const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-2x1T7RD_.js","assets/sha3--8JbGYfk.js","assets/utils-CqP-FaiV.js","assets/clsx.m-DHulAg21.js","assets/index-shx8OlmN.js","assets/events-DQ172AOg.js","assets/index-B8lqC164.js","assets/index-Bgc9HhbY.js","assets/index-g5wIgCDo.js","assets/index.es-DC4scVf0.js"])))=>i.map(i=>d[i]);
var VGe=Object.defineProperty;var hde=e=>{throw TypeError(e)};var WGe=(e,t,n)=>t in e?VGe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Bn=(e,t,n)=>WGe(e,typeof t!="symbol"?t+"":t,n),az=(e,t,n)=>t.has(e)||hde("Cannot "+n);var Ue=(e,t,n)=>(az(e,t,"read from private field"),n?n.call(e):t.get(e)),Ln=(e,t,n)=>t.has(e)?hde("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Wt=(e,t,n,r)=>(az(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),xr=(e,t,n)=>(az(e,t,"access private method"),n);var sb=(e,t,n,r)=>({set _(s){Wt(e,t,s,n)},get _(){return Ue(e,t,r)}});function INe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)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(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var Tu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ki(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function e2n(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var oz={exports:{}},c7={},lz={exports:{}},Ui={};/**
* @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 pde;function qGe(){if(pde)return Ui;pde=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;function x(ae){return ae===null||typeof ae!="object"?null:(ae=f&&ae[f]||ae["@@iterator"],typeof ae=="function"?ae:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,w={};function C(ae,he,Ce){this.props=ae,this.context=he,this.refs=w,this.updater=Ce||g}C.prototype.isReactComponent={},C.prototype.setState=function(ae,he){if(typeof ae!="object"&&typeof ae!="function"&&ae!=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,ae,he,"setState")},C.prototype.forceUpdate=function(ae){this.updater.enqueueForceUpdate(this,ae,"forceUpdate")};function N(){}N.prototype=C.prototype;function I(ae,he,Ce){this.props=ae,this.context=he,this.refs=w,this.updater=Ce||g}var P=I.prototype=new N;P.constructor=I,v(P,C.prototype),P.isPureReactComponent=!0;var R=Array.isArray,F=Object.prototype.hasOwnProperty,U={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function z(ae,he,Ce){var ce,ge={},Ae=null,ye=null;if(he!=null)for(ce in he.ref!==void 0&&(ye=he.ref),he.key!==void 0&&(Ae=""+he.key),he)F.call(he,ce)&&!L.hasOwnProperty(ce)&&(ge[ce]=he[ce]);var je=arguments.length-2;if(je===1)ge.children=Ce;else if(1<je){for(var Ie=Array(je),Re=0;Re<je;Re++)Ie[Re]=arguments[Re+2];ge.children=Ie}if(ae&&ae.defaultProps)for(ce in je=ae.defaultProps,je)ge[ce]===void 0&&(ge[ce]=je[ce]);return{$$typeof:e,type:ae,key:Ae,ref:ye,props:ge,_owner:U.current}}function Q(ae,he){return{$$typeof:e,type:ae.type,key:he,ref:ae.ref,props:ae.props,_owner:ae._owner}}function ne(ae){return typeof ae=="object"&&ae!==null&&ae.$$typeof===e}function J(ae){var he={"=":"=0",":":"=2"};return"$"+ae.replace(/[=:]/g,function(Ce){return he[Ce]})}var X=/\/+/g;function re(ae,he){return typeof ae=="object"&&ae!==null&&ae.key!=null?J(""+ae.key):he.toString(36)}function pe(ae,he,Ce,ce,ge){var Ae=typeof ae;(Ae==="undefined"||Ae==="boolean")&&(ae=null);var ye=!1;if(ae===null)ye=!0;else switch(Ae){case"string":case"number":ye=!0;break;case"object":switch(ae.$$typeof){case e:case t:ye=!0}}if(ye)return ye=ae,ge=ge(ye),ae=ce===""?"."+re(ye,0):ce,R(ge)?(Ce="",ae!=null&&(Ce=ae.replace(X,"$&/")+"/"),pe(ge,he,Ce,"",function(Re){return Re})):ge!=null&&(ne(ge)&&(ge=Q(ge,Ce+(!ge.key||ye&&ye.key===ge.key?"":(""+ge.key).replace(X,"$&/")+"/")+ae)),he.push(ge)),1;if(ye=0,ce=ce===""?".":ce+":",R(ae))for(var je=0;je<ae.length;je++){Ae=ae[je];var Ie=ce+re(Ae,je);ye+=pe(Ae,he,Ce,Ie,ge)}else if(Ie=x(ae),typeof Ie=="function")for(ae=Ie.call(ae),je=0;!(Ae=ae.next()).done;)Ae=Ae.value,Ie=ce+re(Ae,je++),ye+=pe(Ae,he,Ce,Ie,ge);else if(Ae==="object")throw he=String(ae),Error("Objects are not valid as a React child (found: "+(he==="[object Object]"?"object with keys {"+Object.keys(ae).join(", ")+"}":he)+"). If you meant to render a collection of children, use an array instead.");return ye}function Y(ae,he,Ce){if(ae==null)return ae;var ce=[],ge=0;return pe(ae,ce,"","",function(Ae){return he.call(Ce,Ae,ge++)}),ce}function ie(ae){if(ae._status===-1){var he=ae._result;he=he(),he.then(function(Ce){(ae._status===0||ae._status===-1)&&(ae._status=1,ae._result=Ce)},function(Ce){(ae._status===0||ae._status===-1)&&(ae._status=2,ae._result=Ce)}),ae._status===-1&&(ae._status=0,ae._result=he)}if(ae._status===1)return ae._result.default;throw ae._result}var oe={current:null},G={transition:null},V={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:G,ReactCurrentOwner:U};function te(){throw Error("act(...) is not supported in production builds of React.")}return Ui.Children={map:Y,forEach:function(ae,he,Ce){Y(ae,function(){he.apply(this,arguments)},Ce)},count:function(ae){var he=0;return Y(ae,function(){he++}),he},toArray:function(ae){return Y(ae,function(he){return he})||[]},only:function(ae){if(!ne(ae))throw Error("React.Children.only expected to receive a single React element child.");return ae}},Ui.Component=C,Ui.Fragment=n,Ui.Profiler=s,Ui.PureComponent=I,Ui.StrictMode=r,Ui.Suspense=c,Ui.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,Ui.act=te,Ui.cloneElement=function(ae,he,Ce){if(ae==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+ae+".");var ce=v({},ae.props),ge=ae.key,Ae=ae.ref,ye=ae._owner;if(he!=null){if(he.ref!==void 0&&(Ae=he.ref,ye=U.current),he.key!==void 0&&(ge=""+he.key),ae.type&&ae.type.defaultProps)var je=ae.type.defaultProps;for(Ie in he)F.call(he,Ie)&&!L.hasOwnProperty(Ie)&&(ce[Ie]=he[Ie]===void 0&&je!==void 0?je[Ie]:he[Ie])}var Ie=arguments.length-2;if(Ie===1)ce.children=Ce;else if(1<Ie){je=Array(Ie);for(var Re=0;Re<Ie;Re++)je[Re]=arguments[Re+2];ce.children=je}return{$$typeof:e,type:ae.type,key:ge,ref:Ae,props:ce,_owner:ye}},Ui.createContext=function(ae){return ae={$$typeof:o,_currentValue:ae,_currentValue2:ae,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},ae.Provider={$$typeof:a,_context:ae},ae.Consumer=ae},Ui.createElement=z,Ui.createFactory=function(ae){var he=z.bind(null,ae);return he.type=ae,he},Ui.createRef=function(){return{current:null}},Ui.forwardRef=function(ae){return{$$typeof:l,render:ae}},Ui.isValidElement=ne,Ui.lazy=function(ae){return{$$typeof:d,_payload:{_status:-1,_result:ae},_init:ie}},Ui.memo=function(ae,he){return{$$typeof:u,type:ae,compare:he===void 0?null:he}},Ui.startTransition=function(ae){var he=G.transition;G.transition={};try{ae()}finally{G.transition=he}},Ui.unstable_act=te,Ui.useCallback=function(ae,he){return oe.current.useCallback(ae,he)},Ui.useContext=function(ae){return oe.current.useContext(ae)},Ui.useDebugValue=function(){},Ui.useDeferredValue=function(ae){return oe.current.useDeferredValue(ae)},Ui.useEffect=function(ae,he){return oe.current.useEffect(ae,he)},Ui.useId=function(){return oe.current.useId()},Ui.useImperativeHandle=function(ae,he,Ce){return oe.current.useImperativeHandle(ae,he,Ce)},Ui.useInsertionEffect=function(ae,he){return oe.current.useInsertionEffect(ae,he)},Ui.useLayoutEffect=function(ae,he){return oe.current.useLayoutEffect(ae,he)},Ui.useMemo=function(ae,he){return oe.current.useMemo(ae,he)},Ui.useReducer=function(ae,he,Ce){return oe.current.useReducer(ae,he,Ce)},Ui.useRef=function(ae){return oe.current.useRef(ae)},Ui.useState=function(ae){return oe.current.useState(ae)},Ui.useSyncExternalStore=function(ae,he,Ce){return oe.current.useSyncExternalStore(ae,he,Ce)},Ui.useTransition=function(){return oe.current.useTransition()},Ui.version="18.3.1",Ui}var mde;function ax(){return mde||(mde=1,lz.exports=qGe()),lz.exports}/**
* @license React
* react-jsx-runtime.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 xde;function GGe(){if(xde)return c7;xde=1;var e=ax(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,u){var d,f={},x=null,g=null;u!==void 0&&(x=""+u),c.key!==void 0&&(x=""+c.key),c.ref!==void 0&&(g=c.ref);for(d in c)r.call(c,d)&&!a.hasOwnProperty(d)&&(f[d]=c[d]);if(l&&l.defaultProps)for(d in c=l.defaultProps,c)f[d]===void 0&&(f[d]=c[d]);return{$$typeof:t,type:l,key:x,ref:g,props:f,_owner:s.current}}return c7.Fragment=n,c7.jsx=o,c7.jsxs=o,c7}var gde;function KGe(){return gde||(gde=1,oz.exports=GGe()),oz.exports}var i=KGe(),vI={},cz={exports:{}},Od={},uz={exports:{}},dz={};/**
* @license React
* scheduler.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 bde;function YGe(){return bde||(bde=1,function(e){function t(G,V){var te=G.length;G.push(V);e:for(;0<te;){var ae=te-1>>>1,he=G[ae];if(0<s(he,V))G[ae]=V,G[te]=he,te=ae;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var V=G[0],te=G.pop();if(te!==V){G[0]=te;e:for(var ae=0,he=G.length,Ce=he>>>1;ae<Ce;){var ce=2*(ae+1)-1,ge=G[ce],Ae=ce+1,ye=G[Ae];if(0>s(ge,te))Ae<he&&0>s(ye,ge)?(G[ae]=ye,G[Ae]=te,ae=Ae):(G[ae]=ge,G[ce]=te,ae=ce);else if(Ae<he&&0>s(ye,te))G[ae]=ye,G[Ae]=te,ae=Ae;else break e}}return V}function s(G,V){var te=G.sortIndex-V.sortIndex;return te!==0?te:G.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,x=3,g=!1,v=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(G){for(var V=n(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=G)r(u),V.sortIndex=V.expirationTime,t(c,V);else break;V=n(u)}}function R(G){if(w=!1,P(G),!v)if(n(c)!==null)v=!0,ie(F);else{var V=n(u);V!==null&&oe(R,V.startTime-G)}}function F(G,V){v=!1,w&&(w=!1,N(z),z=-1),g=!0;var te=x;try{for(P(V),f=n(c);f!==null&&(!(f.expirationTime>V)||G&&!J());){var ae=f.callback;if(typeof ae=="function"){f.callback=null,x=f.priorityLevel;var he=ae(f.expirationTime<=V);V=e.unstable_now(),typeof he=="function"?f.callback=he:f===n(c)&&r(c),P(V)}else r(c);f=n(c)}if(f!==null)var Ce=!0;else{var ce=n(u);ce!==null&&oe(R,ce.startTime-V),Ce=!1}return Ce}finally{f=null,x=te,g=!1}}var U=!1,L=null,z=-1,Q=5,ne=-1;function J(){return!(e.unstable_now()-ne<Q)}function X(){if(L!==null){var G=e.unstable_now();ne=G;var V=!0;try{V=L(!0,G)}finally{V?re():(U=!1,L=null)}}else U=!1}var re;if(typeof I=="function")re=function(){I(X)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Y=pe.port2;pe.port1.onmessage=X,re=function(){Y.postMessage(null)}}else re=function(){C(X,0)};function ie(G){L=G,U||(U=!0,re())}function oe(G,V){z=C(function(){G(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_continueExecution=function(){v||g||(v=!0,ie(F))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(G){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var te=x;x=V;try{return G()}finally{x=te}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,V){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var te=x;x=G;try{return V()}finally{x=te}},e.unstable_scheduleCallback=function(G,V,te){var ae=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?ae+te:ae):te=ae,G){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=te+he,G={id:d++,callback:V,priorityLevel:G,startTime:te,expirationTime:he,sortIndex:-1},te>ae?(G.sortIndex=te,t(u,G),n(c)===null&&G===n(u)&&(w?(N(z),z=-1):w=!0,oe(R,te-ae))):(G.sortIndex=he,t(c,G),v||g||(v=!0,ie(F))),G},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(G){var V=x;return function(){var te=x;x=V;try{return G.apply(this,arguments)}finally{x=te}}}}(dz)),dz}var yde;function XGe(){return yde||(yde=1,uz.exports=YGe()),uz.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 vde;function QGe(){if(vde)return Od;vde=1;var e=ax(),t=XGe();function n(A){for(var M="https://reactjs.org/docs/error-decoder.html?invariant="+A,Z=1;Z<arguments.length;Z++)M+="&args[]="+encodeURIComponent(arguments[Z]);return"Minified React error #"+A+"; visit "+M+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function a(A,M){o(A,M),o(A+"Capture",M)}function o(A,M){for(s[A]=M,A=0;A<M.length;A++)r.add(M[A])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function x(A){return c.call(f,A)?!0:c.call(d,A)?!1:u.test(A)?f[A]=!0:(d[A]=!0,!1)}function g(A,M,Z,me){if(Z!==null&&Z.type===0)return!1;switch(typeof M){case"function":case"symbol":return!0;case"boolean":return me?!1:Z!==null?!Z.acceptsBooleans:(A=A.toLowerCase().slice(0,5),A!=="data-"&&A!=="aria-");default:return!1}}function v(A,M,Z,me){if(M===null||typeof M>"u"||g(A,M,Z,me))return!0;if(me)return!1;if(Z!==null)switch(Z.type){case 3:return!M;case 4:return M===!1;case 5:return isNaN(M);case 6:return isNaN(M)||1>M}return!1}function w(A,M,Z,me,Pe,ze,Ct){this.acceptsBooleans=M===2||M===3||M===4,this.attributeName=me,this.attributeNamespace=Pe,this.mustUseProperty=Z,this.propertyName=A,this.type=M,this.sanitizeURL=ze,this.removeEmptyString=Ct}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(A){C[A]=new w(A,0,!1,A,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(A){var M=A[0];C[M]=new w(M,1,!1,A[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(A){C[A]=new w(A,2,!1,A.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(A){C[A]=new w(A,2,!1,A,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(A){C[A]=new w(A,3,!1,A.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(A){C[A]=new w(A,3,!0,A,null,!1,!1)}),["capture","download"].forEach(function(A){C[A]=new w(A,4,!1,A,null,!1,!1)}),["cols","rows","size","span"].forEach(function(A){C[A]=new w(A,6,!1,A,null,!1,!1)}),["rowSpan","start"].forEach(function(A){C[A]=new w(A,5,!1,A.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function I(A){return A[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(A){var M=A.replace(N,I);C[M]=new w(M,1,!1,A,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(A){var M=A.replace(N,I);C[M]=new w(M,1,!1,A,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(A){var M=A.replace(N,I);C[M]=new w(M,1,!1,A,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(A){C[A]=new w(A,1,!1,A.toLowerCase(),null,!1,!1)}),C.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(A){C[A]=new w(A,1,!1,A.toLowerCase(),null,!0,!0)});function P(A,M,Z,me){var Pe=C.hasOwnProperty(M)?C[M]:null;(Pe!==null?Pe.type!==0:me||!(2<M.length)||M[0]!=="o"&&M[0]!=="O"||M[1]!=="n"&&M[1]!=="N")&&(v(M,Z,Pe,me)&&(Z=null),me||Pe===null?x(M)&&(Z===null?A.removeAttribute(M):A.setAttribute(M,""+Z)):Pe.mustUseProperty?A[Pe.propertyName]=Z===null?Pe.type===3?!1:"":Z:(M=Pe.attributeName,me=Pe.attributeNamespace,Z===null?A.removeAttribute(M):(Pe=Pe.type,Z=Pe===3||Pe===4&&Z===!0?"":""+Z,me?A.setAttributeNS(me,M,Z):A.setAttribute(M,Z))))}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,F=Symbol.for("react.element"),U=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),ne=Symbol.for("react.provider"),J=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),oe=Symbol.for("react.offscreen"),G=Symbol.iterator;function V(A){return A===null||typeof A!="object"?null:(A=G&&A[G]||A["@@iterator"],typeof A=="function"?A:null)}var te=Object.assign,ae;function he(A){if(ae===void 0)try{throw Error()}catch(Z){var M=Z.stack.trim().match(/\n( *(at )?)/);ae=M&&M[1]||""}return`
`+ae+A}var Ce=!1;function ce(A,M){if(!A||Ce)return"";Ce=!0;var Z=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(M)if(M=function(){throw Error()},Object.defineProperty(M.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(M,[])}catch(ar){var me=ar}Reflect.construct(A,[],M)}else{try{M.call()}catch(ar){me=ar}A.call(M.prototype)}else{try{throw Error()}catch(ar){me=ar}A()}}catch(ar){if(ar&&me&&typeof ar.stack=="string"){for(var Pe=ar.stack.split(`
`),ze=me.stack.split(`
`),Ct=Pe.length-1,pn=ze.length-1;1<=Ct&&0<=pn&&Pe[Ct]!==ze[pn];)pn--;for(;1<=Ct&&0<=pn;Ct--,pn--)if(Pe[Ct]!==ze[pn]){if(Ct!==1||pn!==1)do if(Ct--,pn--,0>pn||Pe[Ct]!==ze[pn]){var kn=`
`+Pe[Ct].replace(" at new "," at ");return A.displayName&&kn.includes("<anonymous>")&&(kn=kn.replace("<anonymous>",A.displayName)),kn}while(1<=Ct&&0<=pn);break}}}finally{Ce=!1,Error.prepareStackTrace=Z}return(A=A?A.displayName||A.name:"")?he(A):""}function ge(A){switch(A.tag){case 5:return he(A.type);case 16:return he("Lazy");case 13:return he("Suspense");case 19:return he("SuspenseList");case 0:case 2:case 15:return A=ce(A.type,!1),A;case 11:return A=ce(A.type.render,!1),A;case 1:return A=ce(A.type,!0),A;default:return""}}function Ae(A){if(A==null)return null;if(typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case L:return"Fragment";case U:return"Portal";case Q:return"Profiler";case z:return"StrictMode";case re:return"Suspense";case pe:return"SuspenseList"}if(typeof A=="object")switch(A.$$typeof){case J:return(A.displayName||"Context")+".Consumer";case ne:return(A._context.displayName||"Context")+".Provider";case X:var M=A.render;return A=A.displayName,A||(A=M.displayName||M.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case Y:return M=A.displayName||null,M!==null?M:Ae(A.type)||"Memo";case ie:M=A._payload,A=A._init;try{return Ae(A(M))}catch{}}return null}function ye(A){var M=A.type;switch(A.tag){case 24:return"Cache";case 9:return(M.displayName||"Context")+".Consumer";case 10:return(M._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return A=M.render,A=A.displayName||A.name||"",M.displayName||(A!==""?"ForwardRef("+A+")":"ForwardRef");case 7:return"Fragment";case 5:return M;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ae(M);case 8:return M===z?"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 M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M}return null}function je(A){switch(typeof A){case"boolean":case"number":case"string":case"undefined":return A;case"object":return A;default:return""}}function Ie(A){var M=A.type;return(A=A.nodeName)&&A.toLowerCase()==="input"&&(M==="checkbox"||M==="radio")}function Re(A){var M=Ie(A)?"checked":"value",Z=Object.getOwnPropertyDescriptor(A.constructor.prototype,M),me=""+A[M];if(!A.hasOwnProperty(M)&&typeof Z<"u"&&typeof Z.get=="function"&&typeof Z.set=="function"){var Pe=Z.get,ze=Z.set;return Object.defineProperty(A,M,{configurable:!0,get:function(){return Pe.call(this)},set:function(Ct){me=""+Ct,ze.call(this,Ct)}}),Object.defineProperty(A,M,{enumerable:Z.enumerable}),{getValue:function(){return me},setValue:function(Ct){me=""+Ct},stopTracking:function(){A._valueTracker=null,delete A[M]}}}}function Qe(A){A._valueTracker||(A._valueTracker=Re(A))}function $e(A){if(!A)return!1;var M=A._valueTracker;if(!M)return!0;var Z=M.getValue(),me="";return A&&(me=Ie(A)?A.checked?"true":"false":A.value),A=me,A!==Z?(M.setValue(A),!0):!1}function it(A){if(A=A||(typeof document<"u"?document:void 0),typeof A>"u")return null;try{return A.activeElement||A.body}catch{return A.body}}function tt(A,M){var Z=M.checked;return te({},M,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:Z??A._wrapperState.initialChecked})}function ot(A,M){var Z=M.defaultValue==null?"":M.defaultValue,me=M.checked!=null?M.checked:M.defaultChecked;Z=je(M.value!=null?M.value:Z),A._wrapperState={initialChecked:me,initialValue:Z,controlled:M.type==="checkbox"||M.type==="radio"?M.checked!=null:M.value!=null}}function ft(A,M){M=M.checked,M!=null&&P(A,"checked",M,!1)}function ct(A,M){ft(A,M);var Z=je(M.value),me=M.type;if(Z!=null)me==="number"?(Z===0&&A.value===""||A.value!=Z)&&(A.value=""+Z):A.value!==""+Z&&(A.value=""+Z);else if(me==="submit"||me==="reset"){A.removeAttribute("value");return}M.hasOwnProperty("value")?It(A,M.type,Z):M.hasOwnProperty("defaultValue")&&It(A,M.type,je(M.defaultValue)),M.checked==null&&M.defaultChecked!=null&&(A.defaultChecked=!!M.defaultChecked)}function Vt(A,M,Z){if(M.hasOwnProperty("value")||M.hasOwnProperty("defaultValue")){var me=M.type;if(!(me!=="submit"&&me!=="reset"||M.value!==void 0&&M.value!==null))return;M=""+A._wrapperState.initialValue,Z||M===A.value||(A.value=M),A.defaultValue=M}Z=A.name,Z!==""&&(A.name=""),A.defaultChecked=!!A._wrapperState.initialChecked,Z!==""&&(A.name=Z)}function It(A,M,Z){(M!=="number"||it(A.ownerDocument)!==A)&&(Z==null?A.defaultValue=""+A._wrapperState.initialValue:A.defaultValue!==""+Z&&(A.defaultValue=""+Z))}var an=Array.isArray;function Nt(A,M,Z,me){if(A=A.options,M){M={};for(var Pe=0;Pe<Z.length;Pe++)M["$"+Z[Pe]]=!0;for(Z=0;Z<A.length;Z++)Pe=M.hasOwnProperty("$"+A[Z].value),A[Z].selected!==Pe&&(A[Z].selected=Pe),Pe&&me&&(A[Z].defaultSelected=!0)}else{for(Z=""+je(Z),M=null,Pe=0;Pe<A.length;Pe++){if(A[Pe].value===Z){A[Pe].selected=!0,me&&(A[Pe].defaultSelected=!0);return}M!==null||A[Pe].disabled||(M=A[Pe])}M!==null&&(M.selected=!0)}}function mn(A,M){if(M.dangerouslySetInnerHTML!=null)throw Error(n(91));return te({},M,{value:void 0,defaultValue:void 0,children:""+A._wrapperState.initialValue})}function dn(A,M){var Z=M.value;if(Z==null){if(Z=M.children,M=M.defaultValue,Z!=null){if(M!=null)throw Error(n(92));if(an(Z)){if(1<Z.length)throw Error(n(93));Z=Z[0]}M=Z}M==null&&(M=""),Z=M}A._wrapperState={initialValue:je(Z)}}function Pt(A,M){var Z=je(M.value),me=je(M.defaultValue);Z!=null&&(Z=""+Z,Z!==A.value&&(A.value=Z),M.defaultValue==null&&A.defaultValue!==Z&&(A.defaultValue=Z)),me!=null&&(A.defaultValue=""+me)}function Xe(A){var M=A.textContent;M===A._wrapperState.initialValue&&M!==""&&M!==null&&(A.value=M)}function Ut(A){switch(A){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Lt(A,M){return A==null||A==="http://www.w3.org/1999/xhtml"?Ut(M):A==="http://www.w3.org/2000/svg"&&M==="foreignObject"?"http://www.w3.org/1999/xhtml":A}var qe,Ke=function(A){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(M,Z,me,Pe){MSApp.execUnsafeLocalFunction(function(){return A(M,Z,me,Pe)})}:A}(function(A,M){if(A.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in A)A.innerHTML=M;else{for(qe=qe||document.createElement("div"),qe.innerHTML="<svg>"+M.valueOf().toString()+"</svg>",M=qe.firstChild;A.firstChild;)A.removeChild(A.firstChild);for(;M.firstChild;)A.appendChild(M.firstChild)}});function pt(A,M){if(M){var Z=A.firstChild;if(Z&&Z===A.lastChild&&Z.nodeType===3){Z.nodeValue=M;return}}A.textContent=M}var en={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},Bt=["Webkit","ms","Moz","O"];Object.keys(en).forEach(function(A){Bt.forEach(function(M){M=M+A.charAt(0).toUpperCase()+A.substring(1),en[M]=en[A]})});function Et(A,M,Z){return M==null||typeof M=="boolean"||M===""?"":Z||typeof M!="number"||M===0||en.hasOwnProperty(A)&&en[A]?(""+M).trim():M+"px"}function et(A,M){A=A.style;for(var Z in M)if(M.hasOwnProperty(Z)){var me=Z.indexOf("--")===0,Pe=Et(Z,M[Z],me);Z==="float"&&(Z="cssFloat"),me?A.setProperty(Z,Pe):A[Z]=Pe}}var Be=te({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 Mt(A,M){if(M){if(Be[A]&&(M.children!=null||M.dangerouslySetInnerHTML!=null))throw Error(n(137,A));if(M.dangerouslySetInnerHTML!=null){if(M.children!=null)throw Error(n(60));if(typeof M.dangerouslySetInnerHTML!="object"||!("__html"in M.dangerouslySetInnerHTML))throw Error(n(61))}if(M.style!=null&&typeof M.style!="object")throw Error(n(62))}}function Ve(A,M){if(A.indexOf("-")===-1)return typeof M.is=="string";switch(A){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 ut=null;function xt(A){return A=A.target||A.srcElement||window,A.correspondingUseElement&&(A=A.correspondingUseElement),A.nodeType===3?A.parentNode:A}var jt=null,kt=null,xn=null;function un(A){if(A=fc(A)){if(typeof jt!="function")throw Error(n(280));var M=A.stateNode;M&&(M=D5(M),jt(A.stateNode,A.type,M))}}function On(A){kt?xn?xn.push(A):xn=[A]:kt=A}function En(){if(kt){var A=kt,M=xn;if(xn=kt=null,un(A),M)for(A=0;A<M.length;A++)un(M[A])}}function jn(A,M){return A(M)}function bn(){}var Zn=!1;function zn(A,M,Z){if(Zn)return A(M,Z);Zn=!0;try{return jn(A,M,Z)}finally{Zn=!1,(kt!==null||xn!==null)&&(bn(),En())}}function $n(A,M){var Z=A.stateNode;if(Z===null)return null;var me=D5(Z);if(me===null)return null;Z=me[M];e:switch(M){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(me=!me.disabled)||(A=A.type,me=!(A==="button"||A==="input"||A==="select"||A==="textarea")),A=!me;break e;default:A=!1}if(A)return null;if(Z&&typeof Z!="function")throw Error(n(231,M,typeof Z));return Z}var nr=!1;if(l)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){nr=!0}}),window.addEventListener("test",wn,wn),window.removeEventListener("test",wn,wn)}catch{nr=!1}function on(A,M,Z,me,Pe,ze,Ct,pn,kn){var ar=Array.prototype.slice.call(arguments,3);try{M.apply(Z,ar)}catch($r){this.onError($r)}}var Oe=!1,rn=null,cn=!1,_t=null,Yn={onError:function(A){Oe=!0,rn=A}};function yn(A,M,Z,me,Pe,ze,Ct,pn,kn){Oe=!1,rn=null,on.apply(Yn,arguments)}function Dt(A,M,Z,me,Pe,ze,Ct,pn,kn){if(yn.apply(this,arguments),Oe){if(Oe){var ar=rn;Oe=!1,rn=null}else throw Error(n(198));cn||(cn=!0,_t=ar)}}function sn(A){var M=A,Z=A;if(A.alternate)for(;M.return;)M=M.return;else{A=M;do M=A,M.flags&4098&&(Z=M.return),A=M.return;while(A)}return M.tag===3?Z:null}function Tn(A){if(A.tag===13){var M=A.memoizedState;if(M===null&&(A=A.alternate,A!==null&&(M=A.memoizedState)),M!==null)return M.dehydrated}return null}function Kn(A){if(sn(A)!==A)throw Error(n(188))}function ir(A){var M=A.alternate;if(!M){if(M=sn(A),M===null)throw Error(n(188));return M!==A?null:A}for(var Z=A,me=M;;){var Pe=Z.return;if(Pe===null)break;var ze=Pe.alternate;if(ze===null){if(me=Pe.return,me!==null){Z=me;continue}break}if(Pe.child===ze.child){for(ze=Pe.child;ze;){if(ze===Z)return Kn(Pe),A;if(ze===me)return Kn(Pe),M;ze=ze.sibling}throw Error(n(188))}if(Z.return!==me.return)Z=Pe,me=ze;else{for(var Ct=!1,pn=Pe.child;pn;){if(pn===Z){Ct=!0,Z=Pe,me=ze;break}if(pn===me){Ct=!0,me=Pe,Z=ze;break}pn=pn.sibling}if(!Ct){for(pn=ze.child;pn;){if(pn===Z){Ct=!0,Z=ze,me=Pe;break}if(pn===me){Ct=!0,me=ze,Z=Pe;break}pn=pn.sibling}if(!Ct)throw Error(n(189))}}if(Z.alternate!==me)throw Error(n(190))}if(Z.tag!==3)throw Error(n(188));return Z.stateNode.current===Z?A:M}function rr(A){return A=ir(A),A!==null?Jt(A):null}function Jt(A){if(A.tag===5||A.tag===6)return A;for(A=A.child;A!==null;){var M=Jt(A);if(M!==null)return M;A=A.sibling}return null}var Un=t.unstable_scheduleCallback,Qn=t.unstable_cancelCallback,Rt=t.unstable_shouldYield,Pn=t.unstable_requestPaint,Ee=t.unstable_now,p=t.unstable_getCurrentPriorityLevel,h=t.unstable_ImmediatePriority,S=t.unstable_UserBlockingPriority,_=t.unstable_NormalPriority,k=t.unstable_LowPriority,T=t.unstable_IdlePriority,B=null,W=null;function ee(A){if(W&&typeof W.onCommitFiberRoot=="function")try{W.onCommitFiberRoot(B,A,void 0,(A.current.flags&128)===128)}catch{}}var de=Math.clz32?Math.clz32:we,fe=Math.log,xe=Math.LN2;function we(A){return A>>>=0,A===0?32:31-(fe(A)/xe|0)|0}var ke=64,Me=4194304;function Ye(A){switch(A&-A){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 A&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return A&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return A}}function Fe(A,M){var Z=A.pendingLanes;if(Z===0)return 0;var me=0,Pe=A.suspendedLanes,ze=A.pingedLanes,Ct=Z&268435455;if(Ct!==0){var pn=Ct&~Pe;pn!==0?me=Ye(pn):(ze&=Ct,ze!==0&&(me=Ye(ze)))}else Ct=Z&~Pe,Ct!==0?me=Ye(Ct):ze!==0&&(me=Ye(ze));if(me===0)return 0;if(M!==0&&M!==me&&!(M&Pe)&&(Pe=me&-me,ze=M&-M,Pe>=ze||Pe===16&&(ze&4194240)!==0))return M;if(me&4&&(me|=Z&16),M=A.entangledLanes,M!==0)for(A=A.entanglements,M&=me;0<M;)Z=31-de(M),Pe=1<<Z,me|=A[Z],M&=~Pe;return me}function st(A,M){switch(A){case 1:case 2:case 4:return M+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return M+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function se(A,M){for(var Z=A.suspendedLanes,me=A.pingedLanes,Pe=A.expirationTimes,ze=A.pendingLanes;0<ze;){var Ct=31-de(ze),pn=1<<Ct,kn=Pe[Ct];kn===-1?(!(pn&Z)||pn&me)&&(Pe[Ct]=st(pn,M)):kn<=M&&(A.expiredLanes|=pn),ze&=~pn}}function Se(A){return A=A.pendingLanes&-1073741825,A!==0?A:A&1073741824?1073741824:0}function De(){var A=ke;return ke<<=1,!(ke&4194240)&&(ke=64),A}function Le(A){for(var M=[],Z=0;31>Z;Z++)M.push(A);return M}function _e(A,M,Z){A.pendingLanes|=M,M!==536870912&&(A.suspendedLanes=0,A.pingedLanes=0),A=A.eventTimes,M=31-de(M),A[M]=Z}function nt(A,M){var Z=A.pendingLanes&~M;A.pendingLanes=M,A.suspendedLanes=0,A.pingedLanes=0,A.expiredLanes&=M,A.mutableReadLanes&=M,A.entangledLanes&=M,M=A.entanglements;var me=A.eventTimes;for(A=A.expirationTimes;0<Z;){var Pe=31-de(Z),ze=1<<Pe;M[Pe]=0,me[Pe]=-1,A[Pe]=-1,Z&=~ze}}function lt(A,M){var Z=A.entangledLanes|=M;for(A=A.entanglements;Z;){var me=31-de(Z),Pe=1<<me;Pe&M|A[me]&M&&(A[me]|=M),Z&=~Pe}}var bt=0;function Zt(A){return A&=-A,1<A?4<A?A&268435455?16:536870912:4:1}var Ge,Je,We,wt,At,Gt=!1,fn=[],Rn=null,An=null,pr=null,mt=new Map,qt=new Map,Qt=[],In="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function or(A,M){switch(A){case"focusin":case"focusout":Rn=null;break;case"dragenter":case"dragleave":An=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":mt.delete(M.pointerId);break;case"gotpointercapture":case"lostpointercapture":qt.delete(M.pointerId)}}function Wn(A,M,Z,me,Pe,ze){return A===null||A.nativeEvent!==ze?(A={blockedOn:M,domEventName:Z,eventSystemFlags:me,nativeEvent:ze,targetContainers:[Pe]},M!==null&&(M=fc(M),M!==null&&Je(M)),A):(A.eventSystemFlags|=me,M=A.targetContainers,Pe!==null&&M.indexOf(Pe)===-1&&M.push(Pe),A)}function Vn(A,M,Z,me,Pe){switch(M){case"focusin":return Rn=Wn(Rn,A,M,Z,me,Pe),!0;case"dragenter":return An=Wn(An,A,M,Z,me,Pe),!0;case"mouseover":return pr=Wn(pr,A,M,Z,me,Pe),!0;case"pointerover":var ze=Pe.pointerId;return mt.set(ze,Wn(mt.get(ze)||null,A,M,Z,me,Pe)),!0;case"gotpointercapture":return ze=Pe.pointerId,qt.set(ze,Wn(qt.get(ze)||null,A,M,Z,me,Pe)),!0}return!1}function gr(A){var M=th(A.target);if(M!==null){var Z=sn(M);if(Z!==null){if(M=Z.tag,M===13){if(M=Tn(Z),M!==null){A.blockedOn=M,At(A.priority,function(){We(Z)});return}}else if(M===3&&Z.stateNode.current.memoizedState.isDehydrated){A.blockedOn=Z.tag===3?Z.stateNode.containerInfo:null;return}}}A.blockedOn=null}function Ir(A){if(A.blockedOn!==null)return!1;for(var M=A.targetContainers;0<M.length;){var Z=Yr(A.domEventName,A.eventSystemFlags,M[0],A.nativeEvent);if(Z===null){Z=A.nativeEvent;var me=new Z.constructor(Z.type,Z);ut=me,Z.target.dispatchEvent(me),ut=null}else return M=fc(Z),M!==null&&Je(M),A.blockedOn=Z,!1;M.shift()}return!0}function Fr(A,M,Z){Ir(A)&&Z.delete(M)}function Lr(){Gt=!1,Rn!==null&&Ir(Rn)&&(Rn=null),An!==null&&Ir(An)&&(An=null),pr!==null&&Ir(pr)&&(pr=null),mt.forEach(Fr),qt.forEach(Fr)}function Ht(A,M){A.blockedOn===M&&(A.blockedOn=null,Gt||(Gt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lr)))}function nn(A){function M(Pe){return Ht(Pe,A)}if(0<fn.length){Ht(fn[0],A);for(var Z=1;Z<fn.length;Z++){var me=fn[Z];me.blockedOn===A&&(me.blockedOn=null)}}for(Rn!==null&&Ht(Rn,A),An!==null&&Ht(An,A),pr!==null&&Ht(pr,A),mt.forEach(M),qt.forEach(M),Z=0;Z<Qt.length;Z++)me=Qt[Z],me.blockedOn===A&&(me.blockedOn=null);for(;0<Qt.length&&(Z=Qt[0],Z.blockedOn===null);)gr(Z),Z.blockedOn===null&&Qt.shift()}var Sr=R.ReactCurrentBatchConfig,Br=!0;function Kr(A,M,Z,me){var Pe=bt,ze=Sr.transition;Sr.transition=null;try{bt=1,ms(A,M,Z,me)}finally{bt=Pe,Sr.transition=ze}}function As(A,M,Z,me){var Pe=bt,ze=Sr.transition;Sr.transition=null;try{bt=4,ms(A,M,Z,me)}finally{bt=Pe,Sr.transition=ze}}function ms(A,M,Z,me){if(Br){var Pe=Yr(A,M,Z,me);if(Pe===null)f8(A,M,me,vr,Z),or(A,me);else if(Vn(Pe,A,M,Z,me))me.stopPropagation();else if(or(A,me),M&4&&-1<In.indexOf(A)){for(;Pe!==null;){var ze=fc(Pe);if(ze!==null&&Ge(ze),ze=Yr(A,M,Z,me),ze===null&&f8(A,M,me,vr,Z),ze===Pe)break;Pe=ze}Pe!==null&&me.stopPropagation()}else f8(A,M,me,null,Z)}}var vr=null;function Yr(A,M,Z,me){if(vr=null,A=xt(me),A=th(A),A!==null)if(M=sn(A),M===null)A=null;else if(Z=M.tag,Z===13){if(A=Tn(M),A!==null)return A;A=null}else if(Z===3){if(M.stateNode.current.memoizedState.isDehydrated)return M.tag===3?M.stateNode.containerInfo:null;A=null}else M!==A&&(A=null);return vr=A,null}function vi(A){switch(A){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(p()){case h:return 1;case S:return 4;case _:case k:return 16;case T:return 536870912;default:return 16}default:return 16}}var _r=null,os=null,Gs=null;function mi(){if(Gs)return Gs;var A,M=os,Z=M.length,me,Pe="value"in _r?_r.value:_r.textContent,ze=Pe.length;for(A=0;A<Z&&M[A]===Pe[A];A++);var Ct=Z-A;for(me=1;me<=Ct&&M[Z-me]===Pe[ze-me];me++);return Gs=Pe.slice(A,1<me?1-me:void 0)}function ns(A){var M=A.keyCode;return"charCode"in A?(A=A.charCode,A===0&&M===13&&(A=13)):A=M,A===10&&(A=13),32<=A||A===13?A:0}function Xt(){return!0}function ue(){return!1}function rt(A){function M(Z,me,Pe,ze,Ct){this._reactName=Z,this._targetInst=Pe,this.type=me,this.nativeEvent=ze,this.target=Ct,this.currentTarget=null;for(var pn in A)A.hasOwnProperty(pn)&&(Z=A[pn],this[pn]=Z?Z(ze):ze[pn]);return this.isDefaultPrevented=(ze.defaultPrevented!=null?ze.defaultPrevented:ze.returnValue===!1)?Xt:ue,this.isPropagationStopped=ue,this}return te(M.prototype,{preventDefault:function(){this.defaultPrevented=!0;var Z=this.nativeEvent;Z&&(Z.preventDefault?Z.preventDefault():typeof Z.returnValue!="unknown"&&(Z.returnValue=!1),this.isDefaultPrevented=Xt)},stopPropagation:function(){var Z=this.nativeEvent;Z&&(Z.stopPropagation?Z.stopPropagation():typeof Z.cancelBubble!="unknown"&&(Z.cancelBubble=!0),this.isPropagationStopped=Xt)},persist:function(){},isPersistent:Xt}),M}var Ft={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(A){return A.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yt=rt(Ft),hn=te({},Ft,{view:0,detail:0}),vn=rt(hn),lr,Nr,fr,cr=te({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kr,button:0,buttons:0,relatedTarget:function(A){return A.relatedTarget===void 0?A.fromElement===A.srcElement?A.toElement:A.fromElement:A.relatedTarget},movementX:function(A){return"movementX"in A?A.movementX:(A!==fr&&(fr&&A.type==="mousemove"?(lr=A.screenX-fr.screenX,Nr=A.screenY-fr.screenY):Nr=lr=0,fr=A),lr)},movementY:function(A){return"movementY"in A?A.movementY:Nr}}),ts=rt(cr),is=te({},cr,{dataTransfer:0}),Or=rt(is),hr=te({},hn,{relatedTarget:0}),Jn=rt(hr),vs=te({},Ft,{animationName:0,elapsedTime:0,pseudoElement:0}),si=rt(vs),ni=te({},Ft,{clipboardData:function(A){return"clipboardData"in A?A.clipboardData:window.clipboardData}}),Er=rt(ni),Sn=te({},Ft,{data:0}),Mn=rt(Sn),at={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zt={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},er={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qn(A){var M=this.nativeEvent;return M.getModifierState?M.getModifierState(A):(A=er[A])?!!M[A]:!1}function kr(){return qn}var Ar=te({},hn,{key:function(A){if(A.key){var M=at[A.key]||A.key;if(M!=="Unidentified")return M}return A.type==="keypress"?(A=ns(A),A===13?"Enter":String.fromCharCode(A)):A.type==="keydown"||A.type==="keyup"?zt[A.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kr,charCode:function(A){return A.type==="keypress"?ns(A):0},keyCode:function(A){return A.type==="keydown"||A.type==="keyup"?A.keyCode:0},which:function(A){return A.type==="keypress"?ns(A):A.type==="keydown"||A.type==="keyup"?A.keyCode:0}}),Zr=rt(Ar),Fs=te({},cr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),St=rt(Fs),sr=te({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kr}),Hn=rt(sr),zr=te({},Ft,{propertyName:0,elapsedTime:0,pseudoElement:0}),as=rt(zr),rs=te({},cr,{deltaX:function(A){return"deltaX"in A?A.deltaX:"wheelDeltaX"in A?-A.wheelDeltaX:0},deltaY:function(A){return"deltaY"in A?A.deltaY:"wheelDeltaY"in A?-A.wheelDeltaY:"wheelDelta"in A?-A.wheelDelta:0},deltaZ:0,deltaMode:0}),hs=rt(rs),ps=[9,13,27,32],Bi=l&&"CompositionEvent"in window,Ls=null;l&&"documentMode"in document&&(Ls=document.documentMode);var xs=l&&"TextEvent"in window&&!Ls,jr=l&&(!Bi||Ls&&8<Ls&&11>=Ls),ga=" ",El=!1;function _l(A,M){switch(A){case"keyup":return ps.indexOf(M.keyCode)!==-1;case"keydown":return M.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bu(A){return A=A.detail,typeof A=="object"&&"data"in A?A.data:null}var ba=!1;function kl(A,M){switch(A){case"compositionend":return Bu(M);case"keypress":return M.which!==32?null:(El=!0,ga);case"textInput":return A=M.data,A===ga&&El?null:A;default:return null}}function px(A,M){if(ba)return A==="compositionend"||!Bi&&_l(A,M)?(A=mi(),Gs=os=_r=null,ba=!1,A):null;switch(A){case"paste":return null;case"keypress":if(!(M.ctrlKey||M.altKey||M.metaKey)||M.ctrlKey&&M.altKey){if(M.char&&1<M.char.length)return M.char;if(M.which)return String.fromCharCode(M.which)}return null;case"compositionend":return jr&&M.locale!=="ko"?null:M.data;default:return null}}var $u={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xi(A){var M=A&&A.nodeName&&A.nodeName.toLowerCase();return M==="input"?!!$u[A.type]:M==="textarea"}function yd(A,M,Z,me){On(me),M=O5(M,"onChange"),0<M.length&&(Z=new yt("onChange","change",null,Z,me),A.push({event:Z,listeners:M}))}var dt=null,y=null;function E(A){ET(A,0)}function O(A){var M=wi(A);if($e(M))return A}function $(A,M){if(A==="change")return M}var H=!1;if(l){var K;if(l){var le="oninput"in document;if(!le){var ve=document.createElement("div");ve.setAttribute("oninput","return;"),le=typeof ve.oninput=="function"}K=le}else K=!1;H=K&&(!document.documentMode||9<document.documentMode)}function Te(){dt&&(dt.detachEvent("onpropertychange",Ze),y=dt=null)}function Ze(A){if(A.propertyName==="value"&&O(y)){var M=[];yd(M,y,A,xt(A)),zn(E,M)}}function ht(A,M,Z){A==="focusin"?(Te(),dt=M,y=Z,dt.attachEvent("onpropertychange",Ze)):A==="focusout"&&Te()}function Tt(A){if(A==="selectionchange"||A==="keyup"||A==="keydown")return O(y)}function tn(A,M){if(A==="click")return O(M)}function vt(A,M){if(A==="input"||A==="change")return O(M)}function $t(A,M){return A===M&&(A!==0||1/A===1/M)||A!==A&&M!==M}var Kt=typeof Object.is=="function"?Object.is:$t;function _n(A,M){if(Kt(A,M))return!0;if(typeof A!="object"||A===null||typeof M!="object"||M===null)return!1;var Z=Object.keys(A),me=Object.keys(M);if(Z.length!==me.length)return!1;for(me=0;me<Z.length;me++){var Pe=Z[me];if(!c.call(M,Pe)||!Kt(A[Pe],M[Pe]))return!1}return!0}function ur(A){for(;A&&A.firstChild;)A=A.firstChild;return A}function br(A,M){var Z=ur(A);A=0;for(var me;Z;){if(Z.nodeType===3){if(me=A+Z.textContent.length,A<=M&&me>=M)return{node:Z,offset:M-A};A=me}e:{for(;Z;){if(Z.nextSibling){Z=Z.nextSibling;break e}Z=Z.parentNode}Z=void 0}Z=ur(Z)}}function wr(A,M){return A&&M?A===M?!0:A&&A.nodeType===3?!1:M&&M.nodeType===3?wr(A,M.parentNode):"contains"in A?A.contains(M):A.compareDocumentPosition?!!(A.compareDocumentPosition(M)&16):!1:!1}function ws(){for(var A=window,M=it();M instanceof A.HTMLIFrameElement;){try{var Z=typeof M.contentWindow.location.href=="string"}catch{Z=!1}if(Z)A=M.contentWindow;else break;M=it(A.document)}return M}function Ks(A){var M=A&&A.nodeName&&A.nodeName.toLowerCase();return M&&(M==="input"&&(A.type==="text"||A.type==="search"||A.type==="tel"||A.type==="url"||A.type==="password")||M==="textarea"||A.contentEditable==="true")}function uc(A){var M=ws(),Z=A.focusedElem,me=A.selectionRange;if(M!==Z&&Z&&Z.ownerDocument&&wr(Z.ownerDocument.documentElement,Z)){if(me!==null&&Ks(Z)){if(M=me.start,A=me.end,A===void 0&&(A=M),"selectionStart"in Z)Z.selectionStart=M,Z.selectionEnd=Math.min(A,Z.value.length);else if(A=(M=Z.ownerDocument||document)&&M.defaultView||window,A.getSelection){A=A.getSelection();var Pe=Z.textContent.length,ze=Math.min(me.start,Pe);me=me.end===void 0?ze:Math.min(me.end,Pe),!A.extend&&ze>me&&(Pe=me,me=ze,ze=Pe),Pe=br(Z,ze);var Ct=br(Z,me);Pe&&Ct&&(A.rangeCount!==1||A.anchorNode!==Pe.node||A.anchorOffset!==Pe.offset||A.focusNode!==Ct.node||A.focusOffset!==Ct.offset)&&(M=M.createRange(),M.setStart(Pe.node,Pe.offset),A.removeAllRanges(),ze>me?(A.addRange(M),A.extend(Ct.node,Ct.offset)):(M.setEnd(Ct.node,Ct.offset),A.addRange(M)))}}for(M=[],A=Z;A=A.parentNode;)A.nodeType===1&&M.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<M.length;Z++)A=M[Z],A.element.scrollLeft=A.left,A.element.scrollTop=A.top}}var Za=l&&"documentMode"in document&&11>=document.documentMode,Ja=null,da=null,_a=null,Vo=!1;function vd(A,M,Z){var me=Z.window===Z?Z.document:Z.nodeType===9?Z:Z.ownerDocument;Vo||Ja==null||Ja!==it(me)||(me=Ja,"selectionStart"in me&&Ks(me)?me={start:me.selectionStart,end:me.selectionEnd}:(me=(me.ownerDocument&&me.ownerDocument.defaultView||window).getSelection(),me={anchorNode:me.anchorNode,anchorOffset:me.anchorOffset,focusNode:me.focusNode,focusOffset:me.focusOffset}),_a&&_n(_a,me)||(_a=me,me=O5(da,"onSelect"),0<me.length&&(M=new yt("onSelect","select",null,M,Z),A.push({event:M,listeners:me}),M.target=Ja)))}function Ii(A,M){var Z={};return Z[A.toLowerCase()]=M.toLowerCase(),Z["Webkit"+A]="webkit"+M,Z["Moz"+A]="moz"+M,Z}var Em={animationend:Ii("Animation","AnimationEnd"),animationiteration:Ii("Animation","AnimationIteration"),animationstart:Ii("Animation","AnimationStart"),transitionend:Ii("Transition","TransitionEnd")},P1={},S2={};l&&(S2=document.createElement("div").style,"AnimationEvent"in window||(delete Em.animationend.animation,delete Em.animationiteration.animation,delete Em.animationstart.animation),"TransitionEvent"in window||delete Em.transitionend.transition);function k5(A){if(P1[A])return P1[A];if(!Em[A])return A;var M=Em[A],Z;for(Z in M)if(M.hasOwnProperty(Z)&&Z in S2)return P1[A]=M[Z];return A}var NT=k5("animationend"),AT=k5("animationiteration"),N2=k5("animationstart"),mp=k5("transitionend"),A2=new Map,u8="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function hf(A,M){A2.set(A,M),a(M,[A])}for(var T5=0;T5<u8.length;T5++){var I5=u8[T5],P5=I5.toLowerCase(),jT=I5[0].toUpperCase()+I5.slice(1);hf(P5,"on"+jT)}hf(NT,"onAnimationEnd"),hf(AT,"onAnimationIteration"),hf(N2,"onAnimationStart"),hf("dblclick","onDoubleClick"),hf("focusin","onFocus"),hf("focusout","onBlur"),hf(mp,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xp="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mx=new Set("cancel close invalid load scroll toggle".split(" ").concat(xp));function j2(A,M,Z){var me=A.type||"unknown-event";A.currentTarget=Z,Dt(me,M,void 0,A),A.currentTarget=null}function ET(A,M){M=(M&4)!==0;for(var Z=0;Z<A.length;Z++){var me=A[Z],Pe=me.event;me=me.listeners;e:{var ze=void 0;if(M)for(var Ct=me.length-1;0<=Ct;Ct--){var pn=me[Ct],kn=pn.instance,ar=pn.currentTarget;if(pn=pn.listener,kn!==ze&&Pe.isPropagationStopped())break e;j2(Pe,pn,ar),ze=kn}else for(Ct=0;Ct<me.length;Ct++){if(pn=me[Ct],kn=pn.instance,ar=pn.currentTarget,pn=pn.listener,kn!==ze&&Pe.isPropagationStopped())break e;j2(Pe,pn,ar),ze=kn}}}if(cn)throw A=_t,cn=!1,_t=null,A}function Wa(A,M){var Z=M[L5];Z===void 0&&(Z=M[L5]=new Set);var me=A+"__bubble";Z.has(me)||(F5(M,A,2,!1),Z.add(me))}function d8(A,M,Z){var me=0;M&&(me|=4),F5(Z,A,me,M)}var xx="_reactListening"+Math.random().toString(36).slice(2);function _m(A){if(!A[xx]){A[xx]=!0,r.forEach(function(Z){Z!=="selectionchange"&&(mx.has(Z)||d8(Z,!1,A),d8(Z,!0,A))});var M=A.nodeType===9?A:A.ownerDocument;M===null||M[xx]||(M[xx]=!0,d8("selectionchange",!1,M))}}function F5(A,M,Z,me){switch(vi(M)){case 1:var Pe=Kr;break;case 4:Pe=As;break;default:Pe=ms}Z=Pe.bind(null,M,Z,A),Pe=void 0,!nr||M!=="touchstart"&&M!=="touchmove"&&M!=="wheel"||(Pe=!0),me?Pe!==void 0?A.addEventListener(M,Z,{capture:!0,passive:Pe}):A.addEventListener(M,Z,!0):Pe!==void 0?A.addEventListener(M,Z,{passive:Pe}):A.addEventListener(M,Z,!1)}function f8(A,M,Z,me,Pe){var ze=me;if(!(M&1)&&!(M&2)&&me!==null)e:for(;;){if(me===null)return;var Ct=me.tag;if(Ct===3||Ct===4){var pn=me.stateNode.containerInfo;if(pn===Pe||pn.nodeType===8&&pn.parentNode===Pe)break;if(Ct===4)for(Ct=me.return;Ct!==null;){var kn=Ct.tag;if((kn===3||kn===4)&&(kn=Ct.stateNode.containerInfo,kn===Pe||kn.nodeType===8&&kn.parentNode===Pe))return;Ct=Ct.return}for(;pn!==null;){if(Ct=th(pn),Ct===null)return;if(kn=Ct.tag,kn===5||kn===6){me=ze=Ct;continue e}pn=pn.parentNode}}me=me.return}zn(function(){var ar=ze,$r=xt(Z),Hr=[];e:{var Dr=A2.get(A);if(Dr!==void 0){var us=yt,Cs=A;switch(A){case"keypress":if(ns(Z)===0)break e;case"keydown":case"keyup":us=Zr;break;case"focusin":Cs="focus",us=Jn;break;case"focusout":Cs="blur",us=Jn;break;case"beforeblur":case"afterblur":us=Jn;break;case"click":if(Z.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":us=ts;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":us=Or;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":us=Hn;break;case NT:case AT:case N2:us=si;break;case mp:us=as;break;case"scroll":us=vn;break;case"wheel":us=hs;break;case"copy":case"cut":case"paste":us=Er;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":us=St}var _s=(M&4)!==0,No=!_s&&A==="scroll",Xn=_s?Dr!==null?Dr+"Capture":null:Dr;_s=[];for(var Dn=ar,tr;Dn!==null;){tr=Dn;var Gr=tr.stateNode;if(tr.tag===5&&Gr!==null&&(tr=Gr,Xn!==null&&(Gr=$n(Dn,Xn),Gr!=null&&_s.push(F1(Dn,Gr,tr)))),No)break;Dn=Dn.return}0<_s.length&&(Dr=new us(Dr,Cs,null,Z,$r),Hr.push({event:Dr,listeners:_s}))}}if(!(M&7)){e:{if(Dr=A==="mouseover"||A==="pointerover",us=A==="mouseout"||A==="pointerout",Dr&&Z!==ut&&(Cs=Z.relatedTarget||Z.fromElement)&&(th(Cs)||Cs[Uu]))break e;if((us||Dr)&&(Dr=$r.window===$r?$r:(Dr=$r.ownerDocument)?Dr.defaultView||Dr.parentWindow:window,us?(Cs=Z.relatedTarget||Z.toElement,us=ar,Cs=Cs?th(Cs):null,Cs!==null&&(No=sn(Cs),Cs!==No||Cs.tag!==5&&Cs.tag!==6)&&(Cs=null)):(us=null,Cs=ar),us!==Cs)){if(_s=ts,Gr="onMouseLeave",Xn="onMouseEnter",Dn="mouse",(A==="pointerout"||A==="pointerover")&&(_s=St,Gr="onPointerLeave",Xn="onPointerEnter",Dn="pointer"),No=us==null?Dr:wi(us),tr=Cs==null?Dr:wi(Cs),Dr=new _s(Gr,Dn+"leave",us,Z,$r),Dr.target=No,Dr.relatedTarget=tr,Gr=null,th($r)===ar&&(_s=new _s(Xn,Dn+"enter",Cs,Z,$r),_s.target=tr,_s.relatedTarget=No,Gr=_s),No=Gr,us&&Cs)t:{for(_s=us,Xn=Cs,Dn=0,tr=_s;tr;tr=O1(tr))Dn++;for(tr=0,Gr=Xn;Gr;Gr=O1(Gr))tr++;for(;0<Dn-tr;)_s=O1(_s),Dn--;for(;0<tr-Dn;)Xn=O1(Xn),tr--;for(;Dn--;){if(_s===Xn||Xn!==null&&_s===Xn.alternate)break t;_s=O1(_s),Xn=O1(Xn)}_s=null}else _s=null;us!==null&&Wo(Hr,Dr,us,_s,!1),Cs!==null&&No!==null&&Wo(Hr,No,Cs,_s,!0)}}e:{if(Dr=ar?wi(ar):window,us=Dr.nodeName&&Dr.nodeName.toLowerCase(),us==="select"||us==="input"&&Dr.type==="file")var ks=$;else if(xi(Dr))if(H)ks=vt;else{ks=Tt;var $s=ht}else(us=Dr.nodeName)&&us.toLowerCase()==="input"&&(Dr.type==="checkbox"||Dr.type==="radio")&&(ks=tn);if(ks&&(ks=ks(A,ar))){yd(Hr,ks,Z,$r);break e}$s&&$s(A,Dr,ar),A==="focusout"&&($s=Dr._wrapperState)&&$s.controlled&&Dr.type==="number"&&It(Dr,"number",Dr.value)}switch($s=ar?wi(ar):window,A){case"focusin":(xi($s)||$s.contentEditable==="true")&&(Ja=$s,da=ar,_a=null);break;case"focusout":_a=da=Ja=null;break;case"mousedown":Vo=!0;break;case"contextmenu":case"mouseup":case"dragend":Vo=!1,vd(Hr,Z,$r);break;case"selectionchange":if(Za)break;case"keydown":case"keyup":vd(Hr,Z,$r)}var Us;if(Bi)e:{switch(A){case"compositionstart":var qs="onCompositionStart";break e;case"compositionend":qs="onCompositionEnd";break e;case"compositionupdate":qs="onCompositionUpdate";break e}qs=void 0}else ba?_l(A,Z)&&(qs="onCompositionEnd"):A==="keydown"&&Z.keyCode===229&&(qs="onCompositionStart");qs&&(jr&&Z.locale!=="ko"&&(ba||qs!=="onCompositionStart"?qs==="onCompositionEnd"&&ba&&(Us=mi()):(_r=$r,os="value"in _r?_r.value:_r.textContent,ba=!0)),$s=O5(ar,qs),0<$s.length&&(qs=new Mn(qs,A,null,Z,$r),Hr.push({event:qs,listeners:$s}),Us?qs.data=Us:(Us=Bu(Z),Us!==null&&(qs.data=Us)))),(Us=xs?kl(A,Z):px(A,Z))&&(ar=O5(ar,"onBeforeInput"),0<ar.length&&($r=new Mn("onBeforeInput","beforeinput",null,Z,$r),Hr.push({event:$r,listeners:ar}),$r.data=Us))}ET(Hr,M)})}function F1(A,M,Z){return{instance:A,listener:M,currentTarget:Z}}function O5(A,M){for(var Z=M+"Capture",me=[];A!==null;){var Pe=A,ze=Pe.stateNode;Pe.tag===5&&ze!==null&&(Pe=ze,ze=$n(A,Z),ze!=null&&me.unshift(F1(A,ze,Pe)),ze=$n(A,M),ze!=null&&me.push(F1(A,ze,Pe))),A=A.return}return me}function O1(A){if(A===null)return null;do A=A.return;while(A&&A.tag!==5);return A||null}function Wo(A,M,Z,me,Pe){for(var ze=M._reactName,Ct=[];Z!==null&&Z!==me;){var pn=Z,kn=pn.alternate,ar=pn.stateNode;if(kn!==null&&kn===me)break;pn.tag===5&&ar!==null&&(pn=ar,Pe?(kn=$n(Z,ze),kn!=null&&Ct.unshift(F1(Z,kn,pn))):Pe||(kn=$n(Z,ze),kn!=null&&Ct.push(F1(Z,kn,pn)))),Z=Z.return}Ct.length!==0&&A.push({event:M,listeners:Ct})}var dc=/\r\n?/g,kU=/\u0000|\uFFFD/g;function _T(A){return(typeof A=="string"?A:""+A).replace(dc,`
`).replace(kU,"")}function E2(A,M,Z){if(M=_T(M),_T(A)!==M&&Z)throw Error(n(425))}function M5(){}var _2=null,gx=null;function k2(A,M){return A==="textarea"||A==="noscript"||typeof M.children=="string"||typeof M.children=="number"||typeof M.dangerouslySetInnerHTML=="object"&&M.dangerouslySetInnerHTML!==null&&M.dangerouslySetInnerHTML.__html!=null}var km=typeof setTimeout=="function"?setTimeout:void 0,T2=typeof clearTimeout=="function"?clearTimeout:void 0,M1=typeof Promise=="function"?Promise:void 0,R5=typeof queueMicrotask=="function"?queueMicrotask:typeof M1<"u"?function(A){return M1.resolve(null).then(A).catch(R1)}:km;function R1(A){setTimeout(function(){throw A})}function h8(A,M){var Z=M,me=0;do{var Pe=Z.nextSibling;if(A.removeChild(Z),Pe&&Pe.nodeType===8)if(Z=Pe.data,Z==="/$"){if(me===0){A.removeChild(Pe),nn(M);return}me--}else Z!=="$"&&Z!=="$?"&&Z!=="$!"||me++;Z=Pe}while(Z);nn(M)}function Tm(A){for(;A!=null;A=A.nextSibling){var M=A.nodeType;if(M===1||M===3)break;if(M===8){if(M=A.data,M==="$"||M==="$!"||M==="$?")break;if(M==="/$")return null}}return A}function kT(A){A=A.previousSibling;for(var M=0;A;){if(A.nodeType===8){var Z=A.data;if(Z==="$"||Z==="$!"||Z==="$?"){if(M===0)return A;M--}else Z==="/$"&&M++}A=A.previousSibling}return null}var L1=Math.random().toString(36).slice(2),eh="__reactFiber$"+L1,Im="__reactProps$"+L1,Uu="__reactContainer$"+L1,L5="__reactEvents$"+L1,Ot="__reactListeners$"+L1,D1="__reactHandles$"+L1;function th(A){var M=A[eh];if(M)return M;for(var Z=A.parentNode;Z;){if(M=Z[Uu]||Z[eh]){if(Z=M.alternate,M.child!==null||Z!==null&&Z.child!==null)for(A=kT(A);A!==null;){if(Z=A[eh])return Z;A=kT(A)}return M}A=Z,Z=A.parentNode}return null}function fc(A){return A=A[eh]||A[Uu],!A||A.tag!==5&&A.tag!==6&&A.tag!==13&&A.tag!==3?null:A}function wi(A){if(A.tag===5||A.tag===6)return A.stateNode;throw Error(n(33))}function D5(A){return A[Im]||null}var p8=[],B1=-1;function lu(A){return{current:A}}function qa(A){0>B1||(A.current=p8[B1],p8[B1]=null,B1--)}function $a(A,M){B1++,p8[B1]=A.current,A.current=M}var Pm={},hc=lu(Pm),cu=lu(!1),Dc=Pm;function $1(A,M){var Z=A.type.contextTypes;if(!Z)return Pm;var me=A.stateNode;if(me&&me.__reactInternalMemoizedUnmaskedChildContext===M)return me.__reactInternalMemoizedMaskedChildContext;var Pe={},ze;for(ze in Z)Pe[ze]=M[ze];return me&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=M,A.__reactInternalMemoizedMaskedChildContext=Pe),Pe}function uu(A){return A=A.childContextTypes,A!=null}function B5(){qa(cu),qa(hc)}function TT(A,M,Z){if(hc.current!==Pm)throw Error(n(168));$a(hc,M),$a(cu,Z)}function IT(A,M,Z){var me=A.stateNode;if(M=M.childContextTypes,typeof me.getChildContext!="function")return Z;me=me.getChildContext();for(var Pe in me)if(!(Pe in M))throw Error(n(108,ye(A)||"Unknown",Pe));return te({},Z,me)}function wd(A){return A=(A=A.stateNode)&&A.__reactInternalMemoizedMergedChildContext||Pm,Dc=hc.current,$a(hc,A),$a(cu,cu.current),!0}function PT(A,M,Z){var me=A.stateNode;if(!me)throw Error(n(169));Z?(A=IT(A,M,Dc),me.__reactInternalMemoizedMergedChildContext=A,qa(cu),qa(hc),$a(hc,A)):qa(cu),$a(cu,Z)}var gp=null,$5=!1,m8=!1;function FT(A){gp===null?gp=[A]:gp.push(A)}function bx(A){$5=!0,FT(A)}function Fm(){if(!m8&&gp!==null){m8=!0;var A=0,M=bt;try{var Z=gp;for(bt=1;A<Z.length;A++){var me=Z[A];do me=me(!0);while(me!==null)}gp=null,$5=!1}catch(Pe){throw gp!==null&&(gp=gp.slice(A+1)),Un(h,Fm),Pe}finally{bt=M,m8=!1}}return null}var U1=[],pc=0,U5=null,z5=0,Cd=[],Sd=0,yx=null,nh=1,rh="";function vx(A,M){U1[pc++]=z5,U1[pc++]=U5,U5=A,z5=M}function OT(A,M,Z){Cd[Sd++]=nh,Cd[Sd++]=rh,Cd[Sd++]=yx,yx=A;var me=nh;A=rh;var Pe=32-de(me)-1;me&=~(1<<Pe),Z+=1;var ze=32-de(M)+Pe;if(30<ze){var Ct=Pe-Pe%5;ze=(me&(1<<Ct)-1).toString(32),me>>=Ct,Pe-=Ct,nh=1<<32-de(M)+Pe|Z<<Pe|me,rh=ze+A}else nh=1<<ze|Z<<Pe|me,rh=A}function I2(A){A.return!==null&&(vx(A,1),OT(A,1,0))}function wx(A){for(;A===U5;)U5=U1[--pc],U1[pc]=null,z5=U1[--pc],U1[pc]=null;for(;A===yx;)yx=Cd[--Sd],Cd[Sd]=null,rh=Cd[--Sd],Cd[Sd]=null,nh=Cd[--Sd],Cd[Sd]=null}var mc=null,zu=null,Ga=!1,pf=null;function sh(A,M){var Z=Td(5,null,null,0);Z.elementType="DELETED",Z.stateNode=M,Z.return=A,M=A.deletions,M===null?(A.deletions=[Z],A.flags|=16):M.push(Z)}function H5(A,M){switch(A.tag){case 5:var Z=A.type;return M=M.nodeType!==1||Z.toLowerCase()!==M.nodeName.toLowerCase()?null:M,M!==null?(A.stateNode=M,mc=A,zu=Tm(M.firstChild),!0):!1;case 6:return M=A.pendingProps===""||M.nodeType!==3?null:M,M!==null?(A.stateNode=M,mc=A,zu=null,!0):!1;case 13:return M=M.nodeType!==8?null:M,M!==null?(Z=yx!==null?{id:nh,overflow:rh}:null,A.memoizedState={dehydrated:M,treeContext:Z,retryLane:1073741824},Z=Td(18,null,null,0),Z.stateNode=M,Z.return=A,A.child=Z,mc=A,zu=null,!0):!1;default:return!1}}function bp(A){return(A.mode&1)!==0&&(A.flags&128)===0}function du(A){if(Ga){var M=zu;if(M){var Z=M;if(!H5(A,M)){if(bp(A))throw Error(n(418));M=Tm(Z.nextSibling);var me=mc;M&&H5(A,M)?sh(me,Z):(A.flags=A.flags&-4097|2,Ga=!1,mc=A)}}else{if(bp(A))throw Error(n(418));A.flags=A.flags&-4097|2,Ga=!1,mc=A}}}function MT(A){for(A=A.return;A!==null&&A.tag!==5&&A.tag!==3&&A.tag!==13;)A=A.return;mc=A}function P2(A){if(A!==mc)return!1;if(!Ga)return MT(A),Ga=!0,!1;var M;if((M=A.tag!==3)&&!(M=A.tag!==5)&&(M=A.type,M=M!=="head"&&M!=="body"&&!k2(A.type,A.memoizedProps)),M&&(M=zu)){if(bp(A))throw x8(),Error(n(418));for(;M;)sh(A,M),M=Tm(M.nextSibling)}if(MT(A),A.tag===13){if(A=A.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));e:{for(A=A.nextSibling,M=0;A;){if(A.nodeType===8){var Z=A.data;if(Z==="/$"){if(M===0){zu=Tm(A.nextSibling);break e}M--}else Z!=="$"&&Z!=="$!"&&Z!=="$?"||M++}A=A.nextSibling}zu=null}}else zu=mc?Tm(A.stateNode.nextSibling):null;return!0}function x8(){for(var A=zu;A;)A=Tm(A.nextSibling)}function ih(){zu=mc=null,Ga=!1}function ah(A){pf===null?pf=[A]:pf.push(A)}var RT=R.ReactCurrentBatchConfig;function F2(A,M,Z){if(A=Z.ref,A!==null&&typeof A!="function"&&typeof A!="object"){if(Z._owner){if(Z=Z._owner,Z){if(Z.tag!==1)throw Error(n(309));var me=Z.stateNode}if(!me)throw Error(n(147,A));var Pe=me,ze=""+A;return M!==null&&M.ref!==null&&typeof M.ref=="function"&&M.ref._stringRef===ze?M.ref:(M=function(Ct){var pn=Pe.refs;Ct===null?delete pn[ze]:pn[ze]=Ct},M._stringRef=ze,M)}if(typeof A!="string")throw Error(n(284));if(!Z._owner)throw Error(n(290,A))}return A}function Cx(A,M){throw A=Object.prototype.toString.call(M),Error(n(31,A==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":A))}function LT(A){var M=A._init;return M(A._payload)}function g8(A){function M(Xn,Dn){if(A){var tr=Xn.deletions;tr===null?(Xn.deletions=[Dn],Xn.flags|=16):tr.push(Dn)}}function Z(Xn,Dn){if(!A)return null;for(;Dn!==null;)M(Xn,Dn),Dn=Dn.sibling;return null}function me(Xn,Dn){for(Xn=new Map;Dn!==null;)Dn.key!==null?Xn.set(Dn.key,Dn):Xn.set(Dn.index,Dn),Dn=Dn.sibling;return Xn}function Pe(Xn,Dn){return Xn=wf(Xn,Dn),Xn.index=0,Xn.sibling=null,Xn}function ze(Xn,Dn,tr){return Xn.index=tr,A?(tr=Xn.alternate,tr!==null?(tr=tr.index,tr<Dn?(Xn.flags|=2,Dn):tr):(Xn.flags|=2,Dn)):(Xn.flags|=1048576,Dn)}function Ct(Xn){return A&&Xn.alternate===null&&(Xn.flags|=2),Xn}function pn(Xn,Dn,tr,Gr){return Dn===null||Dn.tag!==6?(Dn=r7(tr,Xn.mode,Gr),Dn.return=Xn,Dn):(Dn=Pe(Dn,tr),Dn.return=Xn,Dn)}function kn(Xn,Dn,tr,Gr){var ks=tr.type;return ks===L?$r(Xn,Dn,tr.props.children,Gr,tr.key):Dn!==null&&(Dn.elementType===ks||typeof ks=="object"&&ks!==null&&ks.$$typeof===ie&<(ks)===Dn.type)?(Gr=Pe(Dn,tr.props),Gr.ref=F2(Xn,Dn,tr),Gr.return=Xn,Gr):(Gr=N6(tr.type,tr.key,tr.props,null,Xn.mode,Gr),Gr.ref=F2(Xn,Dn,tr),Gr.return=Xn,Gr)}function ar(Xn,Dn,tr,Gr){return Dn===null||Dn.tag!==4||Dn.stateNode.containerInfo!==tr.containerInfo||Dn.stateNode.implementation!==tr.implementation?(Dn=s7(tr,Xn.mode,Gr),Dn.return=Xn,Dn):(Dn=Pe(Dn,tr.children||[]),Dn.return=Xn,Dn)}function $r(Xn,Dn,tr,Gr,ks){return Dn===null||Dn.tag!==7?(Dn=Fx(tr,Xn.mode,Gr,ks),Dn.return=Xn,Dn):(Dn=Pe(Dn,tr),Dn.return=Xn,Dn)}function Hr(Xn,Dn,tr){if(typeof Dn=="string"&&Dn!==""||typeof Dn=="number")return Dn=r7(""+Dn,Xn.mode,tr),Dn.return=Xn,Dn;if(typeof Dn=="object"&&Dn!==null){switch(Dn.$$typeof){case F:return tr=N6(Dn.type,Dn.key,Dn.props,null,Xn.mode,tr),tr.ref=F2(Xn,null,Dn),tr.return=Xn,tr;case U:return Dn=s7(Dn,Xn.mode,tr),Dn.return=Xn,Dn;case ie:var Gr=Dn._init;return Hr(Xn,Gr(Dn._payload),tr)}if(an(Dn)||V(Dn))return Dn=Fx(Dn,Xn.mode,tr,null),Dn.return=Xn,Dn;Cx(Xn,Dn)}return null}function Dr(Xn,Dn,tr,Gr){var ks=Dn!==null?Dn.key:null;if(typeof tr=="string"&&tr!==""||typeof tr=="number")return ks!==null?null:pn(Xn,Dn,""+tr,Gr);if(typeof tr=="object"&&tr!==null){switch(tr.$$typeof){case F:return tr.key===ks?kn(Xn,Dn,tr,Gr):null;case U:return tr.key===ks?ar(Xn,Dn,tr,Gr):null;case ie:return ks=tr._init,Dr(Xn,Dn,ks(tr._payload),Gr)}if(an(tr)||V(tr))return ks!==null?null:$r(Xn,Dn,tr,Gr,null);Cx(Xn,tr)}return null}function us(Xn,Dn,tr,Gr,ks){if(typeof Gr=="string"&&Gr!==""||typeof Gr=="number")return Xn=Xn.get(tr)||null,pn(Dn,Xn,""+Gr,ks);if(typeof Gr=="object"&&Gr!==null){switch(Gr.$$typeof){case F:return Xn=Xn.get(Gr.key===null?tr:Gr.key)||null,kn(Dn,Xn,Gr,ks);case U:return Xn=Xn.get(Gr.key===null?tr:Gr.key)||null,ar(Dn,Xn,Gr,ks);case ie:var $s=Gr._init;return us(Xn,Dn,tr,$s(Gr._payload),ks)}if(an(Gr)||V(Gr))return Xn=Xn.get(tr)||null,$r(Dn,Xn,Gr,ks,null);Cx(Dn,Gr)}return null}function Cs(Xn,Dn,tr,Gr){for(var ks=null,$s=null,Us=Dn,qs=Dn=0,ul=null;Us!==null&&qs<tr.length;qs++){Us.index>qs?(ul=Us,Us=null):ul=Us.sibling;var ia=Dr(Xn,Us,tr[qs],Gr);if(ia===null){Us===null&&(Us=ul);break}A&&Us&&ia.alternate===null&&M(Xn,Us),Dn=ze(ia,Dn,qs),$s===null?ks=ia:$s.sibling=ia,$s=ia,Us=ul}if(qs===tr.length)return Z(Xn,Us),Ga&&vx(Xn,qs),ks;if(Us===null){for(;qs<tr.length;qs++)Us=Hr(Xn,tr[qs],Gr),Us!==null&&(Dn=ze(Us,Dn,qs),$s===null?ks=Us:$s.sibling=Us,$s=Us);return Ga&&vx(Xn,qs),ks}for(Us=me(Xn,Us);qs<tr.length;qs++)ul=us(Us,Xn,qs,tr[qs],Gr),ul!==null&&(A&&ul.alternate!==null&&Us.delete(ul.key===null?qs:ul.key),Dn=ze(ul,Dn,qs),$s===null?ks=ul:$s.sibling=ul,$s=ul);return A&&Us.forEach(function(Wm){return M(Xn,Wm)}),Ga&&vx(Xn,qs),ks}function _s(Xn,Dn,tr,Gr){var ks=V(tr);if(typeof ks!="function")throw Error(n(150));if(tr=ks.call(tr),tr==null)throw Error(n(151));for(var $s=ks=null,Us=Dn,qs=Dn=0,ul=null,ia=tr.next();Us!==null&&!ia.done;qs++,ia=tr.next()){Us.index>qs?(ul=Us,Us=null):ul=Us.sibling;var Wm=Dr(Xn,Us,ia.value,Gr);if(Wm===null){Us===null&&(Us=ul);break}A&&Us&&Wm.alternate===null&&M(Xn,Us),Dn=ze(Wm,Dn,qs),$s===null?ks=Wm:$s.sibling=Wm,$s=Wm,Us=ul}if(ia.done)return Z(Xn,Us),Ga&&vx(Xn,qs),ks;if(Us===null){for(;!ia.done;qs++,ia=tr.next())ia=Hr(Xn,ia.value,Gr),ia!==null&&(Dn=ze(ia,Dn,qs),$s===null?ks=ia:$s.sibling=ia,$s=ia);return Ga&&vx(Xn,qs),ks}for(Us=me(Xn,Us);!ia.done;qs++,ia=tr.next())ia=us(Us,Xn,qs,ia.value,Gr),ia!==null&&(A&&ia.alternate!==null&&Us.delete(ia.key===null?qs:ia.key),Dn=ze(ia,Dn,qs),$s===null?ks=ia:$s.sibling=ia,$s=ia);return A&&Us.forEach(function(KU){return M(Xn,KU)}),Ga&&vx(Xn,qs),ks}function No(Xn,Dn,tr,Gr){if(typeof tr=="object"&&tr!==null&&tr.type===L&&tr.key===null&&(tr=tr.props.children),typeof tr=="object"&&tr!==null){switch(tr.$$typeof){case F:e:{for(var ks=tr.key,$s=Dn;$s!==null;){if($s.key===ks){if(ks=tr.type,ks===L){if($s.tag===7){Z(Xn,$s.sibling),Dn=Pe($s,tr.props.children),Dn.return=Xn,Xn=Dn;break e}}else if($s.elementType===ks||typeof ks=="object"&&ks!==null&&ks.$$typeof===ie&<(ks)===$s.type){Z(Xn,$s.sibling),Dn=Pe($s,tr.props),Dn.ref=F2(Xn,$s,tr),Dn.return=Xn,Xn=Dn;break e}Z(Xn,$s);break}else M(Xn,$s);$s=$s.sibling}tr.type===L?(Dn=Fx(tr.props.children,Xn.mode,Gr,tr.key),Dn.return=Xn,Xn=Dn):(Gr=N6(tr.type,tr.key,tr.props,null,Xn.mode,Gr),Gr.ref=F2(Xn,Dn,tr),Gr.return=Xn,Xn=Gr)}return Ct(Xn);case U:e:{for($s=tr.key;Dn!==null;){if(Dn.key===$s)if(Dn.tag===4&&Dn.stateNode.containerInfo===tr.containerInfo&&Dn.stateNode.implementation===tr.implementation){Z(Xn,Dn.sibling),Dn=Pe(Dn,tr.children||[]),Dn.return=Xn,Xn=Dn;break e}else{Z(Xn,Dn);break}else M(Xn,Dn);Dn=Dn.sibling}Dn=s7(tr,Xn.mode,Gr),Dn.return=Xn,Xn=Dn}return Ct(Xn);case ie:return $s=tr._init,No(Xn,Dn,$s(tr._payload),Gr)}if(an(tr))return Cs(Xn,Dn,tr,Gr);if(V(tr))return _s(Xn,Dn,tr,Gr);Cx(Xn,tr)}return typeof tr=="string"&&tr!==""||typeof tr=="number"?(tr=""+tr,Dn!==null&&Dn.tag===6?(Z(Xn,Dn.sibling),Dn=Pe(Dn,tr),Dn.return=Xn,Xn=Dn):(Z(Xn,Dn),Dn=r7(tr,Xn.mode,Gr),Dn.return=Xn,Xn=Dn),Ct(Xn)):Z(Xn,Dn)}return No}var So=g8(!0),V5=g8(!1),O2=lu(null),Hu=null,Om=null,z1=null;function yp(){z1=Om=Hu=null}function W5(A){var M=O2.current;qa(O2),A._currentValue=M}function ql(A,M,Z){for(;A!==null;){var me=A.alternate;if((A.childLanes&M)!==M?(A.childLanes|=M,me!==null&&(me.childLanes|=M)):me!==null&&(me.childLanes&M)!==M&&(me.childLanes|=M),A===Z)break;A=A.return}}function Mm(A,M){Hu=A,z1=Om=null,A=A.dependencies,A!==null&&A.firstContext!==null&&(A.lanes&M&&($c=!0),A.firstContext=null)}function Nd(A){var M=A._currentValue;if(z1!==A)if(A={context:A,memoizedValue:M,next:null},Om===null){if(Hu===null)throw Error(n(308));Om=A,Hu.dependencies={lanes:0,firstContext:A}}else Om=Om.next=A;return M}var Sx=null;function b8(A){Sx===null?Sx=[A]:Sx.push(A)}function q5(A,M,Z,me){var Pe=M.interleaved;return Pe===null?(Z.next=Z,b8(M)):(Z.next=Pe.next,Pe.next=Z),M.interleaved=Z,vp(A,me)}function vp(A,M){A.lanes|=M;var Z=A.alternate;for(Z!==null&&(Z.lanes|=M),Z=A,A=A.return;A!==null;)A.childLanes|=M,Z=A.alternate,Z!==null&&(Z.childLanes|=M),Z=A,A=A.return;return Z.tag===3?Z.stateNode:null}var Ad=!1;function G5(A){A.updateQueue={baseState:A.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function DT(A,M){A=A.updateQueue,M.updateQueue===A&&(M.updateQueue={baseState:A.baseState,firstBaseUpdate:A.firstBaseUpdate,lastBaseUpdate:A.lastBaseUpdate,shared:A.shared,effects:A.effects})}function wp(A,M){return{eventTime:A,lane:M,tag:0,payload:null,callback:null,next:null}}function jd(A,M,Z){var me=A.updateQueue;if(me===null)return null;if(me=me.shared,Yi&2){var Pe=me.pending;return Pe===null?M.next=M:(M.next=Pe.next,Pe.next=M),me.pending=M,vp(A,Z)}return Pe=me.interleaved,Pe===null?(M.next=M,b8(me)):(M.next=Pe.next,Pe.next=M),me.interleaved=M,vp(A,Z)}function K5(A,M,Z){if(M=M.updateQueue,M!==null&&(M=M.shared,(Z&4194240)!==0)){var me=M.lanes;me&=A.pendingLanes,Z|=me,M.lanes=Z,lt(A,Z)}}function BT(A,M){var Z=A.updateQueue,me=A.alternate;if(me!==null&&(me=me.updateQueue,Z===me)){var Pe=null,ze=null;if(Z=Z.firstBaseUpdate,Z!==null){do{var Ct={eventTime:Z.eventTime,lane:Z.lane,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null};ze===null?Pe=ze=Ct:ze=ze.next=Ct,Z=Z.next}while(Z!==null);ze===null?Pe=ze=M:ze=ze.next=M}else Pe=ze=M;Z={baseState:me.baseState,firstBaseUpdate:Pe,lastBaseUpdate:ze,shared:me.shared,effects:me.effects},A.updateQueue=Z;return}A=Z.lastBaseUpdate,A===null?Z.firstBaseUpdate=M:A.next=M,Z.lastBaseUpdate=M}function H1(A,M,Z,me){var Pe=A.updateQueue;Ad=!1;var ze=Pe.firstBaseUpdate,Ct=Pe.lastBaseUpdate,pn=Pe.shared.pending;if(pn!==null){Pe.shared.pending=null;var kn=pn,ar=kn.next;kn.next=null,Ct===null?ze=ar:Ct.next=ar,Ct=kn;var $r=A.alternate;$r!==null&&($r=$r.updateQueue,pn=$r.lastBaseUpdate,pn!==Ct&&(pn===null?$r.firstBaseUpdate=ar:pn.next=ar,$r.lastBaseUpdate=kn))}if(ze!==null){var Hr=Pe.baseState;Ct=0,$r=ar=kn=null,pn=ze;do{var Dr=pn.lane,us=pn.eventTime;if((me&Dr)===Dr){$r!==null&&($r=$r.next={eventTime:us,lane:0,tag:pn.tag,payload:pn.payload,callback:pn.callback,next:null});e:{var Cs=A,_s=pn;switch(Dr=M,us=Z,_s.tag){case 1:if(Cs=_s.payload,typeof Cs=="function"){Hr=Cs.call(us,Hr,Dr);break e}Hr=Cs;break e;case 3:Cs.flags=Cs.flags&-65537|128;case 0:if(Cs=_s.payload,Dr=typeof Cs=="function"?Cs.call(us,Hr,Dr):Cs,Dr==null)break e;Hr=te({},Hr,Dr);break e;case 2:Ad=!0}}pn.callback!==null&&pn.lane!==0&&(A.flags|=64,Dr=Pe.effects,Dr===null?Pe.effects=[pn]:Dr.push(pn))}else us={eventTime:us,lane:Dr,tag:pn.tag,payload:pn.payload,callback:pn.callback,next:null},$r===null?(ar=$r=us,kn=Hr):$r=$r.next=us,Ct|=Dr;if(pn=pn.next,pn===null){if(pn=Pe.shared.pending,pn===null)break;Dr=pn,pn=Dr.next,Dr.next=null,Pe.lastBaseUpdate=Dr,Pe.shared.pending=null}}while(!0);if($r===null&&(kn=Hr),Pe.baseState=kn,Pe.firstBaseUpdate=ar,Pe.lastBaseUpdate=$r,M=Pe.shared.interleaved,M!==null){Pe=M;do Ct|=Pe.lane,Pe=Pe.next;while(Pe!==M)}else ze===null&&(Pe.shared.lanes=0);$m|=Ct,A.lanes=Ct,A.memoizedState=Hr}}function y8(A,M,Z){if(A=M.effects,M.effects=null,A!==null)for(M=0;M<A.length;M++){var me=A[M],Pe=me.callback;if(Pe!==null){if(me.callback=null,me=Z,typeof Pe!="function")throw Error(n(191,Pe));Pe.call(me)}}}var M2={},oh=lu(M2),R2=lu(M2),V1=lu(M2);function Cp(A){if(A===M2)throw Error(n(174));return A}function v8(A,M){switch($a(V1,M),$a(R2,A),$a(oh,M2),A=M.nodeType,A){case 9:case 11:M=(M=M.documentElement)?M.namespaceURI:Lt(null,"");break;default:A=A===8?M.parentNode:M,M=A.namespaceURI||null,A=A.tagName,M=Lt(M,A)}qa(oh),$a(oh,M)}function Rm(){qa(oh),qa(R2),qa(V1)}function w8(A){Cp(V1.current);var M=Cp(oh.current),Z=Lt(M,A.type);M!==Z&&($a(R2,A),$a(oh,Z))}function Y5(A){R2.current===A&&(qa(oh),qa(R2))}var eo=lu(0);function Nx(A){for(var M=A;M!==null;){if(M.tag===13){var Z=M.memoizedState;if(Z!==null&&(Z=Z.dehydrated,Z===null||Z.data==="$?"||Z.data==="$!"))return M}else if(M.tag===19&&M.memoizedProps.revealOrder!==void 0){if(M.flags&128)return M}else if(M.child!==null){M.child.return=M,M=M.child;continue}if(M===A)break;for(;M.sibling===null;){if(M.return===null||M.return===A)return null;M=M.return}M.sibling.return=M.return,M=M.sibling}return null}var C8=[];function X5(){for(var A=0;A<C8.length;A++)C8[A]._workInProgressVersionPrimary=null;C8.length=0}var L2=R.ReactCurrentDispatcher,S8=R.ReactCurrentBatchConfig,Lm=0,fo=null,Ro=null,ll=null,W1=!1,D2=!1,Ax=0,Pi=0;function xc(){throw Error(n(321))}function N8(A,M){if(M===null)return!1;for(var Z=0;Z<M.length&&Z<A.length;Z++)if(!Kt(A[Z],M[Z]))return!1;return!0}function jx(A,M,Z,me,Pe,ze){if(Lm=ze,fo=M,M.memoizedState=null,M.updateQueue=null,M.lanes=0,L2.current=A===null||A.memoizedState===null?IU:r6,A=Z(me,Pe),D2){ze=0;do{if(D2=!1,Ax=0,25<=ze)throw Error(n(301));ze+=1,ll=Ro=null,M.updateQueue=null,L2.current=Y1,A=Z(me,Pe)}while(D2)}if(L2.current=n6,M=Ro!==null&&Ro.next!==null,Lm=0,ll=Ro=fo=null,W1=!1,M)throw Error(n(300));return A}function Q5(){var A=Ax!==0;return Ax=0,A}function lh(){var A={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ll===null?fo.memoizedState=ll=A:ll=ll.next=A,ll}function Ed(){if(Ro===null){var A=fo.alternate;A=A!==null?A.memoizedState:null}else A=Ro.next;var M=ll===null?fo.memoizedState:ll.next;if(M!==null)ll=M,Ro=A;else{if(A===null)throw Error(n(310));Ro=A,A={memoizedState:Ro.memoizedState,baseState:Ro.baseState,baseQueue:Ro.baseQueue,queue:Ro.queue,next:null},ll===null?fo.memoizedState=ll=A:ll=ll.next=A}return ll}function gc(A,M){return typeof M=="function"?M(A):M}function A8(A){var M=Ed(),Z=M.queue;if(Z===null)throw Error(n(311));Z.lastRenderedReducer=A;var me=Ro,Pe=me.baseQueue,ze=Z.pending;if(ze!==null){if(Pe!==null){var Ct=Pe.next;Pe.next=ze.next,ze.next=Ct}me.baseQueue=Pe=ze,Z.pending=null}if(Pe!==null){ze=Pe.next,me=me.baseState;var pn=Ct=null,kn=null,ar=ze;do{var $r=ar.lane;if((Lm&$r)===$r)kn!==null&&(kn=kn.next={lane:0,action:ar.action,hasEagerState:ar.hasEagerState,eagerState:ar.eagerState,next:null}),me=ar.hasEagerState?ar.eagerState:A(me,ar.action);else{var Hr={lane:$r,action:ar.action,hasEagerState:ar.hasEagerState,eagerState:ar.eagerState,next:null};kn===null?(pn=kn=Hr,Ct=me):kn=kn.next=Hr,fo.lanes|=$r,$m|=$r}ar=ar.next}while(ar!==null&&ar!==ze);kn===null?Ct=me:kn.next=pn,Kt(me,M.memoizedState)||($c=!0),M.memoizedState=me,M.baseState=Ct,M.baseQueue=kn,Z.lastRenderedState=me}if(A=Z.interleaved,A!==null){Pe=A;do ze=Pe.lane,fo.lanes|=ze,$m|=ze,Pe=Pe.next;while(Pe!==A)}else Pe===null&&(Z.lanes=0);return[M.memoizedState,Z.dispatch]}function q1(A){var M=Ed(),Z=M.queue;if(Z===null)throw Error(n(311));Z.lastRenderedReducer=A;var me=Z.dispatch,Pe=Z.pending,ze=M.memoizedState;if(Pe!==null){Z.pending=null;var Ct=Pe=Pe.next;do ze=A(ze,Ct.action),Ct=Ct.next;while(Ct!==Pe);Kt(ze,M.memoizedState)||($c=!0),M.memoizedState=ze,M.baseQueue===null&&(M.baseState=ze),Z.lastRenderedState=ze}return[ze,me]}function Z5(){}function j8(A,M){var Z=fo,me=Ed(),Pe=M(),ze=!Kt(me.memoizedState,Pe);if(ze&&(me.memoizedState=Pe,$c=!0),me=me.queue,ch(Sp.bind(null,Z,me,A),[A]),me.getSnapshot!==M||ze||ll!==null&&ll.memoizedState.tag&1){if(Z.flags|=2048,G1(9,fu.bind(null,Z,me,Pe,M),void 0,null),Il===null)throw Error(n(349));Lm&30||E8(Z,M,Pe)}return Pe}function E8(A,M,Z){A.flags|=16384,A={getSnapshot:M,value:Z},M=fo.updateQueue,M===null?(M={lastEffect:null,stores:null},fo.updateQueue=M,M.stores=[A]):(Z=M.stores,Z===null?M.stores=[A]:Z.push(A))}function fu(A,M,Z,me){M.value=Z,M.getSnapshot=me,J5(M)&&_8(A)}function Sp(A,M,Z){return Z(function(){J5(M)&&_8(A)})}function J5(A){var M=A.getSnapshot;A=A.value;try{var Z=M();return!Kt(A,Z)}catch{return!0}}function _8(A){var M=vp(A,1);M!==null&&vf(M,A,1,-1)}function B2(A){var M=lh();return typeof A=="function"&&(A=A()),M.memoizedState=M.baseState=A,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gc,lastRenderedState:A},M.queue=A,A=A.dispatch=WT.bind(null,fo,A),[M.memoizedState,A]}function G1(A,M,Z,me){return A={tag:A,create:M,destroy:Z,deps:me,next:null},M=fo.updateQueue,M===null?(M={lastEffect:null,stores:null},fo.updateQueue=M,M.lastEffect=A.next=A):(Z=M.lastEffect,Z===null?M.lastEffect=A.next=A:(me=Z.next,Z.next=A,A.next=me,M.lastEffect=A)),A}function e6(){return Ed().memoizedState}function $2(A,M,Z,me){var Pe=lh();fo.flags|=A,Pe.memoizedState=G1(1|M,Z,void 0,me===void 0?null:me)}function K1(A,M,Z,me){var Pe=Ed();me=me===void 0?null:me;var ze=void 0;if(Ro!==null){var Ct=Ro.memoizedState;if(ze=Ct.destroy,me!==null&&N8(me,Ct.deps)){Pe.memoizedState=G1(M,Z,ze,me);return}}fo.flags|=A,Pe.memoizedState=G1(1|M,Z,ze,me)}function t6(A,M){return $2(8390656,8,A,M)}function ch(A,M){return K1(2048,8,A,M)}function $T(A,M){return K1(4,2,A,M)}function Np(A,M){return K1(4,4,A,M)}function k8(A,M){if(typeof M=="function")return A=A(),M(A),function(){M(null)};if(M!=null)return A=A(),M.current=A,function(){M.current=null}}function T8(A,M,Z){return Z=Z!=null?Z.concat([A]):null,K1(4,4,k8.bind(null,M,A),Z)}function U2(){}function UT(A,M){var Z=Ed();M=M===void 0?null:M;var me=Z.memoizedState;return me!==null&&M!==null&&N8(M,me[1])?me[0]:(Z.memoizedState=[A,M],A)}function zT(A,M){var Z=Ed();M=M===void 0?null:M;var me=Z.memoizedState;return me!==null&&M!==null&&N8(M,me[1])?me[0]:(A=A(),Z.memoizedState=[A,M],A)}function HT(A,M,Z){return Lm&21?(Kt(Z,M)||(Z=De(),fo.lanes|=Z,$m|=Z,A.baseState=!0),M):(A.baseState&&(A.baseState=!1,$c=!0),A.memoizedState=Z)}function VT(A,M){var Z=bt;bt=Z!==0&&4>Z?Z:4,A(!0);var me=S8.transition;S8.transition={};try{A(!1),M()}finally{bt=Z,S8.transition=me}}function I8(){return Ed().memoizedState}function TU(A,M,Z){var me=Hm(A);if(Z={lane:me,action:Z,hasEagerState:!1,eagerState:null,next:null},P8(A))Bc(M,Z);else if(Z=q5(A,M,Z,me),Z!==null){var Pe=Hc();vf(Z,A,me,Pe),mf(Z,M,me)}}function WT(A,M,Z){var me=Hm(A),Pe={lane:me,action:Z,hasEagerState:!1,eagerState:null,next:null};if(P8(A))Bc(M,Pe);else{var ze=A.alternate;if(A.lanes===0&&(ze===null||ze.lanes===0)&&(ze=M.lastRenderedReducer,ze!==null))try{var Ct=M.lastRenderedState,pn=ze(Ct,Z);if(Pe.hasEagerState=!0,Pe.eagerState=pn,Kt(pn,Ct)){var kn=M.interleaved;kn===null?(Pe.next=Pe,b8(M)):(Pe.next=kn.next,kn.next=Pe),M.interleaved=Pe;return}}catch{}finally{}Z=q5(A,M,Pe,me),Z!==null&&(Pe=Hc(),vf(Z,A,me,Pe),mf(Z,M,me))}}function P8(A){var M=A.alternate;return A===fo||M!==null&&M===fo}function Bc(A,M){D2=W1=!0;var Z=A.pending;Z===null?M.next=M:(M.next=Z.next,Z.next=M),A.pending=M}function mf(A,M,Z){if(Z&4194240){var me=M.lanes;me&=A.pendingLanes,Z|=me,M.lanes=Z,lt(A,Z)}}var n6={readContext:Nd,useCallback:xc,useContext:xc,useEffect:xc,useImperativeHandle:xc,useInsertionEffect:xc,useLayoutEffect:xc,useMemo:xc,useReducer:xc,useRef:xc,useState:xc,useDebugValue:xc,useDeferredValue:xc,useTransition:xc,useMutableSource:xc,useSyncExternalStore:xc,useId:xc,unstable_isNewReconciler:!1},IU={readContext:Nd,useCallback:function(A,M){return lh().memoizedState=[A,M===void 0?null:M],A},useContext:Nd,useEffect:t6,useImperativeHandle:function(A,M,Z){return Z=Z!=null?Z.concat([A]):null,$2(4194308,4,k8.bind(null,M,A),Z)},useLayoutEffect:function(A,M){return $2(4194308,4,A,M)},useInsertionEffect:function(A,M){return $2(4,2,A,M)},useMemo:function(A,M){var Z=lh();return M=M===void 0?null:M,A=A(),Z.memoizedState=[A,M],A},useReducer:function(A,M,Z){var me=lh();return M=Z!==void 0?Z(M):M,me.memoizedState=me.baseState=M,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:A,lastRenderedState:M},me.queue=A,A=A.dispatch=TU.bind(null,fo,A),[me.memoizedState,A]},useRef:function(A){var M=lh();return A={current:A},M.memoizedState=A},useState:B2,useDebugValue:U2,useDeferredValue:function(A){return lh().memoizedState=A},useTransition:function(){var A=B2(!1),M=A[0];return A=VT.bind(null,A[1]),lh().memoizedState=A,[M,A]},useMutableSource:function(){},useSyncExternalStore:function(A,M,Z){var me=fo,Pe=lh();if(Ga){if(Z===void 0)throw Error(n(407));Z=Z()}else{if(Z=M(),Il===null)throw Error(n(349));Lm&30||E8(me,M,Z)}Pe.memoizedState=Z;var ze={value:Z,getSnapshot:M};return Pe.queue=ze,t6(Sp.bind(null,me,ze,A),[A]),me.flags|=2048,G1(9,fu.bind(null,me,ze,Z,M),void 0,null),Z},useId:function(){var A=lh(),M=Il.identifierPrefix;if(Ga){var Z=rh,me=nh;Z=(me&~(1<<32-de(me)-1)).toString(32)+Z,M=":"+M+"R"+Z,Z=Ax++,0<Z&&(M+="H"+Z.toString(32)),M+=":"}else Z=Pi++,M=":"+M+"r"+Z.toString(32)+":";return A.memoizedState=M},unstable_isNewReconciler:!1},r6={readContext:Nd,useCallback:UT,useContext:Nd,useEffect:ch,useImperativeHandle:T8,useInsertionEffect:$T,useLayoutEffect:Np,useMemo:zT,useReducer:A8,useRef:e6,useState:function(){return A8(gc)},useDebugValue:U2,useDeferredValue:function(A){var M=Ed();return HT(M,Ro.memoizedState,A)},useTransition:function(){var A=A8(gc)[0],M=Ed().memoizedState;return[A,M]},useMutableSource:Z5,useSyncExternalStore:j8,useId:I8,unstable_isNewReconciler:!1},Y1={readContext:Nd,useCallback:UT,useContext:Nd,useEffect:ch,useImperativeHandle:T8,useInsertionEffect:$T,useLayoutEffect:Np,useMemo:zT,useReducer:q1,useRef:e6,useState:function(){return q1(gc)},useDebugValue:U2,useDeferredValue:function(A){var M=Ed();return Ro===null?M.memoizedState=A:HT(M,Ro.memoizedState,A)},useTransition:function(){var A=q1(gc)[0],M=Ed().memoizedState;return[A,M]},useMutableSource:Z5,useSyncExternalStore:j8,useId:I8,unstable_isNewReconciler:!1};function _d(A,M){if(A&&A.defaultProps){M=te({},M),A=A.defaultProps;for(var Z in A)M[Z]===void 0&&(M[Z]=A[Z]);return M}return M}function s6(A,M,Z,me){M=A.memoizedState,Z=Z(me,M),Z=Z==null?M:te({},M,Z),A.memoizedState=Z,A.lanes===0&&(A.updateQueue.baseState=Z)}var i6={isMounted:function(A){return(A=A._reactInternals)?sn(A)===A:!1},enqueueSetState:function(A,M,Z){A=A._reactInternals;var me=Hc(),Pe=Hm(A),ze=wp(me,Pe);ze.payload=M,Z!=null&&(ze.callback=Z),M=jd(A,ze,Pe),M!==null&&(vf(M,A,Pe,me),K5(M,A,Pe))},enqueueReplaceState:function(A,M,Z){A=A._reactInternals;var me=Hc(),Pe=Hm(A),ze=wp(me,Pe);ze.tag=1,ze.payload=M,Z!=null&&(ze.callback=Z),M=jd(A,ze,Pe),M!==null&&(vf(M,A,Pe,me),K5(M,A,Pe))},enqueueForceUpdate:function(A,M){A=A._reactInternals;var Z=Hc(),me=Hm(A),Pe=wp(Z,me);Pe.tag=2,M!=null&&(Pe.callback=M),M=jd(A,Pe,me),M!==null&&(vf(M,A,me,Z),K5(M,A,me))}};function F8(A,M,Z,me,Pe,ze,Ct){return A=A.stateNode,typeof A.shouldComponentUpdate=="function"?A.shouldComponentUpdate(me,ze,Ct):M.prototype&&M.prototype.isPureReactComponent?!_n(Z,me)||!_n(Pe,ze):!0}function Ex(A,M,Z){var me=!1,Pe=Pm,ze=M.contextType;return typeof ze=="object"&&ze!==null?ze=Nd(ze):(Pe=uu(M)?Dc:hc.current,me=M.contextTypes,ze=(me=me!=null)?$1(A,Pe):Pm),M=new M(Z,ze),A.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,M.updater=i6,A.stateNode=M,M._reactInternals=A,me&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=Pe,A.__reactInternalMemoizedMaskedChildContext=ze),M}function X1(A,M,Z,me){A=M.state,typeof M.componentWillReceiveProps=="function"&&M.componentWillReceiveProps(Z,me),typeof M.UNSAFE_componentWillReceiveProps=="function"&&M.UNSAFE_componentWillReceiveProps(Z,me),M.state!==A&&i6.enqueueReplaceState(M,M.state,null)}function O8(A,M,Z,me){var Pe=A.stateNode;Pe.props=Z,Pe.state=A.memoizedState,Pe.refs={},G5(A);var ze=M.contextType;typeof ze=="object"&&ze!==null?Pe.context=Nd(ze):(ze=uu(M)?Dc:hc.current,Pe.context=$1(A,ze)),Pe.state=A.memoizedState,ze=M.getDerivedStateFromProps,typeof ze=="function"&&(s6(A,M,ze,Z),Pe.state=A.memoizedState),typeof M.getDerivedStateFromProps=="function"||typeof Pe.getSnapshotBeforeUpdate=="function"||typeof Pe.UNSAFE_componentWillMount!="function"&&typeof Pe.componentWillMount!="function"||(M=Pe.state,typeof Pe.componentWillMount=="function"&&Pe.componentWillMount(),typeof Pe.UNSAFE_componentWillMount=="function"&&Pe.UNSAFE_componentWillMount(),M!==Pe.state&&i6.enqueueReplaceState(Pe,Pe.state,null),H1(A,Z,Pe,me),Pe.state=A.memoizedState),typeof Pe.componentDidMount=="function"&&(A.flags|=4194308)}function _x(A,M){try{var Z="",me=M;do Z+=ge(me),me=me.return;while(me);var Pe=Z}catch(ze){Pe=`
Error generating stack: `+ze.message+`
`+ze.stack}return{value:A,source:M,stack:Pe,digest:null}}function a6(A,M,Z){return{value:A,source:null,stack:Z??null,digest:M??null}}function Q1(A,M){try{console.error(M.value)}catch(Z){setTimeout(function(){throw Z})}}var qT=typeof WeakMap=="function"?WeakMap:Map;function z2(A,M,Z){Z=wp(-1,Z),Z.tag=3,Z.payload={element:null};var me=M.value;return Z.callback=function(){g6||(g6=!0,X8=me),Q1(A,M)},Z}function o6(A,M,Z){Z=wp(-1,Z),Z.tag=3;var me=A.type.getDerivedStateFromError;if(typeof me=="function"){var Pe=M.value;Z.payload=function(){return me(Pe)},Z.callback=function(){Q1(A,M)}}var ze=A.stateNode;return ze!==null&&typeof ze.componentDidCatch=="function"&&(Z.callback=function(){Q1(A,M),typeof me!="function"&&(Um===null?Um=new Set([this]):Um.add(this));var Ct=M.stack;this.componentDidCatch(M.value,{componentStack:Ct!==null?Ct:""})}),Z}function H2(A,M,Z){var me=A.pingCache;if(me===null){me=A.pingCache=new qT;var Pe=new Set;me.set(M,Pe)}else Pe=me.get(M),Pe===void 0&&(Pe=new Set,me.set(M,Pe));Pe.has(Z)||(Pe.add(Z),A=BU.bind(null,A,M,Z),M.then(A,A))}function GT(A){do{var M;if((M=A.tag===13)&&(M=A.memoizedState,M=M!==null?M.dehydrated!==null:!0),M)return A;A=A.return}while(A!==null);return null}function M8(A,M,Z,me,Pe){return A.mode&1?(A.flags|=65536,A.lanes=Pe,A):(A===M?A.flags|=65536:(A.flags|=128,Z.flags|=131072,Z.flags&=-52805,Z.tag===1&&(Z.alternate===null?Z.tag=17:(M=wp(-1,1),M.tag=2,jd(Z,M,1))),Z.lanes|=1),A)}var l6=R.ReactCurrentOwner,$c=!1;function Gl(A,M,Z,me){M.child=A===null?V5(M,null,Z,me):So(M,A.child,Z,me)}function KT(A,M,Z,me,Pe){Z=Z.render;var ze=M.ref;return Mm(M,Pe),me=jx(A,M,Z,me,ze,Pe),Z=Q5(),A!==null&&!$c?(M.updateQueue=A.updateQueue,M.flags&=-2053,A.lanes&=~Pe,xf(A,M,Pe)):(Ga&&Z&&I2(M),M.flags|=1,Gl(A,M,me,Pe),M.child)}function R8(A,M,Z,me,Pe){if(A===null){var ze=Z.type;return typeof ze=="function"&&!S6(ze)&&ze.defaultProps===void 0&&Z.compare===null&&Z.defaultProps===void 0?(M.tag=15,M.type=ze,uh(A,M,ze,me,Pe)):(A=N6(Z.type,null,me,M,M.mode,Pe),A.ref=M.ref,A.return=M,M.child=A)}if(ze=A.child,!(A.lanes&Pe)){var Ct=ze.memoizedProps;if(Z=Z.compare,Z=Z!==null?Z:_n,Z(Ct,me)&&A.ref===M.ref)return xf(A,M,Pe)}return M.flags|=1,A=wf(ze,me),A.ref=M.ref,A.return=M,M.child=A}function uh(A,M,Z,me,Pe){if(A!==null){var ze=A.memoizedProps;if(_n(ze,me)&&A.ref===M.ref)if($c=!1,M.pendingProps=me=ze,(A.lanes&Pe)!==0)A.flags&131072&&($c=!0);else return M.lanes=A.lanes,xf(A,M,Pe)}return B8(A,M,Z,me,Pe)}function L8(A,M,Z){var me=M.pendingProps,Pe=me.children,ze=A!==null?A.memoizedState:null;if(me.mode==="hidden")if(!(M.mode&1))M.memoizedState={baseLanes:0,cachePool:null,transitions:null},$a(tb,Wu),Wu|=Z;else{if(!(Z&1073741824))return A=ze!==null?ze.baseLanes|Z:Z,M.lanes=M.childLanes=1073741824,M.memoizedState={baseLanes:A,cachePool:null,transitions:null},M.updateQueue=null,$a(tb,Wu),Wu|=A,null;M.memoizedState={baseLanes:0,cachePool:null,transitions:null},me=ze!==null?ze.baseLanes:Z,$a(tb,Wu),Wu|=me}else ze!==null?(me=ze.baseLanes|Z,M.memoizedState=null):me=Z,$a(tb,Wu),Wu|=me;return Gl(A,M,Pe,Z),M.child}function D8(A,M){var Z=M.ref;(A===null&&Z!==null||A!==null&&A.ref!==Z)&&(M.flags|=512,M.flags|=2097152)}function B8(A,M,Z,me,Pe){var ze=uu(Z)?Dc:hc.current;return ze=$1(M,ze),Mm(M,Pe),Z=jx(A,M,Z,me,ze,Pe),me=Q5(),A!==null&&!$c?(M.updateQueue=A.updateQueue,M.flags&=-2053,A.lanes&=~Pe,xf(A,M,Pe)):(Ga&&me&&I2(M),M.flags|=1,Gl(A,M,Z,Pe),M.child)}function $8(A,M,Z,me,Pe){if(uu(Z)){var ze=!0;wd(M)}else ze=!1;if(Mm(M,Pe),M.stateNode===null)u6(A,M),Ex(M,Z,me),O8(M,Z,me,Pe),me=!0;else if(A===null){var Ct=M.stateNode,pn=M.memoizedProps;Ct.props=pn;var kn=Ct.context,ar=Z.contextType;typeof ar=="object"&&ar!==null?ar=Nd(ar):(ar=uu(Z)?Dc:hc.current,ar=$1(M,ar));var $r=Z.getDerivedStateFromProps,Hr=typeof $r=="function"||typeof Ct.getSnapshotBeforeUpdate=="function";Hr||typeof Ct.UNSAFE_componentWillReceiveProps!="function"&&typeof Ct.componentWillReceiveProps!="function"||(pn!==me||kn!==ar)&&X1(M,Ct,me,ar),Ad=!1;var Dr=M.memoizedState;Ct.state=Dr,H1(M,me,Ct,Pe),kn=M.memoizedState,pn!==me||Dr!==kn||cu.current||Ad?(typeof $r=="function"&&(s6(M,Z,$r,me),kn=M.memoizedState),(pn=Ad||F8(M,Z,pn,me,Dr,kn,ar))?(Hr||typeof Ct.UNSAFE_componentWillMount!="function"&&typeof Ct.componentWillMount!="function"||(typeof Ct.componentWillMount=="function"&&Ct.componentWillMount(),typeof Ct.UNSAFE_componentWillMount=="function"&&Ct.UNSAFE_componentWillMount()),typeof Ct.componentDidMount=="function"&&(M.flags|=4194308)):(typeof Ct.componentDidMount=="function"&&(M.flags|=4194308),M.memoizedProps=me,M.memoizedState=kn),Ct.props=me,Ct.state=kn,Ct.context=ar,me=pn):(typeof Ct.componentDidMount=="function"&&(M.flags|=4194308),me=!1)}else{Ct=M.stateNode,DT(A,M),pn=M.memoizedProps,ar=M.type===M.elementType?pn:_d(M.type,pn),Ct.props=ar,Hr=M.pendingProps,Dr=Ct.context,kn=Z.contextType,typeof kn=="object"&&kn!==null?kn=Nd(kn):(kn=uu(Z)?Dc:hc.current,kn=$1(M,kn));var us=Z.getDerivedStateFromProps;($r=typeof us=="function"||typeof Ct.getSnapshotBeforeUpdate=="function")||typeof Ct.UNSAFE_componentWillReceiveProps!="function"&&typeof Ct.componentWillReceiveProps!="function"||(pn!==Hr||Dr!==kn)&&X1(M,Ct,me,kn),Ad=!1,Dr=M.memoizedState,Ct.state=Dr,H1(M,me,Ct,Pe);var Cs=M.memoizedState;pn!==Hr||Dr!==Cs||cu.current||Ad?(typeof us=="function"&&(s6(M,Z,us,me),Cs=M.memoizedState),(ar=Ad||F8(M,Z,ar,me,Dr,Cs,kn)||!1)?($r||typeof Ct.UNSAFE_componentWillUpdate!="function"&&typeof Ct.componentWillUpdate!="function"||(typeof Ct.componentWillUpdate=="function"&&Ct.componentWillUpdate(me,Cs,kn),typeof Ct.UNSAFE_componentWillUpdate=="function"&&Ct.UNSAFE_componentWillUpdate(me,Cs,kn)),typeof Ct.componentDidUpdate=="function"&&(M.flags|=4),typeof Ct.getSnapshotBeforeUpdate=="function"&&(M.flags|=1024)):(typeof Ct.componentDidUpdate!="function"||pn===A.memoizedProps&&Dr===A.memoizedState||(M.flags|=4),typeof Ct.getSnapshotBeforeUpdate!="function"||pn===A.memoizedProps&&Dr===A.memoizedState||(M.flags|=1024),M.memoizedProps=me,M.memoizedState=Cs),Ct.props=me,Ct.state=Cs,Ct.context=kn,me=ar):(typeof Ct.componentDidUpdate!="function"||pn===A.memoizedProps&&Dr===A.memoizedState||(M.flags|=4),typeof Ct.getSnapshotBeforeUpdate!="function"||pn===A.memoizedProps&&Dr===A.memoizedState||(M.flags|=1024),me=!1)}return U8(A,M,Z,me,ze,Pe)}function U8(A,M,Z,me,Pe,ze){D8(A,M);var Ct=(M.flags&128)!==0;if(!me&&!Ct)return Pe&&PT(M,Z,!1),xf(A,M,ze);me=M.stateNode,l6.current=M;var pn=Ct&&typeof Z.getDerivedStateFromError!="function"?null:me.render();return M.flags|=1,A!==null&&Ct?(M.child=So(M,A.child,null,ze),M.child=So(M,null,pn,ze)):Gl(A,M,pn,ze),M.memoizedState=me.state,Pe&&PT(M,Z,!0),M.child}function YT(A){var M=A.stateNode;M.pendingContext?TT(A,M.pendingContext,M.pendingContext!==M.context):M.context&&TT(A,M.context,!1),v8(A,M.containerInfo)}function dh(A,M,Z,me,Pe){return ih(),ah(Pe),M.flags|=256,Gl(A,M,Z,me),M.child}var V2={dehydrated:null,treeContext:null,retryLane:0};function W2(A){return{baseLanes:A,cachePool:null,transitions:null}}function c6(A,M,Z){var me=M.pendingProps,Pe=eo.current,ze=!1,Ct=(M.flags&128)!==0,pn;if((pn=Ct)||(pn=A!==null&&A.memoizedState===null?!1:(Pe&2)!==0),pn?(ze=!0,M.flags&=-129):(A===null||A.memoizedState!==null)&&(Pe|=1),$a(eo,Pe&1),A===null)return du(M),A=M.memoizedState,A!==null&&(A=A.dehydrated,A!==null)?(M.mode&1?A.data==="$!"?M.lanes=8:M.lanes=1073741824:M.lanes=1,null):(Ct=me.children,A=me.fallback,ze?(me=M.mode,ze=M.child,Ct={mode:"hidden",children:Ct},!(me&1)&&ze!==null?(ze.childLanes=0,ze.pendingProps=Ct):ze=A6(Ct,me,0,null),A=Fx(A,me,Z,null),ze.return=M,A.return=M,ze.sibling=A,M.child=ze,M.child.memoizedState=W2(Z),M.memoizedState=V2,A):Z1(M,Ct));if(Pe=A.memoizedState,Pe!==null&&(pn=Pe.dehydrated,pn!==null))return Hs(A,M,Ct,me,pn,Pe,Z);if(ze){ze=me.fallback,Ct=M.mode,Pe=A.child,pn=Pe.sibling;var kn={mode:"hidden",children:me.children};return!(Ct&1)&&M.child!==Pe?(me=M.child,me.childLanes=0,me.pendingProps=kn,M.deletions=null):(me=wf(Pe,kn),me.subtreeFlags=Pe.subtreeFlags&14680064),pn!==null?ze=wf(pn,ze):(ze=Fx(ze,Ct,Z,null),ze.flags|=2),ze.return=M,me.return=M,me.sibling=ze,M.child=me,me=ze,ze=M.child,Ct=A.child.memoizedState,Ct=Ct===null?W2(Z):{baseLanes:Ct.baseLanes|Z,cachePool:null,transitions:Ct.transitions},ze.memoizedState=Ct,ze.childLanes=A.childLanes&~Z,M.memoizedState=V2,me}return ze=A.child,A=ze.sibling,me=wf(ze,{mode:"visible",children:me.children}),!(M.mode&1)&&(me.lanes=Z),me.return=M,me.sibling=null,A!==null&&(Z=M.deletions,Z===null?(M.deletions=[A],M.flags|=16):Z.push(A)),M.child=me,M.memoizedState=null,me}function Z1(A,M){return M=A6({mode:"visible",children:M},A.mode,0,null),M.return=A,A.child=M}function Ap(A,M,Z,me){return me!==null&&ah(me),So(M,A.child,null,Z),A=Z1(M,M.pendingProps.children),A.flags|=2,M.memoizedState=null,A}function Hs(A,M,Z,me,Pe,ze,Ct){if(Z)return M.flags&256?(M.flags&=-257,me=a6(Error(n(422))),Ap(A,M,Ct,me)):M.memoizedState!==null?(M.child=A.child,M.flags|=128,null):(ze=me.fallback,Pe=M.mode,me=A6({mode:"visible",children:me.children},Pe,0,null),ze=Fx(ze,Pe,Ct,null),ze.flags|=2,me.return=M,ze.return=M,me.sibling=ze,M.child=me,M.mode&1&&So(M,A.child,null,Ct),M.child.memoizedState=W2(Ct),M.memoizedState=V2,ze);if(!(M.mode&1))return Ap(A,M,Ct,null);if(Pe.data==="$!"){if(me=Pe.nextSibling&&Pe.nextSibling.dataset,me)var pn=me.dgst;return me=pn,ze=Error(n(419)),me=a6(ze,me,void 0),Ap(A,M,Ct,me)}if(pn=(Ct&A.childLanes)!==0,$c||pn){if(me=Il,me!==null){switch(Ct&-Ct){case 4:Pe=2;break;case 16:Pe=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:Pe=32;break;case 536870912:Pe=268435456;break;default:Pe=0}Pe=Pe&(me.suspendedLanes|Ct)?0:Pe,Pe!==0&&Pe!==ze.retryLane&&(ze.retryLane=Pe,vp(A,Pe),vf(me,A,Pe,-1))}return n7(),me=a6(Error(n(421))),Ap(A,M,Ct,me)}return Pe.data==="$?"?(M.flags|=128,M.child=A.child,M=$U.bind(null,A),Pe._reactRetry=M,null):(A=ze.treeContext,zu=Tm(Pe.nextSibling),mc=M,Ga=!0,pf=null,A!==null&&(Cd[Sd++]=nh,Cd[Sd++]=rh,Cd[Sd++]=yx,nh=A.id,rh=A.overflow,yx=M),M=Z1(M,me.children),M.flags|=4096,M)}function q2(A,M,Z){A.lanes|=M;var me=A.alternate;me!==null&&(me.lanes|=M),ql(A.return,M,Z)}function G2(A,M,Z,me,Pe){var ze=A.memoizedState;ze===null?A.memoizedState={isBackwards:M,rendering:null,renderingStartTime:0,last:me,tail:Z,tailMode:Pe}:(ze.isBackwards=M,ze.rendering=null,ze.renderingStartTime=0,ze.last=me,ze.tail=Z,ze.tailMode=Pe)}function Dm(A,M,Z){var me=M.pendingProps,Pe=me.revealOrder,ze=me.tail;if(Gl(A,M,me.children,Z),me=eo.current,me&2)me=me&1|2,M.flags|=128;else{if(A!==null&&A.flags&128)e:for(A=M.child;A!==null;){if(A.tag===13)A.memoizedState!==null&&q2(A,Z,M);else if(A.tag===19)q2(A,Z,M);else if(A.child!==null){A.child.return=A,A=A.child;continue}if(A===M)break e;for(;A.sibling===null;){if(A.return===null||A.return===M)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}me&=1}if($a(eo,me),!(M.mode&1))M.memoizedState=null;else switch(Pe){case"forwards":for(Z=M.child,Pe=null;Z!==null;)A=Z.alternate,A!==null&&Nx(A)===null&&(Pe=Z),Z=Z.sibling;Z=Pe,Z===null?(Pe=M.child,M.child=null):(Pe=Z.sibling,Z.sibling=null),G2(M,!1,Pe,Z,ze);break;case"backwards":for(Z=null,Pe=M.child,M.child=null;Pe!==null;){if(A=Pe.alternate,A!==null&&Nx(A)===null){M.child=Pe;break}A=Pe.sibling,Pe.sibling=Z,Z=Pe,Pe=A}G2(M,!0,Z,null,ze);break;case"together":G2(M,!1,null,null,void 0);break;default:M.memoizedState=null}return M.child}function u6(A,M){!(M.mode&1)&&A!==null&&(A.alternate=null,M.alternate=null,M.flags|=2)}function xf(A,M,Z){if(A!==null&&(M.dependencies=A.dependencies),$m|=M.lanes,!(Z&M.childLanes))return null;if(A!==null&&M.child!==A.child)throw Error(n(153));if(M.child!==null){for(A=M.child,Z=wf(A,A.pendingProps),M.child=Z,Z.return=M;A.sibling!==null;)A=A.sibling,Z=Z.sibling=wf(A,A.pendingProps),Z.return=M;Z.sibling=null}return M.child}function XT(A,M,Z){switch(M.tag){case 3:YT(M),ih();break;case 5:w8(M);break;case 1:uu(M.type)&&wd(M);break;case 4:v8(M,M.stateNode.containerInfo);break;case 10:var me=M.type._context,Pe=M.memoizedProps.value;$a(O2,me._currentValue),me._currentValue=Pe;break;case 13:if(me=M.memoizedState,me!==null)return me.dehydrated!==null?($a(eo,eo.current&1),M.flags|=128,null):Z&M.child.childLanes?c6(A,M,Z):($a(eo,eo.current&1),A=xf(A,M,Z),A!==null?A.sibling:null);$a(eo,eo.current&1);break;case 19:if(me=(Z&M.childLanes)!==0,A.flags&128){if(me)return Dm(A,M,Z);M.flags|=128}if(Pe=M.memoizedState,Pe!==null&&(Pe.rendering=null,Pe.tail=null,Pe.lastEffect=null),$a(eo,eo.current),me)break;return null;case 22:case 23:return M.lanes=0,L8(A,M,Z)}return xf(A,M,Z)}var Kl,z8,QT,H8;Kl=function(A,M){for(var Z=M.child;Z!==null;){if(Z.tag===5||Z.tag===6)A.appendChild(Z.stateNode);else if(Z.tag!==4&&Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===M)break;for(;Z.sibling===null;){if(Z.return===null||Z.return===M)return;Z=Z.return}Z.sibling.return=Z.return,Z=Z.sibling}},z8=function(){},QT=function(A,M,Z,me){var Pe=A.memoizedProps;if(Pe!==me){A=M.stateNode,Cp(oh.current);var ze=null;switch(Z){case"input":Pe=tt(A,Pe),me=tt(A,me),ze=[];break;case"select":Pe=te({},Pe,{value:void 0}),me=te({},me,{value:void 0}),ze=[];break;case"textarea":Pe=mn(A,Pe),me=mn(A,me),ze=[];break;default:typeof Pe.onClick!="function"&&typeof me.onClick=="function"&&(A.onclick=M5)}Mt(Z,me);var Ct;Z=null;for(ar in Pe)if(!me.hasOwnProperty(ar)&&Pe.hasOwnProperty(ar)&&Pe[ar]!=null)if(ar==="style"){var pn=Pe[ar];for(Ct in pn)pn.hasOwnProperty(Ct)&&(Z||(Z={}),Z[Ct]="")}else ar!=="dangerouslySetInnerHTML"&&ar!=="children"&&ar!=="suppressContentEditableWarning"&&ar!=="suppressHydrationWarning"&&ar!=="autoFocus"&&(s.hasOwnProperty(ar)?ze||(ze=[]):(ze=ze||[]).push(ar,null));for(ar in me){var kn=me[ar];if(pn=Pe!=null?Pe[ar]:void 0,me.hasOwnProperty(ar)&&kn!==pn&&(kn!=null||pn!=null))if(ar==="style")if(pn){for(Ct in pn)!pn.hasOwnProperty(Ct)||kn&&kn.hasOwnProperty(Ct)||(Z||(Z={}),Z[Ct]="");for(Ct in kn)kn.hasOwnProperty(Ct)&&pn[Ct]!==kn[Ct]&&(Z||(Z={}),Z[Ct]=kn[Ct])}else Z||(ze||(ze=[]),ze.push(ar,Z)),Z=kn;else ar==="dangerouslySetInnerHTML"?(kn=kn?kn.__html:void 0,pn=pn?pn.__html:void 0,kn!=null&&pn!==kn&&(ze=ze||[]).push(ar,kn)):ar==="children"?typeof kn!="string"&&typeof kn!="number"||(ze=ze||[]).push(ar,""+kn):ar!=="suppressContentEditableWarning"&&ar!=="suppressHydrationWarning"&&(s.hasOwnProperty(ar)?(kn!=null&&ar==="onScroll"&&Wa("scroll",A),ze||pn===kn||(ze=[])):(ze=ze||[]).push(ar,kn))}Z&&(ze=ze||[]).push("style",Z);var ar=ze;(M.updateQueue=ar)&&(M.flags|=4)}},H8=function(A,M,Z,me){Z!==me&&(M.flags|=4)};function K2(A,M){if(!Ga)switch(A.tailMode){case"hidden":M=A.tail;for(var Z=null;M!==null;)M.alternate!==null&&(Z=M),M=M.sibling;Z===null?A.tail=null:Z.sibling=null;break;case"collapsed":Z=A.tail;for(var me=null;Z!==null;)Z.alternate!==null&&(me=Z),Z=Z.sibling;me===null?M||A.tail===null?A.tail=null:A.tail.sibling=null:me.sibling=null}}function Yl(A){var M=A.alternate!==null&&A.alternate.child===A.child,Z=0,me=0;if(M)for(var Pe=A.child;Pe!==null;)Z|=Pe.lanes|Pe.childLanes,me|=Pe.subtreeFlags&14680064,me|=Pe.flags&14680064,Pe.return=A,Pe=Pe.sibling;else for(Pe=A.child;Pe!==null;)Z|=Pe.lanes|Pe.childLanes,me|=Pe.subtreeFlags,me|=Pe.flags,Pe.return=A,Pe=Pe.sibling;return A.subtreeFlags|=me,A.childLanes=Z,M}function PU(A,M,Z){var me=M.pendingProps;switch(wx(M),M.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yl(M),null;case 1:return uu(M.type)&&B5(),Yl(M),null;case 3:return me=M.stateNode,Rm(),qa(cu),qa(hc),X5(),me.pendingContext&&(me.context=me.pendingContext,me.pendingContext=null),(A===null||A.child===null)&&(P2(M)?M.flags|=4:A===null||A.memoizedState.isDehydrated&&!(M.flags&256)||(M.flags|=1024,pf!==null&&(J8(pf),pf=null))),z8(A,M),Yl(M),null;case 5:Y5(M);var Pe=Cp(V1.current);if(Z=M.type,A!==null&&M.stateNode!=null)QT(A,M,Z,me,Pe),A.ref!==M.ref&&(M.flags|=512,M.flags|=2097152);else{if(!me){if(M.stateNode===null)throw Error(n(166));return Yl(M),null}if(A=Cp(oh.current),P2(M)){me=M.stateNode,Z=M.type;var ze=M.memoizedProps;switch(me[eh]=M,me[Im]=ze,A=(M.mode&1)!==0,Z){case"dialog":Wa("cancel",me),Wa("close",me);break;case"iframe":case"object":case"embed":Wa("load",me);break;case"video":case"audio":for(Pe=0;Pe<xp.length;Pe++)Wa(xp[Pe],me);break;case"source":Wa("error",me);break;case"img":case"image":case"link":Wa("error",me),Wa("load",me);break;case"details":Wa("toggle",me);break;case"input":ot(me,ze),Wa("invalid",me);break;case"select":me._wrapperState={wasMultiple:!!ze.multiple},Wa("invalid",me);break;case"textarea":dn(me,ze),Wa("invalid",me)}Mt(Z,ze),Pe=null;for(var Ct in ze)if(ze.hasOwnProperty(Ct)){var pn=ze[Ct];Ct==="children"?typeof pn=="string"?me.textContent!==pn&&(ze.suppressHydrationWarning!==!0&&E2(me.textContent,pn,A),Pe=["children",pn]):typeof pn=="number"&&me.textContent!==""+pn&&(ze.suppressHydrationWarning!==!0&&E2(me.textContent,pn,A),Pe=["children",""+pn]):s.hasOwnProperty(Ct)&&pn!=null&&Ct==="onScroll"&&Wa("scroll",me)}switch(Z){case"input":Qe(me),Vt(me,ze,!0);break;case"textarea":Qe(me),Xe(me);break;case"select":case"option":break;default:typeof ze.onClick=="function"&&(me.onclick=M5)}me=Pe,M.updateQueue=me,me!==null&&(M.flags|=4)}else{Ct=Pe.nodeType===9?Pe:Pe.ownerDocument,A==="http://www.w3.org/1999/xhtml"&&(A=Ut(Z)),A==="http://www.w3.org/1999/xhtml"?Z==="script"?(A=Ct.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild)):typeof me.is=="string"?A=Ct.createElement(Z,{is:me.is}):(A=Ct.createElement(Z),Z==="select"&&(Ct=A,me.multiple?Ct.multiple=!0:me.size&&(Ct.size=me.size))):A=Ct.createElementNS(A,Z),A[eh]=M,A[Im]=me,Kl(A,M,!1,!1),M.stateNode=A;e:{switch(Ct=Ve(Z,me),Z){case"dialog":Wa("cancel",A),Wa("close",A),Pe=me;break;case"iframe":case"object":case"embed":Wa("load",A),Pe=me;break;case"video":case"audio":for(Pe=0;Pe<xp.length;Pe++)Wa(xp[Pe],A);Pe=me;break;case"source":Wa("error",A),Pe=me;break;case"img":case"image":case"link":Wa("error",A),Wa("load",A),Pe=me;break;case"details":Wa("toggle",A),Pe=me;break;case"input":ot(A,me),Pe=tt(A,me),Wa("invalid",A);break;case"option":Pe=me;break;case"select":A._wrapperState={wasMultiple:!!me.multiple},Pe=te({},me,{value:void 0}),Wa("invalid",A);break;case"textarea":dn(A,me),Pe=mn(A,me),Wa("invalid",A);break;default:Pe=me}Mt(Z,Pe),pn=Pe;for(ze in pn)if(pn.hasOwnProperty(ze)){var kn=pn[ze];ze==="style"?et(A,kn):ze==="dangerouslySetInnerHTML"?(kn=kn?kn.__html:void 0,kn!=null&&Ke(A,kn)):ze==="children"?typeof kn=="string"?(Z!=="textarea"||kn!=="")&&pt(A,kn):typeof kn=="number"&&pt(A,""+kn):ze!=="suppressContentEditableWarning"&&ze!=="suppressHydrationWarning"&&ze!=="autoFocus"&&(s.hasOwnProperty(ze)?kn!=null&&ze==="onScroll"&&Wa("scroll",A):kn!=null&&P(A,ze,kn,Ct))}switch(Z){case"input":Qe(A),Vt(A,me,!1);break;case"textarea":Qe(A),Xe(A);break;case"option":me.value!=null&&A.setAttribute("value",""+je(me.value));break;case"select":A.multiple=!!me.multiple,ze=me.value,ze!=null?Nt(A,!!me.multiple,ze,!1):me.defaultValue!=null&&Nt(A,!!me.multiple,me.defaultValue,!0);break;default:typeof Pe.onClick=="function"&&(A.onclick=M5)}switch(Z){case"button":case"input":case"select":case"textarea":me=!!me.autoFocus;break e;case"img":me=!0;break e;default:me=!1}}me&&(M.flags|=4)}M.ref!==null&&(M.flags|=512,M.flags|=2097152)}return Yl(M),null;case 6:if(A&&M.stateNode!=null)H8(A,M,A.memoizedProps,me);else{if(typeof me!="string"&&M.stateNode===null)throw Error(n(166));if(Z=Cp(V1.current),Cp(oh.current),P2(M)){if(me=M.stateNode,Z=M.memoizedProps,me[eh]=M,(ze=me.nodeValue!==Z)&&(A=mc,A!==null))switch(A.tag){case 3:E2(me.nodeValue,Z,(A.mode&1)!==0);break;case 5:A.memoizedProps.suppressHydrationWarning!==!0&&E2(me.nodeValue,Z,(A.mode&1)!==0)}ze&&(M.flags|=4)}else me=(Z.nodeType===9?Z:Z.ownerDocument).createTextNode(me),me[eh]=M,M.stateNode=me}return Yl(M),null;case 13:if(qa(eo),me=M.memoizedState,A===null||A.memoizedState!==null&&A.memoizedState.dehydrated!==null){if(Ga&&zu!==null&&M.mode&1&&!(M.flags&128))x8(),ih(),M.flags|=98560,ze=!1;else if(ze=P2(M),me!==null&&me.dehydrated!==null){if(A===null){if(!ze)throw Error(n(318));if(ze=M.memoizedState,ze=ze!==null?ze.dehydrated:null,!ze)throw Error(n(317));ze[eh]=M}else ih(),!(M.flags&128)&&(M.memoizedState=null),M.flags|=4;Yl(M),ze=!1}else pf!==null&&(J8(pf),pf=null),ze=!0;if(!ze)return M.flags&65536?M:null}return M.flags&128?(M.lanes=Z,M):(me=me!==null,me!==(A!==null&&A.memoizedState!==null)&&me&&(M.child.flags|=8192,M.mode&1&&(A===null||eo.current&1?cl===0&&(cl=3):n7())),M.updateQueue!==null&&(M.flags|=4),Yl(M),null);case 4:return Rm(),z8(A,M),A===null&&_m(M.stateNode.containerInfo),Yl(M),null;case 10:return W5(M.type._context),Yl(M),null;case 17:return uu(M.type)&&B5(),Yl(M),null;case 19:if(qa(eo),ze=M.memoizedState,ze===null)return Yl(M),null;if(me=(M.flags&128)!==0,Ct=ze.rendering,Ct===null)if(me)K2(ze,!1);else{if(cl!==0||A!==null&&A.flags&128)for(A=M.child;A!==null;){if(Ct=Nx(A),Ct!==null){for(M.flags|=128,K2(ze,!1),me=Ct.updateQueue,me!==null&&(M.updateQueue=me,M.flags|=4),M.subtreeFlags=0,me=Z,Z=M.child;Z!==null;)ze=Z,A=me,ze.flags&=14680066,Ct=ze.alternate,Ct===null?(ze.childLanes=0,ze.lanes=A,ze.child=null,ze.subtreeFlags=0,ze.memoizedProps=null,ze.memoizedState=null,ze.updateQueue=null,ze.dependencies=null,ze.stateNode=null):(ze.childLanes=Ct.childLanes,ze.lanes=Ct.lanes,ze.child=Ct.child,ze.subtreeFlags=0,ze.deletions=null,ze.memoizedProps=Ct.memoizedProps,ze.memoizedState=Ct.memoizedState,ze.updateQueue=Ct.updateQueue,ze.type=Ct.type,A=Ct.dependencies,ze.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),Z=Z.sibling;return $a(eo,eo.current&1|2),M.child}A=A.sibling}ze.tail!==null&&Ee()>kx&&(M.flags|=128,me=!0,K2(ze,!1),M.lanes=4194304)}else{if(!me)if(A=Nx(Ct),A!==null){if(M.flags|=128,me=!0,Z=A.updateQueue,Z!==null&&(M.updateQueue=Z,M.flags|=4),K2(ze,!0),ze.tail===null&&ze.tailMode==="hidden"&&!Ct.alternate&&!Ga)return Yl(M),null}else 2*Ee()-ze.renderingStartTime>kx&&Z!==1073741824&&(M.flags|=128,me=!0,K2(ze,!1),M.lanes=4194304);ze.isBackwards?(Ct.sibling=M.child,M.child=Ct):(Z=ze.last,Z!==null?Z.sibling=Ct:M.child=Ct,ze.last=Ct)}return ze.tail!==null?(M=ze.tail,ze.rendering=M,ze.tail=M.sibling,ze.renderingStartTime=Ee(),M.sibling=null,Z=eo.current,$a(eo,me?Z&1|2:Z&1),M):(Yl(M),null);case 22:case 23:return t7(),me=M.memoizedState!==null,A!==null&&A.memoizedState!==null!==me&&(M.flags|=8192),me&&M.mode&1?Wu&1073741824&&(Yl(M),M.subtreeFlags&6&&(M.flags|=8192)):Yl(M),null;case 24:return null;case 25:return null}throw Error(n(156,M.tag))}function FU(A,M){switch(wx(M),M.tag){case 1:return uu(M.type)&&B5(),A=M.flags,A&65536?(M.flags=A&-65537|128,M):null;case 3:return Rm(),qa(cu),qa(hc),X5(),A=M.flags,A&65536&&!(A&128)?(M.flags=A&-65537|128,M):null;case 5:return Y5(M),null;case 13:if(qa(eo),A=M.memoizedState,A!==null&&A.dehydrated!==null){if(M.alternate===null)throw Error(n(340));ih()}return A=M.flags,A&65536?(M.flags=A&-65537|128,M):null;case 19:return qa(eo),null;case 4:return Rm(),null;case 10:return W5(M.type._context),null;case 22:case 23:return t7(),null;case 24:return null;default:return null}}var d6=!1,to=!1,Uc=typeof WeakSet=="function"?WeakSet:Set,gs=null;function J1(A,M){var Z=A.ref;if(Z!==null)if(typeof Z=="function")try{Z(null)}catch(me){ho(A,M,me)}else Z.current=null}function Y2(A,M,Z){try{Z()}catch(me){ho(A,M,me)}}var ZT=!1;function OU(A,M){if(_2=Br,A=ws(),Ks(A)){if("selectionStart"in A)var Z={start:A.selectionStart,end:A.selectionEnd};else e:{Z=(Z=A.ownerDocument)&&Z.defaultView||window;var me=Z.getSelection&&Z.getSelection();if(me&&me.rangeCount!==0){Z=me.anchorNode;var Pe=me.anchorOffset,ze=me.focusNode;me=me.focusOffset;try{Z.nodeType,ze.nodeType}catch{Z=null;break e}var Ct=0,pn=-1,kn=-1,ar=0,$r=0,Hr=A,Dr=null;t:for(;;){for(var us;Hr!==Z||Pe!==0&&Hr.nodeType!==3||(pn=Ct+Pe),Hr!==ze||me!==0&&Hr.nodeType!==3||(kn=Ct+me),Hr.nodeType===3&&(Ct+=Hr.nodeValue.length),(us=Hr.firstChild)!==null;)Dr=Hr,Hr=us;for(;;){if(Hr===A)break t;if(Dr===Z&&++ar===Pe&&(pn=Ct),Dr===ze&&++$r===me&&(kn=Ct),(us=Hr.nextSibling)!==null)break;Hr=Dr,Dr=Hr.parentNode}Hr=us}Z=pn===-1||kn===-1?null:{start:pn,end:kn}}else Z=null}Z=Z||{start:0,end:0}}else Z=null;for(gx={focusedElem:A,selectionRange:Z},Br=!1,gs=M;gs!==null;)if(M=gs,A=M.child,(M.subtreeFlags&1028)!==0&&A!==null)A.return=M,gs=A;else for(;gs!==null;){M=gs;try{var Cs=M.alternate;if(M.flags&1024)switch(M.tag){case 0:case 11:case 15:break;case 1:if(Cs!==null){var _s=Cs.memoizedProps,No=Cs.memoizedState,Xn=M.stateNode,Dn=Xn.getSnapshotBeforeUpdate(M.elementType===M.type?_s:_d(M.type,_s),No);Xn.__reactInternalSnapshotBeforeUpdate=Dn}break;case 3:var tr=M.stateNode.containerInfo;tr.nodeType===1?tr.textContent="":tr.nodeType===9&&tr.documentElement&&tr.removeChild(tr.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Gr){ho(M,M.return,Gr)}if(A=M.sibling,A!==null){A.return=M.return,gs=A;break}gs=M.return}return Cs=ZT,ZT=!1,Cs}function jp(A,M,Z){var me=M.updateQueue;if(me=me!==null?me.lastEffect:null,me!==null){var Pe=me=me.next;do{if((Pe.tag&A)===A){var ze=Pe.destroy;Pe.destroy=void 0,ze!==void 0&&Y2(M,Z,ze)}Pe=Pe.next}while(Pe!==me)}}function X2(A,M){if(M=M.updateQueue,M=M!==null?M.lastEffect:null,M!==null){var Z=M=M.next;do{if((Z.tag&A)===A){var me=Z.create;Z.destroy=me()}Z=Z.next}while(Z!==M)}}function f6(A){var M=A.ref;if(M!==null){var Z=A.stateNode;switch(A.tag){case 5:A=Z;break;default:A=Z}typeof M=="function"?M(A):M.current=A}}function JT(A){var M=A.alternate;M!==null&&(A.alternate=null,JT(M)),A.child=null,A.deletions=null,A.sibling=null,A.tag===5&&(M=A.stateNode,M!==null&&(delete M[eh],delete M[Im],delete M[L5],delete M[Ot],delete M[D1])),A.stateNode=null,A.return=null,A.dependencies=null,A.memoizedProps=null,A.memoizedState=null,A.pendingProps=null,A.stateNode=null,A.updateQueue=null}function eI(A){return A.tag===5||A.tag===3||A.tag===4}function tI(A){e:for(;;){for(;A.sibling===null;){if(A.return===null||eI(A.return))return null;A=A.return}for(A.sibling.return=A.return,A=A.sibling;A.tag!==5&&A.tag!==6&&A.tag!==18;){if(A.flags&2||A.child===null||A.tag===4)continue e;A.child.return=A,A=A.child}if(!(A.flags&2))return A.stateNode}}function V8(A,M,Z){var me=A.tag;if(me===5||me===6)A=A.stateNode,M?Z.nodeType===8?Z.parentNode.insertBefore(A,M):Z.insertBefore(A,M):(Z.nodeType===8?(M=Z.parentNode,M.insertBefore(A,Z)):(M=Z,M.appendChild(A)),Z=Z._reactRootContainer,Z!=null||M.onclick!==null||(M.onclick=M5));else if(me!==4&&(A=A.child,A!==null))for(V8(A,M,Z),A=A.sibling;A!==null;)V8(A,M,Z),A=A.sibling}function h6(A,M,Z){var me=A.tag;if(me===5||me===6)A=A.stateNode,M?Z.insertBefore(A,M):Z.appendChild(A);else if(me!==4&&(A=A.child,A!==null))for(h6(A,M,Z),A=A.sibling;A!==null;)h6(A,M,Z),A=A.sibling}var Tl=null,gf=!1;function fh(A,M,Z){for(Z=Z.child;Z!==null;)W8(A,M,Z),Z=Z.sibling}function W8(A,M,Z){if(W&&typeof W.onCommitFiberUnmount=="function")try{W.onCommitFiberUnmount(B,Z)}catch{}switch(Z.tag){case 5:to||J1(Z,M);case 6:var me=Tl,Pe=gf;Tl=null,fh(A,M,Z),Tl=me,gf=Pe,Tl!==null&&(gf?(A=Tl,Z=Z.stateNode,A.nodeType===8?A.parentNode.removeChild(Z):A.removeChild(Z)):Tl.removeChild(Z.stateNode));break;case 18:Tl!==null&&(gf?(A=Tl,Z=Z.stateNode,A.nodeType===8?h8(A.parentNode,Z):A.nodeType===1&&h8(A,Z),nn(A)):h8(Tl,Z.stateNode));break;case 4:me=Tl,Pe=gf,Tl=Z.stateNode.containerInfo,gf=!0,fh(A,M,Z),Tl=me,gf=Pe;break;case 0:case 11:case 14:case 15:if(!to&&(me=Z.updateQueue,me!==null&&(me=me.lastEffect,me!==null))){Pe=me=me.next;do{var ze=Pe,Ct=ze.destroy;ze=ze.tag,Ct!==void 0&&(ze&2||ze&4)&&Y2(Z,M,Ct),Pe=Pe.next}while(Pe!==me)}fh(A,M,Z);break;case 1:if(!to&&(J1(Z,M),me=Z.stateNode,typeof me.componentWillUnmount=="function"))try{me.props=Z.memoizedProps,me.state=Z.memoizedState,me.componentWillUnmount()}catch(pn){ho(Z,M,pn)}fh(A,M,Z);break;case 21:fh(A,M,Z);break;case 22:Z.mode&1?(to=(me=to)||Z.memoizedState!==null,fh(A,M,Z),to=me):fh(A,M,Z);break;default:fh(A,M,Z)}}function eb(A){var M=A.updateQueue;if(M!==null){A.updateQueue=null;var Z=A.stateNode;Z===null&&(Z=A.stateNode=new Uc),M.forEach(function(me){var Pe=UU.bind(null,A,me);Z.has(me)||(Z.add(me),me.then(Pe,Pe))})}}function Vu(A,M){var Z=M.deletions;if(Z!==null)for(var me=0;me<Z.length;me++){var Pe=Z[me];try{var ze=A,Ct=M,pn=Ct;e:for(;pn!==null;){switch(pn.tag){case 5:Tl=pn.stateNode,gf=!1;break e;case 3:Tl=pn.stateNode.containerInfo,gf=!0;break e;case 4:Tl=pn.stateNode.containerInfo,gf=!0;break e}pn=pn.return}if(Tl===null)throw Error(n(160));W8(ze,Ct,Pe),Tl=null,gf=!1;var kn=Pe.alternate;kn!==null&&(kn.return=null),Pe.return=null}catch(ar){ho(Pe,M,ar)}}if(M.subtreeFlags&12854)for(M=M.child;M!==null;)q8(M,A),M=M.sibling}function q8(A,M){var Z=A.alternate,me=A.flags;switch(A.tag){case 0:case 11:case 14:case 15:if(Vu(M,A),bf(A),me&4){try{jp(3,A,A.return),X2(3,A)}catch(_s){ho(A,A.return,_s)}try{jp(5,A,A.return)}catch(_s){ho(A,A.return,_s)}}break;case 1:Vu(M,A),bf(A),me&512&&Z!==null&&J1(Z,Z.return);break;case 5:if(Vu(M,A),bf(A),me&512&&Z!==null&&J1(Z,Z.return),A.flags&32){var Pe=A.stateNode;try{pt(Pe,"")}catch(_s){ho(A,A.return,_s)}}if(me&4&&(Pe=A.stateNode,Pe!=null)){var ze=A.memoizedProps,Ct=Z!==null?Z.memoizedProps:ze,pn=A.type,kn=A.updateQueue;if(A.updateQueue=null,kn!==null)try{pn==="input"&&ze.type==="radio"&&ze.name!=null&&ft(Pe,ze),Ve(pn,Ct);var ar=Ve(pn,ze);for(Ct=0;Ct<kn.length;Ct+=2){var $r=kn[Ct],Hr=kn[Ct+1];$r==="style"?et(Pe,Hr):$r==="dangerouslySetInnerHTML"?Ke(Pe,Hr):$r==="children"?pt(Pe,Hr):P(Pe,$r,Hr,ar)}switch(pn){case"input":ct(Pe,ze);break;case"textarea":Pt(Pe,ze);break;case"select":var Dr=Pe._wrapperState.wasMultiple;Pe._wrapperState.wasMultiple=!!ze.multiple;var us=ze.value;us!=null?Nt(Pe,!!ze.multiple,us,!1):Dr!==!!ze.multiple&&(ze.defaultValue!=null?Nt(Pe,!!ze.multiple,ze.defaultValue,!0):Nt(Pe,!!ze.multiple,ze.multiple?[]:"",!1))}Pe[Im]=ze}catch(_s){ho(A,A.return,_s)}}break;case 6:if(Vu(M,A),bf(A),me&4){if(A.stateNode===null)throw Error(n(162));Pe=A.stateNode,ze=A.memoizedProps;try{Pe.nodeValue=ze}catch(_s){ho(A,A.return,_s)}}break;case 3:if(Vu(M,A),bf(A),me&4&&Z!==null&&Z.memoizedState.isDehydrated)try{nn(M.containerInfo)}catch(_s){ho(A,A.return,_s)}break;case 4:Vu(M,A),bf(A);break;case 13:Vu(M,A),bf(A),Pe=A.child,Pe.flags&8192&&(ze=Pe.memoizedState!==null,Pe.stateNode.isHidden=ze,!ze||Pe.alternate!==null&&Pe.alternate.memoizedState!==null||(Y8=Ee())),me&4&&eb(A);break;case 22:if($r=Z!==null&&Z.memoizedState!==null,A.mode&1?(to=(ar=to)||$r,Vu(M,A),to=ar):Vu(M,A),bf(A),me&8192){if(ar=A.memoizedState!==null,(A.stateNode.isHidden=ar)&&!$r&&A.mode&1)for(gs=A,$r=A.child;$r!==null;){for(Hr=gs=$r;gs!==null;){switch(Dr=gs,us=Dr.child,Dr.tag){case 0:case 11:case 14:case 15:jp(4,Dr,Dr.return);break;case 1:J1(Dr,Dr.return);var Cs=Dr.stateNode;if(typeof Cs.componentWillUnmount=="function"){me=Dr,Z=Dr.return;try{M=me,Cs.props=M.memoizedProps,Cs.state=M.memoizedState,Cs.componentWillUnmount()}catch(_s){ho(me,Z,_s)}}break;case 5:J1(Dr,Dr.return);break;case 22:if(Dr.memoizedState!==null){Bm(Hr);continue}}us!==null?(us.return=Dr,gs=us):Bm(Hr)}$r=$r.sibling}e:for($r=null,Hr=A;;){if(Hr.tag===5){if($r===null){$r=Hr;try{Pe=Hr.stateNode,ar?(ze=Pe.style,typeof ze.setProperty=="function"?ze.setProperty("display","none","important"):ze.display="none"):(pn=Hr.stateNode,kn=Hr.memoizedProps.style,Ct=kn!=null&&kn.hasOwnProperty("display")?kn.display:null,pn.style.display=Et("display",Ct))}catch(_s){ho(A,A.return,_s)}}}else if(Hr.tag===6){if($r===null)try{Hr.stateNode.nodeValue=ar?"":Hr.memoizedProps}catch(_s){ho(A,A.return,_s)}}else if((Hr.tag!==22&&Hr.tag!==23||Hr.memoizedState===null||Hr===A)&&Hr.child!==null){Hr.child.return=Hr,Hr=Hr.child;continue}if(Hr===A)break e;for(;Hr.sibling===null;){if(Hr.return===null||Hr.return===A)break e;$r===Hr&&($r=null),Hr=Hr.return}$r===Hr&&($r=null),Hr.sibling.return=Hr.return,Hr=Hr.sibling}}break;case 19:Vu(M,A),bf(A),me&4&&eb(A);break;case 21:break;default:Vu(M,A),bf(A)}}function bf(A){var M=A.flags;if(M&2){try{e:{for(var Z=A.return;Z!==null;){if(eI(Z)){var me=Z;break e}Z=Z.return}throw Error(n(160))}switch(me.tag){case 5:var Pe=me.stateNode;me.flags&32&&(pt(Pe,""),me.flags&=-33);var ze=tI(A);h6(A,ze,Pe);break;case 3:case 4:var Ct=me.stateNode.containerInfo,pn=tI(A);V8(A,pn,Ct);break;default:throw Error(n(161))}}catch(kn){ho(A,A.return,kn)}A.flags&=-3}M&4096&&(A.flags&=-4097)}function p6(A,M,Z){gs=A,G8(A)}function G8(A,M,Z){for(var me=(A.mode&1)!==0;gs!==null;){var Pe=gs,ze=Pe.child;if(Pe.tag===22&&me){var Ct=Pe.memoizedState!==null||d6;if(!Ct){var pn=Pe.alternate,kn=pn!==null&&pn.memoizedState!==null||to;pn=d6;var ar=to;if(d6=Ct,(to=kn)&&!ar)for(gs=Pe;gs!==null;)Ct=gs,kn=Ct.child,Ct.tag===22&&Ct.memoizedState!==null?nI(Pe):kn!==null?(kn.return=Ct,gs=kn):nI(Pe);for(;ze!==null;)gs=ze,G8(ze),ze=ze.sibling;gs=Pe,d6=pn,to=ar}yf(A)}else Pe.subtreeFlags&8772&&ze!==null?(ze.return=Pe,gs=ze):yf(A)}}function yf(A){for(;gs!==null;){var M=gs;if(M.flags&8772){var Z=M.alternate;try{if(M.flags&8772)switch(M.tag){case 0:case 11:case 15:to||X2(5,M);break;case 1:var me=M.stateNode;if(M.flags&4&&!to)if(Z===null)me.componentDidMount();else{var Pe=M.elementType===M.type?Z.memoizedProps:_d(M.type,Z.memoizedProps);me.componentDidUpdate(Pe,Z.memoizedState,me.__reactInternalSnapshotBeforeUpdate)}var ze=M.updateQueue;ze!==null&&y8(M,ze,me);break;case 3:var Ct=M.updateQueue;if(Ct!==null){if(Z=null,M.child!==null)switch(M.child.tag){case 5:Z=M.child.stateNode;break;case 1:Z=M.child.stateNode}y8(M,Ct,Z)}break;case 5:var pn=M.stateNode;if(Z===null&&M.flags&4){Z=pn;var kn=M.memoizedProps;switch(M.type){case"button":case"input":case"select":case"textarea":kn.autoFocus&&Z.focus();break;case"img":kn.src&&(Z.src=kn.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(M.memoizedState===null){var ar=M.alternate;if(ar!==null){var $r=ar.memoizedState;if($r!==null){var Hr=$r.dehydrated;Hr!==null&&nn(Hr)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}to||M.flags&512&&f6(M)}catch(Dr){ho(M,M.return,Dr)}}if(M===A){gs=null;break}if(Z=M.sibling,Z!==null){Z.return=M.return,gs=Z;break}gs=M.return}}function Bm(A){for(;gs!==null;){var M=gs;if(M===A){gs=null;break}var Z=M.sibling;if(Z!==null){Z.return=M.return,gs=Z;break}gs=M.return}}function nI(A){for(;gs!==null;){var M=gs;try{switch(M.tag){case 0:case 11:case 15:var Z=M.return;try{X2(4,M)}catch(kn){ho(M,Z,kn)}break;case 1:var me=M.stateNode;if(typeof me.componentDidMount=="function"){var Pe=M.return;try{me.componentDidMount()}catch(kn){ho(M,Pe,kn)}}var ze=M.return;try{f6(M)}catch(kn){ho(M,ze,kn)}break;case 5:var Ct=M.return;try{f6(M)}catch(kn){ho(M,Ct,kn)}}}catch(kn){ho(M,M.return,kn)}if(M===A){gs=null;break}var pn=M.sibling;if(pn!==null){pn.return=M.return,gs=pn;break}gs=M.return}}var rI=Math.ceil,m6=R.ReactCurrentDispatcher,K8=R.ReactCurrentOwner,kd=R.ReactCurrentBatchConfig,Yi=0,Il=null,qo=null,Xl=0,Wu=0,tb=lu(0),cl=0,Q2=null,$m=0,Z2=0,x6=0,J2=null,hu=null,Y8=0,kx=1/0,Ep=null,g6=!1,X8=null,Um=null,b6=!1,zm=null,zc=0,ev=0,Q8=null,y6=-1,tv=0;function Hc(){return Yi&6?Ee():y6!==-1?y6:y6=Ee()}function Hm(A){return A.mode&1?Yi&2&&Xl!==0?Xl&-Xl:RT.transition!==null?(tv===0&&(tv=De()),tv):(A=bt,A!==0||(A=window.event,A=A===void 0?16:vi(A.type)),A):1}function vf(A,M,Z,me){if(50<ev)throw ev=0,Q8=null,Error(n(185));_e(A,Z,me),(!(Yi&2)||A!==Il)&&(A===Il&&(!(Yi&2)&&(Z2|=Z),cl===4&&Vm(A,Xl)),pu(A,me),Z===1&&Yi===0&&!(M.mode&1)&&(kx=Ee()+500,$5&&Fm()))}function pu(A,M){var Z=A.callbackNode;se(A,M);var me=Fe(A,A===Il?Xl:0);if(me===0)Z!==null&&Qn(Z),A.callbackNode=null,A.callbackPriority=0;else if(M=me&-me,A.callbackPriority!==M){if(Z!=null&&Qn(Z),M===1)A.tag===0?bx(sI.bind(null,A)):FT(sI.bind(null,A)),R5(function(){!(Yi&6)&&Fm()}),Z=null;else{switch(Zt(me)){case 1:Z=h;break;case 4:Z=S;break;case 16:Z=_;break;case 536870912:Z=T;break;default:Z=_}Z=dI(Z,v6.bind(null,A))}A.callbackPriority=M,A.callbackNode=Z}}function v6(A,M){if(y6=-1,tv=0,Yi&6)throw Error(n(327));var Z=A.callbackNode;if(nb()&&A.callbackNode!==Z)return null;var me=Fe(A,A===Il?Xl:0);if(me===0)return null;if(me&30||me&A.expiredLanes||M)M=w6(A,me);else{M=me;var Pe=Yi;Yi|=2;var ze=aI();(Il!==A||Xl!==M)&&(Ep=null,kx=Ee()+500,Ix(A,M));do try{LU();break}catch(pn){iI(A,pn)}while(!0);yp(),m6.current=ze,Yi=Pe,qo!==null?M=0:(Il=null,Xl=0,M=cl)}if(M!==0){if(M===2&&(Pe=Se(A),Pe!==0&&(me=Pe,M=Z8(A,Pe))),M===1)throw Z=Q2,Ix(A,0),Vm(A,me),pu(A,Ee()),Z;if(M===6)Vm(A,me);else{if(Pe=A.current.alternate,!(me&30)&&!MU(Pe)&&(M=w6(A,me),M===2&&(ze=Se(A),ze!==0&&(me=ze,M=Z8(A,ze))),M===1))throw Z=Q2,Ix(A,0),Vm(A,me),pu(A,Ee()),Z;switch(A.finishedWork=Pe,A.finishedLanes=me,M){case 0:case 1:throw Error(n(345));case 2:Px(A,hu,Ep);break;case 3:if(Vm(A,me),(me&130023424)===me&&(M=Y8+500-Ee(),10<M)){if(Fe(A,0)!==0)break;if(Pe=A.suspendedLanes,(Pe&me)!==me){Hc(),A.pingedLanes|=A.suspendedLanes&Pe;break}A.timeoutHandle=km(Px.bind(null,A,hu,Ep),M);break}Px(A,hu,Ep);break;case 4:if(Vm(A,me),(me&4194240)===me)break;for(M=A.eventTimes,Pe=-1;0<me;){var Ct=31-de(me);ze=1<<Ct,Ct=M[Ct],Ct>Pe&&(Pe=Ct),me&=~ze}if(me=Pe,me=Ee()-me,me=(120>me?120:480>me?480:1080>me?1080:1920>me?1920:3e3>me?3e3:4320>me?4320:1960*rI(me/1960))-me,10<me){A.timeoutHandle=km(Px.bind(null,A,hu,Ep),me);break}Px(A,hu,Ep);break;case 5:Px(A,hu,Ep);break;default:throw Error(n(329))}}}return pu(A,Ee()),A.callbackNode===Z?v6.bind(null,A):null}function Z8(A,M){var Z=J2;return A.current.memoizedState.isDehydrated&&(Ix(A,M).flags|=256),A=w6(A,M),A!==2&&(M=hu,hu=Z,M!==null&&J8(M)),A}function J8(A){hu===null?hu=A:hu.push.apply(hu,A)}function MU(A){for(var M=A;;){if(M.flags&16384){var Z=M.updateQueue;if(Z!==null&&(Z=Z.stores,Z!==null))for(var me=0;me<Z.length;me++){var Pe=Z[me],ze=Pe.getSnapshot;Pe=Pe.value;try{if(!Kt(ze(),Pe))return!1}catch{return!1}}}if(Z=M.child,M.subtreeFlags&16384&&Z!==null)Z.return=M,M=Z;else{if(M===A)break;for(;M.sibling===null;){if(M.return===null||M.return===A)return!0;M=M.return}M.sibling.return=M.return,M=M.sibling}}return!0}function Vm(A,M){for(M&=~x6,M&=~Z2,A.suspendedLanes|=M,A.pingedLanes&=~M,A=A.expirationTimes;0<M;){var Z=31-de(M),me=1<<Z;A[Z]=-1,M&=~me}}function sI(A){if(Yi&6)throw Error(n(327));nb();var M=Fe(A,0);if(!(M&1))return pu(A,Ee()),null;var Z=w6(A,M);if(A.tag!==0&&Z===2){var me=Se(A);me!==0&&(M=me,Z=Z8(A,me))}if(Z===1)throw Z=Q2,Ix(A,0),Vm(A,M),pu(A,Ee()),Z;if(Z===6)throw Error(n(345));return A.finishedWork=A.current.alternate,A.finishedLanes=M,Px(A,hu,Ep),pu(A,Ee()),null}function e7(A,M){var Z=Yi;Yi|=1;try{return A(M)}finally{Yi=Z,Yi===0&&(kx=Ee()+500,$5&&Fm())}}function Tx(A){zm!==null&&zm.tag===0&&!(Yi&6)&&nb();var M=Yi;Yi|=1;var Z=kd.transition,me=bt;try{if(kd.transition=null,bt=1,A)return A()}finally{bt=me,kd.transition=Z,Yi=M,!(Yi&6)&&Fm()}}function t7(){Wu=tb.current,qa(tb)}function Ix(A,M){A.finishedWork=null,A.finishedLanes=0;var Z=A.timeoutHandle;if(Z!==-1&&(A.timeoutHandle=-1,T2(Z)),qo!==null)for(Z=qo.return;Z!==null;){var me=Z;switch(wx(me),me.tag){case 1:me=me.type.childContextTypes,me!=null&&B5();break;case 3:Rm(),qa(cu),qa(hc),X5();break;case 5:Y5(me);break;case 4:Rm();break;case 13:qa(eo);break;case 19:qa(eo);break;case 10:W5(me.type._context);break;case 22:case 23:t7()}Z=Z.return}if(Il=A,qo=A=wf(A.current,null),Xl=Wu=M,cl=0,Q2=null,x6=Z2=$m=0,hu=J2=null,Sx!==null){for(M=0;M<Sx.length;M++)if(Z=Sx[M],me=Z.interleaved,me!==null){Z.interleaved=null;var Pe=me.next,ze=Z.pending;if(ze!==null){var Ct=ze.next;ze.next=Pe,me.next=Ct}Z.pending=me}Sx=null}return A}function iI(A,M){do{var Z=qo;try{if(yp(),L2.current=n6,W1){for(var me=fo.memoizedState;me!==null;){var Pe=me.queue;Pe!==null&&(Pe.pending=null),me=me.next}W1=!1}if(Lm=0,ll=Ro=fo=null,D2=!1,Ax=0,K8.current=null,Z===null||Z.return===null){cl=1,Q2=M,qo=null;break}e:{var ze=A,Ct=Z.return,pn=Z,kn=M;if(M=Xl,pn.flags|=32768,kn!==null&&typeof kn=="object"&&typeof kn.then=="function"){var ar=kn,$r=pn,Hr=$r.tag;if(!($r.mode&1)&&(Hr===0||Hr===11||Hr===15)){var Dr=$r.alternate;Dr?($r.updateQueue=Dr.updateQueue,$r.memoizedState=Dr.memoizedState,$r.lanes=Dr.lanes):($r.updateQueue=null,$r.memoizedState=null)}var us=GT(Ct);if(us!==null){us.flags&=-257,M8(us,Ct,pn,ze,M),us.mode&1&&H2(ze,ar,M),M=us,kn=ar;var Cs=M.updateQueue;if(Cs===null){var _s=new Set;_s.add(kn),M.updateQueue=_s}else Cs.add(kn);break e}else{if(!(M&1)){H2(ze,ar,M),n7();break e}kn=Error(n(426))}}else if(Ga&&pn.mode&1){var No=GT(Ct);if(No!==null){!(No.flags&65536)&&(No.flags|=256),M8(No,Ct,pn,ze,M),ah(_x(kn,pn));break e}}ze=kn=_x(kn,pn),cl!==4&&(cl=2),J2===null?J2=[ze]:J2.push(ze),ze=Ct;do{switch(ze.tag){case 3:ze.flags|=65536,M&=-M,ze.lanes|=M;var Xn=z2(ze,kn,M);BT(ze,Xn);break e;case 1:pn=kn;var Dn=ze.type,tr=ze.stateNode;if(!(ze.flags&128)&&(typeof Dn.getDerivedStateFromError=="function"||tr!==null&&typeof tr.componentDidCatch=="function"&&(Um===null||!Um.has(tr)))){ze.flags|=65536,M&=-M,ze.lanes|=M;var Gr=o6(ze,pn,M);BT(ze,Gr);break e}}ze=ze.return}while(ze!==null)}lI(Z)}catch(ks){M=ks,qo===Z&&Z!==null&&(qo=Z=Z.return);continue}break}while(!0)}function aI(){var A=m6.current;return m6.current=n6,A===null?n6:A}function n7(){(cl===0||cl===3||cl===2)&&(cl=4),Il===null||!($m&268435455)&&!(Z2&268435455)||Vm(Il,Xl)}function w6(A,M){var Z=Yi;Yi|=2;var me=aI();(Il!==A||Xl!==M)&&(Ep=null,Ix(A,M));do try{RU();break}catch(Pe){iI(A,Pe)}while(!0);if(yp(),Yi=Z,m6.current=me,qo!==null)throw Error(n(261));return Il=null,Xl=0,cl}function RU(){for(;qo!==null;)oI(qo)}function LU(){for(;qo!==null&&!Rt();)oI(qo)}function oI(A){var M=uI(A.alternate,A,Wu);A.memoizedProps=A.pendingProps,M===null?lI(A):qo=M,K8.current=null}function lI(A){var M=A;do{var Z=M.alternate;if(A=M.return,M.flags&32768){if(Z=FU(Z,M),Z!==null){Z.flags&=32767,qo=Z;return}if(A!==null)A.flags|=32768,A.subtreeFlags=0,A.deletions=null;else{cl=6,qo=null;return}}else if(Z=PU(Z,M,Wu),Z!==null){qo=Z;return}if(M=M.sibling,M!==null){qo=M;return}qo=M=A}while(M!==null);cl===0&&(cl=5)}function Px(A,M,Z){var me=bt,Pe=kd.transition;try{kd.transition=null,bt=1,DU(A,M,Z,me)}finally{kd.transition=Pe,bt=me}return null}function DU(A,M,Z,me){do nb();while(zm!==null);if(Yi&6)throw Error(n(327));Z=A.finishedWork;var Pe=A.finishedLanes;if(Z===null)return null;if(A.finishedWork=null,A.finishedLanes=0,Z===A.current)throw Error(n(177));A.callbackNode=null,A.callbackPriority=0;var ze=Z.lanes|Z.childLanes;if(nt(A,ze),A===Il&&(qo=Il=null,Xl=0),!(Z.subtreeFlags&2064)&&!(Z.flags&2064)||b6||(b6=!0,dI(_,function(){return nb(),null})),ze=(Z.flags&15990)!==0,Z.subtreeFlags&15990||ze){ze=kd.transition,kd.transition=null;var Ct=bt;bt=1;var pn=Yi;Yi|=4,K8.current=null,OU(A,Z),q8(Z,A),uc(gx),Br=!!_2,gx=_2=null,A.current=Z,p6(Z),Pn(),Yi=pn,bt=Ct,kd.transition=ze}else A.current=Z;if(b6&&(b6=!1,zm=A,zc=Pe),ze=A.pendingLanes,ze===0&&(Um=null),ee(Z.stateNode),pu(A,Ee()),M!==null)for(me=A.onRecoverableError,Z=0;Z<M.length;Z++)Pe=M[Z],me(Pe.value,{componentStack:Pe.stack,digest:Pe.digest});if(g6)throw g6=!1,A=X8,X8=null,A;return zc&1&&A.tag!==0&&nb(),ze=A.pendingLanes,ze&1?A===Q8?ev++:(ev=0,Q8=A):ev=0,Fm(),null}function nb(){if(zm!==null){var A=Zt(zc),M=kd.transition,Z=bt;try{if(kd.transition=null,bt=16>A?16:A,zm===null)var me=!1;else{if(A=zm,zm=null,zc=0,Yi&6)throw Error(n(331));var Pe=Yi;for(Yi|=4,gs=A.current;gs!==null;){var ze=gs,Ct=ze.child;if(gs.flags&16){var pn=ze.deletions;if(pn!==null){for(var kn=0;kn<pn.length;kn++){var ar=pn[kn];for(gs=ar;gs!==null;){var $r=gs;switch($r.tag){case 0:case 11:case 15:jp(8,$r,ze)}var Hr=$r.child;if(Hr!==null)Hr.return=$r,gs=Hr;else for(;gs!==null;){$r=gs;var Dr=$r.sibling,us=$r.return;if(JT($r),$r===ar){gs=null;break}if(Dr!==null){Dr.return=us,gs=Dr;break}gs=us}}}var Cs=ze.alternate;if(Cs!==null){var _s=Cs.child;if(_s!==null){Cs.child=null;do{var No=_s.sibling;_s.sibling=null,_s=No}while(_s!==null)}}gs=ze}}if(ze.subtreeFlags&2064&&Ct!==null)Ct.return=ze,gs=Ct;else e:for(;gs!==null;){if(ze=gs,ze.flags&2048)switch(ze.tag){case 0:case 11:case 15:jp(9,ze,ze.return)}var Xn=ze.sibling;if(Xn!==null){Xn.return=ze.return,gs=Xn;break e}gs=ze.return}}var Dn=A.current;for(gs=Dn;gs!==null;){Ct=gs;var tr=Ct.child;if(Ct.subtreeFlags&2064&&tr!==null)tr.return=Ct,gs=tr;else e:for(Ct=Dn;gs!==null;){if(pn=gs,pn.flags&2048)try{switch(pn.tag){case 0:case 11:case 15:X2(9,pn)}}catch(ks){ho(pn,pn.return,ks)}if(pn===Ct){gs=null;break e}var Gr=pn.sibling;if(Gr!==null){Gr.return=pn.return,gs=Gr;break e}gs=pn.return}}if(Yi=Pe,Fm(),W&&typeof W.onPostCommitFiberRoot=="function")try{W.onPostCommitFiberRoot(B,A)}catch{}me=!0}return me}finally{bt=Z,kd.transition=M}}return!1}function C6(A,M,Z){M=_x(Z,M),M=z2(A,M,1),A=jd(A,M,1),M=Hc(),A!==null&&(_e(A,1,M),pu(A,M))}function ho(A,M,Z){if(A.tag===3)C6(A,A,Z);else for(;M!==null;){if(M.tag===3){C6(M,A,Z);break}else if(M.tag===1){var me=M.stateNode;if(typeof M.type.getDerivedStateFromError=="function"||typeof me.componentDidCatch=="function"&&(Um===null||!Um.has(me))){A=_x(Z,A),A=o6(M,A,1),M=jd(M,A,1),A=Hc(),M!==null&&(_e(M,1,A),pu(M,A));break}}M=M.return}}function BU(A,M,Z){var me=A.pingCache;me!==null&&me.delete(M),M=Hc(),A.pingedLanes|=A.suspendedLanes&Z,Il===A&&(Xl&Z)===Z&&(cl===4||cl===3&&(Xl&130023424)===Xl&&500>Ee()-Y8?Ix(A,0):x6|=Z),pu(A,M)}function cI(A,M){M===0&&(A.mode&1?(M=Me,Me<<=1,!(Me&130023424)&&(Me=4194304)):M=1);var Z=Hc();A=vp(A,M),A!==null&&(_e(A,M,Z),pu(A,Z))}function $U(A){var M=A.memoizedState,Z=0;M!==null&&(Z=M.retryLane),cI(A,Z)}function UU(A,M){var Z=0;switch(A.tag){case 13:var me=A.stateNode,Pe=A.memoizedState;Pe!==null&&(Z=Pe.retryLane);break;case 19:me=A.stateNode;break;default:throw Error(n(314))}me!==null&&me.delete(M),cI(A,Z)}var uI;uI=function(A,M,Z){if(A!==null)if(A.memoizedProps!==M.pendingProps||cu.current)$c=!0;else{if(!(A.lanes&Z)&&!(M.flags&128))return $c=!1,XT(A,M,Z);$c=!!(A.flags&131072)}else $c=!1,Ga&&M.flags&1048576&&OT(M,z5,M.index);switch(M.lanes=0,M.tag){case 2:var me=M.type;u6(A,M),A=M.pendingProps;var Pe=$1(M,hc.current);Mm(M,Z),Pe=jx(null,M,me,A,Pe,Z);var ze=Q5();return M.flags|=1,typeof Pe=="object"&&Pe!==null&&typeof Pe.render=="function"&&Pe.$$typeof===void 0?(M.tag=1,M.memoizedState=null,M.updateQueue=null,uu(me)?(ze=!0,wd(M)):ze=!1,M.memoizedState=Pe.state!==null&&Pe.state!==void 0?Pe.state:null,G5(M),Pe.updater=i6,M.stateNode=Pe,Pe._reactInternals=M,O8(M,me,A,Z),M=U8(null,M,me,!0,ze,Z)):(M.tag=0,Ga&&ze&&I2(M),Gl(null,M,Pe,Z),M=M.child),M;case 16:me=M.elementType;e:{switch(u6(A,M),A=M.pendingProps,Pe=me._init,me=Pe(me._payload),M.type=me,Pe=M.tag=HU(me),A=_d(me,A),Pe){case 0:M=B8(null,M,me,A,Z);break e;case 1:M=$8(null,M,me,A,Z);break e;case 11:M=KT(null,M,me,A,Z);break e;case 14:M=R8(null,M,me,_d(me.type,A),Z);break e}throw Error(n(306,me,""))}return M;case 0:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:_d(me,Pe),B8(A,M,me,Pe,Z);case 1:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:_d(me,Pe),$8(A,M,me,Pe,Z);case 3:e:{if(YT(M),A===null)throw Error(n(387));me=M.pendingProps,ze=M.memoizedState,Pe=ze.element,DT(A,M),H1(M,me,null,Z);var Ct=M.memoizedState;if(me=Ct.element,ze.isDehydrated)if(ze={element:me,isDehydrated:!1,cache:Ct.cache,pendingSuspenseBoundaries:Ct.pendingSuspenseBoundaries,transitions:Ct.transitions},M.updateQueue.baseState=ze,M.memoizedState=ze,M.flags&256){Pe=_x(Error(n(423)),M),M=dh(A,M,me,Z,Pe);break e}else if(me!==Pe){Pe=_x(Error(n(424)),M),M=dh(A,M,me,Z,Pe);break e}else for(zu=Tm(M.stateNode.containerInfo.firstChild),mc=M,Ga=!0,pf=null,Z=V5(M,null,me,Z),M.child=Z;Z;)Z.flags=Z.flags&-3|4096,Z=Z.sibling;else{if(ih(),me===Pe){M=xf(A,M,Z);break e}Gl(A,M,me,Z)}M=M.child}return M;case 5:return w8(M),A===null&&du(M),me=M.type,Pe=M.pendingProps,ze=A!==null?A.memoizedProps:null,Ct=Pe.children,k2(me,Pe)?Ct=null:ze!==null&&k2(me,ze)&&(M.flags|=32),D8(A,M),Gl(A,M,Ct,Z),M.child;case 6:return A===null&&du(M),null;case 13:return c6(A,M,Z);case 4:return v8(M,M.stateNode.containerInfo),me=M.pendingProps,A===null?M.child=So(M,null,me,Z):Gl(A,M,me,Z),M.child;case 11:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:_d(me,Pe),KT(A,M,me,Pe,Z);case 7:return Gl(A,M,M.pendingProps,Z),M.child;case 8:return Gl(A,M,M.pendingProps.children,Z),M.child;case 12:return Gl(A,M,M.pendingProps.children,Z),M.child;case 10:e:{if(me=M.type._context,Pe=M.pendingProps,ze=M.memoizedProps,Ct=Pe.value,$a(O2,me._currentValue),me._currentValue=Ct,ze!==null)if(Kt(ze.value,Ct)){if(ze.children===Pe.children&&!cu.current){M=xf(A,M,Z);break e}}else for(ze=M.child,ze!==null&&(ze.return=M);ze!==null;){var pn=ze.dependencies;if(pn!==null){Ct=ze.child;for(var kn=pn.firstContext;kn!==null;){if(kn.context===me){if(ze.tag===1){kn=wp(-1,Z&-Z),kn.tag=2;var ar=ze.updateQueue;if(ar!==null){ar=ar.shared;var $r=ar.pending;$r===null?kn.next=kn:(kn.next=$r.next,$r.next=kn),ar.pending=kn}}ze.lanes|=Z,kn=ze.alternate,kn!==null&&(kn.lanes|=Z),ql(ze.return,Z,M),pn.lanes|=Z;break}kn=kn.next}}else if(ze.tag===10)Ct=ze.type===M.type?null:ze.child;else if(ze.tag===18){if(Ct=ze.return,Ct===null)throw Error(n(341));Ct.lanes|=Z,pn=Ct.alternate,pn!==null&&(pn.lanes|=Z),ql(Ct,Z,M),Ct=ze.sibling}else Ct=ze.child;if(Ct!==null)Ct.return=ze;else for(Ct=ze;Ct!==null;){if(Ct===M){Ct=null;break}if(ze=Ct.sibling,ze!==null){ze.return=Ct.return,Ct=ze;break}Ct=Ct.return}ze=Ct}Gl(A,M,Pe.children,Z),M=M.child}return M;case 9:return Pe=M.type,me=M.pendingProps.children,Mm(M,Z),Pe=Nd(Pe),me=me(Pe),M.flags|=1,Gl(A,M,me,Z),M.child;case 14:return me=M.type,Pe=_d(me,M.pendingProps),Pe=_d(me.type,Pe),R8(A,M,me,Pe,Z);case 15:return uh(A,M,M.type,M.pendingProps,Z);case 17:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:_d(me,Pe),u6(A,M),M.tag=1,uu(me)?(A=!0,wd(M)):A=!1,Mm(M,Z),Ex(M,me,Pe),O8(M,me,Pe,Z),U8(null,M,me,!0,A,Z);case 19:return Dm(A,M,Z);case 22:return L8(A,M,Z)}throw Error(n(156,M.tag))};function dI(A,M){return Un(A,M)}function zU(A,M,Z,me){this.tag=A,this.key=Z,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=M,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=me,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Td(A,M,Z,me){return new zU(A,M,Z,me)}function S6(A){return A=A.prototype,!(!A||!A.isReactComponent)}function HU(A){if(typeof A=="function")return S6(A)?1:0;if(A!=null){if(A=A.$$typeof,A===X)return 11;if(A===Y)return 14}return 2}function wf(A,M){var Z=A.alternate;return Z===null?(Z=Td(A.tag,M,A.key,A.mode),Z.elementType=A.elementType,Z.type=A.type,Z.stateNode=A.stateNode,Z.alternate=A,A.alternate=Z):(Z.pendingProps=M,Z.type=A.type,Z.flags=0,Z.subtreeFlags=0,Z.deletions=null),Z.flags=A.flags&14680064,Z.childLanes=A.childLanes,Z.lanes=A.lanes,Z.child=A.child,Z.memoizedProps=A.memoizedProps,Z.memoizedState=A.memoizedState,Z.updateQueue=A.updateQueue,M=A.dependencies,Z.dependencies=M===null?null:{lanes:M.lanes,firstContext:M.firstContext},Z.sibling=A.sibling,Z.index=A.index,Z.ref=A.ref,Z}function N6(A,M,Z,me,Pe,ze){var Ct=2;if(me=A,typeof A=="function")S6(A)&&(Ct=1);else if(typeof A=="string")Ct=5;else e:switch(A){case L:return Fx(Z.children,Pe,ze,M);case z:Ct=8,Pe|=8;break;case Q:return A=Td(12,Z,M,Pe|2),A.elementType=Q,A.lanes=ze,A;case re:return A=Td(13,Z,M,Pe),A.elementType=re,A.lanes=ze,A;case pe:return A=Td(19,Z,M,Pe),A.elementType=pe,A.lanes=ze,A;case oe:return A6(Z,Pe,ze,M);default:if(typeof A=="object"&&A!==null)switch(A.$$typeof){case ne:Ct=10;break e;case J:Ct=9;break e;case X:Ct=11;break e;case Y:Ct=14;break e;case ie:Ct=16,me=null;break e}throw Error(n(130,A==null?A:typeof A,""))}return M=Td(Ct,Z,M,Pe),M.elementType=A,M.type=me,M.lanes=ze,M}function Fx(A,M,Z,me){return A=Td(7,A,me,M),A.lanes=Z,A}function A6(A,M,Z,me){return A=Td(22,A,me,M),A.elementType=oe,A.lanes=Z,A.stateNode={isHidden:!1},A}function r7(A,M,Z){return A=Td(6,A,null,M),A.lanes=Z,A}function s7(A,M,Z){return M=Td(4,A.children!==null?A.children:[],A.key,M),M.lanes=Z,M.stateNode={containerInfo:A.containerInfo,pendingChildren:null,implementation:A.implementation},M}function VU(A,M,Z,me,Pe){this.tag=M,this.containerInfo=A,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Le(0),this.expirationTimes=Le(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Le(0),this.identifierPrefix=me,this.onRecoverableError=Pe,this.mutableSourceEagerHydrationData=null}function i7(A,M,Z,me,Pe,ze,Ct,pn,kn){return A=new VU(A,M,Z,pn,kn),M===1?(M=1,ze===!0&&(M|=8)):M=0,ze=Td(3,null,null,M),A.current=ze,ze.stateNode=A,ze.memoizedState={element:me,isDehydrated:Z,cache:null,transitions:null,pendingSuspenseBoundaries:null},G5(ze),A}function WU(A,M,Z){var me=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:me==null?null:""+me,children:A,containerInfo:M,implementation:Z}}function fI(A){if(!A)return Pm;A=A._reactInternals;e:{if(sn(A)!==A||A.tag!==1)throw Error(n(170));var M=A;do{switch(M.tag){case 3:M=M.stateNode.context;break e;case 1:if(uu(M.type)){M=M.stateNode.__reactInternalMemoizedMergedChildContext;break e}}M=M.return}while(M!==null);throw Error(n(171))}if(A.tag===1){var Z=A.type;if(uu(Z))return IT(A,Z,M)}return M}function hI(A,M,Z,me,Pe,ze,Ct,pn,kn){return A=i7(Z,me,!0,A,Pe,ze,Ct,pn,kn),A.context=fI(null),Z=A.current,me=Hc(),Pe=Hm(Z),ze=wp(me,Pe),ze.callback=M??null,jd(Z,ze,Pe),A.current.lanes=Pe,_e(A,Pe,me),pu(A,me),A}function j6(A,M,Z,me){var Pe=M.current,ze=Hc(),Ct=Hm(Pe);return Z=fI(Z),M.context===null?M.context=Z:M.pendingContext=Z,M=wp(ze,Ct),M.payload={element:A},me=me===void 0?null:me,me!==null&&(M.callback=me),A=jd(Pe,M,Ct),A!==null&&(vf(A,Pe,Ct,ze),K5(A,Pe,Ct)),Ct}function E6(A){if(A=A.current,!A.child)return null;switch(A.child.tag){case 5:return A.child.stateNode;default:return A.child.stateNode}}function pI(A,M){if(A=A.memoizedState,A!==null&&A.dehydrated!==null){var Z=A.retryLane;A.retryLane=Z!==0&&Z<M?Z:M}}function a7(A,M){pI(A,M),(A=A.alternate)&&pI(A,M)}var mI=typeof reportError=="function"?reportError:function(A){console.error(A)};function o7(A){this._internalRoot=A}nv.prototype.render=o7.prototype.render=function(A){var M=this._internalRoot;if(M===null)throw Error(n(409));j6(A,M,null,null)},nv.prototype.unmount=o7.prototype.unmount=function(){var A=this._internalRoot;if(A!==null){this._internalRoot=null;var M=A.containerInfo;Tx(function(){j6(null,A,null,null)}),M[Uu]=null}};function nv(A){this._internalRoot=A}nv.prototype.unstable_scheduleHydration=function(A){if(A){var M=wt();A={blockedOn:null,target:A,priority:M};for(var Z=0;Z<Qt.length&&M!==0&&M<Qt[Z].priority;Z++);Qt.splice(Z,0,A),Z===0&&gr(A)}};function _6(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)}function k6(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11&&(A.nodeType!==8||A.nodeValue!==" react-mount-point-unstable "))}function xI(){}function qU(A,M,Z,me,Pe){if(Pe){if(typeof me=="function"){var ze=me;me=function(){var ar=E6(Ct);ze.call(ar)}}var Ct=hI(M,me,A,0,null,!1,!1,"",xI);return A._reactRootContainer=Ct,A[Uu]=Ct.current,_m(A.nodeType===8?A.parentNode:A),Tx(),Ct}for(;Pe=A.lastChild;)A.removeChild(Pe);if(typeof me=="function"){var pn=me;me=function(){var ar=E6(kn);pn.call(ar)}}var kn=i7(A,0,!1,null,null,!1,!1,"",xI);return A._reactRootContainer=kn,A[Uu]=kn.current,_m(A.nodeType===8?A.parentNode:A),Tx(function(){j6(M,kn,Z,me)}),kn}function T6(A,M,Z,me,Pe){var ze=Z._reactRootContainer;if(ze){var Ct=ze;if(typeof Pe=="function"){var pn=Pe;Pe=function(){var kn=E6(Ct);pn.call(kn)}}j6(M,Ct,A,Pe)}else Ct=qU(Z,M,A,Pe,me);return E6(Ct)}Ge=function(A){switch(A.tag){case 3:var M=A.stateNode;if(M.current.memoizedState.isDehydrated){var Z=Ye(M.pendingLanes);Z!==0&&(lt(M,Z|1),pu(M,Ee()),!(Yi&6)&&(kx=Ee()+500,Fm()))}break;case 13:Tx(function(){var me=vp(A,1);if(me!==null){var Pe=Hc();vf(me,A,1,Pe)}}),a7(A,1)}},Je=function(A){if(A.tag===13){var M=vp(A,134217728);if(M!==null){var Z=Hc();vf(M,A,134217728,Z)}a7(A,134217728)}},We=function(A){if(A.tag===13){var M=Hm(A),Z=vp(A,M);if(Z!==null){var me=Hc();vf(Z,A,M,me)}a7(A,M)}},wt=function(){return bt},At=function(A,M){var Z=bt;try{return bt=A,M()}finally{bt=Z}},jt=function(A,M,Z){switch(M){case"input":if(ct(A,Z),M=Z.name,Z.type==="radio"&&M!=null){for(Z=A;Z.parentNode;)Z=Z.parentNode;for(Z=Z.querySelectorAll("input[name="+JSON.stringify(""+M)+'][type="radio"]'),M=0;M<Z.length;M++){var me=Z[M];if(me!==A&&me.form===A.form){var Pe=D5(me);if(!Pe)throw Error(n(90));$e(me),ct(me,Pe)}}}break;case"textarea":Pt(A,Z);break;case"select":M=Z.value,M!=null&&Nt(A,!!Z.multiple,M,!1)}},jn=e7,bn=Tx;var I6={usingClientEntryPoint:!1,Events:[fc,wi,D5,On,En,e7]},rv={findFiberByHostInstance:th,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},GU={bundleType:rv.bundleType,version:rv.version,rendererPackageName:rv.rendererPackageName,rendererConfig:rv.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(A){return A=rr(A),A===null?null:A.stateNode},findFiberByHostInstance:rv.findFiberByHostInstance,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var P6=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!P6.isDisabled&&P6.supportsFiber)try{B=P6.inject(GU),W=P6}catch{}}return Od.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I6,Od.createPortal=function(A,M){var Z=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_6(M))throw Error(n(200));return WU(A,M,null,Z)},Od.createRoot=function(A,M){if(!_6(A))throw Error(n(299));var Z=!1,me="",Pe=mI;return M!=null&&(M.unstable_strictMode===!0&&(Z=!0),M.identifierPrefix!==void 0&&(me=M.identifierPrefix),M.onRecoverableError!==void 0&&(Pe=M.onRecoverableError)),M=i7(A,1,!1,null,null,Z,!1,me,Pe),A[Uu]=M.current,_m(A.nodeType===8?A.parentNode:A),new o7(M)},Od.findDOMNode=function(A){if(A==null)return null;if(A.nodeType===1)return A;var M=A._reactInternals;if(M===void 0)throw typeof A.render=="function"?Error(n(188)):(A=Object.keys(A).join(","),Error(n(268,A)));return A=rr(M),A=A===null?null:A.stateNode,A},Od.flushSync=function(A){return Tx(A)},Od.hydrate=function(A,M,Z){if(!k6(M))throw Error(n(200));return T6(null,A,M,!0,Z)},Od.hydrateRoot=function(A,M,Z){if(!_6(A))throw Error(n(405));var me=Z!=null&&Z.hydratedSources||null,Pe=!1,ze="",Ct=mI;if(Z!=null&&(Z.unstable_strictMode===!0&&(Pe=!0),Z.identifierPrefix!==void 0&&(ze=Z.identifierPrefix),Z.onRecoverableError!==void 0&&(Ct=Z.onRecoverableError)),M=hI(M,null,A,1,Z??null,Pe,!1,ze,Ct),A[Uu]=M.current,_m(A),me)for(A=0;A<me.length;A++)Z=me[A],Pe=Z._getVersion,Pe=Pe(Z._source),M.mutableSourceEagerHydrationData==null?M.mutableSourceEagerHydrationData=[Z,Pe]:M.mutableSourceEagerHydrationData.push(Z,Pe);return new nv(M)},Od.render=function(A,M,Z){if(!k6(M))throw Error(n(200));return T6(null,A,M,!1,Z)},Od.unmountComponentAtNode=function(A){if(!k6(A))throw Error(n(40));return A._reactRootContainer?(Tx(function(){T6(null,null,A,!1,function(){A._reactRootContainer=null,A[Uu]=null})}),!0):!1},Od.unstable_batchedUpdates=e7,Od.unstable_renderSubtreeIntoContainer=function(A,M,Z,me){if(!k6(Z))throw Error(n(200));if(A==null||A._reactInternals===void 0)throw Error(n(38));return T6(A,M,Z,!1,me)},Od.version="18.3.1-next-f1338f8080-20240426",Od}var wde;function PNe(){if(wde)return cz.exports;wde=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cz.exports=QGe(),cz.exports}var Cde;function ZGe(){if(Cde)return vI;Cde=1;var e=PNe();return vI.createRoot=e.createRoot,vI.hydrateRoot=e.hydrateRoot,vI}var FNe=ZGe(),m=ax();const Ne=ki(m),Iy=INe({__proto__:null,default:Ne},[m]);var Na=PNe();const yre=ki(Na);/**
* @remix-run/router v1.19.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 g9(){return g9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g9.apply(this,arguments)}var cy;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(cy||(cy={}));const Sde="popstate";function JGe(e){e===void 0&&(e={});function t(r,s){let{pathname:a,search:o,hash:l}=r.location;return oQ("",{pathname:a,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:FO(s)}return tKe(t,n,null,e)}function zo(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ONe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eKe(){return Math.random().toString(36).substr(2,8)}function Nde(e,t){return{usr:e.state,key:e.key,idx:t}}function oQ(e,t,n,r){return n===void 0&&(n=null),g9({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ZN(t):t,{state:n,key:t&&t.key||r||eKe()})}function FO(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ZN(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function tKe(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,o=s.history,l=cy.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(g9({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=cy.Pop;let C=d(),N=C==null?null:C-u;u=C,c&&c({action:l,location:w.location,delta:N})}function x(C,N){l=cy.Push;let I=oQ(w.location,C,N);u=d()+1;let P=Nde(I,u),R=w.createHref(I);try{o.pushState(P,"",R)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;s.location.assign(R)}a&&c&&c({action:l,location:w.location,delta:1})}function g(C,N){l=cy.Replace;let I=oQ(w.location,C,N);u=d();let P=Nde(I,u),R=w.createHref(I);o.replaceState(P,"",R),a&&c&&c({action:l,location:w.location,delta:0})}function v(C){let N=s.location.origin!=="null"?s.location.origin:s.location.href,I=typeof C=="string"?C:FO(C);return I=I.replace(/ $/,"%20"),zo(N,"No window.location.(origin|href) available to create URL for href: "+I),new URL(I,N)}let w={get action(){return l},get location(){return e(s,o)},listen(C){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Sde,f),c=C,()=>{s.removeEventListener(Sde,f),c=null}},createHref(C){return t(s,C)},createURL:v,encodeLocation(C){let N=v(C);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:x,replace:g,go(C){return o.go(C)}};return w}var Ade;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ade||(Ade={}));function nKe(e,t,n){return n===void 0&&(n="/"),rKe(e,t,n)}function rKe(e,t,n,r){let s=typeof t=="string"?ZN(t):t,a=wS(s.pathname||"/",n);if(a==null)return null;let o=MNe(e);sKe(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=mKe(a);l=hKe(o[c],u)}return l}function MNe(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(zo(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=vy([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(zo(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),MNe(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:dKe(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of RNe(a.path))s(a,o,c)}),t}function RNe(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let o=RNe(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function sKe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:fKe(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const iKe=/^:[\w-]+$/,aKe=3,oKe=2,lKe=1,cKe=10,uKe=-2,jde=e=>e==="*";function dKe(e,t){let n=e.split("/"),r=n.length;return n.some(jde)&&(r+=uKe),t&&(r+=oKe),n.filter(s=>!jde(s)).reduce((s,a)=>s+(iKe.test(a)?aKe:a===""?lKe:cKe),r)}function fKe(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function hKe(e,t,n){let{routesMeta:r}=e,s={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=lQ({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),x=c.route;if(!f)return null;Object.assign(s,f.params),o.push({params:s,pathname:vy([a,f.pathname]),pathnameBase:yKe(vy([a,f.pathnameBase])),route:x}),f.pathnameBase!=="/"&&(a=vy([a,f.pathnameBase]))}return o}function lQ(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pKe(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],o=a.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:x,isOptional:g}=d;if(x==="*"){let w=l[f]||"";o=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const v=l[f];return g&&!v?u[x]=void 0:u[x]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function pKe(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ONe(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function mKe(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ONe(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function wS(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function xKe(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ZN(e):e;return{pathname:n?n.startsWith("/")?n:gKe(n,t):t,search:vKe(r),hash:wKe(s)}}function gKe(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function fz(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function bKe(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function vre(e,t){let n=bKe(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function wre(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=ZN(e):(s=g9({},e),zo(!s.pathname||!s.pathname.includes("?"),fz("?","pathname","search",s)),zo(!s.pathname||!s.pathname.includes("#"),fz("#","pathname","hash",s)),zo(!s.search||!s.search.includes("#"),fz("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let x=o.split("/");for(;x[0]==="..";)x.shift(),f-=1;s.pathname=x.join("/")}l=f>=0?t[f]:"/"}let c=xKe(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const vy=e=>e.join("/").replace(/\/\/+/g,"/"),yKe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),vKe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wKe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function CKe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const LNe=["post","put","patch","delete"];new Set(LNe);const SKe=["get",...LNe];new Set(SKe);/**
* React Router v6.26.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 b9(){return b9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b9.apply(this,arguments)}const xD=m.createContext(null),DNe=m.createContext(null),y1=m.createContext(null),gD=m.createContext(null),ox=m.createContext({outlet:null,matches:[],isDataRoute:!1}),BNe=m.createContext(null);function NKe(e,t){let{relative:n}=t===void 0?{}:t;JN()||zo(!1);let{basename:r,navigator:s}=m.useContext(y1),{hash:a,pathname:o,search:l}=bD(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:vy([r,o])),s.createHref({pathname:c,search:l,hash:a})}function JN(){return m.useContext(gD)!=null}function Mc(){return JN()||zo(!1),m.useContext(gD).location}function $Ne(e){m.useContext(y1).static||m.useLayoutEffect(e)}function il(){let{isDataRoute:e}=m.useContext(ox);return e?BKe():AKe()}function AKe(){JN()||zo(!1);let e=m.useContext(xD),{basename:t,future:n,navigator:r}=m.useContext(y1),{matches:s}=m.useContext(ox),{pathname:a}=Mc(),o=JSON.stringify(vre(s,n.v7_relativeSplatPath)),l=m.useRef(!1);return $Ne(()=>{l.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=wre(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:vy([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}const jKe=m.createContext(null);function EKe(e){let t=m.useContext(ox).outlet;return t&&m.createElement(jKe.Provider,{value:e},t)}function e5(){let{matches:e}=m.useContext(ox),t=e[e.length-1];return t?t.params:{}}function bD(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(y1),{matches:s}=m.useContext(ox),{pathname:a}=Mc(),o=JSON.stringify(vre(s,r.v7_relativeSplatPath));return m.useMemo(()=>wre(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function _Ke(e,t){return kKe(e,t)}function kKe(e,t,n,r){JN()||zo(!1);let{navigator:s}=m.useContext(y1),{matches:a}=m.useContext(ox),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Mc(),d;if(t){var f;let C=typeof t=="string"?ZN(t):t;c==="/"||(f=C.pathname)!=null&&f.startsWith(c)||zo(!1),d=C}else d=u;let x=d.pathname||"/",g=x;if(c!=="/"){let C=c.replace(/^\//,"").split("/");g="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let v=nKe(e,{pathname:g}),w=OKe(v&&v.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:vy([c,s.encodeLocation?s.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?c:vy([c,s.encodeLocation?s.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,n,r);return t&&w?m.createElement(gD.Provider,{value:{location:b9({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:cy.Pop}},w):w}function TKe(){let e=DKe(),t=CKe(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const IKe=m.createElement(TKe,null);class PKe extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(ox.Provider,{value:this.props.routeContext},m.createElement(BNe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function FKe(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(xD);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(ox.Provider,{value:t},r)}function OKe(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||zo(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:x,errors:g}=n,v=f.route.loader&&x[f.route.id]===void 0&&(!g||g[f.route.id]===void 0);if(f.route.lazy||v){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,x)=>{let g,v=!1,w=null,C=null;n&&(g=l&&f.route.id?l[f.route.id]:void 0,w=f.route.errorElement||IKe,c&&(u<0&&x===0?(v=!0,C=null):u===x&&(v=!0,C=f.route.hydrateFallbackElement||null)));let N=t.concat(o.slice(0,x+1)),I=()=>{let P;return g?P=w:v?P=C:f.route.Component?P=m.createElement(f.route.Component,null):f.route.element?P=f.route.element:P=d,m.createElement(FKe,{match:f,routeContext:{outlet:d,matches:N,isDataRoute:n!=null},children:P})};return n&&(f.route.ErrorBoundary||f.route.errorElement||x===0)?m.createElement(PKe,{location:n.location,revalidation:n.revalidation,component:w,error:g,children:I(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):I()},null)}var UNe=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(UNe||{}),OO=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(OO||{});function MKe(e){let t=m.useContext(xD);return t||zo(!1),t}function RKe(e){let t=m.useContext(DNe);return t||zo(!1),t}function LKe(e){let t=m.useContext(ox);return t||zo(!1),t}function zNe(e){let t=LKe(),n=t.matches[t.matches.length-1];return n.route.id||zo(!1),n.route.id}function DKe(){var e;let t=m.useContext(BNe),n=RKe(OO.UseRouteError),r=zNe(OO.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function BKe(){let{router:e}=MKe(UNe.UseNavigateStable),t=zNe(OO.UseNavigateStable),n=m.useRef(!1);return $Ne(()=>{n.current=!0}),m.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,b9({fromRouteId:t},a)))},[e,t])}function Ede(e){let{to:t,replace:n,state:r,relative:s}=e;JN()||zo(!1);let{future:a,static:o}=m.useContext(y1),{matches:l}=m.useContext(ox),{pathname:c}=Mc(),u=il(),d=wre(t,vre(l,a.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return m.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function $Ke(e){return EKe(e.context)}function ya(e){zo(!1)}function UKe(e){let{basename:t="/",children:n=null,location:r,navigationType:s=cy.Pop,navigator:a,static:o=!1,future:l}=e;JN()&&zo(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:a,static:o,future:b9({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=ZN(r));let{pathname:d="/",search:f="",hash:x="",state:g=null,key:v="default"}=r,w=m.useMemo(()=>{let C=wS(d,c);return C==null?null:{location:{pathname:C,search:f,hash:x,state:g,key:v},navigationType:s}},[c,d,f,x,g,v,s]);return w==null?null:m.createElement(y1.Provider,{value:u},m.createElement(gD.Provider,{children:n,value:w}))}function zKe(e){let{children:t,location:n}=e;return _Ke(cQ(t),n)}new Promise(()=>{});function cQ(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let a=[...t,s];if(r.type===m.Fragment){n.push.apply(n,cQ(r.props.children,a));return}r.type!==ya&&zo(!1),!r.props.index||!r.props.children||zo(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=cQ(r.props.children,a)),n.push(o)}),n}/**
* React Router DOM v6.26.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 MO(){return MO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MO.apply(this,arguments)}function HNe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function HKe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function VKe(e,t){return e.button===0&&(!t||t==="_self")&&!HKe(e)}function uQ(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function WKe(e,t){let n=uQ(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(a=>{n.append(s,a)})}),n}const qKe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],GKe=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],KKe="6";try{window.__reactRouterVersion=KKe}catch{}const YKe=m.createContext({isTransitioning:!1}),XKe="startTransition",_de=Iy[XKe];function QKe(e){let{basename:t,children:n,future:r,window:s}=e,a=m.useRef();a.current==null&&(a.current=JGe({window:s,v5Compat:!0}));let o=a.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=m.useCallback(f=>{u&&_de?_de(()=>c(f)):c(f)},[c,u]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.createElement(UKe,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const ZKe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JKe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hl=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,x=HNe(t,qKe),{basename:g}=m.useContext(y1),v,w=!1;if(typeof u=="string"&&JKe.test(u)&&(v=u,ZKe))try{let P=new URL(window.location.href),R=u.startsWith("//")?new URL(P.protocol+u):new URL(u),F=wS(R.pathname,g);R.origin===P.origin&&F!=null?u=F+R.search+R.hash:w=!0}catch{}let C=NKe(u,{relative:s}),N=tYe(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,unstable_viewTransition:f});function I(P){r&&r(P),P.defaultPrevented||N(P)}return m.createElement("a",MO({},x,{href:v||C,onClick:w||a?r:I,ref:n,target:c}))}),kde=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:a="",end:o=!1,style:l,to:c,unstable_viewTransition:u,children:d}=t,f=HNe(t,GKe),x=bD(c,{relative:f.relative}),g=Mc(),v=m.useContext(DNe),{navigator:w,basename:C}=m.useContext(y1),N=v!=null&&nYe(x)&&u===!0,I=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,P=g.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;s||(P=P.toLowerCase(),R=R?R.toLowerCase():null,I=I.toLowerCase()),R&&C&&(R=wS(R,C)||R);const F=I!=="/"&&I.endsWith("/")?I.length-1:I.length;let U=P===I||!o&&P.startsWith(I)&&P.charAt(F)==="/",L=R!=null&&(R===I||!o&&R.startsWith(I)&&R.charAt(I.length)==="/"),z={isActive:U,isPending:L,isTransitioning:N},Q=U?r:void 0,ne;typeof a=="function"?ne=a(z):ne=[a,U?"active":null,L?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let J=typeof l=="function"?l(z):l;return m.createElement(hl,MO({},f,{"aria-current":Q,className:ne,ref:n,style:J,to:c,unstable_viewTransition:u}),typeof d=="function"?d(z):d)});var dQ;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(dQ||(dQ={}));var Tde;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Tde||(Tde={}));function eYe(e){let t=m.useContext(xD);return t||zo(!1),t}function tYe(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l}=t===void 0?{}:t,c=il(),u=Mc(),d=bD(e,{relative:o});return m.useCallback(f=>{if(VKe(f,n)){f.preventDefault();let x=r!==void 0?r:FO(u)===FO(d);c(e,{replace:x,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l})}},[u,c,d,r,s,n,e,a,o,l])}function VNe(e){let t=m.useRef(uQ(e)),n=m.useRef(!1),r=Mc(),s=m.useMemo(()=>WKe(r.search,n.current?null:t.current),[r.search]),a=il(),o=m.useCallback((l,c)=>{const u=uQ(typeof l=="function"?l(s):l);n.current=!0,a("?"+u,c)},[a,s]);return[s,o]}function nYe(e,t){t===void 0&&(t={});let n=m.useContext(YKe);n==null&&zo(!1);let{basename:r}=eYe(dQ.useViewTransitionState),s=bD(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=wS(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=wS(n.nextLocation.pathname,r)||n.nextLocation.pathname;return lQ(s.pathname,o)!=null||lQ(s.pathname,a)!=null}let rYe={data:""},sYe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||rYe,iYe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,aYe=/\/\*[^]*?\*\/| +/g,Ide=/\n+/g,Ib=(e,t)=>{let n="",r="",s="";for(let a in e){let o=e[a];a[0]=="@"?a[1]=="i"?n=a+" "+o+";":r+=a[1]=="f"?Ib(o,a):a+"{"+Ib(o,a[1]=="k"?"":t)+"}":typeof o=="object"?r+=Ib(o,t?t.replace(/([^,])+/g,l=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):a):o!=null&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Ib.p?Ib.p(a,o):a+":"+o+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Lx={},WNe=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+WNe(e[n]);return t}return e},oYe=(e,t,n,r,s)=>{let a=WNe(e),o=Lx[a]||(Lx[a]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(a));if(!Lx[o]){let c=a!==e?e:(u=>{let d,f,x=[{}];for(;d=iYe.exec(u.replace(aYe,""));)d[4]?x.shift():d[3]?(f=d[3].replace(Ide," ").trim(),x.unshift(x[0][f]=x[0][f]||{})):x[0][d[1]]=d[2].replace(Ide," ").trim();return x[0]})(e);Lx[o]=Ib(s?{["@keyframes "+o]:c}:c,n?"":"."+o)}let l=n&&Lx.g?Lx.g:null;return n&&(Lx.g=Lx[o]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(Lx[o],t,r,l),o},lYe=(e,t,n)=>e.reduce((r,s,a)=>{let o=t[a];if(o&&o.call){let l=o(n),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;o=c?"."+c:l&&typeof l=="object"?l.props?"":Ib(l,""):l===!1?"":l}return r+s+(o??"")},"");function yD(e){let t=this||{},n=e.call?e(t.p):e;return oYe(n.unshift?n.raw?lYe(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,sYe(t.target),t.g,t.o,t.k)}let qNe,fQ,hQ;yD.bind({g:1});let e1=yD.bind({k:1});function cYe(e,t,n,r){Ib.p=t,qNe=e,fQ=n,hQ=r}function e2(e,t){let n=this||{};return function(){let r=arguments;function s(a,o){let l=Object.assign({},a),c=l.className||s.className;n.p=Object.assign({theme:fQ&&fQ()},l),n.o=/ *go\d+/.test(c),l.className=yD.apply(n,r)+(c?" "+c:"");let u=e;return e[0]&&(u=l.as||e,delete l.as),hQ&&u[0]&&hQ(l),qNe(u,l)}return s}}var uYe=e=>typeof e=="function",RO=(e,t)=>uYe(e)?e(t):e,dYe=(()=>{let e=0;return()=>(++e).toString()})(),GNe=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),fYe=20,SF=new Map,hYe=1e3,Pde=e=>{if(SF.has(e))return;let t=setTimeout(()=>{SF.delete(e),t5({type:4,toastId:e})},hYe);SF.set(e,t)},pYe=e=>{let t=SF.get(e);t&&clearTimeout(t)},pQ=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,fYe)};case 1:return t.toast.id&&pYe(t.toast.id),{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:n}=t;return e.toasts.find(a=>a.id===n.id)?pQ(e,{type:1,toast:n}):pQ(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?Pde(r):e.toasts.forEach(a=>{Pde(a.id)}),{...e,toasts:e.toasts.map(a=>a.id===r||r===void 0?{...a,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},NF=[],AF={toasts:[],pausedAt:void 0},t5=e=>{AF=pQ(AF,e),NF.forEach(t=>{t(AF)})},mYe={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},xYe=(e={})=>{let[t,n]=m.useState(AF);m.useEffect(()=>(NF.push(n),()=>{let s=NF.indexOf(n);s>-1&&NF.splice(s,1)}),[t]);let r=t.toasts.map(s=>{var a,o;return{...e,...e[s.type],...s,duration:s.duration||((a=e[s.type])==null?void 0:a.duration)||(e==null?void 0:e.duration)||mYe[s.type],style:{...e.style,...(o=e[s.type])==null?void 0:o.style,...s.style}}});return{...t,toasts:r}},gYe=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||dYe()}),hk=e=>(t,n)=>{let r=gYe(t,e,n);return t5({type:2,toast:r}),r.id},Bf=(e,t)=>hk("blank")(e,t);Bf.error=hk("error");Bf.success=hk("success");Bf.loading=hk("loading");Bf.custom=hk("custom");Bf.dismiss=e=>{t5({type:3,toastId:e})};Bf.remove=e=>t5({type:4,toastId:e});Bf.promise=(e,t,n)=>{let r=Bf.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(s=>(Bf.success(RO(t.success,s),{id:r,...n,...n==null?void 0:n.success}),s)).catch(s=>{Bf.error(RO(t.error,s),{id:r,...n,...n==null?void 0:n.error})}),e};var bYe=(e,t)=>{t5({type:1,toast:{id:e,height:t}})},yYe=()=>{t5({type:5,time:Date.now()})},vYe=e=>{let{toasts:t,pausedAt:n}=xYe(e);m.useEffect(()=>{if(n)return;let a=Date.now(),o=t.map(l=>{if(l.duration===1/0)return;let c=(l.duration||0)+l.pauseDuration-(a-l.createdAt);if(c<0){l.visible&&Bf.dismiss(l.id);return}return setTimeout(()=>Bf.dismiss(l.id),c)});return()=>{o.forEach(l=>l&&clearTimeout(l))}},[t,n]);let r=m.useCallback(()=>{n&&t5({type:6,time:Date.now()})},[n]),s=m.useCallback((a,o)=>{let{reverseOrder:l=!1,gutter:c=8,defaultPosition:u}=o||{},d=t.filter(g=>(g.position||u)===(a.position||u)&&g.height),f=d.findIndex(g=>g.id===a.id),x=d.filter((g,v)=>v<f&&g.visible).length;return d.filter(g=>g.visible).slice(...l?[x+1]:[0,x]).reduce((g,v)=>g+(v.height||0)+c,0)},[t]);return{toasts:t,handlers:{updateHeight:bYe,startPause:yYe,endPause:r,calculateOffset:s}}},wYe=e1`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,CYe=e1`
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}`,SYe=e1`
from {
transform: scale(0) rotate(90deg);
opacity: 0;
}
to {
transform: scale(1) rotate(90deg);
opacity: 1;
}`,NYe=e2("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#ff4b4b"};
position: relative;
transform: rotate(45deg);
animation: ${wYe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after,
&:before {
content: '';
animation: ${CYe} 0.15s ease-out forwards;
animation-delay: 150ms;
position: absolute;
border-radius: 3px;
opacity: 0;
background: ${e=>e.secondary||"#fff"};
bottom: 9px;
left: 4px;
height: 2px;
width: 12px;
}
&:before {
animation: ${SYe} 0.15s ease-out forwards;
animation-delay: 180ms;
transform: rotate(90deg);
}
`,AYe=e1`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,KNe=e2("div")`
width: 12px;
height: 12px;
box-sizing: border-box;
border: 2px solid;
border-radius: 100%;
border-color: ${e=>e.secondary||"#e0e0e0"};
border-right-color: ${e=>e.primary||"#616161"};
animation: ${AYe} 1s linear infinite;
`,jYe=e1`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,EYe=e1`
0% {
height: 0;
width: 0;
opacity: 0;
}
40% {
height: 0;
width: 6px;
opacity: 1;
}
100% {
opacity: 1;
height: 10px;
}`,_Ye=e2("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#61d345"};
position: relative;
transform: rotate(45deg);
animation: ${jYe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after {
content: '';
box-sizing: border-box;
animation: ${EYe} 0.2s ease-out forwards;
opacity: 0;
animation-delay: 200ms;
position: absolute;
border-right: 2px solid;
border-bottom: 2px solid;
border-color: ${e=>e.secondary||"#fff"};
bottom: 6px;
left: 6px;
height: 10px;
width: 6px;
}
`,kYe=e2("div")`
position: absolute;
`,TYe=e2("div")`
position: relative;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
min-height: 20px;
`,IYe=e1`
from {
transform: scale(0.6);
opacity: 0.4;
}
to {
transform: scale(1);
opacity: 1;
}`,PYe=e2("div")`
position: relative;
transform: scale(0.6);
opacity: 0.4;
min-width: 20px;
animation: ${IYe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
`,FYe=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?m.createElement(PYe,null,t):t:n==="blank"?null:m.createElement(TYe,null,m.createElement(KNe,{...r}),n!=="loading"&&m.createElement(kYe,null,n==="error"?m.createElement(NYe,{...r}):m.createElement(_Ye,{...r})))},OYe=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,MYe=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,RYe="0%{opacity:0;} 100%{opacity:1;}",LYe="0%{opacity:1;} 100%{opacity:0;}",DYe=e2("div")`
display: flex;
align-items: center;
background: #fff;
color: #363636;
line-height: 1.3;
will-change: transform;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
max-width: 350px;
pointer-events: auto;
padding: 8px 10px;
border-radius: 8px;
`,BYe=e2("div")`
display: flex;
justify-content: center;
margin: 4px 10px;
color: inherit;
flex: 1 1 auto;
white-space: pre-line;
`,$Ye=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=GNe()?[RYe,LYe]:[OYe(n),MYe(n)];return{animation:t?`${e1(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${e1(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},UYe=m.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?$Ye(e.position||t||"top-center",e.visible):{opacity:0},a=m.createElement(FYe,{toast:e}),o=m.createElement(BYe,{...e.ariaProps},RO(e.message,e));return m.createElement(DYe,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:a,message:o}):m.createElement(m.Fragment,null,a,o))});cYe(m.createElement);var zYe=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let a=m.useCallback(o=>{if(o){let l=()=>{let c=o.getBoundingClientRect().height;r(e,c)};l(),new MutationObserver(l).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return m.createElement("div",{ref:a,className:t,style:n},s)},HYe=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:GNe()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},VYe=yD`
z-index: 9999;
> * {
pointer-events: auto;
}
`,wI=16,WYe=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,containerStyle:a,containerClassName:o})=>{let{toasts:l,handlers:c}=vYe(n);return m.createElement("div",{style:{position:"fixed",zIndex:9999,top:wI,left:wI,right:wI,bottom:wI,pointerEvents:"none",...a},className:o,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(u=>{let d=u.position||t,f=c.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),x=HYe(d,f);return m.createElement(zYe,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?VYe:"",style:x},u.type==="custom"?RO(u.message,u):s?s(u):m.createElement(UYe,{toast:u,position:d}))}))},ln=Bf;const YNe=typeof document<"u"?Ne.useLayoutEffect:()=>{};function qYe(e){const t=m.useRef(null);return YNe(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const pk=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},$v=e=>e&&"window"in e&&e.window===e?e:pk(e).defaultView||window;function GYe(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function KYe(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function XNe(e){let t=null;return()=>(t==null&&(t=e()),t)}const YYe=XNe(function(){return KYe(/^Mac/i)}),XYe=XNe(function(){return GYe(/Android/i)});function QYe(e){return e.mozInputSource===0&&e.isTrusted?!0:XYe()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class ZYe{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function QNe(e){let t=m.useRef({isFocused:!1,observer:null});YNe(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=qYe(r=>{e==null||e(r)});return m.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let s=r.target,a=o=>{t.current.isFocused=!1,s.disabled&&n(new ZYe("blur",o)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};s.addEventListener("focusout",a,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&s.disabled){var o;(o=t.current.observer)===null||o===void 0||o.disconnect();let l=s===document.activeElement?null:document.activeElement;s.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),s.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(s,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function JYe(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:s}=e;const a=m.useCallback(c=>{if(c.target===c.currentTarget)return r&&r(c),s&&s(!1),!0},[r,s]),o=QNe(a),l=m.useCallback(c=>{const u=pk(c.target);c.target===c.currentTarget&&u.activeElement===c.target&&(n&&n(c),s&&s(!0),o(c))},[s,n,o]);return{focusProps:{onFocus:!t&&(n||s||r)?l:void 0,onBlur:!t&&(r||s)?a:void 0}}}let mk=null,mQ=new Set,Mj=new Map,u3=!1,xQ=!1;const eXe={Tab:!0,Escape:!0};function Cre(e,t){for(let n of mQ)n(e,t)}function tXe(e){return!(e.metaKey||!YYe()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function LO(e){u3=!0,tXe(e)&&(mk="keyboard",Cre("keyboard",e))}function Vh(e){mk="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(u3=!0,Cre("pointer",e))}function ZNe(e){QYe(e)&&(u3=!0,mk="virtual")}function JNe(e){e.target===window||e.target===document||(!u3&&!xQ&&(mk="virtual",Cre("virtual",e)),u3=!1,xQ=!1)}function eAe(){u3=!1,xQ=!0}function gQ(e){if(typeof window>"u"||Mj.get($v(e)))return;const t=$v(e),n=pk(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){u3=!0,r.apply(this,arguments)},n.addEventListener("keydown",LO,!0),n.addEventListener("keyup",LO,!0),n.addEventListener("click",ZNe,!0),t.addEventListener("focus",JNe,!0),t.addEventListener("blur",eAe,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Vh,!0),n.addEventListener("pointermove",Vh,!0),n.addEventListener("pointerup",Vh,!0)):(n.addEventListener("mousedown",Vh,!0),n.addEventListener("mousemove",Vh,!0),n.addEventListener("mouseup",Vh,!0)),t.addEventListener("beforeunload",()=>{tAe(e)},{once:!0}),Mj.set(t,{focus:r})}const tAe=(e,t)=>{const n=$v(e),r=pk(e);t&&r.removeEventListener("DOMContentLoaded",t),Mj.has(n)&&(n.HTMLElement.prototype.focus=Mj.get(n).focus,r.removeEventListener("keydown",LO,!0),r.removeEventListener("keyup",LO,!0),r.removeEventListener("click",ZNe,!0),n.removeEventListener("focus",JNe,!0),n.removeEventListener("blur",eAe,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Vh,!0),r.removeEventListener("pointermove",Vh,!0),r.removeEventListener("pointerup",Vh,!0)):(r.removeEventListener("mousedown",Vh,!0),r.removeEventListener("mousemove",Vh,!0),r.removeEventListener("mouseup",Vh,!0)),Mj.delete(n))};function nXe(e){const t=pk(e);let n;return t.readyState!=="loading"?gQ(e):(n=()=>{gQ(e)},t.addEventListener("DOMContentLoaded",n)),()=>tAe(e,n)}typeof document<"u"&&nXe();function nAe(){return mk!=="pointer"}const rXe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function sXe(e,t,n){var r;const s=typeof window<"u"?$v(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?$v(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?$v(n==null?void 0:n.target).HTMLElement:HTMLElement,l=typeof window<"u"?$v(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof s&&!rXe.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof a||(n==null?void 0:n.target)instanceof o&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof l&&!eXe[n.key])}function iXe(e,t,n){gQ(),m.useEffect(()=>{let r=(s,a)=>{sXe(!!(n!=null&&n.isTextInput),s,a)&&e(nAe())};return mQ.add(r),()=>{mQ.delete(r)}},t)}function aXe(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:s}=e,a=m.useRef({isFocusWithin:!1}),o=m.useCallback(u=>{a.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(a.current.isFocusWithin=!1,n&&n(u),s&&s(!1))},[n,s,a]),l=QNe(o),c=m.useCallback(u=>{!a.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),s&&s(!0),a.current.isFocusWithin=!0,l(u))},[r,s,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:o}}}let DO=!1,hz=0;function bQ(){DO=!0,setTimeout(()=>{DO=!1},50)}function Fde(e){e.pointerType==="touch"&&bQ()}function oXe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Fde):document.addEventListener("touchend",bQ),hz++,()=>{hz--,!(hz>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Fde):document.removeEventListener("touchend",bQ))}}function Sre(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:s}=e,[a,o]=m.useState(!1),l=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(oXe,[]);let{hoverProps:c,triggerHoverEnd:u}=m.useMemo(()=>{let d=(g,v)=>{if(l.pointerType=v,s||v==="touch"||l.isHovered||!g.currentTarget.contains(g.target))return;l.isHovered=!0;let w=g.currentTarget;l.target=w,t&&t({type:"hoverstart",target:w,pointerType:v}),n&&n(!0),o(!0)},f=(g,v)=>{if(l.pointerType="",l.target=null,v==="touch"||!l.isHovered)return;l.isHovered=!1;let w=g.currentTarget;r&&r({type:"hoverend",target:w,pointerType:v}),n&&n(!1),o(!1)},x={};return typeof PointerEvent<"u"?(x.onPointerEnter=g=>{DO&&g.pointerType==="mouse"||d(g,g.pointerType)},x.onPointerLeave=g=>{!s&&g.currentTarget.contains(g.target)&&f(g,g.pointerType)}):(x.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},x.onMouseEnter=g=>{!l.ignoreEmulatedMouseEvents&&!DO&&d(g,"mouse"),l.ignoreEmulatedMouseEvents=!1},x.onMouseLeave=g=>{!s&&g.currentTarget.contains(g.target)&&f(g,"mouse")}),{hoverProps:x,triggerHoverEnd:f}},[t,n,r,s,l]);return m.useEffect(()=>{s&&u({currentTarget:l.target},l.pointerType)},[s]),{hoverProps:c,isHovered:a}}function Nre(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,s=m.useRef({isFocused:!1,isFocusVisible:t||nAe()}),[a,o]=m.useState(!1),[l,c]=m.useState(()=>s.current.isFocused&&s.current.isFocusVisible),u=m.useCallback(()=>c(s.current.isFocused&&s.current.isFocusVisible),[]),d=m.useCallback(g=>{s.current.isFocused=g,o(g),u()},[u]);iXe(g=>{s.current.isFocusVisible=g,u()},[],{isTextInput:n});let{focusProps:f}=JYe({isDisabled:r,onFocusChange:d}),{focusWithinProps:x}=aXe({isDisabled:!r,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:l,focusProps:r?x:f}}var lXe=Object.defineProperty,cXe=(e,t,n)=>t in e?lXe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pz=(e,t,n)=>(cXe(e,typeof t!="symbol"?t+"":t,n),n);let uXe=class{constructor(){pz(this,"current",this.detect()),pz(this,"handoffState","pending"),pz(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Uw=new uXe;function t2(e){return Uw.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function vD(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function lx(){let e=[],t={addEventListener(n,r,s,a){return n.addEventListener(r,s,a),t.add(()=>n.removeEventListener(r,s,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return vD(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,s){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:s}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=lx();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let s of e.splice(r,1))s()}},dispose(){for(let n of e.splice(0))n()}};return t}function n2(){let[e]=m.useState(lx);return m.useEffect(()=>()=>e.dispose(),[e]),e}let Qa=(e,t)=>{Uw.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function n5(e){let t=m.useRef(e);return Qa(()=>{t.current=e},[e]),t}let Bs=function(e){let t=n5(e);return Ne.useCallback((...n)=>t.current(...n),[t])};function dXe(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function fXe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Are({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),s=n2(),a=Bs(()=>{t.current=null,r(!1),s.dispose()}),o=Bs(l=>{if(s.dispose(),t.current===null){t.current=l.currentTarget,r(!0);{let c=t2(l.currentTarget);s.addEventListener(c,"pointerup",a,!1),s.addEventListener(c,"pointermove",u=>{if(t.current){let d=dXe(u);r(fXe(d,t.current.getBoundingClientRect()))}},!1),s.addEventListener(c,"pointercancel",a,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:o,onPointerUp:a,onClick:a}}}let hXe=m.createContext(void 0);function jre(){return m.useContext(hXe)}function yQ(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function qf(e,t,...n){if(e in t){let s=t[e];return typeof s=="function"?s(...n):s}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(s=>`"${s}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,qf),r}var Py=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Py||{}),uy=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(uy||{});function Co(){let e=mXe();return m.useCallback(t=>pXe({mergeRefs:e,...t}),[e])}function pXe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:s,visible:a=!0,name:o,mergeRefs:l}){l=l??xXe;let c=rAe(t,e);if(a)return CI(c,n,r,o,l);let u=s??0;if(u&2){let{static:d=!1,...f}=c;if(d)return CI(f,n,r,o,l)}if(u&1){let{unmount:d=!0,...f}=c;return qf(d?0:1,{0(){return null},1(){return CI({...f,hidden:!0,style:{display:"none"}},n,r,o,l)}})}return CI(c,n,r,o,l)}function CI(e,t={},n,r,s){let{as:a=n,children:o,refName:l="ref",...c}=mz(e,["unmount","static"]),u=e.ref!==void 0?{[l]:e.ref}:{},d=typeof o=="function"?o(t):o;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let f={};if(t){let x=!1,g=[];for(let[v,w]of Object.entries(t))typeof w=="boolean"&&(x=!0),w===!0&&g.push(v.replace(/([A-Z])/g,C=>`-${C.toLowerCase()}`));if(x){f["data-headlessui-state"]=g.join(" ");for(let v of g)f[`data-${v}`]=""}}if(a===m.Fragment&&(Object.keys(kb(c)).length>0||Object.keys(kb(f)).length>0))if(!m.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(kb(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(kb(c)).concat(Object.keys(kb(f))).map(x=>` - ${x}`).join(`
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(x=>` - ${x}`).join(`
`)].join(`
`))}else{let x=d.props,g=x==null?void 0:x.className,v=typeof g=="function"?(...N)=>yQ(g(...N),c.className):yQ(g,c.className),w=v?{className:v}:{},C=rAe(d.props,kb(mz(c,["ref"])));for(let N in f)N in C&&delete f[N];return m.cloneElement(d,Object.assign({},C,f,u,{ref:s(gXe(d),u.ref)},w))}return m.createElement(a,Object.assign({},mz(c,["ref"]),a!==m.Fragment&&u,a!==m.Fragment&&f),d)}function mXe(){let e=m.useRef([]),t=m.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function xXe(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function rAe(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let s in r)s.startsWith("on")&&typeof r[s]=="function"?(n[s]!=null||(n[s]=[]),n[s].push(r[s])):t[s]=r[s];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[s=>{var a;return(a=s==null?void 0:s.preventDefault)==null?void 0:a.call(s)}]);for(let r in n)Object.assign(t,{[r](s,...a){let o=n[r];for(let l of o){if((s instanceof Event||(s==null?void 0:s.nativeEvent)instanceof Event)&&s.defaultPrevented)return;l(s,...a)}}});return t}function y9(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let s in r)s.startsWith("on")&&typeof r[s]=="function"?(n[s]!=null||(n[s]=[]),n[s].push(r[s])):t[s]=r[s];for(let r in n)Object.assign(t,{[r](...s){let a=n[r];for(let o of a)o==null||o(...s)}});return t}function uo(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function kb(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function mz(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function gXe(e){return Ne.version.split(".")[0]>="19"?e.props.ref:e.ref}function bXe(e,t,n){let[r,s]=m.useState(n),a=e!==void 0,o=m.useRef(a),l=m.useRef(!1),c=m.useRef(!1);return a&&!o.current&&!l.current?(l.current=!0,o.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&o.current&&!c.current&&(c.current=!0,o.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?e:r,Bs(u=>(a||s(u),t==null?void 0:t(u)))]}function yXe(e){let[t]=m.useState(e);return t}function sAe(e={},t=null,n=[]){for(let[r,s]of Object.entries(e))aAe(n,iAe(t,r),s);return n}function iAe(e,t){return e?e+"["+t+"]":t}function aAe(e,t,n){if(Array.isArray(n))for(let[r,s]of n.entries())aAe(e,iAe(t,r.toString()),s);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):sAe(n,t,e)}function vXe(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let s of r.elements)if(s!==e&&(s.tagName==="INPUT"&&s.type==="submit"||s.tagName==="BUTTON"&&s.type==="submit"||s.nodeName==="INPUT"&&s.type==="image")){s.click();return}(n=r.requestSubmit)==null||n.call(r)}}let wXe="span";var CS=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(CS||{});function CXe(e,t){var n;let{features:r=1,...s}=e,a={ref:t,"aria-hidden":(r&2)===2?!0:(n=s["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Co()({ourProps:a,theirProps:s,slot:{},defaultTag:wXe,name:"Hidden"})}let v9=uo(CXe),SXe=m.createContext(null);function NXe({children:e}){let t=m.useContext(SXe);if(!t)return Ne.createElement(Ne.Fragment,null,e);let{target:n}=t;return n?Na.createPortal(Ne.createElement(Ne.Fragment,null,e),n):null}function AXe({data:e,form:t,disabled:n,onReset:r,overrides:s}){let[a,o]=m.useState(null),l=n2();return m.useEffect(()=>{if(r&&a)return l.addEventListener(a,"reset",r)},[a,t,r]),Ne.createElement(NXe,null,Ne.createElement(jXe,{setForm:o,formId:t}),sAe(e).map(([c,u])=>Ne.createElement(v9,{features:CS.Hidden,...kb({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:c,value:u,...s})})))}function jXe({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:Ne.createElement(v9,{features:CS.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let EXe=m.createContext(void 0);function oAe(){return m.useContext(EXe)}function Ere(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&_Xe(n)?!1:r}function _Xe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let lAe=Symbol();function cAe(e,t=!0){return Object.assign(e,{[lAe]:t})}function oc(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=Bs(r=>{for(let s of t.current)s!=null&&(typeof s=="function"?s(r):s.current=r)});return e.every(r=>r==null||(r==null?void 0:r[lAe]))?void 0:n}let wD=m.createContext(null);wD.displayName="DescriptionContext";function uAe(){let e=m.useContext(wD);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,uAe),t}return e}function kXe(){var e,t;return(t=(e=m.useContext(wD))==null?void 0:e.value)!=null?t:void 0}function _re(){let[e,t]=m.useState([]);return[e.length>0?e.join(" "):void 0,m.useMemo(()=>function(n){let r=Bs(a=>(t(o=>[...o,a]),()=>t(o=>{let l=o.slice(),c=l.indexOf(a);return c!==-1&&l.splice(c,1),l}))),s=m.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return Ne.createElement(wD.Provider,{value:s},n.children)},[t])]}let TXe="p";function IXe(e,t){let n=m.useId(),r=jre(),{id:s=`headlessui-description-${n}`,...a}=e,o=uAe(),l=oc(t);Qa(()=>o.register(s),[s,o.register]);let c=r||!1,u=m.useMemo(()=>({...o.slot,disabled:c}),[o.slot,c]),d={ref:l,...o.props,id:s};return Co()({ourProps:d,theirProps:a,slot:u,defaultTag:TXe,name:o.name||"Description"})}let PXe=uo(IXe),dAe=Object.assign(PXe,{});var xo=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(xo||{});let CD=m.createContext(null);CD.displayName="LabelContext";function kre(){let e=m.useContext(CD);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,kre),t}return e}function fAe(e){var t,n,r;let s=(n=(t=m.useContext(CD))==null?void 0:t.value)!=null?n:void 0;return((r=void 0)!=null?r:0)>0?[s,...e].filter(Boolean).join(" "):s}function Tre({inherit:e=!1}={}){let t=fAe(),[n,r]=m.useState([]),s=e?[t,...n].filter(Boolean):n;return[s.length>0?s.join(" "):void 0,m.useMemo(()=>function(a){let o=Bs(c=>(r(u=>[...u,c]),()=>r(u=>{let d=u.slice(),f=d.indexOf(c);return f!==-1&&d.splice(f,1),d}))),l=m.useMemo(()=>({register:o,slot:a.slot,name:a.name,props:a.props,value:a.value}),[o,a.slot,a.name,a.props,a.value]);return Ne.createElement(CD.Provider,{value:l},a.children)},[r])]}let FXe="label";function OXe(e,t){var n;let r=m.useId(),s=kre(),a=oAe(),o=jre(),{id:l=`headlessui-label-${r}`,htmlFor:c=a??((n=s.props)==null?void 0:n.htmlFor),passive:u=!1,...d}=e,f=oc(t);Qa(()=>s.register(l),[l,s.register]);let x=Bs(C=>{let N=C.currentTarget;if(N instanceof HTMLLabelElement&&C.preventDefault(),s.props&&"onClick"in s.props&&typeof s.props.onClick=="function"&&s.props.onClick(C),N instanceof HTMLLabelElement){let I=document.getElementById(N.htmlFor);if(I){let P=I.getAttribute("disabled");if(P==="true"||P==="")return;let R=I.getAttribute("aria-disabled");if(R==="true"||R==="")return;(I instanceof HTMLInputElement&&(I.type==="radio"||I.type==="checkbox")||I.role==="radio"||I.role==="checkbox"||I.role==="switch")&&I.click(),I.focus({preventScroll:!0})}}}),g=o||!1,v=m.useMemo(()=>({...s.slot,disabled:g}),[s.slot,g]),w={ref:f,...s.props,id:l,htmlFor:c,onClick:x};return u&&("onClick"in w&&(delete w.htmlFor,delete w.onClick),"onClick"in d&&delete d.onClick),Co()({ourProps:w,theirProps:d,slot:v,defaultTag:c?FXe:"div",name:s.name||"Label"})}let MXe=uo(OXe),RXe=Object.assign(MXe,{}),LXe=m.createContext(()=>{});function hAe({value:e,children:t}){return Ne.createElement(LXe.Provider,{value:e},t)}function DXe(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function BXe(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),s=m.useMemo(()=>DXe(e),[e,n]);return Qa(()=>{if(!e)return;let a=new ResizeObserver(r);return a.observe(e),()=>{a.disconnect()}},[e]),t?{width:`${s.width}px`,height:`${s.height}px`}:s}let $Xe=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function pAe(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(s){return r.add(s),()=>r.delete(s)},dispatch(s,...a){let o=t[s].call(n,...a);o&&(n=o,r.forEach(l=>l()))}}}function mAe(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let UXe=new $Xe(()=>pAe(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function eA(e,t){let n=UXe.get(t),r=m.useId(),s=mAe(n);if(Qa(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let a=s.indexOf(r),o=s.length;return a===-1&&(a=o,o+=1),a===o-1}let vQ=new Map,Rj=new Map;function Ode(e){var t;let n=(t=Rj.get(e))!=null?t:0;return Rj.set(e,n+1),n!==0?()=>Mde(e):(vQ.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Mde(e))}function Mde(e){var t;let n=(t=Rj.get(e))!=null?t:1;if(n===1?Rj.delete(e):Rj.set(e,n-1),n!==1)return;let r=vQ.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,vQ.delete(e))}function xAe(e,{allowed:t,disallowed:n}={}){let r=eA(e,"inert-others");Qa(()=>{var s,a;if(!r)return;let o=lx();for(let c of(s=n==null?void 0:n())!=null?s:[])c&&o.add(Ode(c));let l=(a=t==null?void 0:t())!=null?a:[];for(let c of l){if(!c)continue;let u=t2(c);if(!u)continue;let d=c.parentElement;for(;d&&d!==u.body;){for(let f of d.children)l.some(x=>f.contains(x))||o.add(Ode(f));d=d.parentElement}}return o.dispose},[r,t,n])}function gAe(e,t,n){let r=n5(s=>{let a=s.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&n()});m.useEffect(()=>{if(!e)return;let s=t===null?null:t instanceof HTMLElement?t:t.current;if(!s)return;let a=lx();if(typeof ResizeObserver<"u"){let o=new ResizeObserver(()=>r.current(s));o.observe(s),a.add(()=>o.disconnect())}if(typeof IntersectionObserver<"u"){let o=new IntersectionObserver(()=>r.current(s));o.observe(s),a.add(()=>o.disconnect())}return()=>a.dispose()},[t,r,e])}let BO=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),zXe=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var em=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(em||{}),wQ=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(wQ||{}),HXe=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(HXe||{});function bAe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(BO)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function VXe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(zXe)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ire=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ire||{});function Pre(e,t=0){var n;return e===((n=t2(e))==null?void 0:n.body)?!1:qf(t,{0(){return e.matches(BO)},1(){let r=e;for(;r!==null;){if(r.matches(BO))return!0;r=r.parentElement}return!1}})}function yAe(e){let t=t2(e);lx().nextFrame(()=>{t&&!Pre(t.activeElement,0)&&O0(e)})}var WXe=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(WXe||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function O0(e){e==null||e.focus({preventScroll:!0})}let qXe=["textarea","input"].join(",");function GXe(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,qXe))!=null?n:!1}function vAe(e,t=n=>n){return e.slice().sort((n,r)=>{let s=t(n),a=t(r);if(s===null||a===null)return 0;let o=s.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function KXe(e,t){return GC(bAe(),t,{relativeTo:e})}function GC(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:s=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?vAe(e):e:t&64?VXe(e):bAe(e);s.length>0&&o.length>1&&(o=o.filter(g=>!s.some(v=>v!=null&&"current"in v?(v==null?void 0:v.current)===g:v===g))),r=r??a.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,f=o.length,x;do{if(d>=f||d+f<=0)return 0;let g=c+d;if(t&16)g=(g+f)%f;else{if(g<0)return 3;if(g>=f)return 1}x=o[g],x==null||x.focus(u),d+=l}while(x!==a.activeElement);return t&6&&GXe(x)&&x.select(),2}function wAe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function YXe(){return/Android/gi.test(window.navigator.userAgent)}function XXe(){return wAe()||YXe()}function u7(e,t,n,r){let s=n5(n);m.useEffect(()=>{if(!e)return;function a(o){s.current(o)}return document.addEventListener(t,a,r),()=>document.removeEventListener(t,a,r)},[e,t,r])}function CAe(e,t,n,r){let s=n5(n);m.useEffect(()=>{if(!e)return;function a(o){s.current(o)}return window.addEventListener(t,a,r),()=>window.removeEventListener(t,a,r)},[e,t,r])}const Rde=30;function SAe(e,t,n){let r=eA(e,"outside-click"),s=n5(n),a=m.useCallback(function(c,u){if(c.defaultPrevented)return;let d=u(c);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let f=function x(g){return typeof g=="function"?x(g()):Array.isArray(g)||g instanceof Set?g:[g]}(t);for(let x of f)if(x!==null&&(x.contains(d)||c.composed&&c.composedPath().includes(x)))return;return!Pre(d,Ire.Loose)&&d.tabIndex!==-1&&c.preventDefault(),s.current(c,d)},[s,t]),o=m.useRef(null);u7(r,"pointerdown",c=>{var u,d;o.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),u7(r,"mousedown",c=>{var u,d;o.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),u7(r,"click",c=>{XXe()||o.current&&(a(c,()=>o.current),o.current=null)},!0);let l=m.useRef({x:0,y:0});u7(r,"touchstart",c=>{l.current.x=c.touches[0].clientX,l.current.y=c.touches[0].clientY},!0),u7(r,"touchend",c=>{let u={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(u.x-l.current.x)>=Rde||Math.abs(u.y-l.current.y)>=Rde))return a(c,()=>c.target instanceof HTMLElement?c.target:null)},!0),CAe(r,"blur",c=>a(c,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function tA(...e){return m.useMemo(()=>t2(...e),[...e])}function NAe(e,t,n,r){let s=n5(n);m.useEffect(()=>{e=e??window;function a(o){s.current(o)}return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a,r)},[e,t,r])}function Fre(e,t){return m.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function QXe(){let e;return{before({doc:t}){var n;let r=t.documentElement,s=(n=t.defaultView)!=null?n:window;e=Math.max(0,s.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,s=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-s);n.style(r,"paddingRight",`${a}px`)}}}function ZXe(){return wAe()?{before({doc:e,d:t,meta:n}){function r(s){return n.containers.flatMap(a=>a()).some(a=>a.contains(s))}t.microTask(()=>{var s;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=lx();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let a=(s=window.scrollY)!=null?s:window.pageYOffset,o=null;t.addEventListener(e,"click",l=>{if(l.target instanceof HTMLElement)try{let c=l.target.closest("a");if(!c)return;let{hash:u}=new URL(c.href),d=e.querySelector(u);d&&!r(d)&&(o=d)}catch{}},!0),t.addEventListener(e,"touchstart",l=>{if(l.target instanceof HTMLElement)if(r(l.target)){let c=l.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;t.style(c,"overscrollBehavior","contain")}else t.style(l.target,"touchAction","none")}),t.addEventListener(e,"touchmove",l=>{if(l.target instanceof HTMLElement){if(l.target.tagName==="INPUT")return;if(r(l.target)){let c=l.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let c=(l=window.scrollY)!=null?l:window.pageYOffset;a!==c&&window.scrollTo(0,a),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function JXe(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function eQe(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Uv=pAe(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:lx(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:eQe(n)},s=[ZXe(),QXe(),JXe()];s.forEach(({before:a})=>a==null?void 0:a(r)),s.forEach(({after:a})=>a==null?void 0:a(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Uv.subscribe(()=>{let e=Uv.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",s=n.count!==0;(s&&!r||!s&&r)&&Uv.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Uv.dispatch("TEARDOWN",n)}});function tQe(e,t,n=()=>({containers:[]})){let r=mAe(Uv),s=t?r.get(t):void 0,a=s?s.count>0:!1;return Qa(()=>{if(!(!t||!e))return Uv.dispatch("PUSH",t,n),()=>Uv.dispatch("POP",t,n)},[e,t]),a}function AAe(e,t,n=()=>[document.body]){let r=eA(e,"scroll-lock");tQe(r,t,s=>{var a;return{containers:[...(a=s.containers)!=null?a:[],n]}})}function Lde(e){return[e.screenX,e.screenY]}function nQe(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=Lde(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Lde(t)}}}function rQe(e=0){let[t,n]=m.useState(e),r=m.useCallback(c=>n(c),[t]),s=m.useCallback(c=>n(u=>u|c),[t]),a=m.useCallback(c=>(t&c)===c,[t]),o=m.useCallback(c=>n(u=>u&~c),[n]),l=m.useCallback(c=>n(u=>u^c),[n]);return{flags:t,setFlag:r,addFlag:s,hasFlag:a,removeFlag:o,toggleFlag:l}}var sQe={},Dde,Bde;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Dde=process==null?void 0:sQe)==null?void 0:Dde.NODE_ENV)==="test"&&typeof((Bde=Element==null?void 0:Element.prototype)==null?void 0:Bde.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
`)),[]});var iQe=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(iQe||{});function Ore(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Mre(e,t,n,r){let[s,a]=m.useState(n),{hasFlag:o,addFlag:l,removeFlag:c}=rQe(e&&s?3:0),u=m.useRef(!1),d=m.useRef(!1),f=n2();return Qa(()=>{var x;if(e){if(n&&a(!0),!t){n&&l(3);return}return(x=r==null?void 0:r.start)==null||x.call(r,n),aQe(t,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(l(3),c(4)):(l(4),c(2)))},run(){d.current?n?(c(3),l(4)):(c(4),l(3)):n?c(1):l(1)},done(){var g;d.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(u.current=!1,c(7),n||a(!1),(g=r==null?void 0:r.end)==null||g.call(r,n))}})}},[e,n,t,f]),e?[s,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function aQe(e,{prepare:t,run:n,done:r,inFlight:s}){let a=lx();return lQe(e,{prepare:t,inFlight:s}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(oQe(e,r))})}),a.dispose}function oQe(e,t){var n,r;let s=lx();if(!e)return s.dispose;let a=!1;s.add(()=>{a=!0});let o=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(l=>l instanceof CSSTransition))!=null?r:[];return o.length===0?(t(),s.dispose):(Promise.allSettled(o.map(l=>l.finished)).then(()=>{a||t()}),s.dispose)}function lQe(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function cQe(e,{container:t,accept:n,walk:r}){let s=m.useRef(n),a=m.useRef(r);m.useEffect(()=>{s.current=n,a.current=r},[n,r]),Qa(()=>{if(!t||!e)return;let o=t2(t);if(!o)return;let l=s.current,c=a.current,u=Object.assign(f=>l(f),{acceptNode:l}),d=o.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)c(d.currentNode)},[t,e,s,a])}function Rre(e,t){let n=m.useRef([]),r=Bs(e);m.useEffect(()=>{let s=[...n.current];for(let[a,o]of t.entries())if(n.current[a]!==o){let l=r(t,s);return n.current=t,l}},[r,...t])}function SD(){return typeof window<"u"}function nA(e){return jAe(e)?(e.nodeName||"").toLowerCase():"#document"}function Uf(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cx(e){var t;return(t=(jAe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jAe(e){return SD()?e instanceof Node||e instanceof Uf(e).Node:!1}function rd(e){return SD()?e instanceof Element||e instanceof Uf(e).Element:!1}function q0(e){return SD()?e instanceof HTMLElement||e instanceof Uf(e).HTMLElement:!1}function $de(e){return!SD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Uf(e).ShadowRoot}function xk(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=pm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function uQe(e){return["table","td","th"].includes(nA(e))}function ND(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Lre(e){const t=Dre(),n=rd(e)?pm(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function dQe(e){let t=Fy(e);for(;q0(t)&&!SS(t);){if(Lre(t))return t;if(ND(t))return null;t=Fy(t)}return null}function Dre(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function SS(e){return["html","body","#document"].includes(nA(e))}function pm(e){return Uf(e).getComputedStyle(e)}function AD(e){return rd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fy(e){if(nA(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$de(e)&&e.host||cx(e);return $de(t)?t.host:t}function EAe(e){const t=Fy(e);return SS(t)?e.ownerDocument?e.ownerDocument.body:e.body:q0(t)&&xk(t)?t:EAe(t)}function w9(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=EAe(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=Uf(s);if(a){const l=CQ(o);return t.concat(o,o.visualViewport||[],xk(s)?s:[],l&&n?w9(l):[])}return t.concat(s,w9(s,[],n))}function CQ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fQe(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const hQe=["top","right","bottom","left"],Oy=Math.min,Au=Math.max,C9=Math.round,SI=Math.floor,My=e=>({x:e,y:e}),pQe={left:"right",right:"left",bottom:"top",top:"bottom"},mQe={start:"end",end:"start"};function SQ(e,t,n){return Au(e,Oy(t,n))}function G0(e,t){return typeof e=="function"?e(t):e}function t1(e){return e.split("-")[0]}function rA(e){return e.split("-")[1]}function Bre(e){return e==="x"?"y":"x"}function $re(e){return e==="y"?"height":"width"}function Ry(e){return["top","bottom"].includes(t1(e))?"y":"x"}function Ure(e){return Bre(Ry(e))}function xQe(e,t,n){n===void 0&&(n=!1);const r=rA(e),s=Ure(e),a=$re(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=$O(o)),[o,$O(o)]}function gQe(e){const t=$O(e);return[NQ(e),t,NQ(t)]}function NQ(e){return e.replace(/start|end/g,t=>mQe[t])}function bQe(e,t,n){const r=["left","right"],s=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?a:o;default:return[]}}function yQe(e,t,n,r){const s=rA(e);let a=bQe(t1(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(NQ)))),a}function $O(e){return e.replace(/left|right|bottom|top/g,t=>pQe[t])}function vQe(e){return{top:0,right:0,bottom:0,left:0,...e}}function _Ae(e){return typeof e!="number"?vQe(e):{top:e,right:e,bottom:e,left:e}}function S9(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Ude(e,t,n){let{reference:r,floating:s}=e;const a=Ry(t),o=Ure(t),l=$re(o),c=t1(t),u=a==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,x=r[l]/2-s[l]/2;let g;switch(c){case"top":g={x:d,y:r.y-s.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-s.width,y:f};break;default:g={x:r.x,y:r.y}}switch(rA(t)){case"start":g[o]-=x*(n&&u?-1:1);break;case"end":g[o]+=x*(n&&u?-1:1);break}return g}const wQe=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:o}=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Ude(u,r,c),x=r,g={},v=0;for(let w=0;w<l.length;w++){const{name:C,fn:N}=l[w],{x:I,y:P,data:R,reset:F}=await N({x:d,y:f,initialPlacement:r,placement:x,strategy:s,middlewareData:g,rects:u,platform:o,elements:{reference:e,floating:t}});d=I??d,f=P??f,g={...g,[C]:{...g[C],...R}},F&&v<=50&&(v++,typeof F=="object"&&(F.placement&&(x=F.placement),F.rects&&(u=F.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):F.rects),{x:d,y:f}=Ude(u,x,c)),w=-1)}return{x:d,y:f,placement:x,strategy:s,middlewareData:g}};async function NS(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:x=!1,padding:g=0}=G0(t,e),v=_Ae(g),C=l[x?f==="floating"?"reference":"floating":f],N=S9(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),I=f==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),R=await(a.isElement==null?void 0:a.isElement(P))?await(a.getScale==null?void 0:a.getScale(P))||{x:1,y:1}:{x:1,y:1},F=S9(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:I,offsetParent:P,strategy:c}):I);return{top:(N.top-F.top+v.top)/R.y,bottom:(F.bottom-N.bottom+v.bottom)/R.y,left:(N.left-F.left+v.left)/R.x,right:(F.right-N.right+v.right)/R.x}}const CQe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=G0(e,t)||{};if(u==null)return{};const f=_Ae(d),x={x:n,y:r},g=Ure(s),v=$re(g),w=await o.getDimensions(u),C=g==="y",N=C?"top":"left",I=C?"bottom":"right",P=C?"clientHeight":"clientWidth",R=a.reference[v]+a.reference[g]-x[g]-a.floating[v],F=x[g]-a.reference[g],U=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let L=U?U[P]:0;(!L||!await(o.isElement==null?void 0:o.isElement(U)))&&(L=l.floating[P]||a.floating[v]);const z=R/2-F/2,Q=L/2-w[v]/2-1,ne=Oy(f[N],Q),J=Oy(f[I],Q),X=ne,re=L-w[v]-J,pe=L/2-w[v]/2+z,Y=SQ(X,pe,re),ie=!c.arrow&&rA(s)!=null&&pe!==Y&&a.reference[v]/2-(pe<X?ne:J)-w[v]/2<0,oe=ie?pe<X?pe-X:pe-re:0;return{[g]:x[g]+oe,data:{[g]:Y,centerOffset:pe-Y-oe,...ie&&{alignmentOffset:oe}},reset:ie}}}),SQe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:w=!0,...C}=G0(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const N=t1(s),I=Ry(l),P=t1(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(u.floating)),F=x||(P||!w?[$O(l)]:gQe(l)),U=v!=="none";!x&&U&&F.push(...yQe(l,w,v,R));const L=[l,...F],z=await NS(t,C),Q=[];let ne=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&Q.push(z[N]),f){const pe=xQe(s,o,R);Q.push(z[pe[0]],z[pe[1]])}if(ne=[...ne,{placement:s,overflows:Q}],!Q.every(pe=>pe<=0)){var J,X;const pe=(((J=a.flip)==null?void 0:J.index)||0)+1,Y=L[pe];if(Y)return{data:{index:pe,overflows:ne},reset:{placement:Y}};let ie=(X=ne.filter(oe=>oe.overflows[0]<=0).sort((oe,G)=>oe.overflows[1]-G.overflows[1])[0])==null?void 0:X.placement;if(!ie)switch(g){case"bestFit":{var re;const oe=(re=ne.filter(G=>{if(U){const V=Ry(G.placement);return V===I||V==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(V=>V>0).reduce((V,te)=>V+te,0)]).sort((G,V)=>G[1]-V[1])[0])==null?void 0:re[0];oe&&(ie=oe);break}case"initialPlacement":ie=l;break}if(s!==ie)return{reset:{placement:ie}}}return{}}}};function zde(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hde(e){return hQe.some(t=>e[t]>=0)}const NQe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=G0(e,t);switch(r){case"referenceHidden":{const a=await NS(t,{...s,elementContext:"reference"}),o=zde(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Hde(o)}}}case"escaped":{const a=await NS(t,{...s,altBoundary:!0}),o=zde(a,n.floating);return{data:{escapedOffsets:o,escaped:Hde(o)}}}default:return{}}}}};async function AQe(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=t1(n),l=rA(n),c=Ry(n)==="y",u=["left","top"].includes(o)?-1:1,d=a&&c?-1:1,f=G0(t,e);let{mainAxis:x,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),c?{x:g*d,y:x*u}:{x:x*u,y:g*d}}const jQe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await AQe(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},EQe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:C=>{let{x:N,y:I}=C;return{x:N,y:I}}},...c}=G0(e,t),u={x:n,y:r},d=await NS(t,c),f=Ry(t1(s)),x=Bre(f);let g=u[x],v=u[f];if(a){const C=x==="y"?"top":"left",N=x==="y"?"bottom":"right",I=g+d[C],P=g-d[N];g=SQ(I,g,P)}if(o){const C=f==="y"?"top":"left",N=f==="y"?"bottom":"right",I=v+d[C],P=v-d[N];v=SQ(I,v,P)}const w=l.fn({...t,[x]:g,[f]:v});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[x]:a,[f]:o}}}}}},_Qe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=G0(e,t),d={x:n,y:r},f=Ry(s),x=Bre(f);let g=d[x],v=d[f];const w=G0(l,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const P=x==="y"?"height":"width",R=a.reference[x]-a.floating[P]+C.mainAxis,F=a.reference[x]+a.reference[P]-C.mainAxis;g<R?g=R:g>F&&(g=F)}if(u){var N,I;const P=x==="y"?"width":"height",R=["top","left"].includes(t1(s)),F=a.reference[f]-a.floating[P]+(R&&((N=o.offset)==null?void 0:N[f])||0)+(R?0:C.crossAxis),U=a.reference[f]+a.reference[P]+(R?0:((I=o.offset)==null?void 0:I[f])||0)-(R?C.crossAxis:0);v<F?v=F:v>U&&(v=U)}return{[x]:g,[f]:v}}}},kQe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=G0(e,t),d=await NS(t,u),f=t1(s),x=rA(s),g=Ry(s)==="y",{width:v,height:w}=a.floating;let C,N;f==="top"||f==="bottom"?(C=f,N=x===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(N=f,C=x==="end"?"top":"bottom");const I=w-d.top-d.bottom,P=v-d.left-d.right,R=Oy(w-d[C],I),F=Oy(v-d[N],P),U=!t.middlewareData.shift;let L=R,z=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=P),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=I),U&&!x){const ne=Au(d.left,0),J=Au(d.right,0),X=Au(d.top,0),re=Au(d.bottom,0);g?z=v-2*(ne!==0||J!==0?ne+J:Au(d.left,d.right)):L=w-2*(X!==0||re!==0?X+re:Au(d.top,d.bottom))}await c({...t,availableWidth:z,availableHeight:L});const Q=await o.getDimensions(l.floating);return v!==Q.width||w!==Q.height?{reset:{rects:!0}}:{}}}};function kAe(e){const t=pm(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=q0(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=C9(n)!==a||C9(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function zre(e){return rd(e)?e:e.contextElement}function KC(e){const t=zre(e);if(!q0(t))return My(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=kAe(t);let o=(a?C9(n.width):n.width)/r,l=(a?C9(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const TQe=My(0);function TAe(e){const t=Uf(e);return!Dre()||!t.visualViewport?TQe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function IQe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Uf(e)?!1:t}function d3(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=zre(e);let o=My(1);t&&(r?rd(r)&&(o=KC(r)):o=KC(e));const l=IQe(a,n,r)?TAe(a):My(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(a){const x=Uf(a),g=r&&rd(r)?Uf(r):r;let v=x,w=CQ(v);for(;w&&r&&g!==v;){const C=KC(w),N=w.getBoundingClientRect(),I=pm(w),P=N.left+(w.clientLeft+parseFloat(I.paddingLeft))*C.x,R=N.top+(w.clientTop+parseFloat(I.paddingTop))*C.y;c*=C.x,u*=C.y,d*=C.x,f*=C.y,c+=P,u+=R,v=Uf(w),w=CQ(v)}}return S9({width:d,height:f,x:c,y:u})}function PQe(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=cx(r),l=t?ND(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=My(1);const d=My(0),f=q0(r);if((f||!f&&!a)&&((nA(r)!=="body"||xk(o))&&(c=AD(r)),q0(r))){const x=d3(r);u=KC(r),d.x=x.x+r.clientLeft,d.y=x.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function FQe(e){return Array.from(e.getClientRects())}function AQ(e,t){const n=AD(e).scrollLeft;return t?t.left+n:d3(cx(e)).left+n}function OQe(e){const t=cx(e),n=AD(e),r=e.ownerDocument.body,s=Au(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Au(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+AQ(e);const l=-n.scrollTop;return pm(r).direction==="rtl"&&(o+=Au(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}function MQe(e,t){const n=Uf(e),r=cx(e),s=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const u=Dre();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}function RQe(e,t){const n=d3(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=q0(e)?KC(e):My(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function Vde(e,t,n){let r;if(t==="viewport")r=MQe(e,n);else if(t==="document")r=OQe(cx(e));else if(rd(t))r=RQe(t,n);else{const s=TAe(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return S9(r)}function IAe(e,t){const n=Fy(e);return n===t||!rd(n)||SS(n)?!1:pm(n).position==="fixed"||IAe(n,t)}function LQe(e,t){const n=t.get(e);if(n)return n;let r=w9(e,[],!1).filter(l=>rd(l)&&nA(l)!=="body"),s=null;const a=pm(e).position==="fixed";let o=a?Fy(e):e;for(;rd(o)&&!SS(o);){const l=pm(o),c=Lre(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||xk(o)&&!c&&IAe(e,o))?r=r.filter(d=>d!==o):s=l,o=Fy(o)}return t.set(e,r),r}function DQe(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?ND(t)?[]:LQe(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const f=Vde(t,d,s);return u.top=Au(f.top,u.top),u.right=Oy(f.right,u.right),u.bottom=Oy(f.bottom,u.bottom),u.left=Au(f.left,u.left),u},Vde(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function BQe(e){const{width:t,height:n}=kAe(e);return{width:t,height:n}}function $Qe(e,t,n){const r=q0(t),s=cx(t),a=n==="fixed",o=d3(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=My(0);if(r||!r&&!a)if((nA(t)!=="body"||xk(s))&&(l=AD(t)),r){const g=d3(t,!0,a,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else s&&(c.x=AQ(s));let u=0,d=0;if(s&&!r&&!a){const g=s.getBoundingClientRect();d=g.top+l.scrollTop,u=g.left+l.scrollLeft-AQ(s,g)}const f=o.left+l.scrollLeft-c.x-u,x=o.top+l.scrollTop-c.y-d;return{x:f,y:x,width:o.width,height:o.height}}function xz(e){return pm(e).position==="static"}function Wde(e,t){if(!q0(e)||pm(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return cx(e)===n&&(n=n.ownerDocument.body),n}function PAe(e,t){const n=Uf(e);if(ND(e))return n;if(!q0(e)){let s=Fy(e);for(;s&&!SS(s);){if(rd(s)&&!xz(s))return s;s=Fy(s)}return n}let r=Wde(e,t);for(;r&&uQe(r)&&xz(r);)r=Wde(r,t);return r&&SS(r)&&xz(r)&&!Lre(r)?n:r||dQe(e)||n}const UQe=async function(e){const t=this.getOffsetParent||PAe,n=this.getDimensions,r=await n(e.floating);return{reference:$Qe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zQe(e){return pm(e).direction==="rtl"}const HQe={convertOffsetParentRelativeRectToViewportRelativeRect:PQe,getDocumentElement:cx,getClippingRect:DQe,getOffsetParent:PAe,getElementRects:UQe,getClientRects:FQe,getDimensions:BQe,getScale:KC,isElement:rd,isRTL:zQe};function VQe(e,t){let n=null,r;const s=cx(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const{left:u,top:d,width:f,height:x}=e.getBoundingClientRect();if(l||t(),!f||!x)return;const g=SI(d),v=SI(s.clientWidth-(u+f)),w=SI(s.clientHeight-(d+x)),C=SI(u),I={rootMargin:-g+"px "+-v+"px "+-w+"px "+-C+"px",threshold:Au(0,Oy(1,c))||1};let P=!0;function R(F){const U=F[0].intersectionRatio;if(U!==c){if(!P)return o();U?o(!1,U):r=setTimeout(()=>{o(!1,1e-7)},1e3)}P=!1}try{n=new IntersectionObserver(R,{...I,root:s.ownerDocument})}catch{n=new IntersectionObserver(R,I)}n.observe(e)}return o(!0),a}function FAe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=zre(e),d=s||a?[...u?w9(u):[],...w9(t)]:[];d.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),a&&N.addEventListener("resize",n)});const f=u&&l?VQe(u,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(N=>{let[I]=N;I&&I.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var P;(P=g)==null||P.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,w=c?d3(e):null;c&&C();function C(){const N=d3(e);w&&(N.x!==w.x||N.y!==w.y||N.width!==w.width||N.height!==w.height)&&n(),w=N,v=requestAnimationFrame(C)}return n(),()=>{var N;d.forEach(I=>{s&&I.removeEventListener("scroll",n),a&&I.removeEventListener("resize",n)}),f==null||f(),(N=g)==null||N.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const gz=NS,OAe=jQe,MAe=EQe,RAe=SQe,LAe=kQe,WQe=NQe,qde=CQe,qQe=_Qe,DAe=(e,t,n)=>{const r=new Map,s={platform:HQe,...n},a={...s.platform,_c:r};return wQe(e,t,{...s,platform:a})};var jF=typeof document<"u"?m.useLayoutEffect:m.useEffect;function UO(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!UO(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!UO(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function BAe(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gde(e,t){const n=BAe(e);return Math.round(t*n)/n}function bz(e){const t=m.useRef(e);return jF(()=>{t.current=e}),t}function GQe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=m.useState(r);UO(x,r)||g(r);const[v,w]=m.useState(null),[C,N]=m.useState(null),I=m.useCallback(G=>{G!==U.current&&(U.current=G,w(G))},[]),P=m.useCallback(G=>{G!==L.current&&(L.current=G,N(G))},[]),R=a||v,F=o||C,U=m.useRef(null),L=m.useRef(null),z=m.useRef(d),Q=c!=null,ne=bz(c),J=bz(s),X=bz(u),re=m.useCallback(()=>{if(!U.current||!L.current)return;const G={placement:t,strategy:n,middleware:x};J.current&&(G.platform=J.current),DAe(U.current,L.current,G).then(V=>{const te={...V,isPositioned:X.current!==!1};pe.current&&!UO(z.current,te)&&(z.current=te,Na.flushSync(()=>{f(te)}))})},[x,t,n,J,X]);jF(()=>{u===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[u]);const pe=m.useRef(!1);jF(()=>(pe.current=!0,()=>{pe.current=!1}),[]),jF(()=>{if(R&&(U.current=R),F&&(L.current=F),R&&F){if(ne.current)return ne.current(R,F,re);re()}},[R,F,re,ne,Q]);const Y=m.useMemo(()=>({reference:U,floating:L,setReference:I,setFloating:P}),[I,P]),ie=m.useMemo(()=>({reference:R,floating:F}),[R,F]),oe=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!ie.floating)return G;const V=Gde(ie.floating,d.x),te=Gde(ie.floating,d.y);return l?{...G,transform:"translate("+V+"px, "+te+"px)",...BAe(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:te}},[n,l,ie.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:re,refs:Y,elements:ie,floatingStyles:oe}),[d,re,Y,ie,oe])}const $Ae=(e,t)=>({...OAe(e),options:[e,t]}),KQe=(e,t)=>({...MAe(e),options:[e,t]}),YQe=(e,t)=>({...RAe(e),options:[e,t]}),XQe=(e,t)=>({...LAe(e),options:[e,t]}),UAe={...Iy},QQe=UAe.useInsertionEffect,ZQe=QQe||(e=>e());function zAe(e){const t=m.useRef(()=>{});return ZQe(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}var jQ=typeof document<"u"?m.useLayoutEffect:m.useEffect;let Kde=!1,JQe=0;const Yde=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+JQe++;function eZe(){const[e,t]=m.useState(()=>Kde?Yde():void 0);return jQ(()=>{e==null&&t(Yde())},[]),m.useEffect(()=>{Kde=!0},[]),e}const tZe=UAe.useId,nZe=tZe||eZe;function rZe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(s=>s!==n))||[])}}}const sZe=m.createContext(null),iZe=m.createContext(null),aZe=()=>{var e;return((e=m.useContext(sZe))==null?void 0:e.id)||null},oZe=()=>m.useContext(iZe),lZe="data-floating-ui-focusable";function cZe(e){const{open:t=!1,onOpenChange:n,elements:r}=e,s=nZe(),a=m.useRef({}),[o]=m.useState(()=>rZe()),l=aZe()!=null,[c,u]=m.useState(r.reference),d=zAe((g,v,w)=>{a.current.openEvent=g?v:void 0,o.emit("openchange",{open:g,event:v,reason:w,nested:l}),n==null||n(g,v,w)}),f=m.useMemo(()=>({setPositionReference:u}),[]),x=m.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return m.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:x,events:o,floatingId:s,refs:f}),[t,d,x,o,s,f])}function uZe(e){e===void 0&&(e={});const{nodeId:t}=e,n=cZe({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,s=r.elements,[a,o]=m.useState(null),[l,c]=m.useState(null),d=(s==null?void 0:s.reference)||a,f=m.useRef(null),x=oZe();jQ(()=>{d&&(f.current=d)},[d]);const g=GQe({...e,elements:{...s,...l&&{reference:l}}}),v=m.useCallback(P=>{const R=rd(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),contextElement:P}:P;c(R),g.refs.setReference(R)},[g.refs]),w=m.useCallback(P=>{(rd(P)||P===null)&&(f.current=P,o(P)),(rd(g.refs.reference.current)||g.refs.reference.current===null||P!==null&&!rd(P))&&g.refs.setReference(P)},[g.refs]),C=m.useMemo(()=>({...g.refs,setReference:w,setPositionReference:v,domReference:f}),[g.refs,w,v]),N=m.useMemo(()=>({...g.elements,domReference:d}),[g.elements,d]),I=m.useMemo(()=>({...g,...r,refs:C,elements:N,nodeId:t}),[g,C,N,t,r]);return jQ(()=>{r.dataRef.current.floatingContext=I;const P=x==null?void 0:x.nodesRef.current.find(R=>R.id===t);P&&(P.context=I)}),m.useMemo(()=>({...g,context:I,refs:C,elements:N}),[g,C,N,I])}const Xde="active",Qde="selected";function yz(e,t,n){const r=new Map,s=n==="item";let a=e;if(s&&e){const{[Xde]:o,[Qde]:l,...c}=e;a=c}return{...n==="floating"&&{tabIndex:-1,[lZe]:""},...a,...t.map(o=>{const l=o?o[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((o,l)=>(l&&Object.entries(l).forEach(c=>{let[u,d]=c;if(!(s&&[Xde,Qde].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var f;(f=r.get(u))==null||f.push(d),o[u]=function(){for(var x,g=arguments.length,v=new Array(g),w=0;w<g;w++)v[w]=arguments[w];return(x=r.get(u))==null?void 0:x.map(C=>C(...v)).find(C=>C!==void 0)}}}else o[u]=d}),o),{})}}function dZe(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),s=m.useCallback(l=>yz(l,e,"reference"),t),a=m.useCallback(l=>yz(l,e,"floating"),n),o=m.useCallback(l=>yz(l,e,"item"),r);return m.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:o}),[s,a,o])}function Zde(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const fZe=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:s,offset:a=0,index:o=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:u,...d}=G0(e,t),{rects:f,elements:{floating:x}}=t,g=n.current[o],v=(u==null?void 0:u.current)||x,w=x.clientTop||v.clientTop,C=x.clientTop!==0,N=v.clientTop!==0,I=x===v;if(!g)return{};const P={...t,...await $Ae(-g.offsetTop-x.clientTop-f.reference.height/2-g.offsetHeight/2-a).fn(t)},R=await gz(Zde(P,v.scrollHeight+w+x.clientTop),d),F=await gz(P,{...d,elementContext:"reference"}),U=Au(0,R.top),L=P.y+U,z=v.scrollHeight>v.clientHeight,ne=(z?J=>J:C9)(Au(0,v.scrollHeight+(C&&I||N?w*2:0)-U-Au(0,R.bottom)));if(v.style.maxHeight=ne+"px",v.scrollTop=U,s){const J=z&&v.offsetHeight<g.offsetHeight*l-1||F.top>=-c||F.bottom>=-c;Na.flushSync(()=>s(J))}return r&&(r.current=await gz(Zde({...P,y:L},v.offsetHeight+w+x.clientTop),d)),{y:L}}});function hZe(e,t){const{open:n,elements:r}=e,{enabled:s=!0,overflowRef:a,scrollRef:o,onChange:l}=t,c=zAe(l),u=m.useRef(!1),d=m.useRef(null),f=m.useRef(null);m.useEffect(()=>{if(!s)return;function g(w){if(w.ctrlKey||!v||a.current==null)return;const C=w.deltaY,N=a.current.top>=-.5,I=a.current.bottom>=-.5,P=v.scrollHeight-v.clientHeight,R=C<0?-1:1,F=C<0?"max":"min";v.scrollHeight<=v.clientHeight||(!N&&C>0||!I&&C<0?(w.preventDefault(),Na.flushSync(()=>{c(U=>U+Math[F](C,P*R))})):/firefox/i.test(fQe())&&(v.scrollTop+=C))}const v=(o==null?void 0:o.current)||r.floating;if(n&&v)return v.addEventListener("wheel",g),requestAnimationFrame(()=>{d.current=v.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{d.current=null,f.current=null,v.removeEventListener("wheel",g)}},[s,n,r.floating,a,o,c]);const x=m.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const g=(o==null?void 0:o.current)||r.floating;if(!(!a.current||!g||!u.current)){if(d.current!==null){const v=g.scrollTop-d.current;(a.current.bottom<-.5&&v<-1||a.current.top<-.5&&v>1)&&Na.flushSync(()=>c(w=>w+v))}requestAnimationFrame(()=>{d.current=g.scrollTop})}}}),[r.floating,c,a,o]);return m.useMemo(()=>s?{floating:x}:{},[s,x])}let sA=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});sA.displayName="FloatingContext";let Hre=m.createContext(null);Hre.displayName="PlacementContext";function pZe(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function mZe(){return m.useContext(sA).setReference}function xZe(){return m.useContext(sA).getReferenceProps}function gZe(){let{getFloatingProps:e,slot:t}=m.useContext(sA);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function bZe(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Hre),n=m.useMemo(()=>e,[JSON.stringify(e,(s,a)=>{var o;return(o=a==null?void 0:a.outerHTML)!=null?o:a})]);Qa(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(sA);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Jde=4;function yZe({children:e,enabled:t=!0}){let[n,r]=m.useState(null),[s,a]=m.useState(0),o=m.useRef(null),[l,c]=m.useState(null);vZe(l);let u=t&&n!==null&&l!==null,{to:d="bottom",gap:f=0,offset:x=0,padding:g=0,inner:v}=wZe(n,l),[w,C="center"]=d.split(" ");Qa(()=>{u&&a(0)},[u]);let{refs:N,floatingStyles:I,context:P}=uZe({open:u,placement:w==="selection"?C==="center"?"bottom":`bottom-${C}`:C==="center"?`${w}`:`${w}-${C}`,strategy:"absolute",transform:!1,middleware:[$Ae({mainAxis:w==="selection"?0:f,crossAxis:x}),KQe({padding:g}),w!=="selection"&&YQe({padding:g}),w==="selection"&&v?fZe({...v,padding:g,overflowRef:o,offset:s,minItemsVisible:Jde,referenceOverflowThreshold:g,onFallbackChange(J){var X,re;if(!J)return;let pe=P.elements.floating;if(!pe)return;let Y=parseFloat(getComputedStyle(pe).scrollPaddingBottom)||0,ie=Math.min(Jde,pe.childElementCount),oe=0,G=0;for(let V of(re=(X=P.elements.floating)==null?void 0:X.childNodes)!=null?re:[])if(V instanceof HTMLElement){let te=V.offsetTop,ae=te+V.clientHeight+Y,he=pe.scrollTop,Ce=he+pe.clientHeight;if(te>=he&&ae<=Ce)ie--;else{G=Math.max(0,Math.min(ae,Ce)-Math.max(te,he)),oe=V.clientHeight;break}}ie>=1&&a(V=>{let te=oe*ie-G+Y;return V>=te?V:te})}}):null,XQe({padding:g,apply({availableWidth:J,availableHeight:X,elements:re}){Object.assign(re.floating.style,{overflow:"auto",maxWidth:`${J}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${X}px)`})}})].filter(Boolean),whileElementsMounted:FAe}),[R=w,F=C]=P.placement.split("-");w==="selection"&&(R="selection");let U=m.useMemo(()=>({anchor:[R,F].filter(Boolean).join(" ")}),[R,F]),L=hZe(P,{overflowRef:o,onChange:a}),{getReferenceProps:z,getFloatingProps:Q}=dZe([L]),ne=Bs(J=>{c(J),N.setFloating(J)});return m.createElement(Hre.Provider,{value:r},m.createElement(sA.Provider,{value:{setFloating:ne,setReference:N.setReference,styles:I,getReferenceProps:z,getFloatingProps:Q,slot:U}},e))}function vZe(e){Qa(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let s=parseInt(n);isNaN(s)||r!==s&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function wZe(e,t){var n,r,s;let a=vz((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),o=vz((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),l=vz((s=e==null?void 0:e.padding)!=null?s:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:o,padding:l}}function vz(e,t,n=void 0){let r=n2(),s=Bs((c,u)=>{if(c==null)return[n,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!u)return[n,null];let d=efe(c,u);return[d,f=>{let x=HAe(c);{let g=x.map(v=>window.getComputedStyle(u).getPropertyValue(v));r.requestAnimationFrame(function v(){r.nextFrame(v);let w=!1;for(let[N,I]of x.entries()){let P=window.getComputedStyle(u).getPropertyValue(I);if(g[N]!==P){g[N]=P,w=!0;break}}if(!w)return;let C=efe(c,u);d!==C&&(f(C),d=C)})}return r.dispose}]}return[n,null]}),a=m.useMemo(()=>s(e,t)[0],[e,t]),[o=a,l]=m.useState();return Qa(()=>{let[c,u]=s(e,t);if(l(c),!!u)return u(l)},[e,t]),o}function HAe(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),s=t[1].slice(n+1).trim();return s?[r,...HAe(s)]:[r]}return[]}function efe(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}let jD=m.createContext(null);jD.displayName="OpenClosedContext";var tc=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(tc||{});function iA(){return m.useContext(jD)}function Vre({value:e,children:t}){return Ne.createElement(jD.Provider,{value:e},t)}function VAe({children:e}){return Ne.createElement(jD.Provider,{value:null},e)}function CZe(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Pb=[];CZe(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Pb[0]===t.target)return;let n=t.target;n=n.closest(BO),Pb.unshift(n??t.target),Pb=Pb.filter(r=>r!=null&&r.isConnected),Pb.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function SZe(e){throw new Error("Unexpected object: "+e)}var _u=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(_u||{});function wz(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),s=r??-1;switch(e.focus){case 0:{for(let a=0;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 1:{s===-1&&(s=n.length);for(let a=s-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 2:{for(let a=s+1;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 3:{for(let a=n.length-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 4:{for(let a=0;a<n.length;++a)if(t.resolveId(n[a],a,n)===e.id)return a;return r}case 5:return null;default:SZe(e)}}function WAe(e){let t=Bs(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,vD(()=>{n.current&&t()})}),[t])}function NZe(){let e=typeof document>"u";return"useSyncExternalStore"in Iy?(t=>t.useSyncExternalStore)(Iy)(()=>()=>{},()=>!1,()=>!e):!1}function gk(){let e=NZe(),[t,n]=m.useState(Uw.isHandoffComplete);return t&&Uw.isHandoffComplete===!1&&n(!1),m.useEffect(()=>{t!==!0&&n(!0)},[t]),m.useEffect(()=>Uw.handoff(),[]),e?!1:t}let qAe=m.createContext(!1);function AZe(){return m.useContext(qAe)}function tfe(e){return Ne.createElement(qAe.Provider,{value:e.force},e.children)}function jZe(e){let t=AZe(),n=m.useContext(KAe),r=tA(e),[s,a]=m.useState(()=>{var o;if(!t&&n!==null)return(o=n.current)!=null?o:null;if(Uw.isServer)return null;let l=r==null?void 0:r.getElementById("headlessui-portal-root");if(l)return l;if(r===null)return null;let c=r.createElement("div");return c.setAttribute("id","headlessui-portal-root"),r.body.appendChild(c)});return m.useEffect(()=>{s!==null&&(r!=null&&r.body.contains(s)||r==null||r.body.appendChild(s))},[s,r]),m.useEffect(()=>{t||n!==null&&a(n.current)},[n,a,t]),s}let GAe=m.Fragment,EZe=uo(function(e,t){let n=e,r=m.useRef(null),s=oc(cAe(f=>{r.current=f}),t),a=tA(r),o=jZe(r),[l]=m.useState(()=>{var f;return Uw.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),c=m.useContext(EQ),u=gk();Qa(()=>{!o||!l||o.contains(l)||(l.setAttribute("data-headlessui-portal",""),o.appendChild(l))},[o,l]),Qa(()=>{if(l&&c)return c.register(l)},[c,l]),WAe(()=>{var f;!o||!l||(l instanceof Node&&o.contains(l)&&o.removeChild(l),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))});let d=Co();return u?!o||!l?null:Na.createPortal(d({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:GAe,name:"Portal"}),l):null});function _Ze(e,t){let n=oc(t),{enabled:r=!0,...s}=e,a=Co();return r?Ne.createElement(EZe,{...s,ref:n}):a({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:GAe,name:"Portal"})}let kZe=m.Fragment,KAe=m.createContext(null);function TZe(e,t){let{target:n,...r}=e,s={ref:oc(t)},a=Co();return Ne.createElement(KAe.Provider,{value:n},a({ourProps:s,theirProps:r,defaultTag:kZe,name:"Popover.Group"}))}let EQ=m.createContext(null);function IZe(){let e=m.useContext(EQ),t=m.useRef([]),n=Bs(a=>(t.current.push(a),e&&e.register(a),()=>r(a))),r=Bs(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),s=m.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,m.useMemo(()=>function({children:a}){return Ne.createElement(EQ.Provider,{value:s},a)},[s])]}let PZe=uo(_Ze),YAe=uo(TZe),XAe=Object.assign(PZe,{Group:YAe});function FZe(e,t=typeof document<"u"?document.defaultView:null,n){let r=eA(e,"escape");NAe(t,"keydown",s=>{r&&(s.defaultPrevented||s.key===xo.Escape&&n(s))})}function OZe(){var e;let[t]=m.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=m.useState((e=t==null?void 0:t.matches)!=null?e:!1);return Qa(()=>{if(!t)return;function s(a){r(a.matches)}return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[t]),n}function MZe({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=tA(n),s=Bs(()=>{var a,o;let l=[];for(let c of e)c!==null&&(c instanceof HTMLElement?l.push(c):"current"in c&&c.current instanceof HTMLElement&&l.push(c.current));if(t!=null&&t.current)for(let c of t.current)l.push(c);for(let c of(a=r==null?void 0:r.querySelectorAll("html > *, body > *"))!=null?a:[])c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c.id!=="headlessui-portal-root"&&(n&&(c.contains(n)||c.contains((o=n==null?void 0:n.getRootNode())==null?void 0:o.host))||l.some(u=>c.contains(u))||l.push(c));return l});return{resolveContainers:s,contains:Bs(a=>s().some(o=>o.contains(a)))}}let QAe=m.createContext(null);function nfe({children:e,node:t}){let[n,r]=m.useState(null),s=ZAe(t??n);return Ne.createElement(QAe.Provider,{value:s},e,s===null&&Ne.createElement(v9,{features:CS.Hidden,ref:a=>{var o,l;if(a){for(let c of(l=(o=t2(a))==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?l:[])if(c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c!=null&&c.contains(a)){r(c);break}}}}))}function ZAe(e=null){var t;return(t=m.useContext(QAe))!=null?t:e}function Wre(){let e=m.useRef(!1);return Qa(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var aj=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(aj||{});function RZe(){let e=m.useRef(0);return CAe(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function JAe(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let LZe="div";var Pv=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(Pv||{});function DZe(e,t){let n=m.useRef(null),r=oc(n,t),{initialFocus:s,initialFocusFallback:a,containers:o,features:l=15,...c}=e;gk()||(l=0);let u=tA(n);zZe(l,{ownerDocument:u});let d=HZe(l,{ownerDocument:u,container:n,initialFocus:s,initialFocusFallback:a});VZe(l,{ownerDocument:u,container:n,containers:o,previousActiveElement:d});let f=RZe(),x=Bs(I=>{let P=n.current;P&&(R=>R())(()=>{qf(f.current,{[aj.Forwards]:()=>{GC(P,em.First,{skipElements:[I.relatedTarget,a]})},[aj.Backwards]:()=>{GC(P,em.Last,{skipElements:[I.relatedTarget,a]})}})})}),g=eA(!!(l&2),"focus-trap#tab-lock"),v=n2(),w=m.useRef(!1),C={ref:r,onKeyDown(I){I.key=="Tab"&&(w.current=!0,v.requestAnimationFrame(()=>{w.current=!1}))},onBlur(I){if(!(l&4))return;let P=JAe(o);n.current instanceof HTMLElement&&P.add(n.current);let R=I.relatedTarget;R instanceof HTMLElement&&R.dataset.headlessuiFocusGuard!=="true"&&(e8e(P,R)||(w.current?GC(n.current,qf(f.current,{[aj.Forwards]:()=>em.Next,[aj.Backwards]:()=>em.Previous})|em.WrapAround,{relativeTo:I.target}):I.target instanceof HTMLElement&&O0(I.target)))}},N=Co();return Ne.createElement(Ne.Fragment,null,g&&Ne.createElement(v9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:CS.Focusable}),N({ourProps:C,theirProps:c,defaultTag:LZe,name:"FocusTrap"}),g&&Ne.createElement(v9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:CS.Focusable}))}let BZe=uo(DZe),$Ze=Object.assign(BZe,{features:Pv});function UZe(e=!0){let t=m.useRef(Pb.slice());return Rre(([n],[r])=>{r===!0&&n===!1&&vD(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Pb.slice())},[e,Pb,t]),Bs(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function zZe(e,{ownerDocument:t}){let n=!!(e&8),r=UZe(n);Rre(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&O0(r())},[n]),WAe(()=>{n&&O0(r())})}function HZe(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:s}){let a=m.useRef(null),o=eA(!!(e&1),"focus-trap#initial-focus"),l=Wre();return Rre(()=>{if(e===0)return;if(!o){s!=null&&s.current&&O0(s.current);return}let c=n.current;c&&vD(()=>{if(!l.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){a.current=u;return}}else if(c.contains(u)){a.current=u;return}if(r!=null&&r.current)O0(r.current);else{if(e&16){if(GC(c,em.First|em.AutoFocus)!==wQ.Error)return}else if(GC(c,em.First)!==wQ.Error)return;if(s!=null&&s.current&&(O0(s.current),(t==null?void 0:t.activeElement)===s.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=t==null?void 0:t.activeElement})},[s,o,e]),a}function VZe(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:s}){let a=Wre(),o=!!(e&4);NAe(t==null?void 0:t.defaultView,"focus",l=>{if(!o||!a.current)return;let c=JAe(r);n.current instanceof HTMLElement&&c.add(n.current);let u=s.current;if(!u)return;let d=l.target;d&&d instanceof HTMLElement?e8e(c,d)?(s.current=d,O0(d)):(l.preventDefault(),l.stopPropagation(),O0(u)):O0(s.current)},!0)}function e8e(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function t8e(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:r8e)!==m.Fragment||Ne.Children.count(e.children)===1}let ED=m.createContext(null);ED.displayName="TransitionContext";var WZe=(e=>(e.Visible="visible",e.Hidden="hidden",e))(WZe||{});function qZe(){let e=m.useContext(ED);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function GZe(){let e=m.useContext(_D);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let _D=m.createContext(null);_D.displayName="NestingContext";function kD(e){return"children"in e?kD(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function n8e(e,t){let n=n5(e),r=m.useRef([]),s=Wre(),a=n2(),o=Bs((g,v=uy.Hidden)=>{let w=r.current.findIndex(({el:C})=>C===g);w!==-1&&(qf(v,{[uy.Unmount](){r.current.splice(w,1)},[uy.Hidden](){r.current[w].state="hidden"}}),a.microTask(()=>{var C;!kD(r)&&s.current&&((C=n.current)==null||C.call(n))}))}),l=Bs(g=>{let v=r.current.find(({el:w})=>w===g);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:g,state:"visible"}),()=>o(g,uy.Unmount)}),c=m.useRef([]),u=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[]}),f=Bs((g,v,w)=>{c.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([C])=>C!==g)),t==null||t.chains.current[v].push([g,new Promise(C=>{c.current.push(C)})]),t==null||t.chains.current[v].push([g,new Promise(C=>{Promise.all(d.current[v].map(([N,I])=>I)).then(()=>C())})]),v==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>w(v)):w(v)}),x=Bs((g,v,w)=>{Promise.all(d.current[v].splice(0).map(([C,N])=>N)).then(()=>{var C;(C=c.current.shift())==null||C()}).then(()=>w(v))});return m.useMemo(()=>({children:r,register:l,unregister:o,onStart:f,onStop:x,wait:u,chains:d}),[l,o,r,f,x,d,u])}let r8e=m.Fragment,s8e=Py.RenderStrategy;function KZe(e,t){var n,r;let{transition:s=!0,beforeEnter:a,afterEnter:o,beforeLeave:l,afterLeave:c,enter:u,enterFrom:d,enterTo:f,entered:x,leave:g,leaveFrom:v,leaveTo:w,...C}=e,[N,I]=m.useState(null),P=m.useRef(null),R=t8e(e),F=oc(...R?[P,t,I]:t===null?[]:[t]),U=(n=C.unmount)==null||n?uy.Unmount:uy.Hidden,{show:L,appear:z,initial:Q}=qZe(),[ne,J]=m.useState(L?"visible":"hidden"),X=GZe(),{register:re,unregister:pe}=X;Qa(()=>re(P),[re,P]),Qa(()=>{if(U===uy.Hidden&&P.current){if(L&&ne!=="visible"){J("visible");return}return qf(ne,{hidden:()=>pe(P),visible:()=>re(P)})}},[ne,P,re,pe,L,U]);let Y=gk();Qa(()=>{if(R&&Y&&ne==="visible"&&P.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[P,ne,Y,R]);let ie=Q&&!z,oe=z&&L&&Q,G=m.useRef(!1),V=n8e(()=>{G.current||(J("hidden"),pe(P))},X),te=Bs(ye=>{G.current=!0;let je=ye?"enter":"leave";V.onStart(P,je,Ie=>{Ie==="enter"?a==null||a():Ie==="leave"&&(l==null||l())})}),ae=Bs(ye=>{let je=ye?"enter":"leave";G.current=!1,V.onStop(P,je,Ie=>{Ie==="enter"?o==null||o():Ie==="leave"&&(c==null||c())}),je==="leave"&&!kD(V)&&(J("hidden"),pe(P))});m.useEffect(()=>{R&&s||(te(L),ae(L))},[L,R,s]);let he=!(!s||!R||!Y||ie),[,Ce]=Mre(he,N,L,{start:te,end:ae}),ce=kb({ref:F,className:((r=yQ(C.className,oe&&u,oe&&d,Ce.enter&&u,Ce.enter&&Ce.closed&&d,Ce.enter&&!Ce.closed&&f,Ce.leave&&g,Ce.leave&&!Ce.closed&&v,Ce.leave&&Ce.closed&&w,!Ce.transition&&L&&x))==null?void 0:r.trim())||void 0,...Ore(Ce)}),ge=0;ne==="visible"&&(ge|=tc.Open),ne==="hidden"&&(ge|=tc.Closed),Ce.enter&&(ge|=tc.Opening),Ce.leave&&(ge|=tc.Closing);let Ae=Co();return Ne.createElement(_D.Provider,{value:V},Ne.createElement(Vre,{value:ge},Ae({ourProps:ce,theirProps:C,defaultTag:r8e,features:s8e,visible:ne==="visible",name:"Transition.Child"})))}function YZe(e,t){let{show:n,appear:r=!1,unmount:s=!0,...a}=e,o=m.useRef(null),l=t8e(e),c=oc(...l?[o,t]:t===null?[]:[t]);gk();let u=iA();if(n===void 0&&u!==null&&(n=(u&tc.Open)===tc.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,f]=m.useState(n?"visible":"hidden"),x=n8e(()=>{n||f("hidden")}),[g,v]=m.useState(!0),w=m.useRef([n]);Qa(()=>{g!==!1&&w.current[w.current.length-1]!==n&&(w.current.push(n),v(!1))},[w,n]);let C=m.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);Qa(()=>{n?f("visible"):!kD(x)&&o.current!==null&&f("hidden")},[n,x]);let N={unmount:s},I=Bs(()=>{var F;g&&v(!1),(F=e.beforeEnter)==null||F.call(e)}),P=Bs(()=>{var F;g&&v(!1),(F=e.beforeLeave)==null||F.call(e)}),R=Co();return Ne.createElement(_D.Provider,{value:x},Ne.createElement(ED.Provider,{value:C},R({ourProps:{...N,as:m.Fragment,children:Ne.createElement(i8e,{ref:c,...N,...a,beforeEnter:I,beforeLeave:P})},theirProps:{},defaultTag:m.Fragment,features:s8e,visible:d==="visible",name:"Transition"})))}function XZe(e,t){let n=m.useContext(ED)!==null,r=iA()!==null;return Ne.createElement(Ne.Fragment,null,!n&&r?Ne.createElement(_Q,{ref:t,...e}):Ne.createElement(i8e,{ref:t,...e}))}let _Q=uo(YZe),i8e=uo(KZe),qre=uo(XZe),a8e=Object.assign(_Q,{Child:qre,Root:_Q});var QZe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(QZe||{}),ZZe=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(ZZe||{});let JZe={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Gre=m.createContext(null);Gre.displayName="DialogContext";function TD(e){let t=m.useContext(Gre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,TD),n}return t}function eJe(e,t){return qf(t.type,JZe,e,t)}let rfe=uo(function(e,t){let n=m.useId(),{id:r=`headlessui-dialog-${n}`,open:s,onClose:a,initialFocus:o,role:l="dialog",autoFocus:c=!0,__demoMode:u=!1,unmount:d=!1,...f}=e,x=m.useRef(!1);l=function(){return l==="dialog"||l==="alertdialog"?l:(x.current||(x.current=!0,console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=iA();s===void 0&&g!==null&&(s=(g&tc.Open)===tc.Open);let v=m.useRef(null),w=oc(v,t),C=tA(v),N=s?0:1,[I,P]=m.useReducer(eJe,{titleId:null,descriptionId:null,panelRef:m.createRef()}),R=Bs(()=>a(!1)),F=Bs(ae=>P({type:0,id:ae})),U=gk()?N===0:!1,[L,z]=IZe(),Q={get current(){var ae;return(ae=I.panelRef.current)!=null?ae:v.current}},ne=ZAe(),{resolveContainers:J}=MZe({mainTreeNode:ne,portals:L,defaultContainers:[Q]}),X=g!==null?(g&tc.Closing)===tc.Closing:!1;xAe(u||X?!1:U,{allowed:Bs(()=>{var ae,he;return[(he=(ae=v.current)==null?void 0:ae.closest("[data-headlessui-portal]"))!=null?he:null]}),disallowed:Bs(()=>{var ae;return[(ae=ne==null?void 0:ne.closest("body > *:not(#headlessui-portal-root)"))!=null?ae:null]})}),SAe(U,J,ae=>{ae.preventDefault(),R()}),FZe(U,C==null?void 0:C.defaultView,ae=>{ae.preventDefault(),ae.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),R()}),AAe(u||X?!1:U,C,J),gAe(U,v,R);let[re,pe]=_re(),Y=m.useMemo(()=>[{dialogState:N,close:R,setTitleId:F,unmount:d},I],[N,I,R,F,d]),ie=m.useMemo(()=>({open:N===0}),[N]),oe={ref:w,id:r,role:l,tabIndex:-1,"aria-modal":u?void 0:N===0?!0:void 0,"aria-labelledby":I.titleId,"aria-describedby":re,unmount:d},G=!OZe(),V=Pv.None;U&&!u&&(V|=Pv.RestoreFocus,V|=Pv.TabLock,c&&(V|=Pv.AutoFocus),G&&(V|=Pv.InitialFocus));let te=Co();return Ne.createElement(VAe,null,Ne.createElement(tfe,{force:!0},Ne.createElement(XAe,null,Ne.createElement(Gre.Provider,{value:Y},Ne.createElement(YAe,{target:v},Ne.createElement(tfe,{force:!1},Ne.createElement(pe,{slot:ie},Ne.createElement(z,null,Ne.createElement($Ze,{initialFocus:o,initialFocusFallback:v,containers:J,features:V},Ne.createElement(hAe,{value:R},te({ourProps:oe,theirProps:f,slot:ie,defaultTag:tJe,features:nJe,visible:N===0,name:"Dialog"})))))))))))}),tJe="div",nJe=Py.RenderStrategy|Py.Static;function rJe(e,t){let{transition:n=!1,open:r,...s}=e,a=iA(),o=e.hasOwnProperty("open")||a!==null,l=e.hasOwnProperty("onClose");if(!o&&!l)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!s.static?Ne.createElement(nfe,null,Ne.createElement(a8e,{show:r,transition:n,unmount:s.unmount},Ne.createElement(rfe,{ref:t,...s}))):Ne.createElement(nfe,null,Ne.createElement(rfe,{ref:t,open:r,...s}))}let sJe="div";function iJe(e,t){let n=m.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:s=!1,...a}=e,[{dialogState:o,unmount:l},c]=TD("Dialog.Panel"),u=oc(t,c.panelRef),d=m.useMemo(()=>({open:o===0}),[o]),f=Bs(C=>{C.stopPropagation()}),x={ref:u,id:r,onClick:f},g=s?qre:m.Fragment,v=s?{unmount:l}:{},w=Co();return Ne.createElement(g,{...v},w({ourProps:x,theirProps:a,slot:d,defaultTag:sJe,name:"Dialog.Panel"}))}let aJe="div";function oJe(e,t){let{transition:n=!1,...r}=e,[{dialogState:s,unmount:a}]=TD("Dialog.Backdrop"),o=m.useMemo(()=>({open:s===0}),[s]),l={ref:t,"aria-hidden":!0},c=n?qre:m.Fragment,u=n?{unmount:a}:{},d=Co();return Ne.createElement(c,{...u},d({ourProps:l,theirProps:r,slot:o,defaultTag:aJe,name:"Dialog.Backdrop"}))}let lJe="h2";function cJe(e,t){let n=m.useId(),{id:r=`headlessui-dialog-title-${n}`,...s}=e,[{dialogState:a,setTitleId:o}]=TD("Dialog.Title"),l=oc(t);m.useEffect(()=>(o(r),()=>o(null)),[r,o]);let c=m.useMemo(()=>({open:a===0}),[a]),u={ref:l,id:r};return Co()({ourProps:u,theirProps:s,slot:c,defaultTag:lJe,name:"Dialog.Title"})}let uJe=uo(rJe),xa=uo(iJe),ja=uo(oJe),dJe=uo(cJe),Ea=Object.assign(uJe,{Panel:xa,Title:dJe,Description:dAe});var sfe;let fJe=(sfe=Ne.startTransition)!=null?sfe:function(e){e()};var hJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(hJe||{}),pJe=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))(pJe||{});let mJe={0:e=>({...e,disclosureState:qf(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}},4(e,t){return e.buttonElement===t.element?e:{...e,buttonElement:t.element}},5(e,t){return e.panelElement===t.element?e:{...e,panelElement:t.element}}},Kre=m.createContext(null);Kre.displayName="DisclosureContext";function Yre(e){let t=m.useContext(Kre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Yre),n}return t}let Xre=m.createContext(null);Xre.displayName="DisclosureAPIContext";function o8e(e){let t=m.useContext(Xre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,o8e),n}return t}let Qre=m.createContext(null);Qre.displayName="DisclosurePanelContext";function xJe(){return m.useContext(Qre)}function gJe(e,t){return qf(t.type,mJe,e,t)}let bJe=m.Fragment;function yJe(e,t){let{defaultOpen:n=!1,...r}=e,s=m.useRef(null),a=oc(t,cAe(w=>{s.current=w},e.as===void 0||e.as===m.Fragment)),o=m.useReducer(gJe,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:l,buttonId:c},u]=o,d=Bs(w=>{u({type:1});let C=t2(s);if(!C||!c)return;let N=w?w instanceof HTMLElement?w:w.current instanceof HTMLElement?w.current:C.getElementById(c):C.getElementById(c);N==null||N.focus()}),f=m.useMemo(()=>({close:d}),[d]),x=m.useMemo(()=>({open:l===0,close:d}),[l,d]),g={ref:a},v=Co();return Ne.createElement(Kre.Provider,{value:o},Ne.createElement(Xre.Provider,{value:f},Ne.createElement(hAe,{value:d},Ne.createElement(Vre,{value:qf(l,{0:tc.Open,1:tc.Closed})},v({ourProps:g,theirProps:r,slot:x,defaultTag:bJe,name:"Disclosure"})))))}let vJe="button";function wJe(e,t){let n=m.useId(),{id:r=`headlessui-disclosure-button-${n}`,disabled:s=!1,autoFocus:a=!1,...o}=e,[l,c]=Yre("Disclosure.Button"),u=xJe(),d=u===null?!1:u===l.panelId,f=m.useRef(null),x=oc(f,t,Bs(Q=>{if(!d)return c({type:4,element:Q})}));m.useEffect(()=>{if(!d)return c({type:2,buttonId:r}),()=>{c({type:2,buttonId:null})}},[r,c,d]);let g=Bs(Q=>{var ne;if(d){if(l.disclosureState===1)return;switch(Q.key){case xo.Space:case xo.Enter:Q.preventDefault(),Q.stopPropagation(),c({type:0}),(ne=l.buttonElement)==null||ne.focus();break}}else switch(Q.key){case xo.Space:case xo.Enter:Q.preventDefault(),Q.stopPropagation(),c({type:0});break}}),v=Bs(Q=>{switch(Q.key){case xo.Space:Q.preventDefault();break}}),w=Bs(Q=>{var ne;Ere(Q.currentTarget)||s||(d?(c({type:0}),(ne=l.buttonElement)==null||ne.focus()):c({type:0}))}),{isFocusVisible:C,focusProps:N}=Nre({autoFocus:a}),{isHovered:I,hoverProps:P}=Sre({isDisabled:s}),{pressed:R,pressProps:F}=Are({disabled:s}),U=m.useMemo(()=>({open:l.disclosureState===0,hover:I,active:R,disabled:s,focus:C,autofocus:a}),[l,I,R,C,s,a]),L=Fre(e,l.buttonElement),z=y9(d?{ref:x,type:L,disabled:s||void 0,autoFocus:a,onKeyDown:g,onClick:w}:{ref:x,id:r,type:L,"aria-expanded":l.disclosureState===0,"aria-controls":l.panelElement?l.panelId:void 0,disabled:s||void 0,autoFocus:a,onKeyDown:g,onKeyUp:v,onClick:w},N,P,F);return Co()({ourProps:z,theirProps:o,slot:U,defaultTag:vJe,name:"Disclosure.Button"})}let CJe="div",SJe=Py.RenderStrategy|Py.Static;function NJe(e,t){let n=m.useId(),{id:r=`headlessui-disclosure-panel-${n}`,transition:s=!1,...a}=e,[o,l]=Yre("Disclosure.Panel"),{close:c}=o8e("Disclosure.Panel"),[u,d]=m.useState(null),f=oc(t,Bs(I=>{fJe(()=>l({type:5,element:I}))}),d);m.useEffect(()=>(l({type:3,panelId:r}),()=>{l({type:3,panelId:null})}),[r,l]);let x=iA(),[g,v]=Mre(s,u,x!==null?(x&tc.Open)===tc.Open:o.disclosureState===0),w=m.useMemo(()=>({open:o.disclosureState===0,close:c}),[o.disclosureState,c]),C={ref:f,id:r,...Ore(v)},N=Co();return Ne.createElement(VAe,null,Ne.createElement(Qre.Provider,{value:o.panelId},N({ourProps:C,theirProps:a,slot:w,defaultTag:CJe,features:SJe,visible:g,name:"Disclosure.Panel"})))}let AJe=uo(yJe),Zre=uo(wJe),Jre=uo(NJe),l8e=Object.assign(AJe,{Button:Zre,Panel:Jre});function jJe(e,t){let n=m.useRef({left:0,top:0});if(Qa(()=>{if(!t)return;let s=t.getBoundingClientRect();s&&(n.current=s)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let ife=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function afe(e){var t,n;let r=(t=e.innerText)!=null?t:"",s=e.cloneNode(!0);if(!(s instanceof HTMLElement))return r;let a=!1;for(let l of s.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),a=!0;let o=a?(n=s.innerText)!=null?n:"":r;return ife.test(o)&&(o=o.replace(ife,"")),o}function EJe(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(s=>{let a=document.getElementById(s);if(a){let o=a.getAttribute("aria-label");return typeof o=="string"?o.trim():afe(a).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return afe(e).trim()}function _Je(e){let t=m.useRef(""),n=m.useRef("");return Bs(()=>{let r=e.current;if(!r)return"";let s=r.innerText;if(t.current===s)return n.current;let a=EJe(r).trim().toLowerCase();return t.current=s,n.current=a,a})}var kJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(kJe||{}),TJe=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(TJe||{}),IJe=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetItemsElement=8]="SetItemsElement",e))(IJe||{});function Cz(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=vAe(t(e.items.slice()),a=>a.dataRef.current.domRef.current),s=n?r.indexOf(n):null;return s===-1&&(s=null),{items:r,activeItemIndex:s}}let PJe={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var n,r,s,a,o;if(e.menuState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===_u.Nothing)return{...l,activeItemIndex:null};if(t.focus===_u.Specific)return{...l,activeItemIndex:e.items.findIndex(d=>d.id===t.id)};if(t.focus===_u.Previous){let d=e.activeItemIndex;if(d!==null){let f=e.items[d].dataRef.current.domRef,x=wz(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(x!==null){let g=e.items[x].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===g.current||((s=g.current)==null?void 0:s.previousElementSibling)===null)return{...l,activeItemIndex:x}}}}else if(t.focus===_u.Next){let d=e.activeItemIndex;if(d!==null){let f=e.items[d].dataRef.current.domRef,x=wz(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(x!==null){let g=e.items[x].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===g.current||((o=g.current)==null?void 0:o.nextElementSibling)===null)return{...l,activeItemIndex:x}}}}let c=Cz(e),u=wz(t,{resolveItems:()=>c.items,resolveActiveIndex:()=>c.activeItemIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...l,...c,activeItemIndex:u}},3:(e,t)=>{let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),s=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(o=>{var l;return((l=o.dataRef.current.textValue)==null?void 0:l.startsWith(r))&&!o.dataRef.current.disabled}),a=s?e.items.indexOf(s):-1;return a===-1||a===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:a,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let n=Cz(e,r=>[...r,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=Cz(e,r=>{let s=r.findIndex(a=>a.id===t.id);return s!==-1&&r.splice(s,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element}},ese=m.createContext(null);ese.displayName="MenuContext";function ID(e){let t=m.useContext(ese);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ID),n}return t}function FJe(e,t){return qf(t.type,PJe,e,t)}let OJe=m.Fragment;function MJe(e,t){let{__demoMode:n=!1,...r}=e,s=m.useReducer(FJe,{__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:a,itemsElement:o,buttonElement:l},c]=s,u=oc(t);SAe(a===0,[l,o],(v,w)=>{c({type:1}),Pre(w,Ire.Loose)||(v.preventDefault(),l==null||l.focus())});let d=Bs(()=>{c({type:1})}),f=m.useMemo(()=>({open:a===0,close:d}),[a,d]),x={ref:u},g=Co();return Ne.createElement(yZe,null,Ne.createElement(ese.Provider,{value:s},Ne.createElement(Vre,{value:qf(a,{0:tc.Open,1:tc.Closed})},g({ourProps:x,theirProps:r,slot:f,defaultTag:OJe,name:"Menu"}))))}let RJe="button";function LJe(e,t){var n;let r=m.useId(),{id:s=`headlessui-menu-button-${r}`,disabled:a=!1,autoFocus:o=!1,...l}=e,[c,u]=ID("Menu.Button"),d=xZe(),f=oc(t,mZe(),Bs(L=>u({type:7,element:L}))),x=Bs(L=>{switch(L.key){case xo.Space:case xo.Enter:case xo.ArrowDown:L.preventDefault(),L.stopPropagation(),Na.flushSync(()=>u({type:0})),u({type:2,focus:_u.First});break;case xo.ArrowUp:L.preventDefault(),L.stopPropagation(),Na.flushSync(()=>u({type:0})),u({type:2,focus:_u.Last});break}}),g=Bs(L=>{switch(L.key){case xo.Space:L.preventDefault();break}}),v=Bs(L=>{var z;if(Ere(L.currentTarget))return L.preventDefault();a||(c.menuState===0?(Na.flushSync(()=>u({type:1})),(z=c.buttonElement)==null||z.focus({preventScroll:!0})):(L.preventDefault(),u({type:0})))}),{isFocusVisible:w,focusProps:C}=Nre({autoFocus:o}),{isHovered:N,hoverProps:I}=Sre({isDisabled:a}),{pressed:P,pressProps:R}=Are({disabled:a}),F=m.useMemo(()=>({open:c.menuState===0,active:P||c.menuState===0,disabled:a,hover:N,focus:w,autofocus:o}),[c,N,w,P,a,o]),U=y9(d(),{ref:f,id:s,type:Fre(e,c.buttonElement),"aria-haspopup":"menu","aria-controls":(n=c.itemsElement)==null?void 0:n.id,"aria-expanded":c.menuState===0,disabled:a||void 0,autoFocus:o,onKeyDown:x,onKeyUp:g,onClick:v},C,I,R);return Co()({ourProps:U,theirProps:l,slot:F,defaultTag:RJe,name:"Menu.Button"})}let DJe="div",BJe=Py.RenderStrategy|Py.Static;function $Je(e,t){var n,r;let s=m.useId(),{id:a=`headlessui-menu-items-${s}`,anchor:o,portal:l=!1,modal:c=!0,transition:u=!1,...d}=e,f=pZe(o),[x,g]=ID("Menu.Items"),[v,w]=bZe(f),C=gZe(),[N,I]=m.useState(null),P=oc(t,f?v:null,Bs(G=>g({type:8,element:G})),I),R=tA(x.itemsElement);f&&(l=!0);let F=iA(),[U,L]=Mre(u,N,F!==null?(F&tc.Open)===tc.Open:x.menuState===0);gAe(U,x.buttonElement,()=>{g({type:1})});let z=x.__demoMode?!1:c&&x.menuState===0;AAe(z,R);let Q=x.__demoMode?!1:c&&x.menuState===0;xAe(Q,{allowed:m.useCallback(()=>[x.buttonElement,x.itemsElement],[x.buttonElement,x.itemsElement])});let ne=x.menuState!==0,J=jJe(ne,x.buttonElement)?!1:U;m.useEffect(()=>{let G=x.itemsElement;G&&x.menuState===0&&G!==(R==null?void 0:R.activeElement)&&G.focus({preventScroll:!0})},[x.menuState,x.itemsElement,R]),cQe(x.menuState===0,{container:x.itemsElement,accept(G){return G.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:G.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(G){G.setAttribute("role","none")}});let X=n2(),re=Bs(G=>{var V,te,ae;switch(X.dispose(),G.key){case xo.Space:if(x.searchQuery!=="")return G.preventDefault(),G.stopPropagation(),g({type:3,value:G.key});case xo.Enter:if(G.preventDefault(),G.stopPropagation(),g({type:1}),x.activeItemIndex!==null){let{dataRef:he}=x.items[x.activeItemIndex];(te=(V=he.current)==null?void 0:V.domRef.current)==null||te.click()}yAe(x.buttonElement);break;case xo.ArrowDown:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:_u.Next});case xo.ArrowUp:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:_u.Previous});case xo.Home:case xo.PageUp:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:_u.First});case xo.End:case xo.PageDown:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:_u.Last});case xo.Escape:G.preventDefault(),G.stopPropagation(),Na.flushSync(()=>g({type:1})),(ae=x.buttonElement)==null||ae.focus({preventScroll:!0});break;case xo.Tab:G.preventDefault(),G.stopPropagation(),Na.flushSync(()=>g({type:1})),KXe(x.buttonElement,G.shiftKey?em.Previous:em.Next);break;default:G.key.length===1&&(g({type:3,value:G.key}),X.setTimeout(()=>g({type:4}),350));break}}),pe=Bs(G=>{switch(G.key){case xo.Space:G.preventDefault();break}}),Y=m.useMemo(()=>({open:x.menuState===0}),[x.menuState]),ie=y9(f?C():{},{"aria-activedescendant":x.activeItemIndex===null||(n=x.items[x.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(r=x.buttonElement)==null?void 0:r.id,id:a,onKeyDown:re,onKeyUp:pe,role:"menu",tabIndex:x.menuState===0?0:void 0,ref:P,style:{...d.style,...w,"--button-width":BXe(x.buttonElement,!0).width},...Ore(L)}),oe=Co();return Ne.createElement(XAe,{enabled:l?e.static||U:!1},oe({ourProps:ie,theirProps:d,slot:Y,defaultTag:DJe,features:BJe,visible:J,name:"Menu.Items"}))}let UJe=m.Fragment;function zJe(e,t){let n=m.useId(),{id:r=`headlessui-menu-item-${n}`,disabled:s=!1,...a}=e,[o,l]=ID("Menu.Item"),c=o.activeItemIndex!==null?o.items[o.activeItemIndex].id===r:!1,u=m.useRef(null),d=oc(t,u);Qa(()=>{if(!o.__demoMode&&o.menuState===0&&c&&o.activationTrigger!==0)return lx().requestAnimationFrame(()=>{var J,X;(X=(J=u.current)==null?void 0:J.scrollIntoView)==null||X.call(J,{block:"nearest"})})},[o.__demoMode,u,c,o.menuState,o.activationTrigger,o.activeItemIndex]);let f=_Je(u),x=m.useRef({disabled:s,domRef:u,get textValue(){return f()}});Qa(()=>{x.current.disabled=s},[x,s]),Qa(()=>(l({type:5,id:r,dataRef:x}),()=>l({type:6,id:r})),[x,r]);let g=Bs(()=>{l({type:1})}),v=Bs(J=>{if(s)return J.preventDefault();l({type:1}),yAe(o.buttonElement)}),w=Bs(()=>{if(s)return l({type:2,focus:_u.Nothing});l({type:2,focus:_u.Specific,id:r})}),C=nQe(),N=Bs(J=>{C.update(J),!s&&(c||l({type:2,focus:_u.Specific,id:r,trigger:0}))}),I=Bs(J=>{C.wasMoved(J)&&(s||c||l({type:2,focus:_u.Specific,id:r,trigger:0}))}),P=Bs(J=>{C.wasMoved(J)&&(s||c&&l({type:2,focus:_u.Nothing}))}),[R,F]=Tre(),[U,L]=_re(),z=m.useMemo(()=>({active:c,focus:c,disabled:s,close:g}),[c,s,g]),Q={id:r,ref:d,role:"menuitem",tabIndex:s===!0?void 0:-1,"aria-disabled":s===!0?!0:void 0,"aria-labelledby":R,"aria-describedby":U,disabled:void 0,onClick:v,onFocus:w,onPointerEnter:N,onMouseEnter:N,onPointerMove:I,onMouseMove:I,onPointerLeave:P,onMouseLeave:P},ne=Co();return Ne.createElement(F,null,Ne.createElement(L,null,ne({ourProps:Q,theirProps:a,slot:z,defaultTag:UJe,name:"Menu.Item"})))}let HJe="div";function VJe(e,t){let[n,r]=Tre(),s=e,a={ref:t,"aria-labelledby":n,role:"group"},o=Co();return Ne.createElement(r,null,o({ourProps:a,theirProps:s,slot:{},defaultTag:HJe,name:"Menu.Section"}))}let WJe="header";function qJe(e,t){let n=m.useId(),{id:r=`headlessui-menu-heading-${n}`,...s}=e,a=kre();Qa(()=>a.register(r),[r,a.register]);let o={id:r,ref:t,role:"presentation",...a.props};return Co()({ourProps:o,theirProps:s,slot:{},defaultTag:WJe,name:"Menu.Heading"})}let GJe="div";function KJe(e,t){let n=e,r={ref:t,role:"separator"};return Co()({ourProps:r,theirProps:n,slot:{},defaultTag:GJe,name:"Menu.Separator"})}let YJe=uo(MJe),PD=uo(LJe),FD=uo($Je),jC=uo(zJe),XJe=uo(VJe),QJe=uo(qJe),ZJe=uo(KJe),OD=Object.assign(YJe,{Button:PD,Items:FD,Item:jC,Section:XJe,Heading:QJe,Separator:ZJe}),tse=m.createContext(null);tse.displayName="GroupContext";let JJe=m.Fragment;function eet(e){var t;let[n,r]=m.useState(null),[s,a]=Tre(),[o,l]=_re(),c=m.useMemo(()=>({switch:n,setSwitch:r}),[n,r]),u={},d=e,f=Co();return Ne.createElement(l,{name:"Switch.Description",value:o},Ne.createElement(a,{name:"Switch.Label",value:s,props:{htmlFor:(t=c.switch)==null?void 0:t.id,onClick(x){n&&(x.currentTarget instanceof HTMLLabelElement&&x.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},Ne.createElement(tse.Provider,{value:c},f({ourProps:u,theirProps:d,slot:{},defaultTag:JJe,name:"Switch.Group"}))))}let tet="button";function net(e,t){var n;let r=m.useId(),s=oAe(),a=jre(),{id:o=s||`headlessui-switch-${r}`,disabled:l=a||!1,checked:c,defaultChecked:u,onChange:d,name:f,value:x,form:g,autoFocus:v=!1,...w}=e,C=m.useContext(tse),[N,I]=m.useState(null),P=m.useRef(null),R=oc(P,t,C===null?null:C.setSwitch,I),F=yXe(u),[U,L]=bXe(c,d,F??!1),z=n2(),[Q,ne]=m.useState(!1),J=Bs(()=>{ne(!0),L==null||L(!U),z.nextFrame(()=>{ne(!1)})}),X=Bs(ye=>{if(Ere(ye.currentTarget))return ye.preventDefault();ye.preventDefault(),J()}),re=Bs(ye=>{ye.key===xo.Space?(ye.preventDefault(),J()):ye.key===xo.Enter&&vXe(ye.currentTarget)}),pe=Bs(ye=>ye.preventDefault()),Y=fAe(),ie=kXe(),{isFocusVisible:oe,focusProps:G}=Nre({autoFocus:v}),{isHovered:V,hoverProps:te}=Sre({isDisabled:l}),{pressed:ae,pressProps:he}=Are({disabled:l}),Ce=m.useMemo(()=>({checked:U,disabled:l,hover:V,focus:oe,active:ae,autofocus:v,changing:Q}),[U,V,oe,ae,l,Q,v]),ce=y9({id:o,ref:R,role:"switch",type:Fre(e,N),tabIndex:e.tabIndex===-1?0:(n=e.tabIndex)!=null?n:0,"aria-checked":U,"aria-labelledby":Y,"aria-describedby":ie,disabled:l||void 0,autoFocus:v,onClick:X,onKeyUp:re,onKeyPress:pe},G,te,he),ge=m.useCallback(()=>{if(F!==void 0)return L==null?void 0:L(F)},[L,F]),Ae=Co();return Ne.createElement(Ne.Fragment,null,f!=null&&Ne.createElement(AXe,{disabled:l,data:{[f]:x||"on"},overrides:{type:"checkbox",checked:U},form:g,onReset:ge}),Ae({ourProps:ce,theirProps:w,slot:Ce,defaultTag:tet,name:"Switch"}))}let ret=uo(net),set=eet,iet=RXe,aet=dAe,jo=Object.assign(ret,{Group:set,Label:iet,Description:aet});function oet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 0 1 .75.75v10.638l3.96-4.158a.75.75 0 1 1 1.08 1.04l-5.25 5.5a.75.75 0 0 1-1.08 0l-5.25-5.5a.75.75 0 1 1 1.08-1.04l3.96 4.158V3.75A.75.75 0 0 1 10 3Z",clipRule:"evenodd"}))}const Bl=m.forwardRef(oet);function cet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 0 1-9.201 2.466l-.312-.311h2.433a.75.75 0 0 0 0-1.5H3.989a.75.75 0 0 0-.75.75v4.242a.75.75 0 0 0 1.5 0v-2.43l.31.31a7 7 0 0 0 11.712-3.138.75.75 0 0 0-1.449-.39Zm1.23-3.723a.75.75 0 0 0 .219-.53V2.929a.75.75 0 0 0-1.5 0V5.36l-.31-.31A7 7 0 0 0 3.239 8.188a.75.75 0 1 0 1.448.389A5.5 5.5 0 0 1 13.89 6.11l.311.31h-2.432a.75.75 0 0 0 0 1.5h4.243a.75.75 0 0 0 .53-.219Z",clipRule:"evenodd"}))}const AS=m.forwardRef(cet);function uet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Z",clipRule:"evenodd"}),m.createElement("path",{fillRule:"evenodd",d:"M6.194 12.753a.75.75 0 0 0 1.06.053L16.5 4.44v2.81a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.553l-9.056 8.194a.75.75 0 0 0-.053 1.06Z",clipRule:"evenodd"}))}const det=m.forwardRef(uet);function fet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 17a.75.75 0 0 1-.75-.75V5.612L5.29 9.77a.75.75 0 0 1-1.08-1.04l5.25-5.5a.75.75 0 0 1 1.08 0l5.25 5.5a.75.75 0 1 1-1.08 1.04l-3.96-4.158V16.25A.75.75 0 0 1 10 17Z",clipRule:"evenodd"}))}const nse=m.forwardRef(fet);function het({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const pet=m.forwardRef(het);function met({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const c8e=m.forwardRef(met);function xet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const N9=m.forwardRef(xet);function get({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z",clipRule:"evenodd"}))}const rse=m.forwardRef(get);function bet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 1c3.866 0 7 1.79 7 4s-3.134 4-7 4-7-1.79-7-4 3.134-4 7-4Zm5.694 8.13c.464-.264.91-.583 1.306-.952V10c0 2.21-3.134 4-7 4s-7-1.79-7-4V8.178c.396.37.842.688 1.306.953C5.838 10.006 7.854 10.5 10 10.5s4.162-.494 5.694-1.37ZM3 13.179V15c0 2.21 3.134 4 7 4s7-1.79 7-4v-1.822c-.396.37-.842.688-1.306.953-1.532.875-3.548 1.369-5.694 1.369s-4.162-.494-5.694-1.37A7.009 7.009 0 0 1 3 13.179Z",clipRule:"evenodd"}))}const r5=m.forwardRef(bet);function yet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 0 0-1.06 1.06l14.5 14.5a.75.75 0 1 0 1.06-1.06l-1.745-1.745a10.029 10.029 0 0 0 3.3-4.38 1.651 1.651 0 0 0 0-1.185A10.004 10.004 0 0 0 9.999 3a9.956 9.956 0 0 0-4.744 1.194L3.28 2.22ZM7.752 6.69l1.092 1.092a2.5 2.5 0 0 1 3.374 3.373l1.091 1.092a4 4 0 0 0-5.557-5.557Z",clipRule:"evenodd"}),m.createElement("path",{d:"m10.748 13.93 2.523 2.523a9.987 9.987 0 0 1-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 0 1 0-1.186A10.007 10.007 0 0 1 2.839 6.02L6.07 9.252a4 4 0 0 0 4.678 4.678Z"}))}const vet=m.forwardRef(yet);function wet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"}),m.createElement("path",{fillRule:"evenodd",d:"M.664 10.59a1.651 1.651 0 0 1 0-1.186A10.004 10.004 0 0 1 10 3c4.257 0 7.893 2.66 9.336 6.41.147.381.146.804 0 1.186A10.004 10.004 0 0 1 10 17c-4.257 0-7.893-2.66-9.336-6.41ZM14 10a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z",clipRule:"evenodd"}))}const Cet=m.forwardRef(wet);function Net({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M4 10a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H4.75A.75.75 0 0 1 4 10Z",clipRule:"evenodd"}))}const u8e=m.forwardRef(Net);function Aet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{d:"M13 4.5a2.5 2.5 0 1 1 .702 1.737L6.97 9.604a2.518 2.518 0 0 1 0 .792l6.733 3.367a2.5 2.5 0 1 1-.671 1.341l-6.733-3.367a2.5 2.5 0 1 1 0-3.475l6.733-3.366A2.52 2.52 0 0 1 13 4.5Z"}))}const jet=m.forwardRef(Aet);function Eet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"}))}const d8e=m.forwardRef(Eet),f8e=m.createContext({});function _et(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const sse=typeof window<"u",ket=sse?m.useLayoutEffect:m.useEffect,ise=m.createContext(null);function bk(e,t){e.indexOf(t)===-1&&e.push(t)}function yk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Pc=(e,t,n)=>n>t?t:n<e?e:n;let jS=()=>{};const Fc={},MD=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function RD(e){return typeof e=="object"&&e!==null}const LD=e=>/^0[^.\s]+$/u.test(e);function aA(e){let t;return()=>(t===void 0&&(t=e()),t)}const al=e=>e,Tet=(e,t)=>n=>t(e(n)),ux=(...e)=>e.reduce(Tet),K0=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class oA{constructor(){this.subscriptions=[]}add(t){return bk(this.subscriptions,t),()=>yk(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let a=0;a<s;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Hl=e=>e*1e3,nl=e=>e/1e3;function DD(e,t){return t?e*(1e3/t):0}const h8e=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Iet=1e-7,Pet=12;function Fet(e,t,n,r,s){let a,o,l=0;do o=t+(n-t)/2,a=h8e(o,r,s)-e,a>0?n=o:t=o;while(Math.abs(a)>Iet&&++l<Pet);return o}function vk(e,t,n,r){if(e===t&&n===r)return al;const s=a=>Fet(a,0,1,e,n);return a=>a===0||a===1?a:h8e(s(a),t,r)}const p8e=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,m8e=e=>t=>1-e(1-t),x8e=vk(.33,1.53,.69,.99),ase=m8e(x8e),ose=p8e(ase),lse=e=>(e*=2)<1?.5*ase(e):.5*(2-Math.pow(2,-10*(e-1))),cse=e=>1-Math.sin(Math.acos(e)),use=m8e(cse),dse=p8e(cse),Oet=vk(.42,0,1,1),Met=vk(0,0,.58,1),fse=vk(.42,0,.58,1),g8e=e=>Array.isArray(e)&&typeof e[0]!="number",hse=e=>Array.isArray(e)&&typeof e[0]=="number",ofe={linear:al,easeIn:Oet,easeInOut:fse,easeOut:Met,circIn:cse,circInOut:dse,circOut:use,backIn:ase,backInOut:ose,backOut:x8e,anticipate:lse},Ret=e=>typeof e=="string",zO=e=>{if(hse(e)){jS(e.length===4);const[t,n,r,s]=e;return vk(t,n,r,s)}else if(Ret(e))return jS(ofe[e]!==void 0),ofe[e];return e},NI=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Let(e,t){let n=new Set,r=new Set,s=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),e()),d(l)}const u={schedule:(d,f=!1,x=!1)=>{const v=x&&s?n:r;return f&&o.add(d),v.has(d)||v.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(l=d,s){a=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,a&&(a=!1,u.process(d))}};return u}const Det=40;function b8e(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=NI.reduce((P,R)=>(P[R]=Let(a),P),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:x,render:g,postRender:v}=o,w=()=>{const P=Fc.useManualTiming?s.timestamp:performance.now();n=!1,Fc.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(P-s.timestamp,Det),1)),s.timestamp=P,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),f.process(s),x.process(s),g.process(s),v.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(w))},C=()=>{n=!0,r=!0,s.isProcessing||e(w)};return{schedule:NI.reduce((P,R)=>{const F=o[R];return P[R]=(U,L=!1,z=!1)=>(n||C(),F.schedule(U,L,z)),P},{}),cancel:P=>{for(let R=0;R<NI.length;R++)o[NI[R]].cancel(P)},state:s,steps:o}}const{schedule:Io,cancel:Ly,state:Gc,steps:Sz}=b8e(typeof requestAnimationFrame<"u"?requestAnimationFrame:al,!0);let EF;function Bet(){EF=void 0}const Yd={now:()=>(EF===void 0&&Yd.set(Gc.isProcessing||Fc.useManualTiming?Gc.timestamp:performance.now()),EF),set:e=>{EF=e,queueMicrotask(Bet)}},y8e=e=>t=>typeof t=="string"&&t.startsWith(e),pse=y8e("--"),$et=y8e("var(--"),mse=e=>$et(e)?Uet.test(e.split("/*")[0].trim()):!1,Uet=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,lA={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},A9={...lA,transform:e=>Pc(0,1,e)},AI={...lA,default:1},Lj=e=>Math.round(e*1e5)/1e5,xse=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function zet(e){return e==null}const Het=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gse=(e,t)=>n=>!!(typeof n=="string"&&Het.test(n)&&n.startsWith(e)||t&&!zet(n)&&Object.prototype.hasOwnProperty.call(n,t)),v8e=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(xse);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Vet=e=>Pc(0,255,e),Nz={...lA,transform:e=>Math.round(Vet(e))},zv={test:gse("rgb","red"),parse:v8e("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nz.transform(e)+", "+Nz.transform(t)+", "+Nz.transform(n)+", "+Lj(A9.transform(r))+")"};function Wet(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const kQ={test:gse("#"),parse:Wet,transform:zv.transform},wk=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Cb=wk("deg"),M0=wk("%"),ii=wk("px"),qet=wk("vh"),Get=wk("vw"),lfe={...M0,parse:e=>M0.parse(e)/100,transform:e=>M0.transform(e*100)},EC={test:gse("hsl","hue"),parse:v8e("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+M0.transform(Lj(t))+", "+M0.transform(Lj(n))+", "+Lj(A9.transform(r))+")"},Ll={test:e=>zv.test(e)||kQ.test(e)||EC.test(e),parse:e=>zv.test(e)?zv.parse(e):EC.test(e)?EC.parse(e):kQ.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?zv.transform(e):EC.transform(e),getAnimatableNone:e=>{const t=Ll.parse(e);return t.alpha=0,Ll.transform(t)}},Ket=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Yet(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(xse))==null?void 0:t.length)||0)+(((n=e.match(Ket))==null?void 0:n.length)||0)>0}const w8e="number",C8e="color",Xet="var",Qet="var(",cfe="${}",Zet=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function j9(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(Zet,c=>(Ll.test(c)?(r.color.push(a),s.push(C8e),n.push(Ll.parse(c))):c.startsWith(Qet)?(r.var.push(a),s.push(Xet),n.push(c)):(r.number.push(a),s.push(w8e),n.push(parseFloat(c))),++a,cfe)).split(cfe);return{values:n,split:l,indexes:r,types:s}}function S8e(e){return j9(e).values}function N8e(e){const{split:t,types:n}=j9(e),r=t.length;return s=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],s[o]!==void 0){const l=n[o];l===w8e?a+=Lj(s[o]):l===C8e?a+=Ll.transform(s[o]):a+=s[o]}return a}}const Jet=e=>typeof e=="number"?0:Ll.test(e)?Ll.getAnimatableNone(e):e;function ett(e){const t=S8e(e);return N8e(e)(t.map(Jet))}const Dy={test:Yet,parse:S8e,createTransformer:N8e,getAnimatableNone:ett};function Az(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ttt({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,o=0;if(!t)s=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=Az(c,l,e+1/3),a=Az(c,l,e),o=Az(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function HO(e,t){return n=>n>0?t:e}const $o=(e,t,n)=>e+(t-e)*n,jz=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},ntt=[kQ,zv,EC],rtt=e=>ntt.find(t=>t.test(e));function ufe(e){const t=rtt(e);if(!t)return!1;let n=t.parse(e);return t===EC&&(n=ttt(n)),n}const dfe=(e,t)=>{const n=ufe(e),r=ufe(t);if(!n||!r)return HO(e,t);const s={...n};return a=>(s.red=jz(n.red,r.red,a),s.green=jz(n.green,r.green,a),s.blue=jz(n.blue,r.blue,a),s.alpha=$o(n.alpha,r.alpha,a),zv.transform(s))},TQ=new Set(["none","hidden"]);function stt(e,t){return TQ.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function itt(e,t){return n=>$o(e,t,n)}function bse(e){return typeof e=="number"?itt:typeof e=="string"?mse(e)?HO:Ll.test(e)?dfe:ltt:Array.isArray(e)?A8e:typeof e=="object"?Ll.test(e)?dfe:att:HO}function A8e(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>bse(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function att(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=bse(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function ott(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],o=e.indexes[a][r[a]],l=e.values[o]??0;n[s]=l,r[a]++}return n}const ltt=(e,t)=>{const n=Dy.createTransformer(t),r=j9(e),s=j9(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?TQ.has(e)&&!s.values.length||TQ.has(t)&&!r.values.length?stt(e,t):ux(A8e(ott(r,s),s.values),n):HO(e,t)};function j8e(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?$o(e,t,n):bse(e)(e,t)}const ctt=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Io.update(t,n),stop:()=>Ly(t),now:()=>Gc.isProcessing?Gc.timestamp:Yd.now()}},E8e=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},VO=2e4;function yse(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<VO;)t+=n,r=e.next(t);return t>=VO?1/0:t}function utt(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(yse(r),VO);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:nl(s)}}const dtt=5;function _8e(e,t,n){const r=Math.max(t-dtt,0);return DD(n-e(r),t-r)}const Zo={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ffe=.001;function ftt({duration:e=Zo.duration,bounce:t=Zo.bounce,velocity:n=Zo.velocity,mass:r=Zo.mass}){let s,a,o=1-t;o=Pc(Zo.minDamping,Zo.maxDamping,o),e=Pc(Zo.minDuration,Zo.maxDuration,nl(e)),o<1?(s=u=>{const d=u*o,f=d*e,x=d-n,g=IQ(u,o),v=Math.exp(-f);return ffe-x/g*v},a=u=>{const f=u*o*e,x=f*n+n,g=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),w=IQ(Math.pow(u,2),o);return(-s(u)+ffe>0?-1:1)*((x-g)*v)/w}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},a=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=ptt(s,a,l);if(e=Hl(e),isNaN(c))return{stiffness:Zo.stiffness,damping:Zo.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const htt=12;function ptt(e,t,n){let r=n;for(let s=1;s<htt;s++)r=r-e(r)/t(r);return r}function IQ(e,t){return e*Math.sqrt(1-t*t)}const mtt=["duration","bounce"],xtt=["stiffness","damping","mass"];function hfe(e,t){return t.some(n=>e[n]!==void 0)}function gtt(e){let t={velocity:Zo.velocity,stiffness:Zo.stiffness,damping:Zo.damping,mass:Zo.mass,isResolvedFromDuration:!1,...e};if(!hfe(e,xtt)&&hfe(e,mtt))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*Pc(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Zo.mass,stiffness:s,damping:a}}else{const n=ftt(e);t={...t,...n,mass:Zo.mass},t.isResolvedFromDuration=!0}return t}function WO(e=Zo.visualDuration,t=Zo.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:f,velocity:x,isResolvedFromDuration:g}=gtt({...n,velocity:-nl(n.velocity||0)}),v=x||0,w=u/(2*Math.sqrt(c*d)),C=o-a,N=nl(Math.sqrt(c/d)),I=Math.abs(C)<5;r||(r=I?Zo.restSpeed.granular:Zo.restSpeed.default),s||(s=I?Zo.restDelta.granular:Zo.restDelta.default);let P;if(w<1){const F=IQ(N,w);P=U=>{const L=Math.exp(-w*N*U);return o-L*((v+w*N*C)/F*Math.sin(F*U)+C*Math.cos(F*U))}}else if(w===1)P=F=>o-Math.exp(-N*F)*(C+(v+N*C)*F);else{const F=N*Math.sqrt(w*w-1);P=U=>{const L=Math.exp(-w*N*U),z=Math.min(F*U,300);return o-L*((v+w*N*C)*Math.sinh(z)+F*C*Math.cosh(z))/F}}const R={calculatedDuration:g&&f||null,next:F=>{const U=P(F);if(g)l.done=F>=f;else{let L=F===0?v:0;w<1&&(L=F===0?Hl(v):_8e(P,F,U));const z=Math.abs(L)<=r,Q=Math.abs(o-U)<=s;l.done=z&&Q}return l.value=l.done?o:U,l},toString:()=>{const F=Math.min(yse(R),VO),U=E8e(L=>R.next(F*L).value,F,30);return F+"ms "+U},toTransition:()=>{}};return R}WO.applyToOptions=e=>{const t=utt(e,100,WO);return e.ease=t.ease,e.duration=Hl(t.duration),e.type="keyframes",e};function PQ({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],x={done:!1,value:f},g=z=>l!==void 0&&z<l||c!==void 0&&z>c,v=z=>l===void 0?c:c===void 0||Math.abs(l-z)<Math.abs(c-z)?l:c;let w=n*t;const C=f+w,N=o===void 0?C:o(C);N!==C&&(w=N-f);const I=z=>-w*Math.exp(-z/r),P=z=>N+I(z),R=z=>{const Q=I(z),ne=P(z);x.done=Math.abs(Q)<=u,x.value=x.done?N:ne};let F,U;const L=z=>{g(x.value)&&(F=z,U=WO({keyframes:[x.value,v(x.value)],velocity:_8e(P,z,x.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return L(0),{calculatedDuration:null,next:z=>{let Q=!1;return!U&&F===void 0&&(Q=!0,R(z),L(z)),F!==void 0&&z>=F?U.next(z-F):(!Q&&R(z),x)}}}function btt(e,t,n){const r=[],s=n||Fc.mix||j8e,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||al:t;l=ux(c,l)}r.push(l)}return r}function ytt(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(jS(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=btt(t,r,s),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const x=K0(e[f],e[f+1],d);return l[f](x)};return n?d=>u(Pc(e[0],e[a-1],d)):u}function vtt(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=K0(0,t,r);e.push($o(n,1,s))}}function wtt(e){const t=[0];return vtt(t,e.length-1),t}function Ctt(e,t){return e.map(n=>n*t)}function Stt(e,t){return e.map(()=>t||fse).splice(0,e.length-1)}function Dj({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=g8e(r)?r.map(zO):zO(r),a={done:!1,value:t[0]},o=Ctt(n&&n.length===t.length?n:wtt(t),e),l=ytt(o,t,{ease:Array.isArray(s)?s:Stt(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const Ntt=e=>e!==null;function vse(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(Ntt),l=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const Att={decay:PQ,inertia:PQ,tween:Dj,keyframes:Dj,spring:WO};function k8e(e){typeof e.type=="string"&&(e.type=Att[e.type])}let wse=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}};const jtt=e=>e/100;let Cse=class extends wse{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Yd.now()&&this.tick(Yd.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;k8e(t);const{type:n=Dj,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||Dj;c!==Dj&&typeof l[0]!="number"&&(this.mixKeyframes=ux(jtt,j8e(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=yse(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:x,repeatDelay:g,type:v,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-u*(this.playbackSpeed>=0?1:-1),I=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,R=r;if(f){const z=Math.min(this.currentTime,s)/l;let Q=Math.floor(z),ne=z%1;!ne&&z>=1&&(ne=1),ne===1&&Q--,Q=Math.min(Q,f+1),!!(Q%2)&&(x==="reverse"?(ne=1-ne,g&&(ne-=g/l)):x==="mirror"&&(R=o)),P=Pc(0,1,ne)*l}const F=I?{done:!1,value:d[0]}:R.next(P);a&&(F.value=a(F.value));let{done:U}=F;!I&&c!==null&&(U=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return L&&v!==PQ&&(F.value=vse(d,this.options,C,this.speed)),w&&w(F.value),L&&this.finish(),F}then(t,n){return this.finished.then(t,n)}get duration(){return nl(this.calculatedDuration)}get time(){return nl(this.currentTime)}set time(t){var n;t=Hl(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Yd.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=nl(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=ctt,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(s=this.options).onPlay)==null||a.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Yd.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}};function Ett(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Hv=e=>e*180/Math.PI,FQ=e=>{const t=Hv(Math.atan2(e[1],e[0]));return OQ(t)},_tt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:FQ,rotateZ:FQ,skewX:e=>Hv(Math.atan(e[1])),skewY:e=>Hv(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},OQ=e=>(e=e%360,e<0&&(e+=360),e),pfe=FQ,mfe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xfe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ktt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:mfe,scaleY:xfe,scale:e=>(mfe(e)+xfe(e))/2,rotateX:e=>OQ(Hv(Math.atan2(e[6],e[5]))),rotateY:e=>OQ(Hv(Math.atan2(-e[2],e[0]))),rotateZ:pfe,rotate:pfe,skewX:e=>Hv(Math.atan(e[4])),skewY:e=>Hv(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function MQ(e){return e.includes("scale")?1:0}function RQ(e,t){if(!e||e==="none")return MQ(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=ktt,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_tt,s=l}if(!s)return MQ(t);const a=r[t],o=s[1].split(",").map(Itt);return typeof a=="function"?a(o):o[a]}const Ttt=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return RQ(n,t)};function Itt(e){return parseFloat(e.trim())}const cA=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],uA=new Set(cA),gfe=e=>e===lA||e===ii,Ptt=new Set(["x","y","z"]),Ftt=cA.filter(e=>!Ptt.has(e));function Ott(e){const t=[];return Ftt.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zw={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>RQ(t,"x"),y:(e,{transform:t})=>RQ(t,"y")};zw.translateX=zw.x;zw.translateY=zw.y;const Hw=new Set;let LQ=!1,DQ=!1,BQ=!1;function T8e(){if(DQ){const e=Array.from(Hw).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Ott(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))==null||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}DQ=!1,LQ=!1,Hw.forEach(e=>e.complete(BQ)),Hw.clear()}function I8e(){Hw.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(DQ=!0)})}function Mtt(){BQ=!0,I8e(),T8e(),BQ=!1}let Sse=class{constructor(t,n,r,s,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Hw.add(this),LQ||(LQ=!0,Io.read(I8e),Io.resolveKeyframes(T8e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const a=s==null?void 0:s.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&a===void 0&&s.set(t[0])}Ett(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Hw.delete(this)}cancel(){this.state==="scheduled"&&(Hw.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};const Rtt=e=>e.startsWith("--");function Ltt(e,t,n){Rtt(t)?e.style.setProperty(t,n):e.style[t]=n}const Dtt=aA(()=>window.ScrollTimeline!==void 0),Btt={};function $tt(e,t){const n=aA(e);return()=>Btt[t]??n()}const P8e=$tt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),oj=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bfe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:oj([0,.65,.55,1]),circOut:oj([.55,0,1,.45]),backIn:oj([.31,.01,.66,-.59]),backOut:oj([.33,1.53,.69,.99])};function F8e(e,t){if(e)return typeof e=="function"?P8e()?E8e(e,t):"ease-out":hse(e)?oj(e):Array.isArray(e)?e.map(n=>F8e(n,t)||bfe.easeOut):bfe[e]}function Utt(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=F8e(l,s);Array.isArray(f)&&(d.easing=f);const x={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(x.pseudoElement=u),e.animate(d,x)}function O8e(e){return typeof e=="function"&&"applyToOptions"in e}function ztt({type:e,...t}){return O8e(e)&&P8e()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}let Htt=class extends wse{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,jS(typeof t.type!="string");const u=ztt(t);this.animation=Utt(n,r,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=vse(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):Ltt(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return nl(Number(t))}get time(){return nl(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Hl(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Dtt()?(this.animation.timeline=t,al):n(this)}};const M8e={anticipate:lse,backInOut:ose,circInOut:dse};function Vtt(e){return e in M8e}function Wtt(e){typeof e.ease=="string"&&Vtt(e.ease)&&(e.ease=M8e[e.ease])}const yfe=10;let qtt=class extends Htt{constructor(t){Wtt(t),k8e(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Cse({...o,autoplay:!1}),c=Hl(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-yfe).value,l.sample(c).value,yfe),l.stop()}};const vfe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Dy.test(e)||e==="0")&&!e.startsWith("url("));function Gtt(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ktt(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=vfe(s,t),l=vfe(a,t);return!o||!l?!1:Gtt(e)||(n==="spring"||O8e(n))&&r}function $Q(e){e.duration=0,e.type}const Ytt=new Set(["opacity","clipPath","filter","transform"]),Xtt=aA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Qtt(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:a,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Xtt()&&n&&Ytt.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const Ztt=40;let Jtt=class extends wse{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...f}){var v;super(),this.stop=()=>{var w,C;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=Yd.now();const x={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:d,...f},g=(d==null?void 0:d.KeyframeResolver)||Sse;this.keyframeResolver=new g(l,(w,C,N)=>this.onKeyframesResolved(w,C,x,!N),c,u,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Yd.now(),Ktt(t,a,o,l)||((Fc.instantAnimations||!c)&&(d==null||d(vse(t,r,n))),t[0]=t[t.length-1],$Q(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Ztt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!u&&Qtt(x)?new qtt({...x,element:x.motionValue.owner.current}):new Cse(x);g.finished.then(()=>this.notifyFinished()).catch(al),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Mtt()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}};const ent=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function tnt(e){const t=ent.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function R8e(e,t,n=1){const[r,s]=tnt(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return MD(o)?parseFloat(o):o}return mse(s)?R8e(s,t,n+1):s}function Nse(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const L8e=new Set(["width","height","top","left","right","bottom",...cA]),nnt={test:e=>e==="auto",parse:e=>e},D8e=e=>t=>t.test(e),B8e=[lA,ii,M0,Cb,Get,qet,nnt],wfe=e=>B8e.find(D8e(e));function rnt(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||LD(e):!0}const snt=new Set(["brightness","contrast","saturate","opacity"]);function int(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(xse)||[];if(!r)return e;const s=n.replace(r,"");let a=snt.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const ant=/\b([a-z-]*)\(.*?\)/gu,UQ={...Dy,getAnimatableNone:e=>{const t=e.match(ant);return t?t.map(int).join(" "):e}},Cfe={...lA,transform:Math.round},ont={rotate:Cb,rotateX:Cb,rotateY:Cb,rotateZ:Cb,scale:AI,scaleX:AI,scaleY:AI,scaleZ:AI,skew:Cb,skewX:Cb,skewY:Cb,distance:ii,translateX:ii,translateY:ii,translateZ:ii,x:ii,y:ii,z:ii,perspective:ii,transformPerspective:ii,opacity:A9,originX:lfe,originY:lfe,originZ:ii},Ase={borderWidth:ii,borderTopWidth:ii,borderRightWidth:ii,borderBottomWidth:ii,borderLeftWidth:ii,borderRadius:ii,radius:ii,borderTopLeftRadius:ii,borderTopRightRadius:ii,borderBottomRightRadius:ii,borderBottomLeftRadius:ii,width:ii,maxWidth:ii,height:ii,maxHeight:ii,top:ii,right:ii,bottom:ii,left:ii,padding:ii,paddingTop:ii,paddingRight:ii,paddingBottom:ii,paddingLeft:ii,margin:ii,marginTop:ii,marginRight:ii,marginBottom:ii,marginLeft:ii,backgroundPositionX:ii,backgroundPositionY:ii,...ont,zIndex:Cfe,fillOpacity:A9,strokeOpacity:A9,numOctaves:Cfe},lnt={...Ase,color:Ll,backgroundColor:Ll,outlineColor:Ll,fill:Ll,stroke:Ll,borderColor:Ll,borderTopColor:Ll,borderRightColor:Ll,borderBottomColor:Ll,borderLeftColor:Ll,filter:UQ,WebkitFilter:UQ},$8e=e=>lnt[e];function U8e(e,t){let n=$8e(e);return n!==UQ&&(n=Dy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const cnt=new Set(["auto","none","0"]);function unt(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!cnt.has(a)&&j9(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=U8e(n,s)}let dnt=class extends Sse{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),mse(u))){const d=R8e(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!L8e.has(r)||t.length!==2)return;const[s,a]=t,o=wfe(s),l=wfe(a);if(o!==l)if(gfe(o)&&gfe(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else zw[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||rnt(t[s]))&&r.push(s);r.length&&unt(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=zw[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=zw[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}};function fnt(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const z8e=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function hnt(e){return RD(e)&&"offsetHeight"in e}const Sfe=30,pnt=e=>!isNaN(parseFloat(e));let mnt=class{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const s=Yd.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Yd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=pnt(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new oA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Io.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Yd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sfe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Sfe);return DD(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function ES(e,t){return new mnt(e,t)}const{schedule:jse,cancel:d2n}=b8e(queueMicrotask,!1),Op={x:!1,y:!1};function H8e(){return Op.x||Op.y}function xnt(e){return e==="x"||e==="y"?Op[e]?null:(Op[e]=!0,()=>{Op[e]=!1}):Op.x||Op.y?null:(Op.x=Op.y=!0,()=>{Op.x=Op.y=!1})}function V8e(e,t){const n=fnt(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Nfe(e){return!(e.pointerType==="touch"||H8e())}function gnt(e,t,n={}){const[r,s,a]=V8e(e,n),o=l=>{if(!Nfe(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{Nfe(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const W8e=(e,t)=>t?e===t?!0:W8e(e,t.parentElement):!1,Ese=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,bnt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ynt(e){return bnt.has(e.tagName)||e.tabIndex!==-1}const _F=new WeakSet;function Afe(e){return t=>{t.key==="Enter"&&e(t)}}function Ez(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const vnt=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Afe(()=>{if(_F.has(n))return;Ez(n,"down");const s=Afe(()=>{Ez(n,"up")}),a=()=>Ez(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function jfe(e){return Ese(e)&&!H8e()}function wnt(e,t,n={}){const[r,s,a]=V8e(e,n),o=l=>{const c=l.currentTarget;if(!jfe(l))return;_F.add(c);const u=t(c,l),d=(g,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",x),_F.has(c)&&_F.delete(c),jfe(g)&&typeof u=="function"&&u(g,{success:v})},f=g=>{d(g,c===window||c===document||n.useGlobalTarget||W8e(c,g.target))},x=g=>{d(g,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",x,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),hnt(l)&&(l.addEventListener("focus",u=>vnt(u,s)),!ynt(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function q8e(e){return RD(e)&&"ownerSVGElement"in e}function Cnt(e){return q8e(e)&&e.tagName==="svg"}const Iu=e=>!!(e&&e.getVelocity),Snt=[...B8e,Ll,Dy],Nnt=e=>Snt.find(D8e(e)),G8e=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Ant(e=!0){const t=m.useContext(ise);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=m.useId();m.useEffect(()=>{if(e)return s(a)},[e]);const o=m.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const K8e=m.createContext({strict:!1}),Efe={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},_S={};for(const e in Efe)_S[e]={isEnabled:t=>Efe[e].some(n=>!!t[n])};function jnt(e){for(const t in e)_S[t]={..._S[t],...e[t]}}const Ent=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function qO(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ent.has(e)}let Y8e=e=>!qO(e);function _nt(e){typeof e=="function"&&(Y8e=t=>t.startsWith("on")?!qO(t):e(t))}try{_nt(require("@emotion/is-prop-valid").default)}catch{}function knt(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Y8e(s)||n===!0&&qO(s)||!t&&!qO(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const BD=m.createContext({});function $D(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function E9(e){return typeof e=="string"||Array.isArray(e)}const _se=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kse=["initial",..._se];function UD(e){return $D(e.animate)||kse.some(t=>E9(e[t]))}function X8e(e){return!!(UD(e)||e.variants)}function Tnt(e,t){if(UD(e)){const{initial:n,animate:r}=e;return{initial:n===!1||E9(n)?n:void 0,animate:E9(r)?r:void 0}}return e.inherit!==!1?t:{}}function Int(e){const{initial:t,animate:n}=Tnt(e,m.useContext(BD));return m.useMemo(()=>({initial:t,animate:n}),[_fe(t),_fe(n)])}function _fe(e){return Array.isArray(e)?e.join(" "):e}const _9={};function Pnt(e){for(const t in e)_9[t]=e[t],pse(t)&&(_9[t].isCSSVariable=!0)}function Q8e(e,{layout:t,layoutId:n}){return uA.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!_9[e]||e==="opacity")}const Fnt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ont=cA.length;function Mnt(e,t,n){let r="",s=!0;for(let a=0;a<Ont;a++){const o=cA[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=z8e(l,Ase[o]);if(!c){s=!1;const d=Fnt[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Tse(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(uA.has(c)){o=!0;continue}else if(pse(c)){s[c]=u;continue}else{const d=z8e(u,Ase[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=Mnt(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}const Ise=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Z8e(e,t,n){for(const r in t)!Iu(t[r])&&!Q8e(r,n)&&(e[r]=t[r])}function Rnt({transformTemplate:e},t){return m.useMemo(()=>{const n=Ise();return Tse(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Lnt(e,t){const n=e.style||{},r={};return Z8e(r,n,e),Object.assign(r,Rnt(e,t)),r}function Dnt(e,t){const n={},r=Lnt(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Bnt={offset:"stroke-dashoffset",array:"stroke-dasharray"},$nt={offset:"strokeDashoffset",array:"strokeDasharray"};function Unt(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?Bnt:$nt;e[a.offset]=ii.transform(-r);const o=ii.transform(t),l=ii.transform(n);e[a.array]=`${o} ${l}`}function J8e(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(Tse(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:x}=e;f.transform&&(x.transform=f.transform,delete f.transform),(x.transform||f.transformOrigin)&&(x.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),x.transform&&(x.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&Unt(f,s,a,o,!1)}const e7e=()=>({...Ise(),attrs:{}}),t7e=e=>typeof e=="string"&&e.toLowerCase()==="svg";function znt(e,t,n,r){const s=m.useMemo(()=>{const a=e7e();return J8e(a,t,t7e(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Z8e(a,e.style,e),s.style={...a,...s.style}}return s}const Hnt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Pse(e){return typeof e!="string"||e.includes("-")?!1:!!(Hnt.indexOf(e)>-1||/[A-Z]/u.test(e))}function Vnt(e,t,n,{latestValues:r},s,a=!1){const l=(Pse(e)?znt:Dnt)(t,r,s,e),c=knt(t,typeof e=="string",a),u=e!==m.Fragment?{...c,...l,ref:n}:{},{children:d}=t,f=m.useMemo(()=>Iu(d)?d.get():d,[d]);return m.createElement(e,{...u,children:f})}function kfe(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Fse(e,t,n,r){if(typeof t=="function"){const[s,a]=kfe(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=kfe(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function kF(e){return Iu(e)?e.get():e}function Wnt({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:qnt(n,r,s,e),renderState:t()}}function qnt(e,t,n,r){const s={},a=r(e,{});for(const x in a)s[x]=kF(a[x]);let{initial:o,animate:l}=e;const c=UD(e),u=X8e(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!$D(f)){const x=Array.isArray(f)?f:[f];for(let g=0;g<x.length;g++){const v=Fse(e,x[g]);if(v){const{transitionEnd:w,transition:C,...N}=v;for(const I in N){let P=N[I];if(Array.isArray(P)){const R=d?P.length-1:0;P=P[R]}P!==null&&(s[I]=P)}for(const I in w)s[I]=w[I]}}}return s}const n7e=e=>(t,n)=>{const r=m.useContext(BD),s=m.useContext(ise),a=()=>Wnt(e,t,r,s);return n?a():_et(a)};function Ose(e,t,n){var a;const{style:r}=e,s={};for(const o in r)(Iu(r[o])||t.style&&Iu(t.style[o])||Q8e(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}const Gnt=n7e({scrapeMotionValuesFromProps:Ose,createRenderState:Ise});function r7e(e,t,n){const r=Ose(e,t,n);for(const s in e)if(Iu(e[s])||Iu(t[s])){const a=cA.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}const Knt=n7e({scrapeMotionValuesFromProps:r7e,createRenderState:e7e}),Ynt=Symbol.for("motionComponentSymbol");function _C(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xnt(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):_C(n)&&(n.current=r))},[t])}const Mse=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qnt="framerAppearId",s7e="data-"+Mse(Qnt),i7e=m.createContext({});function Znt(e,t,n,r,s){var w,C;const{visualElement:a}=m.useContext(BD),o=m.useContext(K8e),l=m.useContext(ise),c=m.useContext(G8e).reducedMotion,u=m.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=m.useContext(i7e);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Jnt(u.current,n,s,f);const x=m.useRef(!1);m.useInsertionEffect(()=>{d&&x.current&&d.update(n,l)});const g=n[s7e],v=m.useRef(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return ket(()=>{d&&(x.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),v.current&&d.animationState&&d.animationState.animateChanges())}),m.useEffect(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var N;(N=window.MotionHandoffMarkAsComplete)==null||N.call(window,g)}),v.current=!1),d.enteringChildren=void 0)}),d}function Jnt(e,t,n,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:a7e(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&_C(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function a7e(e){if(e)return e.options.allowProjection!==!1?e.projection:a7e(e.parent)}function _z(e,{forwardMotionProps:t=!1}={},n,r){n&&jnt(n);const s=Pse(e)?Knt:Gnt;function a(l,c){let u;const d={...m.useContext(G8e),...l,layoutId:ert(l)},{isStatic:f}=d,x=Int(l),g=s(l,f);if(!f&&sse){trt();const v=nrt(d);u=v.MeasureLayout,x.visualElement=Znt(e,g,d,r,v.ProjectionNode)}return i.jsxs(BD.Provider,{value:x,children:[u&&x.visualElement?i.jsx(u,{visualElement:x.visualElement,...d}):null,Vnt(e,l,Xnt(g,x.visualElement,c),g,f,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=m.forwardRef(a);return o[Ynt]=e,o}function ert({layoutId:e}){const t=m.useContext(f8e).id;return t&&e!==void 0?t+"-"+e:e}function trt(e,t){m.useContext(K8e).strict}function nrt(e){const{drag:t,layout:n}=_S;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function rrt(e,t){if(typeof Proxy>"u")return _z;const n=new Map,r=(a,o)=>_z(a,o,e,t),s=(a,o)=>r(a,o);return new Proxy(s,{get:(a,o)=>o==="create"?r:(n.has(o)||n.set(o,_z(o,void 0,e,t)),n.get(o))})}function o7e({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function srt({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function irt(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function kz(e){return e===void 0||e===1}function zQ({scale:e,scaleX:t,scaleY:n}){return!kz(e)||!kz(t)||!kz(n)}function wv(e){return zQ(e)||l7e(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function l7e(e){return Tfe(e.x)||Tfe(e.y)}function Tfe(e){return e&&e!=="0%"}function GO(e,t,n){const r=e-n,s=t*r;return n+s}function Ife(e,t,n,r,s){return s!==void 0&&(e=GO(e,s,r)),GO(e,n,r)+t}function HQ(e,t=0,n=1,r,s){e.min=Ife(e.min,t,n,r,s),e.max=Ife(e.max,t,n,r,s)}function c7e(e,{x:t,y:n}){HQ(e.x,t.translate,t.scale,t.originPoint),HQ(e.y,n.translate,n.scale,n.originPoint)}const Pfe=.999999999999,Ffe=1.0000000000001;function art(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,o;for(let l=0;l<s;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&TC(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,c7e(e,o)),r&&wv(a.latestValues)&&TC(e,a.latestValues))}t.x<Ffe&&t.x>Pfe&&(t.x=1),t.y<Ffe&&t.y>Pfe&&(t.y=1)}function kC(e,t){e.min=e.min+t,e.max=e.max+t}function Ofe(e,t,n,r,s=.5){const a=$o(e.min,e.max,s);HQ(e,t,n,a,r)}function TC(e,t){Ofe(e.x,t.x,t.scaleX,t.scale,t.originX),Ofe(e.y,t.y,t.scaleY,t.scale,t.originY)}function u7e(e,t){return o7e(irt(e.getBoundingClientRect(),t))}function ort(e,t,n){const r=u7e(e,n),{scroll:s}=t;return s&&(kC(r.x,s.offset.x),kC(r.y,s.offset.y)),r}const Mfe=()=>({translate:0,scale:1,origin:0,originPoint:0}),IC=()=>({x:Mfe(),y:Mfe()}),Rfe=()=>({min:0,max:0}),pl=()=>({x:Rfe(),y:Rfe()}),VQ={current:null},d7e={current:!1};function lrt(){if(d7e.current=!0,!!sse)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>VQ.current=e.matches;e.addEventListener("change",t),t()}else VQ.current=!1}const crt=new WeakMap;function urt(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Iu(s))e.addValue(r,s);else if(Iu(a))e.addValue(r,ES(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,ES(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Lfe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let drt=class{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Sse,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=Yd.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,Io.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=UD(n),this.isVariantNode=X8e(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const x in f){const g=f[x];c[x]!==void 0&&Iu(g)&&g.set(c[x])}}mount(t){var n;this.current=t,crt.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),d7e.current||lrt(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:VQ.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Ly(this.notifyUpdate),Ly(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=uA.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Io.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in _S){const n=_S[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pl()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Lfe.length;r++){const s=Lfe[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=urt(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ES(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(MD(r)||LD(r))?r=parseFloat(r):!Nnt(r)&&Dy.test(n)&&(r=U8e(t,n)),this.setBaseTarget(t,Iu(r)?r.get():r)),Iu(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Fse(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Iu(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new oA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){jse.render(this.render)}},f7e=class extends drt{constructor(){super(...arguments),this.KeyframeResolver=dnt}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Iu(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}};function h7e(e,{style:t,vars:n},r,s){const a=e.style;let o;for(o in t)a[o]=t[o];s==null||s.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function frt(e){return window.getComputedStyle(e)}let hrt=class extends f7e{constructor(){super(...arguments),this.type="html",this.renderInstance=h7e}readValueFromInstance(t,n){var r;if(uA.has(n))return(r=this.projection)!=null&&r.isProjecting?MQ(n):Ttt(t,n);{const s=frt(t),a=(pse(n)?s.getPropertyValue(n):s[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return u7e(t,n)}build(t,n,r){Tse(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ose(t,n,r)}};const p7e=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function prt(e,t,n,r){h7e(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(p7e.has(s)?s:Mse(s),t.attrs[s])}let mrt=class extends f7e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=pl}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(uA.has(n)){const r=$8e(n);return r&&r.default||0}return n=p7e.has(n)?n:Mse(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return r7e(t,n,r)}build(t,n,r){J8e(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){prt(t,n,r,s)}mount(t){this.isSVGTag=t7e(t.tagName),super.mount(t)}};const xrt=(e,t)=>Pse(e)?new mrt(t):new hrt(t,{allowProjection:e!==m.Fragment});function YC(e,t,n){const r=e.getProps();return Fse(r,t,n!==void 0?n:r.custom,e)}const WQ=e=>Array.isArray(e);function grt(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ES(n))}function brt(e){return WQ(e)?e[e.length-1]||0:e}function yrt(e,t){const n=YC(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=brt(a[o]);grt(e,o,l)}}function vrt(e){return!!(Iu(e)&&e.add)}function qQ(e,t){const n=e.getValue("willChange");if(vrt(n))return n.add(t);if(!n&&Fc.WillChange){const r=new Fc.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function m7e(e){return e.props[s7e]}const wrt=e=>e!==null;function Crt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(wrt),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[a]}const Srt={type:"spring",stiffness:500,damping:25,restSpeed:10},Nrt=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Art={type:"keyframes",duration:.8},jrt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ert=(e,{keyframes:t})=>t.length>2?Art:uA.has(e)?e.startsWith("scale")?Nrt(t[1]):Srt:jrt;function _rt({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Rse=(e,t,n,r={},s,a)=>o=>{const l=Nse(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Hl(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:x=>{t.set(x),l.onUpdate&&l.onUpdate(x)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};_rt(l)||Object.assign(d,Ert(e,d)),d.duration&&(d.duration=Hl(d.duration)),d.repeatDelay&&(d.repeatDelay=Hl(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&($Q(d),d.delay===0&&(f=!0)),(Fc.instantAnimations||Fc.skipAnimations)&&(f=!0,$Q(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!a&&t.get()!==void 0){const x=Crt(d.keyframes,l);if(x!==void 0){Io.update(()=>{d.onUpdate(x),d.onComplete()});return}}return l.isSync?new Cse(d):new Jtt(d)};function krt({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function x7e(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),x=l[d];if(x===void 0||u&&krt(u,d))continue;const g={delay:n,...Nse(a||{},d)},v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(x)&&x===v&&!g.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const N=m7e(e);if(N){const I=window.MotionHandoffAnimation(N,d,Io);I!==null&&(g.startTime=I,w=!0)}}qQ(e,d),f.start(Rse(d,f,x,e.shouldReduceMotion&&L8e.has(d)?{type:!1}:g,e,w));const C=f.animation;C&&c.push(C)}return o&&Promise.all(c).then(()=>{Io.update(()=>{o&&yrt(e,o)})}),c}function g7e(e,t,n,r=0,s=1){const a=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(a,o):s===1?a*r:l-a*r}function GQ(e,t,n={}){var c;const r=YC(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(x7e(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:x}=s;return Trt(e,t,u,d,f,x,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function Trt(e,t,n=0,r=0,s=0,a=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(GQ(c,t,{...o,delay:n+(typeof r=="function"?0:r)+g7e(e.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function Irt(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>GQ(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=GQ(e,t,n);else{const s=typeof t=="function"?YC(e,t,n.custom):t;r=Promise.all(x7e(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function b7e(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Prt=kse.length;function y7e(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?y7e(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Prt;n++){const r=kse[n],s=e.props[r];(E9(s)||s===!1)&&(t[r]=s)}return t}const Frt=[..._se].reverse(),Ort=_se.length;function Mrt(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Irt(e,n,r)))}function Rrt(e){let t=Mrt(e),n=Dfe(),r=!0;const s=c=>(u,d)=>{var x;const f=YC(e,d,c==="exit"?(x=e.presenceContext)==null?void 0:x.custom:void 0);if(f){const{transition:g,transitionEnd:v,...w}=f;u={...u,...w,...v}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=y7e(e.parent)||{},f=[],x=new Set;let g={},v=1/0;for(let C=0;C<Ort;C++){const N=Frt[C],I=n[N],P=u[N]!==void 0?u[N]:d[N],R=E9(P),F=N===c?I.isActive:null;F===!1&&(v=C);let U=P===d[N]&&P!==u[N]&&R;if(U&&r&&e.manuallyAnimateOnMount&&(U=!1),I.protectedKeys={...g},!I.isActive&&F===null||!P&&!I.prevProp||$D(P)||typeof P=="boolean")continue;const L=Lrt(I.prevProp,P);let z=L||N===c&&I.isActive&&!U&&R||C>v&&R,Q=!1;const ne=Array.isArray(P)?P:[P];let J=ne.reduce(s(N),{});F===!1&&(J={});const{prevResolvedValues:X={}}=I,re={...X,...J},pe=oe=>{z=!0,x.has(oe)&&(Q=!0,x.delete(oe)),I.needsAnimating[oe]=!0;const G=e.getValue(oe);G&&(G.liveStyle=!1)};for(const oe in re){const G=J[oe],V=X[oe];if(g.hasOwnProperty(oe))continue;let te=!1;WQ(G)&&WQ(V)?te=!b7e(G,V):te=G!==V,te?G!=null?pe(oe):x.add(oe):G!==void 0&&x.has(oe)?pe(oe):I.protectedKeys[oe]=!0}I.prevProp=P,I.prevResolvedValues=J,I.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(z=!1);const Y=U&&L;z&&(!Y||Q)&&f.push(...ne.map(oe=>{const G={type:N};if(typeof oe=="string"&&r&&!Y&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,te=YC(V,oe);if(V.enteringChildren&&te){const{delayChildren:ae}=te.transition||{};G.delay=g7e(V.enteringChildren,e,ae)}}return{animation:oe,options:G}}))}if(x.size){const C={};if(typeof u.initial!="boolean"){const N=YC(e,Array.isArray(u.initial)?u.initial[0]:u.initial);N&&N.transition&&(C.transition=N.transition)}x.forEach(N=>{const I=e.getBaseTarget(N),P=e.getValue(N);P&&(P.liveStyle=!0),C[N]=I??null}),f.push({animation:C})}let w=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(x=>{var g;return(g=x.animationState)==null?void 0:g.setActive(c,u)}),n[c].isActive=u;const d=o(c);for(const x in n)n[x].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Dfe(),r=!0}}}function Lrt(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!b7e(t,e):!1}function iv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dfe(){return{animate:iv(!0),whileInView:iv(),whileHover:iv(),whileTap:iv(),whileDrag:iv(),whileFocus:iv(),exit:iv()}}let r2=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},Drt=class extends r2{constructor(t){super(t),t.animationState||(t.animationState=Rrt(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$D(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}},Brt=0,$rt=class extends r2{constructor(){super(...arguments),this.id=Brt++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}};const Urt={animation:{Feature:Drt},exit:{Feature:$rt}};function k9(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ck(e){return{point:{x:e.pageX,y:e.pageY}}}const zrt=e=>t=>Ese(t)&&e(t,Ck(t));function Bj(e,t,n,r){return k9(e,t,zrt(n),r)}const v7e=1e-4,Hrt=1-v7e,Vrt=1+v7e,w7e=.01,Wrt=0-w7e,qrt=0+w7e;function sd(e){return e.max-e.min}function Grt(e,t,n){return Math.abs(e-t)<=n}function Bfe(e,t,n,r=.5){e.origin=r,e.originPoint=$o(t.min,t.max,e.origin),e.scale=sd(n)/sd(t),e.translate=$o(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Hrt&&e.scale<=Vrt||isNaN(e.scale))&&(e.scale=1),(e.translate>=Wrt&&e.translate<=qrt||isNaN(e.translate))&&(e.translate=0)}function $j(e,t,n,r){Bfe(e.x,t.x,n.x,r?r.originX:void 0),Bfe(e.y,t.y,n.y,r?r.originY:void 0)}function $fe(e,t,n){e.min=n.min+t.min,e.max=e.min+sd(t)}function Krt(e,t,n){$fe(e.x,t.x,n.x),$fe(e.y,t.y,n.y)}function Ufe(e,t,n){e.min=t.min-n.min,e.max=e.min+sd(t)}function Uj(e,t,n){Ufe(e.x,t.x,n.x),Ufe(e.y,t.y,n.y)}function kh(e){return[e("x"),e("y")]}const C7e=({current:e})=>e?e.ownerDocument.defaultView:null,zfe=(e,t)=>Math.abs(e-t);function Yrt(e,t){const n=zfe(e.x,t.x),r=zfe(e.y,t.y);return Math.sqrt(n**2+r**2)}let S7e=class{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Iz(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=Yrt(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!v)return;const{point:w}=x,{timestamp:C}=Gc;this.history.push({...w,timestamp:C});const{onStart:N,onMove:I}=this.handlers;g||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),I&&I(this.lastMoveEvent,x)},this.handlePointerMove=(x,g)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=Tz(g,this.transformPagePoint),Io.update(this.updatePoint,!0)},this.handlePointerUp=(x,g)=>{this.end();const{onEnd:v,onSessionEnd:w,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=Iz(x.type==="pointercancel"?this.lastMoveEventInfo:Tz(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(x,N),w&&w(x,N)},!Ese(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Ck(t),c=Tz(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Gc;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,Iz(c,this.history)),this.removeListeners=ux(Bj(this.contextWindow,"pointermove",this.handlePointerMove),Bj(this.contextWindow,"pointerup",this.handlePointerUp),Bj(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ly(this.updatePoint)}};function Tz(e,t){return t?{point:t(e.point)}:e}function Hfe(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Iz({point:e},t){return{point:e,delta:Hfe(e,N7e(t)),offset:Hfe(e,Xrt(t)),velocity:Qrt(t,.1)}}function Xrt(e){return e[0]}function N7e(e){return e[e.length-1]}function Qrt(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=N7e(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Hl(t)));)n--;if(!r)return{x:0,y:0};const a=nl(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Zrt(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?$o(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?$o(n,e,r.max):Math.min(e,n)),e}function Vfe(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Jrt(e,{top:t,left:n,bottom:r,right:s}){return{x:Vfe(e.x,n,s),y:Vfe(e.y,t,r)}}function Wfe(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function est(e,t){return{x:Wfe(e.x,t.x),y:Wfe(e.y,t.y)}}function tst(e,t){let n=.5;const r=sd(e),s=sd(t);return s>r?n=K0(t.min,t.max-r,e.min):r>s&&(n=K0(e.min,e.max-s,t.min)),Pc(0,1,n)}function nst(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const KQ=.35;function rst(e=KQ){return e===!1?e=0:e===!0&&(e=KQ),{x:qfe(e,"left","right"),y:qfe(e,"top","bottom")}}function qfe(e,t,n){return{min:Gfe(e,t),max:Gfe(e,n)}}function Gfe(e,t){return typeof e=="number"?e:e[t]||0}const sst=new WeakMap;let ist=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=pl(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=f=>{const{dragSnapToOrigin:x}=this.getProps();x?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ck(f).point)},o=(f,x)=>{const{drag:g,dragPropagation:v,onDragStart:w}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=xnt(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),kh(N=>{let I=this.getAxisMotionValue(N).get()||0;if(M0.test(I)){const{projection:P}=this.visualElement;if(P&&P.layout){const R=P.layout.layoutBox[N];R&&(I=sd(R)*(parseFloat(I)/100))}}this.originPoint[N]=I}),w&&Io.postRender(()=>w(f,x)),qQ(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},l=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x;const{dragPropagation:g,dragDirectionLock:v,onDirectionLock:w,onDrag:C}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:N}=x;if(v&&this.currentDirection===null){this.currentDirection=ast(N),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",x.point,N),this.updateAxis("y",x.point,N),this.visualElement.render(),C&&C(f,x)},c=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x,this.stop(f,x),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>kh(f=>{var x;return this.getAnimationState(f)==="paused"&&((x=this.getAxisMotionValue(f).animation)==null?void 0:x.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new S7e(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:C7e(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Io.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!jI(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Zrt(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;t&&_C(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Jrt(r.layoutBox,t):this.constraints=!1,this.elastic=rst(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&kh(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=nst(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!_C(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=ort(r,s.root,this.visualElement.getTransformPagePoint());let o=est(s.layout.layoutBox,a);if(n){const l=n(srt(o));this.hasMutatedConstraints=!!l,l&&(o=o7e(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=kh(d=>{if(!jI(d,n,this.currentDirection))return;let f=c[d]||{};o&&(f={min:0,max:0});const x=s?200:1e6,g=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:x,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return qQ(this.visualElement,t),r.start(Rse(t,r,0,n,this.visualElement,!1))}stopAnimation(){kh(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){kh(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){kh(n=>{const{drag:r}=this.getProps();if(!jI(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];a.set(t[n]-$o(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!_C(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};kh(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=tst({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),kh(o=>{if(!jI(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set($o(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;sst.set(this.visualElement,this);const t=this.visualElement.current,n=Bj(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();_C(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Io.read(r);const o=k9(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(kh(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=KQ,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}};function jI(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ast(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}let ost=class extends r2{constructor(t){super(t),this.removeGroupControls=al,this.removeListeners=al,this.controls=new ist(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||al}unmount(){this.removeGroupControls(),this.removeListeners()}};const Kfe=e=>(t,n)=>{e&&Io.postRender(()=>e(t,n))};let lst=class extends r2{constructor(){super(...arguments),this.removePointerDownListener=al}onPointerDown(t){this.session=new S7e(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:C7e(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Kfe(t),onStart:Kfe(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&Io.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=Bj(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};const TF={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Yfe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const d7={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ii.test(e))e=parseFloat(e);else return e;const n=Yfe(e,t.target.x),r=Yfe(e,t.target.y);return`${n}% ${r}%`}},cst={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Dy.parse(e);if(s.length>5)return r;const a=Dy.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=$o(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}};let Pz=!1,ust=class extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;Pnt(dst),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),Pz&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),TF.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,Pz=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Io.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),jse.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Pz=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}};function A7e(e){const[t,n]=Ant(),r=m.useContext(f8e);return i.jsx(ust,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(i7e),isPresent:t,safeToRemove:n})}const dst={borderRadius:{...d7,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:d7,borderTopRightRadius:d7,borderBottomLeftRadius:d7,borderBottomRightRadius:d7,boxShadow:cst};function fst(e,t,n){const r=Iu(e)?e:ES(e);return r.start(Rse("",r,t,n)),r.animation}const hst=(e,t)=>e.depth-t.depth;let pst=class{constructor(){this.children=[],this.isDirty=!1}add(t){bk(this.children,t),this.isDirty=!0}remove(t){yk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hst),this.isDirty=!1,this.children.forEach(t)}};function mst(e,t){const n=Yd.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(Ly(r),e(a-t))};return Io.setup(r,!0),()=>Ly(r)}const j7e=["TopLeft","TopRight","BottomLeft","BottomRight"],xst=j7e.length,Xfe=e=>typeof e=="string"?parseFloat(e):e,Qfe=e=>typeof e=="number"||ii.test(e);function gst(e,t,n,r,s,a){s?(e.opacity=$o(0,n.opacity??1,bst(r)),e.opacityExit=$o(t.opacity??1,0,yst(r))):a&&(e.opacity=$o(t.opacity??1,n.opacity??1,r));for(let o=0;o<xst;o++){const l=`border${j7e[o]}Radius`;let c=Zfe(t,l),u=Zfe(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Qfe(c)===Qfe(u)?(e[l]=Math.max($o(Xfe(c),Xfe(u),r),0),(M0.test(u)||M0.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=$o(t.rotate||0,n.rotate||0,r))}function Zfe(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const bst=E7e(0,.5,use),yst=E7e(.5,.95,al);function E7e(e,t,n){return r=>r<e?0:r>t?1:n(K0(e,t,r))}function Jfe(e,t){e.min=t.min,e.max=t.max}function ph(e,t){Jfe(e.x,t.x),Jfe(e.y,t.y)}function ehe(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function the(e,t,n,r,s){return e-=t,e=GO(e,1/n,r),s!==void 0&&(e=GO(e,1/s,r)),e}function vst(e,t=0,n=1,r=.5,s,a=e,o=e){if(M0.test(t)&&(t=parseFloat(t),t=$o(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=$o(a.min,a.max,r);e===a&&(l-=t),e.min=the(e.min,t,n,l,s),e.max=the(e.max,t,n,l,s)}function nhe(e,t,[n,r,s],a,o){vst(e,t[n],t[r],t[s],t.scale,a,o)}const wst=["x","scaleX","originX"],Cst=["y","scaleY","originY"];function rhe(e,t,n,r){nhe(e.x,t,wst,n?n.x:void 0,r?r.x:void 0),nhe(e.y,t,Cst,n?n.y:void 0,r?r.y:void 0)}function she(e){return e.translate===0&&e.scale===1}function _7e(e){return she(e.x)&&she(e.y)}function ihe(e,t){return e.min===t.min&&e.max===t.max}function Sst(e,t){return ihe(e.x,t.x)&&ihe(e.y,t.y)}function ahe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function k7e(e,t){return ahe(e.x,t.x)&&ahe(e.y,t.y)}function ohe(e){return sd(e.x)/sd(e.y)}function lhe(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}let Nst=class{constructor(){this.members=[]}add(t){bk(this.members,t),t.scheduleRender()}remove(t){if(yk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function Ast(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:x,skewX:g,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),x&&(r+=`rotateY(${x}deg) `),g&&(r+=`skewX(${g}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Fz=["","X","Y","Z"],jst=1e3;let Est=0;function Oz(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function T7e(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=m7e(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Io,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&T7e(r)}function I7e({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=Est++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Tst),this.nodes.forEach(Ost),this.nodes.forEach(Mst),this.nodes.forEach(Ist)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new pst)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new oA),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=q8e(o)&&!Cnt(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,f=0;const x=()=>this.root.updateBlockedByResize=!1;Io.read(()=>{f=window.innerWidth}),e(o,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=mst(x,250),TF.hasAnimatedSinceResize&&(TF.hasAnimatedSinceResize=!1,this.nodes.forEach(dhe)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:x,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||$st,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=u.getProps(),N=!this.targetLayout||!k7e(this.targetLayout,g),I=!f&&x;if(this.options.layoutRoot||this.resumeFrom||I||f&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...Nse(v,"layout"),onPlay:w,onComplete:C};(u.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(d,I)}else f||dhe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ly(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Rst),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&T7e(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(che);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(uhe);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Fst),this.nodes.forEach(_st),this.nodes.forEach(kst)):this.nodes.forEach(uhe),this.clearAllSnapshots();const l=Yd.now();Gc.delta=Pc(0,1e3/60,l-Gc.timestamp),Gc.timestamp=l,Gc.isProcessing=!0,Sz.update.process(Gc),Sz.preRender.process(Gc),Sz.render.process(Gc),Gc.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,jse.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Pst),this.sharedNodes.forEach(Lst)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Io.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Io.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!sd(this.snapshot.measuredBox.x)&&!sd(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=pl(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!_7e(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||wv(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),Ust(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return pl();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(zst))){const{scroll:d}=this.root;d&&(kC(l.x,d.offset.x),kC(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=pl();if(ph(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:x}=d;d!==this.root&&f&&x.layoutScroll&&(f.wasRoot&&ph(l,o),kC(l.x,f.offset.x),kC(l.y,f.offset.y))}return l}applyTransform(o,l=!1){const c=pl();ph(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&TC(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),wv(d.latestValues)&&TC(c,d.latestValues)}return wv(this.latestValues)&&TC(c,this.latestValues),c}removeTransform(o){const l=pl();ph(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!wv(u.latestValues))continue;zQ(u.latestValues)&&u.updateSnapshot();const d=pl(),f=u.measurePageBox();ph(d,f),rhe(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return wv(this.latestValues)&&rhe(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Gc.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var x;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Gc.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=pl(),this.relativeTargetOrigin=pl(),Uj(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),ph(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=pl(),this.targetWithTransforms=pl()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Krt(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ph(this.target,this.layout.layoutBox),c7e(this.target,this.targetDelta)):ph(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=pl(),this.relativeTargetOrigin=pl(),Uj(this.relativeTargetOrigin,this.target,g.target),ph(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||zQ(this.parent.latestValues)||l7e(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var v;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Gc.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;ph(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,x=this.treeScale.y;art(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=pl());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ehe(this.prevProjectionDelta.x,this.projectionDelta.x),ehe(this.prevProjectionDelta.y,this.projectionDelta.y)),$j(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==x||!lhe(this.projectionDelta.x,this.prevProjectionDelta.x)||!lhe(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=IC(),this.projectionDelta=IC(),this.projectionDeltaWithTransform=IC()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=IC();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const x=pl(),g=c?c.source:void 0,v=this.layout?this.layout.source:void 0,w=g!==v,C=this.getStack(),N=!C||C.members.length<=1,I=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(Bst));this.animationProgress=0;let P;this.mixTargetDelta=R=>{const F=R/1e3;fhe(f.x,o.x,F),fhe(f.y,o.y,F),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Uj(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Dst(this.relativeTarget,this.relativeTargetOrigin,x,F),P&&Sst(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=pl()),ph(P,this.relativeTarget)),w&&(this.animationValues=d,gst(d,u,this.latestValues,F,I,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Ly(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Io.update(()=>{TF.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ES(0)),this.currentAnimation=fst(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(jst),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&P7e(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||pl();const f=sd(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const x=sd(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+x}ph(l,c),TC(l,d),$j(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Nst),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Oz("z",o,u,this.animationValues);for(let d=0;d<Fz.length;d++)Oz(`rotate${Fz[d]}`,o,u,this.animationValues),Oz(`skew${Fz[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=kF(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=kF(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!wv(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Ast(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),o.transform=f;const{x,y:g}=this.projectionDelta;o.transformOrigin=`${x.origin*100}% ${g.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in _9){if(d[v]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=_9[v],I=f==="none"?d[v]:w(d[v],u);if(C){const P=C.length;for(let R=0;R<P;R++)o[C[R]]=I}else N?this.options.visualElement.renderState.vars[v]=I:o[v]=I}this.options.layoutId&&(o.pointerEvents=u===this?kF(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(che),this.root.sharedNodes.clear()}}}function _st(e){e.updateLayout()}function kst(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?kh(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=sd(x);x.min=r[f].min,x.max=x.min+g}):P7e(a,t.layoutBox,r)&&kh(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=sd(r[f]);x.max=x.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const l=IC();$j(l,r,t.layoutBox);const c=IC();o?$j(c,e.applyTransform(s,!0),t.measuredBox):$j(c,r,t.layoutBox);const u=!_7e(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:x,layout:g}=f;if(x&&g){const v=pl();Uj(v,t.layoutBox,x.layoutBox);const w=pl();Uj(w,r,g.layoutBox),k7e(v,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Tst(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ist(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Pst(e){e.clearSnapshot()}function che(e){e.clearMeasurements()}function uhe(e){e.isLayoutDirty=!1}function Fst(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function dhe(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ost(e){e.resolveTargetDelta()}function Mst(e){e.calcProjection()}function Rst(e){e.resetSkewAndRotation()}function Lst(e){e.removeLeadSnapshot()}function fhe(e,t,n){e.translate=$o(t.translate,0,n),e.scale=$o(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function hhe(e,t,n,r){e.min=$o(t.min,n.min,r),e.max=$o(t.max,n.max,r)}function Dst(e,t,n,r){hhe(e.x,t.x,n.x,r),hhe(e.y,t.y,n.y,r)}function Bst(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $st={duration:.45,ease:[.4,0,.1,1]},phe=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),mhe=phe("applewebkit/")&&!phe("chrome/")?Math.round:al;function xhe(e){e.min=mhe(e.min),e.max=mhe(e.max)}function Ust(e){xhe(e.x),xhe(e.y)}function P7e(e,t,n){return e==="position"||e==="preserve-aspect"&&!Grt(ohe(t),ohe(n),.2)}function zst(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Hst=I7e({attachResizeListener:(e,t)=>k9(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Mz={current:void 0},F7e=I7e({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Mz.current){const e=new Hst({});e.mount(window),e.setOptions({layoutScroll:!0}),Mz.current=e}return Mz.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Vst={pan:{Feature:lst},drag:{Feature:ost,ProjectionNode:F7e,MeasureLayout:A7e}};function ghe(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&Io.postRender(()=>a(t,Ck(t)))}let Wst=class extends r2{mount(){const{current:t}=this.node;t&&(this.unmount=gnt(t,(n,r)=>(ghe(this.node,r,"Start"),s=>ghe(this.node,s,"End"))))}unmount(){}},qst=class extends r2{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ux(k9(this.node.current,"focus",()=>this.onFocus()),k9(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function bhe(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&Io.postRender(()=>a(t,Ck(t)))}let Gst=class extends r2{mount(){const{current:t}=this.node;t&&(this.unmount=wnt(t,(n,r)=>(bhe(this.node,r,"Start"),(s,{success:a})=>bhe(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const YQ=new WeakMap,Rz=new WeakMap,Kst=e=>{const t=YQ.get(e.target);t&&t(e)},Yst=e=>{e.forEach(Kst)};function Xst({root:e,...t}){const n=e||document;Rz.has(n)||Rz.set(n,{});const r=Rz.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Yst,{root:e,...t})),r[s]}function Qst(e,t,n){const r=Xst(t);return YQ.set(e,n),r.observe(e),()=>{YQ.delete(e),r.unobserve(e)}}const Zst={some:0,all:1};let Jst=class extends r2{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Zst[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),x=u?d:f;x&&x(c)};return Qst(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(eit(t,n))&&this.startObserver()}unmount(){}};function eit({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tit={inView:{Feature:Jst},tap:{Feature:Gst},focus:{Feature:qst},hover:{Feature:Wst}},nit={layout:{ProjectionNode:F7e,MeasureLayout:A7e}},rit={...Urt,...tit,...Vst,...nit},sm=rrt(rit,xrt),yhe={yellow:"bg-yellow-300",red:"bg-red-300",purple:"bg-purple-300",emerald:"bg-emerald-300",blue:"bg-sky-300",orange:"bg-orange-300"};function v0({label:e="NEW",tone:t="yellow"}){const n=yhe[t]??yhe.yellow;return i.jsxs("span",{className:"relative inline-flex h-4 items-center rounded-full px-2 text-[9px] font-semibold uppercase tracking-[0.08em] text-black overflow-hidden select-none ml-1 mt-[1px]",children:[i.jsx("span",{className:`absolute inset-[1px] rounded-full ${n}`}),i.jsx(sm.span,{className:"absolute -inset-y-2 left-[-40%] h-[200%] w-[40%] rotate-[18deg] bg-gradient-to-r from-transparent via-white/70 to-transparent opacity-80",animate:{x:["0%","300%"]},transition:{duration:3.2,ease:"linear",repeat:1/0}}),i.jsx("span",{className:"relative z-10",children:e})]})}function sit({label:e,items:t=[],activePaths:n=[],badgeLabel:r,badgeTone:s="yellow",align:a="left"}){var d;const{pathname:o}=Mc(),l=(d=n==null?void 0:n.some)==null?void 0:d.call(n,f=>o.startsWith(f)),c=a==="right"?"right-0":"left-0",u=f=>{if(!f)return null;if(typeof f=="string")return i.jsx("img",{src:f,alt:"",className:"w-4 h-4 object-contain shrink-0",loading:"lazy"});if(Ne.isValidElement(f))return f;if(typeof f=="function"){const x=f;return i.jsx(x,{className:"w-4 h-4 shrink-0"})}return null};return i.jsxs(OD,{as:"div",className:"relative hidden sm:inline-block text-left",children:[i.jsxs(PD,{className:`${l?"bg-[#232323]":"bg-transparent"} h-8 px-2 py-2 hover:bg-[#232323] rounded-[256px] inline-flex items-center focus:outline-none focus:ring-0`,children:[i.jsx("div",{className:"text-white text-[13px] font-semibold font-manrope leading-none",children:e}),r?i.jsx(v0,{label:r,tone:s}):null,i.jsx(N9,{"aria-hidden":"true",className:"-mr-1 size-5 text-gray-400"})]}),i.jsx(FD,{transition:!0,className:`absolute ${c} z-50 mt-1 origin-top-right ring-1 ring-black/5 transition focus:outline-none data-[closed]:scale-95 data-[closed]:transform data-[closed]:opacity-0 data-[enter]:duration-100 data-[leave]:duration-75 data-[enter]:ease-out data-[leave]:ease-in w-max min-w-[220px] bg-[#1A1A1A] rounded-2xl shadow border border-[#242424]`,children:i.jsx("div",{className:"flex flex-col items-start gap-1.5 p-1.5",children:t.map((f,x)=>{if(f.flyout&&f.submenu)return i.jsxs(jC,{as:"div",className:"relative group w-full",children:[i.jsxs("div",{className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl flex justify-between items-center cursor-pointer",children:[i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:f.label}),i.jsx(N9,{className:"size-4 -rotate-90 text-gray-400"})]}),i.jsx("div",{className:"absolute top-0 left-full hidden group-hover:block z-50 px-2",children:i.jsx("div",{className:"min-w-[220px] bg-[#1A1A1A] rounded-2xl shadow border border-[#242424] p-1.5",children:f.submenu.map((v,w)=>v.to?i.jsx(kde,{to:v.to,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl flex justify-between items-center",children:i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:v.label})},`sub-to-${w}`):i.jsxs("button",{onClick:v.onClick,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl flex justify-start items-center",children:[i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:v.label}),v.badge&&i.jsx(v0,{tone:"emerald",label:v.badge})]},`sub-btn-${w}`))})})]},`flyout-${x}`);const g=()=>i.jsx("div",{className:"flex justify-between items-center gap-6 w-full",children:i.jsxs("div",{className:"text-white text-[13px] font-semibold font-manrope flex items-center gap-2",children:[u(f.icon),f.label,f.badge&&i.jsx(v0,{tone:"emerald",label:f.badge})]})});return f.to?i.jsx(jC,{children:i.jsx(kde,{to:f.to,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl block",children:i.jsx(g,{})})},`to-${f.to}-${x}`):f.href?i.jsx(jC,{children:i.jsx("a",{href:f.href,target:f.external?"_blank":void 0,rel:f.external?"noreferrer":void 0,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl block",children:i.jsx(g,{})})},`href-${f.href}-${x}`):i.jsx(jC,{children:i.jsx("button",{className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl",onClick:f.onClick,children:i.jsx(g,{})})},`btn-${x}`)})})})]})}const dy=({className:e})=>i.jsxs("svg",{viewBox:"0 0 53 96",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:`size-full ${e}`,children:[i.jsx("path",{d:"M23 76.3751L0 96V20.687L23 0V76.3751Z"}),i.jsx("path",{d:"M53 76.4219L30 96V66.6279L53 46V76.4219Z"})]}),iit=[{type:"link",label:"Terminal",to:"/terminal/BTC"},{type:"dropdown",label:"Copy Trade",activePaths:["/copy-trade","/wallet-management","/discover-wallets","/hyperliquid-vaults","/back-testing","/hyperliquid-whale-trades","/hyperliquid-fee-calculator"],items:[{label:"Discover Wallets",to:"/discover-wallets"},{label:"My Copy Trading",to:"/copy-trade"},{label:"Wallet Management",to:"/wallet-management"},{label:"Discover Vaults",to:"/hyperliquid-vaults"},{label:"Backtest",to:"/back-testing"},{label:"Whale Trades",to:"/hyperliquid-whale-trades"},{label:"HL Fee Calculator",to:"/hyperliquid-fee-calculator"},{label:"Ticker",to:"ticker"}]},{type:"dropdown",label:"Leaderboard",activePaths:["/leaderboard","/referral"],items:[{label:"Leaderboard",to:"/leaderboard"},{label:"Referral",to:"/referral"}]},{type:"dropdown",label:"Tracker",activePaths:["/tracked-wallets","/tracker"],items:[{label:"Tracked Wallets",to:"/tracked-wallets"},{label:"My Activities",to:"/tracker"}]},{type:"dropdown",label:"Trading Bots",activePaths:[""],badgeTone:"yellow",items:[{label:"Extended Grid Bot",to:"/terminal/extended/BTC#gridbot",icon:"https://app.extended.exchange/assets/logo/extended.svg"},{label:"Extended DCA Bot",to:"/dca-bot",icon:"https://app.extended.exchange/assets/logo/extended.svg"},{label:"Extended Farming",action:"openExtended",badge:"SMART",icon:"https://app.extended.exchange/assets/logo/extended.svg"},{label:"Lighter Grid Bot",to:"/terminal/lighter/BTC#gridbot",icon:dy},{label:"HL Grid Bot",to:"/terminal/hyperliquid/BTC#gridbot",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg"},{label:"HL Market Maker Bot",to:"/market-maker",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg"},{label:"Farming Bots",flyout:!0,submenu:[{label:"Aster Farming",action:"openAster"},{label:"BasedApp Farming",action:"openFarm"},{label:"Lighter Farming",action:"openLighter"},{label:"Apex Farming",action:"openApex"},{label:"Variational Farming",action:"openVariational"},{label:"Paradex Farming",action:"openParadex"},{label:"Pacifica Farming",action:"openPacifica"}]}]}];function f3(e){"@babel/helpers - typeof";return f3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f3(e)}function ait(e,t){if(f3(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(f3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function O7e(e){var t=ait(e,"string");return f3(t)=="symbol"?t:t+""}function lj(e,t,n){return(t=O7e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vhe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ws(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vhe(Object(n),!0).forEach(function(r){lj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vhe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oit(e){if(Array.isArray(e))return e}function lit(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function XQ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function M7e(e,t){if(e){if(typeof e=="string")return XQ(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XQ(e,t):void 0}}function cit(){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 zg(e,t){return oit(e)||lit(e,t)||M7e(e,t)||cit()}function uit(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function v1(e,t){if(e==null)return{};var n,r,s=uit(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var dit=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function fit(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,s=r===void 0?!1:r,a=e.defaultValue,o=a===void 0?null:a,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,d=e.onInputChange,f=e.onMenuClose,x=e.onMenuOpen,g=e.value,v=v1(e,dit),w=m.useState(l!==void 0?l:n),C=zg(w,2),N=C[0],I=C[1],P=m.useState(c!==void 0?c:s),R=zg(P,2),F=R[0],U=R[1],L=m.useState(g!==void 0?g:o),z=zg(L,2),Q=z[0],ne=z[1],J=m.useCallback(function(G,V){typeof u=="function"&&u(G,V),ne(G)},[u]),X=m.useCallback(function(G,V){var te;typeof d=="function"&&(te=d(G,V)),I(te!==void 0?te:G)},[d]),re=m.useCallback(function(){typeof x=="function"&&x(),U(!0)},[x]),pe=m.useCallback(function(){typeof f=="function"&&f(),U(!1)},[f]),Y=l!==void 0?l:N,ie=c!==void 0?c:F,oe=g!==void 0?g:Q;return Ws(Ws({},v),{},{inputValue:Y,menuIsOpen:ie,onChange:J,onInputChange:X,onMenuClose:pe,onMenuOpen:re,value:oe})}function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zs.apply(null,arguments)}function hit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function whe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,O7e(r.key),r)}}function pit(e,t,n){return whe(e.prototype,t),whe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QQ(e,t){return QQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},QQ(e,t)}function mit(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QQ(e,t)}function KO(e){return KO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},KO(e)}function R7e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R7e=function(){return!!e})()}function xit(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function git(e,t){if(t&&(f3(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xit(e)}function bit(e){var t=R7e();return function(){var n,r=KO(e);if(t){var s=KO(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return git(this,n)}}function yit(e){if(Array.isArray(e))return XQ(e)}function vit(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wit(){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 Lse(e){return yit(e)||vit(e)||M7e(e)||wit()}function Cit(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Sit(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Nit=function(){function e(n){var r=this;this._insertTag=function(s){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,a),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Sit(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Cit(s);try{a.insertRule(r,a.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),mu="-ms-",YO="-moz-",va="-webkit-",L7e="comm",Dse="rule",Bse="decl",Ait="@import",D7e="@keyframes",jit="@layer",Eit=Math.abs,zD=String.fromCharCode,_it=Object.assign;function kit(e,t){return Xc(e,0)^45?(((t<<2^Xc(e,0))<<2^Xc(e,1))<<2^Xc(e,2))<<2^Xc(e,3):0}function B7e(e){return e.trim()}function Tit(e,t){return(e=t.exec(e))?e[0]:e}function wa(e,t,n){return e.replace(t,n)}function ZQ(e,t){return e.indexOf(t)}function Xc(e,t){return e.charCodeAt(t)|0}function T9(e,t,n){return e.slice(t,n)}function x0(e){return e.length}function $se(e){return e.length}function EI(e,t){return t.push(e),e}function Iit(e,t){return e.map(t).join("")}var HD=1,kS=1,$7e=0,of=0,$l=0,dA="";function VD(e,t,n,r,s,a,o){return{value:e,root:t,parent:n,type:r,props:s,children:a,line:HD,column:kS,length:o,return:""}}function f7(e,t){return _it(VD("",null,null,"",null,null,0),e,{length:-e.length},t)}function Pit(){return $l}function Fit(){return $l=of>0?Xc(dA,--of):0,kS--,$l===10&&(kS=1,HD--),$l}function zf(){return $l=of<$7e?Xc(dA,of++):0,kS++,$l===10&&(kS=1,HD++),$l}function R0(){return Xc(dA,of)}function IF(){return of}function Sk(e,t){return T9(dA,e,t)}function I9(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function U7e(e){return HD=kS=1,$7e=x0(dA=e),of=0,[]}function z7e(e){return dA="",e}function PF(e){return B7e(Sk(of-1,JQ(e===91?e+2:e===40?e+1:e)))}function Oit(e){for(;($l=R0())&&$l<33;)zf();return I9(e)>2||I9($l)>3?"":" "}function Mit(e,t){for(;--t&&zf()&&!($l<48||$l>102||$l>57&&$l<65||$l>70&&$l<97););return Sk(e,IF()+(t<6&&R0()==32&&zf()==32))}function JQ(e){for(;zf();)switch($l){case e:return of;case 34:case 39:e!==34&&e!==39&&JQ($l);break;case 40:e===41&&JQ(e);break;case 92:zf();break}return of}function Rit(e,t){for(;zf()&&e+$l!==57;)if(e+$l===84&&R0()===47)break;return"/*"+Sk(t,of-1)+"*"+zD(e===47?e:zf())}function Lit(e){for(;!I9(R0());)zf();return Sk(e,of)}function Dit(e){return z7e(FF("",null,null,null,[""],e=U7e(e),0,[0],e))}function FF(e,t,n,r,s,a,o,l,c){for(var u=0,d=0,f=o,x=0,g=0,v=0,w=1,C=1,N=1,I=0,P="",R=s,F=a,U=r,L=P;C;)switch(v=I,I=zf()){case 40:if(v!=108&&Xc(L,f-1)==58){ZQ(L+=wa(PF(I),"&","&\f"),"&\f")!=-1&&(N=-1);break}case 34:case 39:case 91:L+=PF(I);break;case 9:case 10:case 13:case 32:L+=Oit(v);break;case 92:L+=Mit(IF()-1,7);continue;case 47:switch(R0()){case 42:case 47:EI(Bit(Rit(zf(),IF()),t,n),c);break;default:L+="/"}break;case 123*w:l[u++]=x0(L)*N;case 125*w:case 59:case 0:switch(I){case 0:case 125:C=0;case 59+d:N==-1&&(L=wa(L,/\f/g,"")),g>0&&x0(L)-f&&EI(g>32?She(L+";",r,n,f-1):She(wa(L," ","")+";",r,n,f-2),c);break;case 59:L+=";";default:if(EI(U=Che(L,t,n,u,d,s,l,P,R=[],F=[],f),a),I===123)if(d===0)FF(L,t,U,U,R,a,f,l,F);else switch(x===99&&Xc(L,3)===110?100:x){case 100:case 108:case 109:case 115:FF(e,U,U,r&&EI(Che(e,U,U,0,0,s,l,P,s,R=[],f),F),s,F,f,l,r?R:F);break;default:FF(L,U,U,U,[""],F,0,l,F)}}u=d=g=0,w=N=1,P=L="",f=o;break;case 58:f=1+x0(L),g=v;default:if(w<1){if(I==123)--w;else if(I==125&&w++==0&&Fit()==125)continue}switch(L+=zD(I),I*w){case 38:N=d>0?1:(L+="\f",-1);break;case 44:l[u++]=(x0(L)-1)*N,N=1;break;case 64:R0()===45&&(L+=PF(zf())),x=R0(),d=f=x0(P=L+=Lit(IF())),I++;break;case 45:v===45&&x0(L)==2&&(w=0)}}return a}function Che(e,t,n,r,s,a,o,l,c,u,d){for(var f=s-1,x=s===0?a:[""],g=$se(x),v=0,w=0,C=0;v<r;++v)for(var N=0,I=T9(e,f+1,f=Eit(w=o[v])),P=e;N<g;++N)(P=B7e(w>0?x[N]+" "+I:wa(I,/&\f/g,x[N])))&&(c[C++]=P);return VD(e,t,n,s===0?Dse:l,c,u,d)}function Bit(e,t,n){return VD(e,t,n,L7e,zD(Pit()),T9(e,2,-2),0)}function She(e,t,n,r){return VD(e,t,n,Bse,T9(e,0,r),T9(e,r+1,-1),r)}function XC(e,t){for(var n="",r=$se(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function $it(e,t,n,r){switch(e.type){case jit:if(e.children.length)break;case Ait:case Bse:return e.return=e.return||e.value;case L7e:return"";case D7e:return e.return=e.value+"{"+XC(e.children,r)+"}";case Dse:e.value=e.props.join(",")}return x0(n=XC(e.children,r))?e.return=e.value+"{"+n+"}":""}function Uit(e){var t=$se(e);return function(n,r,s,a){for(var o="",l=0;l<t;l++)o+=e[l](n,r,s,a)||"";return o}}function zit(e){return function(t){t.root||(t=t.return)&&e(t)}}function Hit(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Vit=function(t,n,r){for(var s=0,a=0;s=a,a=R0(),s===38&&a===12&&(n[r]=1),!I9(a);)zf();return Sk(t,of)},Wit=function(t,n){var r=-1,s=44;do switch(I9(s)){case 0:s===38&&R0()===12&&(n[r]=1),t[r]+=Vit(of-1,n,r);break;case 2:t[r]+=PF(s);break;case 4:if(s===44){t[++r]=R0()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=zD(s)}while(s=zf());return t},qit=function(t,n){return z7e(Wit(U7e(t),n))},Nhe=new WeakMap,Git=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!Nhe.get(r))&&!s){Nhe.set(t,!0);for(var a=[],o=qit(n,a),l=r.props,c=0,u=0;c<o.length;c++)for(var d=0;d<l.length;d++,u++)t.props[u]=a[c]?o[c].replace(/&\f/g,l[d]):l[d]+" "+o[c]}}},Kit=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function H7e(e,t){switch(kit(e,t)){case 5103:return va+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return va+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return va+e+YO+e+mu+e+e;case 6828:case 4268:return va+e+mu+e+e;case 6165:return va+e+mu+"flex-"+e+e;case 5187:return va+e+wa(e,/(\w+).+(:[^]+)/,va+"box-$1$2"+mu+"flex-$1$2")+e;case 5443:return va+e+mu+"flex-item-"+wa(e,/flex-|-self/,"")+e;case 4675:return va+e+mu+"flex-line-pack"+wa(e,/align-content|flex-|-self/,"")+e;case 5548:return va+e+mu+wa(e,"shrink","negative")+e;case 5292:return va+e+mu+wa(e,"basis","preferred-size")+e;case 6060:return va+"box-"+wa(e,"-grow","")+va+e+mu+wa(e,"grow","positive")+e;case 4554:return va+wa(e,/([^-])(transform)/g,"$1"+va+"$2")+e;case 6187:return wa(wa(wa(e,/(zoom-|grab)/,va+"$1"),/(image-set)/,va+"$1"),e,"")+e;case 5495:case 3959:return wa(e,/(image-set\([^]*)/,va+"$1$`$1");case 4968:return wa(wa(e,/(.+:)(flex-)?(.*)/,va+"box-pack:$3"+mu+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+va+e+e;case 4095:case 3583:case 4068:case 2532:return wa(e,/(.+)-inline(.+)/,va+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(x0(e)-1-t>6)switch(Xc(e,t+1)){case 109:if(Xc(e,t+4)!==45)break;case 102:return wa(e,/(.+:)(.+)-([^]+)/,"$1"+va+"$2-$3$1"+YO+(Xc(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ZQ(e,"stretch")?H7e(wa(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Xc(e,t+1)!==115)break;case 6444:switch(Xc(e,x0(e)-3-(~ZQ(e,"!important")&&10))){case 107:return wa(e,":",":"+va)+e;case 101:return wa(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+va+(Xc(e,14)===45?"inline-":"")+"box$3$1"+va+"$2$3$1"+mu+"$2box$3")+e}break;case 5936:switch(Xc(e,t+11)){case 114:return va+e+mu+wa(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return va+e+mu+wa(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return va+e+mu+wa(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return va+e+mu+e+e}return e}var Yit=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case Bse:t.return=H7e(t.value,t.length);break;case D7e:return XC([f7(t,{value:wa(t.value,"@","@"+va)})],s);case Dse:if(t.length)return Iit(t.props,function(a){switch(Tit(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return XC([f7(t,{props:[wa(a,/:(read-\w+)/,":"+YO+"$1")]})],s);case"::placeholder":return XC([f7(t,{props:[wa(a,/:(plac\w+)/,":"+va+"input-$1")]}),f7(t,{props:[wa(a,/:(plac\w+)/,":"+YO+"$1")]}),f7(t,{props:[wa(a,/:(plac\w+)/,mu+"input-$1")]})],s)}return""})}},Xit=[Yit],Qit=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var C=w.getAttribute("data-emotion");C.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var s=t.stylisPlugins||Xit,a={},o,l=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var C=w.getAttribute("data-emotion").split(" "),N=1;N<C.length;N++)a[C[N]]=!0;l.push(w)});var c,u=[Git,Kit];{var d,f=[$it,zit(function(w){d.insert(w)})],x=Uit(u.concat(s,f)),g=function(C){return XC(Dit(C),x)};c=function(C,N,I,P){d=I,g(C?C+"{"+N.styles+"}":N.styles),P&&(v.inserted[N.name]=!0)}}var v={key:n,sheet:new Nit({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:c};return v.sheet.hydrate(l),v},Lz={exports:{}},Ta={};/** @license React v16.13.1
* react-is.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 Ahe;function Zit(){if(Ahe)return Ta;Ahe=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,w=e?Symbol.for("react.block"):60121,C=e?Symbol.for("react.fundamental"):60117,N=e?Symbol.for("react.responder"):60118,I=e?Symbol.for("react.scope"):60119;function P(F){if(typeof F=="object"&&F!==null){var U=F.$$typeof;switch(U){case t:switch(F=F.type,F){case c:case u:case r:case a:case s:case f:return F;default:switch(F=F&&F.$$typeof,F){case l:case d:case v:case g:case o:return F;default:return U}}case n:return U}}}function R(F){return P(F)===u}return Ta.AsyncMode=c,Ta.ConcurrentMode=u,Ta.ContextConsumer=l,Ta.ContextProvider=o,Ta.Element=t,Ta.ForwardRef=d,Ta.Fragment=r,Ta.Lazy=v,Ta.Memo=g,Ta.Portal=n,Ta.Profiler=a,Ta.StrictMode=s,Ta.Suspense=f,Ta.isAsyncMode=function(F){return R(F)||P(F)===c},Ta.isConcurrentMode=R,Ta.isContextConsumer=function(F){return P(F)===l},Ta.isContextProvider=function(F){return P(F)===o},Ta.isElement=function(F){return typeof F=="object"&&F!==null&&F.$$typeof===t},Ta.isForwardRef=function(F){return P(F)===d},Ta.isFragment=function(F){return P(F)===r},Ta.isLazy=function(F){return P(F)===v},Ta.isMemo=function(F){return P(F)===g},Ta.isPortal=function(F){return P(F)===n},Ta.isProfiler=function(F){return P(F)===a},Ta.isStrictMode=function(F){return P(F)===s},Ta.isSuspense=function(F){return P(F)===f},Ta.isValidElementType=function(F){return typeof F=="string"||typeof F=="function"||F===r||F===u||F===a||F===s||F===f||F===x||typeof F=="object"&&F!==null&&(F.$$typeof===v||F.$$typeof===g||F.$$typeof===o||F.$$typeof===l||F.$$typeof===d||F.$$typeof===C||F.$$typeof===N||F.$$typeof===I||F.$$typeof===w)},Ta.typeOf=P,Ta}var jhe;function Jit(){return jhe||(jhe=1,Lz.exports=Zit()),Lz.exports}var Dz,Ehe;function eat(){if(Ehe)return Dz;Ehe=1;var e=Jit(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=r,a[e.Memo]=s;function o(v){return e.isMemo(v)?s:a[v.$$typeof]||t}var l=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,x=Object.prototype;function g(v,w,C){if(typeof w!="string"){if(x){var N=f(w);N&&N!==x&&g(v,N,C)}var I=c(w);u&&(I=I.concat(u(w)));for(var P=o(v),R=o(w),F=0;F<I.length;++F){var U=I[F];if(!n[U]&&!(C&&C[U])&&!(R&&R[U])&&!(P&&P[U])){var L=d(w,U);try{l(v,U,L)}catch{}}}}return v}return Dz=g,Dz}eat();var tat=!0;function nat(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var V7e=function(t,n,r){var s=t.key+"-"+n.name;(r===!1||tat===!1)&&t.registered[s]===void 0&&(t.registered[s]=n.styles)},rat=function(t,n,r){V7e(t,n,r);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+s:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function sat(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var iat={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},aat=/[A-Z]|^ms/g,oat=/_EMO_([^_]+?)_([^]*?)_EMO_/g,W7e=function(t){return t.charCodeAt(1)===45},_he=function(t){return t!=null&&typeof t!="boolean"},Bz=Hit(function(e){return W7e(e)?e:e.replace(aat,"-$&").toLowerCase()}),khe=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(oat,function(r,s,a){return g0={name:s,styles:a,next:g0},s})}return iat[t]!==1&&!W7e(t)&&typeof n=="number"&&n!==0?n+"px":n};function P9(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return g0={name:s.name,styles:s.styles,next:g0},s.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)g0={name:o.name,styles:o.styles,next:g0},o=o.next;var l=a.styles+";";return l}return lat(e,t,n)}case"function":{if(e!==void 0){var c=g0,u=n(e);return g0=c,P9(e,t,u)}break}}var d=n;return d}function lat(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=P9(e,t,n[s])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var l=o;_he(l)&&(r+=Bz(a)+":"+khe(a,l)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&t==null)for(var c=0;c<o.length;c++)_he(o[c])&&(r+=Bz(a)+":"+khe(a,o[c])+";");else{var u=P9(e,t,o);switch(a){case"animation":case"animationName":{r+=Bz(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}return r}var The=/label:\s*([^\s;{]+)\s*(;|$)/g,g0;function q7e(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";g0=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,s+=P9(n,t,a);else{var o=a;s+=o[0]}for(var l=1;l<e.length;l++)if(s+=P9(n,t,e[l]),r){var c=a;s+=c[l]}The.lastIndex=0;for(var u="",d;(d=The.exec(s))!==null;)u+="-"+d[1];var f=sat(s)+u;return{name:f,styles:s,next:g0}}var cat=function(t){return t()},uat=Iy.useInsertionEffect?Iy.useInsertionEffect:!1,dat=uat||cat,G7e=m.createContext(typeof HTMLElement<"u"?Qit({key:"css"}):null);G7e.Provider;var fat=function(t){return m.forwardRef(function(n,r){var s=m.useContext(G7e);return t(n,s,r)})},hat=m.createContext({}),Use={}.hasOwnProperty,eZ="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",pat=function(t,n){var r={};for(var s in n)Use.call(n,s)&&(r[s]=n[s]);return r[eZ]=t,r},mat=function(t){var n=t.cache,r=t.serialized,s=t.isStringTag;return V7e(n,r,s),dat(function(){return rat(n,r,s)}),null},xat=fat(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var s=e[eZ],a=[r],o="";typeof e.className=="string"?o=nat(t.registered,a,e.className):e.className!=null&&(o=e.className+" ");var l=q7e(a,void 0,m.useContext(hat));o+=t.key+"-"+l.name;var c={};for(var u in e)Use.call(e,u)&&u!=="css"&&u!==eZ&&(c[u]=e[u]);return c.className=o,n&&(c.ref=n),m.createElement(m.Fragment,null,m.createElement(mat,{cache:t,serialized:l,isStringTag:typeof s=="string"}),m.createElement(s,c))}),gat=xat,zs=function(t,n){var r=arguments;if(n==null||!Use.call(n,"css"))return m.createElement.apply(void 0,r);var s=r.length,a=new Array(s);a[0]=gat,a[1]=pat(t,n);for(var o=2;o<s;o++)a[o]=r[o];return m.createElement.apply(null,a)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(zs);function zse(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return q7e(t)}function bat(){var e=zse.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function yat(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const vat=Math.min,wat=Math.max,XO=Math.round,_I=Math.floor,QO=e=>({x:e,y:e});function WD(){return typeof window<"u"}function K7e(e){return X7e(e)?(e.nodeName||"").toLowerCase():"#document"}function n1(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Y7e(e){var t;return(t=(X7e(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function X7e(e){return WD()?e instanceof Node||e instanceof n1(e).Node:!1}function Cat(e){return WD()?e instanceof Element||e instanceof n1(e).Element:!1}function Hse(e){return WD()?e instanceof HTMLElement||e instanceof n1(e).HTMLElement:!1}function Ihe(e){return!WD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof n1(e).ShadowRoot}function Q7e(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Vse(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function Sat(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Nat(e){return["html","body","#document"].includes(K7e(e))}function Vse(e){return n1(e).getComputedStyle(e)}function Aat(e){if(K7e(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ihe(e)&&e.host||Y7e(e);return Ihe(t)?t.host:t}function Z7e(e){const t=Aat(e);return Nat(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hse(t)&&Q7e(t)?t:Z7e(t)}function ZO(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Z7e(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=n1(s);if(a){const l=tZ(o);return t.concat(o,o.visualViewport||[],Q7e(s)?s:[],l&&n?ZO(l):[])}return t.concat(s,ZO(s,[],n))}function tZ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jat(e){const t=Vse(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Hse(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=XO(n)!==a||XO(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function Wse(e){return Cat(e)?e:e.contextElement}function Phe(e){const t=Wse(e);if(!Hse(t))return QO(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=jat(t);let o=(a?XO(n.width):n.width)/r,l=(a?XO(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Eat=QO(0);function _at(e){const t=n1(e);return!Sat()||!t.visualViewport?Eat:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kat(e,t,n){return!1}function Fhe(e,t,n,r){t===void 0&&(t=!1);const s=e.getBoundingClientRect(),a=Wse(e);let o=QO(1);t&&(o=Phe(e));const l=kat()?_at(a):QO(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(a){const x=n1(a),g=r;let v=x,w=tZ(v);for(;w&&r&&g!==v;){const C=Phe(w),N=w.getBoundingClientRect(),I=Vse(w),P=N.left+(w.clientLeft+parseFloat(I.paddingLeft))*C.x,R=N.top+(w.clientTop+parseFloat(I.paddingTop))*C.y;c*=C.x,u*=C.y,d*=C.x,f*=C.y,c+=P,u+=R,v=n1(w),w=tZ(v)}}return S9({width:d,height:f,x:c,y:u})}function J7e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tat(e,t){let n=null,r;const s=Y7e(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:d,top:f,width:x,height:g}=u;if(l||t(),!x||!g)return;const v=_I(f),w=_I(s.clientWidth-(d+x)),C=_I(s.clientHeight-(f+g)),N=_I(d),P={rootMargin:-v+"px "+-w+"px "+-C+"px "+-N+"px",threshold:wat(0,vat(1,c))||1};let R=!0;function F(U){const L=U[0].intersectionRatio;if(L!==c){if(!R)return o();L?o(!1,L):r=setTimeout(()=>{o(!1,1e-7)},1e3)}L===1&&!J7e(u,e.getBoundingClientRect())&&o(),R=!1}try{n=new IntersectionObserver(F,{...P,root:s.ownerDocument})}catch{n=new IntersectionObserver(F,P)}n.observe(e)}return o(!0),a}function Iat(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Wse(e),d=s||a?[...u?ZO(u):[],...ZO(t)]:[];d.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),a&&N.addEventListener("resize",n)});const f=u&&l?Tat(u,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(N=>{let[I]=N;I&&I.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var P;(P=g)==null||P.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,w=c?Fhe(e):null;c&&C();function C(){const N=Fhe(e);w&&!J7e(w,N)&&n(),w=N,v=requestAnimationFrame(C)}return n(),()=>{var N;d.forEach(I=>{s&&I.removeEventListener("scroll",n),a&&I.removeEventListener("resize",n)}),f==null||f(),(N=g)==null||N.disconnect(),g=null,c&&cancelAnimationFrame(v)}}var nZ=m.useLayoutEffect,Pat=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],JO=function(){};function Fat(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Oat(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];var a=[].concat(r);if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&a.push("".concat(Fat(e,o)));return a.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var Ohe=function(t){return Hat(t)?t.filter(Boolean):f3(t)==="object"&&t!==null?[t]:[]},eje=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=v1(t,Pat);return Ws({},n)},ol=function(t,n,r){var s=t.cx,a=t.getStyles,o=t.getClassNames,l=t.className;return{css:a(n,t),className:s(r??{},o(n,t),l)}};function qD(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Mat(e){return qD(e)?window.innerHeight:e.clientHeight}function tje(e){return qD(e)?window.pageYOffset:e.scrollTop}function eM(e,t){if(qD(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Rat(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var s=e;s=s.parentElement;)if(t=getComputedStyle(s),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return s;return document.documentElement}function Lat(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function kI(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:JO,s=tje(e),a=t-s,o=10,l=0;function c(){l+=o;var u=Lat(l,s,a,n);eM(e,u),l<n?window.requestAnimationFrame(c):r(e)}c()}function Mhe(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=t.offsetHeight/3;r.bottom+s>n.bottom?eM(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+s,e.scrollHeight)):r.top-s<n.top&&eM(e,Math.max(t.offsetTop-s,0))}function Dat(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Rhe(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Bat(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var nje=!1,$at={get passive(){return nje=!0}},TI=typeof window<"u"?window:{};TI.addEventListener&&TI.removeEventListener&&(TI.addEventListener("p",JO,$at),TI.removeEventListener("p",JO,!1));var Uat=nje;function zat(e){return e!=null}function Hat(e){return Array.isArray(e)}function II(e,t,n){return e?t:n}var Vat=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];var a=Object.entries(t).filter(function(o){var l=zg(o,1),c=l[0];return!r.includes(c)});return a.reduce(function(o,l){var c=zg(l,2),u=c[0],d=c[1];return o[u]=d,o},{})},Wat=["children","innerProps"],qat=["children","innerProps"];function Gat(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,s=e.placement,a=e.shouldScroll,o=e.isFixedPosition,l=e.controlHeight,c=Rat(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var d=c.getBoundingClientRect(),f=d.height,x=n.getBoundingClientRect(),g=x.bottom,v=x.height,w=x.top,C=n.offsetParent.getBoundingClientRect(),N=C.top,I=o?window.innerHeight:Mat(c),P=tje(c),R=parseInt(getComputedStyle(n).marginBottom,10),F=parseInt(getComputedStyle(n).marginTop,10),U=N-F,L=I-w,z=U+P,Q=f-P-w,ne=g-I+P+R,J=P+w-F,X=160;switch(s){case"auto":case"bottom":if(L>=v)return{placement:"bottom",maxHeight:t};if(Q>=v&&!o)return a&&kI(c,ne,X),{placement:"bottom",maxHeight:t};if(!o&&Q>=r||o&&L>=r){a&&kI(c,ne,X);var re=o?L-R:Q-R;return{placement:"bottom",maxHeight:re}}if(s==="auto"||o){var pe=t,Y=o?U:z;return Y>=r&&(pe=Math.min(Y-R-l,t)),{placement:"top",maxHeight:pe}}if(s==="bottom")return a&&eM(c,ne),{placement:"bottom",maxHeight:t};break;case"top":if(U>=v)return{placement:"top",maxHeight:t};if(z>=v&&!o)return a&&kI(c,J,X),{placement:"top",maxHeight:t};if(!o&&z>=r||o&&U>=r){var ie=t;return(!o&&z>=r||o&&U>=r)&&(ie=o?U-F:z-F),a&&kI(c,J,X),{placement:"top",maxHeight:ie}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(s,'".'))}return u}function Kat(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var rje=function(t){return t==="auto"?"bottom":t},Yat=function(t,n){var r,s=t.placement,a=t.theme,o=a.borderRadius,l=a.spacing,c=a.colors;return Ws((r={label:"menu"},lj(r,Kat(s),"100%"),lj(r,"position","absolute"),lj(r,"width","100%"),lj(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},sje=m.createContext(null),Xat=function(t){var n=t.children,r=t.minMenuHeight,s=t.maxMenuHeight,a=t.menuPlacement,o=t.menuPosition,l=t.menuShouldScrollIntoView,c=t.theme,u=m.useContext(sje)||{},d=u.setPortalPlacement,f=m.useRef(null),x=m.useState(s),g=zg(x,2),v=g[0],w=g[1],C=m.useState(null),N=zg(C,2),I=N[0],P=N[1],R=c.spacing.controlHeight;return nZ(function(){var F=f.current;if(F){var U=o==="fixed",L=l&&!U,z=Gat({maxHeight:s,menuEl:F,minHeight:r,placement:a,shouldScroll:L,isFixedPosition:U,controlHeight:R});w(z.maxHeight),P(z.placement),d==null||d(z.placement)}},[s,a,o,l,r,d,R]),n({ref:f,placerProps:Ws(Ws({},t),{},{placement:I||rje(a),maxHeight:v})})},Qat=function(t){var n=t.children,r=t.innerRef,s=t.innerProps;return zs("div",Zs({},ol(t,"menu",{menu:!0}),{ref:r},s),n)},Zat=Qat,Jat=function(t,n){var r=t.maxHeight,s=t.theme.spacing.baseUnit;return Ws({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:s,paddingTop:s})},eot=function(t){var n=t.children,r=t.innerProps,s=t.innerRef,a=t.isMulti;return zs("div",Zs({},ol(t,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:s},r),n)},ije=function(t,n){var r=t.theme,s=r.spacing.baseUnit,a=r.colors;return Ws({textAlign:"center"},n?{}:{color:a.neutral40,padding:"".concat(s*2,"px ").concat(s*3,"px")})},tot=ije,not=ije,rot=function(t){var n=t.children,r=n===void 0?"No options":n,s=t.innerProps,a=v1(t,Wat);return zs("div",Zs({},ol(Ws(Ws({},a),{},{children:r,innerProps:s}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),s),r)},sot=function(t){var n=t.children,r=n===void 0?"Loading...":n,s=t.innerProps,a=v1(t,qat);return zs("div",Zs({},ol(Ws(Ws({},a),{},{children:r,innerProps:s}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),s),r)},iot=function(t){var n=t.rect,r=t.offset,s=t.position;return{left:n.left,position:s,top:r,width:n.width,zIndex:1}},aot=function(t){var n=t.appendTo,r=t.children,s=t.controlElement,a=t.innerProps,o=t.menuPlacement,l=t.menuPosition,c=m.useRef(null),u=m.useRef(null),d=m.useState(rje(o)),f=zg(d,2),x=f[0],g=f[1],v=m.useMemo(function(){return{setPortalPlacement:g}},[]),w=m.useState(null),C=zg(w,2),N=C[0],I=C[1],P=m.useCallback(function(){if(s){var L=Dat(s),z=l==="fixed"?0:window.pageYOffset,Q=L[x]+z;(Q!==(N==null?void 0:N.offset)||L.left!==(N==null?void 0:N.rect.left)||L.width!==(N==null?void 0:N.rect.width))&&I({offset:Q,rect:L})}},[s,l,x,N==null?void 0:N.offset,N==null?void 0:N.rect.left,N==null?void 0:N.rect.width]);nZ(function(){P()},[P]);var R=m.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),s&&c.current&&(u.current=Iat(s,c.current,P,{elementResize:"ResizeObserver"in window}))},[s,P]);nZ(function(){R()},[R]);var F=m.useCallback(function(L){c.current=L,R()},[R]);if(!n&&l!=="fixed"||!N)return null;var U=zs("div",Zs({ref:F},ol(Ws(Ws({},t),{},{offset:N.offset,position:l,rect:N.rect}),"menuPortal",{"menu-portal":!0}),a),r);return zs(sje.Provider,{value:v},n?Na.createPortal(U,n):U)},oot=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},lot=function(t){var n=t.children,r=t.innerProps,s=t.isDisabled,a=t.isRtl;return zs("div",Zs({},ol(t,"container",{"--is-disabled":s,"--is-rtl":a}),r),n)},cot=function(t,n){var r=t.theme.spacing,s=t.isMulti,a=t.hasValue,o=t.selectProps.controlShouldRenderValue;return Ws({alignItems:"center",display:s&&a&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},uot=function(t){var n=t.children,r=t.innerProps,s=t.isMulti,a=t.hasValue;return zs("div",Zs({},ol(t,"valueContainer",{"value-container":!0,"value-container--is-multi":s,"value-container--has-value":a}),r),n)},dot=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},fot=function(t){var n=t.children,r=t.innerProps;return zs("div",Zs({},ol(t,"indicatorsContainer",{indicators:!0}),r),n)},Lhe,hot=["size"],pot=["innerProps","isRtl","size"],mot={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},aje=function(t){var n=t.size,r=v1(t,hot);return zs("svg",Zs({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:mot},r))},qse=function(t){return zs(aje,Zs({size:20},t),zs("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},oje=function(t){return zs(aje,Zs({size:20},t),zs("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},lje=function(t,n){var r=t.isFocused,s=t.theme,a=s.spacing.baseUnit,o=s.colors;return Ws({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2,":hover":{color:r?o.neutral80:o.neutral40}})},xot=lje,got=function(t){var n=t.children,r=t.innerProps;return zs("div",Zs({},ol(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||zs(oje,null))},bot=lje,yot=function(t){var n=t.children,r=t.innerProps;return zs("div",Zs({},ol(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||zs(qse,null))},vot=function(t,n){var r=t.isDisabled,s=t.theme,a=s.spacing.baseUnit,o=s.colors;return Ws({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:a*2,marginTop:a*2})},wot=function(t){var n=t.innerProps;return zs("span",Zs({},n,ol(t,"indicatorSeparator",{"indicator-separator":!0})))},Cot=bat(Lhe||(Lhe=yat([`
0%, 80%, 100% { opacity: 0; }
40% { opacity: 1; }
`]))),Sot=function(t,n){var r=t.isFocused,s=t.size,a=t.theme,o=a.colors,l=a.spacing.baseUnit;return Ws({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:s,lineHeight:1,marginRight:s,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:l*2})},$z=function(t){var n=t.delay,r=t.offset;return zs("span",{css:zse({animation:"".concat(Cot," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Not=function(t){var n=t.innerProps,r=t.isRtl,s=t.size,a=s===void 0?4:s,o=v1(t,pot);return zs("div",Zs({},ol(Ws(Ws({},o),{},{innerProps:n,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),zs($z,{delay:0,offset:r}),zs($z,{delay:160,offset:!0}),zs($z,{delay:320,offset:!r}))},Aot=function(t,n){var r=t.isDisabled,s=t.isFocused,a=t.theme,o=a.colors,l=a.borderRadius,c=a.spacing;return Ws({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:s?o.primary:o.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:s?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:s?o.primary:o.neutral30}})},jot=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,a=t.innerRef,o=t.innerProps,l=t.menuIsOpen;return zs("div",Zs({ref:a},ol(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":l}),o,{"aria-disabled":r||void 0}),n)},Eot=jot,_ot=["data"],kot=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Tot=function(t){var n=t.children,r=t.cx,s=t.getStyles,a=t.getClassNames,o=t.Heading,l=t.headingProps,c=t.innerProps,u=t.label,d=t.theme,f=t.selectProps;return zs("div",Zs({},ol(t,"group",{group:!0}),c),zs(o,Zs({},l,{selectProps:f,theme:d,getStyles:s,getClassNames:a,cx:r}),u),zs("div",null,n))},Iot=function(t,n){var r=t.theme,s=r.colors,a=r.spacing;return Ws({label:"group",cursor:"default",display:"block"},n?{}:{color:s.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},Pot=function(t){var n=eje(t);n.data;var r=v1(n,_ot);return zs("div",Zs({},ol(t,"groupHeading",{"group-heading":!0}),r))},Fot=Tot,Oot=["innerRef","isDisabled","isHidden","inputClassName"],Mot=function(t,n){var r=t.isDisabled,s=t.value,a=t.theme,o=a.spacing,l=a.colors;return Ws(Ws({visibility:r?"hidden":"visible",transform:s?"translateZ(0)":""},Rot),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:l.neutral80})},cje={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Rot={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ws({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},cje)},Lot=function(t){return Ws({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},cje)},Dot=function(t){var n=t.cx,r=t.value,s=eje(t),a=s.innerRef,o=s.isDisabled,l=s.isHidden,c=s.inputClassName,u=v1(s,Oot);return zs("div",Zs({},ol(t,"input",{"input-container":!0}),{"data-value":r||""}),zs("input",Zs({className:n({input:!0},c),ref:a,style:Lot(l),disabled:o},u)))},Bot=Dot,$ot=function(t,n){var r=t.theme,s=r.spacing,a=r.borderRadius,o=r.colors;return Ws({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:a/2,margin:s.baseUnit/2})},Uot=function(t,n){var r=t.theme,s=r.borderRadius,a=r.colors,o=t.cropWithEllipsis;return Ws({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:s/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},zot=function(t,n){var r=t.theme,s=r.spacing,a=r.borderRadius,o=r.colors,l=t.isFocused;return Ws({alignItems:"center",display:"flex"},n?{}:{borderRadius:a/2,backgroundColor:l?o.dangerLight:void 0,paddingLeft:s.baseUnit,paddingRight:s.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},uje=function(t){var n=t.children,r=t.innerProps;return zs("div",r,n)},Hot=uje,Vot=uje;function Wot(e){var t=e.children,n=e.innerProps;return zs("div",Zs({role:"button"},n),t||zs(qse,{size:14}))}var qot=function(t){var n=t.children,r=t.components,s=t.data,a=t.innerProps,o=t.isDisabled,l=t.removeProps,c=t.selectProps,u=r.Container,d=r.Label,f=r.Remove;return zs(u,{data:s,innerProps:Ws(Ws({},ol(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),a),selectProps:c},zs(d,{data:s,innerProps:Ws({},ol(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),zs(f,{data:s,innerProps:Ws(Ws({},ol(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:c}))},Got=qot,Kot=function(t,n){var r=t.isDisabled,s=t.isFocused,a=t.isSelected,o=t.theme,l=o.spacing,c=o.colors;return Ws({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:a?c.primary:s?c.primary25:"transparent",color:r?c.neutral20:a?c.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:a?c.primary:c.primary50}})},Yot=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,a=t.isSelected,o=t.innerRef,l=t.innerProps;return zs("div",Zs({},ol(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":s,"option--is-selected":a}),{ref:o,"aria-disabled":r},l),n)},Xot=Yot,Qot=function(t,n){var r=t.theme,s=r.spacing,a=r.colors;return Ws({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:a.neutral50,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},Zot=function(t){var n=t.children,r=t.innerProps;return zs("div",Zs({},ol(t,"placeholder",{placeholder:!0}),r),n)},Jot=Zot,elt=function(t,n){var r=t.isDisabled,s=t.theme,a=s.spacing,o=s.colors;return Ws({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},tlt=function(t){var n=t.children,r=t.isDisabled,s=t.innerProps;return zs("div",Zs({},ol(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),s),n)},nlt=tlt,Ca={ClearIndicator:yot,Control:Eot,DropdownIndicator:got,DownChevron:oje,CrossIcon:qse,Group:Fot,GroupHeading:Pot,IndicatorsContainer:fot,IndicatorSeparator:wot,Input:Bot,LoadingIndicator:Not,Menu:Zat,MenuList:eot,MenuPortal:aot,LoadingMessage:sot,NoOptionsMessage:rot,MultiValue:Got,MultiValueContainer:Hot,MultiValueLabel:Vot,MultiValueRemove:Wot,Option:Xot,Placeholder:Jot,SelectContainer:lot,SingleValue:nlt,ValueContainer:uot},rlt=function(t){return Ws(Ws({},Ca),t.components)},Dhe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function slt(e,t){return!!(e===t||Dhe(e)&&Dhe(t))}function ilt(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!slt(e[n],t[n]))return!1;return!0}function alt(e,t){t===void 0&&(t=ilt);var n=null;function r(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(n&&n.lastThis===this&&t(s,n.lastArgs))return n.lastResult;var o=e.apply(this,s);return n={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){n=null},r}var olt={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},llt=function(t){return zs("span",Zs({css:olt},t))},Bhe=llt,clt={guidance:function(t){var n=t.isSearchable,r=t.isMulti,s=t.tabSelectsValue,a=t.context,o=t.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(s?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,s=r===void 0?"":r,a=t.labels,o=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(s,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return o?"option ".concat(s," is disabled. Select another option."):"option ".concat(s,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,s=t.options,a=t.label,o=a===void 0?"":a,l=t.selectValue,c=t.isDisabled,u=t.isSelected,d=t.isAppleDevice,f=function(w,C){return w&&w.length?"".concat(w.indexOf(C)+1," of ").concat(w.length):""};if(n==="value"&&l)return"value ".concat(o," focused, ").concat(f(l,r),".");if(n==="menu"&&d){var x=c?" disabled":"",g="".concat(u?" selected":"").concat(x);return"".concat(o).concat(g,", ").concat(f(s,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},ult=function(t){var n=t.ariaSelection,r=t.focusedOption,s=t.focusedValue,a=t.focusableOptions,o=t.isFocused,l=t.selectValue,c=t.selectProps,u=t.id,d=t.isAppleDevice,f=c.ariaLiveMessages,x=c.getOptionLabel,g=c.inputValue,v=c.isMulti,w=c.isOptionDisabled,C=c.isSearchable,N=c.menuIsOpen,I=c.options,P=c.screenReaderStatus,R=c.tabSelectsValue,F=c.isLoading,U=c["aria-label"],L=c["aria-live"],z=m.useMemo(function(){return Ws(Ws({},clt),f||{})},[f]),Q=m.useMemo(function(){var Y="";if(n&&z.onChange){var ie=n.option,oe=n.options,G=n.removedValue,V=n.removedValues,te=n.value,ae=function(je){return Array.isArray(je)?null:je},he=G||ie||ae(te),Ce=he?x(he):"",ce=oe||V||void 0,ge=ce?ce.map(x):[],Ae=Ws({isDisabled:he&&w(he,l),label:Ce,labels:ge},n);Y=z.onChange(Ae)}return Y},[n,z,w,l,x]),ne=m.useMemo(function(){var Y="",ie=r||s,oe=!!(r&&l&&l.includes(r));if(ie&&z.onFocus){var G={focused:ie,label:x(ie),isDisabled:w(ie,l),isSelected:oe,options:a,context:ie===r?"menu":"value",selectValue:l,isAppleDevice:d};Y=z.onFocus(G)}return Y},[r,s,x,w,z,a,l,d]),J=m.useMemo(function(){var Y="";if(N&&I.length&&!F&&z.onFilter){var ie=P({count:a.length});Y=z.onFilter({inputValue:g,resultsMessage:ie})}return Y},[a,g,N,z,I,P,F]),X=(n==null?void 0:n.action)==="initial-input-focus",re=m.useMemo(function(){var Y="";if(z.guidance){var ie=s?"value":N?"menu":"input";Y=z.guidance({"aria-label":U,context:ie,isDisabled:r&&w(r,l),isMulti:v,isSearchable:C,tabSelectsValue:R,isInitialFocus:X})}return Y},[U,r,s,v,w,C,N,z,l,R,X]),pe=zs(m.Fragment,null,zs("span",{id:"aria-selection"},Q),zs("span",{id:"aria-focused"},ne),zs("span",{id:"aria-results"},J),zs("span",{id:"aria-guidance"},re));return zs(m.Fragment,null,zs(Bhe,{id:u},X&&pe),zs(Bhe,{"aria-live":L,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!X&&pe))},dlt=ult,rZ=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],flt=new RegExp("["+rZ.map(function(e){return e.letters}).join("")+"]","g"),dje={};for(var Uz=0;Uz<rZ.length;Uz++)for(var zz=rZ[Uz],Hz=0;Hz<zz.letters.length;Hz++)dje[zz.letters[Hz]]=zz.base;var fje=function(t){return t.replace(flt,function(n){return dje[n]})},hlt=alt(fje),$he=function(t){return t.replace(/^\s+|\s+$/g,"")},plt=function(t){return"".concat(t.label," ").concat(t.value)},mlt=function(t){return function(n,r){if(n.data.__isNew__)return!0;var s=Ws({ignoreCase:!0,ignoreAccents:!0,stringify:plt,trim:!0,matchFrom:"any"},t),a=s.ignoreCase,o=s.ignoreAccents,l=s.stringify,c=s.trim,u=s.matchFrom,d=c?$he(r):r,f=c?$he(l(n)):l(n);return a&&(d=d.toLowerCase(),f=f.toLowerCase()),o&&(d=hlt(d),f=fje(f)),u==="start"?f.substr(0,d.length)===d:f.indexOf(d)>-1}},xlt=["innerRef"];function glt(e){var t=e.innerRef,n=v1(e,xlt),r=Vat(n,"onExited","in","enter","exit","appear");return zs("input",Zs({ref:t},r,{css:zse({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var blt=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function ylt(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,s=e.onTopArrive,a=e.onTopLeave,o=m.useRef(!1),l=m.useRef(!1),c=m.useRef(0),u=m.useRef(null),d=m.useCallback(function(C,N){if(u.current!==null){var I=u.current,P=I.scrollTop,R=I.scrollHeight,F=I.clientHeight,U=u.current,L=N>0,z=R-F-P,Q=!1;z>N&&o.current&&(r&&r(C),o.current=!1),L&&l.current&&(a&&a(C),l.current=!1),L&&N>z?(n&&!o.current&&n(C),U.scrollTop=R,Q=!0,o.current=!0):!L&&-N>P&&(s&&!l.current&&s(C),U.scrollTop=0,Q=!0,l.current=!0),Q&&blt(C)}},[n,r,s,a]),f=m.useCallback(function(C){d(C,C.deltaY)},[d]),x=m.useCallback(function(C){c.current=C.changedTouches[0].clientY},[]),g=m.useCallback(function(C){var N=c.current-C.changedTouches[0].clientY;d(C,N)},[d]),v=m.useCallback(function(C){if(C){var N=Uat?{passive:!1}:!1;C.addEventListener("wheel",f,N),C.addEventListener("touchstart",x,N),C.addEventListener("touchmove",g,N)}},[g,x,f]),w=m.useCallback(function(C){C&&(C.removeEventListener("wheel",f,!1),C.removeEventListener("touchstart",x,!1),C.removeEventListener("touchmove",g,!1))},[g,x,f]);return m.useEffect(function(){if(t){var C=u.current;return v(C),function(){w(C)}}},[t,v,w]),function(C){u.current=C}}var Uhe=["boxSizing","height","overflow","paddingRight","position"],zhe={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Hhe(e){e.cancelable&&e.preventDefault()}function Vhe(e){e.stopPropagation()}function Whe(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function qhe(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ghe=!!(typeof window<"u"&&window.document&&window.document.createElement),h7=0,M6={capture:!1,passive:!1};function vlt(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,s=m.useRef({}),a=m.useRef(null),o=m.useCallback(function(c){if(Ghe){var u=document.body,d=u&&u.style;if(r&&Uhe.forEach(function(v){var w=d&&d[v];s.current[v]=w}),r&&h7<1){var f=parseInt(s.current.paddingRight,10)||0,x=document.body?document.body.clientWidth:0,g=window.innerWidth-x+f||0;Object.keys(zhe).forEach(function(v){var w=zhe[v];d&&(d[v]=w)}),d&&(d.paddingRight="".concat(g,"px"))}u&&qhe()&&(u.addEventListener("touchmove",Hhe,M6),c&&(c.addEventListener("touchstart",Whe,M6),c.addEventListener("touchmove",Vhe,M6))),h7+=1}},[r]),l=m.useCallback(function(c){if(Ghe){var u=document.body,d=u&&u.style;h7=Math.max(h7-1,0),r&&h7<1&&Uhe.forEach(function(f){var x=s.current[f];d&&(d[f]=x)}),u&&qhe()&&(u.removeEventListener("touchmove",Hhe,M6),c&&(c.removeEventListener("touchstart",Whe,M6),c.removeEventListener("touchmove",Vhe,M6)))}},[r]);return m.useEffect(function(){if(t){var c=a.current;return o(c),function(){l(c)}}},[t,o,l]),function(c){a.current=c}}var wlt=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Clt={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Slt(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,s=r===void 0?!0:r,a=e.onBottomArrive,o=e.onBottomLeave,l=e.onTopArrive,c=e.onTopLeave,u=ylt({isEnabled:s,onBottomArrive:a,onBottomLeave:o,onTopArrive:l,onTopLeave:c}),d=vlt({isEnabled:n}),f=function(g){u(g),d(g)};return zs(m.Fragment,null,n&&zs("div",{onClick:wlt,css:Clt}),t(f))}var Nlt={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Alt=function(t){var n=t.name,r=t.onFocus;return zs("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Nlt,value:"",onChange:function(){}})},jlt=Alt;function Gse(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Elt(){return Gse(/^iPhone/i)}function hje(){return Gse(/^Mac/i)}function _lt(){return Gse(/^iPad/i)||hje()&&navigator.maxTouchPoints>1}function klt(){return Elt()||_lt()}function Tlt(){return hje()||klt()}var Ilt=function(t){return t.label},Plt=function(t){return t.label},Flt=function(t){return t.value},Olt=function(t){return!!t.isDisabled},Mlt={clearIndicator:bot,container:oot,control:Aot,dropdownIndicator:xot,group:kot,groupHeading:Iot,indicatorsContainer:dot,indicatorSeparator:vot,input:Mot,loadingIndicator:Sot,loadingMessage:not,menu:Yat,menuList:Jat,menuPortal:iot,multiValue:$ot,multiValueLabel:Uot,multiValueRemove:zot,noOptionsMessage:tot,option:Kot,placeholder:Qot,singleValue:elt,valueContainer:cot},Rlt={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Llt=4,pje=4,Dlt=38,Blt=pje*2,$lt={baseUnit:pje,controlHeight:Dlt,menuGutter:Blt},Vz={borderRadius:Llt,colors:Rlt,spacing:$lt},Ult={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Rhe(),captureMenuScroll:!Rhe(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:mlt(),formatGroupLabel:Ilt,getOptionLabel:Plt,getOptionValue:Flt,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Olt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Bat(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Khe(e,t,n,r){var s=gje(e,t,n),a=bje(e,t,n),o=xje(e,t),l=tM(e,t);return{type:"option",data:t,isDisabled:s,isSelected:a,label:o,value:l,index:r}}function OF(e,t){return e.options.map(function(n,r){if("options"in n){var s=n.options.map(function(o,l){return Khe(e,o,t,l)}).filter(function(o){return Xhe(e,o)});return s.length>0?{type:"group",data:n,options:s,index:r}:void 0}var a=Khe(e,n,t,r);return Xhe(e,a)?a:void 0}).filter(zat)}function mje(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Lse(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Yhe(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Lse(r.options.map(function(s){return{data:s.data,id:"".concat(t,"-").concat(r.index,"-").concat(s.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function zlt(e,t){return mje(OF(e,t))}function Xhe(e,t){var n=e.inputValue,r=n===void 0?"":n,s=t.data,a=t.isSelected,o=t.label,l=t.value;return(!vje(e)||!a)&&yje(e,{label:o,value:l,data:s},r)}function Hlt(e,t){var n=e.focusedValue,r=e.selectValue,s=r.indexOf(n);if(s>-1){var a=t.indexOf(n);if(a>-1)return n;if(s<t.length)return t[s]}return null}function Vlt(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Wz=function(t,n){var r,s=(r=t.find(function(a){return a.data===n}))===null||r===void 0?void 0:r.id;return s||null},xje=function(t,n){return t.getOptionLabel(n)},tM=function(t,n){return t.getOptionValue(n)};function gje(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function bje(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=tM(e,t);return n.some(function(s){return tM(e,s)===r})}function yje(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var vje=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Wlt=1,wje=function(e){mit(n,e);var t=bit(n);function n(r){var s;if(hit(this,n),s=t.call(this,r),s.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},s.blockOptionHover=!1,s.isComposing=!1,s.commonProps=void 0,s.initialTouchX=0,s.initialTouchY=0,s.openAfterFocus=!1,s.scrollToFocusedOptionOnUpdate=!1,s.userIsDragging=void 0,s.isAppleDevice=Tlt(),s.controlRef=null,s.getControlRef=function(c){s.controlRef=c},s.focusedOptionRef=null,s.getFocusedOptionRef=function(c){s.focusedOptionRef=c},s.menuListRef=null,s.getMenuListRef=function(c){s.menuListRef=c},s.inputRef=null,s.getInputRef=function(c){s.inputRef=c},s.focus=s.focusInput,s.blur=s.blurInput,s.onChange=function(c,u){var d=s.props,f=d.onChange,x=d.name;u.name=x,s.ariaOnChange(c,u),f(c,u)},s.setValue=function(c,u,d){var f=s.props,x=f.closeMenuOnSelect,g=f.isMulti,v=f.inputValue;s.onInputChange("",{action:"set-value",prevInputValue:v}),x&&(s.setState({inputIsHiddenAfterUpdate:!g}),s.onMenuClose()),s.setState({clearFocusValueOnUpdate:!0}),s.onChange(c,{action:u,option:d})},s.selectOption=function(c){var u=s.props,d=u.blurInputOnSelect,f=u.isMulti,x=u.name,g=s.state.selectValue,v=f&&s.isOptionSelected(c,g),w=s.isOptionDisabled(c,g);if(v){var C=s.getOptionValue(c);s.setValue(g.filter(function(N){return s.getOptionValue(N)!==C}),"deselect-option",c)}else if(!w)f?s.setValue([].concat(Lse(g),[c]),"select-option",c):s.setValue(c,"select-option");else{s.ariaOnChange(c,{action:"select-option",option:c,name:x});return}d&&s.blurInput()},s.removeValue=function(c){var u=s.props.isMulti,d=s.state.selectValue,f=s.getOptionValue(c),x=d.filter(function(v){return s.getOptionValue(v)!==f}),g=II(u,x,x[0]||null);s.onChange(g,{action:"remove-value",removedValue:c}),s.focusInput()},s.clearValue=function(){var c=s.state.selectValue;s.onChange(II(s.props.isMulti,[],null),{action:"clear",removedValues:c})},s.popValue=function(){var c=s.props.isMulti,u=s.state.selectValue,d=u[u.length-1],f=u.slice(0,u.length-1),x=II(c,f,f[0]||null);d&&s.onChange(x,{action:"pop-value",removedValue:d})},s.getFocusedOptionId=function(c){return Wz(s.state.focusableOptionsWithIds,c)},s.getFocusableOptionsWithIds=function(){return Yhe(OF(s.props,s.state.selectValue),s.getElementId("option"))},s.getValue=function(){return s.state.selectValue},s.cx=function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];return Oat.apply(void 0,[s.props.classNamePrefix].concat(u))},s.getOptionLabel=function(c){return xje(s.props,c)},s.getOptionValue=function(c){return tM(s.props,c)},s.getStyles=function(c,u){var d=s.props.unstyled,f=Mlt[c](u,d);f.boxSizing="border-box";var x=s.props.styles[c];return x?x(f,u):f},s.getClassNames=function(c,u){var d,f;return(d=(f=s.props.classNames)[c])===null||d===void 0?void 0:d.call(f,u)},s.getElementId=function(c){return"".concat(s.state.instancePrefix,"-").concat(c)},s.getComponents=function(){return rlt(s.props)},s.buildCategorizedOptions=function(){return OF(s.props,s.state.selectValue)},s.getCategorizedOptions=function(){return s.props.menuIsOpen?s.buildCategorizedOptions():[]},s.buildFocusableOptions=function(){return mje(s.buildCategorizedOptions())},s.getFocusableOptions=function(){return s.props.menuIsOpen?s.buildFocusableOptions():[]},s.ariaOnChange=function(c,u){s.setState({ariaSelection:Ws({value:c},u)})},s.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),s.focusInput())},s.onMenuMouseMove=function(c){s.blockOptionHover=!1},s.onControlMouseDown=function(c){if(!c.defaultPrevented){var u=s.props.openMenuOnClick;s.state.isFocused?s.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&s.onMenuClose():u&&s.openMenu("first"):(u&&(s.openAfterFocus=!0),s.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},s.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!s.props.isDisabled){var u=s.props,d=u.isMulti,f=u.menuIsOpen;s.focusInput(),f?(s.setState({inputIsHiddenAfterUpdate:!d}),s.onMenuClose()):s.openMenu("first"),c.preventDefault()}},s.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(s.clearValue(),c.preventDefault(),s.openAfterFocus=!1,c.type==="touchend"?s.focusInput():setTimeout(function(){return s.focusInput()}))},s.onScroll=function(c){typeof s.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&qD(c.target)&&s.props.onMenuClose():typeof s.props.closeMenuOnScroll=="function"&&s.props.closeMenuOnScroll(c)&&s.props.onMenuClose()},s.onCompositionStart=function(){s.isComposing=!0},s.onCompositionEnd=function(){s.isComposing=!1},s.onTouchStart=function(c){var u=c.touches,d=u&&u.item(0);d&&(s.initialTouchX=d.clientX,s.initialTouchY=d.clientY,s.userIsDragging=!1)},s.onTouchMove=function(c){var u=c.touches,d=u&&u.item(0);if(d){var f=Math.abs(d.clientX-s.initialTouchX),x=Math.abs(d.clientY-s.initialTouchY),g=5;s.userIsDragging=f>g||x>g}},s.onTouchEnd=function(c){s.userIsDragging||(s.controlRef&&!s.controlRef.contains(c.target)&&s.menuListRef&&!s.menuListRef.contains(c.target)&&s.blurInput(),s.initialTouchX=0,s.initialTouchY=0)},s.onControlTouchEnd=function(c){s.userIsDragging||s.onControlMouseDown(c)},s.onClearIndicatorTouchEnd=function(c){s.userIsDragging||s.onClearIndicatorMouseDown(c)},s.onDropdownIndicatorTouchEnd=function(c){s.userIsDragging||s.onDropdownIndicatorMouseDown(c)},s.handleInputChange=function(c){var u=s.props.inputValue,d=c.currentTarget.value;s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange(d,{action:"input-change",prevInputValue:u}),s.props.menuIsOpen||s.onMenuOpen()},s.onInputFocus=function(c){s.props.onFocus&&s.props.onFocus(c),s.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(s.openAfterFocus||s.props.openMenuOnFocus)&&s.openMenu("first"),s.openAfterFocus=!1},s.onInputBlur=function(c){var u=s.props.inputValue;if(s.menuListRef&&s.menuListRef.contains(document.activeElement)){s.inputRef.focus();return}s.props.onBlur&&s.props.onBlur(c),s.onInputChange("",{action:"input-blur",prevInputValue:u}),s.onMenuClose(),s.setState({focusedValue:null,isFocused:!1})},s.onOptionHover=function(c){if(!(s.blockOptionHover||s.state.focusedOption===c)){var u=s.getFocusableOptions(),d=u.indexOf(c);s.setState({focusedOption:c,focusedOptionId:d>-1?s.getFocusedOptionId(c):null})}},s.shouldHideSelectedOptions=function(){return vje(s.props)},s.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),s.focus()},s.onKeyDown=function(c){var u=s.props,d=u.isMulti,f=u.backspaceRemovesValue,x=u.escapeClearsValue,g=u.inputValue,v=u.isClearable,w=u.isDisabled,C=u.menuIsOpen,N=u.onKeyDown,I=u.tabSelectsValue,P=u.openMenuOnFocus,R=s.state,F=R.focusedOption,U=R.focusedValue,L=R.selectValue;if(!w&&!(typeof N=="function"&&(N(c),c.defaultPrevented))){switch(s.blockOptionHover=!0,c.key){case"ArrowLeft":if(!d||g)return;s.focusValue("previous");break;case"ArrowRight":if(!d||g)return;s.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(U)s.removeValue(U);else{if(!f)return;d?s.popValue():v&&s.clearValue()}break;case"Tab":if(s.isComposing||c.shiftKey||!C||!I||!F||P&&s.isOptionSelected(F,L))return;s.selectOption(F);break;case"Enter":if(c.keyCode===229)break;if(C){if(!F||s.isComposing)return;s.selectOption(F);break}return;case"Escape":C?(s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange("",{action:"menu-close",prevInputValue:g}),s.onMenuClose()):v&&x&&s.clearValue();break;case" ":if(g)return;if(!C){s.openMenu("first");break}if(!F)return;s.selectOption(F);break;case"ArrowUp":C?s.focusOption("up"):s.openMenu("last");break;case"ArrowDown":C?s.focusOption("down"):s.openMenu("first");break;case"PageUp":if(!C)return;s.focusOption("pageup");break;case"PageDown":if(!C)return;s.focusOption("pagedown");break;case"Home":if(!C)return;s.focusOption("first");break;case"End":if(!C)return;s.focusOption("last");break;default:return}c.preventDefault()}},s.state.instancePrefix="react-select-"+(s.props.instanceId||++Wlt),s.state.selectValue=Ohe(r.value),r.menuIsOpen&&s.state.selectValue.length){var a=s.getFocusableOptionsWithIds(),o=s.buildFocusableOptions(),l=o.indexOf(s.state.selectValue[0]);s.state.focusableOptionsWithIds=a,s.state.focusedOption=o[l],s.state.focusedOptionId=Wz(a,o[l])}return s}return pit(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Mhe(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isDisabled,l=a.menuIsOpen,c=this.state.isFocused;(c&&!o&&s.isDisabled||c&&l&&!s.menuIsOpen)&&this.focusInput(),c&&o&&!s.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!o&&s.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Mhe(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(s,a){this.props.onInputChange(s,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(s){var a=this,o=this.state,l=o.selectValue,c=o.isFocused,u=this.buildFocusableOptions(),d=s==="first"?0:u.length-1;if(!this.props.isMulti){var f=u.indexOf(l[0]);f>-1&&(d=f)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[d],focusedOptionId:this.getFocusedOptionId(u[d])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(s){var a=this.state,o=a.selectValue,l=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=o.indexOf(l);l||(c=-1);var u=o.length-1,d=-1;if(o.length){switch(s){case"previous":c===0?d=0:c===-1?d=u:d=c-1;break;case"next":c>-1&&c<u&&(d=c+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:o[d]})}}}},{key:"focusOption",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,o=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var c=0,u=l.indexOf(o);o||(u=-1),s==="up"?c=u>0?u-1:l.length-1:s==="down"?c=(u+1)%l.length:s==="pageup"?(c=u-a,c<0&&(c=0)):s==="pagedown"?(c=u+a,c>l.length-1&&(c=l.length-1)):s==="last"&&(c=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Vz):Ws(Ws({},Vz),this.props.theme):Vz}},{key:"getCommonProps",value:function(){var s=this.clearValue,a=this.cx,o=this.getStyles,l=this.getClassNames,c=this.getValue,u=this.selectOption,d=this.setValue,f=this.props,x=f.isMulti,g=f.isRtl,v=f.options,w=this.hasValue();return{clearValue:s,cx:a,getStyles:o,getClassNames:l,getValue:c,hasValue:w,isMulti:x,isRtl:g,options:v,selectOption:u,selectProps:f,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var s=this.state.selectValue;return s.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var s=this.props,a=s.isClearable,o=s.isMulti;return a===void 0?o:a}},{key:"isOptionDisabled",value:function(s,a){return gje(this.props,s,a)}},{key:"isOptionSelected",value:function(s,a){return bje(this.props,s,a)}},{key:"filterOption",value:function(s,a){return yje(this.props,s,a)}},{key:"formatOptionLabel",value:function(s,a){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(s,{context:a,inputValue:o,selectValue:l})}else return this.getOptionLabel(s)}},{key:"formatGroupLabel",value:function(s){return this.props.formatGroupLabel(s)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var s=this.props,a=s.isDisabled,o=s.isSearchable,l=s.inputId,c=s.inputValue,u=s.tabIndex,d=s.form,f=s.menuIsOpen,x=s.required,g=this.getComponents(),v=g.Input,w=this.state,C=w.inputIsHidden,N=w.ariaSelection,I=this.commonProps,P=l||this.getElementId("input"),R=Ws(Ws(Ws({"aria-autocomplete":"list","aria-expanded":f,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":x,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(N==null?void 0:N.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?m.createElement(v,Zs({},I,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:P,innerRef:this.getInputRef,isDisabled:a,isHidden:C,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:d,type:"text",value:c},R)):m.createElement(glt,Zs({id:P,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:JO,onFocus:this.onInputFocus,disabled:a,tabIndex:u,inputMode:"none",form:d,value:""},R))}},{key:"renderPlaceholderOrValue",value:function(){var s=this,a=this.getComponents(),o=a.MultiValue,l=a.MultiValueContainer,c=a.MultiValueLabel,u=a.MultiValueRemove,d=a.SingleValue,f=a.Placeholder,x=this.commonProps,g=this.props,v=g.controlShouldRenderValue,w=g.isDisabled,C=g.isMulti,N=g.inputValue,I=g.placeholder,P=this.state,R=P.selectValue,F=P.focusedValue,U=P.isFocused;if(!this.hasValue()||!v)return N?null:m.createElement(f,Zs({},x,{key:"placeholder",isDisabled:w,isFocused:U,innerProps:{id:this.getElementId("placeholder")}}),I);if(C)return R.map(function(z,Q){var ne=z===F,J="".concat(s.getOptionLabel(z),"-").concat(s.getOptionValue(z));return m.createElement(o,Zs({},x,{components:{Container:l,Label:c,Remove:u},isFocused:ne,isDisabled:w,key:J,index:Q,removeProps:{onClick:function(){return s.removeValue(z)},onTouchEnd:function(){return s.removeValue(z)},onMouseDown:function(re){re.preventDefault()}},data:z}),s.formatOptionLabel(z,"value"))});if(N)return null;var L=R[0];return m.createElement(d,Zs({},x,{data:L,isDisabled:w}),this.formatOptionLabel(L,"value"))}},{key:"renderClearIndicator",value:function(){var s=this.getComponents(),a=s.ClearIndicator,o=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,d=this.state.isFocused;if(!this.isClearable()||!a||c||!this.hasValue()||u)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return m.createElement(a,Zs({},o,{innerProps:f,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var s=this.getComponents(),a=s.LoadingIndicator,o=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,d=this.state.isFocused;if(!a||!u)return null;var f={"aria-hidden":"true"};return m.createElement(a,Zs({},o,{innerProps:f,isDisabled:c,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var s=this.getComponents(),a=s.DropdownIndicator,o=s.IndicatorSeparator;if(!a||!o)return null;var l=this.commonProps,c=this.props.isDisabled,u=this.state.isFocused;return m.createElement(o,Zs({},l,{isDisabled:c,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var s=this.getComponents(),a=s.DropdownIndicator;if(!a)return null;var o=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return m.createElement(a,Zs({},o,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderMenu",value:function(){var s=this,a=this.getComponents(),o=a.Group,l=a.GroupHeading,c=a.Menu,u=a.MenuList,d=a.MenuPortal,f=a.LoadingMessage,x=a.NoOptionsMessage,g=a.Option,v=this.commonProps,w=this.state.focusedOption,C=this.props,N=C.captureMenuScroll,I=C.inputValue,P=C.isLoading,R=C.loadingMessage,F=C.minMenuHeight,U=C.maxMenuHeight,L=C.menuIsOpen,z=C.menuPlacement,Q=C.menuPosition,ne=C.menuPortalTarget,J=C.menuShouldBlockScroll,X=C.menuShouldScrollIntoView,re=C.noOptionsMessage,pe=C.onMenuScrollToTop,Y=C.onMenuScrollToBottom;if(!L)return null;var ie=function(Ce,ce){var ge=Ce.type,Ae=Ce.data,ye=Ce.isDisabled,je=Ce.isSelected,Ie=Ce.label,Re=Ce.value,Qe=w===Ae,$e=ye?void 0:function(){return s.onOptionHover(Ae)},it=ye?void 0:function(){return s.selectOption(Ae)},tt="".concat(s.getElementId("option"),"-").concat(ce),ot={id:tt,onClick:it,onMouseMove:$e,onMouseOver:$e,tabIndex:-1,role:"option","aria-selected":s.isAppleDevice?void 0:je};return m.createElement(g,Zs({},v,{innerProps:ot,data:Ae,isDisabled:ye,isSelected:je,key:tt,label:Ie,type:ge,value:Re,isFocused:Qe,innerRef:Qe?s.getFocusedOptionRef:void 0}),s.formatOptionLabel(Ce.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(he){if(he.type==="group"){var Ce=he.data,ce=he.options,ge=he.index,Ae="".concat(s.getElementId("group"),"-").concat(ge),ye="".concat(Ae,"-heading");return m.createElement(o,Zs({},v,{key:Ae,data:Ce,options:ce,Heading:l,headingProps:{id:ye,data:he.data},label:s.formatGroupLabel(he.data)}),he.options.map(function(je){return ie(je,"".concat(ge,"-").concat(je.index))}))}else if(he.type==="option")return ie(he,"".concat(he.index))});else if(P){var G=R({inputValue:I});if(G===null)return null;oe=m.createElement(f,v,G)}else{var V=re({inputValue:I});if(V===null)return null;oe=m.createElement(x,v,V)}var te={minMenuHeight:F,maxMenuHeight:U,menuPlacement:z,menuPosition:Q,menuShouldScrollIntoView:X},ae=m.createElement(Xat,Zs({},v,te),function(he){var Ce=he.ref,ce=he.placerProps,ge=ce.placement,Ae=ce.maxHeight;return m.createElement(c,Zs({},v,te,{innerRef:Ce,innerProps:{onMouseDown:s.onMenuMouseDown,onMouseMove:s.onMenuMouseMove},isLoading:P,placement:ge}),m.createElement(Slt,{captureEnabled:N,onTopArrive:pe,onBottomArrive:Y,lockEnabled:J},function(ye){return m.createElement(u,Zs({},v,{innerRef:function(Ie){s.getMenuListRef(Ie),ye(Ie)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:s.getElementId("listbox")},isLoading:P,maxHeight:Ae,focusedOption:w}),oe)}))});return ne||Q==="fixed"?m.createElement(d,Zs({},v,{appendTo:ne,controlElement:this.controlRef,menuPlacement:z,menuPosition:Q}),ae):ae}},{key:"renderFormField",value:function(){var s=this,a=this.props,o=a.delimiter,l=a.isDisabled,c=a.isMulti,u=a.name,d=a.required,f=this.state.selectValue;if(d&&!this.hasValue()&&!l)return m.createElement(jlt,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(c)if(o){var x=f.map(function(w){return s.getOptionValue(w)}).join(o);return m.createElement("input",{name:u,type:"hidden",value:x})}else{var g=f.length>0?f.map(function(w,C){return m.createElement("input",{key:"i-".concat(C),name:u,type:"hidden",value:s.getOptionValue(w)})}):m.createElement("input",{name:u,type:"hidden",value:""});return m.createElement("div",null,g)}else{var v=f[0]?this.getOptionValue(f[0]):"";return m.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var s=this.commonProps,a=this.state,o=a.ariaSelection,l=a.focusedOption,c=a.focusedValue,u=a.isFocused,d=a.selectValue,f=this.getFocusableOptions();return m.createElement(dlt,Zs({},s,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:l,focusedValue:c,isFocused:u,selectValue:d,focusableOptions:f,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var s=this.getComponents(),a=s.Control,o=s.IndicatorsContainer,l=s.SelectContainer,c=s.ValueContainer,u=this.props,d=u.className,f=u.id,x=u.isDisabled,g=u.menuIsOpen,v=this.state.isFocused,w=this.commonProps=this.getCommonProps();return m.createElement(l,Zs({},w,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:x,isFocused:v}),this.renderLiveRegion(),m.createElement(a,Zs({},w,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:x,isFocused:v,menuIsOpen:g}),m.createElement(c,Zs({},w,{isDisabled:x}),this.renderPlaceholderOrValue(),this.renderInput()),m.createElement(o,Zs({},w,{isDisabled:x}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(s,a){var o=a.prevProps,l=a.clearFocusValueOnUpdate,c=a.inputIsHiddenAfterUpdate,u=a.ariaSelection,d=a.isFocused,f=a.prevWasFocused,x=a.instancePrefix,g=s.options,v=s.value,w=s.menuIsOpen,C=s.inputValue,N=s.isMulti,I=Ohe(v),P={};if(o&&(v!==o.value||g!==o.options||w!==o.menuIsOpen||C!==o.inputValue)){var R=w?zlt(s,I):[],F=w?Yhe(OF(s,I),"".concat(x,"-option")):[],U=l?Hlt(a,I):null,L=Vlt(a,R),z=Wz(F,L);P={selectValue:I,focusedOption:L,focusedOptionId:z,focusableOptionsWithIds:F,focusedValue:U,clearFocusValueOnUpdate:!1}}var Q=c!=null&&s!==o?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},ne=u,J=d&&f;return d&&!J&&(ne={value:II(N,I,I[0]||null),options:I,action:"initial-input-focus"},J=!f),(u==null?void 0:u.action)==="initial-input-focus"&&(ne=null),Ws(Ws(Ws({},P),Q),{},{prevProps:s,ariaSelection:ne,prevWasFocused:J})}}]),n}(m.Component);wje.defaultProps=Ult;var qlt=m.forwardRef(function(e,t){var n=fit(e);return m.createElement(wje,Zs({ref:t},n))}),Cl=qlt;function su(e){if(!e)return"--/--/--";const t=new Date(e),n=t.toLocaleString("en-US",{month:"short"}),r=t.getDate(),s=t.getFullYear(),a=String(t.getHours()%12||12).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");String(t.getSeconds()).padStart(2,"0");const l=t.getHours()>=12?" PM":" AM";return`${n} ${r}, ${s}, ${a}:${o} ${l}`}function h3(e){const t=new Date(e),n=t.toLocaleString("en-US",{month:"short"}),r=t.getDate(),s=t.getFullYear();return String(t.getHours()%12||12).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),String(t.getSeconds()).padStart(2,"0"),t.getHours()>=12,`${n} ${r}, ${s}`}function Oo(e){const t=new Date(e),r=Math.floor((new Date().getTime()-t.getTime())/1e3),s=Math.floor(r/60),a=Math.floor(r/3600),o=Math.floor(r/86400),l=Math.floor(r/31536e3),c=s%60,u=a%24,d=o%365;return{dateTime:r<60?`${r} seconds ago`:r<3600?`${s} minutes ago`:r<86400?c>0?`${a} hours ${c} minutes ago`:`${a} hours ago`:r<31536e3?u>0?`${o} days ${u} hours ago`:`${o} days ago`:d>0?`${l} years ${d} days ago`:`${l} years ago`}}function Glt(e){const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");String(t.getSeconds()).padStart(2,"0");const l=t.getHours()>=12?" PM":" AM";return`${n}/${r}/${s} ${a}:${o} ${l}`}function PI(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear();return String(t.getHours()).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),String(t.getSeconds()).padStart(2,"0"),`${n}/${r}/${s}`}function Klt(e){const t=new Date(e),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear();return String(t.getHours()).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),`${n}/${r}/${s}`}function Is(e){if(e==null||isNaN(e))return"-";const t=e.toString();if(t.includes(".")){const n=t.split(".")[0];return new Intl.NumberFormat("en-US").format(parseInt(n))}return new Intl.NumberFormat("en-US").format(parseInt(e))}function Ylt(e){try{var t=e.split(".")[1],n=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(n).split("").map(function(s){return"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}catch{return JSON.parse(!1)}}function Cr(e){if(e==null||isNaN(e))return"--";const t=parseFloat(e),n=Math.floor(t)===0;let r=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n?4:2,useGrouping:!0});if(r.includes(".")){const[s,a]=r.split("."),o=a.replace(/0+$/,"");r=o?`${s}.${o}`:s}return r}function Xlt(e){if(e==null||isNaN(e))return"--";const t=parseFloat(e),n=Math.floor(t)===0,r=t>=1e3;let s=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:r?0:n?4:2,useGrouping:!0});if(!r&&s.includes(".")){const[a,o]=s.split("."),l=o.replace(/0+$/,"");s=l?`${a}.${l}`:a}return s}function ao(e){if(e==null||isNaN(e)||e===0)return"--";const t=parseFloat(e),n=t>=1e3;let r=t.toLocaleString("en-US",{minimumFractionDigits:n?2:0,maximumFractionDigits:n?2:4,useGrouping:!0});if(r.includes(".")){const[s,a]=r.split(".");r=`${s}.${a.replace(/0+$/,"")}`}return r.replace(/\.$/,"")}function fy(e){if(e==null||isNaN(e)||e===0)return"--";const t=parseFloat(e),n=t%1!==0;return t.toLocaleString("en-US",{minimumFractionDigits:n?4:0,maximumFractionDigits:4,useGrouping:!0})}function Cv(e){if(e==null||isNaN(e)||e===0)return"--";const t=parseFloat(e),n=t>=1e3;let r=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n?2:4,useGrouping:!0});if(r.includes(".")){const[s,a]=r.split(".");r=`${s}.${a.slice(0,2)}`}return r.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")}const GD=e=>e?`${e.slice(0,4)}..${e.slice(-4)}`:"-";function ed(e){const t=parseFloat(e);return isNaN(t)?"0.00":t>=1e9?(t/1e9).toFixed(2).replace(/\.00$/,"")+"B":t>=1e6?(t/1e6).toFixed(2).replace(/\.00$/,"")+"M":t>=1e3?(t/1e3).toFixed(2).replace(/\.00$/,"")+"K":t.toFixed(2).replace(/\.00$/,"")}function Vw(e){if(isNaN(e))return;const t=e.toString().replace(".",",");return Number(t.replace(",",".")).toLocaleString("en-US",{maximumFractionDigits:20})}const Cje="2.28.0";let p7={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Cje}`},Rr=class sZ extends Error{constructor(t,n={}){var l;const r=(()=>{var c;return n.cause instanceof sZ?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof sZ&&n.cause.docsPath||n.docsPath,a=(l=p7.getDocsUrl)==null?void 0:l.call(p7,{...n,docsPath:s}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...p7.version?[`Version: ${p7.version}`]:[]].join(`
`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Cje}walk(t){return Sje(this,t)}};function Sje(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Sje(e.cause,t):t?null:e}let Nje=class extends Rr{constructor({max:t,min:n,signed:r,size:s,value:a}){super(`Number "${a}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}};class Qlt extends Rr{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class Zlt extends Rr{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let Jlt=class extends Rr{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}},Aje=class extends Rr{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},jje=class extends Rr{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class Qhe extends Rr{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function fA(e,{dir:t,size:n=32}={}){return typeof e=="string"?wy(e,{dir:t,size:n}):ect(e,{dir:t,size:n})}function wy(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new jje({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function ect(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new jje({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const a=t==="right";r[a?s:n-s-1]=e[a?s:e.length-s-1]}return r}function Y0(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function rl(e){return Y0(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Hf(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}const tct=new TextEncoder;function hA(e,t={}){return typeof e=="number"||typeof e=="bigint"?rct(e,t):typeof e=="boolean"?nct(e,t):Y0(e)?sp(e,t):Ww(e,t)}function nct(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(hp(n,{size:t.size}),fA(n,{size:t.size})):n}const Dx={zero:48,nine:57,A:65,F:70,a:97,f:102};function Zhe(e){if(e>=Dx.zero&&e<=Dx.nine)return e-Dx.zero;if(e>=Dx.A&&e<=Dx.F)return e-(Dx.A-10);if(e>=Dx.a&&e<=Dx.f)return e-(Dx.a-10)}function sp(e,t={}){let n=e;t.size&&(hp(n,{size:t.size}),n=fA(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,a=new Uint8Array(s);for(let o=0,l=0;o<s;o++){const c=Zhe(r.charCodeAt(l++)),u=Zhe(r.charCodeAt(l++));if(c===void 0||u===void 0)throw new Rr(`Invalid byte sequence ("${r[l-2]}${r[l-1]}" in "${r}").`);a[o]=c*16+u}return a}function rct(e,t){const n=Ds(e,t);return sp(n)}function Ww(e,t={}){const n=tct.encode(e);return typeof t.size=="number"?(hp(n,{size:t.size}),fA(n,{dir:"right",size:t.size})):n}function hp(e,{size:t}){if(rl(e)>t)throw new Jlt({givenSize:rl(e),maxSize:t})}function nd(e,t={}){const{signed:n}=t;t.size&&hp(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,a=(1n<<BigInt(s)*8n-1n)-1n;return r<=a?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function sct(e,t={}){let n=e;if(t.size&&(hp(n,{size:t.size}),n=Hf(n)),Hf(n)==="0x00")return!1;if(Hf(n)==="0x01")return!0;throw new Zlt(n)}function X0(e,t={}){return Number(nd(e,t))}function ict(e,t={}){let n=sp(e);return t.size&&(hp(n,{size:t.size}),n=Hf(n,{dir:"right"})),new TextDecoder().decode(n)}const act=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function oi(e,t={}){return typeof e=="number"||typeof e=="bigint"?Ds(e,t):typeof e=="string"?TS(e,t):typeof e=="boolean"?Eje(e,t):Wl(e,t)}function Eje(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(hp(n,{size:t.size}),fA(n,{size:t.size})):n}function Wl(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=act[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(hp(r,{size:t.size}),fA(r,{dir:"right",size:t.size})):r}function Ds(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let a;r?n?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&n?-a-1n:0;if(a&&s>a||s<o){const c=typeof e=="bigint"?"n":"";throw new Nje({max:a?`${a}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${e}${c}`})}const l=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?fA(l,{size:r}):l}const oct=new TextEncoder;function TS(e,t={}){const n=oct.encode(e);return Wl(n,t)}function mm(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new vct(e.type);return`${e.name}(${KD(e.inputs,{includeName:t})})`}function KD(e,{includeName:t=!1}={}){return e?e.map(n=>lct(n,{includeName:t})).join(t?", ":","):""}function lct(e,{includeName:t}){return e.type.startsWith("tuple")?`(${KD(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class cct extends Rr{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class Jhe extends Rr{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class _je extends Rr{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${KD(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class Nk extends Rr{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class uct extends Rr{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class dct extends Rr{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${rl(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class fct extends Rr{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
`),{name:"AbiEncodingLengthMismatchError"})}}class hct extends Rr{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class epe extends Rr{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class kje extends Rr{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class pct extends Rr{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class Tje extends Rr{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class tpe extends Rr{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
`),{docsPath:n,name:"AbiEventNotFoundError"})}}class IS extends Rr{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class Ije extends Rr{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class mct extends Rr{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class xct extends Rr{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${mm(t.abiItem)}\`, and`,`\`${n.type}\` in \`${mm(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let gct=class extends Rr{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class F9 extends Rr{constructor({abiItem:t,data:n,params:r,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(`
`),{metaMessages:[`Params: (${KD(r,{includeName:!0})})`,`Data: ${n} (${s} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=s}}class YD extends Rr{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${mm(t,{includeName:!0})}".`].join(`
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class bct extends Rr{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class yct extends Rr{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let Pje=class extends Rr{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
`),{name:"InvalidArrayError"})}};class vct extends Rr{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`),{name:"InvalidDefinitionTypeError"})}}function r1(e){return typeof e[0]=="string"?Cm(e):wct(e)}function wct(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Cm(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}let pd=class extends Rr{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},XD=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};function nM(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Cct(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ak(e,...t){if(!Cct(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Sct(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");nM(e.outputLen),nM(e.blockLen)}function PS(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Fje(e,t){Ak(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const FI=BigInt(2**32-1),npe=BigInt(32);function Nct(e,t=!1){return t?{h:Number(e&FI),l:Number(e>>npe&FI)}:{h:Number(e>>npe&FI)|0,l:Number(e&FI)|0}}function Act(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=Nct(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const jct=(e,t,n)=>e<<n|t>>>32-n,Ect=(e,t,n)=>t<<n|e>>>32-n,_ct=(e,t,n)=>t<<n-32|e>>>64-n,kct=(e,t,n)=>e<<n-32|t>>>64-n,R6=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Tct(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function qz(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function qm(e,t){return e<<32-t|e>>>t}const rpe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ict(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function spe(e){for(let t=0;t<e.length;t++)e[t]=Ict(e[t])}typeof Uint8Array.from([]).toHex=="function"&&Uint8Array.fromHex;function Pct(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function QD(e){return typeof e=="string"&&(e=Pct(e)),Ak(e),e}function Fct(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Ak(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}let Kse=class{clone(){return this._cloneInto()}};function Oje(e){const t=r=>e().update(QD(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Oct(e=32){if(R6&&typeof R6.getRandomValues=="function")return R6.getRandomValues(new Uint8Array(e));if(R6&&typeof R6.randomBytes=="function")return Uint8Array.from(R6.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const Mje=[],Rje=[],Lje=[],Mct=BigInt(0),m7=BigInt(1),Rct=BigInt(2),Lct=BigInt(7),Dct=BigInt(256),Bct=BigInt(113);for(let e=0,t=m7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Mje.push(2*(5*r+n)),Rje.push((e+1)*(e+2)/2%64);let s=Mct;for(let a=0;a<7;a++)t=(t<<m7^(t>>Lct)*Bct)%Dct,t&Rct&&(s^=m7<<(m7<<BigInt(a))-m7);Lje.push(s)}const[$ct,Uct]=Act(Lje,!0),ipe=(e,t,n)=>n>32?_ct(e,t,n):jct(e,t,n),ape=(e,t,n)=>n>32?kct(e,t,n):Ect(e,t,n);function zct(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=ipe(u,d,1)^n[l],x=ape(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=Rje[o],c=ipe(s,a,l),u=ape(s,a,l),d=Mje[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=$ct[r],e[1]^=Uct[r]}n.fill(0)}let Hct=class Dje extends Kse{constructor(t,n,r,s=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,nM(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Tct(this.state)}keccak(){rpe||spe(this.state32),zct(this.state32,this.rounds),rpe||spe(this.state32),this.posOut=0,this.pos=0}update(t){PS(this);const{blockLen:n,state:r}=this;t=QD(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){PS(this,!1),Ak(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return nM(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Fje(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new Dje(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const Vct=(e,t,n)=>Oje(()=>new Hct(t,e,n)),Wct=Vct(1,136,256/8);function eu(e,t){const n=t||"hex",r=Wct(Y0(e,{strict:!1})?hA(e):e);return n==="bytes"?r:oi(r)}const Gz=new XD(8192);function ZD(e,t){if(Gz.has(`${e}.${t}`))return Gz.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=eu(Ww(n),"bytes"),s=(t?n.substring(`${t}0x`.length):n).split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(r[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const a=`0x${s.join("")}`;return Gz.set(`${e}.${t}`,a),a}function Ac(e,t){if(!ic(e,{strict:!1}))throw new pd({address:e});return ZD(e,t)}const qct=/^0x[a-fA-F0-9]{40}$/,Kz=new XD(8192);function ic(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Kz.has(r))return Kz.get(r);const s=qct.test(e)?e.toLowerCase()===e?!0:n?ZD(e)===e:!0:!1;return Kz.set(r,s),s}function p3(e,t,n,{strict:r}={}){return Y0(e,{strict:!1})?zje(e,t,n,{strict:r}):Uje(e,t,n,{strict:r})}function Bje(e,t){if(typeof t=="number"&&t>0&&t>rl(e)-1)throw new Aje({offset:t,position:"start",size:rl(e)})}function $je(e,t,n){if(typeof t=="number"&&typeof n=="number"&&rl(e)!==n-t)throw new Aje({offset:n,position:"end",size:rl(e)})}function Uje(e,t,n,{strict:r}={}){Bje(e,t);const s=e.slice(t,n);return r&&$je(s,t,n),s}function zje(e,t,n,{strict:r}={}){Bje(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&$je(s,t,n),s}const Gct=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Hje=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function s2(e,t){if(e.length!==t.length)throw new fct({expectedLength:e.length,givenLength:t.length});const n=Kct({params:e,values:t}),r=Xse(n);return r.length===0?"0x":r}function Kct({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Yse({param:e[r],value:t[r]}));return n}function Yse({param:e,value:t}){const n=Qse(e.type);if(n){const[r,s]=n;return Xct(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return tut(t,{param:e});if(e.type==="address")return Yct(t);if(e.type==="bool")return Zct(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,s="256"]=Hje.exec(e.type)??[];return Jct(t,{signed:r,size:Number(s)})}if(e.type.startsWith("bytes"))return Qct(t,{param:e});if(e.type==="string")return eut(t);throw new bct(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Xse(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?t+=32:t+=rl(l)}const n=[],r=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?(n.push(Ds(t+s,{size:32})),r.push(l),s+=rl(l)):n.push(l)}return r1([...n,...r])}function Yct(e){if(!ic(e))throw new pd({address:e});return{dynamic:!1,encoded:wy(e.toLowerCase())}}function Xct(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Pje(e);if(!r&&e.length!==t)throw new uct({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const a=[];for(let o=0;o<e.length;o++){const l=Yse({param:n,value:e[o]});l.dynamic&&(s=!0),a.push(l)}if(r||s){const o=Xse(a);if(r){const l=Ds(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?r1([l,o]):l}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:r1(a.map(({encoded:o})=>o))}}function Qct(e,{param:t}){const[,n]=t.type.split("bytes"),r=rl(e);if(!n){let s=e;return r%32!==0&&(s=wy(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:r1([wy(Ds(r,{size:32})),s])}}if(r!==Number.parseInt(n))throw new dct({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:wy(e,{dir:"right"})}}function Zct(e){if(typeof e!="boolean")throw new Rr(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:wy(Eje(e))}}function Jct(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new Nje({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Ds(e,{size:32,signed:t})}}function eut(e){const t=TS(e),n=Math.ceil(rl(t)/32),r=[];for(let s=0;s<n;s++)r.push(wy(p3(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:r1([wy(Ds(rl(t),{size:32})),...r])}}function tut(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const a=t.components[s],o=Array.isArray(e)?s:a.name,l=Yse({param:a,value:e[o]});r.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Xse(r):r1(r.map(({encoded:s})=>s))}}function Qse(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Yz="/docs/contract/encodeDeployData";function Zse(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(o=>"type"in o&&o.type==="constructor");if(!s)throw new cct({docsPath:Yz});if(!("inputs"in s))throw new Jhe({docsPath:Yz});if(!s.inputs||s.inputs.length===0)throw new Jhe({docsPath:Yz});const a=s2(s.inputs,n);return Cm([r,a])}function Du(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class JD extends Rr{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
`),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class Xz extends Rr{constructor({docsPath:t,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}function nut(e){const t=eu(`0x${e.substring(4)}`).substring(26);return ZD(`0x${t}`)}const rut="modulepreload",sut=function(e){return"/"+e},ope={},ss=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=sut(c),c in ope)return;ope[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":rut,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((x,g)=>{f.addEventListener("load",x),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};async function iut({hash:e,signature:t}){const n=Y0(e)?e:oi(e),{secp256k1:r}=await ss(async()=>{const{secp256k1:o}=await Promise.resolve().then(()=>Umt);return{secp256k1:o}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:d,v:f,yParity:x}=t,g=Number(x??f),v=lpe(g);return new r.Signature(nd(u),nd(d)).addRecoveryBit(v)}const o=Y0(t)?t:oi(t),l=X0(`0x${o.slice(130)}`),c=lpe(l);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function lpe(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function Vje({hash:e,signature:t}){return nut(await iut({hash:e,signature:t}))}class cpe extends Rr{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class Wje extends Rr{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class aut extends Rr{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const out={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new aut({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Wje({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new cpe({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new cpe({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Jse(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(out);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function By(e,t="hex"){const n=qje(e),r=Jse(new Uint8Array(n.length));return n.encode(r),t==="hex"?Wl(r.bytes):r.bytes}function qje(e){return Array.isArray(e)?lut(e.map(t=>qje(t))):cut(e)}function lut(e){const t=e.reduce((s,a)=>s+a.length,0),n=Gje(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function cut(e){const t=typeof e=="string"?sp(e):e,n=Gje(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Gje(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new Rr("Length is too large.")}function uut(e){const{chainId:t,nonce:n,to:r}=e,s=e.contractAddress??e.address,a=eu(Cm(["0x05",By([t?Ds(t):"0x",s,n?Ds(n):"0x"])]));return r==="bytes"?sp(a):a}async function Kje(e){const{authorization:t,signature:n}=e;return Vje({hash:uut(t),signature:n??t})}class iZ extends Rr{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}let dut=class extends Rr{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}};class fut extends Rr{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
`),{name:"ChainNotFoundError"})}}class Yje extends Rr{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class eB extends Rr{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}function hut({chain:e,currentChainId:t}){if(!e)throw new fut;if(t!==e.id)throw new dut({chain:e,currentChainId:t})}const put={gwei:9,wei:18},mut={ether:-9,wei:9},xut={ether:-18,gwei:-9};function jk(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,a]=[n.slice(0,n.length-t),n.slice(n.length-t)];return a=a.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${a?`.${a}`:""}`}function ef(e,t="wei"){return jk(e,mut[t])}class PC extends Rr{constructor({cause:t,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(PC,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(PC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class m3 extends Rr{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${ef(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(m3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class aZ extends Rr{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${ef(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(aZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class oZ extends Rr{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(oZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class lZ extends Rr{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(lZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class cZ extends Rr{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(cZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class uZ extends Rr{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(uZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class dZ extends Rr{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(dZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class fZ extends Rr{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(fZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class hZ extends Rr{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(hZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class O9 extends Rr{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${ef(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${ef(r)} gwei`:""}).`].join(`
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(O9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Ek extends Rr{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function eie(e,t="wei"){return jk(e,put[t])}function _k(e){const t=Object.entries(e).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=t.reduce((r,[s])=>Math.max(r,s.length),0);return t.map(([r,s])=>` ${`${r}:`.padEnd(n+1)} ${s}`).join(`
`)}class gut extends Rr{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
`),{name:"FeeConflictError"})}}class but extends Rr{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class yut extends Rr{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",_k(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class vut extends Rr{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class wut extends Rr{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:d,to:f,value:x}){var v;const g=_k({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.address,to:f,value:typeof x<"u"&&`${eie(x)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${ef(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${ef(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${ef(u)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",g].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Xje extends Rr{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:s,index:a}){let o="Transaction";r&&a!==void 0&&(o=`Transaction at block time "${r}" at index "${a}"`),t&&a!==void 0&&(o=`Transaction at block hash "${t}" at index "${a}"`),n&&a!==void 0&&(o=`Transaction at block number "${n}" at index "${a}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class Qje extends Rr{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class Cut extends Rr{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const Tc=(e,t,n)=>JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString():s,n),Sut=e=>e,tie=e=>e;class zj extends Rr{constructor({body:t,cause:n,details:r,headers:s,status:a,url:o}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[a&&`Status: ${a}`,`URL: ${tie(o)}`,t&&`Request body: ${Tc(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=s,this.status=a,this.url=o}}class nie extends Rr{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${tie(r)}`,`Request body: ${Tc(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data}}class upe extends Rr{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${tie(n)}`,`Request body: ${Tc(t)}`],name:"TimeoutError"})}}const Nut=-1;let uf=class extends Rr{constructor(t,{code:n,docsPath:r,metaMessages:s,name:a,shortMessage:o}){super(o,{cause:t,docsPath:r,metaMessages:s||(t==null?void 0:t.metaMessages),name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||t.name,this.code=t instanceof nie?t.code:n??Nut}};class Qf extends uf{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class M9 extends uf{constructor(t){super(t,{code:M9.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(M9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class R9 extends uf{constructor(t){super(t,{code:R9.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(R9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class L9 extends uf{constructor(t,{method:n}={}){super(t,{code:L9.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(L9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class D9 extends uf{constructor(t){super(t,{code:D9.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(D9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class x3 extends uf{constructor(t){super(t,{code:x3.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(x3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class g3 extends uf{constructor(t){super(t,{code:g3.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(g3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class B9 extends uf{constructor(t){super(t,{code:B9.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(B9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Cy extends uf{constructor(t){super(t,{code:Cy.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Cy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class $9 extends uf{constructor(t){super(t,{code:$9.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty($9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Vv extends uf{constructor(t,{method:n}={}){super(t,{code:Vv.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Vv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class FS extends uf{constructor(t){super(t,{code:FS.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(FS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class U9 extends uf{constructor(t){super(t,{code:U9.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(U9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class bo extends Qf{constructor(t){super(t,{code:bo.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(bo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class z9 extends Qf{constructor(t){super(t,{code:z9.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(z9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class H9 extends Qf{constructor(t,{method:n}={}){super(t,{code:H9.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(H9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class V9 extends Qf{constructor(t){super(t,{code:V9.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(V9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class W9 extends Qf{constructor(t){super(t,{code:W9.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(W9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ip extends Qf{constructor(t){super(t,{code:ip.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(ip,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class q9 extends Qf{constructor(t){super(t,{code:q9.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(q9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class G9 extends Qf{constructor(t){super(t,{code:G9.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(G9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class K9 extends Qf{constructor(t){super(t,{code:K9.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(K9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class Y9 extends Qf{constructor(t){super(t,{code:Y9.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(Y9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class X9 extends Qf{constructor(t){super(t,{code:X9.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(X9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Q9 extends Qf{constructor(t){super(t,{code:Q9.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Q9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Z9 extends Qf{constructor(t){super(t,{code:Z9.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Z9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Aut extends uf{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function tB(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof Rr?e.walk(s=>(s==null?void 0:s.code)===PC.code):e;return r instanceof Rr?new PC({cause:e,message:r.details}):PC.nodeMessage.test(n)?new PC({cause:e,message:e.details}):m3.nodeMessage.test(n)?new m3({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):aZ.nodeMessage.test(n)?new aZ({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):oZ.nodeMessage.test(n)?new oZ({cause:e,nonce:t==null?void 0:t.nonce}):lZ.nodeMessage.test(n)?new lZ({cause:e,nonce:t==null?void 0:t.nonce}):cZ.nodeMessage.test(n)?new cZ({cause:e,nonce:t==null?void 0:t.nonce}):uZ.nodeMessage.test(n)?new uZ({cause:e}):dZ.nodeMessage.test(n)?new dZ({cause:e,gas:t==null?void 0:t.gas}):fZ.nodeMessage.test(n)?new fZ({cause:e,gas:t==null?void 0:t.gas}):hZ.nodeMessage.test(n)?new hZ({cause:e}):O9.nodeMessage.test(n)?new O9({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Ek({cause:e})}function jut(e,{docsPath:t,...n}){const r=(()=>{const s=tB(e,n);return s instanceof Ek?e:s})();return new wut(r,{docsPath:t,...n})}function nB(e,{format:t}){if(!t)return{};const n={};function r(a){const o=Object.keys(a);for(const l of o)l in e&&(n[l]=e[l]),a[l]&&typeof a[l]=="object"&&!Array.isArray(a[l])&&r(a[l])}const s=t(e||{});return r(s),n}function rie(e,t){return({exclude:n,format:r})=>({exclude:n,format:s=>{const a=t(s);if(n)for(const o of n)delete a[o];return{...a,...r(s)}},type:e})}const Eut={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function kk(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=_ut(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>Wl(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=Ds(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=Ds(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=Ds(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=Ds(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=Ds(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=Ds(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Eut[e.type]),typeof e.value<"u"&&(t.value=Ds(e.value)),t}function _ut(e){return e.map(t=>({address:t.address,r:t.r?Ds(BigInt(t.r)):t.r,s:t.s?Ds(BigInt(t.s)):t.s,chainId:Ds(t.chainId),nonce:Ds(t.nonce),...typeof t.yParity<"u"?{yParity:Ds(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:Ds(t.v)}:{}}))}function ti(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:a=>t(e,a)}const rB=2n**256n-1n;function pA(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:a}=e,o=t?Du(t):void 0;if(o&&!ic(o.address))throw new pd({address:o.address});if(a&&!ic(a))throw new pd({address:a});if(typeof n<"u"&&(typeof r<"u"||typeof s<"u"))throw new gut;if(r&&r>rB)throw new m3({maxFeePerGas:r});if(s&&r&&s>r)throw new O9({maxFeePerGas:r,maxPriorityFeePerGas:s})}async function sie(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return X0(t)}class kut extends Rr{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class iie extends Rr{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Tut extends Rr{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${ef(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Zje extends Rr{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const Jje={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function sB(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?X0(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?X0(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Jje[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(t.authorizationList=Put(e.authorizationList)),t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}const Iut=rie("transaction",sB);function Put(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function aie(e){const t=(e.transactions??[]).map(n=>typeof n=="string"?n:sB(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Fut=rie("block",aie);async function j0(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){var d,f,x;const a=r??"latest",o=s??!1,l=n!==void 0?Ds(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,o]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[l||a,o]},{dedupe:!!l}),!c)throw new Zje({blockHash:t,blockNumber:n});return(((x=(f=(d=e.chain)==null?void 0:d.formatters)==null?void 0:f.block)==null?void 0:x.format)||aie)(c)}async function oie(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Out(e,t){return e9e(e,t)}async function e9e(e,t){var a,o;const{block:n,chain:r=e.chain,request:s}=t||{};try{const l=((a=r==null?void 0:r.fees)==null?void 0:a.maxPriorityFeePerGas)??((o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee);if(typeof l=="function"){const u=n||await ti(e,j0,"getBlock")({}),d=await l({block:u,client:e,request:s});if(d===null)throw new Error;return d}if(typeof l<"u")return l;const c=await e.request({method:"eth_maxPriorityFeePerGas"});return nd(c)}catch{const[l,c]=await Promise.all([n?Promise.resolve(n):ti(e,j0,"getBlock")({}),ti(e,oie,"getGasPrice")({})]);if(typeof l.baseFeePerGas!="bigint")throw new iie;const u=c-l.baseFeePerGas;return u<0n?0n:u}}async function Mut(e,t){return pZ(e,t)}async function pZ(e,t){var x,g;const{block:n,chain:r=e.chain,request:s,type:a="eip1559"}=t||{},o=await(async()=>{var v,w;return typeof((v=r==null?void 0:r.fees)==null?void 0:v.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):((w=r==null?void 0:r.fees)==null?void 0:w.baseFeeMultiplier)??1.2})();if(o<1)throw new kut;const c=10**(((x=o.toString().split(".")[1])==null?void 0:x.length)??0),u=v=>v*BigInt(Math.ceil(o*c))/BigInt(c),d=n||await ti(e,j0,"getBlock")({});if(typeof((g=r==null?void 0:r.fees)==null?void 0:g.estimateFeesPerGas)=="function"){const v=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:a});if(v!==null)return v}if(a==="eip1559"){if(typeof d.baseFeePerGas!="bigint")throw new iie;const v=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await e9e(e,{block:d,chain:r,request:s}),w=u(d.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??w+v,maxPriorityFeePerGas:v}}return{gasPrice:(s==null?void 0:s.gasPrice)??u(await ti(e,oie,"getGasPrice")({}))}}class Rut extends Rr{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:d,to:f,value:x}){var v;const g=_k({from:n==null?void 0:n.address,to:f,value:typeof x<"u"&&`${eie(x)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${ef(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${ef(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${ef(u)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",g].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function Lut(e,{docsPath:t,...n}){const r=(()=>{const s=tB(e,n);return s instanceof Ek?e:s})();return new Rut(r,{docsPath:t,...n})}class Dut extends Rr{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class But extends Rr{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function dpe(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
`,"")}function $ut(e){return e.reduce((t,{address:n,...r})=>{let s=`${t} ${n}:
`;return r.nonce&&(s+=` nonce: ${r.nonce}
`),r.balance&&(s+=` balance: ${r.balance}
`),r.code&&(s+=` code: ${r.code}
`),r.state&&(s+=` state:
`,s+=dpe(r.state)),r.stateDiff&&(s+=` stateDiff:
`,s+=dpe(r.stateDiff)),s},` State Override:
`).slice(0,-1)}function fpe(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Qhe({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Qhe({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Uut(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:a}=e,o={};if(a!==void 0&&(o.code=a),t!==void 0&&(o.balance=Ds(t)),n!==void 0&&(o.nonce=Ds(n)),r!==void 0&&(o.state=fpe(r)),s!==void 0){if(o.state)throw new But;o.stateDiff=fpe(s)}return o}function lie(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ic(n,{strict:!1}))throw new pd({address:n});if(t[n])throw new Dut({address:n});t[n]=Uut(r)}return t}async function cie(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?Ds(n):void 0,a=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(a)}async function uie(e,t){var s,a,o;const{account:n=e.account}=t,r=n?Du(n):void 0;try{let pe=function(ie){const{block:oe,request:G,rpcStateOverride:V}=ie;return e.request({method:"eth_estimateGas",params:V?[G,oe??"latest",V]:oe?[G,oe]:[G]})};const{accessList:l,authorizationList:c,blobs:u,blobVersionedHashes:d,blockNumber:f,blockTag:x,data:g,gas:v,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:N,maxPriorityFeePerGas:I,nonce:P,value:R,stateOverride:F,...U}=await pie(e,{...t,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),z=(f?Ds(f):void 0)||x,Q=lie(F),ne=await(async()=>{if(U.to)return U.to;if(c&&c.length>0)return await Kje({authorization:c[0]}).catch(()=>{throw new Rr("`to` is required. Could not infer from `authorizationList`")})})();pA(t);const J=(o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionRequest)==null?void 0:o.format,re=(J||kk)({...nB(U,{format:J}),from:r==null?void 0:r.address,accessList:l,authorizationList:c,blobs:u,blobVersionedHashes:d,data:g,gas:v,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:N,maxPriorityFeePerGas:I,nonce:P,to:ne,value:R});let Y=BigInt(await pe({block:z,request:re,rpcStateOverride:Q}));if(c){const ie=await cie(e,{address:re.from}),oe=await Promise.all(c.map(async G=>{const{address:V}=G,te=await pe({block:z,request:{authorizationList:void 0,data:g,from:r==null?void 0:r.address,to:V,value:Ds(ie)},rpcStateOverride:Q}).catch(()=>100000n);return 2n*BigInt(te)}));Y+=oe.reduce((G,V)=>G+V,0n)}return Y}catch(l){throw Lut(l,{...t,account:r,chain:e.chain})}}async function t9e(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,r?Ds(r):n]},{dedupe:!!r});return X0(s)}function die(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(a=>sp(a)):e.blobs,s=[];for(const a of r)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?s:s.map(a=>Wl(a))}function fie(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>sp(o)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(o=>sp(o)):e.commitments,a=[];for(let o=0;o<r.length;o++){const l=r[o],c=s[o];a.push(Uint8Array.from(t.computeBlobKzgProof(l,c)))}return n==="bytes"?a:a.map(o=>Wl(o))}function zut(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),l=Number(n&a),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,l,r)}function Hut(e,t,n){return e&t^~e&n}function Vut(e,t,n){return e&t^e&n^t&n}let Wut=class extends Kse{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=qz(this.buffer)}update(t){PS(this);const{view:n,buffer:r,blockLen:s}=this;t=QD(t);const a=t.length;for(let o=0;o<a;){const l=Math.min(s-this.pos,a-o);if(l===s){const c=qz(t);for(;s<=a-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){PS(this),Fje(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;zut(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=qz(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,d[f],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:l}=this;return t.length=s,t.pos=l,t.finished=a,t.destroyed=o,s%n&&t.buffer.set(r),t}};const qut=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]),ib=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ab=new Uint32Array(64);let Gut=class extends Wut{constructor(t=32){super(64,t,8,!1),this.A=ib[0]|0,this.B=ib[1]|0,this.C=ib[2]|0,this.D=ib[3]|0,this.E=ib[4]|0,this.F=ib[5]|0,this.G=ib[6]|0,this.H=ib[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:o,G:l,H:c}=this;return[t,n,r,s,a,o,l,c]}set(t,n,r,s,a,o,l,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=l|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)ab[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=ab[f-15],g=ab[f-2],v=qm(x,7)^qm(x,18)^x>>>3,w=qm(g,17)^qm(g,19)^g>>>10;ab[f]=w+ab[f-7]+v+ab[f-16]|0}let{A:r,B:s,C:a,D:o,E:l,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const x=qm(l,6)^qm(l,11)^qm(l,25),g=d+x+Hut(l,c,u)+qut[f]+ab[f]|0,w=(qm(r,2)^qm(r,13)^qm(r,22))+Vut(r,s,a)|0;d=u,u=c,c=l,l=o+g|0,o=a,a=s,s=r,r=g+w|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,a,o,l,c,u,d)}roundClean(){ab.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const n9e=Oje(()=>new Gut);function Kut(e,t){return n9e(Y0(e,{strict:!1})?hA(e):e)}function Yut(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=Kut(t);return s.set([n],0),r==="bytes"?s:Wl(s)}function r9e(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(Yut({commitment:a,to:r,version:n}));return s}const hpe=6,s9e=32,hie=4096,i9e=s9e*hie,ppe=i9e*hpe-1-1*hie*hpe,a9e=1;class Xut extends Rr{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class o9e extends Rr{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Qut extends Rr{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class Zut extends Rr{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${a9e}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function Jut(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?sp(e.data):e.data,r=rl(n);if(!r)throw new o9e;if(r>ppe)throw new Xut({maxSize:ppe,size:r});const s=[];let a=!0,o=0;for(;a;){const l=Jse(new Uint8Array(i9e));let c=0;for(;c<hie;){const u=n.slice(o,o+(s9e-1));if(l.pushByte(0),l.pushBytes(u),u.length<31){l.pushByte(128),a=!1;break}c++,o+=31}s.push(l)}return t==="bytes"?s.map(l=>l.bytes):s.map(l=>Wl(l.bytes))}function l9e(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??Jut({data:t,to:r}),a=e.commitments??die({blobs:s,kzg:n,to:r}),o=e.proofs??fie({blobs:s,commitments:a,kzg:n,to:r}),l=[];for(let c=0;c<s.length;c++)l.push({blob:s[c],commitment:a[c],proof:o[c]});return l}function c9e(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new yut({transaction:e})}const u9e=["blobVersionedHashes","chainId","fees","gas","nonce","type"],mpe=new Map;async function pie(e,t){const{account:n=e.account,blobs:r,chain:s,gas:a,kzg:o,nonce:l,nonceManager:c,parameters:u=u9e,type:d}=t,f=n&&Du(n),x={...t,...f?{from:f==null?void 0:f.address}:{}};let g;async function v(){return g||(g=await ti(e,j0,"getBlock")({blockTag:"latest"}),g)}let w;async function C(){return w||(s?s.id:typeof t.chainId<"u"?t.chainId:(w=await ti(e,sie,"getChainId")({}),w))}if(u.includes("nonce")&&typeof l>"u"&&f)if(c){const N=await C();x.nonce=await c.consume({address:f.address,chainId:N,client:e})}else x.nonce=await ti(e,t9e,"getTransactionCount")({address:f.address,blockTag:"pending"});if((u.includes("blobVersionedHashes")||u.includes("sidecars"))&&r&&o){const N=die({blobs:r,kzg:o});if(u.includes("blobVersionedHashes")){const I=r9e({commitments:N,to:"hex"});x.blobVersionedHashes=I}if(u.includes("sidecars")){const I=fie({blobs:r,commitments:N,kzg:o}),P=l9e({blobs:r,commitments:N,proofs:I,to:"hex"});x.sidecars=P}}if(u.includes("chainId")&&(x.chainId=await C()),(u.includes("fees")||u.includes("type"))&&typeof d>"u")try{x.type=c9e(x)}catch{let N=mpe.get(e.uid);if(typeof N>"u"){const I=await v();N=typeof(I==null?void 0:I.baseFeePerGas)=="bigint",mpe.set(e.uid,N)}x.type=N?"eip1559":"legacy"}if(u.includes("fees"))if(x.type!=="legacy"&&x.type!=="eip2930"){if(typeof x.maxFeePerGas>"u"||typeof x.maxPriorityFeePerGas>"u"){const N=await v(),{maxFeePerGas:I,maxPriorityFeePerGas:P}=await pZ(e,{block:N,chain:s,request:x});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<P)throw new Tut({maxPriorityFeePerGas:P});x.maxPriorityFeePerGas=P,x.maxFeePerGas=I}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new iie;if(typeof t.gasPrice>"u"){const N=await v(),{gasPrice:I}=await pZ(e,{block:N,chain:s,request:x,type:"legacy"});x.gasPrice=I}}return u.includes("gas")&&typeof a>"u"&&(x.gas=await ti(e,uie,"estimateGas")({...x,account:f&&{address:f.address,type:"json-rpc"}})),pA(x),delete x.parameters,x}async function d9e(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const Qz=new XD(128);async function edt(e,t){var N,I,P,R;const{account:n=e.account,chain:r=e.chain,accessList:s,authorizationList:a,blobs:o,data:l,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:x,nonce:g,value:v,...w}=t;if(typeof n>"u")throw new JD({docsPath:"/docs/actions/wallet/sendTransaction"});const C=n?Du(n):null;try{pA(t);const F=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await Kje({authorization:a[0]}).catch(()=>{throw new Rr("`to` is required. Could not infer from `authorizationList`.")})})();if((C==null?void 0:C.type)==="json-rpc"||C===null){let U;r!==null&&(U=await ti(e,sie,"getChainId")({}),hut({currentChainId:U,chain:r}));const L=(P=(I=(N=e.chain)==null?void 0:N.formatters)==null?void 0:I.transactionRequest)==null?void 0:P.format,Q=(L||kk)({...nB(w,{format:L}),accessList:s,authorizationList:a,blobs:o,chainId:U,data:l,from:C==null?void 0:C.address,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:x,nonce:g,to:F,value:v}),ne=Qz.get(e.uid),J=ne?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:J,params:[Q]},{retryCount:0})}catch(X){if(ne===!1)throw X;const re=X;if(re.name==="InvalidInputRpcError"||re.name==="InvalidParamsRpcError"||re.name==="MethodNotFoundRpcError"||re.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[Q]},{retryCount:0}).then(pe=>(Qz.set(e.uid,!0),pe)).catch(pe=>{const Y=pe;throw Y.name==="MethodNotFoundRpcError"||Y.name==="MethodNotSupportedRpcError"?(Qz.set(e.uid,!1),re):Y});throw re}}if((C==null?void 0:C.type)==="local"){const U=await ti(e,pie,"prepareTransactionRequest")({account:C,accessList:s,authorizationList:a,blobs:o,chain:r,data:l,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:x,nonce:g,nonceManager:C.nonceManager,parameters:[...u9e,"sidecars"],value:v,...w,to:F}),L=(R=r==null?void 0:r.serializers)==null?void 0:R.transaction,z=await C.signTransaction(U,{serializer:L});return await ti(e,d9e,"sendRawTransaction")({serializedTransaction:z})}throw(C==null?void 0:C.type)==="smart"?new Xz({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Xz({docsPath:"/docs/actions/wallet/sendTransaction",type:C==null?void 0:C.type})}catch(F){throw F instanceof Xz?F:jut(F,{...t,account:C,chain:t.chain||void 0})}}const mZ=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],xZ=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],f9e=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],h9e=[...f9e,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],tdt=[...f9e,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],xpe=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],gpe=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],bpe=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function ndt(e,t={}){typeof t.size<"u"&&hp(e,{size:t.size});const n=Wl(e,t);return nd(n,t)}function rdt(e,t={}){let n=e;if(typeof t.size<"u"&&(hp(n,{size:t.size}),n=Hf(n)),n.length>1||n[0]>1)throw new Qlt(n);return!!n[0]}function Hg(e,t={}){typeof t.size<"u"&&hp(e,{size:t.size});const n=Wl(e,t);return X0(n,t)}function sdt(e,t={}){let n=e;return typeof t.size<"u"&&(hp(n,{size:t.size}),n=Hf(n,{dir:"right"})),new TextDecoder().decode(n)}function Tk(e,t){const n=typeof t=="string"?sp(t):t,r=Jse(n);if(rl(n)===0&&e.length>0)throw new Nk;if(rl(t)&&rl(t)<32)throw new _je({data:typeof t=="string"?t:Wl(t),params:e,size:rl(t)});let s=0;const a=[];for(let o=0;o<e.length;++o){const l=e[o];r.setPosition(s);const[c,u]=QC(r,l,{staticPosition:0});s+=u,a.push(c)}return a}function QC(e,t,{staticPosition:n}){const r=Qse(t.type);if(r){const[s,a]=r;return adt(e,{...t,type:a},{length:s,staticPosition:n})}if(t.type==="tuple")return udt(e,t,{staticPosition:n});if(t.type==="address")return idt(e);if(t.type==="bool")return odt(e);if(t.type.startsWith("bytes"))return ldt(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return cdt(e,t);if(t.type==="string")return ddt(e,{staticPosition:n});throw new yct(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ype=32,gZ=32;function idt(e){const t=e.readBytes(32);return[ZD(Wl(Uje(t,-20))),32]}function adt(e,t,{length:n,staticPosition:r}){if(!n){const o=Hg(e.readBytes(gZ)),l=r+o,c=l+ype;e.setPosition(l);const u=Hg(e.readBytes(ype)),d=J9(t);let f=0;const x=[];for(let g=0;g<u;++g){e.setPosition(c+(d?g*32:f));const[v,w]=QC(e,t,{staticPosition:c});f+=w,x.push(v)}return e.setPosition(r+32),[x,32]}if(J9(t)){const o=Hg(e.readBytes(gZ)),l=r+o,c=[];for(let u=0;u<n;++u){e.setPosition(l+u*32);const[d]=QC(e,t,{staticPosition:l});c.push(d)}return e.setPosition(r+32),[c,32]}let s=0;const a=[];for(let o=0;o<n;++o){const[l,c]=QC(e,t,{staticPosition:r+s});s+=c,a.push(l)}return[a,s]}function odt(e){return[rdt(e.readBytes(32),{size:32}),32]}function ldt(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const o=Hg(e.readBytes(32));e.setPosition(n+o);const l=Hg(e.readBytes(32));if(l===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(l);return e.setPosition(n+32),[Wl(c),32]}return[Wl(e.readBytes(Number.parseInt(s),32)),32]}function cdt(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),s=e.readBytes(32);return[r>48?ndt(s,{signed:n}):Hg(s,{signed:n}),32]}function udt(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:o})=>!o),s=r?[]:{};let a=0;if(J9(t)){const o=Hg(e.readBytes(gZ)),l=n+o;for(let c=0;c<t.components.length;++c){const u=t.components[c];e.setPosition(l+a);const[d,f]=QC(e,u,{staticPosition:l});a+=f,s[r?c:u==null?void 0:u.name]=d}return e.setPosition(n+32),[s,32]}for(let o=0;o<t.components.length;++o){const l=t.components[o],[c,u]=QC(e,l,{staticPosition:n});s[r?o:l==null?void 0:l.name]=c,a+=u}return[s,a]}function ddt(e,{staticPosition:t}){const n=Hg(e.readBytes(32)),r=t+n;e.setPosition(r);const s=Hg(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const a=e.readBytes(s,32),o=sdt(Hf(a));return e.setPosition(t+32),[o,32]}function J9(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(J9);const n=Qse(e.type);return!!(n&&J9({...e,type:n[1]}))}const fdt=e=>eu(hA(e));function hdt(e){return fdt(e)}const pdt="1.0.8";let Zf=class bZ extends Error{constructor(t,n={}){var o;const r=n.cause instanceof bZ?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,s=n.cause instanceof bZ&&n.cause.docsPath||n.docsPath,a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${pdt}`].join(`
`);super(a),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function w1(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const p9e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,m9e=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,x9e=/^\(.+?\).*?$/,vpe=/^tuple(?<array>(\[(\d*)\])*)$/;function yZ(e){let t=e.type;if(vpe.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const a=e.components[s];t+=yZ(a),s<n-1&&(t+=", ")}const r=w1(vpe,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,yZ({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function x7(e){let t="";const n=e.length;for(let r=0;r<n;r++){const s=e[r];t+=yZ(s),r!==n-1&&(t+=", ")}return t}function rM(e){var t;return e.type==="function"?`function ${e.name}(${x7(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${x7(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${x7(e.inputs)})`:e.type==="error"?`error ${e.name}(${x7(e.inputs)})`:e.type==="constructor"?`constructor(${x7(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const g9e=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function mdt(e){return g9e.test(e)}function xdt(e){return w1(g9e,e)}const b9e=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function gdt(e){return b9e.test(e)}function bdt(e){return w1(b9e,e)}const y9e=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function ydt(e){return y9e.test(e)}function vdt(e){return w1(y9e,e)}const v9e=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function mie(e){return v9e.test(e)}function wdt(e){return w1(v9e,e)}const w9e=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Cdt(e){return w9e.test(e)}function Sdt(e){return w1(w9e,e)}const C9e=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Ndt(e){return C9e.test(e)}function Adt(e){return w1(C9e,e)}const jdt=/^receive\(\) external payable$/;function Edt(e){return jdt.test(e)}const _dt=new Set(["indexed"]),vZ=new Set(["calldata","memory","storage"]);class kdt extends Zf{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Tdt extends Zf{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Idt extends Zf{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Pdt extends Zf{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Fdt extends Zf{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Odt extends Zf{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Mdt extends Zf{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Rdt extends Zf{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}let mA=class extends Zf{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};class Ldt extends Zf{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Ddt extends Zf{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class Bdt extends Zf{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class $dt extends Zf{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function Udt(e,t,n){let r="";if(n)for(const s of Object.entries(n)){if(!s)continue;let a="";for(const o of s[1])a+=`[${o.type}${o.name?`:${o.name}`:""}]`;r+=`(${s[0]}{${a}})`}return t?`${t}:${e}${r}`:e}const Zz=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function wZ(e,t={}){if(ydt(e))return zdt(e,t);if(gdt(e))return Hdt(e,t);if(mdt(e))return Vdt(e,t);if(Cdt(e))return Wdt(e,t);if(Ndt(e))return qdt(e);if(Edt(e))return{type:"receive",stateMutability:"payable"};throw new Ldt({signature:e})}function zdt(e,t={}){const n=vdt(e);if(!n)throw new mA({signature:e,type:"function"});const r=tm(n.parameters),s=[],a=r.length;for(let l=0;l<a;l++)s.push(b3(r[l],{modifiers:vZ,structs:t,type:"function"}));const o=[];if(n.returns){const l=tm(n.returns),c=l.length;for(let u=0;u<c;u++)o.push(b3(l[u],{modifiers:vZ,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:o}}function Hdt(e,t={}){const n=bdt(e);if(!n)throw new mA({signature:e,type:"event"});const r=tm(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(b3(r[o],{modifiers:_dt,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:s}}function Vdt(e,t={}){const n=xdt(e);if(!n)throw new mA({signature:e,type:"error"});const r=tm(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(b3(r[o],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:s}}function Wdt(e,t={}){const n=Sdt(e);if(!n)throw new mA({signature:e,type:"constructor"});const r=tm(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(b3(r[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}function qdt(e){const t=Adt(e);if(!t)throw new mA({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const Gdt=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Kdt=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ydt=/^u?int$/;function b3(e,t){var f,x;const n=Udt(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Zz.has(n))return Zz.get(n);const r=x9e.test(e),s=w1(r?Kdt:Gdt,e);if(!s)throw new Pdt({param:e});if(s.name&&Qdt(s.name))throw new Fdt({param:e,name:s.name});const a=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},l=(t==null?void 0:t.structs)??{};let c,u={};if(r){c="tuple";const g=tm(s.type),v=[],w=g.length;for(let C=0;C<w;C++)v.push(b3(g[C],{structs:l}));u={components:v}}else if(s.type in l)c="tuple",u={components:l[s.type]};else if(Ydt.test(s.type))c=`${s.type}256`;else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!S9e(c))throw new Idt({type:c});if(s.modifier){if(!((x=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&x.call(f,s.modifier)))throw new Odt({param:e,type:t==null?void 0:t.type,modifier:s.modifier});if(vZ.has(s.modifier)&&!Zdt(c,!!s.array))throw new Mdt({param:e,type:t==null?void 0:t.type,modifier:s.modifier})}const d={type:`${c}${s.array??""}`,...a,...o,...u};return Zz.set(n,d),d}function tm(e,t=[],n="",r=0){const s=e.trim().length;for(let a=0;a<s;a++){const o=e[a],l=e.slice(a+1);switch(o){case",":return r===0?tm(l,[...t,n.trim()]):tm(l,t,`${n}${o}`,r);case"(":return tm(l,t,`${n}${o}`,r+1);case")":return tm(l,t,`${n}${o}`,r-1);default:return tm(l,t,`${n}${o}`,r)}}if(n==="")return t;if(r!==0)throw new $dt({current:n,depth:r});return t.push(n.trim()),t}function S9e(e){return e==="address"||e==="bool"||e==="function"||e==="string"||p9e.test(e)||m9e.test(e)}const Xdt=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function Qdt(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||p9e.test(e)||m9e.test(e)||Xdt.test(e)}function Zdt(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function N9e(e){const t={},n=e.length;for(let o=0;o<n;o++){const l=e[o];if(!mie(l))continue;const c=wdt(l);if(!c)throw new mA({signature:l,type:"struct"});const u=c.properties.split(";"),d=[],f=u.length;for(let x=0;x<f;x++){const v=u[x].trim();if(!v)continue;const w=b3(v,{type:"struct"});d.push(w)}if(!d.length)throw new Ddt({signature:l});t[c.name]=d}const r={},s=Object.entries(t),a=s.length;for(let o=0;o<a;o++){const[l,c]=s[o];r[l]=A9e(c,t)}return r}const Jdt=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function A9e(e,t,n=new Set){const r=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(x9e.test(o.type))r.push(o);else{const c=w1(Jdt,o.type);if(!(c!=null&&c.type))throw new Rdt({abiParameter:o});const{array:u,type:d}=c;if(d in t){if(n.has(d))throw new Bdt({type:d});r.push({...o,type:`tuple${u??""}`,components:A9e(t[d]??[],t,new Set([...n,d]))})}else if(S9e(d))r.push(o);else throw new Tdt({type:d})}}return r}function j9e(e){const t=N9e(e),n=[],r=e.length;for(let s=0;s<r;s++){const a=e[s];mie(a)||n.push(wZ(a,t))}return n}function wpe(e){let t;if(typeof e=="string")t=wZ(e);else{const n=N9e(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!mie(a)){t=wZ(a,n);break}}}if(!t)throw new kdt({signature:e});return t}function eft(e){let t=!0,n="",r=0,s="",a=!1;for(let o=0;o<e.length;o++){const l=e[o];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function",""].includes(s))s="";else if(s+=l,l===")"){a=!0;break}continue}if(l===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=l,n+=l}}if(!a)throw new Rr("Unable to normalize signature.");return s}const tft=e=>{const t=typeof e=="string"?e:rM(e);return eft(t)};function E9e(e){return hdt(tft(e))}const iB=E9e,Ik=e=>p3(E9e(e),0,4);function s5(e){const{abi:t,args:n=[],name:r}=e,s=Y0(r,{strict:!1}),a=t.filter(l=>s?l.type==="function"?Ik(l)===r:l.type==="event"?iB(l)===r:!1:"name"in l&&l.name===r);if(a.length===0)return;if(a.length===1)return a[0];let o;for(const l of a){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return l;continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((u,d)=>{const f="inputs"in l&&l.inputs[d];return f?CZ(u,f):!1})){if(o&&"inputs"in o&&o.inputs){const u=_9e(l.inputs,o.inputs,n);if(u)throw new xct({abiItem:l,type:u[0]},{abiItem:o,type:u[1]})}o=l}}return o||a[0]}function CZ(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ic(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>CZ(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>CZ(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function _9e(e,t,n){for(const r in e){const s=e[r],a=t[r];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return _9e(s.components,a.components,n[r]);const o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?ic(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?ic(n[r],{strict:!1}):!1)return o}}const Jz="/docs/contract/decodeFunctionResult";function i5(e){const{abi:t,args:n,functionName:r,data:s}=e;let a=t[0];if(r){const l=s5({abi:t,args:n,name:r});if(!l)throw new IS(r,{docsPath:Jz});a=l}if(a.type!=="function")throw new IS(void 0,{docsPath:Jz});if(!a.outputs)throw new Ije(a.name,{docsPath:Jz});const o=Tk(a.outputs,s);if(o.length>1)return o;if(o.length===1)return o[0]}const Cpe="/docs/contract/encodeFunctionData";function nft(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const a=s5({abi:t,args:n,name:r});if(!a)throw new IS(r,{docsPath:Cpe});s=a}if(s.type!=="function")throw new IS(void 0,{docsPath:Cpe});return{abi:[s],functionName:Ik(mm(s))}}function Sm(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var l;return e.abi.length===1&&((l=e.functionName)!=null&&l.startsWith("0x"))?e:nft(e)})(),s=n[0],a=r,o="inputs"in s&&s.inputs?s2(s.inputs,t??[]):void 0;return Cm([a,o??"0x"])}function xA({blockNumber:e,chain:t,contract:n}){var s;const r=(s=t==null?void 0:t.contracts)==null?void 0:s[n];if(!r)throw new iZ({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new iZ({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const k9e={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},T9e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},rft={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function sft(e){const{abi:t,data:n}=e,r=p3(n,0,4);if(r==="0x")throw new Nk;const a=[...t||[],T9e,rft].find(o=>o.type==="error"&&r===Ik(mm(o)));if(!a)throw new kje(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?Tk(a.inputs,p3(n,4)):void 0,errorName:a.name}}function I9e({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,a)=>`${r&&s.name?`${s.name}: `:""}${typeof t[a]=="object"?Tc(t[a]):t[a]}`).join(", ")})`}class P9e extends Rr{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:d,to:f,value:x,stateOverride:g}){var C;const v=n?Du(n):void 0;let w=_k({from:v==null?void 0:v.address,to:f,value:typeof x<"u"&&`${eie(x)} ${((C=s==null?void 0:s.nativeCurrency)==null?void 0:C.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${ef(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${ef(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${ef(u)} gwei`,nonce:d});g&&(w+=`
${$ut(g)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class F9e extends Rr{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:a,functionName:o,sender:l}){const c=s5({abi:n,args:r,name:o}),u=c?I9e({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,d=c?mm(c,{includeName:!0}):void 0,f=_k({address:s&&Sut(s),function:d,args:u&&u!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${u}`,sender:l});super(t.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:t,docsPath:a,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=s,this.functionName=o,this.sender=l}}class SZ extends Rr{constructor({abi:t,data:n,functionName:r,message:s}){let a,o,l,c;if(n&&n!=="0x")try{o=sft({abi:t,data:n});const{abiItem:d,errorName:f,args:x}=o;if(f==="Error")c=x[0];else if(f==="Panic"){const[g]=x;c=k9e[g]}else{const g=d?mm(d,{includeName:!0}):void 0,v=d&&x?I9e({abiItem:d,args:x,includeFunctionName:!1,includeName:!1}):void 0;l=[g?`Error: ${g}`:"",v&&v!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${v}`:""]}}catch(d){a=d}else s&&(c=s);let u;a instanceof kje&&(u=a.signature,l=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(c&&c!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(`
`):`The contract function "${r}" reverted.`,{cause:a,metaMessages:l,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.raw=n,this.reason=c,this.signature=u}}class ift extends Rr{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class aft extends Rr{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class aB extends Rr{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}function xie(e,t){var r,s,a,o,l,c;if(!(e instanceof Rr))return!1;const n=e.walk(u=>u instanceof SZ);return n instanceof SZ?!!(((r=n.data)==null?void 0:r.errorName)==="ResolverNotFound"||((s=n.data)==null?void 0:s.errorName)==="ResolverWildcardNotSupported"||((a=n.data)==null?void 0:a.errorName)==="ResolverNotContract"||((o=n.data)==null?void 0:o.errorName)==="ResolverError"||((l=n.data)==null?void 0:l.errorName)==="HttpError"||(c=n.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&n.reason===k9e[50]):!1}function oft(e){const{abi:t,data:n}=e,r=p3(n,0,4),s=t.find(a=>a.type==="function"&&r===Ik(mm(a)));if(!s)throw new mct(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Tk(s.inputs,p3(n,4)):void 0}}const eH="/docs/contract/encodeErrorResult";function Spe(e){const{abi:t,errorName:n,args:r}=e;let s=t[0];if(n){const c=s5({abi:t,args:r,name:n});if(!c)throw new epe(n,{docsPath:eH});s=c}if(s.type!=="error")throw new epe(void 0,{docsPath:eH});const a=mm(s),o=Ik(a);let l="0x";if(r&&r.length>0){if(!s.inputs)throw new hct(s.name,{docsPath:eH});l=s2(s.inputs,r)}return Cm([o,l])}const tH="/docs/contract/encodeFunctionResult";function lft(e){const{abi:t,functionName:n,result:r}=e;let s=t[0];if(n){const o=s5({abi:t,name:n});if(!o)throw new IS(n,{docsPath:tH});s=o}if(s.type!=="function")throw new IS(void 0,{docsPath:tH});if(!s.outputs)throw new Ije(s.name,{docsPath:tH});const a=(()=>{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new Pje(r)})();return s2(s.outputs,a)}const O9e="x-batch-gateway:true";async function W2n(e){const{data:t,ccipRequest:n}=e,{args:[r]}=oft({abi:xZ,data:t}),s=[],a=[];return await Promise.all(r.map(async(o,l)=>{try{a[l]=await n(o),s[l]=!1}catch(c){s[l]=!0,a[l]=cft(c)}})),lft({abi:xZ,functionName:"query",result:[s,a]})}function cft(e){return e.name==="HttpRequestError"&&e.status?Spe({abi:xZ,errorName:"HttpError",args:[e.status,e.shortMessage]}):Spe({abi:[T9e],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function M9e(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Y0(t)?t:null}function MF(e){let t=new Uint8Array(32).fill(0);if(!e)return Wl(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const s=M9e(n[r]),a=s?hA(s):eu(Ww(n[r]),"bytes");t=eu(r1([t,a]),"bytes")}return Wl(t)}function uft(e){return`[${e.slice(2)}]`}function dft(e){const t=new Uint8Array(32).fill(0);return e?M9e(e)||eu(Ww(e)):Wl(t)}function oB(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Ww(t).byteLength+2);let r=0;const s=t.split(".");for(let a=0;a<s.length;a++){let o=Ww(s[a]);o.byteLength>255&&(o=Ww(uft(dft(s[a])))),n[r]=o.length,n.set(o,r+1),r+=o.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}const fft=3;function y3(e,{abi:t,address:n,args:r,docsPath:s,functionName:a,sender:o}){const l=e instanceof aB?e:e instanceof Rr?e.walk(v=>"data"in v)||e.walk():{},{code:c,data:u,details:d,message:f,shortMessage:x}=l,g=e instanceof Nk?new ift({functionName:a}):[fft,x3.code].includes(c)&&(u||d||f||x)?new SZ({abi:t,data:typeof u=="object"?u.data:u,functionName:a,message:l instanceof nie?d:x??f}):e;return new F9e(g,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:a,sender:o})}const hft="0x82ad56cb",R9e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",pft="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",mft="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function L9e(e,{docsPath:t,...n}){const r=(()=>{const s=tB(e,n);return s instanceof Ek?e:s})();return new P9e(r,{docsPath:t,...n})}function D9e(){let e=()=>{},t=()=>{};return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}const nH=new Map;function B9e({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const a=async()=>{const d=c();o();const f=d.map(({args:x})=>x);f.length!==0&&e(f).then(x=>{s&&Array.isArray(x)&&x.sort(s);for(let g=0;g<d.length;g++){const{resolve:v}=d[g];v==null||v([x[g],x])}}).catch(x=>{for(let g=0;g<d.length;g++){const{reject:v}=d[g];v==null||v(x)}})},o=()=>nH.delete(t),l=()=>c().map(({args:d})=>d),c=()=>nH.get(t)||[],u=d=>nH.set(t,[...c(),d]);return{flush:o,async schedule(d){const{promise:f,resolve:x,reject:g}=D9e();return(n==null?void 0:n([...l(),d]))&&a(),c().length>0?(u({args:d,resolve:x,reject:g}),f):(u({args:d,resolve:x,reject:g}),setTimeout(a,r),f)}}}async function lB(e,t){var J,X,re,pe;const{account:n=e.account,batch:r=!!((J=e.batch)!=null&&J.multicall),blockNumber:s,blockTag:a="latest",accessList:o,blobs:l,code:c,data:u,factory:d,factoryData:f,gas:x,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:N,to:I,value:P,stateOverride:R,...F}=t,U=n?Du(n):void 0;if(c&&(d||f))throw new Rr("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&I)throw new Rr("Cannot provide both `code` & `to` as parameters.");const L=c&&u,z=d&&f&&I&&u,Q=L||z,ne=L?bft({code:c,data:u}):z?yft({data:u,factory:d,factoryData:f,to:I}):u;try{pA(t);const ie=(s?Ds(s):void 0)||a,oe=lie(R),G=(pe=(re=(X=e.chain)==null?void 0:X.formatters)==null?void 0:re.transactionRequest)==null?void 0:pe.format,te=(G||kk)({...nB(F,{format:G}),from:U==null?void 0:U.address,accessList:o,blobs:l,data:ne,gas:x,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:N,to:Q?void 0:I,value:P});if(r&&xft({request:te})&&!oe)try{return await gft(e,{...te,blockNumber:s,blockTag:a})}catch(he){if(!(he instanceof Yje)&&!(he instanceof iZ))throw he}const ae=await e.request({method:"eth_call",params:oe?[te,ie,oe]:[te,ie]});return ae==="0x"?{data:void 0}:{data:ae}}catch(Y){const ie=vft(Y),{offchainLookup:oe,offchainLookupSignature:G}=await ss(async()=>{const{offchainLookup:V,offchainLookupSignature:te}=await import("./ccip-zqmSJdoO.js");return{offchainLookup:V,offchainLookupSignature:te}},[]);if(e.ccipRead!==!1&&(ie==null?void 0:ie.slice(0,10))===G&&I)return{data:await oe(e,{data:ie,to:I})};throw Q&&(ie==null?void 0:ie.slice(0,10))==="0x101bb98d"?new aft({factory:d}):L9e(Y,{...t,account:U,chain:e.chain})}}function xft({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(hft)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function gft(e,t){var w;const{batchSize:n=1024,wait:r=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:a="latest",data:o,multicallAddress:l,to:c}=t;let u=l;if(!u){if(!e.chain)throw new Yje;u=xA({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=(s?Ds(s):void 0)||a,{schedule:x}=B9e({id:`${e.uid}.${f}`,wait:r,shouldSplitBatch(C){return C.reduce((I,{data:P})=>I+(P.length-2),0)>n*2},fn:async C=>{const N=C.map(R=>({allowFailure:!0,callData:R.data,target:R.to})),I=Sm({abi:mZ,args:[N],functionName:"aggregate3"}),P=await e.request({method:"eth_call",params:[{data:I,to:u},f]});return i5({abi:mZ,args:[N],functionName:"aggregate3",data:P||"0x"})}}),[{returnData:g,success:v}]=await x({data:o,to:c});if(!v)throw new aB({data:g});return g==="0x"?{data:void 0}:{data:g}}function bft(e){const{code:t,data:n}=e;return Zse({abi:j9e(["constructor(bytes, bytes)"]),bytecode:R9e,args:[t,n]})}function yft(e){const{data:t,factory:n,factoryData:r,to:s}=e;return Zse({abi:j9e(["constructor(address, bytes, address, bytes)"]),bytecode:pft,args:[s,t,n,r]})}function vft(e){var n;if(!(e instanceof Rr))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function Q0(e,t){const{abi:n,address:r,args:s,functionName:a,...o}=t,l=Sm({abi:n,args:s,functionName:a});try{const{data:c}=await ti(e,lB,"call")({...o,data:l,to:r});return i5({abi:n,args:s,functionName:a,data:c||"0x"})}catch(c){throw y3(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:a})}}async function wft(e,t){const{blockNumber:n,blockTag:r,coinType:s,name:a,gatewayUrls:o,strict:l}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return xA({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),d=c==null?void 0:c.ensTlds;if(d&&!d.some(f=>a.endsWith(f)))return null;try{const f=Sm({abi:gpe,functionName:"addr",...s!=null?{args:[MF(a),BigInt(s)]}:{args:[MF(a)]}}),x={address:u,abi:h9e,functionName:"resolve",args:[oi(oB(a)),f,o??[O9e]],blockNumber:n,blockTag:r},v=await ti(e,Q0,"readContract")(x);if(v[0]==="0x")return null;const w=i5({abi:gpe,args:s!=null?[MF(a),BigInt(s)]:void 0,functionName:"addr",data:v[0]});return w==="0x"||Hf(w)==="0x00"?null:w}catch(f){if(l)throw f;if(xie(f,"resolve"))return null;throw f}}class Cft extends Rr{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class g7 extends Rr{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class gie extends Rr{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class Sft extends Rr{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Nft=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Aft=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,jft=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Eft=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function _ft(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function Npe(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function $9e({uri:e,gatewayUrls:t}){const n=jft.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Npe(t==null?void 0:t.ipfs,"https://ipfs.io"),s=Npe(t==null?void 0:t.arweave,"https://arweave.net"),a=e.match(Nft),{protocol:o,subpath:l,target:c,subtarget:u=""}=(a==null?void 0:a.groups)||{},d=o==="ipns:/"||l==="ipns/",f=o==="ipfs:/"||l==="ipfs/"||Aft.test(e);if(e.startsWith("http")&&!d&&!f){let g=e;return t!=null&&t.arweave&&(g=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((d||f)&&c)return{uri:`${r}/${d?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${s}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let x=e.replace(Eft,"");if(x.startsWith("<svg")&&(x=`data:image/svg+xml;base64,${btoa(x)}`),x.startsWith("data:")||x.startsWith("{"))return{uri:x,isOnChain:!0,isEncoded:!1};throw new gie({uri:e})}function U9e(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Cft({data:e});return e.image||e.image_url||e.image_data}async function kft({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(s=>s.json());return await bie({gatewayUrls:e,uri:U9e(n)})}catch{throw new gie({uri:t})}}async function bie({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=$9e({uri:t,gatewayUrls:e});if(r||await _ft(n))return n;throw new gie({uri:t})}function Tft(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[a,o]=n.split(":"),[l,c]=r.split(":");if(!a||a.toLowerCase()!=="eip155")throw new g7({reason:"Only EIP-155 supported"});if(!o)throw new g7({reason:"Chain ID not found"});if(!c)throw new g7({reason:"Contract address not found"});if(!s)throw new g7({reason:"Token ID not found"});if(!l)throw new g7({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:l.toLowerCase(),contractAddress:c,tokenID:s}}async function Ift(e,{nft:t}){if(t.namespace==="erc721")return Q0(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return Q0(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new Sft({namespace:t.namespace})}async function Pft(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Fft(e,{gatewayUrls:t,record:n}):bie({uri:n,gatewayUrls:t})}async function Fft(e,{gatewayUrls:t,record:n}){const r=Tft(n),s=await Ift(e,{nft:r}),{uri:a,isOnChain:o,isEncoded:l}=$9e({uri:s,gatewayUrls:t});if(o&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const u=l?atob(a.replace("data:application/json;base64,","")):a,d=JSON.parse(u);return bie({uri:U9e(d),gatewayUrls:t})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),kft({gatewayUrls:t,uri:a.replace(/(?:0x)?{id}/,c)})}async function z9e(e,t){const{blockNumber:n,blockTag:r,key:s,name:a,gatewayUrls:o,strict:l}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return xA({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),d=c==null?void 0:c.ensTlds;if(d&&!d.some(f=>a.endsWith(f)))return null;try{const f={address:u,abi:h9e,functionName:"resolve",args:[oi(oB(a)),Sm({abi:xpe,functionName:"text",args:[MF(a),s]}),o??[O9e]],blockNumber:n,blockTag:r},g=await ti(e,Q0,"readContract")(f);if(g[0]==="0x")return null;const v=i5({abi:xpe,functionName:"text",data:g[0]});return v===""?null:v}catch(f){if(l)throw f;if(xie(f,"resolve"))return null;throw f}}async function H9e(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:a,strict:o,universalResolverAddress:l}){const c=await ti(e,z9e,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:l,gatewayUrls:a,strict:o});if(!c)return null;try{return await Pft(e,{record:c,gatewayUrls:r})}catch{return null}}async function V9e(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:s,strict:a,universalResolverAddress:o}){let l=o;if(!l){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=xA({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const u={address:l,abi:tdt,functionName:"reverse",args:[oi(oB(c))],blockNumber:n,blockTag:r},d=ti(e,Q0,"readContract"),[f,x]=s?await d({...u,args:[...u.args,s]}):await d(u);return t.toLowerCase()!==x.toLowerCase()?null:f}catch(u){if(a)throw u;if(xie(u,"reverse"))return null;throw u}}async function Oft(e,t){const{blockNumber:n,blockTag:r,name:s}=t,{chain:a}=e,o=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return xA({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),l=a==null?void 0:a.ensTlds;if(l&&!l.some(u=>s.endsWith(u)))throw new Error(`${s} is not a valid ENS TLD (${l==null?void 0:l.join(", ")}) for chain "${a.name}" (id: ${a.id}).`);const[c]=await ti(e,Q0,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[oi(oB(s))],blockNumber:n,blockTag:r});return c}async function W9e(e,t){var C,N,I;const{account:n=e.account,blockNumber:r,blockTag:s="latest",blobs:a,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:x,value:g,...v}=t,w=n?Du(n):void 0;try{pA(t);const R=(r?Ds(r):void 0)||s,F=(I=(N=(C=e.chain)==null?void 0:C.formatters)==null?void 0:N.transactionRequest)==null?void 0:I.format,L=(F||kk)({...nB(v,{format:F}),from:w==null?void 0:w.address,blobs:a,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:x,value:g}),z=await e.request({method:"eth_createAccessList",params:[L,R]});return{accessList:z.accessList,gasUsed:BigInt(z.gasUsed)}}catch(P){throw L9e(P,{...t,account:w,chain:e.chain})}}function cB(e,{method:t}){var r,s;const n={};return e.transport.type==="fallback"&&((s=(r=e.transport).onResponse)==null||s.call(r,({method:a,response:o,status:l,transport:c})=>{l==="success"&&t===a&&(n[o]=c.request)})),a=>n[a]||e.request}async function Mft(e){const t=cB(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class Rft extends Rr{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const Ape="/docs/contract/encodeEventTopics";function Pk(e){var c;const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const u=s5({abi:t,name:n});if(!u)throw new tpe(n,{docsPath:Ape});s=u}if(s.type!=="event")throw new tpe(void 0,{docsPath:Ape});const a=mm(s),o=iB(a);let l=[];if(r&&"inputs"in s){const u=(c=s.inputs)==null?void 0:c.filter(f=>"indexed"in f&&f.indexed),d=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(f=>r[f.name]))??[]:[];d.length>0&&(l=(u==null?void 0:u.map((f,x)=>Array.isArray(d[x])?d[x].map((g,v)=>jpe({param:f,value:d[x][v]})):typeof d[x]<"u"&&d[x]!==null?jpe({param:f,value:d[x]}):null))??[])}return[o,...l]}function jpe({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return eu(hA(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Rft(e.type);return s2([e],[t])}async function q9e(e,t){const{address:n,abi:r,args:s,eventName:a,fromBlock:o,strict:l,toBlock:c}=t,u=cB(e,{method:"eth_newFilter"}),d=a?Pk({abi:r,args:s,eventName:a}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof o=="bigint"?Ds(o):o,toBlock:typeof c=="bigint"?Ds(c):c,topics:d}]});return{abi:r,args:s,eventName:a,id:f,request:u(f),strict:!!l,type:"event"}}async function G9e(e,{address:t,args:n,event:r,events:s,fromBlock:a,strict:o,toBlock:l}={}){const c=s??(r?[r]:void 0),u=cB(e,{method:"eth_newFilter"});let d=[];c&&(d=[c.flatMap(g=>Pk({abi:[g],eventName:g.name,args:n}))],r&&(d=d[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof a=="bigint"?Ds(a):a,toBlock:typeof l=="bigint"?Ds(l):l,...d.length?{topics:d}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:a,id:f,request:u(f),strict:!!o,toBlock:l,type:"event"}}async function K9e(e){const t=cB(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Lft(e,t){const{abi:n,address:r,args:s,functionName:a,dataSuffix:o,...l}=t,c=Sm({abi:n,args:s,functionName:a});try{return await ti(e,uie,"estimateGas")({data:`${c}${o?o.replace("0x",""):""}`,to:r,...l})}catch(u){const d=l.account?Du(l.account):void 0;throw y3(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:d==null?void 0:d.address})}}async function Dft(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const Bft=new Map,$ft=new Map;function Uft(e){const t=(s,a)=>({clear:()=>a.delete(s),get:()=>a.get(s),set:o=>a.set(s,o)}),n=t(e,Bft),r=t(e,$ft);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function zft(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=Uft(t),s=r.response.get();if(s&&n>0&&new Date().getTime()-s.created.getTime()<n)return s.data;let a=r.promise.get();a||(a=e(),r.promise.set(a));try{const o=await a;return r.response.set({created:new Date,data:o}),o}finally{r.promise.clear()}}const Hft=e=>`blockNumber.${e}`;async function Fk(e,{cacheTime:t=e.cacheTime}={}){const n=await zft(()=>e.request({method:"eth_blockNumber"}),{cacheKey:Hft(e.uid),cacheTime:t});return BigInt(n)}async function Vft(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?Ds(n):void 0;let a;return t?a=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):a=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),X0(a)}async function Epe(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?Ds(n):void 0,a=await e.request({method:"eth_getCode",params:[t,s||r]},{dedupe:!!s});if(a!=="0x")return a}function yie(e,t){if(!ic(e,{strict:!1}))throw new pd({address:e});if(!ic(t,{strict:!1}))throw new pd({address:t});return e.toLowerCase()===t.toLowerCase()}const _pe="/docs/contract/decodeEventLog";function vie(e){const{abi:t,data:n,strict:r,topics:s}=e,a=r??!0,[o,...l]=s;if(!o)throw new pct({docsPath:_pe});const c=t.length===1?t[0]:t.find(w=>w.type==="event"&&o===iB(mm(w)));if(!(c&&"name"in c)||c.type!=="event")throw new Tje(o,{docsPath:_pe});const{name:u,inputs:d}=c,f=d==null?void 0:d.some(w=>!("name"in w&&w.name));let x=f?[]:{};const g=d.filter(w=>"indexed"in w&&w.indexed);for(let w=0;w<g.length;w++){const C=g[w],N=l[w];if(!N)throw new YD({abiItem:c,param:C});x[f?w:C.name||w]=Wft({param:C,value:N})}const v=d.filter(w=>!("indexed"in w&&w.indexed));if(v.length>0){if(n&&n!=="0x")try{const w=Tk(v,n);if(w)if(f)x=[...x,...w];else for(let C=0;C<v.length;C++)x[v[C].name]=w[C]}catch(w){if(a)throw w instanceof _je||w instanceof Wje?new F9({abiItem:c,data:n,params:v,size:rl(n)}):w}else if(a)throw new F9({abiItem:c,data:"0x",params:v,size:0})}return{eventName:u,args:Object.values(x).length>0?x:void 0}}function Wft({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:Tk([e],t)[0]}function wie(e){const{abi:t,args:n,logs:r,strict:s=!0}=e,a=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(o=>{var l;try{const c=t.find(d=>d.type==="event"&&o.topics[0]===iB(d));if(!c)return null;const u=vie({...o,abi:[c],strict:s});return a&&!a.includes(u.eventName)||!qft({args:u.args,inputs:c.inputs,matchArgs:n})?null:{...u,...o}}catch(c){let u,d;if(c instanceof Tje)return null;if(c instanceof F9||c instanceof YD){if(s)return null;u=c.abiItem.name,d=(l=c.abiItem.inputs)==null?void 0:l.some(f=>!("name"in f&&f.name))}return{...o,args:d?[]:{},eventName:u}}}).filter(Boolean)}function qft(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function s(a,o,l){try{return a.type==="address"?yie(o,l):a.type==="string"||a.type==="bytes"?eu(hA(o))===l:o===l}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((a,o)=>{if(a==null)return!0;const l=n[o];return l?(Array.isArray(a)?a:[a]).some(u=>s(l,u,t[o])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([a,o])=>{if(o==null)return!0;const l=n.find(u=>u.name===a);return l?(Array.isArray(o)?o:[o]).some(u=>s(l,u,t[a])):!1}):!1}function s1(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function Cie(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:a,events:o,args:l,strict:c}={}){const u=c??!1,d=o??(a?[a]:void 0);let f=[];d&&(f=[d.flatMap(w=>Pk({abi:[w],eventName:w.name,args:o?void 0:l}))],a&&(f=f[0]));let x;n?x=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):x=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?Ds(r):r,toBlock:typeof s=="bigint"?Ds(s):s}]});const g=x.map(v=>s1(v));return d?wie({abi:d,args:l,logs:g,strict:u}):g}async function Y9e(e,t){const{abi:n,address:r,args:s,blockHash:a,eventName:o,fromBlock:l,toBlock:c,strict:u}=t,d=o?s5({abi:n,name:o}):void 0,f=d?void 0:n.filter(x=>x.type==="event");return ti(e,Cie,"getLogs")({address:r,args:s,blockHash:a,event:d,events:f,fromBlock:l,toBlock:c,strict:u})}class Gft extends Rr{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function Kft(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[a,o,l,c,u,d,f]=await ti(e,Q0,"readContract")({abi:Yft,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:o,version:l,chainId:Number(c),verifyingContract:u,salt:d},extensions:f,fields:a}}catch(a){const o=a;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new Gft({address:n}):o}}const Yft=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function Xft(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function Qft(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const a=n?Ds(n):void 0,o=await e.request({method:"eth_feeHistory",params:[Ds(t),a||r,s]},{dedupe:!!a});return Xft(o)}async function uB(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const s=r.map(a=>s1(a));return!("abi"in t)||!t.abi?s:wie({abi:t.abi,logs:s,strict:n})}async function Zft(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(a=>s1(a));return t.abi?wie({abi:t.abi,logs:s,strict:n}):s}async function Jft(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const a=n!==void 0?Ds(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,a||r]})}async function Sie(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:a}){var d,f,x;const o=r||"latest",l=n!==void 0?Ds(n):void 0;let c=null;if(s?c=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Ds(a)]},{dedupe:!0}):(l||o)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||o,Ds(a)]},{dedupe:!!l})),!c)throw new Xje({blockHash:t,blockNumber:n,blockTag:o,hash:s,index:a});return(((x=(f=(d=e.chain)==null?void 0:d.formatters)==null?void 0:f.transaction)==null?void 0:x.format)||sB)(c)}async function eht(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([ti(e,Fk,"getBlockNumber")({}),t?ti(e,Sie,"getTransaction")({hash:t}):void 0]),a=(n==null?void 0:n.blockNumber)||(s==null?void 0:s.blockNumber);return a?r-a+1n:0n}const tht={"0x0":"reverted","0x1":"success"};function X9e(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>s1(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?X0(e.transactionIndex):null,status:e.status?tht[e.status]:null,type:e.type?Jje[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const nht=rie("transactionReceipt",X9e);async function NZ(e,{hash:t}){var s,a,o;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Qje({hash:t});return(((o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionReceipt)==null?void 0:o.format)||X9e)(n)}async function Q9e(e,t){var C;const{allowFailure:n=!0,batchSize:r,blockNumber:s,blockTag:a,multicallAddress:o,stateOverride:l}=t,c=t.contracts,u=r??(typeof((C=e.batch)==null?void 0:C.multicall)=="object"&&e.batch.multicall.batchSize||1024);let d=o;if(!d){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");d=xA({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=[[]];let x=0,g=0;for(let N=0;N<c.length;N++){const{abi:I,address:P,args:R,functionName:F}=c[N];try{const U=Sm({abi:I,args:R,functionName:F});g+=(U.length-2)/2,u>0&&g>u&&f[x].length>0&&(x++,g=(U.length-2)/2,f[x]=[]),f[x]=[...f[x],{allowFailure:!0,callData:U,target:P}]}catch(U){const L=y3(U,{abi:I,address:P,args:R,docsPath:"/docs/contract/multicall",functionName:F});if(!n)throw L;f[x]=[...f[x],{allowFailure:!0,callData:"0x",target:P}]}}const v=await Promise.allSettled(f.map(N=>ti(e,Q0,"readContract")({abi:mZ,address:d,args:[N],blockNumber:s,blockTag:a,functionName:"aggregate3",stateOverride:l}))),w=[];for(let N=0;N<v.length;N++){const I=v[N];if(I.status==="rejected"){if(!n)throw I.reason;for(let R=0;R<f[N].length;R++)w.push({status:"failure",error:I.reason,result:void 0});continue}const P=I.value;for(let R=0;R<P.length;R++){const{returnData:F,success:U}=P[R],{callData:L}=f[N][R],{abi:z,address:Q,functionName:ne,args:J}=c[w.length];try{if(L==="0x")throw new Nk;if(!U)throw new aB({data:F});const X=i5({abi:z,args:J,data:F,functionName:ne});w.push(n?{result:X,status:"success"}:X)}catch(X){const re=y3(X,{abi:z,address:Q,args:J,docsPath:"/docs/contract/multicall",functionName:ne});if(!n)throw re;w.push({error:re,result:void 0,status:"failure"})}}}if(w.length!==c.length)throw new Rr("multicall results mismatch");return w}const rht="0.1.1";function sht(){return rht}let Nl=class AZ extends Error{constructor(t,n={}){const r=(()=>{var c;if(n.cause instanceof AZ){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof AZ&&n.cause.docsPath||n.docsPath,o=`https://oxlib.sh${s??""}`,l=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||s?["",r?`Details: ${r}`:void 0,s?`See: ${o}`:void 0]:[]].filter(c=>typeof c=="string").join(`
`);super(l,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${sht()}`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsPath=s,this.shortMessage=t}walk(t){return Z9e(this,t)}};function Z9e(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Z9e(e.cause,t):t?null:e}const iht="#__bigint";function aht(e,t,n){return JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString()+iht:s,n)}function oht(e,t){if(Tpe(e)>t)throw new ght({givenSize:Tpe(e),maxSize:t})}const Bx={zero:48,nine:57,A:65,F:70,a:97,f:102};function kpe(e){if(e>=Bx.zero&&e<=Bx.nine)return e-Bx.zero;if(e>=Bx.A&&e<=Bx.F)return e-(Bx.A-10);if(e>=Bx.a&&e<=Bx.f)return e-(Bx.a-10)}function lht(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new bht({size:e.length,targetSize:r,type:"Bytes"});const s=new Uint8Array(r);for(let a=0;a<r;a++){const o=n==="right";s[o?a:r-a-1]=e[o?a:e.length-a-1]}return s}function Nie(e,t){if(ap(e)>t)throw new Sht({givenSize:ap(e),maxSize:t})}function cht(e,t){if(typeof t=="number"&&t>0&&t>ap(e)-1)throw new rEe({offset:t,position:"start",size:ap(e)})}function uht(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ap(e)!==n-t)throw new rEe({offset:n,position:"end",size:ap(e)})}function J9e(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const s=e.replace("0x","");if(s.length>r*2)throw new Nht({size:Math.ceil(s.length/2),targetSize:r,type:"Hex"});return`0x${s[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const dht=new TextEncoder;function fht(e){return e instanceof Uint8Array?e:typeof e=="string"?pht(e):hht(e)}function hht(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function pht(e,t={}){const{size:n}=t;let r=e;n&&(Nie(e,n),r=w3(e,n));let s=r.slice(2);s.length%2&&(s=`0${s}`);const a=s.length/2,o=new Uint8Array(a);for(let l=0,c=0;l<a;l++){const u=kpe(s.charCodeAt(c++)),d=kpe(s.charCodeAt(c++));if(u===void 0||d===void 0)throw new Nl(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);o[l]=u*16+d}return o}function mht(e,t={}){const{size:n}=t,r=dht.encode(e);return typeof n=="number"?(oht(r,n),xht(r,n)):r}function xht(e,t){return lht(e,{dir:"right",size:t})}function Tpe(e){return e.length}let ght=class extends Nl{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},bht=class extends Nl{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const yht=new TextEncoder,vht=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function wht(e,t={}){const{strict:n=!1}=t;if(!e)throw new Ipe(e);if(typeof e!="string")throw new Ipe(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new Ppe(e);if(!e.startsWith("0x"))throw new Ppe(e)}function Z0(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function eEe(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Nie(n,t.size),v3(n,t.size)):n}function tEe(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=vht[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(Nie(r,t.size),w3(r,t.size)):r}function td(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let a;r?n?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&n?-a-1n:0;if(a&&s>a||s<o){const u=typeof e=="bigint"?"n":"";throw new nEe({max:a?`${a}${u}`:void 0,min:`${o}${u}`,signed:n,size:r,value:`${e}${u}`})}const c=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?v3(c,r):c}function Aie(e,t={}){return tEe(yht.encode(e),t)}function v3(e,t){return J9e(e,{dir:"left",size:t})}function w3(e,t){return J9e(e,{dir:"right",size:t})}function jie(e,t,n,r={}){const{strict:s}=r;cht(e,t);const a=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&uht(a,t,n),a}function ap(e){return Math.ceil((e.length-2)/2)}function Cht(e,t={}){const{strict:n=!1}=t;try{return wht(e,{strict:n}),!0}catch{return!1}}class nEe extends Nl{constructor({max:t,min:n,signed:r,size:s,value:a}){super(`Number \`${a}\` is not in safe${s?` ${s*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class Ipe extends Nl{constructor(t){super(`Value \`${typeof t=="object"?aht(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class Ppe extends Nl{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class Sht extends Nl{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class rEe extends Nl{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class Nht extends Nl{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function Aht(e){return{address:e.address,amount:td(e.amount),index:td(e.index),validatorIndex:td(e.validatorIndex)}}function jht(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:td(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:td(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:td(e.gasLimit)},...typeof e.number=="bigint"&&{number:td(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:td(e.prevRandao)},...typeof e.time=="bigint"&&{time:td(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Aht)}}}async function jZ(e,t){const{blockNumber:n,blockTag:r="latest",blocks:s,returnFullTransactions:a,traceTransfers:o,validation:l}=t;try{const c=[];for(const x of s){const g=x.blockOverrides?jht(x.blockOverrides):void 0,v=x.calls.map(C=>{const N=C,I=N.account?Du(N.account):void 0,P={...N,data:N.abi?Sm(N):N.data,from:N.from??(I==null?void 0:I.address)};return pA(P),kk(P)}),w=x.stateOverrides?lie(x.stateOverrides):void 0;c.push({blockOverrides:g,calls:v,stateOverrides:w})}const d=(n?Ds(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:a,traceTransfers:o,validation:l},d]})).map((x,g)=>({...aie(x),calls:x.calls.map((v,w)=>{var ne,J;const{abi:C,args:N,functionName:I,to:P}=s[g].calls[w],R=((ne=v.error)==null?void 0:ne.data)??v.returnData,F=BigInt(v.gasUsed),U=(J=v.logs)==null?void 0:J.map(X=>s1(X)),L=v.status==="0x1"?"success":"failure",z=C&&L==="success"&&R!=="0x"?i5({abi:C,data:R,functionName:I}):null,Q=(()=>{var re;if(L==="success")return;let X;if(((re=v.error)==null?void 0:re.data)==="0x"?X=new Nk:v.error&&(X=new aB(v.error)),!!X)return y3(X,{abi:C??[],address:P,args:N,functionName:I??"<unknown>"})})();return{data:R,gasUsed:F,logs:U,status:L,...L==="success"?{result:z}:{error:Q}}})}))}catch(c){const u=c,d=tB(u,{});throw d instanceof Ek?u:d}}function Fpe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Eht(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Eie(e,...t){if(!Eht(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Ope(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _ht(e,t){Eie(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kht=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Mpe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Tht=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Rpe(e){for(let t=0;t<e.length;t++)e[t]=Tht(e[t])}function Iht(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function sEe(e){return typeof e=="string"&&(e=Iht(e)),Eie(e),e}let Pht=class{clone(){return this._cloneInto()}};function Fht(e){const t=r=>e().update(sEe(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const OI=BigInt(2**32-1),Lpe=BigInt(32);function Oht(e,t=!1){return t?{h:Number(e&OI),l:Number(e>>Lpe&OI)}:{h:Number(e>>Lpe&OI)|0,l:Number(e&OI)|0}}function Mht(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=Oht(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const Rht=(e,t,n)=>e<<n|t>>>32-n,Lht=(e,t,n)=>t<<n|e>>>32-n,Dht=(e,t,n)=>t<<n-32|e>>>64-n,Bht=(e,t,n)=>e<<n-32|t>>>64-n,iEe=[],aEe=[],oEe=[],$ht=BigInt(0),b7=BigInt(1),Uht=BigInt(2),zht=BigInt(7),Hht=BigInt(256),Vht=BigInt(113);for(let e=0,t=b7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],iEe.push(2*(5*r+n)),aEe.push((e+1)*(e+2)/2%64);let s=$ht;for(let a=0;a<7;a++)t=(t<<b7^(t>>zht)*Vht)%Hht,t&Uht&&(s^=b7<<(b7<<BigInt(a))-b7);oEe.push(s)}const[Wht,qht]=Mht(oEe,!0),Dpe=(e,t,n)=>n>32?Dht(e,t,n):Rht(e,t,n),Bpe=(e,t,n)=>n>32?Bht(e,t,n):Lht(e,t,n);function Ght(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=Dpe(u,d,1)^n[l],x=Bpe(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=aEe[o],c=Dpe(s,a,l),u=Bpe(s,a,l),d=iEe[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=Wht[r],e[1]^=qht[r]}n.fill(0)}let Kht=class lEe extends Pht{constructor(t,n,r,s=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Fpe(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=kht(this.state)}keccak(){Mpe||Rpe(this.state32),Ght(this.state32,this.rounds),Mpe||Rpe(this.state32),this.posOut=0,this.pos=0}update(t){Ope(this);const{blockLen:n,state:r}=this;t=sEe(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){Ope(this,!1),Eie(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Fpe(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(_ht(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new lEe(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const Yht=(e,t,n)=>Fht(()=>new Kht(t,e,n)),Xht=Yht(1,136,256/8);function cEe(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Xht(fht(e));return n==="Bytes"?r:tEe(r)}class Qht extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Zht={checksum:new Qht(8192)},rH=Zht.checksum,Jht=/^0x[a-fA-F0-9]{40}$/;function dB(e,t={}){const{strict:n=!0}=t;if(!Jht.test(e))throw new $pe({address:e,cause:new tpt});if(n){if(e.toLowerCase()===e)return;if(ept(e)!==e)throw new $pe({address:e,cause:new npt})}}function ept(e){if(rH.has(e))return rH.get(e);dB(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=cEe(mht(t),{as:"Bytes"}),r=t.split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&r[a]&&(r[a]=r[a].toUpperCase()),(n[a>>1]&15)>=8&&r[a+1]&&(r[a+1]=r[a+1].toUpperCase());const s=`0x${r.join("")}`;return rH.set(e,s),s}function EZ(e,t={}){const{strict:n=!0}=t??{};try{return dB(e,{strict:n}),!0}catch{return!1}}let $pe=class extends Nl{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},tpt=class extends Nl{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}};class npt extends Nl{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function _Z(e){let t=!0,n="",r=0,s="",a=!1;for(let o=0;o<e.length;o++){const l=e[o];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function","error",""].includes(s))s="";else if(s+=l,l===")"){a=!0;break}continue}if(l===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=l,n+=l}}if(!a)throw new Nl("Unable to normalize signature.");return s}function kZ(e,t){const n=typeof e,r=t.type;switch(r){case"address":return EZ(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>kZ(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>kZ(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function uEe(e,t,n){for(const r in e){const s=e[r],a=t[r];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return uEe(s.components,a.components,n[r]);const o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?EZ(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?EZ(n[r],{strict:!1}):!1)return o}}function dEe(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?wpe(e):e;return{...r,...n?{hash:FC(r)}:{}}}function rpt(e,t,n){const{args:r=[],prepare:s=!0}=n,a=Cht(t,{strict:!1}),o=e.filter(u=>a?u.type==="function"||u.type==="error"?fEe(u)===jie(t,0,4):u.type==="event"?FC(u)===t:!1:"name"in u&&u.name===t);if(o.length===0)throw new TZ({name:t});if(o.length===1)return{...o[0],...s?{hash:FC(o[0])}:{}};let l;for(const u of o){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...s?{hash:FC(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((f,x)=>{const g="inputs"in u&&u.inputs[x];return g?kZ(f,g):!1})){if(l&&"inputs"in l&&l.inputs){const f=uEe(u.inputs,l.inputs,r);if(f)throw new ipt({abiItem:u,type:f[0]},{abiItem:l,type:f[1]})}l=u}}const c=(()=>{if(l)return l;const[u,...d]=o;return{...u,overloads:d}})();if(!c)throw new TZ({name:t});return{...c,...s?{hash:FC(c)}:{}}}function fEe(e){return jie(FC(e),0,4)}function spt(e){const t=typeof e=="string"?e:rM(e);return _Z(t)}function FC(e){return typeof e!="string"&&"hash"in e&&e.hash?e.hash:cEe(Aie(spt(e)))}class ipt extends Nl{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${_Z(rM(t.abiItem))}\`, and`,`\`${n.type}\` in \`${_Z(rM(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class TZ extends Nl{constructor({name:t,data:n,type:r="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}const apt=/^(.*)\[([0-9]*)\]$/,opt=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,hEe=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function lpt({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(_ie({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function _ie({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=xpt(r.type);if(s){const[a,o]=s;return upt(n,{checksumAddress:e,length:a,parameter:{...r,type:o}})}if(r.type==="tuple")return mpt(n,{checksumAddress:e,parameter:r});if(r.type==="address")return cpt(n,{checksum:e});if(r.type==="bool")return fpt(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const a=r.type.startsWith("int"),[,,o="256"]=hEe.exec(r.type)??[];return hpt(n,{signed:a,size:Number(o)})}if(r.type.startsWith("bytes"))return dpt(n,{type:r.type});if(r.type==="string")return ppt(n);throw new bEe(r.type)}function kie(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?t+=32:t+=ap(l)}const n=[],r=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?(n.push(td(t+s,{size:32})),r.push(l),s+=ap(l)):n.push(l)}return Z0(...n,...r)}function cpt(e,t){const{checksum:n=!1}=t;return dB(e,{strict:n}),{dynamic:!1,encoded:v3(e.toLowerCase())}}function upt(e,t){const{checksumAddress:n,length:r,parameter:s}=t,a=r===null;if(!Array.isArray(e))throw new bpt(e);if(!a&&e.length!==r)throw new gpt({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let o=!1;const l=[];for(let c=0;c<e.length;c++){const u=_ie({checksumAddress:n,parameter:s,value:e[c]});u.dynamic&&(o=!0),l.push(u)}if(a||o){const c=kie(l);if(a){const u=td(l.length,{size:32});return{dynamic:!0,encoded:l.length>0?Z0(u,c):u}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:Z0(...l.map(({encoded:c})=>c))}}function dpt(e,{type:t}){const[,n]=t.split("bytes"),r=ap(e);if(!n){let s=e;return r%32!==0&&(s=w3(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Z0(v3(td(r,{size:32})),s)}}if(r!==Number.parseInt(n))throw new xEe({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:w3(e)}}function fpt(e){if(typeof e!="boolean")throw new Nl(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:v3(eEe(e))}}function hpt(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new nEe({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:td(e,{size:32,signed:t})}}function ppt(e){const t=Aie(e),n=Math.ceil(ap(t)/32),r=[];for(let s=0;s<n;s++)r.push(w3(jie(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:Z0(w3(td(ap(t),{size:32})),...r)}}function mpt(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const a=[];for(let o=0;o<r.components.length;o++){const l=r.components[o],c=Array.isArray(e)?o:l.name,u=_ie({checksumAddress:n,parameter:l,value:e[c]});a.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?kie(a):Z0(...a.map(({encoded:o})=>o))}}function xpt(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function pEe(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new gEe({expectedLength:e.length,givenLength:t.length});const s=lpt({checksumAddress:r,parameters:e,values:t}),a=kie(s);return a.length===0?"0x":a}function mEe(e,t){if(e.length!==t.length)throw new gEe({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],a=t[r];n.push(mEe.encode(s,a))}return Z0(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const c=r;return dB(c),v3(c.toLowerCase(),s?32:0)}if(n==="string")return Aie(r);if(n==="bytes")return r;if(n==="bool")return v3(eEe(r),s?32:1);const a=n.match(hEe);if(a){const[c,u,d="256"]=a,f=Number.parseInt(d)/8;return td(r,{size:s?32:f,signed:u==="int"})}const o=n.match(opt);if(o){const[c,u]=o;if(Number.parseInt(u)!==(r.length-2)/2)throw new xEe({expectedSize:Number.parseInt(u),value:r});return w3(r,s?32:0)}const l=n.match(apt);if(l&&Array.isArray(r)){const[c,u]=l,d=[];for(let f=0;f<r.length;f++)d.push(t(u,r[f],!0));return d.length===0?"0x":Z0(...d)}throw new bEe(n)}e.encode=t})(mEe);class gpt extends Nl{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class xEe extends Nl{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ap(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class gEe extends Nl{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class bpt extends Nl{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class bEe extends Nl{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function ypt(e,t){var s;const{bytecode:n,args:r}=t;return Z0(n,(s=e.inputs)!=null&&s.length&&(r!=null&&r.length)?pEe(e.inputs,r):"0x")}function vpt(e){return dEe(e)}function wpt(e,...t){const{overloads:n}=e,r=n?Cpt([e,...n],e.name,{args:t[0]}):e,s=Spt(r),a=t.length>0?pEe(r.inputs,t[0]):void 0;return a?Z0(s,a):s}function L6(e,t={}){return dEe(e,t)}function Cpt(e,t,n){const r=rpt(e,t,n);if(r.type!=="function")throw new TZ({name:t,type:"function"});return r}function Spt(e){return fEe(e)}const Npt="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Gm="0x0000000000000000000000000000000000000000",MI=new XD(8192);function Apt(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(MI.get(n))return MI.get(n);const r=e().finally(()=>MI.delete(n));return MI.set(n,r),r}async function IZ(e){return new Promise(t=>setTimeout(t,e))}function sM(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((s,a)=>{const o=async({count:l=0}={})=>{const c=async({error:u})=>{const d=typeof t=="function"?t({count:l,error:u}):t;d&&await IZ(d),o({count:l+1})};try{const u=await e();s(u)}catch(u){if(l<n&&await r({count:l,error:u}))return c({error:u});a(u)}};o()})}function jpt(e,t={}){return async(n,r={})=>{var f;const{dedupe:s=!1,methods:a,retryDelay:o=150,retryCount:l=3,uid:c}={...t,...r},{method:u}=n;if((f=a==null?void 0:a.exclude)!=null&&f.includes(u))throw new Vv(new Error("method not supported"),{method:u});if(a!=null&&a.include&&!a.include.includes(u))throw new Vv(new Error("method not supported"),{method:u});const d=s?TS(`${c}.${Tc(n)}`):void 0;return Apt(()=>sM(async()=>{try{return await e(n)}catch(x){const g=x;switch(g.code){case M9.code:throw new M9(g);case R9.code:throw new R9(g);case L9.code:throw new L9(g,{method:n.method});case D9.code:throw new D9(g);case x3.code:throw new x3(g);case g3.code:throw new g3(g);case B9.code:throw new B9(g);case Cy.code:throw new Cy(g);case $9.code:throw new $9(g);case Vv.code:throw new Vv(g,{method:n.method});case FS.code:throw new FS(g);case U9.code:throw new U9(g);case bo.code:throw new bo(g);case z9.code:throw new z9(g);case H9.code:throw new H9(g);case V9.code:throw new V9(g);case W9.code:throw new W9(g);case ip.code:throw new ip(g);case q9.code:throw new q9(g);case G9.code:throw new G9(g);case K9.code:throw new K9(g);case Y9.code:throw new Y9(g);case X9.code:throw new X9(g);case Q9.code:throw new Q9(g);case Z9.code:throw new Z9(g);case 5e3:throw new bo(g);default:throw x instanceof Rr?x:new Aut(g)}}},{delay:({count:x,error:g})=>{var v;if(g&&g instanceof zj){const w=(v=g==null?void 0:g.headers)==null?void 0:v.get("Retry-After");if(w!=null&&w.match(/\d/))return Number.parseInt(w)*1e3}return~~(1<<x)*o},retryCount:l,shouldRetry:({error:x})=>Ept(x)}),{enabled:s,id:d})}}function Ept(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===FS.code||e.code===x3.code:e instanceof zj&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function fB(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function Tie(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,a)=>{(async()=>{let o;try{const l=new AbortController;n>0&&(o=setTimeout(()=>{r?l.abort():a(t)},n)),s(await e({signal:(l==null?void 0:l.signal)||null}))}catch(l){(l==null?void 0:l.name)==="AbortError"&&a(t),a(l)}finally{clearTimeout(o)}})()})}function _pt(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Upe=_pt();function kpt(e,t={}){return{async request(n){var f;const{body:r,onRequest:s=t.onRequest,onResponse:a=t.onResponse,timeout:o=t.timeout??1e4}=n,l={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:u,signal:d}=l;try{const x=await Tie(async({signal:v})=>{const w={...l,body:Array.isArray(r)?Tc(r.map(P=>({jsonrpc:"2.0",id:P.id??Upe.take(),...P}))):Tc({jsonrpc:"2.0",id:r.id??Upe.take(),...r}),headers:{"Content-Type":"application/json",...c},method:u||"POST",signal:d||(o>0?v:null)},C=new Request(e,w),N=await(s==null?void 0:s(C,w))??{...w,url:e};return await fetch(N.url??e,N)},{errorInstance:new upe({body:r,url:e}),timeout:o,signal:!0});a&&await a(x);let g;if((f=x.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))g=await x.json();else{g=await x.text();try{g=JSON.parse(g||"{}")}catch(v){if(x.ok)throw v;g={error:g}}}if(!x.ok)throw new zj({body:r,details:Tc(g.error)||x.statusText,headers:x.headers,status:x.status,url:e});return g}catch(x){throw x instanceof zj||x instanceof upe?x:new zj({body:r,cause:x,url:e})}}}}class Tpt extends Rr{constructor({domain:t}){super(`Invalid domain "${Tc(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Ipt extends Rr{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class Ppt extends Rr{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Fpt(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:NEe({domain:t}),...e.types};SEe({domain:t,message:n,primaryType:r,types:s});const a=["0x1901"];return t&&a.push(Opt({domain:t,types:s})),r!=="EIP712Domain"&&a.push(yEe({data:n,primaryType:r,types:s})),eu(r1(a))}function Opt({domain:e,types:t}){return yEe({data:e,primaryType:"EIP712Domain",types:t})}function yEe({data:e,primaryType:t,types:n}){const r=vEe({data:e,primaryType:t,types:n});return eu(r)}function vEe({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[Mpt({primaryType:t,types:n})];for(const a of n[t]){const[o,l]=CEe({types:n,name:a.name,type:a.type,value:e[a.name]});r.push(o),s.push(l)}return s2(r,s)}function Mpt({primaryType:e,types:t}){const n=oi(Rpt({primaryType:e,types:t}));return eu(n)}function Rpt({primaryType:e,types:t}){let n="";const r=wEe({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const a of s)n+=`${a}(${t[a].map(({name:o,type:l})=>`${l} ${o}`).join(",")})`;return n}function wEe({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r==null?void 0:r[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const a of t[s])wEe({primaryType:a.type,types:t},n);return n}function CEe({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},eu(vEe({data:r,primaryType:n,types:e}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},eu(r)];if(n==="string")return[{type:"bytes32"},eu(oi(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),a=r.map(o=>CEe({name:t,type:s,types:e,value:o}));return[{type:"bytes32"},eu(s2(a.map(([o])=>o),a.map(([,o])=>o)))]}return[{type:n},r]}function Lpt(e){const{domain:t,message:n,primaryType:r,types:s}=e,a=(c,u)=>{const d={...u};for(const f of c){const{name:x,type:g}=f;g==="address"&&(d[x]=d[x].toLowerCase())}return d},o=s.EIP712Domain?t?a(s.EIP712Domain,t):{}:{},l=(()=>{if(r!=="EIP712Domain")return a(s[r],n)})();return Tc({domain:o,message:l,primaryType:r,types:s})}function SEe(e){const{domain:t,message:n,primaryType:r,types:s}=e,a=(o,l)=>{for(const c of o){const{name:u,type:d}=c,f=l[u],x=d.match(Hje);if(x&&(typeof f=="number"||typeof f=="bigint")){const[w,C,N]=x;Ds(f,{signed:C==="int",size:Number.parseInt(N)/8})}if(d==="address"&&typeof f=="string"&&!ic(f))throw new pd({address:f});const g=d.match(Gct);if(g){const[w,C]=g;if(C&&rl(f)!==Number.parseInt(C))throw new gct({expectedSize:Number.parseInt(C),givenSize:rl(f)})}const v=s[d];v&&(Dpt(d),a(v,f))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new Tpt({domain:t});a(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])a(s[r],n);else throw new Ipt({primaryType:r,types:s})}function NEe({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Dpt(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Ppt({type:e})}function Bpt(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,s=n.address;if(!ic(s))throw new pd({address:s});if(r<0)throw new eB({chainId:r})}Iie(e)}function $pt(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new o9e;for(const n of t){const r=rl(n),s=X0(p3(n,0,1));if(r!==32)throw new Qut({hash:n,size:r});if(s!==a9e)throw new Zut({hash:n,version:s})}}Iie(e)}function Iie(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new eB({chainId:t});if(s&&!ic(s))throw new pd({address:s});if(r&&r>rB)throw new m3({maxFeePerGas:r});if(n&&r&&n>r)throw new O9({maxFeePerGas:r,maxPriorityFeePerGas:n})}function Upt(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:a}=e;if(t<=0)throw new eB({chainId:t});if(a&&!ic(a))throw new pd({address:a});if(n||s)throw new Rr("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>rB)throw new m3({maxFeePerGas:r})}function zpt(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:a}=e;if(a&&!ic(a))throw new pd({address:a});if(typeof t<"u"&&t<=0)throw new eB({chainId:t});if(n||s)throw new Rr("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>rB)throw new m3({maxFeePerGas:r})}function hB(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:s}=e[n];for(let a=0;a<s.length;a++)if(s[a].length-2!==64)throw new vut({storageKey:s[a]});if(!ic(r,{strict:!1}))throw new pd({address:r});t.push([r,s])}return t}function Hpt(e,t){const n=c9e(e);return n==="eip1559"?qpt(e,t):n==="eip2930"?Gpt(e,t):n==="eip4844"?Wpt(e,t):n==="eip7702"?Vpt(e,t):Kpt(e,t)}function Vpt(e,t){const{authorizationList:n,chainId:r,gas:s,nonce:a,to:o,value:l,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:f}=e;Bpt(e);const x=hB(d),g=Ypt(n);return Cm(["0x04",By([oi(r),a?oi(a):"0x",u?oi(u):"0x",c?oi(c):"0x",s?oi(s):"0x",o??"0x",l?oi(l):"0x",f??"0x",x,g,...Ok(e,t)])])}function Wpt(e,t){const{chainId:n,gas:r,nonce:s,to:a,value:o,maxFeePerBlobGas:l,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:f}=e;$pt(e);let x=e.blobVersionedHashes,g=e.sidecars;if(e.blobs&&(typeof x>"u"||typeof g>"u")){const P=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(U=>Wl(U)),R=e.kzg,F=die({blobs:P,kzg:R});if(typeof x>"u"&&(x=r9e({commitments:F})),typeof g>"u"){const U=fie({blobs:P,commitments:F,kzg:R});g=l9e({blobs:P,commitments:F,proofs:U})}}const v=hB(d),w=[oi(n),s?oi(s):"0x",u?oi(u):"0x",c?oi(c):"0x",r?oi(r):"0x",a??"0x",o?oi(o):"0x",f??"0x",v,l?oi(l):"0x",x??[],...Ok(e,t)],C=[],N=[],I=[];if(g)for(let P=0;P<g.length;P++){const{blob:R,commitment:F,proof:U}=g[P];C.push(R),N.push(F),I.push(U)}return Cm(["0x03",By(g?[w,C,N,I]:w)])}function qpt(e,t){const{chainId:n,gas:r,nonce:s,to:a,value:o,maxFeePerGas:l,maxPriorityFeePerGas:c,accessList:u,data:d}=e;Iie(e);const f=hB(u),x=[oi(n),s?oi(s):"0x",c?oi(c):"0x",l?oi(l):"0x",r?oi(r):"0x",a??"0x",o?oi(o):"0x",d??"0x",f,...Ok(e,t)];return Cm(["0x02",By(x)])}function Gpt(e,t){const{chainId:n,gas:r,data:s,nonce:a,to:o,value:l,accessList:c,gasPrice:u}=e;Upt(e);const d=hB(c),f=[oi(n),a?oi(a):"0x",u?oi(u):"0x",r?oi(r):"0x",o??"0x",l?oi(l):"0x",s??"0x",d,...Ok(e,t)];return Cm(["0x01",By(f)])}function Kpt(e,t){const{chainId:n=0,gas:r,data:s,nonce:a,to:o,value:l,gasPrice:c}=e;zpt(e);let u=[a?oi(a):"0x",c?oi(c):"0x",r?oi(r):"0x",o??"0x",l?oi(l):"0x",s??"0x"];if(t){const d=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const g=27n+(t.v===27n?0n:1n);if(t.v!==g)throw new but({v:t.v});return g})(),f=Hf(t.r),x=Hf(t.s);u=[...u,oi(d),f==="0x00"?"0x":f,x==="0x00"?"0x":x]}else n>0&&(u=[...u,oi(n),"0x","0x"]);return By(u)}function Ok(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const a=Hf(n.r),o=Hf(n.s);return[typeof s=="number"?s?oi(1):"0x":r===0n?"0x":r===1n?oi(1):r===27n?"0x":oi(1),a==="0x00"?"0x":a,o==="0x00"?"0x":o]}function Ypt(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:s,...a}=n,o=n.address;t.push([r?oi(r):"0x",o,s?oi(s):"0x",...Ok({},a)])}return t}const Xpt=`Ethereum Signed Message:
`;function Qpt(e){const t=typeof e=="string"?TS(e):typeof e.raw=="string"?e.raw:Wl(e.raw),n=TS(`${Xpt}${rl(t)}`);return r1([n,t])}function AEe(e,t){return eu(Qpt(e),t)}const jEe="0x6492649264926492649264926492649264926492649264926492649264926492";function Zpt(e){return zje(e,-32)===jEe}function Jpt(e){const{address:t,data:n,signature:r,to:s="hex"}=e,a=Cm([s2([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,n,r]),jEe]);return s==="hex"?a:sp(a)}class emt extends Rr{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function tmt(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new emt({value:e});let[n,r="0"]=e.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[a,o,l]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],c=Math.round(+`${o}.${l}`);c>9?r=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):r=`${a}${c}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${s?"-":""}${n}${r}`)}const nmt="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function rmt(e,t){const{blockNumber:n,blockTag:r,calls:s,stateOverrides:a,traceAssetChanges:o,traceTransfers:l,validation:c}=t,u=t.account?Du(t.account):void 0;if(o&&!u)throw new Rr("`account` is required when `traceAssetChanges` is true");const d=u?ypt(vpt("constructor(bytes, bytes)"),{bytecode:R9e,args:[nmt,wpt(L6("function getBalance(address)"),[u.address])]}):void 0,f=o?await Promise.all(t.calls.map(async V=>{if(!V.data&&!V.abi)return;const{accessList:te}=await W9e(e,{account:u.address,...V,data:V.abi?Sm(V):V.data});return te.map(({address:ae,storageKeys:he})=>he.length>0?ae:null)})).then(V=>V.flat().filter(Boolean)):[],x=a==null?void 0:a.map(V=>V.address===(u==null?void 0:u.address)?{...V,nonce:0}:V),g=await jZ(e,{blockNumber:n,blockTag:r,blocks:[...o?[{calls:[{data:d}],stateOverrides:a},{calls:f.map((V,te)=>({abi:[L6("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:V,from:Gm,nonce:te})),stateOverrides:[{address:Gm,nonce:0}]}]:[],{calls:[...s,{}].map((V,te)=>({...V,from:u==null?void 0:u.address,nonce:te})),stateOverrides:x},...o?[{calls:[{data:d}]},{calls:f.map((V,te)=>({abi:[L6("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:V,from:Gm,nonce:te})),stateOverrides:[{address:Gm,nonce:0}]},{calls:f.map((V,te)=>({to:V,abi:[L6("function decimals() returns (uint256)")],functionName:"decimals",from:Gm,nonce:te})),stateOverrides:[{address:Gm,nonce:0}]},{calls:f.map((V,te)=>({to:V,abi:[L6("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Gm,nonce:te})),stateOverrides:[{address:Gm,nonce:0}]},{calls:f.map((V,te)=>({to:V,abi:[L6("function symbol() returns (string)")],functionName:"symbol",from:Gm,nonce:te})),stateOverrides:[{address:Gm,nonce:0}]}]:[]],traceTransfers:l,validation:c}),v=o?g[2]:g[0],[w,C,,N,I,P,R,F]=o?g:[],{calls:U,...L}=v,z=U.slice(0,-1)??[],Q=(w==null?void 0:w.calls)??[],ne=(C==null?void 0:C.calls)??[],J=[...Q,...ne].map(V=>V.status==="success"?nd(V.data):null),X=(N==null?void 0:N.calls)??[],re=(I==null?void 0:I.calls)??[],pe=[...X,...re].map(V=>V.status==="success"?nd(V.data):null),Y=((P==null?void 0:P.calls)??[]).map(V=>V.status==="success"?V.result:null),ie=((F==null?void 0:F.calls)??[]).map(V=>V.status==="success"?V.result:null),oe=((R==null?void 0:R.calls)??[]).map(V=>V.status==="success"?V.result:null),G=[];for(const[V,te]of pe.entries()){const ae=J[V];if(typeof te!="bigint"||typeof ae!="bigint")continue;const he=Y[V-1],Ce=ie[V-1],ce=oe[V-1],ge=V===0?{address:Npt,decimals:18,symbol:"ETH"}:{address:f[V-1],decimals:ce||he?Number(he??1):void 0,symbol:Ce??void 0};G.some(Ae=>Ae.token.address===ge.address)||G.push({token:ge,value:{pre:ae,post:te,diff:te-ae}})}return{assetChanges:G,block:L,results:z}}const sH=new Map,zpe=new Map;let smt=0;function $y(e,t,n){const r=++smt,s=()=>sH.get(e)||[],a=()=>{const d=s();sH.set(e,d.filter(f=>f.id!==r))},o=()=>{const d=s();if(!d.some(x=>x.id===r))return;const f=zpe.get(e);d.length===1&&f&&f(),a()},l=s();if(sH.set(e,[...l,{id:r,fns:t}]),l.length>0)return o;const c={};for(const d in t)c[d]=(...f)=>{var g,v;const x=s();if(x.length!==0)for(const w of x)(v=(g=w.fns)[d])==null||v.call(g,...f)};const u=n(c);return typeof u=="function"&&zpe.set(e,u),o}function Mk(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const a=()=>s=!1;return(async()=>{let l;t&&(l=await e({unpoll:a}));const c=await(n==null?void 0:n(l))??r;await IZ(c);const u=async()=>{s&&(await e({unpoll:a}),await IZ(r),u())};u()})(),a}function imt(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:a,includeTransactions:o,poll:l,pollingInterval:c=e.pollingInterval}){const u=typeof l<"u"?l:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),d=o??!1;let f;return u?(()=>{const v=Tc(["watchBlocks",e.uid,t,n,r,d,c]);return $y(v,{onBlock:s,onError:a},w=>Mk(async()=>{var C;try{const N=await ti(e,j0,"getBlock")({blockTag:t,includeTransactions:d});if(N.number&&(f!=null&&f.number)){if(N.number===f.number)return;if(N.number-f.number>1&&n)for(let I=(f==null?void 0:f.number)+1n;I<N.number;I++){const P=await ti(e,j0,"getBlock")({blockNumber:I,includeTransactions:d});w.onBlock(P,f),f=P}}(!(f!=null&&f.number)||t==="pending"&&!(N!=null&&N.number)||N.number&&N.number>f.number)&&(w.onBlock(N,f),f=N)}catch(N){(C=w.onError)==null||C.call(w,N)}},{emitOnBegin:r,interval:c}))})():(()=>{let v=!0,w=!0,C=()=>v=!1;return(async()=>{try{r&&ti(e,j0,"getBlock")({blockTag:t,includeTransactions:d}).then(P=>{v&&w&&(s(P,void 0),w=!1)});const N=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(R=>R.config.type==="webSocket");return P?P.value:e.transport}return e.transport})(),{unsubscribe:I}=await N.subscribe({params:["newHeads"],async onData(P){if(!v)return;const R=await ti(e,j0,"getBlock")({blockNumber:P.blockNumber,includeTransactions:d}).catch(()=>{});v&&(s(R,f),w=!1,f=R)},onError(P){a==null||a(P)}});C=I,v||C()}catch(N){a==null||a(N)}})(),()=>C()})()}function EEe(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:a,pollingInterval:o=e.pollingInterval}){const l=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket");let c;return l?(()=>{const f=Tc(["watchBlockNumber",e.uid,t,n,o]);return $y(f,{onBlockNumber:r,onError:s},x=>Mk(async()=>{var g;try{const v=await ti(e,Fk,"getBlockNumber")({cacheTime:0});if(c){if(v===c)return;if(v-c>1&&n)for(let w=c+1n;w<v;w++)x.onBlockNumber(w,c),c=w}(!c||v>c)&&(x.onBlockNumber(v,c),c=v)}catch(v){(g=x.onError)==null||g.call(x,v)}},{emitOnBegin:t,interval:o}))})():(()=>{const f=Tc(["watchBlockNumber",e.uid,t,n]);return $y(f,{onBlockNumber:r,onError:s},x=>{let g=!0,v=()=>g=!1;return(async()=>{try{const w=(()=>{if(e.transport.type==="fallback"){const N=e.transport.transports.find(I=>I.config.type==="webSocket");return N?N.value:e.transport}return e.transport})(),{unsubscribe:C}=await w.subscribe({params:["newHeads"],onData(N){var P;if(!g)return;const I=nd((P=N.result)==null?void 0:P.number);x.onBlockNumber(I,c),c=I},onError(N){var I;(I=x.onError)==null||I.call(x,N)}});v=C,g||v()}catch(w){s==null||s(w)}})(),()=>v()})})()}async function pB(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function amt(e,{address:t,args:n,batch:r=!0,event:s,events:a,fromBlock:o,onError:l,onLogs:c,poll:u,pollingInterval:d=e.pollingInterval,strict:f}){const x=typeof u<"u"?u:typeof o=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),g=f??!1;return x?(()=>{const C=Tc(["watchEvent",t,n,r,e.uid,s,d,o]);return $y(C,{onLogs:c,onError:l},N=>{let I;o!==void 0&&(I=o-1n);let P,R=!1;const F=Mk(async()=>{var U;if(!R){try{P=await ti(e,G9e,"createEventFilter")({address:t,args:n,event:s,events:a,strict:g,fromBlock:o})}catch{}R=!0;return}try{let L;if(P)L=await ti(e,uB,"getFilterChanges")({filter:P});else{const z=await ti(e,Fk,"getBlockNumber")({});I&&I!==z?L=await ti(e,Cie,"getLogs")({address:t,args:n,event:s,events:a,fromBlock:I+1n,toBlock:z}):L=[],I=z}if(L.length===0)return;if(r)N.onLogs(L);else for(const z of L)N.onLogs([z])}catch(L){P&&L instanceof g3&&(R=!1),(U=N.onError)==null||U.call(N,L)}},{emitOnBegin:!0,interval:d});return async()=>{P&&await ti(e,pB,"uninstallFilter")({filter:P}),F()}})})():(()=>{let C=!0,N=()=>C=!1;return(async()=>{try{const I=(()=>{if(e.transport.type==="fallback"){const U=e.transport.transports.find(L=>L.config.type==="webSocket");return U?U.value:e.transport}return e.transport})(),P=a??(s?[s]:void 0);let R=[];P&&(R=[P.flatMap(L=>Pk({abi:[L],eventName:L.name,args:n}))],s&&(R=R[0]));const{unsubscribe:F}=await I.subscribe({params:["logs",{address:t,topics:R}],onData(U){var z;if(!C)return;const L=U.result;try{const{eventName:Q,args:ne}=vie({abi:P??[],data:L.data,topics:L.topics,strict:g}),J=s1(L,{args:ne,eventName:Q});c([J])}catch(Q){let ne,J;if(Q instanceof F9||Q instanceof YD){if(f)return;ne=Q.abiItem.name,J=(z=Q.abiItem.inputs)==null?void 0:z.some(re=>!("name"in re&&re.name))}const X=s1(L,{args:J?[]:{},eventName:ne});c([X])}},onError(U){l==null||l(U)}});N=F,C||N()}catch(I){l==null||l(I)}})(),()=>N()})()}function omt(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:a=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket")?(()=>{const u=Tc(["watchPendingTransactions",e.uid,t,a]);return $y(u,{onTransactions:r,onError:n},d=>{let f;const x=Mk(async()=>{var g;try{if(!f)try{f=await ti(e,K9e,"createPendingTransactionFilter")({});return}catch(w){throw x(),w}const v=await ti(e,uB,"getFilterChanges")({filter:f});if(v.length===0)return;if(t)d.onTransactions(v);else for(const w of v)d.onTransactions([w])}catch(v){(g=d.onError)==null||g.call(d,v)}},{emitOnBegin:!0,interval:a});return async()=>{f&&await ti(e,pB,"uninstallFilter")({filter:f}),x()}})})():(()=>{let u=!0,d=()=>u=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(x){if(!u)return;const g=x.result;r([g])},onError(x){n==null||n(x)}});d=f,u||d()}catch(f){n==null||n(f)}})(),()=>d()})()}function lmt(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function cmt(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?X0(e.nonce):void 0,storageProof:e.storageProof?lmt(e.storageProof):void 0}}async function umt(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const a=r??"latest",o=n!==void 0?Ds(n):void 0,l=await e.request({method:"eth_getProof",params:[t,s,o||a]});return cmt(l)}async function dmt(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:s=e.pollingInterval,retryCount:a=6,retryDelay:o=({count:c})=>~~(1<<c)*200,timeout:l=18e4}){const c=Tc(["waitForTransactionReceipt",e.uid,n]);let u,d,f,x=!1;const{promise:g,resolve:v,reject:w}=D9e(),C=l?setTimeout(()=>w(new Cut({hash:n})),l):void 0,N=$y(c,{onReplaced:r,resolve:v,reject:w},I=>{const P=ti(e,EEe,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(R){const F=L=>{clearTimeout(C),P(),L(),N()};let U=R;if(!x)try{if(f){if(t>1&&(!f.blockNumber||U-f.blockNumber+1n<t))return;F(()=>I.resolve(f));return}if(u||(x=!0,await sM(async()=>{u=await ti(e,Sie,"getTransaction")({hash:n}),u.blockNumber&&(U=u.blockNumber)},{delay:o,retryCount:a}),x=!1),f=await ti(e,NZ,"getTransactionReceipt")({hash:n}),t>1&&(!f.blockNumber||U-f.blockNumber+1n<t))return;F(()=>I.resolve(f))}catch(L){if(L instanceof Xje||L instanceof Qje){if(!u){x=!1;return}try{d=u,x=!0;const z=await sM(()=>ti(e,j0,"getBlock")({blockNumber:U,includeTransactions:!0}),{delay:o,retryCount:a,shouldRetry:({error:J})=>J instanceof Zje});x=!1;const Q=z.transactions.find(({from:J,nonce:X})=>J===d.from&&X===d.nonce);if(!Q||(f=await ti(e,NZ,"getTransactionReceipt")({hash:Q.hash}),t>1&&(!f.blockNumber||U-f.blockNumber+1n<t)))return;let ne="replaced";Q.to===d.to&&Q.value===d.value&&Q.input===d.input?ne="repriced":Q.from===Q.to&&Q.value===0n&&(ne="cancelled"),F(()=>{var J;(J=I.onReplaced)==null||J.call(I,{reason:ne,replacedTransaction:d,transaction:Q,transactionReceipt:f}),I.resolve(f)})}catch(z){F(()=>I.reject(z))}}else F(()=>I.reject(L))}}})});return g}async function fmt(e,{account:t=e.account,message:n}){if(!t)throw new JD({docsPath:"/docs/actions/wallet/signMessage"});const r=Du(t);if(r.signMessage)return r.signMessage({message:n});const s=typeof n=="string"?TS(n):n.raw instanceof Uint8Array?oi(n.raw):n.raw;return e.request({method:"personal_sign",params:[s,r.address]},{retryCount:0})}async function hmt(e,t){const{account:n=e.account,domain:r,message:s,primaryType:a}=t;if(!n)throw new JD({docsPath:"/docs/actions/wallet/signTypedData"});const o=Du(n),l={EIP712Domain:NEe({domain:r}),...t.types};if(SEe({domain:r,message:s,primaryType:a,types:l}),o.signTypedData)return o.signTypedData({domain:r,message:s,primaryType:a,types:l});const c=Lpt({domain:r,message:s,primaryType:a,types:l});return e.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function pmt(e,t){const{abi:n,address:r,args:s,dataSuffix:a,functionName:o,...l}=t,c=l.account?Du(l.account):e.account,u=Sm({abi:n,args:s,functionName:o});try{const{data:d}=await ti(e,lB,"call")({batch:!1,data:`${u}${a?a.replace("0x",""):""}`,to:r,...l,account:c}),f=i5({abi:n,args:s,functionName:o,data:d||"0x"}),x=n.filter(g=>"name"in g&&g.name===t.functionName);return{result:f,request:{abi:x,address:r,args:s,dataSuffix:a,functionName:o,...l,account:c}}}catch(d){throw y3(d,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}let _Ee=class extends Kse{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Sct(t);const r=QD(n);if(this.iHash=t.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 s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return PS(this),this.iHash.update(t),this}digestInto(t){PS(this),Ak(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:o,outputLen:l}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const kEe=(e,t,n)=>new _Ee(e,t).update(n).digest();kEe.create=(e,t)=>new _Ee(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Pie=BigInt(0),PZ=BigInt(1);function OS(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Fie(e){if(!OS(e))throw new Error("Uint8Array expected")}function eE(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function RI(e){const t=e.toString(16);return t.length&1?"0"+t:t}function TEe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Pie:BigInt("0x"+e)}const IEe=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",mmt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tE(e){if(Fie(e),IEe)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=mmt[e[n]];return t}const $x={_0:48,_9:57,A:65,F:70,a:97,f:102};function Hpe(e){if(e>=$x._0&&e<=$x._9)return e-$x._0;if(e>=$x.A&&e<=$x.F)return e-($x.A-10);if(e>=$x.a&&e<=$x.f)return e-($x.a-10)}function iM(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(IEe)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,a=0;s<n;s++,a+=2){const o=Hpe(e.charCodeAt(a)),l=Hpe(e.charCodeAt(a+1));if(o===void 0||l===void 0){const c=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}r[s]=o*16+l}return r}function qw(e){return TEe(tE(e))}function PEe(e){return Fie(e),TEe(tE(Uint8Array.from(e).reverse()))}function nE(e,t){return iM(e.toString(16).padStart(t*2,"0"))}function FEe(e,t){return nE(e,t).reverse()}function Dp(e,t,n){let r;if(typeof t=="string")try{r=iM(t)}catch(a){throw new Error(e+" must be hex string or Uint8Array, cause: "+a)}else if(OS(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return r}function aM(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Fie(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}const iH=e=>typeof e=="bigint"&&Pie<=e;function Oie(e,t,n){return iH(e)&&iH(t)&&iH(n)&&t<=e&&e<n}function ZC(e,t,n,r){if(!Oie(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function xmt(e){let t;for(t=0;e>Pie;e>>=PZ,t+=1);return t}const mB=e=>(PZ<<BigInt(e))-PZ,aH=e=>new Uint8Array(e),Vpe=e=>Uint8Array.from(e);function gmt(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=aH(e),s=aH(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=aH(0))=>{s=l(Vpe([0]),f),r=l(),f.length!==0&&(s=l(Vpe([1]),f),r=l())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const x=[];for(;f<t;){r=l();const g=r.slice();x.push(g),f+=r.length}return aM(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const bmt={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||OS(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function xB(e,t,n={}){const r=(s,a,o)=>{const l=bmt[a];if(typeof l!="function")throw new Error("invalid validator function");const c=e[s];if(!(o&&c===void 0)&&!l(c,e))throw new Error("param "+String(s)+" is invalid. Expected "+a+", got "+c)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}function Wpe(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const a=e(n,...r);return t.set(n,a),a}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const jc=BigInt(0),bl=BigInt(1),Fv=BigInt(2),ymt=BigInt(3),FZ=BigInt(4),qpe=BigInt(5),Gpe=BigInt(8);function Ud(e,t){const n=e%t;return n>=jc?n:t+n}function vmt(e,t,n){if(t<jc)throw new Error("invalid exponent, negatives unsupported");if(n<=jc)throw new Error("invalid modulus");if(n===bl)return jc;let r=bl;for(;t>jc;)t&bl&&(r=r*e%n),e=e*e%n,t>>=bl;return r}function mh(e,t,n){let r=e;for(;t-- >jc;)r*=r,r%=n;return r}function OZ(e,t){if(e===jc)throw new Error("invert: expected non-zero number");if(t<=jc)throw new Error("invert: expected positive modulus, got "+t);let n=Ud(e,t),r=t,s=jc,a=bl;for(;n!==jc;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==bl)throw new Error("invert: does not exist");return Ud(s,t)}function wmt(e){const t=(e-bl)/Fv;let n,r,s;for(n=e-bl,r=0;n%Fv===jc;n/=Fv,r++);for(s=Fv;s<e&&vmt(s,t,e)!==e-bl;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(e+bl)/FZ;return function(c,u){const d=c.pow(u,o);if(!c.eql(c.sqr(d),u))throw new Error("Cannot find square root");return d}}const a=(n+bl)/Fv;return function(l,c){if(l.pow(c,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let u=r,d=l.pow(l.mul(l.ONE,s),n),f=l.pow(c,a),x=l.pow(c,n);for(;!l.eql(x,l.ONE);){if(l.eql(x,l.ZERO))return l.ZERO;let g=1;for(let w=l.sqr(x);g<u&&!l.eql(w,l.ONE);g++)w=l.sqr(w);const v=l.pow(d,bl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function Cmt(e){if(e%FZ===ymt){const t=(e+bl)/FZ;return function(r,s){const a=r.pow(s,t);if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}if(e%Gpe===qpe){const t=(e-qpe)/Gpe;return function(r,s){const a=r.mul(s,Fv),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Fv),o),u=r.mul(l,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return wmt(e)}const Smt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Nmt(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Smt.reduce((r,s)=>(r[s]="function",r),t);return xB(e,n)}function Amt(e,t,n){if(n<jc)throw new Error("invalid exponent, negatives unsupported");if(n===jc)return e.ONE;if(n===bl)return t;let r=e.ONE,s=t;for(;n>jc;)n&bl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=bl;return r}function jmt(e,t){const n=new Array(t.length),r=t.reduce((a,o,l)=>e.is0(o)?a:(n[l]=a,e.mul(a,o)),e.ONE),s=e.inv(r);return t.reduceRight((a,o,l)=>e.is0(o)?a:(n[l]=e.mul(a,n[l]),e.mul(a,o)),s),n}function OEe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function MEe(e,t,n=!1,r={}){if(e<=jc)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:a}=OEe(e,t);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const l=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:a,MASK:mB(s),ZERO:jc,ONE:bl,create:c=>Ud(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return jc<=c&&c<e},is0:c=>c===jc,isOdd:c=>(c&bl)===bl,neg:c=>Ud(-c,e),eql:(c,u)=>c===u,sqr:c=>Ud(c*c,e),add:(c,u)=>Ud(c+u,e),sub:(c,u)=>Ud(c-u,e),mul:(c,u)=>Ud(c*u,e),pow:(c,u)=>Amt(l,c,u),div:(c,u)=>Ud(c*OZ(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>OZ(c,e),sqrt:r.sqrt||(c=>(o||(o=Cmt(e)),o(l,c))),invertBatch:c=>jmt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?FEe(c,a):nE(c,a),fromBytes:c=>{if(c.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+c.length);return n?PEe(c):qw(c)}});return Object.freeze(l)}function REe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function LEe(e){const t=REe(e);return t+Math.ceil(t/2)}function Emt(e,t,n=!1){const r=e.length,s=REe(t),a=LEe(t);if(r<16||r<a||r>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+r);const o=n?PEe(e):qw(e),l=Ud(o,t-bl)+bl;return n?FEe(l,s):nE(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Kpe=BigInt(0),MZ=BigInt(1);function oH(e,t){const n=t.negate();return e?n:t}function DEe(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function lH(e,t){DEe(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),s=2**e,a=mB(e),o=BigInt(e);return{windows:n,windowSize:r,mask:a,maxNumber:s,shiftBy:o}}function Ype(e,t,n){const{windowSize:r,mask:s,maxNumber:a,shiftBy:o}=n;let l=Number(e&s),c=e>>o;l>r&&(l-=a,c+=MZ);const u=t*r,d=u+Math.abs(l)-1,f=l===0,x=l<0,g=t%2!==0;return{nextN:c,offset:d,isZero:f,isNeg:x,isNegF:g,offsetF:u}}function _mt(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function kmt(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const cH=new WeakMap,BEe=new WeakMap;function uH(e){return BEe.get(e)||1}function Tmt(e,t){return{constTimeNegate:oH,hasPrecomputes(n){return uH(n)!==1},unsafeLadder(n,r,s=e.ZERO){let a=n;for(;r>Kpe;)r&MZ&&(s=s.add(a)),a=a.double(),r>>=MZ;return s},precomputeWindow(n,r){const{windows:s,windowSize:a}=lH(r,t),o=[];let l=n,c=l;for(let u=0;u<s;u++){c=l,o.push(c);for(let d=1;d<a;d++)c=c.add(l),o.push(c);l=c.double()}return o},wNAF(n,r,s){let a=e.ZERO,o=e.BASE;const l=lH(n,t);for(let c=0;c<l.windows;c++){const{nextN:u,offset:d,isZero:f,isNeg:x,isNegF:g,offsetF:v}=Ype(s,c,l);s=u,f?o=o.add(oH(g,r[v])):a=a.add(oH(x,r[d]))}return{p:a,f:o}},wNAFUnsafe(n,r,s,a=e.ZERO){const o=lH(n,t);for(let l=0;l<o.windows&&s!==Kpe;l++){const{nextN:c,offset:u,isZero:d,isNeg:f}=Ype(s,l,o);if(s=c,!d){const x=r[u];a=a.add(f?x.negate():x)}}return a},getPrecomputes(n,r,s){let a=cH.get(r);return a||(a=this.precomputeWindow(r,n),n!==1&&cH.set(r,s(a))),a},wNAFCached(n,r,s){const a=uH(n);return this.wNAF(a,this.getPrecomputes(a,n,s),r)},wNAFCachedUnsafe(n,r,s,a){const o=uH(n);return o===1?this.unsafeLadder(n,r,a):this.wNAFUnsafe(o,this.getPrecomputes(o,n,s),r,a)},setWindowSize(n,r){DEe(r,t),BEe.set(n,r),cH.delete(n)}}}function Imt(e,t,n,r){if(_mt(n,e),kmt(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,a=xmt(BigInt(n.length)),o=a>12?a-3:a>4?a-2:a?2:1,l=mB(o),c=new Array(Number(l)+1).fill(s),u=Math.floor((t.BITS-1)/o)*o;let d=s;for(let f=u;f>=0;f-=o){c.fill(s);for(let g=0;g<r.length;g++){const v=r[g],w=Number(v>>BigInt(f)&l);c[w]=c[w].add(n[g])}let x=s;for(let g=c.length-1,v=s;g>0;g--)v=v.add(c[g]),x=x.add(v);if(d=d.add(x),f!==0)for(let g=0;g<o;g++)d=d.double()}return d}function $Ee(e){return Nmt(e.Fp),xB(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...OEe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Xpe(e){e.lowS!==void 0&&eE("lowS",e.lowS),e.prehash!==void 0&&eE("prehash",e.prehash)}function Pmt(e){const t=$Ee(e);xB(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("invalid 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("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}class Fmt extends Error{constructor(t=""){super(t)}}const ug={Err:Fmt,_tlv:{encode:(e,t)=>{const{Err:n}=ug;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,s=RI(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const a=r>127?RI(s.length/2|128):"";return RI(e)+a+s+t},decode(e,t){const{Err:n}=ug;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[r++],a=!!(s&128);let o=0;if(!a)o=s;else{const c=s&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+c);if(u.length!==c)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const d of u)o=o<<8|d;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const l=t.subarray(r,r+o);if(l.length!==o)throw new n("tlv.decode: wrong value length");return{v:l,l:t.subarray(r+o)}}},_int:{encode(e){const{Err:t}=ug;if(e<_g)throw new t("integer: negative integers are not allowed");let n=RI(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=ug;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return qw(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=ug,s=Dp("signature",e),{v:a,l:o}=r.decode(48,s);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:l,l:c}=r.decode(2,a),{v:u,l:d}=r.decode(2,c);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(l),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=ug,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),a=r+s;return t.encode(48,a)}},_g=BigInt(0),Cc=BigInt(1);BigInt(2);const Qpe=BigInt(3);BigInt(4);function Omt(e){const t=Pmt(e),{Fp:n}=t,r=MEe(t.n,t.nBitLength),s=t.toBytes||((w,C,N)=>{const I=C.toAffine();return aM(Uint8Array.from([4]),n.toBytes(I.x),n.toBytes(I.y))}),a=t.fromBytes||(w=>{const C=w.subarray(1),N=n.fromBytes(C.subarray(0,n.BYTES)),I=n.fromBytes(C.subarray(n.BYTES,2*n.BYTES));return{x:N,y:I}});function o(w){const{a:C,b:N}=t,I=n.sqr(w),P=n.mul(I,w);return n.add(n.add(P,n.mul(w,C)),N)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function l(w){return Oie(w,Cc,t.n)}function c(w){const{allowedPrivateKeyLengths:C,nByteLength:N,wrapPrivateKey:I,n:P}=t;if(C&&typeof w!="bigint"){if(OS(w)&&(w=tE(w)),typeof w!="string"||!C.includes(w.length))throw new Error("invalid private key");w=w.padStart(N*2,"0")}let R;try{R=typeof w=="bigint"?w:qw(Dp("private key",w,N))}catch{throw new Error("invalid private key, expected hex or "+N+" bytes, got "+typeof w)}return I&&(R=Ud(R,P)),ZC("private key",R,Cc,P),R}function u(w){if(!(w instanceof x))throw new Error("ProjectivePoint expected")}const d=Wpe((w,C)=>{const{px:N,py:I,pz:P}=w;if(n.eql(P,n.ONE))return{x:N,y:I};const R=w.is0();C==null&&(C=R?n.ONE:n.inv(P));const F=n.mul(N,C),U=n.mul(I,C),L=n.mul(P,C);if(R)return{x:n.ZERO,y:n.ZERO};if(!n.eql(L,n.ONE))throw new Error("invZ was invalid");return{x:F,y:U}}),f=Wpe(w=>{if(w.is0()){if(t.allowInfinityPoint&&!n.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:C,y:N}=w.toAffine();if(!n.isValid(C)||!n.isValid(N))throw new Error("bad point: x or y not FE");const I=n.sqr(N),P=o(C);if(!n.eql(I,P))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class x{constructor(C,N,I){if(C==null||!n.isValid(C))throw new Error("x required");if(N==null||!n.isValid(N))throw new Error("y required");if(I==null||!n.isValid(I))throw new Error("z required");this.px=C,this.py=N,this.pz=I,Object.freeze(this)}static fromAffine(C){const{x:N,y:I}=C||{};if(!C||!n.isValid(N)||!n.isValid(I))throw new Error("invalid affine point");if(C instanceof x)throw new Error("projective point not allowed");const P=R=>n.eql(R,n.ZERO);return P(N)&&P(I)?x.ZERO:new x(N,I,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const N=n.invertBatch(C.map(I=>I.pz));return C.map((I,P)=>I.toAffine(N[P])).map(x.fromAffine)}static fromHex(C){const N=x.fromAffine(a(Dp("pointHex",C)));return N.assertValidity(),N}static fromPrivateKey(C){return x.BASE.multiply(c(C))}static msm(C,N){return Imt(x,r,C,N)}_setWindowSize(C){v.setWindowSize(this,C)}assertValidity(){f(this)}hasEvenY(){const{y:C}=this.toAffine();if(n.isOdd)return!n.isOdd(C);throw new Error("Field doesn't support isOdd")}equals(C){u(C);const{px:N,py:I,pz:P}=this,{px:R,py:F,pz:U}=C,L=n.eql(n.mul(N,U),n.mul(R,P)),z=n.eql(n.mul(I,U),n.mul(F,P));return L&&z}negate(){return new x(this.px,n.neg(this.py),this.pz)}double(){const{a:C,b:N}=t,I=n.mul(N,Qpe),{px:P,py:R,pz:F}=this;let U=n.ZERO,L=n.ZERO,z=n.ZERO,Q=n.mul(P,P),ne=n.mul(R,R),J=n.mul(F,F),X=n.mul(P,R);return X=n.add(X,X),z=n.mul(P,F),z=n.add(z,z),U=n.mul(C,z),L=n.mul(I,J),L=n.add(U,L),U=n.sub(ne,L),L=n.add(ne,L),L=n.mul(U,L),U=n.mul(X,U),z=n.mul(I,z),J=n.mul(C,J),X=n.sub(Q,J),X=n.mul(C,X),X=n.add(X,z),z=n.add(Q,Q),Q=n.add(z,Q),Q=n.add(Q,J),Q=n.mul(Q,X),L=n.add(L,Q),J=n.mul(R,F),J=n.add(J,J),Q=n.mul(J,X),U=n.sub(U,Q),z=n.mul(J,ne),z=n.add(z,z),z=n.add(z,z),new x(U,L,z)}add(C){u(C);const{px:N,py:I,pz:P}=this,{px:R,py:F,pz:U}=C;let L=n.ZERO,z=n.ZERO,Q=n.ZERO;const ne=t.a,J=n.mul(t.b,Qpe);let X=n.mul(N,R),re=n.mul(I,F),pe=n.mul(P,U),Y=n.add(N,I),ie=n.add(R,F);Y=n.mul(Y,ie),ie=n.add(X,re),Y=n.sub(Y,ie),ie=n.add(N,P);let oe=n.add(R,U);return ie=n.mul(ie,oe),oe=n.add(X,pe),ie=n.sub(ie,oe),oe=n.add(I,P),L=n.add(F,U),oe=n.mul(oe,L),L=n.add(re,pe),oe=n.sub(oe,L),Q=n.mul(ne,ie),L=n.mul(J,pe),Q=n.add(L,Q),L=n.sub(re,Q),Q=n.add(re,Q),z=n.mul(L,Q),re=n.add(X,X),re=n.add(re,X),pe=n.mul(ne,pe),ie=n.mul(J,ie),re=n.add(re,pe),pe=n.sub(X,pe),pe=n.mul(ne,pe),ie=n.add(ie,pe),X=n.mul(re,ie),z=n.add(z,X),X=n.mul(oe,ie),L=n.mul(Y,L),L=n.sub(L,X),X=n.mul(Y,re),Q=n.mul(oe,Q),Q=n.add(Q,X),new x(L,z,Q)}subtract(C){return this.add(C.negate())}is0(){return this.equals(x.ZERO)}wNAF(C){return v.wNAFCached(this,C,x.normalizeZ)}multiplyUnsafe(C){const{endo:N,n:I}=t;ZC("scalar",C,_g,I);const P=x.ZERO;if(C===_g)return P;if(this.is0()||C===Cc)return this;if(!N||v.hasPrecomputes(this))return v.wNAFCachedUnsafe(this,C,x.normalizeZ);let{k1neg:R,k1:F,k2neg:U,k2:L}=N.splitScalar(C),z=P,Q=P,ne=this;for(;F>_g||L>_g;)F&Cc&&(z=z.add(ne)),L&Cc&&(Q=Q.add(ne)),ne=ne.double(),F>>=Cc,L>>=Cc;return R&&(z=z.negate()),U&&(Q=Q.negate()),Q=new x(n.mul(Q.px,N.beta),Q.py,Q.pz),z.add(Q)}multiply(C){const{endo:N,n:I}=t;ZC("scalar",C,Cc,I);let P,R;if(N){const{k1neg:F,k1:U,k2neg:L,k2:z}=N.splitScalar(C);let{p:Q,f:ne}=this.wNAF(U),{p:J,f:X}=this.wNAF(z);Q=v.constTimeNegate(F,Q),J=v.constTimeNegate(L,J),J=new x(n.mul(J.px,N.beta),J.py,J.pz),P=Q.add(J),R=ne.add(X)}else{const{p:F,f:U}=this.wNAF(C);P=F,R=U}return x.normalizeZ([P,R])[0]}multiplyAndAddUnsafe(C,N,I){const P=x.BASE,R=(U,L)=>L===_g||L===Cc||!U.equals(P)?U.multiplyUnsafe(L):U.multiply(L),F=R(this,N).add(R(C,I));return F.is0()?void 0:F}toAffine(C){return d(this,C)}isTorsionFree(){const{h:C,isTorsionFree:N}=t;if(C===Cc)return!0;if(N)return N(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:C,clearCofactor:N}=t;return C===Cc?this:N?N(x,this):this.multiplyUnsafe(t.h)}toRawBytes(C=!0){return eE("isCompressed",C),this.assertValidity(),s(x,this,C)}toHex(C=!0){return eE("isCompressed",C),tE(this.toRawBytes(C))}}x.BASE=new x(t.Gx,t.Gy,n.ONE),x.ZERO=new x(n.ZERO,n.ONE,n.ZERO);const g=t.nBitLength,v=Tmt(x,t.endo?Math.ceil(g/2):g);return{CURVE:t,ProjectivePoint:x,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:l}}function Mmt(e){const t=$Ee(e);return xB(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Rmt(e){const t=Mmt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(pe){return Ud(pe,r)}function l(pe){return OZ(pe,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=Omt({...t,toBytes(pe,Y,ie){const oe=Y.toAffine(),G=n.toBytes(oe.x),V=aM;return eE("isCompressed",ie),ie?V(Uint8Array.from([Y.hasEvenY()?2:3]),G):V(Uint8Array.from([4]),G,n.toBytes(oe.y))},fromBytes(pe){const Y=pe.length,ie=pe[0],oe=pe.subarray(1);if(Y===s&&(ie===2||ie===3)){const G=qw(oe);if(!Oie(G,Cc,n.ORDER))throw new Error("Point is not on curve");const V=d(G);let te;try{te=n.sqrt(V)}catch(Ce){const ce=Ce instanceof Error?": "+Ce.message:"";throw new Error("Point is not on curve"+ce)}const ae=(te&Cc)===Cc;return(ie&1)===1!==ae&&(te=n.neg(te)),{x:G,y:te}}else if(Y===a&&ie===4){const G=n.fromBytes(oe.subarray(0,n.BYTES)),V=n.fromBytes(oe.subarray(n.BYTES,2*n.BYTES));return{x:G,y:V}}else{const G=s,V=a;throw new Error("invalid Point, expected length of "+G+", or uncompressed "+V+", got "+Y)}}}),x=pe=>tE(nE(pe,t.nByteLength));function g(pe){const Y=r>>Cc;return pe>Y}function v(pe){return g(pe)?o(-pe):pe}const w=(pe,Y,ie)=>qw(pe.slice(Y,ie));class C{constructor(Y,ie,oe){ZC("r",Y,Cc,r),ZC("s",ie,Cc,r),this.r=Y,this.s=ie,oe!=null&&(this.recovery=oe),Object.freeze(this)}static fromCompact(Y){const ie=t.nByteLength;return Y=Dp("compactSignature",Y,ie*2),new C(w(Y,0,ie),w(Y,ie,2*ie))}static fromDER(Y){const{r:ie,s:oe}=ug.toSig(Dp("DER",Y));return new C(ie,oe)}assertValidity(){}addRecoveryBit(Y){return new C(this.r,this.s,Y)}recoverPublicKey(Y){const{r:ie,s:oe,recovery:G}=this,V=U(Dp("msgHash",Y));if(G==null||![0,1,2,3].includes(G))throw new Error("recovery id invalid");const te=G===2||G===3?ie+t.n:ie;if(te>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const ae=G&1?"03":"02",he=c.fromHex(ae+x(te)),Ce=l(te),ce=o(-V*Ce),ge=o(oe*Ce),Ae=c.BASE.multiplyAndAddUnsafe(he,ce,ge);if(!Ae)throw new Error("point at infinify");return Ae.assertValidity(),Ae}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return iM(this.toDERHex())}toDERHex(){return ug.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return iM(this.toCompactHex())}toCompactHex(){return x(this.r)+x(this.s)}}const N={isValidPrivateKey(pe){try{return u(pe),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const pe=LEe(t.n);return Emt(t.randomBytes(pe),t.n)},precompute(pe=8,Y=c.BASE){return Y._setWindowSize(pe),Y.multiply(BigInt(3)),Y}};function I(pe,Y=!0){return c.fromPrivateKey(pe).toRawBytes(Y)}function P(pe){const Y=OS(pe),ie=typeof pe=="string",oe=(Y||ie)&&pe.length;return Y?oe===s||oe===a:ie?oe===2*s||oe===2*a:pe instanceof c}function R(pe,Y,ie=!0){if(P(pe))throw new Error("first arg must be private key");if(!P(Y))throw new Error("second arg must be public key");return c.fromHex(Y).multiply(u(pe)).toRawBytes(ie)}const F=t.bits2int||function(pe){if(pe.length>8192)throw new Error("input is too large");const Y=qw(pe),ie=pe.length*8-t.nBitLength;return ie>0?Y>>BigInt(ie):Y},U=t.bits2int_modN||function(pe){return o(F(pe))},L=mB(t.nBitLength);function z(pe){return ZC("num < 2^"+t.nBitLength,pe,_g,L),nE(pe,t.nByteLength)}function Q(pe,Y,ie=ne){if(["recovered","canonical"].some(je=>je in ie))throw new Error("sign() legacy options not supported");const{hash:oe,randomBytes:G}=t;let{lowS:V,prehash:te,extraEntropy:ae}=ie;V==null&&(V=!0),pe=Dp("msgHash",pe),Xpe(ie),te&&(pe=Dp("prehashed msgHash",oe(pe)));const he=U(pe),Ce=u(Y),ce=[z(Ce),z(he)];if(ae!=null&&ae!==!1){const je=ae===!0?G(n.BYTES):ae;ce.push(Dp("extraEntropy",je))}const ge=aM(...ce),Ae=he;function ye(je){const Ie=F(je);if(!f(Ie))return;const Re=l(Ie),Qe=c.BASE.multiply(Ie).toAffine(),$e=o(Qe.x);if($e===_g)return;const it=o(Re*o(Ae+$e*Ce));if(it===_g)return;let tt=(Qe.x===$e?0:2)|Number(Qe.y&Cc),ot=it;return V&&g(it)&&(ot=v(it),tt^=1),new C($e,ot,tt)}return{seed:ge,k2sig:ye}}const ne={lowS:t.lowS,prehash:!1},J={lowS:t.lowS,prehash:!1};function X(pe,Y,ie=ne){const{seed:oe,k2sig:G}=Q(pe,Y,ie),V=t;return gmt(V.hash.outputLen,V.nByteLength,V.hmac)(oe,G)}c.BASE._setWindowSize(8);function re(pe,Y,ie,oe=J){var tt;const G=pe;Y=Dp("msgHash",Y),ie=Dp("publicKey",ie);const{lowS:V,prehash:te,format:ae}=oe;if(Xpe(oe),"strict"in oe)throw new Error("options.strict was renamed to lowS");if(ae!==void 0&&ae!=="compact"&&ae!=="der")throw new Error("format must be compact or der");const he=typeof G=="string"||OS(G),Ce=!he&&!ae&&typeof G=="object"&&G!==null&&typeof G.r=="bigint"&&typeof G.s=="bigint";if(!he&&!Ce)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let ce,ge;try{if(Ce&&(ce=new C(G.r,G.s)),he){try{ae!=="compact"&&(ce=C.fromDER(G))}catch(ot){if(!(ot instanceof ug.Err))throw ot}!ce&&ae!=="der"&&(ce=C.fromCompact(G))}ge=c.fromHex(ie)}catch{return!1}if(!ce||V&&ce.hasHighS())return!1;te&&(Y=t.hash(Y));const{r:Ae,s:ye}=ce,je=U(Y),Ie=l(ye),Re=o(je*Ie),Qe=o(Ae*Ie),$e=(tt=c.BASE.multiplyAndAddUnsafe(ge,Re,Qe))==null?void 0:tt.toAffine();return $e?o($e.x)===Ae:!1}return{CURVE:t,getPublicKey:I,getSharedSecret:R,sign:X,verify:re,ProjectivePoint:c,Signature:C,utils:N}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Lmt(e){return{hash:e,hmac:(t,...n)=>kEe(e,t,Fct(...n)),randomBytes:Oct}}function Dmt(e,t){const n=r=>Rmt({...e,...Lmt(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const UEe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Zpe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Bmt=BigInt(1),RZ=BigInt(2),Jpe=(e,t)=>(e+t/RZ)/t;function $mt(e){const t=UEe,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=mh(d,n,t)*d%t,x=mh(f,n,t)*d%t,g=mh(x,RZ,t)*u%t,v=mh(g,s,t)*g%t,w=mh(v,a,t)*v%t,C=mh(w,l,t)*w%t,N=mh(C,c,t)*C%t,I=mh(N,l,t)*w%t,P=mh(I,n,t)*d%t,R=mh(P,o,t)*v%t,F=mh(R,r,t)*u%t,U=mh(F,RZ,t);if(!LZ.eql(LZ.sqr(U),e))throw new Error("Cannot find square root");return U}const LZ=MEe(UEe,void 0,void 0,{sqrt:$mt}),Mie=Dmt({a:BigInt(0),b:BigInt(7),Fp:LZ,n:Zpe,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Zpe,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Bmt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=Jpe(a*e,t),c=Jpe(-r*e,t);let u=Ud(e-l*n-c*s,t),d=Ud(-l*r-c*a,t);const f=u>o,x=d>o;if(f&&(u=t-u),x&&(d=t-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:x,k2:d}}}},n9e);BigInt(0);Mie.ProjectivePoint;const Umt=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Mie},Symbol.toStringTag,{value:"Module"}));function zmt({r:e,s:t,to:n="hex",v:r,yParity:s}){const a=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new Mie.Signature(nd(e),nd(t)).toCompactHex()}${a===0?"1b":"1c"}`;return n==="hex"?o:sp(o)}async function Rie(e,t){var f,x,g;const{address:n,factory:r,factoryData:s,hash:a,signature:o,universalSignatureVerifierAddress:l=(g=(x=(f=e.chain)==null?void 0:f.contracts)==null?void 0:x.universalSignatureVerifier)==null?void 0:g.address,...c}=t,u=Y0(o)?o:typeof o=="object"&&"r"in o&&"s"in o?zmt(o):Wl(o),d=await(async()=>!r&&!s||Zpt(u)?u:Jpt({address:r,data:s,signature:u}))();try{const v=l?{to:l,data:Sm({abi:bpe,functionName:"isValidSig",args:[n,a,d]}),...c}:{data:Zse({abi:bpe,args:[n,a,d],bytecode:mft}),...c},{data:w}=await ti(e,lB,"call")(v);return sct(w??"0x0")}catch(v){try{if(yie(Ac(n),await Vje({hash:a,signature:o})))return!0}catch{}if(v instanceof P9e)return!1;throw v}}async function Hmt(e,{address:t,message:n,factory:r,factoryData:s,signature:a,...o}){const l=AEe(n);return Rie(e,{address:t,factory:r,factoryData:s,hash:l,signature:a,...o})}async function Vmt(e,t){const{address:n,factory:r,factoryData:s,signature:a,message:o,primaryType:l,types:c,domain:u,...d}=t,f=Fpt({message:o,primaryType:l,types:c,domain:u});return Rie(e,{address:n,factory:r,factoryData:s,hash:f,signature:a,...d})}function Wmt(e,t){const{abi:n,address:r,args:s,batch:a=!0,eventName:o,fromBlock:l,onError:c,onLogs:u,poll:d,pollingInterval:f=e.pollingInterval,strict:x}=t;return(typeof d<"u"?d:typeof l=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const C=x??!1,N=Tc(["watchContractEvent",r,s,a,e.uid,o,f,C,l]);return $y(N,{onLogs:u,onError:c},I=>{let P;l!==void 0&&(P=l-1n);let R,F=!1;const U=Mk(async()=>{var L;if(!F){try{R=await ti(e,q9e,"createContractEventFilter")({abi:n,address:r,args:s,eventName:o,strict:C,fromBlock:l})}catch{}F=!0;return}try{let z;if(R)z=await ti(e,uB,"getFilterChanges")({filter:R});else{const Q=await ti(e,Fk,"getBlockNumber")({});P&&P<Q?z=await ti(e,Y9e,"getContractEvents")({abi:n,address:r,args:s,eventName:o,fromBlock:P+1n,toBlock:Q,strict:C}):z=[],P=Q}if(z.length===0)return;if(a)I.onLogs(z);else for(const Q of z)I.onLogs([Q])}catch(z){R&&z instanceof g3&&(F=!1),(L=I.onError)==null||L.call(I,z)}},{emitOnBegin:!0,interval:f});return async()=>{R&&await ti(e,pB,"uninstallFilter")({filter:R}),U()}})})():(()=>{const C=x??!1,N=Tc(["watchContractEvent",r,s,a,e.uid,o,f,C]);let I=!0,P=()=>I=!1;return $y(N,{onLogs:u,onError:c},R=>((async()=>{try{const F=(()=>{if(e.transport.type==="fallback"){const z=e.transport.transports.find(Q=>Q.config.type==="webSocket");return z?z.value:e.transport}return e.transport})(),U=o?Pk({abi:n,eventName:o,args:s}):[],{unsubscribe:L}=await F.subscribe({params:["logs",{address:r,topics:U}],onData(z){var ne;if(!I)return;const Q=z.result;try{const{eventName:J,args:X}=vie({abi:n,data:Q.data,topics:Q.topics,strict:x}),re=s1(Q,{args:X,eventName:J});R.onLogs([re])}catch(J){let X,re;if(J instanceof F9||J instanceof YD){if(x)return;X=J.abiItem.name,re=(ne=J.abiItem.inputs)==null?void 0:ne.some(Y=>!("name"in Y&&Y.name))}const pe=s1(Q,{args:re?[]:{},eventName:X});R.onLogs([pe])}},onError(z){var Q;(Q=R.onError)==null||Q.call(R,z)}});P=L,I||P()}catch(F){c==null||c(F)}})(),()=>P()))})()}async function qmt(e,t){const{abi:n,account:r=e.account,address:s,args:a,dataSuffix:o,functionName:l,...c}=t;if(typeof r>"u")throw new JD({docsPath:"/docs/contract/writeContract"});const u=r?Du(r):null,d=Sm({abi:n,args:a,functionName:l});try{return await ti(e,edt,"sendTransaction")({data:`${d}${o?o.replace("0x",""):""}`,to:s,account:u,...c})}catch(f){throw y3(f,{abi:n,address:s,args:a,docsPath:"/docs/contract/writeContract",functionName:l,sender:u==null?void 0:u.address})}}function i2(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:a=>t(e,a)}const RF="2.16.7",Gmt=()=>`@wagmi/core@${RF}`;var zEe=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},oM,HEe;let C1=class DZ extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Gmt()}constructor(t,n={}){var a;super(),oM.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof DZ?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details,s=n.cause instanceof DZ&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return zEe(this,oM,"m",HEe).call(this,this,t)}};oM=new WeakSet,HEe=function e(t,n){return n!=null&&n(t)?t:t.cause?zEe(this,oM,"m",e).call(this,t.cause,n):t};class C3 extends C1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Kmt extends C1{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class Ymt extends C1{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Xmt extends C1{constructor({address:t,connector:n}){super(`Account "${t}" not found for connector "${n.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class Qmt extends C1{constructor({connectionChainId:t,connectorChainId:n}){super(`The current chain of the connector (id: ${n}) does not match the connection's chain (id: ${t}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Zmt extends C1{constructor({connector:t}){super(`Connector "${t.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function Jmt(e,t){var r;let n;if(typeof t.connector=="function"?n=e._internal.connectors.setup(t.connector):n=t.connector,n.uid===e.state.current)throw new Kmt;try{e.setState(c=>({...c,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});const{connector:s,...a}=t,o=await n.connect(a),l=o.accounts;return n.emitter.off("connect",e._internal.events.connect),n.emitter.on("change",e._internal.events.change),n.emitter.on("disconnect",e._internal.events.disconnect),await((r=e.storage)==null?void 0:r.setItem("recentConnectorId",n.id)),e.setState(c=>({...c,connections:new Map(c.connections).set(n.uid,{accounts:l,chainId:o.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:l,chainId:o.chainId}}catch(s){throw e.setState(a=>({...a,status:a.current?"connected":"disconnected"})),s}}const BZ=256;let LI=BZ,DI;function VEe(e=11){if(!DI||LI+e>BZ*2){DI="",LI=0;for(let t=0;t<BZ;t++)DI+=(256+Math.random()*256|0).toString(16).substring(1)}return DI.substring(LI,LI+++e)}function WEe(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,ccipRead:r,key:s="base",name:a="Base Client",pollingInterval:o=4e3,type:l="base"}=e,c=e.chain,u=e.account?Du(e.account):void 0,{config:d,request:f,value:x}=e.transport({chain:c,pollingInterval:o}),g={...d,...x},v={account:u,batch:t,cacheTime:n,ccipRead:r,chain:c,key:s,name:a,pollingInterval:o,request:f,transport:g,type:l,uid:VEe()};function w(C){return N=>{const I=N(C);for(const R in v)delete I[R];const P={...C,...I};return Object.assign(P,{extend:w(P)})}}return Object.assign(v,{extend:w(v)})}function qEe({key:e,methods:t,name:n,request:r,retryCount:s=3,retryDelay:a=150,timeout:o,type:l},c){const u=VEe();return{config:{key:e,methods:t,name:n,request:r,retryCount:s,retryDelay:a,timeout:o,type:l},request:jpt(r,{methods:t,retryCount:s,retryDelay:a,uid:u}),value:c}}function e0t(e,t={}){const{key:n="custom",methods:r,name:s="Custom Provider",retryDelay:a}=t;return({retryCount:o})=>qEe({key:n,methods:r,name:s,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:a,type:"custom"})}class t0t extends Rr{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function cj(e,t={}){const{batch:n,fetchOptions:r,key:s="http",methods:a,name:o="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:c,retryDelay:u,raw:d}=t;return({chain:f,retryCount:x,timeout:g})=>{const{batchSize:v=1e3,wait:w=0}=typeof n=="object"?n:{},C=t.retryCount??x,N=g??t.timeout??1e4,I=f==null?void 0:f.rpcUrls.default.http[0];if(!I)throw new t0t;const P=kpt(I,{fetchOptions:r,onRequest:l,onResponse:c,timeout:N});return qEe({key:s,methods:a,name:o,async request({method:R,params:F}){const U={method:R,params:F},{schedule:L}=B9e({id:I,wait:w,shouldSplitBatch(J){return J.length>v},fn:J=>P.request({body:J}),sort:(J,X)=>J.id-X.id}),z=async J=>n?L(J):[await P.request({body:J})],[{error:Q,result:ne}]=await z(U);if(d)return{error:Q,result:ne};if(Q)throw new nie({body:U,error:Q,url:I});return ne},retryCount:C,retryDelay:u,timeout:N,type:"http"},{fetchOptions:r,url:I})}}function n0t(e){var f,x,g;const{scheme:t,statement:n,...r}=((f=e.match(r0t))==null?void 0:f.groups)??{},{chainId:s,expirationTime:a,issuedAt:o,notBefore:l,requestId:c,...u}=((x=e.match(s0t))==null?void 0:x.groups)??{},d=(g=e.split("Resources:")[1])==null?void 0:g.split(`
- `).slice(1);return{...r,...u,...s?{chainId:Number(s)}:{},...a?{expirationTime:new Date(a)}:{},...o?{issuedAt:new Date(o)}:{},...l?{notBefore:new Date(l)}:{},...c?{requestId:c}:{},...d?{resources:d}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const r0t=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,s0t=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function i0t(e){const{address:t,domain:n,message:r,nonce:s,scheme:a,time:o=new Date}=e;if(n&&r.domain!==n||s&&r.nonce!==s||a&&r.scheme!==a||r.expirationTime&&o>=r.expirationTime||r.notBefore&&o<r.notBefore)return!1;try{if(!r.address||t&&!yie(r.address,t))return!1}catch{return!1}return!0}async function a0t(e,t){const{address:n,domain:r,message:s,nonce:a,scheme:o,signature:l,time:c=new Date,...u}=t,d=n0t(s);if(!d.address||!i0t({address:n,domain:r,message:d,nonce:a,scheme:o,time:c}))return!1;const x=AEe(s);return Rie(e,{address:d.address,hash:x,signature:l,...u})}function o0t(e){return{call:t=>lB(e,t),createAccessList:t=>W9e(e,t),createBlockFilter:()=>Mft(e),createContractEventFilter:t=>q9e(e,t),createEventFilter:t=>G9e(e,t),createPendingTransactionFilter:()=>K9e(e),estimateContractGas:t=>Lft(e,t),estimateGas:t=>uie(e,t),getBalance:t=>cie(e,t),getBlobBaseFee:()=>Dft(e),getBlock:t=>j0(e,t),getBlockNumber:t=>Fk(e,t),getBlockTransactionCount:t=>Vft(e,t),getBytecode:t=>Epe(e,t),getChainId:()=>sie(e),getCode:t=>Epe(e,t),getContractEvents:t=>Y9e(e,t),getEip712Domain:t=>Kft(e,t),getEnsAddress:t=>wft(e,t),getEnsAvatar:t=>H9e(e,t),getEnsName:t=>V9e(e,t),getEnsResolver:t=>Oft(e,t),getEnsText:t=>z9e(e,t),getFeeHistory:t=>Qft(e,t),estimateFeesPerGas:t=>Mut(e,t),getFilterChanges:t=>uB(e,t),getFilterLogs:t=>Zft(e,t),getGasPrice:()=>oie(e),getLogs:t=>Cie(e,t),getProof:t=>umt(e,t),estimateMaxPriorityFeePerGas:t=>Out(e,t),getStorageAt:t=>Jft(e,t),getTransaction:t=>Sie(e,t),getTransactionConfirmations:t=>eht(e,t),getTransactionCount:t=>t9e(e,t),getTransactionReceipt:t=>NZ(e,t),multicall:t=>Q9e(e,t),prepareTransactionRequest:t=>pie(e,t),readContract:t=>Q0(e,t),sendRawTransaction:t=>d9e(e,t),simulate:t=>jZ(e,t),simulateBlocks:t=>jZ(e,t),simulateCalls:t=>rmt(e,t),simulateContract:t=>pmt(e,t),verifyMessage:t=>Hmt(e,t),verifySiweMessage:t=>a0t(e,t),verifyTypedData:t=>Vmt(e,t),uninstallFilter:t=>pB(e,t),waitForTransactionReceipt:t=>dmt(e,t),watchBlocks:t=>imt(e,t),watchBlockNumber:t=>EEe(e,t),watchContractEvent:t=>Wmt(e,t),watchEvent:t=>amt(e,t),watchPendingTransactions:t=>omt(e,t)}}async function Lie(e,t={}){let n;if(t.connector){const{connector:u}=t;if(e.state.status==="reconnecting"&&!u.getAccounts&&!u.getChainId)throw new Zmt({connector:u});const[d,f]=await Promise.all([u.getAccounts().catch(x=>{if(t.account===null)return[];throw x}),u.getChainId()]);n={accounts:d,chainId:f,connector:u}}else n=e.state.connections.get(e.state.current);if(!n)throw new Ymt;const r=t.chainId??n.chainId,s=await n.connector.getChainId();if(s!==n.chainId)throw new Qmt({connectionChainId:n.chainId,connectorChainId:s});const a=n.connector;if(a.getClient)return a.getClient({chainId:r});const o=Du(t.account??n.accounts[0]);if(o&&(o.address=Ac(o.address)),t.account&&!n.accounts.some(u=>u.toLowerCase()===o.address.toLowerCase()))throw new Xmt({address:o.address,connector:a});const l=e.chains.find(u=>u.id===r),c=await n.connector.getProvider({chainId:r});return WEe({account:o,chain:l,name:"Connector Client",transport:u=>e0t(c)({...u,retryCount:0})})}async function l0t(e,t={}){var s,a;let n;if(t.connector)n=t.connector;else{const{connections:o,current:l}=e.state,c=o.get(l);n=c==null?void 0:c.connector}const r=e.state.connections;n&&(await n.disconnect(),n.emitter.off("change",e._internal.events.change),n.emitter.off("disconnect",e._internal.events.disconnect),n.emitter.on("connect",e._internal.events.connect),r.delete(n.uid)),e.setState(o=>{if(r.size===0)return{...o,connections:new Map,current:null,status:"disconnected"};const l=r.values().next().value;return{...o,connections:new Map(r),current:l.connector.uid}});{const o=e.state.current;if(!o)return;const l=(s=e.state.connections.get(o))==null?void 0:s.connector;if(!l)return;await((a=e.storage)==null?void 0:a.setItem("recentConnectorId",l.id))}}function GEe(e){return typeof e=="number"?e:e==="wei"?0:Math.abs(xut[e])}function KEe(e){const t=e.state.current,n=e.state.connections.get(t),r=n==null?void 0:n.accounts,s=r==null?void 0:r[0],a=e.chains.find(l=>l.id===(n==null?void 0:n.chainId)),o=e.state.status;switch(o){case"connected":return{address:s,addresses:r,chain:a,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:s,addresses:r,chain:a,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!!s,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:s,addresses:r,chain:a,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}async function c0t(e,t){const{allowFailure:n=!0,chainId:r,contracts:s,...a}=t,o=e.getClient({chainId:r});return i2(o,Q9e,"multicall")({allowFailure:n,contracts:s,...a})}function YEe(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return i2(s,Q0,"readContract")(r)}async function u0t(e,t){var l;const{allowFailure:n=!0,blockNumber:r,blockTag:s,...a}=t,o=t.contracts;try{const c={};for(const[x,g]of o.entries()){const v=g.chainId??e.state.chainId;c[v]||(c[v]=[]),(l=c[v])==null||l.push({contract:g,index:x})}const u=()=>Object.entries(c).map(([x,g])=>c0t(e,{...a,allowFailure:n,blockNumber:r,blockTag:s,chainId:Number.parseInt(x),contracts:g.map(({contract:v})=>v)})),d=(await Promise.all(u())).flat(),f=Object.values(c).flatMap(x=>x.map(({index:g})=>g));return d.reduce((x,g,v)=>(x&&(x[f[v]]=g),x),[])}catch(c){if(c instanceof F9e)throw c;const u=()=>o.map(d=>YEe(e,{...d,blockNumber:r,blockTag:s}));return n?(await Promise.allSettled(u())).map(d=>d.status==="fulfilled"?{result:d.value,status:"success"}:{error:d.reason,result:void 0,status:"failure"}):await Promise.all(u())}}async function d0t(e,t){const{address:n,blockNumber:r,blockTag:s,chainId:a,token:o,unit:l="ether"}=t;if(o)try{return await eme(e,{balanceAddress:n,chainId:a,symbolType:"string",tokenAddress:o})}catch(x){if(x.name==="ContractFunctionExecutionError"){const g=await eme(e,{balanceAddress:n,chainId:a,symbolType:"bytes32",tokenAddress:o}),v=ict(Hf(g.symbol,{dir:"right"}));return{...g,symbol:v}}throw x}const c=e.getClient({chainId:a}),d=await i2(c,cie,"getBalance")(r?{address:n,blockNumber:r}:{address:n,blockTag:s}),f=e.chains.find(x=>x.id===a)??c.chain;return{decimals:f.nativeCurrency.decimals,formatted:jk(d,GEe(l)),symbol:f.nativeCurrency.symbol,value:d}}async function eme(e,t){const{balanceAddress:n,chainId:r,symbolType:s,tokenAddress:a,unit:o}=t,l={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:s}]}],address:a},[c,u,d]=await u0t(e,{allowFailure:!1,contracts:[{...l,functionName:"balanceOf",args:[n],chainId:r},{...l,functionName:"decimals",chainId:r},{...l,functionName:"symbol",chainId:r}]}),f=jk(c??"0",GEe(o??u));return{decimals:u,formatted:f,symbol:d,value:c}}function tme(e){return e.state.chainId}function Uy(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,r;if(Array.isArray(e)&&Array.isArray(t)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Uy(e[r],t[r]))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const s=Object.keys(e);if(n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(a&&!Uy(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}let dH=[];function nme(e){const t=e.chains;return Uy(dH,t)?dH:(dH=t,t)}function f0t(e,t={}){let n;try{n=e.getClient(t)}catch{}return n}let BI=[];function $Z(e){const t=[...e.state.connections.values()];return e.state.status==="reconnecting"||Uy(BI,t)?BI:(BI=t,t)}let fH=[];function rme(e){const t=e.connectors;return Uy(fH,t)?fH:(fH=t,t)}function h0t(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return i2(s,H9e,"getEnsAvatar")(r)}function p0t(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return i2(s,V9e,"getEnsName")(r)}function UZ(e,t={}){const n=f0t(e,t);return n==null?void 0:n.extend(o0t)}let hH=!1;async function m0t(e,t={}){var u,d;if(hH)return[];hH=!0,e.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const n=[];if((u=t.connectors)!=null&&u.length)for(const f of t.connectors){let x;typeof f=="function"?x=e._internal.connectors.setup(f):x=f,n.push(x)}else n.push(...e.connectors);let r;try{r=await((d=e.storage)==null?void 0:d.getItem("recentConnectorId"))}catch{}const s={};for(const[,f]of e.state.connections)s[f.connector.id]=1;r&&(s[r]=0);const a=Object.keys(s).length>0?[...n].sort((f,x)=>(s[f.id]??10)-(s[x.id]??10)):n;let o=!1;const l=[],c=[];for(const f of a){const x=await f.getProvider().catch(()=>{});if(!x||c.some(w=>w===x)||!await f.isAuthorized())continue;const v=await f.connect({isReconnecting:!0}).catch(()=>null);v&&(f.emitter.off("connect",e._internal.events.connect),f.emitter.on("change",e._internal.events.change),f.emitter.on("disconnect",e._internal.events.disconnect),e.setState(w=>{const C=new Map(o?w.connections:new Map).set(f.uid,{accounts:v.accounts,chainId:v.chainId,connector:f});return{...w,current:o?w.current:f.uid,connections:C}}),l.push({accounts:v.accounts,chainId:v.chainId,connector:f}),c.push(x),o=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(o?e.setState(f=>({...f,status:"connected"})):e.setState(f=>({...f,connections:new Map,current:null,status:"disconnected"}))),hH=!1,l}async function x0t(e,t){const{account:n,connector:r,...s}=t;let a;return typeof n=="object"&&n.type==="local"?a=e.getClient():a=await Lie(e,{account:n,connector:r}),i2(a,fmt,"signMessage")({...s,...n?{account:n}:{}})}async function g0t(e,t){const{account:n,connector:r,...s}=t;let a;return typeof n=="object"&&n.type==="local"?a=e.getClient():a=await Lie(e,{account:n,connector:r}),i2(a,hmt,"signTypedData")({...s,...n?{account:n}:{}})}class Wh extends C1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class b0t extends C1{constructor({connector:t}){super(`"${t.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function y0t(e,t){var o;const{addEthereumChainParameter:n,chainId:r}=t,s=e.state.connections.get(((o=t.connector)==null?void 0:o.uid)??e.state.current);if(s){const l=s.connector;if(!l.switchChain)throw new b0t({connector:l});return await l.switchChain({addEthereumChainParameter:n,chainId:r})}const a=e.chains.find(l=>l.id===r);if(!a)throw new C3;return e.setState(l=>({...l,chainId:r})),a}function XEe(e,t){const{onChange:n}=t;return e.subscribe(()=>KEe(e),n,{equalityFn(r,s){const{connector:a,...o}=r,{connector:l,...c}=s;return Uy(o,c)&&(a==null?void 0:a.id)===(l==null?void 0:l.id)&&(a==null?void 0:a.uid)===(l==null?void 0:l.uid)}})}function v0t(e,t){const{onChange:n}=t;return e.subscribe(r=>r.chainId,n)}function w0t(e,t){const{onChange:n}=t;return e.subscribe(()=>$Z(e),n,{equalityFn:Uy})}function C0t(e,t){const{onChange:n}=t;return e._internal.connectors.subscribe((r,s)=>{n(Object.values(r),s)})}function S0t(e,t){const{onChange:n}=t;return e.subscribe(()=>UZ(e),n,{equalityFn(r,s){return(r==null?void 0:r.uid)===(s==null?void 0:s.uid)}})}async function N0t(e,t){const{account:n,chainId:r,connector:s,...a}=t;let o;return typeof n=="object"&&(n==null?void 0:n.type)==="local"?o=e.getClient({chainId:r}):o=await Lie(e,{account:n??void 0,chainId:r,connector:s}),await i2(o,qmt,"writeContract")({...a,...n?{account:n}:{},chain:r?{id:r}:null})}gB.type="injected";function gB(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function r(){const c=e.target;if(typeof c=="function"){const u=c();if(u)return u}return typeof c=="object"?c:typeof c=="string"?{...A0t[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(u){return u==null?void 0:u.ethereum}}}let s,a,o,l;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:gB.type,async setup(){const u=await this.getProvider();u!=null&&u.on&&e.target&&(o||(o=this.onConnect.bind(this),u.on("connect",o)),s||(s=this.onAccountsChanged.bind(this),u.on("accountsChanged",s)))},async connect({chainId:u,isReconnecting:d}={}){var g,v,w,C,N,I;const f=await this.getProvider();if(!f)throw new Wh;let x=[];if(d)x=await this.getAccounts().catch(()=>[]);else if(t)try{x=(C=(w=(v=(g=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:g.caveats)==null?void 0:v[0])==null?void 0:w.value)==null?void 0:C.map(R=>Ac(R)),x.length>0&&(x=await this.getAccounts())}catch(P){const R=P;if(R.code===bo.code)throw new bo(R);if(R.code===Cy.code)throw R}try{!(x!=null&&x.length)&&!d&&(x=(await f.request({method:"eth_requestAccounts"})).map(F=>Ac(F))),o&&(f.removeListener("connect",o),o=void 0),s||(s=this.onAccountsChanged.bind(this),f.on("accountsChanged",s)),a||(a=this.onChainChanged.bind(this),f.on("chainChanged",a)),l||(l=this.onDisconnect.bind(this),f.on("disconnect",l));let P=await this.getChainId();if(u&&P!==u){const R=await this.switchChain({chainId:u}).catch(F=>{if(F.code===bo.code)throw F;return{id:P}});P=(R==null?void 0:R.id)??P}return t&&await((N=c.storage)==null?void 0:N.removeItem(`${this.id}.disconnected`)),e.target||await((I=c.storage)==null?void 0:I.setItem("injected.connected",!0)),{accounts:x,chainId:P}}catch(P){const R=P;throw R.code===bo.code?new bo(R):R.code===Cy.code?new Cy(R):R}},async disconnect(){var d,f;const u=await this.getProvider();if(!u)throw new Wh;a&&(u.removeListener("chainChanged",a),a=void 0),l&&(u.removeListener("disconnect",l),l=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o));try{await Tie(()=>u.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await((d=c.storage)==null?void 0:d.setItem(`${this.id}.disconnected`,!0)),e.target||await((f=c.storage)==null?void 0:f.removeItem("injected.connected"))},async getAccounts(){const u=await this.getProvider();if(!u)throw new Wh;return(await u.request({method:"eth_accounts"})).map(f=>Ac(f))},async getChainId(){const u=await this.getProvider();if(!u)throw new Wh;const d=await u.request({method:"eth_chainId"});return Number(d)},async getProvider(){if(typeof window>"u")return;let u;const d=r();return typeof d.provider=="function"?u=d.provider(window):typeof d.provider=="string"?u=LF(window,d.provider):u=d.provider,u&&!u.removeListener&&("off"in u&&typeof u.off=="function"?u.removeListener=u.off:u.removeListener=()=>{}),u},async isAuthorized(){var u,d;try{if(t&&await((u=c.storage)==null?void 0:u.getItem(`${this.id}.disconnected`))||!e.target&&!await((d=c.storage)==null?void 0:d.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const v=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",v),!!await this.getProvider()),w=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(N=>window.addEventListener("ethereum#initialized",()=>N(v()),{once:!0}))]:[],new Promise(N=>setTimeout(()=>N(v()),w))]))return!0}throw new Wh}return!!(await sM(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:d}){var v,w,C,N;const f=await this.getProvider();if(!f)throw new Wh;const x=c.chains.find(I=>I.id===d);if(!x)throw new ip(new C3);const g=new Promise(I=>{const P=R=>{"chainId"in R&&R.chainId===d&&(c.emitter.off("change",P),I())};c.emitter.on("change",P)});try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:Ds(d)}]}).then(async()=>{await this.getChainId()===d&&c.emitter.emit("change",{chainId:d})}),g]),x}catch(I){const P=I;if(P.code===4902||((w=(v=P==null?void 0:P.data)==null?void 0:v.originalError)==null?void 0:w.code)===4902)try{const{default:R,...F}=x.blockExplorers??{};let U;u!=null&&u.blockExplorerUrls?U=u.blockExplorerUrls:R&&(U=[R.url,...Object.values(F).map(Q=>Q.url)]);let L;(C=u==null?void 0:u.rpcUrls)!=null&&C.length?L=u.rpcUrls:L=[((N=x.rpcUrls.default)==null?void 0:N.http[0])??""];const z={blockExplorerUrls:U,chainId:Ds(d),chainName:(u==null?void 0:u.chainName)??x.name,iconUrls:u==null?void 0:u.iconUrls,nativeCurrency:(u==null?void 0:u.nativeCurrency)??x.nativeCurrency,rpcUrls:L};return await Promise.all([f.request({method:"wallet_addEthereumChain",params:[z]}).then(async()=>{if(await this.getChainId()===d)c.emitter.emit("change",{chainId:d});else throw new bo(new Error("User rejected switch after adding network."))}),g]),x}catch(R){throw new bo(R)}throw P.code===bo.code?new bo(P):new ip(P)}},async onAccountsChanged(u){var d;if(u.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const f=(await this.getChainId()).toString();this.onConnect({chainId:f}),t&&await((d=c.storage)==null?void 0:d.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:u.map(f=>Ac(f))})},onChainChanged(u){const d=Number(u);c.emitter.emit("change",{chainId:d})},async onConnect(u){const d=await this.getAccounts();if(d.length===0)return;const f=Number(u.chainId);c.emitter.emit("connect",{accounts:d,chainId:f});const x=await this.getProvider();x&&(o&&(x.removeListener("connect",o),o=void 0),s||(s=this.onAccountsChanged.bind(this),x.on("accountsChanged",s)),a||(a=this.onChainChanged.bind(this),x.on("chainChanged",a)),l||(l=this.onDisconnect.bind(this),x.on("disconnect",l)))},async onDisconnect(u){const d=await this.getProvider();u&&u.code===1013&&d&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),d&&(a&&(d.removeListener("chainChanged",a),a=void 0),l&&(d.removeListener("disconnect",l),l=void 0),o||(o=this.onConnect.bind(this),d.on("connect",o))))}})}const A0t={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e!=null&&e.coinbaseWalletExtension?e.coinbaseWalletExtension:LF(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return LF(e,t=>{if(!t.isMetaMask||t.isBraveWallet&&!t._events&&!t._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(t[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(e){var t,n;return(t=e==null?void 0:e.phantom)!=null&&t.ethereum?(n=e.phantom)==null?void 0:n.ethereum:LF(e,"isPhantom")}}};function LF(e,t){function n(s){return typeof t=="function"?t(s):typeof t=="string"?s[t]:!0}const r=e.ethereum;if(r!=null&&r.providers)return r.providers.find(s=>n(s));if(r&&n(r))return r}function j0t(e){if(typeof window>"u")return;const t=n=>e(n.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}function E0t(){const e=new Set;let t=[];const n=()=>j0t(s=>{t.some(({info:a})=>a.uuid===s.info.uuid)||(t=[...t,s],e.forEach(a=>a(t,{added:[s]})))});let r=n();return{_listeners(){return e},clear(){e.forEach(s=>s([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),r==null||r()},findProvider({rdns:s}){return t.find(a=>a.info.rdns===s)},getProviders(){return t},reset(){this.clear(),r==null||r(),r=n()},subscribe(s,{emitImmediately:a}={}){return e.add(s),a&&s(t,{added:t}),()=>e.delete(s)}}}const _0t=e=>(t,n,r)=>{const s=r.subscribe;return r.subscribe=(o,l,c)=>{let u=o;if(l){const d=(c==null?void 0:c.equalityFn)||Object.is;let f=o(r.getState());u=x=>{const g=o(x);if(!d(f,g)){const v=f;l(f=g,v)}},c!=null&&c.fireImmediately&&l(f,f)}return s(u)},e(t,n,r)},k0t=_0t;function T0t(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const o=c=>c===null?null:JSON.parse(c,void 0),l=(a=n.getItem(s))!=null?a:null;return l instanceof Promise?l.then(o):o(l)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const zZ=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return zZ(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return zZ(r)(n)}}}},I0t=(e,t)=>(n,r,s)=>{let a={storage:T0t(()=>localStorage),partialize:w=>w,version:0,merge:(w,C)=>({...C,...w}),...t},o=!1;const l=new Set,c=new Set;let u=a.storage;if(!u)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...w)},r,s);const d=()=>{const w=a.partialize({...r()});return u.setItem(a.name,{state:w,version:a.version})},f=s.setState;s.setState=(w,C)=>{f(w,C),d()};const x=e((...w)=>{n(...w),d()},r,s);s.getInitialState=()=>x;let g;const v=()=>{var w,C;if(!u)return;o=!1,l.forEach(I=>{var P;return I((P=r())!=null?P:x)});const N=((C=a.onRehydrateStorage)==null?void 0:C.call(a,(w=r())!=null?w:x))||void 0;return zZ(u.getItem.bind(u))(a.name).then(I=>{if(I)if(typeof I.version=="number"&&I.version!==a.version){if(a.migrate)return[!0,a.migrate(I.state,I.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,I.state];return[!1,void 0]}).then(I=>{var P;const[R,F]=I;if(g=a.merge(F,(P=r())!=null?P:x),n(g,!0),R)return d()}).then(()=>{N==null||N(g,void 0),g=r(),o=!0,c.forEach(I=>I(g))}).catch(I=>{N==null||N(void 0,I)})};return s.persist={setOptions:w=>{a={...a,...w},w.storage&&(u=w.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:w=>(l.add(w),()=>{l.delete(w)}),onFinishHydration:w=>(c.add(w),()=>{c.delete(w)})},a.skipHydration||v(),g||x},P0t=I0t,sme=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const x=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,x))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(r,s,l);return l},pH=e=>e?sme(e):sme;var mH={exports:{}},ime;function F0t(){return ime||(ime=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,x){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new s(d,f||c,x),v=n?n+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],g]:c._events[v].push(g):(c._events[v]=g,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var x=0,g=f.length,v=new Array(g);x<g;x++)v[x]=f[x].fn;return v},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,x,g,v){var w=n?n+u:u;if(!this._events[w])return!1;var C=this._events[w],N=arguments.length,I,P;if(C.fn){switch(C.once&&this.removeListener(u,C.fn,void 0,!0),N){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,d),!0;case 3:return C.fn.call(C.context,d,f),!0;case 4:return C.fn.call(C.context,d,f,x),!0;case 5:return C.fn.call(C.context,d,f,x,g),!0;case 6:return C.fn.call(C.context,d,f,x,g,v),!0}for(P=1,I=new Array(N-1);P<N;P++)I[P-1]=arguments[P];C.fn.apply(C.context,I)}else{var R=C.length,F;for(P=0;P<R;P++)switch(C[P].once&&this.removeListener(u,C[P].fn,void 0,!0),N){case 1:C[P].fn.call(C[P].context);break;case 2:C[P].fn.call(C[P].context,d);break;case 3:C[P].fn.call(C[P].context,d,f);break;case 4:C[P].fn.call(C[P].context,d,f,x);break;default:if(!I)for(F=1,I=new Array(N-1);F<N;F++)I[F-1]=arguments[F];C[P].fn.apply(C[P].context,I)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,x){var g=n?n+u:u;if(!this._events[g])return this;if(!d)return o(this,g),this;var v=this._events[g];if(v.fn)v.fn===d&&(!x||v.once)&&(!f||v.context===f)&&o(this,g);else{for(var w=0,C=[],N=v.length;w<N;w++)(v[w].fn!==d||x&&!v[w].once||f&&v[w].context!==f)&&C.push(v[w]);C.length?this._events[g]=C.length===1?C[0]:C:o(this,g)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l}(mH)),mH.exports}var O0t=F0t();const Die=ki(O0t);let M0t=class{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new Die})}on(t,n){this._emitter.on(t,n)}once(t,n){this._emitter.once(t,n)}off(t,n){this._emitter.off(t,n)}emit(t,...n){const r=n[0];this._emitter.emit(t,{uid:this.uid,...r})}listenerCount(t){return this._emitter.listenerCount(t)}};function R0t(e){return new M0t(e)}function L0t(e,t){return JSON.parse(e,(n,r)=>{let s=r;return(s==null?void 0:s.__type)==="bigint"&&(s=BigInt(s.value)),(s==null?void 0:s.__type)==="Map"&&(s=new Map(s.value)),(t==null?void 0:t(n,s))??s})}function ame(e,t){return e.slice(0,t).join(".")||"."}function ome(e,t){const{length:n}=e;for(let r=0;r<n;++r)if(e[r]===t)return r+1;return 0}function D0t(e,t){const n=typeof e=="function",r=typeof t=="function",s=[],a=[];return function(l,c){if(typeof c=="object")if(s.length){const u=ome(s,this);u===0?s[s.length]=this:(s.splice(u),a.splice(u)),a[a.length]=l;const d=ome(s,c);if(d!==0)return r?t.call(this,l,c,ame(a,d)):`[ref=${ame(a,d)}]`}else s[0]=c,a[0]=l;return n?e.call(this,l,c):c}}function B0t(e,t,n,r){return JSON.stringify(e,D0t((s,a)=>{let o=a;return typeof o=="bigint"&&(o={__type:"bigint",value:a.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(a.entries())}),(t==null?void 0:t(s,o))??o},r),n??void 0)}function $0t(e){const{deserialize:t=L0t,key:n="wagmi",serialize:r=B0t,storage:s=QEe}=e;function a(o){return o instanceof Promise?o.then(l=>l).catch(()=>null):o}return{...s,key:n,async getItem(o,l){const c=s.getItem(`${n}.${o}`),u=await a(c);return u?t(u)??null:l??null},async setItem(o,l){const c=`${n}.${o}`;l===null?await a(s.removeItem(c)):await a(s.setItem(c,r(l)))},async removeItem(o){await a(s.removeItem(`${n}.${o}`))}}}const QEe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function U0t(){const e=typeof window<"u"&&window.localStorage?window.localStorage:QEe;return{getItem(t){return e.getItem(t)},removeItem(t){e.removeItem(t)},setItem(t,n){try{e.setItem(t,n)}catch{}}}}const HZ=256;let $I=HZ,UI;function z0t(e=11){if(!UI||$I+e>HZ*2){UI="",$I=0;for(let t=0;t<HZ;t++)UI+=(256+Math.random()*256|0).toString(16).substring(1)}return UI.substring($I,$I+++e)}function H0t(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=$0t({storage:U0t()}),syncConnectedChain:r=!0,ssr:s=!1,...a}=e,o=typeof window<"u"&&t?E0t():void 0,l=pH(()=>a.chains),c=pH(()=>{const F=[],U=new Set;for(const L of a.connectors??[]){const z=u(L);if(F.push(z),!s&&z.rdns){const Q=typeof z.rdns=="string"?[z.rdns]:z.rdns;for(const ne of Q)U.add(ne)}}if(!s&&o){const L=o.getProviders();for(const z of L)U.has(z.info.rdns)||F.push(u(d(z)))}return F});function u(F){var z;const U=R0t(z0t()),L={...F({emitter:U,chains:l.getState(),storage:n,transports:a.transports}),emitter:U,uid:U.uid};return U.on("connect",P),(z=L.setup)==null||z.call(L),L}function d(F){const{info:U}=F,L=F.provider;return gB({target:{...U,id:U.rdns,provider:L}})}const f=new Map;function x(F={}){const U=F.chainId??C.getState().chainId,L=l.getState().find(Q=>Q.id===U);if(F.chainId&&!L)throw new C3;{const Q=f.get(C.getState().chainId);if(Q&&!L)return Q;if(!L)throw new C3}{const Q=f.get(U);if(Q)return Q}let z;if(a.client)z=a.client({chain:L});else{const Q=L.id,ne=l.getState().map(re=>re.id),J={},X=Object.entries(a);for(const[re,pe]of X)if(!(re==="chains"||re==="client"||re==="connectors"||re==="transports"))if(typeof pe=="object")if(Q in pe)J[re]=pe[Q];else{if(ne.some(ie=>ie in pe))continue;J[re]=pe}else J[re]=pe;z=WEe({...J,chain:L,batch:J.batch??{multicall:!0},transport:re=>a.transports[Q]({...re,connectors:c})})}return f.set(U,z),z}function g(){return{chainId:l.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let v;const w="0.0.0-canary-";RF.startsWith(w)?v=Number.parseInt(RF.replace(w,"")):v=Number.parseInt(RF.split(".")[0]??"0");const C=pH(k0t(n?P0t(g,{migrate(F,U){if(U===v)return F;const L=g(),z=N(F,L.chainId);return{...L,chainId:z}},name:"store",partialize(F){return{connections:{__type:"Map",value:Array.from(F.connections.entries()).map(([U,L])=>{const{id:z,name:Q,type:ne,uid:J}=L.connector;return[U,{...L,connector:{id:z,name:Q,type:ne,uid:J}}]})},chainId:F.chainId,current:F.current}},merge(F,U){typeof F=="object"&&F&&"status"in F&&delete F.status;const L=N(F,U.chainId);return{...U,...F,chainId:L}},skipHydration:s,storage:n,version:v}):g));C.setState(g());function N(F,U){return F&&typeof F=="object"&&"chainId"in F&&typeof F.chainId=="number"&&l.getState().some(L=>L.id===F.chainId)?F.chainId:U}r&&C.subscribe(({connections:F,current:U})=>{var L;return U?(L=F.get(U))==null?void 0:L.chainId:void 0},F=>{if(l.getState().some(L=>L.id===F))return C.setState(L=>({...L,chainId:F??L.chainId}))}),o==null||o.subscribe(F=>{const U=new Set,L=new Set;for(const Q of c.getState())if(U.add(Q.id),Q.rdns){const ne=typeof Q.rdns=="string"?[Q.rdns]:Q.rdns;for(const J of ne)L.add(J)}const z=[];for(const Q of F){if(L.has(Q.info.rdns))continue;const ne=u(d(Q));U.has(ne.id)||z.push(ne)}n&&!C.persist.hasHydrated()||c.setState(Q=>[...Q,...z],!0)});function I(F){C.setState(U=>{const L=U.connections.get(F.uid);return L?{...U,connections:new Map(U.connections).set(F.uid,{accounts:F.accounts??L.accounts,chainId:F.chainId??L.chainId,connector:L.connector})}:U})}function P(F){C.getState().status==="connecting"||C.getState().status==="reconnecting"||C.setState(U=>{const L=c.getState().find(z=>z.uid===F.uid);return L?(L.emitter.listenerCount("connect")&&L.emitter.off("connect",I),L.emitter.listenerCount("change")||L.emitter.on("change",I),L.emitter.listenerCount("disconnect")||L.emitter.on("disconnect",R),{...U,connections:new Map(U.connections).set(F.uid,{accounts:F.accounts,chainId:F.chainId,connector:L}),current:F.uid,status:"connected"}):U})}function R(F){C.setState(U=>{const L=U.connections.get(F.uid);if(L){const Q=L.connector;Q.emitter.listenerCount("change")&&L.connector.emitter.off("change",I),Q.emitter.listenerCount("disconnect")&&L.connector.emitter.off("disconnect",R),Q.emitter.listenerCount("connect")||L.connector.emitter.on("connect",P)}if(U.connections.delete(F.uid),U.connections.size===0)return{...U,connections:new Map,current:null,status:"disconnected"};const z=U.connections.values().next().value;return{...U,connections:new Map(U.connections),current:z.connector.uid}})}return{get chains(){return l.getState()},get connectors(){return c.getState()},storage:n,getClient:x,get state(){return C.getState()},setState(F){let U;typeof F=="function"?U=F(C.getState()):U=F;const L=g();typeof U!="object"&&(U=L),Object.keys(L).some(Q=>!(Q in U))&&(U=L),C.setState(U,!0)},subscribe(F,U,L){return C.subscribe(F,U,L?{...L,fireImmediately:L.emitImmediately}:void 0)},_internal:{mipd:o,store:C,ssr:!!s,syncConnectedChain:r,transports:a.transports,chains:{setState(F){const U=typeof F=="function"?F(l.getState()):F;if(U.length!==0)return l.setState(U,!0)},subscribe(F){return l.subscribe(F)}},connectors:{providerDetailToConnector:d,setup:u,setState(F){return c.setState(typeof F=="function"?F(c.getState()):F,!0)},subscribe(F){return c.subscribe(F)}},events:{change:I,connect:P,disconnect:R}}}}function V0t(e,t){const{initialState:n,reconnectOnMount:r}=t;return n&&!e._internal.store.persist.hasHydrated()&&e.setState({...n,chainId:e.chains.some(s=>s.id===n.chainId)?n.chainId:e.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){e._internal.ssr&&(await e._internal.store.persist.rehydrate(),e._internal.mipd&&e._internal.connectors.setState(s=>{var c;const a=new Set;for(const u of s??[])if(u.rdns){const d=Array.isArray(u.rdns)?u.rdns:[u.rdns];for(const f of d)a.add(f)}const o=[],l=((c=e._internal.mipd)==null?void 0:c.getProviders())??[];for(const u of l){if(a.has(u.info.rdns))continue;const d=e._internal.connectors.providerDetailToConnector(u),f=e._internal.connectors.setup(d);o.push(f)}return[...s,...o]})),r?m0t(e):e.storage&&e.setState(s=>({...s,connections:new Map}))}}}function W0t(e){var a,o,l;const{chain:t}=e,n=t.rpcUrls.default.http[0];if(!e.transports)return[n];const r=(o=(a=e.transports)==null?void 0:a[t.id])==null?void 0:o.call(a,{chain:t});return(((l=r==null?void 0:r.value)==null?void 0:l.transports)||[r]).map(({value:c})=>(c==null?void 0:c.url)||n)}function q0t(e){const{children:t,config:n,initialState:r,reconnectOnMount:s=!0}=e,{onMount:a}=V0t(n,{initialState:r,reconnectOnMount:s});n._internal.ssr||a();const o=m.useRef(!0);return m.useEffect(()=>{if(o.current&&n._internal.ssr)return a(),()=>{o.current=!1}},[]),t}const ZEe=m.createContext(void 0);function G0t(e){const{children:t,config:n}=e,r={value:n};return m.createElement(q0t,e,m.createElement(ZEe.Provider,r,t))}const K0t="2.14.16",Y0t=()=>`wagmi@${K0t}`;let X0t=class extends C1{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return Y0t()}};class Q0t extends X0t{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function Al(e={}){const t=e.config??m.useContext(ZEe);if(!t)throw new Q0t;return t}function Z0t(e,t){const{onChange:n}=t;return e._internal.chains.subscribe((r,s)=>{n(r,s)})}var xH={exports:{}},gH={},bH={exports:{}},yH={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var lme;function J0t(){if(lme)return yH;lme=1;var e=ax();function t(f,x){return f===x&&(f!==0||1/f===1/x)||f!==f&&x!==x}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(f,x){var g=x(),v=r({inst:{value:g,getSnapshot:x}}),w=v[0].inst,C=v[1];return a(function(){w.value=g,w.getSnapshot=x,c(w)&&C({inst:w})},[f,g,x]),s(function(){return c(w)&&C({inst:w}),f(function(){c(w)&&C({inst:w})})},[f]),o(g),g}function c(f){var x=f.getSnapshot;f=f.value;try{var g=x();return!n(f,g)}catch{return!0}}function u(f,x){return x()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return yH.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,yH}var cme;function ext(){return cme||(cme=1,bH.exports=J0t()),bH.exports}/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ume;function txt(){if(ume)return gH;ume=1;var e=ax(),t=ext();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return gH.useSyncExternalStoreWithSelector=function(u,d,f,x,g){var v=a(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=l(function(){function N(U){if(!I){if(I=!0,P=U,U=x(U),g!==void 0&&w.hasValue){var L=w.value;if(g(L,U))return R=L}return R=U}if(L=R,r(P,U))return L;var z=x(U);return g!==void 0&&g(L,z)?(P=U,L):(P=U,R=z)}var I=!1,P,R,F=f===void 0?null:f;return[function(){return N(d())},F===null?void 0:function(){return N(F())}]},[d,f,x,g]);var C=s(u,v[0],v[1]);return o(function(){w.hasValue=!0,w.value=C},[C]),c(C),C},gH}var dme;function nxt(){return dme||(dme=1,xH.exports=txt()),xH.exports}var JEe=nxt();const vH=e=>typeof e=="object"&&!Array.isArray(e);function rxt(e,t,n=t,r=Uy){const s=m.useRef([]),a=JEe.useSyncExternalStoreWithSelector(e,t,n,o=>o,(o,l)=>{if(vH(o)&&vH(l)&&s.current.length){for(const c of s.current)if(!r(o[c],l[c]))return!1;return!0}return r(o,l)});return m.useMemo(()=>{if(vH(a)){const o={...a};let l={};for(const[c,u]of Object.entries(o))l={...l,[c]:{configurable:!1,enumerable:!0,get:()=>(s.current.includes(c)||s.current.push(c),u)}};return Object.defineProperties(o,l),o}return a},[a])}function Jr(e={}){const t=Al(e);return rxt(n=>XEe(t,{onChange:n}),()=>KEe(t))}function e_e(e={}){const{onConnect:t,onDisconnect:n}=e,r=Al(e);m.useEffect(()=>XEe(r,{onChange(s,a){if((a.status==="reconnecting"||a.status==="connecting"&&a.address===void 0)&&s.status==="connected"){const{address:o,addresses:l,chain:c,chainId:u,connector:d}=s,f=a.status==="reconnecting"||a.status===void 0;t==null||t({address:o,addresses:l,chain:c,chainId:u,connector:d,isReconnected:f})}else a.status==="connected"&&s.status==="disconnected"&&(n==null||n())}}),[r,t,n])}var gA=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},S3=typeof window>"u"||"Deno"in globalThis;function Uh(){}function sxt(e,t){return typeof e=="function"?e(t):e}function VZ(e){return typeof e=="number"&&e>=0&&e!==1/0}function t_e(e,t){return Math.max(e+(t||0)-Date.now(),0)}function JC(e,t){return typeof e=="function"?e(t):e}function Zp(e,t){return typeof e=="function"?e(t):e}function fme(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Bie(o,t.options))return!1}else if(!rE(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function hme(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(N3(t.options.mutationKey)!==N3(a))return!1}else if(!rE(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Bie(e,t){return((t==null?void 0:t.queryKeyHashFn)||N3)(e)}function N3(e){return JSON.stringify(e,(t,n)=>WZ(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function rE(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>rE(e[n],t[n])):!1}function $ie(e,t){if(e===t)return e;const n=pme(e)&&pme(t);if(n||WZ(e)&&WZ(t)){const r=n?e:Object.keys(e),s=r.length,a=n?t:Object.keys(t),o=a.length,l=n?[]:{};let c=0;for(let u=0;u<o;u++){const d=n?u:a[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(l[d]=void 0,c++):(l[d]=$ie(e[d],t[d]),l[d]===e[d]&&e[d]!==void 0&&c++)}return s===o&&c===s?e:l}return t}function lM(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function pme(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function WZ(e){if(!mme(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!mme(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function mme(e){return Object.prototype.toString.call(e)==="[object Object]"}function ixt(e){return new Promise(t=>{setTimeout(t,e)})}function qZ(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$ie(e,t):t}function axt(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function oxt(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uie=Symbol();function n_e(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Uie?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var uw,Rb,y4,vNe,lxt=(vNe=class extends gA{constructor(){super();Ln(this,uw);Ln(this,Rb);Ln(this,y4);Wt(this,y4,t=>{if(!S3&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Ue(this,Rb)||this.setEventListener(Ue(this,y4))}onUnsubscribe(){var t;this.hasListeners()||((t=Ue(this,Rb))==null||t.call(this),Wt(this,Rb,void 0))}setEventListener(t){var n;Wt(this,y4,t),(n=Ue(this,Rb))==null||n.call(this),Wt(this,Rb,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Ue(this,uw)!==t&&(Wt(this,uw,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Ue(this,uw)=="boolean"?Ue(this,uw):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},uw=new WeakMap,Rb=new WeakMap,y4=new WeakMap,vNe),zie=new lxt,v4,Lb,w4,wNe,cxt=(wNe=class extends gA{constructor(){super();Ln(this,v4,!0);Ln(this,Lb);Ln(this,w4);Wt(this,w4,t=>{if(!S3&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Ue(this,Lb)||this.setEventListener(Ue(this,w4))}onUnsubscribe(){var t;this.hasListeners()||((t=Ue(this,Lb))==null||t.call(this),Wt(this,Lb,void 0))}setEventListener(t){var n;Wt(this,w4,t),(n=Ue(this,Lb))==null||n.call(this),Wt(this,Lb,t(this.setOnline.bind(this)))}setOnline(t){Ue(this,v4)!==t&&(Wt(this,v4,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Ue(this,v4)}},v4=new WeakMap,Lb=new WeakMap,w4=new WeakMap,wNe),cM=new cxt;function GZ(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function uxt(e){return Math.min(1e3*2**e,3e4)}function r_e(e){return(e??"online")==="online"?cM.isOnline():!0}var s_e=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wH(e){return e instanceof s_e}function i_e(e){let t=!1,n=0,r=!1,s;const a=GZ(),o=w=>{var C;r||(x(new s_e(w)),(C=e.abort)==null||C.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>zie.isFocused()&&(e.networkMode==="always"||cM.isOnline())&&e.canRun(),d=()=>r_e(e.networkMode)&&e.canRun(),f=w=>{var C;r||(r=!0,(C=e.onSuccess)==null||C.call(e,w),s==null||s(),a.resolve(w))},x=w=>{var C;r||(r=!0,(C=e.onError)==null||C.call(e,w),s==null||s(),a.reject(w))},g=()=>new Promise(w=>{var C;s=N=>{(r||u())&&w(N)},(C=e.onPause)==null||C.call(e)}).then(()=>{var w;s=void 0,r||(w=e.onContinue)==null||w.call(e)}),v=()=>{if(r)return;let w;const C=n===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(N){w=Promise.reject(N)}Promise.resolve(w).then(f).catch(N=>{var U;if(r)return;const I=e.retry??(S3?0:3),P=e.retryDelay??uxt,R=typeof P=="function"?P(n,N):P,F=I===!0||typeof I=="number"&&n<I||typeof I=="function"&&I(n,N);if(t||!F){x(N);return}n++,(U=e.onFail)==null||U.call(e,n,N),ixt(R).then(()=>u()?void 0:g()).then(()=>{t?x(N):v()})})};return{promise:a,cancel:o,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?v():g().then(v),a)}}var dxt=e=>setTimeout(e,0);function fxt(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=dxt;const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Jl=fxt(),dw,CNe,a_e=(CNe=class{constructor(){Ln(this,dw)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),VZ(this.gcTime)&&Wt(this,dw,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(S3?1/0:5*60*1e3))}clearGcTimeout(){Ue(this,dw)&&(clearTimeout(Ue(this,dw)),Wt(this,dw,void 0))}},dw=new WeakMap,CNe),C4,S4,Rh,fw,bu,G_,hw,Up,rg,SNe,hxt=(SNe=class extends a_e{constructor(t){super();Ln(this,Up);Ln(this,C4);Ln(this,S4);Ln(this,Rh);Ln(this,fw);Ln(this,bu);Ln(this,G_);Ln(this,hw);Wt(this,hw,!1),Wt(this,G_,t.defaultOptions),this.setOptions(t.options),this.observers=[],Wt(this,fw,t.client),Wt(this,Rh,Ue(this,fw).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Wt(this,C4,pxt(this.options)),this.state=t.state??Ue(this,C4),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Ue(this,bu))==null?void 0:t.promise}setOptions(t){this.options={...Ue(this,G_),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ue(this,Rh).remove(this)}setData(t,n){const r=qZ(this.state.data,t,this.options);return xr(this,Up,rg).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){xr(this,Up,rg).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=Ue(this,bu))==null?void 0:r.promise;return(s=Ue(this,bu))==null||s.cancel(t),n?n.then(Uh).catch(Uh):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ue(this,C4))}isActive(){return this.observers.some(t=>Zp(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uie||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!t_e(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Ue(this,bu))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Ue(this,bu))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Ue(this,Rh).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Ue(this,bu)&&(Ue(this,hw)?Ue(this,bu).cancel({revert:!0}):Ue(this,bu).cancelRetry()),this.scheduleGc()),Ue(this,Rh).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||xr(this,Up,rg).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Ue(this,bu))return Ue(this,bu).continueRetry(),Ue(this,bu).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(x=>x.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Wt(this,hw,!0),r.signal)})},a=()=>{const f=n_e(this.options,n),x={client:Ue(this,fw),queryKey:this.queryKey,meta:this.meta};return s(x),Wt(this,hw,!1),this.options.persister?this.options.persister(f,x,this):f(x)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Ue(this,fw),state:this.state,fetchFn:a};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),Wt(this,S4,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&xr(this,Up,rg).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const l=f=>{var x,g,v,w;wH(f)&&f.silent||xr(this,Up,rg).call(this,{type:"error",error:f}),wH(f)||((g=(x=Ue(this,Rh).config).onError)==null||g.call(x,f,this),(w=(v=Ue(this,Rh).config).onSettled)==null||w.call(v,this.state.data,f,this)),this.scheduleGc()};return Wt(this,bu,i_e({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var x,g,v,w;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(C){l(C);return}(g=(x=Ue(this,Rh).config).onSuccess)==null||g.call(x,f,this),(w=(v=Ue(this,Rh).config).onSettled)==null||w.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,x)=>{xr(this,Up,rg).call(this,{type:"failed",failureCount:f,error:x})},onPause:()=>{xr(this,Up,rg).call(this,{type:"pause"})},onContinue:()=>{xr(this,Up,rg).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),Ue(this,bu).start()}},C4=new WeakMap,S4=new WeakMap,Rh=new WeakMap,fw=new WeakMap,bu=new WeakMap,G_=new WeakMap,hw=new WeakMap,Up=new WeakSet,rg=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...o_e(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return wH(s)&&s.revert&&Ue(this,S4)?{...Ue(this,S4),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Jl.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Ue(this,Rh).notify({query:this,type:"updated",action:t})})},SNe);function o_e(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:r_e(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pxt(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var s0,NNe,mxt=(NNe=class extends gA{constructor(t={}){super();Ln(this,s0);this.config=t,Wt(this,s0,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??Bie(s,n);let o=this.get(a);return o||(o=new hxt({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){Ue(this,s0).has(t.queryHash)||(Ue(this,s0).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Ue(this,s0).get(t.queryHash);n&&(t.destroy(),n===t&&Ue(this,s0).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Jl.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Ue(this,s0).get(t)}getAll(){return[...Ue(this,s0).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>fme(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>fme(t,r)):n}notify(t){Jl.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Jl.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Jl.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},s0=new WeakMap,NNe),i0,Yu,pw,a0,Sb,ANe,xxt=(ANe=class extends a_e{constructor(t){super();Ln(this,a0);Ln(this,i0);Ln(this,Yu);Ln(this,pw);this.mutationId=t.mutationId,Wt(this,Yu,t.mutationCache),Wt(this,i0,[]),this.state=t.state||l_e(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Ue(this,i0).includes(t)||(Ue(this,i0).push(t),this.clearGcTimeout(),Ue(this,Yu).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Wt(this,i0,Ue(this,i0).filter(n=>n!==t)),this.scheduleGc(),Ue(this,Yu).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Ue(this,i0).length||(this.state.status==="pending"?this.scheduleGc():Ue(this,Yu).remove(this))}continue(){var t;return((t=Ue(this,pw))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,c,u,d,f,x,g,v,w,C,N,I,P,R,F,U,L,z;const n=()=>{xr(this,a0,Sb).call(this,{type:"continue"})};Wt(this,pw,i_e({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(Q,ne)=>{xr(this,a0,Sb).call(this,{type:"failed",failureCount:Q,error:ne})},onPause:()=>{xr(this,a0,Sb).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ue(this,Yu).canRun(this)}));const r=this.state.status==="pending",s=!Ue(this,pw).canStart();try{if(r)n();else{xr(this,a0,Sb).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=Ue(this,Yu).config).onMutate)==null?void 0:o.call(a,t,this));const ne=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));ne!==this.state.context&&xr(this,a0,Sb).call(this,{type:"pending",context:ne,variables:t,isPaused:s})}const Q=await Ue(this,pw).start();return await((d=(u=Ue(this,Yu).config).onSuccess)==null?void 0:d.call(u,Q,t,this.state.context,this)),await((x=(f=this.options).onSuccess)==null?void 0:x.call(f,Q,t,this.state.context)),await((v=(g=Ue(this,Yu).config).onSettled)==null?void 0:v.call(g,Q,null,this.state.variables,this.state.context,this)),await((C=(w=this.options).onSettled)==null?void 0:C.call(w,Q,null,t,this.state.context)),xr(this,a0,Sb).call(this,{type:"success",data:Q}),Q}catch(Q){try{throw await((I=(N=Ue(this,Yu).config).onError)==null?void 0:I.call(N,Q,t,this.state.context,this)),await((R=(P=this.options).onError)==null?void 0:R.call(P,Q,t,this.state.context)),await((U=(F=Ue(this,Yu).config).onSettled)==null?void 0:U.call(F,void 0,Q,this.state.variables,this.state.context,this)),await((z=(L=this.options).onSettled)==null?void 0:z.call(L,void 0,Q,t,this.state.context)),Q}finally{xr(this,a0,Sb).call(this,{type:"error",error:Q})}}finally{Ue(this,Yu).runNext(this)}}},i0=new WeakMap,Yu=new WeakMap,pw=new WeakMap,a0=new WeakSet,Sb=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Jl.batch(()=>{Ue(this,i0).forEach(r=>{r.onMutationUpdate(t)}),Ue(this,Yu).notify({mutation:this,type:"updated",action:t})})},ANe);function l_e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mg,zp,K_,jNe,gxt=(jNe=class extends gA{constructor(t={}){super();Ln(this,mg);Ln(this,zp);Ln(this,K_);this.config=t,Wt(this,mg,new Set),Wt(this,zp,new Map),Wt(this,K_,0)}build(t,n,r){const s=new xxt({mutationCache:this,mutationId:++sb(this,K_)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){Ue(this,mg).add(t);const n=zI(t);if(typeof n=="string"){const r=Ue(this,zp).get(n);r?r.push(t):Ue(this,zp).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Ue(this,mg).delete(t)){const n=zI(t);if(typeof n=="string"){const r=Ue(this,zp).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&Ue(this,zp).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=zI(t);if(typeof n=="string"){const r=Ue(this,zp).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=zI(t);if(typeof n=="string"){const s=(r=Ue(this,zp).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Jl.batch(()=>{Ue(this,mg).forEach(t=>{this.notify({type:"removed",mutation:t})}),Ue(this,mg).clear(),Ue(this,zp).clear()})}getAll(){return Array.from(Ue(this,mg))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>hme(n,r))}findAll(t={}){return this.getAll().filter(n=>hme(t,n))}notify(t){Jl.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Jl.batch(()=>Promise.all(t.map(n=>n.continue().catch(Uh))))}},mg=new WeakMap,zp=new WeakMap,K_=new WeakMap,jNe);function zI(e){var t;return(t=e.options.scope)==null?void 0:t.id}function xme(e){return{onFetch:(t,n)=>{var d,f,x,g,v;const r=t.options,s=(x=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:x.direction,a=((g=t.state.data)==null?void 0:g.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let w=!1;const C=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>(t.signal.aborted?w=!0:t.signal.addEventListener("abort",()=>{w=!0}),t.signal)})},N=n_e(t.options,t.fetchOptions),I=async(P,R,F)=>{if(w)return Promise.reject();if(R==null&&P.pages.length)return Promise.resolve(P);const U={client:t.client,queryKey:t.queryKey,pageParam:R,direction:F?"backward":"forward",meta:t.options.meta};C(U);const L=await N(U),{maxPages:z}=t.options,Q=F?oxt:axt;return{pages:Q(P.pages,L,z),pageParams:Q(P.pageParams,R,z)}};if(s&&a.length){const P=s==="backward",R=P?bxt:gme,F={pages:a,pageParams:o},U=R(r,F);l=await I(F,U,P)}else{const P=e??a.length;do{const R=c===0?o[0]??r.initialPageParam:gme(r,l);if(c>0&&R==null)break;l=await I(l,R),c++}while(c<P)}return l};t.options.persister?t.fetchFn=()=>{var w,C;return(C=(w=t.options).persister)==null?void 0:C.call(w,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function gme(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function bxt(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Yo,Db,Bb,N4,A4,$b,j4,E4,ENe,yxt=(ENe=class{constructor(e={}){Ln(this,Yo);Ln(this,Db);Ln(this,Bb);Ln(this,N4);Ln(this,A4);Ln(this,$b);Ln(this,j4);Ln(this,E4);Wt(this,Yo,e.queryCache||new mxt),Wt(this,Db,e.mutationCache||new gxt),Wt(this,Bb,e.defaultOptions||{}),Wt(this,N4,new Map),Wt(this,A4,new Map),Wt(this,$b,0)}mount(){sb(this,$b)._++,Ue(this,$b)===1&&(Wt(this,j4,zie.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ue(this,Yo).onFocus())})),Wt(this,E4,cM.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ue(this,Yo).onOnline())})))}unmount(){var e,t;sb(this,$b)._--,Ue(this,$b)===0&&((e=Ue(this,j4))==null||e.call(this),Wt(this,j4,void 0),(t=Ue(this,E4))==null||t.call(this),Wt(this,E4,void 0))}isFetching(e){return Ue(this,Yo).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Ue(this,Db).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Ue(this,Yo).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Ue(this,Yo).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(JC(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Ue(this,Yo).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=Ue(this,Yo).get(r.queryHash),a=s==null?void 0:s.state.data,o=sxt(t,a);if(o!==void 0)return Ue(this,Yo).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Jl.batch(()=>Ue(this,Yo).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Ue(this,Yo).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Ue(this,Yo);Jl.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Ue(this,Yo);return Jl.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Jl.batch(()=>Ue(this,Yo).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Uh).catch(Uh)}invalidateQueries(e,t={}){return Jl.batch(()=>(Ue(this,Yo).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Jl.batch(()=>Ue(this,Yo).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Uh)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Uh)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Ue(this,Yo).build(this,t);return n.isStaleByTime(JC(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Uh).catch(Uh)}fetchInfiniteQuery(e){return e.behavior=xme(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Uh).catch(Uh)}ensureInfiniteQueryData(e){return e.behavior=xme(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cM.isOnline()?Ue(this,Db).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ue(this,Yo)}getMutationCache(){return Ue(this,Db)}getDefaultOptions(){return Ue(this,Bb)}setDefaultOptions(e){Wt(this,Bb,e)}setQueryDefaults(e,t){Ue(this,N4).set(N3(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Ue(this,N4).values()],n={};return t.forEach(r=>{rE(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Ue(this,A4).set(N3(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Ue(this,A4).values()],n={};return t.forEach(r=>{rE(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Ue(this,Bb).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bie(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Uie&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Ue(this,Bb).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Ue(this,Yo).clear(),Ue(this,Db).clear()}},Yo=new WeakMap,Db=new WeakMap,Bb=new WeakMap,N4=new WeakMap,A4=new WeakMap,$b=new WeakMap,j4=new WeakMap,E4=new WeakMap,ENe),Ld,Zi,Y_,Xu,mw,_4,Ub,zb,X_,k4,T4,xw,gw,Hb,I4,Ma,uj,KZ,YZ,XZ,QZ,ZZ,JZ,eJ,c_e,_Ne,vxt=(_Ne=class extends gA{constructor(t,n){super();Ln(this,Ma);Ln(this,Ld);Ln(this,Zi);Ln(this,Y_);Ln(this,Xu);Ln(this,mw);Ln(this,_4);Ln(this,Ub);Ln(this,zb);Ln(this,X_);Ln(this,k4);Ln(this,T4);Ln(this,xw);Ln(this,gw);Ln(this,Hb);Ln(this,I4,new Set);this.options=n,Wt(this,Ld,t),Wt(this,zb,null),Wt(this,Ub,GZ()),this.options.experimental_prefetchInRender||Ue(this,Ub).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Ue(this,Zi).addObserver(this),bme(Ue(this,Zi),this.options)?xr(this,Ma,uj).call(this):this.updateResult(),xr(this,Ma,QZ).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tJ(Ue(this,Zi),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tJ(Ue(this,Zi),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xr(this,Ma,ZZ).call(this),xr(this,Ma,JZ).call(this),Ue(this,Zi).removeObserver(this)}setOptions(t){const n=this.options,r=Ue(this,Zi);if(this.options=Ue(this,Ld).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Zp(this.options.enabled,Ue(this,Zi))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");xr(this,Ma,eJ).call(this),Ue(this,Zi).setOptions(this.options),n._defaulted&&!lM(this.options,n)&&Ue(this,Ld).getQueryCache().notify({type:"observerOptionsUpdated",query:Ue(this,Zi),observer:this});const s=this.hasListeners();s&&yme(Ue(this,Zi),r,this.options,n)&&xr(this,Ma,uj).call(this),this.updateResult(),s&&(Ue(this,Zi)!==r||Zp(this.options.enabled,Ue(this,Zi))!==Zp(n.enabled,Ue(this,Zi))||JC(this.options.staleTime,Ue(this,Zi))!==JC(n.staleTime,Ue(this,Zi)))&&xr(this,Ma,KZ).call(this);const a=xr(this,Ma,YZ).call(this);s&&(Ue(this,Zi)!==r||Zp(this.options.enabled,Ue(this,Zi))!==Zp(n.enabled,Ue(this,Zi))||a!==Ue(this,Hb))&&xr(this,Ma,XZ).call(this,a)}getOptimisticResult(t){const n=Ue(this,Ld).getQueryCache().build(Ue(this,Ld),t),r=this.createResult(n,t);return Cxt(this,r)&&(Wt(this,Xu,r),Wt(this,_4,this.options),Wt(this,mw,Ue(this,Zi).state)),r}getCurrentResult(){return Ue(this,Xu)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){Ue(this,I4).add(t)}getCurrentQuery(){return Ue(this,Zi)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Ue(this,Ld).defaultQueryOptions(t),r=Ue(this,Ld).getQueryCache().build(Ue(this,Ld),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return xr(this,Ma,uj).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Ue(this,Xu)))}createResult(t,n){var Q;const r=Ue(this,Zi),s=this.options,a=Ue(this,Xu),o=Ue(this,mw),l=Ue(this,_4),u=t!==r?t.state:Ue(this,Y_),{state:d}=t;let f={...d},x=!1,g;if(n._optimisticResults){const ne=this.hasListeners(),J=!ne&&bme(t,n),X=ne&&yme(t,r,n,s);(J||X)&&(f={...f,...o_e(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:C}=f;g=f.data;let N=!1;if(n.placeholderData!==void 0&&g===void 0&&C==="pending"){let ne;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(ne=a.data,N=!0):ne=typeof n.placeholderData=="function"?n.placeholderData((Q=Ue(this,T4))==null?void 0:Q.state.data,Ue(this,T4)):n.placeholderData,ne!==void 0&&(C="success",g=qZ(a==null?void 0:a.data,ne,n),x=!0)}if(n.select&&g!==void 0&&!N)if(a&&g===(o==null?void 0:o.data)&&n.select===Ue(this,X_))g=Ue(this,k4);else try{Wt(this,X_,n.select),g=n.select(g),g=qZ(a==null?void 0:a.data,g,n),Wt(this,k4,g),Wt(this,zb,null)}catch(ne){Wt(this,zb,ne)}Ue(this,zb)&&(v=Ue(this,zb),g=Ue(this,k4),w=Date.now(),C="error");const I=f.fetchStatus==="fetching",P=C==="pending",R=C==="error",F=P&&I,U=g!==void 0,z={status:C,fetchStatus:f.fetchStatus,isPending:P,isSuccess:C==="success",isError:R,isInitialLoading:F,isLoading:F,data:g,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:I,isRefetching:I&&!P,isLoadingError:R&&!U,isPaused:f.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:R&&U,isStale:Hie(t,n),refetch:this.refetch,promise:Ue(this,Ub)};if(this.options.experimental_prefetchInRender){const ne=re=>{z.status==="error"?re.reject(z.error):z.data!==void 0&&re.resolve(z.data)},J=()=>{const re=Wt(this,Ub,z.promise=GZ());ne(re)},X=Ue(this,Ub);switch(X.status){case"pending":t.queryHash===r.queryHash&&ne(X);break;case"fulfilled":(z.status==="error"||z.data!==X.value)&&J();break;case"rejected":(z.status!=="error"||z.error!==X.reason)&&J();break}}return z}updateResult(){const t=Ue(this,Xu),n=this.createResult(Ue(this,Zi),this.options);if(Wt(this,mw,Ue(this,Zi).state),Wt(this,_4,this.options),Ue(this,mw).data!==void 0&&Wt(this,T4,Ue(this,Zi)),lM(n,t))return;Wt(this,Xu,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!Ue(this,I4).size)return!0;const o=new Set(a??Ue(this,I4));return this.options.throwOnError&&o.add("error"),Object.keys(Ue(this,Xu)).some(l=>{const c=l;return Ue(this,Xu)[c]!==t[c]&&o.has(c)})};xr(this,Ma,c_e).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xr(this,Ma,QZ).call(this)}},Ld=new WeakMap,Zi=new WeakMap,Y_=new WeakMap,Xu=new WeakMap,mw=new WeakMap,_4=new WeakMap,Ub=new WeakMap,zb=new WeakMap,X_=new WeakMap,k4=new WeakMap,T4=new WeakMap,xw=new WeakMap,gw=new WeakMap,Hb=new WeakMap,I4=new WeakMap,Ma=new WeakSet,uj=function(t){xr(this,Ma,eJ).call(this);let n=Ue(this,Zi).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Uh)),n},KZ=function(){xr(this,Ma,ZZ).call(this);const t=JC(this.options.staleTime,Ue(this,Zi));if(S3||Ue(this,Xu).isStale||!VZ(t))return;const r=t_e(Ue(this,Xu).dataUpdatedAt,t)+1;Wt(this,xw,setTimeout(()=>{Ue(this,Xu).isStale||this.updateResult()},r))},YZ=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Ue(this,Zi)):this.options.refetchInterval)??!1},XZ=function(t){xr(this,Ma,JZ).call(this),Wt(this,Hb,t),!(S3||Zp(this.options.enabled,Ue(this,Zi))===!1||!VZ(Ue(this,Hb))||Ue(this,Hb)===0)&&Wt(this,gw,setInterval(()=>{(this.options.refetchIntervalInBackground||zie.isFocused())&&xr(this,Ma,uj).call(this)},Ue(this,Hb)))},QZ=function(){xr(this,Ma,KZ).call(this),xr(this,Ma,XZ).call(this,xr(this,Ma,YZ).call(this))},ZZ=function(){Ue(this,xw)&&(clearTimeout(Ue(this,xw)),Wt(this,xw,void 0))},JZ=function(){Ue(this,gw)&&(clearInterval(Ue(this,gw)),Wt(this,gw,void 0))},eJ=function(){const t=Ue(this,Ld).getQueryCache().build(Ue(this,Ld),this.options);if(t===Ue(this,Zi))return;const n=Ue(this,Zi);Wt(this,Zi,t),Wt(this,Y_,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},c_e=function(t){Jl.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Ue(this,Xu))}),Ue(this,Ld).getQueryCache().notify({query:Ue(this,Zi),type:"observerResultsUpdated"})})},_Ne);function wxt(e,t){return Zp(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function bme(e,t){return wxt(e,t)||e.state.data!==void 0&&tJ(e,t,t.refetchOnMount)}function tJ(e,t,n){if(Zp(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Hie(e,t)}return!1}function yme(e,t,n,r){return(e!==t||Zp(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Hie(e,n)}function Hie(e,t){return Zp(t.enabled,e)!==!1&&e.isStaleByTime(JC(t.staleTime,e))}function Cxt(e,t){return!lM(e.getCurrentResult(),t)}var Vb,Wb,Dd,xg,Jg,DF,nJ,kNe,Sxt=(kNe=class extends gA{constructor(n,r){super();Ln(this,Jg);Ln(this,Vb);Ln(this,Wb);Ln(this,Dd);Ln(this,xg);Wt(this,Vb,n),this.setOptions(r),this.bindMethods(),xr(this,Jg,DF).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=Ue(this,Vb).defaultMutationOptions(n),lM(this.options,r)||Ue(this,Vb).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Ue(this,Dd),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&N3(r.mutationKey)!==N3(this.options.mutationKey)?this.reset():((s=Ue(this,Dd))==null?void 0:s.state.status)==="pending"&&Ue(this,Dd).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Ue(this,Dd))==null||n.removeObserver(this)}onMutationUpdate(n){xr(this,Jg,DF).call(this),xr(this,Jg,nJ).call(this,n)}getCurrentResult(){return Ue(this,Wb)}reset(){var n;(n=Ue(this,Dd))==null||n.removeObserver(this),Wt(this,Dd,void 0),xr(this,Jg,DF).call(this),xr(this,Jg,nJ).call(this)}mutate(n,r){var s;return Wt(this,xg,r),(s=Ue(this,Dd))==null||s.removeObserver(this),Wt(this,Dd,Ue(this,Vb).getMutationCache().build(Ue(this,Vb),this.options)),Ue(this,Dd).addObserver(this),Ue(this,Dd).execute(n)}},Vb=new WeakMap,Wb=new WeakMap,Dd=new WeakMap,xg=new WeakMap,Jg=new WeakSet,DF=function(){var r;const n=((r=Ue(this,Dd))==null?void 0:r.state)??l_e();Wt(this,Wb,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},nJ=function(n){Jl.batch(()=>{var r,s,a,o,l,c,u,d;if(Ue(this,xg)&&this.hasListeners()){const f=Ue(this,Wb).variables,x=Ue(this,Wb).context;(n==null?void 0:n.type)==="success"?((s=(r=Ue(this,xg)).onSuccess)==null||s.call(r,n.data,f,x),(o=(a=Ue(this,xg)).onSettled)==null||o.call(a,n.data,null,f,x)):(n==null?void 0:n.type)==="error"&&((c=(l=Ue(this,xg)).onError)==null||c.call(l,n.error,f,x),(d=(u=Ue(this,xg)).onSettled)==null||d.call(u,void 0,n.error,f,x))}this.listeners.forEach(f=>{f(Ue(this,Wb))})})},kNe);function Nxt(e,t){return $ie(e,t)}function Axt(e){return JSON.stringify(e,(t,n)=>jxt(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):typeof n=="bigint"?n.toString():n)}function jxt(e){if(!vme(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!vme(n)||!n.hasOwnProperty("isPrototypeOf"))}function vme(e){return Object.prototype.toString.call(e)==="[object Object]"}function bB(e){const{_defaulted:t,behavior:n,gcTime:r,initialData:s,initialDataUpdatedAt:a,maxPages:o,meta:l,networkMode:c,queryFn:u,queryHash:d,queryKey:f,queryKeyHashFn:x,retry:g,retryDelay:v,structuralSharing:w,getPreviousPageParam:C,getNextPageParam:N,initialPageParam:I,_optimisticResults:P,enabled:R,notifyOnChangeProps:F,placeholderData:U,refetchInterval:L,refetchIntervalInBackground:z,refetchOnMount:Q,refetchOnReconnect:ne,refetchOnWindowFocus:J,retryOnMount:X,select:re,staleTime:pe,suspense:Y,throwOnError:ie,config:oe,connector:G,query:V,...te}=e;return te}function Ext(e){return{mutationFn(t){return Jmt(e,t)},mutationKey:["connect"]}}function _xt(e){return{mutationFn(t){return l0t(e,t)},mutationKey:["disconnect"]}}function kxt(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("address is required");return await d0t(e,{...a,address:r})??null},queryKey:Txt(t)}}function Txt(e={}){return["balance",bB(e)]}function Ixt(e,t={}){return{async queryFn({queryKey:n}){const{name:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("name is required");return h0t(e,{...a,name:r})},queryKey:Pxt(t)}}function Pxt(e={}){return["ensAvatar",bB(e)]}function Fxt(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("address is required");return p0t(e,{...a,address:r})},queryKey:Oxt(t)}}function Oxt(e={}){return["ensName",bB(e)]}function Mxt(e,t={}){return{async queryFn({queryKey:n}){const r=t.abi;if(!r)throw new Error("abi is required");const{functionName:s,scopeKey:a,...o}=n[1],l=(()=>{const c=n[1];if(c.address)return{address:c.address};if(c.code)return{code:c.code};throw new Error("address or code is required")})();if(!s)throw new Error("functionName is required");return YEe(e,{abi:r,functionName:s,args:o.args,...l,...o})},queryKey:Rxt(t)}}function Rxt(e={}){const{abi:t,...n}=e;return["readContract",bB(n)]}function Lxt(e){return{mutationFn(t){return x0t(e,t)},mutationKey:["signMessage"]}}function Dxt(e){return{mutationFn(t){return g0t(e,t)},mutationKey:["signTypedData"]}}function Bxt(e){return{mutationFn(t){return y0t(e,t)},mutationKey:["switchChain"]}}function $xt(e){return{mutationFn(t){return N0t(e,t)},mutationKey:["writeContract"]}}var u_e=m.createContext(void 0),d_e=e=>{const t=m.useContext(u_e);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Uxt=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(u_e.Provider,{value:e,children:t})),f_e=m.createContext(!1),zxt=()=>m.useContext(f_e);f_e.Provider;function Hxt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vxt=m.createContext(Hxt()),Wxt=()=>m.useContext(Vxt);function h_e(e,t){return typeof e=="function"?e(...t):!!e}function rJ(){}var qxt=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Gxt=e=>{m.useEffect(()=>{e.clearReset()},[e])},Kxt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||h_e(n,[e.error,r])),Yxt=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Xxt=(e,t)=>e.isLoading&&e.isFetching&&!t,Qxt=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,wme=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zxt(e,t,n){var f,x,g,v,w;const r=d_e(),s=zxt(),a=Wxt(),o=r.defaultQueryOptions(e);(x=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||x.call(f,o),o._optimisticResults=s?"isRestoring":"optimistic",Yxt(o),qxt(o,a),Gxt(a);const l=!r.getQueryCache().get(o.queryHash),[c]=m.useState(()=>new t(r,o)),u=c.getOptimisticResult(o),d=!s&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(C=>{const N=d?c.subscribe(Jl.batchCalls(C)):rJ;return c.updateResult(),N},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(o)},[o,c]),Qxt(o,u))throw wme(o,c,a);if(Kxt({result:u,errorResetBoundary:a,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((v=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||v.call(g,o,u),o.experimental_prefetchInRender&&!S3&&Xxt(u,s)){const C=l?wme(o,c,a):(w=r.getQueryCache().get(o.queryHash))==null?void 0:w.promise;C==null||C.catch(rJ).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function p_e(e,t){return Zxt(e,vxt)}function bA(e,t){const n=d_e(),[r]=m.useState(()=>new Sxt(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const s=m.useSyncExternalStore(m.useCallback(o=>r.subscribe(Jl.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=m.useCallback((o,l)=>{r.mutate(o,l).catch(rJ)},[r]);if(s.error&&h_e(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function yB(e){const t=p_e({...e,queryKeyHashFn:Axt});return t.queryKey=e.queryKey,t}function yA(e={}){const t=Al(e);return m.useSyncExternalStore(n=>v0t(t,{onChange:n}),()=>tme(t),()=>tme(t))}function m_e(e={}){const{address:t,query:n={}}=e,r=Al(e),s=yA({config:r}),a=kxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return yB({...n,...a,enabled:o})}function Jxt(e={}){const t=Al(e);return m.useSyncExternalStore(n=>Z0t(t,{onChange:n}),()=>nme(t),()=>nme(t))}function egt(e={}){const t=Al(e);return m.useSyncExternalStore(n=>C0t(t,{onChange:n}),()=>rme(t),()=>rme(t))}function tgt(e={}){const{mutation:t}=e,n=Al(e),r=Ext(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return m.useEffect(()=>n.subscribe(({status:l})=>l,(l,c)=>{c==="connected"&&l==="disconnected"&&o.reset()}),[n,o.reset]),{...o,connect:s,connectAsync:a,connectors:egt({config:n})}}function ngt(e={}){const t=Al(e);return m.useSyncExternalStore(n=>w0t(t,{onChange:n}),()=>$Z(t),()=>$Z(t))}function vB(e={}){const{mutation:t}=e,n=Al(e),r=_xt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,connectors:ngt({config:n}).map(l=>l.connector),disconnect:s,disconnectAsync:a}}function rgt(e={}){const{name:t,query:n={}}=e,r=Al(e),s=yA({config:r}),a=Ixt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return yB({...n,...a,enabled:o})}function sgt(e={}){const{address:t,query:n={}}=e,r=Al(e),s=yA({config:r}),a=Fxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return yB({...n,...a,enabled:o})}function x_e(e={}){const t=Al(e);return JEe.useSyncExternalStoreWithSelector(n=>S0t(t,{onChange:n}),()=>UZ(t,e),()=>UZ(t,e),n=>n,(n,r)=>(n==null?void 0:n.uid)===(r==null?void 0:r.uid))}function Cme(e={}){const{abi:t,address:n,functionName:r,query:s={}}=e,a=e.code,o=Al(e),l=yA({config:o}),c=Mxt(o,{...e,chainId:e.chainId??l}),u=!!((n||a)&&t&&r&&(s.enabled??!0));return yB({...s,...c,enabled:u,structuralSharing:s.structuralSharing??Nxt})}function g_e(e={}){const{mutation:t}=e,n=Al(e),r=Lxt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,signMessage:s,signMessageAsync:a}}function igt(e={}){const{mutation:t}=e,n=Al(e),r=Dxt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,signTypedData:s,signTypedDataAsync:a}}function Vie(e={}){const{mutation:t}=e,n=Al(e),r=Bxt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,chains:Jxt({config:n}),switchChain:s,switchChainAsync:a}}function agt(e={}){const{mutation:t}=e,n=Al(e),r=$xt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,writeContract:s,writeContractAsync:a}}const J0=Object.create(null);J0.open="0";J0.close="1";J0.ping="2";J0.pong="3";J0.message="4";J0.upgrade="5";J0.noop="6";const BF=Object.create(null);Object.keys(J0).forEach(e=>{BF[J0[e]]=e});const sJ={type:"error",data:"parser error"},b_e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",y_e=typeof ArrayBuffer=="function",v_e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Wie=({type:e,data:t},n,r)=>b_e&&t instanceof Blob?n?r(t):Sme(t,r):y_e&&(t instanceof ArrayBuffer||v_e(t))?n?r(t):Sme(new Blob([t]),r):r(J0[e]+(t||"")),Sme=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Nme(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let CH;function ogt(e,t){if(b_e&&e.data instanceof Blob)return e.data.arrayBuffer().then(Nme).then(t);if(y_e&&(e.data instanceof ArrayBuffer||v_e(e.data)))return t(Nme(e.data));Wie(e,!1,n=>{CH||(CH=new TextEncoder),t(CH.encode(n))})}const Ame="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dj=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Ame.length;e++)dj[Ame.charCodeAt(e)]=e;const lgt=e=>{let t=e.length*.75,n=e.length,r,s=0,a,o,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)a=dj[e.charCodeAt(r)],o=dj[e.charCodeAt(r+1)],l=dj[e.charCodeAt(r+2)],c=dj[e.charCodeAt(r+3)],d[s++]=a<<2|o>>4,d[s++]=(o&15)<<4|l>>2,d[s++]=(l&3)<<6|c&63;return u},cgt=typeof ArrayBuffer=="function",qie=(e,t)=>{if(typeof e!="string")return{type:"message",data:w_e(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ugt(e.substring(1),t)}:BF[n]?e.length>1?{type:BF[n],data:e.substring(1)}:{type:BF[n]}:sJ},ugt=(e,t)=>{if(cgt){const n=lgt(e);return w_e(n,t)}else return{base64:!0,data:e}},w_e=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},C_e="",dgt=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((a,o)=>{Wie(a,!1,l=>{r[o]=l,++s===n&&t(r.join(C_e))})})},fgt=(e,t)=>{const n=e.split(C_e),r=[];for(let s=0;s<n.length;s++){const a=qie(n[s],t);if(r.push(a),a.type==="error")break}return r};function hgt(){return new TransformStream({transform(e,t){ogt(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const a=new DataView(s.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{s=new Uint8Array(9);const a=new DataView(s.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let SH;function HI(e){return e.reduce((t,n)=>t+n.length,0)}function VI(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function pgt(e,t){SH||(SH=new TextDecoder);const n=[];let r=0,s=-1,a=!1;return new TransformStream({transform(o,l){for(n.push(o);;){if(r===0){if(HI(n)<1)break;const c=VI(n,1);a=(c[0]&128)===128,s=c[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(HI(n)<2)break;const c=VI(n,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(HI(n)<8)break;const c=VI(n,8),u=new DataView(c.buffer,c.byteOffset,c.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(sJ);break}s=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(HI(n)<s)break;const c=VI(n,s);l.enqueue(qie(a?c:SH.decode(c),t)),r=0}if(s===0||s>e){l.enqueue(sJ);break}}}})}const S_e=4;function Ul(e){if(e)return mgt(e)}function mgt(e){for(var t in Ul.prototype)e[t]=Ul.prototype[t];return e}Ul.prototype.on=Ul.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ul.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ul.prototype.off=Ul.prototype.removeListener=Ul.prototype.removeAllListeners=Ul.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ul.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Ul.prototype.emitReserved=Ul.prototype.emit;Ul.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ul.prototype.hasListeners=function(e){return!!this.listeners(e).length};const wB=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),qh=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),xgt="arraybuffer";function N_e(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const ggt=qh.setTimeout,bgt=qh.clearTimeout;function CB(e,t){t.useNativeTimers?(e.setTimeoutFn=ggt.bind(qh),e.clearTimeoutFn=bgt.bind(qh)):(e.setTimeoutFn=qh.setTimeout.bind(qh),e.clearTimeoutFn=qh.clearTimeout.bind(qh))}const ygt=1.33;function vgt(e){return typeof e=="string"?wgt(e):Math.ceil((e.byteLength||e.size)*ygt)}function wgt(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function A_e(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Cgt(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Sgt(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class Ngt extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}let Gie=class extends Ul{constructor(t){super(),this.writable=!1,CB(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Ngt(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=qie(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Cgt(t);return n.length?"?"+n:""}};class Agt extends Gie{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};fgt(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,dgt(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=A_e()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let j_e=!1;try{j_e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jgt=j_e;function Egt(){}class _gt extends Agt{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,a)=>{this.onError("xhr post error",s,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let e4=class $F extends Ul{constructor(t,n,r){super(),this.createRequest=t,CB(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=N_e(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=$F.requestsCount++,$F.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Egt,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $F.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};e4.requestsCount=0;e4.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",jme);else if(typeof addEventListener=="function"){const e="onpagehide"in qh?"pagehide":"unload";addEventListener(e,jme,!1)}}function jme(){for(let e in e4.requests)e4.requests.hasOwnProperty(e)&&e4.requests[e].abort()}const kgt=function(){const e=E_e({xdomain:!1});return e&&e.responseType!==null}();class Tgt extends _gt{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=kgt&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new e4(E_e,this.uri(),t)}}function E_e(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||jgt))return new XMLHttpRequest}catch{}if(!t)try{return new qh[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const __e=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Igt extends Gie{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=__e?{}:N_e(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Wie(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}s&&wB(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=A_e()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const NH=qh.WebSocket||qh.MozWebSocket;let Pgt=class extends Igt{createSocket(t,n,r){return __e?new NH(t,n,r):n?new NH(t,n):new NH(t)}doWrite(t,n){this.ws.send(n)}};class Fgt extends Gie{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=pgt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=hgt();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const a=()=>{r.read().then(({done:l,value:c})=>{l||(this.onPacket(c),a())}).catch(l=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&wB(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Ogt={websocket:Pgt,webtransport:Fgt,polling:Tgt},Mgt=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Rgt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function iJ(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=Mgt.exec(e||""),a={},o=14;for(;o--;)a[Rgt[o]]=s[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Lgt(a,a.path),a.queryKey=Dgt(a,a.query),a}function Lgt(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Dgt(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,a){s&&(n[s]=a)}),n}const aJ=typeof addEventListener=="function"&&typeof removeEventListener=="function",UF=[];aJ&&addEventListener("offline",()=>{UF.forEach(e=>e())},!1);class Sy extends Ul{constructor(t,n){if(super(),this.binaryType=xgt,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=iJ(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=iJ(n.host).host);CB(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Sgt(this.opts.query)),aJ&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},UF.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=S_e,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Sy.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Sy.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=vgt(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,wB(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Sy.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),aJ&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=UF.indexOf(this._offlineEventListener);r!==-1&&UF.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Sy.protocol=S_e;class Bgt extends Sy{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Sy.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Sy.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=n.name,this.emitReserved("upgradeError",x)}}))};function a(){r||(r=!0,d(),n.close(),n=null)}const o=f=>{const x=new Error("probe error: "+f);x.transport=n.name,a(),this.emitReserved("upgradeError",x)};function l(){o("transport closed")}function c(){o("socket closed")}function u(f){n&&f.name!==n.name&&a()}const d=()=>{n.removeListener("open",s),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",u)};n.once("open",s),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let $gt=class extends Bgt{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>Ogt[s]).filter(s=>!!s)),super(t,r)}};function Ugt(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=iJ(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const zgt=typeof ArrayBuffer=="function",Hgt=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,k_e=Object.prototype.toString,Vgt=typeof Blob=="function"||typeof Blob<"u"&&k_e.call(Blob)==="[object BlobConstructor]",Wgt=typeof File=="function"||typeof File<"u"&&k_e.call(File)==="[object FileConstructor]";function Kie(e){return zgt&&(e instanceof ArrayBuffer||Hgt(e))||Vgt&&e instanceof Blob||Wgt&&e instanceof File}function zF(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(zF(e[n]))return!0;return!1}if(Kie(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return zF(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&zF(e[n]))return!0;return!1}function qgt(e){const t=[],n=e.data,r=e;return r.data=oJ(n,t),r.attachments=t.length,{packet:r,buffers:t}}function oJ(e,t){if(!e)return e;if(Kie(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=oJ(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=oJ(e[r],t));return n}return e}function Ggt(e,t){return e.data=lJ(e.data,t),delete e.attachments,e}function lJ(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=lJ(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=lJ(e[n],t));return e}const Kgt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Ygt=5;var Ji;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ji||(Ji={}));let Xgt=class{constructor(t){this.replacer=t}encode(t){return(t.type===Ji.EVENT||t.type===Ji.ACK)&&zF(t)?this.encodeAsBinary({type:t.type===Ji.EVENT?Ji.BINARY_EVENT:Ji.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ji.BINARY_EVENT||t.type===Ji.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=qgt(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}};function Eme(e){return Object.prototype.toString.call(e)==="[object Object]"}class Yie extends Ul{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Ji.BINARY_EVENT;r||n.type===Ji.BINARY_ACK?(n.type=r?Ji.EVENT:Ji.ACK,this.reconstructor=new Qgt(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Kie(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Ji[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ji.BINARY_EVENT||r.type===Ji.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Yie.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Ji.CONNECT:return Eme(n);case Ji.DISCONNECT:return n===void 0;case Ji.CONNECT_ERROR:return typeof n=="string"||Eme(n);case Ji.EVENT:case Ji.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Kgt.indexOf(n[0])===-1);case Ji.ACK:case Ji.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Qgt{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Ggt(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Zgt=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Yie,Encoder:Xgt,get PacketType(){return Ji},protocol:Ygt},Symbol.toStringTag,{value:"Module"}));function Kp(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Jgt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class T_e extends Ul{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Kp(t,"open",this.onopen.bind(this)),Kp(t,"packet",this.onpacket.bind(this)),Kp(t,"error",this.onerror.bind(this)),Kp(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,a;if(Jgt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Ji.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,f=n.pop();this._registerAckCallback(d,f),o.id=d}const l=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},s),o=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,s)=>{const a=(o,l)=>o?s(o):r(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...a)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ji.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ji.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ji.EVENT:case Ji.BINARY_EVENT:this.onevent(t);break;case Ji.ACK:case Ji.BINARY_ACK:this.onack(t);break;case Ji.DISCONNECT:this.ondisconnect();break;case Ji.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:Ji.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ji.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function vA(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}vA.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};vA.prototype.reset=function(){this.attempts=0};vA.prototype.setMin=function(e){this.ms=e};vA.prototype.setMax=function(e){this.max=e};vA.prototype.setJitter=function(e){this.jitter=e};class cJ extends Ul{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,CB(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new vA({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||Zgt;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new $gt(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Kp(n,"open",function(){r.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Kp(n,"error",a);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{s(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(s),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Kp(t,"ping",this.onping.bind(this)),Kp(t,"data",this.ondata.bind(this)),Kp(t,"error",this.onerror.bind(this)),Kp(t,"close",this.onclose.bind(this)),Kp(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){wB(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new T_e(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const y7={};function Ny(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Ugt(e,t.path||"/socket.io"),r=n.source,s=n.id,a=n.path,o=y7[s]&&a in y7[s].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new cJ(r,t):(y7[s]||(y7[s]=new cJ(r,t)),c=y7[s]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Ny,{Manager:cJ,Socket:T_e,io:Ny,connect:Ny});function I_e(e,t){return function(){return e.apply(t,arguments)}}const{toString:e1t}=Object.prototype,{getPrototypeOf:Xie}=Object,SB=(e=>t=>{const n=e1t.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Nm=e=>(e=e.toLowerCase(),t=>SB(t)===e),NB=e=>t=>typeof t===e,{isArray:wA}=Array,sE=NB("undefined");function t1t(e){return e!==null&&!sE(e)&&e.constructor!==null&&!sE(e.constructor)&&Vf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const P_e=Nm("ArrayBuffer");function n1t(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&P_e(e.buffer),t}const r1t=NB("string"),Vf=NB("function"),F_e=NB("number"),AB=e=>e!==null&&typeof e=="object",s1t=e=>e===!0||e===!1,HF=e=>{if(SB(e)!=="object")return!1;const t=Xie(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},i1t=Nm("Date"),a1t=Nm("File"),o1t=Nm("Blob"),l1t=Nm("FileList"),c1t=e=>AB(e)&&Vf(e.pipe),u1t=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Vf(e.append)&&((t=SB(e))==="formdata"||t==="object"&&Vf(e.toString)&&e.toString()==="[object FormData]"))},d1t=Nm("URLSearchParams"),[f1t,h1t,p1t,m1t]=["ReadableStream","Request","Response","Headers"].map(Nm),x1t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Rk(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),wA(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let l;for(r=0;r<o;r++)l=a[r],t.call(null,e[l],l,e)}}function O_e(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Wv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,M_e=e=>!sE(e)&&e!==Wv;function uJ(){const{caseless:e}=M_e(this)&&this||{},t={},n=(r,s)=>{const a=e&&O_e(t,s)||s;HF(t[a])&&HF(r)?t[a]=uJ(t[a],r):HF(r)?t[a]=uJ({},r):wA(r)?t[a]=r.slice():t[a]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Rk(arguments[r],n);return t}const g1t=(e,t,n,{allOwnKeys:r}={})=>(Rk(t,(s,a)=>{n&&Vf(s)?e[a]=I_e(s,n):e[a]=s},{allOwnKeys:r}),e),b1t=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),y1t=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},v1t=(e,t,n,r)=>{let s,a,o;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)o=s[a],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&Xie(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},w1t=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},C1t=e=>{if(!e)return null;if(wA(e))return e;let t=e.length;if(!F_e(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},S1t=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xie(Uint8Array)),N1t=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},A1t=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},j1t=Nm("HTMLFormElement"),E1t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),_me=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_1t=Nm("RegExp"),R_e=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Rk(n,(s,a)=>{let o;(o=t(s,a,e))!==!1&&(r[a]=o||s)}),Object.defineProperties(e,r)},k1t=e=>{R_e(e,(t,n)=>{if(Vf(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Vf(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},T1t=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return wA(e)?r(e):r(String(e).split(t)),n},I1t=()=>{},P1t=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,AH="abcdefghijklmnopqrstuvwxyz",kme="0123456789",L_e={DIGIT:kme,ALPHA:AH,ALPHA_DIGIT:AH+AH.toUpperCase()+kme},F1t=(e=16,t=L_e.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function O1t(e){return!!(e&&Vf(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const M1t=e=>{const t=new Array(10),n=(r,s)=>{if(AB(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const a=wA(r)?[]:{};return Rk(r,(o,l)=>{const c=n(o,s+1);!sE(c)&&(a[l]=c)}),t[s]=void 0,a}}return r};return n(e,0)},R1t=Nm("AsyncFunction"),L1t=e=>e&&(AB(e)||Vf(e))&&Vf(e.then)&&Vf(e.catch),D_e=((e,t)=>e?setImmediate:t?((n,r)=>(Wv.addEventListener("message",({source:s,data:a})=>{s===Wv&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Wv.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Vf(Wv.postMessage)),D1t=typeof queueMicrotask<"u"?queueMicrotask.bind(Wv):typeof process<"u"&&process.nextTick||D_e,mr={isArray:wA,isArrayBuffer:P_e,isBuffer:t1t,isFormData:u1t,isArrayBufferView:n1t,isString:r1t,isNumber:F_e,isBoolean:s1t,isObject:AB,isPlainObject:HF,isReadableStream:f1t,isRequest:h1t,isResponse:p1t,isHeaders:m1t,isUndefined:sE,isDate:i1t,isFile:a1t,isBlob:o1t,isRegExp:_1t,isFunction:Vf,isStream:c1t,isURLSearchParams:d1t,isTypedArray:S1t,isFileList:l1t,forEach:Rk,merge:uJ,extend:g1t,trim:x1t,stripBOM:b1t,inherits:y1t,toFlatObject:v1t,kindOf:SB,kindOfTest:Nm,endsWith:w1t,toArray:C1t,forEachEntry:N1t,matchAll:A1t,isHTMLForm:j1t,hasOwnProperty:_me,hasOwnProp:_me,reduceDescriptors:R_e,freezeMethods:k1t,toObjectSet:T1t,toCamelCase:E1t,noop:I1t,toFiniteNumber:P1t,findKey:O_e,global:Wv,isContextDefined:M_e,ALPHABET:L_e,generateString:F1t,isSpecCompliantForm:O1t,toJSONObject:M1t,isAsyncFn:R1t,isThenable:L1t,setImmediate:D_e,asap:D1t};function Ei(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}mr.inherits(Ei,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:mr.toJSONObject(this.config),code:this.code,status:this.status}}});const B_e=Ei.prototype,$_e={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{$_e[e]={value:e}});Object.defineProperties(Ei,$_e);Object.defineProperty(B_e,"isAxiosError",{value:!0});Ei.from=(e,t,n,r,s,a)=>{const o=Object.create(B_e);return mr.toFlatObject(e,o,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),Ei.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const B1t=null;function dJ(e){return mr.isPlainObject(e)||mr.isArray(e)}function U_e(e){return mr.endsWith(e,"[]")?e.slice(0,-2):e}function Tme(e,t,n){return e?e.concat(t).map(function(s,a){return s=U_e(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function $1t(e){return mr.isArray(e)&&!e.some(dJ)}const U1t=mr.toFlatObject(mr,{},null,function(t){return/^is[A-Z]/.test(t)});function jB(e,t,n){if(!mr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=mr.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,C){return!mr.isUndefined(C[w])});const r=n.metaTokens,s=n.visitor||d,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&mr.isSpecCompliantForm(t);if(!mr.isFunction(s))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(mr.isDate(v))return v.toISOString();if(!c&&mr.isBlob(v))throw new Ei("Blob is not supported. Use a Buffer instead.");return mr.isArrayBuffer(v)||mr.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function d(v,w,C){let N=v;if(v&&!C&&typeof v=="object"){if(mr.endsWith(w,"{}"))w=r?w:w.slice(0,-2),v=JSON.stringify(v);else if(mr.isArray(v)&&$1t(v)||(mr.isFileList(v)||mr.endsWith(w,"[]"))&&(N=mr.toArray(v)))return w=U_e(w),N.forEach(function(P,R){!(mr.isUndefined(P)||P===null)&&t.append(o===!0?Tme([w],R,a):o===null?w:w+"[]",u(P))}),!1}return dJ(v)?!0:(t.append(Tme(C,w,a),u(v)),!1)}const f=[],x=Object.assign(U1t,{defaultVisitor:d,convertValue:u,isVisitable:dJ});function g(v,w){if(!mr.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(v),mr.forEach(v,function(N,I){(!(mr.isUndefined(N)||N===null)&&s.call(t,N,mr.isString(I)?I.trim():I,w,x))===!0&&g(N,w?w.concat(I):[I])}),f.pop()}}if(!mr.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ime(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Qie(e,t){this._pairs=[],e&&jB(e,this,t)}const z_e=Qie.prototype;z_e.append=function(t,n){this._pairs.push([t,n])};z_e.toString=function(t){const n=t?function(r){return t.call(this,r,Ime)}:Ime;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function z1t(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function H_e(e,t,n){if(!t)return e;const r=n&&n.encode||z1t;mr.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(s?a=s(t,n):a=mr.isURLSearchParams(t)?t.toString():new Qie(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Pme{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){mr.forEach(this.handlers,function(r){r!==null&&t(r)})}}const V_e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},H1t=typeof URLSearchParams<"u"?URLSearchParams:Qie,V1t=typeof FormData<"u"?FormData:null,W1t=typeof Blob<"u"?Blob:null,q1t={isBrowser:!0,classes:{URLSearchParams:H1t,FormData:V1t,Blob:W1t},protocols:["http","https","file","blob","url","data"]},Zie=typeof window<"u"&&typeof document<"u",fJ=typeof navigator=="object"&&navigator||void 0,G1t=Zie&&(!fJ||["ReactNative","NativeScript","NS"].indexOf(fJ.product)<0),K1t=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Y1t=Zie&&window.location.href||"http://localhost",X1t=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Zie,hasStandardBrowserEnv:G1t,hasStandardBrowserWebWorkerEnv:K1t,navigator:fJ,origin:Y1t},Symbol.toStringTag,{value:"Module"})),ku={...X1t,...q1t};function Q1t(e,t){return jB(e,new ku.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,a){return ku.isNode&&mr.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function Z1t(e){return mr.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function J1t(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r<s;r++)a=n[r],t[a]=e[a];return t}function W_e(e){function t(n,r,s,a){let o=n[a++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),c=a>=n.length;return o=!o&&mr.isArray(s)?s.length:o,c?(mr.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!l):((!s[o]||!mr.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],a)&&mr.isArray(s[o])&&(s[o]=J1t(s[o])),!l)}if(mr.isFormData(e)&&mr.isFunction(e.entries)){const n={};return mr.forEachEntry(e,(r,s)=>{t(Z1t(r),s,n,0)}),n}return null}function ebt(e,t,n){if(mr.isString(e))try{return(t||JSON.parse)(e),mr.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Lk={transitional:V_e,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=mr.isObject(t);if(a&&mr.isHTMLForm(t)&&(t=new FormData(t)),mr.isFormData(t))return s?JSON.stringify(W_e(t)):t;if(mr.isArrayBuffer(t)||mr.isBuffer(t)||mr.isStream(t)||mr.isFile(t)||mr.isBlob(t)||mr.isReadableStream(t))return t;if(mr.isArrayBufferView(t))return t.buffer;if(mr.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Q1t(t,this.formSerializer).toString();if((l=mr.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return jB(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||s?(n.setContentType("application/json",!1),ebt(t)):t}],transformResponse:[function(t){const n=this.transitional||Lk.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(mr.isResponse(t)||mr.isReadableStream(t))return t;if(t&&mr.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?Ei.from(l,Ei.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ku.classes.FormData,Blob:ku.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};mr.forEach(["delete","get","head","post","put","patch"],e=>{Lk.headers[e]={}});const tbt=mr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),nbt=e=>{const t={};let n,r,s;return e&&e.split(`
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&tbt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Fme=Symbol("internals");function v7(e){return e&&String(e).trim().toLowerCase()}function VF(e){return e===!1||e==null?e:mr.isArray(e)?e.map(VF):String(e)}function rbt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const sbt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function jH(e,t,n,r,s){if(mr.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!mr.isString(t)){if(mr.isString(r))return t.indexOf(r)!==-1;if(mr.isRegExp(r))return r.test(t)}}function ibt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function abt(e,t){const n=mr.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,a,o){return this[r].call(this,t,s,a,o)},configurable:!0})})}class tf{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function a(l,c,u){const d=v7(c);if(!d)throw new Error("header name must be a non-empty string");const f=mr.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=VF(l))}const o=(l,c)=>mr.forEach(l,(u,d)=>a(u,d,c));if(mr.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(mr.isString(t)&&(t=t.trim())&&!sbt(t))o(nbt(t),n);else if(mr.isHeaders(t))for(const[l,c]of t.entries())a(c,l,r);else t!=null&&a(n,t,r);return this}get(t,n){if(t=v7(t),t){const r=mr.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return rbt(s);if(mr.isFunction(n))return n.call(this,s,r);if(mr.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=v7(t),t){const r=mr.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||jH(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function a(o){if(o=v7(o),o){const l=mr.findKey(r,o);l&&(!n||jH(r,r[l],l,n))&&(delete r[l],s=!0)}}return mr.isArray(t)?t.forEach(a):a(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const a=n[r];(!t||jH(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const n=this,r={};return mr.forEach(this,(s,a)=>{const o=mr.findKey(r,a);if(o){n[o]=VF(s),delete n[a];return}const l=t?ibt(a):String(a).trim();l!==a&&delete n[a],n[l]=VF(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return mr.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&mr.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Fme]=this[Fme]={accessors:{}}).accessors,s=this.prototype;function a(o){const l=v7(o);r[l]||(abt(s,o),r[l]=!0)}return mr.isArray(t)?t.forEach(a):a(t),this}}tf.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);mr.reduceDescriptors(tf.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});mr.freezeMethods(tf);function EH(e,t){const n=this||Lk,r=t||n,s=tf.from(r.headers);let a=r.data;return mr.forEach(e,function(l){a=l.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function q_e(e){return!!(e&&e.__CANCEL__)}function CA(e,t,n){Ei.call(this,e??"canceled",Ei.ERR_CANCELED,t,n),this.name="CanceledError"}mr.inherits(CA,Ei,{__CANCEL__:!0});function G_e(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ei("Request failed with status code "+n.status,[Ei.ERR_BAD_REQUEST,Ei.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function obt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function lbt(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[a];o||(o=u),n[s]=c,r[s]=u;let f=a,x=0;for(;f!==s;)x+=n[f++],f=f%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),u-o<t)return;const g=d&&u-d;return g?Math.round(x*1e3/g):void 0}}function cbt(e,t){let n=0,r=1e3/t,s,a;const o=(u,d=Date.now())=>{n=d,s=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?o(u,d):(s=u,a||(a=setTimeout(()=>{a=null,o(s)},r-f)))},()=>s&&o(s)]}const uM=(e,t,n=3)=>{let r=0;const s=lbt(50,250);return cbt(a=>{const o=a.loaded,l=a.lengthComputable?a.total:void 0,c=o-r,u=s(c),d=o<=l;r=o;const f={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-o)/u:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},Ome=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Mme=e=>(...t)=>mr.asap(()=>e(...t)),ubt=ku.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ku.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ku.origin),ku.navigator&&/(msie|trident)/i.test(ku.navigator.userAgent)):()=>!0,dbt=ku.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];mr.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),mr.isString(r)&&o.push("path="+r),mr.isString(s)&&o.push("domain="+s),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function fbt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function hbt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function K_e(e,t){return e&&!fbt(t)?hbt(e,t):t}const Rme=e=>e instanceof tf?{...e}:e;function A3(e,t){t=t||{};const n={};function r(u,d,f,x){return mr.isPlainObject(u)&&mr.isPlainObject(d)?mr.merge.call({caseless:x},u,d):mr.isPlainObject(d)?mr.merge({},d):mr.isArray(d)?d.slice():d}function s(u,d,f,x){if(mr.isUndefined(d)){if(!mr.isUndefined(u))return r(void 0,u,f,x)}else return r(u,d,f,x)}function a(u,d){if(!mr.isUndefined(d))return r(void 0,d)}function o(u,d){if(mr.isUndefined(d)){if(!mr.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,d,f)=>s(Rme(u),Rme(d),f,!0)};return mr.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||s,x=f(e[d],t[d],d);mr.isUndefined(x)&&f!==l||(n[d]=x)}),n}const Y_e=e=>{const t=A3({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:l}=t;t.headers=o=tf.from(o),t.url=H_e(K_e(t.baseURL,t.url),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(mr.isFormData(n)){if(ku.hasStandardBrowserEnv||ku.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(ku.hasStandardBrowserEnv&&(r&&mr.isFunction(r)&&(r=r(t)),r||r!==!1&&ubt(t.url))){const u=s&&a&&dbt.read(a);u&&o.set(s,u)}return t},pbt=typeof XMLHttpRequest<"u",mbt=pbt&&function(e){return new Promise(function(n,r){const s=Y_e(e);let a=s.data;const o=tf.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=s,d,f,x,g,v;function w(){g&&g(),v&&v(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let C=new XMLHttpRequest;C.open(s.method.toUpperCase(),s.url,!0),C.timeout=s.timeout;function N(){if(!C)return;const P=tf.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),F={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:P,config:e,request:C};G_e(function(L){n(L),w()},function(L){r(L),w()},F),C=null}"onloadend"in C?C.onloadend=N:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(N)},C.onabort=function(){C&&(r(new Ei("Request aborted",Ei.ECONNABORTED,e,C)),C=null)},C.onerror=function(){r(new Ei("Network Error",Ei.ERR_NETWORK,e,C)),C=null},C.ontimeout=function(){let R=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const F=s.transitional||V_e;s.timeoutErrorMessage&&(R=s.timeoutErrorMessage),r(new Ei(R,F.clarifyTimeoutError?Ei.ETIMEDOUT:Ei.ECONNABORTED,e,C)),C=null},a===void 0&&o.setContentType(null),"setRequestHeader"in C&&mr.forEach(o.toJSON(),function(R,F){C.setRequestHeader(F,R)}),mr.isUndefined(s.withCredentials)||(C.withCredentials=!!s.withCredentials),l&&l!=="json"&&(C.responseType=s.responseType),u&&([x,v]=uM(u,!0),C.addEventListener("progress",x)),c&&C.upload&&([f,g]=uM(c),C.upload.addEventListener("progress",f),C.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(d=P=>{C&&(r(!P||P.type?new CA(null,e,C):P),C.abort(),C=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const I=obt(s.url);if(I&&ku.protocols.indexOf(I)===-1){r(new Ei("Unsupported protocol "+I+":",Ei.ERR_BAD_REQUEST,e));return}C.send(a||null)})},xbt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const a=function(u){if(!s){s=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof Ei?d:new CA(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,a(new Ei(`timeout ${t} of ms exceeded`,Ei.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>mr.asap(l),c}},gbt=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},bbt=async function*(e,t){for await(const n of ybt(e))yield*gbt(n,t)},ybt=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Lme=(e,t,n,r)=>{const s=bbt(e,t);let a=0,o,l=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){l(),c.close();return}let f=d.byteLength;if(n){let x=a+=f;n(x)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},EB=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",X_e=EB&&typeof ReadableStream=="function",vbt=EB&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Q_e=(e,...t)=>{try{return!!e(...t)}catch{return!1}},wbt=X_e&&Q_e(()=>{let e=!1;const t=new Request(ku.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Dme=64*1024,hJ=X_e&&Q_e(()=>mr.isReadableStream(new Response("").body)),dM={stream:hJ&&(e=>e.body)};EB&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!dM[t]&&(dM[t]=mr.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Ei(`Response type '${t}' is not supported`,Ei.ERR_NOT_SUPPORT,r)})})})(new Response);const Cbt=async e=>{if(e==null)return 0;if(mr.isBlob(e))return e.size;if(mr.isSpecCompliantForm(e))return(await new Request(ku.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(mr.isArrayBufferView(e)||mr.isArrayBuffer(e))return e.byteLength;if(mr.isURLSearchParams(e)&&(e=e+""),mr.isString(e))return(await vbt(e)).byteLength},Sbt=async(e,t)=>{const n=mr.toFiniteNumber(e.getContentLength());return n??Cbt(t)},Nbt=EB&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:a,timeout:o,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:x}=Y_e(e);u=u?(u+"").toLowerCase():"text";let g=xbt([s,a&&a.toAbortSignal()],o),v;const w=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let C;try{if(c&&wbt&&n!=="get"&&n!=="head"&&(C=await Sbt(d,r))!==0){let F=new Request(t,{method:"POST",body:r,duplex:"half"}),U;if(mr.isFormData(r)&&(U=F.headers.get("content-type"))&&d.setContentType(U),F.body){const[L,z]=Ome(C,uM(Mme(c)));r=Lme(F.body,Dme,L,z)}}mr.isString(f)||(f=f?"include":"omit");const N="credentials"in Request.prototype;v=new Request(t,{...x,signal:g,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:N?f:void 0});let I=await fetch(v);const P=hJ&&(u==="stream"||u==="response");if(hJ&&(l||P&&w)){const F={};["status","statusText","headers"].forEach(Q=>{F[Q]=I[Q]});const U=mr.toFiniteNumber(I.headers.get("content-length")),[L,z]=l&&Ome(U,uM(Mme(l),!0))||[];I=new Response(Lme(I.body,Dme,L,()=>{z&&z(),w&&w()}),F)}u=u||"text";let R=await dM[mr.findKey(dM,u)||"text"](I,e);return!P&&w&&w(),await new Promise((F,U)=>{G_e(F,U,{data:R,headers:tf.from(I.headers),status:I.status,statusText:I.statusText,config:e,request:v})})}catch(N){throw w&&w(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new Ei("Network Error",Ei.ERR_NETWORK,e,v),{cause:N.cause||N}):Ei.from(N,N&&N.code,e,v)}}),pJ={http:B1t,xhr:mbt,fetch:Nbt};mr.forEach(pJ,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Bme=e=>`- ${e}`,Abt=e=>mr.isFunction(e)||e===null||e===!1,Z_e={getAdapter:e=>{e=mr.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let a=0;a<t;a++){n=e[a];let o;if(r=n,!Abt(n)&&(r=pJ[(o=String(n)).toLowerCase()],r===void 0))throw new Ei(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+a]=r}if(!r){const a=Object.entries(s).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
`+a.map(Bme).join(`
`):" "+Bme(a[0]):"as no adapter specified";throw new Ei("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:pJ};function _H(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CA(null,e)}function $me(e){return _H(e),e.headers=tf.from(e.headers),e.data=EH.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Z_e.getAdapter(e.adapter||Lk.adapter)(e).then(function(r){return _H(e),r.data=EH.call(e,e.transformResponse,r),r.headers=tf.from(r.headers),r},function(r){return q_e(r)||(_H(e),r&&r.response&&(r.response.data=EH.call(e,e.transformResponse,r.response),r.response.headers=tf.from(r.response.headers))),Promise.reject(r)})}const J_e="1.7.9",_B={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_B[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ume={};_B.transitional=function(t,n,r){function s(a,o){return"[Axios v"+J_e+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,l)=>{if(t===!1)throw new Ei(s(o," has been removed"+(n?" in "+n:"")),Ei.ERR_DEPRECATED);return n&&!Ume[o]&&(Ume[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,l):!0}};_B.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function jbt(e,t,n){if(typeof e!="object")throw new Ei("options must be an object",Ei.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],o=t[a];if(o){const l=e[a],c=l===void 0||o(l,a,e);if(c!==!0)throw new Ei("option "+a+" must be "+c,Ei.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ei("Unknown option "+a,Ei.ERR_BAD_OPTION)}}const WF={assertOptions:jbt,validators:_B},Km=WF.validators;class Gw{constructor(t){this.defaults=t,this.interceptors={request:new Pme,response:new Pme}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=A3(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&WF.assertOptions(r,{silentJSONParsing:Km.transitional(Km.boolean),forcedJSONParsing:Km.transitional(Km.boolean),clarifyTimeoutError:Km.transitional(Km.boolean)},!1),s!=null&&(mr.isFunction(s)?n.paramsSerializer={serialize:s}:WF.assertOptions(s,{encode:Km.function,serialize:Km.function},!0)),WF.assertOptions(n,{baseUrl:Km.spelling("baseURL"),withXsrfToken:Km.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&mr.merge(a.common,a[n.method]);a&&mr.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),n.headers=tf.concat(o,a);const l=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let d,f=0,x;if(!c){const v=[$me.bind(this),void 0];for(v.unshift.apply(v,l),v.push.apply(v,u),x=v.length,d=Promise.resolve(n);f<x;)d=d.then(v[f++],v[f++]);return d}x=l.length;let g=n;for(f=0;f<x;){const v=l[f++],w=l[f++];try{g=v(g)}catch(C){w.call(this,C);break}}try{d=$me.call(this,g)}catch(v){return Promise.reject(v)}for(f=0,x=u.length;f<x;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=A3(this.defaults,t);const n=K_e(t.baseURL,t.url);return H_e(n,t.params,t.paramsSerializer)}}mr.forEach(["delete","get","head","options"],function(t){Gw.prototype[t]=function(n,r){return this.request(A3(r||{},{method:t,url:n,data:(r||{}).data}))}});mr.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,l){return this.request(A3(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Gw.prototype[t]=n(),Gw.prototype[t+"Form"]=n(!0)});class Jie{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(s=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const o=new Promise(l=>{r.subscribe(l),a=l}).then(s);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,l){r.reason||(r.reason=new CA(a,o,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Jie(function(s){t=s}),cancel:t}}}function Ebt(e){return function(n){return e.apply(null,n)}}function _bt(e){return mr.isObject(e)&&e.isAxiosError===!0}const mJ={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(mJ).forEach(([e,t])=>{mJ[t]=e});function eke(e){const t=new Gw(e),n=I_e(Gw.prototype.request,t);return mr.extend(n,Gw.prototype,t,{allOwnKeys:!0}),mr.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return eke(A3(e,s))},n}const ds=eke(Lk);ds.Axios=Gw;ds.CanceledError=CA;ds.CancelToken=Jie;ds.isCancel=q_e;ds.VERSION=J_e;ds.toFormData=jB;ds.AxiosError=Ei;ds.Cancel=ds.CanceledError;ds.all=function(t){return Promise.all(t)};ds.spread=Ebt;ds.isAxiosError=_bt;ds.mergeConfig=A3;ds.AxiosHeaders=tf;ds.formToJSON=e=>W_e(mr.isHTMLForm(e)?new FormData(e):e);ds.getAdapter=Z_e.getAdapter;ds.HttpStatusCode=mJ;ds.default=ds;var zy="https://dextrabothypev2.nftinit.io/";async function kbt(e,t){if(t==1||t==null)return fetch(zy+"api/subscriber/sign_start/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e})}).then(n=>n.json());if(t>1)return fetch(zy+"api/subscriber/sign_start/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token_slot:t})}).then(n=>n.json())}async function Tbt(e,t,n,r){if(r==1||r==null)return fetch(zy+"api/subscriber/sign_complete_v2/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,temp_password:t,signature:n})}).then(s=>s.json());if(r>1)return fetch(zy+"api/subscriber/sign_complete_v2/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,temp_password:t,signature:n,token_slot:r})}).then(s=>s.json())}async function ji(e,t){if(e)return await fetch(zy+"api/subscriber/check_account/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Ibt(e,t){if(e)return await fetch(zy+"api/subscriber/telegram_start/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Pbt(e,t){if(e)return await fetch(zy+"api/hyper/following/list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Fbt(e,t){if(e)return await fetch(zy+"api/hyper/tracker/list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Obt(e){try{const t=await fetch(`${API_URL}/refresh_token/`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({address:e})});if(!t.ok)throw new Error("Refresh token failed");const n=await t.json();if(n.success&&n.trade_token)return localStorage.setItem("hyperTradeToken",n.trade_token),localStorage.setItem("hyperAddress",n.address),n.trade_token;throw new Error("Refresh response invalid")}catch(t){return console.error("Token refresh error:",t),null}}let kH=null;function Mbt(e){kH&&clearInterval(kH),kH=setInterval(async()=>{const t=localStorage.getItem("hyperTradeTokenExp"),n=Date.now()/1e3;(!t||t-n<600)&&await Obt(e)&&(localStorage.setItem("hyperTradeTokenExp",n+259200),console.log("Trade token refreshed"))},5*60*1e3)}const Rbt=e=>{const t=[...e].sort((r,s)=>s.time-r.time),n=new Map;return t.forEach(r=>{var a;const s=r.oid;if(!n.has(s)){const o=t.filter(v=>v.oid===r.oid),l=o.reduce((v,w)=>v+parseFloat(w.sz),0),c=o.map(v=>parseFloat(v.startPosition));let u;c.includes(0)?u=0:c.every(v=>v>0)?u=Math.max(...c):c.every(v=>v<0)?u=Math.min(...c):u=o.reduce((v,w)=>v+parseFloat(w.startPosition),0);const d=o.reduce((v,w)=>v+parseFloat(w.sz)*parseFloat(w.px),0),f=o.reduce((v,w)=>v+parseFloat(w.closedPnl||0),0),x=o.reduce((v,w)=>v+parseFloat(w.fee||0),0),g=((a=o.find(v=>v.dir==="Long > Short"||v.dir==="Short > Long"))==null?void 0:a.dir)||"";n.set(s,{oid:r.oid,asset:r.coin,direction:g===""?r.dir:g,fills:o,totalSize:l,totalStartPositions:u,totalValue:d,pnl:f-x,latestFill:r.time})}}),Array.from(n.values()).sort((r,s)=>s.latestFill-r.latestFill)},Qr=m.createContext(),Lbt=({children:e})=>{const t=Mc(),{isConnected:n,address:r}=Jr(),{signMessageAsync:s}=g_e(),[a,o]=m.useState("user"),[l,c]=m.useState(null),[u,d]=m.useState(0),[f,x]=m.useState(0),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(!1),[P,R]=m.useState(0),[F,U]=m.useState(window.localStorage.getItem("hyperToken")),[L,z]=m.useState(window.localStorage.getItem("hyperAddress")),[Q,ne]=m.useState(!1),[J,X]=m.useState(!1),[re,pe]=m.useState(!1),[Y,ie]=m.useState(null),[oe,G]=m.useState(!1),[V,te]=m.useState(null),[ae,he]=m.useState(null),[Ce,ce]=m.useState([]),[ge,Ae]=m.useState([]),[ye,je]=m.useState([]),[Ie,Re]=m.useState(""),[Qe,$e]=m.useState({activeRange:"",day:0,week:0,month:0}),[it,tt]=m.useState([]),ot=m.useCallback(async()=>{const Xe=window.localStorage.getItem("hyperToken"),Ut=window.localStorage.getItem("hyperAddress");if(!Xe||!Ut){tt([]);return}try{const Lt=await ji(Ut.toLowerCase(),Xe);Lt!=null&&Lt.success&&tt((Lt==null?void 0:Lt.bot_slots_info)||[])}catch{}},[]);async function ft(){var qe,Ke;const Xe=window.localStorage.getItem("hyperToken"),Ut=window.localStorage.getItem("hyperAddress"),Lt=Ylt(Xe);if(Xe&&Lt!==!1){const pt=await ji(Ut,Xe);pt.success?(tt((pt==null?void 0:pt.bot_slots_info)||[]),c(pt.telegram_chat_id),o(pt.subscriber_role),d((qe=pt==null?void 0:pt.mushboomer_counts)==null?void 0:qe.eth),x((Ke=pt==null?void 0:pt.mushboomer_counts)==null?void 0:Ke.sol),v(pt==null?void 0:pt.referral_code),C(pt==null?void 0:pt.refcode),I(pt==null?void 0:pt.whitelist),R(pt==null?void 0:pt.subs_expire_day),U(localStorage.getItem("hyperToken")),z(localStorage.getItem("hyperAddress")),dn(),an()):tt([])}else ct(1)}async function ct(Xe){try{if(!r)throw new Error("No accounts found. Please connect your wallet.");const Ut=await kbt(r,Xe);if(!Ut.success)return{success:!1,message:Ut.error_message};const Lt=Ut.temp_password,qe=`dextrabot.io verification code : ${Lt}`,Ke=await s({message:qe}),pt=await Tbt(Ut.address,Lt,Ke,Xe);if(pt&&pt.token){if(window.localStorage.setItem("hyperAddress",pt.address),window.localStorage.setItem("hyperToken",pt.token),pt.trade_token){window.localStorage.setItem("hyperTradeToken",pt.trade_token);const en=Date.now()/1e3;window.localStorage.setItem("hyperTradeTokenExp",en+(pt.expires_in||259200)),Mbt(pt.address)}return ft(),window.dispatchEvent(new Event("localStorageUpdated")),{success:!0,initToken:pt.token}}else throw new Error("Failed to complete the signing process.")}catch(Ut){return console.error("Error during sign-in:",Ut),{success:!1,message:Ut.message||"An unknown error occurred."}}}const[Vt,It]=m.useState([]);async function an(){const Xe=window.localStorage.getItem("hyperToken"),Ut=window.localStorage.getItem("hyperAddress");try{pe(!0);const Lt=await Pbt(r||Ut,Xe);if(!Lt.success){Lt.error_message!="User not verified"&&ln.error(Lt.error_message),Lt.error_message=="User not verified";return}Lt.success?It(Lt==null?void 0:Lt.data):It([])}catch(Lt){Lt.name!=="AbortError"&&(ie(Lt.message),ln.error(Lt.message)),It([])}finally{pe(!1)}}const[Nt,mn]=m.useState([]);async function dn(){const Xe=window.localStorage.getItem("hyperToken"),Ut=window.localStorage.getItem("hyperAddress");try{G(!0);const Lt=await Fbt(r||Ut,Xe);if(!Lt.success){Lt.error_message!="User not verified"&&ln.error(Lt.error_message),Lt.error_message=="User not verified";return}Lt.success?mn(Lt==null?void 0:Lt.data):mn([])}catch(Lt){Lt.name!=="AbortError"&&(te(Lt.message),ln.error(Lt.message)),mn([])}finally{G(!1)}}m.useEffect(()=>{window.localStorage.getItem("hyperToken")==null&&t.pathname!="/tracked-wallets"&&J&&ne(!0)},[n]),m.useEffect(()=>{!n&&!F||(t.pathname=="/wallet-management"||t.pathname.includes("referral")||t.pathname=="/leaderboard")&&F!=null&&F&&an()},[F]),m.useRef(!1),m.useEffect(()=>{if(t.pathname==="/"||t.pathname==="/sitemap"||t.pathname==="/videos"||!window.localStorage.getItem("hyperToken"))return;const Lt=`notificationsFeedSocket_${r==null?void 0:r.toLowerCase()}`,qe=localStorage.getItem(Lt);ce(qe?JSON.parse(qe):[]);const Ke=Ny("https://dextrabothypesocketv2.nftinit.io/");return he(Ke),Ke.on("connect",()=>{console.log("Socket connected")}),Ke.on("disconnect",()=>{console.log("Socket disconnected")}),Ke.on("hyper_get_trade_message",async pt=>{const en=(Array.isArray(pt)?pt:[pt]).map(et=>({...et,is_read:!1,trader_pnl:null}));ce(et=>{const Be=new Set(et.map(ut=>ut==null?void 0:ut.oid)),Ve=[...en==null?void 0:en.filter(ut=>!(Be!=null&&Be.has(ut==null?void 0:ut.oid))),...et].slice(0,100);return localStorage.setItem(Lt,JSON.stringify(Ve)),Ve});const Bt=window.localStorage.getItem("hyperToken");if(!r||!Bt){console.log("User logged out before timeout - skipping PNL fetch.");return}const Et=en.map(et=>et==null?void 0:et.trader_wallet).filter(Boolean)[0];try{const et=await ds.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:Et});if(et.data){const Be=Rbt(et.data),Mt=new Map(Be==null?void 0:Be.map(Ve=>[Ve==null?void 0:Ve.oid,Ve==null?void 0:Ve.pnl]));ce(Ve=>{const ut=Ve==null?void 0:Ve.map(xt=>Mt!=null&&Mt.has(xt==null?void 0:xt.trader_oid)?{...xt,trader_pnl:Mt==null?void 0:Mt.get(xt==null?void 0:xt.trader_oid)}:xt);return localStorage.setItem(Lt,JSON.stringify(ut)),ut})}else console.log("Unexpected API response")}catch(et){console.error("PNL API error:",et)}}),()=>{Ke.disconnect()}},[F]),m.useEffect(()=>{if(!ae||!r||!Vt||Vt.length===0)return;Vt.map(Ut=>Ut.wallet_address);const Xe=window.localStorage.getItem("hyperToken");return ae.emit("subscribe",{login:r==null?void 0:r.toLowerCase(),token:Xe}),()=>{}},[ae,r,Vt]);const Pt=async()=>{try{const Xe=window.localStorage.getItem("hyperToken"),Ut="https://dextrabothypev2.nftinit.io/api/subscriber/announcement/getannouncements/";let Lt={};r&&Xe&&(Lt={address:r.toLowerCase(),token:Xe});const qe=await fetch(Ut,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Lt)});if(!qe.ok)throw new Error(`Server responded with status ${qe.status}`);const Ke=await qe.json();Ke.success?Ae(Ke):console.log(Ke.error_message)}catch(Xe){console.error("Error in handleAnnouncement:",Xe)}};return m.useEffect(()=>{Pt();const Xe=setInterval(()=>{Pt()},6e4);return()=>clearInterval(Xe)},[n,F]),m.useEffect(()=>{(async()=>{try{const qe=(await(await fetch("https://dextradata.nftinit.io/api/hyper/terminal_coins/v2/")).json()).coins;je(qe)}catch(Ut){console.error("Data retrieval error:",Ut),Re(Ut.message)}})()},[]),i.jsx(Qr.Provider,{value:{subscriberRole:a,setSubscriberRole:o,subsExpireDay:P,setSubsExpireDay:R,hyperToken:F,setHyperToken:U,hyperAddress:L,setHyperAddress:z,signModalOpen:Q,setSignModalOpen:ne,walletLogin:ft,signIn:ct,copyTradeWatchList:Vt,setCopyTradeWatchList:It,trackedWatchList:Nt,setTrackedWatchList:mn,getCopyTradeWatchList:an,getTrackedWatchList:dn,copyWatchListLoading:re,setCopyWatchListLoading:pe,trackedWatchListLoading:oe,setTrackedWatchListLoading:G,copyWatchListError:Y,setCopyWatchListError:ie,trackedWatchListError:V,setTrackedWatchListError:te,signInConnectButtonOpen:J,setSignInConnectButtonOpen:X,telegramChatId:l,setTelegramChatId:c,mushboomerETH:u,setMushboomerETH:d,isWhitelist:N,setIsWhitelist:I,mushboomerSOL:f,setMushboomerSOL:x,isReferralCode:g,setIsReferralCode:v,isReferralCodeName:w,setIsReferralCodeName:C,latestPnL:Qe,setLatestPnL:$e,notificationData:Ce,setNotificationData:ce,announcementData:ge,setAnnouncementData:Ae,handleAnnouncement:Pt,searchTerminalCoin:ye,setSearchTerminalCoin:je,isSearchTerminalError:Ie,setIsSearchTerminalError:Re,botSlotsInfo:it,setBotSlotsInfo:tt,refreshBotSlots:ot},children:e})},Dbt="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6758%2020C16.1986%2020%2020.6758%2015.5228%2020.6758%2010C20.6758%204.47715%2016.1986%200%2010.6758%200C5.15293%200%200.675781%204.47715%200.675781%2010C0.675781%2015.5228%205.15293%2020%2010.6758%2020Z'%20fill='url(%23paint0_linear_26_4024)'/%3e%3cpath%20d='M15.667%205.86343C15.756%205.28809%2015.209%204.83396%2014.6975%205.05857L4.50863%209.532C4.14178%209.69307%204.16862%2010.2488%204.5491%2010.3699L6.65026%2011.0391C7.05133%2011.1668%207.48554%2011.1007%207.83576%2010.8588L12.573%207.58593C12.7159%207.48721%2012.8716%207.69036%2012.7495%207.81614L9.33954%2011.3319C9.00876%2011.6729%209.0744%2012.2509%209.47233%2012.5004L13.2902%2014.8945C13.7184%2015.163%2014.2693%2014.8933%2014.3493%2014.3758L15.667%205.86343Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_26_4024'%20x1='10.6758'%20y1='0'%20x2='10.6758'%20y2='20'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2337BBFE'/%3e%3cstop%20offset='1'%20stop-color='%23007DBB'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",qi="/assets/dextrabotIcon-B5aLRkPC.png",Bbt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fillRule='evenodd'%20clipRule='evenodd'%20d='M9.72943%203.99268C10.8214%202.39501%2013.1782%202.39502%2014.2702%203.99268L14.7021%204.62463C17.4081%208.58385%2019.7331%2012.7905%2021.6458%2017.1881L21.736%2017.3956C22.4101%2018.9453%2021.3917%2020.705%2019.7122%2020.8927C14.5865%2021.4656%209.41304%2021.4656%204.28741%2020.8927C2.60787%2020.705%201.5895%2018.9453%202.26356%2017.3956L2.35377%2017.1881C4.2665%2012.7905%206.59147%208.58384%209.29751%204.62463L9.72943%203.99268ZM12.9998%209.00005C12.9998%209.55233%2012.5521%2010%2011.9998%2010C11.4475%2010%2010.9998%209.55233%2010.9998%209.00005C10.9998%208.44776%2011.4475%208.00005%2011.9998%208.00005C12.5521%208.00005%2012.9998%208.44776%2012.9998%209.00005ZM11.9998%2011.75C12.414%2011.75%2012.7498%2012.0858%2012.7498%2012.5V17.5C12.7498%2017.9143%2012.414%2018.25%2011.9998%2018.25C11.5856%2018.25%2011.2498%2017.9143%2011.2498%2017.5V12.5C11.2498%2012.0858%2011.5856%2011.75%2011.9998%2011.75Z'%20fill='%23FF3566'/%3e%3c/svg%3e",$bt="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M29.2932%209.61329C28.9198%205.97329%2026.0265%203.07996%2022.3865%202.70663C22.1198%202.67996%2021.8532%202.66663%2021.5865%202.66663H10.4132C10.1465%202.66663%209.87984%202.67996%209.61317%202.70663C5.97317%203.07996%203.07984%205.97329%202.7065%209.61329C2.67984%209.87996%202.6665%2010.1466%202.6665%2010.4133V21.5866C2.6665%2021.8533%202.67984%2022.12%202.7065%2022.3866C3.07984%2026.0266%205.97317%2028.92%209.61317%2029.2933C9.87984%2029.32%2010.1465%2029.3333%2010.4132%2029.3333H18.6665C19.3998%2029.3333%2019.9998%2028.7333%2019.9998%2028V24.04C19.9998%2021.8133%2021.8132%2020%2024.0398%2020H27.9998C28.7332%2020%2029.3332%2019.4%2029.3332%2018.6666V10.4133C29.3332%2010.1466%2029.3198%209.87996%2029.2932%209.61329ZM10.3332%2018C10.3332%2018.5466%209.87984%2019%209.33317%2019C8.7865%2019%208.33317%2018.5466%208.33317%2018V14C8.33317%2013.4533%208.7865%2013%209.33317%2013C9.87984%2013%2010.3332%2013.4533%2010.3332%2014V18ZM16.9998%2018C16.9998%2018.5466%2016.5465%2019%2015.9998%2019C15.4532%2019%2014.9998%2018.5466%2014.9998%2018V14C14.9998%2013.4533%2015.4532%2013%2015.9998%2013C16.5465%2013%2016.9998%2013.4533%2016.9998%2014V18Z'%20fill='%23FFA756'/%3e%3cpath%20d='M27.9602%2021.3334H24.0402C22.3468%2021.3334%2021.3335%2022.3467%2021.3335%2024.04V27.96C21.3335%2029.6534%2022.3468%2030.6667%2024.0402%2030.6667H27.9602C29.6535%2030.6667%2030.6668%2029.6534%2030.6668%2027.96V24.04C30.6668%2022.3467%2029.6535%2021.3334%2027.9602%2021.3334ZM28.6268%2027.4134C28.9602%2027.7467%2028.9602%2028.2934%2028.6268%2028.6267C28.4535%2028.7867%2028.2268%2028.8667%2028.0135%2028.8667C27.8002%2028.8667%2027.5735%2028.7867%2027.4002%2028.6267L25.9868%2027.2134L24.6002%2028.6267C24.4268%2028.7867%2024.2135%2028.8667%2023.9735%2028.8667C23.7735%2028.8667%2023.5468%2028.7867%2023.3868%2028.6267C23.0535%2028.2934%2023.0535%2027.7467%2023.3868%2027.4134L24.8002%2026L23.3868%2024.6C23.0535%2024.2667%2023.0535%2023.72%2023.3868%2023.3867C23.7202%2023.0534%2024.2668%2023.0534%2024.6002%2023.3867L25.9868%2024.8L27.4002%2023.3867C27.7335%2023.0534%2028.2935%2023.0534%2028.6268%2023.3867C28.9602%2023.72%2028.9602%2024.2667%2028.6268%2024.6L27.2135%2026L28.6268%2027.4134Z'%20fill='%23FFA756'/%3e%3c/svg%3e",Va="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20y='0.5'%20width='39'%20height='39'%20rx='19.5'%20fill='%23232323'/%3e%3crect%20x='0.5'%20y='0.5'%20width='39'%20height='39'%20rx='19.5'%20stroke='%23ACACAC'%20style='mix-blend-mode:color-dodge'/%3e%3cpath%20d='M21.1515%2013.9091C21.1515%2012.3024%2022.454%2011%2024.0606%2011C25.6673%2011%2026.9697%2012.3024%2026.9697%2013.9091C26.9697%2015.5157%2025.6673%2016.8182%2024.0606%2016.8182C22.454%2016.8182%2021.1515%2015.5157%2021.1515%2013.9091Z'%20fill='%236C6C6C'/%3e%3cpath%20d='M17.5365%2017.017C17.2707%2016.5917%2016.8045%2016.3333%2016.303%2016.3333C15.8015%2016.3333%2015.3354%2016.5917%2015.0696%2017.017L10.2211%2024.7745C9.94085%2025.2229%209.92601%2025.7881%2010.1823%2026.2506C10.4387%2026.7131%2010.9258%2027%2011.4545%2027H26.9697C27.5206%2027%2028.0243%2026.6887%2028.2707%2026.1959C28.5171%2025.7032%2028.4639%2025.1135%2028.1333%2024.6727L25.2243%2020.7939C24.9496%2020.4277%2024.5184%2020.2121%2024.0606%2020.2121C23.6028%2020.2121%2023.1717%2020.4277%2022.897%2020.7939L21.2607%2022.9757L17.5365%2017.017Z'%20fill='%236C6C6C'/%3e%3c/svg%3e",Ba="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.6568%2017.6568L6.34314%206.34314'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20/%3e%3cpath%20d='M17.6569%206.34314L6.34315%2017.6568'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20/%3e%3c/svg%3e",wo="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.33342%207.52484V9.97484C9.33342%2012.0165%208.51675%2012.8332%206.47508%2012.8332H4.02508C1.98341%2012.8332%201.16675%2012.0165%201.16675%209.97484V7.52484C1.16675%205.48317%201.98341%204.6665%204.02508%204.6665H6.47508C8.51675%204.6665%209.33342%205.48317%209.33342%207.52484Z'%20fill='%23989898'/%3e%3cpath%20d='M9.97511%201.1665H7.52511C5.89748%201.1665%205.05203%201.68923%204.77585%202.93218C4.65505%203.47584%205.1276%203.93734%205.68451%203.93734H6.47511C8.92511%203.93734%2010.0626%205.07484%2010.0626%207.52484V8.31543C10.0626%208.87235%2010.5241%209.34489%2011.0678%209.22409C12.3107%208.94791%2012.8334%208.10247%2012.8334%206.47484V4.02484C12.8334%201.98317%2012.0168%201.1665%209.97511%201.1665Z'%20fill='%23989898'/%3e%3c/svg%3e",Ubt="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.53%2010.1625C13.215%2010.47%2013.035%2010.9125%2013.08%2011.385C13.1475%2012.195%2013.89%2012.7875%2014.7%2012.7875H16.125V13.68C16.125%2015.2325%2014.8575%2016.5%2013.305%2016.5H4.695C3.1425%2016.5%201.875%2015.2325%201.875%2013.68V8.63251C1.875%207.08001%203.1425%205.8125%204.695%205.8125H13.305C14.8575%205.8125%2016.125%207.08001%2016.125%208.63251V9.71251H14.61C14.19%209.71251%2013.8075%209.87749%2013.53%2010.1625Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M1.875%209.30748V5.88002C1.875%204.98752%202.4225%204.19248%203.255%203.87748L9.21%201.62748C10.14%201.27498%2011.1375%201.96501%2011.1375%202.96251V5.8125'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.9191%2010.4776V12.0227C16.9191%2012.4352%2016.5891%2012.7726%2016.1691%2012.7876H14.6991C13.8891%2012.7876%2013.1466%2012.1951%2013.0791%2011.3851C13.0341%2010.9126%2013.2141%2010.4701%2013.5291%2010.1626C13.8066%209.87763%2014.1891%209.71265%2014.6091%209.71265H16.1691C16.5891%209.72765%2016.9191%2010.0651%2016.9191%2010.4776Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.25%209H10.5'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",dx="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%206.97075C14%2011.5992%2011.1675%2013.0844%209.67513%2011.762C8.44671%2010.6837%208.08122%208.40507%206.2335%208.17111C3.88832%207.87611%203.68528%2010.999%202.14214%2010.999C0.345178%2010.999%200%208.38472%200%207.04196C0%205.66867%200.385787%203.79694%201.91878%203.79694C3.70559%203.79694%203.80711%206.4723%206.04061%206.32988C8.26396%206.1773%208.30457%203.39004%209.74624%202.19986C11.0051%201.17244%2014%202.28124%2014%206.97075Z'%20fill='%2397FCE4'/%3e%3c/svg%3e",tke="data:image/svg+xml,%3csvg%20width='14'%20height='9'%20viewBox='0%200%2014%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.33013%201.5C5.48483%20-0.500002%208.37158%20-0.5%209.52628%201.5L13.8564%209H0L4.33013%201.5Z'%20fill='%23404040'/%3e%3c/svg%3e",zbt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='6'%20height='6'%20rx='3'%20fill='%23D35B5B'/%3e%3c/svg%3e",Hbt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='6'%20height='6'%20rx='3'%20fill='%230BAA60'/%3e%3c/svg%3e",ac="/assets/noDataNewIcon-D33nv6-9.svg",SA="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2967%202.63297L11.6167%205.27297C11.7967%205.64047%2012.2767%205.99297%2012.6817%206.06047L15.0742%206.45797C16.6042%206.71297%2016.9642%207.82297%2015.8617%208.91797L14.0017%2010.778C13.6867%2011.093%2013.5142%2011.7005%2013.6117%2012.1355L14.1442%2014.438C14.5642%2016.2605%2013.5967%2016.9655%2011.9842%2016.013L9.7417%2014.6855C9.3367%2014.4455%208.6692%2014.4455%208.2567%2014.6855L6.0142%2016.013C4.4092%2016.9655%203.4342%2016.253%203.8542%2014.438L4.3867%2012.1355C4.4842%2011.7005%204.3117%2011.093%203.9967%2010.778L2.1367%208.91797C1.0417%207.82297%201.3942%206.71297%202.9242%206.45797L5.3167%206.06047C5.7142%205.99297%206.1942%205.64047%206.3742%205.27297L7.6942%202.63297C8.4142%201.20047%209.5842%201.20047%2010.2967%202.63297Z'%20stroke='%239B9B9B'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",a5="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2967%202.63297L11.6167%205.27297C11.7967%205.64047%2012.2767%205.99297%2012.6817%206.06047L15.0742%206.45797C16.6042%206.71297%2016.9642%207.82297%2015.8617%208.91797L14.0017%2010.778C13.6867%2011.093%2013.5142%2011.7005%2013.6117%2012.1355L14.1442%2014.438C14.5642%2016.2605%2013.5967%2016.9655%2011.9842%2016.013L9.7417%2014.6855C9.3367%2014.4455%208.6692%2014.4455%208.2567%2014.6855L6.0142%2016.013C4.4092%2016.9655%203.4342%2016.253%203.8542%2014.438L4.3867%2012.1355C4.4842%2011.7005%204.3117%2011.093%203.9967%2010.778L2.1367%208.91797C1.0417%207.82297%201.3942%206.71297%202.9242%206.45797L5.3167%206.06047C5.7142%205.99297%206.1942%205.64047%206.3742%205.27297L7.6942%202.63297C8.4142%201.20047%209.5842%201.20047%2010.2967%202.63297Z'%20fill='%23FFC01F'/%3e%3c/svg%3e",Vbt="/assets/referralBgIcon-C-Csekzm.svg",o5="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1635_11489)'%3e%3cpath%20d='M7.58763%209.47632C8.45415%209.97644%208.8874%2010.2265%209.36324%2010.2269C9.83905%2010.2273%2010.2727%209.97802%2011.1401%209.47942L16.6693%206.30109C16.9189%206.15761%2017.0728%205.89166%2017.0728%205.60374C17.0728%205.31582%2016.9189%205.04987%2016.6693%204.90639L11.1381%201.7269C10.2717%201.22883%209.83844%200.979795%209.3631%200.979981C8.88773%200.980166%208.45471%201.22954%207.58863%201.72828L2.83367%204.4665C2.79841%204.4868%202.7808%204.49696%202.76438%204.50657C1.14012%205.45741%200.136601%207.19333%200.123183%209.07539C0.123047%209.09441%200.123047%209.11474%200.123047%209.15542C0.123047%209.19601%200.123047%209.21634%200.123182%209.23534C0.136571%2011.1153%201.13785%2012.8496%202.75921%2013.8012C2.7756%2013.8108%202.79321%2013.8209%202.82838%2013.8413L5.80688%2015.561C7.54244%2016.563%208.41021%2017.064%209.36318%2017.0644C10.3161%2017.0647%2011.1843%2016.5642%2012.9205%2015.5633L16.0647%2013.7508C16.9341%2013.2496%2017.3688%2012.9991%2017.6074%2012.5859C17.8461%2012.1728%2017.8461%2011.6711%2017.8461%2010.6676V8.72907C17.8461%208.4507%2017.6954%208.19416%2017.4521%208.05869C17.2168%207.92762%2016.9299%207.92956%2016.6964%208.06381L10.2491%2011.7699C9.81659%2012.0185%209.60028%2012.1429%209.36296%2012.1429C9.12561%2012.143%208.90925%2012.0188%208.47653%2011.7704L4.11289%209.2656C3.89431%209.14013%203.78501%209.07738%203.69722%209.06605C3.49709%209.04022%203.30466%209.15234%203.22842%209.33918C3.195%209.42113%203.19566%209.54715%203.19702%209.79918C3.19802%209.98472%203.19851%2010.0775%203.21585%2010.1628C3.2547%2010.3539%203.35522%2010.527%203.50202%2010.6553C3.56757%2010.7127%203.6479%2010.7591%203.80863%2010.8518L8.47406%2013.5445C8.90792%2013.7949%209.12483%2013.9201%209.36302%2013.9202C9.60122%2013.9202%209.81822%2013.7952%2010.2522%2013.545L15.9706%2010.2487C16.1189%2010.1632%2016.193%2010.1205%2016.2486%2010.1526C16.3041%2010.1847%2016.3041%2010.2703%2016.3041%2010.4414V11.3206C16.3041%2011.5715%2016.3041%2011.6969%2016.2445%2011.8002C16.1848%2011.9035%2016.0761%2011.9661%2015.8588%2012.0914L11.1422%2014.8103C10.2738%2015.3108%209.83968%2015.5611%209.36313%2015.5608C8.88654%2015.5606%208.4526%2015.31%207.58475%2014.8086L3.17196%2012.2596C3.15794%2012.2514%203.15094%2012.2474%203.1444%2012.2436C2.21916%2011.7029%201.64824%2010.7138%201.64288%209.64217C1.64285%209.63461%201.64285%209.62652%201.64285%209.61032V8.8032C1.64285%208.21161%201.95792%207.6648%202.46974%207.36813C2.92201%207.10599%203.47987%207.10547%203.93261%207.36677L7.58763%209.47632Z'%20fill='%23F2F7F7'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1635_11489'%3e%3crect%20width='18'%20height='18'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",xm="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.75%208.24998L15.9%202.09998'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.5%205.1V1.5H12.9'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.25%201.5H6.75C3%201.5%201.5%203%201.5%206.75V11.25C1.5%2015%203%2016.5%206.75%2016.5H11.25C15%2016.5%2016.5%2015%2016.5%2011.25V9.75'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",fM="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6668%208.60016V11.4002C10.6668%2013.7335%209.7335%2014.6668%207.40016%2014.6668H4.60016C2.26683%2014.6668%201.3335%2013.7335%201.3335%2011.4002V8.60016C1.3335%206.26683%202.26683%205.3335%204.60016%205.3335H7.40016C9.7335%205.3335%2010.6668%206.26683%2010.6668%208.60016Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.6668%204.60016V7.40016C14.6668%209.7335%2013.7335%2010.6668%2011.4002%2010.6668H10.6668V8.60016C10.6668%206.26683%209.7335%205.3335%207.40016%205.3335H5.3335V4.60016C5.3335%202.26683%206.26683%201.3335%208.60016%201.3335H11.4002C13.7335%201.3335%2014.6668%202.26683%2014.6668%204.60016Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Wbt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M35.0601%2015.54C34.9201%2015.52%2034.7801%2015.52%2034.6401%2015.54C31.5401%2015.44%2029.0801%2012.9%2029.0801%209.78C29.0801%206.6%2031.6601%204%2034.8601%204C38.0401%204%2040.6401%206.58%2040.6401%209.78C40.6201%2012.9%2038.1601%2015.44%2035.0601%2015.54Z'%20fill='white'/%3e%3cpath%20d='M41.58%2029.3998C39.34%2030.8998%2036.1999%2031.4598%2033.2999%2031.0798C34.0599%2029.4398%2034.4599%2027.6198%2034.4799%2025.6998C34.4799%2023.6998%2034.04%2021.7998%2033.2%2020.1398C36.16%2019.7398%2039.3%2020.2998%2041.56%2021.7998C44.72%2023.8798%2044.72%2027.2998%2041.58%2029.3998Z'%20fill='white'/%3e%3cpath%20d='M12.8801%2015.54C13.0201%2015.52%2013.1601%2015.52%2013.3001%2015.54C16.4001%2015.44%2018.8601%2012.9%2018.8601%209.78C18.8601%206.58%2016.2801%204%2013.0801%204C9.90007%204%207.32007%206.58%207.32007%209.78C7.32007%2012.9%209.78007%2015.44%2012.8801%2015.54Z'%20fill='white'/%3e%3cpath%20d='M13.1%2025.7002C13.1%2027.6402%2013.52%2029.4802%2014.28%2031.1402C11.46%2031.4402%208.51999%2030.8402%206.35999%2029.4202C3.19999%2027.3202%203.19999%2023.9002%206.35999%2021.8002C8.49999%2020.3602%2011.52%2019.7802%2014.36%2020.1002C13.54%2021.7802%2013.1%2023.6802%2013.1%2025.7002Z'%20fill='white'/%3e%3cpath%20d='M24.2401%2031.74C24.0801%2031.72%2023.9001%2031.72%2023.7201%2031.74C20.0401%2031.62%2017.1001%2028.6%2017.1001%2024.88C17.1201%2021.08%2020.1801%2018%2024.0001%2018C27.8001%2018%2030.8801%2021.08%2030.8801%2024.88C30.8601%2028.6%2027.9401%2031.62%2024.2401%2031.74Z'%20fill='white'/%3e%3cpath%20d='M17.7401%2035.8798C14.7201%2037.8998%2014.7201%2041.2198%2017.7401%2043.2198C21.1801%2045.5198%2026.8201%2045.5198%2030.2601%2043.2198C33.2801%2041.1998%2033.2801%2037.8798%2030.2601%2035.8798C26.8401%2033.5798%2021.2001%2033.5798%2017.7401%2035.8798Z'%20fill='white'/%3e%3c/svg%3e",qbt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M24%204C12.98%204%204%2012.98%204%2024C4%2035.02%2012.98%2044%2024%2044C35.02%2044%2044%2035.02%2044%2024C44%2012.98%2035.02%204%2024%204ZM33.56%2019.4L22.22%2030.74C21.94%2031.02%2021.56%2031.18%2021.16%2031.18C20.76%2031.18%2020.38%2031.02%2020.1%2030.74L14.44%2025.08C13.86%2024.5%2013.86%2023.54%2014.44%2022.96C15.02%2022.38%2015.98%2022.38%2016.56%2022.96L21.16%2027.56L31.44%2017.28C32.02%2016.7%2032.98%2016.7%2033.56%2017.28C34.14%2017.86%2034.14%2018.8%2033.56%2019.4Z'%20fill='%231DE6A3'/%3e%3c/svg%3e",Gbt="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M48.107%2039.1333C46.987%2040.2266%2046.347%2041.8%2046.507%2043.48C46.747%2046.36%2049.387%2048.4666%2052.267%2048.4666H57.3337V51.64C57.3337%2057.16%2052.827%2061.6667%2047.307%2061.6667H16.6937C11.1737%2061.6667%206.66699%2057.16%206.66699%2051.64V33.6933C6.66699%2028.1733%2011.1737%2023.6667%2016.6937%2023.6667H47.307C52.827%2023.6667%2057.3337%2028.1733%2057.3337%2033.6933V37.5334H51.947C50.4537%2037.5334%2049.0937%2038.12%2048.107%2039.1333Z'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.66699%2036.0933V23.9068C6.66699%2020.7334%208.61366%2017.9067%2011.5737%2016.7867L32.747%208.78666C36.0537%207.53333%2039.6003%209.98674%2039.6003%2013.5334V23.6667'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M60.1572%2040.2537V45.7472C60.1572%2047.2139%2058.9838%2048.4138%2057.4905%2048.4671H52.2638C49.3838%2048.4671%2046.7438%2046.3605%2046.5038%2043.4805C46.3438%2041.8005%2046.9838%2040.2271%2048.1038%2039.1338C49.0905%2038.1205%2050.4505%2037.5339%2051.9438%2037.5339H57.4905C58.9838%2037.5872%2060.1572%2038.7871%2060.1572%2040.2537Z'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M18.667%2035H37.3337'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Kbt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%2021C5.50558%2021%202.95666%2020.5387%202.54353%2018.2033C2.13039%2015.8679%204.77383%2011.4774%205.58842%2010.0285C8.31257%205.18408%2010.1637%203%2012%203C13.8363%203%2015.6874%205.18408%2018.4116%2010.0285C19.2262%2011.4774%2021.8696%2015.8679%2021.4565%2018.2033C21.0444%2020.5387%2018.4944%2021%2012%2021Z'%20stroke='%23FF9900'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12%208.5V12.395'%20stroke='%23FF9900'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9955%2015.8945H12.0045'%20stroke='%23FF9900'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",hM="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.75764%205.18999L14.1826%207.15499C15.4576%207.71749%2015.4576%208.64749%2014.1826%209.20999L9.75764%2011.175C9.25514%2011.4%208.43014%2011.4%207.92764%2011.175L3.50264%209.20999C2.22764%208.64749%202.22764%207.71749%203.50264%207.15499L7.92764%205.18999C8.43014%204.96499%209.25514%204.96499%209.75764%205.18999Z'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2011.25C2.25%2011.88%202.7225%2012.6075%203.3%2012.8625L8.3925%2015.1275C8.7825%2015.3%209.225%2015.3%209.6075%2015.1275L14.7%2012.8625C15.2775%2012.6075%2015.75%2011.88%2015.75%2011.25'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2015C2.25%2015.6975%202.6625%2016.3275%203.3%2016.6125L8.3925%2018.8775C8.7825%2019.05%209.225%2019.05%209.6075%2018.8775L14.7%2016.6125C15.3375%2016.3275%2015.75%2015.6975%2015.75%2015'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3ccircle%20cx='16'%20cy='5'%20r='4.5'%20fill='%2367FFBD'%20stroke='%23273F35'/%3e%3c/svg%3e",pM="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.75764%205.18999L14.1826%207.15499C15.4576%207.71749%2015.4576%208.64749%2014.1826%209.20999L9.75764%2011.175C9.25514%2011.4%208.43014%2011.4%207.92764%2011.175L3.50264%209.20999C2.22764%208.64749%202.22764%207.71749%203.50264%207.15499L7.92764%205.18999C8.43014%204.96499%209.25514%204.96499%209.75764%205.18999Z'%20stroke='%23FF797C'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2011.25C2.25%2011.88%202.7225%2012.6075%203.3%2012.8625L8.3925%2015.1275C8.7825%2015.3%209.225%2015.3%209.6075%2015.1275L14.7%2012.8625C15.2775%2012.6075%2015.75%2011.88%2015.75%2011.25'%20stroke='%23FF797C'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2015C2.25%2015.6975%202.6625%2016.3275%203.3%2016.6125L8.3925%2018.8775C8.7825%2019.05%209.225%2019.05%209.6075%2018.8775L14.7%2016.6125C15.3375%2016.3275%2015.75%2015.6975%2015.75%2015'%20stroke='%23FF797C'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3ccircle%20cx='16'%20cy='5'%20r='4.5'%20fill='%23FF797C'%20stroke='%233F2A2B'/%3e%3c/svg%3e",NA="/assets/sharePnlGreenIcon-CwGFUwvO.svg",AA="/assets/sharePnlRedIcon-NsgQBTQF.svg",jA="/assets/dextrabotShareIcon-DbUzC8hq.png",Ybt="/assets/buttonHyperrIcon-BEIlirim.png",zme="/assets/mushroomRed-DlifwotO.svg",Hme="/assets/mushroomBlue-DU8qWKKQ.svg",Yc="data:image/svg+xml,%3csvg%20width='11'%20height='8'%20viewBox='0%200%2011%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1%203.83L3.83%206.66L9.5%201'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Xbt="data:image/svg+xml,%3csvg%20width='28'%20height='32'%20viewBox='0%200%2028%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_92_32471)'%3e%3cpath%20d='M18.4324%2015.0402H16.1149V9.64023C16.1149%208.38023%2015.4324%208.12523%2014.5999%209.07023L13.9999%209.75273L8.92239%2015.5277C8.22489%2016.3152%208.51739%2016.9602%209.56739%2016.9602H11.8849V22.3602C11.8849%2023.6202%2012.5674%2023.8752%2013.3999%2022.9302L13.9999%2022.2477L19.0774%2016.4727C19.7749%2015.6852%2019.4824%2015.0402%2018.4324%2015.0402Z'%20fill='%2367FFBD'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_92_32471'%20x='-3'%20y='-0.999756'%20width='34'%20height='34'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='4'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.403922%200%200%200%200%201%200%200%200%200%200.741176%200%200%200%200.48%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_92_32471'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_92_32471'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",Qbt="data:image/svg+xml,%3csvg%20width='35'%20height='30'%20viewBox='0%200%2035%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_92_32478)'%3e%3cpath%20d='M20.4658%209.05899L21.6995%2011.5265C21.8658%2011.8677%2022.312%2012.1915%2022.6883%2012.2615L24.9195%2012.629C26.3458%2012.8652%2026.6783%2013.8977%2025.6545%2014.9302L23.9133%2016.6715C23.6245%2016.9602%2023.4583%2017.529%2023.5545%2017.9402L24.0533%2020.0927C24.447%2021.7902%2023.537%2022.4552%2022.0408%2021.5627L19.9495%2020.3202C19.5733%2020.0927%2018.9433%2020.0927%2018.567%2020.3202L16.4758%2021.5627C14.9795%2022.4465%2014.0695%2021.7902%2014.4633%2020.0927L14.962%2017.9402C15.0408%2017.5202%2014.8745%2016.9515%2014.5858%2016.6627L12.8445%2014.9215C11.8208%2013.8977%2012.1533%2012.8652%2013.5795%2012.6202L15.8108%2012.2527C16.187%2012.1915%2016.6333%2011.859%2016.7995%2011.5177L18.0333%209.05024C18.707%207.72024%2019.792%207.72024%2020.4658%209.05899Z'%20fill='%23D65AFF'/%3e%3cpath%20d='M14%209.53149H8.75C8.39125%209.53149%208.09375%209.23399%208.09375%208.87524C8.09375%208.51649%208.39125%208.21899%208.75%208.21899H14C14.3587%208.21899%2014.6562%208.51649%2014.6562%208.87524C14.6562%209.23399%2014.3587%209.53149%2014%209.53149Z'%20fill='%23D65AFF'/%3e%3cpath%20d='M11.375%2021.7815H8.75C8.39125%2021.7815%208.09375%2021.484%208.09375%2021.1252C8.09375%2020.7665%208.39125%2020.469%208.75%2020.469H11.375C11.7338%2020.469%2012.0312%2020.7665%2012.0312%2021.1252C12.0312%2021.484%2011.7338%2021.7815%2011.375%2021.7815Z'%20fill='%23D65AFF'/%3e%3cpath%20d='M9.625%2015.6565H8.75C8.39125%2015.6565%208.09375%2015.359%208.09375%2015.0002C8.09375%2014.6415%208.39125%2014.344%208.75%2014.344H9.625C9.98375%2014.344%2010.2812%2014.6415%2010.2812%2015.0002C10.2812%2015.359%209.98375%2015.6565%209.625%2015.6565Z'%20fill='%23D65AFF'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_92_32478'%20x='-1'%20y='-3.49976'%20width='37'%20height='37'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='4'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.839216%200%200%200%200%200.352941%200%200%200%200%201%200%200%200%200.48%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_92_32478'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_92_32478'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",ec="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%206.75V10.5'%20stroke='%23FF797C'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.99958%2016.0575H4.45458C1.85208%2016.0575%200.764583%2014.1975%202.02458%2011.925L4.36458%207.70996L6.56958%203.74996C7.90458%201.34246%2010.0946%201.34246%2011.4296%203.74996L13.6346%207.71746L15.9746%2011.9325C17.2346%2014.205%2016.1396%2016.065%2013.5446%2016.065H8.99958V16.0575Z'%20stroke='%23FF797C'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.99609%2012.75H9.00283'%20stroke='%23FF797C'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",eae="data:image/svg+xml,%3csvg%20width='86'%20height='86'%20viewBox='0%200%2086%2086'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='43'%20cy='43'%20r='43'%20fill='%231DE6A3'%20fill-opacity='0.16'/%3e%3cpath%20d='M42.9987%2016.3335C28.3054%2016.3335%2016.332%2028.3068%2016.332%2043.0002C16.332%2057.6935%2028.3054%2069.6668%2042.9987%2069.6668C57.692%2069.6668%2069.6654%2057.6935%2069.6654%2043.0002C69.6654%2028.3068%2057.692%2016.3335%2042.9987%2016.3335ZM55.7454%2036.8668L40.6254%2051.9868C40.252%2052.3602%2039.7454%2052.5735%2039.212%2052.5735C38.6787%2052.5735%2038.172%2052.3602%2037.7987%2051.9868L30.252%2044.4402C29.4787%2043.6668%2029.4787%2042.3868%2030.252%2041.6135C31.0254%2040.8402%2032.3054%2040.8402%2033.0787%2041.6135L39.212%2047.7468L52.9187%2034.0402C53.692%2033.2668%2054.972%2033.2668%2055.7454%2034.0402C56.5187%2034.8135%2056.5187%2036.0668%2055.7454%2036.8668Z'%20fill='%231DE6A3'/%3e%3c/svg%3e",Zbt="/assets/copyTradeBanner-Bzh6f0rX.svg",Jbt="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%2016.5C13.1421%2016.5%2016.5%2013.1421%2016.5%209C16.5%204.85786%2013.1421%201.5%209%201.5C4.85786%201.5%201.5%204.85786%201.5%209C1.5%2013.1421%204.85786%2016.5%209%2016.5Z'%20stroke='%23FFD979'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.375%209H10.875'%20stroke='%23FFD979'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.375%2011.25L11.625%209L9.375%206.75'%20stroke='%23FFD979'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Vme="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2782_17351)'%3e%3cpath%20d='M5.05842%206.31754C5.6361%206.65096%205.92493%206.81767%206.24216%206.81794C6.55936%206.81822%206.84849%206.65201%207.42676%206.31961L11.1129%204.20073C11.2793%204.10508%2011.3819%203.92777%2011.3819%203.73583C11.3819%203.54388%2011.2793%203.36658%2011.1129%203.27093L7.42543%201.15127C6.84779%200.81922%206.55896%200.653197%206.24207%200.65332C5.92515%200.653444%205.63647%200.819692%205.05909%201.15219L1.88911%202.97767C1.86561%202.9912%201.85387%202.99797%201.84292%203.00438C0.76008%203.63828%200.0910671%204.79556%200.0821217%206.05026C0.0820312%206.06294%200.0820313%206.07649%200.0820313%206.10361C0.0820313%206.13068%200.0820312%206.14423%200.0821215%206.15689C0.0910473%207.41019%200.758568%208.56638%201.83948%209.20078C1.8504%209.20718%201.86214%209.21396%201.88559%209.22751L3.87125%2010.374C5.02829%2011.042%205.6068%2011.376%206.24212%2011.3762C6.87742%2011.3764%207.45617%2011.0428%208.61365%2010.3756L10.7098%209.16719C11.2894%208.83308%2011.5792%208.66604%2011.7383%208.39063C11.8974%208.11522%2011.8974%207.78073%2011.8974%207.11174V5.81938C11.8974%205.6338%2011.7969%205.46278%2011.6348%205.37246C11.4779%205.28508%2011.2866%205.28638%2011.1309%205.37588L6.83276%207.84658C6.54439%208.01235%206.40019%208.09524%206.24197%208.0953C6.08374%208.09533%205.9395%208.01253%205.65102%207.84695L2.74192%206.17707C2.59621%206.09342%202.52334%206.05159%202.46482%206.04404C2.33139%206.02681%202.20311%206.10156%202.15228%206.22612C2.13%206.28075%202.13044%206.36477%202.13135%206.53279C2.13201%206.65648%202.13234%206.71833%202.1439%206.77522C2.1698%206.90263%202.23682%207.01797%202.33468%207.10356C2.37838%207.14178%202.43194%207.1727%202.53909%207.23453L5.64938%209.02967C5.93861%209.1966%206.08322%209.28007%206.24201%209.28012C6.40082%209.28016%206.54548%209.19677%206.83479%209.03001L10.6471%206.83244C10.7459%206.77546%2010.7953%206.74698%2010.8324%206.76839C10.8694%206.78981%2010.8694%206.84684%2010.8694%206.96091V7.54708C10.8694%207.71434%2010.8694%207.79796%2010.8296%207.86682C10.7899%207.93566%2010.7174%207.97742%2010.5725%208.06096L7.42811%209.87351C6.84923%2010.2072%206.55979%2010.374%206.24208%2010.3739C5.92436%2010.3737%205.63507%2010.2067%205.0565%209.87242L2.11464%208.17304C2.1053%208.16763%202.10063%208.16494%202.09627%208.16239C1.47944%207.80194%201.09883%207.14254%201.09526%206.42811C1.09523%206.42307%201.09523%206.41768%201.09523%206.40688V5.8688C1.09523%205.47441%201.30528%205.10986%201.6465%204.91209C1.948%204.73733%202.31991%204.73698%202.62174%204.91118L5.05842%206.31754Z'%20fill='%23F2F7F7'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2782_17351'%3e%3crect%20width='12'%20height='12'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",tae="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.939%207.14668H9.87903V2.34668C9.87903%201.22668%209.27236%201.00001%208.53236%201.84001L7.99903%202.44668L3.4857%207.58001C2.8657%208.28001%203.1257%208.85335%204.05903%208.85335H6.11903V13.6533C6.11903%2014.7733%206.7257%2015%207.4657%2014.16L7.99903%2013.5533L12.5124%208.42001C13.1324%207.72001%2012.8724%207.14668%2011.939%207.14668Z'%20fill='%2367FFBD'/%3e%3c/svg%3e",eyt="/assets/introductionModalIcon-C3qCLVbZ.svg",tyt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20opacity='0.4'%20cx='24'%20cy='24'%20r='20'%20fill='%23868686'/%3e%3cpath%20d='M34%2020C34%2021.1046%2033.1046%2022%2032%2022C30.8954%2022%2030%2021.1046%2030%2020C30%2018.8954%2030.8954%2018%2032%2018C33.1046%2018%2034%2018.8954%2034%2020Z'%20fill='%23868686'/%3e%3cpath%20d='M18%2020C18%2021.1046%2017.1046%2022%2016%2022C14.8954%2022%2014%2021.1046%2014%2020C14%2018.8954%2014.8954%2018%2016%2018C17.1046%2018%2018%2018.8954%2018%2020Z'%20fill='%23868686'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M18.9891%2028.8723C18.3698%2028.329%2017.4271%2028.3868%2016.8789%2029.0035C16.3285%2029.6226%2016.3843%2030.5708%2017.0035%2031.1211L18%2030C17.0035%2031.1211%2017.003%2031.1207%2017.0035%2031.1211L17.0054%2031.1228L17.0075%2031.1247L17.0124%2031.1291L17.0249%2031.1399L17.06%2031.1698C17.088%2031.1934%2017.125%2031.224%2017.171%2031.2605C17.263%2031.3335%2017.391%2031.4308%2017.5536%2031.5439C17.8782%2031.7697%2018.3441%2032.0611%2018.9394%2032.3497C20.13%2032.927%2021.8535%2033.5%2024%2033.5C26.1465%2033.5%2027.87%2032.927%2029.0607%2032.3497C29.656%2032.0611%2030.1218%2031.7697%2030.4465%2031.5439C30.609%2031.4308%2030.737%2031.3335%2030.829%2031.2605C30.875%2031.224%2030.9121%2031.1934%2030.94%2031.1698L30.9752%2031.1399L30.9876%2031.1291L30.9925%2031.1247L30.9946%2031.1228C30.9951%2031.1224%2030.9966%2031.1211%2030%2030L30.9966%2031.1211C31.6157%2030.5708%2031.6715%2029.6226%2031.1211%2029.0035C30.573%2028.3868%2029.6302%2028.329%2029.0109%2028.8723L29.0092%2028.8739C29.0023%2028.8796%2028.9859%2028.8933%2028.963%2028.9114C28.9173%2028.9477%2028.8402%2029.0068%2028.7333%2029.0812C28.5189%2029.2303%2028.1878%2029.4389%2027.7519%2029.6503C26.88%2030.073%2025.6035%2030.5%2024%2030.5C22.3965%2030.5%2021.12%2030.073%2020.2482%2029.6503C19.8122%2029.4389%2019.4812%2029.2303%2019.2668%2029.0812C19.1598%2029.0068%2019.0827%2028.9477%2019.037%2028.9114C19.0142%2028.8933%2018.9992%2028.8809%2018.9924%2028.8751C18.9909%2028.8739%2018.9898%2028.8729%2018.9891%2028.8723C18.9891%2028.8723%2018.9891%2028.8723%2018.9891%2028.8723ZM29.0109%2028.8723L29.0092%2028.8739L29.0067%2028.876L29.0052%2028.8774C29.0074%2028.8754%2029.0087%2028.8743%2029.0109%2028.8723Z'%20fill='%23868686'/%3e%3c/svg%3e",nyt="data:image/svg+xml,%3csvg%20width='10'%20height='10'%20viewBox='0%200%2010%2010'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.41602%204.58334L8.83268%201.16667'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.16602%202.83333V0.833328H7.16602'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M4.58398%200.833328H3.75065C1.66732%200.833328%200.833984%201.66666%200.833984%203.74999V6.24999C0.833984%208.33333%201.66732%209.16666%203.75065%209.16666H6.25065C8.33398%209.16666%209.16732%208.33333%209.16732%206.24999V5.41666'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ryt="/assets/dextrabot-copy-trade-hyperliquid-BgdeQSj5.png",syt="/assets/dextrabot-position-copy-Ph5ntD17.png",iyt="/assets/dextrabot-referral-rewards-CvRzGBKC.png",ayt="/assets/hyperliquid-discover-wallets-CgeXGTl5.svg",oyt="/assets/dextrabot-telegram-alerts-CJHcZn29.png",lyt="/assets/hyperliquid-wallet-analysis-DwEnicpm.png",cyt="/assets/dextrabot-discover-wallets-filters-BSnYa19g.svg",uyt="/assets/hyperliquid-trading-metrics-Cwsy4rqz.svg",dyt="/assets/dextrabot-risk-parameters-DzTb7mB0.svg",fyt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.4297%205.92999L20.4997%2012L14.4297%2018.07'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M3.5%2012H20.33'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",TH="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='32'%20cy='32'%20r='32'%20fill='%233D3D3D'/%3e%3c/svg%3e",hyt="/assets/dextrabotNewLogoIcon-V6eDxoac.png",nae="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.1425%201.5H5.8575C3.1275%201.5%201.5%203.1275%201.5%205.8575V12.135C1.5%2014.8725%203.1275%2016.5%205.8575%2016.5H12.135C14.865%2016.5%2016.4925%2014.8725%2016.4925%2012.1425V5.8575C16.5%203.1275%2014.8725%201.5%2012.1425%201.5ZM12.9375%209.2475C12.9375%209.555%2012.6825%209.81%2012.375%209.81C12.0675%209.81%2011.8125%209.555%2011.8125%209.2475V6.9825L6.0225%2012.7725C5.91%2012.885%205.7675%2012.9375%205.625%2012.9375C5.4825%2012.9375%205.34%2012.885%205.2275%2012.7725C5.01%2012.555%205.01%2012.195%205.2275%2011.9775L11.0175%206.1875H8.7525C8.445%206.1875%208.19%205.9325%208.19%205.625C8.19%205.3175%208.445%205.0625%208.7525%205.0625H12.375C12.6825%205.0625%2012.9375%205.3175%2012.9375%205.625V9.2475Z'%20fill='white'%20fill-opacity='0.32'/%3e%3c/svg%3e",pyt="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205.0625C16.1391%205.0625%2017.0625%204.13909%2017.0625%203C17.0625%201.86091%2016.1391%200.9375%2015%200.9375C13.8609%200.9375%2012.9375%201.86091%2012.9375%203C12.9375%204.13909%2013.8609%205.0625%2015%205.0625Z'%20fill='white'/%3e%3cpath%20d='M14.28%206.1125C13.1025%205.8575%2012.1425%204.8975%2011.8875%203.72C11.79%203.2625%2011.7825%202.82%2011.865%202.4C11.9625%201.935%2011.6175%201.5%2011.1375%201.5H5.25C3.18%201.5%201.5%203.18%201.5%205.25V10.4625C1.5%2012.5325%203.18%2014.2125%205.25%2014.2125H6.375C6.585%2014.2125%206.855%2014.3475%206.975%2014.5125L8.1%2016.005C8.595%2016.665%209.405%2016.665%209.9%2016.005L11.025%2014.5125C11.1675%2014.325%2011.385%2014.2125%2011.625%2014.2125H12.7575C14.8275%2014.2125%2016.5%2012.54%2016.5%2010.47V6.8625C16.5%206.39%2016.065%206.045%2015.6%206.135C15.18%206.21%2014.7375%206.21%2014.28%206.1125ZM6%209C5.58%209%205.25%208.6625%205.25%208.25C5.25%207.8375%205.58%207.5%206%207.5C6.4125%207.5%206.75%207.8375%206.75%208.25C6.75%208.6625%206.42%209%206%209ZM9%209C8.58%209%208.25%208.6625%208.25%208.25C8.25%207.8375%208.58%207.5%209%207.5C9.4125%207.5%209.75%207.8375%209.75%208.25C9.75%208.6625%209.42%209%209%209ZM12%209C11.58%209%2011.25%208.6625%2011.25%208.25C11.25%207.8375%2011.58%207.5%2012%207.5C12.4125%207.5%2012.75%207.8375%2012.75%208.25C12.75%208.6625%2012.42%209%2012%209Z'%20fill='white'/%3e%3c/svg%3e",myt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.0199%2020.5299C9.68987%2020.5299%207.35987%2020.1599%205.14987%2019.4199C4.30987%2019.1299%203.66987%2018.5399%203.38987%2017.7699C3.09987%2016.9999%203.19987%2016.1499%203.65987%2015.3899L4.80987%2013.4799C5.04987%2013.0799%205.26987%2012.2799%205.26987%2011.8099V8.91992C5.26987%205.19992%208.29987%202.16992%2012.0199%202.16992C15.7399%202.16992%2018.7699%205.19992%2018.7699%208.91992V11.8099C18.7699%2012.2699%2018.9899%2013.0799%2019.2299%2013.4899L20.3699%2015.3899C20.7999%2016.1099%2020.8799%2016.9799%2020.5899%2017.7699C20.2999%2018.5599%2019.6699%2019.1599%2018.8799%2019.4199C16.6799%2020.1599%2014.3499%2020.5299%2012.0199%2020.5299ZM12.0199%203.66992C9.12987%203.66992%206.76987%206.01992%206.76987%208.91992V11.8099C6.76987%2012.5399%206.46987%2013.6199%206.09987%2014.2499L4.94987%2016.1599C4.72987%2016.5299%204.66987%2016.9199%204.79987%2017.2499C4.91987%2017.5899%205.21987%2017.8499%205.62987%2017.9899C9.80987%2019.3899%2014.2399%2019.3899%2018.4199%2017.9899C18.7799%2017.8699%2019.0599%2017.5999%2019.1899%2017.2399C19.3199%2016.8799%2019.2899%2016.4899%2019.0899%2016.1599L17.9399%2014.2499C17.5599%2013.5999%2017.2699%2012.5299%2017.2699%2011.7999V8.91992C17.2699%206.01992%2014.9199%203.66992%2012.0199%203.66992Z'%20fill='white'/%3e%3cpath%20d='M13.8806%203.94018C13.8106%203.94018%2013.7406%203.93018%2013.6706%203.91018C13.3806%203.83018%2013.1006%203.77018%2012.8306%203.73018C11.9806%203.62018%2011.1606%203.68018%2010.3906%203.91018C10.1106%204.00018%209.8106%203.91018%209.6206%203.70018C9.4306%203.49018%209.3706%203.19018%209.4806%202.92018C9.8906%201.87018%2010.8906%201.18018%2012.0306%201.18018C13.1706%201.18018%2014.1706%201.86018%2014.5806%202.92018C14.6806%203.19018%2014.6306%203.49018%2014.4406%203.70018C14.2906%203.86018%2014.0806%203.94018%2013.8806%203.94018Z'%20fill='white'/%3e%3cpath%20d='M12.0195%2022.8101C11.0295%2022.8101%2010.0695%2022.4101%209.36953%2021.7101C8.66953%2021.0101%208.26953%2020.0501%208.26953%2019.0601H9.76953C9.76953%2019.6501%2010.0095%2020.2301%2010.4295%2020.6501C10.8495%2021.0701%2011.4295%2021.3101%2012.0195%2021.3101C13.2595%2021.3101%2014.2695%2020.3001%2014.2695%2019.0601H15.7695C15.7695%2021.1301%2014.0895%2022.8101%2012.0195%2022.8101Z'%20fill='white'/%3e%3c/svg%3e",xyt="data:image/svg+xml,%3csvg%20width='14'%20height='13'%20viewBox='0%200%2014%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_378_2345)'%3e%3cpath%20d='M10.9574%200H13.0931L8.40386%205.51661L13.8824%2013H9.58315L6.21708%208.4524L2.3635%2013H0.22779L5.19565%207.09963L-0.0507812%200H4.35529L7.39636%204.15424L10.9574%200ZM10.2099%2011.7048H11.3939L3.73315%201.24723H2.461L10.2099%2011.7048Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_378_2345'%3e%3crect%20width='13.9286'%20height='13'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",gyt="data:image/svg+xml,%3csvg%20width='10'%20height='12'%20viewBox='0%200%2010%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%2012L10%206.00005L0%200V12Z'%20fill='white'/%3e%3c/svg%3e",nke="data:image/svg+xml,%3csvg%20width='10'%20height='12'%20viewBox='0%200%2010%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.67166%207.49665C9.67295%208.13961%209.54358%208.77482%209.29002%209.36475C9.0481%209.93526%208.6988%2010.4489%208.25377%2010.8887C7.81262%2011.3273%207.28996%2011.6753%206.71686%2011.9146C6.64441%2011.9444%206.57196%2011.9728%206.49952%2012C6.54609%2011.9599%206.59137%2011.9185%206.63407%2011.8758C6.86823%2011.6442%207.05193%2011.3738%207.18%2011.0737C7.31326%2010.7632%207.38182%2010.4282%207.38052%2010.0905C7.38052%209.73733%207.30808%209.39579%207.16448%209.07237C7.02476%208.75671%206.82036%208.47209%206.5655%208.23923L6.35463%208.04647C6.33134%208.02448%206.29383%208.02706%206.27183%208.05035C6.26665%208.05682%206.26278%208.06329%206.26019%208.06976L6.16704%208.34013C6.10883%208.50832%206.00015%208.68167%205.8475%208.85114C5.83844%208.86279%205.8268%208.86538%205.81775%208.86538C5.80998%208.86667%205.79834%208.86538%205.78669%208.85503C5.77764%208.84597%205.77246%208.83304%205.77246%208.8201C5.79963%208.38542%205.66897%207.89382%205.38435%207.35952C5.1489%206.91578%204.8216%206.57036%204.41279%206.32844L4.11395%206.1525C4.07514%206.12922%204.02468%206.16026%204.02727%206.20554L4.04279%206.55226C4.05315%206.789%204.02598%206.99987%203.96129%207.17323C3.88108%207.38668%203.76724%207.58462%203.62105%207.76315C3.52014%207.88605%203.405%207.9986%203.27822%208.09563C2.97291%208.32979%202.72452%208.63122%202.55246%208.97405C2.3804%209.32076%202.29114%209.7024%202.29114%2010.0905C2.29114%2010.4307%202.3584%2010.7619%202.49166%2011.0737C2.61973%2011.3738%202.80473%2011.6455%203.03759%2011.8745C3.08158%2011.9185%203.12686%2011.9599%203.17344%2011.9987C3.09969%2011.9728%203.02725%2011.9444%202.9548%2011.9133C2.37911%2011.6727%201.86292%2011.3273%201.41789%2010.8874C0.976737%2010.4514%200.624856%209.93397%200.381641%209.36345C0.128074%208.77223%200%208.1435%200%207.49536C0.00129499%206.76054%200.170768%206.03478%200.498069%205.37628C0.825378%204.72297%201.29628%204.15245%201.87586%203.70742C2.11648%203.52112%202.33512%203.30896%202.52788%203.07351C2.80602%202.73586%203.02207%202.35939%203.17344%201.95446C3.29763%201.62328%203.34938%201.22482%203.32867%200.774614L3.29892%200.114833C3.29504%200.0281497%203.38948%20-0.0287652%203.46322%200.015216L4.03116%200.348991C4.80866%200.806956%205.43092%201.46545%205.87855%202.30893C6.41931%203.32449%206.66641%204.25724%206.61595%205.08391C6.61466%205.10849%206.62371%205.13307%206.64312%205.14989C6.66382%205.1693%206.68711%205.17188%206.70263%205.17058C6.71815%205.1693%206.74014%205.16282%206.75955%205.14213C7.04934%204.82%207.25374%204.49139%207.365%204.17056L7.54353%203.65826C7.5487%203.64403%207.55518%203.63239%207.56552%203.62074C7.60562%203.57546%207.67549%203.57158%207.72206%203.61298L8.12182%203.9791C8.60566%204.42283%208.99376%204.96101%209.26026%205.56128C9.53323%206.17579%209.67166%206.82652%209.67166%207.49665Z'%20fill='white'/%3e%3c/svg%3e",byt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.5733%208.48671C13.3267%208.48671%2013.12%208.30005%2013.0933%208.05338C12.9333%206.58671%2012.1467%205.26671%2010.9333%204.42671C10.7133%204.27338%2010.66%203.97338%2010.8133%203.75338C10.9667%203.53338%2011.2667%203.48005%2011.4867%203.63338C12.9333%204.64005%2013.8667%206.21338%2014.06%207.95338C14.0867%208.22005%2013.8933%208.46005%2013.6267%208.48671C13.6067%208.48671%2013.5933%208.48671%2013.5733%208.48671Z'%20fill='white'/%3e%3cpath%20d='M2.49333%208.51989C2.48%208.51989%202.46%208.51989%202.44666%208.51989C2.18%208.49322%201.98666%208.25322%202.01333%207.98656C2.19333%206.24656%203.11333%204.67322%204.54666%203.65989C4.76%203.50656%205.06666%203.55989%205.22%203.77322C5.37333%203.99322%205.32%204.29322%205.10666%204.44656C3.90666%205.29989%203.12666%206.61989%202.98%208.07989C2.95333%208.33322%202.74%208.51989%202.49333%208.51989Z'%20fill='white'/%3e%3cpath%20d='M10.66%2014.0666C9.84%2014.4599%208.96%2014.6599%208.04%2014.6599C7.08%2014.6599%206.16666%2014.4466%205.31333%2014.0132C5.07333%2013.8999%204.98%2013.6066%205.1%2013.3666C5.21333%2013.1266%205.50667%2013.0332%205.74667%2013.1466C6.16667%2013.3599%206.61333%2013.5066%207.06667%2013.5932C7.68%2013.7132%208.30667%2013.7199%208.92%2013.6132C9.37333%2013.5332%209.82%2013.3932%2010.2333%2013.1932C10.48%2013.0799%2010.7733%2013.1732%2010.88%2013.4199C11%2013.6599%2010.9067%2013.9532%2010.66%2014.0666Z'%20fill='white'/%3e%3cpath%20d='M8.03333%201.34009C7%201.34009%206.15333%202.18009%206.15333%203.22009C6.15333%204.26009%206.99333%205.10009%208.03333%205.10009C9.07333%205.10009%209.91333%204.26009%209.91333%203.22009C9.91333%202.18009%209.07333%201.34009%208.03333%201.34009Z'%20fill='white'/%3e%3cpath%20d='M3.36666%209.24658C2.33333%209.24658%201.48666%2010.0866%201.48666%2011.1266C1.48666%2012.1666%202.32666%2013.0066%203.36666%2013.0066C4.40666%2013.0066%205.24666%2012.1666%205.24666%2011.1266C5.24666%2010.0866%204.4%209.24658%203.36666%209.24658Z'%20fill='white'/%3e%3cpath%20d='M12.6333%209.24658C11.6%209.24658%2010.7533%2010.0866%2010.7533%2011.1266C10.7533%2012.1666%2011.5933%2013.0066%2012.6333%2013.0066C13.6733%2013.0066%2014.5133%2012.1666%2014.5133%2011.1266C14.5133%2010.0866%2013.6733%209.24658%2012.6333%209.24658Z'%20fill='white'/%3e%3c/svg%3e",rke="data:image/svg+xml,%3csvg%20width='18'%20height='14'%20viewBox='0%200%2018%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3194_16457)'%3e%3cpath%20d='M11.5339%200C11.358%200.32044%2011.2001%200.651933%2011.0565%200.990792C9.69238%200.78085%208.30315%200.78085%206.93547%200.990792C6.79547%200.651933%206.63392%200.32044%206.45804%200C5.1765%200.224685%203.92727%200.618785%202.74267%201.17495C0.394982%204.74402%20-0.240399%208.22099%200.075501%2011.6501C1.45036%2012.6924%202.99036%2013.488%204.63086%2013.9963C5.0006%2013.488%205.32727%2012.9466%205.60727%2012.3831C5.07599%2012.1805%204.56265%2011.9263%204.07087%2011.6317C4.20009%2011.5359%204.32573%2011.4365%204.44778%2011.3407C7.33034%2012.733%2010.6688%2012.733%2013.5549%2011.3407C13.677%2011.4438%2013.8026%2011.5433%2013.9318%2011.6317C13.4401%2011.93%2012.9267%2012.1805%2012.3919%2012.3867C12.6718%2012.9503%2012.9985%2013.4917%2013.3683%2014C15.0087%2013.4917%2016.5487%2012.6998%2017.9237%2011.6575C18.2969%207.67955%2017.2847%204.23204%2015.2492%201.17864C14.0683%200.622475%2012.819%200.22836%2011.5375%200.00736458L11.5339%200ZM6.00932%209.5396C5.12266%209.5396%204.38677%208.71455%204.38677%207.6943C4.38677%206.67405%205.09394%205.84531%206.00573%205.84531C6.91753%205.84531%207.64264%206.67772%207.62828%207.6943C7.61393%208.71087%206.91394%209.5396%206.00932%209.5396ZM11.9898%209.5396C11.0995%209.5396%2010.3708%208.71455%2010.3708%207.6943C10.3708%206.67405%2011.078%205.84531%2011.9898%205.84531C12.9016%205.84531%2013.6231%206.67772%2013.6088%207.6943C13.5944%208.71087%2012.8944%209.5396%2011.9898%209.5396Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3194_16457'%3e%3crect%20width='18'%20height='14'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",yyt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.1626%201.5H14.3679L9.54994%207.00667L15.2179%2014.5H10.7799L7.30394%209.95533L3.3266%2014.5H1.11994L6.27327%208.61L0.835938%201.5H5.3866L8.5286%205.654L12.1626%201.5ZM11.3886%2013.18H12.6106L4.7226%202.75067H3.41127L11.3886%2013.18Z'%20fill='white'/%3e%3c/svg%3e",vyt="data:image/svg+xml,%3csvg%20width='18'%20height='16'%20viewBox='0%200%2018%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.24334%206.83119C5.90766%204.79901%209.01794%203.45928%2010.5742%202.81199C15.0175%200.963838%2015.9408%200.642794%2016.5426%200.632193C16.675%200.629862%2016.9709%200.662664%2017.1626%200.818215C17.3245%200.949559%2017.369%201.12699%2017.3903%201.25151C17.4117%201.37604%2017.4382%201.65972%2017.4171%201.88138C17.1763%204.41136%2016.1344%2010.5509%2015.6044%2013.3846C15.3801%2014.5836%2014.9385%2014.9856%2014.5109%2015.0249C13.5818%2015.1104%2012.8762%2014.4109%2011.9763%2013.821C10.5681%2012.8979%209.77254%2012.3233%208.40563%2011.4225C6.82593%2010.3815%207.84998%209.80933%208.75025%208.87427C8.98585%208.62956%2013.0797%204.90589%2013.1589%204.56809C13.1689%204.52584%2013.1781%204.36837%2013.0845%204.28521C12.9909%204.20206%2012.8529%204.2305%2012.7532%204.25311C12.612%204.28517%2010.3624%205.77209%206.00433%208.71388C5.36578%209.15236%204.7874%209.366%204.2692%209.3548C3.69791%209.34246%202.599%209.03179%201.78206%208.76624C0.780062%208.44052%20-0.0163084%208.26832%200.0530376%207.71516C0.0891573%207.42704%200.485924%207.13238%201.24334%206.83119Z'%20fill='white'/%3e%3c/svg%3e",wyt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.3697%204.89012L13.5097%202.28012C12.6497%201.90012%2011.3497%201.90012%2010.4897%202.28012L4.62969%204.89012C3.14969%205.55012%202.92969%206.45012%202.92969%206.93012C2.92969%207.41012%203.14969%208.31012%204.62969%208.97012L10.4897%2011.5801C10.9197%2011.7701%2011.4597%2011.8701%2011.9997%2011.8701C12.5397%2011.8701%2013.0797%2011.7701%2013.5097%2011.5801L19.3697%208.97012C20.8497%208.31012%2021.0697%207.41012%2021.0697%206.93012C21.0697%206.45012%2020.8597%205.55012%2019.3697%204.89012Z'%20fill='%23083C26'/%3e%3cpath%20d='M12.0003%2017.04C11.6203%2017.04%2011.2403%2016.96%2010.8903%2016.81L4.15031%2013.81C3.12031%2013.35%202.32031%2012.12%202.32031%2010.99C2.32031%2010.58%202.65031%2010.25%203.06031%2010.25C3.47031%2010.25%203.80031%2010.58%203.80031%2010.99C3.80031%2011.53%204.25031%2012.23%204.75031%2012.45L11.4903%2015.45C11.8103%2015.59%2012.1803%2015.59%2012.5003%2015.45L19.2403%2012.45C19.7403%2012.23%2020.1903%2011.54%2020.1903%2010.99C20.1903%2010.58%2020.5203%2010.25%2020.9303%2010.25C21.3403%2010.25%2021.6703%2010.58%2021.6703%2010.99C21.6703%2012.11%2020.8703%2013.35%2019.8403%2013.81L13.1003%2016.81C12.7603%2016.96%2012.3803%2017.04%2012.0003%2017.04Z'%20fill='%23083C26'/%3e%3cpath%20d='M12.0003%2022C11.6203%2022%2011.2403%2021.92%2010.8903%2021.77L4.15031%2018.77C3.04031%2018.28%202.32031%2017.17%202.32031%2015.95C2.32031%2015.54%202.65031%2015.21%203.06031%2015.21C3.47031%2015.21%203.80031%2015.54%203.80031%2015.95C3.80031%2016.58%204.17031%2017.15%204.75031%2017.41L11.4903%2020.41C11.8103%2020.55%2012.1803%2020.55%2012.5003%2020.41L19.2403%2017.41C19.8103%2017.16%2020.1903%2016.58%2020.1903%2015.95C20.1903%2015.54%2020.5203%2015.21%2020.9303%2015.21C21.3403%2015.21%2021.6703%2015.54%2021.6703%2015.95C21.6703%2017.17%2020.9503%2018.27%2019.8403%2018.77L13.1003%2021.77C12.7603%2021.92%2012.3803%2022%2012.0003%2022Z'%20fill='%23083C26'/%3e%3c/svg%3e",Cyt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.299%202.85232L7.88065%201.32982C7.37898%201.10816%206.62065%201.10816%206.11898%201.32982L2.70065%202.85232C1.83732%203.23732%201.70898%203.76232%201.70898%204.04232C1.70898%204.32232%201.83732%204.84732%202.70065%205.23232L6.11898%206.75482C6.36982%206.86566%206.68482%206.92399%206.99982%206.92399C7.31482%206.92399%207.62982%206.86566%207.88065%206.75482L11.299%205.23232C12.1623%204.84732%2012.2907%204.32232%2012.2907%204.04232C12.2907%203.76232%2012.1682%203.23732%2011.299%202.85232Z'%20fill='%2367FFBD'/%3e%3cpath%20d='M7.00018%209.93984C6.77852%209.93984%206.55685%209.89317%206.35268%209.80567L2.42102%208.05567C1.82018%207.78734%201.35352%207.06984%201.35352%206.41067C1.35352%206.1715%201.54602%205.979%201.78518%205.979C2.02435%205.979%202.21685%206.1715%202.21685%206.41067C2.21685%206.72567%202.47935%207.134%202.77102%207.26234L6.70268%209.01234C6.88935%209.094%207.10518%209.094%207.29185%209.01234L11.2235%207.26234C11.5152%207.134%2011.7777%206.7315%2011.7777%206.41067C11.7777%206.1715%2011.9702%205.979%2012.2093%205.979C12.4485%205.979%2012.641%206.1715%2012.641%206.41067C12.641%207.064%2012.1743%207.78734%2011.5735%208.05567L7.64185%209.80567C7.44352%209.89317%207.22185%209.93984%207.00018%209.93984Z'%20fill='%2367FFBD'/%3e%3cpath%20d='M7.00018%2012.8334C6.77852%2012.8334%206.55685%2012.7867%206.35268%2012.6992L2.42102%2010.9492C1.77352%2010.6634%201.35352%2010.0159%201.35352%209.30423C1.35352%209.06506%201.54602%208.87256%201.78518%208.87256C2.02435%208.87256%202.21685%209.06506%202.21685%209.30423C2.21685%209.67173%202.43268%2010.0042%202.77102%2010.1559L6.70268%2011.9059C6.88935%2011.9876%207.10518%2011.9876%207.29185%2011.9059L11.2235%2010.1559C11.556%2010.0101%2011.7777%209.67173%2011.7777%209.30423C11.7777%209.06506%2011.9702%208.87256%2012.2093%208.87256C12.4485%208.87256%2012.641%209.06506%2012.641%209.30423C12.641%2010.0159%2012.221%2010.6576%2011.5735%2010.9492L7.64185%2012.6992C7.44352%2012.7867%207.22185%2012.8334%207.00018%2012.8334Z'%20fill='%2367FFBD'/%3e%3c/svg%3e",ske="data:image/webp;base64,UklGRjQFAABXRUJQVlA4WAoAAAAQAAAATwAATwAAQUxQSH0BAAABkFZtb91IHwRBEJRAMAQzmDCoGTQMXAaBYAiG8EEQBM3s9uLY2svPiJgAXC1pr410d7featkEC0u60weyJlljO83H1zSd3MwvZtaZ5GY+IW/zZPqkzHNo84lPneDLfGrLV8ndp79fo90X7HqB0pekDlP6otRBSl+WOkTpC1NHdF+6y2d3X/z+Ufbl9w/U1jN97/QA21vZQ8zvMAbKq5sHWV4oozB5lj3M8oxx2JPkgW6/1UhOAOKRmgApFE9AjeUAGAshHqxs0aQSzf6IprZoWo+GFo7/92U0Fk5v0bRHNHWPpqRoNolGwFgIHLFUIMWSALFQBMAZSQWALZL0GywO4mmJIz8Ti4L6DCWKgpfCGIg3cwz5HbQITryttp7pe9jXy/j0WO3Ax9LX6hioXIk6Asp1qBirXIWK0co1qBivfYWuuPSY7xBcnG0u23G9njM1xZSZszBj2sIZrAgm1syrrAhmT48L7NywpKQHR/BIgoVlK7V1+41sdU+CqwEAVlA4IJADAABwEwCdASpQAFAAPoU2lUelIyIhNbWt+KAQiWgAwcQmjtEXOZ5HT3EdLOAefDpgG8d/ufJgCf6jCvGt9C+wF+svVj9Cn9MGb35/r/3vvZgfMSDVHeAiajfoFCV6cakAkwXuHIdi1jVLDZWi77j8sJk+JjxDWiXlDvt6I8wpx4M78xMLipwjRr4qS7zgj/mcsZ7+N9mFpGVH+u8uucq/VUIgbo8haAD+9nv//1lX/+sXv//V1BzpNxdi//pSQKliFbd/die8+PJljk1dSETv/4Dv//V9v/6xe//9X4vt/T1CpqMx/9Jrs3+i7wjIfqVj0ir9/fLIHPFE/n+4kRR0tZ/6/Nz2DIp8r6foLt/8YWQ3TXVGe5Agwsl+1h/8vQHA/mhjtDMKMNJHVELwPr/sRxHahr2rUd5f6Jo2mSF/HB/3VcOqJOkapGgKidoRI6QH2gLTGlK1hC/jcfJbEmVE6ymGrd945Qw6B3neGhuFvVvX4SojZ6xzO/CzIbCO/2X7p7UPxPOEo2SxBD+I17Rl8Q6EuwFnKc2wK3x20D98b69igUaZM+cJyP9CbW270jv/PUK4CuwPXktb8oK+6kVs9P/jnHw//fuE2v1W91zgCuInucSU+hOVEXKMk+e1qYbdONQSmOug0bzt7gx94aJ6a0CQKuH90O03DvmSWJk1kGLJHXloJlj4rZLImdggYgr/kyRqAJ91d6EkOkYmBF7cPbmbx3ZK0RcjZLGBZpxXPO4VlfR3aSZqLHYMM4j0J5/PFZXvLhPP4zZbimGJ0rHCeDH2zPOAxPVxMPFX9je/PArcoYy2MF7utYELr0I0N16B0cFSuGM39Ya0jv+XoNZzMiRLJ94xOrAlE5mc9MLobRQb91AvrGdbFck8hQS5s6umsNJ/reb5eLgMGyBZOko+RT2uDpQ7eXjMuJdlVrdilTJxEMxui5E4H2R2+w30l9Ge4IJugTERWfY/dWK5IPAGneaeMvBupdYOkxAbZf+JDjYDkFw9MCWQ6qD9XvjxLBrzzvkWkVq9vYS1jjXxt52QWo/GoqTBhQfuTXxr5L/9+sehGnbJ7f8fVWUNUbjUW0j4N/qn7RyiWdXShQYKeh/FGLQSqLLqiVSu+XV8RIkoRpiXfBVFL3JChg1ifmXaGvCvGKfsiQ0f4wrAPxHL15eWF8EM9EQM/+XMNRXxz89P85wJOVelt87VZ+65wJOaz1aQyAA=",Syt="data:image/svg+xml,%3csvg%20width='14'%20height='10'%20viewBox='0%200%2014%2010'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.0572%204.79065C13.0572%205.66981%2012.3474%206.38537%2011.4753%206.38537C10.6034%206.38537%209.8961%205.66981%209.8961%204.79065C9.8961%203.90784%2010.6034%203.19229%2011.4753%203.19229C12.3455%203.19229%2013.0572%203.90911%2013.0572%204.79065ZM2.52608%203.19229C1.65388%203.19229%200.944177%203.90784%200.944177%204.79065C0.944177%205.66981%201.65388%206.38537%202.52608%206.38537C3.39561%206.38537%204.10532%205.66981%204.10532%204.79065C4.10532%203.90911%203.39561%203.19229%202.52608%203.19229ZM6.99882%200C5.71126%200%204.6618%201.0588%204.6618%202.36126C4.6618%203.66355%205.71016%204.72426%206.99882%204.72426C8.28795%204.72426%209.33648%203.66355%209.33648%202.36126C9.33726%201.0588%208.28779%200%206.99882%200ZM13.9998%209.63452C13.9998%208.1818%2012.865%207.00276%2011.473%207.00276C11.2247%207.00276%2010.9875%207.05216%2010.7619%207.12205C11.0592%207.72451%2011.2412%208.39639%2011.2412%209.1191V10H14L13.9998%209.63452ZM3.23516%207.12205C3.01027%207.05216%202.77548%207.00276%202.52718%207.00276C1.13323%207.00276%200%208.18387%200%209.63452V10H2.75584V9.1191C2.75584%208.39639%202.93892%207.72451%203.23516%207.12205ZM3.33495%2010H10.6621V9.16246C10.6621%207.06169%209.01746%205.35262%206.99882%205.35262C4.97689%205.35262%203.33511%207.06185%203.33511%209.16246L3.33495%2010Z'%20fill='%2367FFBD'/%3e%3c/svg%3e",Nyt="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%2011C8.75%2011%2011%208.75%2011%206C11%203.25%208.75%201%206%201C3.25%201%201%203.25%201%206C1%208.75%203.25%2011%206%2011Z'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6%204V6.5'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.99725%208H6.00174'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Ayt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.68583%202.96336C8.17833%202.81169%207.61833%202.71252%207%202.71252C4.20583%202.71252%201.9425%204.97586%201.9425%207.77002C1.9425%2010.57%204.20583%2012.8334%207%2012.8334C9.79416%2012.8334%2012.0575%2010.57%2012.0575%207.77586C12.0575%206.73752%2011.7425%205.76919%2011.2058%204.96419'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.40917%203.10335L7.72334%201.16669'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.40917%203.10333L7.44334%204.53833'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Wme="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.125%2019.5V12.75H9.375'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M21.375%2019.5H2.625'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.375%2019.5V8.25H14.625'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.875%203.75H14.625V19.5H19.875V3.75Z'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",xJ="data:image/svg+xml,%3csvg%20width='11'%20height='7'%20viewBox='0%200%2011%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.83097%200.791748L6.66431%204.00789C6.6074%204.06569%206.57869%204.09459%206.55322%204.11738C6.1419%204.48554%205.51967%204.48554%205.10835%204.11738C5.08288%204.09459%205.05417%204.06568%204.99726%204.00789C4.94036%203.95009%204.9119%203.92119%204.88643%203.8984C4.47511%203.53024%203.85288%203.53024%203.44156%203.8984C3.41609%203.92119%203.38764%203.9501%203.33073%204.00789L1.16406%206.20841M9.83097%200.791748L9.83073%204.04175M9.83097%200.791748H6.58073'%20stroke='%2334D399'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",gJ="data:image/svg+xml,%3csvg%20width='11'%20height='7'%20viewBox='0%200%2011%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.00496%206.41675L4.17163%203.2006C4.22854%203.14281%204.25725%203.1139%204.28271%203.09111C4.69404%202.72296%205.31627%202.72296%205.72759%203.09111C5.75306%203.1139%205.78177%203.14281%205.83868%203.20061C5.89558%203.2584%205.92404%203.28731%205.9495%203.3101C6.36083%203.67826%206.98306%203.67826%207.39438%203.3101C7.41984%203.28731%207.4483%203.2584%207.50521%203.2006L9.67188%201.00008M1.00496%206.41675L1.00521%203.16675M1.00496%206.41675L4.25521%206.41675'%20stroke='%23FB7184'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",jyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='22'%20viewBox='0%200%2021%2022'%20fill='none'%3e%3cpath%20d='M2.625%206.625H18.375'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M5.25%2011H15.75'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M8.75%2015.375H12.25'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Eyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='22'%20viewBox='0%200%2021%2022'%20fill='none'%3e%3cpath%20d='M2.625%206.625H18.375'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M5.25%2011H15.75'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M8.75%2015.375H12.25'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",EA="/assets/dextrabotIcon64x64-CGBWeHNW.png",_yt="/assets/telegramfilterIcon-D3R-nSo1.svg",kyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%3e%3cpath%20d='M10.5%2019.25C15.3325%2019.25%2019.25%2015.3325%2019.25%2010.5C19.25%205.66751%2015.3325%201.75%2010.5%201.75C5.66751%201.75%201.75%205.66751%201.75%2010.5C1.75%2015.3325%205.66751%2019.25%2010.5%2019.25Z'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.00039%202.625H7.87539C6.16914%207.735%206.16914%2013.265%207.87539%2018.375H7.00039'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.125%202.625C14.8313%207.735%2014.8313%2013.265%2013.125%2018.375'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.625%2014V13.125C7.735%2014.8313%2013.265%2014.8313%2018.375%2013.125V14'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.625%207.8749C7.735%206.16865%2013.265%206.16865%2018.375%207.8749'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",iE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='9'%20height='8'%20viewBox='0%200%209%208'%20fill='none'%3e%3cpath%20d='M4.5%200L0%208L9%208L4.5%200Z'%20fill='%233DB380'/%3e%3c/svg%3e",aE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='9'%20height='8'%20viewBox='0%200%209%208'%20fill='none'%3e%3cpath%20d='M4.5%208L9%200L0%202.0772e-08L4.5%208Z'%20fill='%23FF797C'/%3e%3c/svg%3e",E0="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.3726%207.16021L13.4726%206.10688C13.3059%205.90688%2013.1659%205.53355%2013.1659%205.26688V4.13355C13.1659%203.42688%2012.5859%202.84688%2011.8793%202.84688H10.7459C10.4793%202.84688%2010.0993%202.70688%209.89927%202.54021L8.84594%201.64021C8.38594%201.24688%207.6326%201.24688%207.1726%201.64021L6.10594%202.54021C5.90594%202.70688%205.5326%202.84688%205.26594%202.84688H4.1126C3.40594%202.84688%202.82594%203.42688%202.82594%204.13355V5.26688C2.82594%205.52688%202.6926%205.90021%202.52594%206.10021L1.62594%207.16021C1.23927%207.62688%201.23927%208.37355%201.62594%208.82688L2.52594%209.88688C2.6926%2010.0802%202.82594%2010.4602%202.82594%2010.7202V11.8602C2.82594%2012.5669%203.40594%2013.1469%204.1126%2013.1469H5.2726C5.5326%2013.1469%205.9126%2013.2869%206.1126%2013.4535L7.16594%2014.3535C7.62594%2014.7469%208.37927%2014.7469%208.83927%2014.3535L9.8926%2013.4535C10.0926%2013.2869%2010.4659%2013.1469%2010.7326%2013.1469H11.8659C12.5726%2013.1469%2013.1526%2012.5669%2013.1526%2011.8602V10.7269C13.1526%2010.4602%2013.2926%2010.0869%2013.4593%209.88688L14.3593%208.83355C14.7659%208.38022%2014.7659%207.62688%2014.3726%207.16021ZM7.49927%205.42022C7.49927%205.14688%207.72594%204.92022%207.99927%204.92022C8.2726%204.92022%208.49927%205.14688%208.49927%205.42022V8.64021C8.49927%208.91355%208.2726%209.14021%207.99927%209.14021C7.72594%209.14021%207.49927%208.91355%207.49927%208.64021V5.42022ZM7.99927%2011.2469C7.6326%2011.2469%207.3326%2010.9469%207.3326%2010.5802C7.3326%2010.2135%207.62594%209.91355%207.99927%209.91355C8.36594%209.91355%208.66594%2010.2135%208.66594%2010.5802C8.66594%2010.9469%208.3726%2011.2469%207.99927%2011.2469Z'%20fill='%23636363'/%3e%3c/svg%3e",Tyt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_257_8126)'%3e%3cpath%20d='M1.5%201C1.36739%201%201.24021%201.05268%201.14645%201.14645C1.05268%201.24021%201%201.36739%201%201.5V5.5C1%205.63261%200.947322%205.75979%200.853553%205.85355C0.759785%205.94732%200.632608%206%200.5%206C0.367392%206%200.240215%205.94732%200.146447%205.85355C0.0526784%205.75979%200%205.63261%200%205.5V1.5C0%201.10218%200.158035%200.720644%200.43934%200.43934C0.720644%200.158035%201.10218%200%201.5%200L5.5%200C5.63261%200%205.75979%200.0526784%205.85355%200.146447C5.94732%200.240215%206%200.367392%206%200.5C6%200.632608%205.94732%200.759785%205.85355%200.853553C5.75979%200.947322%205.63261%201%205.5%201H1.5ZM10%200.5C10%200.367392%2010.0527%200.240215%2010.1464%200.146447C10.2402%200.0526784%2010.3674%200%2010.5%200L14.5%200C14.8978%200%2015.2794%200.158035%2015.5607%200.43934C15.842%200.720644%2016%201.10218%2016%201.5V5.5C16%205.63261%2015.9473%205.75979%2015.8536%205.85355C15.7598%205.94732%2015.6326%206%2015.5%206C15.3674%206%2015.2402%205.94732%2015.1464%205.85355C15.0527%205.75979%2015%205.63261%2015%205.5V1.5C15%201.36739%2014.9473%201.24021%2014.8536%201.14645C14.7598%201.05268%2014.6326%201%2014.5%201H10.5C10.3674%201%2010.2402%200.947322%2010.1464%200.853553C10.0527%200.759785%2010%200.632608%2010%200.5ZM0.5%2010C0.632608%2010%200.759785%2010.0527%200.853553%2010.1464C0.947322%2010.2402%201%2010.3674%201%2010.5V14.5C1%2014.6326%201.05268%2014.7598%201.14645%2014.8536C1.24021%2014.9473%201.36739%2015%201.5%2015H5.5C5.63261%2015%205.75979%2015.0527%205.85355%2015.1464C5.94732%2015.2402%206%2015.3674%206%2015.5C6%2015.6326%205.94732%2015.7598%205.85355%2015.8536C5.75979%2015.9473%205.63261%2016%205.5%2016H1.5C1.10218%2016%200.720644%2015.842%200.43934%2015.5607C0.158035%2015.2794%200%2014.8978%200%2014.5L0%2010.5C0%2010.3674%200.0526784%2010.2402%200.146447%2010.1464C0.240215%2010.0527%200.367392%2010%200.5%2010ZM15.5%2010C15.6326%2010%2015.7598%2010.0527%2015.8536%2010.1464C15.9473%2010.2402%2016%2010.3674%2016%2010.5V14.5C16%2014.8978%2015.842%2015.2794%2015.5607%2015.5607C15.2794%2015.842%2014.8978%2016%2014.5%2016H10.5C10.3674%2016%2010.2402%2015.9473%2010.1464%2015.8536C10.0527%2015.7598%2010%2015.6326%2010%2015.5C10%2015.3674%2010.0527%2015.2402%2010.1464%2015.1464C10.2402%2015.0527%2010.3674%2015%2010.5%2015H14.5C14.6326%2015%2014.7598%2014.9473%2014.8536%2014.8536C14.9473%2014.7598%2015%2014.6326%2015%2014.5V10.5C15%2010.3674%2015.0527%2010.2402%2015.1464%2010.1464C15.2402%2010.0527%2015.3674%2010%2015.5%2010Z'%20fill='%23929292'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_257_8126'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Iyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%3e%3cpath%20d='M24%2011.9499C24%2019.8843%2019.1443%2022.4303%2016.5859%2020.1633C14.4801%2018.3148%2013.8535%2014.4087%2010.686%2014.0076C6.6657%2013.5019%206.31762%2018.8555%203.67223%2018.8555C0.591733%2018.8555%200%2014.3738%200%2012.0719C0%209.71772%200.661348%206.50904%203.28933%206.50904C6.35243%206.50904%206.52647%2011.0954%2010.3553%2010.8512C14.1668%2010.5897%2014.2364%205.81149%2016.7078%203.77119C18.8658%202.00989%2024%203.91069%2024%2011.9499Z'%20fill='%2397FCE4'/%3e%3c/svg%3e",Pyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%3e%3cpath%20d='M14.1663%201.75H6.83375C3.64875%201.75%201.75%203.64875%201.75%206.83375V14.1575C1.75%2017.3513%203.64875%2019.25%206.83375%2019.25H14.1575C17.3425%2019.25%2019.2412%2017.3513%2019.2412%2014.1663V6.83375C19.25%203.64875%2017.3513%201.75%2014.1663%201.75ZM15.0938%2010.7887C15.0938%2011.1475%2014.7963%2011.445%2014.4375%2011.445C14.0787%2011.445%2013.7812%2011.1475%2013.7812%2010.7887V8.14625L7.02625%2014.9013C6.895%2015.0325%206.72875%2015.0938%206.5625%2015.0938C6.39625%2015.0938%206.23%2015.0325%206.09875%2014.9013C5.845%2014.6475%205.845%2014.2275%206.09875%2013.9738L12.8537%207.21875H10.2113C9.8525%207.21875%209.555%206.92125%209.555%206.5625C9.555%206.20375%209.8525%205.90625%2010.2113%205.90625H14.4375C14.7963%205.90625%2015.0938%206.20375%2015.0938%206.5625V10.7887Z'%20fill='%2300FF91'/%3e%3c/svg%3e",Fyt="/assets/telegramModalIcon-CwWiyADO.png",ike="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M43.1198%2021.48L40.3998%2018.32C39.8798%2017.72%2039.4598%2016.6%2039.4598%2015.8V12.4C39.4598%2010.28%2037.7198%208.53999%2035.5998%208.53999H32.1998C31.4198%208.53999%2030.2798%208.12%2029.6798%207.59999L26.5198%204.88C25.1398%203.7%2022.8798%203.7%2021.4798%204.88L18.3398%207.61999C17.7398%208.12%2016.5998%208.53999%2015.8198%208.53999H12.3598C10.2398%208.53999%208.49977%2010.28%208.49977%2012.4V15.82C8.49977%2016.6%208.07977%2017.72%207.57977%2018.32L4.87977%2021.5C3.71977%2022.88%203.71977%2025.12%204.87977%2026.5L7.57977%2029.68C8.07977%2030.28%208.49977%2031.4%208.49977%2032.18V35.6C8.49977%2037.72%2010.2398%2039.46%2012.3598%2039.46H15.8198C16.5998%2039.46%2017.7398%2039.88%2018.3398%2040.4L21.4998%2043.12C22.8798%2044.3%2025.1398%2044.3%2026.5398%2043.12L29.6998%2040.4C30.2998%2039.88%2031.4198%2039.46%2032.2198%2039.46H35.6198C37.7398%2039.46%2039.4798%2037.72%2039.4798%2035.6V32.2C39.4798%2031.42%2039.8998%2030.28%2040.4198%2029.68L43.1398%2026.52C44.2998%2025.14%2044.2998%2022.86%2043.1198%2021.48ZM32.3198%2020.22L22.6598%2029.88C22.3798%2030.16%2021.9998%2030.32%2021.5998%2030.32C21.1998%2030.32%2020.8198%2030.16%2020.5398%2029.88L15.6998%2025.04C15.1198%2024.46%2015.1198%2023.5%2015.6998%2022.92C16.2798%2022.34%2017.2398%2022.34%2017.8198%2022.92L21.5998%2026.7L30.1998%2018.1C30.7798%2017.52%2031.7398%2017.52%2032.3198%2018.1C32.8998%2018.68%2032.8998%2019.64%2032.3198%2020.22Z'%20fill='%231DE674'/%3e%3c/svg%3e",ake="data:image/svg+xml,%3csvg%20width='21'%20height='22'%20viewBox='0%200%2021%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3765_9549)'%3e%3cpath%20d='M10.5%2021.5C16.299%2021.5%2021%2016.799%2021%2011C21%205.20101%2016.299%200.5%2010.5%200.5C4.70101%200.5%200%205.20101%200%2011C0%2016.799%204.70101%2021.5%2010.5%2021.5Z'%20fill='url(%23paint0_linear_3765_9549)'/%3e%3cpath%20d='M7.10742%2011.7675L8.35316%2015.2156C8.35316%2015.2156%208.50891%2015.5382%208.67568%2015.5382C8.84246%2015.5382%2011.323%2012.9576%2011.323%2012.9576L14.0814%207.62976L7.15187%2010.8775L7.10742%2011.7675Z'%20fill='%23C8DAEA'/%3e%3cpath%20d='M8.75895%2012.6519L8.51981%2015.1934C8.51981%2015.1934%208.41971%2015.9721%209.19829%2015.1934C9.97686%2014.4146%2010.7221%2013.8141%2010.7221%2013.8141'%20fill='%23A9C6D8'/%3e%3cpath%20d='M7.12957%2011.8906L4.56705%2011.0557C4.56705%2011.0557%204.2608%2010.9315%204.35941%2010.6497C4.37971%2010.5916%204.42066%2010.5422%204.54316%2010.4572C5.11095%2010.0614%2015.0524%206.4882%2015.0524%206.4882C15.0524%206.4882%2015.3331%206.39362%2015.4987%206.45653C15.5396%206.46921%2015.5765%206.49254%2015.6055%206.52413C15.6344%206.55572%2015.6545%206.59445%2015.6636%206.63634C15.6815%206.71034%2015.689%206.78647%2015.6858%206.86253C15.6851%206.92833%2015.6771%206.98932%2015.6711%207.08495C15.6105%208.06189%2013.7986%2015.3531%2013.7986%2015.3531C13.7986%2015.3531%2013.6901%2015.7797%2013.3017%2015.7944C13.2063%2015.7974%2013.1112%2015.7813%2013.0221%2015.7468C12.933%2015.7124%2012.8518%2015.6603%2012.7833%2015.5938C12.0211%2014.9382%209.38663%2013.1677%208.8045%2012.7783C8.79136%2012.7694%208.78031%2012.7577%208.77206%2012.7441C8.76382%2012.7305%208.75859%2012.7153%208.75672%2012.6996C8.74858%2012.6585%208.79321%2012.6077%208.79321%2012.6077C8.79321%2012.6077%2013.3805%208.53019%2013.5025%208.10214C13.512%208.06898%2013.4763%208.05262%2013.4283%208.06714C13.1237%208.17923%207.842%2011.5146%207.25907%2011.8828C7.21711%2011.8954%207.17276%2011.8981%207.12957%2011.8906Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_3765_9549'%20x1='10.5'%20y1='21.5'%20x2='10.5'%20y2='0.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231D93D2'/%3e%3cstop%20offset='1'%20stop-color='%2338B0E3'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_3765_9549'%3e%3crect%20width='21'%20height='21'%20fill='white'%20transform='translate(0%200.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",qme="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%201.5C4.8675%201.5%201.5%204.8675%201.5%209C1.5%2013.1325%204.8675%2016.5%209%2016.5C13.1325%2016.5%2016.5%2013.1325%2016.5%209C16.5%204.8675%2013.1325%201.5%209%201.5ZM12.585%207.275L8.3325%2011.5275C8.2275%2011.6325%208.085%2011.6925%207.935%2011.6925C7.785%2011.6925%207.6425%2011.6325%207.5375%2011.5275L5.415%209.405C5.1975%209.1875%205.1975%208.8275%205.415%208.61C5.6325%208.3925%205.9925%208.3925%206.21%208.61L7.935%2010.335L11.79%206.48C12.0075%206.2625%2012.3675%206.2625%2012.585%206.48C12.8025%206.6975%2012.8025%207.05%2012.585%207.275Z'%20fill='%231DE674'/%3e%3c/svg%3e",oke="/assets/basedLogoSvgIcon-C71QETXb.png",Oyt="/assets/variationalIcon-VFI-7A--.png",Myt="/assets/apexIcon-pUC7_jPm.png",Ryt="/assets/paradexIcon-gNYlng5D.jpg";function Lyt({open:e,setOpen:t,setGenModalOpen:n,setGenWalletSuccess:r,setGenWalletData:s,setShowPrivateKey:a}){return i.jsx(i.Fragment,{children:i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-[9999999999] font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-[9999999999] w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[300px] sm:w-[480px] h-max relative bg-[#252525] rounded-3xl py-4 text-white",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"text-center text-white text-xl sm:text-2xl font-semibold font-manrope leading-7",children:"Last Chance to Save Your Private Key"}),i.jsx("div",{className:"w-[248px] sm:w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:"You will not be able to recover it later."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsxs("div",{onClick:()=>{t(!1),r(!1),s([]),a(!1),ln.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#67ffbd",paddingLeft:"5px"},children:"The process is successful."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"340px",minWidth:"340px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"I Already Saved It"})]})]})]})})})})})]})})}const Dyt=()=>i.jsxs("div",{className:"w-full flex flex-col items-center justify-center h-full gap-4 font-manrope",children:[i.jsxs("div",{role:"status",className:"flex justify-center items-center w-full",children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-[48px] h-[48px] animate-spin text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),i.jsx("div",{className:"font-manrope font-medium text-sm sm:text-lg leading-5.5 text-gray-600",children:"Loading"})]}),Da=Ne.memo(Dyt),Byt=({loading:e,genWalletSuccess:t,genWalletData:n,showPrivateKey:r,genWalletName:s,setGenWalletName:a,errorMessage:o,setShowPrivateKey:l,setGenWalletData:c,setGenWalletSuccess:u,setErrorMessage:d,setLoading:f,handleListRequest:x,handlePageChange:g})=>{const{setSignModalOpen:v}=m.useContext(Qr),{address:w}=Jr(),C=async()=>{const I=window.localStorage.getItem("hyperToken");if(!I){v(!0);return}if(!s){d("Please enter a name.");return}f(!0),d("");const P=window.localStorage.getItem("hyperAddress");try{const F=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:w?w.toLowerCase():P,token:I,wallet_name:s})})).json();F.success?(c(F==null?void 0:F.wallet),u(!0),a(""),x(),g(1)):(console.log("An error has occurred. Please try again."),d(F==null?void 0:F.error_message))}catch(R){console.error("An error has occurred:",R.message),d(R==null?void 0:R.message)}finally{f(!1)}},N=()=>{l(I=>!I)};return i.jsx(i.Fragment,{children:e?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Da,{})}):t&&Object.keys(n).length>0?i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4",children:[i.jsx("div",{className:"w-full flex justify-center items-center",children:i.jsx("span",{className:"flex justify-center items-center w-[286px] sm:w-[480px] text-center text-white/60 text-[16px] leading-5 font-medium font-['Inter'] tracking-tight",children:"Please copy the private key below and store it in a secure location. This private key will not be shown again."})}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-4 py-4 text-white w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Label"}),i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none",children:n==null?void 0:n.wallet_name})]}),i.jsx("div",{className:"w-full h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2 w-[286px] sm:w-[400px]",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Address"}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none break-all",children:n==null?void 0:n.address}),i.jsx("img",{onClick:I=>{I.stopPropagation(),navigator.clipboard.writeText(n==null?void 0:n.address),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]}),i.jsx("div",{className:"w-full h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Private Key"}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none max-w-[280px] sm:max-w-[380px] break-all",children:r?n==null?void 0:n.private_key:"••••••••••••••••••"}),i.jsx("img",{onClick:I=>{I.stopPropagation(),navigator.clipboard.writeText(n==null?void 0:n.private_key),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"}),i.jsx("span",{onClick:()=>{N()},className:"p-1 rounded cursor-pointer",children:r?i.jsx(Cet,{className:"w-4 h-4"}):i.jsx(vet,{className:"w-4 h-4"})})]})]})]})]}):i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 w-full -mt-2",children:[i.jsx("div",{className:"text-white text-sm font-medium leading-normal tracking-[-0.14px] w-full",children:"Enter a name for your follower wallet"}),i.jsx("div",{className:"w-full",children:i.jsx("input",{type:"text",value:s,onChange:I=>a(I.target.value),placeholder:"Wallet Name",className:"px-4 py-2 focus:outline-none focus:ring-0 w-full h-10 bg-[#1b1b1b] rounded-xl border border-[#303030] text-white text-sm font-medium font-['Inter'] leading-[8px] placeholder:text-[14px] placeholder:font-medium placeholder:tracking-[-0.28px] placeholder:leading-[8px] placeholder:font-inter focus:placeholder:text-white"})}),i.jsx("button",{onClick:()=>{C()},disabled:e,className:"w-full h-10 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] focus:ring-0 focus:outline-none justify-center items-center gap-1.5 inline-flex mt-2.5",children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Generate"})}),o&&i.jsxs("div",{className:"mt-2 w-full h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:o})]})]})})},$yt=({agentWalletData:e,setAgentWalletData:t,agentWalletName:n,setAgentWalletName:r,errorAgentMessage:s,setErrorAgentMessage:a,loadingAgent:o,setLoadingAgent:l,handleListRequest:c,handlePageChange:u,agentWalletAddress:d,setAgentWalletAddress:f,agentWalletPkey:x,setAgentWalletPkey:g})=>{const{setSignModalOpen:v}=m.useContext(Qr),{address:w}=Jr(),C=async()=>{const N=window.localStorage.getItem("hyperToken");if(!N){v(!0);return}if(!n||!d||!x){n?d?x||a("Please enter the agent wallet private key."):a("Please enter the main public address."):a("Please enter a name.");return}l(!0),a("");const I=window.localStorage.getItem("hyperAddress");try{const R=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:w?w.toLowerCase():I,token:N,name:n,connet_wallet_address:d,agent_wallet_pkey:x})})).json();R.success?(t(R==null?void 0:R.wallet),r(""),c(),u(1)):(console.log("An error has occurred. Please try again."),a(R==null?void 0:R.error_message))}catch(P){console.error("An error has occurred:",P.message),a(P==null?void 0:P.message)}finally{l(!1)}};return i.jsx(i.Fragment,{children:o?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Da,{})}):Object.keys(e).length>0?i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4",children:[i.jsx("div",{className:"w-full flex justify-center items-center",children:i.jsx("span",{className:"flex justify-center items-center w-[400px] text-center text-white/60 text-[16px] leading-5 font-medium font-manrope tracking-tight",children:"Please copy the private key below and store it in a secure location. This private key will not be shown again."})}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-4 p-4 text-white",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Label"}),i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none",children:e==null?void 0:e.wallet_name})]}),i.jsx("div",{className:"w-[440px] h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Address"}),i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none",children:e==null?void 0:e.address})})]}),i.jsx("div",{className:"w-[440px] h-px bg-[#353535]"})]})]}):i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2",children:[i.jsx("div",{className:"font-bold text-white",children:"Manually add api & secret key"}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2",children:[i.jsx("input",{type:"text",value:n,onChange:N=>r(N.target.value),placeholder:"Wallet Name",className:"px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white"}),i.jsx("input",{type:"text",value:d,onChange:N=>f(N.target.value),placeholder:"Main Public Address",className:"px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white"}),i.jsx("input",{type:"text",value:x,onChange:N=>g(N.target.value),placeholder:"Agent Wallet Private Key",className:"px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white"})]}),i.jsxs("button",{onClick:()=>{C()},disabled:o,className:"w-[285px] h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Connect"})]}),s&&i.jsx("p",{className:"mt-2 text-sm text-red-500",children:s})]})})},lke="6.15.0";function Uyt(e,t,n){const r=t.split("|").map(a=>a.trim());for(let a=0;a<r.length;a++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const s=new Error(`invalid value for type ${t}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${n}`,s.value=e,s}async function Su(e){const t=Object.keys(e);return(await Promise.all(t.map(r=>Promise.resolve(e[r])))).reduce((r,s,a)=>(r[t[a]]=s,r),{})}function Rs(e,t,n){for(let r in t){let s=t[r];const a=n?n[r]:null;a&&Uyt(s,a,r),Object.defineProperty(e,r,{enumerable:!0,value:s,writable:!1})}}function OC(e,t){if(e==null)return"null";if(t==null&&(t=new Set),typeof e=="object"){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(n=>OC(n,t)).join(", ")+" ]";if(e instanceof Uint8Array){const n="0123456789abcdef";let r="0x";for(let s=0;s<e.length;s++)r+=n[e[s]>>4],r+=n[e[s]&15];return r}if(typeof e=="object"&&typeof e.toJSON=="function")return OC(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(r=>`${OC(r,t)}: ${OC(e[r],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Zc(e,t){return e&&e.code===t}function rae(e){return Zc(e,"CALL_EXCEPTION")}function Eo(e,t,n){let r=e;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${OC(n)}`);for(const o in n){if(o==="shortMessage")continue;const l=n[o];a.push(o+"="+OC(l))}}a.push(`code=${t}`),a.push(`version=${lke}`),a.length&&(e+=" ("+a.join(", ")+")")}let s;switch(t){case"INVALID_ARGUMENT":s=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(e);break;default:s=new Error(e)}return Rs(s,{code:t}),n&&Object.assign(s,n),s.shortMessage==null&&Rs(s,{shortMessage:r}),s}function Mr(e,t,n,r){if(!e)throw Eo(t,n,r)}function Cn(e,t,n,r){Mr(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function cke(e,t,n){n==null&&(n=""),n&&(n=": "+n),Mr(e>=t,"missing argument"+n,"MISSING_ARGUMENT",{count:e,expectedCount:t}),Mr(e<=t,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}const zyt=["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test".normalize(t)!=="test")throw new Error("bad");if(t==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");e.push(t)}catch{}return e},[]);function uke(e){Mr(zyt.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function l5(e,t,n){if(n==null&&(n=""),e!==t){let r=n,s="new";n&&(r+=".",s+=" "+n),Mr(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function dke(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if(typeof e=="string"&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((e.length-2)/2);let s=2;for(let a=0;a<r.length;a++)r[a]=parseInt(e.substring(s,s+2),16),s+=2;return r}Cn(!1,"invalid BytesLike value",t||"value",e)}function fs(e,t){return dke(e,t,!1)}function Jc(e,t){return dke(e,t,!0)}function co(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t=="number"&&e.length!==2+2*t||t===!0&&e.length%2!==0)}function kB(e){return co(e,!0)||e instanceof Uint8Array}const Gme="0123456789abcdef";function qr(e){const t=fs(e);let n="0x";for(let r=0;r<t.length;r++){const s=t[r];n+=Gme[(s&240)>>4]+Gme[s&15]}return n}function Ra(e){return"0x"+e.map(t=>qr(t).substring(2)).join("")}function t4(e){return co(e,!0)?(e.length-2)/2:fs(e).length}function go(e,t,n){const r=fs(e);return n!=null&&n>r.length&&Mr(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),qr(r.slice(t??0,n??r.length))}function fke(e,t,n){const r=fs(e);Mr(t>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:t,offset:t+1});const s=new Uint8Array(t);return s.fill(0),n?s.set(r,t-r.length):s.set(r,0),qr(s)}function i1(e,t){return fke(e,t,!0)}function Hyt(e,t){return fke(e,t,!1)}const TB=BigInt(0),nm=BigInt(1),bJ=9007199254740991;function Vyt(e,t){const n=IB(e,"value"),r=BigInt(Li(t,"width"));if(Mr(n>>r===TB,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-nm){const s=(nm<<r)-nm;return-((~n&s)+nm)}return n}function hke(e,t){let n=Ns(e,"value");const r=BigInt(Li(t,"width")),s=nm<<r-nm;if(n<TB){n=-n,Mr(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});const a=(nm<<r)-nm;return(~n&a)+nm}else Mr(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return n}function fj(e,t){const n=IB(e,"value"),r=BigInt(Li(t,"bits"));return n&(nm<<r)-nm}function Ns(e,t){switch(typeof e){case"bigint":return e;case"number":return Cn(Number.isInteger(e),"underflow",t||"value",e),Cn(e>=-9007199254740991&&e<=bJ,"overflow",t||"value",e),BigInt(e);case"string":try{if(e==="")throw new Error("empty string");return e[0]==="-"&&e[1]!=="-"?-BigInt(e.substring(1)):BigInt(e)}catch(n){Cn(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}Cn(!1,"invalid BigNumberish value",t||"value",e)}function IB(e,t){const n=Ns(e,t);return Mr(n>=TB,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const Kme="0123456789abcdef";function PB(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=Kme[n>>4],t+=Kme[n&15];return BigInt(t)}return Ns(e)}function Li(e,t){switch(typeof e){case"bigint":return Cn(e>=-9007199254740991&&e<=bJ,"overflow",t||"value",e),Number(e);case"number":return Cn(Number.isInteger(e),"underflow",t||"value",e),Cn(e>=-9007199254740991&&e<=bJ,"overflow",t||"value",e),e;case"string":try{if(e==="")throw new Error("empty string");return Li(BigInt(e),t)}catch(n){Cn(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}Cn(!1,"invalid numeric value",t||"value",e)}function Wyt(e){return Li(PB(e))}function a1(e,t){let r=IB(e,"value").toString(16);if(t==null)r.length%2&&(r="0"+r);else{const s=Li(t,"width");for(Mr(s*2>=r.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});r.length<s*2;)r="0"+r}return"0x"+r}function sl(e){const t=IB(e,"value");if(t===TB)return new Uint8Array([]);let n=t.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let s=0;s<r.length;s++){const a=s*2;r[s]=parseInt(n.substring(a,a+2),16)}return r}function Jp(e){let t=qr(kB(e)?e:sl(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return t===""&&(t="0"),"0x"+t}const mM="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let WI=null;function qyt(e){if(WI==null){WI={};for(let n=0;n<mM.length;n++)WI[mM[n]]=BigInt(n)}const t=WI[e];return Cn(t!=null,"invalid base58 value","letter",e),t}const Gyt=BigInt(0),yJ=BigInt(58);function pke(e){const t=fs(e);let n=PB(t),r="";for(;n;)r=mM[Number(n%yJ)]+r,n/=yJ;for(let s=0;s<t.length&&!t[s];s++)r=mM[0]+r;return r}function Kyt(e){let t=Gyt;for(let n=0;n<e.length;n++)t*=yJ,t+=qyt(e[n]);return t}function Yyt(e){e=atob(e);const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return fs(t)}function Xyt(e){const t=fs(e);let n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n)}var P4;class mke{constructor(t,n,r){Bn(this,"filter");Bn(this,"emitter");Ln(this,P4);Wt(this,P4,n),Rs(this,{emitter:t,filter:r})}async removeListener(){Ue(this,P4)!=null&&await this.emitter.off(this.filter,Ue(this,P4))}}P4=new WeakMap;function Qyt(e,t,n,r,s){Cn(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",n)}function xke(e,t,n,r,s){if(e==="BAD_PREFIX"||e==="UNEXPECTED_CONTINUE"){let a=0;for(let o=t+1;o<n.length&&n[o]>>6===2;o++)a++;return a}return e==="OVERRUN"?n.length-t-1:0}function Zyt(e,t,n,r,s){return e==="OVERLONG"?(Cn(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),xke(e,t,n))}const Jyt=Object.freeze({error:Qyt,ignore:xke,replace:Zyt});function e2t(e,t){t==null&&(t=Jyt.error);const n=fs(e,"bytes"),r=[];let s=0;for(;s<n.length;){const a=n[s++];if(!(a>>7)){r.push(a);continue}let o=null,l=null;if((a&224)===192)o=1,l=127;else if((a&240)===224)o=2,l=2047;else if((a&248)===240)o=3,l=65535;else{(a&192)===128?s+=t("UNEXPECTED_CONTINUE",s-1,n,r):s+=t("BAD_PREFIX",s-1,n,r);continue}if(s-1+o>=n.length){s+=t("OVERRUN",s-1,n,r);continue}let c=a&(1<<8-o-1)-1;for(let u=0;u<o;u++){let d=n[s];if((d&192)!=128){s+=t("MISSING_CONTINUE",s,n,r),c=null;break}c=c<<6|d&63,s++}if(c!==null){if(c>1114111){s+=t("OUT_OF_RANGE",s-1-o,n,r,c);continue}if(c>=55296&&c<=57343){s+=t("UTF16_SURROGATE",s-1-o,n,r,c);continue}if(c<=l){s+=t("OVERLONG",s-1-o,n,r,c);continue}r.push(c)}}return r}function ud(e,t){Cn(typeof e=="string","invalid string value","str",e),t!=null&&(uke(t),e=e.normalize(t));let n=[];for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);if(s<128)n.push(s);else if(s<2048)n.push(s>>6|192),n.push(s&63|128);else if((s&64512)==55296){r++;const a=e.charCodeAt(r);Cn(r<e.length&&(a&64512)===56320,"invalid surrogate pair","str",e);const o=65536+((s&1023)<<10)+(a&1023);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(s&63|128)}return new Uint8Array(n)}function t2t(e){return e.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function xM(e,t){return t2t(e2t(e,t))}function gke(e){async function t(n,r){Mr(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const s=n.url.split(":")[0].toLowerCase();Mr(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),Mr(s==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a=null;const o=new AbortController,l=setTimeout(()=>{a=Eo("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{a=Eo("request cancelled","CANCELLED"),o.abort()});const c=Object.assign({},e,{method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:o.signal});let u;try{u=await fetch(n.url,c)}catch(g){throw clearTimeout(l),a||g}clearTimeout(l);const d={};u.headers.forEach((g,v)=>{d[v.toLowerCase()]=g});const f=await u.arrayBuffer(),x=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:d,body:x}}return t}const n2t=12,r2t=250;let Yme=gke();const s2t=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),i2t=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let IH=!1;async function bke(e,t){try{const n=e.match(s2t);if(!n)throw new Error("invalid data");return new Ay(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Yyt(n[3]):o2t(n[3]))}catch{return new Ay(599,"BAD REQUEST (invalid data: URI)",{},null,new Hy(e))}}function yke(e){async function t(n,r){try{const s=n.match(i2t);if(!s)throw new Error("invalid link");return new Hy(`${e}${s[2]}`)}catch{return new Ay(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Hy(n))}}return t}const qI={data:bke,ipfs:yke("https://gateway.ipfs.io/ipfs/")},vke=new WeakMap;var bw,qb;class a2t{constructor(t){Ln(this,bw);Ln(this,qb);Wt(this,bw,[]),Wt(this,qb,!1),vke.set(t,()=>{if(!Ue(this,qb)){Wt(this,qb,!0);for(const n of Ue(this,bw))setTimeout(()=>{n()},0);Wt(this,bw,[])}})}addListener(t){Mr(!Ue(this,qb),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),Ue(this,bw).push(t)}get cancelled(){return Ue(this,qb)}checkSignal(){Mr(!this.cancelled,"cancelled","CANCELLED",{})}}bw=new WeakMap,qb=new WeakMap;function GI(e){if(e==null)throw new Error("missing signal; should not happen");return e.checkSignal(),e}var F4,O4,Hp,gg,M4,R4,vc,If,bg,yw,vw,ww,o0,Vp,Gb,Cw,hj;const cD=class cD{constructor(t){Ln(this,Cw);Ln(this,F4);Ln(this,O4);Ln(this,Hp);Ln(this,gg);Ln(this,M4);Ln(this,R4);Ln(this,vc);Ln(this,If);Ln(this,bg);Ln(this,yw);Ln(this,vw);Ln(this,ww);Ln(this,o0);Ln(this,Vp);Ln(this,Gb);Wt(this,R4,String(t)),Wt(this,F4,!1),Wt(this,O4,!0),Wt(this,Hp,{}),Wt(this,gg,""),Wt(this,M4,3e5),Wt(this,Vp,{slotInterval:r2t,maxAttempts:n2t}),Wt(this,Gb,null)}get url(){return Ue(this,R4)}set url(t){Wt(this,R4,String(t))}get body(){return Ue(this,vc)==null?null:new Uint8Array(Ue(this,vc))}set body(t){if(t==null)Wt(this,vc,void 0),Wt(this,If,void 0);else if(typeof t=="string")Wt(this,vc,ud(t)),Wt(this,If,"text/plain");else if(t instanceof Uint8Array)Wt(this,vc,t),Wt(this,If,"application/octet-stream");else if(typeof t=="object")Wt(this,vc,ud(JSON.stringify(t))),Wt(this,If,"application/json");else throw new Error("invalid body")}hasBody(){return Ue(this,vc)!=null}get method(){return Ue(this,gg)?Ue(this,gg):this.hasBody()?"POST":"GET"}set method(t){t==null&&(t=""),Wt(this,gg,String(t).toUpperCase())}get headers(){const t=Object.assign({},Ue(this,Hp));return Ue(this,bg)&&(t.authorization=`Basic ${Xyt(ud(Ue(this,bg)))}`),this.allowGzip&&(t["accept-encoding"]="gzip"),t["content-type"]==null&&Ue(this,If)&&(t["content-type"]=Ue(this,If)),this.body&&(t["content-length"]=String(this.body.length)),t}getHeader(t){return this.headers[t.toLowerCase()]}setHeader(t,n){Ue(this,Hp)[String(t).toLowerCase()]=String(n)}clearHeaders(){Wt(this,Hp,{})}[Symbol.iterator](){const t=this.headers,n=Object.keys(t);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return Ue(this,bg)||null}setCredentials(t,n){Cn(!t.match(/:/),"invalid basic authentication username","username","[REDACTED]"),Wt(this,bg,`${t}:${n}`)}get allowGzip(){return Ue(this,O4)}set allowGzip(t){Wt(this,O4,!!t)}get allowInsecureAuthentication(){return!!Ue(this,F4)}set allowInsecureAuthentication(t){Wt(this,F4,!!t)}get timeout(){return Ue(this,M4)}set timeout(t){Cn(t>=0,"timeout must be non-zero","timeout",t),Wt(this,M4,t)}get preflightFunc(){return Ue(this,yw)||null}set preflightFunc(t){Wt(this,yw,t)}get processFunc(){return Ue(this,vw)||null}set processFunc(t){Wt(this,vw,t)}get retryFunc(){return Ue(this,ww)||null}set retryFunc(t){Wt(this,ww,t)}get getUrlFunc(){return Ue(this,Gb)||Yme}set getUrlFunc(t){Wt(this,Gb,t)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${Ue(this,vc)?qr(Ue(this,vc)):"null"}>`}setThrottleParams(t){t.slotInterval!=null&&(Ue(this,Vp).slotInterval=t.slotInterval),t.maxAttempts!=null&&(Ue(this,Vp).maxAttempts=t.maxAttempts)}send(){return Mr(Ue(this,o0)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),Wt(this,o0,new a2t(this)),xr(this,Cw,hj).call(this,0,Xme()+this.timeout,0,this,new Ay(0,"",{},null,this))}cancel(){Mr(Ue(this,o0)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const t=vke.get(this);if(!t)throw new Error("missing signal; should not happen");t()}redirect(t){const n=this.url.split(":")[0].toLowerCase(),r=t.split(":")[0].toLowerCase();Mr(this.method==="GET"&&(n!=="https"||r!=="http")&&t.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(t)})`});const s=new cD(t);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,Wt(s,Hp,Object.assign({},Ue(this,Hp))),Ue(this,vc)&&Wt(s,vc,new Uint8Array(Ue(this,vc))),Wt(s,If,Ue(this,If)),s}clone(){const t=new cD(this.url);return Wt(t,gg,Ue(this,gg)),Ue(this,vc)&&Wt(t,vc,Ue(this,vc)),Wt(t,If,Ue(this,If)),Wt(t,Hp,Object.assign({},Ue(this,Hp))),Wt(t,bg,Ue(this,bg)),this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),Wt(t,yw,Ue(this,yw)),Wt(t,vw,Ue(this,vw)),Wt(t,ww,Ue(this,ww)),Wt(t,Vp,Object.assign({},Ue(this,Vp))),Wt(t,Gb,Ue(this,Gb)),t}static lockConfig(){IH=!0}static getGateway(t){return qI[t.toLowerCase()]||null}static registerGateway(t,n){if(t=t.toLowerCase(),t==="http"||t==="https")throw new Error(`cannot intercept ${t}; use registerGetUrl`);if(IH)throw new Error("gateways locked");qI[t]=n}static registerGetUrl(t){if(IH)throw new Error("gateways locked");Yme=t}static createGetUrlFunc(t){return gke(t)}static createDataGateway(){return bke}static createIpfsGatewayFunc(t){return yke(t)}};F4=new WeakMap,O4=new WeakMap,Hp=new WeakMap,gg=new WeakMap,M4=new WeakMap,R4=new WeakMap,vc=new WeakMap,If=new WeakMap,bg=new WeakMap,yw=new WeakMap,vw=new WeakMap,ww=new WeakMap,o0=new WeakMap,Vp=new WeakMap,Gb=new WeakMap,Cw=new WeakSet,hj=async function(t,n,r,s,a){var d,f,x;if(t>=Ue(this,Vp).maxAttempts)return a.makeServerError("exceeded maximum retry limit");Mr(Xme()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await l2t(r);let o=this.clone();const l=(o.url.split(":")[0]||"").toLowerCase();if(l in qI){const g=await qI[l](o.url,GI(Ue(s,o0)));if(g instanceof Ay){let v=g;if(this.processFunc){GI(Ue(s,o0));try{v=await this.processFunc(o,v)}catch(w){(w.throttle==null||typeof w.stall!="number")&&v.makeServerError("error in post-processing function",w).assertOk()}}return v}o=g}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,GI(Ue(s,o0)));let u=new Ay(c.statusCode,c.statusMessage,c.headers,c.body,s);if(u.statusCode===301||u.statusCode===302){try{const g=u.headers.location||"";return xr(d=o.redirect(g),Cw,hj).call(d,t+1,n,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,t))){const g=u.headers["retry-after"];let v=Ue(this,Vp).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(v=parseInt(g)),xr(f=o.clone(),Cw,hj).call(f,t+1,n,v,s,u)}if(this.processFunc){GI(Ue(s,o0));try{u=await this.processFunc(o,u)}catch(g){(g.throttle==null||typeof g.stall!="number")&&u.makeServerError("error in post-processing function",g).assertOk();let v=Ue(this,Vp).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return g.stall>=0&&(v=g.stall),xr(x=o.clone(),Cw,hj).call(x,t+1,n,v,s,u)}}return u};let Hy=cD;var Q_,Z_,J_,Pf,L4,Sw;const Vue=class Vue{constructor(t,n,r,s,a){Ln(this,Q_);Ln(this,Z_);Ln(this,J_);Ln(this,Pf);Ln(this,L4);Ln(this,Sw);Wt(this,Q_,t),Wt(this,Z_,n),Wt(this,J_,Object.keys(r).reduce((o,l)=>(o[l.toLowerCase()]=String(r[l]),o),{})),Wt(this,Pf,s==null?null:new Uint8Array(s)),Wt(this,L4,a||null),Wt(this,Sw,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${Ue(this,Pf)?qr(Ue(this,Pf)):"null"}>`}get statusCode(){return Ue(this,Q_)}get statusMessage(){return Ue(this,Z_)}get headers(){return Object.assign({},Ue(this,J_))}get body(){return Ue(this,Pf)==null?null:new Uint8Array(Ue(this,Pf))}get bodyText(){try{return Ue(this,Pf)==null?"":xM(Ue(this,Pf))}catch{Mr(!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{Mr(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const t=this.headers,n=Object.keys(t);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(t,n){let r;t?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${t})`:(t=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${t})`);const s=new Vue(599,r,this.headers,this.body,Ue(this,L4)||void 0);return Wt(s,Sw,{message:t,error:n}),s}throwThrottleError(t,n){n==null?n=-1:Cn(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(t||"throttling requests");throw Rs(r,{stall:n,throttle:!0}),r}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return Ue(this,Pf)!=null}get request(){return Ue(this,L4)}ok(){return Ue(this,Sw).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:t,error:n}=Ue(this,Sw);t===""&&(t=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let s=null;try{Ue(this,Pf)&&(s=xM(Ue(this,Pf)))}catch{}Mr(!1,t,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Q_=new WeakMap,Z_=new WeakMap,J_=new WeakMap,Pf=new WeakMap,L4=new WeakMap,Sw=new WeakMap;let Ay=Vue;function Xme(){return new Date().getTime()}function o2t(e){return ud(e.replace(/%([0-9a-f][0-9a-f])/gi,(t,n)=>String.fromCharCode(parseInt(n,16))))}function l2t(e){return new Promise(t=>setTimeout(t,e))}function c2t(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function Qme(e,t,n){let r=0;for(let s=0;s<n;s++)r=r*256+e[t+s];return r}function Zme(e,t,n,r){const s=[];for(;n<t+1+r;){const a=wke(e,n);s.push(a.result),n+=a.consumed,Mr(n<=t+1+r,"child data too short","BUFFER_OVERRUN",{buffer:e,length:r,offset:t})}return{consumed:1+r,result:s}}function wke(e,t){Mr(e.length!==0,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const n=r=>{Mr(r<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:r})};if(e[t]>=248){const r=e[t]-247;n(t+1+r);const s=Qme(e,t+1,r);return n(t+1+r+s),Zme(e,t,t+1+r,r+s)}else if(e[t]>=192){const r=e[t]-192;return n(t+1+r),Zme(e,t,t+1,r)}else if(e[t]>=184){const r=e[t]-183;n(t+1+r);const s=Qme(e,t+1,r);n(t+1+r+s);const a=qr(e.slice(t+1+r,t+1+r+s));return{consumed:1+r+s,result:a}}else if(e[t]>=128){const r=e[t]-128;n(t+1+r);const s=qr(e.slice(t+1,t+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:c2t(e[t])}}function Dk(e){const t=fs(e,"data"),n=wke(t,0);return Cn(n.consumed===t.length,"unexpected junk after rlp payload","data",e),n.result}function Jme(e){const t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function Cke(e){if(Array.isArray(e)){let r=[];if(e.forEach(function(a){r=r.concat(Cke(a))}),r.length<=55)return r.unshift(192+r.length),r;const s=Jme(r.length);return s.unshift(247+s.length),s.concat(r)}const t=Array.prototype.slice.call(fs(e,"object"));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const n=Jme(t.length);return n.unshift(183+n.length),n.concat(t)}const e0e="0123456789abcdef";function o1(e){let t="0x";for(const n of Cke(e))t+=e0e[n>>4],t+=e0e[n&15];return t}function u2t(e){const t=fs(e,"randomBytes");t[6]=t[6]&15|64,t[8]=t[8]&63|128;const n=qr(t);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join("-")}const id=32,vJ=new Uint8Array(id),d2t=["then"],KI={},Ske=new WeakMap;function Ov(e){return Ske.get(e)}function t0e(e,t){Ske.set(e,t)}function w7(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw n.error=t,n}function wJ(e,t,n){return e.indexOf(null)>=0?t.map((r,s)=>r instanceof gM?wJ(Ov(r),r,n):r):e.reduce((r,s,a)=>{let o=t.getValue(s);return s in r||(n&&o instanceof gM&&(o=wJ(Ov(o),o,n)),r[s]=o),r},{})}var D4,$g;let gM=($g=class extends Array{constructor(...n){const r=n[0];let s=n[1],a=(n[2]||[]).slice(),o=!0;r!==KI&&(s=n,a=[],o=!1);super(s.length);Ln(this,D4);s.forEach((u,d)=>{this[d]=u});const l=a.reduce((u,d)=>(typeof d=="string"&&u.set(d,(u.get(d)||0)+1),u),new Map);if(t0e(this,Object.freeze(s.map((u,d)=>{const f=a[d];return f!=null&&l.get(f)===1?f:null}))),Wt(this,D4,[]),Ue(this,D4)==null&&Ue(this,D4),!o)return;Object.freeze(this);const c=new Proxy(this,{get:(u,d,f)=>{if(typeof d=="string"){if(d.match(/^[0-9]+$/)){const g=Li(d,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const v=u[g];return v instanceof Error&&w7(`index ${g}`,v),v}if(d2t.indexOf(d)>=0)return Reflect.get(u,d,f);const x=u[d];if(x instanceof Function)return function(...g){return x.apply(this===f?u:this,g)};if(!(d in u))return u.getValue.apply(this===f?u:this,[d])}return Reflect.get(u,d,f)}});return t0e(c,Ov(this)),c}toArray(n){const r=[];return this.forEach((s,a)=>{s instanceof Error&&w7(`index ${a}`,s),n&&s instanceof $g&&(s=s.toArray(n)),r.push(s)}),r}toObject(n){const r=Ov(this);return r.reduce((s,a,o)=>(Mr(a!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),wJ(r,this,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 s=Ov(this),a=[],o=[];for(let l=n;l<r;l++)a.push(this[l]),o.push(s[l]);return new $g(KI,a,o)}filter(n,r){const s=Ov(this),a=[],o=[];for(let l=0;l<this.length;l++){const c=this[l];c instanceof Error&&w7(`index ${l}`,c),n.call(r,c,l,this)&&(a.push(c),o.push(s[l]))}return new $g(KI,a,o)}map(n,r){const s=[];for(let a=0;a<this.length;a++){const o=this[a];o instanceof Error&&w7(`index ${a}`,o),s.push(n.call(r,o,a,this))}return s}getValue(n){const r=Ov(this).indexOf(n);if(r===-1)return;const s=this[r];return s instanceof Error&&w7(`property ${JSON.stringify(n)}`,s.error),s}static fromItems(n,r){return new $g(KI,n,r)}},D4=new WeakMap,$g);function n0e(e){let t=sl(e);return Mr(t.length<=id,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:id,offset:t.length}),t.length!==id&&(t=Jc(Ra([vJ.slice(t.length%id),t]))),t}class S1{constructor(t,n,r,s){Bn(this,"name");Bn(this,"type");Bn(this,"localName");Bn(this,"dynamic");Rs(this,{name:t,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,n){Cn(!1,t,this.localName,n)}}var yg,Nw,B4,qF;class CJ{constructor(){Ln(this,B4);Ln(this,yg);Ln(this,Nw);Wt(this,yg,[]),Wt(this,Nw,0)}get data(){return Ra(Ue(this,yg))}get length(){return Ue(this,Nw)}appendWriter(t){return xr(this,B4,qF).call(this,Jc(t.data))}writeBytes(t){let n=Jc(t);const r=n.length%id;return r&&(n=Jc(Ra([n,vJ.slice(r)]))),xr(this,B4,qF).call(this,n)}writeValue(t){return xr(this,B4,qF).call(this,n0e(t))}writeUpdatableValue(){const t=Ue(this,yg).length;return Ue(this,yg).push(vJ),Wt(this,Nw,Ue(this,Nw)+id),n=>{Ue(this,yg)[t]=n0e(n)}}}yg=new WeakMap,Nw=new WeakMap,B4=new WeakSet,qF=function(t){return Ue(this,yg).push(t),Wt(this,Nw,Ue(this,Nw)+t.length),t.length};var Bd,Ff,Aw,jw,Kb,J3,NJ,Nke;const Wue=class Wue{constructor(t,n,r){Ln(this,J3);Bn(this,"allowLoose");Ln(this,Bd);Ln(this,Ff);Ln(this,Aw);Ln(this,jw);Ln(this,Kb);Rs(this,{allowLoose:!!n}),Wt(this,Bd,Jc(t)),Wt(this,Aw,0),Wt(this,jw,null),Wt(this,Kb,r??1024),Wt(this,Ff,0)}get data(){return qr(Ue(this,Bd))}get dataLength(){return Ue(this,Bd).length}get consumed(){return Ue(this,Ff)}get bytes(){return new Uint8Array(Ue(this,Bd))}subReader(t){const n=new Wue(Ue(this,Bd).slice(Ue(this,Ff)+t),this.allowLoose,Ue(this,Kb));return Wt(n,jw,this),n}readBytes(t,n){let r=xr(this,J3,Nke).call(this,0,t,!!n);return xr(this,J3,NJ).call(this,t),Wt(this,Ff,Ue(this,Ff)+r.length),r.slice(0,t)}readValue(){return PB(this.readBytes(id))}readIndex(){return Wyt(this.readBytes(id))}};Bd=new WeakMap,Ff=new WeakMap,Aw=new WeakMap,jw=new WeakMap,Kb=new WeakMap,J3=new WeakSet,NJ=function(t){var n;if(Ue(this,jw))return xr(n=Ue(this,jw),J3,NJ).call(n,t);Wt(this,Aw,Ue(this,Aw)+t),Mr(Ue(this,Kb)<1||Ue(this,Aw)<=Ue(this,Kb)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${Ue(this,Kb)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Jc(Ue(this,Bd)),offset:Ue(this,Ff),length:t,info:{bytesRead:Ue(this,Aw),dataLength:this.dataLength}})},Nke=function(t,n,r){let s=Math.ceil(n/id)*id;return Ue(this,Ff)+s>Ue(this,Bd).length&&(this.allowLoose&&r&&Ue(this,Ff)+n<=Ue(this,Bd).length?s=n:Mr(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Jc(Ue(this,Bd)),length:Ue(this,Bd).length,offset:Ue(this,Ff)+s})),Ue(this,Bd).slice(Ue(this,Ff),Ue(this,Ff)+s)};let SJ=Wue;function Lf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function sae(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Ake(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Lf(e.outputLen),Lf(e.blockLen)}function MS(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function jke(e,t){sae(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const PH=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Eke=e=>e instanceof Uint8Array,GF=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),KF=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Ym=(e,t)=>e<<32-t|e>>>t,f2t=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!f2t)throw new Error("Non little-endian hardware is not supported");const h2t=async()=>{};async function r0e(e,t,n){let r=Date.now();for(let s=0;s<e;s++){n(s);const a=Date.now()-r;a>=0&&a<t||(await h2t(),r+=a)}}function p2t(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function RS(e){if(typeof e=="string"&&(e=p2t(e)),!Eke(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function m2t(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!Eke(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}let iae=class{clone(){return this._cloneInto()}};const x2t={}.toString;function _ke(e,t){if(t!==void 0&&x2t.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function FB(e){const t=r=>e().update(RS(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function g2t(e=32){if(PH&&typeof PH.getRandomValues=="function")return PH.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}let kke=class extends iae{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Ake(t);const r=RS(n);if(this.iHash=t.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 s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return MS(this),this.iHash.update(t),this}digestInto(t){MS(this),sae(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:o,outputLen:l}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const OB=(e,t,n)=>new kke(e,t).update(n).digest();OB.create=(e,t)=>new kke(e,t);function b2t(e,t,n,r){Ake(e);const s=_ke({dkLen:32,asyncTick:10},r),{c:a,dkLen:o,asyncTick:l}=s;if(Lf(a),Lf(o),Lf(l),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=RS(t),u=RS(n),d=new Uint8Array(o),f=OB.create(e,c),x=f._cloneInto().update(u);return{c:a,dkLen:o,asyncTick:l,DK:d,PRF:f,PRFSalt:x}}function y2t(e,t,n,r,s){return e.destroy(),t.destroy(),r&&r.destroy(),s.fill(0),n}function aae(e,t,n,r){const{c:s,dkLen:a,DK:o,PRF:l,PRFSalt:c}=b2t(e,t,n,r);let u;const d=new Uint8Array(4),f=KF(d),x=new Uint8Array(l.outputLen);for(let g=1,v=0;v<a;g++,v+=l.outputLen){const w=o.subarray(v,v+l.outputLen);f.setInt32(0,g,!1),(u=c._cloneInto(u)).update(d).digestInto(x),w.set(x.subarray(0,w.length));for(let C=1;C<s;C++){l._cloneInto(u).update(x).digestInto(x);for(let N=0;N<w.length;N++)w[N]^=x[N]}}return y2t(l,c,o,u,x)}function v2t(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),l=Number(n&a),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,l,r)}class oae extends iae{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=KF(this.buffer)}update(t){MS(this);const{view:n,buffer:r,blockLen:s}=this;t=RS(t);const a=t.length;for(let o=0;o<a;){const l=Math.min(s-this.pos,a-o);if(l===s){const c=KF(t);for(;s<=a-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){MS(this),jke(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;v2t(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=KF(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,d[f],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:l}=this;return t.length=s,t.pos=l,t.finished=a,t.destroyed=o,s%n&&t.buffer.set(r),t}}const w2t=(e,t,n)=>e&t^~e&n,C2t=(e,t,n)=>e&t^e&n^t&n,S2t=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]),ob=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),lb=new Uint32Array(64);let N2t=class extends oae{constructor(){super(64,32,8,!1),this.A=ob[0]|0,this.B=ob[1]|0,this.C=ob[2]|0,this.D=ob[3]|0,this.E=ob[4]|0,this.F=ob[5]|0,this.G=ob[6]|0,this.H=ob[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:o,G:l,H:c}=this;return[t,n,r,s,a,o,l,c]}set(t,n,r,s,a,o,l,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=l|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)lb[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=lb[f-15],g=lb[f-2],v=Ym(x,7)^Ym(x,18)^x>>>3,w=Ym(g,17)^Ym(g,19)^g>>>10;lb[f]=w+lb[f-7]+v+lb[f-16]|0}let{A:r,B:s,C:a,D:o,E:l,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const x=Ym(l,6)^Ym(l,11)^Ym(l,25),g=d+x+w2t(l,c,u)+S2t[f]+lb[f]|0,w=(Ym(r,2)^Ym(r,13)^Ym(r,22))+C2t(r,s,a)|0;d=u,u=c,c=l,l=o+g|0,o=a,a=s,s=r,r=g+w|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,a,o,l,c,u,d)}roundClean(){lb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const _A=FB(()=>new N2t),YI=BigInt(2**32-1),AJ=BigInt(32);function Tke(e,t=!1){return t?{h:Number(e&YI),l:Number(e>>AJ&YI)}:{h:Number(e>>AJ&YI)|0,l:Number(e&YI)|0}}function Ike(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=Tke(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const A2t=(e,t)=>BigInt(e>>>0)<<AJ|BigInt(t>>>0),j2t=(e,t,n)=>e>>>n,E2t=(e,t,n)=>e<<32-n|t>>>n,_2t=(e,t,n)=>e>>>n|t<<32-n,k2t=(e,t,n)=>e<<32-n|t>>>n,T2t=(e,t,n)=>e<<64-n|t>>>n-32,I2t=(e,t,n)=>e>>>n-32|t<<64-n,P2t=(e,t)=>t,F2t=(e,t)=>e,Pke=(e,t,n)=>e<<n|t>>>32-n,Fke=(e,t,n)=>t<<n|e>>>32-n,Oke=(e,t,n)=>t<<n-32|e>>>64-n,Mke=(e,t,n)=>e<<n-32|t>>>64-n;function O2t(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const M2t=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),R2t=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,L2t=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),D2t=(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,B2t=(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0),$2t=(e,t,n,r,s,a)=>t+n+r+s+a+(e/2**32|0)|0,Mi={fromBig:Tke,split:Ike,toBig:A2t,shrSH:j2t,shrSL:E2t,rotrSH:_2t,rotrSL:k2t,rotrBH:T2t,rotrBL:I2t,rotr32H:P2t,rotr32L:F2t,rotlSH:Pke,rotlSL:Fke,rotlBH:Oke,rotlBL:Mke,add:O2t,add3L:M2t,add3H:R2t,add4L:L2t,add4H:D2t,add5H:$2t,add5L:B2t},[U2t,z2t]=Mi.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(e=>BigInt(e))),cb=new Uint32Array(80),ub=new Uint32Array(80);class H2t extends oae{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:t,Al:n,Bh:r,Bl:s,Ch:a,Cl:o,Dh:l,Dl:c,Eh:u,El:d,Fh:f,Fl:x,Gh:g,Gl:v,Hh:w,Hl:C}=this;return[t,n,r,s,a,o,l,c,u,d,f,x,g,v,w,C]}set(t,n,r,s,a,o,l,c,u,d,f,x,g,v,w,C){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=a|0,this.Cl=o|0,this.Dh=l|0,this.Dl=c|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=x|0,this.Gh=g|0,this.Gl=v|0,this.Hh=w|0,this.Hl=C|0}process(t,n){for(let P=0;P<16;P++,n+=4)cb[P]=t.getUint32(n),ub[P]=t.getUint32(n+=4);for(let P=16;P<80;P++){const R=cb[P-15]|0,F=ub[P-15]|0,U=Mi.rotrSH(R,F,1)^Mi.rotrSH(R,F,8)^Mi.shrSH(R,F,7),L=Mi.rotrSL(R,F,1)^Mi.rotrSL(R,F,8)^Mi.shrSL(R,F,7),z=cb[P-2]|0,Q=ub[P-2]|0,ne=Mi.rotrSH(z,Q,19)^Mi.rotrBH(z,Q,61)^Mi.shrSH(z,Q,6),J=Mi.rotrSL(z,Q,19)^Mi.rotrBL(z,Q,61)^Mi.shrSL(z,Q,6),X=Mi.add4L(L,J,ub[P-7],ub[P-16]),re=Mi.add4H(X,U,ne,cb[P-7],cb[P-16]);cb[P]=re|0,ub[P]=X|0}let{Ah:r,Al:s,Bh:a,Bl:o,Ch:l,Cl:c,Dh:u,Dl:d,Eh:f,El:x,Fh:g,Fl:v,Gh:w,Gl:C,Hh:N,Hl:I}=this;for(let P=0;P<80;P++){const R=Mi.rotrSH(f,x,14)^Mi.rotrSH(f,x,18)^Mi.rotrBH(f,x,41),F=Mi.rotrSL(f,x,14)^Mi.rotrSL(f,x,18)^Mi.rotrBL(f,x,41),U=f&g^~f&w,L=x&v^~x&C,z=Mi.add5L(I,F,L,z2t[P],ub[P]),Q=Mi.add5H(z,N,R,U,U2t[P],cb[P]),ne=z|0,J=Mi.rotrSH(r,s,28)^Mi.rotrBH(r,s,34)^Mi.rotrBH(r,s,39),X=Mi.rotrSL(r,s,28)^Mi.rotrBL(r,s,34)^Mi.rotrBL(r,s,39),re=r&a^r&l^a&l,pe=s&o^s&c^o&c;N=w|0,I=C|0,w=g|0,C=v|0,g=f|0,v=x|0,{h:f,l:x}=Mi.add(u|0,d|0,Q|0,ne|0),u=l|0,d=c|0,l=a|0,c=o|0,a=r|0,o=s|0;const Y=Mi.add3L(ne,X,pe);r=Mi.add3H(Y,Q,J,re),s=Y|0}({h:r,l:s}=Mi.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:a,l:o}=Mi.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:l,l:c}=Mi.add(this.Ch|0,this.Cl|0,l|0,c|0),{h:u,l:d}=Mi.add(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:x}=Mi.add(this.Eh|0,this.El|0,f|0,x|0),{h:g,l:v}=Mi.add(this.Fh|0,this.Fl|0,g|0,v|0),{h:w,l:C}=Mi.add(this.Gh|0,this.Gl|0,w|0,C|0),{h:N,l:I}=Mi.add(this.Hh|0,this.Hl|0,N|0,I|0),this.set(r,s,a,o,l,c,u,d,f,x,g,v,w,C,N,I)}roundClean(){cb.fill(0),ub.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)}}const lae=FB(()=>new H2t);function V2t(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const s0e=V2t(),i0e=s0e.crypto||s0e.msCrypto;function W2t(e){switch(e){case"sha256":return _A.create();case"sha512":return lae.create()}Cn(!1,"invalid hashing algorithm name","algorithm",e)}function q2t(e,t){const n={sha256:_A,sha512:lae}[e];return Cn(n!=null,"invalid hmac algorithm","algorithm",e),OB.create(n,t)}function G2t(e,t,n,r,s){const a={sha256:_A,sha512:lae}[s];return Cn(a!=null,"invalid pbkdf2 algorithm","algorithm",s),aae(a,e,t,{c:n,dkLen:r})}function K2t(e){Mr(i0e!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),Cn(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const t=new Uint8Array(e);return i0e.getRandomValues(t),t}let Rke=!1;const Lke=function(e,t,n){return q2t(e,t).update(n).digest()};let Dke=Lke;function kA(e,t,n){const r=fs(t,"key"),s=fs(n,"data");return qr(Dke(e,r,s))}kA._=Lke;kA.lock=function(){Rke=!0};kA.register=function(e){if(Rke)throw new Error("computeHmac is locked");Dke=e};Object.freeze(kA);const[Bke,$ke,Uke]=[[],[],[]],Y2t=BigInt(0),C7=BigInt(1),X2t=BigInt(2),Q2t=BigInt(7),Z2t=BigInt(256),J2t=BigInt(113);for(let e=0,t=C7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Bke.push(2*(5*r+n)),$ke.push((e+1)*(e+2)/2%64);let s=Y2t;for(let a=0;a<7;a++)t=(t<<C7^(t>>Q2t)*J2t)%Z2t,t&X2t&&(s^=C7<<(C7<<BigInt(a))-C7);Uke.push(s)}const[evt,tvt]=Ike(Uke,!0),a0e=(e,t,n)=>n>32?Oke(e,t,n):Pke(e,t,n),o0e=(e,t,n)=>n>32?Mke(e,t,n):Fke(e,t,n);function nvt(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=a0e(u,d,1)^n[l],x=o0e(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=$ke[o],c=a0e(s,a,l),u=o0e(s,a,l),d=Bke[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=evt[r],e[1]^=tvt[r]}n.fill(0)}let rvt=class zke extends iae{constructor(t,n,r,s=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Lf(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=GF(this.state)}keccak(){nvt(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){MS(this);const{blockLen:n,state:r}=this;t=RS(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){MS(this,!1),sae(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Lf(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(jke(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new zke(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const svt=(e,t,n)=>FB(()=>new rvt(t,e,n)),ivt=svt(1,136,256/8);let Hke=!1;const Vke=function(e){return ivt(e)};let Wke=Vke;function lo(e){const t=fs(e,"data");return qr(Wke(t))}lo._=Vke;lo.lock=function(){Hke=!0};lo.register=function(e){if(Hke)throw new TypeError("keccak256 is locked");Wke=e};Object.freeze(lo);const avt=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),qke=Uint8Array.from({length:16},(e,t)=>t),ovt=qke.map(e=>(9*e+5)%16);let cae=[qke],uae=[ovt];for(let e=0;e<4;e++)for(let t of[cae,uae])t.push(t[e].map(n=>avt[n]));const Gke=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),lvt=cae.map((e,t)=>e.map(n=>Gke[t][n])),cvt=uae.map((e,t)=>e.map(n=>Gke[t][n])),uvt=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),dvt=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),XI=(e,t)=>e<<t|e>>>32-t;function l0e(e,t,n,r){return e===0?t^n^r:e===1?t&n|~t&r:e===2?(t|~n)^r:e===3?t&r|n&~r:t^(n|~r)}const QI=new Uint32Array(16);class fvt extends oae{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:n,h2:r,h3:s,h4:a}=this;return[t,n,r,s,a]}set(t,n,r,s,a){this.h0=t|0,this.h1=n|0,this.h2=r|0,this.h3=s|0,this.h4=a|0}process(t,n){for(let g=0;g<16;g++,n+=4)QI[g]=t.getUint32(n,!0);let r=this.h0|0,s=r,a=this.h1|0,o=a,l=this.h2|0,c=l,u=this.h3|0,d=u,f=this.h4|0,x=f;for(let g=0;g<5;g++){const v=4-g,w=uvt[g],C=dvt[g],N=cae[g],I=uae[g],P=lvt[g],R=cvt[g];for(let F=0;F<16;F++){const U=XI(r+l0e(g,a,l,u)+QI[N[F]]+w,P[F])+f|0;r=f,f=u,u=XI(l,10)|0,l=a,a=U}for(let F=0;F<16;F++){const U=XI(s+l0e(v,o,c,d)+QI[I[F]]+C,R[F])+x|0;s=x,x=d,d=XI(c,10)|0,c=o,o=U}}this.set(this.h1+l+d|0,this.h2+u+x|0,this.h3+f+s|0,this.h4+r+o|0,this.h0+a+c|0)}roundClean(){QI.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const hvt=FB(()=>new fvt);let Kke=!1;const Yke=function(e){return hvt(e)};let Xke=Yke;function TA(e){const t=fs(e,"data");return qr(Xke(t))}TA._=Yke;TA.lock=function(){Kke=!0};TA.register=function(e){if(Kke)throw new TypeError("ripemd160 is locked");Xke=e};Object.freeze(TA);let Qke=!1;const Zke=function(e,t,n,r,s){return G2t(e,t,n,r,s)};let Jke=Zke;function a2(e,t,n,r,s){const a=fs(e,"password"),o=fs(t,"salt");return qr(Jke(a,o,n,r,s))}a2._=Zke;a2.lock=function(){Qke=!0};a2.register=function(e){if(Qke)throw new Error("pbkdf2 is locked");Jke=e};Object.freeze(a2);let eTe=!1;const tTe=function(e){return new Uint8Array(K2t(e))};let nTe=tTe;function Vg(e){return nTe(e)}Vg._=tTe;Vg.lock=function(){eTe=!0};Vg.register=function(e){if(eTe)throw new Error("randomBytes is locked");nTe=e};Object.freeze(Vg);const fa=(e,t)=>e<<t|e>>>32-t;function c0e(e,t,n,r,s,a){let o=e[t++]^n[r++],l=e[t++]^n[r++],c=e[t++]^n[r++],u=e[t++]^n[r++],d=e[t++]^n[r++],f=e[t++]^n[r++],x=e[t++]^n[r++],g=e[t++]^n[r++],v=e[t++]^n[r++],w=e[t++]^n[r++],C=e[t++]^n[r++],N=e[t++]^n[r++],I=e[t++]^n[r++],P=e[t++]^n[r++],R=e[t++]^n[r++],F=e[t++]^n[r++],U=o,L=l,z=c,Q=u,ne=d,J=f,X=x,re=g,pe=v,Y=w,ie=C,oe=N,G=I,V=P,te=R,ae=F;for(let he=0;he<8;he+=2)ne^=fa(U+G|0,7),pe^=fa(ne+U|0,9),G^=fa(pe+ne|0,13),U^=fa(G+pe|0,18),Y^=fa(J+L|0,7),V^=fa(Y+J|0,9),L^=fa(V+Y|0,13),J^=fa(L+V|0,18),te^=fa(ie+X|0,7),z^=fa(te+ie|0,9),X^=fa(z+te|0,13),ie^=fa(X+z|0,18),Q^=fa(ae+oe|0,7),re^=fa(Q+ae|0,9),oe^=fa(re+Q|0,13),ae^=fa(oe+re|0,18),L^=fa(U+Q|0,7),z^=fa(L+U|0,9),Q^=fa(z+L|0,13),U^=fa(Q+z|0,18),X^=fa(J+ne|0,7),re^=fa(X+J|0,9),ne^=fa(re+X|0,13),J^=fa(ne+re|0,18),oe^=fa(ie+Y|0,7),pe^=fa(oe+ie|0,9),Y^=fa(pe+oe|0,13),ie^=fa(Y+pe|0,18),G^=fa(ae+te|0,7),V^=fa(G+ae|0,9),te^=fa(V+G|0,13),ae^=fa(te+V|0,18);s[a++]=o+U|0,s[a++]=l+L|0,s[a++]=c+z|0,s[a++]=u+Q|0,s[a++]=d+ne|0,s[a++]=f+J|0,s[a++]=x+X|0,s[a++]=g+re|0,s[a++]=v+pe|0,s[a++]=w+Y|0,s[a++]=C+ie|0,s[a++]=N+oe|0,s[a++]=I+G|0,s[a++]=P+V|0,s[a++]=R+te|0,s[a++]=F+ae|0}function n4(e,t,n,r,s){let a=r+0,o=r+16*s;for(let l=0;l<16;l++)n[o+l]=e[t+(2*s-1)*16+l];for(let l=0;l<s;l++,a+=16,t+=16)c0e(n,o,e,t,n,a),l>0&&(o+=16),c0e(n,a,e,t+=16,n,o)}function rTe(e,t,n){const r=_ke({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:s,r:a,p:o,dkLen:l,asyncTick:c,maxmem:u,onProgress:d}=r;if(Lf(s),Lf(a),Lf(o),Lf(l),Lf(c),Lf(u),d!==void 0&&typeof d!="function")throw new Error("progressCb should be function");const f=128*a,x=f/4;if(s<=1||s&s-1||s>=2**(f/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(l<0||l>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=f*(s+o);if(g>u)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${u} (maxmem)`);const v=aae(_A,e,t,{c:1,dkLen:f*o}),w=GF(v),C=GF(new Uint8Array(f*s)),N=GF(new Uint8Array(f));let I=()=>{};if(d){const P=2*s*o,R=Math.max(Math.floor(P/1e4),1);let F=0;I=()=>{F++,d&&(!(F%R)||F===P)&&d(F/P)}}return{N:s,r:a,p:o,dkLen:l,blockSize32:x,V:C,B32:w,B:v,tmp:N,blockMixCb:I,asyncTick:c}}function sTe(e,t,n,r,s){const a=aae(_A,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),s.fill(0),a}function pvt(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x}=rTe(e,t,n);for(let g=0;g<a;g++){const v=l*g;for(let w=0;w<l;w++)c[w]=u[v+w];for(let w=0,C=0;w<r-1;w++)n4(c,C,c,C+=l,s),x();n4(c,(r-1)*l,u,v,s),x();for(let w=0;w<r;w++){const C=u[v+l-16]%r;for(let N=0;N<l;N++)f[N]=u[v+N]^c[C*l+N];n4(f,0,u,v,s),x()}}return sTe(e,o,d,c,f)}async function mvt(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x,asyncTick:g}=rTe(e,t,n);for(let v=0;v<a;v++){const w=l*v;for(let N=0;N<l;N++)c[N]=u[w+N];let C=0;await r0e(r-1,g,()=>{n4(c,C,c,C+=l,s),x()}),n4(c,(r-1)*l,u,w,s),x(),await r0e(r,g,()=>{const N=u[w+l-16]%r;for(let I=0;I<l;I++)f[I]=u[w+I]^c[N*l+I];n4(f,0,u,w,s),x()})}return sTe(e,o,d,c,f)}let iTe=!1,aTe=!1;const oTe=async function(e,t,n,r,s,a,o){return await mvt(e,t,{N:n,r,p:s,dkLen:a,onProgress:o})},lTe=function(e,t,n,r,s,a){return pvt(e,t,{N:n,r,p:s,dkLen:a})};let cTe=oTe,uTe=lTe;async function IA(e,t,n,r,s,a,o){const l=fs(e,"passwd"),c=fs(t,"salt");return qr(await cTe(l,c,n,r,s,a,o))}IA._=oTe;IA.lock=function(){aTe=!0};IA.register=function(e){if(aTe)throw new Error("scrypt is locked");cTe=e};Object.freeze(IA);function PA(e,t,n,r,s,a){const o=fs(e,"passwd"),l=fs(t,"salt");return qr(uTe(o,l,n,r,s,a))}PA._=lTe;PA.lock=function(){iTe=!0};PA.register=function(e){if(iTe)throw new Error("scryptSync is locked");uTe=e};Object.freeze(PA);const dTe=function(e){return W2t("sha256").update(e).digest()};let fTe=dTe,hTe=!1;function op(e){const t=fs(e,"data");return qr(fTe(t))}op._=dTe;op.lock=function(){hTe=!0};op.register=function(e){if(hTe)throw new Error("sha256 is locked");fTe=e};Object.freeze(op);Object.freeze(op);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pTe=BigInt(0),MB=BigInt(1),xvt=BigInt(2),RB=e=>e instanceof Uint8Array,gvt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function LS(e){if(!RB(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=gvt[e[n]];return t}function mTe(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function dae(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function DS(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){const s=r*2,a=e.slice(s,s+2),o=Number.parseInt(a,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function Kw(e){return dae(LS(e))}function fae(e){if(!RB(e))throw new Error("Uint8Array expected");return dae(LS(Uint8Array.from(e).reverse()))}function BS(e,t){return DS(e.toString(16).padStart(t*2,"0"))}function hae(e,t){return BS(e,t).reverse()}function bvt(e){return DS(mTe(e))}function Bp(e,t,n){let r;if(typeof t=="string")try{r=DS(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if(RB(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${e} expected ${n} bytes, got ${s}`);return r}function oE(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!RB(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function yvt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function vvt(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function wvt(e){let t;for(t=0;e>pTe;e>>=MB,t+=1);return t}function Cvt(e,t){return e>>BigInt(t)&MB}const Svt=(e,t,n)=>e|(n?MB:pTe)<<BigInt(t),pae=e=>(xvt<<BigInt(e-1))-MB,FH=e=>new Uint8Array(e),u0e=e=>Uint8Array.from(e);function xTe(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=FH(e),s=FH(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=FH())=>{s=l(u0e([0]),f),r=l(),f.length!==0&&(s=l(u0e([1]),f),r=l())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const x=[];for(;f<t;){r=l();const g=r.slice();x.push(g),f+=r.length}return oE(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const Nvt={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Bk(e,t,n={}){const r=(s,a,o)=>{const l=Nvt[a];if(typeof l!="function")throw new Error(`Invalid validator "${a}", expected function`);const c=e[s];if(!(o&&c===void 0)&&!l(c,e))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${a}`)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}const Avt=Object.freeze(Object.defineProperty({__proto__:null,bitGet:Cvt,bitLen:wvt,bitMask:pae,bitSet:Svt,bytesToHex:LS,bytesToNumberBE:Kw,bytesToNumberLE:fae,concatBytes:oE,createHmacDrbg:xTe,ensureBytes:Bp,equalBytes:yvt,hexToBytes:DS,hexToNumber:dae,numberToBytesBE:BS,numberToBytesLE:hae,numberToHexUnpadded:mTe,numberToVarBytesBE:bvt,utf8ToBytes:vvt,validateObject:Bk},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ec=BigInt(0),yl=BigInt(1),Mv=BigInt(2),jvt=BigInt(3),jJ=BigInt(4),d0e=BigInt(5),f0e=BigInt(8);BigInt(9);BigInt(16);function zd(e,t){const n=e%t;return n>=Ec?n:t+n}function Evt(e,t,n){if(n<=Ec||t<Ec)throw new Error("Expected power/modulo > 0");if(n===yl)return Ec;let r=yl;for(;t>Ec;)t&yl&&(r=r*e%n),e=e*e%n,t>>=yl;return r}function xh(e,t,n){let r=e;for(;t-- >Ec;)r*=r,r%=n;return r}function EJ(e,t){if(e===Ec||t<=Ec)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=zd(e,t),r=t,s=Ec,a=yl;for(;n!==Ec;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==yl)throw new Error("invert: does not exist");return zd(s,t)}function _vt(e){const t=(e-yl)/Mv;let n,r,s;for(n=e-yl,r=0;n%Mv===Ec;n/=Mv,r++);for(s=Mv;s<e&&Evt(s,t,e)!==e-yl;s++);if(r===1){const o=(e+yl)/jJ;return function(c,u){const d=c.pow(u,o);if(!c.eql(c.sqr(d),u))throw new Error("Cannot find square root");return d}}const a=(n+yl)/Mv;return function(l,c){if(l.pow(c,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let u=r,d=l.pow(l.mul(l.ONE,s),n),f=l.pow(c,a),x=l.pow(c,n);for(;!l.eql(x,l.ONE);){if(l.eql(x,l.ZERO))return l.ZERO;let g=1;for(let w=l.sqr(x);g<u&&!l.eql(w,l.ONE);g++)w=l.sqr(w);const v=l.pow(d,yl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function kvt(e){if(e%jJ===jvt){const t=(e+yl)/jJ;return function(r,s){const a=r.pow(s,t);if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}if(e%f0e===d0e){const t=(e-d0e)/f0e;return function(r,s){const a=r.mul(s,Mv),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Mv),o),u=r.mul(l,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return _vt(e)}const Tvt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ivt(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Tvt.reduce((r,s)=>(r[s]="function",r),t);return Bk(e,n)}function Pvt(e,t,n){if(n<Ec)throw new Error("Expected power > 0");if(n===Ec)return e.ONE;if(n===yl)return t;let r=e.ONE,s=t;for(;n>Ec;)n&yl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=yl;return r}function Fvt(e,t){const n=new Array(t.length),r=t.reduce((a,o,l)=>e.is0(o)?a:(n[l]=a,e.mul(a,o)),e.ONE),s=e.inv(r);return t.reduceRight((a,o,l)=>e.is0(o)?a:(n[l]=e.mul(a,n[l]),e.mul(a,o)),s),n}function gTe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Ovt(e,t,n=!1,r={}){if(e<=Ec)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:a}=gTe(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=kvt(e),l=Object.freeze({ORDER:e,BITS:s,BYTES:a,MASK:pae(s),ZERO:Ec,ONE:yl,create:c=>zd(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Ec<=c&&c<e},is0:c=>c===Ec,isOdd:c=>(c&yl)===yl,neg:c=>zd(-c,e),eql:(c,u)=>c===u,sqr:c=>zd(c*c,e),add:(c,u)=>zd(c+u,e),sub:(c,u)=>zd(c-u,e),mul:(c,u)=>zd(c*u,e),pow:(c,u)=>Pvt(l,c,u),div:(c,u)=>zd(c*EJ(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>EJ(c,e),sqrt:r.sqrt||(c=>o(l,c)),invertBatch:c=>Fvt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?hae(c,a):BS(c,a),fromBytes:c=>{if(c.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${c.length}`);return n?fae(c):Kw(c)}});return Object.freeze(l)}function bTe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function yTe(e){const t=bTe(e);return t+Math.ceil(t/2)}function Mvt(e,t,n=!1){const r=e.length,s=bTe(t),a=yTe(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?Kw(e):fae(e),l=zd(o,t-yl)+yl;return n?hae(l,s):BS(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rvt=BigInt(0),OH=BigInt(1);function Lvt(e,t){const n=(s,a)=>{const o=a.negate();return s?o:a},r=s=>{const a=Math.ceil(t/s)+1,o=2**(s-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,a){let o=e.ZERO,l=s;for(;a>Rvt;)a&OH&&(o=o.add(l)),l=l.double(),a>>=OH;return o},precomputeWindow(s,a){const{windows:o,windowSize:l}=r(a),c=[];let u=s,d=u;for(let f=0;f<o;f++){d=u,c.push(d);for(let x=1;x<l;x++)d=d.add(u),c.push(d);u=d.double()}return c},wNAF(s,a,o){const{windows:l,windowSize:c}=r(s);let u=e.ZERO,d=e.BASE;const f=BigInt(2**s-1),x=2**s,g=BigInt(s);for(let v=0;v<l;v++){const w=v*c;let C=Number(o&f);o>>=g,C>c&&(C-=x,o+=OH);const N=w,I=w+Math.abs(C)-1,P=v%2!==0,R=C<0;C===0?d=d.add(n(P,a[N])):u=u.add(n(R,a[I]))}return{p:u,f:d}},wNAFCached(s,a,o,l){const c=s._WINDOW_SIZE||1;let u=a.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&a.set(s,l(u))),this.wNAF(c,u,o)}}}function vTe(e){return Ivt(e.Fp),Bk(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...gTe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Dvt(e){const t=vTe(e);Bk(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,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({...t})}const{bytesToNumberBE:Bvt,hexToBytes:$vt}=Avt,qv={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=qv;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Bvt(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=qv,n=typeof e=="string"?$vt(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:a}=qv._parseInt(n.subarray(2)),{d:o,l}=qv._parseInt(a);if(l.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const d=u.toString(16);return d.length&1?`0${d}`:d},r=t(n(e.s)),s=t(n(e.r)),a=r.length/2,o=s.length/2,l=n(a),c=n(o);return`30${n(o+a+4)}02${c}${s}02${l}${r}`}},kg=BigInt(0),zh=BigInt(1);BigInt(2);const h0e=BigInt(3);BigInt(4);function Uvt(e){const t=Dvt(e),{Fp:n}=t,r=t.toBytes||((v,w,C)=>{const N=w.toAffine();return oE(Uint8Array.from([4]),n.toBytes(N.x),n.toBytes(N.y))}),s=t.fromBytes||(v=>{const w=v.subarray(1),C=n.fromBytes(w.subarray(0,n.BYTES)),N=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x:C,y:N}});function a(v){const{a:w,b:C}=t,N=n.sqr(v),I=n.mul(N,v);return n.add(n.add(I,n.mul(v,w)),C)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&kg<v&&v<t.n}function l(v){if(!o(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(v){const{allowedPrivateKeyLengths:w,nByteLength:C,wrapPrivateKey:N,n:I}=t;if(w&&typeof v!="bigint"){if(v instanceof Uint8Array&&(v=LS(v)),typeof v!="string"||!w.includes(v.length))throw new Error("Invalid key");v=v.padStart(C*2,"0")}let P;try{P=typeof v=="bigint"?v:Kw(Bp("private key",v,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof v}`)}return N&&(P=zd(P,I)),l(P),P}const u=new Map;function d(v){if(!(v instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(w,C,N){if(this.px=w,this.py=C,this.pz=N,w==null||!n.isValid(w))throw new Error("x required");if(C==null||!n.isValid(C))throw new Error("y required");if(N==null||!n.isValid(N))throw new Error("z required")}static fromAffine(w){const{x:C,y:N}=w||{};if(!w||!n.isValid(C)||!n.isValid(N))throw new Error("invalid affine point");if(w instanceof f)throw new Error("projective point not allowed");const I=P=>n.eql(P,n.ZERO);return I(C)&&I(N)?f.ZERO:new f(C,N,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const C=n.invertBatch(w.map(N=>N.pz));return w.map((N,I)=>N.toAffine(C[I])).map(f.fromAffine)}static fromHex(w){const C=f.fromAffine(s(Bp("pointHex",w)));return C.assertValidity(),C}static fromPrivateKey(w){return f.BASE.multiply(c(w))}_setWindowSize(w){this._WINDOW_SIZE=w,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:w,y:C}=this.toAffine();if(!n.isValid(w)||!n.isValid(C))throw new Error("bad point: x or y not FE");const N=n.sqr(C),I=a(w);if(!n.eql(N,I))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){d(w);const{px:C,py:N,pz:I}=this,{px:P,py:R,pz:F}=w,U=n.eql(n.mul(C,F),n.mul(P,I)),L=n.eql(n.mul(N,F),n.mul(R,I));return U&&L}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:C}=t,N=n.mul(C,h0e),{px:I,py:P,pz:R}=this;let F=n.ZERO,U=n.ZERO,L=n.ZERO,z=n.mul(I,I),Q=n.mul(P,P),ne=n.mul(R,R),J=n.mul(I,P);return J=n.add(J,J),L=n.mul(I,R),L=n.add(L,L),F=n.mul(w,L),U=n.mul(N,ne),U=n.add(F,U),F=n.sub(Q,U),U=n.add(Q,U),U=n.mul(F,U),F=n.mul(J,F),L=n.mul(N,L),ne=n.mul(w,ne),J=n.sub(z,ne),J=n.mul(w,J),J=n.add(J,L),L=n.add(z,z),z=n.add(L,z),z=n.add(z,ne),z=n.mul(z,J),U=n.add(U,z),ne=n.mul(P,R),ne=n.add(ne,ne),z=n.mul(ne,J),F=n.sub(F,z),L=n.mul(ne,Q),L=n.add(L,L),L=n.add(L,L),new f(F,U,L)}add(w){d(w);const{px:C,py:N,pz:I}=this,{px:P,py:R,pz:F}=w;let U=n.ZERO,L=n.ZERO,z=n.ZERO;const Q=t.a,ne=n.mul(t.b,h0e);let J=n.mul(C,P),X=n.mul(N,R),re=n.mul(I,F),pe=n.add(C,N),Y=n.add(P,R);pe=n.mul(pe,Y),Y=n.add(J,X),pe=n.sub(pe,Y),Y=n.add(C,I);let ie=n.add(P,F);return Y=n.mul(Y,ie),ie=n.add(J,re),Y=n.sub(Y,ie),ie=n.add(N,I),U=n.add(R,F),ie=n.mul(ie,U),U=n.add(X,re),ie=n.sub(ie,U),z=n.mul(Q,Y),U=n.mul(ne,re),z=n.add(U,z),U=n.sub(X,z),z=n.add(X,z),L=n.mul(U,z),X=n.add(J,J),X=n.add(X,J),re=n.mul(Q,re),Y=n.mul(ne,Y),X=n.add(X,re),re=n.sub(J,re),re=n.mul(Q,re),Y=n.add(Y,re),J=n.mul(X,Y),L=n.add(L,J),J=n.mul(ie,Y),U=n.mul(pe,U),U=n.sub(U,J),J=n.mul(pe,X),z=n.mul(ie,z),z=n.add(z,J),new f(U,L,z)}subtract(w){return this.add(w.negate())}is0(){return this.equals(f.ZERO)}wNAF(w){return g.wNAFCached(this,u,w,C=>{const N=n.invertBatch(C.map(I=>I.pz));return C.map((I,P)=>I.toAffine(N[P])).map(f.fromAffine)})}multiplyUnsafe(w){const C=f.ZERO;if(w===kg)return C;if(l(w),w===zh)return this;const{endo:N}=t;if(!N)return g.unsafeLadder(this,w);let{k1neg:I,k1:P,k2neg:R,k2:F}=N.splitScalar(w),U=C,L=C,z=this;for(;P>kg||F>kg;)P&zh&&(U=U.add(z)),F&zh&&(L=L.add(z)),z=z.double(),P>>=zh,F>>=zh;return I&&(U=U.negate()),R&&(L=L.negate()),L=new f(n.mul(L.px,N.beta),L.py,L.pz),U.add(L)}multiply(w){l(w);let C=w,N,I;const{endo:P}=t;if(P){const{k1neg:R,k1:F,k2neg:U,k2:L}=P.splitScalar(C);let{p:z,f:Q}=this.wNAF(F),{p:ne,f:J}=this.wNAF(L);z=g.constTimeNegate(R,z),ne=g.constTimeNegate(U,ne),ne=new f(n.mul(ne.px,P.beta),ne.py,ne.pz),N=z.add(ne),I=Q.add(J)}else{const{p:R,f:F}=this.wNAF(C);N=R,I=F}return f.normalizeZ([N,I])[0]}multiplyAndAddUnsafe(w,C,N){const I=f.BASE,P=(F,U)=>U===kg||U===zh||!F.equals(I)?F.multiplyUnsafe(U):F.multiply(U),R=P(this,C).add(P(w,N));return R.is0()?void 0:R}toAffine(w){const{px:C,py:N,pz:I}=this,P=this.is0();w==null&&(w=P?n.ONE:n.inv(I));const R=n.mul(C,w),F=n.mul(N,w),U=n.mul(I,w);if(P)return{x:n.ZERO,y:n.ZERO};if(!n.eql(U,n.ONE))throw new Error("invZ was invalid");return{x:R,y:F}}isTorsionFree(){const{h:w,isTorsionFree:C}=t;if(w===zh)return!0;if(C)return C(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:C}=t;return w===zh?this:C?C(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return LS(this.toRawBytes(w))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const x=t.nBitLength,g=Lvt(f,t.endo?Math.ceil(x/2):x);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function zvt(e){const t=vTe(e);return Bk(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Hvt(e){const t=zvt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(Y){return kg<Y&&Y<n.ORDER}function l(Y){return zd(Y,r)}function c(Y){return EJ(Y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:x}=Uvt({...t,toBytes(Y,ie,oe){const G=ie.toAffine(),V=n.toBytes(G.x),te=oE;return oe?te(Uint8Array.from([ie.hasEvenY()?2:3]),V):te(Uint8Array.from([4]),V,n.toBytes(G.y))},fromBytes(Y){const ie=Y.length,oe=Y[0],G=Y.subarray(1);if(ie===s&&(oe===2||oe===3)){const V=Kw(G);if(!o(V))throw new Error("Point is not on curve");const te=f(V);let ae=n.sqrt(te);const he=(ae&zh)===zh;return(oe&1)===1!==he&&(ae=n.neg(ae)),{x:V,y:ae}}else if(ie===a&&oe===4){const V=n.fromBytes(G.subarray(0,n.BYTES)),te=n.fromBytes(G.subarray(n.BYTES,2*n.BYTES));return{x:V,y:te}}else throw new Error(`Point of length ${ie} was invalid. Expected ${s} compressed bytes or ${a} uncompressed bytes`)}}),g=Y=>LS(BS(Y,t.nByteLength));function v(Y){const ie=r>>zh;return Y>ie}function w(Y){return v(Y)?l(-Y):Y}const C=(Y,ie,oe)=>Kw(Y.slice(ie,oe));class N{constructor(ie,oe,G){this.r=ie,this.s=oe,this.recovery=G,this.assertValidity()}static fromCompact(ie){const oe=t.nByteLength;return ie=Bp("compactSignature",ie,oe*2),new N(C(ie,0,oe),C(ie,oe,2*oe))}static fromDER(ie){const{r:oe,s:G}=qv.toSig(Bp("DER",ie));return new N(oe,G)}assertValidity(){if(!x(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!x(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(ie){return new N(this.r,this.s,ie)}recoverPublicKey(ie){const{r:oe,s:G,recovery:V}=this,te=L(Bp("msgHash",ie));if(V==null||![0,1,2,3].includes(V))throw new Error("recovery id invalid");const ae=V===2||V===3?oe+t.n:oe;if(ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const he=V&1?"03":"02",Ce=u.fromHex(he+g(ae)),ce=c(ae),ge=l(-te*ce),Ae=l(G*ce),ye=u.BASE.multiplyAndAddUnsafe(Ce,ge,Ae);if(!ye)throw new Error("point at infinify");return ye.assertValidity(),ye}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return DS(this.toDERHex())}toDERHex(){return qv.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return DS(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const I={isValidPrivateKey(Y){try{return d(Y),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const Y=yTe(t.n);return Mvt(t.randomBytes(Y),t.n)},precompute(Y=8,ie=u.BASE){return ie._setWindowSize(Y),ie.multiply(BigInt(3)),ie}};function P(Y,ie=!0){return u.fromPrivateKey(Y).toRawBytes(ie)}function R(Y){const ie=Y instanceof Uint8Array,oe=typeof Y=="string",G=(ie||oe)&&Y.length;return ie?G===s||G===a:oe?G===2*s||G===2*a:Y instanceof u}function F(Y,ie,oe=!0){if(R(Y))throw new Error("first arg must be private key");if(!R(ie))throw new Error("second arg must be public key");return u.fromHex(ie).multiply(d(Y)).toRawBytes(oe)}const U=t.bits2int||function(Y){const ie=Kw(Y),oe=Y.length*8-t.nBitLength;return oe>0?ie>>BigInt(oe):ie},L=t.bits2int_modN||function(Y){return l(U(Y))},z=pae(t.nBitLength);function Q(Y){if(typeof Y!="bigint")throw new Error("bigint expected");if(!(kg<=Y&&Y<z))throw new Error(`bigint expected < 2^${t.nBitLength}`);return BS(Y,t.nByteLength)}function ne(Y,ie,oe=J){if(["recovered","canonical"].some(Ie=>Ie in oe))throw new Error("sign() legacy options not supported");const{hash:G,randomBytes:V}=t;let{lowS:te,prehash:ae,extraEntropy:he}=oe;te==null&&(te=!0),Y=Bp("msgHash",Y),ae&&(Y=Bp("prehashed msgHash",G(Y)));const Ce=L(Y),ce=d(ie),ge=[Q(ce),Q(Ce)];if(he!=null){const Ie=he===!0?V(n.BYTES):he;ge.push(Bp("extraEntropy",Ie))}const Ae=oE(...ge),ye=Ce;function je(Ie){const Re=U(Ie);if(!x(Re))return;const Qe=c(Re),$e=u.BASE.multiply(Re).toAffine(),it=l($e.x);if(it===kg)return;const tt=l(Qe*l(ye+it*ce));if(tt===kg)return;let ot=($e.x===it?0:2)|Number($e.y&zh),ft=tt;return te&&v(tt)&&(ft=w(tt),ot^=1),new N(it,ft,ot)}return{seed:Ae,k2sig:je}}const J={lowS:t.lowS,prehash:!1},X={lowS:t.lowS,prehash:!1};function re(Y,ie,oe=J){const{seed:G,k2sig:V}=ne(Y,ie,oe),te=t;return xTe(te.hash.outputLen,te.nByteLength,te.hmac)(G,V)}u.BASE._setWindowSize(8);function pe(Y,ie,oe,G=X){var $e;const V=Y;if(ie=Bp("msgHash",ie),oe=Bp("publicKey",oe),"strict"in G)throw new Error("options.strict was renamed to lowS");const{lowS:te,prehash:ae}=G;let he,Ce;try{if(typeof V=="string"||V instanceof Uint8Array)try{he=N.fromDER(V)}catch(it){if(!(it instanceof qv.Err))throw it;he=N.fromCompact(V)}else if(typeof V=="object"&&typeof V.r=="bigint"&&typeof V.s=="bigint"){const{r:it,s:tt}=V;he=new N(it,tt)}else throw new Error("PARSE");Ce=u.fromHex(oe)}catch(it){if(it.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(te&&he.hasHighS())return!1;ae&&(ie=t.hash(ie));const{r:ce,s:ge}=he,Ae=L(ie),ye=c(ge),je=l(Ae*ye),Ie=l(ce*ye),Re=($e=u.BASE.multiplyAndAddUnsafe(Ce,je,Ie))==null?void 0:$e.toAffine();return Re?l(Re.x)===ce:!1}return{CURVE:t,getPublicKey:P,getSharedSecret:F,sign:re,verify:pe,ProjectivePoint:u,Signature:N,utils:I}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Vvt(e){return{hash:e,hmac:(t,...n)=>OB(e,t,m2t(...n)),randomBytes:g2t}}function Wvt(e,t){const n=r=>Hvt({...e,...Vvt(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wTe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),p0e=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),qvt=BigInt(1),_J=BigInt(2),m0e=(e,t)=>(e+t/_J)/t;function Gvt(e){const t=wTe,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=xh(d,n,t)*d%t,x=xh(f,n,t)*d%t,g=xh(x,_J,t)*u%t,v=xh(g,s,t)*g%t,w=xh(v,a,t)*v%t,C=xh(w,l,t)*w%t,N=xh(C,c,t)*C%t,I=xh(N,l,t)*w%t,P=xh(I,n,t)*d%t,R=xh(P,o,t)*v%t,F=xh(R,r,t)*u%t,U=xh(F,_J,t);if(!kJ.eql(kJ.sqr(U),e))throw new Error("Cannot find square root");return U}const kJ=Ovt(wTe,void 0,void 0,{sqrt:Gvt}),Nb=Wvt({a:BigInt(0),b:BigInt(7),Fp:kJ,n:p0e,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=p0e,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-qvt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=m0e(a*e,t),c=m0e(-r*e,t);let u=zd(e-l*n-c*s,t),d=zd(-l*r-c*a,t);const f=u>o,x=d>o;if(f&&(u=t-u),x&&(d=t-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:x,k2:d}}}},_A);BigInt(0);Nb.ProjectivePoint;const lE="0x0000000000000000000000000000000000000000",x0e="0x0000000000000000000000000000000000000000000000000000000000000000",Kvt=`Ethereum Signed Message:
`,g0e=BigInt(0),b0e=BigInt(1),y0e=BigInt(2),v0e=BigInt(27),w0e=BigInt(28),ZI=BigInt(35),D6={};function C0e(e){return i1(sl(e),32)}var $4,l0,U4,Ew;const Rp=class Rp{constructor(t,n,r,s){Ln(this,$4);Ln(this,l0);Ln(this,U4);Ln(this,Ew);l5(t,D6,"Signature"),Wt(this,$4,n),Wt(this,l0,r),Wt(this,U4,s),Wt(this,Ew,null)}get r(){return Ue(this,$4)}set r(t){Cn(t4(t)===32,"invalid r","value",t),Wt(this,$4,qr(t))}get s(){return Cn(parseInt(Ue(this,l0).substring(0,3))<8,"non-canonical s; use ._s","s",Ue(this,l0)),Ue(this,l0)}set s(t){Cn(t4(t)===32,"invalid s","value",t),Wt(this,l0,qr(t))}get _s(){return Ue(this,l0)}isValid(){return parseInt(Ue(this,l0).substring(0,3))<8}get v(){return Ue(this,U4)}set v(t){const n=Li(t,"value");Cn(n===27||n===28,"invalid v","v",t),Wt(this,U4,n)}get networkV(){return Ue(this,Ew)}get legacyChainId(){const t=this.networkV;return t==null?null:Rp.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){const t=fs(this.s);return this.yParity&&(t[0]|=128),qr(t)}get compactSerialized(){return Ra([this.r,this.yParityAndS])}get serialized(){return Ra([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this._s}"${this.isValid()?"":', valid: "false"'}, yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const t=new Rp(D6,this.r,this._s,this.v);return this.networkV&&Wt(t,Ew,this.networkV),t}toJSON(){const t=this.networkV;return{_type:"signature",networkV:t!=null?t.toString():null,r:this.r,s:this._s,v:this.v}}static getChainId(t){const n=Ns(t,"v");return n==v0e||n==w0e?g0e:(Cn(n>=ZI,"invalid EIP-155 v","v",t),(n-ZI)/y0e)}static getChainIdV(t,n){return Ns(t)*y0e+BigInt(35+n-27)}static getNormalizedV(t){const n=Ns(t);return n===g0e||n===v0e?27:n===b0e||n===w0e?28:(Cn(n>=ZI,"invalid v","v",t),n&b0e?27:28)}static from(t){function n(u,d){Cn(u,d,"signature",t)}if(t==null)return new Rp(D6,x0e,x0e,27);if(typeof t=="string"){const u=fs(t,"signature");if(u.length===64){const d=qr(u.slice(0,32)),f=u.slice(32,64),x=f[0]&128?28:27;return f[0]&=127,new Rp(D6,d,qr(f),x)}if(u.length===65){const d=qr(u.slice(0,32)),f=qr(u.slice(32,64)),x=Rp.getNormalizedV(u[64]);return new Rp(D6,d,f,x)}n(!1,"invalid raw signature length")}if(t instanceof Rp)return t.clone();const r=t.r;n(r!=null,"missing r");const s=C0e(r),a=function(u,d){if(u!=null)return C0e(u);if(d!=null){n(co(d,32),"invalid yParityAndS");const f=fs(d);return f[0]&=127,qr(f)}n(!1,"missing s")}(t.s,t.yParityAndS),{networkV:o,v:l}=function(u,d,f){if(u!=null){const x=Ns(u);return{networkV:x>=ZI?x:void 0,v:Rp.getNormalizedV(x)}}if(d!=null)return n(co(d,32),"invalid yParityAndS"),{v:fs(d)[0]&128?28:27};if(f!=null){switch(Li(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(t.v,t.yParityAndS,t.yParity),c=new Rp(D6,s,a,l);return o&&Wt(c,Ew,o),n(t.yParity==null||Li(t.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),n(t.yParityAndS==null||t.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};$4=new WeakMap,l0=new WeakMap,U4=new WeakMap,Ew=new WeakMap;let nu=Rp;var vg;const Lv=class Lv{constructor(t){Ln(this,vg);Cn(t4(t)===32,"invalid private key","privateKey","[REDACTED]"),Wt(this,vg,qr(t))}get privateKey(){return Ue(this,vg)}get publicKey(){return Lv.computePublicKey(Ue(this,vg))}get compressedPublicKey(){return Lv.computePublicKey(Ue(this,vg),!0)}sign(t){Cn(t4(t)===32,"invalid digest length","digest",t);const n=Nb.sign(Jc(t),Jc(Ue(this,vg)),{lowS:!0});return nu.from({r:a1(n.r,32),s:a1(n.s,32),v:n.recovery?28:27})}computeSharedSecret(t){const n=Lv.computePublicKey(t);return qr(Nb.getSharedSecret(Jc(Ue(this,vg)),fs(n),!1))}static computePublicKey(t,n){let r=fs(t,"key");if(r.length===32){const a=Nb.getPublicKey(r,!!n);return qr(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const s=Nb.ProjectivePoint.fromHex(r);return qr(s.toRawBytes(n))}static recoverPublicKey(t,n){Cn(t4(t)===32,"invalid digest length","digest",t);const r=nu.from(n);let s=Nb.Signature.fromCompact(Jc(Ra([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const a=s.recoverPublicKey(Jc(t));return Cn(a!=null,"invalid signature for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(t,n,r){const s=Nb.ProjectivePoint.fromHex(Lv.computePublicKey(t).substring(2)),a=Nb.ProjectivePoint.fromHex(Lv.computePublicKey(n).substring(2));return"0x"+s.add(a).toHex(!!r)}};vg=new WeakMap;let L0=Lv;const Yvt=BigInt(0),Xvt=BigInt(36);function S0e(e){e=e.toLowerCase();const t=e.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=t[s].charCodeAt(0);const r=fs(lo(n));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(r[s>>1]&15)>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}const mae={};for(let e=0;e<10;e++)mae[String(e)]=String(e);for(let e=0;e<26;e++)mae[String.fromCharCode(65+e)]=String(10+e);const N0e=15;function Qvt(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(r=>mae[r]).join("");for(;t.length>=N0e;){let r=t.substring(0,N0e);t=parseInt(r,10)%97+t.substring(r.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}const Zvt=function(){const e={};for(let t=0;t<36;t++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[t];e[n]=BigInt(t)}return e}();function Jvt(e){e=e.toLowerCase();let t=Yvt;for(let n=0;n<e.length;n++)t=t*Xvt+Zvt[e[n]];return t}function na(e){if(Cn(typeof e=="string","invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=S0e(e);return Cn(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Cn(e.substring(2,4)===Qvt(e),"bad icap checksum","address",e);let t=Jvt(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return S0e("0x"+t)}Cn(!1,"invalid address","address",e)}function ewt(e){const t=na(e.from);let r=Ns(e.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,na(go(lo(o1([t,r])),12))}function CTe(e){return e&&typeof e.getAddress=="function"}async function MH(e,t){const n=await t;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(Mr(typeof e!="string","unconfigured name","UNCONFIGURED_NAME",{value:e}),Cn(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),na(n)}function _c(e,t){if(typeof e=="string")return e.match(/^0x[0-9a-f]{40}$/i)?na(e):(Mr(t!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),MH(e,t.resolveName(e)));if(CTe(e))return MH(e,e.getAddress());if(e&&typeof e.then=="function")return MH(e,e);Cn(!1,"unsupported addressable value","target",e)}const og={};function js(e,t){let n=!1;return t<0&&(n=!0,t*=-1),new Mu(og,`${n?"":"u"}int${t}`,e,{signed:n,width:t})}function ha(e,t){return new Mu(og,`bytes${t||""}`,e,{size:t})}const A0e=Symbol.for("_ethers_typed");var _w;const cg=class cg{constructor(t,n,r,s){Bn(this,"type");Bn(this,"value");Ln(this,_w);Bn(this,"_typedSymbol");s==null&&(s=null),l5(og,t,"Typed"),Rs(this,{_typedSymbol:A0e,type:n,value:r}),Wt(this,_w,s),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.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 Ue(this,_w)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return Ue(this,_w)===!0?-1:Ue(this,_w)===!1?this.value.length:null}static from(t,n){return new cg(og,t,n)}static uint8(t){return js(t,8)}static uint16(t){return js(t,16)}static uint24(t){return js(t,24)}static uint32(t){return js(t,32)}static uint40(t){return js(t,40)}static uint48(t){return js(t,48)}static uint56(t){return js(t,56)}static uint64(t){return js(t,64)}static uint72(t){return js(t,72)}static uint80(t){return js(t,80)}static uint88(t){return js(t,88)}static uint96(t){return js(t,96)}static uint104(t){return js(t,104)}static uint112(t){return js(t,112)}static uint120(t){return js(t,120)}static uint128(t){return js(t,128)}static uint136(t){return js(t,136)}static uint144(t){return js(t,144)}static uint152(t){return js(t,152)}static uint160(t){return js(t,160)}static uint168(t){return js(t,168)}static uint176(t){return js(t,176)}static uint184(t){return js(t,184)}static uint192(t){return js(t,192)}static uint200(t){return js(t,200)}static uint208(t){return js(t,208)}static uint216(t){return js(t,216)}static uint224(t){return js(t,224)}static uint232(t){return js(t,232)}static uint240(t){return js(t,240)}static uint248(t){return js(t,248)}static uint256(t){return js(t,256)}static uint(t){return js(t,256)}static int8(t){return js(t,-8)}static int16(t){return js(t,-16)}static int24(t){return js(t,-24)}static int32(t){return js(t,-32)}static int40(t){return js(t,-40)}static int48(t){return js(t,-48)}static int56(t){return js(t,-56)}static int64(t){return js(t,-64)}static int72(t){return js(t,-72)}static int80(t){return js(t,-80)}static int88(t){return js(t,-88)}static int96(t){return js(t,-96)}static int104(t){return js(t,-104)}static int112(t){return js(t,-112)}static int120(t){return js(t,-120)}static int128(t){return js(t,-128)}static int136(t){return js(t,-136)}static int144(t){return js(t,-144)}static int152(t){return js(t,-152)}static int160(t){return js(t,-160)}static int168(t){return js(t,-168)}static int176(t){return js(t,-176)}static int184(t){return js(t,-184)}static int192(t){return js(t,-192)}static int200(t){return js(t,-200)}static int208(t){return js(t,-208)}static int216(t){return js(t,-216)}static int224(t){return js(t,-224)}static int232(t){return js(t,-232)}static int240(t){return js(t,-240)}static int248(t){return js(t,-248)}static int256(t){return js(t,-256)}static int(t){return js(t,-256)}static bytes1(t){return ha(t,1)}static bytes2(t){return ha(t,2)}static bytes3(t){return ha(t,3)}static bytes4(t){return ha(t,4)}static bytes5(t){return ha(t,5)}static bytes6(t){return ha(t,6)}static bytes7(t){return ha(t,7)}static bytes8(t){return ha(t,8)}static bytes9(t){return ha(t,9)}static bytes10(t){return ha(t,10)}static bytes11(t){return ha(t,11)}static bytes12(t){return ha(t,12)}static bytes13(t){return ha(t,13)}static bytes14(t){return ha(t,14)}static bytes15(t){return ha(t,15)}static bytes16(t){return ha(t,16)}static bytes17(t){return ha(t,17)}static bytes18(t){return ha(t,18)}static bytes19(t){return ha(t,19)}static bytes20(t){return ha(t,20)}static bytes21(t){return ha(t,21)}static bytes22(t){return ha(t,22)}static bytes23(t){return ha(t,23)}static bytes24(t){return ha(t,24)}static bytes25(t){return ha(t,25)}static bytes26(t){return ha(t,26)}static bytes27(t){return ha(t,27)}static bytes28(t){return ha(t,28)}static bytes29(t){return ha(t,29)}static bytes30(t){return ha(t,30)}static bytes31(t){return ha(t,31)}static bytes32(t){return ha(t,32)}static address(t){return new cg(og,"address",t)}static bool(t){return new cg(og,"bool",!!t)}static bytes(t){return new cg(og,"bytes",t)}static string(t){return new cg(og,"string",t)}static array(t,n){throw new Error("not implemented yet")}static tuple(t,n){throw new Error("not implemented yet")}static overrides(t){return new cg(og,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===A0e}static dereference(t,n){if(cg.isTyped(t)){if(t.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${t.type}`);return t.value}return t}};_w=new WeakMap;let Mu=cg;class twt extends S1{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,n){let r=Mu.dereference(n,"string");try{r=na(r)}catch(s){return this._throwError(s.message,n)}return t.writeValue(r)}decode(t){return na(a1(t.readValue(),20))}}class nwt extends S1{constructor(n){super(n.name,n.type,"_",n.dynamic);Bn(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 STe(e,t,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let c={};r=t.map(u=>{const d=u.localName;return Mr(d,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),Mr(!c[d],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),c[d]=!0,n[d]})}else Cn(!1,"invalid tuple value","tuple",n);Cn(t.length===r.length,"types/value length mismatch","tuple",n);let s=new CJ,a=new CJ,o=[];t.forEach((c,u)=>{let d=r[u];if(c.dynamic){let f=a.length;c.encode(a,d);let x=s.writeUpdatableValue();o.push(g=>{x(g+f)})}else c.encode(s,d)}),o.forEach(c=>{c(s.length)});let l=e.appendWriter(s);return l+=e.appendWriter(a),l}function NTe(e,t){let n=[],r=[],s=e.subReader(0);return t.forEach(a=>{let o=null;if(a.dynamic){let l=e.readIndex(),c=s.subReader(l);try{o=a.decode(c)}catch(u){if(Zc(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(e)}catch(l){if(Zc(l,"BUFFER_OVERRUN"))throw l;o=l,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)}),gM.fromItems(n,r)}class rwt extends S1{constructor(n,r,s){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,s,o);Bn(this,"coder");Bn(this,"length");Rs(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let s=0;s<this.length;s++)r.push(n);return r}encode(n,r){const s=Mu.dereference(r,"array");Array.isArray(s)||this._throwError("expected array value",s);let a=this.length;a===-1&&(a=s.length,n.writeValue(s.length)),cke(s.length,a,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let l=0;l<s.length;l++)o.push(this.coder);return STe(n,o,s)}decode(n){let r=this.length;r===-1&&(r=n.readIndex(),Mr(r*id<=n.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:n.bytes,offset:r*id,length:n.dataLength}));let s=[];for(let a=0;a<r;a++)s.push(new nwt(this.coder));return NTe(n,s)}}class swt extends S1{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,n){const r=Mu.dereference(n,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}}class ATe extends S1{constructor(t,n){super(t,t,n,!0)}defaultValue(){return"0x"}encode(t,n){n=Jc(n);let r=t.writeValue(n.length);return r+=t.writeBytes(n),r}decode(t){return t.readBytes(t.readIndex(),!0)}}class iwt extends ATe{constructor(t){super("bytes",t)}decode(t){return qr(super.decode(t))}}class awt extends S1{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);Bn(this,"size");Rs(this,{size:n},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,r){let s=Jc(Mu.dereference(r,this.type));return s.length!==this.size&&this._throwError("incorrect data length",r),n.writeBytes(s)}decode(n){return qr(n.readBytes(this.size))}}const owt=new Uint8Array([]);class lwt extends S1{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,n){return n!=null&&this._throwError("not null",n),t.writeBytes(owt)}decode(t){return t.readBytes(0),null}}const cwt=BigInt(0),uwt=BigInt(1),dwt=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class fwt extends S1{constructor(n,r,s){const a=(r?"int":"uint")+n*8;super(a,a,s,!1);Bn(this,"size");Bn(this,"signed");Rs(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=Ns(Mu.dereference(r,this.type)),a=fj(dwt,id*8);if(this.signed){let o=fj(a,this.size*8-1);(s>o||s<-(o+uwt))&&this._throwError("value out-of-bounds",r),s=hke(s,8*id)}else(s<cwt||s>fj(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(s)}decode(n){let r=fj(n.readValue(),this.size*8);return this.signed&&(r=Vyt(r,this.size*8)),r}}class hwt extends ATe{constructor(t){super("string",t)}defaultValue(){return""}encode(t,n){return super.encode(t,ud(Mu.dereference(n,"string")))}decode(t){return xM(super.decode(t))}}class JI extends S1{constructor(n,r){let s=!1;const a=[];n.forEach(l=>{l.dynamic&&(s=!0),a.push(l.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,s);Bn(this,"coders");Rs(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(s=>{n.push(s.defaultValue())});const r=this.coders.reduce((s,a)=>{const o=a.localName;return o&&(s[o]||(s[o]=0),s[o]++),s},{});return this.coders.forEach((s,a)=>{let o=s.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const s=Mu.dereference(r,"tuple");return STe(n,this.coders,s)}decode(n){return NTe(n,this.coders)}}function RH(e,t){return{address:na(e),storageKeys:t.map((n,r)=>(Cn(co(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function c5(e){if(Array.isArray(e))return e.map((n,r)=>Array.isArray(n)?(Cn(n.length===2,"invalid slot set",`value[${r}]`,n),RH(n[0],n[1])):(Cn(n!=null&&typeof n=="object","invalid address-slot set","value",e),RH(n.address,n.storageKeys)));Cn(e!=null&&typeof e=="object","invalid access list","value",e);const t=Object.keys(e).map(n=>{const r=e[n].reduce((s,a)=>(s[a]=!0,s),{});return RH(n,Object.keys(r).sort())});return t.sort((n,r)=>n.address.localeCompare(r.address)),t}function jTe(e){return{address:na(e.address),nonce:Ns(e.nonce!=null?e.nonce:0),chainId:Ns(e.chainId!=null?e.chainId:0),signature:nu.from(e.signature)}}function $k(e){let t;return typeof e=="string"?t=L0.computePublicKey(e,!1):t=e.publicKey,na(lo("0x"+t.substring(4)).substring(26))}function pwt(e,t){return $k(L0.recoverPublicKey(e,t))}const Nc=BigInt(0),mwt=BigInt(2),xwt=BigInt(27),gwt=BigInt(28),bwt=BigInt(35),ywt=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),LH=4096*32;function vwt(e){return{blobToKzgCommitment:r=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return fs(e.blobToKzgCommitment(qr(r)))}else if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return fs(e.blobToKzgCommitment(r));if("blobToKZGCommitment"in e&&typeof e.blobToKZGCommitment=="function")return fs(e.blobToKZGCommitment(qr(r)));Cn(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(r,s)=>{if("computeBlobProof"in e&&typeof e.computeBlobProof=="function")return fs(e.computeBlobProof(qr(r),qr(s)));if("computeBlobKzgProof"in e&&typeof e.computeBlobKzgProof=="function")return e.computeBlobKzgProof(r,s);if("computeBlobKZGProof"in e&&typeof e.computeBlobKZGProof=="function")return fs(e.computeBlobKZGProof(qr(r),qr(s)));Cn(!1,"unsupported KZG library","kzg",e)}}}function j0e(e,t){let n=e.toString(16);for(;n.length<2;)n="0"+n;return n+=op(t).substring(4),"0x"+n}function FA(e){return e==="0x"?null:na(e)}function LB(e,t){try{return c5(e)}catch(n){Cn(!1,n.message,t,e)}}function wwt(e,t){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const n=[];for(let r=0;r<e.length;r++){const s=e[r];if(!Array.isArray(s))throw new Error(`authorization[${r}]: invalid array`);if(s.length!==6)throw new Error(`authorization[${r}]: wrong length`);if(!s[1])throw new Error(`authorization[${r}]: null address`);n.push({address:FA(s[1]),nonce:Ha(s[2],"nonce"),chainId:Ha(s[0],"chainId"),signature:nu.from({yParity:u5(s[3],"yParity"),r:i1(s[4],32),s:i1(s[5],32)})})}return n}catch(n){Cn(!1,n.message,t,e)}}function u5(e,t){return e==="0x"?0:Li(e,t)}function Ha(e,t){if(e==="0x")return Nc;const n=Ns(e,t);return Cn(n<=ywt,"value exceeds uint size",t,n),n}function ta(e,t){const n=Ns(e,"value"),r=sl(n);return Cn(r.length<=32,"value too large",`tx.${t}`,n),r}function DB(e){return c5(e).map(t=>[t.address,t.storageKeys])}function Cwt(e){return e.map(t=>[ta(t.chainId,"chainId"),t.address,ta(t.nonce,"nonce"),ta(t.signature.yParity,"yParity"),sl(t.signature.r),sl(t.signature.s)])}function Swt(e,t){Cn(Array.isArray(e),`invalid ${t}`,"value",e);for(let n=0;n<e.length;n++)Cn(co(e[n],32),"invalid ${ param } hash",`value[${n}]`,e[n]);return e}function Nwt(e){const t=Dk(e);Cn(Array.isArray(t)&&(t.length===9||t.length===6),"invalid field count for legacy transaction","data",e);const n={type:0,nonce:u5(t[0],"nonce"),gasPrice:Ha(t[1],"gasPrice"),gasLimit:Ha(t[2],"gasLimit"),to:FA(t[3]),value:Ha(t[4],"value"),data:qr(t[5]),chainId:Nc};if(t.length===6)return n;const r=Ha(t[6],"v"),s=Ha(t[7],"r"),a=Ha(t[8],"s");if(s===Nc&&a===Nc)n.chainId=r;else{let o=(r-bwt)/mwt;o<Nc&&(o=Nc),n.chainId=o,Cn(o!==Nc||r===xwt||r===gwt,"non-canonical legacy v","v",t[6]),n.signature=nu.from({r:i1(t[7],32),s:i1(t[8],32),v:r})}return n}function Awt(e,t){const n=[ta(e.nonce,"nonce"),ta(e.gasPrice||0,"gasPrice"),ta(e.gasLimit,"gasLimit"),e.to||"0x",ta(e.value,"value"),e.data];let r=Nc;if(e.chainId!=Nc)r=Ns(e.chainId,"tx.chainId"),Cn(!t||t.networkV==null||t.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const a=e.signature.legacyChainId;a!=null&&(r=a)}if(!t)return r!==Nc&&(n.push(sl(r)),n.push("0x"),n.push("0x")),o1(n);let s=BigInt(27+t.yParity);return r!==Nc?s=nu.getChainIdV(r,t.v):BigInt(t.v)!==s&&Cn(!1,"tx.chainId/sig.v mismatch","sig",t),n.push(sl(s)),n.push(sl(t.r)),n.push(sl(t.s)),o1(n)}function BB(e,t){let n;try{if(n=u5(t[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{Cn(!1,"invalid yParity","yParity",t[0])}const r=i1(t[1],32),s=i1(t[2],32),a=nu.from({r,s,yParity:n});e.signature=a}function jwt(e){const t=Dk(fs(e).slice(1));Cn(Array.isArray(t)&&(t.length===9||t.length===12),"invalid field count for transaction type: 2","data",qr(e));const n={type:2,chainId:Ha(t[0],"chainId"),nonce:u5(t[1],"nonce"),maxPriorityFeePerGas:Ha(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ha(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ha(t[4],"gasLimit"),to:FA(t[5]),value:Ha(t[6],"value"),data:qr(t[7]),accessList:LB(t[8],"accessList")};return t.length===9||BB(n,t.slice(9)),n}function Ewt(e,t){const n=[ta(e.chainId,"chainId"),ta(e.nonce,"nonce"),ta(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ta(e.maxFeePerGas||0,"maxFeePerGas"),ta(e.gasLimit,"gasLimit"),e.to||"0x",ta(e.value,"value"),e.data,DB(e.accessList||[])];return t&&(n.push(ta(t.yParity,"yParity")),n.push(sl(t.r)),n.push(sl(t.s))),Ra(["0x02",o1(n)])}function _wt(e){const t=Dk(fs(e).slice(1));Cn(Array.isArray(t)&&(t.length===8||t.length===11),"invalid field count for transaction type: 1","data",qr(e));const n={type:1,chainId:Ha(t[0],"chainId"),nonce:u5(t[1],"nonce"),gasPrice:Ha(t[2],"gasPrice"),gasLimit:Ha(t[3],"gasLimit"),to:FA(t[4]),value:Ha(t[5],"value"),data:qr(t[6]),accessList:LB(t[7],"accessList")};return t.length===8||BB(n,t.slice(8)),n}function kwt(e,t){const n=[ta(e.chainId,"chainId"),ta(e.nonce,"nonce"),ta(e.gasPrice||0,"gasPrice"),ta(e.gasLimit,"gasLimit"),e.to||"0x",ta(e.value,"value"),e.data,DB(e.accessList||[])];return t&&(n.push(ta(t.yParity,"recoveryParam")),n.push(sl(t.r)),n.push(sl(t.s))),Ra(["0x01",o1(n)])}function Twt(e){let t=Dk(fs(e).slice(1)),n="3",r=null;if(t.length===4&&Array.isArray(t[0])){n="3 (network format)";const a=t[1],o=t[2],l=t[3];Cn(Array.isArray(a),"invalid network format: blobs not an array","fields[1]",a),Cn(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),Cn(Array.isArray(l),"invalid network format: proofs not an array","fields[3]",l),Cn(a.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",t),Cn(a.length===l.length,"invalid network format: blobs/proofs length mismatch","fields",t),r=[];for(let c=0;c<t[1].length;c++)r.push({data:a[c],commitment:o[c],proof:l[c]});t=t[0]}Cn(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${n}`,"data",qr(e));const s={type:3,chainId:Ha(t[0],"chainId"),nonce:u5(t[1],"nonce"),maxPriorityFeePerGas:Ha(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ha(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ha(t[4],"gasLimit"),to:FA(t[5]),value:Ha(t[6],"value"),data:qr(t[7]),accessList:LB(t[8],"accessList"),maxFeePerBlobGas:Ha(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};r&&(s.blobs=r),Cn(s.to!=null,`invalid address for transaction type: ${n}`,"data",e),Cn(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let a=0;a<s.blobVersionedHashes.length;a++)Cn(co(s.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",e);return t.length===11||BB(s,t.slice(11)),s}function Iwt(e,t,n){const r=[ta(e.chainId,"chainId"),ta(e.nonce,"nonce"),ta(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ta(e.maxFeePerGas||0,"maxFeePerGas"),ta(e.gasLimit,"gasLimit"),e.to||lE,ta(e.value,"value"),e.data,DB(e.accessList||[]),ta(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Swt(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(r.push(ta(t.yParity,"yParity")),r.push(sl(t.r)),r.push(sl(t.s)),n)?Ra(["0x03",o1([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):Ra(["0x03",o1(r)])}function Pwt(e){const t=Dk(fs(e).slice(1));Cn(Array.isArray(t)&&(t.length===10||t.length===13),"invalid field count for transaction type: 4","data",qr(e));const n={type:4,chainId:Ha(t[0],"chainId"),nonce:u5(t[1],"nonce"),maxPriorityFeePerGas:Ha(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ha(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ha(t[4],"gasLimit"),to:FA(t[5]),value:Ha(t[6],"value"),data:qr(t[7]),accessList:LB(t[8],"accessList"),authorizationList:wwt(t[9],"authorizationList")};return t.length===10||BB(n,t.slice(10)),n}function Fwt(e,t){const n=[ta(e.chainId,"chainId"),ta(e.nonce,"nonce"),ta(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ta(e.maxFeePerGas||0,"maxFeePerGas"),ta(e.gasLimit,"gasLimit"),e.to||"0x",ta(e.value,"value"),e.data,DB(e.accessList||[]),Cwt(e.authorizationList||[])];return t&&(n.push(ta(t.yParity,"yParity")),n.push(sl(t.r)),n.push(sl(t.s))),Ra(["0x04",o1(n)])}var Wp,z4,H4,V4,W4,q4,G4,K4,Y4,X4,Q4,Z4,kw,Yb,c0,Xb,J4,eS,YF,Rf;let xae=(Rf=class{constructor(){Ln(this,eS);Ln(this,Wp);Ln(this,z4);Ln(this,H4);Ln(this,V4);Ln(this,W4);Ln(this,q4);Ln(this,G4);Ln(this,K4);Ln(this,Y4);Ln(this,X4);Ln(this,Q4);Ln(this,Z4);Ln(this,kw);Ln(this,Yb);Ln(this,c0);Ln(this,Xb);Ln(this,J4);Wt(this,Wp,null),Wt(this,z4,null),Wt(this,V4,0),Wt(this,W4,Nc),Wt(this,q4,null),Wt(this,G4,null),Wt(this,K4,null),Wt(this,H4,"0x"),Wt(this,Y4,Nc),Wt(this,X4,Nc),Wt(this,Q4,null),Wt(this,Z4,null),Wt(this,kw,null),Wt(this,Yb,null),Wt(this,c0,null),Wt(this,Xb,null),Wt(this,J4,null)}get type(){return Ue(this,Wp)}set type(t){switch(t){case null:Wt(this,Wp,null);break;case 0:case"legacy":Wt(this,Wp,0);break;case 1:case"berlin":case"eip-2930":Wt(this,Wp,1);break;case 2:case"london":case"eip-1559":Wt(this,Wp,2);break;case 3:case"cancun":case"eip-4844":Wt(this,Wp,3);break;case 4:case"pectra":case"eip-7702":Wt(this,Wp,4);break;default:Cn(!1,"unsupported transaction type","type",t)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const t=Ue(this,z4);return t==null&&this.type===3?lE:t}set to(t){Wt(this,z4,t==null?null:na(t))}get nonce(){return Ue(this,V4)}set nonce(t){Wt(this,V4,Li(t,"value"))}get gasLimit(){return Ue(this,W4)}set gasLimit(t){Wt(this,W4,Ns(t))}get gasPrice(){const t=Ue(this,q4);return t==null&&(this.type===0||this.type===1)?Nc:t}set gasPrice(t){Wt(this,q4,t==null?null:Ns(t,"gasPrice"))}get maxPriorityFeePerGas(){const t=Ue(this,G4);return t??(this.type===2||this.type===3?Nc:null)}set maxPriorityFeePerGas(t){Wt(this,G4,t==null?null:Ns(t,"maxPriorityFeePerGas"))}get maxFeePerGas(){const t=Ue(this,K4);return t??(this.type===2||this.type===3?Nc:null)}set maxFeePerGas(t){Wt(this,K4,t==null?null:Ns(t,"maxFeePerGas"))}get data(){return Ue(this,H4)}set data(t){Wt(this,H4,qr(t))}get value(){return Ue(this,Y4)}set value(t){Wt(this,Y4,Ns(t,"value"))}get chainId(){return Ue(this,X4)}set chainId(t){Wt(this,X4,Ns(t))}get signature(){return Ue(this,Q4)||null}set signature(t){Wt(this,Q4,t==null?null:nu.from(t))}get accessList(){const t=Ue(this,Z4)||null;return t??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(t){Wt(this,Z4,t==null?null:c5(t))}get authorizationList(){const t=Ue(this,J4)||null;return t==null&&this.type===4?[]:t}set authorizationList(t){Wt(this,J4,t==null?null:t.map(n=>jTe(n)))}get maxFeePerBlobGas(){const t=Ue(this,kw);return t==null&&this.type===3?Nc:t}set maxFeePerBlobGas(t){Wt(this,kw,t==null?null:Ns(t,"maxFeePerBlobGas"))}get blobVersionedHashes(){let t=Ue(this,Yb);return t==null&&this.type===3?[]:t}set blobVersionedHashes(t){if(t!=null){Cn(Array.isArray(t),"blobVersionedHashes must be an Array","value",t),t=t.slice();for(let n=0;n<t.length;n++)Cn(co(t[n],32),"invalid blobVersionedHash",`value[${n}]`,t[n])}Wt(this,Yb,t)}get blobs(){return Ue(this,Xb)==null?null:Ue(this,Xb).map(t=>Object.assign({},t))}set blobs(t){if(t==null){Wt(this,Xb,null);return}const n=[],r=[];for(let s=0;s<t.length;s++){const a=t[s];if(kB(a)){Mr(Ue(this,c0),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=fs(a);if(Cn(o.length<=LH,"blob is too large",`blobs[${s}]`,a),o.length!==LH){const u=new Uint8Array(LH);u.set(o),o=u}const l=Ue(this,c0).blobToKzgCommitment(o),c=qr(Ue(this,c0).computeBlobKzgProof(o,l));n.push({data:qr(o),commitment:qr(l),proof:c}),r.push(j0e(1,l))}else{const o=qr(a.commitment);n.push({data:qr(a.data),commitment:o,proof:qr(a.proof)}),r.push(j0e(1,o))}}Wt(this,Xb,n),Wt(this,Yb,r)}get kzg(){return Ue(this,c0)}set kzg(t){t==null?Wt(this,c0,null):Wt(this,c0,vwt(t))}get hash(){return this.signature==null?null:lo(xr(this,eS,YF).call(this,!0,!1))}get unsignedHash(){return lo(this.unsignedSerialized)}get from(){return this.signature==null?null:pwt(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:L0.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return xr(this,eS,YF).call(this,!0,!0)}get unsignedSerialized(){return xr(this,eS,YF).call(this,!1,!1)}inferType(){const t=this.inferTypes();return t.indexOf(2)>=0?2:t.pop()}inferTypes(){const t=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,s=Ue(this,kw)!=null||Ue(this,Yb);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Mr(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Mr(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Mr(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):this.authorizationList&&this.authorizationList.length?a.push(4):n?a.push(2):t?(a.push(1),r||a.push(0)):r?(a.push(1),a.push(2)):(s&&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 Rf.from(this)}toJSON(){const t=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:t(this.gasLimit),gasPrice:t(this.gasPrice),maxPriorityFeePerGas:t(this.maxPriorityFeePerGas),maxFeePerGas:t(this.maxFeePerGas),value:t(this.value),chainId:t(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(t){if(t==null)return new Rf;if(typeof t=="string"){const r=fs(t);if(r[0]>=127)return Rf.from(Nwt(r));switch(r[0]){case 1:return Rf.from(_wt(r));case 2:return Rf.from(jwt(r));case 3:return Rf.from(Twt(r));case 4:return Rf.from(Pwt(r))}Mr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Rf;return t.type!=null&&(n.type=t.type),t.to!=null&&(n.to=t.to),t.nonce!=null&&(n.nonce=t.nonce),t.gasLimit!=null&&(n.gasLimit=t.gasLimit),t.gasPrice!=null&&(n.gasPrice=t.gasPrice),t.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas),t.maxFeePerGas!=null&&(n.maxFeePerGas=t.maxFeePerGas),t.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas),t.data!=null&&(n.data=t.data),t.value!=null&&(n.value=t.value),t.chainId!=null&&(n.chainId=t.chainId),t.signature!=null&&(n.signature=nu.from(t.signature)),t.accessList!=null&&(n.accessList=t.accessList),t.authorizationList!=null&&(n.authorizationList=t.authorizationList),t.blobVersionedHashes!=null&&(n.blobVersionedHashes=t.blobVersionedHashes),t.kzg!=null&&(n.kzg=t.kzg),t.blobs!=null&&(n.blobs=t.blobs),t.hash!=null&&(Cn(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",t),Cn(n.hash===t.hash,"hash mismatch","tx",t)),t.from!=null&&(Cn(n.isSigned(),"unsigned transaction cannot define '.from'","tx",t),Cn(n.from.toLowerCase()===(t.from||"").toLowerCase(),"from mismatch","tx",t)),n}},Wp=new WeakMap,z4=new WeakMap,H4=new WeakMap,V4=new WeakMap,W4=new WeakMap,q4=new WeakMap,G4=new WeakMap,K4=new WeakMap,Y4=new WeakMap,X4=new WeakMap,Q4=new WeakMap,Z4=new WeakMap,kw=new WeakMap,Yb=new WeakMap,c0=new WeakMap,Xb=new WeakMap,J4=new WeakMap,eS=new WeakSet,YF=function(t,n){Mr(!t||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=t?this.signature:null;switch(this.inferType()){case 0:return Awt(this,r);case 1:return kwt(this,r);case 2:return Ewt(this,r);case 3:return Iwt(this,r,n?this.blobs:null);case 4:return Fwt(this,r)}Mr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})},Rf);function Owt(e){return Cn(typeof e.address=="string","invalid address for hashAuthorization","auth.address",e),lo(Ra(["0x05",o1([e.chainId!=null?sl(e.chainId):"0x",na(e.address),e.nonce!=null?sl(e.nonce):"0x"])]))}function l1(e){return lo(ud(e))}var Mwt="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const E0e=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),_0e=4;function Rwt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let F=1;F<r;F++)a.push(s+=n());let o=n(),l=t;t+=o;let c=0,u=0;function d(){return c==0&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=31,x=2**f,g=x>>>1,v=g>>1,w=x-1;let C=0;for(let F=0;F<f;F++)C=C<<1|d();let N=[],I=0,P=x;for(;;){let F=Math.floor(((C-I+1)*s-1)/P),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;F<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=I+Math.floor(P*a[U]/s),Q=I+Math.floor(P*a[U+1]/s)-1;for(;!((z^Q)&g);)C=C<<1&w|d(),z=z<<1&w,Q=Q<<1&w|1;for(;z&~Q&v;)C=C&g|C<<1&w>>>1|d(),z=z<<1^g,Q=(Q^g)<<1|g|1;I=z,P=1+Q-z}let R=r-4;return N.map(F=>{switch(F-R){case 3:return R+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return R+256+(e[l++]<<8|e[l++]);case 1:return R+e[l++];default:return F-1}})}function Lwt(e){let t=0;return()=>e[t++]}function ETe(e){return Lwt(Rwt(Dwt(e)))}function Dwt(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,a)=>t[s.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,a=0,o=0,l=0;s<n;s++)l=l<<6|t[e.charCodeAt(s)],o+=6,o>=8&&(r[a++]=l>>(o-=8));return r}function Bwt(e){return e&1?~e>>1:e>>1}function $wt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=Bwt(t());return n}function cE(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let a=0;a<s;a++)n.push(t+a);t+=s+1}return n}function _Te(e){return uE(()=>{let t=cE(e);if(t.length)return t})}function kTe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(Uwt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(zwt(n,e))}return t.flat()}function uE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function TTe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)$wt(e,n).forEach((a,o)=>r[o].push(a));return r}function Uwt(e,t){let n=1+t(),r=t(),s=uE(t);return TTe(s.length,1+e,t).flatMap((o,l)=>{let[c,...u]=o;return Array(s[l]).fill().map((d,f)=>{let x=f*r;return[c+f*n,u.map(g=>g+x)]})})}function zwt(e,t){let n=1+t();return TTe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function Hwt(e){let t=[],n=cE(e);return s(r([]),[]),t;function r(a){let o=e(),l=uE(()=>{let c=cE(e).map(u=>n[u]);if(c.length)return r(c)});return{S:o,B:l,Q:a}}function s({S:a,B:o},l,c){if(!(a&4&&c===l[l.length-1])){a&2&&(c=l[l.length-1]),a&1&&t.push(l);for(let u of o)for(let d of u.Q)s(u,[...l,d],c)}}}function Vwt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function ITe(e){return`{${Vwt(e)}}`}function Wwt(e){let t=[];for(let n=0,r=e.length;n<r;){let s=e.codePointAt(n);n+=s<65536?1:2,t.push(s)}return t}function $S(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...e.slice(s,s+=4096)));return r.join("")}function qwt(e,t){let n=e.length,r=n-t.length;for(let s=0;r==0&&s<n;s++)r=e[s]-t[s];return r}var Gwt="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const dE=44032,bM=4352,yM=4449,vM=4519,PTe=19,FTe=21,US=28,wM=FTe*US,Kwt=PTe*wM,Ywt=dE+Kwt,Xwt=bM+PTe,Qwt=yM+FTe,Zwt=vM+US;function pj(e){return e>>24&255}function OTe(e){return e&16777215}let TJ,k0e,IJ,XF;function Jwt(){let e=ETe(Gwt);TJ=new Map(_Te(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),k0e=new Set(cE(e)),IJ=new Map,XF=new Map;for(let[t,n]of kTe(e)){if(!k0e.has(t)&&n.length==2){let[r,s]=n,a=XF.get(r);a||(a=new Map,XF.set(r,a)),a.set(s,t)}IJ.set(t,n.reverse())}}function MTe(e){return e>=dE&&e<Ywt}function e3t(e,t){if(e>=bM&&e<Xwt&&t>=yM&&t<Qwt)return dE+(e-bM)*wM+(t-yM)*US;if(MTe(e)&&t>vM&&t<Zwt&&(e-dE)%US==0)return e+(t-vM);{let n=XF.get(e);return n&&(n=n.get(t),n)?n:-1}}function RTe(e){TJ||Jwt();let t=[],n=[],r=!1;function s(a){let o=TJ.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(MTe(a)){let o=a-dE,l=o/wM|0,c=o%wM/US|0,u=o%US;s(bM+l),s(yM+c),u>0&&s(vM+u)}else{let o=IJ.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=pj(t[0]);for(let o=1;o<t.length;o++){let l=pj(t[o]);if(l==0||a<=l){a=l;continue}let c=o-1;for(;;){let u=t[c+1];if(t[c+1]=t[c],t[c]=u,!c||(a=pj(t[--c]),a<=l))break}a=pj(t[o])}}return t}function t3t(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=pj(a),l=OTe(a);if(r==-1)o==0?r=l:t.push(l);else if(s>0&&s>=o)o==0?(t.push(r,...n),n.length=0,r=l):n.push(l),s=o;else{let c=e3t(r,l);c>=0?r=c:s==0&&o==0?(t.push(r),r=l):(n.push(l),s=o)}}return r>=0&&t.push(r,...n),t}function LTe(e){return RTe(e).map(OTe)}function n3t(e){return t3t(RTe(e))}const T0e=45,DTe=".",BTe=65039,$Te=1,CM=e=>Array.from(e);function fE(e,t){return e.P.has(t)||e.Q.has(t)}let r3t=class extends Array{get is_emoji(){return!0}},PJ,UTe,Gv,FJ,zTe,r4,DH,gC,Sv,I0e,OJ;function gae(){if(PJ)return;let e=ETe(Mwt);const t=()=>cE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));PJ=new Map(kTe(e)),UTe=n(),Gv=t(),FJ=new Set(t().map(d=>Gv[d])),Gv=new Set(Gv),zTe=n(),n();let s=_Te(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};r4=uE(d=>{let f=uE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=$S(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),DH=n(),gC=new Map;let l=t().concat(CM(DH)).sort((d,f)=>d-f);l.forEach((d,f)=>{let x=e(),g=l[f]=x?l[f-x]:{V:[],M:new Map};g.V.push(d),DH.has(d)||gC.set(d,g)});for(let{V:d,M:f}of new Set(gC.values())){let x=[];for(let v of d){let w=r4.filter(N=>fE(N,v)),C=x.find(({G:N})=>w.some(I=>N.has(I)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>CM(v.G));for(let{G:v,V:w}of x){let C=new Set(g.filter(N=>!v.has(N)));for(let N of w)f.set(N,C)}}Sv=new Set;let c=new Set;const u=d=>Sv.has(d)?c.add(d):Sv.add(d);for(let d of r4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of Sv)!gC.has(d)&&!c.has(d)&&gC.set(d,$Te);r(Sv,LTe(Sv)),I0e=Hwt(e).map(d=>r3t.from(d)).sort(qwt),OJ=new Map;for(let d of I0e){let f=[OJ];for(let x of d){let g=f.map(v=>{let w=v.get(x);return w||(w=new Map,v.set(x,w)),w});x===BTe?f.push(...g):f=g}for(let x of f)x.V=d}}function bae(e){return(HTe(e)?"":`${yae($B([e]))} `)+ITe(e)}function yae(e){return`"${e}"`}function s3t(e){if(e.length>=4&&e[2]==T0e&&e[3]==T0e)throw new Error(`invalid label extension: "${$S(e.slice(0,4))}"`)}function i3t(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function a3t(e){let t=e[0],n=E0e.get(t);if(n)throw Hj(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=E0e.get(t);if(o){if(s==a)throw Hj(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw Hj(`trailing ${n}`)}function $B(e,t=1/0,n=ITe){let r=[];o3t(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let o=0;o<a;o++){let l=e[o];HTe(l)&&(r.push($S(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push($S(e.slice(s,a))),r.join("")}function o3t(e){return gae(),Gv.has(e)}function HTe(e){return gae(),zTe.has(e)}function l3t(e){return f3t(c3t(e,n3t,m3t))}function c3t(e,t,n){if(!e)return[];gae();let r=0;return e.split(DTe).map(s=>{let a=Wwt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=p3t(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(i3t(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))s3t(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(Gv.has(d[0]))throw Hj("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&Gv.has(C[0]))throw Hj(`emoji + combining mark: "${$S(l[w-1])} + ${$B([C[0]])}"`)}a3t(d);let g=CM(new Set(x)),[v]=d3t(g);h3t(v,x),u3t(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function u3t(e,t){let n,r=[];for(let s of t){let a=gC.get(s);if(a===$Te)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):CM(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>fE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function d3t(e){let t=r4;for(let n of e){let r=t.filter(s=>fE(s,n));if(!r.length)throw r4.some(s=>fE(s,n))?WTe(t[0],n):VTe(n);if(t=r,r.length==1)break}return t}function f3t(e){return e.map(({input:t,error:n,output:r})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${yae($B(t,63))}: ${s}`)}return $S(r)}).join(DTe)}function VTe(e){return new Error(`disallowed character: ${bae(e)}`)}function WTe(e,t){let n=bae(t),r=r4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function Hj(e){return new Error(`illegal placement: ${e}`)}function h3t(e,t){for(let n of t)if(!fE(e,n))throw WTe(e,n);if(e.M){let n=LTe(t);for(let r=1,s=n.length;r<s;r++)if(FJ.has(n[r])){let a=r+1;for(let o;a<s&&FJ.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${bae(o)}`);if(a-r>_0e)throw new Error(`excessive non-spacing marks: ${yae($B(n.slice(r-1,a)))} (${a-r}/${_0e})`);r=a}}}function p3t(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=x3t(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(Sv.has(o))s.push(o);else{let l=PJ.get(o);if(l)s.push(...l);else if(!UTe.has(o))throw VTe(o)}}}return s.length&&r.push(t(s)),r}function m3t(e){return e.filter(t=>t!=BTe)}function x3t(e,t){let n=OJ,r,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:a}=n;a&&(r=a,e.length=s)}return r}const qTe=new Uint8Array(32);qTe.fill(0);function P0e(e){return Cn(e.length!==0,"invalid ENS name; empty component","comp",e),e}function GTe(e){const t=ud(g3t(e)),n=[];if(e.length===0)return n;let r=0;for(let s=0;s<t.length;s++)t[s]===46&&(n.push(P0e(t.slice(r,s))),r=s+1);return Cn(r<t.length,"invalid ENS name; empty component","name",e),n.push(P0e(t.slice(r))),n}function g3t(e){try{if(e.length===0)throw new Error("empty label");return l3t(e)}catch(t){Cn(!1,`invalid ENS name (${t.message})`,"name",e)}}function MJ(e){Cn(typeof e=="string","invalid ENS name; not a string","name",e),Cn(e.length,"invalid ENS name (empty label)","name",e);let t=qTe;const n=GTe(e);for(;n.length;)t=lo(Ra([t,lo(n.pop())]));return qr(t)}function b3t(e,t){const n=t;return Cn(n<=255,"DNS encoded label cannot exceed 255","length",n),qr(Ra(GTe(e).map(r=>{Cn(r.length<=n,`label ${JSON.stringify(e)} exceeds ${n} bytes`,"name",e);const s=new Uint8Array(r.length+1);return s.set(r,1),s[0]=s.length-1,s})))+"00"}function y3t(e){return typeof e=="string"&&(e=ud(e)),lo(Ra([ud(Kvt),ud(String(e.length)),e]))}const KTe=new Uint8Array(32);KTe.fill(0);const v3t=BigInt(-1),YTe=BigInt(0),XTe=BigInt(1),w3t=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function C3t(e){const t=fs(e),n=t.length%32;return n?Ra([t,KTe.slice(n)]):qr(t)}const S3t=a1(XTe,32),N3t=a1(YTe,32),F0e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},BH=["name","version","chainId","verifyingContract","salt"];function O0e(e){return function(t){return Cn(typeof t=="string",`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const A3t={name:O0e("name"),version:O0e("version"),chainId:function(e){const t=Ns(e,"domain.chainId");return Cn(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):Jp(t)},verifyingContract:function(e){try{return na(e).toLowerCase()}catch{}Cn(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=fs(e,"domain.salt");return Cn(t.length===32,'invalid domain value "salt"',"domain.salt",e),qr(t)}};function $H(e){{const t=e.match(/^(u?)int(\d+)$/);if(t){const n=t[1]==="",r=parseInt(t[2]);Cn(r%8===0&&r!==0&&r<=256&&t[2]===String(r),"invalid numeric width","type",e);const s=fj(w3t,n?r-1:r),a=n?(s+XTe)*v3t:YTe;return function(o){const l=Ns(o,"value");return Cn(l>=a&&l<=s,`value out-of-bounds for ${e}`,"value",l),a1(n?hke(l,256):l,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return Cn(n!==0&&n<=32&&t[1]===String(n),"invalid bytes width","type",e),function(r){const s=fs(r);return Cn(s.length===n,`invalid length for ${e}`,"value",r),C3t(r)}}}switch(e){case"address":return function(t){return i1(na(t),32)};case"bool":return function(t){return t?S3t:N3t};case"bytes":return function(t){return lo(t)};case"string":return function(t){return l1(t)}}return null}function M0e(e,t){return`${e}(${t.map(({name:n,type:r})=>r+" "+n).join(",")})`}function eP(e){const t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}var ek,wg,tS,uD,QTe;const Ph=class Ph{constructor(t){Ln(this,uD);Bn(this,"primaryType");Ln(this,ek);Ln(this,wg);Ln(this,tS);Wt(this,wg,new Map),Wt(this,tS,new Map);const n=new Map,r=new Map,s=new Map,a={};Object.keys(t).forEach(c=>{a[c]=t[c].map(({name:u,type:d})=>{let{base:f,index:x}=eP(d);return f==="int"&&!t.int&&(f="int256"),f==="uint"&&!t.uint&&(f="uint256"),{name:u,type:f+(x||"")}}),n.set(c,new Set),r.set(c,[]),s.set(c,new Set)}),Wt(this,ek,JSON.stringify(a));for(const c in a){const u=new Set;for(const d of a[c]){Cn(!u.has(d.name),`duplicate variable name ${JSON.stringify(d.name)} in ${JSON.stringify(c)}`,"types",t),u.add(d.name);const f=eP(d.type).base;Cn(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",t),!$H(f)&&(Cn(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",t),r.get(f).push(c),n.get(c).add(f))}}const o=Array.from(r.keys()).filter(c=>r.get(c).length===0);Cn(o.length!==0,"missing primary type","types",t),Cn(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",t),Rs(this,{primaryType:o[0]});function l(c,u){Cn(!u.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",t),u.add(c);for(const d of n.get(c))if(r.has(d)){l(d,u);for(const f of u)s.get(f).add(d)}u.delete(c)}l(this.primaryType,new Set);for(const[c,u]of s){const d=Array.from(u);d.sort(),Ue(this,wg).set(c,M0e(c,a[c])+d.map(f=>M0e(f,a[f])).join(""))}}get types(){return JSON.parse(Ue(this,ek))}getEncoder(t){let n=Ue(this,tS).get(t);return n||(n=xr(this,uD,QTe).call(this,t),Ue(this,tS).set(t,n)),n}encodeType(t){const n=Ue(this,wg).get(t);return Cn(n,`unknown type: ${JSON.stringify(t)}`,"name",t),n}encodeData(t,n){return this.getEncoder(t)(n)}hashStruct(t,n){return lo(this.encodeData(t,n))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,n,r){if($H(t))return r(t,n);const s=eP(t).array;if(s)return Cn(s.count===-1||s.count===n.length,`array length mismatch; expected length ${s.count}`,"value",n),n.map(o=>this._visit(s.prefix,o,r));const a=this.types[t];if(a)return a.reduce((o,{name:l,type:c})=>(o[l]=this._visit(c,n[l],r),o),{});Cn(!1,`unknown type: ${t}`,"type",t)}visit(t,n){return this._visit(this.primaryType,t,n)}static from(t){return new Ph(t)}static getPrimaryType(t){return Ph.from(t).primaryType}static hashStruct(t,n,r){return Ph.from(n).hashStruct(t,r)}static hashDomain(t){const n=[];for(const r in t){if(t[r]==null)continue;const s=F0e[r];Cn(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),n.push({name:r,type:s})}return n.sort((r,s)=>BH.indexOf(r.name)-BH.indexOf(s.name)),Ph.hashStruct("EIP712Domain",{EIP712Domain:n},t)}static encode(t,n,r){return Ra(["0x1901",Ph.hashDomain(t),Ph.from(n).hash(r)])}static hash(t,n,r){return lo(Ph.encode(t,n,r))}static async resolveNames(t,n,r,s){t=Object.assign({},t);for(const l in t)t[l]==null&&delete t[l];const a={};t.verifyingContract&&!co(t.verifyingContract,20)&&(a[t.verifyingContract]="0x");const o=Ph.from(n);o.visit(r,(l,c)=>(l==="address"&&!co(c,20)&&(a[c]="0x"),c));for(const l in a)a[l]=await s(l);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=o.visit(r,(l,c)=>l==="address"&&a[c]?a[c]:c),{domain:t,value:r}}static getPayload(t,n,r){Ph.hashDomain(t);const s={},a=[];BH.forEach(c=>{const u=t[c];u!=null&&(s[c]=A3t[c](u),a.push({name:c,type:F0e[c]}))});const o=Ph.from(n);n=o.types;const l=Object.assign({},n);return Cn(l.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),l.EIP712Domain=a,o.encode(r),{types:l,domain:s,primaryType:o.primaryType,message:o.visit(r,(c,u)=>{if(c.match(/^bytes(\d*)/))return qr(fs(u));if(c.match(/^u?int/))return Ns(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return Cn(typeof u=="string","invalid string","value",u),u}Cn(!1,"unsupported type","type",c)})}}};ek=new WeakMap,wg=new WeakMap,tS=new WeakMap,uD=new WeakSet,QTe=function(t){{const s=$H(t);if(s)return s}const n=eP(t).array;if(n){const s=n.prefix,a=this.getEncoder(s);return o=>{Cn(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let l=o.map(a);return Ue(this,wg).has(s)&&(l=l.map(lo)),lo(Ra(l))}}const r=this.types[t];if(r){const s=l1(Ue(this,wg).get(t));return a=>{const o=r.map(({name:l,type:c})=>{const u=this.getEncoder(c)(a[l]);return Ue(this,wg).has(c)?lo(u):u});return o.unshift(s),Ra(o)}}Cn(!1,`unknown type: ${t}`,"type",t)};let zS=Ph;function ad(e){const t=new Set;return e.forEach(n=>t.add(n)),Object.freeze(t)}const j3t="external public payable override",E3t=ad(j3t.split(" ")),ZTe="constant external internal payable private public pure view override",_3t=ad(ZTe.split(" ")),JTe="constructor error event fallback function receive struct",eIe=ad(JTe.split(" ")),tIe="calldata memory storage payable indexed",k3t=ad(tIe.split(" ")),T3t="tuple returns",I3t=[JTe,tIe,T3t,ZTe].join(" "),P3t=ad(I3t.split(" ")),F3t={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},O3t=new RegExp("^(\\s*)"),M3t=new RegExp("^([0-9]+)"),R3t=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),nIe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),rIe=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Wc,qp,tk,RJ;const dD=class dD{constructor(t){Ln(this,tk);Ln(this,Wc);Ln(this,qp);Wt(this,Wc,0),Wt(this,qp,t.slice())}get offset(){return Ue(this,Wc)}get length(){return Ue(this,qp).length-Ue(this,Wc)}clone(){return new dD(Ue(this,qp))}reset(){Wt(this,Wc,0)}popKeyword(t){const n=this.peek();if(n.type!=="KEYWORD"||!t.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){const n=this.peek();throw new Error(`expected ${t}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const n=xr(this,tk,RJ).call(this,Ue(this,Wc)+1,t.match+1);return Wt(this,Wc,t.match+1),n}popParams(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;Ue(this,Wc)<t.match-1;){const r=this.peek().linkNext;n.push(xr(this,tk,RJ).call(this,Ue(this,Wc)+1,r)),Wt(this,Wc,r)}return Wt(this,Wc,t.match+1),n}peek(){if(Ue(this,Wc)>=Ue(this,qp).length)throw new Error("out-of-bounds");return Ue(this,qp)[Ue(this,Wc)]}peekKeyword(t){const n=this.peekType("KEYWORD");return n!=null&&t.has(n)?n:null}peekType(t){if(this.length===0)return null;const n=this.peek();return n.type===t?n.text:null}pop(){const t=this.peek();return sb(this,Wc)._++,t}toString(){const t=[];for(let n=Ue(this,Wc);n<Ue(this,qp).length;n++){const r=Ue(this,qp)[n];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}};Wc=new WeakMap,qp=new WeakMap,tk=new WeakSet,RJ=function(t=0,n=0){return new dD(Ue(this,qp).slice(t,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))};let gm=dD;function o2(e){const t=[],n=o=>{const l=a<e.length?JSON.stringify(e[a]):"$EOI";throw new Error(`invalid token ${l} at ${a}: ${o}`)};let r=[],s=[],a=0;for(;a<e.length;){let o=e.substring(a),l=o.match(O3t);l&&(a+=l[1].length,o=e.substring(a));const c={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};t.push(c);let u=F3t[o[0]]||"";if(u){if(c.type=u,c.text=o[0],a++,u==="OPEN_PAREN")r.push(t.length-1),s.push(t.length-1);else if(u=="CLOSE_PAREN")r.length===0&&n("no matching open bracket"),c.match=r.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=s.pop(),t[c.linkBack].linkNext=t.length-1;else if(u==="COMMA")c.linkBack=s.pop(),t[c.linkBack].linkNext=t.length-1,s.push(t.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let d=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){const f=t.pop().text;d=f+d,t[t.length-1].value=Li(f)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=d}continue}if(l=o.match(R3t),l){if(c.text=l[1],a+=c.text.length,P3t.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(rIe)){c.type="TYPE";continue}c.type="ID";continue}if(l=o.match(M3t),l){c.text=l[1],c.type="NUMBER",a+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new gm(t.map(o=>Object.freeze(o)))}function R0e(e,t){let n=[];for(const r in t.keys())e.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function UB(e,t){if(t.peekKeyword(eIe)){const n=t.pop().text;if(n!==e)throw new Error(`expected ${e}, got ${n}`)}return t.popType("ID")}function c1(e,t){const n=new Set;for(;;){const r=e.peekType("KEYWORD");if(r==null||t&&!t.has(r))break;if(e.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function sIe(e){let t=c1(e,_3t);return R0e(t,ad("constant payable nonpayable".split(" "))),R0e(t,ad("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function Wg(e,t){return e.popParams().map(n=>ru.from(n,t))}function iIe(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return Ns(e.pop().text);throw new Error("invalid gas")}return null}function j3(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const L3t=new RegExp(/^(.*)\[([0-9]*)\]$/);function L0e(e){const t=e.match(rIe);if(Cn(t,"invalid type","type",e),e==="uint")return"uint256";if(e==="int")return"int256";if(t[2]){const n=parseInt(t[2]);Cn(n!==0&&n<=32,"invalid bytes length","type",e)}else if(t[3]){const n=parseInt(t[3]);Cn(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",e)}return e}const Bo={},lf=Symbol.for("_ethers_internal"),D0e="_ParamTypeInternal",B0e="_ErrorInternal",$0e="_EventInternal",U0e="_ConstructorInternal",z0e="_FallbackInternal",H0e="_FunctionInternal",V0e="_StructInternal";var nS,QF;const Fh=class Fh{constructor(t,n,r,s,a,o,l,c){Ln(this,nS);Bn(this,"name");Bn(this,"type");Bn(this,"baseType");Bn(this,"indexed");Bn(this,"components");Bn(this,"arrayLength");Bn(this,"arrayChildren");if(l5(t,Bo,"ParamType"),Object.defineProperty(this,lf,{value:D0e}),o&&(o=Object.freeze(o.slice())),s==="array"){if(l==null||c==null)throw new Error("")}else if(l!=null||c!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Rs(this,{name:n,type:r,baseType:s,indexed:a,components:o,arrayLength:l,arrayChildren:c})}format(t){if(t==null&&(t="sighash"),t==="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 s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(a=>JSON.parse(a.format(t)))),JSON.stringify(s)}let n="";return this.isArray()?(n+=this.arrayChildren.format(t),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(t)).join(t==="full"?", ":",")+")":n+=this.type,t!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),t==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return t.map(s=>r.arrayChildren.walk(s,n))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const r=this;return t.map((s,a)=>r.components[a].walk(s,n))}return n(this.type,t)}async walkAsync(t,n){const r=[],s=[t];return xr(this,nS,QF).call(this,r,t,n,a=>{s[0]=a}),r.length&&await Promise.all(r),s[0]}static from(t,n){if(Fh.isParamType(t))return t;if(typeof t=="string")try{return Fh.from(o2(t),n)}catch{Cn(!1,"invalid param type","obj",t)}else if(t instanceof gm){let l="",c="",u=null;c1(t,ad(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(c="tuple",u=t.popParams().map(w=>Fh.from(w)),l=`tuple(${u.map(w=>w.format()).join(",")})`):(l=L0e(t.popType("TYPE")),c=l);let d=null,f=null;for(;t.length&&t.peekType("BRACKET");){const w=t.pop();d=new Fh(Bo,"",l,c,null,u,f,d),f=w.value,l+=w.text,c="array",u=null}let x=null;if(c1(t,k3t).has("indexed")){if(!n)throw new Error("");x=!0}const v=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new Fh(Bo,v,l,c,x,u,f,d)}const r=t.name;Cn(!r||typeof r=="string"&&r.match(nIe),"invalid name","obj.name",r);let s=t.indexed;s!=null&&(Cn(n,"parameter cannot be indexed","obj.indexed",t.indexed),s=!!s);let a=t.type,o=a.match(L3t);if(o){const l=parseInt(o[2]||"-1"),c=Fh.from({type:o[1],components:t.components});return new Fh(Bo,r||"",a,"array",s,null,l,c)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const l=t.components!=null?t.components.map(u=>Fh.from(u)):null;return new Fh(Bo,r||"",a,"tuple",s,l,null,null)}return a=L0e(t.type),new Fh(Bo,r||"",a,a,s,null,null,null)}static isParamType(t){return t&&t[lf]===D0e}};nS=new WeakSet,QF=function(t,n,r,s){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,l=n.slice();l.forEach((c,u)=>{var d;xr(d=o,nS,QF).call(d,t,c,r,f=>{l[u]=f})}),s(l);return}if(this.isTuple()){const o=this.components;let l;if(Array.isArray(n))l=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");l=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in n))throw new Error(`missing value for component ${c.name}`);return n[c.name]})}if(l.length!==this.components.length)throw new Error("array is wrong length");l.forEach((c,u)=>{var d;xr(d=o[u],nS,QF).call(d,t,c,r,f=>{l[u]=f})}),s(l);return}const a=r(this.type,n);a.then?t.push(async function(){s(await a)}()):s(a)};let ru=Fh;class E3{constructor(t,n,r){Bn(this,"type");Bn(this,"inputs");l5(t,Bo,"Fragment"),r=Object.freeze(r.slice()),Rs(this,{type:n,inputs:r})}static from(t){if(typeof t=="string"){try{E3.from(JSON.parse(t))}catch{}return E3.from(o2(t))}if(t instanceof gm)switch(t.peekKeyword(eIe)){case"constructor":return Mg.from(t);case"error":return Wd.from(t);case"event":return w0.from(t);case"fallback":case"receive":return dg.from(t);case"function":return C0.from(t);case"struct":return Yw.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return Mg.from(t);case"error":return Wd.from(t);case"event":return w0.from(t);case"fallback":case"receive":return dg.from(t);case"function":return C0.from(t);case"struct":return Yw.from(t)}Mr(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Cn(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return Mg.isFragment(t)}static isError(t){return Wd.isFragment(t)}static isEvent(t){return w0.isFragment(t)}static isFunction(t){return C0.isFragment(t)}static isStruct(t){return Yw.isFragment(t)}}class zB extends E3{constructor(n,r,s,a){super(n,r,a);Bn(this,"name");Cn(typeof s=="string"&&s.match(nIe),"invalid identifier","name",s),a=Object.freeze(a.slice()),Rs(this,{name:s})}}function hE(e,t){return"("+t.map(n=>n.format(e)).join(e==="full"?", ":",")+")"}class Wd extends zB{constructor(t,n,r){super(t,"error",n,r),Object.defineProperty(this,lf,{value:B0e})}get selector(){return l1(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const n=[];return t!=="sighash"&&n.push("error"),n.push(this.name+hE(t,this.inputs)),n.join(" ")}static from(t){if(Wd.isFragment(t))return t;if(typeof t=="string")return Wd.from(o2(t));if(t instanceof gm){const n=UB("error",t),r=Wg(t);return j3(t),new Wd(Bo,n,r)}return new Wd(Bo,t.name,t.inputs?t.inputs.map(ru.from):[])}static isFragment(t){return t&&t[lf]===B0e}}class w0 extends zB{constructor(n,r,s,a){super(n,"event",r,s);Bn(this,"anonymous");Object.defineProperty(this,lf,{value:$0e}),Rs(this,{anonymous:a})}get topicHash(){return l1(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(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+hE(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>ru.from(a)),new w0(Bo,n,r,!1).topicHash}static from(n){if(w0.isFragment(n))return n;if(typeof n=="string")try{return w0.from(o2(n))}catch{Cn(!1,"invalid event fragment","obj",n)}else if(n instanceof gm){const r=UB("event",n),s=Wg(n,!0),a=!!c1(n,ad(["anonymous"])).has("anonymous");return j3(n),new w0(Bo,r,s,a)}return new w0(Bo,n.name,n.inputs?n.inputs.map(r=>ru.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[lf]===$0e}}class Mg extends E3{constructor(n,r,s,a,o){super(n,r,s);Bn(this,"payable");Bn(this,"gas");Object.defineProperty(this,lf,{value:U0e}),Rs(this,{payable:a,gas:o})}format(n){if(Mr(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(s=>JSON.parse(s.format(n)))});const r=[`constructor${hE(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(Mg.isFragment(n))return n;if(typeof n=="string")try{return Mg.from(o2(n))}catch{Cn(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof gm){c1(n,ad(["constructor"]));const r=Wg(n),s=!!c1(n,E3t).has("payable"),a=iIe(n);return j3(n),new Mg(Bo,"constructor",r,s,a)}return new Mg(Bo,"constructor",n.inputs?n.inputs.map(ru.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[lf]===U0e}}class dg extends E3{constructor(n,r,s){super(n,"fallback",r);Bn(this,"payable");Object.defineProperty(this,lf,{value:z0e}),Rs(this,{payable:s})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const s=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:s})}return`${r}()${this.payable?" payable":""}`}static from(n){if(dg.isFragment(n))return n;if(typeof n=="string")try{return dg.from(o2(n))}catch{Cn(!1,"invalid fallback fragment","obj",n)}else if(n instanceof gm){const r=n.toString(),s=n.peekKeyword(ad(["fallback","receive"]));if(Cn(s,"type must be fallback or receive","obj",r),n.popKeyword(ad(["fallback","receive"]))==="receive"){const c=Wg(n);return Cn(c.length===0,"receive cannot have arguments","obj.inputs",c),c1(n,ad(["payable"])),j3(n),new dg(Bo,[],!0)}let o=Wg(n);o.length?Cn(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(c=>c.format("minimal")).join(", ")):o=[ru.from("bytes")];const l=sIe(n);if(Cn(l==="nonpayable"||l==="payable","fallback cannot be constants","obj.stateMutability",l),c1(n,ad(["returns"])).has("returns")){const c=Wg(n);Cn(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return j3(n),new dg(Bo,o,l==="payable")}if(n.type==="receive")return new dg(Bo,[],!0);if(n.type==="fallback"){const r=[ru.from("bytes")],s=n.stateMutability==="payable";return new dg(Bo,r,s)}Cn(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[lf]===z0e}}class C0 extends zB{constructor(n,r,s,a,o,l){super(n,"function",r,a);Bn(this,"constant");Bn(this,"outputs");Bn(this,"stateMutability");Bn(this,"payable");Bn(this,"gas");Object.defineProperty(this,lf,{value:H0e}),o=Object.freeze(o.slice()),Rs(this,{constant:s==="view"||s==="pure",gas:l,outputs:o,payable:s==="payable",stateMutability:s})}get selector(){return l1(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(s=>JSON.parse(s.format(n))),outputs:this.outputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+hE(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(hE(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>ru.from(a)),new C0(Bo,n,"view",r,[],null).selector}static from(n){if(C0.isFragment(n))return n;if(typeof n=="string")try{return C0.from(o2(n))}catch{Cn(!1,"invalid function fragment","obj",n)}else if(n instanceof gm){const s=UB("function",n),a=Wg(n),o=sIe(n);let l=[];c1(n,ad(["returns"])).has("returns")&&(l=Wg(n));const c=iIe(n);return j3(n),new C0(Bo,s,o,a,l,c)}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 C0(Bo,n.name,r,n.inputs?n.inputs.map(ru.from):[],n.outputs?n.outputs.map(ru.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[lf]===H0e}}class Yw extends zB{constructor(t,n,r){super(t,"struct",n,r),Object.defineProperty(this,lf,{value:V0e})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return Yw.from(o2(t))}catch{Cn(!1,"invalid struct fragment","obj",t)}else if(t instanceof gm){const n=UB("struct",t),r=Wg(t);return j3(t),new Yw(Bo,n,r)}return new Yw(Bo,t.name,t.inputs?t.inputs.map(ru.from):[])}static isFragment(t){return t&&t[lf]===V0e}}const Am=new Map;Am.set(0,"GENERIC_PANIC");Am.set(1,"ASSERT_FALSE");Am.set(17,"OVERFLOW");Am.set(18,"DIVIDE_BY_ZERO");Am.set(33,"ENUM_RANGE_ERROR");Am.set(34,"BAD_STORAGE_DATA");Am.set(49,"STACK_UNDERFLOW");Am.set(50,"ARRAY_RANGE_ERROR");Am.set(65,"OUT_OF_MEMORY");Am.set(81,"UNINITIALIZED_FUNCTION_CALL");const D3t=new RegExp(/^bytes([0-9]*)$/),B3t=new RegExp(/^(u?int)([0-9]*)$/);let UH=null,W0e=1024;function $3t(e,t,n,r){let s="missing revert data",a=null;const o=null;let l=null;if(n){s="execution reverted";const u=fs(n);if(n=qr(n),u.length===0)s+=" (no data present; likely require(false) occurred",a="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(qr(u.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],u.slice(4))[0],l={signature:"Error(string)",name:"Error",args:[a]},s+=`: ${JSON.stringify(a)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(qr(u.slice(0,4))==="0x4e487b71")try{const d=Number(r.decode(["uint256"],u.slice(4))[0]);l={signature:"Panic(uint256)",name:"Panic",args:[d]},a=`Panic due to ${Am.get(d)||"UNKNOWN"}(${d})`,s+=`: ${a}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const c={to:t.to?na(t.to):null,data:t.data||"0x"};return t.from&&(c.from=na(t.from)),Eo(s,"CALL_EXCEPTION",{action:e,data:n,reason:a,transaction:c,invocation:o,revert:l})}var Qb,bC;const fD=class fD{constructor(){Ln(this,Qb)}getDefaultValue(t){const n=t.map(s=>xr(this,Qb,bC).call(this,ru.from(s)));return new JI(n,"_").defaultValue()}encode(t,n){cke(n.length,t.length,"types/values length mismatch");const r=t.map(o=>xr(this,Qb,bC).call(this,ru.from(o))),s=new JI(r,"_"),a=new CJ;return s.encode(a,n),a.data}decode(t,n,r){const s=t.map(o=>xr(this,Qb,bC).call(this,ru.from(o)));return new JI(s,"_").decode(new SJ(n,r,W0e))}static _setDefaultMaxInflation(t){Cn(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),W0e=t}static defaultAbiCoder(){return UH==null&&(UH=new fD),UH}static getBuiltinCallException(t,n,r){return $3t(t,n,r,fD.defaultAbiCoder())}};Qb=new WeakSet,bC=function(t){if(t.isArray())return new rwt(xr(this,Qb,bC).call(this,t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new JI(t.components.map(r=>xr(this,Qb,bC).call(this,r)),t.name);switch(t.baseType){case"address":return new twt(t.name);case"bool":return new swt(t.name);case"string":return new hwt(t.name);case"bytes":return new iwt(t.name);case"":return new lwt(t.name)}let n=t.type.match(B3t);if(n){let r=parseInt(n[2]||"256");return Cn(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",t),new fwt(r/8,n[1]==="int",t.name)}if(n=t.type.match(D3t),n){let r=parseInt(n[1]);return Cn(r!==0&&r<=32,"invalid bytes length","param",t),new awt(r,t.name)}Cn(!1,"invalid type","type",t.type)};let pE=fD;class U3t{constructor(t,n,r){Bn(this,"fragment");Bn(this,"name");Bn(this,"signature");Bn(this,"topic");Bn(this,"args");const s=t.name,a=t.format();Rs(this,{fragment:t,name:s,signature:a,topic:n,args:r})}}class z3t{constructor(t,n,r,s){Bn(this,"fragment");Bn(this,"name");Bn(this,"args");Bn(this,"signature");Bn(this,"selector");Bn(this,"value");const a=t.name,o=t.format();Rs(this,{fragment:t,name:a,args:r,signature:o,selector:n,value:s})}}class H3t{constructor(t,n,r){Bn(this,"fragment");Bn(this,"name");Bn(this,"args");Bn(this,"signature");Bn(this,"selector");const s=t.name,a=t.format();Rs(this,{fragment:t,name:s,args:r,signature:a,selector:n})}}class q0e{constructor(t){Bn(this,"hash");Bn(this,"_isIndexed");Rs(this,{hash:t,_isIndexed:!0})}static isIndexed(t){return!!(t&&t._isIndexed)}}const G0e={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"},K0e={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&G0e[e.toString()]&&(t=G0e[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};var u0,d0,f0,yu,W0,ZF,JF;const Dv=class Dv{constructor(t){Ln(this,W0);Bn(this,"fragments");Bn(this,"deploy");Bn(this,"fallback");Bn(this,"receive");Ln(this,u0);Ln(this,d0);Ln(this,f0);Ln(this,yu);let n=[];typeof t=="string"?n=JSON.parse(t):n=t,Wt(this,f0,new Map),Wt(this,u0,new Map),Wt(this,d0,new Map);const r=[];for(const o of n)try{r.push(E3.from(o))}catch(l){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,l.message)}Rs(this,{fragments:Object.freeze(r)});let s=null,a=!1;Wt(this,yu,this.getAbiCoder()),this.fragments.forEach((o,l)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Rs(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(Cn(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${l}]`,o),s=o,a=s.payable);return;case"function":c=Ue(this,f0);break;case"event":c=Ue(this,d0);break;case"error":c=Ue(this,u0);break;default:return}const u=o.format();c.has(u)||c.set(u,o)}),this.deploy||Rs(this,{deploy:Mg.from("constructor()")}),Rs(this,{fallback:s,receive:a})}format(t){const n=t?"minimal":"full";return this.fragments.map(s=>s.format(n))}formatJson(){const t=this.fragments.map(n=>n.format("json"));return JSON.stringify(t.map(n=>JSON.parse(n)))}getAbiCoder(){return pE.defaultAbiCoder()}getFunctionName(t){const n=xr(this,W0,ZF).call(this,t,null,!1);return Cn(n,"no matching function","key",t),n.name}hasFunction(t){return!!xr(this,W0,ZF).call(this,t,null,!1)}getFunction(t,n){return xr(this,W0,ZF).call(this,t,n||null,!0)}forEachFunction(t){const n=Array.from(Ue(this,f0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t(Ue(this,f0).get(s),r)}}getEventName(t){const n=xr(this,W0,JF).call(this,t,null,!1);return Cn(n,"no matching event","key",t),n.name}hasEvent(t){return!!xr(this,W0,JF).call(this,t,null,!1)}getEvent(t,n){return xr(this,W0,JF).call(this,t,n||null,!0)}forEachEvent(t){const n=Array.from(Ue(this,d0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t(Ue(this,d0).get(s),r)}}getError(t,n){if(co(t)){const s=t.toLowerCase();if(K0e[s])return Wd.from(K0e[s].signature);for(const a of Ue(this,u0).values())if(s===a.selector)return a;return null}if(t.indexOf("(")===-1){const s=[];for(const[a,o]of Ue(this,u0))a.split("(")[0]===t&&s.push(o);if(s.length===0)return t==="Error"?Wd.from("error Error(string)"):t==="Panic"?Wd.from("error Panic(uint256)"):null;if(s.length>1){const a=s.map(o=>JSON.stringify(o.format())).join(", ");Cn(!1,`ambiguous error description (i.e. ${a})`,"name",t)}return s[0]}if(t=Wd.from(t).format(),t==="Error(string)")return Wd.from("error Error(string)");if(t==="Panic(uint256)")return Wd.from("error Panic(uint256)");const r=Ue(this,u0).get(t);return r||null}forEachError(t){const n=Array.from(Ue(this,u0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t(Ue(this,u0).get(s),r)}}_decodeParams(t,n){return Ue(this,yu).decode(t,n)}_encodeParams(t,n){return Ue(this,yu).encode(t,n)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,n){if(typeof t=="string"){const r=this.getError(t);Cn(r,"unknown error","fragment",t),t=r}return Cn(go(n,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",n),this._decodeParams(t.inputs,go(n,4))}encodeErrorResult(t,n){if(typeof t=="string"){const r=this.getError(t);Cn(r,"unknown error","fragment",t),t=r}return Ra([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionData(t,n){if(typeof t=="string"){const r=this.getFunction(t);Cn(r,"unknown function","fragment",t),t=r}return Cn(go(n,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",n),this._decodeParams(t.inputs,go(n,4))}encodeFunctionData(t,n){if(typeof t=="string"){const r=this.getFunction(t);Cn(r,"unknown function","fragment",t),t=r}return Ra([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionResult(t,n){if(typeof t=="string"){const a=this.getFunction(t);Cn(a,"unknown function","fragment",t),t=a}let r="invalid length for result data";const s=Jc(n);if(s.length%32===0)try{return Ue(this,yu).decode(t.outputs,s)}catch{r="could not decode result data"}Mr(!1,r,"BAD_DATA",{value:qr(s),info:{method:t.name,signature:t.format()}})}makeError(t,n){const r=fs(t,"data"),s=pE.getBuiltinCallException("call",n,r);if(s.message.startsWith("execution reverted (unknown custom error)")){const l=qr(r.slice(0,4)),c=this.getError(l);if(c)try{const u=Ue(this,yu).decode(c.inputs,r.slice(4));s.revert={name:c.name,signature:c.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const o=this.parseTransaction(n);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(t,n){if(typeof t=="string"){const r=this.getFunction(t);Cn(r,"unknown function","fragment",t),t=r}return qr(Ue(this,yu).encode(t.outputs,n||[]))}encodeFilterTopics(t,n){if(typeof t=="string"){const a=this.getEvent(t);Cn(a,"unknown event","eventFragment",t),t=a}Mr(n.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:t.inputs.length});const r=[];t.anonymous||r.push(t.topicHash);const s=(a,o)=>a.type==="string"?l1(o):a.type==="bytes"?lo(qr(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=a1(o):a.type.match(/^bytes/)?o=Hyt(o,32):a.type==="address"&&Ue(this,yu).encode(["address"],[o]),i1(qr(o),32));for(n.forEach((a,o)=>{const l=t.inputs[o];if(!l.indexed){Cn(a==null,"cannot filter non-indexed parameters; must be null","contract."+l.name,a);return}a==null?r.push(null):l.baseType==="array"||l.baseType==="tuple"?Cn(!1,"filtering with tuples or arrays not supported","contract."+l.name,a):Array.isArray(a)?r.push(a.map(c=>s(l,c))):r.push(s(l,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(t,n){if(typeof t=="string"){const o=this.getEvent(t);Cn(o,"unknown event","eventFragment",t),t=o}const r=[],s=[],a=[];return t.anonymous||r.push(t.topicHash),Cn(n.length===t.inputs.length,"event arguments/values mismatch","values",n),t.inputs.forEach((o,l)=>{const c=n[l];if(o.indexed)if(o.type==="string")r.push(l1(c));else if(o.type==="bytes")r.push(lo(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(Ue(this,yu).encode([o.type],[c]))}else s.push(o),a.push(c)}),{data:Ue(this,yu).encode(s,a),topics:r}}decodeEventLog(t,n,r){if(typeof t=="string"){const g=this.getEvent(t);Cn(g,"unknown event","eventFragment",t),t=g}if(r!=null&&!t.anonymous){const g=t.topicHash;Cn(co(r[0],32)&&r[0].toLowerCase()===g,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],a=[],o=[];t.inputs.forEach((g,v)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(s.push(ru.from({type:"bytes32",name:g.name})),o.push(!0)):(s.push(g),o.push(!1)):(a.push(g),o.push(!1))});const l=r!=null?Ue(this,yu).decode(s,Ra(r)):null,c=Ue(this,yu).decode(a,n,!0),u=[],d=[];let f=0,x=0;return t.inputs.forEach((g,v)=>{let w=null;if(g.indexed)if(l==null)w=new q0e(null);else if(o[v])w=new q0e(l[x++]);else try{w=l[x++]}catch(C){w=C}else try{w=c[f++]}catch(C){w=C}u.push(w),d.push(g.name||null)}),gM.fromItems(u,d)}parseTransaction(t){const n=fs(t.data,"tx.data"),r=Ns(t.value!=null?t.value:0,"tx.value"),s=this.getFunction(qr(n.slice(0,4)));if(!s)return null;const a=Ue(this,yu).decode(s.inputs,n.slice(4));return new z3t(s,s.selector,a,r)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const n=this.getEvent(t.topics[0]);return!n||n.anonymous?null:new U3t(n,n.topicHash,this.decodeEventLog(n,t.data,t.topics))}parseError(t){const n=qr(t),r=this.getError(go(n,0,4));if(!r)return null;const s=Ue(this,yu).decode(r.inputs,go(n,4));return new H3t(r,r.selector,s)}static from(t){return t instanceof Dv?t:typeof t=="string"?new Dv(JSON.parse(t)):typeof t.formatJson=="function"?new Dv(t.formatJson()):typeof t.format=="function"?new Dv(t.format("json")):new Dv(t)}};u0=new WeakMap,d0=new WeakMap,f0=new WeakMap,yu=new WeakMap,W0=new WeakSet,ZF=function(t,n,r){if(co(t)){const a=t.toLowerCase();for(const o of Ue(this,f0).values())if(a===o.selector)return o;return null}if(t.indexOf("(")===-1){const a=[];for(const[o,l]of Ue(this,f0))o.split("(")[0]===t&&a.push(l);if(n){const o=n.length>0?n[n.length-1]:null;let l=n.length,c=!0;Mu.isTyped(o)&&o.type==="overrides"&&(c=!1,l--);for(let u=a.length-1;u>=0;u--){const d=a[u].inputs.length;d!==l&&(!c||d!==l-1)&&a.splice(u,1)}for(let u=a.length-1;u>=0;u--){const d=a[u].inputs;for(let f=0;f<n.length;f++)if(Mu.isTyped(n[f])){if(f>=d.length){if(n[f].type==="overrides")continue;a.splice(u,1);break}if(n[f].type!==d[f].baseType){a.splice(u,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(l=>JSON.stringify(l.format())).join(", ");Cn(!1,`ambiguous function description (i.e. matches ${o})`,"key",t)}return a[0]}const s=Ue(this,f0).get(C0.from(t).format());return s||null},JF=function(t,n,r){if(co(t)){const a=t.toLowerCase();for(const o of Ue(this,d0).values())if(a===o.topicHash)return o;return null}if(t.indexOf("(")===-1){const a=[];for(const[o,l]of Ue(this,d0))o.split("(")[0]===t&&a.push(l);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length<n.length&&a.splice(o,1);for(let o=a.length-1;o>=0;o--){const l=a[o].inputs;for(let c=0;c<n.length;c++)if(Mu.isTyped(n[c])&&n[c].type!==l[c].baseType){a.splice(o,1);break}}}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(l=>JSON.stringify(l.format())).join(", ");Cn(!1,`ambiguous event description (i.e. matches ${o})`,"key",t)}return a[0]}const s=Ue(this,d0).get(w0.from(t).format());return s||null};let LJ=Dv;const aIe=BigInt(0);function s4(e){return e??null}function gl(e){return e==null?null:e.toString()}class Y0e{constructor(t,n,r){Bn(this,"gasPrice");Bn(this,"maxFeePerGas");Bn(this,"maxPriorityFeePerGas");Rs(this,{gasPrice:s4(t),maxFeePerGas:s4(n),maxPriorityFeePerGas:s4(r)})}toJSON(){const{gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:gl(t),maxFeePerGas:gl(n),maxPriorityFeePerGas:gl(r)}}}function mE(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=qr(e.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of n)!(s in e)||e[s]==null||(t[s]=Ns(e[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in e)||e[s]==null||(t[s]=Li(e[s],`request.${s}`));return e.accessList&&(t.accessList=c5(e.accessList)),e.authorizationList&&(t.authorizationList=e.authorizationList.slice()),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(t.kzg=e.kzg),"blobs"in e&&e.blobs&&(t.blobs=e.blobs.map(s=>kB(s)?qr(s):Object.assign({},s))),t}var Cg;class V3t{constructor(t,n){Bn(this,"provider");Bn(this,"number");Bn(this,"hash");Bn(this,"timestamp");Bn(this,"parentHash");Bn(this,"parentBeaconBlockRoot");Bn(this,"nonce");Bn(this,"difficulty");Bn(this,"gasLimit");Bn(this,"gasUsed");Bn(this,"stateRoot");Bn(this,"receiptsRoot");Bn(this,"blobGasUsed");Bn(this,"excessBlobGas");Bn(this,"miner");Bn(this,"prevRandao");Bn(this,"extraData");Bn(this,"baseFeePerGas");Ln(this,Cg);Wt(this,Cg,t.transactions.map(r=>typeof r!="string"?new xE(r,n):r)),Rs(this,{provider:n,hash:s4(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:s4(t.prevRandao),extraData:t.extraData,baseFeePerGas:s4(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return Ue(this,Cg).map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){const t=Ue(this,Cg).slice();return t.length===0?[]:(Mr(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){const{baseFeePerGas:t,difficulty:n,extraData:r,gasLimit:s,gasUsed:a,hash:o,miner:l,prevRandao:c,nonce:u,number:d,parentHash:f,parentBeaconBlockRoot:x,stateRoot:g,receiptsRoot:v,timestamp:w,transactions:C}=this;return{_type:"Block",baseFeePerGas:gl(t),difficulty:gl(n),extraData:r,gasLimit:gl(s),gasUsed:gl(a),blobGasUsed:gl(this.blobGasUsed),excessBlobGas:gl(this.excessBlobGas),hash:o,miner:l,prevRandao:c,nonce:u,number:d,parentHash:f,timestamp:w,parentBeaconBlockRoot:x,stateRoot:g,receiptsRoot:v,transactions:C}}[Symbol.iterator](){let t=0;const n=this.transactions;return{next:()=>t<this.length?{value:n[t++],done:!1}:{value:void 0,done:!0}}}get length(){return Ue(this,Cg).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let n;if(typeof t=="number")n=Ue(this,Cg)[t];else{const r=t.toLowerCase();for(const s of Ue(this,Cg))if(typeof s=="string"){if(s!==r)continue;n=s;break}else{if(s.hash!==r)continue;n=s;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(t){const n=this.prefetchedTransactions;if(typeof t=="number")return n[t];t=t.toLowerCase();for(const r of n)if(r.hash===t)return r;Cn(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return W3t(this)}}Cg=new WeakMap;class Uk{constructor(t,n){Bn(this,"provider");Bn(this,"transactionHash");Bn(this,"blockHash");Bn(this,"blockNumber");Bn(this,"removed");Bn(this,"address");Bn(this,"data");Bn(this,"topics");Bn(this,"index");Bn(this,"transactionIndex");this.provider=n;const r=Object.freeze(t.topics.slice());Rs(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:r,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){const{address:t,blockHash:n,blockNumber:r,data:s,index:a,removed:o,topics:l,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:t,blockHash:n,blockNumber:r,data:s,index:a,removed:o,topics:l,transactionHash:c,transactionIndex:u}}async getBlock(){const t=await this.provider.getBlock(this.blockHash);return Mr(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){const t=await this.provider.getTransaction(this.transactionHash);return Mr(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){const t=await this.provider.getTransactionReceipt(this.transactionHash);return Mr(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return q3t(this)}}var nk;class oIe{constructor(t,n){Bn(this,"provider");Bn(this,"to");Bn(this,"from");Bn(this,"contractAddress");Bn(this,"hash");Bn(this,"index");Bn(this,"blockHash");Bn(this,"blockNumber");Bn(this,"logsBloom");Bn(this,"gasUsed");Bn(this,"blobGasUsed");Bn(this,"cumulativeGasUsed");Bn(this,"gasPrice");Bn(this,"blobGasPrice");Bn(this,"type");Bn(this,"status");Bn(this,"root");Ln(this,nk);Wt(this,nk,Object.freeze(t.logs.map(s=>new Uk(s,n))));let r=aIe;t.effectiveGasPrice!=null?r=t.effectiveGasPrice:t.gasPrice!=null&&(r=t.gasPrice),Rs(this,{provider:n,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:r,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return Ue(this,nk)}toJSON(){const{to:t,from:n,contractAddress:r,hash:s,index:a,blockHash:o,blockNumber:l,logsBloom:c,logs:u,status:d,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:l,contractAddress:r,cumulativeGasUsed:gl(this.cumulativeGasUsed),from:n,gasPrice:gl(this.gasPrice),blobGasUsed:gl(this.blobGasUsed),blobGasPrice:gl(this.blobGasPrice),gasUsed:gl(this.gasUsed),hash:s,index:a,logs:u,logsBloom:c,root:f,status:d,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){const t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return cIe(this)}reorderedEvent(t){return Mr(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),lIe(this,t)}}nk=new WeakMap;var Zb;const que=class que{constructor(t,n){Bn(this,"provider");Bn(this,"blockNumber");Bn(this,"blockHash");Bn(this,"index");Bn(this,"hash");Bn(this,"type");Bn(this,"to");Bn(this,"from");Bn(this,"nonce");Bn(this,"gasLimit");Bn(this,"gasPrice");Bn(this,"maxPriorityFeePerGas");Bn(this,"maxFeePerGas");Bn(this,"maxFeePerBlobGas");Bn(this,"data");Bn(this,"value");Bn(this,"chainId");Bn(this,"signature");Bn(this,"accessList");Bn(this,"blobVersionedHashes");Bn(this,"authorizationList");Ln(this,Zb);this.provider=n,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,this.authorizationList=t.authorizationList!=null?t.authorizationList:null,Wt(this,Zb,-1)}toJSON(){const{blockNumber:t,blockHash:n,index:r,hash:s,type:a,to:o,from:l,nonce:c,data:u,signature:d,accessList:f,blobVersionedHashes:x}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:t,blockHash:n,blobVersionedHashes:x,chainId:gl(this.chainId),data:u,from:l,gasLimit:gl(this.gasLimit),gasPrice:gl(this.gasPrice),hash:s,maxFeePerGas:gl(this.maxFeePerGas),maxPriorityFeePerGas:gl(this.maxPriorityFeePerGas),maxFeePerBlobGas:gl(this.maxFeePerBlobGas),nonce:c,signature:d,to:o,index:r,type:a,value:gl(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){const r=await this.getTransaction();r&&(t=r.blockNumber)}if(t==null)return null;const n=this.provider.getBlock(t);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:n,blockNumber:r}=await Su({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:r-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,n){const r=t??1,s=n??0;let a=Ue(this,Zb),o=-1,l=a===-1;const c=async()=>{if(l)return null;const{blockNumber:x,nonce:g}=await Su({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g<this.nonce){a=x;return}if(l)return null;const v=await this.getTransaction();if(!(v&&v.blockNumber!=null))for(o===-1&&(o=a-3,o<Ue(this,Zb)&&(o=Ue(this,Zb)));o<=x;){if(l)return null;const w=await this.provider.getBlock(o,!0);if(w==null)return;for(const C of w)if(C===this.hash)return;for(let C=0;C<w.length;C++){const N=await w.getTransaction(C);if(N.from===this.from&&N.nonce===this.nonce){if(l)return null;const I=await this.provider.getTransactionReceipt(N.hash);if(I==null||x-I.blockNumber+1<r)return;let P="replaced";N.data===this.data&&N.to===this.to&&N.value===this.value?P="repriced":N.data==="0x"&&N.from===N.to&&N.value===aIe&&(P="cancelled"),Mr(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:P==="replaced"||P==="cancelled",reason:P,replacement:N.replaceableTransaction(a),hash:N.hash,receipt:I})}}o++}},u=x=>{if(x==null||x.status!==0)return x;Mr(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:x.to,from:x.from,data:""},receipt:x})},d=await this.provider.getTransactionReceipt(this.hash);if(r===0)return u(d);if(d){if(r===1||await d.confirmations()>=r)return u(d)}else if(await c(),r===0)return null;return await new Promise((x,g)=>{const v=[],w=()=>{v.forEach(N=>N())};if(v.push(()=>{l=!0}),s>0){const N=setTimeout(()=>{w(),g(Eo("wait for transaction timeout","TIMEOUT"))},s);v.push(()=>{clearTimeout(N)})}const C=async N=>{if(await N.confirmations()>=r){w();try{x(u(N))}catch(I){g(I)}}};if(v.push(()=>{this.provider.off(this.hash,C)}),this.provider.on(this.hash,C),a>=0){const N=async()=>{try{await c()}catch(I){if(Zc(I,"TRANSACTION_REPLACED")){w(),g(I);return}}l||this.provider.once("block",N)};v.push(()=>{this.provider.off("block",N)}),this.provider.once("block",N)}})}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 Mr(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),cIe(this)}reorderedEvent(t){return Mr(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Mr(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),lIe(this,t)}replaceableTransaction(t){Cn(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);const n=new que(this,this.provider);return Wt(n,Zb,t),n}};Zb=new WeakMap;let xE=que;function W3t(e){return{orphan:"drop-block",hash:e.hash,number:e.number}}function lIe(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function cIe(e){return{orphan:"drop-transaction",tx:e}}function q3t(e){return{orphan:"drop-log",log:{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,address:e.address,data:e.data,topics:Object.freeze(e.topics.slice()),index:e.index}}}class vae extends Uk{constructor(n,r,s){super(n,n.provider);Bn(this,"interface");Bn(this,"fragment");Bn(this,"args");const a=r.decodeEventLog(s,n.data,n.topics);Rs(this,{args:a,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class uIe extends Uk{constructor(n,r){super(n,n.provider);Bn(this,"error");Rs(this,{error:r})}}var rS;class G3t extends oIe{constructor(n,r,s){super(s,r);Ln(this,rS);Wt(this,rS,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?Ue(this,rS).getEvent(n.topics[0]):null;if(r)try{return new vae(n,Ue(this,rS),r)}catch(s){return new uIe(n,s)}return n})}}rS=new WeakMap;var rk;class wae extends xE{constructor(n,r,s){super(s,r);Ln(this,rk);Wt(this,rk,n)}async wait(n,r){const s=await super.wait(n,r);return s==null?null:new G3t(Ue(this,rk),this.provider,s)}}rk=new WeakMap;class dIe extends mke{constructor(n,r,s,a){super(n,r,s);Bn(this,"log");Rs(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 K3t extends dIe{constructor(t,n,r,s,a){super(t,n,r,new vae(a,t.interface,s));const o=t.interface.decodeEventLog(s,this.log.data,this.log.topics);Rs(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const X0e=BigInt(0);function fIe(e){return e&&typeof e.call=="function"}function hIe(e){return e&&typeof e.estimateGas=="function"}function HB(e){return e&&typeof e.resolveName=="function"}function pIe(e){return e&&typeof e.sendTransaction=="function"}function mIe(e){if(e!=null){if(HB(e))return e;if(e.provider)return e.provider}}var sk;class Y3t{constructor(t,n,r){Ln(this,sk);Bn(this,"fragment");if(Rs(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=_3(t.runner,"resolveName"),a=HB(s)?s:null;Wt(this,sk,async function(){const o=await Promise.all(n.inputs.map((l,c)=>r[c]==null?null:l.walkAsync(r[c],(d,f)=>d==="address"?Array.isArray(f)?Promise.all(f.map(x=>_c(x,a))):_c(f,a):f)));return t.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return Ue(this,sk)}}sk=new WeakMap;function _3(e,t){return e==null?null:typeof e[t]=="function"?e:e.provider&&typeof e.provider[t]=="function"?e.provider:null}function Kv(e){return e==null?null:e.provider||null}async function xIe(e,t){const n=Mu.dereference(e,"overrides");Cn(typeof n=="object","invalid overrides parameter","overrides",e);const r=mE(n);return Cn(r.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Cn(r.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function X3t(e,t,n){const r=_3(e,"resolveName"),s=HB(r)?r:null;return await Promise.all(t.map((a,o)=>a.walkAsync(n[o],(l,c)=>(c=Mu.dereference(c,l),l==="address"?_c(c,s):c))))}function Q3t(e){const t=async function(o){const l=await xIe(o,["data"]);l.to=await e.getAddress(),l.from&&(l.from=await _c(l.from,mIe(e.runner)));const c=e.interface,u=Ns(l.value||X0e,"overrides.value")===X0e,d=(l.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!d&&!u&&Cn(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),Cn(c.fallback||d,"cannot send data to receive-only contract","overrides.data",l.data);const f=c.receive||c.fallback&&c.fallback.payable;return Cn(f||u,"cannot send value to non-payable fallback","overrides.value",l.value),Cn(c.fallback||d,"cannot send data to receive-only contract","overrides.data",l.data),l},n=async function(o){const l=_3(e.runner,"call");Mr(fIe(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await t(o);try{return await l.call(c)}catch(u){throw rae(u)&&u.data?e.interface.makeError(u.data,c):u}},r=async function(o){const l=e.runner;Mr(pIe(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await l.sendTransaction(await t(o)),u=Kv(e.runner);return new wae(e.interface,u,c)},s=async function(o){const l=_3(e.runner,"estimateGas");return Mr(hIe(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await t(o))},a=async o=>await r(o);return Rs(a,{_contract:e,estimateGas:s,populateTransaction:t,send:r,staticCall:n}),a}function Z3t(e,t){const n=function(...u){const d=e.interface.getFunction(t,u);return Mr(d,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:u}}),d},r=async function(...u){const d=n(...u);let f={};if(d.inputs.length+1===u.length&&(f=await xIe(u.pop()),f.from&&(f.from=await _c(f.from,mIe(e.runner)))),d.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const x=await X3t(e.runner,d.inputs,u);return Object.assign({},f,await Su({to:e.getAddress(),data:e.interface.encodeFunctionData(d,x)}))},s=async function(...u){const d=await l(...u);return d.length===1?d[0]:d},a=async function(...u){const d=e.runner;Mr(pIe(d),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await d.sendTransaction(await r(...u)),x=Kv(e.runner);return new wae(e.interface,x,f)},o=async function(...u){const d=_3(e.runner,"estimateGas");return Mr(hIe(d),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await d.estimateGas(await r(...u))},l=async function(...u){const d=_3(e.runner,"call");Mr(fIe(d),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...u);let x="0x";try{x=await d.call(f)}catch(v){throw rae(v)&&v.data?e.interface.makeError(v.data,f):v}const g=n(...u);return e.interface.decodeFunctionResult(g,x)},c=async(...u)=>n(...u).constant?await s(...u):await a(...u);return Rs(c,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:s,staticCallResult:l}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=e.interface.getFunction(t);return Mr(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),u}}),c}function J3t(e,t){const n=function(...s){const a=e.interface.getEvent(t,s);return Mr(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:s}}),a},r=function(...s){return new Y3t(e,n(...s),s)};return Rs(r,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=e.interface.getEvent(t);return Mr(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),s}}),r}const SM=Symbol.for("_ethersInternal_contract"),gIe=new WeakMap;function e5t(e,t){gIe.set(e[SM],t)}function kf(e){return gIe.get(e[SM])}function t5t(e){return e&&typeof e=="object"&&"getTopicFilter"in e&&typeof e.getTopicFilter=="function"&&e.fragment}async function Cae(e,t){let n,r=null;if(Array.isArray(t)){const a=function(o){if(co(o,32))return o;const l=e.interface.getEvent(o);return Cn(l,"unknown fragment","name",o),l.topicHash};n=t.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else t==="*"?n=[null]:typeof t=="string"?co(t,32)?n=[t]:(r=e.interface.getEvent(t),Cn(r,"unknown fragment","event",t),n=[r.topicHash]):t5t(t)?n=await t.getTopicFilter():"fragment"in t?(r=t.fragment,n=[r.topicHash]):Cn(!1,"unknown event name","event",t);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(l=>l.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const s=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:s,topics:n}}async function mj(e,t){const{subs:n}=kf(e);return n.get((await Cae(e,t)).tag)||null}async function Q0e(e,t,n){const r=Kv(e.runner);Mr(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:s,tag:a,topics:o}=await Cae(e,n),{addr:l,subs:c}=kf(e);let u=c.get(a);if(!u){const f={address:l||e,topics:o},x=C=>{let N=s;if(N==null)try{N=e.interface.getEvent(C.topics[0])}catch{}if(N){const I=N,P=s?e.interface.decodeEventLog(s,C.data,C.topics):[];BJ(e,n,P,R=>new K3t(e,R,n,I,C))}else BJ(e,n,[],I=>new dIe(e,I,n,C))};let g=[];u={tag:a,listeners:[],start:()=>{g.length||g.push(r.on(f,x))},stop:async()=>{if(g.length==0)return;let C=g;g=[],await Promise.all(C),r.off(f,x)}},c.set(a,u)}return u}let DJ=Promise.resolve();async function n5t(e,t,n,r){await DJ;const s=await mj(e,t);if(!s)return!1;const a=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:l})=>{const c=Array.from(n);r&&c.push(r(l?null:o));try{o.call(e,...c)}catch{}return!l}),s.listeners.length===0&&(s.stop(),kf(e).subs.delete(s.tag)),a>0}async function BJ(e,t,n,r){try{await DJ}catch{}const s=n5t(e,t,n,r);return DJ=s,await s}const tP=["then"];var TNe;TNe=SM;const x9=class x9{constructor(t,n,r,s){Bn(this,"target");Bn(this,"interface");Bn(this,"runner");Bn(this,"filters");Bn(this,TNe);Bn(this,"fallback");Cn(typeof t=="string"||CTe(t),"invalid value for Contract target","target",t),r==null&&(r=null);const a=LJ.from(n);Rs(this,{target:t,runner:r,interface:a}),Object.defineProperty(this,SM,{value:{}});let o,l=null,c=null;if(s){const f=Kv(r);c=new wae(this.interface,f,s)}let u=new Map;if(typeof t=="string")if(co(t))l=t,o=Promise.resolve(t);else{const f=_3(r,"resolveName");if(!HB(f))throw Eo("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(t).then(x=>{if(x==null)throw Eo("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return kf(this).addr=x,x})}else o=t.getAddress().then(f=>{if(f==null)throw new Error("TODO");return kf(this).addr=f,f});e5t(this,{addrPromise:o,addr:l,deployTx:c,subs:u});const d=new Proxy({},{get:(f,x,g)=>{if(typeof x=="symbol"||tP.indexOf(x)>=0)return Reflect.get(f,x,g);try{return this.getEvent(x)}catch(v){if(!Zc(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,x)=>tP.indexOf(x)>=0?Reflect.has(f,x):Reflect.has(f,x)||this.interface.hasEvent(String(x))});return Rs(this,{filters:d}),Rs(this,{fallback:a.receive||a.fallback?Q3t(this):null}),new Proxy(this,{get:(f,x,g)=>{if(typeof x=="symbol"||x in f||tP.indexOf(x)>=0)return Reflect.get(f,x,g);try{return f.getFunction(x)}catch(v){if(!Zc(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,x)=>typeof x=="symbol"||x in f||tP.indexOf(x)>=0?Reflect.has(f,x):f.interface.hasFunction(x)})}connect(t){return new x9(this.target,this.interface,t)}attach(t){return new x9(t,this.interface,this.runner)}async getAddress(){return await kf(this).addrPromise}async getDeployedCode(){const t=Kv(this.runner);Mr(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await t.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Kv(this.runner);return Mr(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",o)}catch(l){a(l)}};o()})}deploymentTransaction(){return kf(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),Z3t(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),J3t(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:s,addrPromise:a}=kf(this),o=s||await a,{fragment:l,topics:c}=await Cae(this,t),u={address:o,topics:c,fromBlock:n,toBlock:r},d=Kv(this.runner);return Mr(d,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await d.getLogs(u)).map(f=>{let x=l;if(x==null)try{x=this.interface.getEvent(f.topics[0])}catch{}if(x)try{return new vae(f,this.interface,x)}catch(g){return new uIe(f,g)}return new Uk(f,d)})}async on(t,n){const r=await Q0e(this,"on",t);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(t,n){const r=await Q0e(this,"once",t);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(t,...n){return await BJ(this,t,n,null)}async listenerCount(t){if(t){const s=await mj(this,t);return s?s.listeners.length:0}const{subs:n}=kf(this);let r=0;for(const{listeners:s}of n.values())r+=s.length;return r}async listeners(t){if(t){const s=await mj(this,t);return s?s.listeners.map(({listener:a})=>a):[]}const{subs:n}=kf(this);let r=[];for(const{listeners:s}of n.values())r=r.concat(s.map(({listener:a})=>a));return r}async off(t,n){const r=await mj(this,t);if(!r)return this;if(n){const s=r.listeners.map(({listener:a})=>a).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(n==null||r.listeners.length===0)&&(r.stop(),kf(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){const n=await mj(this,t);if(!n)return this;n.stop(),kf(this).subs.delete(n.tag)}else{const{subs:n}=kf(this);for(const{tag:r,stop:s}of n.values())s(),n.delete(r)}return this}async addListener(t,n){return await this.on(t,n)}async removeListener(t,n){return await this.off(t,n)}static buildClass(t){class n extends x9{constructor(s,a=null){super(s,t,a)}}return n}static from(t,n,r){return r==null&&(r=null),new this(t,n,r)}};let $J=x9;function r5t(){return $J}let Vj=class extends r5t(){};function zH(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Cn(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class s5t{constructor(t){Bn(this,"name");Rs(this,{name:t})}connect(t){return this}supportsCoinType(t){return!1}async encodeAddress(t,n){throw new Error("unsupported coin")}async decodeAddress(t,n){throw new Error("unsupported coin")}}const bIe=new RegExp("^(ipfs)://(.*)$","i"),Z0e=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),bIe,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Jb,Tw,ey,yC,hD,yIe;const qC=class qC{constructor(t,n,r){Ln(this,ey);Bn(this,"provider");Bn(this,"address");Bn(this,"name");Ln(this,Jb);Ln(this,Tw);Rs(this,{provider:t,address:n,name:r}),Wt(this,Jb,null),Wt(this,Tw,new Vj(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)"],t))}async supportsWildcard(){return Ue(this,Jb)==null&&Wt(this,Jb,(async()=>{try{return await Ue(this,Tw).supportsInterface("0x9061b923")}catch(t){if(Zc(t,"CALL_EXCEPTION"))return!1;throw Wt(this,Jb,null),t}})()),await Ue(this,Jb)}async getAddress(t){if(t==null&&(t=60),t===60)try{const a=await xr(this,ey,yC).call(this,"addr(bytes32)");return a==null||a===lE?null:a}catch(a){if(Zc(a,"CALL_EXCEPTION"))return null;throw a}if(t>=0&&t<2147483648){let a=t+2147483648;const o=await xr(this,ey,yC).call(this,"addr(bytes32,uint)",[a]);if(co(o,20))return na(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof s5t&&a.supportsCoinType(t)){n=a;break}if(n==null)return null;const r=await xr(this,ey,yC).call(this,"addr(bytes32,uint)",[t]);if(r==null||r==="0x")return null;const s=await n.decodeAddress(t,r);if(s!=null)return s;Mr(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${t})`,info:{coinType:t,data:r}})}async getText(t){const n=await xr(this,ey,yC).call(this,"text(bytes32,string)",[t]);return n==null||n==="0x"?null:n}async getContentHash(){const t=await xr(this,ey,yC).call(this,"contenthash(bytes32)");if(t==null||t==="0x")return null;const n=t.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const s=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${s}://${pke("0x"+n[2])}`}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;Mr(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:t}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const t=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return t.push({type:"!avatar",value:""}),{url:null,linkage:t};t.push({type:"avatar",value:n});for(let r=0;r<Z0e.length;r++){const s=n.match(Z0e[r]);if(s==null)continue;const a=s[1].toLowerCase();switch(a){case"https":case"data":return t.push({type:"url",value:n}),{linkage:t,url:n};case"ipfs":{const o=zH(n);return t.push({type:"ipfs",value:n}),t.push({type:"url",value:o}),{linkage:t,url:o}}case"erc721":case"erc1155":{const o=a==="erc721"?"tokenURI(uint256)":"uri(uint256)";t.push({type:a,value:n});const l=await this.getAddress();if(l==null)return t.push({type:"!owner",value:""}),{url:null,linkage:t};const c=(s[2]||"").split("/");if(c.length!==2)return t.push({type:`!${a}caip`,value:s[2]||""}),{url:null,linkage:t};const u=c[1],d=new Vj(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(a==="erc721"){const w=await d.ownerOf(u);if(l!==w)return t.push({type:"!owner",value:w}),{url:null,linkage:t};t.push({type:"owner",value:w})}else if(a==="erc1155"){const w=await d.balanceOf(l,u);if(!w)return t.push({type:"!balance",value:"0"}),{url:null,linkage:t};t.push({type:"balance",value:w.toString()})}let f=await d[o](u);if(f==null||f==="0x")return t.push({type:"!metadata-url",value:""}),{url:null,linkage:t};t.push({type:"metadata-url-base",value:f}),a==="erc1155"&&(f=f.replace("{id}",a1(u,32).substring(2)),t.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=zH(f)),t.push({type:"metadata-url",value:f});let x={};const g=await new Hy(f).send();g.assertOk();try{x=g.bodyJson}catch{try{t.push({type:"!metadata",value:g.bodyText})}catch{const N=g.body;return N&&t.push({type:"!metadata",value:qr(N)}),{url:null,linkage:t}}return{url:null,linkage:t}}if(!x)return t.push({type:"!metadata",value:""}),{url:null,linkage:t};t.push({type:"metadata",value:JSON.stringify(x)});let v=x.image;if(typeof v!="string")return t.push({type:"!imageUrl",value:""}),{url:null,linkage:t};if(!v.match(/^(https:\/\/|data:)/i)){if(v.match(bIe)==null)return t.push({type:"!imageUrl-ipfs",value:v}),{url:null,linkage:t};t.push({type:"imageUrl-ipfs",value:v}),v=zH(v)}return t.push({type:"url",value:v}),{linkage:t,url:v}}}}}catch{}return{linkage:t,url:null}}static async getEnsAddress(t){const n=await t.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return Mr(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async fromName(t,n){var s;let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;const a=await xr(s=qC,hD,yIe).call(s,t,r);if(a!=null){const o=new qC(t,a,n);return r!==n&&!await o.supportsWildcard()?null:o}r=r.split(".").slice(1).join(".")}}};Jb=new WeakMap,Tw=new WeakMap,ey=new WeakSet,yC=async function(t,n){n=(n||[]).slice();const r=Ue(this,Tw).interface;n.unshift(MJ(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(t),Mr(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:t}}),n=[b3t(this.name,255),r.encodeFunctionData(s,n)],t="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const a=await Ue(this,Tw)[t](...n);return s?r.decodeFunctionResult(s,a)[0]:a}catch(a){if(!Zc(a,"CALL_EXCEPTION"))throw a}return null},hD=new WeakSet,yIe=async function(t,n){const r=await qC.getEnsAddress(t);try{const a=await new Vj(r,["function resolver(bytes32) view returns (address)"],t).resolver(MJ(n),{enableCcipRead:!0});return a===lE?null:a}catch(s){throw s}return null},Ln(qC,hD);let NM=qC;const J0e=BigInt(0);function ea(e,t){return function(n){return n==null?t:e(n)}}function gE(e,t){return n=>{if(t&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>e(r))}}function zk(e,t){return n=>{const r={};for(const s in e){let a=s;if(t&&s in t&&!(a in n)){for(const o of t[s])if(o in n){a=o;break}}try{const o=e[s](n[a]);o!==void 0&&(r[s]=o)}catch(o){const l=o instanceof Error?o.message:"not-an-error";Mr(!1,`invalid value for value.${s} (${l})`,"BAD_DATA",{value:n})}}return r}}function i5t(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}Cn(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}function HS(e){return Cn(co(e,!0),"invalid data","value",e),e}function Qc(e){return Cn(co(e,32),"invalid hash","value",e),e}const a5t=zk({address:na,blockHash:Qc,blockNumber:Li,data:HS,index:Li,removed:ea(i5t,!1),topics:gE(Qc),transactionHash:Qc,transactionIndex:Li},{index:["logIndex"]});function o5t(e){return a5t(e)}const l5t=zk({hash:ea(Qc),parentHash:Qc,parentBeaconBlockRoot:ea(Qc,null),number:Li,timestamp:Li,nonce:ea(HS),difficulty:Ns,gasLimit:Ns,gasUsed:Ns,stateRoot:ea(Qc,null),receiptsRoot:ea(Qc,null),blobGasUsed:ea(Ns,null),excessBlobGas:ea(Ns,null),miner:ea(na),prevRandao:ea(Qc,null),extraData:HS,baseFeePerGas:ea(Ns)},{prevRandao:["mixHash"]});function c5t(e){const t=l5t(e);return t.transactions=e.transactions.map(n=>typeof n=="string"?n:vIe(n)),t}const u5t=zk({transactionIndex:Li,blockNumber:Li,transactionHash:Qc,address:na,topics:gE(Qc),data:HS,index:Li,blockHash:Qc},{index:["logIndex"]});function d5t(e){return u5t(e)}const f5t=zk({to:ea(na,null),from:ea(na,null),contractAddress:ea(na,null),index:Li,root:ea(qr),gasUsed:Ns,blobGasUsed:ea(Ns,null),logsBloom:ea(HS),blockHash:Qc,hash:Qc,logs:gE(d5t),blockNumber:Li,cumulativeGasUsed:Ns,effectiveGasPrice:ea(Ns),blobGasPrice:ea(Ns,null),status:ea(Li),type:ea(Li,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function h5t(e){return f5t(e)}function vIe(e){e.to&&Ns(e.to)===J0e&&(e.to="0x0000000000000000000000000000000000000000");const t=zk({hash:Qc,index:ea(Li,void 0),type:n=>n==="0x"||n==null?0:Li(n),accessList:ea(c5,null),blobVersionedHashes:ea(gE(Qc,!0),null),authorizationList:ea(gE(n=>{let r;if(n.signature)r=n.signature;else{let s=n.yParity;s==="0x1b"?s=0:s==="0x1c"&&(s=1),r=Object.assign({},n,{yParity:s})}return{address:na(n.address),chainId:Ns(n.chainId),nonce:Ns(n.nonce),signature:nu.from(r)}},!1),null),blockHash:ea(Qc,null),blockNumber:ea(Li,null),transactionIndex:ea(Li,null),from:na,gasPrice:ea(Ns),maxPriorityFeePerGas:ea(Ns),maxFeePerGas:ea(Ns),maxFeePerBlobGas:ea(Ns,null),gasLimit:Ns,to:ea(na,null),value:Ns,nonce:Li,data:HS,creates:ea(na,null),chainId:ea(Ns,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(t.to==null&&t.creates==null&&(t.creates=ewt(t)),(e.type===1||e.type===2)&&e.accessList==null&&(t.accessList=[]),e.signature?t.signature=nu.from(e.signature):t.signature=nu.from(e),t.chainId==null){const n=t.signature.legacyChainId;n!=null&&(t.chainId=n)}return t.blockHash&&Ns(t.blockHash)===J0e&&(t.blockHash=null),t}const p5t="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Hk{constructor(t){Bn(this,"name");Rs(this,{name:t})}clone(){return new Hk(this.name)}}class VB extends Hk{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);Bn(this,"effectiveBlock");Bn(this,"txBase");Bn(this,"txCreate");Bn(this,"txDataZero");Bn(this,"txDataNonzero");Bn(this,"txAccessListStorageKey");Bn(this,"txAccessListAddress");const s={effectiveBlock:n};function a(o,l){let c=(r||{})[o];c==null&&(c=l),Cn(typeof c=="number",`invalud value for ${o}`,"costs",r),s[o]=c}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),Rs(this,s)}clone(){return new VB(this.effectiveBlock,this)}}class WB extends Hk{constructor(n,r){super("org.ethers.plugins.network.Ens");Bn(this,"address");Bn(this,"targetNetwork");Rs(this,{address:n||p5t,targetNetwork:r??1})}clone(){return new WB(this.address,this.targetNetwork)}}var ik,ak;class m5t extends Hk{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Ln(this,ik);Ln(this,ak);Wt(this,ik,n),Wt(this,ak,r)}get url(){return Ue(this,ik)}get processFunc(){return Ue(this,ak)}clone(){return this}}ik=new WeakMap,ak=new WeakMap;const HH=new Map;var sS,iS,ty,Ug;let hy=(Ug=class{constructor(t,n){Ln(this,sS);Ln(this,iS);Ln(this,ty);Wt(this,sS,t),Wt(this,iS,Ns(n)),Wt(this,ty,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return Ue(this,sS)}set name(t){Wt(this,sS,t)}get chainId(){return Ue(this,iS)}set chainId(t){Wt(this,iS,Ns(t,"chainId"))}matches(t){if(t==null)return!1;if(typeof t=="string"){try{return this.chainId===Ns(t)}catch{}return this.name===t}if(typeof t=="number"||typeof t=="bigint"){try{return this.chainId===Ns(t)}catch{}return!1}if(typeof t=="object"){if(t.chainId!=null){try{return this.chainId===Ns(t.chainId)}catch{}return!1}return t.name!=null?this.name===t.name:!1}return!1}get plugins(){return Array.from(Ue(this,ty).values())}attachPlugin(t){if(Ue(this,ty).get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return Ue(this,ty).set(t.name,t.clone()),this}getPlugin(t){return Ue(this,ty).get(t)||null}getPlugins(t){return this.plugins.filter(n=>n.name.split("#")[0]===t)}clone(){const t=new Ug(this.name,this.chainId);return this.plugins.forEach(n=>{t.attachPlugin(n.clone())}),t}computeIntrinsicGas(t){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new VB;let r=n.txBase;if(t.to==null&&(r+=n.txCreate),t.data)for(let s=2;s<t.data.length;s+=2)t.data.substring(s,s+2)==="00"?r+=n.txDataZero:r+=n.txDataNonzero;if(t.accessList){const s=c5(t.accessList);for(const a in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[a].storageKeys.length}return r}static from(t){if(x5t(),t==null)return Ug.from("mainnet");if(typeof t=="number"&&(t=BigInt(t)),typeof t=="string"||typeof t=="bigint"){const n=HH.get(t);if(n)return n();if(typeof t=="bigint")return new Ug("unknown",t);Cn(!1,"unknown network","network",t)}if(typeof t.clone=="function")return t.clone();if(typeof t=="object"){Cn(typeof t.name=="string"&&typeof t.chainId=="number","invalid network object name or chainId","network",t);const n=new Ug(t.name,t.chainId);return(t.ensAddress||t.ensNetwork!=null)&&n.attachPlugin(new WB(t.ensAddress,t.ensNetwork)),n}Cn(!1,"invalid network","network",t)}static register(t,n){typeof t=="number"&&(t=BigInt(t));const r=HH.get(t);r&&Cn(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",t),HH.set(t,n)}},sS=new WeakMap,iS=new WeakMap,ty=new WeakMap,Ug);function exe(e,t){const n=String(e);if(!n.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const r=n.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${e}`);for(;r[1].length<t;)r[1]+="0";if(r[1].length>9){let s=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||s++,r[1]=s.toString()}return BigInt(r[0]+r[1])}function txe(e){return new m5t(e,async(t,n,r)=>{r.setHeader("User-Agent","ethers");let s;try{const[a,o]=await Promise.all([r.send(),t()]);s=a;const l=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:exe(l.maxFee,9),maxPriorityFeePerGas:exe(l.maxPriorityFee,9)}}catch(a){Mr(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:a})}})}let nxe=!1;function x5t(){if(nxe)return;nxe=!0;function e(t,n,r){const s=function(){const a=new hy(t,n);return r.ensNetwork!=null&&a.attachPlugin(new WB(null,r.ensNetwork)),a.attachPlugin(new VB),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};hy.register(t,s),hy.register(n,s),r.altNames&&r.altNames.forEach(a=>{hy.register(a,s)})}e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[txe("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[txe("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1})}function UJ(e){return JSON.parse(JSON.stringify(e))}var Sg,Lh,ny,h0,aS,eO;class g5t{constructor(t){Ln(this,aS);Ln(this,Sg);Ln(this,Lh);Ln(this,ny);Ln(this,h0);Wt(this,Sg,t),Wt(this,Lh,null),Wt(this,ny,4e3),Wt(this,h0,-2)}get pollingInterval(){return Ue(this,ny)}set pollingInterval(t){Wt(this,ny,t)}start(){Ue(this,Lh)||(Wt(this,Lh,Ue(this,Sg)._setTimeout(xr(this,aS,eO).bind(this),Ue(this,ny))),xr(this,aS,eO).call(this))}stop(){Ue(this,Lh)&&(Ue(this,Sg)._clearTimeout(Ue(this,Lh)),Wt(this,Lh,null))}pause(t){this.stop(),t&&Wt(this,h0,-2)}resume(){this.start()}}Sg=new WeakMap,Lh=new WeakMap,ny=new WeakMap,h0=new WeakMap,aS=new WeakSet,eO=async function(){try{const t=await Ue(this,Sg).getBlockNumber();if(Ue(this,h0)===-2){Wt(this,h0,t);return}if(t!==Ue(this,h0)){for(let n=Ue(this,h0)+1;n<=t;n++){if(Ue(this,Lh)==null)return;await Ue(this,Sg).emit("block",n)}Wt(this,h0,t)}}catch{}Ue(this,Lh)!=null&&Wt(this,Lh,Ue(this,Sg)._setTimeout(xr(this,aS,eO).bind(this),Ue(this,ny)))};var Iw,Pw,ry;class Sae{constructor(t){Ln(this,Iw);Ln(this,Pw);Ln(this,ry);Wt(this,Iw,t),Wt(this,ry,!1),Wt(this,Pw,n=>{this._poll(n,Ue(this,Iw))})}async _poll(t,n){throw new Error("sub-classes must override this")}start(){Ue(this,ry)||(Wt(this,ry,!0),Ue(this,Pw).call(this,-2),Ue(this,Iw).on("block",Ue(this,Pw)))}stop(){Ue(this,ry)&&(Wt(this,ry,!1),Ue(this,Iw).off("block",Ue(this,Pw)))}pause(t){this.stop()}resume(){this.start()}}Iw=new WeakMap,Pw=new WeakMap,ry=new WeakMap;var oS,Ng;class b5t extends Sae{constructor(n,r){super(n);Ln(this,oS);Ln(this,Ng);Wt(this,oS,r),Wt(this,Ng,-2)}pause(n){n&&Wt(this,Ng,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock(Ue(this,oS));s!=null&&(Ue(this,Ng)===-2?Wt(this,Ng,s.number):s.number>Ue(this,Ng)&&(r.emit(Ue(this,oS),s.number),Wt(this,Ng,s.number)))}}oS=new WeakMap,Ng=new WeakMap;var pD;class y5t extends Sae{constructor(n,r){super(n);Ln(this,pD);Wt(this,pD,UJ(r))}async _poll(n,r){throw new Error("@TODO")}}pD=new WeakMap;var lS;class v5t extends Sae{constructor(n,r){super(n);Ln(this,lS);Wt(this,lS,r)}async _poll(n,r){const s=await r.getTransactionReceipt(Ue(this,lS));s&&r.emit(Ue(this,lS),s)}}lS=new WeakMap;var Ag,cS,uS,sy,Dh,mD,wIe;class Nae{constructor(t,n){Ln(this,mD);Ln(this,Ag);Ln(this,cS);Ln(this,uS);Ln(this,sy);Ln(this,Dh);Wt(this,Ag,t),Wt(this,cS,UJ(n)),Wt(this,uS,xr(this,mD,wIe).bind(this)),Wt(this,sy,!1),Wt(this,Dh,-2)}start(){Ue(this,sy)||(Wt(this,sy,!0),Ue(this,Dh)===-2&&Ue(this,Ag).getBlockNumber().then(t=>{Wt(this,Dh,t)}),Ue(this,Ag).on("block",Ue(this,uS)))}stop(){Ue(this,sy)&&(Wt(this,sy,!1),Ue(this,Ag).off("block",Ue(this,uS)))}pause(t){this.stop(),t&&Wt(this,Dh,-2)}resume(){this.start()}}Ag=new WeakMap,cS=new WeakMap,uS=new WeakMap,sy=new WeakMap,Dh=new WeakMap,mD=new WeakSet,wIe=async function(t){if(Ue(this,Dh)===-2)return;const n=UJ(Ue(this,cS));n.fromBlock=Ue(this,Dh)+1,n.toBlock=t;const r=await Ue(this,Ag).getLogs(n);if(r.length===0){Ue(this,Dh)<t-60&&Wt(this,Dh,t-60);return}for(const s of r)Ue(this,Ag).emit(Ue(this,cS),s),Wt(this,Dh,s.blockNumber)};const w5t=BigInt(2),C5t=10;function nP(e){return e&&typeof e.then=="function"}function tO(e,t){return e+":"+JSON.stringify(t,(n,r)=>{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 s=Object.keys(r);return s.sort(),s.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}class CIe{constructor(t){Bn(this,"name");Rs(this,{name:t})}start(){}stop(){}pause(t){}resume(){}}function S5t(e){return JSON.parse(JSON.stringify(e))}function zJ(e){return e=Array.from(new Set(e).values()),e.sort(),e}async function VH(e,t){if(e==null)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),typeof e=="string")switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if(co(e,32)){const n=e.toLowerCase();return{type:"transaction",tag:tO("tx",{hash:n}),hash:n}}if(e.orphan){const n=e;return{type:"orphan",tag:tO("orphan",n),filter:S5t(n)}}if(e.address||e.topics){const n=e,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?zJ(s.map(a=>a.toLowerCase())):s.toLowerCase())};if(n.address){const s=[],a=[],o=l=>{co(l)?s.push(l):a.push((async()=>{s.push(await _c(l,t))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=zJ(s.map(l=>l.toLowerCase()))}return{filter:r,tag:tO("event",r),type:"event"}}Cn(!1,"unknown ProviderEvent","event",e)}function WH(){return new Date().getTime()}const N5t={cacheTimeout:250,pollingInterval:4e3};var vu,iy,wu,dS,Of,Fw,ay,jg,ok,Bh,fS,hS,zi,jf,HJ,VJ,xj,WJ,gj,nO;class A5t{constructor(t,n){Ln(this,zi);Ln(this,vu);Ln(this,iy);Ln(this,wu);Ln(this,dS);Ln(this,Of);Ln(this,Fw);Ln(this,ay);Ln(this,jg);Ln(this,ok);Ln(this,Bh);Ln(this,fS);Ln(this,hS);if(Wt(this,hS,Object.assign({},N5t,n||{})),t==="any")Wt(this,Fw,!0),Wt(this,Of,null);else if(t){const r=hy.from(t);Wt(this,Fw,!1),Wt(this,Of,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else Wt(this,Fw,!1),Wt(this,Of,null);Wt(this,jg,-1),Wt(this,ay,new Map),Wt(this,vu,new Map),Wt(this,iy,new Map),Wt(this,wu,null),Wt(this,dS,!1),Wt(this,ok,1),Wt(this,Bh,new Map),Wt(this,fS,!1)}get pollingInterval(){return Ue(this,hS).pollingInterval}get provider(){return this}get plugins(){return Array.from(Ue(this,iy).values())}attachPlugin(t){if(Ue(this,iy).get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return Ue(this,iy).set(t.name,t.connect(this)),this}getPlugin(t){return Ue(this,iy).get(t)||null}get disableCcipRead(){return Ue(this,fS)}set disableCcipRead(t){Wt(this,fS,!!t)}async ccipReadFetch(t,n,r){if(this.disableCcipRead||r.length===0||t.to==null)return null;const s=t.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let l=0;l<r.length;l++){const c=r[l],u=c.replace("{sender}",s).replace("{data}",a),d=new Hy(u);c.indexOf("{data}")===-1&&(d.body={data:a,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:d,index:l,urls:r});let f="unknown error",x;try{x=await d.send()}catch(g){o.push(g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:{error:g}});continue}try{const g=x.bodyJson;if(g.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:d,result:g}),g.data;g.message&&(f=g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:g})}catch{}Mr(x.statusCode<400||x.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:t,info:{url:c,errorMessage:f}}),o.push(f)}Mr(!1,`error encountered during CCIP fetch: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:t,info:{urls:r,errorMessages:o}})}_wrapBlock(t,n){return new V3t(c5t(t),this)}_wrapLog(t,n){return new Uk(o5t(t),this)}_wrapTransactionReceipt(t,n){return new oIe(h5t(t),this)}_wrapTransactionResponse(t,n){return new xE(vIe(t),this)}_detectNetwork(){Mr(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(t){Mr(!1,`unsupported method: ${t.method}`,"UNSUPPORTED_OPERATION",{operation:t.method,info:t})}async getBlockNumber(){const t=Li(await xr(this,zi,jf).call(this,{method:"getBlockNumber"}),"%response");return Ue(this,jg)>=0&&Wt(this,jg,t),t}_getAddress(t){return _c(t,this)}_getBlockTag(t){if(t==null)return"latest";switch(t){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return t}if(co(t))return co(t,32)?t:Jp(t);if(typeof t=="bigint"&&(t=Li(t,"blockTag")),typeof t=="number")return t>=0?Jp(t):Ue(this,jg)>=0?Jp(Ue(this,jg)+t):this.getBlockNumber().then(n=>Jp(n+t));Cn(!1,"invalid blockTag","blockTag",t)}_getFilter(t){const n=(t.topics||[]).map(c=>c==null?null:Array.isArray(c)?zJ(c.map(u=>u.toLowerCase())):c.toLowerCase()),r="blockHash"in t?t.blockHash:void 0,s=(c,u,d)=>{let f;switch(c.length){case 0:break;case 1:f=c[0];break;default:c.sort(),f=c}if(r&&(u!=null||d!=null))throw new Error("invalid filter");const x={};return f&&(x.address=f),n.length&&(x.topics=n),u&&(x.fromBlock=u),d&&(x.toBlock=d),r&&(x.blockHash=r),x};let a=[];if(t.address)if(Array.isArray(t.address))for(const c of t.address)a.push(this._getAddress(c));else a.push(this._getAddress(t.address));let o;"fromBlock"in t&&(o=this._getBlockTag(t.fromBlock));let l;return"toBlock"in t&&(l=this._getBlockTag(t.toBlock)),a.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||l!=null&&typeof l!="string"?Promise.all([Promise.all(a),o,l]).then(c=>s(c[0],c[1],c[2])):s(a,o,l)}_getTransactionRequest(t){const n=mE(t),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const a=_c(n[s],this);nP(a)?r.push(async function(){n[s]=await a}()):n[s]=a}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);nP(s)?r.push(async function(){n.blockTag=await s}()):n.blockTag=s}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(Ue(this,Of)==null){const s=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw Ue(this,Of)===s&&Wt(this,Of,null),a}})();return Wt(this,Of,s),(await s).clone()}const t=Ue(this,Of),[n,r]=await Promise.all([t,this._detectNetwork()]);return n.chainId!==r.chainId&&(Ue(this,Fw)?(this.emit("network",r,n),Ue(this,Of)===t&&Wt(this,Of,Promise.resolve(r))):Mr(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const t=await this.getNetwork(),n=async()=>{const{_block:s,gasPrice:a,priorityFee:o}=await Su({_block:xr(this,zi,WJ).call(this,"latest",!1),gasPrice:(async()=>{try{const d=await xr(this,zi,jf).call(this,{method:"getGasPrice"});return Ns(d,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const d=await xr(this,zi,jf).call(this,{method:"getPriorityFee"});return Ns(d,"%response")}catch{}return null})()});let l=null,c=null;const u=this._wrapBlock(s,t);return u&&u.baseFeePerGas&&(c=o??BigInt("1000000000"),l=u.baseFeePerGas*w5t+c),new Y0e(a,l,c)},r=t.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new Hy(r.url),a=await r.processFunc(n,this,s);return new Y0e(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(t){let n=this._getTransactionRequest(t);return nP(n)&&(n=await n),Ns(await xr(this,zi,jf).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(t){const{tx:n,blockTag:r}=await Su({tx:this._getTransactionRequest(t),blockTag:this._getBlockTag(t.blockTag)});return await xr(this,zi,VJ).call(this,xr(this,zi,HJ).call(this,n,r,t.enableCcipRead?0:-1))}async getBalance(t,n){return Ns(await xr(this,zi,xj).call(this,{method:"getBalance"},t,n),"%response")}async getTransactionCount(t,n){return Li(await xr(this,zi,xj).call(this,{method:"getTransactionCount"},t,n),"%response")}async getCode(t,n){return qr(await xr(this,zi,xj).call(this,{method:"getCode"},t,n))}async getStorage(t,n,r){const s=Ns(n,"position");return qr(await xr(this,zi,xj).call(this,{method:"getStorage",position:s},t,r))}async broadcastTransaction(t){const{blockNumber:n,hash:r,network:s}=await Su({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:t}),network:this.getNetwork()}),a=xae.from(t);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,s).replaceableTransaction(n)}async getBlock(t,n){const{network:r,params:s}=await Su({network:this.getNetwork(),params:xr(this,zi,WJ).call(this,t,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(t){const{network:n,params:r}=await Su({network:this.getNetwork(),params:xr(this,zi,jf).call(this,{method:"getTransaction",hash:t})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(t){const{network:n,params:r}=await Su({network:this.getNetwork(),params:xr(this,zi,jf).call(this,{method:"getTransactionReceipt",hash:t})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await xr(this,zi,jf).call(this,{method:"getTransaction",hash:t});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(t){const{result:n}=await Su({network:this.getNetwork(),result:xr(this,zi,jf).call(this,{method:"getTransactionResult",hash:t})});return n==null?null:qr(n)}async getLogs(t){let n=this._getFilter(t);nP(n)&&(n=await n);const{network:r,params:s}=await Su({network:this.getNetwork(),params:xr(this,zi,jf).call(this,{method:"getLogs",filter:n})});return s.map(a=>this._wrapLog(a,r))}_getProvider(t){Mr(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(t){return await NM.fromName(this,t)}async getAvatar(t){const n=await this.getResolver(t);return n?await n.getAvatar():null}async resolveName(t){const n=await this.getResolver(t);return n?await n.getAddress():null}async lookupAddress(t){t=na(t);const n=MJ(t.substring(2).toLowerCase()+".addr.reverse");try{const r=await NM.getEnsAddress(this),a=await new Vj(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===lE)return null;const l=await new Vj(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(l)!==t?null:l}catch(r){if(Zc(r,"BAD_DATA")&&r.value==="0x"||Zc(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(t,n,r){const s=n??1;return s===0?this.getTransactionReceipt(t):new Promise(async(a,o)=>{let l=null;const c=async u=>{try{const d=await this.getTransactionReceipt(t);if(d!=null&&u-d.blockNumber+1>=s){a(d),l&&(clearTimeout(l),l=null);return}}catch(d){console.log("EEE",d)}this.once("block",c)};r!=null&&(l=setTimeout(()=>{l!=null&&(l=null,this.off("block",c),o(Eo("timeout","TIMEOUT",{reason:"timeout"})))},r)),c(await this.getBlockNumber())})}async waitForBlock(t){Mr(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(t){const n=Ue(this,Bh).get(t);n&&(n.timer&&clearTimeout(n.timer),Ue(this,Bh).delete(t))}_setTimeout(t,n){n==null&&(n=0);const r=sb(this,ok)._++,s=()=>{Ue(this,Bh).delete(r),t()};if(this.paused)Ue(this,Bh).set(r,{timer:null,func:s,time:n});else{const a=setTimeout(s,n);Ue(this,Bh).set(r,{timer:a,func:s,time:WH()})}return r}_forEachSubscriber(t){for(const n of Ue(this,vu).values())t(n.subscriber)}_getSubscriber(t){switch(t.type){case"debug":case"error":case"network":return new CIe(t.type);case"block":{const n=new g5t(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new b5t(this,t.type);case"event":return new Nae(this,t.filter);case"transaction":return new v5t(this,t.hash);case"orphan":return new y5t(this,t.filter)}throw new Error(`unsupported event: ${t.type}`)}_recoverSubscriber(t,n){for(const r of Ue(this,vu).values())if(r.subscriber===t){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),Ue(this,wu)!=null&&n.pause(Ue(this,wu));break}}async on(t,n){const r=await xr(this,zi,nO).call(this,t);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,Ue(this,wu)!=null&&r.subscriber.pause(Ue(this,wu))),this}async once(t,n){const r=await xr(this,zi,nO).call(this,t);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,Ue(this,wu)!=null&&r.subscriber.pause(Ue(this,wu))),this}async emit(t,...n){const r=await xr(this,zi,gj).call(this,t,n);if(!r||r.listeners.length===0)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const l=new mke(this,o?null:a,t);try{a.call(this,...n,l)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),Ue(this,vu).delete(r.tag)),s>0}async listenerCount(t){if(t){const r=await xr(this,zi,gj).call(this,t);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of Ue(this,vu).values())n+=r.length;return n}async listeners(t){if(t){const r=await xr(this,zi,gj).call(this,t);return r?r.listeners.map(({listener:s})=>s):[]}let n=[];for(const{listeners:r}of Ue(this,vu).values())n=n.concat(r.map(({listener:s})=>s));return n}async off(t,n){const r=await xr(this,zi,gj).call(this,t);if(!r)return this;if(n){const s=r.listeners.map(({listener:a})=>a).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),Ue(this,vu).delete(r.tag)),this}async removeAllListeners(t){if(t){const{tag:n,started:r,subscriber:s}=await xr(this,zi,nO).call(this,t);r&&s.stop(),Ue(this,vu).delete(n)}else for(const[n,{started:r,subscriber:s}]of Ue(this,vu))r&&s.stop(),Ue(this,vu).delete(n);return this}async addListener(t,n){return await this.on(t,n)}async removeListener(t,n){return this.off(t,n)}get destroyed(){return Ue(this,dS)}destroy(){this.removeAllListeners();for(const t of Ue(this,Bh).keys())this._clearTimeout(t);Wt(this,dS,!0)}get paused(){return Ue(this,wu)!=null}set paused(t){!!t!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(t){if(Wt(this,jg,-1),Ue(this,wu)!=null){if(Ue(this,wu)==!!t)return;Mr(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(t)),Wt(this,wu,!!t);for(const n of Ue(this,Bh).values())n.timer&&clearTimeout(n.timer),n.time=WH()-n.time}resume(){if(Ue(this,wu)!=null){this._forEachSubscriber(t=>t.resume()),Wt(this,wu,null);for(const t of Ue(this,Bh).values()){let n=t.time;n<0&&(n=0),t.time=WH(),setTimeout(t.func,n)}}}}vu=new WeakMap,iy=new WeakMap,wu=new WeakMap,dS=new WeakMap,Of=new WeakMap,Fw=new WeakMap,ay=new WeakMap,jg=new WeakMap,ok=new WeakMap,Bh=new WeakMap,fS=new WeakMap,hS=new WeakMap,zi=new WeakSet,jf=async function(t){const n=Ue(this,hS).cacheTimeout;if(n<0)return await this._perform(t);const r=tO(t.method,t);let s=Ue(this,ay).get(r);return s||(s=this._perform(t),Ue(this,ay).set(r,s),setTimeout(()=>{Ue(this,ay).get(r)===s&&Ue(this,ay).delete(r)},n)),await s},HJ=async function(t,n,r){Mr(r<C5t,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},t,{blockTag:n,enableCcipRead:!0})});const s=mE(t);try{return qr(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(a){if(!this.disableCcipRead&&rae(a)&&a.data&&r>=0&&n==="latest"&&s.to!=null&&go(a.data,0,4)==="0x556f1830"){const o=a.data,l=await _c(s.to,this);let c;try{c=T5t(go(a.data,4))}catch(f){Mr(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}Mr(c.sender.toLowerCase()===l.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const u=await this.ccipReadFetch(s,c.calldata,c.urls);Mr(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:a.data,errorArgs:c.errorArgs}});const d={to:l,data:Ra([c.selector,k5t([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:d});try{const f=await xr(this,zi,HJ).call(this,d,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},d),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},d),error:f}),f}}throw a}},VJ=async function(t){const{value:n}=await Su({network:this.getNetwork(),value:t});return n},xj=async function(t,n,r){let s=this._getAddress(n),a=this._getBlockTag(r);return(typeof s!="string"||typeof a!="string")&&([s,a]=await Promise.all([s,a])),await xr(this,zi,VJ).call(this,xr(this,zi,jf).call(this,Object.assign(t,{address:s,blockTag:a})))},WJ=async function(t,n){if(co(t,32))return await xr(this,zi,jf).call(this,{method:"getBlock",blockHash:t,includeTransactions:n});let r=this._getBlockTag(t);return typeof r!="string"&&(r=await r),await xr(this,zi,jf).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},gj=async function(t,n){let r=await VH(t,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await VH({orphan:"drop-log",log:n[0]},this)),Ue(this,vu).get(r.tag)||null},nO=async function(t){const n=await VH(t,this),r=n.tag;let s=Ue(this,vu).get(r);return s||(s={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},Ue(this,vu).set(r,s)),s};function j5t(e,t){try{const n=qJ(e,t);if(n)return xM(n)}catch{}return null}function qJ(e,t){if(e==="0x")return null;try{const n=Li(go(e,t,t+32)),r=Li(go(e,n,n+32));return go(e,n+32,n+32+r)}catch{}return null}function rxe(e){const t=sl(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function E5t(e){if(e.length%32===0)return e;const t=new Uint8Array(Math.ceil(e.length/32)*32);return t.set(e),t}const _5t=new Uint8Array([]);function k5t(e){const t=[];let n=0;for(let r=0;r<e.length;r++)t.push(_5t),n+=32;for(let r=0;r<e.length;r++){const s=fs(e[r]);t[r]=rxe(n),t.push(rxe(s.length)),t.push(E5t(s)),n+=32+Math.ceil(s.length/32)*32}return Ra(t)}const sxe="0x0000000000000000000000000000000000000000000000000000000000000000";function T5t(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};Mr(t4(e)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=go(e,0,32);Mr(go(n,0,12)===go(sxe,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=go(n,12);try{const r=[],s=Li(go(e,32,64)),a=Li(go(e,s,s+32)),o=go(e,s+32);for(let l=0;l<a;l++){const c=j5t(o,l*32);if(c==null)throw new Error("abort");r.push(c)}t.urls=r}catch{Mr(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=qJ(e,64);if(r==null)throw new Error("abort");t.calldata=r}catch{Mr(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}Mr(go(e,100,128)===go(sxe,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=go(e,96,100);try{const r=qJ(e,128);if(r==null)throw new Error("abort");t.extraData=r}catch{Mr(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>t[r]),t}function av(e,t){if(e.provider)return e.provider;Mr(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function ixe(e,t){let n=mE(t);if(n.to!=null&&(n.to=_c(n.to,e)),n.from!=null){const r=n.from;n.from=Promise.all([e.getAddress(),_c(r,e)]).then(([s,a])=>(Cn(s.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),s))}else n.from=e.getAddress();return await Su(n)}class Aae{constructor(t){Bn(this,"provider");Rs(this,{provider:t||null})}async getNonce(t){return av(this,"getTransactionCount").getTransactionCount(await this.getAddress(),t)}async populateCall(t){return await ixe(this,t)}async populateTransaction(t){const n=av(this,"populateTransaction"),r=await ixe(this,t);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const s=await this.provider.getNetwork();if(r.chainId!=null){const o=Ns(r.chainId);Cn(o===s.chainId,"transaction chainId mismatch","tx.chainId",t.chainId)}else r.chainId=s.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?Cn(!1,"eip-1559 transaction do not support gasPrice","tx",t):(r.type===0||r.type===1)&&a&&Cn(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",t),(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();Mr(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.authorizationList&&r.authorizationList.length?r.type=4:r.type=2,r.gasPrice!=null){const l=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=l,r.maxPriorityFeePerGas=l}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Mr(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):Mr(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3||r.type===4)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Su(r)}async populateAuthorization(t){const n=Object.assign({},t);return n.chainId==null&&(n.chainId=(await av(this,"getNetwork").getNetwork()).chainId),n.nonce==null&&(n.nonce=await this.getNonce()),n}async estimateGas(t){return av(this,"estimateGas").estimateGas(await this.populateCall(t))}async call(t){return av(this,"call").call(await this.populateCall(t))}async resolveName(t){return await av(this,"resolveName").resolveName(t)}async sendTransaction(t){const n=av(this,"sendTransaction"),r=await this.populateTransaction(t);delete r.from;const s=xae.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}authorize(t){Mr(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}var pS,rO;const Gue=class Gue extends Aae{constructor(n,r){super(r);Ln(this,pS);Bn(this,"address");Rs(this,{address:n})}async getAddress(){return this.address}connect(n){return new Gue(this.address,n)}async signTransaction(n){xr(this,pS,rO).call(this,"transactions","signTransaction")}async signMessage(n){xr(this,pS,rO).call(this,"messages","signMessage")}async signTypedData(n,r,s){xr(this,pS,rO).call(this,"typed-data","signTypedData")}};pS=new WeakSet,rO=function(n,r){Mr(!1,`VoidSigner cannot sign ${n}`,"UNSUPPORTED_OPERATION",{operation:r})};let GJ=Gue;function I5t(e){return JSON.parse(JSON.stringify(e))}var Qu,p0,Ow,oy,Mw,mS,Jy,KJ,YJ;class SIe{constructor(t){Ln(this,Jy);Ln(this,Qu);Ln(this,p0);Ln(this,Ow);Ln(this,oy);Ln(this,Mw);Ln(this,mS);Wt(this,Qu,t),Wt(this,p0,null),Wt(this,Ow,xr(this,Jy,KJ).bind(this)),Wt(this,oy,!1),Wt(this,Mw,null),Wt(this,mS,!1)}_subscribe(t){throw new Error("subclasses must override this")}_emitResults(t,n){throw new Error("subclasses must override this")}_recover(t){throw new Error("subclasses must override this")}start(){Ue(this,oy)||(Wt(this,oy,!0),xr(this,Jy,KJ).call(this,-2))}stop(){Ue(this,oy)&&(Wt(this,oy,!1),Wt(this,mS,!0),xr(this,Jy,YJ).call(this),Ue(this,Qu).off("block",Ue(this,Ow)))}pause(t){t&&xr(this,Jy,YJ).call(this),Ue(this,Qu).off("block",Ue(this,Ow))}resume(){this.start()}}Qu=new WeakMap,p0=new WeakMap,Ow=new WeakMap,oy=new WeakMap,Mw=new WeakMap,mS=new WeakMap,Jy=new WeakSet,KJ=async function(t){try{Ue(this,p0)==null&&Wt(this,p0,this._subscribe(Ue(this,Qu)));let n=null;try{n=await Ue(this,p0)}catch(a){if(!Zc(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){Wt(this,p0,null),Ue(this,Qu)._recoverSubscriber(this,this._recover(Ue(this,Qu)));return}const r=await Ue(this,Qu).getNetwork();if(Ue(this,Mw)||Wt(this,Mw,r),Ue(this,Mw).chainId!==r.chainId)throw new Error("chaid changed");if(Ue(this,mS))return;const s=await Ue(this,Qu).send("eth_getFilterChanges",[n]);await this._emitResults(Ue(this,Qu),s)}catch(n){console.log("@TODO",n)}Ue(this,Qu).once("block",Ue(this,Ow))},YJ=function(){const t=Ue(this,p0);t&&(Wt(this,p0,null),t.then(n=>{Ue(this,Qu).destroyed||Ue(this,Qu).send("eth_uninstallFilter",[n])}))};var Rw;class P5t extends SIe{constructor(n,r){super(n);Ln(this,Rw);Wt(this,Rw,I5t(r))}_recover(n){return new Nae(n,Ue(this,Rw))}async _subscribe(n){return await n.send("eth_newFilter",[Ue(this,Rw)])}async _emitResults(n,r){for(const s of r)n.emit(Ue(this,Rw),n._wrapLog(s,n._network))}}Rw=new WeakMap;class F5t extends SIe{async _subscribe(t){return await t.send("eth_newPendingTransactionFilter",[])}async _emitResults(t,n){for(const r of n)t.emit("pending",r)}}const O5t="bigint,boolean,function,number,string,symbol".split(/,/g);function sO(e){if(e==null||O5t.indexOf(typeof e)>=0||typeof e.getAddress=="function")return e;if(Array.isArray(e))return e.map(sO);if(typeof e=="object")return Object.keys(e).reduce((t,n)=>(t[n]=e[n],t),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function M5t(e){return new Promise(t=>{setTimeout(t,e)})}function B6(e){return e&&e.toLowerCase()}function axe(e){return e&&typeof e.pollingInterval=="number"}const NIe={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class qH extends Aae{constructor(n,r){super(n);Bn(this,"address");r=na(r),Rs(this,{address:r})}connect(n){Mr(!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=sO(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const l=await _c(o,this.provider);Cn(l!=null&&l.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=l})())}else r.from=this.address;if(r.gasLimit==null&&s.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;s.push((async()=>{r.to=await _c(o,this.provider)})())}s.length&&await Promise.all(s);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const l=[1e3,100];let c=0;const u=async()=>{try{const d=await this.provider.getTransaction(s);if(d!=null){a(d.replaceableTransaction(r));return}}catch(d){if(Zc(d,"CANCELLED")||Zc(d,"BAD_DATA")||Zc(d,"NETWORK_ERROR")||Zc(d,"UNSUPPORTED_OPERATION")){d.info==null&&(d.info={}),d.info.sendTransactionHash=s,o(d);return}if(Zc(d,"INVALID_ARGUMENT")&&(c++,d.info==null&&(d.info={}),d.info.sendTransactionHash=s,c>10)){o(d);return}this.provider.emit("error",Eo("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:d}))}this.provider._setTimeout(()=>{u()},l.pop()||4e3)};u()})}async signTransaction(n){const r=sO(n);if(r.from){const a=await _c(r.from,this.provider);Cn(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const s=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[s])}async signMessage(n){const r=typeof n=="string"?ud(n):n;return await this.provider.send("personal_sign",[qr(r),this.address.toLowerCase()])}async signTypedData(n,r,s){const a=sO(s),o=await zS.resolveNames(n,r,a,async l=>{const c=await _c(l);return Cn(c!=null,"TypedData does not support null address","value",l),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(zS.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"?ud(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),qr(r)])}}var Lw,xS,Eg,m0,Gp,$h,$d,lk,XJ;class R5t extends A5t{constructor(n,r){super(n,r);Ln(this,lk);Ln(this,Lw);Ln(this,xS);Ln(this,Eg);Ln(this,m0);Ln(this,Gp);Ln(this,$h);Ln(this,$d);Wt(this,xS,1),Wt(this,Lw,Object.assign({},NIe,r||{})),Wt(this,Eg,[]),Wt(this,m0,null),Wt(this,$h,null),Wt(this,$d,null);{let a=null;const o=new Promise(l=>{a=l});Wt(this,Gp,{promise:o,resolve:a})}const s=this._getOption("staticNetwork");typeof s=="boolean"?(Cn(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&Wt(this,$h,hy.from(n))):s&&(Cn(n==null||s.matches(n),"staticNetwork MUST match network object","options",r),Wt(this,$h,s))}_getOption(n){return Ue(this,Lw)[n]}get _network(){return Mr(Ue(this,$h),"network is not available yet","NETWORK_ERROR"),Ue(this,$h)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let s=n.transaction;if(s&&s.type!=null&&Ns(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},s,{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(Ue(this,$h))return Ue(this,$h)}else return n;return Ue(this,$d)?await Ue(this,$d):this.ready?(Wt(this,$d,(async()=>{try{const r=hy.from(Ns(await this.send("eth_chainId",[])));return Wt(this,$d,null),r}catch(r){throw Wt(this,$d,null),r}})()),await Ue(this,$d)):(Wt(this,$d,(async()=>{const r={id:sb(this,xS)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let s;try{s=(await this._send(r))[0],Wt(this,$d,null)}catch(a){throw Wt(this,$d,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return hy.from(Ns(s.result));throw this.getRpcError(r,s)})()),await Ue(this,$d))}_start(){Ue(this,Gp)==null||Ue(this,Gp).resolve==null||(Ue(this,Gp).resolve(),Wt(this,Gp,null),(async()=>{for(;Ue(this,$h)==null&&!this.destroyed;)try{Wt(this,$h,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",Eo("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await M5t(1e3)}xr(this,lk,XJ).call(this)})())}async _waitUntilReady(){if(Ue(this,Gp)!=null)return await Ue(this,Gp).promise}_getSubscriber(n){return n.type==="pending"?new F5t(this):n.type==="event"?this._getOption("polling")?new Nae(this,n.filter):new P5t(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new CIe("orphan"):super._getSubscriber(n)}get ready(){return Ue(this,Gp)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(n[s]==null)return;let a=s;s==="gasLimit"&&(a="gas"),r[a]=Jp(Ns(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=qr(n[s]))}),n.accessList&&(r.accessList=c5(n.accessList)),n.blobVersionedHashes&&(r.blobVersionedHashes=n.blobVersionedHashes.map(s=>s.toLowerCase())),n.authorizationList&&(r.authorizationList=n.authorizationList.map(s=>{const a=jTe(s);return{address:a.address,nonce:Jp(a.nonce),chainId:Jp(a.chainId),yParity:Jp(a.signature.yParity),r:Jp(a.signature.r),s:Jp(a.signature.s)}})),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:[B6(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[B6(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[B6(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[B6(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(B6):n.filter.address=B6(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:s}=n,{error:a}=r;if(s==="eth_estimateGas"&&a.message){const c=a.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return Eo("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}});if(c.match(/nonce/i)&&c.match(/too low/i))return Eo("nonce has already been used","NONCE_EXPIRED",{transaction:n.params[0],info:{payload:n,error:a}})}if(s==="eth_call"||s==="eth_estimateGas"){const c=QJ(a),u=pE.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",n.params[0],c?c.data:null);return u.info={error:a,payload:n},u}const o=JSON.stringify(D5t(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return Eo("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"}[s]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){const c=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return Eo("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return Eo("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Eo("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:a}});if(o.match(/only replay-protected/i))return Eo("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:c,info:{error:a}}})}let l=!!o.match(/the method .* does not exist/i);return l||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(l=!0),l?Eo("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):Eo("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(Eo("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=sb(this,xS)._++,a=new Promise((o,l)=>{Ue(this,Eg).push({resolve:o,reject:l,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return xr(this,lk,XJ).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 qH(this,a[n])}const{accounts:s}=await Su({network:this.getNetwork(),accounts:r});n=na(n);for(const a of s)if(na(a)===n)return new qH(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new qH(this,r))}destroy(){Ue(this,m0)&&(clearTimeout(Ue(this,m0)),Wt(this,m0,null));for(const{payload:n,reject:r}of Ue(this,Eg))r(Eo("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));Wt(this,Eg,[]),super.destroy()}}Lw=new WeakMap,xS=new WeakMap,Eg=new WeakMap,m0=new WeakMap,Gp=new WeakMap,$h=new WeakMap,$d=new WeakMap,lk=new WeakSet,XJ=function(){if(Ue(this,m0))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");Wt(this,m0,setTimeout(()=>{Wt(this,m0,null);const r=Ue(this,Eg);for(Wt(this,Eg,[]);r.length;){const s=[r.shift()];for(;r.length&&s.length!==Ue(this,Lw).batchMaxCount;)if(s.push(r.shift()),JSON.stringify(s.map(o=>o.payload)).length>Ue(this,Lw).batchMaxSize){r.unshift(s.pop());break}(async()=>{const a=s.length===1?s[0].payload:s.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:l,reject:c,payload:u}of s){if(this.destroyed){c(Eo("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const d=o.filter(f=>f.id===u.id)[0];if(d==null){const f=Eo("missing response for request","BAD_DATA",{value:o,info:{payload:u}});this.emit("error",f),c(f);continue}if("error"in d){c(this.getRpcError(u,d));continue}l(d.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:l}of s)l(o)}})()}},n))};var ly;class L5t extends R5t{constructor(n,r){super(n,r);Ln(this,ly);let s=this._getOption("pollingInterval");s==null&&(s=NIe.pollingInterval),Wt(this,ly,s)}_getSubscriber(n){const r=super._getSubscriber(n);return axe(r)&&(r.pollingInterval=Ue(this,ly)),r}get pollingInterval(){return Ue(this,ly)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");Wt(this,ly,n),this._forEachSubscriber(r=>{axe(r)&&(r.pollingInterval=Ue(this,ly))})}}ly=new WeakMap;function QJ(e){if(e==null)return null;if(typeof e.message=="string"&&e.message.match(/revert/i)&&co(e.data))return{message:e.message,data:e.data};if(typeof e=="object"){for(const t in e){const n=QJ(e[t]);if(n)return n}return null}if(typeof e=="string")try{return QJ(JSON.parse(e))}catch{}return null}function ZJ(e,t){if(e!=null){if(typeof e.message=="string"&&t.push(e.message),typeof e=="object")for(const n in e)ZJ(e[n],t);if(typeof e=="string")try{return ZJ(JSON.parse(e),t)}catch{}}}function D5t(e){const t=[];return ZJ(e,t),t}var gS,bS;const Bv=class Bv extends L5t{constructor(n,r,s){const a=Object.assign({},s??{},{batchMaxCount:1});Cn(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,a);Ln(this,gS);Ln(this,bS);Wt(this,bS,null),s&&s.providerInfo&&Wt(this,bS,s.providerInfo),Wt(this,gS,async(o,l)=>{const c={method:o,params:l};this.emit("debug",{action:"sendEip1193Request",payload:c});try{const u=await n.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:u}),u}catch(u){const d=new Error(u.message);throw d.code=u.code,d.data=u.data,d.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:d}),d}})}get providerInfo(){return Ue(this,bS)}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){Cn(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await Ue(this,gS).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(s=>s.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await Ue(this,gS).call(this,"eth_requestAccounts",[])}catch(r){const s=r.payload;throw this.getRpcError(s,{id:s.id,error:r})}return await super.getSigner(n)}static async discover(n){if(n==null&&(n={}),n.provider)return new Bv(n.provider);const r=n.window?n.window:typeof window<"u"?window:null;if(r==null)return null;const s=n.anyProvider;if(s&&r.ethereum)return new Bv(r.ethereum);if(!("addEventListener"in r&&"dispatchEvent"in r&&"removeEventListener"in r))return null;const a=n.timeout?n.timeout:300;return a===0?null:await new Promise((o,l)=>{let c=[];const u=x=>{c.push(x.detail),s&&d()},d=()=>{if(clearTimeout(f),c.length)if(n&&n.filter){const x=n.filter(c.map(g=>Object.assign({},g.info)));if(x==null)o(null);else if(x instanceof Bv)o(x);else{let g=null;if(x.uuid&&(g=c.filter(w=>x.uuid===w.info.uuid)[0]),g){const{provider:v,info:w}=g;o(new Bv(v,void 0,{providerInfo:w}))}else l(Eo("filter returned unknown info","UNSUPPORTED_OPERATION",{value:x}))}}else{const{provider:x,info:g}=c[0];o(new Bv(x,void 0,{providerInfo:g}))}else o(null);r.removeEventListener("eip6963:announceProvider",u)},f=setTimeout(()=>{d()},a);r.addEventListener("eip6963:announceProvider",u),r.dispatchEvent(new Event("eip6963:requestProvider"))})}};gS=new WeakMap,bS=new WeakMap;let AM=Bv;var yS;const Kue=class Kue extends Aae{constructor(n,r){super(r);Bn(this,"address");Ln(this,yS);Cn(n&&typeof n.sign=="function","invalid private key","privateKey","[ REDACTED ]"),Wt(this,yS,n);const s=$k(this.signingKey.publicKey);Rs(this,{address:s})}get signingKey(){return Ue(this,yS)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(n){return new Kue(Ue(this,yS),n)}async signTransaction(n){n=mE(n);const{to:r,from:s}=await Su({to:n.to?_c(n.to,this):void 0,from:n.from?_c(n.from,this):void 0});r!=null&&(n.to=r),s!=null&&(n.from=s),n.from!=null&&(Cn(na(n.from)===this.address,"transaction from address mismatch","tx.from",n.from),delete n.from);const a=xae.from(n);return a.signature=this.signingKey.sign(a.unsignedHash),a.serialized}async signMessage(n){return this.signMessageSync(n)}signMessageSync(n){return this.signingKey.sign(y3t(n)).serialized}authorizeSync(n){Cn(typeof n.address=="string","invalid address for authorizeSync","auth.address",n);const r=this.signingKey.sign(Owt(n));return Object.assign({},{address:na(n.address),nonce:Ns(n.nonce||0),chainId:Ns(n.chainId||0)},{signature:r})}async authorize(n){return n=Object.assign({},n,{address:await _c(n.address,this)}),this.authorizeSync(await this.populateAuthorization(n))}async signTypedData(n,r,s){const a=await zS.resolveNames(n,r,s,async o=>{Mr(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:o}});const l=await this.provider.resolveName(o);return Mr(l!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),l});return this.signingKey.sign(zS.hash(a.domain,r,a.value)).serialized}};yS=new WeakMap;let jM=Kue;const EM=" !#$%&'()*+,-./<=>?@[]^_`{|}~",B5t=/^[a-z]*$/i;function oxe(e,t){let n=97;return e.reduce((r,s)=>(s===t?n++:s.match(B5t)?r.push(String.fromCharCode(n)+s):(n=97,r.push(s)),r),[])}function $5t(e,t){for(let s=EM.length-1;s>=0;s--)e=e.split(EM[s]).join(t.substring(2*s,2*s+2));const n=[],r=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,a,o,l)=>{if(o)for(let c=parseInt(o);c>=0;c--)n.push(";");else n.push(a.toLowerCase());return""});if(r)throw new Error(`leftovers: ${JSON.stringify(r)}`);return oxe(oxe(n,";"),":")}function U5t(e){return Cn(e[0]==="0","unsupported auwl data","data",e),$5t(e.substring(1+2*EM.length),e.substring(1,1+2*EM.length))}class z5t{constructor(t){Bn(this,"locale");Rs(this,{locale:t})}split(t){return t.toLowerCase().split(/\s+/g)}join(t){return t.join(" ")}}var vS,ck,Dw,uk,JJ;class H5t extends z5t{constructor(n,r,s){super(n);Ln(this,uk);Ln(this,vS);Ln(this,ck);Ln(this,Dw);Wt(this,vS,r),Wt(this,ck,s),Wt(this,Dw,null)}get _data(){return Ue(this,vS)}_decodeWords(){return U5t(Ue(this,vS))}getWord(n){const r=xr(this,uk,JJ).call(this);return Cn(n>=0&&n<r.length,`invalid word index: ${n}`,"index",n),r[n]}getWordIndex(n){return xr(this,uk,JJ).call(this).indexOf(n)}}vS=new WeakMap,ck=new WeakMap,Dw=new WeakMap,uk=new WeakSet,JJ=function(){if(Ue(this,Dw)==null){const n=this._decodeWords();if(l1(n.join(`
`)+`
`)!==Ue(this,ck))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);Wt(this,Dw,n)}return Ue(this,Dw)};const V5t="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",W5t="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let GH=null;class k3 extends H5t{constructor(){super("en",V5t,W5t)}static wordlist(){return GH==null&&(GH=new k3),GH}}function AIe(e){return(1<<e)-1<<8-e&255}function q5t(e){return(1<<e)-1&255}function KH(e,t){uke("NFKD"),t==null&&(t=k3.wordlist());const n=t.split(e);Cn(n.length%3===0&&n.length>=12&&n.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const r=new Uint8Array(Math.ceil(11*n.length/8));let s=0;for(let u=0;u<n.length;u++){let d=t.getWordIndex(n[u].normalize("NFKD"));Cn(d>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let f=0;f<11;f++)d&1<<10-f&&(r[s>>3]|=1<<7-s%8),s++}const a=32*n.length/3,o=n.length/3,l=AIe(o),c=fs(op(r.slice(0,a/8)))[0]&l;return Cn(c===(r[r.length-1]&l),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),qr(r.slice(0,a/8))}function YH(e,t){Cn(e.length%4===0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),t==null&&(t=k3.wordlist());const n=[0];let r=11;for(let o=0;o<e.length;o++)r>8?(n[n.length-1]<<=8,n[n.length-1]|=e[o],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[o]>>8-r,n.push(e[o]&q5t(8-r)),r+=3);const s=e.length/4,a=parseInt(op(e).substring(2,4),16)&AIe(s);return n[n.length-1]<<=s,n[n.length-1]|=a>>8-s,t.join(n.map(o=>t.getWord(o)))}const XH={};class VS{constructor(t,n,r,s,a){Bn(this,"phrase");Bn(this,"password");Bn(this,"wordlist");Bn(this,"entropy");s==null&&(s=""),a==null&&(a=k3.wordlist()),l5(t,XH,"Mnemonic"),Rs(this,{phrase:r,password:s,wordlist:a,entropy:n})}computeSeed(){const t=ud("mnemonic"+this.password,"NFKD");return a2(ud(this.phrase,"NFKD"),t,2048,64,"sha512")}static fromPhrase(t,n,r){const s=KH(t,r);return t=YH(fs(s),r),new VS(XH,s,t,n,r)}static fromEntropy(t,n,r){const s=fs(t,"entropy"),a=YH(s,r);return new VS(XH,qr(s),a,n,r)}static entropyToPhrase(t,n){const r=fs(t,"entropy");return YH(r,n)}static phraseToEntropy(t,n){return KH(t,n)}static isValidMnemonic(t,n){try{return KH(t,n),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */var Vc=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},QH=function(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n},iO,Eh,e0;const G5t={16:10,24:12,32:14},K5t=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],gh=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],rP=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Y5t=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],X5t=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Q5t=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Z5t=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],J5t=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],e6t=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],t6t=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],n6t=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],r6t=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],s6t=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],i6t=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],a6t=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function ZH(e){const t=[];for(let n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}class jae{get key(){return Vc(this,iO,"f").slice()}constructor(t){if(iO.set(this,void 0),Eh.set(this,void 0),e0.set(this,void 0),!(this instanceof jae))throw Error("AES must be instanitated with `new`");QH(this,iO,new Uint8Array(t),"f");const n=G5t[this.key.length];if(n==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");QH(this,e0,[],"f"),QH(this,Eh,[],"f");for(let d=0;d<=n;d++)Vc(this,e0,"f").push([0,0,0,0]),Vc(this,Eh,"f").push([0,0,0,0]);const r=(n+1)*4,s=this.key.length/4,a=ZH(this.key);let o;for(let d=0;d<s;d++)o=d>>2,Vc(this,e0,"f")[o][d%4]=a[d],Vc(this,Eh,"f")[n-o][d%4]=a[d];let l=0,c=s,u;for(;c<r;){if(u=a[s-1],a[0]^=gh[u>>16&255]<<24^gh[u>>8&255]<<16^gh[u&255]<<8^gh[u>>24&255]^K5t[l]<<24,l+=1,s!=8)for(let g=1;g<s;g++)a[g]^=a[g-1];else{for(let g=1;g<s/2;g++)a[g]^=a[g-1];u=a[s/2-1],a[s/2]^=gh[u&255]^gh[u>>8&255]<<8^gh[u>>16&255]<<16^gh[u>>24&255]<<24;for(let g=s/2+1;g<s;g++)a[g]^=a[g-1]}let d=0,f,x;for(;d<s&&c<r;)f=c>>2,x=c%4,Vc(this,e0,"f")[f][x]=a[d],Vc(this,Eh,"f")[n-f][x]=a[d++],c++}for(let d=1;d<n;d++)for(let f=0;f<4;f++)u=Vc(this,Eh,"f")[d][f],Vc(this,Eh,"f")[d][f]=r6t[u>>24&255]^s6t[u>>16&255]^i6t[u>>8&255]^a6t[u&255]}encrypt(t){if(t.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const n=Vc(this,e0,"f").length-1,r=[0,0,0,0];let s=ZH(t);for(let l=0;l<4;l++)s[l]^=Vc(this,e0,"f")[0][l];for(let l=1;l<n;l++){for(let c=0;c<4;c++)r[c]=Y5t[s[c]>>24&255]^X5t[s[(c+1)%4]>>16&255]^Q5t[s[(c+2)%4]>>8&255]^Z5t[s[(c+3)%4]&255]^Vc(this,e0,"f")[l][c];s=r.slice()}const a=new Uint8Array(16);let o=0;for(let l=0;l<4;l++)o=Vc(this,e0,"f")[n][l],a[4*l]=(gh[s[l]>>24&255]^o>>24)&255,a[4*l+1]=(gh[s[(l+1)%4]>>16&255]^o>>16)&255,a[4*l+2]=(gh[s[(l+2)%4]>>8&255]^o>>8)&255,a[4*l+3]=(gh[s[(l+3)%4]&255]^o)&255;return a}decrypt(t){if(t.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const n=Vc(this,Eh,"f").length-1,r=[0,0,0,0];let s=ZH(t);for(let l=0;l<4;l++)s[l]^=Vc(this,Eh,"f")[0][l];for(let l=1;l<n;l++){for(let c=0;c<4;c++)r[c]=J5t[s[c]>>24&255]^e6t[s[(c+3)%4]>>16&255]^t6t[s[(c+2)%4]>>8&255]^n6t[s[(c+1)%4]&255]^Vc(this,Eh,"f")[l][c];s=r.slice()}const a=new Uint8Array(16);let o=0;for(let l=0;l<4;l++)o=Vc(this,Eh,"f")[n][l],a[4*l]=(rP[s[l]>>24&255]^o>>24)&255,a[4*l+1]=(rP[s[(l+3)%4]>>16&255]^o>>16)&255,a[4*l+2]=(rP[s[(l+2)%4]>>8&255]^o>>8)&255,a[4*l+3]=(rP[s[(l+1)%4]&255]^o)&255;return a}}iO=new WeakMap,Eh=new WeakMap,e0=new WeakMap;class jIe{constructor(t,n,r){if(r&&!(this instanceof r))throw new Error(`${t} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new jae(n)},name:{enumerable:!0,value:t}})}}var sP=function(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n},$6=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},bj,sg;class Eae extends jIe{constructor(t,n){if(super("ECC",t,Eae),bj.set(this,void 0),sg.set(this,void 0),n){if(n.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");sP(this,bj,new Uint8Array(n),"f")}else sP(this,bj,new Uint8Array(16),"f");sP(this,sg,this.iv,"f")}get iv(){return new Uint8Array($6(this,bj,"f"))}encrypt(t){if(t.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const n=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){for(let s=0;s<16;s++)$6(this,sg,"f")[s]^=t[r+s];sP(this,sg,this.aes.encrypt($6(this,sg,"f")),"f"),n.set($6(this,sg,"f"),r)}return n}decrypt(t){if(t.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const n=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){const s=this.aes.decrypt(t.subarray(r,r+16));for(let a=0;a<16;a++)n[r+a]=s[a]^$6(this,sg,"f")[a],$6(this,sg,"f")[a]=t[r+a]}return n}}bj=new WeakMap,sg=new WeakMap;var U6=function(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n},bh=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},yj,Nv,_h;class WS extends jIe{constructor(t,n){super("CTR",t,WS),yj.set(this,void 0),Nv.set(this,void 0),_h.set(this,void 0),U6(this,_h,new Uint8Array(16),"f"),bh(this,_h,"f").fill(0),U6(this,yj,bh(this,_h,"f"),"f"),U6(this,Nv,16,"f"),n==null&&(n=1),typeof n=="number"?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(bh(this,_h,"f"))}setCounterValue(t){if(!Number.isInteger(t)||t<0||t>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let n=15;n>=0;--n)bh(this,_h,"f")[n]=t%256,t=Math.floor(t/256)}setCounterBytes(t){if(t.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");bh(this,_h,"f").set(t)}increment(){for(let t=15;t>=0;t--)if(bh(this,_h,"f")[t]===255)bh(this,_h,"f")[t]=0;else{bh(this,_h,"f")[t]++;break}}encrypt(t){var n,r;const s=new Uint8Array(t);for(let a=0;a<s.length;a++)bh(this,Nv,"f")===16&&(U6(this,yj,this.aes.encrypt(bh(this,_h,"f")),"f"),U6(this,Nv,0,"f"),this.increment()),s[a]^=bh(this,yj,"f")[U6(this,Nv,(r=bh(this,Nv,"f"),n=r++,r),"f"),n];return s}decrypt(t){return this.encrypt(t)}}yj=new WeakMap,Nv=new WeakMap,_h=new WeakMap;function o6t(e){if(e.length<16)throw new TypeError("PKCS#7 invalid length");const t=e[e.length-1];if(t>16)throw new TypeError("PKCS#7 padding byte out of range");const n=e.length-t;for(let r=0;r<t;r++)if(e[n+r]!==t)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(e.subarray(0,n))}function EIe(e){return typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e),Jc(e)}function S7(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function Vk(e){return typeof e=="string"?ud(e,"NFKC"):Jc(e)}function xl(e,t){const n=t.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);Cn(n!=null,"invalid path","path",t);const r=n[1],s=n[3],a=n[4]==="!";let o=e;for(const l of r.toLowerCase().split(".")){if(Array.isArray(o)){if(!l.match(/^[0-9]+$/))break;o=o[parseInt(l)]}else if(typeof o=="object"){let c=null;for(const u in o)if(u.toLowerCase()===l){c=o[u];break}o=c}else o=null;if(o==null)break}if(Cn(!a||o!=null,"missing required value","path",r),s&&o!=null){if(s==="int"){if(typeof o=="string"&&o.match(/^-?[0-9]+$/))return parseInt(o);if(Number.isSafeInteger(o))return o}if(s==="number"&&typeof o=="string"&&o.match(/^-?[0-9.]*$/))return parseFloat(o);if(s==="data"&&typeof o=="string")return EIe(o);if(s==="array"&&Array.isArray(o)||s===typeof o)return o;Cn(!1,`wrong type found for ${s} `,"path",r)}return o}const _Ie="m/44'/60'/0'/0/0";function lxe(e){try{const t=JSON.parse(e);if((t.version!=null?parseInt(t.version):0)===3)return!0}catch{}return!1}function l6t(e,t,n){if(xl(e,"crypto.cipher:string")==="aes-128-ctr"){const s=xl(e,"crypto.cipherparams.iv:data!"),a=new WS(t,s);return qr(a.decrypt(n))}Mr(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function _M(e,t){const n=fs(t),r=xl(e,"crypto.ciphertext:data!"),s=qr(lo(Ra([n.slice(16,32),r]))).substring(2);Cn(s===xl(e,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const a=l6t(e,n.slice(0,16),r),o=$k(a);if(e.address){let u=e.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),Cn(na(u)===o,"keystore address/privateKey mismatch","address",e.address)}const l={address:o,privateKey:a};if(xl(e,"x-ethers.version:string")==="0.1"){const u=n.slice(32,64),d=xl(e,"x-ethers.mnemonicCiphertext:data!"),f=xl(e,"x-ethers.mnemonicCounter:data!"),x=new WS(u,f);l.mnemonic={path:xl(e,"x-ethers.path:string")||_Ie,locale:xl(e,"x-ethers.locale:string")||"en",entropy:qr(fs(x.decrypt(d)))}}return l}function kIe(e){const t=xl(e,"crypto.kdf:string");if(t&&typeof t=="string"){if(t.toLowerCase()==="scrypt"){const n=xl(e,"crypto.kdfparams.salt:data!"),r=xl(e,"crypto.kdfparams.n:int!"),s=xl(e,"crypto.kdfparams.r:int!"),a=xl(e,"crypto.kdfparams.p:int!");Cn(r>0&&(r&r-1)===0,"invalid kdf.N","kdf.N",r),Cn(s>0&&a>0,"invalid kdf","kdf",t);const o=xl(e,"crypto.kdfparams.dklen:int!");return Cn(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:n,N:r,r:s,p:a,dkLen:64}}else if(t.toLowerCase()==="pbkdf2"){const n=xl(e,"crypto.kdfparams.salt:data!"),r=xl(e,"crypto.kdfparams.prf:string!"),s=r.split("-").pop();Cn(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",r);const a=xl(e,"crypto.kdfparams.c:int!"),o=xl(e,"crypto.kdfparams.dklen:int!");return Cn(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:n,count:a,dkLen:o,algorithm:s}}}Cn(!1,"unsupported key-derivation function","kdf",t)}function c6t(e,t){const n=JSON.parse(e),r=Vk(t),s=kIe(n);if(s.name==="pbkdf2"){const{salt:f,count:x,dkLen:g,algorithm:v}=s,w=a2(r,f,x,g,v);return _M(n,w)}Mr(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:a,N:o,r:l,p:c,dkLen:u}=s,d=PA(r,a,o,l,c,u);return _M(n,d)}function cxe(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}async function u6t(e,t,n){const r=JSON.parse(e),s=Vk(t),a=kIe(r);if(a.name==="pbkdf2"){n&&(n(0),await cxe(0));const{salt:x,count:g,dkLen:v,algorithm:w}=a,C=a2(s,x,g,v,w);return n&&(n(1),await cxe(0)),_M(r,C)}Mr(a.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:a});const{salt:o,N:l,r:c,p:u,dkLen:d}=a,f=await IA(s,o,l,c,u,d,n);return _M(r,f)}function TIe(e){const t=e.salt!=null?fs(e.salt,"options.salt"):Vg(32);let n=1<<17,r=8,s=1;return e.scrypt&&(e.scrypt.N&&(n=e.scrypt.N),e.scrypt.r&&(r=e.scrypt.r),e.scrypt.p&&(s=e.scrypt.p)),Cn(typeof n=="number"&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),"invalid scrypt N parameter","options.N",n),Cn(typeof r=="number"&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r),Cn(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:t,N:n,r,p:s}}function IIe(e,t,n,r){const s=fs(n.privateKey,"privateKey"),a=r.iv!=null?fs(r.iv,"options.iv"):Vg(16);Cn(a.length===16,"invalid options.iv length","options.iv",r.iv);const o=r.uuid!=null?fs(r.uuid,"options.uuid"):Vg(16);Cn(o.length===16,"invalid options.uuid length","options.uuid",r.iv);const l=e.slice(0,16),c=e.slice(16,32),u=new WS(l,a),d=fs(u.encrypt(s)),f=lo(Ra([c,d])),x={address:n.address.substring(2).toLowerCase(),id:u2t(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:qr(a).substring(2)},ciphertext:qr(d).substring(2),kdf:"scrypt",kdfparams:{salt:qr(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:f.substring(2)}};if(n.mnemonic){const g=r.client!=null?r.client:`ethers/${lke}`,v=n.mnemonic.path||_Ie,w=n.mnemonic.locale||"en",C=e.slice(32,64),N=fs(n.mnemonic.entropy,"account.mnemonic.entropy"),I=Vg(16),P=new WS(C,I),R=fs(P.encrypt(N)),F=new Date,L="UTC--"+(F.getUTCFullYear()+"-"+S7(F.getUTCMonth()+1,2)+"-"+S7(F.getUTCDate(),2)+"T"+S7(F.getUTCHours(),2)+"-"+S7(F.getUTCMinutes(),2)+"-"+S7(F.getUTCSeconds(),2)+".0Z")+"--"+x.address;x["x-ethers"]={client:g,gethFilename:L,path:v,locale:w,mnemonicCounter:qr(I).substring(2),mnemonicCiphertext:qr(R).substring(2),version:"0.1"}}return JSON.stringify(x)}function PIe(e,t,n){n==null&&(n={});const r=Vk(t),s=TIe(n),a=PA(r,s.salt,s.N,s.r,s.p,64);return IIe(fs(a),s,e,n)}async function FIe(e,t,n){n==null&&(n={});const r=Vk(t),s=TIe(n),a=await IA(r,s.salt,s.N,s.r,s.p,64,n.progressCallback);return IIe(fs(a),s,e,n)}const JH="m/44'/60'/0'/0/0",d6t=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),i4=2147483648,f6t=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h6t="0123456789abcdef";function kM(e,t){let n="";for(;e;)n=h6t[e%16]+n,e=Math.trunc(e/16);for(;n.length<t*2;)n="0"+n;return"0x"+n}function eee(e){const t=fs(e),n=go(op(op(t)),0,4),r=Ra([t,n]);return pke(r)}const t0={};function OIe(e,t,n,r){const s=new Uint8Array(37);e&i4?(Mr(r!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set(fs(r),1)):s.set(fs(n));for(let o=24;o>=0;o-=8)s[33+(o>>3)]=e>>24-o&255;const a=fs(kA("sha512",t,s));return{IL:a.slice(0,32),IR:a.slice(32)}}function MIe(e,t){const n=t.split("/");Cn(n.length>0,"invalid path","path",t),n[0]==="m"&&(Cn(e.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",t),n.shift());let r=e;for(let s=0;s<n.length;s++){const a=n[s];if(a.match(/^[0-9]+'$/)){const o=parseInt(a.substring(0,a.length-1));Cn(o<i4,"invalid path index",`path[${s}]`,a),r=r.deriveChild(i4+o)}else if(a.match(/^[0-9]+$/)){const o=parseInt(a);Cn(o<i4,"invalid path index",`path[${s}]`,a),r=r.deriveChild(o)}else Cn(!1,"invalid path component",`path[${s}]`,a)}return r}var dk,tee,Bw,vj;const Lp=class Lp extends jM{constructor(n,r,s,a,o,l,c,u,d){super(r,d);Ln(this,dk);Bn(this,"publicKey");Bn(this,"fingerprint");Bn(this,"parentFingerprint");Bn(this,"mnemonic");Bn(this,"chainCode");Bn(this,"path");Bn(this,"index");Bn(this,"depth");l5(n,t0,"HDNodeWallet"),Rs(this,{publicKey:r.compressedPublicKey});const f=go(TA(op(this.publicKey)),0,4);Rs(this,{parentFingerprint:s,fingerprint:f,chainCode:a,path:o,index:l,depth:c}),Rs(this,{mnemonic:u})}connect(n){return new Lp(t0,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,n)}async encrypt(n,r){return await FIe(xr(this,dk,tee).call(this),n,{progressCallback:r})}encryptSync(n){return PIe(xr(this,dk,tee).call(this),n)}get extendedKey(){return Mr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),eee(Ra(["0x0488ADE4",kM(this.depth,1),this.parentFingerprint,kM(this.index,4),this.chainCode,Ra(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new bE(t0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(n){const r=Li(n,"index");Cn(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(r&2147483647),r&i4&&(s+="'"));const{IR:a,IL:o}=OIe(r,this.chainCode,this.publicKey,this.privateKey),l=new L0(a1((PB(o)+BigInt(this.privateKey))%f6t,32));return new Lp(t0,l,this.fingerprint,qr(a),s,r,this.depth+1,this.mnemonic,this.provider)}derivePath(n){return MIe(this,n)}static fromExtendedKey(n){const r=sl(Kyt(n));Cn(r.length===82||eee(r.slice(0,78))===n,"invalid extended key","extendedKey","[ REDACTED ]");const s=r[4],a=qr(r.slice(5,9)),o=parseInt(qr(r.slice(9,13)).substring(2),16),l=qr(r.slice(13,45)),c=r.slice(45,78);switch(qr(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const u=qr(c);return new bE(t0,$k(u),u,a,l,null,o,s,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new Lp(t0,new L0(c.slice(1)),a,l,null,o,s,null,null)}Cn(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(n,r,s){var o;n==null&&(n=""),r==null&&(r=JH),s==null&&(s=k3.wordlist());const a=VS.fromEntropy(Vg(16),n,s);return xr(o=Lp,Bw,vj).call(o,a.computeSeed(),a).derivePath(r)}static fromMnemonic(n,r){var s;return r||(r=JH),xr(s=Lp,Bw,vj).call(s,n.computeSeed(),n).derivePath(r)}static fromPhrase(n,r,s,a){var l;r==null&&(r=""),s==null&&(s=JH),a==null&&(a=k3.wordlist());const o=VS.fromPhrase(n,r,a);return xr(l=Lp,Bw,vj).call(l,o.computeSeed(),o).derivePath(s)}static fromSeed(n){var r;return xr(r=Lp,Bw,vj).call(r,n,null)}};dk=new WeakSet,tee=function(){const n={address:this.address,privateKey:this.privateKey},r=this.mnemonic;return this.path&&r&&r.wordlist.locale==="en"&&r.password===""&&(n.mnemonic={path:this.path,locale:"en",entropy:r.entropy}),n},Bw=new WeakSet,vj=function(n,r){Cn(kB(n),"invalid seed","seed","[REDACTED]");const s=fs(n,"seed");Cn(s.length>=16&&s.length<=64,"invalid seed","seed","[REDACTED]");const a=fs(kA("sha512",d6t,s)),o=new L0(qr(a.slice(0,32)));return new Lp(t0,o,"0x00000000",qr(a.slice(32)),"m",0,0,r,null)},Ln(Lp,Bw);let Wj=Lp;class bE extends GJ{constructor(n,r,s,a,o,l,c,u,d){super(r,d);Bn(this,"publicKey");Bn(this,"fingerprint");Bn(this,"parentFingerprint");Bn(this,"chainCode");Bn(this,"path");Bn(this,"index");Bn(this,"depth");l5(n,t0,"HDNodeVoidWallet"),Rs(this,{publicKey:s});const f=go(TA(op(s)),0,4);Rs(this,{publicKey:s,fingerprint:f,parentFingerprint:a,chainCode:o,path:l,index:c,depth:u})}connect(n){return new bE(t0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,n)}get extendedKey(){return Mr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),eee(Ra(["0x0488B21E",kM(this.depth,1),this.parentFingerprint,kM(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(n){const r=Li(n,"index");Cn(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(r&2147483647),r&i4&&(s+="'"));const{IR:a,IL:o}=OIe(r,this.chainCode,this.publicKey,null),l=L0.addPoints(o,this.publicKey,!0),c=$k(l);return new bE(t0,c,l,this.fingerprint,qr(a),s,r,this.depth+1,this.provider)}derivePath(n){return MIe(this,n)}}function uxe(e){try{if(JSON.parse(e).encseed)return!0}catch{}return!1}function dxe(e,t){const n=JSON.parse(e),r=Vk(t),s=na(xl(n,"ethaddr:string!")),a=EIe(xl(n,"encseed:string!"));Cn(a&&a.length%16===0,"invalid encseed","json",e);const o=fs(a2(r,r,2e3,32,"sha256")).slice(0,16),l=a.slice(0,16),c=a.slice(16),u=new Eae(o,l),d=o6t(fs(u.decrypt(c)));let f="";for(let x=0;x<d.length;x++)f+=String.fromCharCode(d[x]);return{address:s,privateKey:l1(f)}}function fxe(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}var fk,F0,nee;let _ae=(F0=class extends jM{constructor(t,n){typeof t=="string"&&!t.startsWith("0x")&&(t="0x"+t);let r=typeof t=="string"?new L0(t):t;super(r,n)}connect(t){return new F0(this.signingKey,t)}async encrypt(t,n){const r={address:this.address,privateKey:this.privateKey};return await FIe(r,t,{progressCallback:n})}encryptSync(t){const n={address:this.address,privateKey:this.privateKey};return PIe(n,t)}static async fromEncryptedJson(t,n,r){var a;let s=null;return lxe(t)?s=await u6t(t,n,r):uxe(t)&&(r&&(r(0),await fxe(0)),s=dxe(t,n),r&&(r(1),await fxe(0))),xr(a=F0,fk,nee).call(a,s)}static fromEncryptedJsonSync(t,n){var s;let r=null;return lxe(t)?r=c6t(t,n):uxe(t)?r=dxe(t,n):Cn(!1,"invalid JSON wallet","json","[ REDACTED ]"),xr(s=F0,fk,nee).call(s,r)}static createRandom(t){const n=Wj.createRandom();return t?n.connect(t):n}static fromPhrase(t,n){const r=Wj.fromPhrase(t);return n?r.connect(n):r}},fk=new WeakSet,nee=function(t){if(Cn(t,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in t&&t.mnemonic&&t.mnemonic.locale==="en"){const r=VS.fromEntropy(t.mnemonic.entropy),s=Wj.fromMnemonic(r,t.mnemonic.path);if(s.address===t.address&&s.privateKey===t.privateKey)return s;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const n=new F0(t.privateKey);return Cn(n.address===t.address,"address/privateKey mismatch","json","[ REDACTED ]"),n},Ln(F0,fk),F0);async function hxe(e,t,n){let r;if(e===2?r=t==null?void 0:t.builder_sign_data:e===1?r=t==null?void 0:t.sign_data:r=(t==null?void 0:t.builder_sign_data)??(t==null?void 0:t.sign_data),!r)throw new Error("No data found to sign (no sign_data / builder_sign_data).");const{domain:s,types:a,message:o,primaryType:l}=r,{EIP712Domain:c,primary_type:u,...d}=a||{},f={[l]:u||[],...d},x={...o,nonce:(o==null?void 0:o.nonce)!=null?o.nonce.toString():o==null?void 0:o.nonce};if(typeof n.signTypedData!="function")throw new Error("Signer does not support EIP-712 typed data signing");const g=await n.signTypedData(s,f,x),v=nu.from(g);return{signature:{r:v.r,s:v.s,v:v.v},action:{...x,nonce:Number(x==null?void 0:x.nonce)},nonce:(x==null?void 0:x.nonce)||""}}const TM=({className:e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",className:e,children:i.jsx("path",{d:"M9 1.5C4.8675 1.5 1.5 4.8675 1.5 9C1.5 13.1325 4.8675 16.5 9 16.5C13.1325 16.5 16.5 13.1325 16.5 9C16.5 4.8675 13.1325 1.5 9 1.5ZM8.4375 6C8.4375 5.6925 8.6925 5.4375 9 5.4375C9.3075 5.4375 9.5625 5.6925 9.5625 6V9.75C9.5625 10.0575 9.3075 10.3125 9 10.3125C8.6925 10.3125 8.4375 10.0575 8.4375 9.75V6ZM9.69 12.285C9.6525 12.3825 9.6 12.4575 9.5325 12.5325C9.4575 12.6 9.375 12.6525 9.285 12.69C9.195 12.7275 9.0975 12.75 9 12.75C8.9025 12.75 8.805 12.7275 8.715 12.69C8.625 12.6525 8.5425 12.6 8.4675 12.5325C8.4 12.4575 8.3475 12.3825 8.31 12.285C8.2725 12.195 8.25 12.0975 8.25 12C8.25 11.9025 8.2725 11.805 8.31 11.715C8.3475 11.625 8.4 11.5425 8.4675 11.4675C8.5425 11.4 8.625 11.3475 8.715 11.31C8.895 11.235 9.105 11.235 9.285 11.31C9.375 11.3475 9.4575 11.4 9.5325 11.4675C9.6 11.5425 9.6525 11.625 9.69 11.715C9.7275 11.805 9.75 11.9025 9.75 12C9.75 12.0975 9.7275 12.195 9.69 12.285Z",fill:"currentColor"})});var RIe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pxe=Ne.createContext&&Ne.createContext(RIe),p6t=["attr","size","title"];function m6t(e,t){if(e==null)return{};var n=x6t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function x6t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function IM(){return IM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IM.apply(this,arguments)}function mxe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function PM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mxe(Object(n),!0).forEach(function(r){g6t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mxe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g6t(e,t,n){return t=b6t(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b6t(e){var t=y6t(e,"string");return typeof t=="symbol"?t:t+""}function y6t(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LIe(e){return e&&e.map((t,n)=>Ne.createElement(t.tag,PM({key:n},t.attr),LIe(t.child)))}function jl(e){return t=>Ne.createElement(v6t,IM({attr:PM({},e.attr)},t),LIe(e.child))}function v6t(e){var t=n=>{var{attr:r,size:s,title:a}=e,o=m6t(e,p6t),l=s||n.size||"1em",c;return n.className&&(c=n.className),e.className&&(c=(c?c+" ":"")+e.className),Ne.createElement("svg",IM({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:c,style:PM(PM({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&Ne.createElement("title",null,a),e.children)};return pxe!==void 0?Ne.createElement(pxe.Consumer,null,n=>t(n)):t(RIe)}function w6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M446.7 98.6l-67.6 318.8c-5.1 22.5-18.4 28.1-37.3 17.5l-103-75.9-49.7 47.8c-5.5 5.5-10.1 10.1-20.7 10.1l7.4-104.9 190.9-172.5c8.3-7.4-1.8-11.5-12.9-4.1L117.8 284 16.2 252.2c-22.1-6.9-22.5-22.1 4.6-32.7L418.2 66.4c18.4-6.9 34.5 4.1 28.5 32.2z"},child:[]}]})(e)}function Wk(e){return jl({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"},child:[]}]})(e)}function C6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"},child:[]}]})(e)}function kae(e){return jl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 168v-16c0-13.255 10.745-24 24-24h360V80c0-21.367 25.899-32.042 40.971-16.971l80 80c9.372 9.373 9.372 24.569 0 33.941l-80 80C409.956 271.982 384 261.456 384 240v-48H24c-13.255 0-24-10.745-24-24zm488 152H128v-48c0-21.314-25.862-32.08-40.971-16.971l-80 80c-9.372 9.373-9.372 24.569 0 33.941l80 80C102.057 463.997 128 453.437 128 432v-48h360c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24z"},child:[]}]})(e)}function la(e){return jl({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"},child:[]}]})(e)}function ca(e){return jl({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"},child:[]}]})(e)}function S6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.976 0H24.028C2.71 0-8.047 25.866 7.058 40.971L192 225.941V432c0 7.831 3.821 15.17 10.237 19.662l80 55.98C298.02 518.69 320 507.493 320 487.98V225.941l184.947-184.97C520.021 25.896 509.338 0 487.976 0z"},child:[]}]})(e)}function N6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"},child:[]}]})(e)}function A6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"},child:[]}]})(e)}function j6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"},child:[]}]})(e)}function E6t(e){return jl({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"},child:[]}]})(e)}function T3(e){return jl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"},child:[]}]})(e)}function I3(e){return jl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M279 224H41c-21.4 0-32.1-25.9-17-41L143 64c9.4-9.4 24.6-9.4 33.9 0l119 119c15.2 15.1 4.5 41-16.9 41z"},child:[]}]})(e)}function P3(e){return jl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41zm255-105L177 64c-9.4-9.4-24.6-9.4-33.9 0L24 183c-15.1 15.1-4.4 41 17 41h238c21.4 0 32.1-25.9 17-41z"},child:[]}]})(e)}function DIe(e){return jl({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}const _6t=({handleListRequest:e,isLighterInfoValue:t,handleLighterWalletInfo:n})=>{var pe;const r="https://dextrabothypev2.nftinit.io",{setSignModalOpen:s}=m.useContext(Qr),[a,o]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(""),[P,R]=m.useState(""),[F,U]=m.useState(!0),[L,z]=m.useState({}),Q=Y=>/^\d*$/.test(Y),ne=Y=>{["e","E","+","-"].includes(Y.key)&&Y.preventDefault()},J=a.trim()!==""&&l.trim()!==""&&u.trim()!==""&&f.trim()!=="",X=async()=>{if(!J){I("Please fill in all fields.");return}try{C(!0),I(""),R("");const Y=window.localStorage.getItem("hyperToken"),ie=window.localStorage.getItem("hyperAddress");if(!Y||!ie){s(!0),C(!1);return}const oe={address:ie.toLowerCase(),token:Y,wallet_name:a,main_wallet:l,api_wallet_idx:f,api_wallet_private_key:u},V=await(await fetch(`${r}/api/wallet/generate-lighter`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(oe)})).json();V!=null&&V.success?(ln.success("Wallet created successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),e(),n(ie),o(""),c(""),d(""),x(""),I(""),R(V==null?void 0:V.message)):I((V==null?void 0:V.error_message)||"An error has occurred.")}catch(Y){I(Y.message||"An error has occurred.")}finally{C(!1)}},re=async(Y,ie)=>{console.log("id :>> ",Y);const oe=`${Y}_${ie}`;try{z(Ce=>({...Ce,[oe]:!0})),I(""),R("");const G=window.localStorage.getItem("hyperToken"),V=window.localStorage.getItem("hyperAddress");if(!G||!V){s(!0),z(Ce=>({...Ce,[oe]:!1}));return}const te={address:V.toLowerCase(),token:G,wallet_id:Number(Y)},he=await(await fetch(`${r}/api/wallet/delete-lighter`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(te)})).json();he!=null&&he.success?(ln.success("Wallet deleted successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),n(V),I(""),R(he==null?void 0:he.message)):I((he==null?void 0:he.error_message)||"An error has occurred.")}catch(G){I(G.message||"An error has occurred.")}finally{C(!1)}};return i.jsxs("div",{className:"flex flex-col items-start gap-2 w-full relative",children:[w&&i.jsx("div",{role:"status",className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex justify-center items-center w-full z-[60] -mt-20 h-full min-h-[450px] sm:min-h-[280px]",children:i.jsx(Da,{})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 w-full",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Wallet Name"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:a,onChange:Y=>o(Y.target.value),autoComplete:"off",placeholder:"Wallet Name",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#1b1b1b] text-white border text-[13px] outline-none placeholder:text-[#7F7F7F] ${a===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Login Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:l,onChange:Y=>c(Y.target.value),autoComplete:"off",placeholder:"Login Address",type:"text",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${l===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:u,onChange:Y=>d(Y.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:g?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${u===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w}),i.jsx("button",{type:"button",onClick:()=>v(Y=>!Y),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:w,children:g?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:f,onChange:Y=>{const ie=Y.target.value.trim();if(ie==="")return x("");Q(ie)&&x(ie)},onKeyDown:ne,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${f===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w})})]})]}),i.jsx("button",{onClick:()=>{!w&&X()},disabled:w,className:"w-full h-10 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] focus:ring-0 focus:outline-none justify-center items-center gap-1.5 inline-flex mt-2.5",children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Generate"})}),i.jsx("div",{className:"w-full mt-2",children:(t==null?void 0:t.length)>0?i.jsxs("div",{className:"flex flex-col items-start gap-3 w-full ",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 cursor-pointer text-sm text-zinc-300 w-full",onClick:()=>U(!F),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"Lighter Wallets"}),i.jsx(rse,{className:`w-3.5 h-3.5 transition-transform text-white ${F?"":"rotate-180"}`})]}),i.jsx("div",{className:"flex flex-col items-start gap-1 sm:gap-1.5 w-full max-h-[80px] overflow-y-auto",children:F&&((pe=[...t].sort((Y,ie)=>(ie==null?void 0:ie.wallet_created_data)-(Y==null?void 0:Y.wallet_created_data)))==null?void 0:pe.map((Y,ie)=>{var oe,G;return i.jsx("div",{className:"flex flex-col items-start w-full",children:i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[110px]",children:((oe=Y==null?void 0:Y.wallet_name)==null?void 0:oe.length)>18?((G=Y==null?void 0:Y.wallet_name)==null?void 0:G.slice(0,18))+"...":Y==null?void 0:Y.wallet_name})}),i.jsxs("div",{className:"flex justify-start items-center w-max",children:[i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[75px]",children:(Y==null?void 0:Y.wallet_address.slice(0,6))+"..."+(Y==null?void 0:Y.wallet_address.slice(-4))}),i.jsx("img",{onClick:V=>{V.stopPropagation(),navigator.clipboard.writeText(Y==null?void 0:Y.wallet_address),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsx("span",{className:"text-[#929292] text-[11px] font-normal font-['Inter'] leading-4 min-w-max hidden sm:flex",children:su(Y==null?void 0:Y.wallet_created_data)}),L[`${Y==null?void 0:Y.wallet_id}_${Y==null?void 0:Y.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{re(Y==null?void 0:Y.wallet_id,Y==null?void 0:Y.wallet_name)},className:"w-[70px] sm:w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})},ie)}))})]}):""}),N&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:N})]}),P&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#67ffbd]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:eae,alt:"Dextrabot",className:"w-4 h-4"}),i.jsx("p",{className:"text-[#67FFBD] text-[13px] font-normal font-['Inter'] leading-4",children:P})]})]})},k6t=({handleListRequest:e,isExtendedInfoValue:t,handleExtendedWalletInfo:n})=>{var ce;const r="https://dextrabothypev2.nftinit.io",{setSignModalOpen:s}=m.useContext(Qr),[a,o]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,x]=m.useState(""),[g,v]=m.useState(""),[w,C]=m.useState(""),[N,I]=m.useState(!1),[P,R]=m.useState(!1),[F,U]=m.useState(!1),[L,z]=m.useState(!1),[Q,ne]=m.useState(!1),[J,X]=m.useState(""),[re,pe]=m.useState(""),[Y,ie]=m.useState(!0),[oe,G]=m.useState({}),V=ge=>/^\d*$/.test(ge),te=ge=>{["e","E","+","-"].includes(ge.key)&&ge.preventDefault()},ae=a.trim()!==""&&l.trim()!==""&&u.trim()!==""&&f.trim()!==""&&g.trim()!==""&&w.trim()!=="",he=async()=>{if(!ae){X("Please fill in all fields.");return}try{ne(!0),X(""),pe("");const ge=window.localStorage.getItem("hyperToken"),Ae=window.localStorage.getItem("hyperAddress");if(!ge||!Ae){s(!0),ne(!1);return}const ye={address:Ae.toLowerCase(),token:ge,wallet_name:a,main_wallet:l,api_key:f,stark_public:u,stark_private:g,vault_number:w},Ie=await(await fetch(`${r}/api/wallet/generate-extended`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ye)})).json();Ie!=null&&Ie.success?(ln.success("Wallet created successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),e(),n(Ae),o(""),c(""),d(""),x(""),v(""),C(""),X(""),pe(Ie==null?void 0:Ie.message)):X((Ie==null?void 0:Ie.error_message)||"An error has occurred.")}catch(ge){X(ge.message||"An error has occurred.")}finally{ne(!1)}},Ce=async(ge,Ae)=>{console.log("id :>> ",ge);const ye=`${ge}_${Ae}`;try{G(it=>({...it,[ye]:!0})),X(""),pe("");const je=window.localStorage.getItem("hyperToken"),Ie=window.localStorage.getItem("hyperAddress");if(!je||!Ie){s(!0),G(it=>({...it,[ye]:!1}));return}const Re={address:Ie.toLowerCase(),token:je,wallet_id:Number(ge)},$e=await(await fetch(`${r}/api/wallet/delete-extended`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Re)})).json();$e!=null&&$e.success?(e(),ln.success("Wallet deleted successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),n(Ie),X(""),pe($e==null?void 0:$e.message)):X(($e==null?void 0:$e.error_message)||"An error has occurred.")}catch(je){X(je.message||"An error has occurred.")}finally{ne(!1)}};return i.jsxs("div",{className:"flex flex-col items-start gap-2 w-full relative",children:[Q&&i.jsx("div",{role:"status",className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex justify-center items-center w-full z-[60] -mt-20 h-full min-h-[450px] sm:min-h-[280px]",children:i.jsx(Da,{})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 w-full",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Wallet Name"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:a,onChange:ge=>o(ge.target.value),autoComplete:"off",placeholder:"Wallet Name",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#1b1b1b] text-white border text-[13px] outline-none placeholder:text-[#7F7F7F] ${a===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Login Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:l,onChange:ge=>c(ge.target.value),autoComplete:"off",placeholder:"Login Address",type:"text",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${l===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:f,onChange:ge=>x(ge.target.value),autoComplete:"off",placeholder:"API_KEY",type:N?"text":"password",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${f===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q}),i.jsx("button",{type:"button",onClick:()=>I(ge=>!ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Q,children:N?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Public"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:u,onChange:ge=>d(ge.target.value),autoComplete:"off",placeholder:"STARK_KEY_PUBLIC",type:P?"text":"password",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${u===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q}),i.jsx("button",{type:"button",onClick:()=>R(ge=>!ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Q,children:P?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Private"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:g,onChange:ge=>v(ge.target.value),autoComplete:"off",placeholder:"STARK_KEY_PRIVATE",type:F?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${g===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q}),i.jsx("button",{type:"button",onClick:()=>U(ge=>!ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Q,children:F?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Vault Number"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:w,onChange:ge=>{const Ae=ge.target.value.trim();if(Ae==="")return C("");V(Ae)&&C(Ae)},onKeyDown:te,inputMode:"numeric",autoComplete:"off",type:L?"text":"password",placeholder:"VAULT_NUMBER",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${w===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:Q}),i.jsx("button",{type:"button",onClick:()=>z(ge=>!ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Q,children:L?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),i.jsx("button",{onClick:()=>{!Q&&he()},disabled:Q,className:"w-full h-10 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] focus:ring-0 focus:outline-none justify-center items-center gap-1.5 inline-flex mt-2.5",children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Generate"})}),i.jsx("div",{className:"w-full mt-2",children:(t==null?void 0:t.length)>0?i.jsxs("div",{className:"flex flex-col items-start gap-3 w-full ",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 cursor-pointer text-sm text-zinc-300 w-full",onClick:()=>ie(!Y),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"Extended Wallets"}),i.jsx(rse,{className:`w-3.5 h-3.5 transition-transform text-white ${Y?"":"rotate-180"}`})]}),i.jsx("div",{className:"flex flex-col items-start gap-1 sm:gap-1.5 w-full max-h-[80px] overflow-y-auto",children:Y&&((ce=[...t].sort((ge,Ae)=>(Ae==null?void 0:Ae.wallet_created_data)-(ge==null?void 0:ge.wallet_created_data)))==null?void 0:ce.map((ge,Ae)=>{var ye,je;return i.jsx("div",{className:"flex flex-col items-start w-full",children:i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[110px]",children:((ye=ge==null?void 0:ge.wallet_name)==null?void 0:ye.length)>18?((je=ge==null?void 0:ge.wallet_name)==null?void 0:je.slice(0,18))+"...":ge==null?void 0:ge.wallet_name})}),i.jsxs("div",{className:"flex justify-start items-center w-max",children:[i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[75px]",children:(ge==null?void 0:ge.wallet_address.slice(0,6))+"..."+(ge==null?void 0:ge.wallet_address.slice(-4))}),i.jsx("img",{onClick:Ie=>{Ie.stopPropagation(),navigator.clipboard.writeText(ge==null?void 0:ge.wallet_address),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsx("span",{className:"text-[#929292] text-[11px] font-normal font-['Inter'] leading-4 min-w-max hidden sm:flex",children:su(ge==null?void 0:ge.wallet_created_data)}),oe[`${ge==null?void 0:ge.wallet_id}_${ge==null?void 0:ge.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{Ce(ge==null?void 0:ge.wallet_id,ge==null?void 0:ge.wallet_name)},className:"w-[70px] sm:w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})},Ae)}))})]}):""}),J&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:J})]}),re&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#67ffbd]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:eae,alt:"Dextrabot",className:"w-4 h-4"}),i.jsx("p",{className:"text-[#67FFBD] text-[13px] font-normal font-['Inter'] leading-4",children:re})]})]})},T6t=({className:e})=>i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M10.5001 6.31166C10.3454 6.31166 10.197 6.37312 10.0876 6.48252C9.97821 6.59191 9.91675 6.74029 9.91675 6.895V11.0833C9.91675 11.238 9.85529 11.3864 9.74589 11.4958C9.6365 11.6052 9.48812 11.6667 9.33341 11.6667H2.91675C2.76204 11.6667 2.61367 11.6052 2.50427 11.4958C2.39487 11.3864 2.33341 11.238 2.33341 11.0833V4.66666C2.33341 4.51195 2.39487 4.36358 2.50427 4.25419C2.61367 4.14479 2.76204 4.08333 2.91675 4.08333H7.10508C7.25979 4.08333 7.40816 4.02187 7.51756 3.91248C7.62696 3.80308 7.68841 3.65471 7.68841 3.5C7.68841 3.34529 7.62696 3.19691 7.51756 3.08752C7.40816 2.97812 7.25979 2.91666 7.10508 2.91666H2.91675C2.45262 2.91666 2.0075 3.10104 1.67931 3.42923C1.35112 3.75742 1.16675 4.20254 1.16675 4.66666V11.0833C1.16675 11.5475 1.35112 11.9926 1.67931 12.3208C2.0075 12.649 2.45262 12.8333 2.91675 12.8333H9.33341C9.79754 12.8333 10.2427 12.649 10.5709 12.3208C10.899 11.9926 11.0834 11.5475 11.0834 11.0833V6.895C11.0834 6.74029 11.022 6.59191 10.9126 6.48252C10.8032 6.37312 10.6548 6.31166 10.5001 6.31166ZM12.7867 1.52833C12.7276 1.38579 12.6143 1.27252 12.4717 1.21333C12.4016 1.18344 12.3263 1.16759 12.2501 1.16666H8.75008C8.59537 1.16666 8.447 1.22812 8.3376 1.33752C8.22821 1.44691 8.16675 1.59529 8.16675 1.75C8.16675 1.90471 8.22821 2.05308 8.3376 2.16248C8.447 2.27187 8.59537 2.33333 8.75008 2.33333H10.8442L4.83591 8.33583C4.78124 8.39006 4.73784 8.45458 4.70823 8.52566C4.67861 8.59675 4.66337 8.67299 4.66337 8.75C4.66337 8.827 4.67861 8.90325 4.70823 8.97433C4.73784 9.04542 4.78124 9.10994 4.83591 9.16416C4.89014 9.21884 4.95466 9.26224 5.02574 9.29185C5.09683 9.32147 5.17307 9.33671 5.25008 9.33671C5.32709 9.33671 5.40333 9.32147 5.47442 9.29185C5.5455 9.26224 5.61002 9.21884 5.66425 9.16416L11.6667 3.15583V5.25C11.6667 5.40471 11.7282 5.55308 11.8376 5.66248C11.947 5.77187 12.0954 5.83333 12.2501 5.83333C12.4048 5.83333 12.5532 5.77187 12.6626 5.66248C12.772 5.55308 12.8334 5.40471 12.8334 5.25V1.75C12.8325 1.67377 12.8166 1.59846 12.7867 1.52833Z",fill:"currentColor"})}),I6t=({errorConnectMessage:e,setErrorConnectMessage:t,loadingConnect:n,setLoadingConnect:r,handleListRequest:s,handlePageChange:a,isBalanceValue:o,isBalanceLoading:l,isAgentInfoLoading:c,isAgentInfoValue:u,handleAgentWalletInfo:d,isBuilderFeeLoading:f,isBuilderFeeValue:x,refreshAgent:g,handleBuilderFeeInfo:v,isLighterInfoValue:w,handleLighterWalletInfo:C,isExtendedInfoValue:N,handleExtendedWalletInfo:I})=>{var he,Ce;const{setSignModalOpen:P}=m.useContext(Qr),{address:R}=Jr(),F=Mc(),[U,L]=m.useState(!0),[z,Q]=m.useState(!1),[ne,J]=m.useState(!1),[X,re]=m.useState("HYPERLIQUID");m.useEffect(()=>{const ce=F.hash,ge=localStorage.getItem("isWalletSelectMenu");if(ce){const Ae=ce.split("#").filter(Boolean);Ae[2]&&re(Ae[2].toUpperCase()),ge==="LIGHTER"?re("LIGHTER"):ge==="EXTENDED"?re("EXTENDED"):ge==="HYPER"&&re("HYPERLIQUID")}},[F.hash]),m.useEffect(()=>{(async()=>{var ye;const ge=window.localStorage.getItem("hyperToken"),Ae=(ye=R||window.localStorage.getItem("hyperAddress"))==null?void 0:ye.toLowerCase();if(!ge){P(!0);return}if(Ae&&ge)try{const je=await ji(Ae,ge);Q(!!(je!=null&&je.is_generated))}catch{Q(!1)}finally{J(!0)}})()},[R,P]);const pe=ce=>{var Ie,Re,Qe,$e,it,tt;const ge=(ce==null?void 0:ce.code)||((Ie=ce==null?void 0:ce.error)==null?void 0:Ie.code)||((Qe=(Re=ce==null?void 0:ce.info)==null?void 0:Re.error)==null?void 0:Qe.code)||(($e=ce==null?void 0:ce.cause)==null?void 0:$e.code)||"",Ae=typeof ge=="string"?ge.toUpperCase():String(ge).toUpperCase(),ye=String((ce==null?void 0:ce.message)||"").toUpperCase();if(Ae==="ACTION_REJECTED"||Ae==="4001"||ye.includes("USER REJECT")||ye.includes("USER DENIED")){t("Request cancelled by user.");return}if([typeof ce=="string"?ce:"",ce==null?void 0:ce.message,ce==null?void 0:ce.code,ce==null?void 0:ce.name,ce==null?void 0:ce.shortMessage,(it=ce==null?void 0:ce.cause)==null?void 0:it.message,(tt=ce==null?void 0:ce.cause)==null?void 0:tt.code].filter(Boolean).join(" ").toUpperCase().includes("UNSUPPORTED_OPERATION")){t(i.jsxs(i.Fragment,{children:[i.jsx("b",{children:"Wallet Extension Conflict Detected"})," — It looks like you are using multiple wallet extensions at the same time, which is causing a conflict."," ",i.jsx("a",{href:"https://docs.dextrabot.com/errors/wallet-extension-conflict-fix",target:"_blank",rel:"noreferrer",className:"underline",children:"Read Guide"})]}));return}t(typeof ce=="string"?ce:(ce==null?void 0:ce.message)||"Something went wrong.")},Y=()=>{if(!window.ethereum)throw new Error("MetaMask not found.");return window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0xa4b1"}]})},ie=async ce=>{var ye,je;if(z)return;const ge=window.localStorage.getItem("hyperToken");if(!ge||!R){P(!0);return}r(!0),t("");const Ae=window.localStorage.getItem("hyperAddress");try{await window.ethereum.request({method:"eth_chainId"})!=="0xa4b1"&&await Y();const Qe=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate-agent",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:R?R.toLowerCase():Ae,token:ge})})).json();if(!(Qe!=null&&Qe.success)){pe((Qe==null?void 0:Qe.error_message)||"Agent could not be produced.");return}if(!window.ethereum)throw new Error("MetaMask not found.");const it=await new AM(window.ethereum).getSigner(),tt=await hxe(ce,Qe,it),ft=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/complete-agent",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({signature:tt.signature,action:tt.action,nonce:tt.nonce,address:R?R.toLowerCase():Ae,token:ge})})).json();if(ft!=null&&ft.success){if(((ye=ft==null?void 0:ft.result)==null?void 0:ye.status)==="err"){pe(((je=ft==null?void 0:ft.result)==null?void 0:je.response)||"Approval failed."),r(!1);return}s(),a(1),d(R||Ae)}else pe((ft==null?void 0:ft.error_message)||"Approval failed.")}catch(Ie){pe(Ie)}finally{r(!1)}},oe=async ce=>{var ye,je;if(z)return;const ge=window.localStorage.getItem("hyperToken");if(!ge||!R){P(!0);return}r(!0),t("");const Ae=window.localStorage.getItem("hyperAddress");try{await window.ethereum.request({method:"eth_chainId"})!=="0xa4b1"&&await Y();const Qe=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate-agent",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:R?R.toLowerCase():Ae,token:ge})})).json();if(!(Qe!=null&&Qe.success))throw new Error((Qe==null?void 0:Qe.error_message)||"Generate builder fee failed");if(!window.ethereum)throw new Error("MetaMask not found.");const it=await new AM(window.ethereum).getSigner(),tt=await hxe(ce,Qe,it),ft=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/complete-builder",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({signature:tt.signature,action:tt.action,nonce:tt.nonce,address:R?R.toLowerCase():Ae,token:ge})})).json();if(ft!=null&&ft.success){if(((ye=ft==null?void 0:ft.result)==null?void 0:ye.status)==="err"){pe(((je=ft==null?void 0:ft.result)==null?void 0:je.response)||"Approve builder fee failed"),r(!1);return}ie(1),v(R||Ae)}else pe((ft==null?void 0:ft.error_message)||"Approval failed."),r(!1)}catch(Ie){pe(Ie),r(!1)}},G=m.useMemo(()=>u?u.some(ce=>{var ge;return((ge=(ce==null?void 0:ce.name)??"")==null?void 0:ge.trim().toLowerCase())==="dextrabot"}):!1,[u]),V=Number(((he=o==null?void 0:o.marginSummary)==null?void 0:he.accountValue)??0),te=`You can’t create an API Wallet while logged in with a Dextrabot-generated wallet.
How To Login: Log in with a non Dextrabot-generated wallet and try again.`,ae=n||c||l||f||!ne&&R;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-full",children:i.jsxs("div",{className:"flex flex-col items-start justify-center sm:flex-row sm:justify-between sm:items-center w-full gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(eV,{title:"HYPERLIQUID",set_click:()=>re("HYPERLIQUID"),isSelectAPIMenu:X}),i.jsx(eV,{title:"LIGHTER",set_click:()=>re("LIGHTER"),isSelectAPIMenu:X}),i.jsx(eV,{title:"EXTENDED",set_click:()=>re("EXTENDED"),isSelectAPIMenu:X})]}),X==="EXTENDED"&&i.jsxs("button",{onClick:()=>window.open("https://app.extended.exchange/join/DEXTRABOT","_blank"),className:" group px-3 py-1.5 rounded-full border border-[#3ec78c] text-[#3ec78c] text-sm font-medium flex items-center gap-2 transition-all duration-200 hover:bg-[#3ec78c]/15 hover:border-[#3ec78c]/80 active:scale-95",children:[i.jsx("span",{children:"Go To API Page"}),i.jsx(T6t,{className:"w-4 h-4"})]})]})}),ae?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Da,{})}):X==="HYPERLIQUID"?i.jsxs("div",{className:"flex flex-col items-center justify-start gap-[24px] w-full",children:[i.jsxs("div",{className:"flex flex-col items-start gap-2 -mt-[8px] w-full",children:[i.jsx("label",{htmlFor:"address",className:"text-center justify-start text-white text-sm font-medium font-['Inter']",children:"Connected Wallet"}),i.jsxs("div",{id:"address",className:"min-h-10 px-2.5 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] outline outline-1 outline-offset-[-1px] outline-[#2a2a2a] gap-2 flex justify-start items-center w-full text-white text-sm font-medium font-['Inter'] leading-[16px] break-all",children:[R&&i.jsx("img",{src:qme,alt:"agent icon"}),R||"--"]}),!z&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex justify-start items-center gap-4 w-full mt-2",children:i.jsxs("div",{className:"flex flex-col items-start gap-1.5 text-[#929292] text-[13px] font-normal font-['Inter'] leading-4 w-full",children:[i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("span",{className:"text-[#929292]",children:"USDC Available "}),i.jsxs("div",{className:"flex justify-center items-center gap-4",children:[i.jsx("div",{onClick:()=>{g()},className:"flex justify-center items-center cursor-pointer",children:i.jsx(AS,{className:"w-4 h-4 text-[#929292] hover:text-white"})}),i.jsx("span",{className:`${V>=5?"text-[#1DE674]":"text-[#929292]"} `,children:V===0||V?"$"+Cr(V):"--"})]})]}),(V===0&&!G||V<5&&!G)&&i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("span",{className:"text-text-[#929292]",children:"Min. Deposit"}),i.jsx("span",{className:"text-[#929292]",children:"5 USDC"})]})]})}),i.jsx("div",{className:"w-full flex justify-center items-center mt-2",children:x!=null&&Number(x)>0?G?i.jsxs("div",{className:"px-3 py-2.5 bg-[#1de674]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 w-full max-w-[480px] text-[#1DE674] text-[13px] font-normal font-['Inter'] leading-4",children:[i.jsx("img",{src:qme,alt:"agent icon"}),"You’re ready to trade!"]}):"":V>0?V>=5?"":i.jsxs("div",{className:"px-3 py-2.5 bg-[#ffb14b]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 w-full max-w-[480px] text-[#FFB14B] text-[13px] font-normal font-['Inter'] leading-4",children:[i.jsx(TM,{className:"text-[#FFB14B] w-[18px] h-[18px] min-w-[18px] min-h-[18px]"}),"Your Hyperliquid perps balance is $",Cr(V)," USDC. A minimum of 5 USDC is required."]}):i.jsxs("div",{className:"px-3 py-2.5 bg-[#ffb14b]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 w-full max-w-[480px] text-[#FFB14B] text-[13px] font-normal font-['Inter'] leading-4",children:[i.jsx(TM,{className:"text-[#FFB14B] w-[18px] h-[18px] min-w-[18px] min-h-[18px]"}),"Please fund your Hyperliquid Perpetual balance to start trading"]})})]})]}),z?i.jsxs("div",{className:"-mt-2.5 w-full p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] max-w-[480px] flex justify-start items-center gap-2.5",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"whitespace-pre-line text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:te})]}):i.jsxs(i.Fragment,{children:[x!=null&&Number(x)>0?G?"":i.jsx("div",{onClick:()=>{ie(1)},className:`${!n&&!c&&!f?"cursor-pointer bg-[#7445ff] border border-[#8860ff] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)]":"bg-[#6B7280] text-[#D1D5DB] cursor-auto"} w-full h-10 px-6 py-3 rounded-xl inline-flex justify-center items-center gap-2.5 text-white text-sm font-semibold font-['Inter'] leading-[8px] -mt-4`,children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Enable Trading"})}):i.jsx("div",{onClick:ce=>{ce.preventDefault(),V>=5&&!l&&oe(2)},className:`${V>=5&&!l?"cursor-pointer bg-[#7445ff] border border-[#8860ff] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)]":"bg-[#6B7280] text-[#D1D5DB] cursor-auto"} w-full h-10 px-6 py-3 rounded-xl inline-flex justify-center items-center gap-2.5 text-white text-sm font-semibold font-['Inter'] leading-[8px] -mt-4`,children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Enable Trading"})}),i.jsx("div",{className:"w-full",children:(u==null?void 0:u.length)>0?i.jsxs("div",{className:"flex flex-col items-start gap-3 w-full ",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 cursor-pointer text-sm text-zinc-300 w-full",onClick:()=>L(!U),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"API Wallets"}),i.jsx(rse,{className:`w-3.5 h-3.5 transition-transform text-white ${U?"":"rotate-180"}`})]}),i.jsx("div",{className:"flex flex-col items-start gap-1 sm:gap-1.5 w-full max-h-[80px] overflow-y-auto",children:U&&((Ce=[...u].sort((ce,ge)=>(ge==null?void 0:ge.validUntil)-(ce==null?void 0:ce.validUntil)))==null?void 0:Ce.map((ce,ge)=>i.jsx("div",{className:"flex flex-col items-start w-full",children:i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-2 sm:gap-6",children:i.jsx("span",{className:`${(ce==null?void 0:ce.name)==="dextrabot"?"text-white":"text-[#929292]"} text-[11px] font-normal min-w-[110px]`,children:ce==null?void 0:ce.name})}),i.jsxs("span",{className:`${(ce==null?void 0:ce.name)==="dextrabot"?"text-white":"text-[#929292]"} text-[11px] font-normal font-['Inter'] leading-4 min-w-max`,children:["Valid until:"," ",Glt(ce==null?void 0:ce.validUntil)]})]})},ge)))})]}):""}),e&&i.jsxs("div",{className:"-mt-2.5 w-full h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] max-w-[480px] flex justify-start items-center gap-2.5",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:e})]})]})]}):X==="LIGHTER"?i.jsx("div",{className:"flex items-center justify-start w-full",children:i.jsx(_6t,{handleListRequest:s,isLighterInfoValue:w,handleLighterWalletInfo:C})}):i.jsx("div",{className:"flex items-center justify-start w-full",children:i.jsx(k6t,{handleListRequest:s,isExtendedInfoValue:N,handleExtendedWalletInfo:I})})]})},eV=({title:e,set_click:t,isSelectAPIMenu:n})=>i.jsx("div",{onClick:t,className:`${n==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:e}),xxe=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",className:e,children:[i.jsx("path",{d:"M3.75 11.25C3.045 11.25 2.3925 11.4975 1.875 11.91C1.185 12.4575 0.75 13.305 0.75 14.25C0.75 15.9075 2.0925 17.25 3.75 17.25C4.5075 17.25 5.1975 16.965 5.73 16.5C6.3525 15.9525 6.75 15.15 6.75 14.25C6.75 12.5925 5.4075 11.25 3.75 11.25ZM4.5 14.4375C4.5 14.6325 4.395 14.82 4.23 14.9175L3.2925 15.48C3.2025 15.54 3.0975 15.5625 3 15.5625C2.8125 15.5625 2.625 15.465 2.52 15.2925C2.3625 15.0225 2.445 14.6775 2.715 14.52L3.3825 14.1225V13.3125C3.375 13.005 3.63 12.75 3.9375 12.75C4.245 12.75 4.5 13.005 4.5 13.3125V14.4375Z",fill:"currentColor"}),i.jsx("path",{d:"M11.1375 2.96251V5.81251H10.0125V2.96251C10.0125 2.76001 9.8325 2.66251 9.7125 2.66251C9.675 2.66251 9.6375 2.67001 9.6 2.68501L3.6525 4.92751C3.255 5.07751 3 5.45251 3 5.88001V6.38251C2.3175 6.89251 1.875 7.71001 1.875 8.63251V5.88001C1.875 4.98751 2.4225 4.19251 3.255 3.87751L9.21 1.62751C9.375 1.56751 9.5475 1.53751 9.7125 1.53751C10.4625 1.53751 11.1375 2.14501 11.1375 2.96251Z",fill:"currentColor"}),i.jsx("path",{d:"M16.1245 10.875V11.625C16.1245 11.8275 15.967 11.9925 15.757 12H14.662C14.2645 12 13.9045 11.7075 13.8745 11.3175C13.852 11.085 13.942 10.8675 14.092 10.7175C14.227 10.575 14.4145 10.5 14.617 10.5H15.7495C15.967 10.5075 16.1245 10.6725 16.1245 10.875Z",fill:"currentColor"}),i.jsx("path",{d:"M14.61 9.7125H15.375C15.7875 9.7125 16.125 9.375 16.125 8.9625V8.6325C16.125 7.08 14.8575 5.8125 13.305 5.8125H4.695C4.0575 5.8125 3.4725 6.0225 3 6.3825C2.3175 6.8925 1.875 7.71 1.875 8.6325V9.9675C1.875 10.2525 2.175 10.4325 2.445 10.3425C2.865 10.2 3.3075 10.125 3.75 10.125C6.0225 10.125 7.875 11.9775 7.875 14.25C7.875 14.79 7.7325 15.3825 7.5075 15.9075C7.3875 16.1775 7.575 16.5 7.8675 16.5H13.305C14.8575 16.5 16.125 15.2325 16.125 13.68V13.5375C16.125 13.125 15.7875 12.7875 15.375 12.7875H14.7225C14.0025 12.7875 13.3125 12.345 13.125 11.6475C12.975 11.0775 13.155 10.5225 13.53 10.1625C13.8075 9.8775 14.19 9.7125 14.61 9.7125ZM10.5 9.5625H6.75C6.4425 9.5625 6.1875 9.3075 6.1875 9C6.1875 8.6925 6.4425 8.4375 6.75 8.4375H10.5C10.8075 8.4375 11.0625 8.6925 11.0625 9C11.0625 9.3075 10.8075 9.5625 10.5 9.5625Z",fill:"currentColor"})]});function d5({open:e,setOpen:t,handleListRequest:n,handlePageChange:r}){const{isConnected:s,address:a}=Jr(),{hyperToken:o}=m.useContext(Qr);Mc();const[l,c]=m.useState([]),[u,d]=m.useState(""),[f,x]=m.useState(!1),[g,v]=m.useState(""),[w,C]=m.useState(!1),[N,I]=m.useState(!1),[P,R]=m.useState(!1),[F,U]=m.useState("account"),[L,z]=m.useState(!1),Q=m.useRef(null),[ne,J]=m.useState([]),[X,re]=m.useState(""),[pe,Y]=m.useState(""),[ie,oe]=m.useState(!1),[G,V]=m.useState(""),[te,ae]=m.useState(""),[he,Ce]=m.useState(""),[ce,ge]=m.useState(!1),[Ae,ye]=m.useState(!1),[je,Ie]=m.useState(null),[Re,Qe]=m.useState(!1),[$e,it]=m.useState([]),[tt,ot]=m.useState([]),[ft,ct]=m.useState([]),[Vt,It]=m.useState(!1),[an,Nt]=m.useState(null),mn=[{id:"account",name:"Add API Wallet",href:"#account",icon:xxe},{id:"generate",name:"Generate HL Wallet",href:"#generate",icon:xxe}];function dn(...pt){return pt.filter(Boolean).join(" ")}const Pt=async(pt,en)=>{try{en===1&&ye(!0);const Bt=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:pt})});if(!Bt.ok)throw new Error("Network response was not ok");const Et=await Bt.json();Et&&(Ie(Et),ye(!1))}catch(Bt){console.error("Error fetching user balance info:",Bt),ye(!1)}},Xe=async pt=>{try{Qe(!0);const en=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"extraAgents",user:pt})});if(!en.ok)throw new Error("Network response was not ok");const Bt=await en.json();Bt&&(it(Bt),Qe(!1))}catch(en){console.error("Error fetching user balance info:",en),Qe(!1)}},Ut=async pt=>{const en=window.localStorage.getItem("hyperToken"),Bt=window.localStorage.getItem("hyperAddress");if(!(!en||!pt))try{const Et=await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:pt?pt.toLowerCase():Bt,token:en})});if(!Et.ok)throw new Error("Network response was not ok");const et=await Et.json();et.success&&ot((et==null?void 0:et.data)||[])}catch(Et){console.error("Error fetching user balance info:",Et)}},Lt=async pt=>{const en=window.localStorage.getItem("hyperToken"),Bt=window.localStorage.getItem("hyperAddress");if(!(!en||!pt))try{const Et=await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:pt?pt.toLowerCase():Bt,token:en})});if(!Et.ok)throw new Error("Network response was not ok");const et=await Et.json();et.success&&ct((et==null?void 0:et.data)||[])}catch(Et){console.error("Error fetching user balance info:",Et)}},qe=async pt=>{try{It(!0);const en=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"maxBuilderFee",user:pt,builder:"0x49ae63056b3a0be0b166813ee687309ab653c07c"})});if(!en.ok)throw new Error("Network response was not ok");const Bt=await en.text(),Et=parseInt(Bt,10);Nt(Et),It(!1)}catch(en){console.error("Error fetching user balance info:",en),It(!1)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&a&&e&&(Pt(a,1),Xe(a),Ut(a),Lt(a),qe(a))},[e]),m.useEffect(()=>{var Bt;return!e||F!="account"||($e==null?void 0:$e.some(Et=>((Et==null?void 0:Et.name)??"").trim().toLowerCase()==="dextrabot"))?void 0:(Number(((Bt=je==null?void 0:je.marginSummary)==null?void 0:Bt.accountValue)??0)<5?Q.current||(Q.current=setInterval(()=>{Pt(a,2)},1e4)):Q.current&&(clearInterval(Q.current),Q.current=null),()=>{Q.current&&(clearInterval(Q.current),Q.current=null)})},[je,e,F,a]),m.useEffect(()=>{const pt=window.localStorage.getItem("hyperToken");(!a||!s||!pt)&&(t(!1),d(""),v(""),Ce(""))},[a,s,o]);const Ke=()=>{window.localStorage.getItem("hyperToken")&&a&&e?(Pt(a,1),Xe(a),qe(a)):ln.error("Please connect wallet")};return m.useEffect(()=>{if(e&&!L)if(($e==null?void 0:$e.length)>0){const pt=$e==null?void 0:$e.some(Bt=>((Bt==null?void 0:Bt.name)??"").trim().toLowerCase()==="dextrabot"),en=localStorage.getItem("isWalletSelectMenu");U(en==="LIGHTER"||en==="EXTENDED"?"account":en==="HYPER"?pt?"generate":"account":pt&&(tt==null?void 0:tt.length)>0&&(ft==null?void 0:ft.length)>0?"generate":"account"),z(!0)}else U("account"),z(!0)},[$e,L]),i.jsxs(i.Fragment,{children:[i.jsx(Lyt,{open:P,setOpen:R,setGenModalOpen:t,setGenWalletSuccess:I,setGenWalletData:c,setShowPrivateKey:C}),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-[9999999998] font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-[9999999998] w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,style:{boxShadow:"0 4px 24px 0 #000",backdropFilter:"blur(16px)"},className:"relative transform overflow-hidden bg-[rgba(16,16,16,0.64)] border border-[rgba(46,46,46,0.32)] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:`${N&&Object.keys(l).length>0?"w-max":"w-[400px]"} flex flex-col justify-start items-center gap-[26px] h-max relative bg-[#0f0f0f]/60 rounded-3xl pt-[29px] pb-[24px] px-[26px] w-full min-w-[320px]`,children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:pt=>{pt.preventDefault(),f&&F==="generate"||F==="account"&&ce?ln.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please wait until completion."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}):F==="generate"&&N&&Object.keys(l).length>0?(R(!0),C(!1)):(t(!1),d(""),v(""),Ce(""),it([]),Nt(null),z(!1))},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-3.5",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"flex justify-start text-white text-base font-medium font-manrope w-full",children:"Generate your wallet"}),i.jsxs("div",{className:"flex justify-start items-center w-full",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:hidden w-full",children:[i.jsx("select",{value:F,onChange:pt=>{const en=pt.target.value;if(!f){if(F==="generate"&&en!=="generate"&&N&&Object.keys(l).length>0){C(!1),R(!0);return}if(F==="account"&&en!=="account"&&ce){ln.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please wait until completion."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}U(en),d("")}},"aria-label":"Select a tab",className:"col-start-1 row-start-1 w-full appearance-none rounded-md bg-white py-2 pl-3 pr-8 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 focus:outline focus:outline-2 focus:-outline-offset-2 dark:bg-white/5 dark:text-gray-100 dark:outline-white/10 dark:*:bg-gray-800",children:mn==null?void 0:mn.map(pt=>i.jsx("option",{value:pt==null?void 0:pt.id,children:pt==null?void 0:pt.name},pt==null?void 0:pt.id))}),i.jsx(N9,{"aria-hidden":"true",className:"pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end fill-gray-500 dark:fill-gray-400"})]}),i.jsx("div",{style:{boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.16)"},className:"hidden sm:flex w-full justify-center items-center border border-[#2A2A2A] rounded-2xl p-1 h-10",children:i.jsx("nav",{"aria-label":"Tabs",role:"tablist",className:"flex items-center space-x-8",children:mn==null?void 0:mn.map(pt=>{const en=(pt==null?void 0:pt.id)===F;return i.jsxs("a",{href:pt==null?void 0:pt.href,onClick:Bt=>{Bt.preventDefault();const Et=pt==null?void 0:pt.id;if(f)return;if(F==="generate"&&Et!=="generate"&&N&&Object.keys(l).length>0){C(!1),R(!0);return}if(F==="account"&&Et!=="account"&&ce){ln.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please wait until completion."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}U(Et);const et=document.querySelector(pt.href);et&&et.scrollIntoView({behavior:"smooth",block:"start"}),d("")},"aria-current":en?"page":void 0,className:dn(en?"bg-[#2e2e2e] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] h-8 px-6 py-3 text-white":"text-[#878787]","group flex justify-center items-center px-1 py-4 text-[13px] font-medium tracking-[-0.13px] w-[220px] hover:text-white group"),children:[i.jsx(pt.icon,{"aria-hidden":"true",className:dn(en?"text-white group-hover:text-white":"text-[#878787] group-hover:text-white","-ml-0.5 mr-2 size-[18px]")}),i.jsx("span",{children:pt==null?void 0:pt.name})]},pt==null?void 0:pt.id)})})})]}),F==="generate"?i.jsx(Byt,{loading:f,genWalletSuccess:N,genWalletData:l,showPrivateKey:w,genWalletName:u,setGenWalletName:d,errorMessage:g,setShowPrivateKey:C,setErrorMessage:v,setLoading:x,setGenWalletData:c,setGenWalletSuccess:I,handleListRequest:n,handlePageChange:r}):F==="agent"?i.jsx($yt,{agentWalletData:ne,setAgentWalletData:J,agentWalletName:X,setAgentWalletName:re,errorAgentMessage:pe,setErrorAgentMessage:Y,loadingAgent:ie,setLoadingAgent:oe,handleListRequest:n,handlePageChange:r,agentWalletAddress:G,setAgentWalletAddress:V,agentWalletPkey:te,setAgentWalletPkey:ae}):F==="account"?i.jsx(I6t,{errorConnectMessage:he,setErrorConnectMessage:Ce,loadingConnect:ce,setLoadingConnect:ge,handleListRequest:n,handlePageChange:r,isBalanceValue:je,isBalanceLoading:Ae,isAgentInfoLoading:Re,isAgentInfoValue:$e,handleAgentWalletInfo:Xe,isBuilderFeeLoading:Vt,isBuilderFeeValue:an,refreshAgent:Ke,handleBuilderFeeInfo:qe,isLighterInfoValue:tt,handleLighterWalletInfo:Ut,isExtendedInfoValue:ft,handleExtendedWalletInfo:Lt}):""]})})})})})]})]})}var nf="top",lp="bottom",cp="right",rf="left",Tae="auto",qk=[nf,lp,cp,rf],qS="start",yE="end",P6t="clippingParents",BIe="viewport",N7="popper",F6t="reference",gxe=qk.reduce(function(e,t){return e.concat([t+"-"+qS,t+"-"+yE])},[]),$Ie=[].concat(qk,[Tae]).reduce(function(e,t){return e.concat([t,t+"-"+qS,t+"-"+yE])},[]),O6t="beforeRead",M6t="read",R6t="afterRead",L6t="beforeMain",D6t="main",B6t="afterMain",$6t="beforeWrite",U6t="write",z6t="afterWrite",H6t=[O6t,M6t,R6t,L6t,D6t,B6t,$6t,U6t,z6t];function ex(e){return e?(e.nodeName||"").toLowerCase():null}function Gf(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function F3(e){var t=Gf(e).Element;return e instanceof t||e instanceof Element}function ep(e){var t=Gf(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Iae(e){if(typeof ShadowRoot>"u")return!1;var t=Gf(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function V6t(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},s=t.attributes[n]||{},a=t.elements[n];!ep(a)||!ex(a)||(Object.assign(a.style,r),Object.keys(s).forEach(function(o){var l=s[o];l===!1?a.removeAttribute(o):a.setAttribute(o,l===!0?"":l)}))})}function W6t(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var s=t.elements[r],a=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=o.reduce(function(c,u){return c[u]="",c},{});!ep(s)||!ex(s)||(Object.assign(s.style,l),Object.keys(a).forEach(function(c){s.removeAttribute(c)}))})}}const UIe={name:"applyStyles",enabled:!0,phase:"write",fn:V6t,effect:W6t,requires:["computeStyles"]};function D0(e){return e.split("-")[0]}var Xw=Math.max,FM=Math.min,GS=Math.round;function ree(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function zIe(){return!/^((?!chrome|android).)*safari/i.test(ree())}function KS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),s=1,a=1;t&&ep(e)&&(s=e.offsetWidth>0&&GS(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&GS(r.height)/e.offsetHeight||1);var o=F3(e)?Gf(e):window,l=o.visualViewport,c=!zIe()&&n,u=(r.left+(c&&l?l.offsetLeft:0))/s,d=(r.top+(c&&l?l.offsetTop:0))/a,f=r.width/s,x=r.height/a;return{width:f,height:x,top:d,right:u+f,bottom:d+x,left:u,x:u,y:d}}function Pae(e){var t=KS(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function HIe(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Iae(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function u1(e){return Gf(e).getComputedStyle(e)}function q6t(e){return["table","td","th"].indexOf(ex(e))>=0}function l2(e){return((F3(e)?e.ownerDocument:e.document)||window.document).documentElement}function qB(e){return ex(e)==="html"?e:e.assignedSlot||e.parentNode||(Iae(e)?e.host:null)||l2(e)}function bxe(e){return!ep(e)||u1(e).position==="fixed"?null:e.offsetParent}function G6t(e){var t=/firefox/i.test(ree()),n=/Trident/i.test(ree());if(n&&ep(e)){var r=u1(e);if(r.position==="fixed")return null}var s=qB(e);for(Iae(s)&&(s=s.host);ep(s)&&["html","body"].indexOf(ex(s))<0;){var a=u1(s);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return s;s=s.parentNode}return null}function Gk(e){for(var t=Gf(e),n=bxe(e);n&&q6t(n)&&u1(n).position==="static";)n=bxe(n);return n&&(ex(n)==="html"||ex(n)==="body"&&u1(n).position==="static")?t:n||G6t(e)||t}function Fae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qj(e,t,n){return Xw(e,FM(t,n))}function K6t(e,t,n){var r=qj(e,t,n);return r>n?n:r}function VIe(){return{top:0,right:0,bottom:0,left:0}}function WIe(e){return Object.assign({},VIe(),e)}function qIe(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Y6t=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,WIe(typeof t!="number"?t:qIe(t,qk))};function X6t(e){var t,n=e.state,r=e.name,s=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,l=D0(n.placement),c=Fae(l),u=[rf,cp].indexOf(l)>=0,d=u?"height":"width";if(!(!a||!o)){var f=Y6t(s.padding,n),x=Pae(a),g=c==="y"?nf:rf,v=c==="y"?lp:cp,w=n.rects.reference[d]+n.rects.reference[c]-o[c]-n.rects.popper[d],C=o[c]-n.rects.reference[c],N=Gk(a),I=N?c==="y"?N.clientHeight||0:N.clientWidth||0:0,P=w/2-C/2,R=f[g],F=I-x[d]-f[v],U=I/2-x[d]/2+P,L=qj(R,U,F),z=c;n.modifiersData[r]=(t={},t[z]=L,t.centerOffset=L-U,t)}}function Q6t(e){var t=e.state,n=e.options,r=n.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||HIe(t.elements.popper,s)&&(t.elements.arrow=s))}const Z6t={name:"arrow",enabled:!0,phase:"main",fn:X6t,effect:Q6t,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function YS(e){return e.split("-")[1]}var J6t={top:"auto",right:"auto",bottom:"auto",left:"auto"};function eCt(e,t){var n=e.x,r=e.y,s=t.devicePixelRatio||1;return{x:GS(n*s)/s||0,y:GS(r*s)/s||0}}function yxe(e){var t,n=e.popper,r=e.popperRect,s=e.placement,a=e.variation,o=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,x=o.x,g=x===void 0?0:x,v=o.y,w=v===void 0?0:v,C=typeof d=="function"?d({x:g,y:w}):{x:g,y:w};g=C.x,w=C.y;var N=o.hasOwnProperty("x"),I=o.hasOwnProperty("y"),P=rf,R=nf,F=window;if(u){var U=Gk(n),L="clientHeight",z="clientWidth";if(U===Gf(n)&&(U=l2(n),u1(U).position!=="static"&&l==="absolute"&&(L="scrollHeight",z="scrollWidth")),U=U,s===nf||(s===rf||s===cp)&&a===yE){R=lp;var Q=f&&U===F&&F.visualViewport?F.visualViewport.height:U[L];w-=Q-r.height,w*=c?1:-1}if(s===rf||(s===nf||s===lp)&&a===yE){P=cp;var ne=f&&U===F&&F.visualViewport?F.visualViewport.width:U[z];g-=ne-r.width,g*=c?1:-1}}var J=Object.assign({position:l},u&&J6t),X=d===!0?eCt({x:g,y:w},Gf(n)):{x:g,y:w};if(g=X.x,w=X.y,c){var re;return Object.assign({},J,(re={},re[R]=I?"0":"",re[P]=N?"0":"",re.transform=(F.devicePixelRatio||1)<=1?"translate("+g+"px, "+w+"px)":"translate3d("+g+"px, "+w+"px, 0)",re))}return Object.assign({},J,(t={},t[R]=I?w+"px":"",t[P]=N?g+"px":"",t.transform="",t))}function tCt(e){var t=e.state,n=e.options,r=n.gpuAcceleration,s=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,l=n.roundOffsets,c=l===void 0?!0:l,u={placement:D0(t.placement),variation:YS(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,yxe(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,yxe(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const nCt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tCt,data:{}};var iP={passive:!0};function rCt(e){var t=e.state,n=e.instance,r=e.options,s=r.scroll,a=s===void 0?!0:s,o=r.resize,l=o===void 0?!0:o,c=Gf(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(d){d.addEventListener("scroll",n.update,iP)}),l&&c.addEventListener("resize",n.update,iP),function(){a&&u.forEach(function(d){d.removeEventListener("scroll",n.update,iP)}),l&&c.removeEventListener("resize",n.update,iP)}}const sCt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:rCt,data:{}};var iCt={left:"right",right:"left",bottom:"top",top:"bottom"};function aO(e){return e.replace(/left|right|bottom|top/g,function(t){return iCt[t]})}var aCt={start:"end",end:"start"};function vxe(e){return e.replace(/start|end/g,function(t){return aCt[t]})}function Oae(e){var t=Gf(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Mae(e){return KS(l2(e)).left+Oae(e).scrollLeft}function oCt(e,t){var n=Gf(e),r=l2(e),s=n.visualViewport,a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;var u=zIe();(u||!u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l+Mae(e),y:c}}function lCt(e){var t,n=l2(e),r=Oae(e),s=(t=e.ownerDocument)==null?void 0:t.body,a=Xw(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Xw(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-r.scrollLeft+Mae(e),c=-r.scrollTop;return u1(s||n).direction==="rtl"&&(l+=Xw(n.clientWidth,s?s.clientWidth:0)-a),{width:a,height:o,x:l,y:c}}function Rae(e){var t=u1(e),n=t.overflow,r=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+r)}function GIe(e){return["html","body","#document"].indexOf(ex(e))>=0?e.ownerDocument.body:ep(e)&&Rae(e)?e:GIe(qB(e))}function Gj(e,t){var n;t===void 0&&(t=[]);var r=GIe(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),a=Gf(r),o=s?[a].concat(a.visualViewport||[],Rae(r)?r:[]):r,l=t.concat(o);return s?l:l.concat(Gj(qB(o)))}function see(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function cCt(e,t){var n=KS(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function wxe(e,t,n){return t===BIe?see(oCt(e,n)):F3(t)?cCt(t,n):see(lCt(l2(e)))}function uCt(e){var t=Gj(qB(e)),n=["absolute","fixed"].indexOf(u1(e).position)>=0,r=n&&ep(e)?Gk(e):e;return F3(r)?t.filter(function(s){return F3(s)&&HIe(s,r)&&ex(s)!=="body"}):[]}function dCt(e,t,n,r){var s=t==="clippingParents"?uCt(e):[].concat(t),a=[].concat(s,[n]),o=a[0],l=a.reduce(function(c,u){var d=wxe(e,u,r);return c.top=Xw(d.top,c.top),c.right=FM(d.right,c.right),c.bottom=FM(d.bottom,c.bottom),c.left=Xw(d.left,c.left),c},wxe(e,o,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function KIe(e){var t=e.reference,n=e.element,r=e.placement,s=r?D0(r):null,a=r?YS(r):null,o=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(s){case nf:c={x:o,y:t.y-n.height};break;case lp:c={x:o,y:t.y+t.height};break;case cp:c={x:t.x+t.width,y:l};break;case rf:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var u=s?Fae(s):null;if(u!=null){var d=u==="y"?"height":"width";switch(a){case qS:c[u]=c[u]-(t[d]/2-n[d]/2);break;case yE:c[u]=c[u]+(t[d]/2-n[d]/2);break}}return c}function vE(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,l=n.boundary,c=l===void 0?P6t:l,u=n.rootBoundary,d=u===void 0?BIe:u,f=n.elementContext,x=f===void 0?N7:f,g=n.altBoundary,v=g===void 0?!1:g,w=n.padding,C=w===void 0?0:w,N=WIe(typeof C!="number"?C:qIe(C,qk)),I=x===N7?F6t:N7,P=e.rects.popper,R=e.elements[v?I:x],F=dCt(F3(R)?R:R.contextElement||l2(e.elements.popper),c,d,o),U=KS(e.elements.reference),L=KIe({reference:U,element:P,strategy:"absolute",placement:s}),z=see(Object.assign({},P,L)),Q=x===N7?z:U,ne={top:F.top-Q.top+N.top,bottom:Q.bottom-F.bottom+N.bottom,left:F.left-Q.left+N.left,right:Q.right-F.right+N.right},J=e.modifiersData.offset;if(x===N7&&J){var X=J[s];Object.keys(ne).forEach(function(re){var pe=[cp,lp].indexOf(re)>=0?1:-1,Y=[nf,lp].indexOf(re)>=0?"y":"x";ne[re]+=X[Y]*pe})}return ne}function fCt(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=n.boundary,a=n.rootBoundary,o=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?$Ie:c,d=YS(r),f=d?l?gxe:gxe.filter(function(v){return YS(v)===d}):qk,x=f.filter(function(v){return u.indexOf(v)>=0});x.length===0&&(x=f);var g=x.reduce(function(v,w){return v[w]=vE(e,{placement:w,boundary:s,rootBoundary:a,padding:o})[D0(w)],v},{});return Object.keys(g).sort(function(v,w){return g[v]-g[w]})}function hCt(e){if(D0(e)===Tae)return[];var t=aO(e);return[vxe(e),t,vxe(t)]}function pCt(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var s=n.mainAxis,a=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!0:o,c=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,x=n.altBoundary,g=n.flipVariations,v=g===void 0?!0:g,w=n.allowedAutoPlacements,C=t.options.placement,N=D0(C),I=N===C,P=c||(I||!v?[aO(C)]:hCt(C)),R=[C].concat(P).reduce(function(ce,ge){return ce.concat(D0(ge)===Tae?fCt(t,{placement:ge,boundary:d,rootBoundary:f,padding:u,flipVariations:v,allowedAutoPlacements:w}):ge)},[]),F=t.rects.reference,U=t.rects.popper,L=new Map,z=!0,Q=R[0],ne=0;ne<R.length;ne++){var J=R[ne],X=D0(J),re=YS(J)===qS,pe=[nf,lp].indexOf(X)>=0,Y=pe?"width":"height",ie=vE(t,{placement:J,boundary:d,rootBoundary:f,altBoundary:x,padding:u}),oe=pe?re?cp:rf:re?lp:nf;F[Y]>U[Y]&&(oe=aO(oe));var G=aO(oe),V=[];if(a&&V.push(ie[X]<=0),l&&V.push(ie[oe]<=0,ie[G]<=0),V.every(function(ce){return ce})){Q=J,z=!1;break}L.set(J,V)}if(z)for(var te=v?3:1,ae=function(ge){var Ae=R.find(function(ye){var je=L.get(ye);if(je)return je.slice(0,ge).every(function(Ie){return Ie})});if(Ae)return Q=Ae,"break"},he=te;he>0;he--){var Ce=ae(he);if(Ce==="break")break}t.placement!==Q&&(t.modifiersData[r]._skip=!0,t.placement=Q,t.reset=!0)}}const mCt={name:"flip",enabled:!0,phase:"main",fn:pCt,requiresIfExists:["offset"],data:{_skip:!1}};function Cxe(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Sxe(e){return[nf,cp,lp,rf].some(function(t){return e[t]>=0})}function xCt(e){var t=e.state,n=e.name,r=t.rects.reference,s=t.rects.popper,a=t.modifiersData.preventOverflow,o=vE(t,{elementContext:"reference"}),l=vE(t,{altBoundary:!0}),c=Cxe(o,r),u=Cxe(l,s,a),d=Sxe(c),f=Sxe(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const gCt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:xCt};function bCt(e,t,n){var r=D0(e),s=[rf,nf].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=a[0],l=a[1];return o=o||0,l=(l||0)*s,[rf,cp].indexOf(r)>=0?{x:l,y:o}:{x:o,y:l}}function yCt(e){var t=e.state,n=e.options,r=e.name,s=n.offset,a=s===void 0?[0,0]:s,o=$Ie.reduce(function(d,f){return d[f]=bCt(f,t.rects,a),d},{}),l=o[t.placement],c=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=o}const vCt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:yCt};function wCt(e){var t=e.state,n=e.name;t.modifiersData[n]=KIe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const CCt={name:"popperOffsets",enabled:!0,phase:"read",fn:wCt,data:{}};function SCt(e){return e==="x"?"y":"x"}function NCt(e){var t=e.state,n=e.options,r=e.name,s=n.mainAxis,a=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!1:o,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,x=n.tether,g=x===void 0?!0:x,v=n.tetherOffset,w=v===void 0?0:v,C=vE(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),N=D0(t.placement),I=YS(t.placement),P=!I,R=Fae(N),F=SCt(R),U=t.modifiersData.popperOffsets,L=t.rects.reference,z=t.rects.popper,Q=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,ne=typeof Q=="number"?{mainAxis:Q,altAxis:Q}:Object.assign({mainAxis:0,altAxis:0},Q),J=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(U){if(a){var re,pe=R==="y"?nf:rf,Y=R==="y"?lp:cp,ie=R==="y"?"height":"width",oe=U[R],G=oe+C[pe],V=oe-C[Y],te=g?-z[ie]/2:0,ae=I===qS?L[ie]:z[ie],he=I===qS?-z[ie]:-L[ie],Ce=t.elements.arrow,ce=g&&Ce?Pae(Ce):{width:0,height:0},ge=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:VIe(),Ae=ge[pe],ye=ge[Y],je=qj(0,L[ie],ce[ie]),Ie=P?L[ie]/2-te-je-Ae-ne.mainAxis:ae-je-Ae-ne.mainAxis,Re=P?-L[ie]/2+te+je+ye+ne.mainAxis:he+je+ye+ne.mainAxis,Qe=t.elements.arrow&&Gk(t.elements.arrow),$e=Qe?R==="y"?Qe.clientTop||0:Qe.clientLeft||0:0,it=(re=J==null?void 0:J[R])!=null?re:0,tt=oe+Ie-it-$e,ot=oe+Re-it,ft=qj(g?FM(G,tt):G,oe,g?Xw(V,ot):V);U[R]=ft,X[R]=ft-oe}if(l){var ct,Vt=R==="x"?nf:rf,It=R==="x"?lp:cp,an=U[F],Nt=F==="y"?"height":"width",mn=an+C[Vt],dn=an-C[It],Pt=[nf,rf].indexOf(N)!==-1,Xe=(ct=J==null?void 0:J[F])!=null?ct:0,Ut=Pt?mn:an-L[Nt]-z[Nt]-Xe+ne.altAxis,Lt=Pt?an+L[Nt]+z[Nt]-Xe-ne.altAxis:dn,qe=g&&Pt?K6t(Ut,an,Lt):qj(g?Ut:mn,an,g?Lt:dn);U[F]=qe,X[F]=qe-an}t.modifiersData[r]=X}}const ACt={name:"preventOverflow",enabled:!0,phase:"main",fn:NCt,requiresIfExists:["offset"]};function jCt(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function ECt(e){return e===Gf(e)||!ep(e)?Oae(e):jCt(e)}function _Ct(e){var t=e.getBoundingClientRect(),n=GS(t.width)/e.offsetWidth||1,r=GS(t.height)/e.offsetHeight||1;return n!==1||r!==1}function kCt(e,t,n){n===void 0&&(n=!1);var r=ep(t),s=ep(t)&&_Ct(t),a=l2(t),o=KS(e,s,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((ex(t)!=="body"||Rae(a))&&(l=ECt(t)),ep(t)?(c=KS(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Mae(a))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function TCt(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function s(a){n.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&s(c)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||s(a)}),r}function ICt(e){var t=TCt(e);return H6t.reduce(function(n,r){return n.concat(t.filter(function(s){return s.phase===r}))},[])}function PCt(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function FCt(e){var t=e.reduce(function(n,r){var s=n[r.name];return n[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Nxe={placement:"bottom",modifiers:[],strategy:"absolute"};function Axe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function OCt(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,s=t.defaultOptions,a=s===void 0?Nxe:s;return function(l,c,u){u===void 0&&(u=a);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Nxe,a),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],x=!1,g={state:d,setOptions:function(N){var I=typeof N=="function"?N(d.options):N;w(),d.options=Object.assign({},a,d.options,I),d.scrollParents={reference:F3(l)?Gj(l):l.contextElement?Gj(l.contextElement):[],popper:Gj(c)};var P=ICt(FCt([].concat(r,d.options.modifiers)));return d.orderedModifiers=P.filter(function(R){return R.enabled}),v(),g.update()},forceUpdate:function(){if(!x){var N=d.elements,I=N.reference,P=N.popper;if(Axe(I,P)){d.rects={reference:kCt(I,Gk(P),d.options.strategy==="fixed"),popper:Pae(P)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(ne){return d.modifiersData[ne.name]=Object.assign({},ne.data)});for(var R=0;R<d.orderedModifiers.length;R++){if(d.reset===!0){d.reset=!1,R=-1;continue}var F=d.orderedModifiers[R],U=F.fn,L=F.options,z=L===void 0?{}:L,Q=F.name;typeof U=="function"&&(d=U({state:d,options:z,name:Q,instance:g})||d)}}}},update:PCt(function(){return new Promise(function(C){g.forceUpdate(),C(d)})}),destroy:function(){w(),x=!0}};if(!Axe(l,c))return g;g.setOptions(u).then(function(C){!x&&u.onFirstUpdate&&u.onFirstUpdate(C)});function v(){d.orderedModifiers.forEach(function(C){var N=C.name,I=C.options,P=I===void 0?{}:I,R=C.effect;if(typeof R=="function"){var F=R({state:d,name:N,instance:g,options:P}),U=function(){};f.push(F||U)}})}function w(){f.forEach(function(C){return C()}),f=[]}return g}}var MCt=[sCt,CCt,nCt,UIe,vCt,mCt,ACt,Z6t,gCt],RCt=OCt({defaultModifiers:MCt}),LCt="tippy-box",YIe="tippy-content",DCt="tippy-backdrop",XIe="tippy-arrow",QIe="tippy-svg-arrow",Av={passive:!0,capture:!0},ZIe=function(){return document.body};function tV(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Lae(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function JIe(e,t){return typeof e=="function"?e.apply(void 0,t):e}function jxe(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function BCt(e){return e.split(/\s+/).filter(Boolean)}function vC(e){return[].concat(e)}function Exe(e,t){e.indexOf(t)===-1&&e.push(t)}function $Ct(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function UCt(e){return e.split("-")[0]}function OM(e){return[].slice.call(e)}function _xe(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Kj(){return document.createElement("div")}function GB(e){return["Element","Fragment"].some(function(t){return Lae(e,t)})}function zCt(e){return Lae(e,"NodeList")}function ePe(e){return Lae(e,"MouseEvent")}function HCt(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function VCt(e){return GB(e)?[e]:zCt(e)?OM(e):Array.isArray(e)?e:OM(document.querySelectorAll(e))}function nV(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function kxe(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function tPe(e){var t,n=vC(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function WCt(e,t){var n=t.clientX,r=t.clientY;return e.every(function(s){var a=s.popperRect,o=s.popperState,l=s.props,c=l.interactiveBorder,u=UCt(o.placement),d=o.modifiersData.offset;if(!d)return!0;var f=u==="bottom"?d.top.y:0,x=u==="top"?d.bottom.y:0,g=u==="right"?d.left.x:0,v=u==="left"?d.right.x:0,w=a.top-r+f>c,C=r-a.bottom-x>c,N=a.left-n+g>c,I=n-a.right-v>c;return w||C||N||I})}function rV(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(s){e[r](s,n)})}function Txe(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var b0={isTouch:!1},Ixe=0;function qCt(){b0.isTouch||(b0.isTouch=!0,window.performance&&document.addEventListener("mousemove",nPe))}function nPe(){var e=performance.now();e-Ixe<20&&(b0.isTouch=!1,document.removeEventListener("mousemove",nPe)),Ixe=e}function GCt(){var e=document.activeElement;if(HCt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function KCt(){document.addEventListener("touchstart",qCt,Av),window.addEventListener("blur",GCt)}var YCt=typeof window<"u"&&typeof document<"u",XCt=YCt?!!window.msCrypto:!1,QCt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},ZCt={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},im=Object.assign({appendTo:ZIe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},QCt,ZCt),JCt=Object.keys(im),e4t=function(t){var n=Object.keys(t);n.forEach(function(r){im[r]=t[r]})};function rPe(e){var t=e.plugins||[],n=t.reduce(function(r,s){var a=s.name,o=s.defaultValue;if(a){var l;r[a]=e[a]!==void 0?e[a]:(l=im[a])!=null?l:o}return r},{});return Object.assign({},e,n)}function t4t(e,t){var n=t?Object.keys(rPe(Object.assign({},im,{plugins:t}))):JCt,r=n.reduce(function(s,a){var o=(e.getAttribute("data-tippy-"+a)||"").trim();if(!o)return s;if(a==="content")s[a]=o;else try{s[a]=JSON.parse(o)}catch{s[a]=o}return s},{});return r}function Pxe(e,t){var n=Object.assign({},t,{content:JIe(t.content,[e])},t.ignoreAttributes?{}:t4t(e,t.plugins));return n.aria=Object.assign({},im.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var n4t=function(){return"innerHTML"};function iee(e,t){e[n4t()]=t}function Fxe(e){var t=Kj();return e===!0?t.className=XIe:(t.className=QIe,GB(e)?t.appendChild(e):iee(t,e)),t}function Oxe(e,t){GB(t.content)?(iee(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?iee(e,t.content):e.textContent=t.content)}function aee(e){var t=e.firstElementChild,n=OM(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(YIe)}),arrow:n.find(function(r){return r.classList.contains(XIe)||r.classList.contains(QIe)}),backdrop:n.find(function(r){return r.classList.contains(DCt)})}}function sPe(e){var t=Kj(),n=Kj();n.className=LCt,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Kj();r.className=YIe,r.setAttribute("data-state","hidden"),Oxe(r,e.props),t.appendChild(n),n.appendChild(r),s(e.props,e.props);function s(a,o){var l=aee(t),c=l.box,u=l.content,d=l.arrow;o.theme?c.setAttribute("data-theme",o.theme):c.removeAttribute("data-theme"),typeof o.animation=="string"?c.setAttribute("data-animation",o.animation):c.removeAttribute("data-animation"),o.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?c.setAttribute("role",o.role):c.removeAttribute("role"),(a.content!==o.content||a.allowHTML!==o.allowHTML)&&Oxe(u,e.props),o.arrow?d?a.arrow!==o.arrow&&(c.removeChild(d),c.appendChild(Fxe(o.arrow))):c.appendChild(Fxe(o.arrow)):d&&c.removeChild(d)}return{popper:t,onUpdate:s}}sPe.$$tippy=!0;var r4t=1,aP=[],sV=[];function s4t(e,t){var n=Pxe(e,Object.assign({},im,rPe(_xe(t)))),r,s,a,o=!1,l=!1,c=!1,u=!1,d,f,x,g=[],v=jxe(tt,n.interactiveDebounce),w,C=r4t++,N=null,I=$Ct(n.plugins),P={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},R={id:C,reference:e,popper:Kj(),popperInstance:N,props:n,state:P,plugins:I,clearDelayTimeouts:Ut,setProps:Lt,setContent:qe,show:Ke,hide:pt,hideWithInteractivity:en,enable:Pt,disable:Xe,unmount:Bt,destroy:Et};if(!n.render)return R;var F=n.render(R),U=F.popper,L=F.onUpdate;U.setAttribute("data-tippy-root",""),U.id="tippy-"+R.id,R.popper=U,e._tippy=R,U._tippy=R;var z=I.map(function(et){return et.fn(R)}),Q=e.hasAttribute("aria-expanded");return Qe(),te(),oe(),G("onCreate",[R]),n.showOnCreate&&mn(),U.addEventListener("mouseenter",function(){R.props.interactive&&R.state.isVisible&&R.clearDelayTimeouts()}),U.addEventListener("mouseleave",function(){R.props.interactive&&R.props.trigger.indexOf("mouseenter")>=0&&pe().addEventListener("mousemove",v)}),R;function ne(){var et=R.props.touch;return Array.isArray(et)?et:[et,0]}function J(){return ne()[0]==="hold"}function X(){var et;return!!((et=R.props.render)!=null&&et.$$tippy)}function re(){return w||e}function pe(){var et=re().parentNode;return et?tPe(et):document}function Y(){return aee(U)}function ie(et){return R.state.isMounted&&!R.state.isVisible||b0.isTouch||d&&d.type==="focus"?0:tV(R.props.delay,et?0:1,im.delay)}function oe(et){et===void 0&&(et=!1),U.style.pointerEvents=R.props.interactive&&!et?"":"none",U.style.zIndex=""+R.props.zIndex}function G(et,Be,Mt){if(Mt===void 0&&(Mt=!0),z.forEach(function(ut){ut[et]&&ut[et].apply(ut,Be)}),Mt){var Ve;(Ve=R.props)[et].apply(Ve,Be)}}function V(){var et=R.props.aria;if(et.content){var Be="aria-"+et.content,Mt=U.id,Ve=vC(R.props.triggerTarget||e);Ve.forEach(function(ut){var xt=ut.getAttribute(Be);if(R.state.isVisible)ut.setAttribute(Be,xt?xt+" "+Mt:Mt);else{var jt=xt&&xt.replace(Mt,"").trim();jt?ut.setAttribute(Be,jt):ut.removeAttribute(Be)}})}}function te(){if(!(Q||!R.props.aria.expanded)){var et=vC(R.props.triggerTarget||e);et.forEach(function(Be){R.props.interactive?Be.setAttribute("aria-expanded",R.state.isVisible&&Be===re()?"true":"false"):Be.removeAttribute("aria-expanded")})}}function ae(){pe().removeEventListener("mousemove",v),aP=aP.filter(function(et){return et!==v})}function he(et){if(!(b0.isTouch&&(c||et.type==="mousedown"))){var Be=et.composedPath&&et.composedPath()[0]||et.target;if(!(R.props.interactive&&Txe(U,Be))){if(vC(R.props.triggerTarget||e).some(function(Mt){return Txe(Mt,Be)})){if(b0.isTouch||R.state.isVisible&&R.props.trigger.indexOf("click")>=0)return}else G("onClickOutside",[R,et]);R.props.hideOnClick===!0&&(R.clearDelayTimeouts(),R.hide(),l=!0,setTimeout(function(){l=!1}),R.state.isMounted||Ae())}}}function Ce(){c=!0}function ce(){c=!1}function ge(){var et=pe();et.addEventListener("mousedown",he,!0),et.addEventListener("touchend",he,Av),et.addEventListener("touchstart",ce,Av),et.addEventListener("touchmove",Ce,Av)}function Ae(){var et=pe();et.removeEventListener("mousedown",he,!0),et.removeEventListener("touchend",he,Av),et.removeEventListener("touchstart",ce,Av),et.removeEventListener("touchmove",Ce,Av)}function ye(et,Be){Ie(et,function(){!R.state.isVisible&&U.parentNode&&U.parentNode.contains(U)&&Be()})}function je(et,Be){Ie(et,Be)}function Ie(et,Be){var Mt=Y().box;function Ve(ut){ut.target===Mt&&(rV(Mt,"remove",Ve),Be())}if(et===0)return Be();rV(Mt,"remove",f),rV(Mt,"add",Ve),f=Ve}function Re(et,Be,Mt){Mt===void 0&&(Mt=!1);var Ve=vC(R.props.triggerTarget||e);Ve.forEach(function(ut){ut.addEventListener(et,Be,Mt),g.push({node:ut,eventType:et,handler:Be,options:Mt})})}function Qe(){J()&&(Re("touchstart",it,{passive:!0}),Re("touchend",ot,{passive:!0})),BCt(R.props.trigger).forEach(function(et){if(et!=="manual")switch(Re(et,it),et){case"mouseenter":Re("mouseleave",ot);break;case"focus":Re(XCt?"focusout":"blur",ft);break;case"focusin":Re("focusout",ft);break}})}function $e(){g.forEach(function(et){var Be=et.node,Mt=et.eventType,Ve=et.handler,ut=et.options;Be.removeEventListener(Mt,Ve,ut)}),g=[]}function it(et){var Be,Mt=!1;if(!(!R.state.isEnabled||ct(et)||l)){var Ve=((Be=d)==null?void 0:Be.type)==="focus";d=et,w=et.currentTarget,te(),!R.state.isVisible&&ePe(et)&&aP.forEach(function(ut){return ut(et)}),et.type==="click"&&(R.props.trigger.indexOf("mouseenter")<0||o)&&R.props.hideOnClick!==!1&&R.state.isVisible?Mt=!0:mn(et),et.type==="click"&&(o=!Mt),Mt&&!Ve&&dn(et)}}function tt(et){var Be=et.target,Mt=re().contains(Be)||U.contains(Be);if(!(et.type==="mousemove"&&Mt)){var Ve=Nt().concat(U).map(function(ut){var xt,jt=ut._tippy,kt=(xt=jt.popperInstance)==null?void 0:xt.state;return kt?{popperRect:ut.getBoundingClientRect(),popperState:kt,props:n}:null}).filter(Boolean);WCt(Ve,et)&&(ae(),dn(et))}}function ot(et){var Be=ct(et)||R.props.trigger.indexOf("click")>=0&&o;if(!Be){if(R.props.interactive){R.hideWithInteractivity(et);return}dn(et)}}function ft(et){R.props.trigger.indexOf("focusin")<0&&et.target!==re()||R.props.interactive&&et.relatedTarget&&U.contains(et.relatedTarget)||dn(et)}function ct(et){return b0.isTouch?J()!==et.type.indexOf("touch")>=0:!1}function Vt(){It();var et=R.props,Be=et.popperOptions,Mt=et.placement,Ve=et.offset,ut=et.getReferenceClientRect,xt=et.moveTransition,jt=X()?aee(U).arrow:null,kt=ut?{getBoundingClientRect:ut,contextElement:ut.contextElement||re()}:e,xn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(En){var jn=En.state;if(X()){var bn=Y(),Zn=bn.box;["placement","reference-hidden","escaped"].forEach(function(zn){zn==="placement"?Zn.setAttribute("data-placement",jn.placement):jn.attributes.popper["data-popper-"+zn]?Zn.setAttribute("data-"+zn,""):Zn.removeAttribute("data-"+zn)}),jn.attributes.popper={}}}},un=[{name:"offset",options:{offset:Ve}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!xt}},xn];X()&&jt&&un.push({name:"arrow",options:{element:jt,padding:3}}),un.push.apply(un,(Be==null?void 0:Be.modifiers)||[]),R.popperInstance=RCt(kt,U,Object.assign({},Be,{placement:Mt,onFirstUpdate:x,modifiers:un}))}function It(){R.popperInstance&&(R.popperInstance.destroy(),R.popperInstance=null)}function an(){var et=R.props.appendTo,Be,Mt=re();R.props.interactive&&et===ZIe||et==="parent"?Be=Mt.parentNode:Be=JIe(et,[Mt]),Be.contains(U)||Be.appendChild(U),R.state.isMounted=!0,Vt()}function Nt(){return OM(U.querySelectorAll("[data-tippy-root]"))}function mn(et){R.clearDelayTimeouts(),et&&G("onTrigger",[R,et]),ge();var Be=ie(!0),Mt=ne(),Ve=Mt[0],ut=Mt[1];b0.isTouch&&Ve==="hold"&&ut&&(Be=ut),Be?r=setTimeout(function(){R.show()},Be):R.show()}function dn(et){if(R.clearDelayTimeouts(),G("onUntrigger",[R,et]),!R.state.isVisible){Ae();return}if(!(R.props.trigger.indexOf("mouseenter")>=0&&R.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(et.type)>=0&&o)){var Be=ie(!1);Be?s=setTimeout(function(){R.state.isVisible&&R.hide()},Be):a=requestAnimationFrame(function(){R.hide()})}}function Pt(){R.state.isEnabled=!0}function Xe(){R.hide(),R.state.isEnabled=!1}function Ut(){clearTimeout(r),clearTimeout(s),cancelAnimationFrame(a)}function Lt(et){if(!R.state.isDestroyed){G("onBeforeUpdate",[R,et]),$e();var Be=R.props,Mt=Pxe(e,Object.assign({},Be,_xe(et),{ignoreAttributes:!0}));R.props=Mt,Qe(),Be.interactiveDebounce!==Mt.interactiveDebounce&&(ae(),v=jxe(tt,Mt.interactiveDebounce)),Be.triggerTarget&&!Mt.triggerTarget?vC(Be.triggerTarget).forEach(function(Ve){Ve.removeAttribute("aria-expanded")}):Mt.triggerTarget&&e.removeAttribute("aria-expanded"),te(),oe(),L&&L(Be,Mt),R.popperInstance&&(Vt(),Nt().forEach(function(Ve){requestAnimationFrame(Ve._tippy.popperInstance.forceUpdate)})),G("onAfterUpdate",[R,et])}}function qe(et){R.setProps({content:et})}function Ke(){var et=R.state.isVisible,Be=R.state.isDestroyed,Mt=!R.state.isEnabled,Ve=b0.isTouch&&!R.props.touch,ut=tV(R.props.duration,0,im.duration);if(!(et||Be||Mt||Ve)&&!re().hasAttribute("disabled")&&(G("onShow",[R],!1),R.props.onShow(R)!==!1)){if(R.state.isVisible=!0,X()&&(U.style.visibility="visible"),oe(),ge(),R.state.isMounted||(U.style.transition="none"),X()){var xt=Y(),jt=xt.box,kt=xt.content;nV([jt,kt],0)}x=function(){var un;if(!(!R.state.isVisible||u)){if(u=!0,U.offsetHeight,U.style.transition=R.props.moveTransition,X()&&R.props.animation){var On=Y(),En=On.box,jn=On.content;nV([En,jn],ut),kxe([En,jn],"visible")}V(),te(),Exe(sV,R),(un=R.popperInstance)==null||un.forceUpdate(),G("onMount",[R]),R.props.animation&&X()&&je(ut,function(){R.state.isShown=!0,G("onShown",[R])})}},an()}}function pt(){var et=!R.state.isVisible,Be=R.state.isDestroyed,Mt=!R.state.isEnabled,Ve=tV(R.props.duration,1,im.duration);if(!(et||Be||Mt)&&(G("onHide",[R],!1),R.props.onHide(R)!==!1)){if(R.state.isVisible=!1,R.state.isShown=!1,u=!1,o=!1,X()&&(U.style.visibility="hidden"),ae(),Ae(),oe(!0),X()){var ut=Y(),xt=ut.box,jt=ut.content;R.props.animation&&(nV([xt,jt],Ve),kxe([xt,jt],"hidden"))}V(),te(),R.props.animation?X()&&ye(Ve,R.unmount):R.unmount()}}function en(et){pe().addEventListener("mousemove",v),Exe(aP,v),v(et)}function Bt(){R.state.isVisible&&R.hide(),R.state.isMounted&&(It(),Nt().forEach(function(et){et._tippy.unmount()}),U.parentNode&&U.parentNode.removeChild(U),sV=sV.filter(function(et){return et!==R}),R.state.isMounted=!1,G("onHidden",[R]))}function Et(){R.state.isDestroyed||(R.clearDelayTimeouts(),R.unmount(),$e(),delete e._tippy,R.state.isDestroyed=!0,G("onDestroy",[R]))}}function Kk(e,t){t===void 0&&(t={});var n=im.plugins.concat(t.plugins||[]);KCt();var r=Object.assign({},t,{plugins:n}),s=VCt(e),a=s.reduce(function(o,l){var c=l&&s4t(l,r);return c&&o.push(c),o},[]);return GB(e)?a[0]:a}Kk.defaultProps=im;Kk.setDefaultProps=e4t;Kk.currentInput=b0;Object.assign({},UIe,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});var oee={clientX:0,clientY:0},oP=[];function iPe(e){var t=e.clientX,n=e.clientY;oee={clientX:t,clientY:n}}function i4t(e){e.addEventListener("mousemove",iPe)}function a4t(e){e.removeEventListener("mousemove",iPe)}var o4t={name:"followCursor",defaultValue:!1,fn:function(t){var n=t.reference,r=tPe(t.props.triggerTarget||n),s=!1,a=!1,o=!0,l=t.props;function c(){return t.props.followCursor==="initial"&&t.state.isVisible}function u(){r.addEventListener("mousemove",x)}function d(){r.removeEventListener("mousemove",x)}function f(){s=!0,t.setProps({getReferenceClientRect:null}),s=!1}function x(w){var C=w.target?n.contains(w.target):!0,N=t.props.followCursor,I=w.clientX,P=w.clientY,R=n.getBoundingClientRect(),F=I-R.left,U=P-R.top;(C||!t.props.interactive)&&t.setProps({getReferenceClientRect:function(){var z=n.getBoundingClientRect(),Q=I,ne=P;N==="initial"&&(Q=z.left+F,ne=z.top+U);var J=N==="horizontal"?z.top:ne,X=N==="vertical"?z.right:Q,re=N==="horizontal"?z.bottom:ne,pe=N==="vertical"?z.left:Q;return{width:X-pe,height:re-J,top:J,right:X,bottom:re,left:pe}}})}function g(){t.props.followCursor&&(oP.push({instance:t,doc:r}),i4t(r))}function v(){oP=oP.filter(function(w){return w.instance!==t}),oP.filter(function(w){return w.doc===r}).length===0&&a4t(r)}return{onCreate:g,onDestroy:v,onBeforeUpdate:function(){l=t.props},onAfterUpdate:function(C,N){var I=N.followCursor;s||I!==void 0&&l.followCursor!==I&&(v(),I?(g(),t.state.isMounted&&!a&&!c()&&u()):(d(),f()))},onMount:function(){t.props.followCursor&&!a&&(o&&(x(oee),o=!1),c()||u())},onTrigger:function(C,N){ePe(N)&&(oee={clientX:N.clientX,clientY:N.clientY}),a=N.type==="focus"},onHidden:function(){t.props.followCursor&&(f(),d(),o=!0)}}}};Kk.setDefaultProps({render:sPe});function pi({content:e,children:t,align:n="center"}){const r=m.useRef(null),s=m.useRef(null),a=m.useRef(null),o=m.useRef(null);return m.useEffect(()=>{const l=()=>{o.current.hide()},c=document.querySelectorAll("*");return c.forEach(u=>{u.addEventListener("scroll",l,{passive:!0})}),()=>{c.forEach(u=>{u.removeEventListener("scroll",l)})}},[]),m.useEffect(()=>{if(!r.current)return;const l=typeof e!="string";l&&(s.current=document.createElement("div"),a.current=FNe.createRoot(s.current),a.current.render(e));const c=Kk(r.current,{content:l?s.current:`
<div style="
border-radius: 12px;
border: 0.8px solid rgba(133, 133, 133, 0.32);
background: rgba(255, 255, 255, 0.08);
box-shadow: 0 4px 4px 0 #050505;
backdrop-filter: blur(43px);
color: #FFF;
text-align: ${n};
font-family: Inter, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 14px;
letter-spacing: -0.12px;
padding: 6px 10px;
">
${e}
</div>
`,allowHTML:!l,followCursor:!0,plugins:[o4t],delay:[0,0],offset:[10,10],animation:"scale-subtle",duration:[50,100],placement:"top",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","bottom","left"]}},{name:"preventOverflow",options:{padding:8}}]},interactive:!1,moveTransition:"",trigger:"mouseenter mousemove",theme:"custom",onShow(){setTimeout(()=>{window.dispatchEvent(new Event("resize"))},50)}});return o.current=c,()=>{a.current&&Promise.resolve().then(()=>{var u;(u=a.current)==null||u.unmount()})}},[e]),m.isValidElement(t)?m.cloneElement(t,{ref:r}):i.jsx("span",{ref:r,children:t})}var Qh;(function(e){e.NUMBER="NUMBER_NUMBER",e.HEX="NUMBER_HEX",e.STR="NUMBER_STR",e.BIGINT="NUMBER_BIGINT"})(Qh||(Qh={}));var d1;(function(e){e.HEX="BYTES_HEX",e.UINT8ARRAY="BYTES_UINT8ARRAY"})(d1||(d1={}));const dd={number:Qh.BIGINT,bytes:d1.HEX},fi={number:Qh.HEX,bytes:d1.HEX};var Tg;(function(e){e.EARLIEST="earliest",e.LATEST="latest",e.PENDING="pending",e.SAFE="safe",e.FINALIZED="finalized",e.COMMITTED="committed"})(Tg||(Tg={}));var Yj;(function(e){e.chainstart="chainstart",e.frontier="frontier",e.homestead="homestead",e.dao="dao",e.tangerineWhistle="tangerineWhistle",e.spuriousDragon="spuriousDragon",e.byzantium="byzantium",e.constantinople="constantinople",e.petersburg="petersburg",e.istanbul="istanbul",e.muirGlacier="muirGlacier",e.berlin="berlin",e.london="london",e.altair="altair",e.arrowGlacier="arrowGlacier",e.grayGlacier="grayGlacier",e.bellatrix="bellatrix",e.merge="merge",e.capella="capella",e.shanghai="shanghai"})(Yj||(Yj={}));const Dae=Object.getPrototypeOf(Uint8Array);var Mxe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Rxe=Symbol.for("web3/base-provider");class Yk{static isWeb3Provider(t){return t instanceof Yk||!!(t&&t[Rxe])}get[Rxe](){return!0}send(t,n){this.request(t).then(r=>{n(null,r)}).catch(r=>{n(r)})}sendAsync(t){return Mxe(this,void 0,void 0,function*(){return this.request(t)})}asEIP1193Provider(){const t=Object.create(this),n=t.request;return t.request=function(s){return Mxe(this,void 0,void 0,function*(){return(yield n(s)).result})},t.asEIP1193Provider=void 0,t}}class l4t extends Array{constructor(t){super(),this._accountProvider=t}}const c4t=100,u4t=101,d4t=201,f4t=202,h4t=203,p4t=204,m4t=205,x4t=206,g4t=207,b4t=208,y4t=300,v4t=301,w4t=310,C4t=311,S4t=400,N4t=402,A4t=405,j4t=407,E4t=408,_4t=410,k4t=411,T4t=412,I4t=413,P4t=414,F4t=415,O4t=416,M4t=417,R4t=418,L4t=419,D4t=420,B4t=421,$4t=422,U4t=423,z4t=424,H4t=425,V4t=426,W4t=427,q4t=428,G4t=429,K4t=430,Y4t=431,X4t=432,Q4t=433,Z4t=434,J4t=435,eSt=436,tSt=437,nSt=438,rSt=439,sSt=440,iSt=441,aSt=500,oSt=503,lSt=505,cSt=506,uSt=507,dSt=600,fSt=602,hSt=603,pSt=604,mSt=701,xSt=702,gSt=703,bSt=704,ySt=705,vSt=706,wSt=707,CSt=709,SSt=801,NSt=802,ASt=4001,jSt=4100,ESt=4200,_St=4900,kSt=4901,TSt=902,ISt=903,PSt=1001,FSt=1002,OSt=1003,MSt=1004,RSt=1005,LSt=1006,DSt=1008,BSt=1009,$St=1010,USt=1011,zSt=1012,HSt=1014,VSt=1015,WSt=1100,aPe=1101,qSt=1200,MM=-32700,RM=-32600,LM=-32601,DM=-32602,BM=-32603,$M=-32e3,UM=-32001,zM=-32002,HM=-32003,VM=-32004,WM=-32005,qM=-32006;class ci extends Error{get innerError(){return this.cause instanceof Xj?this.cause.errors:this.cause}set innerError(t){Array.isArray(t)?this.cause=new Xj(t):this.cause=t}constructor(t,n){super(t),Array.isArray(n)?this.cause=new Xj(n):this.cause=n,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(t,n=!1){if(t==null)return"undefined";const r=JSON.stringify(t,(s,a)=>typeof a=="bigint"?a.toString():a);return n&&["bigint","string"].includes(typeof t)?r.replace(/['\\"]+/g,""):r}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:this.cause,innerError:this.cause}}}class Xj extends ci{constructor(t){super(`Multiple errors occurred: [${t.map(n=>n.message).join("], [")}]`),this.code=b4t,this.errors=t}}class $i extends ci{constructor(t,n){super(`Invalid value given "${ci.convertToString(t,!0)}". Error: ${n}.`),this.name=this.constructor.name}}class Lxe extends ci{constructor(){super("Private key must be 32 bytes."),this.code=mSt}}class GSt extends ci{constructor(){super("Invalid Private Key, Not a valid string or uint8Array"),this.code=xSt}}class KSt extends ci{constructor(t){super(`"${t}"`),this.code=NSt}}class oPe extends ci{constructor(){super("Invalid key derivation function"),this.code=gSt}}class YSt extends ci{constructor(){super("Key derivation failed - possibly wrong password"),this.code=bSt}}class XSt extends ci{constructor(){super("Unsupported key store version"),this.code=ySt}}class QSt extends ci{constructor(){super("Password cannot be empty"),this.code=vSt}}class ZSt extends ci{constructor(){super("Initialization vector must be 16 bytes"),this.code=wSt}}class JSt extends ci{constructor(){super("c > 1000, pbkdf2 is less secure with less iterations"),this.code=CSt}}class Xk extends ci{constructor(t,n){super(t),this.code=aSt,n&&(this.errorCode=n.code,this.errorReason=n.reason)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{errorCode:this.errorCode,errorReason:this.errorReason})}}class lee extends Xk{constructor(t){super("Connection not open",t),this.code=oSt}}class eNt extends Xk{constructor(t){super(`Maximum number of reconnect attempts reached! (${t})`),this.code=lSt}}class tNt extends Xk{constructor(){super("CONNECTION ERROR: Provider started to reconnect before the response got received!"),this.code=cSt}}class nNt extends Xk{constructor(t){super(`Request already sent with following id: ${t}`),this.code=uSt}}class fd extends ci{constructor(t,n){super(t),this.code=y4t,this.receipt=n}}class Dxe extends ci{constructor(t,n){super(`The resolver at ${t} does not implement requested method: "${n}".`),this.address=t,this.name=n,this.code=v4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{address:this.address,name:this.name})}}class KB extends fd{constructor(t){if(super(t.message||"Error"),this.name="name"in t&&t.name||this.constructor.name,this.stack="stack"in t&&t.stack||void 0,this.code=t.code,typeof t.data=="object"){let n;t.data&&"originalError"in t.data?n=t.data.originalError:n=t.data,this.data=n.data,this.cause=new KB(n)}else this.data=t.data}setDecodedProperties(t,n,r){this.errorName=t,this.errorSignature=n,this.errorArgs=r}toJSON(){let t=Object.assign(Object.assign({},super.toJSON()),{data:this.data});return this.errorName&&(t=Object.assign(Object.assign({},t),{errorName:this.errorName,errorSignature:this.errorSignature,errorArgs:this.errorArgs})),t}}class Qw extends fd{constructor(t){super("Error happened while trying to execute a function inside a smart contract"),this.code=w4t,this.cause=new KB(t)}}class rNt extends $i{constructor(t){var n,r;super(`data: ${(n=t.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=t.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of a contract at the same time, please use either "data" or "input" instead.`),this.code=C4t}}class sNt extends ci{constructor(t){super(`ENS is not supported on network ${t}`),this.code=TSt}}class iNt extends ci{constructor(){super("Network not synced"),this.code=ISt}}class Bxe extends ci{constructor(t){super(`Invalid parameters passed. "${typeof t<"u"?t:""}"`),this.hint=t,this.code=g4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{hint:this.hint})}}class cee extends ci{constructor(){super(...arguments),this.code=d4t}}class Ux extends ci{constructor(){super("The method you're trying to call is not implemented."),this.code=f4t}}class lPe extends ci{constructor(){super(...arguments),this.code=h4t}}class aNt extends ci{constructor(){super(...arguments),this.code=p4t}}class Ki extends ci{constructor(t,n){super(t),this.code=m4t,this.props=n??{}}}class oNt extends ci{constructor(t){super(`A plugin with the namespace: ${t} has already been registered.`),this.code=x4t}}class oO extends ci{constructor(){super(...arguments),this.code=dSt}}class uee extends ci{constructor(t){super(`Client URL "${t}" is invalid.`),this.code=fSt}}class lg extends ci{constructor(){super(...arguments),this.code=hSt}}class lNt extends ci{constructor(){super(...arguments),this.code=pSt}}class cNt extends $i{constructor(){super(...arguments),this.code=SSt}}class Bae extends ci{constructor(t,n){super(t),this.receipt=n,this.code=S4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}}class GM extends ci{constructor(t,n,r,s){super(`Transaction has been reverted by the EVM${r===void 0?"":`:
${ci.convertToString(r)}`}`),this.reason=t,this.signature=n,this.receipt=r,this.data=s,this.code=N4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature,receipt:this.receipt,data:this.data})}}class cPe extends GM{constructor(t,n,r,s,a,o,l){super(t),this.reason=t,this.customErrorName=n,this.customErrorDecodedSignature=r,this.customErrorArguments=s,this.signature=a,this.receipt=o,this.data=l,this.code=nSt}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,customErrorName:this.customErrorName,customErrorDecodedSignature:this.customErrorDecodedSignature,customErrorArguments:this.customErrorArguments,signature:this.signature,receipt:this.receipt,data:this.data})}}class uPe extends Bae{constructor(t){super(`Transaction has been reverted by the EVM${t===void 0?"":`:
${ci.convertToString(t)}`}`,t),this.code=A4t}}class uNt extends Bae{constructor(){super("Raw transaction undefined"),this.code=j4t}}class $xe extends Bae{constructor(){super("Transaction not found"),this.code=K4t}}class dNt extends $i{constructor(t){super(t,"invalid transaction with invalid sender"),this.code=E4t}}class fNt extends $i{constructor(t){super(t,"invalid transaction with invalid receiver"),this.code=tSt}}class hNt extends $i{constructor(){super("MissingCustomChainError","If tx.common is provided it must have tx.common.customChain"),this.code=_4t}}class pNt extends $i{constructor(){super("MissingCustomChainIdError","If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"),this.code=k4t}}class mNt extends $i{constructor(t){super(JSON.stringify(t),"Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"),this.code=T4t}}class xNt extends $i{constructor(t){super(JSON.stringify(t),"Chain doesnt match in tx.chain tx.common.basechain"),this.code=J4t}}class gNt extends $i{constructor(t){super(JSON.stringify(t),"hardfork doesnt match in tx.hardfork tx.common.hardfork"),this.code=eSt}}class bNt extends $i{constructor(){super("CommonOrChainAndHardforkError","Please provide the common object or the chain and hardfork property but not all together."),this.code=I4t}}class yNt extends $i{constructor(t){var n,r;super("MissingChainOrHardforkError",`When specifying chain and hardfork, both values must be defined. Received "chain": ${(n=t.chain)!==null&&n!==void 0?n:"undefined"}, "hardfork": ${(r=t.hardfork)!==null&&r!==void 0?r:"undefined"}`),this.code=P4t}}class vNt extends ci{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions'),this.code=sSt}}class wNt extends $i{constructor(t){var n,r,s,a;super(`gas: ${(n=t.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=t.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(s=t.maxPriorityFeePerGas)!==null&&s!==void 0?s:"undefined"}, maxFeePerGas: ${(a=t.maxFeePerGas)!==null&&a!==void 0?a:"undefined"}`,'"gas" is missing'),this.code=F4t,this.cause=new vNt}}class CNt extends ci{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions, not both'),this.code=iSt}}class SNt extends $i{constructor(t){var n,r,s,a;super(`gas: ${(n=t.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=t.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(s=t.maxPriorityFeePerGas)!==null&&s!==void 0?s:"undefined"}, maxFeePerGas: ${(a=t.maxFeePerGas)!==null&&a!==void 0?a:"undefined"}`,"transaction must specify legacy or fee market gas properties, not both"),this.code=Z4t,this.cause=new CNt}}class NNt extends $i{constructor(t){var n,r;super(`gas: ${(n=t.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=t.gasPrice)!==null&&r!==void 0?r:"undefined"}`,"Gas or gasPrice is lower than 0"),this.code=O4t}}class ANt extends $i{constructor(t){var n,r;super(`maxPriorityFeePerGas: ${(n=t.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=t.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"maxPriorityFeePerGas or maxFeePerGas is lower than 0"),this.code=M4t}}class jNt extends $i{constructor(t){super(t,"eip-1559 transactions don't support gasPrice"),this.code=R4t}}class dPe extends $i{constructor(t){var n,r;super(`maxPriorityFeePerGas: ${(n=t.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=t.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas"),this.code=L4t}}class ENt extends $i{constructor(t){super(t,"invalid transaction object"),this.code=D4t}}class _Nt extends $i{constructor(t){var n,r;super(`nonce: ${(n=t.nonce)!==null&&n!==void 0?n:"undefined"}, chainId: ${(r=t.chainId)!==null&&r!==void 0?r:"undefined"}`,"Nonce or chainId is lower than 0"),this.code=B4t}}class kNt extends $i{constructor(){super("UnableToPopulateNonceError","unable to populate nonce, no from address available"),this.code=$4t}}class TNt extends $i{constructor(){super("Eip1559NotSupportedError","Network doesn't support eip-1559"),this.code=U4t}}class Uxe extends $i{constructor(t){super(t,"unsupported transaction type"),this.code=z4t}}class fPe extends $i{constructor(t){var n,r;super(`data: ${(n=t.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=t.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.`),this.code=H4t}}class INt extends ci{constructor(t){super(`The connected Ethereum Node did not respond within ${t.numberOfSeconds} seconds, please make sure your transaction was properly sent and you are connected to a healthy Node. Be aware that transaction might still be pending or mined!
Transaction Hash: ${t.transactionHash?t.transactionHash.toString():"not available"}`),this.code=Y4t}}function hPe(e){return`Please make sure your transaction was properly sent and there are no previous pending transaction for the same account. However, be aware that it might still be mined!
Transaction Hash: ${e?e.toString():"not available"}`}class pPe extends ci{constructor(t){super(`Transaction was not mined within ${t.numberOfSeconds} seconds. ${hPe(t.transactionHash)}`),this.code=V4t}}class mPe extends ci{constructor(t){super(`Transaction started at ${t.starterBlockNumber} but was not mined within ${t.numberOfBlocks} blocks. ${hPe(t.transactionHash)}`),this.code=X4t}}class PNt extends $i{constructor(t){var n,r;super(`receipt: ${JSON.stringify(t.receipt)}, blockHash: ${(n=t.blockHash)===null||n===void 0?void 0:n.toString()}, transactionHash: ${(r=t.transactionHash)===null||r===void 0?void 0:r.toString()}`,"Receipt missing or blockHash null"),this.code=W4t}}class FNt extends $i{constructor(t){super(`receipt: ${JSON.stringify(t.receipt)}`,"Receipt missing block number"),this.code=q4t}}class dee extends ci{constructor(t){super(`Invalid signature. "${t}"`),this.code=Q4t}}class zxe extends $i{constructor(){super("LocalWalletNotAvailableError","Attempted to index account in local wallet, but no wallet is available"),this.code=G4t}}class ONt extends ci{constructor(t,n){const r=[];t.forEach(s=>r.push(s.keyword)),super(`The following properties are invalid for the transaction type ${n}: ${r.join(", ")}`),this.code=rSt}}class a4 extends $i{constructor(t){super(t,"can not parse as byte data"),this.code=FSt}}class $ae extends $i{constructor(t){super(t,"can not parse as number data"),this.code=OSt}}class Uae extends $i{constructor(t){super(t,"invalid ethereum address"),this.code=RSt}}class MNt extends $i{constructor(t){super(t,"not a valid string"),this.code=PSt}}class xPe extends $i{constructor(t){super(t,"invalid unit"),this.code=MSt}}class gPe extends $i{constructor(t){super(t,"not a valid unit. Must be a positive integer"),this.code=VSt}}class RNt extends $i{constructor(t){super(t,"can not be converted to hex"),this.code=LSt}}class bPe extends $i{constructor(t){super(t,"value greater than the nibble width"),this.code=HSt}}class zae extends $i{constructor(t){super(t,"not a valid boolean."),this.code=DSt}}class LNt extends $i{constructor(t){super(t,"not a valid unsigned integer."),this.code=BSt}}class Hxe extends $i{constructor(t){super(t,"invalid size given."),this.code=$St}}class Vxe extends $i{constructor(t){super(t,"value is larger than size."),this.code=USt}}class DNt extends $i{constructor(t){super(t,"invalid string given"),this.code=zSt}}const BNt=e=>!Array.isArray(e)&&e.jsonrpc==="2.0"&&!!e&&(e.result===void 0||e.result===null)&&"error"in e&&(typeof e.id=="number"||typeof e.id=="string"),Wxe=e=>BNt(e)?e.error.message:"";class S0 extends ci{constructor(t,n,r,s){var a;super(n??`Returned error: ${Array.isArray(t)?t.map(l=>Wxe(l)).join(","):Wxe(t)}`),this.code=c4t,n||(this.data=Array.isArray(t)?t.map(l=>{var c;return(c=l.error)===null||c===void 0?void 0:c.data}):(a=t==null?void 0:t.error)===null||a===void 0?void 0:a.data),this.statusCode=s,this.request=r;let o;"error"in t?o=t.error:t instanceof Array&&(o=t.filter(l=>l.error).map(l=>l.error)),Array.isArray(o)&&o.length>0?this.cause=new Xj(o):this.cause=o}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{data:this.data,request:this.request,statusCode:this.statusCode})}}class YB extends S0{constructor(t,n){super(t,void 0,n),this.code=u4t;let r;"error"in t?r=t.error:t instanceof Array&&(r=t.map(s=>s.error)),Array.isArray(r)?this.cause=new Xj(r):this.cause=r}}class qxe extends ci{constructor(t,n){super(`Web3Config hardfork doesnt match in defaultHardfork ${t} and common.hardfork ${n}`),this.code=aPe}}class Gxe extends ci{constructor(t,n){super(`Web3Config chain doesnt match in defaultHardfork ${t} and common.hardfork ${n}`),this.code=aPe}}const yPe="An Rpc error has occured with a code of *code*",Pu={[MM]:{message:"Parse error",description:"Invalid JSON"},[RM]:{message:"Invalid request",description:"JSON is not a valid request object "},[LM]:{message:"Method not found",description:"Method does not exist "},[DM]:{message:"Invalid params",description:"Invalid method parameters"},[BM]:{message:"Internal error",description:"Internal JSON-RPC error"},[$M]:{message:"Invalid input",description:"Missing or invalid parameters"},[UM]:{message:"Resource not found",description:"Requested resource not found"},[zM]:{message:"Resource unavailable",description:"Requested resource not available"},[HM]:{message:"Transaction rejected",description:"Transaction creation failed"},[VM]:{message:"Method not supported",description:"Method is not implemented"},[WM]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[qM]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[ASt]:{name:"User Rejected Request",message:"The user rejected the request."},[jSt]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[ESt]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[_St]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[kSt]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};class Jf extends ci{constructor(t,n){super(n??yPe.replace("*code*",t.error.code.toString())),this.code=t.error.code,this.id=t.id,this.jsonrpc=t.jsonrpc,this.jsonRpcError=t.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}class $Nt extends ci{constructor(t,n){var r,s,a,o;if(!t)super();else if(!((r=Pu[t])===null||r===void 0)&&r.message)super(Pu[t].message);else{const l=Object.keys(Pu).find(c=>typeof c=="string"&&t>=parseInt(c.split("-")[0],10)&&t<=parseInt(c.split("-")[1],10));super((a=(s=Pu[l??""])===null||s===void 0?void 0:s.message)!==null&&a!==void 0?a:yPe.replace("*code*",(o=t==null?void 0:t.toString())!==null&&o!==void 0?o:'""'))}this.code=t,this.data=n}}class UNt extends Jf{constructor(t){super(t,Pu[MM].message),this.code=MM}}class zNt extends Jf{constructor(t){super(t,Pu[RM].message),this.code=RM}}class HNt extends Jf{constructor(t){super(t,Pu[LM].message),this.code=LM}}class VNt extends Jf{constructor(t){super(t,Pu[DM].message),this.code=DM}}class WNt extends Jf{constructor(t){super(t,Pu[BM].message),this.code=BM}}class qNt extends Jf{constructor(t){super(t,Pu[$M].message),this.code=$M}}class GNt extends Jf{constructor(t){super(t,Pu[VM].message),this.code=VM}}class KNt extends Jf{constructor(t){super(t,Pu[zM].message),this.code=zM}}class YNt extends Jf{constructor(t){super(t,Pu[UM].message),this.code=UM}}class XNt extends Jf{constructor(t){super(t,Pu[qM].message),this.code=qM}}class QNt extends Jf{constructor(t){super(t,Pu[HM].message),this.code=HM}}class ZNt extends Jf{constructor(t){super(t,Pu[WM].message),this.code=WM}}const md=new Map;md.set(MM,{error:UNt});md.set(RM,{error:zNt});md.set(LM,{error:HNt});md.set(DM,{error:VNt});md.set(BM,{error:WNt});md.set($M,{error:qNt});md.set(VM,{error:GNt});md.set(zM,{error:KNt});md.set(HM,{error:QNt});md.set(UM,{error:YNt});md.set(qM,{error:XNt});md.set(WM,{error:ZNt});class JNt extends ci{constructor(t){super(`Format for the type ${t} is unsupported`),this.type=t,this.code=qSt}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}function qd(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function eAt(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function tAt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function OA(e,...t){if(!tAt(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Hae(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");qd(e.outputLen),qd(e.blockLen)}function O3(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Vae(e,t){OA(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const vPe={number:qd,bool:eAt,bytes:OA,hash:Hae,exists:O3,output:Vae},lP=BigInt(2**32-1),Kxe=BigInt(32);function nAt(e,t=!1){return t?{h:Number(e&lP),l:Number(e>>Kxe&lP)}:{h:Number(e>>Kxe&lP)|0,l:Number(e&lP)|0}}function rAt(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=nAt(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const sAt=(e,t,n)=>e<<n|t>>>32-n,iAt=(e,t,n)=>t<<n|e>>>32-n,aAt=(e,t,n)=>t<<n-32|e>>>64-n,oAt=(e,t,n)=>e<<n-32|t>>>64-n,lO=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const cO=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),uO=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Xm=(e,t)=>e<<32-t|e>>>t,pa=(e,t)=>e<<t|e>>>32-t>>>0,KM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,lAt=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function YM(e){for(let t=0;t<e.length;t++)e[t]=lAt(e[t])}function XS(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function QS(e){return typeof e=="string"&&(e=XS(e)),OA(e),e}function XM(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];OA(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}class Wae{clone(){return this._cloneInto()}}const cAt={}.toString;function wPe(e,t){if(t!==void 0&&cAt.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function CPe(e){const t=r=>e().update(QS(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function SPe(e=32){if(lO&&typeof lO.getRandomValues=="function")return lO.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const NPe=[],APe=[],jPe=[],uAt=BigInt(0),A7=BigInt(1),dAt=BigInt(2),fAt=BigInt(7),hAt=BigInt(256),pAt=BigInt(113);for(let e=0,t=A7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],NPe.push(2*(5*r+n)),APe.push((e+1)*(e+2)/2%64);let s=uAt;for(let a=0;a<7;a++)t=(t<<A7^(t>>fAt)*pAt)%hAt,t&dAt&&(s^=A7<<(A7<<BigInt(a))-A7);jPe.push(s)}const[mAt,xAt]=rAt(jPe,!0),Yxe=(e,t,n)=>n>32?aAt(e,t,n):sAt(e,t,n),Xxe=(e,t,n)=>n>32?oAt(e,t,n):iAt(e,t,n);function gAt(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=Yxe(u,d,1)^n[l],x=Xxe(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=APe[o],c=Yxe(s,a,l),u=Xxe(s,a,l),d=NPe[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=mAt[r],e[1]^=xAt[r]}n.fill(0)}class qae extends Wae{constructor(t,n,r,s=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,qd(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=cO(this.state)}keccak(){KM||YM(this.state32),gAt(this.state32,this.rounds),KM||YM(this.state32),this.posOut=0,this.pos=0}update(t){O3(this);const{blockLen:n,state:r}=this;t=QS(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){O3(this,!1),OA(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return qd(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Vae(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new qae(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}}const bAt=(e,t,n)=>CPe(()=>new qae(t,e,n)),Qxe=bAt(1,136,256/8),QM=vPe.bytes;function EPe(e){if(!(e instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof e}`);return new TextDecoder().decode(e)}function yAt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function vAt(e){return t=>(vPe.bytes(t),e(t))}(()=>{const e=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:t&&!e?t("crypto"):void 0,web:e}})();const od=(()=>{const e=vAt(Qxe);return e.create=Qxe.create,e})();var ua;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},e.getValidEnumValues=s=>{const a=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of a)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(const o of s)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(ua||(ua={}));var fee;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(fee||(fee={}));const ys=ua.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fg=e=>{switch(typeof e){case"undefined":return ys.undefined;case"string":return ys.string;case"number":return Number.isNaN(e)?ys.nan:ys.number;case"boolean":return ys.boolean;case"function":return ys.function;case"bigint":return ys.bigint;case"symbol":return ys.symbol;case"object":return Array.isArray(e)?ys.array:e===null?ys.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ys.promise:typeof Map<"u"&&e instanceof Map?ys.map:typeof Set<"u"&&e instanceof Set?ys.set:typeof Date<"u"&&e instanceof Date?ys.date:ys.object;default:return ys.unknown}},Wr=ua.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),wAt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Wf extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(a){return a.message},r={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return s(this),r}static assert(t){if(!(t instanceof Wf))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ua.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];n[a]=n[a]||[],n[a].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Wf.create=e=>new Wf(e);const ZS=(e,t)=>{let n;switch(e.code){case Wr.invalid_type:e.received===ys.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Wr.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ua.jsonStringifyReplacer)}`;break;case Wr.unrecognized_keys:n=`Unrecognized key(s) in object: ${ua.joinValues(e.keys,", ")}`;break;case Wr.invalid_union:n="Invalid input";break;case Wr.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ua.joinValues(e.options)}`;break;case Wr.invalid_enum_value:n=`Invalid enum value. Expected ${ua.joinValues(e.options)}, received '${e.received}'`;break;case Wr.invalid_arguments:n="Invalid function arguments";break;case Wr.invalid_return_type:n="Invalid function return type";break;case Wr.invalid_date:n="Invalid date";break;case Wr.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ua.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Wr.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Wr.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Wr.custom:n="Invalid input";break;case Wr.invalid_intersection_types:n="Intersection results could not be merged";break;case Wr.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Wr.not_finite:n="Number must be finite";break;default:n=t.defaultError,ua.assertNever(e)}return{message:n}};let _Pe=ZS;function CAt(e){_Pe=e}function ZM(){return _Pe}const JM=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,a=[...n,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...s,path:a,message:l}},SAt=[];function cs(e,t){const n=ZM(),r=JM({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ZS?void 0:ZS].filter(s=>!!s)});e.common.issues.push(r)}class Lu{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return ei;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const a=await s.key,o=await s.value;r.push({key:a,value:o})}return Lu.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return ei;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const ei=Object.freeze({status:"aborted"}),MC=e=>({status:"dirty",value:e}),xd=e=>({status:"valid",value:e}),hee=e=>e.status==="aborted",pee=e=>e.status==="dirty",M3=e=>e.status==="valid",wE=e=>typeof Promise<"u"&&e instanceof Promise;var Ms;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ms||(Ms={}));class tx{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Zxe=(e,t)=>{if(M3(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Wf(e.common.issues);return this._error=n,this._error}}};function _i(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class Di{get description(){return this._def.description}_getType(t){return fg(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:fg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Lu,ctx:{common:t.parent.common,data:t.data,parsedType:fg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(wE(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fg(t)},s=this._parseSync({data:t,path:r.path,parent:r});return Zxe(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fg(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return M3(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(s=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(a=>M3(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fg(t)},s=this._parse({data:t,path:r.path,parent:r}),a=await(wE(s)?s:Promise.resolve(s));return Zxe(r,a)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,a)=>{const o=t(s),l=()=>a.addIssue({code:Wr.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new bm({schema:this,typeName:ri.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return B0.create(this,this._def)}nullable(){return Gy.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return um.create(this)}promise(){return eN.create(this,this._def)}or(t){return AE.create([this,t],this._def)}and(t){return jE.create(this,t,this._def)}transform(t){return new bm({..._i(this._def),schema:this,typeName:ri.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new IE({..._i(this._def),innerType:this,defaultValue:n,typeName:ri.ZodDefault})}brand(){return new Gae({typeName:ri.ZodBranded,type:this,..._i(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new PE({..._i(this._def),innerType:this,catchValue:n,typeName:ri.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Qk.create(this,t)}readonly(){return FE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const NAt=/^c[^\s-]{8,}$/i,AAt=/^[0-9a-z]+$/,jAt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EAt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,_At=/^[a-z0-9_-]{21}$/i,kAt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,TAt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,IAt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PAt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let iV;const FAt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,OAt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,MAt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,RAt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,LAt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DAt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,kPe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",BAt=new RegExp(`^${kPe}$`);function TPe(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function $At(e){return new RegExp(`^${TPe(e)}$`)}function IPe(e){let t=`${kPe}T${TPe(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function UAt(e,t){return!!((t==="v4"||!t)&&FAt.test(e)||(t==="v6"||!t)&&MAt.test(e))}function zAt(e,t){if(!kAt.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function HAt(e,t){return!!((t==="v4"||!t)&&OAt.test(e)||(t==="v6"||!t)&&RAt.test(e))}class am extends Di{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ys.string){const a=this._getOrReturnCtx(t);return cs(a,{code:Wr.invalid_type,expected:ys.string,received:a.parsedType}),ei}const r=new Lu;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,l=t.data.length<a.value;(o||l)&&(s=this._getOrReturnCtx(t,s),o?cs(s,{code:Wr.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&cs(s,{code:Wr.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")IAt.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"email",code:Wr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")iV||(iV=new RegExp(PAt,"u")),iV.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"emoji",code:Wr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")EAt.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"uuid",code:Wr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")_At.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"nanoid",code:Wr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")NAt.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"cuid",code:Wr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")AAt.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"cuid2",code:Wr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")jAt.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"ulid",code:Wr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),cs(s,{validation:"url",code:Wr.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"regex",code:Wr.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?IPe(a).test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?BAt.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?$At(a).test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?TAt.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"duration",code:Wr.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?UAt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"ip",code:Wr.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?zAt(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"jwt",code:Wr.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?HAt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"cidr",code:Wr.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?LAt.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"base64",code:Wr.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?DAt.test(t.data)||(s=this._getOrReturnCtx(t,s),cs(s,{validation:"base64url",code:Wr.invalid_string,message:a.message}),r.dirty()):ua.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Wr.invalid_string,...Ms.errToObj(r)})}_addCheck(t){return new am({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ms.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ms.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ms.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ms.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ms.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ms.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ms.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ms.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ms.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ms.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ms.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ms.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ms.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Ms.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ms.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ms.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ms.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ms.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ms.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ms.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ms.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ms.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ms.errToObj(n)})}nonempty(t){return this.min(1,Ms.errToObj(t))}trim(){return new am({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new am({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new am({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}am.create=e=>new am({checks:[],typeName:ri.ZodString,coerce:(e==null?void 0:e.coerce)??!1,..._i(e)});function VAt(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}class Vy extends Di{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ys.number){const a=this._getOrReturnCtx(t);return cs(a,{code:Wr.invalid_type,expected:ys.number,received:a.parsedType}),ei}let r;const s=new Lu;for(const a of this._def.checks)a.kind==="int"?ua.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),cs(r,{code:Wr.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),cs(r,{code:Wr.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),cs(r,{code:Wr.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?VAt(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),cs(r,{code:Wr.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),cs(r,{code:Wr.not_finite,message:a.message}),s.dirty()):ua.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ms.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ms.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ms.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ms.toString(n))}setLimit(t,n,r,s){return new Vy({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ms.toString(s)}]})}_addCheck(t){return new Vy({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ms.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ms.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ms.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ms.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ms.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ms.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ms.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ms.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ms.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ua.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Vy.create=e=>new Vy({checks:[],typeName:ri.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,..._i(e)});class Wy extends Di{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ys.bigint)return this._getInvalidInput(t);let r;const s=new Lu;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),cs(r,{code:Wr.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),cs(r,{code:Wr.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),cs(r,{code:Wr.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):ua.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return cs(n,{code:Wr.invalid_type,expected:ys.bigint,received:n.parsedType}),ei}gte(t,n){return this.setLimit("min",t,!0,Ms.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ms.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ms.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ms.toString(n))}setLimit(t,n,r,s){return new Wy({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ms.toString(s)}]})}_addCheck(t){return new Wy({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ms.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ms.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ms.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ms.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ms.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Wy.create=e=>new Wy({checks:[],typeName:ri.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,..._i(e)});class CE extends Di{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ys.boolean){const r=this._getOrReturnCtx(t);return cs(r,{code:Wr.invalid_type,expected:ys.boolean,received:r.parsedType}),ei}return xd(t.data)}}CE.create=e=>new CE({typeName:ri.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,..._i(e)});class R3 extends Di{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ys.date){const a=this._getOrReturnCtx(t);return cs(a,{code:Wr.invalid_type,expected:ys.date,received:a.parsedType}),ei}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return cs(a,{code:Wr.invalid_date}),ei}const r=new Lu;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(s=this._getOrReturnCtx(t,s),cs(s,{code:Wr.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):ua.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new R3({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ms.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ms.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}R3.create=e=>new R3({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ri.ZodDate,..._i(e)});class eR extends Di{_parse(t){if(this._getType(t)!==ys.symbol){const r=this._getOrReturnCtx(t);return cs(r,{code:Wr.invalid_type,expected:ys.symbol,received:r.parsedType}),ei}return xd(t.data)}}eR.create=e=>new eR({typeName:ri.ZodSymbol,..._i(e)});class SE extends Di{_parse(t){if(this._getType(t)!==ys.undefined){const r=this._getOrReturnCtx(t);return cs(r,{code:Wr.invalid_type,expected:ys.undefined,received:r.parsedType}),ei}return xd(t.data)}}SE.create=e=>new SE({typeName:ri.ZodUndefined,..._i(e)});class NE extends Di{_parse(t){if(this._getType(t)!==ys.null){const r=this._getOrReturnCtx(t);return cs(r,{code:Wr.invalid_type,expected:ys.null,received:r.parsedType}),ei}return xd(t.data)}}NE.create=e=>new NE({typeName:ri.ZodNull,..._i(e)});class JS extends Di{constructor(){super(...arguments),this._any=!0}_parse(t){return xd(t.data)}}JS.create=e=>new JS({typeName:ri.ZodAny,..._i(e)});class Zw extends Di{constructor(){super(...arguments),this._unknown=!0}_parse(t){return xd(t.data)}}Zw.create=e=>new Zw({typeName:ri.ZodUnknown,..._i(e)});class f1 extends Di{_parse(t){const n=this._getOrReturnCtx(t);return cs(n,{code:Wr.invalid_type,expected:ys.never,received:n.parsedType}),ei}}f1.create=e=>new f1({typeName:ri.ZodNever,..._i(e)});class tR extends Di{_parse(t){if(this._getType(t)!==ys.undefined){const r=this._getOrReturnCtx(t);return cs(r,{code:Wr.invalid_type,expected:ys.void,received:r.parsedType}),ei}return xd(t.data)}}tR.create=e=>new tR({typeName:ri.ZodVoid,..._i(e)});class um extends Di{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==ys.array)return cs(n,{code:Wr.invalid_type,expected:ys.array,received:n.parsedType}),ei;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(cs(n,{code:o?Wr.too_big:Wr.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(cs(n,{code:Wr.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(cs(n,{code:Wr.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new tx(n,o,n.path,l)))).then(o=>Lu.mergeArray(r,o));const a=[...n.data].map((o,l)=>s.type._parseSync(new tx(n,o,n.path,l)));return Lu.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new um({...this._def,minLength:{value:t,message:Ms.toString(n)}})}max(t,n){return new um({...this._def,maxLength:{value:t,message:Ms.toString(n)}})}length(t,n){return new um({...this._def,exactLength:{value:t,message:Ms.toString(n)}})}nonempty(t){return this.min(1,t)}}um.create=(e,t)=>new um({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ri.ZodArray,..._i(t)});function wC(e){if(e instanceof Do){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=B0.create(wC(r))}return new Do({...e._def,shape:()=>t})}else return e instanceof um?new um({...e._def,type:wC(e.element)}):e instanceof B0?B0.create(wC(e.unwrap())):e instanceof Gy?Gy.create(wC(e.unwrap())):e instanceof nx?nx.create(e.items.map(t=>wC(t))):e}class Do extends Di{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ua.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ys.object){const u=this._getOrReturnCtx(t);return cs(u,{code:Wr.invalid_type,expected:ys.object,received:u.parsedType}),ei}const{status:r,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof f1&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=a[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new tx(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof f1){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(cs(s,{code:Wr.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new tx(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,x=await d.value;u.push({key:f,value:x,alwaysSet:d.alwaysSet})}return u}).then(u=>Lu.mergeObjectSync(r,u)):Lu.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Ms.errToObj,new Do({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,o;const s=((o=(a=this._def).errorMap)==null?void 0:o.call(a,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ms.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Do({...this._def,unknownKeys:"strip"})}passthrough(){return new Do({...this._def,unknownKeys:"passthrough"})}extend(t){return new Do({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Do({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ri.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Do({...this._def,catchall:t})}pick(t){const n={};for(const r of ua.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Do({...this._def,shape:()=>n})}omit(t){const n={};for(const r of ua.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Do({...this._def,shape:()=>n})}deepPartial(){return wC(this)}partial(t){const n={};for(const r of ua.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new Do({...this._def,shape:()=>n})}required(t){const n={};for(const r of ua.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof B0;)a=a._def.innerType;n[r]=a}return new Do({...this._def,shape:()=>n})}keyof(){return PPe(ua.objectKeys(this.shape))}}Do.create=(e,t)=>new Do({shape:()=>e,unknownKeys:"strip",catchall:f1.create(),typeName:ri.ZodObject,..._i(t)});Do.strictCreate=(e,t)=>new Do({shape:()=>e,unknownKeys:"strict",catchall:f1.create(),typeName:ri.ZodObject,..._i(t)});Do.lazycreate=(e,t)=>new Do({shape:e,unknownKeys:"strip",catchall:f1.create(),typeName:ri.ZodObject,..._i(t)});class AE extends Di{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new Wf(l.ctx.common.issues));return cs(n,{code:Wr.invalid_union,unionErrors:o}),ei}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new Wf(c));return cs(n,{code:Wr.invalid_union,unionErrors:l}),ei}}get options(){return this._def.options}}AE.create=(e,t)=>new AE({options:e,typeName:ri.ZodUnion,..._i(t)});const ig=e=>e instanceof _E?ig(e.schema):e instanceof bm?ig(e.innerType()):e instanceof kE?[e.value]:e instanceof qy?e.options:e instanceof TE?ua.objectValues(e.enum):e instanceof IE?ig(e._def.innerType):e instanceof SE?[void 0]:e instanceof NE?[null]:e instanceof B0?[void 0,...ig(e.unwrap())]:e instanceof Gy?[null,...ig(e.unwrap())]:e instanceof Gae||e instanceof FE?ig(e.unwrap()):e instanceof PE?ig(e._def.innerType):[];class XB extends Di{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ys.object)return cs(n,{code:Wr.invalid_type,expected:ys.object,received:n.parsedType}),ei;const r=this.discriminator,s=n.data[r],a=this.optionsMap.get(s);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(cs(n,{code:Wr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ei)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const a of n){const o=ig(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,a)}}return new XB({typeName:ri.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,..._i(r)})}}function mee(e,t){const n=fg(e),r=fg(t);if(e===t)return{valid:!0,data:e};if(n===ys.object&&r===ys.object){const s=ua.objectKeys(t),a=ua.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=mee(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===ys.array&&r===ys.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a<e.length;a++){const o=e[a],l=t[a],c=mee(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===ys.date&&r===ys.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class jE extends Di{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(a,o)=>{if(hee(a)||hee(o))return ei;const l=mee(a.value,o.value);return l.valid?((pee(a)||pee(o))&&n.dirty(),{status:n.value,value:l.data}):(cs(r,{code:Wr.invalid_intersection_types}),ei)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}jE.create=(e,t,n)=>new jE({left:e,right:t,typeName:ri.ZodIntersection,..._i(n)});class nx extends Di{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ys.array)return cs(r,{code:Wr.invalid_type,expected:ys.array,received:r.parsedType}),ei;if(r.data.length<this._def.items.length)return cs(r,{code:Wr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ei;!this._def.rest&&r.data.length>this._def.items.length&&(cs(r,{code:Wr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new tx(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>Lu.mergeArray(n,o)):Lu.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new nx({...this._def,rest:t})}}nx.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new nx({items:e,typeName:ri.ZodTuple,rest:null,..._i(t)})};class EE extends Di{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ys.object)return cs(r,{code:Wr.invalid_type,expected:ys.object,received:r.parsedType}),ei;const s=[],a=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:a._parse(new tx(r,l,r.path,l)),value:o._parse(new tx(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Lu.mergeObjectAsync(n,s):Lu.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Di?new EE({keyType:t,valueType:n,typeName:ri.ZodRecord,..._i(r)}):new EE({keyType:am.create(),valueType:t,typeName:ri.ZodRecord,..._i(n)})}}class nR extends Di{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ys.map)return cs(r,{code:Wr.invalid_type,expected:ys.map,received:r.parsedType}),ei;const s=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:s._parse(new tx(r,l,r.path,[u,"key"])),value:a._parse(new tx(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return ei;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return ei;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}nR.create=(e,t,n)=>new nR({valueType:t,keyType:e,typeName:ri.ZodMap,..._i(n)});class L3 extends Di{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ys.set)return cs(r,{code:Wr.invalid_type,expected:ys.set,received:r.parsedType}),ei;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(cs(r,{code:Wr.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(cs(r,{code:Wr.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return ei;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>a._parse(new tx(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new L3({...this._def,minSize:{value:t,message:Ms.toString(n)}})}max(t,n){return new L3({...this._def,maxSize:{value:t,message:Ms.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}L3.create=(e,t)=>new L3({valueType:e,minSize:null,maxSize:null,typeName:ri.ZodSet,..._i(t)});class o4 extends Di{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ys.function)return cs(n,{code:Wr.invalid_type,expected:ys.function,received:n.parsedType}),ei;function r(l,c){return JM({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ZM(),ZS].filter(u=>!!u),issueData:{code:Wr.invalid_arguments,argumentsError:c}})}function s(l,c){return JM({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ZM(),ZS].filter(u=>!!u),issueData:{code:Wr.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof eN){const l=this;return xd(async function(...c){const u=new Wf([]),d=await l._def.args.parseAsync(c,a).catch(g=>{throw u.addIssue(r(c,g)),u}),f=await Reflect.apply(o,this,d);return await l._def.returns._def.type.parseAsync(f,a).catch(g=>{throw u.addIssue(s(f,g)),u})})}else{const l=this;return xd(function(...c){const u=l._def.args.safeParse(c,a);if(!u.success)throw new Wf([r(c,u.error)]);const d=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(d,a);if(!f.success)throw new Wf([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new o4({...this._def,args:nx.create(t).rest(Zw.create())})}returns(t){return new o4({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new o4({args:t||nx.create([]).rest(Zw.create()),returns:n||Zw.create(),typeName:ri.ZodFunction,..._i(r)})}}class _E extends Di{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}_E.create=(e,t)=>new _E({getter:e,typeName:ri.ZodLazy,..._i(t)});class kE extends Di{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return cs(n,{received:n.data,code:Wr.invalid_literal,expected:this._def.value}),ei}return{status:"valid",value:t.data}}get value(){return this._def.value}}kE.create=(e,t)=>new kE({value:e,typeName:ri.ZodLiteral,..._i(t)});function PPe(e,t){return new qy({values:e,typeName:ri.ZodEnum,..._i(t)})}class qy extends Di{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return cs(n,{expected:ua.joinValues(r),received:n.parsedType,code:Wr.invalid_type}),ei}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return cs(n,{received:n.data,code:Wr.invalid_enum_value,options:r}),ei}return xd(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return qy.create(t,{...this._def,...n})}exclude(t,n=this._def){return qy.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}qy.create=PPe;class TE extends Di{_parse(t){const n=ua.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ys.string&&r.parsedType!==ys.number){const s=ua.objectValues(n);return cs(r,{expected:ua.joinValues(s),received:r.parsedType,code:Wr.invalid_type}),ei}if(this._cache||(this._cache=new Set(ua.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=ua.objectValues(n);return cs(r,{received:r.data,code:Wr.invalid_enum_value,options:s}),ei}return xd(t.data)}get enum(){return this._def.values}}TE.create=(e,t)=>new TE({values:e,typeName:ri.ZodNativeEnum,..._i(t)});class eN extends Di{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ys.promise&&n.common.async===!1)return cs(n,{code:Wr.invalid_type,expected:ys.promise,received:n.parsedType}),ei;const r=n.parsedType===ys.promise?n.data:Promise.resolve(n.data);return xd(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}eN.create=(e,t)=>new eN({type:e,typeName:ri.ZodPromise,..._i(t)});class bm extends Di{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ri.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{cs(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return ei;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?ei:c.status==="dirty"||n.value==="dirty"?MC(c.value):c});{if(n.value==="aborted")return ei;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?ei:l.status==="dirty"||n.value==="dirty"?MC(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?ei:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?ei:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!M3(o))return ei;const l=s.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>M3(o)?Promise.resolve(s.transform(o.value,a)).then(l=>({status:n.value,value:l})):ei);ua.assertNever(s)}}bm.create=(e,t,n)=>new bm({schema:e,typeName:ri.ZodEffects,effect:t,..._i(n)});bm.createWithPreprocess=(e,t,n)=>new bm({schema:t,effect:{type:"preprocess",transform:e},typeName:ri.ZodEffects,..._i(n)});class B0 extends Di{_parse(t){return this._getType(t)===ys.undefined?xd(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}B0.create=(e,t)=>new B0({innerType:e,typeName:ri.ZodOptional,..._i(t)});class Gy extends Di{_parse(t){return this._getType(t)===ys.null?xd(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gy.create=(e,t)=>new Gy({innerType:e,typeName:ri.ZodNullable,..._i(t)});class IE extends Di{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ys.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}IE.create=(e,t)=>new IE({innerType:e,typeName:ri.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._i(t)});class PE extends Di{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return wE(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Wf(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wf(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}PE.create=(e,t)=>new PE({innerType:e,typeName:ri.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._i(t)});class rR extends Di{_parse(t){if(this._getType(t)!==ys.nan){const r=this._getOrReturnCtx(t);return cs(r,{code:Wr.invalid_type,expected:ys.nan,received:r.parsedType}),ei}return{status:"valid",value:t.data}}}rR.create=e=>new rR({typeName:ri.ZodNaN,..._i(e)});const WAt=Symbol("zod_brand");class Gae extends Di{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Qk extends Di{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?ei:a.status==="dirty"?(n.dirty(),MC(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ei:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new Qk({in:t,out:n,typeName:ri.ZodPipeline})}}class FE extends Di{_parse(t){const n=this._def.innerType._parse(t),r=s=>(M3(s)&&(s.value=Object.freeze(s.value)),s);return wE(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}FE.create=(e,t)=>new FE({innerType:e,typeName:ri.ZodReadonly,..._i(t)});function Jxe(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function FPe(e,t={},n){return e?JS.create().superRefine((r,s)=>{const a=e(r);if(a instanceof Promise)return a.then(o=>{if(!o){const l=Jxe(t,r),c=l.fatal??n??!0;s.addIssue({code:"custom",...l,fatal:c})}});if(!a){const o=Jxe(t,r),l=o.fatal??n??!0;s.addIssue({code:"custom",...o,fatal:l})}}):JS.create()}const qAt={object:Do.lazycreate};var ri;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ri||(ri={}));const GAt=(e,t={message:`Input not instance of ${e.name}`})=>FPe(n=>n instanceof e,t),OPe=am.create,MPe=Vy.create,KAt=rR.create,YAt=Wy.create,RPe=CE.create,XAt=R3.create,QAt=eR.create,ZAt=SE.create,JAt=NE.create,xee=JS.create,e8t=Zw.create,t8t=f1.create,n8t=tR.create,LPe=um.create,dO=Do.create,r8t=Do.strictCreate,DPe=AE.create,s8t=XB.create,i8t=jE.create,BPe=nx.create,a8t=EE.create,o8t=nR.create,l8t=L3.create,c8t=o4.create,u8t=_E.create,d8t=kE.create,f8t=qy.create,h8t=TE.create,p8t=eN.create,ege=bm.create,m8t=B0.create,x8t=Gy.create,g8t=bm.createWithPreprocess,b8t=Qk.create,y8t=()=>OPe().optional(),v8t=()=>MPe().optional(),w8t=()=>RPe().optional(),C8t={string:e=>am.create({...e,coerce:!0}),number:e=>Vy.create({...e,coerce:!0}),boolean:e=>CE.create({...e,coerce:!0}),bigint:e=>Wy.create({...e,coerce:!0}),date:e=>R3.create({...e,coerce:!0})},S8t=ei,tge=Object.freeze(Object.defineProperty({__proto__:null,BRAND:WAt,DIRTY:MC,EMPTY_PATH:SAt,INVALID:ei,NEVER:S8t,OK:xd,ParseStatus:Lu,Schema:Di,ZodAny:JS,ZodArray:um,ZodBigInt:Wy,ZodBoolean:CE,ZodBranded:Gae,ZodCatch:PE,ZodDate:R3,ZodDefault:IE,ZodDiscriminatedUnion:XB,ZodEffects:bm,ZodEnum:qy,ZodError:Wf,get ZodFirstPartyTypeKind(){return ri},ZodFunction:o4,ZodIntersection:jE,ZodIssueCode:Wr,ZodLazy:_E,ZodLiteral:kE,ZodMap:nR,ZodNaN:rR,ZodNativeEnum:TE,ZodNever:f1,ZodNull:NE,ZodNullable:Gy,ZodNumber:Vy,ZodObject:Do,ZodOptional:B0,ZodParsedType:ys,ZodPipeline:Qk,ZodPromise:eN,ZodReadonly:FE,ZodRecord:EE,ZodSchema:Di,ZodSet:L3,ZodString:am,ZodSymbol:eR,ZodTransformer:bm,ZodTuple:nx,ZodType:Di,ZodUndefined:SE,ZodUnion:AE,ZodUnknown:Zw,ZodVoid:tR,addIssueToContext:cs,any:xee,array:LPe,bigint:YAt,boolean:RPe,coerce:C8t,custom:FPe,date:XAt,datetimeRegex:IPe,defaultErrorMap:ZS,discriminatedUnion:s8t,effect:ege,enum:f8t,function:c8t,getErrorMap:ZM,getParsedType:fg,instanceof:GAt,intersection:i8t,isAborted:hee,isAsync:wE,isDirty:pee,isValid:M3,late:qAt,lazy:u8t,literal:d8t,makeIssue:JM,map:o8t,nan:KAt,nativeEnum:h8t,never:t8t,null:JAt,nullable:x8t,number:MPe,object:dO,get objectUtil(){return fee},oboolean:w8t,onumber:v8t,optional:m8t,ostring:y8t,pipeline:b8t,preprocess:g8t,promise:p8t,quotelessJson:wAt,record:a8t,set:l8t,setErrorMap:CAt,strictObject:r8t,string:OPe,symbol:QAt,transformer:ege,tuple:BPe,undefined:ZAt,union:DPe,unknown:e8t,get util(){return ua},void:n8t},Symbol.toStringTag,{value:"Module"})),N8t=e=>e.message?e.message:"unspecified error";class tN extends ci{constructor(t){super(),this.code=WSt,this.errors=t,super.message=`Web3 validator found ${t.length} error[s]:
${this._compileErrors().join(`
`)}`}_compileErrors(){return this.errors.map(N8t)}}const A8t=["bool","int","uint","bytes","string","address","tuple"],$Pe=e=>typeof e=="object"&&"type"in e&&"name"in e,Kae=e=>typeof e=="string",Aa=e=>typeof e=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e);function UPe(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/))}const sR=e=>typeof e=="number"||typeof e=="bigint"||typeof e=="string"&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(e);function Yae(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e.startsWith("0x")}const Xae=function(e){for(const[t,n]of Object.entries(e))if(n!==void 0&&n.length>0&&n[0]===0)throw new Error(`${t} cannot have leading zeroes, received: ${n.toString()}`)},j8t=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],f5=e=>{let t=e.replace(/ /,""),n,r=!1,s=[];if(e.includes("[")&&(t=t.slice(0,t.indexOf("[")),s=[...e.matchAll(/(?:\[(\d*)\])/g)].map(a=>parseInt(a[1],10)).map(a=>Number.isNaN(a)?-1:a),r=s.length>0),A8t.includes(t))return{baseType:t,isArray:r,baseTypeSize:n,arraySizes:s};if(t.startsWith("int"))n=parseInt(t.substring(3),10),t="int";else if(t.startsWith("uint"))n=parseInt(e.substring(4),10),t="uint";else if(t.startsWith("bytes"))n=parseInt(t.substring(5),10),t="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:s};return{baseType:t,isArray:r,baseTypeSize:n,arraySizes:s}},aV=(e,t={})=>{if(Object.keys(t).includes("type"))throw new tN([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);const{baseType:r,baseTypeSize:s}=f5(e);if(!r&&!j8t.includes(e))throw new tN([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(r){if(r==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${r}${s??""}`,required:!0}}return e?{format:e,required:!0}:{}},iR=(e,t="/0")=>{const n={type:"array",items:[],maxItems:e.length,minItems:e.length};for(const[r,s]of e.entries()){let a,o,l=[];$Pe(s)?(a=s.type,o=s.name||`${t}/${r}`,l=s.components):typeof s=="string"?(a=s,o=`${t}/${r}`):Array.isArray(s)&&(s[0]&&typeof s[0]=="string"&&s[0].startsWith("tuple")&&!Array.isArray(s[0])&&s[1]&&Array.isArray(s[1])?(a=s[0],o=`${t}/${r}`,l=s[1]):(a="tuple",o=`${t}/${r}`,l=s));const{baseType:c,isArray:u,arraySizes:d}=f5(a);let f,x=n;for(let g=d.length-1;g>0;g-=1)f={type:"array",$id:o,items:[],maxItems:d[g],minItems:d[g]},d[g]<0&&(delete f.maxItems,delete f.minItems),Array.isArray(x.items)?x.items.length===0?x.items=[f]:x.items.push(f):x.items=[x.items,f],x=f;if(c==="tuple"&&!u){const g=iR(l,o);g.$id=o,x.items.push(g)}else if(c==="tuple"&&u){const g=d[0],v=Object.assign({type:"array",$id:o,items:iR(l,o)},g>=0&&{minItems:g,maxItems:g});x.items.push(v)}else if(u){const g=d[0],v=Object.assign({type:"array",$id:o,items:aV(a)},g>=0&&{minItems:g,maxItems:g});x.items.push(v)}else Array.isArray(x.items)?x.items.push(Object.assign({$id:o},aV(a))):x.items.push(Object.assign({$id:o},aV(a)));x=n}return n},Qae=e=>iR(e),Zae=(e,t)=>t===1?e:Zae(e[0],t-1),Qj=(e,t,n)=>{const r=[];for(const[s,a]of e.entries()){let o,l,c=[];$Pe(a)?(o=a.type,l=a.name,c=a.components):typeof a=="string"?o=a:Array.isArray(a)&&(a[1]&&Array.isArray(a[1])?(o=a[0],c=a[1]):(o="tuple",c=a));const{baseType:u,isArray:d,arraySizes:f}=f5(o),x=Array.isArray(t)?t[s]:t[l];if(u==="tuple"&&!d)r.push(Qj(c,x,n));else if(u==="tuple"&&d){const g=[];for(const v of x)if(f.length>1){const w=Zae(v,f.length-1),C=[];for(const N of w)C.push(Qj(c,N,n));g.push(C)}else g.push(Qj(c,v,n));r.push(g)}else r.push(x)}return n=n??[],n.push(...r),n},zPe=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error(`Invalid code point: ${e}`)},QB=e=>{if(!Aa(e))throw new Error("Invalid hex string");const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=BigInt(n);return r>Number.MAX_SAFE_INTEGER?t?-r:r:r<Number.MIN_SAFE_INTEGER?r:t?-1*Number(r):Number(r)},ZB=e=>{if((typeof e=="number"||typeof e=="bigint")&&e<0)return`-0x${e.toString(16).slice(1)}`;if((typeof e=="number"||typeof e=="bigint")&&e>=0)return`0x${e.toString(16)}`;if(typeof e=="string"&&Aa(e)){const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=n.split(/^(-)?0(x|X)/).slice(-1)[0];return`${t?"-":""}0x${r.replace(/^0+/,"").toLowerCase()}`}if(typeof e=="string"&&!Aa(e))return ZB(BigInt(e));throw new $ae(e)},aR=(e,t,n="0")=>{if(typeof e=="string"&&!Aa(e))return e.padStart(t,n);const r=typeof e=="string"&&Aa(e)?e:ZB(e),[s,a]=r.startsWith("-")?["-0x",r.slice(3)]:["0x",r.slice(2)];return`${s}${a.padStart(t,n)}`};function N1(e){let t="0x";for(const n of e){const r=n.toString(16);t+=r.length===1?`0${r}`:r}return t}const zx={zero:48,nine:57,A:65,F:70,a:97,f:102};function nge(e){if(e>=zx.zero&&e<=zx.nine)return e-zx.zero;if(e>=zx.A&&e<=zx.F)return e-(zx.A-10);if(e>=zx.a&&e<=zx.f)return e-(zx.a-10)}function h5(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new a4(`hex string has odd length: ${e}`);const n=(e.length-t)/2,r=new Uint8Array(n);for(let s=0,a=t;s<n;s+=1){const o=nge(e.charCodeAt(a++)),l=nge(e.charCodeAt(a++));if(o===void 0||l===void 0)throw new a4(`Invalid byte sequence ("${e[a-2]}${e[a-1]}" in "${e}").`);r[s]=o*16+l}return r}function JB(e){var t;return!(e instanceof Uint8Array)&&((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"?Uint8Array.from(e):e}const HPe=Object.freeze(Object.defineProperty({__proto__:null,abiSchemaToJsonSchema:iR,codePointToInt:zPe,ensureIfUint8Array:JB,ethAbiToJsonSchema:Qae,fetchArrayElement:Zae,hexToNumber:QB,hexToUint8Array:h5,numberToHex:ZB,padLeft:aR,parseBaseType:f5,transformJsonDataToAbiFormat:Qj,uint8ArrayToHexString:N1},Symbol.toStringTag,{value:"Module"})),gee=e=>{var t,n;return e instanceof Uint8Array||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="Buffer"},c2=(e,t={abiType:"bytes"})=>{if(typeof e!="string"&&!Array.isArray(e)&&!gee(e)||typeof e=="string"&&Aa(e)&&e.startsWith("-")||typeof e=="string"&&!Aa(e))return!1;let n;if(typeof e=="string"){if(e.length%2!==0)return!1;n=h5(e)}else if(Array.isArray(e)){if(e.some(r=>r<0||r>255||!Number.isInteger(r)))return!1;n=new Uint8Array(e)}else n=e;if(t!=null&&t.abiType){const{baseTypeSize:r}=f5(t.abiType);return r?n.length===r:!0}return t!=null&&t.size?n.length===(t==null?void 0:t.size):!0},VPe=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const t=e.slice(2),n=XS(t.toLowerCase()),r=N1(od(JB(n))).slice(2);for(let s=0;s<40;s+=1)if(parseInt(r[s],16)>7&&t[s].toUpperCase()!==t[s]||parseInt(r[s],16)<=7&&t[s].toLowerCase()!==t[s])return!1;return!0},Kf=(e,t=!0)=>{if(typeof e!="string"&&!gee(e))return!1;let n;return gee(e)?n=N1(e):typeof e=="string"&&!Aa(e)?n=e.toLowerCase().startsWith("0x")?e:`0x${e}`:n=e,/^(0x)?[0-9a-f]{40}$/i.test(n)?/^(0x|0X)?[0-9a-f]{40}$/.test(n)||/^(0x|0X)?[0-9A-F]{40}$/.test(n)?!0:t?VPe(n):!0:!1},D3=(e,t)=>{if(t===BigInt(0))return BigInt(1);let n=e;for(let r=1;r<t;r+=1)n*=e;return n},h1=(e,t={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="string"&&e.length===0)return!1;let n;if(t!=null&&t.abiType){const{baseTypeSize:s}=f5(t.abiType);s&&(n=s)}else t.bitSize&&(n=t.bitSize);const r=D3(BigInt(2),BigInt(n??256))-BigInt(1);try{const s=typeof e=="string"&&Aa(e)?BigInt(QB(e)):BigInt(e);return s>=0&&s<=r}catch{return!1}},OE=(e,t={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="number"&&e>Number.MAX_SAFE_INTEGER)return!1;let n;if(t!=null&&t.abiType){const{baseTypeSize:a,baseType:o}=f5(t.abiType);if(o!=="int")return!1;a&&(n=a)}else t.bitSize&&(n=t.bitSize);const r=D3(BigInt(2),BigInt((n??256)-1)),s=BigInt(-1)*D3(BigInt(2),BigInt((n??256)-1));try{const a=typeof e=="string"&&Aa(e)?BigInt(QB(e)):BigInt(e);return a>=s&&a<=r}catch{return!1}},WPe=e=>!!(OE(e)||typeof e=="string"&&/[0-9.]/.test(e)&&e.indexOf(".")===e.lastIndexOf(".")||typeof e=="number"),qPe=e=>h1(e),Oc=e=>Object.values(Tg).includes(e),bee=e=>Oc(e)||qPe(e),MA=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(e)||/^(0x)?[0-9A-F]{512}$/.test(e)),e$=(e,t)=>{if(typeof t=="string"&&!Aa(t)||!MA(e))return!1;const n=typeof t=="string"?h5(t):t,r=N1(od(n)).slice(2);for(let s=0;s<12;s+=4){const a=(parseInt(r.slice(s,s+2),16)<<8)+parseInt(r.slice(s+2,s+4),16)&2047,o=zPe(e.charCodeAt(e.length-1-Math.floor(a/4))),l=1<<a%4;if((o&l)!==l)return!1}return!0},E8t=(e,t)=>{if(!MA(e)||!Kf(t))return!1;const n=aR(t,64);return e$(e,n)},_8t=(e,t)=>!MA(e)||!Kf(t)?!1:e$(e,t),k8t=e=>["number","string","boolean"].includes(typeof e)?typeof e=="boolean"?!0:typeof e=="string"&&!Aa(e)?e==="1"||e==="0":typeof e=="string"&&Aa(e)?e==="0x1"||e==="0x0":e===1||e===0:!1,dr=e=>e==null,nN=e=>typeof e=="object"&&!dr(e)&&!Array.isArray(e)&&!(e instanceof Dae),oR=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(e)||/^(0x)?[0-9A-F]{64}$/.test(e)),T8t=(e,t)=>!MA(e)||!oR(t)?!1:e$(e,t),I8t=e=>{const t=["fromBlock","toBlock","address","topics","blockHash"];if(dr(e)||typeof e!="object"||!Object.keys(e).every(n=>t.includes(n))||!dr(e.fromBlock)&&!bee(e.fromBlock)||!dr(e.toBlock)&&!bee(e.toBlock))return!1;if(!dr(e.address)){if(Array.isArray(e.address)){if(!e.address.every(n=>Kf(n)))return!1}else if(!Kf(e.address))return!1}return!(!dr(e.topics)&&!e.topics.every(n=>dr(n)?!0:Array.isArray(n)?n.every(r=>oR(r)):!!oR(n)))},B3={address:e=>Kf(e),bloom:e=>MA(e),blockNumber:e=>qPe(e),blockTag:e=>Oc(e),blockNumberOrTag:e=>bee(e),bool:e=>k8t(e),bytes:e=>c2(e),filter:e=>I8t(e),hex:e=>Aa(e),uint:e=>h1(e),int:e=>OE(e),number:e=>WPe(e),string:e=>Kae(e)};for(let e=8;e<=256;e+=8)B3[`int${e}`]=t=>OE(t,{bitSize:e}),B3[`uint${e}`]=t=>h1(t,{bitSize:e});for(let e=1;e<=32;e+=1)B3[`bytes${e}`]=t=>c2(t,{size:e});B3.bytes256=B3.bytes;const wj=e=>{if((!(e!=null&&e.type)||(e==null?void 0:e.type)==="object")&&(e!=null&&e.properties)){const t={};for(const n of Object.keys(e.properties)){const r=wj(e.properties[n]);r&&(t[n]=r)}return Array.isArray(e.required)?dO(t).partial().required(e.required.reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:!0}),{})):dO(t).partial()}if((e==null?void 0:e.type)==="array"&&(e!=null&&e.items)){if(Array.isArray(e.items)&&e.items.length>1&&e.maxItems!==void 0&&new Set(e.items.map(r=>r.$id)).size===e.items.length){const r=[];for(const s of e.items){const a=wj(s);a&&r.push(a)}return BPe(r)}const t=Array.isArray(e.items)?e.items[0]:e.items;let n=LPe(wj(t));return n=e.minItems!==void 0?n.min(e.minItems):n,n=e.maxItems!==void 0?n.max(e.maxItems):n,n}if(e.oneOf&&Array.isArray(e.oneOf))return DPe(e.oneOf.map(t=>wj(t)));if(e!=null&&e.format){if(!B3[e.format])throw new JNt(e.format);return xee().refine(B3[e.format],t=>({params:{value:t,format:e.format}}))}return e!=null&&e.type&&(e==null?void 0:e.type)!=="object"&&typeof tge[String(e.type)]=="function"?tge[String(e.type)]():dO({data:xee()}).partial()};class RC{static factory(){return RC.validatorInstance||(RC.validatorInstance=new RC),RC.validatorInstance}validate(t,n,r){var s,a;const l=wj(t).safeParse(n);if(!l.success){const c=this.convertErrors((a=(s=l.error)===null||s===void 0?void 0:s.issues)!==null&&a!==void 0?a:[]);if(c){if(r!=null&&r.silent)return c;throw new tN(c)}}}convertErrors(t){if(t&&Array.isArray(t)&&t.length>0)return t.map(n=>{var r;let s,a,o,l;l=n.path.join("/");const c=String(n.path[n.path.length-1]),u=n.path.join("/");if(n.code===Wr.too_big)a="maxItems",l=`${u}/maxItems`,o={limit:n.maximum},s=`must NOT have more than ${n.maximum} items`;else if(n.code===Wr.too_small)a="minItems",l=`${u}/minItems`,o={limit:n.minimum},s=`must NOT have fewer than ${n.minimum} items`;else if(n.code===Wr.custom){const{value:d,format:f}=(r=n.params)!==null&&r!==void 0?r:{};typeof d>"u"?s=`value at "/${l}" is required`:s=`value "${typeof d=="object"?JSON.stringify(d):d}" at "/${l}" must pass "${f}" validation`,o={value:d}}return{keyword:a??c,instancePath:u?`/${u}`:"",schemaPath:l?`#${l}`:"#",params:o??{value:n.message},message:s??n.message}})}}class P8t{constructor(){this._validator=RC.factory()}validateJSONSchema(t,n,r){return this._validator.validate(t,n,r)}validate(t,n,r={silent:!1}){var s,a;const o=Qae(t);if(!(Array.isArray(o.items)&&((s=o.items)===null||s===void 0?void 0:s.length)===0&&n.length===0)){if(Array.isArray(o.items)&&((a=o.items)===null||a===void 0?void 0:a.length)===0&&n.length!==0)throw new tN([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:n}]);return this._validator.validate(o,n,r)}}}const Vs=new P8t;function u2(e){var t,n;return e instanceof Uint8Array||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="Buffer"}function gd(...e){const t=e.reduce((s,a)=>s+a.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function t$(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return!1;return!0}const n$={noether:BigInt(0),wei:BigInt(1),kwei:BigInt(1e3),Kwei:BigInt(1e3),babbage:BigInt(1e3),femtoether:BigInt(1e3),mwei:BigInt(1e6),Mwei:BigInt(1e6),lovelace:BigInt(1e6),picoether:BigInt(1e6),gwei:BigInt(1e9),Gwei:BigInt(1e9),shannon:BigInt(1e9),nanoether:BigInt(1e9),nano:BigInt(1e9),szabo:BigInt(1e12),microether:BigInt(1e12),micro:BigInt(1e12),finney:BigInt(1e15),milliether:BigInt(1e15),milli:BigInt(1e15),ether:BigInt("1000000000000000000"),kether:BigInt("1000000000000000000000"),grand:BigInt("1000000000000000000000"),mether:BigInt("1000000000000000000000000"),gether:BigInt("1000000000000000000000000000"),tether:BigInt("1000000000000000000000000000000")},yee="Warning: Using type `number` with values that are large or contain many decimals may cause loss of precision, it is recommended to use type `string` or `BigInt` when using conversion methods",rx=e=>{if(Vs.validate(["bytes"],[e]),u2(e))return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="string")return h5(e);throw new a4(e)},{uint8ArrayToHexString:F8t}=HPe,Vi=e=>F8t(rx(e)),oo=e=>typeof e=="string"&&e.slice(0,2).toLowerCase()!=="0x"?rx(`0x${e}`):rx(e),Zk=e=>(Vs.validate(["hex"],[e]),QB(e)),O8t=Zk,nc=(e,t)=>{typeof e!="bigint"&&Vs.validate(["int"],[e]);let n=ZB(e);return t&&(!n.startsWith("-")&&n.length%2===1?n="0x0".concat(n.slice(2)):n.length%2===0&&n.startsWith("-")&&(n="-0x0".concat(n.slice(3)))),n},M8t=nc,R8t=e=>Zk(e).toString(),ym=e=>{Vs.validate(["string"],[e]);let t=e.replace(/^(?:\u0000)/,"");return t=t.replace(/(?:\u0000)$/,""),Vi(new TextEncoder().encode(t))},GPe=ym,L8t=ym,r$=e=>EPe(oo(e)),D8t=e=>typeof e=="string"?r$(e):(Vs.validate(["bytes"],[e]),EPe(e)),Jae=XS,B8t=r$,KPe=e=>{Vs.validate(["string"],[e]);let t="";for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n).toString(16);t+=r.length%2!==0?`0${r}`:r}return`0x${t}`},$8t=KPe,YPe=e=>new TextDecoder("ascii").decode(oo(e)),U8t=YPe,p1=(e,t)=>{if(typeof e=="string"&&Kf(e))return t?"address":`0x${e.toLowerCase().replace(/^0x/i,"")}`;if(typeof e=="boolean")return t?"bool":e?"0x01":"0x00";if(typeof e=="number")return t?e<0?"int256":"uint256":nc(e);if(typeof e=="bigint")return t?"bigint":nc(e);if(u2(e))return t?"bytes":Vi(e);if(typeof e=="object"&&e)return t?"string":ym(JSON.stringify(e));if(typeof e=="string"){if(e.startsWith("-0x")||e.startsWith("-0X"))return t?"int256":nc(e);if(Aa(e))return t?"bytes":e;if(sR(e)&&!OE(e)&&!h1(e))return t?"bytes":`0x${e}`;if(sR(e)&&!OE(e)&&h1(e))return t?"uint":nc(e);if(!Number.isFinite(e))return t?"string":ym(e)}throw new RNt(e)},Xd=e=>{if(typeof e=="number")return e>1e20?(console.warn(yee),BigInt(e)):e;if(typeof e=="bigint")return e>=Number.MIN_SAFE_INTEGER&&e<=Number.MAX_SAFE_INTEGER?Number(e):e;if(typeof e=="string"&&Aa(e))return Zk(e);try{return Xd(BigInt(e))}catch{throw new $ae(e)}},Yv=e=>{if(typeof e=="number")return BigInt(e);if(typeof e=="bigint")return e;if(typeof e=="string"&&sR(e))return e.startsWith("-")?-BigInt(e.substring(1)):BigInt(e);throw new $ae(e)},z8t=(e,t)=>{let n;if(typeof t=="string"){if(n=n$[t],!n)throw new xPe(t)}else{if(t<0||!Number.isInteger(t))throw new gPe(t);n=D3(BigInt(10),BigInt(t))}const r=String(Xd(e)),s=n.toString().length-1;if(s<=0)return r.toString();const a=r.padStart(s,"0"),o=a.slice(0,-s),l=a.slice(-s).replace(/\.?0+$/,"");return o===""?l?`0.${l}`:"0":l===""?o:`${o}.${l}`.slice(0,o.length+s+1)},H8t=(e,t)=>{Vs.validate(["number"],[e]);let n;if(typeof t=="string"){if(n=n$[t],!n)throw new xPe(t)}else{if(t<0||!Number.isInteger(t))throw new gPe(t);n=D3(BigInt(10),BigInt(t))}let r=e;typeof r=="number"&&(r<1e-15&&console.warn(yee),r>1e20?(console.warn(yee),r=BigInt(r)):r=r.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20}));const[s,a]=String(typeof r=="string"&&!Aa(r)?r:Xd(r)).split(".").concat(""),l=BigInt(`${s}${a}`)*n,c=a.length;return c===0?l.toString():l.toString().slice(0,-c)},fx=e=>{if(!Kf(e,!1))throw new Uae(e);const t=e.toLowerCase().replace(/^0x/i,""),n=N1(od(JB(Jae(t))));if(dr(n)||n==="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")return"";let r="0x";const s=n.replace(/^0x/i,"");for(let a=0;a<t.length;a+=1)parseInt(s[a],16)>7?r+=t[a].toUpperCase():r+=t[a];return r},XPe=e=>{if(typeof e=="boolean")return e;if(typeof e=="number"&&(e===0||e===1)||typeof e=="bigint"&&(e===BigInt(0)||e===BigInt(1)))return!!e;if(typeof e=="string"&&!Aa(e)&&(e==="1"||e==="0"||e==="false"||e==="true"))return e==="true"?!0:e==="false"?!1:!!Number(e);if(typeof e=="string"&&Aa(e)&&(e==="0x1"||e==="0x0"))return!!Xd(e);throw new zae(e)};let eoe=class extends Die{constructor(){super(...arguments),this.maxListeners=Number.MAX_SAFE_INTEGER}setMaxListeners(t){return this.maxListeners=t,this}getMaxListeners(){return this.maxListeners}};const V8t=Aa,W8t=sR,q8t=VPe,G8t=Kf,K8t=MA,Y8t=e$,X8t=E8t,Q8t=_8t,Z8t=oR,J8t=T8t,e7t=(e,t)=>{const n=typeof e=="string"&&Oc(e),r=typeof t=="string"&&Oc(t);if(e===t||(e==="earliest"||e===0)&&(t==="earliest"||t===0))return 0;if(e==="earliest")return-1;if(t==="earliest")return 1;if(n&&r){const o={[Tg.EARLIEST]:1,[Tg.FINALIZED]:2,[Tg.SAFE]:3,[Tg.LATEST]:4,[Tg.PENDING]:5};return o[e]<o[t]?-1:1}if(n&&!r||!n&&r)throw new DNt("Cannot compare blocktag with provided non-blocktag input.");const s=BigInt(e),a=BigInt(t);return s<a?-1:s===a?0:1},py=e=>typeof e=="object"&&!dr(e)&&Object.keys(e).length!==0&&["input","data","from","gas","gasPrice","gasLimit","address","jsonInterface","syncWithContext","dataInputFill"].some(t=>t in e),Js=dr,rge=e=>typeof e=="object"&&!dr(e)&&!Array.isArray(e)&&!(e instanceof Dae),d2=(e,...t)=>{if(!rge(e))return e;const n=Object.assign({},e);for(const r of t)for(const s in r)rge(r[s])?(n[s]||(n[s]={}),n[s]=d2(n[s],r[s])):!dr(r[s])&&Object.hasOwnProperty.call(r,s)&&(Array.isArray(r[s])||r[s]instanceof Dae?n[s]=r[s].slice(0):n[s]=r[s]);return n},rN=(e,t,n="0")=>typeof e=="string"?Aa(e)?aR(e,t,n):e.padStart(t,n):(Vs.validate(["int"],[e]),aR(e,t,n)),QPe=(e,t,n="0")=>{if(typeof e=="string"&&!Aa(e))return e.padEnd(t,n);const r=typeof e=="string"&&Aa(e)?e:nc(e),s=r.startsWith("-")?3:2;return Vs.validate([r.startsWith("-")?"int":"uint"],[e]),r.padEnd(t+s,n)},ZPe=QPe,ME=rN,JPe=(e,t=64)=>{Vs.validate(["int"],[e]);const n=Xd(e);if(n>=0)return rN(p1(n),t);const r=D3(BigInt(2),BigInt(t*4));if(-n>=r)throw new bPe(`value: ${e}, nibbleWidth: ${t}`);const a=BigInt(n)+r;return rN(nc(a),t)},t7t=(e,t=64)=>{Vs.validate(["int"],[e]);const n=Xd(e);if(n<0)return n;const r=Math.ceil(Math.log(Number(n))/Math.log(2));if(r>t*4)throw new bPe(`value: "${e}", nibbleWidth: "${t}"`);if(t*4!==r)return n;const s=D3(BigInt(2),BigInt(t)*BigInt(4));return Xd(BigInt(n)-s)},{parseBaseType:n7t}=HPe,hg=e=>typeof e=="object"&&!dr(e)&&"number"in e&&"bytes"in e,r7t=(e,t,n=[])=>{let r=Object.assign({},e),s;for(const a of t){if(r.oneOf&&s){const o=s,l=n.find(([c])=>c===o);l&&l[0]===s&&(r=r.oneOf[l[1]])}if(!r.properties&&!r.items)return;r.properties?r=r.properties[a]:r.items&&r.items.properties?r=r.items.properties[a]:r.items&&nN(r.items)?r=r.items:r.items&&Array.isArray(r.items)&&(r=r.items[parseInt(a,10)]),r&&a&&(s=a)}return r},RE=(e,t,n)=>{try{const{baseType:r,baseTypeSize:s}=n7t(t);if(r==="int"||r==="uint")switch(n.number){case Qh.NUMBER:return Number(Yv(e));case Qh.HEX:return nc(Yv(e));case Qh.STR:return Yv(e).toString();case Qh.BIGINT:return Yv(e);default:throw new cee(`Invalid format: ${String(n.number)}`)}if(r==="bytes"){let a;switch(s?typeof e=="string"?a=rN(e,s*2):u2(e)&&(a=gd(new Uint8Array(s-e.length),e)):a=e,n.bytes){case d1.HEX:return Vi(rx(a));case d1.UINT8ARRAY:return rx(a);default:throw new cee(`Invalid format: ${String(n.bytes)}`)}}if(r==="string")return String(e)}catch{return e}return e},sge=({value:e,schemaProp:t,schema:n,object:r,key:s,dataPath:a,format:o,oneOfPath:l=[]})=>{var c,u;if(Array.isArray(e)){let d=t;if((t==null?void 0:t.oneOf)!==void 0&&t.oneOf.forEach((f,x)=>{var g,v;!Array.isArray(t==null?void 0:t.items)&&(typeof e[0]=="object"&&((g=f==null?void 0:f.items)===null||g===void 0?void 0:g.type)==="object"||typeof e[0]=="string"&&((v=f==null?void 0:f.items)===null||v===void 0?void 0:v.type)!=="object")&&(d=f,l.push([s,x]))}),dr(d==null?void 0:d.items))return delete r[s],a.pop(),!0;if(nN(d.items)&&!dr(d.items.format)){for(let f=0;f<e.length;f+=1)r[s][f]=RE(e[f],(c=d==null?void 0:d.items)===null||c===void 0?void 0:c.format,o);return a.pop(),!0}if(!Array.isArray(d==null?void 0:d.items)&&((u=d==null?void 0:d.items)===null||u===void 0?void 0:u.type)==="object"){for(const f of e)s$(f,n,a,o,l);return a.pop(),!0}if(Array.isArray(d==null?void 0:d.items)){for(let f=0;f<e.length;f+=1)r[s][f]=RE(e[f],d.items[f].format,o);return a.pop(),!0}}return!1},s$=(e,t,n,r,s=[])=>{var a;if(!nN(e)&&!Array.isArray(e))return RE(e,t==null?void 0:t.format,r);const o=e;if(Array.isArray(o)&&(t==null?void 0:t.type)==="array"&&((a=t==null?void 0:t.items)===null||a===void 0?void 0:a.type)==="object")sge({value:o,schemaProp:t,schema:t,object:o,key:"",dataPath:n,format:r,oneOfPath:s});else for(const[l,c]of Object.entries(o)){n.push(l);let u=r7t(t,n,s);if(dr(u)){delete o[l],n.pop();continue}if(nN(c)){s$(c,t,n,r,s),n.pop();continue}if(!sge({value:c,schemaProp:u,schema:t,object:o,key:l,dataPath:n,format:r,oneOfPath:s})){if((u==null?void 0:u.format)===void 0&&(u==null?void 0:u.oneOf)!==void 0){for(const[d,f]of u.oneOf.entries())if((f==null?void 0:f.format)!==void 0){u=f;break}}o[l]=RE(c,u.format,r),n.pop()}}return o},Vr=(e,t,n=dd)=>{let r;nN(t)?r=d2({},t):Array.isArray(t)?r=[...t]:r=t;const s=nN(e)?e:Qae(e);if(!s.properties&&!s.items&&!s.format)throw new cee("Invalid json schema for formatting");return s$(r,s,[],n)},eFe="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",sN=e=>{let t;return typeof e=="bigint"||typeof e=="number"?t=XS(e.toString()):Array.isArray(e)?t=new Uint8Array(e):typeof e=="string"&&!Aa(e)?t=XS(e):t=rx(e),Vi(od(JB(t)))},Jk=e=>{let t;typeof e=="string"?e.startsWith("0x")&&Aa(e)?t=oo(e):t=XS(e):t=e;const n=sN(t);return n===eFe?void 0:n},Yf=e=>{const t=Jk(e);return dr(t)?eFe:t},s7t=e=>{if(Array.isArray(e))throw new Error("Autodetection of array types is not supported.");let t,n;if(typeof e=="object"&&("t"in e||"type"in e)&&("v"in e||"value"in e))t="t"in e?e.t:e.type,n="v"in e?e.v:e.value,t=t.toLowerCase()==="bigint"?"int":t;else{if(typeof e=="bigint")return["int",e];t=p1(e,!0),n=p1(e),!t.startsWith("int")&&!t.startsWith("uint")&&(t="bytes")}return(t.startsWith("int")||t.startsWith("uint"))&&typeof n=="string"&&!/^(-)?0x/i.test(n)&&(n=Yv(n)),[t,n]},i7t=e=>e.startsWith("int[")?`int256${e.slice(3)}`:e==="int"?"int256":e.startsWith("uint[")?`uint256'${e.slice(4)}`:e==="uint"?"uint256":e,oV=(e,t)=>{const n=/^(\d+).*$/.exec(e.slice(t));return n?parseInt(n[1],10):0},ige=e=>e.toString(2).length,age=(e,t)=>{const n=t.toString();if(e==="string"){if(typeof t=="string")return ym(t);throw new MNt(t)}if(e==="bool"||e==="boolean"){if(typeof t=="boolean")return t?"01":"00";throw new zae(t)}if(e==="address"){if(!Kf(n))throw new Uae(n);return n}const r=i7t(e);if(e.startsWith("uint")){const s=oV(r,4);if(s%8||s<8||s>256)throw new Hxe(n);const a=Xd(n);if(ige(a)>s)throw new Vxe(n);if(a<BigInt(0))throw new LNt(n);return s?ME(a.toString(16),s/8*2):a.toString(16)}if(e.startsWith("int")){const s=oV(r,3);if(s%8||s<8||s>256)throw new Hxe(e);const a=Xd(n);if(ige(a)>s)throw new Vxe(n);return a<BigInt(0)?JPe(a.toString(),s/8*2):s?ME(a.toString(16),s/4):a.toString(16)}if(r==="bytes"){if(n.replace(/^0x/i,"").length%2!==0)throw new a4(n);return n}if(e.startsWith("bytes")){if(n.replace(/^0x/i,"").length%2!==0)throw new a4(n);const s=oV(e,5);if(!s||s<1||s>64||s<n.replace(/^0x/i,"").length/2)throw new a4(n);return ZPe(n,s*2)}return""},tFe=e=>{const[t,n]=s7t(e);return Array.isArray(n)?n.map(a=>age(t,a).replace("0x","")).join(""):age(t,n).replace("0x","")},toe=(...e)=>`0x${e.map(tFe).join("").toLowerCase()}`,a7t=(...e)=>Jk(toe(...e)),o7t=(...e)=>Yf(toe(...e)),l7t=e=>Jk(`0x${(typeof e=="number"?e.toString():e).padStart(64,"0")}`);function c7t(e){return SPe(e)}const LE=e=>c7t(e),u7t=e=>Vi(LE(e));var i$=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function nFe(e){return(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function rFe(e,t,n){return i$(this,void 0,void 0,function*(){let r;const s=yield Promise.race([e instanceof Promise?e:e(),new Promise((a,o)=>{r=setTimeout(()=>n?o(n):a(void 0),t)})]);if(r&&clearTimeout(r),s instanceof Error)throw s;return s})}function noe(e,t){let n;return[new Promise((s,a)=>{n=setInterval(function o(){return i$(this,void 0,void 0,function*(){try{const l=yield rFe(e,t);dr(l)||(clearInterval(n),s(l))}catch(l){clearInterval(n),a(l)}}),o}(),t)}),n]}function d7t(e,t){return i$(this,void 0,void 0,function*(){return noe(e,t)[0]})}function roe(e,t){let n;const r=new Promise((s,a)=>{n=setTimeout(()=>{a(t)},e)});return[n,r]}function sFe(e,t){let n;const r=new Promise((s,a)=>{n=setInterval(()=>{i$(this,void 0,void 0,function*(){const o=yield e();o&&(clearInterval(n),a(o))})},t)});return[n,r]}const soe=()=>{const e=LE(16);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Vi(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")},ioe=e=>{const t=e.error.code;return md.has(t)||t>=-32099&&t<=-32e3},jy=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&"result"in e&&dr(e.error)&&(typeof e.id=="number"||typeof e.id=="string"),Ey=e=>!Array.isArray(e)&&e.jsonrpc==="2.0"&&!!e&&dr(e.result)&&"error"in e&&(typeof e.id=="number"||typeof e.id=="string"),a$=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&!dr(e.params)&&!dr(e.method),iFe=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&"id"in e&&"result"in e,lR=e=>jy(e)||Ey(e),aoe=e=>Array.isArray(e)?e.every(lR):lR(e),DE=e=>Array.isArray(e)&&e.length>0&&aoe(e);let fO;const aFe=e=>{fO=e},$3=e=>{var t,n,r,s;return typeof fO<"u"&&(fO+=1),{jsonrpc:(t=e.jsonrpc)!==null&&t!==void 0?t:"2.0",id:(r=(n=e.id)!==null&&n!==void 0?n:fO)!==null&&r!==void 0?r:soe(),method:e.method,params:(s=e.params)!==null&&s!==void 0?s:void 0}},ooe=e=>e.map(t=>$3(t)),n0=e=>Array.isArray(e)&&e.length>0,f7t=Object.freeze(Object.defineProperty({__proto__:null,isBatchRequest:n0,isBatchResponse:DE,isResponseRpcError:ioe,isResponseWithError:Ey,isResponseWithNotification:a$,isResponseWithResult:jy,isSubscriptionResult:iFe,isValidResponse:aoe,setRequestIdStart:aFe,toBatchPayload:ooe,toPayload:$3,validateResponse:lR},Symbol.toStringTag,{value:"Module"}));var lV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},oFe;class cR{constructor({timeout:t,eagerStart:n,timeoutMessage:r}={timeout:0,eagerStart:!1,timeoutMessage:"DeferredPromise timed out"}){this[oFe]="Promise",this._state="pending",this._promise=new Promise((s,a)=>{this._resolve=s,this._reject=a}),this._timeoutMessage=r,this._timeoutInterval=t,n&&this.startTimer()}get state(){return this._state}then(t,n){return lV(this,void 0,void 0,function*(){return this._promise.then(t,n)})}catch(t){return lV(this,void 0,void 0,function*(){return this._promise.catch(t)})}finally(t){return lV(this,void 0,void 0,function*(){return this._promise.finally(t)})}resolve(t){this._resolve(t),this._state="fulfilled",this._clearTimeout()}reject(t){this._reject(t),this._state="rejected",this._clearTimeout()}startTimer(){this._timeoutInterval&&this._timeoutInterval>0&&(this._timeoutId=setTimeout(this._checkTimeout.bind(this),this._timeoutInterval))}_checkTimeout(){this._state==="pending"&&this._timeoutId&&this.reject(new lPe(this._timeoutMessage))}_clearTimeout(){this._timeoutId&&clearTimeout(this._timeoutId)}}oFe=Symbol.toStringTag;class lFe{constructor(t,n){this.eventEmitter=t,this.autoReconnect=n,this.chunkTimeout=1e3*15}clearQueues(){typeof this._clearQueues=="function"&&this._clearQueues()}onError(t){this._clearQueues=t}parseResponse(t){const n=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(s=>{let a=s;this.lastChunk&&(a=this.lastChunk+a);let o;try{o=JSON.parse(a)}catch{this.lastChunk=a,this.lastChunkTimeout&&clearTimeout(this.lastChunkTimeout),this.lastChunkTimeout=setTimeout(()=>{this.autoReconnect||(this.clearQueues(),this.eventEmitter.emit("error",new YB({id:1,jsonrpc:"2.0",error:{code:2,message:"Chunk timeout"}})))},this.chunkTimeout);return}clearTimeout(this.lastChunkTimeout),this.lastChunk=void 0,o&&n.push(o)}),n}}var oge=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class loe extends Yk{constructor(){super(...arguments),this._eventEmitter=new Die,this._chainId="",this._accounts=[]}_getChainId(){return oge(this,void 0,void 0,function*(){var t;const n=yield this.request($3({method:"eth_chainId",params:[]}));return(t=n==null?void 0:n.result)!==null&&t!==void 0?t:""})}_getAccounts(){return oge(this,void 0,void 0,function*(){var t;const n=yield this.request($3({method:"eth_accounts",params:[]}));return(t=n==null?void 0:n.result)!==null&&t!==void 0?t:[]})}_onConnect(){Promise.all([this._getChainId().then(t=>{t!==this._chainId&&(this._chainId=t,this._eventEmitter.emit("chainChanged",this._chainId))}).catch(t=>{console.error(t)}),this._getAccounts().then(t=>{this._accounts.length===t.length&&t.every(n=>t.includes(n))||(this._accounts=t,this._onAccountsChanged())}).catch(t=>{console.error(t)})]).then(()=>this._eventEmitter.emit("connect",{chainId:this._chainId})).catch(t=>{console.error(t)})}_onDisconnect(t,n){this._eventEmitter.emit("disconnect",new $Nt(t,n))}_onAccountsChanged(){this._eventEmitter.emit("accountsChanged",this._accounts)}}var cV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const h7t={autoReconnect:!0,delay:5e3,maxAttempts:5},p7t=1e3;class cFe extends loe{get SocketConnection(){return this._socketConnection}constructor(t,n,r){if(super(),this._connectionStatus="connecting",this._onMessageHandler=this._onMessage.bind(this),this._onOpenHandler=this._onConnect.bind(this),this._onCloseHandler=this._onCloseEvent.bind(this),this._onErrorHandler=this._onError.bind(this),!this._validateProviderPath(t))throw new uee(t);this._socketPath=t,this._socketOptions=n,this._reconnectOptions=Object.assign(Object.assign({},h7t),r??{}),this._pendingRequestsQueue=new Map,this._sentRequestsQueue=new Map,this._init(),this.connect(),this.chunkResponseParser=new lFe(this._eventEmitter,this._reconnectOptions.autoReconnect),this.chunkResponseParser.onError(()=>{this._clearQueues()}),this.isReconnecting=!1}_init(){this._reconnectAttempts=0}connect(){try{this._openSocketConnection(),this._connectionStatus="connecting",this._addSocketListeners()}catch(t){if(this.isReconnecting)setImmediate(()=>{this._reconnect()});else throw this._connectionStatus="disconnected",t&&t.message?new Xk(`Error while connecting to ${this._socketPath}. Reason: ${t.message}`):new uee(this._socketPath)}}_validateProviderPath(t){return!!t}getPendingRequestQueueSize(){return this._pendingRequestsQueue.size}getSentRequestsQueueSize(){return this._sentRequestsQueue.size}supportsSubscriptions(){return!0}on(t,n){this._eventEmitter.on(t,n)}once(t,n){this._eventEmitter.once(t,n)}removeListener(t,n){this._eventEmitter.removeListener(t,n)}_onDisconnect(t,n){this._connectionStatus="disconnected",super._onDisconnect(t,n)}disconnect(t,n){const r=t??p7t;this._removeSocketListeners(),this.getStatus()!=="disconnected"&&this._closeSocketConnection(r,n),this._onDisconnect(r,n)}safeDisconnect(t,n){return cV(this,arguments,void 0,function*(r,s,a=!1,o=1e3){let l=0;yield cV(this,void 0,void 0,function*(){return new Promise(u=>{const d=setInterval(()=>{a&&l>=5&&this.clearQueues(),this.getPendingRequestQueueSize()===0&&this.getSentRequestsQueueSize()===0&&(clearInterval(d),u(!0)),l+=1},o)})}),this.disconnect(r,s)})}removeAllListeners(t){this._eventEmitter.removeAllListeners(t)}_onError(t){this.isReconnecting?this._reconnect():this._eventEmitter.emit("error",t)}reset(){this._sentRequestsQueue.clear(),this._pendingRequestsQueue.clear(),this._init(),this._removeSocketListeners(),this._addSocketListeners()}_reconnect(){this.isReconnecting||(this.isReconnecting=!0,this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((t,n)=>{t.deferredPromise.reject(new tNt),this._sentRequestsQueue.delete(n)}),this._reconnectAttempts<this._reconnectOptions.maxAttempts?(this._reconnectAttempts+=1,setTimeout(()=>{this._removeSocketListeners(),this.connect(),this.isReconnecting=!1},this._reconnectOptions.delay)):(this.isReconnecting=!1,this._clearQueues(),this._removeSocketListeners(),this._eventEmitter.emit("error",new eNt(this._reconnectOptions.maxAttempts))))}request(t){return cV(this,void 0,void 0,function*(){if(Js(this._socketConnection))throw new Error("Connection is undefined");this.getStatus()==="disconnected"&&this.connect();const n=n0(t)?t[0].id:t.id;if(!n)throw new lNt("Request Id not defined");if(this._sentRequestsQueue.has(n))throw new nNt(n);const r=new cR;r.catch(a=>{this._eventEmitter.emit("error",a)});const s={payload:t,deferredPromise:r};if(this.getStatus()==="connecting")return this._pendingRequestsQueue.set(n,s),s.deferredPromise;this._sentRequestsQueue.set(n,s);try{this._sendToSocket(s.payload)}catch(a){this._sentRequestsQueue.delete(n),this._eventEmitter.emit("error",a)}return r})}_onConnect(){this._connectionStatus="connected",this._reconnectAttempts=0,super._onConnect(),this._sendPendingRequests()}_sendPendingRequests(){for(const[t,n]of this._pendingRequestsQueue.entries())try{this._sendToSocket(n.payload),this._pendingRequestsQueue.delete(t),this._sentRequestsQueue.set(t,n)}catch(r){this._pendingRequestsQueue.delete(t),this._eventEmitter.emit("error",r)}}_onMessage(t){const n=this._parseResponses(t);if(!(Js(n)||n.length===0))for(const r of n){if(a$(r)&&r.method.endsWith("_subscription")){this._eventEmitter.emit("message",r);return}const s=DE(r)?r[0].id:r.id,a=this._sentRequestsQueue.get(s);if(!a)return;(DE(r)||jy(r)||Ey(r))&&(this._eventEmitter.emit("message",r),a.deferredPromise.resolve(r)),this._sentRequestsQueue.delete(s)}}clearQueues(t){this._clearQueues(t)}_clearQueues(t){this._pendingRequestsQueue.size>0&&this._pendingRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new lee(t)),this._pendingRequestsQueue.delete(r)}),this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new lee(t)),this._sentRequestsQueue.delete(r)}),this._removeSocketListeners()}}const uFe=Object.freeze(Object.defineProperty({__proto__:null,ChunkResponseParser:lFe,Eip1193Provider:loe,EventEmitter:eoe,SocketProvider:cFe,Web3DeferredPromise:cR,asciiToHex:KPe,bytesToHex:Vi,bytesToUint8Array:rx,checkAddressCheckSum:q8t,compareBlockNumbers:e7t,convert:s$,convertScalarValue:RE,encodePacked:toe,ethUnitMap:n$,format:Vr,fromAscii:$8t,fromDecimal:M8t,fromTwosComplement:t7t,fromUtf8:GPe,fromWei:z8t,getStorageSlotNumForLongString:l7t,hexToAscii:YPe,hexToBytes:oo,hexToNumber:Zk,hexToNumberString:R8t,hexToString:B8t,hexToUtf8:r$,isAddress:G8t,isBatchRequest:n0,isBatchResponse:DE,isBloom:K8t,isContractAddressInBloom:Q8t,isContractInitOptions:py,isDataFormat:hg,isHex:W8t,isHexStrict:V8t,isInBloom:Y8t,isNullish:Js,isPromise:nFe,isResponseRpcError:ioe,isResponseWithError:Ey,isResponseWithNotification:a$,isResponseWithResult:jy,isSubscriptionResult:iFe,isTopic:Z8t,isTopicInBloom:J8t,isUint8Array:u2,isUserEthereumAddressInBloom:X8t,isValidResponse:aoe,jsonRpc:f7t,keccak256:sN,keccak256Wrapper:sN,leftPad:ME,mergeDeep:d2,numberToHex:nc,padLeft:rN,padRight:QPe,pollTillDefined:d7t,pollTillDefinedAndReturnIntervalId:noe,processSolidityEncodePackedArgs:tFe,randomBytes:LE,randomHex:u7t,rejectIfConditionAtInterval:sFe,rejectIfTimeout:roe,rightPad:ZPe,setRequestIdStart:aFe,sha3:Jk,sha3Raw:Yf,soliditySha3:a7t,soliditySha3Raw:o7t,stringToHex:L8t,toAscii:U8t,toBatchPayload:ooe,toBigInt:Yv,toBool:XPe,toChecksumAddress:fx,toDecimal:O8t,toHex:p1,toNumber:Xd,toPayload:$3,toTwosComplement:JPe,toUtf8:D8t,toWei:H8t,uint8ArrayConcat:gd,uint8ArrayEquals:t$,utf8ToBytes:Jae,utf8ToHex:ym,uuidV4:soe,validateResponse:lR,waitWithTimeout:rFe},Symbol.toStringTag,{value:"Module"}));class o${constructor(){this._emitter=new eoe}on(t,n){this._emitter.on(t,n)}once(t,n){this._emitter.once(t,n)}off(t,n){this._emitter.off(t,n)}emit(t,n){this._emitter.emit(t,n)}listenerCount(t){return this._emitter.listenerCount(t)}listeners(t){return this._emitter.listeners(t)}eventNames(){return this._emitter.eventNames()}removeAllListeners(){return this._emitter.removeAllListeners()}setMaxListenerWarningThreshold(t){this._emitter.setMaxListeners(t)}getMaxListeners(){return this._emitter.getMaxListeners()}}var U3;(function(e){e.CONFIG_CHANGE="CONFIG_CHANGE"})(U3||(U3={}));class m7t extends o${constructor(t){super(),this.config={handleRevert:!1,defaultAccount:void 0,defaultBlock:"latest",transactionBlockTimeout:50,transactionConfirmationBlocks:24,transactionPollingInterval:1e3,transactionPollingTimeout:750*1e3,transactionReceiptPollingInterval:void 0,transactionSendTimeout:750*1e3,transactionConfirmationPollingInterval:void 0,blockHeaderTimeout:10,maxListenersWarningThreshold:100,contractDataInputFill:"data",defaultNetworkId:void 0,defaultChain:"mainnet",defaultHardfork:"london",defaultCommon:void 0,defaultTransactionType:"0x2",defaultMaxPriorityFeePerGas:p1(25e8),enableExperimentalFeatures:{useSubscriptionWhenCheckingBlockTimeout:!1,useRpcCallSpecification:!1},transactionBuilder:void 0,transactionTypeParser:void 0,customTransactionSchema:void 0,defaultReturnFormat:dd,ignoreGasPricing:!1},this.setConfig(t??{})}setConfig(t){const n=Object.keys(t);for(const r of n)this._triggerConfigChange(r,t[r]),!Js(t[r])&&typeof t[r]=="number"&&r==="maxListenersWarningThreshold"&&this.setMaxListenerWarningThreshold(Number(t[r]));Object.assign(this.config,t)}get handleRevert(){return this.config.handleRevert}set handleRevert(t){this._triggerConfigChange("handleRevert",t),this.config.handleRevert=t}get contractDataInputFill(){return this.config.contractDataInputFill}set contractDataInputFill(t){this._triggerConfigChange("contractDataInputFill",t),this.config.contractDataInputFill=t}get defaultAccount(){return this.config.defaultAccount}set defaultAccount(t){this._triggerConfigChange("defaultAccount",t),this.config.defaultAccount=t}get defaultBlock(){return this.config.defaultBlock}set defaultBlock(t){this._triggerConfigChange("defaultBlock",t),this.config.defaultBlock=t}get transactionSendTimeout(){return this.config.transactionSendTimeout}set transactionSendTimeout(t){this._triggerConfigChange("transactionSendTimeout",t),this.config.transactionSendTimeout=t}get transactionBlockTimeout(){return this.config.transactionBlockTimeout}set transactionBlockTimeout(t){this._triggerConfigChange("transactionBlockTimeout",t),this.config.transactionBlockTimeout=t}get transactionConfirmationBlocks(){return this.config.transactionConfirmationBlocks}set transactionConfirmationBlocks(t){this._triggerConfigChange("transactionConfirmationBlocks",t),this.config.transactionConfirmationBlocks=t}get transactionPollingInterval(){return this.config.transactionPollingInterval}set transactionPollingInterval(t){this._triggerConfigChange("transactionPollingInterval",t),this.config.transactionPollingInterval=t,this.transactionReceiptPollingInterval=t,this.transactionConfirmationPollingInterval=t}get transactionPollingTimeout(){return this.config.transactionPollingTimeout}set transactionPollingTimeout(t){this._triggerConfigChange("transactionPollingTimeout",t),this.config.transactionPollingTimeout=t}get transactionReceiptPollingInterval(){return this.config.transactionReceiptPollingInterval}set transactionReceiptPollingInterval(t){this._triggerConfigChange("transactionReceiptPollingInterval",t),this.config.transactionReceiptPollingInterval=t}get transactionConfirmationPollingInterval(){return this.config.transactionConfirmationPollingInterval}set transactionConfirmationPollingInterval(t){this._triggerConfigChange("transactionConfirmationPollingInterval",t),this.config.transactionConfirmationPollingInterval=t}get blockHeaderTimeout(){return this.config.blockHeaderTimeout}set blockHeaderTimeout(t){this._triggerConfigChange("blockHeaderTimeout",t),this.config.blockHeaderTimeout=t}get enableExperimentalFeatures(){return this.config.enableExperimentalFeatures}set enableExperimentalFeatures(t){this._triggerConfigChange("enableExperimentalFeatures",t),this.config.enableExperimentalFeatures=t}get maxListenersWarningThreshold(){return this.config.maxListenersWarningThreshold}set maxListenersWarningThreshold(t){this._triggerConfigChange("maxListenersWarningThreshold",t),this.setMaxListenerWarningThreshold(t),this.config.maxListenersWarningThreshold=t}get defaultReturnFormat(){return this.config.defaultReturnFormat}set defaultReturnFormat(t){this._triggerConfigChange("defaultReturnFormat",t),this.config.defaultReturnFormat=t}get defaultNetworkId(){return this.config.defaultNetworkId}set defaultNetworkId(t){this._triggerConfigChange("defaultNetworkId",t),this.config.defaultNetworkId=t}get defaultChain(){return this.config.defaultChain}set defaultChain(t){if(!Js(this.config.defaultCommon)&&!Js(this.config.defaultCommon.baseChain)&&t!==this.config.defaultCommon.baseChain)throw new Gxe(this.config.defaultChain,t);this._triggerConfigChange("defaultChain",t),this.config.defaultChain=t}get defaultHardfork(){return this.config.defaultHardfork}set defaultHardfork(t){if(!Js(this.config.defaultCommon)&&!Js(this.config.defaultCommon.hardfork)&&t!==this.config.defaultCommon.hardfork)throw new qxe(this.config.defaultCommon.hardfork,t);this._triggerConfigChange("defaultHardfork",t),this.config.defaultHardfork=t}get defaultCommon(){return this.config.defaultCommon}set defaultCommon(t){if(!Js(this.config.defaultHardfork)&&!Js(t)&&!Js(t.hardfork)&&this.config.defaultHardfork!==t.hardfork)throw new qxe(this.config.defaultHardfork,t.hardfork);if(!Js(this.config.defaultChain)&&!Js(t)&&!Js(t.baseChain)&&this.config.defaultChain!==t.baseChain)throw new Gxe(this.config.defaultChain,t.baseChain);this._triggerConfigChange("defaultCommon",t),this.config.defaultCommon=t}get ignoreGasPricing(){return this.config.ignoreGasPricing}set ignoreGasPricing(t){this._triggerConfigChange("ignoreGasPricing",t),this.config.ignoreGasPricing=t}get defaultTransactionType(){return this.config.defaultTransactionType}set defaultTransactionType(t){this._triggerConfigChange("defaultTransactionType",t),this.config.defaultTransactionType=t}get defaultMaxPriorityFeePerGas(){return this.config.defaultMaxPriorityFeePerGas}set defaultMaxPriorityFeePerGas(t){this._triggerConfigChange("defaultMaxPriorityFeePerGas",t),this.config.defaultMaxPriorityFeePerGas=t}get transactionBuilder(){return this.config.transactionBuilder}set transactionBuilder(t){this._triggerConfigChange("transactionBuilder",t),this.config.transactionBuilder=t}get transactionTypeParser(){return this.config.transactionTypeParser}set transactionTypeParser(t){this._triggerConfigChange("transactionTypeParser",t),this.config.transactionTypeParser=t}get customTransactionSchema(){return this.config.customTransactionSchema}set customTransactionSchema(t){this._triggerConfigChange("customTransactionSchema",t),this.config.customTransactionSchema=t}_triggerConfigChange(t,n){this.emit(U3.CONFIG_CHANGE,{name:t,oldValue:this.config[t],newValue:n})}}var cP={exports:{}},lge;function x7t(){return lge||(lge=1,function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Tu<"u"&&Tu,r=function(){function a(){this.fetch=!1,this.DOMException=n.DOMException}return a.prototype=n,new a}();(function(a){(function(o){var l=typeof a<"u"&&a||typeof self<"u"&&self||typeof l<"u"&&l,c={searchParams:"URLSearchParams"in l,iterable:"Symbol"in l&&"iterator"in Symbol,blob:"FileReader"in l&&"Blob"in l&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in l,arrayBuffer:"ArrayBuffer"in l};function u(Y){return Y&&DataView.prototype.isPrototypeOf(Y)}if(c.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(Y){return Y&&d.indexOf(Object.prototype.toString.call(Y))>-1};function x(Y){if(typeof Y!="string"&&(Y=String(Y)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(Y)||Y==="")throw new TypeError('Invalid character in header field name: "'+Y+'"');return Y.toLowerCase()}function g(Y){return typeof Y!="string"&&(Y=String(Y)),Y}function v(Y){var ie={next:function(){var oe=Y.shift();return{done:oe===void 0,value:oe}}};return c.iterable&&(ie[Symbol.iterator]=function(){return ie}),ie}function w(Y){this.map={},Y instanceof w?Y.forEach(function(ie,oe){this.append(oe,ie)},this):Array.isArray(Y)?Y.forEach(function(ie){this.append(ie[0],ie[1])},this):Y&&Object.getOwnPropertyNames(Y).forEach(function(ie){this.append(ie,Y[ie])},this)}w.prototype.append=function(Y,ie){Y=x(Y),ie=g(ie);var oe=this.map[Y];this.map[Y]=oe?oe+", "+ie:ie},w.prototype.delete=function(Y){delete this.map[x(Y)]},w.prototype.get=function(Y){return Y=x(Y),this.has(Y)?this.map[Y]:null},w.prototype.has=function(Y){return this.map.hasOwnProperty(x(Y))},w.prototype.set=function(Y,ie){this.map[x(Y)]=g(ie)},w.prototype.forEach=function(Y,ie){for(var oe in this.map)this.map.hasOwnProperty(oe)&&Y.call(ie,this.map[oe],oe,this)},w.prototype.keys=function(){var Y=[];return this.forEach(function(ie,oe){Y.push(oe)}),v(Y)},w.prototype.values=function(){var Y=[];return this.forEach(function(ie){Y.push(ie)}),v(Y)},w.prototype.entries=function(){var Y=[];return this.forEach(function(ie,oe){Y.push([oe,ie])}),v(Y)},c.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function C(Y){if(Y.bodyUsed)return Promise.reject(new TypeError("Already read"));Y.bodyUsed=!0}function N(Y){return new Promise(function(ie,oe){Y.onload=function(){ie(Y.result)},Y.onerror=function(){oe(Y.error)}})}function I(Y){var ie=new FileReader,oe=N(ie);return ie.readAsArrayBuffer(Y),oe}function P(Y){var ie=new FileReader,oe=N(ie);return ie.readAsText(Y),oe}function R(Y){for(var ie=new Uint8Array(Y),oe=new Array(ie.length),G=0;G<ie.length;G++)oe[G]=String.fromCharCode(ie[G]);return oe.join("")}function F(Y){if(Y.slice)return Y.slice(0);var ie=new Uint8Array(Y.byteLength);return ie.set(new Uint8Array(Y)),ie.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(Y){this.bodyUsed=this.bodyUsed,this._bodyInit=Y,Y?typeof Y=="string"?this._bodyText=Y:c.blob&&Blob.prototype.isPrototypeOf(Y)?this._bodyBlob=Y:c.formData&&FormData.prototype.isPrototypeOf(Y)?this._bodyFormData=Y:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(Y)?this._bodyText=Y.toString():c.arrayBuffer&&c.blob&&u(Y)?(this._bodyArrayBuffer=F(Y.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(Y)||f(Y))?this._bodyArrayBuffer=F(Y):this._bodyText=Y=Object.prototype.toString.call(Y):this._bodyText="",this.headers.get("content-type")||(typeof Y=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(Y)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var Y=C(this);if(Y)return Y;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var Y=C(this);return Y||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(I)}),this.text=function(){var Y=C(this);if(Y)return Y;if(this._bodyBlob)return P(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(R(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(ne)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function z(Y){var ie=Y.toUpperCase();return L.indexOf(ie)>-1?ie:Y}function Q(Y,ie){if(!(this instanceof Q))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');ie=ie||{};var oe=ie.body;if(Y instanceof Q){if(Y.bodyUsed)throw new TypeError("Already read");this.url=Y.url,this.credentials=Y.credentials,ie.headers||(this.headers=new w(Y.headers)),this.method=Y.method,this.mode=Y.mode,this.signal=Y.signal,!oe&&Y._bodyInit!=null&&(oe=Y._bodyInit,Y.bodyUsed=!0)}else this.url=String(Y);if(this.credentials=ie.credentials||this.credentials||"same-origin",(ie.headers||!this.headers)&&(this.headers=new w(ie.headers)),this.method=z(ie.method||this.method||"GET"),this.mode=ie.mode||this.mode||null,this.signal=ie.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&oe)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(oe),(this.method==="GET"||this.method==="HEAD")&&(ie.cache==="no-store"||ie.cache==="no-cache")){var G=/([?&])_=[^&]*/;if(G.test(this.url))this.url=this.url.replace(G,"$1_="+new Date().getTime());else{var V=/\?/;this.url+=(V.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Q.prototype.clone=function(){return new Q(this,{body:this._bodyInit})};function ne(Y){var ie=new FormData;return Y.trim().split("&").forEach(function(oe){if(oe){var G=oe.split("="),V=G.shift().replace(/\+/g," "),te=G.join("=").replace(/\+/g," ");ie.append(decodeURIComponent(V),decodeURIComponent(te))}}),ie}function J(Y){var ie=new w,oe=Y.replace(/\r?\n[\t ]+/g," ");return oe.split("\r").map(function(G){return G.indexOf(`
`)===0?G.substr(1,G.length):G}).forEach(function(G){var V=G.split(":"),te=V.shift().trim();if(te){var ae=V.join(":").trim();ie.append(te,ae)}}),ie}U.call(Q.prototype);function X(Y,ie){if(!(this instanceof X))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');ie||(ie={}),this.type="default",this.status=ie.status===void 0?200:ie.status,this.ok=this.status>=200&&this.status<300,this.statusText=ie.statusText===void 0?"":""+ie.statusText,this.headers=new w(ie.headers),this.url=ie.url||"",this._initBody(Y)}U.call(X.prototype),X.prototype.clone=function(){return new X(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new w(this.headers),url:this.url})},X.error=function(){var Y=new X(null,{status:0,statusText:""});return Y.type="error",Y};var re=[301,302,303,307,308];X.redirect=function(Y,ie){if(re.indexOf(ie)===-1)throw new RangeError("Invalid status code");return new X(null,{status:ie,headers:{location:Y}})},o.DOMException=l.DOMException;try{new o.DOMException}catch{o.DOMException=function(ie,oe){this.message=ie,this.name=oe;var G=Error(ie);this.stack=G.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function pe(Y,ie){return new Promise(function(oe,G){var V=new Q(Y,ie);if(V.signal&&V.signal.aborted)return G(new o.DOMException("Aborted","AbortError"));var te=new XMLHttpRequest;function ae(){te.abort()}te.onload=function(){var Ce={status:te.status,statusText:te.statusText,headers:J(te.getAllResponseHeaders()||"")};Ce.url="responseURL"in te?te.responseURL:Ce.headers.get("X-Request-URL");var ce="response"in te?te.response:te.responseText;setTimeout(function(){oe(new X(ce,Ce))},0)},te.onerror=function(){setTimeout(function(){G(new TypeError("Network request failed"))},0)},te.ontimeout=function(){setTimeout(function(){G(new TypeError("Network request failed"))},0)},te.onabort=function(){setTimeout(function(){G(new o.DOMException("Aborted","AbortError"))},0)};function he(Ce){try{return Ce===""&&l.location.href?l.location.href:Ce}catch{return Ce}}te.open(V.method,he(V.url),!0),V.credentials==="include"?te.withCredentials=!0:V.credentials==="omit"&&(te.withCredentials=!1),"responseType"in te&&(c.blob?te.responseType="blob":c.arrayBuffer&&V.headers.get("Content-Type")&&V.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(te.responseType="arraybuffer")),ie&&typeof ie.headers=="object"&&!(ie.headers instanceof w)?Object.getOwnPropertyNames(ie.headers).forEach(function(Ce){te.setRequestHeader(Ce,g(ie.headers[Ce]))}):V.headers.forEach(function(Ce,ce){te.setRequestHeader(ce,Ce)}),V.signal&&(V.signal.addEventListener("abort",ae),te.onreadystatechange=function(){te.readyState===4&&V.signal.removeEventListener("abort",ae)}),te.send(typeof V._bodyInit>"u"?null:V._bodyInit)})}return pe.polyfill=!0,l.fetch||(l.fetch=pe,l.Headers=w,l.Request=Q,l.Response=X),o.Headers=w,o.Request=Q,o.Response=X,o.fetch=pe,o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var s=n.fetch?n:r;t=s.fetch,t.default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t}(cP,cP.exports)),cP.exports}var g7t=x7t();const b7t=ki(g7t);var y7t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class l$ extends Yk{constructor(t,n){if(super(),!l$.validateClientUrl(t))throw new uee(t);this.clientUrl=t,this.httpProviderOptions=n}static validateClientUrl(t){return typeof t=="string"?/^http(s)?:\/\//i.test(t):!1}getStatus(){throw new Ux}supportsSubscriptions(){return!1}request(t,n){var r;return y7t(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},(r=this.httpProviderOptions)===null||r===void 0?void 0:r.providerOptions),n),a=yield b7t(this.clientUrl,Object.assign(Object.assign({},s),{method:"POST",headers:Object.assign(Object.assign({},s.headers),{"Content-Type":"application/json"}),body:JSON.stringify(t)}));if(!a.ok)throw new S0(yield a.json(),void 0,void 0,a.status);return yield a.json()})}on(){throw new Ux}removeListener(){throw new Ux}once(){throw new Ux}removeAllListeners(){throw new Ux}connect(){throw new Ux}disconnect(){throw new Ux}reset(){throw new Ux}reconnect(){throw new Ux}}var CC=null;typeof WebSocket<"u"?CC=WebSocket:typeof MozWebSocket<"u"?CC=MozWebSocket:typeof global<"u"?CC=global.WebSocket||global.MozWebSocket:typeof window<"u"?CC=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(CC=self.WebSocket||self.MozWebSocket);const v7t=CC;class dFe extends cFe{constructor(t,n,r){super(t,n,r)}_validateProviderPath(t){return typeof t=="string"?/^ws(s)?:\/\//i.test(t):!1}getStatus(){if(this._socketConnection&&!Js(this._socketConnection))switch(this._socketConnection.readyState){case this._socketConnection.CONNECTING:return"connecting";case this._socketConnection.OPEN:return"connected";default:return"disconnected"}return"disconnected"}_openSocketConnection(){this._socketConnection=new v7t(this._socketPath,void 0,this._socketOptions&&Object.keys(this._socketOptions).length===0?void 0:this._socketOptions)}_closeSocketConnection(t,n){var r;(r=this._socketConnection)===null||r===void 0||r.close(t,n)}_sendToSocket(t){var n;if(this.getStatus()==="disconnected")throw new lee;(n=this._socketConnection)===null||n===void 0||n.send(JSON.stringify(t))}_parseResponses(t){return this.chunkResponseParser.parseResponse(t.data)}_addSocketListeners(){var t,n,r,s;(t=this._socketConnection)===null||t===void 0||t.addEventListener("open",this._onOpenHandler),(n=this._socketConnection)===null||n===void 0||n.addEventListener("message",this._onMessageHandler),(r=this._socketConnection)===null||r===void 0||r.addEventListener("close",a=>this._onCloseHandler(a)),(s=this._socketConnection)===null||s===void 0||s.addEventListener("error",this._onErrorHandler)}_removeSocketListeners(){var t,n,r;(t=this._socketConnection)===null||t===void 0||t.removeEventListener("message",this._onMessageHandler),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("open",this._onOpenHandler),(r=this._socketConnection)===null||r===void 0||r.removeEventListener("close",this._onCloseHandler)}_onCloseEvent(t){var n;if(this._reconnectOptions.autoReconnect&&(![1e3,1001].includes(t.code)||!t.wasClean)){this._reconnect();return}this._clearQueues(t),this._removeSocketListeners(),this._onDisconnect(t.code,t.reason),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("error",this._onErrorHandler)}}const fFe=e=>Yk.isWeb3Provider(e),hFe=e=>typeof e!="string"&&"request"in e&&e.request.constructor.name==="Function",pFe=e=>typeof e!="string"&&"request"in e&&e.request.constructor.name==="AsyncFunction",mFe=e=>typeof e!="string"&&"send"in e,xFe=e=>typeof e!="string"&&"sendAsync"in e,uR=e=>e&&(fFe(e)||pFe(e)||hFe(e)||xFe(e)||mFe(e)),w7t=e=>e&&"supportsSubscriptions"in e?e.supportsSubscriptions():!!(e&&typeof e!="string"&&"on"in e);var uV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},iN;(function(e){e.PROVIDER_CHANGED="PROVIDER_CHANGED",e.BEFORE_PROVIDER_CHANGE="BEFORE_PROVIDER_CHANGE"})(iN||(iN={}));const cge={HttpProvider:l$,WebsocketProvider:dFe};class Jw extends o${constructor(t,n,r){super(),Js(t)||this.setProvider(t),this.useRpcCallSpecification=n,Js(r)||(this.middleware=r)}static get providers(){return cge}get provider(){return this._provider}get providers(){return cge}setProvider(t){let n;if(t&&typeof t=="string"&&this.providers)if(/^http(s)?:\/\//i.test(t))n=new this.providers.HttpProvider(t);else if(/^ws(s)?:\/\//i.test(t))n=new this.providers.WebsocketProvider(t);else throw new oO(`Can't autodetect provider for "${t}"`);else Js(t)?n=void 0:n=t;return this.emit(iN.BEFORE_PROVIDER_CHANGE,this._provider),this._provider=n,this.emit(iN.PROVIDER_CHANGED,this._provider),!0}setMiddleware(t){this.middleware=t}send(t){return uV(this,void 0,void 0,function*(){const n=Object.assign({},t);let r=yield this._sendRequest(n);if(Js(this.middleware)||(r=yield this.middleware.processResponse(r)),jy(r))return r.result;throw new S0(r)})}sendBatch(t){return uV(this,void 0,void 0,function*(){return yield this._sendRequest(t)})}_sendRequest(t){return uV(this,void 0,void 0,function*(){const{provider:n}=this;if(Js(n))throw new oO("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");let r=n0(t)?ooe(t):$3(t);if(Js(this.middleware)||(r=yield this.middleware.processRequest(r)),fFe(n)){let s;try{s=yield n.request(r)}catch(a){s=a}return this._processJsonRpcResponse(r,s,{legacy:!1,error:!1})}if(pFe(n))return n.request(r).then(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!1})).catch(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!0}));if(hFe(n))return new Promise((s,a)=>{const o=u=>{a(this._processJsonRpcResponse(r,u,{legacy:!0,error:!0}))},l=u=>s(this._processJsonRpcResponse(r,u,{legacy:!0,error:!1})),c=n.request(r,(u,d)=>u?o(u):l(d));nFe(c)&&c.then(l).catch(d=>{try{const f=this._processJsonRpcResponse(r,d,{legacy:!0,error:!0});a(f)}catch(f){a(f)}})});if(mFe(n))return new Promise((s,a)=>{n.send(r,(o,l)=>{if(o)return a(this._processJsonRpcResponse(r,o,{legacy:!0,error:!0}));if(Js(l))throw new S0({},'Got a "nullish" response from provider.');return s(this._processJsonRpcResponse(r,l,{legacy:!0,error:!1}))})});if(xFe(n))return n.sendAsync(r).then(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!1})).catch(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!0}));throw new oO("Provider does not have a request or send method to use.")})}_processJsonRpcResponse(t,n,{legacy:r,error:s}){if(Js(n))return this._buildResponse(t,null,s);if(Ey(n)){if(this.useRpcCallSpecification&&ioe(n)){const a=n;if(md.get(a.error.code)){const o=md.get(a.error.code).error;throw new o(a)}else throw new Jf(a)}else if(!Jw._isReverted(n))throw new YB(n,t)}if(jy(n))return n;if(n instanceof Error)throw Jw._isReverted(n),n;if(!r&&n0(t)&&DE(n)||r&&!s&&n0(t))return n;if(r&&s&&n0(t))throw n;if(r&&!Ey(n)&&!jy(n))return this._buildResponse(t,n,s);throw n0(t)&&!Array.isArray(n)?new S0(n,"Got normal response for a batch request."):!n0(t)&&Array.isArray(n)?new S0(n,"Got batch response for a normal request."):new S0(n,"Invalid response")}static _isReverted(t){let n;if(Ey(t)?n=t.error:t instanceof Error&&(n=t),n!=null&&n.message.includes("revert"))throw new Qw(n);return!1}_buildResponse(t,n,r){const s={jsonrpc:"2.0",id:n0(t)?t[0].id:"id"in t?t.id:null};return r?Object.assign(Object.assign({},s),{error:n}):Object.assign(Object.assign({},s),{result:n})}}var j7=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class dR{constructor(t,n,r=!1){this.requestManager=t,this.registeredSubscriptions=n,this.tolerateUnlinkedSubscription=r,this._subscriptions=new Map,this.requestManager.on(iN.BEFORE_PROVIDER_CHANGE,()=>j7(this,void 0,void 0,function*(){yield this.unsubscribe()})),this.requestManager.on(iN.PROVIDER_CHANGED,()=>{this.clear(),this.listenToProviderEvents()}),this.listenToProviderEvents()}listenToProviderEvents(){const t=this.requestManager.provider;!this.requestManager.provider||typeof(t==null?void 0:t.supportsSubscriptions)=="function"&&!(t!=null&&t.supportsSubscriptions())||typeof this.requestManager.provider.on=="function"&&(typeof this.requestManager.provider.request=="function"?this.requestManager.provider.on("message",n=>this.messageListener(n)):t.on("data",n=>this.messageListener(n)))}messageListener(t){var n,r,s;if(!t)throw new lg("Should not call messageListener with no data. Type was");const a=((n=t.params)===null||n===void 0?void 0:n.subscription)||((r=t.data)===null||r===void 0?void 0:r.subscription)||((s=t.id)===null||s===void 0?void 0:s.toString(16));if(a){const o=this._subscriptions.get(a);o==null||o.processSubscriptionData(t)}}subscribe(t,n){return j7(this,arguments,void 0,function*(r,s,a=dd){const o=this.registeredSubscriptions[r];if(!o)throw new lg("Invalid subscription type");const l=new o(s??void 0,{subscriptionManager:this,returnFormat:a});return yield this.addSubscription(l),l})}get subscriptions(){return this._subscriptions}addSubscription(t){return j7(this,void 0,void 0,function*(){if(!this.requestManager.provider)throw new oO("Provider not available");if(!this.supportsSubscriptions())throw new lg("The current provider does not support subscriptions");if(t.id&&this._subscriptions.has(t.id))throw new lg(`Subscription with id "${t.id}" already exists`);if(yield t.sendSubscriptionRequest(),Js(t.id))throw new lg("Subscription is not subscribed yet.");return this._subscriptions.set(t.id,t),t.id})}removeSubscription(t){return j7(this,void 0,void 0,function*(){const{id:n}=t;if(Js(n))throw new lg("Subscription is not subscribed yet. Or, had already been unsubscribed but not through the Subscription Manager.");if(!this._subscriptions.has(n)&&!this.tolerateUnlinkedSubscription)throw new lg(`Subscription with id "${n.toString()}" does not exists`);return yield t.sendUnsubscribeRequest(),this._subscriptions.delete(n),n})}unsubscribe(t){return j7(this,void 0,void 0,function*(){const n=[];for(const[r,s]of this.subscriptions.entries())(!t||typeof t=="function"&&t({id:r,sub:s}))&&n.push(this.removeSubscription(s));return Promise.all(n)})}clear(){this._subscriptions.clear()}supportsSubscriptions(){return Js(this.requestManager.provider)?!1:w7t(this.requestManager.provider)}}var E7=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class eT extends o${constructor(t,n){var r;super(),this.args=t;const{requestManager:s}=n,{subscriptionManager:a}=n;s?this._subscriptionManager=new dR(s,{},!0):this._subscriptionManager=a,this._returnFormat=(r=n==null?void 0:n.returnFormat)!==null&&r!==void 0?r:dd}get id(){return this._id}get lastBlock(){return this._lastBlock}subscribe(){return E7(this,void 0,void 0,function*(){return this._subscriptionManager.addSubscription(this)})}processSubscriptionData(t){var n,r;t!=null&&t.data?this._processSubscriptionResult((r=(n=t==null?void 0:t.data)===null||n===void 0?void 0:n.result)!==null&&r!==void 0?r:t==null?void 0:t.data):t&&a$(t)&&this._processSubscriptionResult(t==null?void 0:t.params.result)}sendSubscriptionRequest(){return E7(this,void 0,void 0,function*(){return this._id=yield this._subscriptionManager.requestManager.send({method:"eth_subscribe",params:this._buildSubscriptionParams()}),this.emit("connected",this._id),this._id})}get returnFormat(){return this._returnFormat}get subscriptionManager(){return this._subscriptionManager}resubscribe(){return E7(this,void 0,void 0,function*(){yield this.unsubscribe(),yield this.subscribe()})}unsubscribe(){return E7(this,void 0,void 0,function*(){this.id&&(yield this._subscriptionManager.removeSubscription(this))})}sendUnsubscribeRequest(){return E7(this,void 0,void 0,function*(){yield this._subscriptionManager.requestManager.send({method:"eth_unsubscribe",params:[this.id]}),this._id=void 0})}formatSubscriptionResult(t){return t}_processSubscriptionResult(t){this.emit("data",this.formatSubscriptionResult(t))}_processSubscriptionError(t){this.emit("error",t)}_buildSubscriptionParams(){throw new Error("Implement in the child class")}}var z6=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class fR extends l4t{constructor(){super(...arguments),this._addressMap=new Map,this._defaultKeyName="web3js_wallet"}static getStorage(){let t;try{t=window.localStorage;const n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(n){return n&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&!dr(t)&&t.length!==0?t:void 0}}create(t){for(let n=0;n<t;n+=1)this.add(this._accountProvider.create());return this}add(t){var n;if(typeof t=="string")return this.add(this._accountProvider.privateKeyToAccount(t));let r=this.length;return this.get(t.address)&&(console.warn(`Account ${t.address.toLowerCase()} already exists.`),r=(n=this._addressMap.get(t.address.toLowerCase()))!==null&&n!==void 0?n:r),this._addressMap.set(t.address.toLowerCase(),r),this[r]=t,this}get(t){if(typeof t=="string"){const n=this._addressMap.get(t.toLowerCase());return dr(n)?void 0:this[n]}return this[t]}remove(t){if(typeof t=="string"){const n=this._addressMap.get(t.toLowerCase());return dr(n)?!1:(this._addressMap.delete(t.toLowerCase()),this.splice(n,1),!0)}return this[t]?(this.splice(t,1),!0):!1}clear(){return this._addressMap.clear(),this.length=0,this}encrypt(t,n){return z6(this,void 0,void 0,function*(){return Promise.all(this.map(r=>z6(this,void 0,void 0,function*(){return r.encrypt(t,n)})))})}decrypt(t,n,r){return z6(this,void 0,void 0,function*(){const s=yield Promise.all(t.map(a=>z6(this,void 0,void 0,function*(){return this._accountProvider.decrypt(a,n,r)})));for(const a of s)this.add(a);return this})}save(t,n){return z6(this,void 0,void 0,function*(){const r=fR.getStorage();if(!r)throw new Error("Local storage not available.");return r.setItem(n??this._defaultKeyName,JSON.stringify(yield this.encrypt(t))),!0})}load(t,n){return z6(this,void 0,void 0,function*(){const r=fR.getStorage();if(!r)throw new Error("Local storage not available.");const s=r.getItem(n??this._defaultKeyName);return s&&(yield this.decrypt(JSON.parse(s)||[],t)),this})}}const _0={web:lO};function gFe(e,t,n){if(!n.startsWith("aes-"))throw new Error(`AES submodule doesn't support mode ${n}`);if(t.length!==16)throw new Error("AES: wrong IV length");if(n.startsWith("aes-128")&&e.length!==16||n.startsWith("aes-256")&&e.length!==32)throw new Error("AES: wrong key length")}async function bFe(e,t,n){if(!_0.web)throw new Error("Browser crypto not available.");let r;if(["aes-128-cbc","aes-256-cbc"].includes(e)&&(r="cbc"),["aes-128-ctr","aes-256-ctr"].includes(e)&&(r="ctr"),!r)throw new Error("AES: unsupported mode");return[await _0.web.subtle.importKey("raw",t,{name:`AES-${r.toUpperCase()}`,length:t.length*8},!0,["encrypt","decrypt"]),{name:`aes-${r}`,iv:n,counter:n,length:128}]}async function coe(e,t,n,r="aes-128-ctr",s=!0){if(gFe(t,n,r),_0.web){const[a,o]=await bFe(r,t,n),l=await _0.web.subtle.encrypt(o,a,e);let c=new Uint8Array(l);return!s&&o.name==="aes-cbc"&&!(e.length%16)&&(c=c.slice(0,-16)),c}else if(_0.node){const a=_0.node.createCipheriv(r,t,n);return a.setAutoPadding(s),XM(a.update(e),a.final())}else throw new Error("The environment doesn't have AES module")}async function C7t(e,t,n,r){const s=e.slice(-16);for(let o=0;o<16;o++)s[o]^=n[o]^16;return(await coe(s,t,n,r)).slice(0,16)}async function S7t(e,t,n,r="aes-128-ctr",s=!0){if(gFe(t,n,r),_0.web){const[a,o]=await bFe(r,t,n);if(!s&&o.name==="aes-cbc"){const u=await C7t(e,t,n,r);e=XM(e,u)}const l=await _0.web.subtle.decrypt(o,a,e),c=new Uint8Array(l);if(o.name==="aes-cbc"){const u=await coe(c,t,n,r);if(!yAt(u,e))throw new Error("AES: wrong padding")}return c}else if(_0.node){const a=_0.node.createDecipheriv(r,t,n);return a.setAutoPadding(s),XM(a.update(e),a.final())}else throw new Error("The environment doesn't have AES module")}class yFe extends Wae{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Hae(t);const r=QS(n);if(this.iHash=t.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 s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return O3(this),this.iHash.update(t),this}digestInto(t){O3(this),OA(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:o,outputLen:l}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const uoe=(e,t,n)=>new yFe(e,t).update(n).digest();uoe.create=(e,t)=>new yFe(e,t);function N7t(e,t,n,r){Hae(e);const s=wPe({dkLen:32,asyncTick:10},r),{c:a,dkLen:o,asyncTick:l}=s;if(qd(a),qd(o),qd(l),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=QS(t),u=QS(n),d=new Uint8Array(o),f=uoe.create(e,c),x=f._cloneInto().update(u);return{c:a,dkLen:o,asyncTick:l,DK:d,PRF:f,PRFSalt:x}}function A7t(e,t,n,r,s){return e.destroy(),t.destroy(),r&&r.destroy(),s.fill(0),n}function doe(e,t,n,r){const{c:s,dkLen:a,DK:o,PRF:l,PRFSalt:c}=N7t(e,t,n,r);let u;const d=new Uint8Array(4),f=uO(d),x=new Uint8Array(l.outputLen);for(let g=1,v=0;v<a;g++,v+=l.outputLen){const w=o.subarray(v,v+l.outputLen);f.setInt32(0,g,!1),(u=c._cloneInto(u)).update(d).digestInto(x),w.set(x.subarray(0,w.length));for(let C=1;C<s;C++){l._cloneInto(u).update(x).digestInto(x);for(let N=0;N<w.length;N++)w[N]^=x[N]}}return A7t(l,c,o,u,x)}function j7t(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),l=Number(n&a),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,l,r)}const E7t=(e,t,n)=>e&t^~e&n,_7t=(e,t,n)=>e&t^e&n^t&n;class k7t extends Wae{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=uO(this.buffer)}update(t){O3(this);const{view:n,buffer:r,blockLen:s}=this;t=QS(t);const a=t.length;for(let o=0;o<a;){const l=Math.min(s-this.pos,a-o);if(l===s){const c=uO(t);for(;s<=a-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){O3(this),Vae(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;j7t(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=uO(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,d[f],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:l}=this;return t.length=s,t.pos=l,t.finished=a,t.destroyed=o,s%n&&t.buffer.set(r),t}}const T7t=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]),db=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),fb=new Uint32Array(64);class I7t extends k7t{constructor(){super(64,32,8,!1),this.A=db[0]|0,this.B=db[1]|0,this.C=db[2]|0,this.D=db[3]|0,this.E=db[4]|0,this.F=db[5]|0,this.G=db[6]|0,this.H=db[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:o,G:l,H:c}=this;return[t,n,r,s,a,o,l,c]}set(t,n,r,s,a,o,l,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=l|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)fb[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=fb[f-15],g=fb[f-2],v=Xm(x,7)^Xm(x,18)^x>>>3,w=Xm(g,17)^Xm(g,19)^g>>>10;fb[f]=w+fb[f-7]+v+fb[f-16]|0}let{A:r,B:s,C:a,D:o,E:l,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const x=Xm(l,6)^Xm(l,11)^Xm(l,25),g=d+x+E7t(l,c,u)+T7t[f]+fb[f]|0,w=(Xm(r,2)^Xm(r,13)^Xm(r,22))+_7t(r,s,a)|0;d=u,u=c,c=l,l=o+g|0,o=a,a=s,s=r,r=g+w|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,a,o,l,c,u,d)}roundClean(){fb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const c$=CPe(()=>new I7t);function vFe(e,t,n,r,s){if(!["sha256","sha512"].includes(s))throw new Error("Only sha256 and sha512 are supported");return QM(e),QM(t),doe(c$,e,t,{c:n,dkLen:r})}function uge(e,t,n,r,s,a){let o=e[t++]^n[r++],l=e[t++]^n[r++],c=e[t++]^n[r++],u=e[t++]^n[r++],d=e[t++]^n[r++],f=e[t++]^n[r++],x=e[t++]^n[r++],g=e[t++]^n[r++],v=e[t++]^n[r++],w=e[t++]^n[r++],C=e[t++]^n[r++],N=e[t++]^n[r++],I=e[t++]^n[r++],P=e[t++]^n[r++],R=e[t++]^n[r++],F=e[t++]^n[r++],U=o,L=l,z=c,Q=u,ne=d,J=f,X=x,re=g,pe=v,Y=w,ie=C,oe=N,G=I,V=P,te=R,ae=F;for(let he=0;he<8;he+=2)ne^=pa(U+G|0,7),pe^=pa(ne+U|0,9),G^=pa(pe+ne|0,13),U^=pa(G+pe|0,18),Y^=pa(J+L|0,7),V^=pa(Y+J|0,9),L^=pa(V+Y|0,13),J^=pa(L+V|0,18),te^=pa(ie+X|0,7),z^=pa(te+ie|0,9),X^=pa(z+te|0,13),ie^=pa(X+z|0,18),Q^=pa(ae+oe|0,7),re^=pa(Q+ae|0,9),oe^=pa(re+Q|0,13),ae^=pa(oe+re|0,18),L^=pa(U+Q|0,7),z^=pa(L+U|0,9),Q^=pa(z+L|0,13),U^=pa(Q+z|0,18),X^=pa(J+ne|0,7),re^=pa(X+J|0,9),ne^=pa(re+X|0,13),J^=pa(ne+re|0,18),oe^=pa(ie+Y|0,7),pe^=pa(oe+ie|0,9),Y^=pa(pe+oe|0,13),ie^=pa(Y+pe|0,18),G^=pa(ae+te|0,7),V^=pa(G+ae|0,9),te^=pa(V+G|0,13),ae^=pa(te+V|0,18);s[a++]=o+U|0,s[a++]=l+L|0,s[a++]=c+z|0,s[a++]=u+Q|0,s[a++]=d+ne|0,s[a++]=f+J|0,s[a++]=x+X|0,s[a++]=g+re|0,s[a++]=v+pe|0,s[a++]=w+Y|0,s[a++]=C+ie|0,s[a++]=N+oe|0,s[a++]=I+G|0,s[a++]=P+V|0,s[a++]=R+te|0,s[a++]=F+ae|0}function dV(e,t,n,r,s){let a=r+0,o=r+16*s;for(let l=0;l<16;l++)n[o+l]=e[t+(2*s-1)*16+l];for(let l=0;l<s;l++,a+=16,t+=16)uge(n,o,e,t,n,a),l>0&&(o+=16),uge(n,a,e,t+=16,n,o)}function P7t(e,t,n){const r=wPe({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:s,r:a,p:o,dkLen:l,asyncTick:c,maxmem:u,onProgress:d}=r;if(qd(s),qd(a),qd(o),qd(l),qd(c),qd(u),d!==void 0&&typeof d!="function")throw new Error("progressCb should be function");const f=128*a,x=f/4;if(s<=1||s&s-1||s>=2**(f/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(l<0||l>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=f*(s+o);if(g>u)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${u} (maxmem)`);const v=doe(c$,e,t,{c:1,dkLen:f*o}),w=cO(v),C=cO(new Uint8Array(f*s)),N=cO(new Uint8Array(f));let I=()=>{};if(d){const P=2*s*o,R=Math.max(Math.floor(P/1e4),1);let F=0;I=()=>{F++,d&&(!(F%R)||F===P)&&d(F/P)}}return{N:s,r:a,p:o,dkLen:l,blockSize32:x,V:C,B32:w,B:v,tmp:N,blockMixCb:I,asyncTick:c}}function F7t(e,t,n,r,s){const a=doe(c$,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),s.fill(0),a}function O7t(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x}=P7t(e,t,n);KM||YM(u);for(let g=0;g<a;g++){const v=l*g;for(let w=0;w<l;w++)c[w]=u[v+w];for(let w=0,C=0;w<r-1;w++)dV(c,C,c,C+=l,s),x();dV(c,(r-1)*l,u,v,s),x();for(let w=0;w<r;w++){const C=u[v+l-16]%r;for(let N=0;N<l;N++)f[N]=u[v+N]^c[C*l+N];dV(f,0,u,v,s),x()}}return KM||YM(u),F7t(e,o,d,c,f)}function wFe(e,t,n,r,s,a,o){return QM(e),QM(t),O7t(e,t,{N:n,r:s,p:r,dkLen:a,onProgress:o})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const CFe=BigInt(0),u$=BigInt(1),M7t=BigInt(2);function z3(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function tT(e){if(!z3(e))throw new Error("Uint8Array expected")}const R7t=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function aN(e){tT(e);let t="";for(let n=0;n<e.length;n++)t+=R7t[e[n]];return t}function SFe(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function foe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}const Hx={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function dge(e){if(e>=Hx._0&&e<=Hx._9)return e-Hx._0;if(e>=Hx._A&&e<=Hx._F)return e-(Hx._A-10);if(e>=Hx._a&&e<=Hx._f)return e-(Hx._a-10)}function oN(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,a=0;s<n;s++,a+=2){const o=dge(e.charCodeAt(a)),l=dge(e.charCodeAt(a+1));if(o===void 0||l===void 0){const c=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}r[s]=o*16+l}return r}function e3(e){return foe(aN(e))}function hoe(e){return tT(e),foe(aN(Uint8Array.from(e).reverse()))}function lN(e,t){return oN(e.toString(16).padStart(t*2,"0"))}function poe(e,t){return lN(e,t).reverse()}function L7t(e){return oN(SFe(e))}function $p(e,t,n){let r;if(typeof t=="string")try{r=oN(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if(z3(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${e} expected ${n} bytes, got ${s}`);return r}function BE(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];tT(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}function D7t(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function B7t(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function $7t(e){let t;for(t=0;e>CFe;e>>=u$,t+=1);return t}function U7t(e,t){return e>>BigInt(t)&u$}function z7t(e,t,n){return e|(n?u$:CFe)<<BigInt(t)}const moe=e=>(M7t<<BigInt(e-1))-u$,fV=e=>new Uint8Array(e),fge=e=>Uint8Array.from(e);function NFe(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=fV(e),s=fV(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=fV())=>{s=l(fge([0]),f),r=l(),f.length!==0&&(s=l(fge([1]),f),r=l())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const x=[];for(;f<t;){r=l();const g=r.slice();x.push(g),f+=r.length}return BE(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const H7t={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||z3(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function nT(e,t,n={}){const r=(s,a,o)=>{const l=H7t[a];if(typeof l!="function")throw new Error(`Invalid validator "${a}", expected function`);const c=e[s];if(!(o&&c===void 0)&&!l(c,e))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${a}`)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}const V7t=Object.freeze(Object.defineProperty({__proto__:null,abytes:tT,bitGet:U7t,bitLen:$7t,bitMask:moe,bitSet:z7t,bytesToHex:aN,bytesToNumberBE:e3,bytesToNumberLE:hoe,concatBytes:BE,createHmacDrbg:NFe,ensureBytes:$p,equalBytes:D7t,hexToBytes:oN,hexToNumber:foe,isBytes:z3,numberToBytesBE:lN,numberToBytesLE:poe,numberToHexUnpadded:SFe,numberToVarBytesBE:L7t,utf8ToBytes:B7t,validateObject:nT},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kc=BigInt(0),vl=BigInt(1),Rv=BigInt(2),W7t=BigInt(3),vee=BigInt(4),hge=BigInt(5),pge=BigInt(8);BigInt(9);BigInt(16);function Hd(e,t){const n=e%t;return n>=kc?n:t+n}function q7t(e,t,n){if(n<=kc||t<kc)throw new Error("Expected power/modulo > 0");if(n===vl)return kc;let r=vl;for(;t>kc;)t&vl&&(r=r*e%n),e=e*e%n,t>>=vl;return r}function yh(e,t,n){let r=e;for(;t-- >kc;)r*=r,r%=n;return r}function wee(e,t){if(e===kc||t<=kc)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Hd(e,t),r=t,s=kc,a=vl;for(;n!==kc;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==vl)throw new Error("invert: does not exist");return Hd(s,t)}function G7t(e){const t=(e-vl)/Rv;let n,r,s;for(n=e-vl,r=0;n%Rv===kc;n/=Rv,r++);for(s=Rv;s<e&&q7t(s,t,e)!==e-vl;s++);if(r===1){const o=(e+vl)/vee;return function(c,u){const d=c.pow(u,o);if(!c.eql(c.sqr(d),u))throw new Error("Cannot find square root");return d}}const a=(n+vl)/Rv;return function(l,c){if(l.pow(c,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let u=r,d=l.pow(l.mul(l.ONE,s),n),f=l.pow(c,a),x=l.pow(c,n);for(;!l.eql(x,l.ONE);){if(l.eql(x,l.ZERO))return l.ZERO;let g=1;for(let w=l.sqr(x);g<u&&!l.eql(w,l.ONE);g++)w=l.sqr(w);const v=l.pow(d,vl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function K7t(e){if(e%vee===W7t){const t=(e+vl)/vee;return function(r,s){const a=r.pow(s,t);if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}if(e%pge===hge){const t=(e-hge)/pge;return function(r,s){const a=r.mul(s,Rv),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Rv),o),u=r.mul(l,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return G7t(e)}const Y7t=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function X7t(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Y7t.reduce((r,s)=>(r[s]="function",r),t);return nT(e,n)}function Q7t(e,t,n){if(n<kc)throw new Error("Expected power > 0");if(n===kc)return e.ONE;if(n===vl)return t;let r=e.ONE,s=t;for(;n>kc;)n&vl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=vl;return r}function Z7t(e,t){const n=new Array(t.length),r=t.reduce((a,o,l)=>e.is0(o)?a:(n[l]=a,e.mul(a,o)),e.ONE),s=e.inv(r);return t.reduceRight((a,o,l)=>e.is0(o)?a:(n[l]=e.mul(a,n[l]),e.mul(a,o)),s),n}function AFe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function J7t(e,t,n=!1,r={}){if(e<=kc)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:a}=AFe(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=K7t(e),l=Object.freeze({ORDER:e,BITS:s,BYTES:a,MASK:moe(s),ZERO:kc,ONE:vl,create:c=>Hd(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return kc<=c&&c<e},is0:c=>c===kc,isOdd:c=>(c&vl)===vl,neg:c=>Hd(-c,e),eql:(c,u)=>c===u,sqr:c=>Hd(c*c,e),add:(c,u)=>Hd(c+u,e),sub:(c,u)=>Hd(c-u,e),mul:(c,u)=>Hd(c*u,e),pow:(c,u)=>Q7t(l,c,u),div:(c,u)=>Hd(c*wee(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>wee(c,e),sqrt:r.sqrt||(c=>o(l,c)),invertBatch:c=>Z7t(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?poe(c,a):lN(c,a),fromBytes:c=>{if(c.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${c.length}`);return n?hoe(c):e3(c)}});return Object.freeze(l)}function jFe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function EFe(e){const t=jFe(e);return t+Math.ceil(t/2)}function ejt(e,t,n=!1){const r=e.length,s=jFe(t),a=EFe(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?e3(e):hoe(e),l=Hd(o,t-vl)+vl;return n?poe(l,s):lN(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const tjt=BigInt(0),hV=BigInt(1);function njt(e,t){const n=(s,a)=>{const o=a.negate();return s?o:a},r=s=>{const a=Math.ceil(t/s)+1,o=2**(s-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,a){let o=e.ZERO,l=s;for(;a>tjt;)a&hV&&(o=o.add(l)),l=l.double(),a>>=hV;return o},precomputeWindow(s,a){const{windows:o,windowSize:l}=r(a),c=[];let u=s,d=u;for(let f=0;f<o;f++){d=u,c.push(d);for(let x=1;x<l;x++)d=d.add(u),c.push(d);u=d.double()}return c},wNAF(s,a,o){const{windows:l,windowSize:c}=r(s);let u=e.ZERO,d=e.BASE;const f=BigInt(2**s-1),x=2**s,g=BigInt(s);for(let v=0;v<l;v++){const w=v*c;let C=Number(o&f);o>>=g,C>c&&(C-=x,o+=hV);const N=w,I=w+Math.abs(C)-1,P=v%2!==0,R=C<0;C===0?d=d.add(n(P,a[N])):u=u.add(n(R,a[I]))}return{p:u,f:d}},wNAFCached(s,a,o,l){const c=s._WINDOW_SIZE||1;let u=a.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&a.set(s,l(u))),this.wNAF(c,u,o)}}}function _Fe(e){return X7t(e.Fp),nT(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...AFe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function rjt(e){const t=_Fe(e);nT(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,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({...t})}const{bytesToNumberBE:sjt,hexToBytes:ijt}=V7t,Xv={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Xv;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:sjt(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Xv,n=typeof e=="string"?ijt(e):e;tT(n);let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:a}=Xv._parseInt(n.subarray(2)),{d:o,l}=Xv._parseInt(a);if(l.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const d=u.toString(16);return d.length&1?`0${d}`:d},r=t(n(e.s)),s=t(n(e.r)),a=r.length/2,o=s.length/2,l=n(a),c=n(o);return`30${n(o+a+4)}02${c}${s}02${l}${r}`}},Ig=BigInt(0),Hh=BigInt(1);BigInt(2);const mge=BigInt(3);BigInt(4);function ajt(e){const t=rjt(e),{Fp:n}=t,r=t.toBytes||((v,w,C)=>{const N=w.toAffine();return BE(Uint8Array.from([4]),n.toBytes(N.x),n.toBytes(N.y))}),s=t.fromBytes||(v=>{const w=v.subarray(1),C=n.fromBytes(w.subarray(0,n.BYTES)),N=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x:C,y:N}});function a(v){const{a:w,b:C}=t,N=n.sqr(v),I=n.mul(N,v);return n.add(n.add(I,n.mul(v,w)),C)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&Ig<v&&v<t.n}function l(v){if(!o(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(v){const{allowedPrivateKeyLengths:w,nByteLength:C,wrapPrivateKey:N,n:I}=t;if(w&&typeof v!="bigint"){if(z3(v)&&(v=aN(v)),typeof v!="string"||!w.includes(v.length))throw new Error("Invalid key");v=v.padStart(C*2,"0")}let P;try{P=typeof v=="bigint"?v:e3($p("private key",v,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof v}`)}return N&&(P=Hd(P,I)),l(P),P}const u=new Map;function d(v){if(!(v instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(w,C,N){if(this.px=w,this.py=C,this.pz=N,w==null||!n.isValid(w))throw new Error("x required");if(C==null||!n.isValid(C))throw new Error("y required");if(N==null||!n.isValid(N))throw new Error("z required")}static fromAffine(w){const{x:C,y:N}=w||{};if(!w||!n.isValid(C)||!n.isValid(N))throw new Error("invalid affine point");if(w instanceof f)throw new Error("projective point not allowed");const I=P=>n.eql(P,n.ZERO);return I(C)&&I(N)?f.ZERO:new f(C,N,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const C=n.invertBatch(w.map(N=>N.pz));return w.map((N,I)=>N.toAffine(C[I])).map(f.fromAffine)}static fromHex(w){const C=f.fromAffine(s($p("pointHex",w)));return C.assertValidity(),C}static fromPrivateKey(w){return f.BASE.multiply(c(w))}_setWindowSize(w){this._WINDOW_SIZE=w,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:w,y:C}=this.toAffine();if(!n.isValid(w)||!n.isValid(C))throw new Error("bad point: x or y not FE");const N=n.sqr(C),I=a(w);if(!n.eql(N,I))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){d(w);const{px:C,py:N,pz:I}=this,{px:P,py:R,pz:F}=w,U=n.eql(n.mul(C,F),n.mul(P,I)),L=n.eql(n.mul(N,F),n.mul(R,I));return U&&L}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:C}=t,N=n.mul(C,mge),{px:I,py:P,pz:R}=this;let F=n.ZERO,U=n.ZERO,L=n.ZERO,z=n.mul(I,I),Q=n.mul(P,P),ne=n.mul(R,R),J=n.mul(I,P);return J=n.add(J,J),L=n.mul(I,R),L=n.add(L,L),F=n.mul(w,L),U=n.mul(N,ne),U=n.add(F,U),F=n.sub(Q,U),U=n.add(Q,U),U=n.mul(F,U),F=n.mul(J,F),L=n.mul(N,L),ne=n.mul(w,ne),J=n.sub(z,ne),J=n.mul(w,J),J=n.add(J,L),L=n.add(z,z),z=n.add(L,z),z=n.add(z,ne),z=n.mul(z,J),U=n.add(U,z),ne=n.mul(P,R),ne=n.add(ne,ne),z=n.mul(ne,J),F=n.sub(F,z),L=n.mul(ne,Q),L=n.add(L,L),L=n.add(L,L),new f(F,U,L)}add(w){d(w);const{px:C,py:N,pz:I}=this,{px:P,py:R,pz:F}=w;let U=n.ZERO,L=n.ZERO,z=n.ZERO;const Q=t.a,ne=n.mul(t.b,mge);let J=n.mul(C,P),X=n.mul(N,R),re=n.mul(I,F),pe=n.add(C,N),Y=n.add(P,R);pe=n.mul(pe,Y),Y=n.add(J,X),pe=n.sub(pe,Y),Y=n.add(C,I);let ie=n.add(P,F);return Y=n.mul(Y,ie),ie=n.add(J,re),Y=n.sub(Y,ie),ie=n.add(N,I),U=n.add(R,F),ie=n.mul(ie,U),U=n.add(X,re),ie=n.sub(ie,U),z=n.mul(Q,Y),U=n.mul(ne,re),z=n.add(U,z),U=n.sub(X,z),z=n.add(X,z),L=n.mul(U,z),X=n.add(J,J),X=n.add(X,J),re=n.mul(Q,re),Y=n.mul(ne,Y),X=n.add(X,re),re=n.sub(J,re),re=n.mul(Q,re),Y=n.add(Y,re),J=n.mul(X,Y),L=n.add(L,J),J=n.mul(ie,Y),U=n.mul(pe,U),U=n.sub(U,J),J=n.mul(pe,X),z=n.mul(ie,z),z=n.add(z,J),new f(U,L,z)}subtract(w){return this.add(w.negate())}is0(){return this.equals(f.ZERO)}wNAF(w){return g.wNAFCached(this,u,w,C=>{const N=n.invertBatch(C.map(I=>I.pz));return C.map((I,P)=>I.toAffine(N[P])).map(f.fromAffine)})}multiplyUnsafe(w){const C=f.ZERO;if(w===Ig)return C;if(l(w),w===Hh)return this;const{endo:N}=t;if(!N)return g.unsafeLadder(this,w);let{k1neg:I,k1:P,k2neg:R,k2:F}=N.splitScalar(w),U=C,L=C,z=this;for(;P>Ig||F>Ig;)P&Hh&&(U=U.add(z)),F&Hh&&(L=L.add(z)),z=z.double(),P>>=Hh,F>>=Hh;return I&&(U=U.negate()),R&&(L=L.negate()),L=new f(n.mul(L.px,N.beta),L.py,L.pz),U.add(L)}multiply(w){l(w);let C=w,N,I;const{endo:P}=t;if(P){const{k1neg:R,k1:F,k2neg:U,k2:L}=P.splitScalar(C);let{p:z,f:Q}=this.wNAF(F),{p:ne,f:J}=this.wNAF(L);z=g.constTimeNegate(R,z),ne=g.constTimeNegate(U,ne),ne=new f(n.mul(ne.px,P.beta),ne.py,ne.pz),N=z.add(ne),I=Q.add(J)}else{const{p:R,f:F}=this.wNAF(C);N=R,I=F}return f.normalizeZ([N,I])[0]}multiplyAndAddUnsafe(w,C,N){const I=f.BASE,P=(F,U)=>U===Ig||U===Hh||!F.equals(I)?F.multiplyUnsafe(U):F.multiply(U),R=P(this,C).add(P(w,N));return R.is0()?void 0:R}toAffine(w){const{px:C,py:N,pz:I}=this,P=this.is0();w==null&&(w=P?n.ONE:n.inv(I));const R=n.mul(C,w),F=n.mul(N,w),U=n.mul(I,w);if(P)return{x:n.ZERO,y:n.ZERO};if(!n.eql(U,n.ONE))throw new Error("invZ was invalid");return{x:R,y:F}}isTorsionFree(){const{h:w,isTorsionFree:C}=t;if(w===Hh)return!0;if(C)return C(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:C}=t;return w===Hh?this:C?C(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return aN(this.toRawBytes(w))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const x=t.nBitLength,g=njt(f,t.endo?Math.ceil(x/2):x);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function ojt(e){const t=_Fe(e);return nT(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function ljt(e){const t=ojt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(Y){return Ig<Y&&Y<n.ORDER}function l(Y){return Hd(Y,r)}function c(Y){return wee(Y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:x}=ajt({...t,toBytes(Y,ie,oe){const G=ie.toAffine(),V=n.toBytes(G.x),te=BE;return oe?te(Uint8Array.from([ie.hasEvenY()?2:3]),V):te(Uint8Array.from([4]),V,n.toBytes(G.y))},fromBytes(Y){const ie=Y.length,oe=Y[0],G=Y.subarray(1);if(ie===s&&(oe===2||oe===3)){const V=e3(G);if(!o(V))throw new Error("Point is not on curve");const te=f(V);let ae;try{ae=n.sqrt(te)}catch(ce){const ge=ce instanceof Error?": "+ce.message:"";throw new Error("Point is not on curve"+ge)}const he=(ae&Hh)===Hh;return(oe&1)===1!==he&&(ae=n.neg(ae)),{x:V,y:ae}}else if(ie===a&&oe===4){const V=n.fromBytes(G.subarray(0,n.BYTES)),te=n.fromBytes(G.subarray(n.BYTES,2*n.BYTES));return{x:V,y:te}}else throw new Error(`Point of length ${ie} was invalid. Expected ${s} compressed bytes or ${a} uncompressed bytes`)}}),g=Y=>aN(lN(Y,t.nByteLength));function v(Y){const ie=r>>Hh;return Y>ie}function w(Y){return v(Y)?l(-Y):Y}const C=(Y,ie,oe)=>e3(Y.slice(ie,oe));class N{constructor(ie,oe,G){this.r=ie,this.s=oe,this.recovery=G,this.assertValidity()}static fromCompact(ie){const oe=t.nByteLength;return ie=$p("compactSignature",ie,oe*2),new N(C(ie,0,oe),C(ie,oe,2*oe))}static fromDER(ie){const{r:oe,s:G}=Xv.toSig($p("DER",ie));return new N(oe,G)}assertValidity(){if(!x(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!x(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(ie){return new N(this.r,this.s,ie)}recoverPublicKey(ie){const{r:oe,s:G,recovery:V}=this,te=L($p("msgHash",ie));if(V==null||![0,1,2,3].includes(V))throw new Error("recovery id invalid");const ae=V===2||V===3?oe+t.n:oe;if(ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const he=V&1?"03":"02",Ce=u.fromHex(he+g(ae)),ce=c(ae),ge=l(-te*ce),Ae=l(G*ce),ye=u.BASE.multiplyAndAddUnsafe(Ce,ge,Ae);if(!ye)throw new Error("point at infinify");return ye.assertValidity(),ye}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return oN(this.toDERHex())}toDERHex(){return Xv.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return oN(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const I={isValidPrivateKey(Y){try{return d(Y),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const Y=EFe(t.n);return ejt(t.randomBytes(Y),t.n)},precompute(Y=8,ie=u.BASE){return ie._setWindowSize(Y),ie.multiply(BigInt(3)),ie}};function P(Y,ie=!0){return u.fromPrivateKey(Y).toRawBytes(ie)}function R(Y){const ie=z3(Y),oe=typeof Y=="string",G=(ie||oe)&&Y.length;return ie?G===s||G===a:oe?G===2*s||G===2*a:Y instanceof u}function F(Y,ie,oe=!0){if(R(Y))throw new Error("first arg must be private key");if(!R(ie))throw new Error("second arg must be public key");return u.fromHex(ie).multiply(d(Y)).toRawBytes(oe)}const U=t.bits2int||function(Y){const ie=e3(Y),oe=Y.length*8-t.nBitLength;return oe>0?ie>>BigInt(oe):ie},L=t.bits2int_modN||function(Y){return l(U(Y))},z=moe(t.nBitLength);function Q(Y){if(typeof Y!="bigint")throw new Error("bigint expected");if(!(Ig<=Y&&Y<z))throw new Error(`bigint expected < 2^${t.nBitLength}`);return lN(Y,t.nByteLength)}function ne(Y,ie,oe=J){if(["recovered","canonical"].some(Ie=>Ie in oe))throw new Error("sign() legacy options not supported");const{hash:G,randomBytes:V}=t;let{lowS:te,prehash:ae,extraEntropy:he}=oe;te==null&&(te=!0),Y=$p("msgHash",Y),ae&&(Y=$p("prehashed msgHash",G(Y)));const Ce=L(Y),ce=d(ie),ge=[Q(ce),Q(Ce)];if(he!=null&&he!==!1){const Ie=he===!0?V(n.BYTES):he;ge.push($p("extraEntropy",Ie))}const Ae=BE(...ge),ye=Ce;function je(Ie){const Re=U(Ie);if(!x(Re))return;const Qe=c(Re),$e=u.BASE.multiply(Re).toAffine(),it=l($e.x);if(it===Ig)return;const tt=l(Qe*l(ye+it*ce));if(tt===Ig)return;let ot=($e.x===it?0:2)|Number($e.y&Hh),ft=tt;return te&&v(tt)&&(ft=w(tt),ot^=1),new N(it,ft,ot)}return{seed:Ae,k2sig:je}}const J={lowS:t.lowS,prehash:!1},X={lowS:t.lowS,prehash:!1};function re(Y,ie,oe=J){const{seed:G,k2sig:V}=ne(Y,ie,oe),te=t;return NFe(te.hash.outputLen,te.nByteLength,te.hmac)(G,V)}u.BASE._setWindowSize(8);function pe(Y,ie,oe,G=X){var $e;const V=Y;if(ie=$p("msgHash",ie),oe=$p("publicKey",oe),"strict"in G)throw new Error("options.strict was renamed to lowS");const{lowS:te,prehash:ae}=G;let he,Ce;try{if(typeof V=="string"||z3(V))try{he=N.fromDER(V)}catch(it){if(!(it instanceof Xv.Err))throw it;he=N.fromCompact(V)}else if(typeof V=="object"&&typeof V.r=="bigint"&&typeof V.s=="bigint"){const{r:it,s:tt}=V;he=new N(it,tt)}else throw new Error("PARSE");Ce=u.fromHex(oe)}catch(it){if(it.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(te&&he.hasHighS())return!1;ae&&(ie=t.hash(ie));const{r:ce,s:ge}=he,Ae=L(ie),ye=c(ge),je=l(Ae*ye),Ie=l(ce*ye),Re=($e=u.BASE.multiplyAndAddUnsafe(Ce,je,Ie))==null?void 0:$e.toAffine();return Re?l(Re.x)===ce:!1}return{CURVE:t,getPublicKey:P,getSharedSecret:F,sign:re,verify:pe,ProjectivePoint:u,Signature:N,utils:I}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function cjt(e){return{hash:e,hmac:(t,...n)=>uoe(e,t,XM(...n)),randomBytes:SPe}}function ujt(e,t){const n=r=>ljt({...e,...cjt(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kFe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),xge=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),djt=BigInt(1),Cee=BigInt(2),gge=(e,t)=>(e+t/Cee)/t;function fjt(e){const t=kFe,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=yh(d,n,t)*d%t,x=yh(f,n,t)*d%t,g=yh(x,Cee,t)*u%t,v=yh(g,s,t)*g%t,w=yh(v,a,t)*v%t,C=yh(w,l,t)*w%t,N=yh(C,c,t)*C%t,I=yh(N,l,t)*w%t,P=yh(I,n,t)*d%t,R=yh(P,o,t)*v%t,F=yh(R,r,t)*u%t,U=yh(F,Cee,t);if(!See.eql(See.sqr(U),e))throw new Error("Cannot find square root");return U}const See=J7t(kFe,void 0,void 0,{sqrt:fjt}),xoe=ujt({a:BigInt(0),b:BigInt(7),Fp:See,n:xge,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=xge,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-djt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=gge(a*e,t),c=gge(-r*e,t);let u=Hd(e-l*n-c*s,t),d=Hd(-l*r-c*a,t);const f=u>o,x=d>o;if(f&&(u=t-u),x&&(d=t-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:x,k2:d}}}},c$);BigInt(0);xoe.ProjectivePoint;const hjt=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:xoe},Symbol.toStringTag,{value:"Module"}));var pV;const A1=(pV=xoe)!==null&&pV!==void 0?pV:hjt,bge=BigInt("0xffffffffffffffff"),$E=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),pjt=A1.CURVE.n,mjt=pjt/BigInt(2),xjt={type:"object",required:["crypto","id","version","address"],properties:{crypto:{type:"object",required:["cipher","ciphertext","cipherparams","kdf","kdfparams","mac"],properties:{cipher:{type:"string"},ciphertext:{type:"string"},cipherparams:{type:"object"},kdf:{type:"string"},kdfparams:{type:"object"},salt:{type:"string"},mac:{type:"string"}}},id:{type:"string"},version:{type:"number"},address:{type:"string"}}};var hR;(function(e){e[e.Mainnet=1]="Mainnet",e[e.Goerli=5]="Goerli",e[e.Sepolia=11155111]="Sepolia"})(hR||(hR={}));var so;(function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.ArrowGlacier="arrowGlacier",e.GrayGlacier="grayGlacier",e.MergeForkIdTransition="mergeForkIdTransition",e.Merge="merge",e.Shanghai="shanghai",e.ShardingForkDev="shardingFork"})(so||(so={}));var yge;(function(e){e.ProofOfStake="pos",e.ProofOfWork="pow",e.ProofOfAuthority="poa"})(yge||(yge={}));var vge;(function(e){e.Ethash="ethash",e.Clique="clique",e.Casper="casper"})(vge||(vge={}));var xu;(function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.ArbitrumOne="arbitrum-one",e.xDaiChain="x-dai-chain",e.OptimisticKovan="optimistic-kovan",e.OptimisticEthereum="optimistic-ethereum"})(xu||(xu={}));var Gh;(function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Uint8Array=2]="Uint8Array",e[e.PrefixedHexString=3]="PrefixedHexString"})(Gh||(Gh={}));const TFe=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Yae(e)?e.slice(2):e};function gjt(e){return!e||e==="0x0"?"0x0000000000000000":Yae(e)?`0x${TFe(e).padStart(16,"0")}`:`0x${e.padStart(16,"0")}`}const IFe=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};function bjt(e,t=!0){var n,r;const{name:s,config:a,difficulty:o,mixHash:l,gasLimit:c,coinbase:u,baseFeePerGas:d}=e;let{extraData:f,timestamp:x,nonce:g}=e;const v=Number(x),{chainId:w}=a;if(f===""&&(f="0x"),Yae(x)||(x=IFe(parseInt(x))),g.length!==18&&(g=gjt(g)),a.eip155Block!==a.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const C={name:s,chainId:w,networkId:w,genesis:{timestamp:x,gasLimit:parseInt(c),difficulty:parseInt(o),nonce:g,extraData:f,mixHash:l,coinbase:u,baseFeePerGas:d},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:a.clique!==void 0?{type:"poa",algorithm:"clique",clique:{period:(n=a.clique.period)!==null&&n!==void 0?n:a.clique.blockperiodseconds,epoch:(r=a.clique.epoch)!==null&&r!==void 0?r:a.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},N={[so.Homestead]:{name:"homesteadBlock"},[so.Dao]:{name:"daoForkBlock"},[so.TangerineWhistle]:{name:"eip150Block"},[so.SpuriousDragon]:{name:"eip155Block"},[so.Byzantium]:{name:"byzantiumBlock"},[so.Constantinople]:{name:"constantinopleBlock"},[so.Petersburg]:{name:"petersburgBlock"},[so.Istanbul]:{name:"istanbulBlock"},[so.MuirGlacier]:{name:"muirGlacierBlock"},[so.Berlin]:{name:"berlinBlock"},[so.London]:{name:"londonBlock"},[so.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:t},[so.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[so.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},I=Object.keys(N).reduce((F,U)=>(F[N[U].name]=U,F),{}),P=Object.keys(a).filter(F=>I[F]!==void 0&&a[F]!==void 0&&a[F]!==null);if(C.hardforks=P.map(F=>({name:I[F],block:N[I[F]].isTimestamp===!0||typeof a[F]!="number"?null:a[F],timestamp:N[I[F]].isTimestamp===!0&&typeof a[F]=="number"?a[F]:void 0})).filter(F=>F.block!==null||F.timestamp!==void 0),C.hardforks.sort((F,U)=>{var L,z;return((L=F.block)!==null&&L!==void 0?L:1/0)-((z=U.block)!==null&&z!==void 0?z:1/0)}),C.hardforks.sort((F,U)=>{var L,z;return((L=F.timestamp)!==null&&L!==void 0?L:v)-((z=U.timestamp)!==null&&z!==void 0?z:v)}),a.terminalTotalDifficulty!==void 0){const F={name:so.Merge,ttd:a.terminalTotalDifficulty,block:null},U=C.hardforks.findIndex(L=>{var z;return((z=N[L.name])===null||z===void 0?void 0:z.postMerge)===!0});U!==-1?C.hardforks.splice(U,0,F):C.hardforks.push(F)}const R=C.hardforks.length>0?C.hardforks.slice(-1)[0]:void 0;return C.hardfork=R==null?void 0:R.name,C.hardforks.unshift({name:so.Chainstart,block:0}),C}function yjt(e,t,n){try{if(["config","difficulty","gasLimit","alloc"].some(r=>!(r in e)))throw new Error("Invalid format, expected geth genesis fields missing");return t!==void 0&&(e.name=t),bjt(e,n)}catch(r){throw new Error(`Error parsing parameters file: ${r.message}`)}}function PFe(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}const vjt=function(e){const t=IFe(e);return oo(`0x${PFe(t.slice(2))}`)},_o=function(e){var t;if(e==null)return new Uint8Array;if(e instanceof Uint8Array)return e;if(((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||Array.isArray(e))return Uint8Array.from(e);if(typeof e=="string"){if(!UPe(e))throw new Error(`Cannot convert string to Uint8Array. only supports 0x-prefixed hex strings and this string was given: ${e}`);return oo(PFe(TFe(e)))}if(typeof e=="number")return _o(nc(e));if(typeof e=="bigint"){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${e}`);let n=e.toString(16);return n.length%2&&(n=`0${n}`),_o(`0x${n}`)}if(e.toArray)return Uint8Array.from(e.toArray());throw new Error("invalid type")};function Ka(e){const t=Vi(e);return BigInt(t==="0x"?0:t)}function wjt(e){return _o(`0x${e.toString(16)}`)}const FFe=function(e){return new Uint8Array(e).fill(0)},Cjt=function(e,t,n){const r=FFe(t);return e.length<t?(r.set(e,t-e.length),r):e.subarray(-t)};function goe(e){if(!u2(e)){const t=`This method only supports Uint8Array but input was: ${e}`;throw new Error(t)}}const wge=function(e,t){return goe(e),Cjt(e,t)};function Sjt(e){let t=e[0];for(;e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e}const pR=function(e){return goe(e),Sjt(e)},ko=e=>`0x${e.toString(16)}`;function oa(e){return pR(wjt(e))}function Njt(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function Ajt(e){return e===BigInt(0)||e===BigInt(1)}const boe=function(e,t,n,r,s){const a=Njt(t,s);if(!Ajt(a))throw new Error("Invalid signature v value");return new A1.Signature(Ka(n),Ka(r)).addRecoveryBit(Number(a)).recoverPublicKey(e).toRawBytes(!1).slice(1)};function H6(e,t){if(e===null)return null;if(e===void 0)return;if(typeof e=="string"&&!UPe(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if(typeof e=="number"&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const n=_o(e);switch(t){case Gh.Uint8Array:return n;case Gh.BigInt:return Ka(n);case Gh.Number:{const r=Ka(n);if(r>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(r)}case Gh.PrefixedHexString:return Vi(n);default:throw new Error("unknown outputType")}}var Tp={},Cge;function jjt(){if(Cge)return Tp;Cge=1,Object.defineProperty(Tp,"__esModule",{value:!0}),Tp.RLP=Tp.utils=Tp.decode=Tp.encode=void 0;function e(N){if(Array.isArray(N)){const P=[];let R=0;for(let F=0;F<N.length;F++){const U=e(N[F]);P.push(U),R+=U.length}return d(r(R,192),...P)}const I=C(N);return I.length===1&&I[0]<128?I:d(r(I.length,128),I)}Tp.encode=e;function t(N,I,P){if(P>N.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return N.slice(I,P)}function n(N){if(N[0]===0)throw new Error("invalid RLP: extra zeros");return c(l(N))}function r(N,I){if(N<56)return Uint8Array.from([N+I]);const P=x(N),R=P.length/2,F=x(I+55+R);return Uint8Array.from(u(F+P))}function s(N,I=!1){if(typeof N>"u"||N===null||N.length===0)return Uint8Array.from([]);const P=C(N),R=a(P);if(I)return R;if(R.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return R.data}Tp.decode=s;function a(N){let I,P,R,F,U;const L=[],z=N[0];if(z<=127)return{data:N.slice(0,1),remainder:N.slice(1)};if(z<=183){if(I=z-127,z===128?R=Uint8Array.from([]):R=t(N,1,I),I===2&&R[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:R,remainder:N.slice(I)}}else if(z<=191){if(P=z-182,N.length-1<P)throw new Error("invalid RLP: not enough bytes for string length");if(I=n(t(N,1,P)),I<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return R=t(N,P,I+P),{data:R,remainder:N.slice(I+P)}}else if(z<=247){for(I=z-191,F=t(N,1,I);F.length;)U=a(F),L.push(U.data),F=U.remainder;return{data:L,remainder:N.slice(I)}}else{if(P=z-246,I=n(t(N,1,P)),I<56)throw new Error("invalid RLP: encoded list too short");const Q=P+I;if(Q>N.length)throw new Error("invalid RLP: total length is larger than the data");for(F=t(N,P,Q);F.length;)U=a(F),L.push(U.data),F=U.remainder;return{data:L,remainder:N.slice(Q)}}}const o=Array.from({length:256},(N,I)=>I.toString(16).padStart(2,"0"));function l(N){let I="";for(let P=0;P<N.length;P++)I+=o[N[P]];return I}function c(N){const I=Number.parseInt(N,16);if(Number.isNaN(I))throw new Error("Invalid byte sequence");return I}function u(N){if(typeof N!="string")throw new TypeError("hexToBytes: expected string, got "+typeof N);if(N.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const I=new Uint8Array(N.length/2);for(let P=0;P<I.length;P++){const R=P*2;I[P]=c(N.slice(R,R+2))}return I}function d(...N){if(N.length===1)return N[0];const I=N.reduce((R,F)=>R+F.length,0),P=new Uint8Array(I);for(let R=0,F=0;R<N.length;R++){const U=N[R];P.set(U,F),F+=U.length}return P}function f(N){return new TextEncoder().encode(N)}function x(N){if(N<0)throw new Error("Invalid integer as argument, must be unsigned!");const I=N.toString(16);return I.length%2?`0${I}`:I}function g(N){return N.length%2?`0${N}`:N}function v(N){return N.length>=2&&N[0]==="0"&&N[1]==="x"}function w(N){return typeof N!="string"?N:v(N)?N.slice(2):N}function C(N){if(N instanceof Uint8Array)return N;if(typeof N=="string")return v(N)?u(g(w(N))):f(N);if(typeof N=="number"||typeof N=="bigint")return N?u(x(N)):Uint8Array.from([]);if(N==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof N)}return Tp.utils={bytesToHex:l,concatBytes:d,hexToBytes:u,utf8ToBytes:f},Tp.RLP={encode:e,decode:s},Tp}var Kh=jjt(),mV={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */var Sge;function Ejt(){return Sge||(Sge=1,function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="1.2.2";function n(){for(var z=0,Q=new Array(256),ne=0;ne!=256;++ne)z=ne,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,Q[ne]=z;return typeof Int32Array<"u"?new Int32Array(Q):Q}var r=n();function s(z){var Q=0,ne=0,J=0,X=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(J=0;J!=256;++J)X[J]=z[J];for(J=0;J!=256;++J)for(ne=z[J],Q=256+J;Q<4096;Q+=256)ne=X[Q]=ne>>>8^z[ne&255];var re=[];for(J=1;J!=16;++J)re[J-1]=typeof Int32Array<"u"?X.subarray(J*256,J*256+256):X.slice(J*256,J*256+256);return re}var a=s(r),o=a[0],l=a[1],c=a[2],u=a[3],d=a[4],f=a[5],x=a[6],g=a[7],v=a[8],w=a[9],C=a[10],N=a[11],I=a[12],P=a[13],R=a[14];function F(z,Q){for(var ne=Q^-1,J=0,X=z.length;J<X;)ne=ne>>>8^r[(ne^z.charCodeAt(J++))&255];return~ne}function U(z,Q){for(var ne=Q^-1,J=z.length-15,X=0;X<J;)ne=R[z[X++]^ne&255]^P[z[X++]^ne>>8&255]^I[z[X++]^ne>>16&255]^N[z[X++]^ne>>>24]^C[z[X++]]^w[z[X++]]^v[z[X++]]^g[z[X++]]^x[z[X++]]^f[z[X++]]^d[z[X++]]^u[z[X++]]^c[z[X++]]^l[z[X++]]^o[z[X++]]^r[z[X++]];for(J+=15;X<J;)ne=ne>>>8^r[(ne^z[X++])&255];return~ne}function L(z,Q){for(var ne=Q^-1,J=0,X=z.length,re=0,pe=0;J<X;)re=z.charCodeAt(J++),re<128?ne=ne>>>8^r[(ne^re)&255]:re<2048?(ne=ne>>>8^r[(ne^(192|re>>6&31))&255],ne=ne>>>8^r[(ne^(128|re&63))&255]):re>=55296&&re<57344?(re=(re&1023)+64,pe=z.charCodeAt(J++)&1023,ne=ne>>>8^r[(ne^(240|re>>8&7))&255],ne=ne>>>8^r[(ne^(128|re>>2&63))&255],ne=ne>>>8^r[(ne^(128|pe>>6&15|(re&3)<<4))&255],ne=ne>>>8^r[(ne^(128|pe&63))&255]):(ne=ne>>>8^r[(ne^(224|re>>12&15))&255],ne=ne>>>8^r[(ne^(128|re>>6&63))&255],ne=ne>>>8^r[(ne^(128|re&63))&255]);return~ne}t.table=r,t.bstr=F,t.buf=U,t.str=L})}(mV)),mV}var _jt=Ejt();const kjt=ki(_jt),Tjt={name:"goerli",chainId:5,networkId:5,defaultHardfork:"merge",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:10485760,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://goerli.etherscan.io/block/7382818",name:"merge",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]},Ijt={name:"mainnet",chainId:1,networkId:1,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:17179869184,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://etherscan.io/block/15537393",name:"merge",ttd:"58750000000000000000000",block:15537394,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]},Pjt={name:"sepolia",chainId:11155111,networkId:11155111,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://sepolia.etherscan.io/block/1450408",name:"merge",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]},Fjt={name:"EIP-1153",number:1153,comment:"Transient Storage",url:"https://eips.ethereum.org/EIPS/eip-1153",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}},vm:{},pow:{}},Ojt={name:"EIP-1559",number:1559,comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}},gasPrices:{},vm:{},pow:{}},Mjt={name:"EIP-2315",number:2315,comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:"Draft",minimumHardfork:"istanbul",gasConfig:{},gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}},vm:{},pow:{}},Rjt={name:"EIP-2537",number:2537,comment:"BLS12-381 precompiles",url:"https://eips.ethereum.org/EIPS/eip-2537",status:"Draft",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{Bls12381G1AddGas:{v:600,d:"Gas cost of a single BLS12-381 G1 addition precompile-call"},Bls12381G1MulGas:{v:12e3,d:"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},Bls12381G2AddGas:{v:4500,d:"Gas cost of a single BLS12-381 G2 addition precompile-call"},Bls12381G2MulGas:{v:55e3,d:"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},Bls12381PairingBaseGas:{v:115e3,d:"Base gas cost of BLS12-381 pairing check"},Bls12381PairingPerPairGas:{v:23e3,d:"Per-pair gas cost of BLS12-381 pairing check"},Bls12381MapG1Gas:{v:5500,d:"Gas cost of BLS12-381 map field element to G1"},Bls12381MapG2Gas:{v:11e4,d:"Gas cost of BLS12-381 map field element to G2"},Bls12381MultiExpGasDiscount:{v:[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],d:"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},vm:{},pow:{}},Ljt={name:"EIP-2565",number:2565,comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:"Final",minimumHardfork:"byzantium",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}},vm:{},pow:{}},Djt={name:"EIP-2718",comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{},vm:{},pow:{}},Bjt={name:"EIP-2929",comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}},vm:{},pow:{}},$jt={name:"EIP-2930",comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:"Final",minimumHardfork:"istanbul",requiredEIPs:[2718,2929],gasConfig:{},gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}},vm:{},pow:{}},Ujt={name:"EIP-3198",number:3198,comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}},vm:{},pow:{}},zjt={name:"EIP-3529",comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}},vm:{},pow:{}},Hjt={name:"EIP-3540",number:3540,comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:"Review",minimumHardfork:"london",requiredEIPs:[3541],gasConfig:{},gasPrices:{},vm:{},pow:{}},Vjt={name:"EIP-3541",comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:"Final",minimumHardfork:"berlin",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Wjt={name:"EIP-3554",comment:"Reduction in refunds",url:"Difficulty Bomb Delay to December 1st 2021",status:"Final",minimumHardfork:"muirGlacier",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}},qjt={name:"EIP-3607",number:3607,comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:"Final",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Gjt={name:"EIP-3651",number:3198,comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:"Review",minimumHardfork:"london",requiredEIPs:[2929],gasConfig:{},gasPrices:{},vm:{},pow:{}},Kjt={name:"EIP-3670",number:3670,comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:"london",requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}},Yjt={name:"EIP-3675",number:3675,comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Final",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Xjt={name:"EIP-3855",number:3855,comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}},vm:{},pow:{}},Qjt={name:"EIP-3860",number:3860,comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:"Review",minimumHardfork:"spuriousDragon",requiredEIPs:[],gasConfig:{},gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}},pow:{}},Zjt={name:"EIP-4345",number:4345,comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}},Jjt={name:"EIP-4399",number:4399,comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:"Review",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},e9t={name:"EIP-5133",number:5133,comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:"Draft",minimumHardfork:"grayGlacier",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}},V6={1153:Fjt,1559:Ojt,2315:Mjt,2537:Rjt,2565:Ljt,2718:Djt,2929:Bjt,2930:$jt,3198:Ujt,3529:zjt,3540:Hjt,3541:Vjt,3554:Wjt,3607:qjt,3651:Gjt,3670:Kjt,3675:Yjt,3855:Xjt,3860:Qjt,4345:Zjt,4399:Jjt,5133:e9t},t9t={name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:"",gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},tierStep:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},sha3:{v:30,d:"Base fee of the SHA3 opcode"},sha3Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be"},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations"},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}},n9t={name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{}},r9t={name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:"Final",gasConfig:{},gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}},vm:{},pow:{}},s9t={name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:"Final",gasConfig:{},gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{},pow:{}},i9t={name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:"Final",gasConfig:{},gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}},pow:{}},a9t={name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:"Final",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},vm:{},pow:{minerReward:{v:"3000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}},o9t={name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},vm:{},pow:{minerReward:{v:"2000000000000000000",d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}},l9t={name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}},vm:{},pow:{}},c9t={name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:"Final",gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}},vm:{},pow:{}},u9t={name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}},d9t={name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:"Final",eips:[2565,2929,2718,2930]},f9t={name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:"Final",eips:[1559,3198,3529,3541]},h9t={name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:"Final",eips:[3651,3855,3860,4895]},p9t={name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:"Final",eips:[4345],gasConfig:{},gasPrices:{},vm:{},pow:{}},m9t={name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:"Draft",eips:[5133],gasConfig:{},gasPrices:{},vm:{},pow:{}},x9t={name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Draft",eips:[]},g9t={name:"merge",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:"Final",consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]},b9t={chainstart:t9t,homestead:r9t,dao:n9t,tangerineWhistle:s9t,spuriousDragon:i9t,byzantium:a9t,constantinople:o9t,petersburg:l9t,istanbul:c9t,muirGlacier:u9t,berlin:d9t,london:f9t,shanghai:h9t,arrowGlacier:p9t,grayGlacier:m9t,mergeForkIdTransition:x9t,merge:g9t},{buf:y9t}=kjt;class Zl extends eoe{static custom(t,n={}){var r;const s=(r=n.baseChain)!==null&&r!==void 0?r:"mainnet",a=Object.assign({},Zl._getChainParams(s));if(a.name="custom-chain",typeof t!="string")return new Zl(Object.assign({chain:Object.assign(Object.assign({},a),t)},n));if(t===xu.PolygonMainnet)return Zl.custom({name:xu.PolygonMainnet,chainId:137,networkId:137},n);if(t===xu.PolygonMumbai)return Zl.custom({name:xu.PolygonMumbai,chainId:80001,networkId:80001},n);if(t===xu.ArbitrumRinkebyTestnet)return Zl.custom({name:xu.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},n);if(t===xu.ArbitrumOne)return Zl.custom({name:xu.ArbitrumOne,chainId:42161,networkId:42161},n);if(t===xu.xDaiChain)return Zl.custom({name:xu.xDaiChain,chainId:100,networkId:100},n);if(t===xu.OptimisticKovan)return Zl.custom({name:xu.OptimisticKovan,chainId:69,networkId:69},Object.assign({hardfork:so.Berlin},n));if(t===xu.OptimisticEthereum)return Zl.custom({name:xu.OptimisticEthereum,chainId:10,networkId:10},Object.assign({hardfork:so.Berlin},n));throw new Error(`Custom chain ${t} not supported`)}static fromGethGenesis(t,{chain:n,eips:r,genesisHash:s,hardfork:a,mergeForkIdPostMerge:o}){var l;const c=yjt(t,n,o),u=new Zl({chain:(l=c.name)!==null&&l!==void 0?l:"custom",customChains:[c],eips:r,hardfork:a??c.hardfork});return s!==void 0&&u.setForkHashes(s),u}static isSupportedChainId(t){return!!this._getInitializedChains().names[t.toString()]}static _getChainParams(t,n){let r=t;const s=this._getInitializedChains(n);if(typeof r=="number"||typeof r=="bigint"){if(r=r.toString(),s.names[r]){const a=s.names[r];return s[a]}throw new Error(`Chain with ID ${r} not supported`)}if(s[r]!==void 0)return s[r];throw new Error(`Chain with name ${r} not supported`)}constructor(t){var n,r;super(),this._eips=[],this._customChains=(n=t.customChains)!==null&&n!==void 0?n:[],this._chainParams=this.setChain(t.chain),this.DEFAULT_HARDFORK=(r=this._chainParams.defaultHardfork)!==null&&r!==void 0?r:so.Merge,this.HARDFORK_CHANGES=this.hardforks().map(s=>[s.name,b9t[s.name]]),this._hardfork=this.DEFAULT_HARDFORK,t.hardfork!==void 0&&this.setHardfork(t.hardfork),t.eips&&this.setEIPs(t.eips)}setChain(t){if(typeof t=="number"||typeof t=="bigint"||typeof t=="string")this._chainParams=Zl._getChainParams(t,this._customChains);else if(typeof t=="object"){if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const n=["networkId","genesis","hardforks","bootstrapNodes"];for(const r of n)if(!(r in t))throw new Error(`Missing required chain parameter: ${r}`);this._chainParams=t}else throw new Error("Wrong input format");for(const n of this.hardforks())if(n.block===void 0)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(t){let n=!1;for(const r of this.HARDFORK_CHANGES)r[0]===t&&(this._hardfork!==t&&(this._hardfork=t,this.emit("hardforkChanged",t)),n=!0);if(!n)throw new Error(`Hardfork with name ${t} not supported`)}getHardforkByBlockNumber(t,n,r){const s=H6(t,Gh.BigInt),a=H6(n,Gh.BigInt),o=H6(r,Gh.Number),l=this.hardforks().filter(g=>g.block!==null||g.ttd!==null&&g.ttd!==void 0||g.timestamp!==void 0),c=l.findIndex(g=>g.ttd!==null&&g.ttd!==void 0);if(l.slice(c+1).findIndex(g=>g.ttd!==null&&g.ttd!==void 0)>=0)throw Error("More than one merge hardforks found with ttd specified");let d=l.findIndex(g=>g.block!==null&&g.block>s||o!==void 0&&Number(g.timestamp)>o);if(d===-1)d=l.length;else if(d===0)throw Error("Must have at least one hardfork at block 0");if(o===void 0){const g=l.slice(0,d).reverse().findIndex(v=>v.block!==null||v.ttd!==void 0);d-=g}if(d-=1,l[d].block===null&&l[d].timestamp===void 0)(a==null||BigInt(l[d].ttd)>a)&&(d-=1);else if(c>=0&&a!==void 0&&a!==null){if(d>=c&&BigInt(l[c].ttd)>a)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(d<c&&BigInt(l[c].ttd)<=a)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const f=d;for(;d<l.length-1&&!(l[d].block!==l[d+1].block||l[d].timestamp!==l[d+1].timestamp);d+=1);if(o){if(l.slice(0,f).reduce((w,C)=>{var N;return Math.max(Number((N=C.timestamp)!==null&&N!==void 0?N:"0"),w)},0)>o)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(l.slice(d+1).reduce((w,C)=>{var N;return Math.min(Number((N=C.timestamp)!==null&&N!==void 0?N:o),w)},o)<o)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return l[d].name}setHardforkByBlockNumber(t,n,r){const s=this.getHardforkByBlockNumber(t,n,r);return this.setHardfork(s),s}_getHardfork(t){const n=this.hardforks();for(const r of n)if(r.name===t)return r;return null}setEIPs(t=[]){for(const n of t){if(!(n in V6))throw new Error(`${n} not supported`);const r=this.gteHardfork(V6[n].minimumHardfork);if(!r)throw new Error(`${n} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${r}`);if(V6[n].requiredEIPs!==void 0){for(const s of V6[n].requiredEIPs)if(!(t.includes(s)||this.isActivatedEIP(s)))throw new Error(`${n} requires EIP ${s}, but is not included in the EIP list`)}}this._eips=t}param(t,n){let r;for(const s of this._eips)if(r=this.paramByEIP(t,n,s),r!==void 0)return r;return this.paramByHardfork(t,n,this._hardfork)}paramByHardfork(t,n,r){let s=null;for(const a of this.HARDFORK_CHANGES){if("eips"in a[1]){const o=a[1].eips;for(const l of o){const c=this.paramByEIP(t,n,l);s=typeof c=="bigint"?c:s}}else{if(a[1][t]===void 0)throw new Error(`Topic ${t} not defined`);a[1][t][n]!==void 0&&(s=a[1][t][n].v)}if(a[0]===r)break}return BigInt(s??0)}paramByEIP(t,n,r){if(!(r in V6))throw new Error(`${r} not supported`);const s=V6[r];if(!(t in s))throw new Error(`Topic ${t} not defined`);if(s[t][n]===void 0)return;const a=s[t][n].v;return BigInt(a)}paramByBlock(t,n,r,s,a){const o=this.getHardforkByBlockNumber(r,s,a);return this.paramByHardfork(t,n,o)}isActivatedEIP(t){if(this.eips().includes(t))return!0;for(const n of this.HARDFORK_CHANGES){const r=n[1];if(this.gteHardfork(r.name)&&"eips"in r&&r.eips.includes(t))return!0}return!1}hardforkIsActiveOnBlock(t,n){const r=H6(n,Gh.BigInt),s=t??this._hardfork,a=this.hardforkBlock(s);return typeof a=="bigint"&&a!==BigInt(0)&&r>=a}activeOnBlock(t){return this.hardforkIsActiveOnBlock(null,t)}hardforkGteHardfork(t,n){const r=t??this._hardfork,s=this.hardforks();let a=-1,o=-1,l=0;for(const c of s)c.name===r&&(a=l),c.name===n&&(o=l),l+=1;return a>=o&&o!==-1}gteHardfork(t){return this.hardforkGteHardfork(null,t)}hardforkBlock(t){var n;const r=t??this._hardfork,s=(n=this._getHardfork(r))===null||n===void 0?void 0:n.block;return s==null?null:BigInt(s)}hardforkTimestamp(t){var n;const r=t??this._hardfork,s=(n=this._getHardfork(r))===null||n===void 0?void 0:n.timestamp;return s==null?null:BigInt(s)}eipBlock(t){for(const n of this.HARDFORK_CHANGES){const r=n[1];if("eips"in r&&r.eips.includes(t))return this.hardforkBlock(typeof n[0]=="number"?String(n[0]):n[0])}return null}hardforkTTD(t){var n;const r=t??this._hardfork,s=(n=this._getHardfork(r))===null||n===void 0?void 0:n.ttd;return s==null?null:BigInt(s)}isHardforkBlock(t,n){const r=H6(t,Gh.BigInt),s=n??this._hardfork,a=this.hardforkBlock(s);return typeof a=="bigint"&&a!==BigInt(0)?a===r:!1}nextHardforkBlockOrTimestamp(t){var n,r,s;const a=(n=t)!==null&&n!==void 0?n:this._hardfork,o=this.hardforks();let l=o.findIndex(f=>f.name===a);if(a===so.Merge&&(l-=1),l<0)return null;let c=(r=o[l].timestamp)!==null&&r!==void 0?r:o[l].block;c=c!=null?Number(c):null;const u=o.slice(l+1).find(f=>{var x;let g=(x=f.timestamp)!==null&&x!==void 0?x:f.block;return g=g!=null?Number(g):null,f.name!==so.Merge&&g!==null&&g!==void 0&&g!==c});if(u===void 0)return null;const d=(s=u.timestamp)!==null&&s!==void 0?s:u.block;return d==null?null:BigInt(d)}nextHardforkBlock(t){var n;const r=(n=t)!==null&&n!==void 0?n:this._hardfork;let s=this.hardforkBlock(r);if(s===null&&r===so.Merge){const o=this.hardforks(),l=o.findIndex(c=>c.ttd!==null&&c.ttd!==void 0);if(l<0)throw Error("Merge hardfork should have been found");s=this.hardforkBlock(o[l-1].name)}return s===null?null:this.hardforks().reduce((o,l)=>{const c=BigInt(l.block===null||l.ttd!==void 0&&l.ttd!==null?0:l.block);return c>s&&o===null?c:o},null)}isNextHardforkBlock(t,n){const r=H6(t,Gh.BigInt),s=n??this._hardfork,a=this.nextHardforkBlock(s);return a===null?!1:a===r}_calcForkHash(t,n){let r=new Uint8Array,s=0;for(const l of this.hardforks()){const{block:c,timestamp:u,name:d}=l;let f=u??c;if(f=f!==null?Number(f):null,typeof f=="number"&&f!==0&&f!==s&&d!==so.Merge){const x=oo(f.toString(16).padStart(16,"0"));r=gd(r,x),s=f}if(l.name===t)break}const a=gd(n,r);return Vi(vjt(y9t(a)>>>0))}forkHash(t,n){const r=t??this._hardfork,s=this._getHardfork(r);if(s===null||(s==null?void 0:s.block)===null&&(s==null?void 0:s.timestamp)===void 0&&(s==null?void 0:s.ttd)===void 0){const a="No fork hash calculation possible for future hardfork";throw new Error(a)}if((s==null?void 0:s.forkHash)!==null&&(s==null?void 0:s.forkHash)!==void 0)return s.forkHash;if(!n)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(r,n)}hardforkForForkHash(t){const n=this.hardforks().filter(r=>r.forkHash===t);return n.length>=1?n[n.length-1]:null}setForkHashes(t){var n;for(const r of this.hardforks()){const s=(n=r.timestamp)!==null&&n!==void 0?n:r.block;(r.forkHash===null||r.forkHash===void 0)&&(s!=null||typeof r.ttd<"u")&&(r.forkHash=this.forkHash(r.name,t))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const t=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.type),r[0]===t)break;return n??this._chainParams.consensus.type}consensusAlgorithm(){const t=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.algorithm),r[0]===t)break;return n??this._chainParams.consensus.algorithm}consensusConfig(){var t;const n=this.hardfork();let r;for(const s of this.HARDFORK_CHANGES)if("consensus"in s[1]&&(r=s[1].consensus[s[1].consensus.algorithm]),s[0]===n)break;return(t=r??this._chainParams.consensus[this.consensusAlgorithm()])!==null&&t!==void 0?t:{}}copy(){const t=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return t.removeAllListeners(),t}static _getInitializedChains(t){const n={};for(const[s,a]of Object.entries(hR))n[a]=s.toLowerCase();const r={mainnet:Ijt,goerli:Tjt,sepolia:Pjt};if(t)for(const s of t){const{name:a}=s;n[s.chainId.toString()]=a,r[a]=s}return r.names=n,r}}var N0;(function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"})(N0||(N0={}));function v9t(e){if(e.length===0)return!0;const t=e[0];return!!Array.isArray(t)}function w9t(e){return!v9t(e)}class l4{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new l4(FFe(20))}equals(t){return t$(this.buf,t.buf)}isZero(){return this.equals(l4.zero())}toString(){return Vi(this.buf)}toArray(){return this.buf}static publicToAddress(t,n=!1){let r=t;if(goe(r),n&&r.length!==64&&(r=A1.ProjectivePoint.fromHex(r).toRawBytes(!1).slice(1)),r.length!==64)throw new Error("Expected pubKey to be of length 64");return od(r).slice(-20)}}const C9t=(e,t)=>{const n=e.param("vm","maxInitCodeSize");if(n&&BigInt(t)>n)throw new Error(`the initcode size of this transaction is too large: it is ${t} while the max is ${e.param("vm","maxInitCodeSize")}`)},OFe=e=>{let t,n;if(w9t(e)){t=e;const r=[];for(let s=0;s<e.length;s+=1){const a=e[s],o=_o(a.address),l=[];for(let c=0;c<a.storageKeys.length;c+=1)l.push(_o(a.storageKeys[c]));r.push([o,l])}n=r}else{n=e??[];const r=[];for(let s=0;s<n.length;s+=1){const a=n[s],o=Vi(a[0]),l=[];for(let u=0;u<a[1].length;u+=1)l.push(Vi(a[1][u]));const c={address:o,storageKeys:l};r.push(c)}t=r}return{AccessListJSON:t,accessList:n}},MFe=e=>{for(let t=0;t<e.length;t+=1){const n=e[t],r=n[0],s=n[1];if(n[2]!==void 0)throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(r.length!==20)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let a=0;a<s.length;a+=1)if(s[a].length!==32)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},RFe=e=>{const t=[];for(let n=0;n<e.length;n+=1){const r=e[n],s={address:Vi(wge(r[0],20)),storageKeys:[]},a=r&&r[1];for(let o=0;o<a.length;o+=1){const l=a[o];s.storageKeys.push(Vi(wge(l,32)))}t.push(s)}return t},LFe=(e,t)=>{const n=t.param("gasPrices","accessListStorageKeyCost"),r=t.param("gasPrices","accessListAddressCost");let s=0;for(let o=0;o<e.length;o+=1){const c=e[o][1];s+=c.length}return e.length*Number(r)+s*Number(n)};class cN{constructor(t,n){var r,s;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=hR.Mainnet,this.DEFAULT_HARDFORK=so.Merge;const{nonce:a,gasLimit:o,to:l,value:c,data:u,v:d,r:f,s:x,type:g}=t;this._type=Number(Ka(_o(g))),this.txOptions=n;const v=_o(l===""?"0x":l),w=_o(d===""?"0x":d),C=_o(f===""?"0x":f),N=_o(x===""?"0x":x);this.nonce=Ka(_o(a===""?"0x":a)),this.gasLimit=Ka(_o(o===""?"0x":o)),this.to=v.length>0?new l4(v):void 0,this.value=Ka(_o(c===""?"0x":c)),this.data=_o(u===""?"0x":u),this.v=w.length>0?Ka(w):void 0,this.r=C.length>0?Ka(C):void 0,this.s=N.length>0?Ka(N):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const I=this.to===void 0||this.to===null,P=(r=n.allowUnlimitedInitCodeSize)!==null&&r!==void 0?r:!1,R=(s=n.common)!==null&&s!==void 0?s:this._getCommon();I&&R.isActivatedEIP(3860)&&!P&&C9t(R,this.data.length)}get type(){return this._type}supports(t){return this.activeCapabilities.includes(t)}validate(t=!1){const n=[];return this.getBaseFee()>this.gasLimit&&n.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),this.isSigned()&&!this.verifySignature()&&n.push("Invalid Signature"),t?n:n.length===0}_validateYParity(){const{v:t}=this;if(t!==void 0&&t!==BigInt(0)&&t!==BigInt(1)){const n=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(n)}}_validateHighS(){const{s:t}=this;if(this.common.gteHardfork("homestead")&&t!==void 0&&t>mjt){const n=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(n)}}getBaseFee(){const t=this.common.param("gasPrices","tx");let n=this.getDataFee();if(t&&(n+=t),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const r=this.common.param("gasPrices","txCreation");r&&(n+=r)}return n}getDataFee(){const t=this.common.param("gasPrices","txDataZero"),n=this.common.param("gasPrices","txDataNonZero");let r=BigInt(0);for(let s=0;s<this.data.length;s+=1)this.data[s]===0?r+=t:r+=n;if((this.to===void 0||this.to===null)&&this.common.isActivatedEIP(3860)){const s=BigInt(Math.ceil(this.data.length/32)),a=this.common.param("gasPrices","initCodeWordCost")*s;r+=a}return r}toCreationAddress(){return this.to===void 0||this.to.buf.length===0}isSigned(){const{v:t,r:n,s:r}=this;return!(t===void 0||n===void 0||r===void 0)}verifySignature(){try{const t=this.getSenderPublicKey();return pR(t).length!==0}catch{return!1}}getSenderAddress(){return new l4(l4.publicToAddress(this.getSenderPublicKey()))}sign(t){if(t.length!==32){const c=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(c)}let n=!1;this.type===0&&this.common.gteHardfork("spuriousDragon")&&!this.supports(N0.EIP155ReplayProtection)&&(this.activeCapabilities.push(N0.EIP155ReplayProtection),n=!0);const r=this.getMessageToSign(!0),{v:s,r:a,s:o}=this._ecsign(r,t),l=this._processSignature(s,a,o);if(n){const c=this.activeCapabilities.indexOf(N0.EIP155ReplayProtection);c>-1&&this.activeCapabilities.splice(c,1)}return l}_getCommon(t,n){var r,s,a,o;if(n!==void 0){const l=Ka(_o(n));if(t){if(t.chainId()!==l){const c=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(c)}return t.copy()}return Zl.isSupportedChainId(l)?new Zl({chain:l,hardfork:this.DEFAULT_HARDFORK}):Zl.custom({name:"custom-chain",networkId:l,chainId:l},{baseChain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}if(t!=null&&t.copy&&typeof(t==null?void 0:t.copy)=="function")return t.copy();if(t){const l=typeof t.hardfork=="function"?t.hardfork():t.hardfork;return Zl.custom({name:"custom-chain",networkId:t.networkId?t.networkId():(s=BigInt((r=t.customChain)===null||r===void 0?void 0:r.networkId))!==null&&s!==void 0?s:void 0,chainId:t.chainId?t.chainId():(o=BigInt((a=t.customChain)===null||a===void 0?void 0:a.chainId))!==null&&o!==void 0?o:void 0},{baseChain:this.DEFAULT_CHAIN,hardfork:l||this.DEFAULT_HARDFORK})}return new Zl({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}_validateCannotExceedMaxInteger(t,n=256,r=!1){for(const[s,a]of Object.entries(t))switch(n){case 64:if(r){if(a!==void 0&&a>=bge){const o=this._errorMsg(`${s} cannot equal or exceed MAX_UINT64 (2^64-1), given ${a}`);throw new Error(o)}}else if(a!==void 0&&a>bge){const o=this._errorMsg(`${s} cannot exceed MAX_UINT64 (2^64-1), given ${a}`);throw new Error(o)}break;case 256:if(r){if(a!==void 0&&a>=$E){const o=this._errorMsg(`${s} cannot equal or exceed MAX_INTEGER (2^256-1), given ${a}`);throw new Error(o)}}else if(a!==void 0&&a>$E){const o=this._errorMsg(`${s} cannot exceed MAX_INTEGER (2^256-1), given ${a}`);throw new Error(o)}break;default:{const o=this._errorMsg("unimplemented bits value");throw new Error(o)}}}static _validateNotArray(t){const n=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[r,s]of Object.entries(t))if(n.includes(r)&&Array.isArray(s))throw new Error(`${r} cannot be an array`)}_getSharedErrorPostfix(){let t="";try{t=this.isSigned()?Vi(this.hash()):"not available (unsigned)"}catch{t="error"}let n="";try{n=this.isSigned().toString()}catch{t="error"}let r="";try{r=this.common.hardfork()}catch{r="error"}let s=`tx type=${this.type} hash=${t} nonce=${this.nonce} value=${this.value} `;return s+=`signed=${n} hf=${r}`,s}_ecsign(t,n,r){const s=A1.sign(t,n),a=s.toCompactRawBytes(),o=a.subarray(0,32),l=a.subarray(32,64),c=r===void 0?BigInt(s.recovery+27):BigInt(s.recovery+35)+BigInt(r)*BigInt(2);return{r:o,s:l,v:c}}static fromSerializedTx(t,n={}){}static fromTxData(t,n={}){}}const Nee=2,xV=oo(Nee.toString(16).padStart(2,"0"));class Qv extends cN{static fromTxData(t,n={}){return new Qv(t,n)}static fromSerializedTx(t,n={}){if(!t$(t.subarray(0,1),xV))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${Nee}, received: ${Vi(t.subarray(0,1))}`);const r=Kh.RLP.decode(t.subarray(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Qv.fromValuesArray(r,n)}static fromValuesArray(t,n={}){if(t.length!==9&&t.length!==12)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[r,s,a,o,l,c,u,d,f,x,g,v]=t;return this._validateNotArray({chainId:r,v:x}),Xae({nonce:s,maxPriorityFeePerGas:a,maxFeePerGas:o,gasLimit:l,value:u,v:x,r:g,s:v}),new Qv({chainId:Ka(r),nonce:s,maxPriorityFeePerGas:a,maxFeePerGas:o,gasLimit:l,to:c,value:u,data:d,accessList:f??[],v:x!==void 0?Ka(x):void 0,r:g,s:v},n)}constructor(t,n={}){var r;super(Object.assign(Object.assign({},t),{type:Nee}),n),this.DEFAULT_HARDFORK="london";const{chainId:s,accessList:a,maxFeePerGas:o,maxPriorityFeePerGas:l}=t;if(this.common=this._getCommon(n.common,s),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const c=OFe(a??[]);if(this.accessList=c.accessList,this.AccessListJSON=c.AccessListJSON,MFe(this.accessList),this.maxFeePerGas=Ka(_o(o===""?"0x":o)),this.maxPriorityFeePerGas=Ka(_o(l===""?"0x":l)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),cN._validateNotArray(t),this.gasLimit*this.maxFeePerGas>$E){const d=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(d)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const d=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(d)}this._validateYParity(),this._validateHighS(),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(LFe(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(t=BigInt(0)){const n=this.maxPriorityFeePerGas,r=this.maxFeePerGas-t,a=(n<r?n:r)+t;return this.gasLimit*a+this.value}raw(){return[oa(this.chainId),oa(this.nonce),oa(this.maxPriorityFeePerGas),oa(this.maxFeePerGas),oa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),oa(this.value),this.data,this.accessList,this.v!==void 0?oa(this.v):Uint8Array.from([]),this.r!==void 0?oa(this.r):Uint8Array.from([]),this.s!==void 0?oa(this.s):Uint8Array.from([])]}serialize(){const t=this.raw();return gd(xV,Kh.RLP.encode(t))}getMessageToSign(t=!0){const n=this.raw().slice(0,9),r=gd(xV,Kh.RLP.encode(n));return t?od(r):r}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=od(this.serialize())),this.cache.hash):od(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const a=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(a)}const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return boe(t,n+BigInt(27),oa(r),oa(s))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(t,n,r){const s=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Qv.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:Ka(n),s:Ka(r)},s)}toJSON(){const t=RFe(this.accessList);return{chainId:ko(this.chainId),nonce:ko(this.nonce),maxPriorityFeePerGas:ko(this.maxPriorityFeePerGas),maxFeePerGas:ko(this.maxFeePerGas),gasLimit:ko(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:ko(this.value),data:Vi(this.data),accessList:t,v:this.v!==void 0?ko(this.v):void 0,r:this.r!==void 0?ko(this.r):void 0,s:this.s!==void 0?ko(this.s):void 0}}errorStr(){let t=this._getSharedErrorPostfix();return t+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}const Aee=1,gV=oo(Aee.toString(16).padStart(2,"0"));class Zv extends cN{static fromTxData(t,n={}){return new Zv(t,n)}static fromSerializedTx(t,n={}){if(!t$(t.subarray(0,1),gV))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${Aee}, received: ${Vi(t.subarray(0,1))}`);const r=Kh.RLP.decode(Uint8Array.from(t.subarray(1)));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Zv.fromValuesArray(r,n)}static fromValuesArray(t,n={}){if(t.length!==8&&t.length!==11)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[r,s,a,o,l,c,u,d,f,x,g]=t;this._validateNotArray({chainId:r,v:f}),Xae({nonce:s,gasPrice:a,gasLimit:o,value:c,v:f,r:x,s:g});const v=[];return new Zv({chainId:Ka(r),nonce:s,gasPrice:a,gasLimit:o,to:l,value:c,data:u,accessList:d??v,v:f!==void 0?Ka(f):void 0,r:x,s:g},n)}constructor(t,n={}){var r;super(Object.assign(Object.assign({},t),{type:Aee}),n),this.DEFAULT_HARDFORK="berlin";const{chainId:s,accessList:a,gasPrice:o}=t;if(this.common=this._getCommon(n.common,s),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const l=OFe(a??[]);if(this.accessList=l.accessList,this.AccessListJSON=l.AccessListJSON,MFe(this.accessList),this.gasPrice=Ka(_o(o===""?"0x":o)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),cN._validateNotArray(t),this.gasPrice*this.gasLimit>$E){const u=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(u)}this._validateYParity(),this._validateHighS(),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(LFe(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[oa(this.chainId),oa(this.nonce),oa(this.gasPrice),oa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),oa(this.value),this.data,this.accessList,this.v!==void 0?oa(this.v):Uint8Array.from([]),this.r!==void 0?oa(this.r):Uint8Array.from([]),this.s!==void 0?oa(this.s):Uint8Array.from([])]}serialize(){const t=this.raw();return gd(gV,Kh.RLP.encode(t))}getMessageToSign(t=!0){const n=this.raw().slice(0,8),r=gd(gV,Kh.RLP.encode(n));return t?od(r):r}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=od(this.serialize())),this.cache.hash):od(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const a=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(a)}const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return boe(t,n+BigInt(27),oa(r),oa(s))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(t,n,r){const s=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Zv.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:Ka(n),s:Ka(r)},s)}toJSON(){const t=RFe(this.accessList);return{chainId:ko(this.chainId),nonce:ko(this.nonce),gasPrice:ko(this.gasPrice),gasLimit:ko(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:ko(this.value),data:Vi(this.data),accessList:t,v:this.v!==void 0?ko(this.v):void 0,r:this.r!==void 0?ko(this.r):void 0,s:this.s!==void 0?ko(this.s):void 0}}errorStr(){var t,n;let r=this._getSharedErrorPostfix();return r+=` gasPrice=${this.gasPrice} accessListCount=${(n=(t=this.accessList)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0}`,r}_errorMsg(t){return`${t} (${this.errorStr()})`}}const S9t=0;function Nge(e,t){const n=Number(e),r=Number(t)*2;return n===r+35||n===r+36}class my extends cN{static fromTxData(t,n={}){return new my(t,n)}static fromSerializedTx(t,n={}){const r=Kh.RLP.decode(t);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,n)}static fromValuesArray(t,n={}){if(t.length!==6&&t.length!==9)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[r,s,a,o,l,c,u,d,f]=t;return Xae({nonce:r,gasPrice:s,gasLimit:a,value:l,v:u,r:d,s:f}),new my({nonce:r,gasPrice:s,gasLimit:a,to:o,value:l,data:c,v:u,r:d,s:f},n)}constructor(t,n={}){var r;if(super(Object.assign(Object.assign({},t),{type:S9t}),n),this.common=this._validateTxV(this.v,n.common),this.gasPrice=Ka(_o(t.gasPrice===""?"0x":t.gasPrice)),this.gasPrice*this.gasLimit>$E){const a=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(a)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),cN._validateNotArray(t),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?Nge(this.v,this.common.chainId())&&this.activeCapabilities.push(N0.EIP155ReplayProtection):this.activeCapabilities.push(N0.EIP155ReplayProtection)),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}raw(){return[oa(this.nonce),oa(this.gasPrice),oa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),oa(this.value),this.data,this.v!==void 0?oa(this.v):Uint8Array.from([]),this.r!==void 0?oa(this.r):Uint8Array.from([]),this.s!==void 0?oa(this.s):Uint8Array.from([])]}serialize(){return Kh.RLP.encode(this.raw())}_getMessageToSign(){const t=[oa(this.nonce),oa(this.gasPrice),oa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),oa(this.value),this.data];return this.supports(N0.EIP155ReplayProtection)&&(t.push(_o(this.common.chainId())),t.push(pR(_o(0))),t.push(pR(_o(0)))),t}getMessageToSign(t=!0){const n=this._getMessageToSign();return t?od(Kh.RLP.encode(n)):n}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=od(Kh.RLP.encode(this.raw()))),this.cache.hash):od(Kh.RLP.encode(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned()){const n=this._errorMsg("This transaction is not signed");throw new Error(n)}const t=this._getMessageToSign();return od(Kh.RLP.encode(t))}getSenderPublicKey(){const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return boe(t,n,oa(r),oa(s),this.supports(N0.EIP155ReplayProtection)?this.common.chainId():void 0)}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(t,n,r){let s=t;this.supports(N0.EIP155ReplayProtection)&&(s+=this.common.chainId()*BigInt(2)+BigInt(8));const a=Object.assign(Object.assign({},this.txOptions),{common:this.common});return my.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:s,r:Ka(n),s:Ka(r)},a)}toJSON(){return{nonce:ko(this.nonce),gasPrice:ko(this.gasPrice),gasLimit:ko(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:ko(this.value),data:Vi(this.data),v:this.v!==void 0?ko(this.v):void 0,r:this.r!==void 0?ko(this.r):void 0,s:this.s!==void 0?ko(this.s):void 0}}_validateTxV(t,n){let r;const s=t!==void 0?Number(t):void 0;if(s!==void 0&&s<37&&s!==27&&s!==28)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${s}`);if(s!==void 0&&s!==0&&(!n||n.gteHardfork("spuriousDragon"))&&s!==27&&s!==28)if(n){if(!Nge(BigInt(s),n.chainId()))throw new Error(`Incompatible EIP155-based V ${s} and chain id ${n.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let a;(s-35)%2===0?a=35:a=36,r=BigInt(s-a)/BigInt(2)}return this._getCommon(n,r)}errorStr(){let t=this._getSharedErrorPostfix();return t+=` gasPrice=${this.gasPrice}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}const bV=new Map;class H3{constructor(){}static typeToInt(t){return Number(Ka(_o(t)))}static registerTransactionType(t,n){const r=H3.typeToInt(t);bV.set(r,n)}static fromTxData(t,n={}){if(!("type"in t)||t.type===void 0)return my.fromTxData(t,n);const r=H3.typeToInt(t.type);if(r===0)return my.fromTxData(t,n);if(r===1)return Zv.fromTxData(t,n);if(r===2)return Qv.fromTxData(t,n);const s=bV.get(r);if(s!=null&&s.fromTxData)return s.fromTxData(t,n);throw new Error(`Tx instantiation with type ${r} not supported`)}static fromSerializedData(t,n={}){if(t[0]<=127)switch(t[0]){case 1:return Zv.fromSerializedTx(t,n);case 2:return Qv.fromSerializedTx(t,n);default:{const r=bV.get(Number(t[0]));if(r!=null&&r.fromSerializedTx)return r.fromSerializedTx(t,n);throw new Error(`TypedTransaction with ID ${t[0]} unknown`)}}else return my.fromSerializedTx(t,n)}static fromBlockBodyData(t,n={}){if(u2(t))return this.fromSerializedData(t,n);if(Array.isArray(t))return my.fromValuesArray(t,n);throw new Error("Cannot decode transaction: unknown type input")}}var d$=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const RA=(e,t)=>{let n;if(!t&&typeof e=="string"&&Aa(e)&&e.length!==66)throw new Lxe;try{n=u2(e)?e:rx(e)}catch{throw new GSt}if(!t&&n.byteLength!==32)throw new Lxe;return n},yoe=(e,t=!1)=>{const n=Aa(e)?e:ym(e),r=oo(n),s=oo(GPe(`Ethereum Signed Message:
${r.byteLength}`)),a=t?r:gd(s,r);return Yf(a)},N9t=(e,t)=>{const n=RA(t),r=A1.sign(e.substring(2),n),s=r.toCompactRawBytes(),a=r.r.toString(16).padStart(64,"0"),o=r.s.toString(16).padStart(64,"0"),l=r.recovery+27;return{messageHash:e,v:nc(l),r:`0x${a}`,s:`0x${o}`,signature:`${Vi(s)}${l.toString(16)}`}},DFe=(e,t)=>{const n=yoe(e),{messageHash:r,v:s,r:a,s:o,signature:l}=N9t(n,t);return{message:e,messageHash:r,v:s,r:a,s:o,signature:l}},A9t=(e,t)=>d$(void 0,void 0,void 0,function*(){const n=e.sign(oo(t));if(dr(n.v)||dr(n.r)||dr(n.s))throw new dee("Signer Error");const r=n.validate(!0);if(r.length>0){let o="Signer Error ";for(const l of r)o+=`${o} ${l}.`;throw new dee(o)}const s=Vi(n.serialize()),a=Yf(s);return{messageHash:Vi(n.getMessageToSign(!0)),v:`0x${n.v.toString(16)}`,r:`0x${n.r.toString(16).padStart(64,"0")}`,s:`0x${n.s.toString(16).padStart(64,"0")}`,rawTransaction:s,transactionHash:Vi(a)}}),j9t=e=>{if(dr(e))throw new uNt;const t=H3.fromSerializedData(oo(e));return fx(t.getSenderAddress().toString())},jee=(e,t,n,r,s)=>{if(typeof e=="object"){const f=`${e.r}${e.s.slice(2)}${e.v.slice(2)}`;return jee(e.messageHash,f,n)}if(typeof t=="string"&&typeof n=="string"&&!dr(r)){const f=`${n}${r.slice(2)}${t.slice(2)}`;return jee(e,f,s)}if(dr(t))throw new KSt("signature string undefined");const a=130,o=n?e:yoe(e);let l=parseInt(t.substring(a),16);l>26&&(l-=27);const c=A1.Signature.fromCompact(t.slice(2,a)).addRecoveryBit(l).recoverPublicKey(o.replace("0x","")).toRawBytes(!1),u=Yf(c.subarray(1));return fx(`0x${u.slice(-40)}`)},f$=e=>{const t=RA(e),n=A1.getPublicKey(t,!1),s=Yf(n.slice(1)).slice(-40);return fx(`0x${s}`)},E9t=(e,t)=>{const n=RA(e);return`0x${Vi(A1.getPublicKey(n,t)).slice(4)}`},BFe=(e,t,n)=>d$(void 0,void 0,void 0,function*(){var r,s,a,o,l,c,u;const d=RA(e);let f;if(n!=null&&n.salt?f=typeof n.salt=="string"?oo(n.salt):n.salt:f=LE(32),!(Kae(t)||u2(t)))throw new QSt;const x=typeof t=="string"?oo(ym(t)):t;let g;if(n!=null&&n.iv){if(g=typeof n.iv=="string"?oo(n.iv):n.iv,g.length!==16)throw new ZSt}else g=LE(16);const v=(r=n==null?void 0:n.kdf)!==null&&r!==void 0?r:"scrypt";let w,C;if(v==="pbkdf2"){if(C={dklen:(s=n==null?void 0:n.dklen)!==null&&s!==void 0?s:32,salt:Vi(f).replace("0x",""),c:(a=n==null?void 0:n.c)!==null&&a!==void 0?a:262144,prf:"hmac-sha256"},C.c<1e3)throw new JSt;w=vFe(x,f,C.c,C.dklen,"sha256")}else if(v==="scrypt")C={n:(o=n==null?void 0:n.n)!==null&&o!==void 0?o:8192,r:(l=n==null?void 0:n.r)!==null&&l!==void 0?l:8,p:(c=n==null?void 0:n.p)!==null&&c!==void 0?c:1,dklen:(u=n==null?void 0:n.dklen)!==null&&u!==void 0?u:32,salt:Vi(f).replace("0x","")},w=wFe(x,f,C.n,C.p,C.r,C.dklen);else throw new oPe;const N=yield coe(d,w.slice(0,16),g,"aes-128-ctr"),I=Vi(N).slice(2),P=Yf(gd(w.slice(16,32),N)).replace("0x","");return{version:3,id:soe(),address:f$(d).toLowerCase().replace("0x",""),crypto:{ciphertext:I,cipherparams:{iv:Vi(g).replace("0x","")},cipher:"aes-128-ctr",kdf:v,kdfparams:C,mac:P}}}),voe=(e,t)=>{const n=RA(e,t);return{address:f$(n),privateKey:Vi(n),signTransaction:r=>{throw new dee("Do not have network access to sign the transaction")},sign:r=>DFe(typeof r=="string"?r:JSON.stringify(r),n),encrypt:(r,s)=>d$(void 0,void 0,void 0,function*(){return BFe(n,r,s)})}},_9t=()=>{const e=A1.utils.randomPrivateKey();return voe(`${Vi(e)}`)},k9t=(e,t,n)=>d$(void 0,void 0,void 0,function*(){const r=typeof e=="object"?e:JSON.parse(n?e.toLowerCase():e);if(Vs.validateJSONSchema(xjt,r),r.version!==3)throw new XSt;const s=typeof t=="string"?oo(ym(t)):t;Vs.validate(["bytes"],[s]);let a;if(r.crypto.kdf==="scrypt"){const u=r.crypto.kdfparams,d=typeof u.salt=="string"?oo(u.salt):u.salt;a=wFe(s,d,u.n,u.p,u.r,u.dklen)}else if(r.crypto.kdf==="pbkdf2"){const u=r.crypto.kdfparams,d=typeof u.salt=="string"?oo(u.salt):u.salt;a=vFe(s,d,u.c,u.dklen,"sha256")}else throw new oPe;const o=oo(r.crypto.ciphertext);if(Yf(gd(a.slice(16,32),o)).replace("0x","")!==r.crypto.mac)throw new YSt;const c=yield S7t(oo(r.crypto.ciphertext),a.slice(0,16),oo(r.crypto.cipherparams.iv));return voe(c)});var Age=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const T9t=1e3;class I9t{constructor(t){this._requestManager=t,this._requests=new Map}get requests(){return[...this._requests.values()].map(t=>t.payload)}add(t){const n=$3(t),r=new cR;return this._requests.set(n.id,{payload:n,promise:r}),r}execute(t){return Age(this,void 0,void 0,function*(){var n;if(this.requests.length===0)return Promise.resolve([]);const r=new cR({timeout:(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:T9t,eagerStart:!0,timeoutMessage:"Batch request timeout"});return this._processBatchRequest(r).catch(s=>r.reject(s)),r.catch(s=>{s instanceof lPe&&this._abortAllRequests("Batch request timeout"),r.reject(s)}),r})}_processBatchRequest(t){return Age(this,void 0,void 0,function*(){var n,r;const s=yield this._requestManager.sendBatch([...this._requests.values()].map(l=>l.payload));if(s.length!==this._requests.size)throw this._abortAllRequests("Invalid batch response"),new S0(s,`Batch request size mismatch the results size. Requests: ${this._requests.size}, Responses: ${s.length}`);const a=this.requests.map(l=>l.id).map(Number).sort((l,c)=>l-c),o=s.map(l=>l.id).map(Number).sort((l,c)=>l-c);if(JSON.stringify(a)!==JSON.stringify(o))throw this._abortAllRequests("Invalid batch response"),new S0(s,`Batch request mismatch the results. Requests: [${a.join()}], Responses: [${o.join()}]`);for(const l of s)jy(l)?(n=this._requests.get(l.id))===null||n===void 0||n.promise.resolve(l.result):Ey(l)&&((r=this._requests.get(l.id))===null||r===void 0||r.promise.reject(l.error));t.resolve(s)})}_abortAllRequests(t){for(const{promise:n}of this._requests.values())n.reject(new aNt(t))}}var P9t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class Qd extends m7t{constructor(t){var n;if(super(),this.providers=Jw.providers,Js(t)||typeof t=="string"&&t.trim()!==""||uR(t)){this._requestManager=new Jw(t),this._subscriptionManager=new dR(this._requestManager,{});return}const{config:r,provider:s,requestManager:a,subscriptionManager:o,registeredSubscriptions:l,accountProvider:c,wallet:u,requestManagerMiddleware:d}=t;this.setConfig(r??{}),this._requestManager=a??new Jw(s,(n=r==null?void 0:r.enableExperimentalFeatures)===null||n===void 0?void 0:n.useSubscriptionWhenCheckingBlockTimeout,d),o?this._subscriptionManager=o:this._subscriptionManager=new dR(this.requestManager,l??{}),c&&(this._accountProvider=c),u&&(this._wallet=u)}get requestManager(){return this._requestManager}get subscriptionManager(){return this._subscriptionManager}get wallet(){return this._wallet}get accountProvider(){return this._accountProvider}static fromContextObject(...t){return new this(...t.reverse())}getContextObject(){var t;return{config:this.config,provider:this.provider,requestManager:this.requestManager,subscriptionManager:this.subscriptionManager,registeredSubscriptions:(t=this.subscriptionManager)===null||t===void 0?void 0:t.registeredSubscriptions,providers:this.providers,wallet:this.wallet,accountProvider:this.accountProvider}}use(t,...n){const r=new t(...n,this.getContextObject());return this.on(U3.CONFIG_CHANGE,s=>{r.setConfig({[s.name]:s.newValue})}),this[t.name]=r,r}link(t){this.setConfig(t.config),this._requestManager=t.requestManager,this.provider=t.provider,this._subscriptionManager=t.subscriptionManager,this._wallet=t.wallet,this._accountProvider=t._accountProvider,t.on(U3.CONFIG_CHANGE,n=>{this.setConfig({[n.name]:n.newValue})})}registerPlugin(t){if(this[t.pluginNamespace]!==void 0)throw new oNt(t.pluginNamespace);const n={[t.pluginNamespace]:t};n[t.pluginNamespace].link(this),Object.assign(this,n)}get provider(){return this.currentProvider}set provider(t){this.requestManager.setProvider(t)}get currentProvider(){return this.requestManager.provider}set currentProvider(t){this.requestManager.setProvider(t)}get givenProvider(){return Qd.givenProvider}setProvider(t){return this.provider=t,!0}setRequestManagerMiddleware(t){this.requestManager.setMiddleware(t)}get BatchRequest(){return I9t.bind(void 0,this._requestManager)}extend(t){var n;return t.property&&!this[t.property]&&(this[t.property]={}),(n=t.methods)===null||n===void 0||n.forEach(r=>{const s=(...a)=>P9t(this,void 0,void 0,function*(){return this.requestManager.send({method:r.call,params:a})});t.property?this[t.property][r.name]=s:this[r.name]=s}),this}}Qd.providers=Jw.providers;class Rl{constructor(t){if(this.toAddress=()=>{if(this.isDirect()){const n=this._iban.slice(4),r=Rl._parseInt(n,36),s=ME(r,40);return fx(s)}throw new Error("Iban is indirect and cannot be converted. Must be length of 34 or 35")},Rl.isIndirect(t)||Rl.isDirect(t))this._iban=t;else throw new Error("Invalid IBAN was provided")}static isDirect(t){return t.length===34||t.length===35}isDirect(){return Rl.isDirect(this._iban)}static isIndirect(t){return t.length===20}isIndirect(){return Rl.isIndirect(this._iban)}static isValid(t){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(t)&&Rl._mod9710(Rl._iso13616Prepare(t))===1}isValid(){return Rl.isValid(this._iban)}static fromBban(t){const n="XE",s=`0${(98-this._mod9710(this._iso13616Prepare(`${n}00${t}`))).toString()}`.slice(-2);return new Rl(`${n}${s}${t}`)}static createIndirect(t){return Rl.fromBban(`ETH${t.institution}${t.identifier}`)}static fromAddress(t){if(!Kf(t))throw new Uae(t);const r=BigInt(Zk(t)).toString(36),s=ME(r,15);return Rl.fromBban(s.toUpperCase())}static toIban(t){return Rl.fromAddress(t).toString()}client(){return this.isIndirect()?this._iban.slice(11):""}checksum(){return this._iban.slice(2,4)}institution(){return this.isIndirect()?this._iban.slice(7,11):""}toString(){return this._iban}}Rl._iso13616Prepare=e=>{const r=e.toUpperCase();return`${r.slice(4)}${r.slice(0,4)}`.split("").map(a=>{const o=a.charCodeAt(0);return o>=65&&o<=90?o-65+10:a}).join("")};Rl._parseInt=(e,t)=>[...e].reduce((n,r)=>BigInt(parseInt(r,t))+BigInt(t)*n,BigInt(0));Rl._mod9710=e=>{let t=e,n;for(;t.length>2;)n=t.slice(0,9),t=`${(parseInt(n,10)%97).toString()}${t.slice(n.length)}`;return parseInt(t,10)%97};Rl.toAddress=e=>new Rl(e).toAddress();var yV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},$Fe;class UFe extends o${constructor(t){super(),this[$Fe]="Promise",this._promise=new Promise(t)}then(t,n){return yV(this,void 0,void 0,function*(){return this._promise.then(t,n)})}catch(t){return yV(this,void 0,void 0,function*(){return this._promise.catch(t)})}finally(t){return yV(this,void 0,void 0,function*(){return this._promise.finally(t)})}on(t,n){return super.on(t,n),this}once(t,n){return super.once(t,n),this}}$Fe=Symbol.toStringTag;var vV={},jge;function F9t(){return jge||(jge=1,function(e,t){if(e.setImmediate)return;var n=1,r={},s=!1,a=e.document,o;function l(I){typeof I!="function"&&(I=new Function(""+I));for(var P=new Array(arguments.length-1),R=0;R<P.length;R++)P[R]=arguments[R+1];var F={callback:I,args:P};return r[n]=F,o(n),n++}function c(I){delete r[I]}function u(I){var P=I.callback,R=I.args;switch(R.length){case 0:P();break;case 1:P(R[0]);break;case 2:P(R[0],R[1]);break;case 3:P(R[0],R[1],R[2]);break;default:P.apply(t,R);break}}function d(I){if(s)setTimeout(d,0,I);else{var P=r[I];if(P){s=!0;try{u(P)}finally{c(I),s=!1}}}}function f(){o=function(I){process.nextTick(function(){d(I)})}}function x(){if(e.postMessage&&!e.importScripts){var I=!0,P=e.onmessage;return e.onmessage=function(){I=!1},e.postMessage("","*"),e.onmessage=P,I}}function g(){var I="setImmediate$"+Math.random()+"$",P=function(R){R.source===e&&typeof R.data=="string"&&R.data.indexOf(I)===0&&d(+R.data.slice(I.length))};e.addEventListener?e.addEventListener("message",P,!1):e.attachEvent("onmessage",P),o=function(R){e.postMessage(I+R,"*")}}function v(){var I=new MessageChannel;I.port1.onmessage=function(P){var R=P.data;d(R)},o=function(P){I.port2.postMessage(P)}}function w(){var I=a.documentElement;o=function(P){var R=a.createElement("script");R.onreadystatechange=function(){d(P),R.onreadystatechange=null,I.removeChild(R),R=null},I.appendChild(R)}}function C(){o=function(I){setTimeout(d,0,I)}}var N=Object.getPrototypeOf&&Object.getPrototypeOf(e);N=N&&N.setTimeout?N:e,{}.toString.call(e.process)==="[object process]"?f():x()?g():e.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?w():C(),N.setImmediate=l,N.clearImmediate=c}(typeof self>"u"?typeof Tu>"u"?vV:Tu:self)),vV}F9t();var ui=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function O9t(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_protocolVersion",params:[]})})}function zFe(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_syncing",params:[]})})}function M9t(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_coinbase",params:[]})})}function R9t(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_mining",params:[]})})}function L9t(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_hashrate",params:[]})})}function D9t(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_gasPrice",params:[]})})}function B9t(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_maxPriorityFeePerGas",params:[]})})}function $9t(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_accounts",params:[]})})}function U9t(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_blockNumber",params:[]})})}function z9t(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getBalance",params:[t,n]})})}function H9t(e,t,n,r){return ui(this,void 0,void 0,function*(){return Vs.validate(["address","hex","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getStorageAt",params:[t,n,r]})})}function V9t(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getTransactionCount",params:[t,n]})})}function W9t(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["bytes32"],[t]),e.send({method:"eth_getBlockTransactionCountByHash",params:[t]})})}function q9t(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getBlockTransactionCountByNumber",params:[t]})})}function G9t(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["bytes32"],[t]),e.send({method:"eth_getUncleCountByBlockHash",params:[t]})})}function K9t(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getUncleCountByBlockNumber",params:[t]})})}function Y9t(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getCode",params:[t,n]})})}function X9t(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["address","hex"],[t,n]),e.send({method:"eth_sign",params:[t,n]})})}function Q9t(e,t){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_signTransaction",params:[t]})})}function Z9t(e,t){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_sendTransaction",params:[t]})})}function HFe(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["hex"],[t]),e.send({method:"eth_sendRawTransaction",params:[t]})})}function J9t(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_call",params:[t,n]})})}function eEt(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_estimateGas",params:[t,n]})})}function tEt(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["bytes32","bool"],[t,n]),e.send({method:"eth_getBlockByHash",params:[t,n]})})}function VFe(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["blockNumberOrTag","bool"],[t,n]),e.send({method:"eth_getBlockByNumber",params:[t,n]})})}function nEt(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionByHash",params:[t]})})}function rEt(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockHashAndIndex",params:[t,n]})})}function sEt(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockNumberAndIndex",params:[t,n]})})}function iEt(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionReceipt",params:[t]})})}function aEt(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getUncleByBlockHashAndIndex",params:[t,n]})})}function oEt(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getUncleByBlockNumberAndIndex",params:[t,n]})})}function lEt(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["filter"],[t]),e.send({method:"eth_newFilter",params:[t]})})}function cEt(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_newBlockFilter",params:[]})})}function uEt(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_newPendingTransactionFilter",params:[]})})}function dEt(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["hex"],[t]),e.send({method:"eth_uninstallFilter",params:[t]})})}function fEt(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["hex"],[t]),e.send({method:"eth_getFilterChanges",params:[t]})})}function hEt(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["hex"],[t]),e.send({method:"eth_getFilterLogs",params:[t]})})}function pEt(e,t){return ui(this,void 0,void 0,function*(){return Vs.validate(["filter"],[t]),e.send({method:"eth_getLogs",params:[t]})})}function mEt(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_getWork",params:[]})})}function xEt(e,t,n,r){return ui(this,void 0,void 0,function*(){return Vs.validate(["bytes8","bytes32","bytes32"],[t,n,r]),e.send({method:"eth_submitWork",params:[t,n,r]})})}function gEt(e,t,n,r){return ui(this,void 0,void 0,function*(){Vs.validate(["hex","blockNumberOrTag"],[t,n]);for(const s of r)Vs.validate(["number"],[s]);return e.send({method:"eth_feeHistory",params:[t,n,r]})})}function bEt(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_pendingTransactions",params:[]})})}function yEt(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_requestAccounts",params:[]})})}function vEt(e){return ui(this,void 0,void 0,function*(){return e.send({method:"eth_chainId",params:[]})})}function wEt(e,t,n,r){return ui(this,void 0,void 0,function*(){return Vs.validate(["address","bytes32[]","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getProof",params:[t,n,r]})})}function CEt(e){return ui(this,void 0,void 0,function*(){return e.send({method:"web3_clientVersion",params:[]})})}function SEt(e,t,n){return ui(this,void 0,void 0,function*(){return Vs.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_createAccessList",params:[t,n]})})}function NEt(e,t,n,r=!1){return ui(this,void 0,void 0,function*(){return Vs.validate(["address"],[t]),e.send({method:`eth_signTypedData${r?"":"_v4"}`,params:[t,n]})})}var woe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function AEt(e){return woe(this,void 0,void 0,function*(){return e.send({method:"net_version",params:[]})})}function jEt(e){return woe(this,void 0,void 0,function*(){return e.send({method:"net_peerCount",params:[]})})}function EEt(e){return woe(this,void 0,void 0,function*(){return e.send({method:"net_listening",params:[]})})}var j1=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const _Et=e=>j1(void 0,void 0,void 0,function*(){return e.send({method:"personal_listAccounts",params:[]})}),kEt=(e,t)=>j1(void 0,void 0,void 0,function*(){return e.send({method:"personal_newAccount",params:[t]})}),TEt=(e,t,n,r)=>j1(void 0,void 0,void 0,function*(){return e.send({method:"personal_unlockAccount",params:[t,n,r]})}),IEt=(e,t)=>j1(void 0,void 0,void 0,function*(){return e.send({method:"personal_lockAccount",params:[t]})}),PEt=(e,t,n)=>j1(void 0,void 0,void 0,function*(){return e.send({method:"personal_importRawKey",params:[t,n]})}),FEt=(e,t,n)=>j1(void 0,void 0,void 0,function*(){return e.send({method:"personal_sendTransaction",params:[t,n]})}),OEt=(e,t,n)=>j1(void 0,void 0,void 0,function*(){return e.send({method:"personal_signTransaction",params:[t,n]})}),MEt=(e,t,n,r)=>j1(void 0,void 0,void 0,function*(){return e.send({method:"personal_sign",params:[t,n,r]})}),REt=(e,t,n)=>j1(void 0,void 0,void 0,function*(){return e.send({method:"personal_ecRecover",params:[t,n]})}),Ege={type:"object",properties:{accessList:{type:"null"},maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},_ge={type:"object",properties:{maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},kge={type:"object",properties:{gasPrice:{type:"null"}}},uP=(e,t,n)=>{try{Vs.validateJSONSchema(e,t)}catch(r){throw r instanceof tN?new ONt(r.errors,n):r}},LEt=e=>{var t,n;const r=e;if(!dr(r.type)){let a;switch(r.type){case"0x0":a=Ege;break;case"0x1":a=_ge;break;case"0x2":a=kge;break;default:return Vr({format:"uint"},r.type,fi)}return uP(a,r,r.type),Vr({format:"uint"},r.type,fi)}if(!dr(r.maxFeePerGas)||!dr(r.maxPriorityFeePerGas))return uP(kge,r,"0x2"),"0x2";if(!dr(r.accessList))return uP(_ge,r,"0x1"),"0x1";const s=(t=r.hardfork)!==null&&t!==void 0?t:(n=r.common)===null||n===void 0?void 0:n.hardfork;if(!dr(s)){const a=Object.keys(Yj).indexOf(s);if(a>=Object.keys(Yj).indexOf("london"))return dr(r.gasPrice)?"0x2":"0x0";if(a===Object.keys(Yj).indexOf("berlin"))return"0x0"}if(!dr(r.gasPrice))return uP(Ege,r,"0x0"),"0x0"},DEt=(e,t)=>{var n;return((n=t==null?void 0:t.transactionTypeParser)!==null&&n!==void 0?n:LEt)(e)},BEt=e=>e[0]>127?"0x0":p1(e[0]),$Et={type:"object",properties:{address:{format:"address"},storageKeys:{type:"array",items:{format:"bytes32"}}}},Coe={type:"array",items:Object.assign({},$Et)},UEt={type:"object",properties:{accessList:Object.assign({},Coe),gasUsed:{type:"string"}}},Tge={type:"string",enum:["goerli","kovan","mainnet","rinkeby","ropsten","sepolia"]},Ige={type:"string",enum:["arrowGlacier","berlin","byzantium","chainstart","constantinople","dao","homestead","istanbul","london","merge","muirGlacier","petersburg","shanghai","spuriousDragon","tangerineWhistle"]},zEt={type:"object",properties:{name:{format:"string"},networkId:{format:"uint"},chainId:{format:"uint"}}},WFe={type:"object",properties:{from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},Coe),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},chain:Object.assign({},Tge),hardfork:Object.assign({},Ige),chainId:{format:"uint"},networkId:{format:"uint"},common:{type:"object",properties:{customChain:Object.assign({},zEt),baseChain:Object.assign({},Tge),hardfork:Object.assign({},Ige)}},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}}},Eee={type:"object",properties:Object.assign(Object.assign({},WFe.properties),{blockHash:{format:"bytes32"},blockNumber:{format:"uint"},hash:{format:"bytes32"},transactionIndex:{format:"uint"},from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},Coe),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}})},qFe={type:"object",properties:{index:{format:"uint"},validatorIndex:{format:"uint"},address:{format:"address"},amount:{format:"uint"}}},mR={type:"object",properties:{baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{oneOf:[{type:"array",items:Object.assign({},Eee)},{type:"array",items:{format:"bytes32"}}]},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},qFe)},withdrawalsRoot:{format:"bytes32"}}},HEt={type:"object",properties:{author:{format:"bytes32"},excessDataGas:{format:"uint"},baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{type:"array",items:{format:"bytes32"}},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},qFe)},withdrawalsRoot:{format:"bytes32"}}},LA={type:"object",properties:{removed:{format:"bool"},logIndex:{format:"uint"},transactionIndex:{format:"uint"},transactionHash:{format:"bytes32"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},address:{format:"address"},data:{format:"bytes"},topics:{type:"array",items:{format:"bytes32"}}}},VEt={type:"object",properties:{startingBlock:{format:"string"},currentBlock:{format:"string"},highestBlock:{format:"string"},knownStates:{format:"string"},pulledStates:{format:"string"}}},DA={type:"object",properties:{transactionHash:{format:"bytes32"},transactionIndex:{format:"uint"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},from:{format:"address"},to:{format:"address"},cumulativeGasUsed:{format:"uint"},gasUsed:{format:"uint"},effectiveGasPrice:{format:"uint"},contractAddress:{format:"address"},logs:{type:"array",items:Object.assign({},LA)},logsBloom:{format:"bytes"},root:{format:"bytes"},status:{format:"uint"},type:{format:"uint"}}},WEt={type:"object",properties:{messageHash:{format:"bytes"},r:{format:"bytes32"},s:{format:"bytes32"},v:{format:"bytes"},message:{format:"bytes"},signature:{format:"bytes"}}},qEt={type:"object",properties:{oldestBlock:{format:"uint"},baseFeePerGas:{type:"array",items:{format:"uint"}},reward:{type:"array",items:{type:"array",items:{format:"uint"}}},gasUsedRatio:{type:"array",items:{type:"number"}}}},GEt={type:"object",properties:{key:{format:"bytes32"},value:{format:"uint"},proof:{type:"array",items:{format:"bytes32"}}}},KEt={type:"object",properties:{balance:{format:"uint"},codeHash:{format:"bytes32"},nonce:{format:"uint"},storageHash:{format:"bytes32"},accountProof:{type:"array",items:{format:"bytes32"}},storageProof:{type:"array",items:Object.assign({},GEt)}}};function cf(e,t=dd,n={transactionSchema:Eee,fillInputAndData:!1}){var r,s;let a=d2({},e);if(dr(e==null?void 0:e.common)||(a.common=Object.assign({},e.common),dr((r=e.common)===null||r===void 0?void 0:r.customChain)||(a.common.customChain=Object.assign({},e.common.customChain))),a=Vr((s=n.transactionSchema)!==null&&s!==void 0?s:Eee,a,t),!dr(a.data)&&!dr(a.input)&&p1(a.data)!==p1(a.input))throw new fPe({data:Vi(a.data),input:Vi(a.input)});return n.fillInputAndData&&(dr(a.data)?dr(a.input)||(a.data=a.input):a.input=a.data),dr(a.gasLimit)||(a.gas=a.gasLimit,delete a.gasLimit),a}function YEt(e,t,n={fillInputAndData:!1}){return{raw:Vr({format:"bytes"},e,t),tx:cf(Object.assign(Object.assign({},H3.fromSerializedData(oo(e)).toJSON()),{hash:Vi(sN(oo(e))),type:BEt(oo(e))}),t,{fillInputAndData:n.fillInputAndData,transactionSchema:n.transactionSchema})}}var Soe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function Noe(e,t){return Soe(this,void 0,void 0,function*(){const n=yield AEt(e.requestManager);return Vr({format:"uint"},n,t)})}function XEt(e,t){return Soe(this,void 0,void 0,function*(){const n=yield jEt(e.requestManager);return Vr({format:"uint"},n,t)})}const QEt=e=>Soe(void 0,void 0,void 0,function*(){return EEt(e.requestManager)});var wV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class GFe extends Qd{getId(t=this.defaultReturnFormat){return wV(this,void 0,void 0,function*(){return Noe(this,t)})}getPeerCount(t=this.defaultReturnFormat){return wV(this,void 0,void 0,function*(){return XEt(this,t)})}isListening(){return wV(this,void 0,void 0,function*(){return QEt(this)})}}const uN="ALLEVENTS",_ee={name:uN,signature:"",type:"event",inputs:[]},h$={bytes:d1.HEX,number:Qh.NUMBER};var KFe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function ZEt(e,t,n){return KFe(this,void 0,void 0,function*(){var r,s,a,o;const l=yield SOe(t,t.defaultBlock,!1,fi);if(dr(l.baseFeePerGas))throw new TNt;let c;if(dr(e.gasPrice)&&BigInt(l.baseFeePerGas)===BigInt(0)&&(c=yield Foe(t,n)),!dr(e.gasPrice)||!dr(c)){const u=Vr({format:"uint"},(r=e.gasPrice)!==null&&r!==void 0?r:c,n);return{maxPriorityFeePerGas:u,maxFeePerGas:u}}return{maxPriorityFeePerGas:Vr({format:"uint"},(s=e.maxPriorityFeePerGas)!==null&&s!==void 0?s:t.defaultMaxPriorityFeePerGas,n),maxFeePerGas:Vr({format:"uint"},(a=e.maxFeePerGas)!==null&&a!==void 0?a:BigInt(l.baseFeePerGas)*BigInt(2)+BigInt((o=e.maxPriorityFeePerGas)!==null&&o!==void 0?o:t.defaultMaxPriorityFeePerGas),n)}})}function YFe(e,t,n){return KFe(this,void 0,void 0,function*(){const r=XFe(e,t);if(!dr(r)){if(r.startsWith("-"))throw new Uxe(r);if(Number(r)<0||Number(r)>127)throw new Uxe(r);if(dr(e.gasPrice)&&(r==="0x0"||r==="0x1"))return{gasPrice:yield Foe(t,n),maxPriorityFeePerGas:void 0,maxFeePerGas:void 0};if(r==="0x2")return Object.assign({gasPrice:void 0},yield ZEt(e,t,n))}})}var Aoe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const kee=(e,t,n,r)=>{if(n!==void 0&&e in n&&n[e]!==void 0){if(typeof n[e]=="string"&&Kf(n[e]))return n[e];if(!Aa(n[e])&&WPe(n[e])){if(t.wallet){const s=t.wallet.get(Vr({format:"uint"},n[e],h$));if(!dr(s))return s.address;throw new zxe}throw new zxe}else throw e==="from"?new dNt(n.from):new fNt(n.to)}if(e==="from"){if(!dr(r))return f$(r);if(!dr(t.defaultAccount))return t.defaultAccount}},JEt=(e,t,...n)=>Aoe(void 0,[e,t,...n],void 0,function*(r,s,a=r.defaultReturnFormat){if(dr(s))throw new kNt;return AOe(r,s,r.defaultBlock,a)}),XFe=(e,t)=>{const n=DEt(e,t);if(!dr(n))return n;if(!dr(t.defaultTransactionType))return Vr({format:"uint"},t.defaultTransactionType,fi)};function e_t(e){return Aoe(this,void 0,void 0,function*(){var t,n;let r=Vr(WFe,e.transaction,e.web3Context.defaultReturnFormat);if(dr(r.from)&&(r.from=kee("from",e.web3Context,void 0,e.privateKey)),dr(r.nonce)&&(r.nonce=yield JEt(e.web3Context,r.from,fi)),dr(r.value)&&(r.value="0x0"),dr(r.data))dr(r.input)?r.input="0x":r.input.startsWith("0x")||(r.input=`0x${r.input}`);else{if(!dr(r.input)&&r.data!==r.input)throw new fPe({data:Vi(r.data),input:Vi(r.input)});r.data.startsWith("0x")||(r.data=`0x${r.data}`)}if(dr(r.common)){if(e.web3Context.defaultCommon){const s=e.web3Context.defaultCommon,a=s.customChain.chainId,o=s.customChain.networkId,l=s.customChain.name;r.common=Object.assign(Object.assign({},s),{customChain:{chainId:a,networkId:o,name:l}})}dr(r.chain)&&(r.chain=e.web3Context.defaultChain),dr(r.hardfork)&&(r.hardfork=e.web3Context.defaultHardfork)}if(dr(r.chainId)&&dr((t=r.common)===null||t===void 0?void 0:t.customChain.chainId)&&(r.chainId=yield EOe(e.web3Context,fi)),dr(r.networkId)&&(r.networkId=(n=e.web3Context.defaultNetworkId)!==null&&n!==void 0?n:yield Noe(e.web3Context,fi)),dr(r.gasLimit)&&!dr(r.gas)&&(r.gasLimit=r.gas),r.type=XFe(r,e.web3Context),dr(r.accessList)&&(r.type==="0x1"||r.type==="0x2")&&(r.accessList=[]),e.fillGasPrice&&(r=Object.assign(Object.assign({},r),yield YFe(r,e.web3Context,fi))),dr(r.gas)&&dr(r.gasLimit)&&e.fillGasLimit){const s=yield Roe(e.web3Context,r,"latest",fi);r=Object.assign(Object.assign({},r),{gas:Vr({format:"uint"},s,fi)})}return r})}const t_t=e=>Aoe(void 0,void 0,void 0,function*(){var t;return((t=e.web3Context.transactionBuilder)!==null&&t!==void 0?t:e_t)(Object.assign(Object.assign({},e),{transaction:e.transaction}))});var joe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function Tee(e,t,n){const r=e.transactionPollingInterval,[s,a]=sFe(()=>joe(this,void 0,void 0,function*(){let l;try{l=yield Ooe(e,h$)}catch(u){console.warn("An error happen while trying to get the block number",u);return}const c=l-t;if(c>=e.transactionBlockTimeout)return new mPe({starterBlockNumber:t,numberOfBlocks:c,transactionHash:n})}),r);return[a,{clean:()=>{clearInterval(s)}}]}function n_t(e,t,n){return joe(this,void 0,void 0,function*(){var r;let s=!0,a,o;function l(u,d){d&&console.warn("error happened at subscription. So revert to polling...",d),o.clean(),s=!1;const[f,x]=Tee(e,t,n);o.clean=x.clean,f.catch(g=>u(g))}try{a=yield(r=e.subscriptionManager)===null||r===void 0?void 0:r.subscribe("newHeads"),o={clean:()=>{var u;a.id&&((u=e.subscriptionManager)===null||u===void 0||u.removeSubscription(a).then(()=>{}).catch(()=>{}))}}}catch{return Tee(e,t,n)}return[new Promise((u,d)=>{try{a.on("data",f=>{if(s=!1,!(f!=null&&f.number))return;const x=Number(BigInt(f.number)-BigInt(t));x>=e.transactionBlockTimeout&&d(new mPe({starterBlockNumber:t,numberOfBlocks:x,transactionHash:n}))}),a.on("error",f=>{l(d,f)})}catch(f){l(d,f)}setTimeout(()=>{s&&l(d)},e.blockHeaderTimeout*1e3)}),o]})}function QFe(e,t){return joe(this,void 0,void 0,function*(){var n,r;const{provider:s}=e.requestManager;let a;const o=yield Ooe(e,h$);return!((r=(n=s).supportsSubscriptions)===null||r===void 0)&&r.call(n)&&e.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout?a=yield n_t(e,o,t):a=Tee(e,o,t),a})}var r_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function Iee(e,t,n){return r_t(this,void 0,void 0,function*(){const[r,s]=roe(e.transactionSendTimeout,new INt({numberOfSeconds:e.transactionSendTimeout/1e3,transactionHash:n})),[a,o]=yield QFe(e,n);try{return yield Promise.race([t(),s,a])}finally{clearTimeout(r),o.clean()}})}var Pge=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function ZFe(e,t,n,r){return Pge(this,void 0,void 0,function*(){var s;const a=(s=e.transactionReceiptPollingInterval)!==null&&s!==void 0?s:e.transactionPollingInterval,[o,l]=noe(()=>Pge(this,void 0,void 0,function*(){try{return(r??NOe)(e,t,n)}catch(x){console.warn("An error happen while trying to get the transaction receipt",x);return}}),a),[c,u]=roe(e.transactionPollingTimeout,new pPe({numberOfSeconds:e.transactionPollingTimeout/1e3,transactionHash:t})),[d,f]=yield QFe(e,t);try{return yield Promise.race([o,u,d])}finally{c&&clearTimeout(c),l&&clearInterval(l),f.clean()}})}var s_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const hO=({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})=>{var a;let o=1;const l=setInterval(()=>{s_t(void 0,void 0,void 0,function*(){if(o>=e.transactionConfirmationBlocks){clearInterval(l);return}const c=yield VFe(e.requestManager,nc(BigInt(t.blockNumber)+BigInt(o)),!1);c!=null&&c.hash&&(o+=1,n.emit("confirmation",{confirmations:Vr({format:"uint"},o,s),receipt:Vr(r??DA,t,s),latestBlockHash:Vr({format:"bytes32"},c.hash,s)}))})},(a=e.transactionReceiptPollingInterval)!==null&&a!==void 0?a:e.transactionPollingInterval)};var Fge=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const i_t=({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})=>{let a=!0,o;setImmediate(()=>{var l;(l=e.subscriptionManager)===null||l===void 0||l.subscribe("newHeads").then(c=>{c.on("data",u=>Fge(void 0,void 0,void 0,function*(){var d;if(a=!1,!(u!=null&&u.number)||o===(u==null?void 0:u.parentHash))return;o=u==null?void 0:u.parentHash;const f=BigInt(u.number)-BigInt(t.blockNumber)+BigInt(1);n.emit("confirmation",{confirmations:Vr({format:"uint"},f,s),receipt:Vr(r??DA,t,s),latestBlockHash:Vr({format:"bytes32"},u.parentHash,s)}),f>=e.transactionConfirmationBlocks&&(yield(d=e.subscriptionManager)===null||d===void 0?void 0:d.removeSubscription(c))})),c.on("error",()=>Fge(void 0,void 0,void 0,function*(){var u;yield(u=e.subscriptionManager)===null||u===void 0?void 0:u.removeSubscription(c),a=!1,hO({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})}))}).catch(()=>{a=!1,hO({web3Context:e,transactionReceipt:t,customTransactionReceiptSchema:r,transactionPromiEvent:n,returnFormat:s})})}),setTimeout(()=>{a&&hO({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:s})},e.blockHeaderTimeout*1e3)};function a_t(e,t,n,r,s,a){if(dr(n)||dr(n.blockHash))throw new PNt({receipt:n,blockHash:Vr({format:"bytes32"},n==null?void 0:n.blockHash,s),transactionHash:Vr({format:"bytes32"},r,s)});if(!n.blockNumber)throw new FNt({receipt:n});t.emit("confirmation",{confirmations:Vr({format:"uint"},1,s),receipt:Vr(a??DA,n,s),latestBlockHash:Vr({format:"bytes32"},n.blockHash,s)});const o=e.requestManager.provider;o&&"supportsSubscriptions"in o&&o.supportsSubscriptions()?i_t({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:s}):hO({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:s})}const p$=e=>!Js(e)&&typeof e=="object"&&!Js(e.type)&&e.type==="error",Eoe=e=>!Js(e)&&typeof e=="object"&&!Js(e.type)&&e.type==="event",m$=e=>!Js(e)&&typeof e=="object"&&!Js(e.type)&&e.type==="function",o_t=e=>!Js(e)&&typeof e=="object"&&!Js(e.type)&&e.type==="constructor",l_t=e=>typeof e=="object"&&typeof e.components>"u"&&typeof e.name>"u",JFe=e=>e.includes("[]")?{type:"tuple[]",name:e.slice(0,-2)}:{type:"tuple",name:e},eOe=e=>{const t=[];for(const n of Object.keys(e)){const r=e[n];typeof r=="object"?t.push(Object.assign(Object.assign({},JFe(n)),{components:eOe(r)})):t.push({name:n,type:e[n]})}return t},Pee=(e,t)=>{const n=[];return t.forEach(r=>{if(typeof r.components=="object"){if(!r.type.startsWith("tuple"))throw new Ki(`Invalid value given "${r.type}". Error: components found but type is not tuple.`);const s=r.type.indexOf("["),a=s>=0?r.type.substring(s):"",o=Pee(e,r.components);n.push(`(${o.join(",")})${a}`)}else n.push(r.type)}),n},qg=e=>{var t,n,r,s;return p$(e)||Eoe(e)||m$(e)?!((t=e.name)===null||t===void 0)&&t.includes("(")?e.name:`${(n=e.name)!==null&&n!==void 0?n:""}(${Pee(!1,(r=e.inputs)!==null&&r!==void 0?r:[]).join(",")})`:`(${Pee(!1,(s=e.inputs)!==null&&s!==void 0?s:[]).join(",")})`},c_t=e=>{if(typeof e!="string"&&!p$(e))throw new Ki("Invalid parameter value in encodeErrorSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=qg(e):t=e,Yf(t)},_oe=e=>{if(typeof e!="string"&&!Eoe(e))throw new Ki("Invalid parameter value in encodeEventSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=qg(e):t=e,Yf(t)};function koe(e,t){const n=e.exec(t);return n==null?void 0:n.groups}var tOe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,nOe=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,rOe=/^\(.+?\).*?$/,u_t=Object.defineProperty,d_t=(e,t,n)=>t in e?u_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_7=(e,t,n)=>(d_t(e,typeof t!="symbol"?t+"":t,n),n),f_t="abitype",h_t="0.7.1",Kd=class extends Error{constructor(e,t={}){var a;const n=t.cause instanceof Kd?t.cause.details:(a=t.cause)!=null&&a.message?t.cause.message:t.details,r=t.cause instanceof Kd&&t.cause.docsPath||t.docsPath,s=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],`Version: ${f_t}@${h_t}`].join(`
`);super(s),_7(this,"details"),_7(this,"docsPath"),_7(this,"metaMessages"),_7(this,"shortMessage"),_7(this,"name","AbiTypeError"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}},sOe=/^struct (?<name>[a-zA-Z0-9_]+) \{(?<properties>.*?)\}$/;function iOe(e){return sOe.test(e)}function p_t(e){return koe(sOe,e)}var Oge=new Set(["memory","indexed","storage","calldata"]),m_t=new Set(["calldata","memory","storage"]);function x_t(e,t){return t?`${t}:${e}`:e}var CV=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),g_t=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,b_t=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,y_t=/^u?int$/;function xR(e,t){var f,x;const n=x_t(e,t==null?void 0:t.type);if(CV.has(n))return CV.get(n);const r=rOe.test(e),s=koe(r?b_t:g_t,e);if(!s)throw new Kd("Invalid ABI parameter.",{details:e});if(s.name&&w_t(s.name))throw new Kd("Invalid ABI parameter.",{details:e,metaMessages:[`"${s.name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});const a=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},l=(t==null?void 0:t.structs)??{};let c,u={};if(r){c="tuple";const g=SC(s.type),v=[],w=g.length;for(let C=0;C<w;C++)v.push(xR(g[C],{structs:l}));u={components:v}}else if(s.type in l)c="tuple",u={components:l[s.type]};else if(y_t.test(s.type))c=`${s.type}256`;else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!aOe(c))throw new Kd("Unknown type.",{metaMessages:[`Type "${c}" is not a valid ABI type.`]});if(s.modifier){if(!((x=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&x.call(f,s.modifier)))throw new Kd("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${s.modifier}" not allowed${t!=null&&t.type?` in "${t.type}" type`:""}.`]});if(m_t.has(s.modifier)&&!C_t(c,!!s.array))throw new Kd("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${s.modifier}" not allowed${t!=null&&t.type?` in "${t.type}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${s.modifier}" was given.`]})}const d={type:`${c}${s.array??""}`,...a,...o,...u};return CV.set(n,d),d}function SC(e,t=[],n="",r=0){if(e===""){if(n==="")return t;if(r!==0)throw new Kd("Unbalanced parentheses.",{metaMessages:[`"${n.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`});return[...t,n.trim()]}const s=e.length;for(let a=0;a<s;a++){const o=e[a],l=e.slice(a+1);switch(o){case",":return r===0?SC(l,[...t,n.trim()]):SC(l,t,`${n}${o}`,r);case"(":return SC(l,t,`${n}${o}`,r+1);case")":return SC(l,t,`${n}${o}`,r-1);default:return SC(l,t,`${n}${o}`,r)}}return[]}function aOe(e){return e==="address"||e==="bool"||e==="function"||e==="string"||tOe.test(e)||nOe.test(e)}var v_t=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function w_t(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||tOe.test(e)||nOe.test(e)||v_t.test(e)}function C_t(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function S_t(e){const t={},n=e.length;for(let o=0;o<n;o++){const l=e[o];if(!iOe(l))continue;const c=p_t(l);if(!c)throw new Kd("Invalid struct signature.",{details:l});const u=c.properties.split(";"),d=[],f=u.length;for(let x=0;x<f;x++){const v=u[x].trim();if(!v)continue;const w=xR(v,{type:"struct"});d.push(w)}if(!d.length)throw new Kd("Invalid struct signature.",{details:l,metaMessages:["No properties exist."]});t[c.name]=d}const r={},s=Object.entries(t),a=s.length;for(let o=0;o<a;o++){const[l,c]=s[o];r[l]=oOe(c,t)}return r}var N_t=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?$/;function oOe(e,t,n=new Set){const r=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(rOe.test(o.type))r.push(o);else{const c=koe(N_t,o.type);if(!(c!=null&&c.type))throw new Kd("Invalid ABI parameter.",{details:JSON.stringify(o,null,2),metaMessages:["ABI parameter type is invalid."]});const{array:u,type:d}=c;if(d in t){if(n.has(d))throw new Kd("Circular reference detected.",{metaMessages:[`Struct "${d}" is a circular reference.`]});r.push({...o,type:`tuple${u??""}`,components:oOe(t[d]??[],t,new Set([...n,d]))})}else if(aOe(d))r.push(o);else throw new Kd("Unknown type.",{metaMessages:[`Type "${d}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]})}}return r}function A_t(e){let t;if(typeof e=="string")t=xR(e,{modifiers:Oge});else{const n=S_t(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!iOe(a)){t=xR(a,{modifiers:Oge,structs:n});break}}}if(!t)throw new Kd("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(e,null,2)})`,docsPath:"/api/human.html#parseabiparameter-1"});return t}const tl=32;function Fee(e=0){var t;if(((t=globalThis.Buffer)===null||t===void 0?void 0:t.alloc)!==void 0){const n=globalThis.Buffer.alloc(e);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}return new Uint8Array(e)}function lOe(e){var t,n;return Object.assign(Object.assign({},e),{name:(t=e.name)!==null&&t!==void 0?t:"",components:(n=e.components)===null||n===void 0?void 0:n.map(r=>lOe(r))})}function j_t(e){return!Js(e)&&typeof e=="object"&&!Js(e.type)&&typeof e.type=="string"}function cOe(e){return e.map(t=>{var n;if(j_t(t))return t;if(typeof t=="string")return lOe(A_t(t.replace(/tuple/,"")));if(l_t(t)){const r=Object.keys(t)[0],s=JFe(r);return s.name=(n=s.name)!==null&&n!==void 0?n:"",Object.assign(Object.assign({},s),{components:eOe(t[r])})}throw new Ki("Invalid abi")})}function Toe(e){const t=e.type.lastIndexOf("["),n=e.type.substring(0,t),r=e.type.substring(t);let s=-1;if(r!=="[]"&&(s=Number(r.slice(1,-1)),isNaN(s)))throw new Ki("Invalid fixed array size",{size:r});return{param:{type:n,name:"",components:e.components},size:s}}function gR(e){var t,n;return e.type==="string"||e.type==="bytes"||e.type.endsWith("[]")?!0:e.type==="tuple"?(n=(t=e.components)===null||t===void 0?void 0:t.some(gR))!==null&&n!==void 0?n:!1:e.type.endsWith("]")?gR(Toe(e).param):!1}const uOe=20,dOe=tl-uOe;function E_t(e,t){if(typeof t!="string")throw new Ki("address type expects string as input type",{value:t,name:e.name,type:e.type});let n=t.toLowerCase();if(n.startsWith("0x")||(n=`0x${n}`),!Kf(n))throw new Ki("provided input is not valid address",{value:t,name:e.name,type:e.type});const r=h5(n),s=Fee(tl);return s.set(r,dOe),{dynamic:!1,encoded:s}}function __t(e,t){const n=t.subarray(dOe,tl);if(n.length!==uOe)throw new Ki("Invalid decoding input, not enough bytes to decode address",{bytes:t});const r=N1(n);return{result:fx(r),encoded:t.subarray(tl),consumed:tl}}const Ky=new Map;let dP=BigInt(256);for(let e=8;e<=256;e+=8)Ky.set(`uint${e}`,{min:BigInt(0),max:dP-BigInt(1)}),Ky.set(`int${e}`,{min:-dP/BigInt(2),max:dP/BigInt(2)-BigInt(1)}),dP*=BigInt(256);Ky.set("int",Ky.get("int256"));Ky.set("uint",Ky.get("uint256"));const fOe=BigInt(1)<<BigInt(256);function k_t(e,t=tl){let n;return e<0?n=(fOe+e).toString(16):n=e.toString(16),n=rN(n,t*2),h5(n)}function T_t(e,t){const n=N1(e),r=BigInt(n);return r<=t?r:r-fOe}function rT(e,t){let n;try{n=Yv(t)}catch{throw new Ki("provided input is not number value",{type:e.type,value:t,name:e.name})}const r=Ky.get(e.type);if(!r)throw new Ki("provided abi contains invalid number datatype",{type:e.type});if(n<r.min)throw new Ki("provided input is less then minimum for given type",{type:e.type,value:t,name:e.name,minimum:r.min.toString()});if(n>r.max)throw new Ki("provided input is greater then maximum for given type",{type:e.type,value:t,name:e.name,maximum:r.max.toString()});return{dynamic:!1,encoded:k_t(n)}}function dN(e,t){if(t.length<tl)throw new Ki("Not enough bytes left to decode",{param:e,bytesLeft:t.length});const n=t.subarray(0,tl),r=Ky.get(e.type);if(!r)throw new Ki("provided abi contains invalid number datatype",{type:e.type});const s=T_t(n,r.max);if(s<r.min)throw new Ki("decoded value is less then minimum for given type",{type:e.type,value:s,name:e.name,minimum:r.min.toString()});if(s>r.max)throw new Ki("decoded value is greater then maximum for given type",{type:e.type,value:s,name:e.name,maximum:r.max.toString()});return{result:s,encoded:t.subarray(tl),consumed:tl}}function I_t(e,t){let n;try{n=XPe(t)}catch(r){if(r instanceof zae)throw new Ki("provided input is not valid boolean value",{type:e.type,value:t,name:e.name})}return rT({type:"uint8",name:""},Number(n))}function P_t(e,t){const n=dN({type:"uint8",name:""},t);if(n.result>1||n.result<0)throw new Ki("Invalid boolean value encoded",{boolBytes:t.subarray(0,tl),numberResult:n});return{result:n.result===BigInt(1),encoded:n.encoded,consumed:tl}}const F_t=32;function hOe(e,t){if(typeof t=="string"&&t.length%2!==0&&(t+="0"),!c2(t))throw new Ki("provided input is not valid bytes value",{type:e.type,value:t,name:e.name});const n=rx(t),[,r]=e.type.split("bytes");if(r){if(Number(r)>F_t||Number(r)<1)throw new Ki("invalid bytes type. Static byte type can have between 1 and 32 bytes",{type:e.type});if(Number(r)<n.length)throw new Ki("provided input size is different than type size",{type:e.type,value:t,name:e.name});const o=Fee(tl);return o.set(n),{dynamic:!1,encoded:o}}const s=Math.ceil(n.length/tl),a=Fee(tl+s*tl);return a.set(rT({type:"uint32",name:""},n.length).encoded),a.set(n,tl),{dynamic:!0,encoded:a}}function pOe(e,t){const[,n]=e.type.split("bytes");let r=Number(n),s=t,a=1,o=0;if(!r){const l=dN({type:"uint32",name:""},s);r=Number(l.result),o+=l.consumed,s=l.encoded,a=Math.ceil(r/tl)}if(r>t.length)throw new Ki("there is not enough data to decode",{type:e.type,encoded:t,size:r});return{result:Vi(s.subarray(0,r)),encoded:s.subarray(a*tl),consumed:o+a*tl}}function O_t(e,t){if(typeof t!="string")throw new Ki("invalid input, should be string",{input:t});const n=Jae(t);return hOe({type:"bytes",name:""},n)}function M_t(e,t){const n=pOe({type:"bytes",name:""},t);return{result:r$(n.result),encoded:n.encoded,consumed:n.consumed}}function mOe(e){let t=0,n=0;const r=[],s=[];for(const a of e)a.dynamic?t+=tl:t+=a.encoded.length;for(const a of e)a.dynamic?(r.push(rT({type:"uint256",name:""},t+n)),s.push(a),n+=a.encoded.length):r.push(a);return gd(...r.map(a=>a.encoded),...s.map(a=>a.encoded))}function R_t(e,t){if(!Array.isArray(t))throw new Ki("Expected value to be array",{abi:e,values:t});const{size:n,param:r}=Toe(e),s=t.map(l=>Oee(r,l)),a=n===-1,o=s.length>0&&s[0].dynamic;if(!a&&t.length!==n)throw new Ki("Given arguments count doesn't match array length",{arrayLength:n,argumentsLength:t.length});if(a||o){const l=mOe(s);if(a){const c=rT({type:"uint256",name:""},s.length).encoded;return{dynamic:!0,encoded:s.length>0?gd(c,l):c}}return{dynamic:!0,encoded:l}}return{dynamic:!1,encoded:gd(...s.map(l=>l.encoded))}}function L_t(e,t){let{size:n,param:r}=Toe(e);const s=n===-1;let a=0;const o=[];let l=t;if(s){const u=dN({type:"uint32",name:""},t);n=Number(u.result),a=u.consumed,l=u.encoded}if(gR(r)){for(let u=0;u<n;u+=1){const d=dN({type:"uint32",name:""},l.subarray(u*tl));a+=d.consumed;const f=bR(r,l.subarray(Number(d.result)));a+=f.consumed,o.push(f.result)}return{result:o,encoded:l.subarray(a),consumed:a}}for(let u=0;u<n;u+=1){const d=bR(r,t.subarray(a));a+=d.consumed,o.push(d.result)}return{result:o,encoded:t.subarray(a),consumed:a}}function Oee(e,t){if(e.type==="string")return O_t(e,t);if(e.type==="bool")return I_t(e,t);if(e.type==="address")return E_t(e,t);if(e.type==="tuple")return Ioe(e,t);if(e.type.endsWith("]"))return R_t(e,t);if(e.type.startsWith("bytes"))return hOe(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return rT(e,t);throw new Ki("Unsupported",{param:e,value:t})}function bR(e,t){if(e.type==="string")return M_t(e,t);if(e.type==="bool")return P_t(e,t);if(e.type==="address")return __t(e,t);if(e.type==="tuple")return xOe(e,t);if(e.type.endsWith("]"))return L_t(e,t);if(e.type.startsWith("bytes"))return pOe(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return dN(e,t);throw new Ki("Unsupported",{param:e,bytes:t})}function Ioe(e,t){var n,r,s;let a=!1;if(!Array.isArray(t)&&typeof t!="object")throw new Ki("param must be either Array or Object",{param:e,input:t});const o=t,l=[];for(let c=0;c<((r=(n=e.components)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0);c+=1){const u=e.components[c];let d;if(Array.isArray(o)){if(c>=o.length)throw new Ki("input param length missmatch",{param:e,input:t});d=Oee(u,o[c])}else{const f=o[(s=u.name)!==null&&s!==void 0?s:""];if(f==null)throw new Ki("missing input defined in abi",{param:e,input:t,paramName:u.name});d=Oee(u,f)}d.dynamic&&(a=!0),l.push(d)}return a?{dynamic:!0,encoded:mOe(l)}:{dynamic:!1,encoded:gd(...l.map(c=>c.encoded))}}function xOe(e,t){const n={__length__:0};let r=0;if(!e.components)return{result:n,encoded:t,consumed:r};let s=0;for(const[a,o]of e.components.entries()){let l;if(gR(o)){const c=dN({type:"uint32",name:""},t.subarray(r));l=bR(o,t.subarray(Number(c.result))),r+=c.consumed,s+=l.consumed}else l=bR(o,t.subarray(r)),r+=l.consumed;n.__length__+=1,n[a]=l.result,o.name&&o.name!==""&&(n[o.name]=l.result)}return{encoded:t.subarray(r+s),result:n,consumed:r+s}}function D_t(e,t,n){const r=cOe(e),s=h5(t);return xOe({type:"tuple",name:"",components:r},s).result}function gOe(e){const t=[];return e.forEach(n=>{if(Array.isArray(n)){const r=gOe(n);t.push({type:"tuple",components:r,name:""})}else t.push({type:p1(n,!0)})}),t}function x$(e,t){if((e==null?void 0:e.length)!==t.length)throw new Ki("Invalid number of values received for given ABI",{expected:e==null?void 0:e.length,received:t.length});const n=cOe(e);return N1(Ioe({type:"tuple",name:"",components:n},t).encoded)}function B_t(e){try{const t=gOe(e);return N1(Ioe({type:"tuple",name:"",components:t},e).encoded)}catch{throw new Ki("Could not infer types from given params",{params:e})}}const Mee=(e,t)=>x$([e],[t]),bOe=(e,t,n)=>{try{if(e.length>0&&(!t||t==="0x"||t==="0X"))throw new Ki("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return D_t(e,`0x${t.replace(/0x/i,"")}`,n)}catch(r){throw new Ki(`Parameter decoding error: ${r.message}`,{internalErr:r})}},t3=(e,t)=>bOe(e,t,!1),yOe=(e,t)=>t3([e],t)[0],UE=e=>{if(typeof e!="string"&&!m$(e))throw new Ki("Invalid parameter value in encodeFunctionSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=qg(e):t=e,Yf(t).slice(0,10)},$_t=(e,t)=>{var n;if(!m$(e))throw new Ki("Invalid parameter value in encodeFunctionCall");return`${UE(e)}${x$((n=e.inputs)!==null&&n!==void 0?n:[],t??[]).replace("0x","")}`},Ree=(e,t,n=!0)=>{const r=n&&t&&t.length>=10&&t.startsWith("0x")?t.slice(10):t;if(!e.inputs)throw new fd("No inputs found in the ABI");const s=t3([...e.inputs],r);return Object.assign(Object.assign({},s),{__method__:qg(e)})},U_t=(e,t)=>{if(e.type==="constructor")return t;if(!t)return null;const n=t.length>=2?t.slice(2):t;if(!e.outputs)return null;const r=t3([...e.outputs],n);return r.__length__===1?r[0]:r},z_t=["bool","string","int","uint","address","fixed","ufixed"],H_t=(e,t)=>e==="string"?t:yOe(e,t),vOe=(e,t,n)=>{const r=Array.isArray(n)?n:[n],s={},a={};for(const[x,g]of e.entries())g.indexed?s[x]=g:a[x]=g;const o=t?bOe(Object.values(a),t,!0):{__length__:0},l=r.length-Object.keys(s).length,c=Object.values(s).map((x,g)=>z_t.some(v=>x.type.startsWith(v))?H_t(x.type,r[g+l]):r[g+l]),u={__length__:0};let d=0,f=0;for(const[x,g]of e.entries())u[x]=g.type==="string"?"":void 0,s[x]&&(u[x]=c[d],d+=1),a[x]&&(u[x]=o[String(f)],f+=1),g.name&&(u[g.name]=u[x]),u.__length__+=1;return u},pO=(e,t)=>{if(t!=null&&t.data){let n,r,s;try{const a=t.data.slice(0,10),o=e.find(l=>c_t(l).startsWith(a));o!=null&&o.inputs?(n=o.name,r=qg(o),s=t3([...o.inputs],t.data.substring(10))):t.data.startsWith("0x08c379a0")?(n="Error",r="Error(string)",s=t3([{name:"message",type:"string"}],t.data.substring(10))):t.data.startsWith("0x4e487b71")?(n="Panic",r="Panic(uint256)",s=t3([{name:"code",type:"uint256"}],t.data.substring(10))):console.error("No matching error abi found for error data",t.data)}catch(a){console.error(a)}n&&t.setDecodedProperties(n,r,s)}};var V_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const W_t=(e,t)=>{var n,r,s,a,o;if(e instanceof Qw&&e.cause instanceof KB){if(t!==void 0){const l=t.filter(c=>p$(c));return pO(l,e.cause),{reason:e.cause.message,signature:(n=e.cause.data)===null||n===void 0?void 0:n.slice(0,10),data:(r=e.cause.data)===null||r===void 0?void 0:r.substring(10),customErrorName:e.cause.errorName,customErrorDecodedSignature:e.cause.errorSignature,customErrorArguments:e.cause.errorArgs}}return{reason:e.cause.message,signature:(s=e.cause.data)===null||s===void 0?void 0:s.slice(0,10),data:(a=e.cause.data)===null||a===void 0?void 0:a.substring(10)}}if(e instanceof YB&&!Array.isArray((o=e.cause)===null||o===void 0?void 0:o.errors)&&e.cause!==void 0)return e.cause.message;throw e};function wOe(e,t,n){return V_t(this,arguments,void 0,function*(r,s,a,o=r.defaultReturnFormat){try{yield Moe(r,s,r.defaultBlock,o);return}catch(l){return W_t(l,a)}})}var q_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function SV(e,t,n,r,s,a){return q_t(this,void 0,void 0,function*(){let o=a;o===void 0&&e.handleRevert&&t!==void 0&&(o=yield wOe(e,t,s));let l;if(o===void 0)l=new uPe(n);else if(typeof o=="string")l=new GM(o,void 0,n);else if(o.customErrorName!==void 0&&o.customErrorDecodedSignature!==void 0&&o.customErrorArguments!==void 0){const c=o;l=new cPe(c.reason,c.customErrorName,c.customErrorDecodedSignature,c.customErrorArguments,c.signature,n,c.data)}else l=new GM(o.reason,o.signature,n,o.data);return l})}const Poe=(e,t,n,r=dd)=>{var s,a,o,l,c,u;let d=Object.assign({},e);const f=Vr(LA,t,r);if([uN,"allEvents"].includes(d.name)){const g=n.find(v=>v.signature===t.topics[0]);g?d=g:d={anonymous:!0}}if(d.inputs=(a=(s=d.inputs)!==null&&s!==void 0?s:e.inputs)!==null&&a!==void 0?a:[],!d.anonymous){let g=0;((o=d.inputs)!==null&&o!==void 0?o:[]).forEach(v=>{v.indexed&&(g+=1)}),g>0&&(t!=null&&t.topics)&&(t==null?void 0:t.topics.length)!==g+1&&(d=Object.assign(Object.assign({},d),{anonymous:!0,inputs:[]}))}const x=d.anonymous?t.topics:((l=t.topics)!==null&&l!==void 0?l:[]).slice(1);return Object.assign(Object.assign({},f),{returnValues:vOe([...(c=d.inputs)!==null&&c!==void 0?c:[]],t.data,x),event:d.name,signature:!d.anonymous&&((u=t.topics)===null||u===void 0?void 0:u.length)>0&&t.topics[0]?t.topics[0]:void 0,raw:{data:t.data,topics:t.topics}})};var ov=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class COe{constructor({options:t,web3Context:n,promiEvent:r,returnFormat:s}){this.options={checkRevertBeforeSending:!0},this.options=t,this.web3Context=n,this.promiEvent=r,this.returnFormat=s}getReceiptWithEvents(t){var n,r;const s=Object.assign({},t??{});if(!((n=this.options)===null||n===void 0)&&n.contractAbi&&s.logs&&s.logs.length>0){s.events={};for(const a of s.logs){const o=Poe(_ee,a,(r=this.options)===null||r===void 0?void 0:r.contractAbi,this.returnFormat);o.event&&(s.events[o.event]=o)}}return s}checkRevertBeforeSending(t){return ov(this,void 0,void 0,function*(){if(this.options.checkRevertBeforeSending!==!1){let n=t;dr(t.data)&&dr(t.input)&&dr(t.gas)&&(n=Object.assign(Object.assign({},t),{gas:21e3}));const r=yield wOe(this.web3Context,n,this.options.contractAbi);if(r!==void 0)throw yield SV(this.web3Context,t,void 0,void 0,this.options.contractAbi,r)}})}emitSending(t){this.promiEvent.listenerCount("sending")>0&&this.promiEvent.emit("sending",t)}populateGasPrice(t){return ov(this,arguments,void 0,function*({transactionFormatted:n,transaction:r}){var s;let a=n;return!this.web3Context.config.ignoreGasPricing&&!(!((s=this.options)===null||s===void 0)&&s.ignoreGasPricing)&&dr(n.gasPrice)&&(dr(r.maxPriorityFeePerGas)||dr(r.maxFeePerGas))&&(a=Object.assign(Object.assign({},n),yield YFe(n,this.web3Context,fi))),a})}signAndSend(t){return ov(this,arguments,void 0,function*({wallet:n,tx:r}){if(n){const s=yield n.signTransaction(r);return Iee(this.web3Context,()=>ov(this,void 0,void 0,function*(){return HFe(this.web3Context.requestManager,s.rawTransaction)}),s.transactionHash)}return Iee(this.web3Context,()=>ov(this,void 0,void 0,function*(){return Z9t(this.web3Context.requestManager,r)}))})}emitSent(t){this.promiEvent.listenerCount("sent")>0&&this.promiEvent.emit("sent",t)}emitTransactionHash(t){this.promiEvent.listenerCount("transactionHash")>0&&this.promiEvent.emit("transactionHash",t)}emitReceipt(t){this.promiEvent.listenerCount("receipt")>0&&this.promiEvent.emit("receipt",t)}handleError(t){return ov(this,arguments,void 0,function*({error:n,tx:r}){var s;let a=n;return a instanceof Qw&&this.web3Context.handleRevert&&(a=yield SV(this.web3Context,r,void 0,void 0,(s=this.options)===null||s===void 0?void 0:s.contractAbi)),(a instanceof YB||a instanceof Qw||a instanceof cPe||a instanceof uPe||a instanceof GM||a instanceof pPe)&&this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",a),a})}emitConfirmation({receipt:t,transactionHash:n,customTransactionReceiptSchema:r}){this.promiEvent.listenerCount("confirmation")>0&&a_t(this.web3Context,this.promiEvent,t,n,this.returnFormat,r)}handleResolve(t){return ov(this,arguments,void 0,function*({receipt:n,tx:r}){var s,a,o;if(!((s=this.options)===null||s===void 0)&&s.transactionResolver)return(a=this.options)===null||a===void 0?void 0:a.transactionResolver(n);if(n.status===BigInt(0)){const l=yield SV(this.web3Context,r,n,void 0,(o=this.options)===null||o===void 0?void 0:o.contractAbi);throw this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",l),l}else return n})}}var La=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},G_t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const K_t=e=>La(void 0,void 0,void 0,function*(){return zFe(e.requestManager)});function Y_t(e,t){return La(this,void 0,void 0,function*(){const n=yield L9t(e.requestManager);return Vr({format:"uint"},n,t??e.defaultReturnFormat)})}function Foe(e,t){return La(this,void 0,void 0,function*(){const n=yield D9t(e.requestManager);return Vr({format:"uint"},n,t??e.defaultReturnFormat)})}function X_t(e,t){return La(this,void 0,void 0,function*(){const n=yield B9t(e.requestManager);return Vr({format:"uint"},n,t??e.defaultReturnFormat)})}function Ooe(e,t){return La(this,void 0,void 0,function*(){const n=yield U9t(e.requestManager);return Vr({format:"uint"},n,t??e.defaultReturnFormat)})}function Q_t(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Oc(s)?s:Vr({format:"uint"},s,fi),l=yield z9t(n.requestManager,r,o);return Vr({format:"uint"},l,a??n.defaultReturnFormat)})}function Z_t(e,t,n){return La(this,arguments,void 0,function*(r,s,a,o=r.defaultBlock,l){const c=Vr({format:"uint"},a,fi),u=Oc(o)?o:Vr({format:"uint"},o,fi),d=yield H9t(r.requestManager,s,c,u);return Vr({format:"bytes"},d,l??r.defaultReturnFormat)})}function J_t(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Oc(s)?s:Vr({format:"uint"},s,fi),l=yield Y9t(n.requestManager,r,o);return Vr({format:"bytes"},l,a??n.defaultReturnFormat)})}function SOe(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r=!1,s){var a;let o;if(c2(n)){const c=Vr({format:"bytes32"},n,fi);o=yield tEt(t.requestManager,c,r)}else{const c=Oc(n)?n:Vr({format:"uint"},n,fi);o=yield VFe(t.requestManager,c,r)}const l=Vr(mR,o,s??t.defaultReturnFormat);return dr(l)?l:Object.assign(Object.assign({},l),{transactions:(a=l.transactions)!==null&&a!==void 0?a:[]})})}function ekt(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r){let s;if(c2(n)){const a=Vr({format:"bytes32"},n,fi);s=yield W9t(t.requestManager,a)}else{const a=Oc(n)?n:Vr({format:"uint"},n,fi);s=yield q9t(t.requestManager,a)}return Vr({format:"uint"},s,r??t.defaultReturnFormat)})}function tkt(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r){let s;if(c2(n)){const a=Vr({format:"bytes32"},n,fi);s=yield G9t(t.requestManager,a)}else{const a=Oc(n)?n:Vr({format:"uint"},n,fi);s=yield K9t(t.requestManager,a)}return Vr({format:"uint"},s,r??t.defaultReturnFormat)})}function nkt(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r,s){const a=Vr({format:"uint"},r,fi);let o;if(c2(n)){const l=Vr({format:"bytes32"},n,fi);o=yield aEt(t.requestManager,l,a)}else{const l=Oc(n)?n:Vr({format:"uint"},n,fi);o=yield oEt(t.requestManager,l,a)}return Vr(mR,o,s??t.defaultReturnFormat)})}function rkt(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultReturnFormat){const a=Vr({format:"bytes32"},r,dd),o=yield nEt(n.requestManager,a);return dr(o)?o:cf(o,s,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})})}function skt(e,t){return La(this,void 0,void 0,function*(){return(yield bEt(e.requestManager)).map(r=>cf(r,t??e.defaultReturnFormat,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0}))})}function ikt(e){return La(this,arguments,void 0,function*(t,n=t.defaultBlock,r,s){const a=Vr({format:"uint"},r,fi);let o;if(c2(n)){const l=Vr({format:"bytes32"},n,fi);o=yield rEt(t.requestManager,l,a)}else{const l=Oc(n)?n:Vr({format:"uint"},n,fi);o=yield sEt(t.requestManager,l,a)}return dr(o)?o:cf(o,s??t.defaultReturnFormat,{transactionSchema:t.config.customTransactionSchema,fillInputAndData:!0})})}function NOe(e,t,n){return La(this,void 0,void 0,function*(){const r=Vr({format:"bytes32"},t,dd);let s;try{s=yield iEt(e.requestManager,r)}catch(a){if(typeof a=="object"&&!dr(a)&&"message"in a&&a.message==="transaction indexing is in progress")console.warn("Transaction indexing is in progress.");else throw a}return dr(s)?s:Vr(DA,s,n??e.defaultReturnFormat)})}function AOe(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Oc(s)?s:Vr({format:"uint"},s,fi),l=yield V9t(n.requestManager,r,o);return Vr({format:"uint"},l,a??n.defaultReturnFormat)})}function zE(e,t,n,r={checkRevertBeforeSending:!0},s){const a=new UFe((o,l)=>{setImmediate(()=>{La(this,void 0,void 0,function*(){const c=new COe({web3Context:e,promiEvent:a,options:r,returnFormat:n});let u=Object.assign({},t);dr(s)||(u=yield s.processTransaction(u));let d=cf(Object.assign(Object.assign({},u),{from:kee("from",e,u),to:kee("to",e,u)}),fi,{transactionSchema:e.config.customTransactionSchema});try{d=yield c.populateGasPrice({transaction:u,transactionFormatted:d}),yield c.checkRevertBeforeSending(d),c.emitSending(d);let f;e.wallet&&!dr(d.from)&&(f=e.wallet.get(d.from));const x=yield c.signAndSend({wallet:f,tx:d}),g=Vr({format:"bytes32"},x,n??e.defaultReturnFormat);c.emitSent(d),c.emitTransactionHash(g);const v=yield ZFe(e,x,n??e.defaultReturnFormat),w=c.getReceiptWithEvents(Vr(DA,v,n??e.defaultReturnFormat));c.emitReceipt(w),o(yield c.handleResolve({receipt:w,tx:d})),c.emitConfirmation({receipt:w,transactionHash:x})}catch(f){l(yield c.handleError({error:f,tx:d}))}})})});return a}function akt(e,t,n,r={checkRevertBeforeSending:!0}){const s=new UFe((a,o)=>{setImmediate(()=>{La(this,void 0,void 0,function*(){const l=new COe({web3Context:e,promiEvent:s,options:r,returnFormat:n}),c=Vr({format:"bytes"},t,fi),u=H3.fromSerializedData(rx(oo(c))),d=Object.assign(Object.assign({},u.toJSON()),{from:u.getSenderAddress().toString()});try{const{v:f,r:x,s:g}=d,v=G_t(d,["v","r","s"]);yield l.checkRevertBeforeSending(v),l.emitSending(c);const w=yield Iee(e,()=>La(this,void 0,void 0,function*(){return HFe(e.requestManager,c)}));l.emitSent(c);const C=Vr({format:"bytes32"},w,n??e.defaultReturnFormat);l.emitTransactionHash(C);const N=yield ZFe(e,w,n??e.defaultReturnFormat),I=l.getReceiptWithEvents(Vr(DA,N,n??e.defaultReturnFormat));l.emitReceipt(I),a(yield l.handleResolve({receipt:I,tx:d})),l.emitConfirmation({receipt:I,transactionHash:w})}catch(f){o(yield l.handleError({error:f,tx:d}))}})})});return s}function okt(e,t,n){return La(this,arguments,void 0,function*(r,s,a,o=r.defaultReturnFormat){var l;const c=Vr({format:"bytes"},s,dd);if(!((l=r.wallet)===null||l===void 0)&&l.get(a)){const f=r.wallet.get(a).sign(c);return Vr(WEt,f,o)}if(typeof a=="number")throw new cNt(s,'RPC method "eth_sign" does not support index signatures');const u=yield X9t(r.requestManager,a,c);return Vr({format:"bytes"},u,o)})}function lkt(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultReturnFormat){const a=yield Q9t(n.requestManager,cf(r,fi,{transactionSchema:n.config.customTransactionSchema}));return Kae(a)?YEt(a,s,{fillInputAndData:!0}):{raw:Vr({format:"bytes"},a.raw,s),tx:cf(a.tx,s,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})}})}function Moe(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a=n.defaultReturnFormat){const o=Oc(s)?s:Vr({format:"uint"},s,fi),l=yield J9t(n.requestManager,cf(r,fi,{transactionSchema:n.config.customTransactionSchema}),o);return Vr({format:"bytes"},l,a)})}function Roe(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=cf(r,fi,{transactionSchema:n.config.customTransactionSchema}),l=Oc(s)?s:Vr({format:"uint"},s,fi),c=yield eEt(n.requestManager,o,l);return Vr({format:"uint"},c,a??n.defaultReturnFormat)})}function jOe(e,t,n){return La(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:s}=t;dr(r)||(typeof r=="number"||typeof r=="bigint")&&(r=nc(r)),dr(s)||(typeof s=="number"||typeof s=="bigint")&&(s=nc(s));const a=Object.assign(Object.assign({},t),{fromBlock:s,toBlock:r});return(yield pEt(e.requestManager,a)).map(c=>typeof c=="string"?c:Vr(LA,c,n??e.defaultReturnFormat))})}function EOe(e,t){return La(this,void 0,void 0,function*(){const n=yield vEt(e.requestManager);return Vr({format:"uint"},n,t??e.defaultReturnFormat)})}function ckt(e,t,n){return La(this,arguments,void 0,function*(r,s,a,o=r.defaultBlock,l){const c=a.map(f=>Vr({format:"bytes"},f,fi)),u=Oc(o)?o:Vr({format:"uint"},o,fi),d=yield wEt(r.requestManager,s,c,u);return Vr(KEt,d,l??r.defaultReturnFormat)})}function ukt(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a,o){const l=Vr({format:"uint"},r,fi),c=Oc(s)?s:Vr({format:"uint"},s,fi),u=Vr({type:"array",items:{format:"uint"}},a,h$),d=yield gEt(n.requestManager,l,c,u);return Vr(qEt,d,o??n.defaultReturnFormat)})}function _Oe(e,t){return La(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Oc(s)?s:Vr({format:"uint"},s,fi),l=yield SEt(n.requestManager,cf(r,fi,{transactionSchema:n.config.customTransactionSchema}),o);return Vr(UEt,l,a??n.defaultReturnFormat)})}function dkt(e,t,n,r,s){return La(this,void 0,void 0,function*(){const a=yield NEt(e.requestManager,t,n,r);return Vr({format:"bytes"},a,s??e.defaultReturnFormat)})}var BA=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function fkt(e,t){return BA(this,void 0,void 0,function*(){const n=yield uEt(e.requestManager);return Vr({format:"uint"},n,t??e.defaultReturnFormat)})}function hkt(e,t,n){return BA(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:s}=t;dr(r)||(typeof r=="number"||typeof r=="bigint")&&(r=nc(r)),dr(s)||(typeof s=="number"||typeof s=="bigint")&&(s=nc(s));const a=Object.assign(Object.assign({},t),{fromBlock:s,toBlock:r}),o=yield lEt(e.requestManager,a);return Vr({format:"uint"},o,n??e.defaultReturnFormat)})}function pkt(e,t){return BA(this,void 0,void 0,function*(){const n=yield cEt(e.requestManager);return Vr({format:"uint"},n,t??e.defaultReturnFormat)})}function mkt(e,t){return BA(this,void 0,void 0,function*(){return yield dEt(e.requestManager,nc(t))})}function xkt(e,t,n){return BA(this,void 0,void 0,function*(){return(yield fEt(e.requestManager,nc(t))).map(a=>typeof a=="string"?a:Vr(LA,a,n??e.defaultReturnFormat))})}function gkt(e,t,n){return BA(this,void 0,void 0,function*(){return(yield hEt(e.requestManager,nc(t))).map(a=>typeof a=="string"?a:Vr(LA,a,n??e.defaultReturnFormat))})}class kOe extends eT{_buildSubscriptionParams(){return["logs",this.args]}formatSubscriptionResult(t){return Vr(LA,t,super.returnFormat)}}class Mge extends eT{_buildSubscriptionParams(){return["newPendingTransactions"]}formatSubscriptionResult(t){return Vr({format:"string"},t,super.returnFormat)}}class yR extends eT{_buildSubscriptionParams(){return["newHeads"]}formatSubscriptionResult(t){return Vr(HEt,t,super.returnFormat)}}class TOe extends eT{_buildSubscriptionParams(){return["syncing"]}_processSubscriptionResult(t){if(typeof t=="boolean")this.emit("changed",t);else{const n=Object.fromEntries(Object.entries((t==null?void 0:t.status)||t).map(([r,s])=>[r.charAt(0).toLowerCase()+r.substring(1),s]));this.emit("changed",t.syncing),this.emit("data",Vr(VEt,n,super.returnFormat))}}}var gi=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Lee={logs:kOe,newPendingTransactions:Mge,newHeads:yR,syncing:TOe,pendingTransactions:Mge,newBlockHeaders:yR};class g$ extends Qd{constructor(t){if(typeof t=="string"||uR(t)){super({provider:t,registeredSubscriptions:Lee});return}if(t.registeredSubscriptions){super(t);return}super(Object.assign(Object.assign({},t),{registeredSubscriptions:Lee})),this.getFeeData=this.calculateFeeData}setTransactionMiddleware(t){this.transactionMiddleware=t}getTransactionMiddleware(){return this.transactionMiddleware}getProtocolVersion(){return gi(this,void 0,void 0,function*(){return O9t(this.requestManager)})}isSyncing(){return gi(this,void 0,void 0,function*(){return zFe(this.requestManager)})}getCoinbase(){return gi(this,void 0,void 0,function*(){return M9t(this.requestManager)})}isMining(){return gi(this,void 0,void 0,function*(){return R9t(this.requestManager)})}getHashrate(t){return gi(this,void 0,void 0,function*(){var n;return t===void 0&&(t=(n=this.defaultReturnFormat)!==null&&n!==void 0?n:dd),this.getHashRate(t)})}getHashRate(){return gi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Y_t(this,t)})}getGasPrice(){return gi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Foe(this,t)})}getMaxPriorityFeePerGas(){return gi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return X_t(this,t)})}calculateFeeData(){return gi(this,arguments,void 0,function*(t=BigInt(2),n=n$.Gwei){var r;const s=yield this.getBlock(void 0,!1),a=(r=s==null?void 0:s.baseFeePerGas)!==null&&r!==void 0?r:void 0;let o;try{o=yield this.getGasPrice()}catch{}let l;try{l=yield this.getMaxPriorityFeePerGas()}catch{}let c;if(a){l=l??n;let u;typeof t=="number"?u=BigInt(Math.floor(t*1e3))/BigInt(1e3):u=t,c=a*u+l}return{gasPrice:o,maxFeePerGas:c,maxPriorityFeePerGas:l,baseFeePerGas:a}})}getAccounts(){return gi(this,void 0,void 0,function*(){var t;return((t=yield $9t(this.requestManager))!==null&&t!==void 0?t:[]).map(r=>fx(r))})}getBlockNumber(){return gi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Ooe(this,t)})}getBalance(t){return gi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Q_t(this,n,r,s)})}getStorageAt(t,n){return gi(this,arguments,void 0,function*(r,s,a=this.defaultBlock,o=this.defaultReturnFormat){return Z_t(this,r,s,a,o)})}getCode(t){return gi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return J_t(this,n,r,s)})}getBlock(){return gi(this,arguments,void 0,function*(t=this.defaultBlock,n=!1,r=this.defaultReturnFormat){return SOe(this,t,n,r)})}getBlockTransactionCount(){return gi(this,arguments,void 0,function*(t=this.defaultBlock,n=this.defaultReturnFormat){return ekt(this,t,n)})}getBlockUncleCount(){return gi(this,arguments,void 0,function*(t=this.defaultBlock,n=this.defaultReturnFormat){return tkt(this,t,n)})}getUncle(){return gi(this,arguments,void 0,function*(t=this.defaultBlock,n,r=this.defaultReturnFormat){return nkt(this,t,n,r)})}getTransaction(t){return gi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const s=yield rkt(this,n,r);if(!s)throw new $xe;return s})}getPendingTransactions(){return gi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return skt(this,t)})}getTransactionFromBlock(){return gi(this,arguments,void 0,function*(t=this.defaultBlock,n,r=this.defaultReturnFormat){return ikt(this,t,n,r)})}getTransactionReceipt(t){return gi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const s=yield NOe(this,n,r);if(!s)throw new $xe;return s})}getTransactionCount(t){return gi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return AOe(this,n,r,s)})}sendTransaction(t,n=this.defaultReturnFormat,r){return zE(this,t,n,r,this.transactionMiddleware)}sendSignedTransaction(t,n=this.defaultReturnFormat,r){return akt(this,t,n,r)}sign(t,n){return gi(this,arguments,void 0,function*(r,s,a=this.defaultReturnFormat){return okt(this,r,s,a)})}signTransaction(t){return gi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return lkt(this,n,r)})}call(t){return gi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Moe(this,n,r,s)})}estimateGas(t){return gi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Roe(this,n,r,s)})}getPastLogs(t){return gi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return jOe(this,n,r)})}getWork(){return gi(this,void 0,void 0,function*(){return mEt(this.requestManager)})}submitWork(t,n,r){return gi(this,void 0,void 0,function*(){return xEt(this.requestManager,t,n,r)})}requestAccounts(){return gi(this,void 0,void 0,function*(){return yEt(this.requestManager)})}getChainId(){return gi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return EOe(this,t)})}getNodeInfo(){return gi(this,void 0,void 0,function*(){return CEt(this.requestManager)})}getProof(t,n){return gi(this,arguments,void 0,function*(r,s,a=this.defaultBlock,o=this.defaultReturnFormat){return ckt(this,r,s,a,o)})}getFeeHistory(t){return gi(this,arguments,void 0,function*(n,r=this.defaultBlock,s,a=this.defaultReturnFormat){return ukt(this,n,r,s,a)})}createAccessList(t){return gi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return _Oe(this,n,r,s)})}signTypedData(t,n,r,s){return gi(this,void 0,void 0,function*(){var a;return r===void 0&&(r=!1),s===void 0&&(s=(a=this.defaultReturnFormat)!==null&&a!==void 0?a:dd),dkt(this,t,n,r,s)})}subscribe(t,n,r){return gi(this,void 0,void 0,function*(){var s,a;r===void 0&&(r=(s=this.defaultReturnFormat)!==null&&s!==void 0?s:dd);const o=yield(a=this.subscriptionManager)===null||a===void 0?void 0:a.subscribe(t,n,r);return o instanceof kOe&&t==="logs"&&typeof n=="object"&&!Js(n.fromBlock)&&Number.isFinite(Number(n.fromBlock))&&setImmediate(()=>{this.getPastLogs(n).then(l=>{for(const c of l)o._processSubscriptionResult(c)}).catch(l=>{o._processSubscriptionError(l)})}),o})}static shouldClearSubscription({sub:t}){return!(t instanceof TOe)}clearSubscriptions(t=!1){var n;return(n=this.subscriptionManager)===null||n===void 0?void 0:n.unsubscribe(t?g$.shouldClearSubscription:void 0)}createNewPendingTransactionFilter(){return gi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return fkt(this,t)})}createNewFilter(t){return gi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return hkt(this,n,r)})}createNewBlockFilter(){return gi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return pkt(this,t)})}uninstallFilter(t){return gi(this,void 0,void 0,function*(){return mkt(this,t)})}getFilterChanges(t){return gi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return xkt(this,n,r)})}getFilterLogs(t){return gi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return gkt(this,n,r)})}}const bkt=e=>{if(!dr(e.common)){if(dr(e.common.customChain))throw new hNt;if(dr(e.common.customChain.chainId))throw new pNt;if(!dr(e.chainId)&&e.chainId!==e.common.customChain.chainId)throw new mNt({txChainId:e.chainId,customChainId:e.common.customChain.chainId})}},ykt=e=>{if(!dr(e.common)&&!dr(e.chain)&&!dr(e.hardfork))throw new bNt;if(!dr(e.chain)&&dr(e.hardfork)||!dr(e.hardfork)&&dr(e.chain))throw new yNt({chain:e.chain,hardfork:e.hardfork})},vkt=e=>{if(!dr(e.common)&&!dr(e.common.baseChain)&&!dr(e.chain)&&e.chain!==e.common.baseChain)throw new xNt({txChain:e.chain,baseChain:e.common.baseChain})},wkt=e=>{if(!dr(e.common)&&!dr(e.common.hardfork)&&!dr(e.hardfork)&&e.hardfork!==e.common.hardfork)throw new gNt({txHardfork:e.hardfork,commonHardfork:e.common.hardfork})},Rge=e=>{if(dr(e.gas)||!h1(e.gas)||dr(e.gasPrice)||!h1(e.gasPrice))throw new NNt({gas:e.gas,gasPrice:e.gasPrice});if(!dr(e.maxFeePerGas)||!dr(e.maxPriorityFeePerGas))throw new dPe({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas})},Lge=e=>{if(!dr(e.gasPrice)&&e.type==="0x2")throw new jNt(e.gasPrice);if(e.type==="0x0"||e.type==="0x1")throw new dPe({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas});if(dr(e.maxFeePerGas)||!h1(e.maxFeePerGas)||dr(e.maxPriorityFeePerGas)||!h1(e.maxPriorityFeePerGas))throw new ANt({maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})},Ckt=e=>{const t=!dr(e.gas)||!dr(e.gasLimit),n=t&&!dr(e.gasPrice),r=t&&!dr(e.maxPriorityFeePerGas)&&!dr(e.maxFeePerGas);if(!n&&!r)throw new wNt({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});if(n&&r)throw new SNt({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});(n?Rge:Lge)(e),(!dr(e.type)&&e.type>"0x1"?Lge:Rge)(e)},Skt=(e,t,n={transactionSchema:void 0})=>{if(!dr(t)){t(e);return}if(typeof e!="object"||dr(e))throw new ENt(e);bkt(e),ykt(e),vkt(e),wkt(e);const r=cf(e,fi,{transactionSchema:n.transactionSchema});if(Ckt(r),dr(r.nonce)||dr(r.chainId)||r.nonce.startsWith("-")||r.chainId.startsWith("-"))throw new _Nt({nonce:e.nonce,chainId:e.chainId})};var Nkt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Akt=e=>{var t,n;return Object.assign(Object.assign({},e),{nonce:e.nonce,gasPrice:e.gasPrice,gasLimit:(t=e.gasLimit)!==null&&t!==void 0?t:e.gas,to:e.to,value:e.value,data:(n=e.data)!==null&&n!==void 0?n:e.input,type:e.type,chainId:e.chainId,accessList:e.accessList,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})},jkt=(e,t)=>{var n,r,s,a,o,l,c,u,d,f,x,g,v,w,C,N,I,P;const R=!dr(e.chain)&&!dr(e.hardfork)||!dr(e.common);let F;if(!R)t.defaultCommon?(F=Object.assign({},t.defaultCommon),dr(F.hardfork)&&(F.hardfork=(n=e.hardfork)!==null&&n!==void 0?n:t.defaultHardfork),dr(F.baseChain)&&(F.baseChain=t.defaultChain)):F=Zl.custom({name:"custom-network",chainId:Xd(e.chainId),networkId:dr(e.networkId)?void 0:Xd(e.networkId),defaultHardfork:(r=e.hardfork)!==null&&r!==void 0?r:t.defaultHardfork},{baseChain:t.defaultChain});else{const U=(l=(o=(a=(s=e==null?void 0:e.common)===null||s===void 0?void 0:s.customChain)===null||a===void 0?void 0:a.name)!==null&&o!==void 0?o:e.chain)!==null&&l!==void 0?l:"custom-network",L=Xd((d=(u=(c=e==null?void 0:e.common)===null||c===void 0?void 0:c.customChain)===null||u===void 0?void 0:u.chainId)!==null&&d!==void 0?d:e==null?void 0:e.chainId),z=Xd((g=(x=(f=e==null?void 0:e.common)===null||f===void 0?void 0:f.customChain)===null||x===void 0?void 0:x.networkId)!==null&&g!==void 0?g:e==null?void 0:e.networkId),Q=(C=(w=(v=e==null?void 0:e.common)===null||v===void 0?void 0:v.hardfork)!==null&&w!==void 0?w:e==null?void 0:e.hardfork)!==null&&C!==void 0?C:t.defaultHardfork,ne=(P=(I=(N=e.common)===null||N===void 0?void 0:N.baseChain)!==null&&I!==void 0?I:e.chain)!==null&&P!==void 0?P:t.defaultChain;L&&z&&U&&(F=Zl.custom({name:U,chainId:L,networkId:z,defaultHardfork:Q},{baseChain:ne}))}return{common:F}},Ekt=(e,t,n,...r)=>Nkt(void 0,[e,t,n,...r],void 0,function*(s,a,o,l=!1,c=!0){const u=yield t_t({transaction:s,web3Context:a,privateKey:o,fillGasPrice:l,fillGasLimit:c}),d=cf(u,fi,{transactionSchema:a.config.customTransactionSchema});return Skt(d,void 0,{transactionSchema:a.config.customTransactionSchema}),H3.fromTxData(Akt(d),jkt(d,a))}),Dge=({address:e},t,n)=>{var r,s;const a=n==null?void 0:n.topics,o=(r=n==null?void 0:n.filter)!==null&&r!==void 0?r:{},l={};if(Js(n==null?void 0:n.fromBlock)||(l.fromBlock=Vr(mR.properties.number,n==null?void 0:n.fromBlock,{number:Qh.HEX,bytes:d1.HEX})),Js(n==null?void 0:n.toBlock)||(l.toBlock=Vr(mR.properties.number,n==null?void 0:n.toBlock,{number:Qh.HEX,bytes:d1.HEX})),a&&Array.isArray(a))l.topics=[...a];else if(l.topics=[],t&&!t.anonymous&&![uN,"allEvents"].includes(t.name)&&l.topics.push((s=t.signature)!==null&&s!==void 0?s:_oe(qg(t))),![uN,"allEvents"].includes(t.name)&&t.inputs)for(const c of t.inputs){if(!c.indexed)continue;const u=o[c.name];if(!u){l.topics.push(null);continue}Array.isArray(u)?l.topics.push(u.map(d=>Mee(c.type,d))):c.type==="string"?l.topics.push(sN(u)):l.topics.push(Mee(c.type,u))}return l.topics.length||delete l.topics,e&&(l.address=e.toLowerCase()),l},Zj=(e,t,n)=>{const r=Array.isArray(e.inputs)?e.inputs.length:0;if(e.inputs&&r!==t.length)throw new fd(`The number of arguments is not matching the methods required number. You need to pass ${r} arguments.`);let s;if(e.inputs?s=x$(Array.isArray(e.inputs)?e.inputs:[],t).replace("0x",""):s=B_t(t).replace("0x",""),o_t(e)){if(!n)throw new fd("The contract has no contract data option set. This is necessary to append the constructor parameters.");return n.startsWith("0x")?`${n}${s}`:`0x${n}${s}`}return`${UE(e)}${s}`};class IOe extends eT{constructor(t,n){super(t,n),this.address=t.address,this.topics=t.topics,this.abi=t.abi,this.jsonInterface=t.jsonInterface}_buildSubscriptionParams(){return["logs",{address:this.address,topics:this.topics}]}formatSubscriptionResult(t){return Poe(this.abi,t,this.jsonInterface,super.returnFormat)}}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const b$=(e,t,n,r)=>{var s,a;const o={};return(!Js(e.data)||r==="both")&&(o.data=Zj(t,n,(s=e.data)!==null&&s!==void 0?s:e.input)),(!Js(e.input)||r==="both")&&(o.input=Zj(t,n,(a=e.input)!==null&&a!==void 0?a:e.data)),Js(o.input)&&Js(o.data)&&(o[r]=Zj(t,n)),{data:o.data,input:o.input}},Dee=({abi:e,params:t,options:n,contractOptions:r})=>{var s,a,o;if(!((o=(a=(s=n==null?void 0:n.input)!==null&&s!==void 0?s:n==null?void 0:n.data)!==null&&a!==void 0?a:r.input)!==null&&o!==void 0?o:r.data)&&!(n!=null&&n.to)&&!r.address)throw new fd("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new fd('Contract "from" address not specified');let c=d2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const u=b$(c,e,t,n==null?void 0:n.dataInputFill);return c=Object.assign(Object.assign({},c),{data:u.data,input:u.input}),c},_kt=({abi:e,params:t,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new fd("Contract address not specified");let s=d2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const a=b$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s},kkt=({abi:e,params:t,options:n,contractOptions:r})=>{let s=d2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,data:r.data},n);const a=b$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s},Bge=e=>typeof e=="object"&&!Js(e)&&Object.keys(e).length!==0&&!py(e),Tkt=({abi:e,params:t,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new fd("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new fd('Contract "from" address not specified');let s=d2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const a=b$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s};var Ikt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class Pkt{_contractMethodDeploySend(t){const n={transactionResolver:r=>{if(r.status===BigInt(0))throw new fd("code couldn't be stored",r);const s=this.parent.clone();return s.options.address=r.contractAddress,s},contractAbi:this.parent.options.jsonInterface,checkRevertBeforeSending:!1};return dr(this.parent.getTransactionMiddleware())?zE(this.parent,t,this.parent.defaultReturnFormat,n):zE(this.parent,t,this.parent.defaultReturnFormat,n,this.parent.getTransactionMiddleware())}constructor(t,n){this.parent=t,this.deployOptions=n;const{args:r,abi:s,contractOptions:a,deployData:o}=this.calculateDeployParams();this.args=r,this.constructorAbi=s,this.contractOptions=a,this.deployData=o}send(t){const n=Object.assign({},t),r=this.populateTransaction(n);return this._contractMethodDeploySend(r)}populateTransaction(t){var n,r;const s=Object.assign(Object.assign({},this.contractOptions),{from:(r=(n=this.contractOptions.from)!==null&&n!==void 0?n:this.parent.defaultAccount)!==null&&r!==void 0?r:void 0}),a=Dee({abi:this.constructorAbi,params:this.args,options:Object.assign(Object.assign({},t),{dataInputFill:this.parent.contractDataInputFill}),contractOptions:s});return a.dataInputFill&&delete a.dataInputFill,a}calculateDeployParams(){var t,n,r,s,a,o;let l=this.parent.options.jsonInterface.find(g=>g.type==="constructor");l||(l={type:"constructor",stateMutability:""});const c=Vr({format:"bytes"},(n=(t=this.deployOptions)===null||t===void 0?void 0:t.input)!==null&&n!==void 0?n:this.parent.options.input,dd),u=Vr({format:"bytes"},(s=(r=this.deployOptions)===null||r===void 0?void 0:r.data)!==null&&s!==void 0?s:this.parent.options.data,dd);if((!c||c.trim()==="0x")&&(!u||u.trim()==="0x"))throw new fd("contract creation without any data provided.");const d=(o=(a=this.deployOptions)===null||a===void 0?void 0:a.arguments)!==null&&o!==void 0?o:[],f=Object.assign(Object.assign({},this.parent.options),{input:c,data:u});return{args:d,abi:l,contractOptions:f,deployData:c??u}}estimateGas(t){return Ikt(this,arguments,void 0,function*(n,r=this.parent.defaultReturnFormat){const s=Object.assign({},n);return this.parent.contractMethodEstimateGas({abi:this.constructorAbi,params:this.args,returnFormat:r,options:s,contractOptions:this.contractOptions})})}encodeABI(){return Zj(this.constructorAbi,this.args,Vr({format:"bytes"},this.deployData,this.parent.defaultReturnFormat))}decodeData(t){return Object.assign(Object.assign({},Ree(this.constructorAbi,t.replace(this.deployData,""),!1)),{__method__:this.constructorAbi.type})}}var Fkt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class Okt extends dR{constructor(t,n){super(t.requestManager,t.registeredSubscriptions),this.parentContract=n}subscribe(t,n){const r=Object.create(null,{subscribe:{get:()=>super.subscribe}});return Fkt(this,arguments,void 0,function*(s,a,o=dd){return r.subscribe.call(this,s,a??this.parentContract.options,o)})}}var lv=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Mkt={logs:IOe,newHeads:yR,newBlockHeaders:yR};class n3 extends Qd{get subscriptionManager(){return this._subscriptionManager}constructor(t,n,r,s,a){var o,l,c;const u=py(n)?n:py(r)?r:void 0;let d;Bge(n)?d=n:Bge(r)?d=r:d=s;let f;if(typeof n=="object"&&"provider"in n?f=n.provider:typeof r=="object"&&"provider"in r?f=r.provider:typeof s=="object"&&"provider"in s?f=s.provider:f=n3.givenProvider,super(Object.assign(Object.assign({},d),{provider:f,registeredSubscriptions:Mkt})),this.syncWithContext=!1,this._functions={},this._subscriptionManager=new Okt(super.subscriptionManager,this),d!=null&&d.wallet&&(this._wallet=d.wallet),d!=null&&d.accountProvider&&(this._accountProvider=d.accountProvider),!dr(u)&&!dr(u.data)&&!dr(u.input)&&this.config.contractDataInputFill!=="both")throw new rNt({data:u.data,input:u.input});this._overloadedMethodAbis=new Map;const x=hg(s)?s:hg(r)?r:a??this.defaultReturnFormat,g=typeof n=="string"?n:void 0;this.config.contractDataInputFill=(o=u==null?void 0:u.dataInputFill)!==null&&o!==void 0?o:this.config.contractDataInputFill,this._parseAndSetJsonInterface(t,x),this.defaultReturnFormat!==x&&(this.defaultReturnFormat=x),dr(g)||this._parseAndSetAddress(g,x),this.options={address:g,jsonInterface:this._jsonInterface,gas:(l=u==null?void 0:u.gas)!==null&&l!==void 0?l:u==null?void 0:u.gasLimit,gasPrice:u==null?void 0:u.gasPrice,from:u==null?void 0:u.from,input:u==null?void 0:u.input,data:u==null?void 0:u.data},this.syncWithContext=(c=u==null?void 0:u.syncWithContext)!==null&&c!==void 0?c:!1,d instanceof Qd&&this.subscribeToContextEvents(d),Object.defineProperty(this.options,"address",{set:v=>this._parseAndSetAddress(v,x),get:()=>this._address}),Object.defineProperty(this.options,"jsonInterface",{set:v=>this._parseAndSetJsonInterface(v,x),get:()=>this._jsonInterface}),d instanceof Qd&&d.on(U3.CONFIG_CHANGE,v=>{this.setConfig({[v.name]:v.newValue})})}setTransactionMiddleware(t){this.transactionMiddleware=t}getTransactionMiddleware(){return this.transactionMiddleware}get events(){return this._events}get methods(){return this._methods}clone(){let t;return this.options.address?t=new n3([...this._jsonInterface,...this._errorsInterface],this.options.address,{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()):t=new n3([...this._jsonInterface,...this._errorsInterface],{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()),this.context&&t.subscribeToContextEvents(this.context),t}deploy(t){return new Pkt(this,t)}getPastEvents(t,n,r){return lv(this,void 0,void 0,function*(){var s;const a=typeof t=="string"?t:uN,o=typeof t!="string"&&!hg(t)?t:hg(n)?{}:n,l=hg(t)?t:hg(n)?n:r??this.defaultReturnFormat,c=a==="allEvents"||a===uN?_ee:this._jsonInterface.find(N=>"name"in N&&N.name===a);if(!c)throw new fd(`Event ${String(a)} not found.`);const{fromBlock:u,toBlock:d,topics:f,address:x}=Dge(this.options,c,o??{}),g=yield jOe(this,{fromBlock:u,toBlock:d,topics:f,address:x},l),v=g?g.map(N=>typeof N=="string"?N:Poe(c,N,this._jsonInterface,l)):[],w=(s=o==null?void 0:o.filter)!==null&&s!==void 0?s:{},C=Object.keys(w);return C.length>0?v.filter(N=>typeof N=="string"?!0:C.every(I=>{var P;if(Array.isArray(w[I]))return w[I].some(F=>String(N.returnValues[I]).toUpperCase()===String(F).toUpperCase());const R=(P=c.inputs)===null||P===void 0?void 0:P.filter(F=>F.name===I)[0];return R!=null&&R.indexed&&R.type==="string"&&sN(w[I])===String(N.returnValues[I])?!0:String(N.returnValues[I]).toUpperCase()===String(w[I]).toUpperCase()})):v})}_parseAndSetAddress(t,n=this.defaultReturnFormat){this._address=t&&fx(Vr({format:"address"},t,n))}decodeMethodData(t){const n=t.slice(0,10),s=this._jsonInterface.filter(a=>a.type!=="error").find(a=>n===UE(qg(a)));if(!s)throw new fd(`The ABI for the provided method signature ${n} was not found.`);return Ree(s,t)}_parseAndSetJsonInterface(t,n=this.defaultReturnFormat){var r,s;this._functions={},this._methods={},this._events={};let a=[];const o=t.filter(c=>c.type!=="error"),l=t.filter(c=>p$(c));for(const c of o){const u=Object.assign(Object.assign({},c),{signature:""});if(m$(u)){const d=qg(u),f=UE(d);u.methodNameWithInputs=d,u.signature=f,u.constant=u.stateMutability==="view"||u.stateMutability==="pure"||u.constant,u.payable=u.stateMutability==="payable"||u.payable,this._overloadedMethodAbis.set(u.name,[...(r=this._overloadedMethodAbis.get(u.name))!==null&&r!==void 0?r:[],u]);const x=(s=this._overloadedMethodAbis.get(u.name))!==null&&s!==void 0?s:[],g=this._createContractMethod(x,l),v=this._createContractMethod(x,l,!0);this._functions[d]={signature:f,method:v},this._methods[u.name]=g,this._methods[d]=v,this._methods[f]=v}else if(Eoe(u)){const d=qg(u),f=_oe(d),x=this._createContractEvent(u,n);u.signature=f,(!(d in this._events)||u.name==="bound")&&(this._events[d]=x),this._events[u.name]=x,this._events[f]=x}a=[...a,u]}this._events.allEvents=this._createContractEvent(_ee,n),this._jsonInterface=[...a],this._errorsInterface=l}_getAbiParams(t,n){var r;try{return Qj((r=t.inputs)!==null&&r!==void 0?r:[],n)}catch(s){throw new fd(`Invalid parameters for method ${t.name}: ${s.message}`)}}_createContractMethod(t,n,r=!1){const s=t[t.length-1];return(...a)=>{var o,l,c;let u;const d=(l=r?(o=this._overloadedMethodAbis.get(s.name))===null||o===void 0?void 0:o.filter(w=>w.signature===s.signature):this._overloadedMethodAbis.get(s.name))!==null&&l!==void 0?l:[];let f=d[0];const x=n,g=d.filter(w=>{var C;return((C=w.inputs)!==null&&C!==void 0?C:[]).length===a.length});if(d.length===1||g.length===0)u=this._getAbiParams(f,a),Vs.validate((c=s.inputs)!==null&&c!==void 0?c:[],u);else{const w=[],C=[];for(const N of g)try{u=this._getAbiParams(N,a),Vs.validate(N.inputs,u),C.push(N)}catch(I){w.push(I)}if(C.length===1?[f]=C:C.length>1&&([f]=C,console.warn(`Multiple methods found that is compatible with the given inputs.
Found ${C.length} compatible methods: ${JSON.stringify(C.map(N=>`${N.methodNameWithInputs} (signature: ${N.signature})`))}
The first one will be used: ${f.methodNameWithInputs}`)),w.length===g.length)throw new tN(w)}const v={arguments:u,call:(w,C)=>lv(this,void 0,void 0,function*(){return this._contractMethodCall(f,u,x,w,C)}),send:w=>this._contractMethodSend(f,u,x,w),populateTransaction:(w,C)=>{var N,I;let P=C??this.options;P=Object.assign(Object.assign({},P),{input:void 0,from:(I=(N=P==null?void 0:P.from)!==null&&N!==void 0?N:this.defaultAccount)!==null&&I!==void 0?I:void 0});const R=Dee({abi:s,params:a,options:Object.assign(Object.assign({},w),{dataInputFill:this.config.contractDataInputFill}),contractOptions:P});return R.dataInputFill&&delete R.dataInputFill,R},estimateGas:(w,...C)=>lv(this,[w,...C],void 0,function*(N,I=this.defaultReturnFormat){return this.contractMethodEstimateGas({abi:f,params:u,returnFormat:I,options:N})}),encodeABI:()=>Zj(f,u),decodeData:w=>Ree(f,w),createAccessList:(w,C)=>lv(this,void 0,void 0,function*(){return this._contractMethodCreateAccessList(f,u,x,w,C)})};return f.stateMutability==="payable",v}}_contractMethodCall(t,n,r,s,a){return lv(this,void 0,void 0,function*(){var o;const l=_kt({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{const c=yield Moe(this,l,a,this.defaultReturnFormat);return U_t(t,c)}catch(c){throw c instanceof Qw&&pO(r,c.cause),c}})}_contractMethodCreateAccessList(t,n,r,s,a){return lv(this,void 0,void 0,function*(){var o;const l=Tkt({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{return _Oe(this,l,a,this.defaultReturnFormat)}catch(c){throw c instanceof Qw&&pO(r,c.cause),c}})}_contractMethodSend(t,n,r,s,a){var o,l;let c=a??this.options;c=Object.assign(Object.assign({},c),{input:void 0,from:(l=(o=c.from)!==null&&o!==void 0?o:this.defaultAccount)!==null&&l!==void 0?l:void 0});const u=Dee({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:c}),d=dr(this.transactionMiddleware)?zE(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface}):zE(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface},this.transactionMiddleware);return d.on("error",f=>{f instanceof Qw&&pO(r,f.cause)}),d}contractMethodEstimateGas(t){return lv(this,arguments,void 0,function*({abi:n,params:r,returnFormat:s,options:a,contractOptions:o}){const l=kkt({abi:n,params:r,options:Object.assign(Object.assign({},a),{dataInputFill:this.config.contractDataInputFill}),contractOptions:o??this.options});return Roe(this,l,Tg.LATEST,s??this.defaultReturnFormat)})}_createContractEvent(t,n=this.defaultReturnFormat){return(...r)=>{var s;const{topics:a,fromBlock:o}=Dge(this.options,t,r[0]),l=new IOe({address:this.options.address,topics:a,abi:t,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:n});return dr(o)||this.getPastEvents(t.name,{fromBlock:o,topics:a},n).then(c=>{c&&c.forEach(u=>l.emit("data",u))}).catch(c=>{l.emit("error",new lg("Failed to get past events.",c))}),(s=this.subscriptionManager)===null||s===void 0||s.addSubscription(l).catch(c=>{l.emit("error",new lg("Failed to subscribe.",c))}),l}}subscribeToContextEvents(t){const n=this;this.context=t,n.syncWithContext&&t.on(U3.CONFIG_CHANGE,r=>{n.setConfig({[r.name]:r.newValue})})}}const $ge={addr:"0x3b3b57de",name:"0x691f3431",abi:"0x2203ab56",pubkey:"0xc8690233",text:"0x59d1d43c",contenthash:"0xbc1c58d1"},W6={setAddr:"addr",addr:"addr",setPubkey:"pubkey",pubkey:"pubkey",setContenthash:"contenthash",contenthash:"contenthash",text:"text",name:"name"},vR={main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},Rkt={"0x1":"main","0x5":"goerli"},Lkt=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"}],Dkt=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"}],name:"DNSZoneCleared",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"}];var Bkt="AEkVMQnvDV0B0wKWAQYBQgDpATQAoQDcAIUApwBsAOMAcACTAEUAigBRAHkAPgA/ACwANwAoAGIAHgAvACsAJQAXAC8AHAAhACIALwAVACsAEQAiAAsAGwARABgAFwA7ACoAKwAsADQAFgAtABIAHAAhAA4AHQAdABUAFgAZAA0ADgAXABAAGQAUABIEtAYQASIUOjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqft7uycM2yDPCLspA7EUOwD3LWujAKF9GAAXBCXXFgEdALkZzQT6CSBMNwmXCYgeG1ZZTOODQgATAAwAFQAOa1QAIQAOAEfuFdg98zlYypXmLgoQHV9NWD3sABMADAAVAA5rIFxAlwDD6wAbADkMxQAbFVup+3EB224cHQVbBeIC0J8CxLAKTBykZRRzGm1M9QC7DWcC4QALLTSJF8mRAoF7ARMbAL0NZwLhAAstAUhQJZFMCgMt+wUyCddpF60B10MASSsSdwIxFiEC6ye5N2sAOeEB9SUAxw7LtQEbY4EAsQUABQCK00kFG8MfBxcAqCfRAaErLQObAGcBChk+7Td0BBgXAKoBxwIhANMrEnM681CwBZA6dyc1SAX6JwVZBVivuAVpO11CEjpYQZd7k2ZfofgLEwPFByXxdyMEo0sCU1MCdRurJwGPo6U1WwNFFwSDYQkA0QarPy8jBykCOV0AawFhH3EAgx0ZAJUBSbcAJ2kXAa/FAzctIUNTAW9ZBmUCZQDxSRcDKQEFAElBAKsAXQBzACu1Bgfz7xmNfwAJIQApALMbRwHRAdsHCzGXeIHoAAoAEQA0AD0AODN3edPAEF8QXAFNCUxsOhULAqwPpgvlERUM0SrL09gANKkH6wNTB+sDUwNTB+sH6wNTB+sDUwNTA1MDUxwK8BrTwBBfD0gEbQWOBYsE1giDJkkRgQcoCNJUDXQeHEcDRQD8IyVJHDuTMwslQkwMTQMH/DZCbKd9OANHMatU9ZCiA8syTzlsAR5xEqAAKg9zHDW1Tn56R3GgCktPrrV/SWJOZwK+Oqg/+AohCZNvu3dOBj0QFyehEPMMLwGxATcN6UvUBO0GNwTFH3kZFQ/JlZgIoS3ZDOkm3y6dgFYj8Sp/BelL8DzZC0lRZA9VC2EJ3zpfgUoDHQEJIocK2Q01CGkQ7wrFZw3hEUEHNQPRSZYAoQb9Cw0dMRWxJgxiqAsFOXMG9xryC4smqxMlevgFzxodBkkBJRr7AMsu44WsWi1cGE9bBf8LISPDFKRQHA0hQLN4RBoXBxElpQKNQ2xKg1EyHo8h8jw5DWIuD1F4B/E8ARlLC308mkanRQoRzj6JPUQiRUwoBDF7LCsnhwnLD4EMtXxuAVUJHQmtDG0TLRETN8EINQcVKZcgJxEIHUaRYJYE85sD7xPNAwcFOwk9Bw8DsRwpEyoVJQUJgSDTAu820S6vAotWfAETBccPIR/bEExH3A7lCJcCYQN/JecAKRUdABMilwg/XwBbj9RTAS7HCMNqaCNwA2MU410RbweNDlMHoxwvFbsc3XDEXgeGBCifqwlXAXEJlQFbBN8IBTVXjJwgPWdPi1QYlyBdQTtd+AItDGEVm0S5h3QChw9nEhcBMQFvBzUM/QJzEekRZxCRCOeGADWxM/Q6IQRLIX8gDQojA0tsygsjJvUM9GUBnxJeAwg0OXfqZ6dgsiAX+QcVMsFBXCHtC45PyQyYGr0YPlQqGeAHuwPvGu8n5kFTBfsDnw86STPqBLkLZQiHCTsARQ6fEwfTGGYKbYzMAS2HAbOVA1ONfwJriwYzBwcAYweDBXXhABkCowifAAEAywNTADUCqQeZABUAgT0BOQMjKwEd4QKLA48ILccBkSsB7yUEF78MEQDzM25GAsOtAoBmZp4F2VQCigJFMQFJIQQBSkNNA6tt3QDXAEcGD9tDARGnRscW3z8B22snAMMA9wABMQcBPQHJAe9pALMBWwstCZ6vsQFJ5SUAfwARZwHTAoUA2QAxAHvtAU8ASQVV9QXPAktFAQ0tFCdTXQG3AxsBLwEJAHUGx4mhxQMbBGkHzwIQFxXdAu8qB7EDItsTyULBAr3aUQAyEgo0CrUKtB9f81wvAi1uPUwACh+kPsM/SgVNO087VDtPO1Q7TztUO087VDtPO1QDk7veu94KaF9BYecMog3QRMQ6RRPXYE1gLhPELbMUvRXKJVIZORq4JwEl4FUFDwAtz2YsCCg0cRe4ADspZIM9Y4IeLApHHONTjVT0LRcArUueM6sNqBsRRDwFQ3XpYiYWCgoeAmR9AmI+V0mrVzccAqHzAmiUAmYFAp+AOBcHAmY3AmYiBGoEewN/DwN+jjkCOXMTOX46Hx8CbBkCMjI4BgJtwwJtquuGL2NBJwFjANoA3QBGAQeUDIkA+ge+AAmxAncrAnaeOwJ5Rz8CeLYZWNdFqkbTAnw7AnrEAn0FAnzsBVUFHEf8SHlfIAAnEUlUSlcRE0rIAtD9AtDISyMDiEsDh+JEwZEuAvKdXP8DA6pLykwpIctNSE2rAos7AorUvRcDGT9jAbMCjjMCjlg8k30CjtUCjlh0UbBTMQZS0FSBApP3ApMIAOUAGFUaVatVzAIsFymRgjLdeGJFNzUCl5sC765YHaQAVSEClosClniYAKVZqFoFfUkANwKWsQKWSlxAXM0CmccCmWBcxl0DFQKclzm+OpkCnBICn5cCnrSGABkLLSYLAp3tAp6OALE5YTBh6wKezwKgagGlAp6bGwKeSqFjxGQjIScCJ6sCJnoCoPcCoEgCotkCocACpisCpcoCp/sAeQKn7mh4aK3/RWoYas0CrN8CrKoCrWMCrP4CVxkCVdgCsd3TAx9KbJMCsrkJArLkE2zcbV9tRFsDJckCtlg3O26MAylBArhaArlDEQK5JnNwMnDdAr0VArvWcJIDMg0CvoRx/gMzbQK+FnMec0sCw8cCwwBzfnRHMUF03AM8owM8lgM9uwLFeALGQwLGDIUCyGVNAshAAslLAskqAmSZAt3OeHVdeKp5IUvMAxifZv4CYfAZ75Ugewdejl63DQLPZwLPaCtHT87vD5sAwqkCz28BJeYDTg5+RwEC3CMC24YC0ksDUlgDU1sA/QNViICFO8cS6VxBghiCz4LKg4kC2sMC2dqEDIRFpzgDhqEAKwNkCoZtVfUAUQLfYQLetG9zAuIr7RAB8ywjAfSXAfLOgwLr7wLpbHUC6vUC6uAA9UMBtQLuhQLrmJamlv8C7jsDhdyYdXDccZ0C8v8AZQOOEpmPAvcPA5FqA5KDAveUAvnVAvhimhiap7czmxoDnX8C/vYBFwA1nxifrwMFiQOmZgOm1QDNwQMGZqGEogEFAwxFAQsBGwdpBl21YwEAtwRnuw2HHq8JABNxNQAfAy8SSQOFewFfIx0AjOsAHQDmnwObjQizBhufwQCnBRG76R09PhZ4BWg3PkArQiFCtF9xEV+8AJbFBTIAkEwZm7k7JmAyEbrPDi8YxhiJyfYFVwVYBVcFWAVjBVgFVwVYBVcFWAVXBVgFVwVYRhUI14VnAgICCmRe6SsEyQOxBi+7uwC7BKe7AOdAKRayBUY+aT5wQj9Ctl91N1/oAFgRM6sAjP7Ma8v8pudGej0mIwQrFic2NX5t32rB8RnCLGkBa9duMBcFXwVqycHJuAjPSVsAAAAKfF59i74AMz+BAAMW0QblrSMFAIzDCwMBDQDlZR09JB9KQrFCvEE4I18nYDYnOCMJwT0KRD9DPng+gT5wPnECiUK8SUI7X8tOT2pNCixrVC9qC24fX+AzOhsJZ5sKYiMrPB0mQqtCvCvMAcv8X8kOHy4JCAkifp3fajotShfJq8msCWXBy8wKYEFfD+UQoxEAk40dRUIlG6ltOc44CjM/Qz5wQj8cBwodTEdsWywtWuG8Egp97R0rQj8cXQhKCQ4zVENCNwQ7Q5wsCoEbLUI/G/UIUyIjGDAxAAWPYfBeCnFkyWALYC0jbkNgGTkCGx5gswYCaxBlTmBNEQFk52AVYJVgfWCzYEtgkWgWFwa1DtxVqbxaC0MWqwG7K83BAh8VABwDHgF5AmwvMJVSgAGKCrhHGgDkI3SOCsoNpk3qAZsCh5xPBUBfAPf3BwA0FlcMC6UMJB+6r0eAgQw0ABUTnyuCCHoC0gtLZREbANhOBnUECh5aADEAtritAJQnCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cHAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4rQCUJy07Ds4CkBh7ULtYyHRyjsOlmw/ZFUkb7AEpEFwSBh/lAccJOhCTBQ8rDDYLABEAs+AiAQIApADhAJiCCrJrOS8AFABbG8YubHYqDcEQAjskHNPhHB4LG30CewTBCqrxbAAnLQ6mLs6hHAe7CQAQOg+7GkcczaF3HgE9Kl8cLs4RGQB9q9ocAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvAk8DrsFmAEbawouzqEqD4sa4QHDAREWOwCgCzsLuxC7BBiqe9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOxjbL7ZtvgNIqLsAB7sALrsC6w5WAAq7BAAeuwJVICp/FTwVuwG+J+QAsloBvSjgo7vIAAFbAAG7AAJbAALjAAg7AA67AgAbu6VbDr/EAPQAaPuoOwMBu5UnSwDn3Rm7CBp7CKEFCv9wAN+7p7sau6OLeXIG+6mbgwASuwYbCwG8AACGAG27BgALu6c7ARo7ugihnMoBuwvtB8CpOwDhewG/AADlABW7AAb7AAm7AGmLABq7GLuOaRX7AA5rAC5LHgAGuwAXuwghAA1KAcIAt68mAcAAALQADpsAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAIPAAUOwARawAPiwAN6wANuwAZCwYWGwAVOwBumxm7ALobLgATOwMAaSsKAOFLAAI7AARSABd7BRsABtAAGLsAC/sAX7sAa/sA5IsBuwAXdgG8AAFyC6EABUoAbXYAB/sA5XsAHGseAXsoUgA5RQD+Bw0McgAoKnABpAUIXgG8XiMMCQdvS2xfKokfPBRiLTYDoQq0AdgAFgLRA24BdnJHUhQhA08CFT4BLAYDc0a8e1J6QAApADEB+wBTCtsAe5AsASsAduUNETJGAUoAVwUAAVABB4rMAHg7BCClAFoA1hUAlWg3H4sAzWuxAM/UFgjCdXMbGFYdCdEBiJCrIlNTTUgSPMKJ+QB/HDdAKSvgEZdPAHIBKSwwKUIZDwMwVQT3xe4AS2XcAGoCcQI/EXo6x3guNdUGBQAQGx0KCAwqBB8dKU5TTgi5ugAKEs0AJgABGgCGAIkAjjUA7gC0AOAAnTwAuwCrAKYAoQDyAJ8A0wCcAOsBDAEHAMAAeQBaAMsAzQEHANcA6wCIAKIBNQDjANgA1QMBByoz1NTU1LbA3M3QzkMyFwFNAVcvRwFVAWQBYwFWAUdLQ0VoDQFOFQcIAzI2DAcAIg0kJiksODo6PT09Pj8OQB5RUVFRU1NSUylUVVdWVhxdYWFgYmEjZmhwb3JycnJycnR0dHR0dHR0dHR0dnZ3dnVbAEDsAEUAlgB0AC4AYvIAigBTAFMAMwJz6QCH//LyAGAAj+wAmwBLAF4AYPn5qgCBAIEAZQBSAK0AHgCyAH8CPAI/APgA4wD6APoA5AD7AOUA5QDkAOIAKQJ3AU0BPAE6AVABOgE6AToBNQE0ATQBNAEYAVQPACsIAABNFwoWAxUWDgCKAJIAogBLAGQYAi0AcABpAJEDEgMkKgMeQT5HKQCLAksAwwJTAqAAugKSApICkgKSApICkgKHApICkgKSApICkgKSApECkQKUApwCkwKSApICkAKQApACkAKOApECcQHQApMCmwKSApICkRZ5CwD6BQOnAl0CNhcBUBA1At4RCisTAUo3E02RAXekPAFlWQD/Az1HAQAAkykeGI9qAClgAGkALgCJA5TMi/CuhFoFuisOwhEBndV0KgsEIzFsATNabAGyAN5+gH9+gH6BgoJ+g4aEfoWIhoCHgoiCiX6Kfot+jIqNfo5+j4KQfpF+kn6TfpSDlYiWgpd+2gLabOEC2GwAgmwkbKAAg2xsBEkERgRIBEsESQRPBEwERwRNBE8ETgRKBEwETwCWZmwAowOIbAC0ZgEFbADJUWxsAM9sAgxsAPZabAD2ARkA9gD0APQA9QD0A31ebNSEI2XAAPYA9AD0APUA9BxsbACJWmwA9gCJARkA9gCJAL4A6AAIAPYAiQN9XmzUhCNlwBxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN9XmzUhCNlwBxsbACJWmwBGQD2AIkA9gCJAu0A9gCJAL4CNwD3AIkDfV5s1IQjZcAcbAJDATZsAkoBOWwCS8FsbAJXbGwDnwLtA58DnwOgA6ADoAOg1IQjZcAGA31ebBxsbACJWmwBGQOfAIkDnwCJAu0DnwCJAL4CNwOfAInUhCNlwAYDfV5sHGwEPmwAiQQ/AIkGjTFtIDFs1m4DKGwDrAJsbABVWv4VMgJsbACJAmwAVAEAul5sAmxebGwAiV5sAmxebD3YAEls1gJsbEbCxxP/x5BApA0KYFA89AsjTx97EHmJQPyocItC2JnNFRCEnFU6SFTDoI0PxeRNRoNRWkpzVnWW8pTagkNmgf+jGupqZ3eu50LAFnc+OzfJwdub1AdpOy76VnijWNR/CMEevikQkFyQuLuPajxWi9chqOoMJ7qpCN4sx3LJG4Myu8kD68wC6+iAwt+pU1JEeY13rpCVkXSZfinVKn4xZpxsI3Lp8bJLrJ9ujkrIalMRBAcv/GSKEtowzcEn5XmJw2BagB8V2UWJoJHZ14SXhM7p0XeGFOuw6mlvyq99WYp5XxrO6ru9nn4RHcOkJ7hx5UqWtman7yVMLzYXQefQRUdIY70RYQE8+aAzCNSGQkXiHfnHYRMi+xczKDdZLk3AV1gzxkkSHLjBwuq8shIJ+/RAbqjqQbugFhe0rqklu432EERkM5k9y1DXzds46oLqKAx6OhPT2WiqEfhaITn7OF9Y694AmKmUvbpWp0xJqDaf3jeNJXnK6NpnGcFOmbclbARC+5+5U52ufw5b0Hh+2LrrNimvZe4eYmApRsZnJE310SqB+1xB6rSJfnV1f2D0awB18Oc0sXAFqIlgHgWiaZGdvP5CJUSsCTCQUC335+iSkwPlLJJ5lwjTSn9Lw22NbK1Tu8w+bUpHtDRDPho7Gun8aw2Jzu9i+N0Ot/kPMbLAb/rUQ82kfpk85qLDkfxLl39QPDngo72GYh/Xigbpcm1pA23D2ywt3D8GgMOao040wDqkHxOEx0OhC+ZmHiIdjK7yRbfJD2ouZbAedhD3p7s8WDmCJfNforgDYPGAXSI08fTjPZ5B37lc5VXGzc1vJmibDwBNVzXuaUzg7N5H4BxqjhJ+kz9HLUJys7bpBDYAPvbut13AwJCWd059tS8YTYgC8HwrkewBfa1LSSpmMr9uR2EekTiAMH+Mx4AGzgbquccwBDlLmRhgXL/YiLPCEb6d2k5qJ6o800qddABkpqt7NG+sc2uvHZwZs57W1AHTFM1KkMShasADAh2FvzbzJOzVDMS3ZlT2BSFKdnkZFB6JyqJbhm6XANis9TrtzJdlPVp+rl8v3nIke6Jou7m2TKu53Vounupgkz2LzrQPhhatLIG7rfF/gUKWp15X3LKt+ZvuCDSqPUigF9yJntimC1HJR7Yj/dUrLAXWrT+1tnwPJJLGKAlQ5VeNDWRKCTt2vz3rJuo4+gIt75/Mkfl/gSZblZ9r/SEeeosZXneli/xNh1WVCvkRt2RnyyjtMkMqhzXh1PVOCbILqv0r7rGYm0CHIyKdhHL90cl9E1I6eEtQTCt6RXj8M0HHrHCHLVRpNM6WIbT5BCMGVnL0o5895qSRbCJz+5I8PGMhAN/Xrj4BgIdlKqlHtBHqTJwmK169toZ2IWxNzrAbIG7zh85Q/LG2A4yBcaBel52zdunokB0lv3A7kXnTI7M6ZnfZ7nwuj5lkGhqSpW+w5CI/FmRlplBEbnZy1ZxS3DL8rf1YWhO5XivWZBSRh1gFsjjyj3qRG1cm/6ors7WsEif6WRxns1MKDZa6KrbfMQ/swIb+2nb0tqxHeii6FcgVeAjE/Xwac1owx04dJKG8R5YQgHNnEfHf0qb8WOnU0eQSjazq+IK7cSuCqYzPEUB/x+QgGZqM3dBoYvNvZVOHDkbgdilWdagqO5bkybXfLpyMPuGq8mvAAEZGbR6RwXGlW9ErOWTfnjfx6dXFJqBj0OBSGFz4lWQasNOmVJeN4SFWSLfOGB/7ehV5YuoNNROHZEG9ElVuMnqbDMMuDleOt/cN/gsWxGw128mwU8/HxkOKqdTZnI7dHka67WCTf/FmBrxpNCaKJ1GxBTCSS7MNfhNj8S4Gtotg6Z3AM9cAeVROnppUMaiV5jjudLnNqoVrKO1/FijLlAc74kxydxKX1RQuMqHR63eecYr5o6MJ+B78VsLlCrpelWh6GOrCOBIoQmIcdpJL1pwE2zzZqBkecGTdK8KMOB6r1eNRURyrz6M899TZaoS/vNOxHf+5gORU+OyYIcIW6diP25GHF6u8TNjuL/GJzCnLLXd01KrsjRa51v4+O/VIAWXESJxfxWjv628J+cWUQpoD+Yytzs3jSMRJ23/XT+vUdtUMLDQq1vnIoeg/GjWh88MT6k9dRqDaQ+vodilFgvjuNw5pJpId9mfwyYeLCGb3BmHXdfQfhfPRQaupe/f8TG4Bk3eDKlYBaEK3kZYNN2Sdxz47m/vYBxvIOKtnqplB1pebzuXmAr/MuzQCknKe653dzaWQQ7MUhWYWvzIZwLe1v0rXxImLaz+AkAu+sYikhouNF3EW6w4crZ6MuUiDbIAx8XhAfegcvW6x9BPb3/sCxGWu9YyatqExB+TSm69qIkI9IwhjrcnzME+jWBx4mNQm5WwLzUjSyY4FZ0aMF5YFlXUD4hL4XfOeYv5rDe2s2D/Cn+28fZ9UCnOQvXFMnQqfc0G+ZqOWWD9l/liqUPaNQzZjxCHpUAD8Rcc90MniQ02ugHWsUupFUvhC9usY7zNPt5F2jO7qgzhafsQSd50jgLrC6Qx6bpHbXR3WNAu1BzGmwbz+ebGmwTjdy006Y6zipP7n/OJlvSmbq+SY+nefAVKK6EBMPbce5n3IdRI8+vbxCpN53rw3TvgNds1SuMiuLGxt89L71mxPDeanGhyHvOjmO56tnVpoHalQnL6TqNuqKsHjHCIKB4pCgj4WyYPvRvYvqi5EMr7lN3MotPR/KH7JUD1lZbU0QzfbrEBJnuQiVAyAC9vwXWp2TRU1/0aapyAH2cbglEHVAdl+1rb1u147uV0td1eNoQZsqHrIMIYVPXtLk2TIU3cJE08PjoYNDpfF/IcJnYQHl6nsplczX3Rgah4NbJJHl//5scUufqsSd//kbIS406ZWoMP//+jhGUswX/5nVNz/jAj9KmXPtAmMiK+khhbn1w/mELzZMT/WxcW//y/jsHaOM/61oAW/CjYhJtY622/TtMYuP7bilBvbiT3vB9n8IcFPnwM78H0KfhYDRdY5PhWJ4jWRQzB+HT5NVZV56LG82hcQms+jOTT/c9Y9sx5rPi1/wB7f/+c5UfUCKk3iwwCuywUc2MGnAwsXf1E5hoI55x1Q/Qby+sWH8NRjavZ8VaDsdi1NUVhH86BJHX1yaFt1w1OYeL5LVmdN+5Q+KuTvXEPDzUCg6xp0HhsUhTWSe7MZMM/6rsTUb0/nbUE3YQlGGt48kT1/6cnf6yHnvHtQx9EosOXN077yyEq/jE3YTiG/5SEJmXFeocJJ1EAd6vKeK6VEdJLOZ1km/EwOnZWCQpzCLKPHxrfh4yJhGq//2dos2E/3+MOcdW5EsgIdmTQUQetzRy5fQHhDBl37XbWzsqO/cASEDjyst1/8NEROqVAxWnddQV+umJ8IrKVgKvGaTc0GsQ4s8h0Osql5QKwlddPDjJhKInyWqYUKmmlIts+FIcXZ6yM6cljbsjUG2ksSOkuIw4sYHffRNgBOLApvD6XrR6Rt0rV2Uf8IpnIUVnb9Twt91QjAaD/dStSWDxg7aYY+VXIgnuowYdOkjywa2hlgrnI6PjaU3e3UjQ5Yk5mdIJGyHnv3/P+1EkMav1yFyF+FeJE/RXnWBw+Nh0aOo6TGlKX7d+dkP9+brvr79SdtXJtcD/aXBGiMNfG6/NQniQHYQlK78FEHDqOh+bDI0o+2Ub0h53EL/vlzjrBczVEZz2bOtvIL+DIzDkk9nCWt7tlqsq3l9JMtJk3r5HG2iJ9b/X11TG6wwMAjHLQ2oasaMEsydh88QPvI+hmqIHhvalpKoKOueJR0eZ9J8G2alNOIOy98jwvbc87Ewk9d+5G/tUijTmlbjFlDKXV05HalKxaRTrucc73On7yzAPS6f2v4ogiaWyWeV73dv/MsQT5HjRrsYV9dLAcI3T+zC2qEVINyNpEhoKV+xVSuWtT4AhBfpnZ7unIM+HX3msI0HiI+P+z2PFgkjGi5PqEbG/wNIWeRUjPtDEgbbubN+I4JaDLrW9borRBDob7ZFx+JdKeFVUKVeWqb/c88Ol7DhM0suLtuEd8tkDSMTD3DFx8UphPINHMHi51hAPttXL4Ektt/lKEUG/R4qZKohHjVpAcPIMiHyWr6xR8/EWnNJvBFET76yCdk5er7ADB/1bgoImhpSiZ/omZjPKPCEeZsOwvPmXL+1vlJNeGO3TzySmGA1X6e58gLrazDM71jywM1XL8zKHN6G3kB31Y8vLtP982N975SZXk2JwDvmv7AY/aDsFFk1v+nE7/hbvuOWhBH4kuemeYozPk2K22Vx/YGiDTLU7YilpOt29u3RZMBh4UJjlTP5ItxTzWv6ebL9b+GSU1Vsm2S8LMfVfJczaBSqE8J1A4YUjpsALL7++bwCPXFhaufdpDFtBlHb9makeYbqdg9ltvK/HwF/rNE6KrtWUkEcxmTB7Iyu5TiVaIgW/YxzQhpArliIMkOoK5L7ShVtF+DYqV01mk7fwop04hQRwg4KFmr5z9nYf05VVqkSe7gfnx5bxxlQ0qEV0jiwzf064qG11iEqjHcUgDWWsDs/LEGlzX31T5KVL+7D4EoKim7HBagiqRo5JI3WfDBgpKIruWz9j/J6Hp5Q/EJbMWB8NeSMuFarNw3AEYPBJtYQO/4oD/ZgPTSQ06di0EeumX5EbrdThO+fvYEVSxLtZ3AJkee0Xn0sDwNtiiZhJjJRDuG1YRKB1vOulfd9JjHeyu+UHTmrtra/pm+8Rixh4WKiLaLOCxIbZNoWRZSyyUGLPjAaAo+SQBpfO2uruWrzFxLlpvrXJNMCWtlJDKGAnlWK5xpU2tcxXbeD+sbdfwYXt/qTwDk6UqXR/aUt099DhSNl4Nk8mXwpw+b0nvjKOG6Mg1PRXjrMUMANvNgEArv8nMJs3vj1aHi8MHz/UfJWWzkcrSpZTNBhduXlGR7i+ip/THDp5R9KRNcDKECgtwgXg4EFN5HHfikP/XvsoCkHTg+NbsD8Gl6eknk4Arwn/BWGJ0hgW0/gUKrzuGZhub7igRP3abetpIm+24xEOlWl3YKpm2qTBFvX8ddDRvm1LcwnCJuEfZx12qPY9TrntMIQsv316zvpyWnyStX8VU4j6tQk+CWlLBUCJR6MdH9Cp7g2qdn2WM9qFbREmejH09dlWEPm8hPF0L7RxwRRdiCs0DP8ewk6ApoELkKU9hckSdbnXm8UHJmaNXjxv/q0fTTpu8rnl9lN0vQCpDRbCtcz12rGRFEA7Cfg7FhZn5QFkNmv1ZURKEsiZce1nS9K7HrwpC7yJV4Xt3eAVbLJfoXHrtwG60Z8gwaSnmxoL3s2ZlRqggZN/MHo1oUS4L+GwObFI596Ld4Mvi8l+cQmF1gJpkpnDio7TuO35npaMHiWzFqPSX3qNgkIPGuX0qGYnPIVsM901Yu8oZnOZOY1TbtIdFUNKNq2dP8SJ4F/VCEzIjF0/Rh+7UrZj80tC6rognVH3mqa8eCs/lcQU1Pjj98kBmAKDbZUTwosv02UunRR3n0X6c+f73mtwB7/WbQ16gO431EtwZbNG1SM4TZPBnsQSESlsfG2JLQXx5xWf4bmQ/xcVCPISAX5897JxHKLD/Xkgu57+ABR2+MMtEbX64+MNlBHpKC7sjlWVEShf5qA+dGc59LFVlZrX/Enq9z/v+wnZ1HErmxmjJjxOA+hAjVUWgtq6ygAi/8ewJDjUMFw3zhQFtbyTLDPFd21Ji5S5QPZo9nMSxdg1+DGFSN0wlWt7XeYPbHqLfliV0J1kOhQNp0VbUPy0MS2Ms66OxtSWvaULaWHnfAA+sieVVgtjDwN3nKonWapkSKRN8BKKJQpCfqo8RQI5udhfu5s5+7vwsppmAJDgz2GNA7d43VdbV2l/SrvEu4RYslmNJmfSOVbssxAhSYy6WxpIQdDB0FVBpZ6IM8yr81QN+XLZ3n/wed/R+s6LslkxKbzzst/GkRbe6rFmtvJCwr1T44ETM+IMgOnjUO0eG6a1n2w7lwM1oFBvzMUWRkNFOvKcx3oSb5XdenZ5dXsute6nkRypBiSdAtA2fxAd8UdLOZW/MB7fZoEuFheQXijdaF8kuaRZoSeWdKOkKsGYEGaXfaDKTu0WMTcLniQs7KRCz9iK3SP+Y2xIjkfVGqFLSQ6vh+A1u6FdfwXsv1VPMfi2cxmdM+/xTgMXEyo2ZGcQ2YmPsghnYdv2+z48JpGZA4tUK1p1q2VdVxyfypXEXcrxKKtmt8UdW7sHWmKMqDuBBM3J/JUQx8eUYN4pJ5oRqvdiPHU1o/WPjiKvnlCqOdyxlxF54L9PrtLD1NejZ9aZDivVr6ZfMFK1/psVygoPIAnphcJWWb9+5IKMKmgRQULsTPZi6Bw4wP32zVEoKcHpP73CkFAqS98nSaGoWDjDJiaACJn4p5o1jq9R4Q4VcibhXF//LHP0bdf63kRVZdRbbhGe7sDQcyWS5tpkfeYHnff25WK+4FpzLlAcbaKmHdIBqOw3fImx1uqQIADH0TyHzFlqTG6nMoY81svP0T6BIyELMS8tMe+E1p6TFP6sVpZa6VNaTumufD5aj9goRa9SAmdJT4HhI2r0egj8UrgFb8L59wGLnYlzkLAiUd3m/WWIIEU61kPoEjd3gIVy/fiBcgqQqHnoXpL0SqLGdGGgn7DQeVMSYWHfjno1FngIKP9cjYaTlcRP6bZunjHP13/lbVm4awti894pTf/ZNNqr4OR+tDVie/m+rC8QpVnRbsCMPukOH87B2jM4AG6pHuXl1x9SiKdhYJVOhfo/+SCaGjUW2CoogL1FFhFGN9o+acoVLl0SXs/3vrSccmZeAF3NewFuOg/P12QYKQF+SH+KYcNnsAhIAELPBUgre/KRUJEA+KPD0MHRjv+3J/j2Z23MuJmkfy7leWcMsti8wXLSHgXFJTaksx1Woi6oljwxFVIJG12SBSZLNJDbXMYPekmiXT4FclKI35BFgqnYpKfcsr+f8HUXQoHJ9UYZ4J5YMiHHyAxg6eidhodgqJ2Htf/xYEx+G0zXchuzlt8hcAl+AT8NCQ4orFc4DerabF1enA7NTLnvtZh3FUwqIOvY7Q4DYmoDHwXTSw5UNNh6r7j0B/ezMYJMDcw4+6gCTZX4YQ+7Xs8de72vsR3cmfpxIX64/6KR1p3VX4F6vfHEzxzarh8aDH4G1DFoBBM6npXFpK+Rh+WrcFclAeAxi0PoaR9CpOxxGLSdvxKVSw8oOOanG/soKImRopN38AdcUhhM2GT/PgQeSQrG12njuJJD5Z7vWfAZmFybYLdSA91kB4aoBhoj1Z//KNIVVujqaLLRwCkbyn4vh0739C9V9iSjybeOIeSOvNs7LW1a7EUtNoKAnOGML4U8KBXpfrw73WjAszJG4Qscq+Xr3kZWR4Omm0xT6qE9y6FNSpstV4onMZSqCEJ+3VX9qjvdx5QVrM0WXxmPZxejdfnihcFAjzv5PjlTl6ickDbHe6+Lch52pjOPqk+m3RZ+bh2JSMGtFBuODbMchrpRVlt16NTQ05Ps0IDtWlUmWfP2vX8M4YDynIuOZ4Ck91+591B98Gw9fw+yQogTR8CSg0zaJu+rlBo/mr3A+1NziF+kdubz+whc857AZt6DwIBIF5+5yiaaf3ByQp1Fm3sOkZDAzwsYSQTM/Kv6idkugF63FDobDdUY3huruU+sCaBuRR+HmOowvmZoBjZHNh77SXFtmY/oOUE7ifN7nBHAo83S/xvcS6H4Ci2u/9Id62Wv6Ui+zMNLAzhfkTkVcW2BwrnYvpur0ZDlzs+ZLsmGTWvd1892t78gx1YjEJusGcxphjLkV0UfAKlekfSBVWHE2ahk4AbbRmHyL7GYdtKfdlINwrcdJuf3Cee1nfUojDQn/YmItESOFhtLzrkEv4k2XpMU9oaJQ3VUC+1INh6BE68pkHameGJm4Gvdb24Q0fXWxd9Tp3A9mzFSe4qXDGGDIV4AAGV1jIDfveknH1TwWpUT6HiQxKP3AAHJNkJeRlj/mXBmS4S1j8FK6YmpK7jyyAiRbsMCCLoJcx01fvgpMvKQRxu9IOwymconQjD56g7ksOrcOeoTbius4JnGesAS1DtgdaophYsw1wGIsMS3P7K6doE3K5czznqPQLSRRF/Ylzb5NtSKsL33SgskFNCF4khn5LWaDxI23ZRi2hzqN8uW8UzZEBYy68+VtGLSymQrXGUlr2nO2BbBIT5Vh1RmGAyDXaW0FPrpx3wv2UYdFk9tSl+906bMxCuXQaKDQP/U19UEcVGK4gmksL8lAorxQSAOwpeYX9xrZsh6yoGaL/X5O3tgQC8OM+/GvxnW9XvAtu/JxAigydfSmZfqZfg1XOcHNOpLlN8j64OZ36l5qawDBJ62YaTvxeNmm5gowCdBosgcpHOgNgwA+sknN8XmsR2IYChcafl9bGNMZ/nB5guWuvEziv6QI2bP2DtyKWG/qUjZMaxy+wASkkVGtuwGtywkTYG6MYrZBo18vYcww48G/+f+eITA/qMwbLlJC0S3+/ai2pPvkOhRRVmGTuSupaxhIk0xoXLtixCxSAn4Z3OnUS3wBqVscLI4P3GP7i/6gxYsswsVmkvDXFLhO/OKcur8flegCSKiqmVpIRvCzgbjEA0mXPn+RExXY/2OE1f/BYuWpRQY8gCDpMOYBx9Gn4tL3hihSIR1ixh2PIIT7cr2gUJbfs76EKYG52Jk0UZF/PQkBxGuFCEWXnG6ue/hTIqjTRq1sotVrKrwIGHDrITyuanUzbIYdgdEeV88K1VD82TYB2B61Ft+tB1KqHPmT9+hWoaV+iF3SuvtJqvnoLaA8wxrD56AUMULEgzO9SvBcBAfqz/dzMYzwMt/YLszDbmGe1bcHHfFMcvGql9bf/tp+Hrj4q18aNnftGjmXTfws39emn7/5IBxog9MrmftAA5Oq4awenm8HimWO72dwVlHcHmutVMdrMHw+p2vzpzT+B0iIZ+IEpplwWhClcXlxhxAsF3CHRnnaUEqq3ByQ+cqhe5SvR4SFxh/LZoQwtj8QZQGT1BzY2EMpYnUcZWQEPlwFZw+7UryK9qV8KgruYsvyMoK16KI2sN4SOblrVwhyiL8+IBZ8cpUhsJQSU7TFHAi+L2F0sn0y+FtDODlnuif2Mba8QddPZYYxjTsIgkMe3M6+7kXxUfZvbCUlyq71J1eNczGk6Vqw6rSx2K3vM+DjLxDRGzWepTO2qTT/W8S7u0QXcyFUahcB4vq8xCYTpy8iswtnyz7Kx6lgTEQJ9RqkgEIN6DOUqB0uRdeYuDa7AP7Zy9z+ZlTsmVR5vtV71m3dmdtNeWghbr5PnPJtjXAzcvZjxyV96VEx/B1TA0IEQSI50ywGuIbmAYdQg/l/rxhQLX+6uOLyFsaUt6mtjpAJkLfehnB6MlOHnNOrWLvCBqVBS07jcM+4RzLEed3f3/0Xwp92U+nataNHyEgnnuYR6PXEjRLETz0xrt3UglfK7Bn4aNlXG7cZco4lMziLv5+Mh2JCww3mz69Z9ZMRR/xv5EKJ38IFxKd9dw5CgPIXja/gzAshMbF14/qBIgNkdUQeP8YE7SrICGtiTnAKTyA9cXa3OauDHxZOdTP7yuYBzD1UcHstIO16FxF1bRUAlSkszI83YufTchU8OPnnozDl9bS0y6CnnjGwgj9M61cXcZsljjhLeT/Vq+30ScN2PcT/dOoxUDqDS38+OpCCzLDdnwHQc3ECQVIkaxmdPaZTSdfp2jjGzSdNLM5yPQsgJDl+ZnhclDQi8ltUnkqWJ323IvTZPN8rn0+EshL1cx9PiaLTzUsryn9Zp2Nt/detUAh4N/2I3dlMQqjHFxSihv0uykzflq5clMy2ZBaxoEb0/QMp03IQQus3vnZd/NOmSsmgqXqKFP3ozyDgY7RQS+npabe/hNG+5sa5FtvL8v0uYuag2NewYkcol3TOTadpuncCnDgOGpmLnTQ1PEPUN2cNsrW8LYfIv+hzfb7vod+ipXHzmbgj5Fzc6RcT/5PD7VQ8nTJBNj1urkVUx9uJvTWmqY08OC80rGDLaWXv243VB16gjt4Xtwp5H2UDR0LiKW24Ed/sOO8jl1yEU/XAb3h7ScKnCFy/V3sICrkY1D0K9fSokHIL0s5/7DLShLAPXRbV7fbv4qj6OwHC9d5PlEOX3LRpQ3P7hcSAKlIKPDM83ypz56U5+rJeo0cyUtC7wltL8wqEiNSgZsDWzACc7RFoZqhlD0+sihIBQlkQTXmvUyIOZhkQX2zqME5VRC7ms1sa3CY+odMn3mMBiTvCMKnnCxg5ZPLq4GUDB4jF8Br2K4x4sxfWjGXQatJ25I1JyrIv2Z4bP1jKw5C+B2/s0v4dGUOsaS6IPIQV3ETQ+F2fSl2BPBXHzyYN8VmwWIrKeMX9pyGWuAOVXwkxJsRBaBVzLhZDP8ONGncknL5DpTxHN32GgFWMwsc0GmL0oRDmRT8u2lvjAKUIi0MmXhIHSlFeh3Qh5pP6ap4YUd6b569ZIaHgya2AyD12cPxY0In/PBjzDctTaKJCU+xc6m9RkNLDEE8guvxtJP8sl8N9bLqw0F/qejaBlcHYqw31zYpsutQp07hsP1vhGdl4hJ1wA7OCsAHnKj9879uSHILEmuZ6vI1lT4tvnWCVKZhhYrWHW9oPKPKpbOC6FTjf/OtUvwmiXr2ykvyLzHGQeyS7BenZpL3N/CaF5T7Gkml7JXN5cj0PKaDpZVImD61FuMgFHPqSHvt4Ej4KBdAfdcoO3AjQPLwwtKsgGM+ty4lNZMBEItJSRLunG5ckrM/BeoXWoPZVvEoIzLgFQYPupMwZCXis4W2SCJ2zsefZqCj+aTfSq1FYdUj2UeJALvVTf7vuuikOE1Hit3UIAGUi/sqgMum9vw218y1FlY/9XnOji9nqhGAcMYICc7BiqLZj5N+cKEuSAuiyWbMg81ZD1lHovy/we2eaCcCv4MzEW3O0mVA/t2xdA0cxTVbXmFhn+tARDpvDz5ftLr15OAAmvo2QiAky+feVO4bGibv2nlBmBzqx0lEDfEm4UnEs11pbnwZlJ/0Y73/wBPYfTNZiJKR73TzdCW1BffiJq9bLjQmaKnU0+gN8sfe25IKSUCooQwxePDrFn3a/zUgWxvPoTYVXfobY/GV2qqTkeVDV9D8657fhY0/wiaJ5NfLxhXbE/naxs34N0hd6vxNfdm1TCnozm/NKSCThchoYgMF7Z2tzXFovRfsNVkf86JjrM60r7UIuV3bsmfrMOqzjXjN6HPBG25zCJ3QLueySbj9oFvX/HxWBqh31PBPxduCVAxMqC9HK+YL3oBZqBruoh6LKvdMqoz0PYXUBrwbiioyE8Tj5ImjJmiOOWLbAZvIZ/l9rIPljx3T5glJ2ewlfuIT5GlodQsAf/IEtmYkML5SRQGxxwW+rlZkD8belJNu09Itwx9xDULTnemVDeojdbgcd2gKGM9aO00Jivtbs7ZyOSE8IPh98GfvatD8Ud5uHcZfAfMiPSlIxd4UqeSDzuNfbKDuFepkyC/s3j9fawmhY1b9NqDi0ZS5eP35l7rL2eK5QlWLlyCmxx8AFaFiTuD2pMUxZV5mBSJuJduOaq2ZrWpu28DE8jl/hisBz7bGWH6qLF0ayWNq1Sejtcs8KQrQqJk5P9QHDYHOIolgNsMDmEaWcTelghbfFCDqWrq6YLwDWy+m68ec5nShgq2fduUBpQUuKKKgnttaUX9PRfMmxqJyU7e0RLr1bev+ge1KK0bZyhHKKDE8gQX9Vf7rNHWOxBtZcxwwGusyMpH77qWZxXsQmbgIGhtiO+gSSRCyu/ek+OFsz1HMiQH0IHV7PjJi3dszYfFp8ue9h4+AfKte4MTiehPvxNcm/T1t9vsFZx8rHN5ie77r2jzZOq/Em4Q+H9sNcZakf9HnzCc1fJixppxP8FQABmVnqa6GbJhwaka7WH7Wdoz1WxOjSNV8N9sgW5S3Ppgkut+TTCkjA+AodUOk1KIR+8G8S3WrSZG4nyqfJ6FEjXl6a/LEoRMHZUqfPRWvwqrtXYy9IUsmUGzkqi76ib4NANCe5DnyOxnFRZ9d8FdBVBjra3iNuZhJuWW5Omi/hBigqDsg0mu2AhfJDXdwyMIJ33HHHPfS2JtjegRejX11m41TbNL+Qp7mR0g9CPKTj9PIjuSycGN/YPozXI4zarXuAeLv5CHKtKcJKRbd6R2oLNiEt0T8+QIVJH7zt9ncKMgd49vV2P1AyScZ9Qzbu3m3LBnuu6dw7aE0b6r4kzVkI/GUS88mA53L/rLtntkFlZXGtIoqNP2mD3eVv08AVVPT3wJn81zpbJV9SuqZ6Pd1ge0Zz2RFHeCdV5CLPftH9V5o9+VzFu4R0QeumqDwUhXn3IyYotdJnxr1l3BqWnQVAeDBEOtPyJQx1q5+mODiClXtYeBLTWtsJ42AMBcf/IFIhpfhYO08hsg0Ik+DpQFNOKReK3o3cudkxWX0soPtI5eSFOA6yNylS+IQjrQtYQ/5s4UcixJfokumBUjpH9ofSjUTwPCapGFndfqqG5IHeMMvfg+88SXm7bNyjk6pGKzL+WxDAdqKtQ72WWVbOk3I+ueGuammmB2pvFZvqIcU/lvW3n9+r2lycnQLE4OX9R1jIgW4cDjJ3v8dAa66mVcfC7ptCr5io6mCaA9qI9T9FFWqo1ZAaMxgxAu8aXqmaOYryMND2sTUfoHvxcYK7hEiJhCLYFDx3PBhE97c2a0ub1/ePJcyJOqr7UaTAPTJ+xvZtjb/40sloY1ltRnTkWILmIP2b7S3AdXCR+YiArMUHwdncpjpyDGfzqGOUoAuaamWzAMacQtb34/M32FEgR5lUEf8fRzFrZUhzQj0fR7/6gdzdnVVvcSneLmtqJ930VCCDORY8CVdQWdo/S3PNkX3pQsPVKWIYGAMrFZoq8bQ/OJBDSXP7KSBdL3QN0Zqd393p6VFc7DnlnFiN00SY5Nux7yadeIM0Upl2rVsu8/VAI";const Uge=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),zge=4;function $kt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let F=1;F<r;F++)a.push(s+=n());let o=n(),l=t;t+=o;let c=0,u=0;function d(){return c==0&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=31,x=2**f,g=x>>>1,v=g>>1,w=x-1;let C=0;for(let F=0;F<f;F++)C=C<<1|d();let N=[],I=0,P=x;for(;;){let F=Math.floor(((C-I+1)*s-1)/P),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;F<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=I+Math.floor(P*a[U]/s),Q=I+Math.floor(P*a[U+1]/s)-1;for(;!((z^Q)&g);)C=C<<1&w|d(),z=z<<1&w,Q=Q<<1&w|1;for(;z&~Q&v;)C=C&g|C<<1&w>>>1|d(),z=z<<1^g,Q=(Q^g)<<1|g|1;I=z,P=1+Q-z}let R=r-4;return N.map(F=>{switch(F-R){case 3:return R+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return R+256+(e[l++]<<8|e[l++]);case 1:return R+e[l++];default:return F-1}})}function Ukt(e){let t=0;return()=>e[t++]}function POe(e){return Ukt($kt(zkt(e)))}function zkt(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,a)=>t[s.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,a=0,o=0,l=0;s<n;s++)l=l<<6|t[e.charCodeAt(s)],o+=6,o>=8&&(r[a++]=l>>(o-=8));return r}function Hkt(e){return e&1?~e>>1:e>>1}function Vkt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=Hkt(t());return n}function HE(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let a=0;a<s;a++)n.push(t+a);t+=s+1}return n}function FOe(e){return VE(()=>{let t=HE(e);if(t.length)return t})}function OOe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(Wkt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(qkt(n,e))}return t.flat()}function VE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function MOe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)Vkt(e,n).forEach((a,o)=>r[o].push(a));return r}function Wkt(e,t){let n=1+t(),r=t(),s=VE(t);return MOe(s.length,1+e,t).flatMap((o,l)=>{let[c,...u]=o;return Array(s[l]).fill().map((d,f)=>{let x=f*r;return[c+f*n,u.map(g=>g+x)]})})}function qkt(e,t){let n=1+t();return MOe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function Gkt(e){let t=[],n=HE(e);return s(r([]),[]),t;function r(a){let o=e(),l=VE(()=>{let c=HE(e).map(u=>n[u]);if(c.length)return r(c)});return{S:o,B:l,Q:a}}function s({S:a,B:o},l,c){if(!(a&4&&c===l[l.length-1])){a&2&&(c=l[l.length-1]),a&1&&t.push(l);for(let u of o)for(let d of u.Q)s(u,[...l,d],c)}}}function Kkt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function ROe(e){return`{${Kkt(e)}}`}function Ykt(e){let t=[];for(let n=0,r=e.length;n<r;){let s=e.codePointAt(n);n+=s<65536?1:2,t.push(s)}return t}function fN(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...e.slice(s,s+=4096)));return r.join("")}function Xkt(e,t){let n=e.length,r=n-t.length;for(let s=0;r==0&&s<n;s++)r=e[s]-t[s];return r}var Qkt="AEUDWAHSCGYATwDVADIAdgAiADQAFAAtABQAIQAPACcADQASAAsAGQAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAecDNACxCmIB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJEMAJpIBpob5AERSMAKNoAXqaQLRBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobPgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vLIBDAHUGVsQ8wCzfQIbGVcCHBZHAZ8CBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVkFIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rpF27H7fsd/twPt4l+UW1yQYKBt2Cgy7qJpGiLcdE2P1cQSImUbqJ6ICH27H4knQMIRMrFkHu3sx6tC35Y+eLIh4e4CMKJ4DfyV+8mfta499RCAJ0xfeZR8PsoYOApva9pjGn4PhvyZS7/h5JLuhaucfjuU+Z584wwqNO4hWYmaBCcjgQPale1bjoHzMUbut/zTgxHxBnAyrdKpF4IRMASLBtD/jviyLeCgj8twWjAd3HchN/uqaeRYeHJgl7JEY9/cTrvtfybx/r3Y/NtxJ9dp+MTVmiS9bwBH73s8Di56/Ma+mTPMHq4T1yEG1fWcqr0u+hrGnJEvU1JJAm/maQSrKrazIyvSkDFkj8UUlfBq8baniTGPng6YZRL661rDNw4w/1g2figG0IhXnL7wosd/sVNo5dYSmMBTP5c7rYLjRdCwg8quwljOMPf63D8ICAL0r71XRiyFHdgwHbwfgnPOf4Lzjf2v+j+IiDHG2isp5yUnzSDyDRb4i/Vs0qHSHq8PiEQ/JnBP7PxnjN0j6gT4AVAeRx/1o9VnEUlUwvFrzJqHk9jxAw4sYxCnrxaeBdCFFKbnE7z+x54F5W7ZZsU6kx8Qocul6FoAHHy01FGL/nne61mn4+uYXfQ1Uccn+HMLKE+cZzT8BB1E3FRskOgJrRsq25rauLm8+uamXpkS/bTy6y1wDbCrW4eD532kTWrtNUmVVZOIn/C+/JR9KVR5iG9TY8iaT67ubm/whL1xbKZoqtY+a6fNxMJrg211bGYJDUkYMNWA0BMB++9zOm6Eik4roqs9CCEFW0lyAK0PbvlzvoxrZuY/OEhNW/l/63U15Od/RSvmDvXpGLiVmeGi5PDSH2bYz5o2g6wFDQ2FbZgYgTF8rPlvA1ifjZD3NLtFdXdpSIJvgKR7GpjJWG7GZGawPomIH8B5tUmtHH9LpM+/KQKunEPa1GiQkCXv4Cnm9DLORo2joicHdPDZ64obQrPZ5bgqckkj0G6/NEiPYBY4bCkL7W8G5YzsUb6GakFjykSPkT7JGeLeB6uJOGMm+x7N381BCDfbJFx0dtLgV9Q477BfL1fvitX5anV/oYfxeYl+eF5x5bB8+Ep/L2nsmd56aKF4aAD4GbJWsdKyBW22xEmAD3XdbtsMyAFoR5mOla0gEd9U/YVB7zvHGpHbQonay9Sv0bQ8iZ8piaXVrKc5AG1AmqqgaEvzHSP2Wux7aZTWh6quVDVU01JtMIVRdCFwlSbbqqhoFlyzsotQzRexFvZ/MqUSFu3OhRIuNBbufvBpdVgb8XdGJ48/lJPCZ7dsOujTTbKPSEvGXkOnG2Xdi8/nM3EMRqITd5QeU7iOjKqC7URJY6TnLsHij22xAHKnVRD5MDtBYnoGFqZGMDmXCW6Oj+BAWw14hESY/xLF6bLku06AHkiXTHPCFZ0f9YSqqo27eAhhS67OrA2Het4M9JM3jm/yRX6bYxnfmzYl5qQdHxN08FsNuWDrWd4vMUY2QD3hr8vS73SCTkFoXZR3xNzOQt8d/6HfjBmXqvrE6EGkLzK6YK2U2/ksU/iUH+LvVIsJI+ri2AL/klo+ShdDyfs5A83i2prkMs51IKR7ZcqjZJi5X3+bd8GlyWvtddxKEoEqSgEO7A8jIgf2nH0h8FjM7oB6yte3X5mpL0i/E4Rx0CotKnILJj/vJqo4VkPQ93jRtRVfaitQPqldl5xRYPq8387Z0DcnZvOeION0Ht1+P27kFLGQIcLBX4FG3sffccNHh5cPfzp9INoRtqVtdViJfg8RjnXiIz/MNqEN6zvzX3hMzyWC7oSoXIT14ubc0abPX8Rp9GVa5NI/8iv+6ela1oTncbdimRKnrbRffDR/X4nH+bgqAuHWl7hOaeXPWVzIeRl7ga+JzD4Sx3mlj/q6Ra/E2HhDf21eEzTLNGfCZsY+/yxZzQzIAuijG65ii4O/waAJCrEJaWd/DRAKMQ5678Dw5AT7RCKzdadIwd8LsD+DgPBASmWsUlf8R0k1w/2k4lO2Wpb4zMI6EJVJs0xk/wn8/fRUPqrDKhbjHR41SqgFMx5RGMPuduFwlu5lK89tW11sTqiX/5EfGs5nO+y9FKvgXKPOEmgE05EKNL6Sjb3xS40H3BVPhm0ESOZgAjZoymc8be0inDVo4JdJVf+NKd3tN/CaB7GShhH27qf95NoFZVX/6ZkR2lX+CgWrQ2INgkh+bbMz68+uJ3Clsh8HSMPEQtAt+BBE6fXDab7KIlsKxU1lIXW/KWVstpdPanJ0pdXpQinDyUQjtY7ZVcfiecRxRDMAUhHFU2cEaciQ+htiPMPx1kdvtWG9T44w3r037ljHBFJdYR0r55qvMRixtAEFJAqA4T1ES87FAx7UozXasytg8MftZYt0rjYgLe6EJ5aWvy2qscBSBQ7yehoJIA3wIIZ9ukfkyBb6qnue5ko8W50rpV4kXqWjI5nbGRXrNW0tBZHXlY48nSgcUXBHWT4GcgLZJoLlKJnV96kCYpq9eWHh7xJzkCAyrQuQ5AJ0qq/uZ3toJglNterev+Qm0KXxPg/+YbFRJdfhbp1wOnVOEYdVHTya6CtO0afhEaBhx3oHwCb5Kq6RwHDzFMl2vfjL8GwzcCoTj7wZe+UFnYDV2yKpPU9dba29gYBdNqJg/KXozO+CJTlKmlKhnqTf5doeS35DZFV+cYJQVjd+oVY/Gtc/6XPzUxb1gMqf6cEjNNoRC8AObrp+fx0cVtGu4ffC2TgXRC8zPl8moUHCB5HZ25d87mlsiiK0aNwBtcEQjRNBT/QrXbw/8aVXdKMHn9EqYEKEyxSGTpYQOaes1G1Qq8pDgqkZtlO2HRyCXpmeM7TSrRPkAh004BfisVpF6zP44n2Jvxz/gOVocNCyy9V6lkod28QM4pbaMvVJigD/w3BrsjSJrXlqc4ulBYOCceiBN4b/gHajYyupbhEt63a619Ay4wsL6a6w6B+A7TnoyE7BliWHJfzVxxIKM/W3M/J8Bx99Op863Q8eNuIMGRx++VbYfjm+VGYBA3Ap/KEu/wxBNBpJJncwHPG45V8Gh98ZIrGCc20MwijGowZbcS7d1nEgcOW5cddZpHL2XPAIRbColiheZzXTvBxZOY3iMSDSKDrICyJ/iQs1vdplVdH/JrLJsQ2jtTnfCrITIghq3KFX3qAgLWAIp8IffNSdTYptnbGfc8s+qcr3zyzyHp1aJg+jxTF4kD1ry5Wauv5V3xnOGwTFecNzXSLHBW20/pCQjk4uorD0plIhMSTc79+/r4RKPClRYTBYex1Ob5crtfvRQBBv6re/6FhtCqtduag67glqRA77/3ulblh9YRtMdDxkCyJDeNnAuCLPQFmdRRWJtH20Z8DstfJf+5oj5SSB64d0iF5/Ya4KfTWxfivj9Ap2/zbYaTo/1gO3tM6RYsCZharMBFr7Fm61mLSrQnEI4OF1gbVS4k/JE9UotOrnLJZuswoWodCSV8zbybkJSVIP7n8UaE9xCR39rJZmf27HOAPVOGc9pdkQUcRrI0qyVF9Z3j1RHDbxIfwbWzmPVjwIdPJvtmBYwEQIUsIW1S939hcVikK00ozPRI02cqhzVUNzpOxVdrwRPvlh1aIOf0xFEqD3YkGnCnFah/cFN3J2gB7N+bZSGawwkKFu1tpQMrp1W+27YNkyT0TpcFpTqgOqqLabrgcCUPxh97mREOGy4xItzQ9xSl6rq+8BZsHcrQFReS+QeMxJ3P6CnL9EP/eOLDjumLhvrcQrpPiknsofbzBv9gTP0lU+TIVwE6E7CcKfT36q+ZiEOHJ9ayf0dyUJLezAb2M8aNHwd0+OJmsVgTzRWA";const WE=44032,wR=4352,CR=4449,SR=4519,LOe=19,DOe=21,hN=28,NR=DOe*hN,Zkt=LOe*NR,Jkt=WE+Zkt,eTt=wR+LOe,tTt=CR+DOe,nTt=SR+hN;function Cj(e){return e>>24&255}function BOe(e){return e&16777215}let Bee,Hge,$ee,mO;function rTt(){let e=POe(Qkt);Bee=new Map(FOe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),Hge=new Set(HE(e)),$ee=new Map,mO=new Map;for(let[t,n]of OOe(e)){if(!Hge.has(t)&&n.length==2){let[r,s]=n,a=mO.get(r);a||(a=new Map,mO.set(r,a)),a.set(s,t)}$ee.set(t,n.reverse())}}function $Oe(e){return e>=WE&&e<Jkt}function sTt(e,t){if(e>=wR&&e<eTt&&t>=CR&&t<tTt)return WE+(e-wR)*NR+(t-CR)*hN;if($Oe(e)&&t>SR&&t<nTt&&(e-WE)%hN==0)return e+(t-SR);{let n=mO.get(e);return n&&(n=n.get(t),n)?n:-1}}function UOe(e){Bee||rTt();let t=[],n=[],r=!1;function s(a){let o=Bee.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if($Oe(a)){let o=a-WE,l=o/NR|0,c=o%NR/hN|0,u=o%hN;s(wR+l),s(CR+c),u>0&&s(SR+u)}else{let o=$ee.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=Cj(t[0]);for(let o=1;o<t.length;o++){let l=Cj(t[o]);if(l==0||a<=l){a=l;continue}let c=o-1;for(;;){let u=t[c+1];if(t[c+1]=t[c],t[c]=u,!c||(a=Cj(t[--c]),a<=l))break}a=Cj(t[o])}}return t}function iTt(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=Cj(a),l=BOe(a);if(r==-1)o==0?r=l:t.push(l);else if(s>0&&s>=o)o==0?(t.push(r,...n),n.length=0,r=l):n.push(l),s=o;else{let c=sTt(r,l);c>=0?r=c:s==0&&o==0?(t.push(r),r=l):(n.push(l),s=o)}}return r>=0&&t.push(r,...n),t}function zOe(e){return UOe(e).map(BOe)}function aTt(e){return iTt(UOe(e))}const Vge=45,HOe=".",VOe=65039,WOe=1,AR=e=>Array.from(e);function qE(e,t){return e.P.has(t)||e.Q.has(t)}let oTt=class extends Array{get is_emoji(){return!0}},Uee,qOe,Jv,zee,GOe,c4,NV,NC,jv,Wge,Hee;function Loe(){if(Uee)return;let e=POe(Bkt);const t=()=>HE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));Uee=new Map(OOe(e)),qOe=n(),Jv=t(),zee=new Set(t().map(d=>Jv[d])),Jv=new Set(Jv),GOe=n(),n();let s=FOe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};c4=VE(d=>{let f=VE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=fN(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),NV=n(),NC=new Map;let l=t().concat(AR(NV)).sort((d,f)=>d-f);l.forEach((d,f)=>{let x=e(),g=l[f]=x?l[f-x]:{V:[],M:new Map};g.V.push(d),NV.has(d)||NC.set(d,g)});for(let{V:d,M:f}of new Set(NC.values())){let x=[];for(let v of d){let w=c4.filter(N=>qE(N,v)),C=x.find(({G:N})=>w.some(I=>N.has(I)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>AR(v.G));for(let{G:v,V:w}of x){let C=new Set(g.filter(N=>!v.has(N)));for(let N of w)f.set(N,C)}}jv=new Set;let c=new Set;const u=d=>jv.has(d)?c.add(d):jv.add(d);for(let d of c4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of jv)!NC.has(d)&&!c.has(d)&&NC.set(d,WOe);r(jv,zOe(jv)),Wge=Gkt(e).map(d=>oTt.from(d)).sort(Xkt),Hee=new Map;for(let d of Wge){let f=[Hee];for(let x of d){let g=f.map(v=>{let w=v.get(x);return w||(w=new Map,v.set(x,w)),w});x===VOe?f.push(...g):f=g}for(let x of f)x.V=d}}function Doe(e){return(KOe(e)?"":`${Boe(y$([e]))} `)+ROe(e)}function Boe(e){return`"${e}"`}function lTt(e){if(e.length>=4&&e[2]==Vge&&e[3]==Vge)throw new Error(`invalid label extension: "${fN(e.slice(0,4))}"`)}function cTt(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function uTt(e){let t=e[0],n=Uge.get(t);if(n)throw Jj(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=Uge.get(t);if(o){if(s==a)throw Jj(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw Jj(`trailing ${n}`)}function y$(e,t=1/0,n=ROe){let r=[];dTt(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let o=0;o<a;o++){let l=e[o];KOe(l)&&(r.push(fN(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(fN(e.slice(s,a))),r.join("")}function dTt(e,t){return Loe(),Jv.has(e)}function KOe(e){return Loe(),GOe.has(e)}function fTt(e){return xTt(hTt(e,aTt,yTt))}function hTt(e,t,n){if(!e)return[];Loe();let r=0;return e.split(HOe).map(s=>{let a=Ykt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=bTt(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(cTt(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))lTt(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(Jv.has(d[0]))throw Jj("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&Jv.has(C[0]))throw Jj(`emoji + combining mark: "${fN(l[w-1])} + ${y$([C[0]])}"`)}uTt(d);let g=AR(new Set(x)),[v]=mTt(g);gTt(v,x),pTt(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function pTt(e,t){let n,r=[];for(let s of t){let a=NC.get(s);if(a===WOe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):AR(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>qE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function mTt(e){let t=c4;for(let n of e){let r=t.filter(s=>qE(s,n));if(!r.length)throw c4.some(s=>qE(s,n))?XOe(t[0],n):YOe(n);if(t=r,r.length==1)break}return t}function xTt(e){return e.map(({input:t,error:n,output:r})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${Boe(y$(t,63))}: ${s}`)}return fN(r)}).join(HOe)}function YOe(e){return new Error(`disallowed character: ${Doe(e)}`)}function XOe(e,t){let n=Doe(t),r=c4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function Jj(e){return new Error(`illegal placement: ${e}`)}function gTt(e,t){for(let n of t)if(!qE(e,n))throw XOe(e,n);if(e.M){let n=zOe(t);for(let r=1,s=n.length;r<s;r++)if(zee.has(n[r])){let a=r+1;for(let o;a<s&&zee.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${Doe(o)}`);if(a-r>zge)throw new Error(`excessive non-spacing marks: ${Boe(y$(n.slice(r-1,a)))} (${a-r}/${zge})`);r=a}}}function bTt(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=vTt(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(jv.has(o))s.push(o);else{let l=Uee.get(o);if(l)s.push(...l);else if(!qOe.has(o))throw YOe(o)}}}return s.length&&r.push(t(s)),r}function yTt(e){return e.filter(t=>t!=VOe)}function vTt(e,t){let n=Hee,r,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:a}=n;a&&(r=a,e.length=s)}return r}const wTt=e=>fTt(e),y0=e=>{let t="";for(let n=0;n<32;n+=1)t+="00";if(e){const r=wTt(e).split(".");for(let s=r.length-1;s>=0;s-=1){const a=Yf(r[s]).slice(2);t=Yf(`0x${t}${a}`).slice(2)}}return`0x${t}`};var fP=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class CTt{constructor(t,n){this.contract=new n3(Lkt,n??vR.main,t),this.context=t}getOwner(t){return fP(this,void 0,void 0,function*(){try{return this.contract.methods.owner(y0(t)).call()}catch{throw new Error}})}getTTL(t){return fP(this,void 0,void 0,function*(){try{return this.contract.methods.ttl(y0(t)).call()}catch{throw new Error}})}recordExists(t){return fP(this,void 0,void 0,function*(){try{return this.contract.methods.recordExists(y0(t)).call()}catch{throw new Error}})}getResolver(t){return fP(this,void 0,void 0,function*(){try{return this.contract.methods.resolver(y0(t)).call().then(n=>{if(typeof n=="string")return new n3(Dkt,n,this.context);throw new Error})}catch{throw new Error}})}get events(){return this.contract.events}}var Vx=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class STt{constructor(t){this.registry=t}getResolverContractAdapter(t){return Vx(this,void 0,void 0,function*(){return this.registry.getResolver(t)})}checkInterfaceSupport(t,n){var r,s;return Vx(this,void 0,void 0,function*(){if(Js($ge[n]))throw new Dxe((r=t.options.address)!==null&&r!==void 0?r:"",n);if(!(yield t.methods.supportsInterface($ge[n]).call()))throw new Dxe((s=t.options.address)!==null&&s!==void 0?s:"",n)})}supportsInterface(t,n){var r;return Vx(this,void 0,void 0,function*(){const s=yield this.getResolverContractAdapter(t);let a=n;if(!Aa(a)){if(a=(r=Jk(n))!==null&&r!==void 0?r:"",n==="")throw new Error("Invalid interface Id");a=a.slice(0,10)}return s.methods.supportsInterface(a).call()})}getAddress(t,n=60){return Vx(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(r,W6.addr),r.methods.addr(y0(t),n).call()})}getPubkey(t){return Vx(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(n,W6.pubkey),n.methods.pubkey(y0(t)).call()})}getContenthash(t){return Vx(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(n,W6.contenthash),n.methods.contenthash(y0(t)).call()})}setAddress(t,n,r){return Vx(this,void 0,void 0,function*(){const s=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(s,W6.setAddr),s.methods.setAddr(y0(t),n).send(r)})}getText(t,n){return Vx(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(r,W6.text),r.methods.text(y0(t),n).call()})}getName(t,n=!0){return Vx(this,void 0,void 0,function*(){const r=`${t.toLowerCase().substring(2)}.addr.reverse`,s=yield this.getResolverContractAdapter(r);return n&&(yield this.checkInterfaceSupport(s,W6.name)),s.methods.name(y0(r)).call()})}}var vh=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class QOe extends Qd{constructor(t,n){super(n??""),this.registryAddress=t??vR.main,this._registry=new CTt(this.getContextObject(),t),this._resolver=new STt(this._registry)}getResolver(t){return vh(this,void 0,void 0,function*(){return this._registry.getResolver(t)})}recordExists(t){return vh(this,void 0,void 0,function*(){return this._registry.recordExists(t)})}getTTL(t){return vh(this,void 0,void 0,function*(){return this._registry.getTTL(t)})}getOwner(t){return vh(this,void 0,void 0,function*(){return this._registry.getOwner(t)})}getAddress(t,n=60){return vh(this,void 0,void 0,function*(){return this._resolver.getAddress(t,n)})}getText(t,n){return vh(this,void 0,void 0,function*(){return Kf(t)?this._resolver.getText(yield this._resolver.getName(t,!1),n):this._resolver.getText(t,n)})}getName(t,n=!0){return vh(this,void 0,void 0,function*(){return this._resolver.getName(t,n)})}getPubkey(t){return vh(this,void 0,void 0,function*(){return this._resolver.getPubkey(t)})}getContenthash(t){return vh(this,void 0,void 0,function*(){return this._resolver.getContenthash(t)})}checkNetwork(){return vh(this,void 0,void 0,function*(){const t=Date.now()/1e3;if(!this._lastSyncCheck||t-this._lastSyncCheck>3600){const s=yield K_t(this);if(!(typeof s=="boolean"&&!s))throw new iNt;this._lastSyncCheck=t}if(this._detectedAddress)return this._detectedAddress;const n=yield Noe(this,Object.assign(Object.assign({},this.defaultReturnFormat),{number:Qh.HEX})),r=vR[Rkt[n]];if(typeof r>"u")throw new sNt(n);return this._detectedAddress=r,this._detectedAddress})}supportsInterface(t,n){return vh(this,void 0,void 0,function*(){return this._resolver.supportsInterface(t,n)})}get events(){return this._registry.events}setAddress(t,n,r){return vh(this,void 0,void 0,function*(){return this._resolver.setAddress(t,n,r)})}}var E1=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const NTt=e=>E1(void 0,void 0,void 0,function*(){return(yield _Et(e)).map(fx)}),ATt=(e,t)=>E1(void 0,void 0,void 0,function*(){Vs.validate(["string"],[t]);const n=yield kEt(e,t);return fx(n)}),jTt=(e,t,n,r)=>E1(void 0,void 0,void 0,function*(){return Vs.validate(["address","string","uint"],[t,n,r]),TEt(e,t,n,r)}),ETt=(e,t)=>E1(void 0,void 0,void 0,function*(){return Vs.validate(["address"],[t]),IEt(e,t)}),_Tt=(e,t,n)=>E1(void 0,void 0,void 0,function*(){return Vs.validate(["string","string"],[t,n]),PEt(e,t,n)}),kTt=(e,t,n,r)=>E1(void 0,void 0,void 0,function*(){const s=cf(t,fi,{transactionSchema:r==null?void 0:r.customTransactionSchema});return FEt(e,s,n)}),TTt=(e,t,n,r)=>E1(void 0,void 0,void 0,function*(){const s=cf(t,fi,{transactionSchema:r==null?void 0:r.customTransactionSchema});return OEt(e,s,n)}),ITt=(e,t,n,r)=>E1(void 0,void 0,void 0,function*(){Vs.validate(["string","address","string"],[t,n,r]);const s=Aa(t)?t:ym(t);return MEt(e,s,n,r)}),PTt=(e,t,n)=>E1(void 0,void 0,void 0,function*(){Vs.validate(["string","string"],[t,n]);const r=Aa(t)?t:ym(t);return REt(e,r,n)});var Wx=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class ZOe extends Qd{getAccounts(){return Wx(this,void 0,void 0,function*(){return NTt(this.requestManager)})}newAccount(t){return Wx(this,void 0,void 0,function*(){return ATt(this.requestManager,t)})}unlockAccount(t,n,r){return Wx(this,void 0,void 0,function*(){return jTt(this.requestManager,t,n,r)})}lockAccount(t){return Wx(this,void 0,void 0,function*(){return ETt(this.requestManager,t)})}importRawKey(t,n){return Wx(this,void 0,void 0,function*(){return _Tt(this.requestManager,t,n)})}sendTransaction(t,n){return Wx(this,void 0,void 0,function*(){return kTt(this.requestManager,t,n,this.config)})}signTransaction(t,n){return Wx(this,void 0,void 0,function*(){return TTt(this.requestManager,t,n,this.config)})}sign(t,n,r){return Wx(this,void 0,void 0,function*(){return ITt(this.requestManager,t,n,r)})}ecRecover(t,n){return Wx(this,void 0,void 0,function*(){return PTt(this.requestManager,t,n)})}}var A0;(function(e){e.HTTPS="https",e.WebSocket="wss"})(A0||(A0={}));var bs;(function(e){e.ETH_MAINNET="eth_mainnet",e.ETH_SEPOLIA="eth_sepolia",e.ETH_HOLESKY="eth_holesky",e.POLYGON_MAINNET="polygon_mainnet",e.POLYGON_AMOY="polygon_amoy",e.AVALANCHE_C_MAINNET="avalanche_c_mainnet",e.AVALANCHE_P_MAINNET="avalanche_p_mainnet",e.AVALANCHE_X_MAINNET="avalanche_x_mainnet",e.ARBITRUM_MAINNET="arbitrum_mainnet",e.ARBITRUM_SEPOLIA="arbitrum_sepolia",e.BASE_MAINNET="base_mainnet",e.BASE_SEPOLIA="base_sepolia",e.OPTIMISM_MAINNET="optimism_mainnet",e.OPTIMISM_SEPOLIA="optimism_sepolia",e.FANTOM_MAINNET="fantom_mainnet",e.FANTOM_TESTNET="fantom_testnet",e.DYMENSION_MAINNET="dymension_mainnet",e.DYMENSION_TESTNET="dymension_testnet",e.BNB_MAINNET="bnb_mainnet",e.BNB_TESTNET="bnb_testnet",e.BSC_MAINNET="bsc_mainnet",e.BSC_TESTNET="bsc_testnet",e.ARBITRUM_ONE="arbitrum_one",e.ARBITRUM_NOVA="arbitrum_nova",e.AVALANCHE_FUJI_C="avalanche_fuji_c",e.AVALANCHE_FUJI_P="avalanche_fuji_p",e.AVALANCHE_FUJI_X="avalanche_fuji_x",e.BLAST_MAINNET="blast_mainnet",e.OPBNB_MAINNET="opbnb_mainnet",e.OPBNB_TESTNET="opbnb_testnet",e.GNOSIS_MAINNET="gnosis_mainnet",e.GNOSIS_CHIADO="gnosis_chiado",e.PULSECHAIN_MAINNET="pulsechain_mainnet",e.PULSECHAIN_TESTNET="pulsechain_testnet",e.KAVA_MAINNET="kava_mainnet",e.CRONOS_MAINNET="cronos_mainnet",e.MANTLE_MAINNET="mantle_mainnet",e.CHILIZ_MAINNET="chiliz_mainnet",e.CHILIZ_SPICY="chiliz_spicy",e.MOONBEAM_MAINNET="moonbeam_mainnet",e.TAIKO_MAINNET="taiko_mainnet",e.TAIKO_HEKLA="taiko_hekla",e.LINEA_MAINNET="linea_mainnet",e.LINEA_SEPOLIA="linea_sepolia",e.BAHAMUT_MAINNET="bahamut_mainnet",e.SCROLL_MAINNET="scroll_mainnet",e.SCROLL_SEPOLIA="scroll_sepolia",e.TRON_MAINNET="tron_mainnet",e.SYSCOIN_MAINNET="syscoin_mainnet",e.SYSCOIN_TANENBAUM="syscoin_tanenbaum",e.MOONRIVER_MAINNET="moonriver_mainnet",e.HAQQ_MAINNET="haqq_mainnet",e.EVMOS_MAINNET="evmos_mainnet",e.EVMOS_TESTNET="evmos_testnet",e.BERACHAIN_TESTNET="berachain_testnet"})(bs||(bs={}));const FTt=1300;class OTt extends ci{constructor(t){super("You've reach the rate limit of free RPC calls from our Partner Quick Nodes. There are two options you can either create a paid Quick Nodes account and get 20% off for 2 months using WEB3JS referral code, or use Free public RPC endpoint.",t),this.code=FTt}}const MTt=1301;class qge extends ci{constructor(t){super(`Invalid provider config options given for ${t}`),this.code=MTt}}var RTt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class JOe extends loe{constructor(t,n,r,s,a){if(super(),a!==void 0&&n===A0.HTTPS&&!("providerOptions"in a))throw new qge("HTTP Provider");if(a!==void 0&&n===A0.WebSocket&&!("socketOptions"in a||"reconnectOptions"in a))throw new qge("Websocket Provider");this.transport=n,n===A0.HTTPS?this.provider=new l$(this.getRPCURL(t,n,r,s),a):n===A0.WebSocket&&(this.provider=new dFe(this.getRPCURL(t,n,r,s),a==null?void 0:a.socketOptions,a==null?void 0:a.reconnectOptions))}request(t,n){return RTt(this,void 0,void 0,function*(){return this.transport===A0.HTTPS?yield this.provider.request(t,n):this.provider.request(t)})}getStatus(){return this.provider.getStatus()}supportsSubscriptions(){return this.provider.supportsSubscriptions()}once(t,n){var r;!((r=this.provider)===null||r===void 0)&&r.once&&this.provider.once(t,n)}removeAllListeners(t){var n;!((n=this.provider)===null||n===void 0)&&n.removeAllListeners&&this.provider.removeAllListeners(t)}connect(){var t;!((t=this.provider)===null||t===void 0)&&t.connect&&this.provider.connect()}disconnect(t,n){var r;!((r=this.provider)===null||r===void 0)&&r.disconnect&&this.provider.disconnect(t,n)}reset(){var t;!((t=this.provider)===null||t===void 0)&&t.reset&&this.provider.reset()}on(t,n){this.provider&&this.provider.on(t,n)}removeListener(t,n){this.provider&&this.provider.removeListener(t,n)}}var LTt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const yc=e=>e!==void 0&&e.trim().length>0;class DTt extends JOe{constructor(t=bs.ETH_MAINNET,n=A0.HTTPS,r="",s="",a){super(t,n,r,s,a)}request(t,n){const r=Object.create(null,{request:{get:()=>super.request}});return LTt(this,void 0,void 0,function*(){try{return yield r.request.call(this,t,n)}catch(s){throw s instanceof S0&&s.statusCode===429?new OTt(s):s}})}getRPCURL(t,n,r,s){let a="",o="";switch(t){case bs.ETH_MAINNET:a=yc(s)?s:"powerful-holy-bush.quiknode.pro",o=yc(r)?r:"3240624a343867035925ff7561eb60dfdba2a668";break;case bs.ETH_SEPOLIA:a=yc(s)?s:"dimensional-fabled-glitter.ethereum-sepolia.quiknode.pro",o=yc(r)?r:"382a3b5a4b938f2d6e8686c19af4b22921fde2cd";break;case bs.ETH_HOLESKY:a=yc(s)?s:"yolo-morning-card.ethereum-holesky.quiknode.pro",o=yc(r)?r:"481ebe70638c4dcf176af617a16d02ab866b9af9";break;case bs.ARBITRUM_MAINNET:a=yc(s)?s:"autumn-divine-dinghy.arbitrum-mainnet.quiknode.pro",o=yc(r)?r:"a5d7bfbf60b5ae9ce3628e53d69ef50d529e9a8c";break;case bs.ARBITRUM_SEPOLIA:a=yc(s)?s:"few-patient-pond.arbitrum-sepolia.quiknode.pro",o=yc(r)?r:"3be985450970628c860b959c65cd2642dcafe53c";break;case bs.BNB_MAINNET:a=yc(s)?s:"purple-empty-reel.bsc.quiknode.pro",o=yc(r)?r:"ebf6c532961e21f092ff2facce1ec4c89c540158";break;case bs.BNB_TESTNET:a=yc(s)?s:"floral-rough-scion.bsc-testnet.quiknode.pro",o=yc(r)?r:"5b297e5acff5f81f4c37ebf6f235f7299b6f9d28";break;case bs.POLYGON_MAINNET:a=yc(s)?s:"small-chaotic-moon.matic.quiknode.pro",o=yc(r)?r:"847569f8a017e84d985e10d0f44365d965a951f1";break;case bs.POLYGON_AMOY:a=yc(s)?s:"prettiest-side-shape.matic-amoy.quiknode.pro",o=yc(r)?r:"79a9476eea661d4f82de614db1d8a895b14b881c";break;default:throw new Error("Network info not avalible.")}return`${n}://${a}/${o}`}}const BTt=e=>e!==void 0&&e.trim().length>0,$Tt=[bs.DYMENSION_MAINNET,bs.DYMENSION_TESTNET,bs.KAVA_MAINNET,bs.CRONOS_MAINNET,bs.POLYGON_MAINNET];class jR extends JOe{constructor(t=bs.ETH_MAINNET,n=A0.HTTPS,r="",s){super(t,n,"",r,s)}getRPCURL(t,n,r,s){if(!jR.networkHostMap[t])throw new Error("Network info not avalible.");const a=`${jR.networkHostMap[t]}.publicnode.com`,o=BTt(s)?s:a;return $Tt.includes(t)&&n===A0.WebSocket?`${n}://${o}/websocket`:`${n}://${o}`}}jR.networkHostMap={[bs.POLYGON_AMOY]:"polygon-amoy-bor-rpc",[bs.DYMENSION_MAINNET]:"dymension-evm-rpc",[bs.DYMENSION_TESTNET]:"dymension-testnet-evm-rpc",[bs.BLAST_MAINNET]:"blast-rpc",[bs.GNOSIS_MAINNET]:"gnosis-rpc",[bs.PULSECHAIN_MAINNET]:"pulsechain-rpc",[bs.PULSECHAIN_TESTNET]:"pulsechain-testnet-rpc",[bs.KAVA_MAINNET]:"kava-evm-rpc",[bs.CRONOS_MAINNET]:"cronos-evm-rpc",[bs.MANTLE_MAINNET]:"mantle-rpc",[bs.TAIKO_MAINNET]:"taiko-rpc",[bs.TAIKO_HEKLA]:"taiko-hekla-rpc",[bs.LINEA_MAINNET]:"linea-rpc",[bs.LINEA_SEPOLIA]:"linea-sepolia-rpc",[bs.SCROLL_MAINNET]:"scroll-rpc",[bs.SCROLL_SEPOLIA]:"scroll-sepolia-rpc",[bs.SYSCOIN_MAINNET]:"syscoin-evm-rpc",[bs.SYSCOIN_TANENBAUM]:"syscoin-tanenbaum-evm-rpc",[bs.HAQQ_MAINNET]:"haqq-evm-rpc",[bs.EVMOS_MAINNET]:"evmos-evm-rpc",[bs.EVMOS_TESTNET]:"evmos-testnet-evm-rpc",[bs.BERACHAIN_TESTNET]:"berachain-testnet-evm-rpc",[bs.ETH_MAINNET]:"ethereum-rpc",[bs.ETH_SEPOLIA]:"ethereum-sepolia-rpc",[bs.ETH_HOLESKY]:"ethereum-holesky-rpc",[bs.BSC_MAINNET]:"bsc-rpc",[bs.BSC_TESTNET]:"bsc-testnet-rpc",[bs.POLYGON_MAINNET]:"polygon-bor-rpc",[bs.BASE_MAINNET]:"base-rpc",[bs.BASE_SEPOLIA]:"base-sepolia-rpc",[bs.ARBITRUM_ONE]:"arbitrum-one-rpc",[bs.ARBITRUM_NOVA]:"arbitrum-nova-rpc",[bs.ARBITRUM_SEPOLIA]:"arbitrum-sepolia-rpc",[bs.AVALANCHE_C_MAINNET]:"avalanche-c-chain-rpc",[bs.AVALANCHE_P_MAINNET]:"avalanche-p-chain-rpc",[bs.AVALANCHE_X_MAINNET]:"avalanche-x-chain-rpc",[bs.AVALANCHE_FUJI_C]:"avalanche-fuji-c-chain-rpc",[bs.AVALANCHE_FUJI_P]:"avalanche-fuji-p-chain-rpc",[bs.AVALANCHE_FUJI_X]:"avalanche-fuji-x-chain-rpc",[bs.OPTIMISM_MAINNET]:"optimism-rpc",[bs.OPTIMISM_SEPOLIA]:"optimism-sepolia-rpc",[bs.FANTOM_MAINNET]:"fantom-rpc",[bs.FANTOM_TESTNET]:"fantom-testnet-rpc",[bs.OPBNB_MAINNET]:"opbnb-rpc",[bs.OPBNB_TESTNET]:"opbnb-testnet-rpc",[bs.GNOSIS_CHIADO]:"gnosis-chiado-rpc",[bs.CHILIZ_MAINNET]:"chiliz-rpc",[bs.CHILIZ_SPICY]:"chiliz-spicy-rpc",[bs.MOONBEAM_MAINNET]:"moonbeam-rpc",[bs.BAHAMUT_MAINNET]:"bahamut-rpc",[bs.TRON_MAINNET]:"tron-evm-rpc",[bs.MOONRIVER_MAINNET]:"moonriver-rpc"};const UTt=new DTt,zTt={encodeEventSignature:_oe,encodeFunctionCall:$_t,encodeFunctionSignature:UE,encodeParameter:Mee,encodeParameters:x$,decodeParameter:yOe,decodeParameters:t3,decodeLog:vOe};var k7=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const HTt=e=>{const t=(o,l)=>k7(void 0,void 0,void 0,function*(){const c=yield Ekt(o,e),u=Vr({format:"bytes"},l,fi);return A9t(c,u)}),n=o=>{const l=voe(o);return Object.assign(Object.assign({},l),{signTransaction:c=>k7(void 0,void 0,void 0,function*(){return t(c,l.privateKey)})})},r=(o,l,c)=>k7(void 0,void 0,void 0,function*(){var u;const d=yield k9t(o,l,(u=c==null?void 0:c.nonStrict)!==null&&u!==void 0?u:!0);return Object.assign(Object.assign({},d),{signTransaction:f=>k7(void 0,void 0,void 0,function*(){return t(f,d.privateKey)})})}),s=()=>{const o=_9t();return Object.assign(Object.assign({},o),{signTransaction:l=>k7(void 0,void 0,void 0,function*(){return t(l,o.privateKey)})})},a=new fR({create:s,privateKeyToAccount:n,decrypt:r});return{signTransaction:t,create:s,privateKeyToAccount:n,decrypt:r,recoverTransaction:j9t,hashMessage:yoe,sign:DFe,recover:jee,encrypt:BFe,wallet:a,privateKeyToAddress:f$,parseAndValidatePrivateKey:RA,privateKeyToPublicKey:E9t}},VTt={version:"4.16.0"};var WTt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},ER;(function(e){e.eip6963announceProvider="eip6963:announceProvider",e.eip6963requestProvider="eip6963:requestProvider"})(ER||(ER={}));const AV=new Map,eMe="web3:providersMapUpdated",qTt=()=>WTt(void 0,void 0,void 0,function*(){return new Promise((e,t)=>{typeof window>"u"&&t(new Error("window object not available, EIP-6963 is intended to be used within a browser")),window.addEventListener(ER.eip6963announceProvider,n=>{AV.set(n.detail.info.uuid,n.detail);const r=new CustomEvent(eMe,{detail:AV});window.dispatchEvent(r),e(AV)}),window.dispatchEvent(new Event(ER.eip6963requestProvider))})}),GTt=e=>{if(typeof window>"u")throw new Error("window object not available, EIP-6963 is intended to be used within a browser");window.addEventListener(eMe,e)};class Sl extends Qd{constructor(t=UTt){var n;(Js(t)||typeof t=="string"&&t.trim()===""||typeof t!="string"&&!uR(t)&&!t.provider)&&console.warn("NOTE: web3.js is running without provider. You need to pass a provider in order to interact with the network!");let r={};typeof t=="string"||uR(t)?r.provider=t:t?r=t:r={},r.registeredSubscriptions=Object.assign(Object.assign({},Lee),(n=r.registeredSubscriptions)!==null&&n!==void 0?n:{}),super(r);const s=HTt(this);this._wallet=s.wallet,this._accountProvider=s,this.utils=uFe;const a=this;class o extends n3{constructor(u,d,f,x,g){if(py(d)&&py(f))throw new Bxe("Should not provide options at both 2nd and 3rd parameters");let v,w={},C,N;if(!Js(d)&&typeof d!="object"&&typeof d!="string")throw new Bxe;if(typeof d=="string"&&(v=d),py(d)?w=d:py(f)?w=f:w={},d instanceof Qd?C=d:f instanceof Qd?C=f:x instanceof Qd?C=x:C=a.getContextObject(),g?N=g:hg(f)?N=f:hg(x)&&(N=x),super(u,v,w,C,N),super.subscribeToContextEvents(a),!Js(l)){const I=l.getTransactionMiddleware();Js(I)||super.setTransactionMiddleware(I)}}}const l=a.use(g$);this.eth=Object.assign(l,{ens:a.use(QOe,vR.main),Iban:Rl,net:a.use(GFe),personal:a.use(ZOe),Contract:o,abi:zTt,accounts:s})}}Sl.version=VTt.version;Sl.utils=uFe;Sl.requestEIP6963Providers=qTt;Sl.onNewProviderDiscovered=GTt;Sl.modules={Web3Eth:g$,Iban:Rl,Net:GFe,ENS:QOe,Personal:ZOe};const bd=({open:e,setOpen:t,transactionHash:n,transactionLoading:r,paymentPresaleRole:s,errorFunds:a,activeMethod:o})=>{const[l,c]=m.useState(!1);m.useEffect(()=>{const d=f=>{r&&e&&(f.preventDefault(),f.returnValue="Please do not leave, your purchase is in progress.")};return window.addEventListener("beforeunload",d),()=>window.removeEventListener("beforeunload",d)},[r,e]);const u=async d=>{try{await navigator.clipboard.writeText(d),ln.success("TX Hash copied to clipboard!")}catch(f){console.error("Failed to copy: ",f),ln.error("Failed to copy TX Hash")}};return m.useEffect(()=>{let d;return e&&r?d=setTimeout(()=>c(!0),24e4):(c(!1),d&&clearTimeout(d)),()=>d&&clearTimeout(d)},[e,r]),i.jsxs(Ea,{open:e,onClose:()=>{r||t(!1)},className:"relative z-[9001] font-inter",children:[i.jsx(ja,{style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,style:{maxWidth:"448px"},className:`relative transform overflow-hidden rounded-lg bg-[#161616] border border-[#404040] pt-5 pb-4 text-left shadow-xl transition-all
data-[closed]:translate-y-4 data-[closed]:opacity-0
data-[enter]:duration-300 data-[leave]:duration-200
data-[enter]:ease-out data-[leave]:ease-in
sm:my-8 sm:align-middle sm:w-full sm:max-w-lg`,children:i.jsxs("div",{className:"mt-3 text-center sm:mt-5 text-white",children:[(!r&&s||l)&&i.jsx("svg",{onClick:()=>t(!1),xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 fixed right-0 mr-4 top-4 cursor-pointer text-gray-400 hover:text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),r?i.jsxs("div",{className:"mt-2",children:[!a&&i.jsx("div",{className:"flex justify-center items-center",children:i.jsx(Da,{})}),i.jsxs("p",{className:"mt-4 text-center flex flex-col items-center text-sm font-medium text-gray-200",children:[i.jsx("span",{children:"Your subscription order is created, please confirm"}),i.jsx("span",{children:"transaction on your wallet to complete purchase."})]}),l?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-red-400 mt-4 flex justify-start items-center min-h-20 sm:h-20 bg-[#2a1a1a] w-full border-l-2 border-red-600 gap-4 pl-2.5 rounded",children:[i.jsx("img",{src:ec,alt:"",className:"w-8 h-8"}),i.jsx("span",{className:"text-sm font-medium text-red-400 max-w-[354px] text-left",children:"There was an error, you can contact us via discord."})]}),i.jsx("div",{className:"w-full flex justify-center items-center mt-6",children:i.jsxs("a",{href:"https://discord.gg/dextrabot",target:"_blank",className:"inline-flex relative items-center px-2.5 py-1.5 text-sm font-bold text-white hover:text-white bg-[#5865F2] hover:bg-[#626ef1] rounded-md h-9 min-w-max gap-2",children:[i.jsx("img",{src:rke,className:"w-6 h-6"}),"Join Discord"]})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:`${a?"text-red-400 bg-[#2a1a1a] border-red-600":"text-yellow-400 bg-[#2a2418] border-yellow-600"} mt-4 flex justify-start items-center min-h-20 sm:h-20 w-full border-l-2 gap-4 pl-2.5 rounded`,children:a?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:ec,alt:"",className:"w-8 h-8"}),i.jsx("span",{className:"text-sm font-medium text-red-400 max-w-[354px] text-left",children:"Insufficient funds.Please add funds to your wallet on Ethereum Mainnet."})]}):i.jsxs(i.Fragment,{children:[i.jsx(TM,{className:"w-8 h-8 text-yellow-400"}),i.jsx("span",{className:"text-sm font-medium text-yellow-400 max-w-[354px] text-left",children:"If you have confirmed the transaction from wallet extension, do not exit back and wait, otherwise your transaction may be incorrect."})]})}),i.jsx("div",{className:"w-full flex justify-center items-center mt-6",children:i.jsx("div",{onClick:()=>t(!1),className:"w-26 h-8 px-4 py-1 bg-[#2a2a2a] rounded-full flex justify-center items-center cursor-pointer hover:bg-[#3a3a3a]",children:i.jsx("div",{className:"text-sm font-medium text-gray-300",children:"Cancel"})})})]})]}):o===2&&s?i.jsxs("div",{className:"mt-2",children:[i.jsx("div",{className:"flex justify-center items-center",children:i.jsx("div",{className:"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100",children:i.jsx(pet,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})})}),i.jsx("p",{className:"text-gray-100 text-lg mt-4 font-medium",children:"Payment Successful"}),i.jsxs("p",{className:"text-sm text-left text-gray-300 mt-4 px-2",children:["Transaction Hash"," ",i.jsxs("span",{className:"flex items-center justify-center text-xs break-all",children:[n,i.jsx("span",{onClick:()=>u(n),className:"inline-block mx-1 w-4 cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-300 hover:text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})})]})]})]}):i.jsxs("div",{className:"my-2",children:[i.jsx("div",{className:"flex justify-center items-center",children:i.jsx(Da,{})}),i.jsx("p",{className:"mt-4 text-center flex flex-col items-center text-sm font-medium text-gray-200 font-manrope",children:i.jsx("span",{children:"If your role has not been assigned yet, please refresh the page."})})]})]})})})})]})};function $oe({open:e=!1,setOpen:t=()=>{}}){const[n,r]=m.useState([]),[s,a]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState("11"),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(""),[C,N]=m.useState(""),[I,P]=m.useState(2),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,Q]=m.useState(!1),[ne,J]=m.useState(!1),[X,re]=m.useState(!1),[pe,Y]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState(!1),[te,ae]=m.useState(!1),[he,Ce]=m.useState(null),[ce,ge]=m.useState(""),[Ae,ye]=m.useState(!1),[je,Ie]=m.useState(!1),[Re,Qe]=m.useState(null),[$e,it]=m.useState(!1),[tt,ot]=m.useState([]),[ft,ct]=m.useState(!1),[Vt,It]=m.useState(!1),[an,Nt]=m.useState(""),[mn,dn]=m.useState(!0),{setSignModalOpen:Pt,setTelegramChatId:Xe,setSubscriberRole:Ut,setSubsExpireDay:Lt,setMushboomerETH:qe,setMushboomerSOL:Ke,setIsReferralCode:pt,setIsReferralCodeName:en,setIsWhitelist:Bt,setHyperToken:Et,setHyperAddress:et}=m.useContext(Qr),Be="https://dextrabothypev2.nftinit.io",Mt="https://api.hyperliquid.xyz/info",Ve="0x1924b8561eef20e70ede628a296175d358be80e5",ut=["HYPE","ETH","BTC","SOL","USDT0","PUP"],xt="0.01",jt=Ee=>{switch(Ee){case"BTC":return"UBTC";case"ETH":return"UETH";case"SOL":return"USOL";case"USDT0":return"USDT0";case"HYPE":default:return Ee}},kt=Ee=>{if(Ee==null||Ee==="")return"0.00";const p=Number(Ee);return Number.isNaN(p)?"0.00":p.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},xn=Ee=>/^\d*\.?\d{0,6}$/.test(Ee),un=Ee=>/^\d*$/.test(Ee),On=Ee=>{["e","E","+","-"].includes(Ee.key)&&Ee.preventDefault()},En=m.useMemo(()=>{if(c==="")return!1;const Ee=Number(c);return!Number.isNaN(Ee)&&Ee>=11},[c]);m.useMemo(()=>{if(d==="")return!1;const Ee=Number(d);return!Number.isNaN(Ee)&&Ee>0},[d]);const jn=m.useMemo(()=>{if(x==="")return!1;const Ee=Number(x);return!Number.isNaN(Ee)&&Ee>=0&&Ee<=100},[x]),bn=m.useMemo(()=>{if(v==="")return!1;const Ee=Number(v);return!Number.isNaN(Ee)&&Ee>=0&&Ee<=100},[v]),Zn=m.useMemo(()=>{if(C==="")return!1;const Ee=Number(C);return Number.isInteger(Ee)&&Ee>0&&Ee<=180},[C]),zn=m.useMemo(()=>n.map(Ee=>{const p=(Ee==null?void 0:Ee.wallet_name)??(Ee==null?void 0:Ee.name)??(Ee==null?void 0:Ee.label)??String(Ee==null?void 0:Ee.wallet_id),h=(Ee==null?void 0:Ee.version)===3?`${p} - (API-AGENT) Wallet`:p;return{value:(Ee==null?void 0:Ee.wallet_id)??(Ee==null?void 0:Ee.id)??(Ee==null?void 0:Ee.value)??"",label:h,raw:Ee}}),[n]),$n=m.useMemo(()=>{var Ee;return(Ee=zn.find(p=>String(p.value)===String(s)))==null?void 0:Ee.raw},[zn,s]),nr=m.useMemo(()=>{const Ee=$n||{};return Ee.address||Ee.evm_address||Ee.wallet_address||Ee.public_address||Ee.eth_address||Ee.addr||null},[$n]),wn=($n==null?void 0:$n.version)===3,on=!wn||Re>0,Oe=m.useMemo(()=>{if(!o)return{coin:jt(o),total:"0",entryNtl:"0"};const Ee=jt(o);return(tt||[]).find(h=>(h==null?void 0:h.coin)===Ee)??{coin:Ee,total:"0",entryNtl:"0"}},[o,tt]),rn=s!==""&&o!==""&&(I===1?Zn&&bn:En&&jn)&&Ae&&on&&mn;m.useEffect(()=>{if(!e)return;const Ee=localStorage.getItem("hyperToken"),p=localStorage.getItem("hyperAddress");ye(!!(Ee&&p));const h=setInterval(()=>{const S=localStorage.getItem("hyperToken"),_=localStorage.getItem("hyperAddress");ye(!!(S&&_))},800);return()=>clearInterval(h)},[e]),m.useEffect(()=>{e&&(Y(""),Ae&&Dt())},[e,Ae]),m.useEffect(()=>{e&&(nr?Yn(nr):(Ce(null),ge(""),ot([])))},[e,nr]),m.useEffect(()=>{!e||!Ae||(_t(),Qn())},[e,Ae]),m.useEffect(()=>{e&&I===1&&!v&&w(xt)},[e,I]),m.useEffect(()=>{if(!e||!Ae)return;const Ee=$n||{},p=Ee.address||Ee.evm_address||Ee.wallet_address||Ee.public_address||Ee.eth_address||Ee.addr||null;(Ee==null?void 0:Ee.version)===3&&p&&cn(p)},[e,Ae,s,$n]);async function cn(Ee){try{Ie(!0),Qe(null);const h=await(await fetch(Mt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"maxBuilderFee",user:Ee,builder:Ve})})).json();Qe(Number(h))}catch{Qe(null)}finally{Ie(!1)}}async function _t(){var Ee,p,h;try{L(!0);const S=window.localStorage.getItem("hyperToken"),_=window.localStorage.getItem("hyperAddress");if(!S||!_){V(!1);return}const T=await(await fetch(`${Be}/api/hyper/farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:_.toLowerCase(),token:S})})).json();if(T!=null&&T.success&&((Ee=T==null?void 0:T.data)!=null&&Ee.farming_params)){V(!0),((p=T==null?void 0:T.data)==null?void 0:p.wallet_id)!==void 0&&((h=T==null?void 0:T.data)==null?void 0:h.wallet_id)!==null&&a(String(T.data.wallet_id));const B=T.data.farming_params||{};B.coin&&l(B.coin),B.margin!==void 0&&B.margin!==null&&u(String(B.margin)),B.budget!==void 0&&B.budget!==null&&f(String(B.budget));const W=Number(B.methodType);W===1?(P(2),B.spread!==void 0&&B.spread!==null&&g(String(B.spread))):W===2?(P(1),B.spread!==void 0&&B.spread!==null?w(String(B.spread)):w(xt),B.orderPerHour!==void 0&&B.orderPerHour!==null&&N(String(B.orderPerHour))):P(2)}else V(!1)}catch{V(!1)}finally{L(!1)}}async function Yn(Ee){try{ge(""),ae(!0),Ce(null);const h=await(await fetch(Mt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotClearinghouseState",user:Ee})})).json(),S=Array.isArray(h==null?void 0:h.balances)?h.balances:[];ot(S);const _=S.find(k=>(k==null?void 0:k.coin)==="USDC");Ce(_?_.total:"0")}catch(p){ge(p.message||"Failed to load USDC balance.")}finally{ae(!1)}}function yn(){const Ee=nr||window.localStorage.getItem("hyperAddress");Ee&&Yn(Ee)}async function Dt(){try{F(!0);const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!Ee||!p){ye(!1),Pt(!0);return}const S=await(await fetch(`${Be}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:p.toLowerCase(),token:Ee})})).json();S!=null&&S.success?r((S==null?void 0:S.data)||[]):Y((S==null?void 0:S.error_message)||"Failed to load wallets.")}catch(Ee){Y(Ee.message||"Wallet list error.")}finally{F(!1)}}async function sn(){if(!Ae){Pt(!0);return}if(rn)try{J(!0),Y("");const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!Ee||!p){ye(!1),Pt(!0);return}const S=I===1?{margin:100,budget:1,coin:o,orderPerHour:Number(C),spread:Number(v),methodType:2}:{margin:Number(c),coin:o,spread:Number(x),methodType:1,budget:1},_={address:p.toLowerCase(),token:Ee,wallet_id:Number(s),farming_params:S},T=await(await fetch(`${Be}/api/hyper/farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)})).json();T!=null&&T.success?V(!0):Y((T==null?void 0:T.message)||"Start failed.")}catch(Ee){Y(Ee.message||"An error occurred while saving.")}finally{J(!1)}}async function Tn(){if(!Ae)return Pt(!0);if(s)try{re(!0),Y("");const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!Ee||!p){ye(!1),Pt(!0);return}const S=await(await fetch(`${Be}/api/hyper/farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:p.toLowerCase(),token:Ee,wallet_id:Number(s)})})).json();S!=null&&S.success?V(!1):Y((S==null?void 0:S.error_message)||"Stop failed.")}catch(Ee){Y(Ee.message||"An error occurred while stopping.")}finally{re(!1)}}const Kn=32,ir={control:(Ee,p)=>({...Ee,backgroundColor:"#242424",borderColor:p.isFocused?"#67FFBD":"#353535",minHeight:Kn,height:Kn,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Ee=>({...Ee,height:Kn,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Ee=>({...Ee,height:Kn}),input:Ee=>({...Ee,color:"#FFFFFF",margin:0,padding:0}),singleValue:Ee=>({...Ee,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Ee=>({...Ee,color:"#7F7F7F",fontSize:"12px"}),menu:Ee=>({...Ee,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Ee=>({...Ee,paddingTop:0,paddingBottom:0}),option:(Ee,p)=>({...Ee,backgroundColor:p.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:Kn,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Ee=>({...Ee,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Ee=>({...Ee,backgroundColor:"#353535"})},rr=Ee=>{var p;return i.jsx(Ca.Option,{...Ee,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((p=Ee.data)==null?void 0:p.icon)&&i.jsx("img",{src:Ee.data.icon,alt:Ee.data.label,className:"w-4 h-4",onError:h=>{h.currentTarget.style.display="none"}}),i.jsx("span",{className:"text-white text-[13px]",children:Ee.data.label})]})})},Jt=Ee=>{var p;return i.jsx(Ca.SingleValue,{...Ee,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((p=Ee.data)==null?void 0:p.icon)&&i.jsx("img",{src:Ee.data.icon,alt:Ee.data.label,className:"w-4 h-4",onError:h=>{h.currentTarget.style.display="none"}}),i.jsx("span",{className:"text-white text-[13px]",children:Ee.data.label})]})})},Un=m.useMemo(()=>ut.map(Ee=>{let h=`https://app.hyperliquid.xyz/coins/${Ee==="USDT0"?"USDT":Ee}.svg`;return Ee==="PUP"&&(h="https://www.basedapp.io/_next/image?url=%2Ftokens%2Fpng%2FPUP_USDC.png&w=32&q=75"),{value:Ee,label:Ee,icon:h}}),[]),Qn=async()=>{var h,S;const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!(!Ee||!p))try{Q(!0);const _=await ji(p.toLowerCase(),Ee);_!=null&&_.success?(Xe(_==null?void 0:_.telegram_chat_id),Ut(_==null?void 0:_.subscriber_role),Lt(_==null?void 0:_.subs_expire_day),qe((h=_==null?void 0:_.mushboomer_counts)==null?void 0:h.eth),Ke((S=_==null?void 0:_.mushboomer_counts)==null?void 0:S.sol),pt(_==null?void 0:_.referral_code),en(_==null?void 0:_.refcode),Bt(_==null?void 0:_.whitelist),Et(Ee),et(p),dn(!0),Q(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),Et(""),et(""),Q(!1))}catch(_){console.error("Token verification error:",_),console.error(_.message||"An unknown error occurred."),Q(!1)}},Rt=R||U||ne||X||z,Pn=G&&!X;return e?i.jsxs(i.Fragment,{children:[$e&&Na.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(d5,{open:$e,setOpen:it,handleListRequest:Dt,handlePageChange:()=>{}})}),document.body),i.jsx(bd,{open:Vt,setOpen:It,transactionHash:an,transactionLoading:ft,paymentPresaleRole:mn,errorFunds:ie,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Rt&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#ff6940] max-h-[90dvh] overflow-y-auto",children:[i.jsxs("div",{className:"p-5 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-baseline gap-2",children:[i.jsx("img",{src:oke,alt:"BasedApp",className:"h-6"}),i.jsx("span",{className:"text-[34px] font-semibold text-[#ff6940]",children:"farming"})]}),i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2 pr-[148px]",children:"BasedApp farming module lets you configure automated trading by selecting a wallet, coin, margin, and spread or orders per hour."}),i.jsxs("div",{onClick:Ee=>{window.localStorage.getItem("hyperToken")?it(!0):Pt(!0)},className:"absolute top-[70px] sm:top-8 right-5 h-6 sm:h-8 pl-2 sm:pl-3 pr-4 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] !w-30",children:"Add Account"})]}),i.jsxs("div",{onClick:()=>{window.open("https://www.youtube.com/watch?v=2kBqpY09aDM","_blank")},className:"absolute top-[110px] sm:top-[84px] right-5 h-6 sm:h-8 pl-[26px] sm:pl-[32px] pr-7 py-3 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] justify-center items-center gap-1 inline-flex cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"YouTube"})]})]}),G&&i.jsx("div",{className:"px-5 pt-3",children:i.jsxs("div",{className:"flex items-center justify-between rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2",children:[i.jsx("span",{className:"text-[12px] text-[#CECECE]",children:"Your farm process is currently running. You can follow it here."}),i.jsx("a",{href:"https://www.basedapp.io/leaderboard",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center h-8 px-4 rounded-[10px] text-[12px] font-semibold border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] text-white",children:"Leaderboard"})]})}),I===2&&i.jsx("div",{className:"px-5 pt-3",children:i.jsx("div",{className:"text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:"Use a lower margin compared to your spot balance. Margin should be less than 50% of the Spot balance in order for system to keep farming. Example: For 10.000$ Spot equity use 2.000$ in margin."})}),Ae&&wn&&i.jsx("div",{className:"px-5 pt-3",children:je?i.jsx("div",{className:"text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:"Checking builder approval..."}):on?null:i.jsxs("div",{className:"flex flex-col gap-2 text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:[i.jsx("span",{children:"Action required: Please log in via BasedApp and approve the Builder fee for this wallet to continue."}),i.jsx("a",{href:"https://app.based.one/register?ref=ANABOLIC",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-center text-[#1B1B1B] bg-[#ff6940] rounded-md px-3 py-1 font-bold transition",children:"BasedApp Login"})]})}),i.jsxs("div",{className:"p-5 space-y-6",children:[pe&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:pe}),i.jsxs("div",{className:"w-full rounded-full border border-[#2A2A2A] bg-transparent p-1 flex gap-2",children:[i.jsx("div",{className:`flex-1 h-9 rounded-full text-[13px] transition cursor-pointer flex justify-center items-center font-semibold ${I===2?"bg-[#242424] text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]":"text-[#B3B3B3]"} ${Pn?"opacity-60 cursor-not-allowed":""}`,onClick:()=>!Pn&&P(2),children:"Econo Mode"}),i.jsx("div",{className:`flex-1 h-9 rounded-full text-[13px] transition cursor-pointer flex justify-center items-center font-semibold ${I===1?"bg-[#242424] text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]":"text-[#B3B3B3]"} ${Pn?"opacity-60 cursor-not-allowed":""}`,onClick:()=>!Pn&&P(1),children:"Farmer Mode"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Wallet"}),i.jsxs("div",{className:"relative",children:[i.jsx(Cl,{styles:ir,isDisabled:Rt||R||Pn,isLoading:R,options:zn,value:zn.find(Ee=>String(Ee.value)===String(s))||null,onChange:Ee=>{if(Pn)return;a((Ee==null?void 0:Ee.value)??""),Qe(null);const p=(Ee==null?void 0:Ee.raw)||{},h=p.address||p.evm_address||p.wallet_address||p.public_address||p.eth_address||p.addr||null;Ae&&(p==null?void 0:p.version)===3&&h&&cn(h)},placeholder:Ae?R?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{Ae||Pt(!0)},menuIsOpen:Ae?void 0:!1}),!Ae&&i.jsx("button",{type:"button",onClick:()=>Pt(!0),className:"absolute inset-0 rounded-md cursor-pointer bg-transparent","aria-label":"Connect to select",title:"Connect"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Coin"}),i.jsx(Cl,{styles:ir,components:{Option:rr,SingleValue:Jt},isDisabled:Rt||Pn,options:Un,value:Un.find(Ee=>Ee.value===o)||null,onChange:Ee=>{Pn||l((Ee==null?void 0:Ee.value)??"")},placeholder:"Select",isSearchable:!0})]})]}),I===1?i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Trade Per Hour"}),i.jsx("input",{value:C,onChange:Ee=>{const p=Ee.target.value.trim();if(p==="")return N("");un(p)&&N(p)},onKeyDown:On,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 6 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${C===""?"border-[#353535]":Zn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Rt||Pn}),C!==""&&!Zn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]}),i.jsxs("div",{className:"space-y-2 hidden",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Spread %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:v,onChange:Ee=>{const p=Ee.target.value.trim();if(p==="")return w("");xn(p)&&w(p)},onKeyDown:On,inputMode:"decimal",autoComplete:"off",placeholder:"Default 0.01",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${v===""?"border-[#353535]":bn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Rt||Pn})]}),v!==""&&!bn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."}),o==="PUP"&&i.jsxs("div",{className:"mt-2 text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:[i.jsx("div",{children:"⚠️ PUP Spread Warning"}),i.jsx("div",{children:"Due to high price volatility, we recommend setting your spread to at least %0.03 for PUP."})]})]})]}):i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:i.jsx(pi,{content:"The portion of your budget used per trade. A higher margin means larger trade size, while a lower margin spreads your budget across more trades.",children:i.jsx("span",{children:"Margin (Amount)"})})}),i.jsx("input",{value:c,onChange:Ee=>{const p=Ee.target.value.trim();if(p==="")return u("");xn(p)&&u(p)},onKeyDown:On,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 2000",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${c===""?"border-[#353535]":En?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Rt||Pn}),c!==""&&!En&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a value greater than or equal to 11."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Spread %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:x,onChange:Ee=>{const p=Ee.target.value.trim();if(p==="")return g("");xn(p)&&g(p)},onKeyDown:On,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${x===""?"border-[#353535]":jn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Rt||Pn})]}),x!==""&&!jn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."}),o==="PUP"&&i.jsxs("div",{className:"mt-2 text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:[i.jsx("div",{children:"⚠️ PUP Spread Warning"}),i.jsx("div",{children:"Due to high price volatility, we recommend setting your spread to at least 0.03 for PUP."})]})]})]})]}),i.jsxs("div",{className:"flex items-start gap-3 p-3 border-t border-[#353535] bg[rgba(27,27,27,0.32)] rounded-b-3xl",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[Ae&&i.jsxs("div",{className:"text-[12px] text-[#9B9B9B] flex items-center gap-2",children:["Available Spot Balance (USDC):",i.jsx("span",{className:"text-white",children:te?"Loading...":ce?"—":kt(he??"0")}),i.jsx("div",{onClick:yn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(AS,{className:`w-4 h-4 ${te?"animate-spin":""}`})})]}),Ae&&o&&i.jsxs("div",{className:"text-[12px] text-[#9B9B9B] flex items-center gap-2",children:["Available ",o," Balance:",i.jsx("span",{className:"text-white",children:kt(Oe==null?void 0:Oe.total)}),i.jsxs("span",{className:"text-[#9B9B9B]",children:["(~",kt(Oe==null?void 0:Oe.entryNtl)," USDC)"]}),i.jsx("div",{onClick:yn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(AS,{className:`w-4 h-4 ${te?"animate-spin":""}`})})]})]}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Rt&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] font-inter hover:border-white disabled:opacity-60",disabled:Rt,children:"Cancel"}),Ae?G?i.jsx("button",{onClick:Tn,disabled:!s||Rt,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:X?"Stopping...":"Stop"}):i.jsx("button",{onClick:sn,disabled:!rn||Rt,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border ${!rn||Rt?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:ne?"Starting...":"Start"}):i.jsx("button",{onClick:()=>Pt(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})]}),(R||U)&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]}):null}const tMe=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"121",height:"32",viewBox:"0 0 32 32",fill:"none",className:e,children:[i.jsx("path",{d:"M9.13309 30.4398L9.88315 26.9871C10.7197 23.1362 7.77521 19.4988 3.82118 19.4988H0.385363C1.4689 24.3374 4.75127 28.3496 9.13309 30.4398Z",fill:"currentColor"}),i.jsx("path",{d:"M10.64 31.0663C12.3326 31.6707 14.1567 32 16.0579 32C23.7199 32 30.1285 26.6527 31.7305 19.4988H21.249C16.5244 19.4988 12.4396 22.7824 11.44 27.3838L10.64 31.0663Z",fill:"currentColor"}),i.jsx("path",{d:"M32.0038 17.8987C32.0778 17.2756 32.1159 16.6415 32.1159 15.9985C32.1159 7.60402 25.629 0.719287 17.3779 0.0503251L15.1273 10.4105C14.2907 14.2614 17.2352 17.8987 21.1892 17.8987H32.0038Z",fill:"currentColor"}),i.jsx("path",{d:"M15.7459 0C7.02134 0.165717 0 7.26504 0 15.9985C0 16.6415 0.0380539 17.2756 0.112041 17.8987H3.76146C8.48603 17.8987 12.5709 14.6151 13.5705 10.0137L15.7459 0Z",fill:"currentColor"}),i.jsxs("defs",{children:[i.jsxs("linearGradient",{id:"paint0_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]}),i.jsxs("linearGradient",{id:"paint1_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]}),i.jsxs("linearGradient",{id:"paint2_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]}),i.jsxs("linearGradient",{id:"paint3_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]})]})]}),Uoe=({open:e=!1,setOpen:t=()=>{},defaultMethod:n=2})=>{const{setSignModalOpen:r,setTelegramChatId:s,setSubscriberRole:a,setSubsExpireDay:o,setMushboomerETH:l,setMushboomerSOL:c,setIsReferralCode:u,setIsReferralCodeName:d,setIsWhitelist:f,setHyperToken:x,setHyperAddress:g}=m.useContext(Qr);Jr();const[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState(""),[R,F]=m.useState(""),[U,L]=m.useState(""),[z,Q]=m.useState(""),[ne,J]=m.useState(""),[X,re]=m.useState("OFF"),[pe,Y]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState("LONG"),[te,ae]=m.useState("MARKET"),[he,Ce]=m.useState(""),[ce,ge]=m.useState(""),[Ae,ye]=m.useState(""),[je,Ie]=m.useState(!1),[Re,Qe]=m.useState(!1),[$e,it]=m.useState(!1),[tt,ot]=m.useState(!1),[ft,ct]=m.useState(""),[Vt,It]=m.useState(""),[an,Nt]=m.useState(!0),[mn,dn]=m.useState(!1),[Pt,Xe]=m.useState(!1),[Ut,Lt]=m.useState(!1),[qe,Ke]=m.useState(!1),[pt,en]=m.useState(!1),[Bt,Et]=m.useState(!1),[et,Be]=m.useState(""),[Mt,Ve]=m.useState(!0),[ut,xt]=m.useState(2),jt="https://dextrabothypev2.nftinit.io",kt="",xn={ASTERUSDT:[[50,0,2500],[25,2500,5e3],[20,5e3,1e4],[10,1e4,1e5],[5,1e5,2e5],[2,2e5,6e5],[1,6e5,1e6]],BTCUSDT:[[100,0,5e5],[75,5e5,1e6],[50,1e6,25e5],[25,25e5,5e6],[20,5e6,125e5],[10,125e5,25e6],[5,25e6,75e6],[4,75e6,125e6],[3,125e6,2e8],[2,2e8,25e7],[1,25e7,375e6]],ETHUSDT:[[100,0,3e5],[75,3e5,6e5],[50,6e5,375e4],[20,375e4,12e6],[10,12e6,15e6],[5,15e6,45e6],[4,45e6,75e6],[3,75e6,12e7],[2,12e7,15e7],[1,15e7,225e6]],BNBUSDT:[[100,0,1e4],[75,1e4,5e4],[50,5e4,625e3],[20,625e3,2e6],[10,2e6,25e5],[5,25e5,75e5],[4,75e5,125e5],[3,125e5,2e7],[2,2e7,25e6],[1,25e6,375e5]],SOLUSDT:[[25,0,2e5],[15,2e5,4e5],[10,4e5,4e6],[8,4e6,8e6],[6,8e6,2e7],[5,2e7,4e7],[4,4e7,8e7],[3,8e7,12e7],[2,12e7,16e7],[1,16e7,2e8]]},un={ASTERUSDT:{market:5e3,unit:"ASTER"},BTCUSDT:{market:20,unit:"BTC"},ETHUSDT:{market:100,unit:"ETH"},BNBUSDT:{market:300,unit:"BNB"},SOLUSDT:{market:3e3,unit:"SOL"}},On=k=>{if(k==null||isNaN(k))return"";const T=Math.abs(k),B=W=>W.toFixed(1).replace(/\.0$/,"");return T>=1e9?`${B(k/1e9)}B`:T>=1e6?`${B(k/1e6)}M`:T>=1e3?`${B(k/1e3)}K`:`${k}`},En=(k,T)=>{const B=xn[k]||[];if(!B.length||!T)return null;let W=null;for(const[ee,de,fe]of B)T<=ee&&(!W||ee<W.maxLev)&&(W={min:de,max:fe,maxLev:ee});return W},jn=m.useMemo(()=>[{value:"ASTERUSDT",label:"ASTERUSDT",icon:"https://static.astherus.finance/image/admin_mgs_image_upload/20250916/6dba1412-ddfb-4314-bfdf-87fa11f2daa6.png",maxLeverage:50},{value:"BTCUSDT",label:"BTCUSDT",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:100},{value:"ETHUSDT",label:"ETHUSDT",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:100},{value:"BNBUSDT",label:"BNBUSDT",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:100},{value:"SOLUSDT",label:"SOLUSDT",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:25}],[]),bn=k=>{var T;return((T=jn.find(B=>B.value===k))==null?void 0:T.maxLeverage)??100},Zn=k=>{["e","E","+","-"].includes(k.key)&&k.preventDefault()},zn=k=>/^\d*\.?\d{0,6}$/.test(k),$n=k=>/^\d*$/.test(k),nr=m.useMemo(()=>{if(pe==="")return!1;const k=Number(pe);return Number.isInteger(k)&&k>=1&&k<=180},[pe]),wn=m.useMemo(()=>{if(ie==="")return!1;const k=Number(ie),T=bn(ne);return Number.isInteger(k)&&k>=1&&k<=T},[ie,ne]),on=m.useMemo(()=>{if(he==="")return!1;const k=Number(he);return!Number.isNaN(k)&&k>=0&&k<=100},[he]),Oe=m.useMemo(()=>{if(ce==="")return!1;const k=Number(ce);return!Number.isNaN(k)&&k>=0&&k<=100},[ce]),rn=m.useMemo(()=>{if(Ae==="")return!1;const k=Number(Ae);return!Number.isNaN(k)&&k>=0&&k<=100},[Ae]),cn=Number(ie||0),_t=wn&&ne?En(ne,cn):null,Yn=v&&I.trim()!==""&&R.trim()!==""&&(X!=="ON"||U.trim()!==""&&z.trim()!=="")&&ne!==""&&nr&&wn&&(G==="LONG"||G==="SHORT")&&(te==="LIMIT"||te==="MARKET")&&Mt,yn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Dt=()=>`asterCreds:${yn()}`,sn=()=>{try{const k=localStorage.getItem(Dt());if(!k)return;const T=JSON.parse(k);T.apiKey&&P(T.apiKey),T.apiSecret&&F(T.apiSecret),T.apiKeyTwo&&L(T.apiKeyTwo),T.apiSecretTwo&&Q(T.apiSecretTwo),typeof T.remember=="boolean"&&Nt(T.remember)}catch{}},Tn=()=>{if(an)try{localStorage.setItem(Dt(),JSON.stringify({apiKey:I,apiSecret:R,apiKeyTwo:U,apiSecretTwo:z,remember:!0}))}catch{}},Kn=()=>{try{localStorage.removeItem(Dt())}catch{}};m.useEffect(()=>{if(!e)return;const k=localStorage.getItem("hyperToken"),T=localStorage.getItem("hyperAddress");w(!!(k&&T));const B=setInterval(()=>{const W=localStorage.getItem("hyperToken"),ee=localStorage.getItem("hyperAddress");w(!!(W&&ee))},800);return()=>clearInterval(B)},[e]),m.useEffect(()=>{!e||!v||(ir(),Ee())},[e,v]),m.useEffect(()=>{e&&(ce===""&&ge(kt),he===""&&Ce(kt),Ae===""&&ye(kt))},[e]),m.useEffect(()=>{if(!ne)return;const k=bn(ne),T=Number(ie);!Number.isNaN(T)&&T>k&&oe(String(k)),!Number.isNaN(T)&&T<1&&ie!==""&&oe("1")},[ne]),m.useEffect(()=>{e&&(an&&Tn(),an||Kn())},[I,R,U,z,an,e]);async function ir(){var k,T,B,W,ee;try{Qe(!0),ct("");const de=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!de||!fe){N(!1),sn();return}const we=await(await fetch(`${jt}/api/hyper/ast_farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:fe.toLowerCase(),token:de})})).json(),ke=(k=we==null?void 0:we.data)==null?void 0:k.farming_params;if(we!=null&&we.success&&ke){N(!0);const Me=((T=we==null?void 0:we.data)==null?void 0:T.aster_apikey)??"",Ye=((B=we==null?void 0:we.data)==null?void 0:B.aster_apisecret)??"",Fe=(ke==null?void 0:ke.api_key_2)??"",st=(ke==null?void 0:ke.api_secret_2)??"";Me&&P(String(Me)),Ye&&F(String(Ye)),Fe&&L(String(Fe)),st&&Q(String(st)),((W=we==null?void 0:we.data)==null?void 0:W.delta_neutral)!==void 0&&re((ee=we==null?void 0:we.data)!=null&&ee.delta_neutral?"ON":"OFF"),ke!=null&&ke.coin&&J(String(ke.coin)),(ke==null?void 0:ke.orderPerHour)!=null&&Y(String(ke.orderPerHour)),(ke==null?void 0:ke.leverage)!=null&&oe(String(ke.leverage)),ke!=null&&ke.direction&&V(String(ke.direction).toUpperCase()==="SHORT"?"SHORT":"LONG"),ke!=null&&ke.order_type&&ae(String(ke.order_type)==="limit"?"LIMIT":"MARKET"),(ke==null?void 0:ke.upspread)!=null&&Ce(String(ke.upspread)),(ke==null?void 0:ke.downspread)!=null&&ge(String(ke.downspread)),(ke==null?void 0:ke.upspread)!=null&&ye(String(ke.upspread))}else N(!1),re("OFF");(!I&&!R||X==="ON"&&!U&&!z)&&sn()}catch{N(!1),sn(),re("OFF")}finally{Qe(!1)}}async function rr(){if(!v){r(!0);return}if(Yn)try{it(!0),ct("");const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){r(!0);return}const B={methodType:X==="ON"?2:1,coin:ne,orderPerHour:Number(pe),leverage:Number(ie),...X==="ON"?{api_key_2:U,api_secret_2:z}:te==="LIMIT"?{upspread:Number(Ae),direction:G,order_type:te==="LIMIT"?"limit":"market"}:{upspread:Number(he),downspread:Number(ce),direction:G,order_type:te==="LIMIT"?"limit":"market"}},W={address:T.toLowerCase(),token:k,apikey:I,apisecret:R,farming_params:B,delta_neutral:X==="ON"},de=await(await fetch(`${jt}/api/hyper/ast_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})).json();de!=null&&de.success?(N(!0),an&&Tn()):ct((de==null?void 0:de.error_message)||"Start failed.")}catch(k){ct(k.message||"An error occurred while saving.")}finally{it(!1)}}async function Jt(){if(!v){r(!0);return}try{ot(!0),ct("");const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){r(!0);return}const W=await(await fetch(`${jt}/api/hyper/ast_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:T.toLowerCase(),token:k})})).json();W!=null&&W.success?N(!1):ct((W==null?void 0:W.error_message)||"Stop failed.")}catch(k){ct(k.message||"An error occurred while stopping.")}finally{ot(!1)}}const Un={control:(k,T)=>({...k,backgroundColor:"#242424",borderColor:T.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:k=>({...k,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:k=>({...k,height:32}),input:k=>({...k,color:"#FFFFFF",margin:0,padding:0}),singleValue:k=>({...k,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:k=>({...k,color:"#7F7F7F",fontSize:"12px"}),menu:k=>({...k,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:k=>({...k,paddingTop:0,paddingBottom:0}),option:(k,T)=>({...k,backgroundColor:T.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:k=>({...k,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:k=>({...k,backgroundColor:"#353535"})},Qn=({max:k})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[k,"x"]}),Rt=k=>{var T;return i.jsx(Ca.Option,{...k,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((T=k.data)==null?void 0:T.icon)&&i.jsx("img",{src:k.data.icon,alt:k.data.label,className:"w-4 h-4 rounded-[4px]",onError:B=>B.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:k.data.label}),i.jsx(Qn,{max:k.data.maxLeverage})]})})},Pn=k=>{var T;return i.jsx(Ca.SingleValue,{...k,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((T=k.data)==null?void 0:T.icon)&&i.jsx("img",{src:k.data.icon,alt:k.data.label,className:"w-4 h-4 rounded-[4px]",onError:B=>B.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:k.data.label}),i.jsx(Qn,{max:k.data.maxLeverage})]})})},Ee=async()=>{var B,W;const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!(!k||!T))try{Ie(!0);const ee=await ji(T.toLowerCase(),k);ee!=null&&ee.success?(s(ee==null?void 0:ee.telegram_chat_id),a(ee==null?void 0:ee.subscriber_role),o(ee==null?void 0:ee.subs_expire_day),l((B=ee==null?void 0:ee.mushboomer_counts)==null?void 0:B.eth),c((W=ee==null?void 0:ee.mushboomer_counts)==null?void 0:W.sol),u(ee==null?void 0:ee.referral_code),d(ee==null?void 0:ee.refcode),f(ee==null?void 0:ee.whitelist),x(k),g(T),Ve(!0),Ie(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),x(""),g(""),Ie(!1))}catch(ee){console.error("Token verification error:",ee),console.error(ee.message||"An unknown error occurred."),Ie(!1)}},p=jn;if(!e)return null;const h=Re||$e||tt||je,S=C&&!tt,_=bn(ne);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:Bt,setOpen:Et,transactionHash:et,transactionLoading:pt,paymentPresaleRole:Mt,errorFunds:Vt,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!h&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:`${X==="ON"?"pb-3.5":"pb-2"} px-5 pt-5 border-b border-[#353535] rounded-t-3xl relative`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://static.asterdex.com/cloud-futures/static/images/aster/logo.svg",alt:"Dextrabot - Aster Farming"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#F8D4AB] mt-[1px]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Aster Farming module lets you set up automated farming by providing your API Key and Secret, selecting a pair, defining orders per hour, leverage, direction, and TP/SL percentages."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1",children:i.jsxs("div",{onClick:()=>window.open("https://www.youtube.com/watch?v=qFJxq-vzctE","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})})]}),C&&ut===2&&i.jsx("div",{className:"pt-4",children:i.jsxs("div",{className:"flex items-center justify-between rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2",children:[i.jsx("span",{className:"text-[12px] text-[#CECECE]",children:"Your farm process is currently running. You can follow it here."}),i.jsx("a",{href:"https://www.asterdex.com/en/stage3/statistics",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center h-8 px-4 rounded-[10px] text-[12px] font-semibold border bg-[#F8D4AB] border-[#f7c080] hover:bg-[#f6e7d5] text-black hover:text-black",children:"Points"})]})})]}),i.jsxs("div",{className:`${X==="ON"?"space-y-3 pt-3.5 pb-3":"space-y-2 pt-2 pb-2"} px-5`,children:[ft&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:ft}),i.jsx("div",{className:"px-1 sm:px-4",children:i.jsx("div",{className:"w-full flex gap-2",children:i.jsx("div",{className:"flex-1 h-9 rounded-full text-[13px] transition flex justify-center items-center font-semibold",children:i.jsx("div",{className:"airdrop-btn",children:i.jsx("span",{className:"label",children:i.jsxs("span",{className:"text-[#F6D5B1] font-medium text-[11px] sm:text-sm flex items-center gap-2 min-w-max",children:[i.jsx(tMe,{className:"w-4 h-4"}),"Stage 3"]})})})})})}),v&&!C&&ut===2&&Mt&&i.jsxs("div",{className:"flex flex-col items-center gap-2 px-2 sm:px-5 ",children:[i.jsxs("div",{className:"flex justify-between items-center rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2 w-full gap-2",children:[i.jsx("div",{className:"text-white font-semibold text-[11px] sm:text-[14px] leading-4 font-manrope",children:"1) Enable Trading on Asterdex"}),i.jsx("div",{onClick:()=>{window.open("https://www.asterdex.com/en/futures/v1/BTCUSDT?ref=9876D8","_blank")},className:"flex items-center justify-center h-6 px-6 rounded-[10px] text-[13px] border bg-[#F8D4AB] border-[#F8D4AB] hover:bg-[#dbb689] cursor-pointer min-w-max text-black hover:text-black/90",children:"Enable Trading"})]}),i.jsxs("div",{className:"flex justify-between items-center rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2 w-full gap-2",children:[i.jsx("div",{className:"text-white font-semibold text-[11px] sm:text-[14px] leading-4 font-manrope",children:"2) Create Your API Keys"}),i.jsx("div",{onClick:()=>{window.open("https://www.asterdex.com/en/api-management","_blank")},className:"flex items-center justify-center h-6 px-6 rounded-[10px] text-[13px] border bg-[#F8D4AB] border-[#F8D4AB] hover:bg-[#dbb689] cursor-pointer min-w-max text-black hover:text-black/90",children:"Go to Asterdex"})]})]}),ut===2&&i.jsxs("div",{className:`${X==="ON"?"space-y-6":"space-y-3"} px-3 sm:px-5 py-2 `,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[X==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://www.asterdex.com/en/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:I,onChange:k=>P(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY",type:mn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${I===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>dn(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:mn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:R,onChange:k=>F(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET",type:Pt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${R===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>Xe(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:Pt?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://www.asterdex.com/en/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:I,onChange:k=>P(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY",type:mn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${I===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>dn(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:mn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:R,onChange:k=>F(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET",type:Pt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${R===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>Xe(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:Pt?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),X==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key 2"}),i.jsx("a",{href:"https://www.asterdex.com/en/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:U,onChange:k=>L(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY_2",type:Ut?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${U===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>Lt(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:Ut?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Secret 2"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:z,onChange:k=>Q(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET_2",type:qe?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${z===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>Ke(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:qe?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:Un,components:{Option:Rt,SingleValue:Pn},isDisabled:h||S,options:p,value:p.find(k=>k.value===ne)||null,onChange:k=>J((k==null?void 0:k.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:pe,onChange:k=>{const T=k.target.value.trim();if(T==="")return Y("");$n(T)&&Y(T)},onKeyDown:Zn,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${pe===""?"border-[#353535]":nr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S}),pe!==""&&!nr&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:X==="ON"?"On":"Off"}),i.jsx(jo,{checked:X==="ON",onChange:k=>re(k?"ON":"OFF"),disabled:h||S,className:`${X==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${h||S?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${X==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:ie,onChange:k=>{const T=k.target.value.trim();if(T==="")return oe("");$n(T)&&oe(T)},onKeyDown:Zn,inputMode:"numeric",autoComplete:"off",placeholder:ne?`1–${_}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ie===""?"border-[#353535]":wn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S}),ie!==""&&!wn&&i.jsxs("div",{className:"text-[#FF797C] text-[12px]",children:["Allowed: 1–",_,"x"]}),_t&&i.jsxs("div",{className:"mt-2 space-y-1 text-[10px] text-[#CECECE]",children:[i.jsxs("div",{children:["Tier range at ",i.jsxs("b",{children:[cn,"x"]}),":"," ",i.jsxs("b",{children:[On(_t.min)," – ",On(_t.max)," USDT"]})," ",i.jsx("a",{href:"https://www.asterdex.com/en/futures/trading-rules/leverage-and-margin",target:"_blank",rel:"noopener noreferrer",className:"underline text-[#F8D4AB] hover:text-white",children:"More Details"})]}),un[ne]&&i.jsxs("div",{children:["Trading Limit is"," ",i.jsxs("b",{children:[On(un[ne].market)," ",un[ne].unit]})," ","for ",i.jsx("b",{children:ne})," ",i.jsx("a",{href:"https://www.asterdex.com/en/futures/trading-rules/trading-rules",target:"_blank",rel:"noopener noreferrer",className:"underline text-[#F8D4AB] hover:text-white",children:"More Details"})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${X==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":te==="MARKET",onClick:()=>!S&&ae("MARKET"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",h||S?"opacity-60 cursor-not-allowed":"cursor-pointer",te==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",te==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":te==="LIMIT",onClick:()=>!S&&ae("LIMIT"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",h||S?"opacity-60 cursor-not-allowed":"cursor-pointer",te==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",te==="LIMIT"?" ✓":""]})})]})]}),i.jsxs("div",{className:`${X==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{"aria-pressed":G==="LONG",onClick:()=>!S&&V("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",h||S?"opacity-60 cursor-not-allowed":"cursor-pointer",G==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{children:["LONG",ie?` - ${ie}x`:""]})}),i.jsx("div",{"aria-pressed":G==="SHORT",onClick:()=>!S&&V("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",h||S?"opacity-60 cursor-not-allowed":"cursor-pointer",G==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{children:["SHORT",ie?` - ${ie}x`:""]})})]})]})]}),i.jsxs("div",{className:`${X==="ON"||te==="LIMIT"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:he,onChange:k=>{const T=k.target.value.trim();if(T==="")return Ce("");zn(T)&&Ce(T)},onKeyDown:Zn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${he===""?"border-[#353535]":on?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S})]}),he!==""&&!on&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:ce,onChange:k=>{const T=k.target.value.trim();if(T==="")return ge("");zn(T)&&ge(T)},onKeyDown:Zn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.2",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ce===""?"border-[#353535]":Oe?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S})]}),ce!==""&&!Oe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]})]}),i.jsx("div",{className:`${X==="OFF"&&te==="LIMIT"?"":"hidden"} grid grid-cols-1 md:grid-cols-2 gap-4`,children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Spread %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Ae,onChange:k=>{const T=k.target.value.trim();if(T==="")return ye("");zn(T)&&ye(T)},onKeyDown:Zn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ae===""?"border-[#353535]":rn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S})]}),Ae!==""&&!rn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]})})]}),ut===2&&i.jsx("div",{className:"flex items-center gap-3 px-5 py-3 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl",children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!h&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:h,children:"Cancel"}),v?C?i.jsx("button",{onClick:Jt,disabled:h,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:tt?"Stopping...":"Stop"}):i.jsx("button",{onClick:rr,disabled:!Yn||h,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Yn||h?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:$e?"Starting...":"Start"}):i.jsx("button",{onClick:()=>r(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),Re&&ut===2&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},KTt=({linkTo:e,title:t,icon:n})=>i.jsx("a",{href:e,target:"_self",children:i.jsxs("div",{className:`${location.pathname===e?"bg-[#353535] rounded-[256px]":""} h-8 px-2.5 py-2 justify-start items-center inline-flex text-white min-w-max cursor-pointer ${e==="/tracked-wallets"||e==="/tracker"||e==="/referral"||e==="/wallet-management"||e==="/copy-trade"||e==="/leaderboard"?"hidden sm:block":""}`,children:[n&&i.jsx("img",{src:n,alt:t,className:"h-4"}),i.jsx("div",{className:"text-[13px] font-semibold font-manrope leading-[16px] min-w-max",children:t})]})}),Xf=({className:e})=>i.jsxs("svg",{viewBox:"0 0 53 96",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:`size-full ${e}`,children:[i.jsx("path",{d:"M23 76.3751L0 96V20.687L23 0V76.3751Z"}),i.jsx("path",{d:"M53 76.4219L30 96V66.6279L53 46V76.4219Z"})]}),ro=({content:e,positionTop:t,alignRight:n,tooltipCss:r})=>i.jsxs("span",{className:`tooltip ${n?"left-5 top-1/2 -translate-y-1/2 ":t?"-top-6 -translate-x-1/2 left-1/2":"-bottom-6 -translate-x-1/2 left-1/2"} transform bg-[#353535] text-white font-manrope font-semibold text-xs leading-3 py-1 px-1.5 rounded-sm relative whitespace-normal ${r} h-auto overflow-hidden break-normal`,children:[e==="Sharpe_tooltip"?i.jsxs("div",{className:"flex flex-col items-start pl-4 gap-1 min-w-max",children:[i.jsxs("span",{className:"flex justify-start items-center gap-1 text-xs font-semibold",children:[i.jsx("div",{className:"rounded-full bg-[#FF7173] w-2 h-2"}),i.jsx("span",{children:"< 1"})]}),i.jsxs("span",{className:"flex justify-start items-center gap-1 text-xs font-semibold",children:[i.jsx("div",{className:"rounded-full bg-[#E5BB18] w-2 h-2"}),i.jsx("span",{children:"1 - 2"})]}),i.jsxs("span",{className:"flex justify-start items-center gap-1 text-xs font-semibold",children:[i.jsx("div",{className:"rounded-full bg-[#1DE6A3] w-2 h-2"}),i.jsx("span",{children:"> 2"})]})]}):e,i.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`absolute transform -z-1 ${n?"-rotate-90 left-1 -translate-x-full -translate-y-1/2 top-1/2 ":t?"-bottom-1 rotate-180 -translate-x-1/2 left-1/2":"-top-1 -translate-x-1/2 left-1/2"}`,children:i.jsx("path",{d:"M3.70096 1.25C4.27831 0.25 5.72169 0.25 6.29904 1.25L8.89711 5.75C9.47446 6.75 8.75278 8 7.59808 8H2.40192C1.24722 8 0.525536 6.75 1.10289 5.75L3.70096 1.25Z",fill:"#353535"})})]}),Si=({className:e})=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M8.00016 14.6666C11.6668 14.6666 14.6668 11.6666 14.6668 7.99992C14.6668 4.33325 11.6668 1.33325 8.00016 1.33325C4.3335 1.33325 1.3335 4.33325 1.3335 7.99992C1.3335 11.6666 4.3335 14.6666 8.00016 14.6666Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M8 5.33325V8.66659",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M7.99609 10.6667H8.00208",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),p5=({open:e=!1,setOpen:t=()=>{},oldSlotCount:n,checkAccountLighter:r,tradeMarket:s,product:a})=>{const{address:o}=Jr(),{setSignModalOpen:l,setTelegramChatId:c,setSubscriberRole:u,setSubsExpireDay:d,setMushboomerETH:f,setMushboomerSOL:x,setIsReferralCode:g,setIsReferralCodeName:v,setIsWhitelist:w,setHyperToken:C,setHyperAddress:N}=m.useContext(Qr),[I,P]=m.useState(1),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,Q]=m.useState(""),[ne,J]=m.useState(""),[X,re]=m.useState(""),pe=he=>/^\d*$/.test(he),Y=he=>{["e","E","+","-"].includes(he.key)&&he.preventDefault()};m.useEffect(()=>{e||P(1)},[e]);const ie=m.useRef(X);m.useEffect(()=>{ie.current=X},[X]);const oe=m.useMemo(()=>{if(I==="")return!1;const he=Number(I);return Number.isInteger(he)&&he>=1},[I]),G=async()=>{var ce,ge,Ae,ye;const he=window.localStorage.getItem("hyperToken"),Ce=window.localStorage.getItem("hyperAddress");if(!(!he||!Ce))try{const je=await ji(Ce.toLowerCase(),he);je!=null&&je.success?(c(je==null?void 0:je.telegram_chat_id),u(je==null?void 0:je.subscriber_role),d(je==null?void 0:je.subs_expire_day),f((ce=je==null?void 0:je.mushboomer_counts)==null?void 0:ce.eth),x((ge=je==null?void 0:je.mushboomer_counts)==null?void 0:ge.sol),g(je==null?void 0:je.referral_code),v(je==null?void 0:je.refcode),w(je==null?void 0:je.whitelist),C(he),N(Ce),re((ye=(Ae=je==null?void 0:je.slots_info)==null?void 0:Ae[s])==null?void 0:ye.total_qty)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),C(""),N(""))}catch(je){console.error("Token verification error:",je),console.error(je.message||"An unknown error occurred.")}},V=async()=>new Sl(window.ethereum).eth.getAccounts(Ce=>Ce),te=async(he="slot",Ce=24,ce=5e3)=>{Ce<=0||(await new Promise(ge=>setTimeout(ge,ce)),await G(),he==="slot"&&ie.current<=n?te(he,Ce-1,ce):r())},ae=async he=>{J("");const Ce=window.localStorage.getItem("hyperToken"),ce=window.localStorage.getItem("hyperAddress");if(!Ce||!o){l(!0);return}L(!0),F(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(ye){console.error("Failed to switch network",ye),F(!1);return}const ge=new Sl(window.ethereum);var Ae=await V();if(Ae.length>0?Ae=Ae[0]:Ae=void 0,Ae){const je=he*.012,Ie=ge.utils.toWei(je.toString(),"ether"),Re={from:Ae,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:Ie};await ge.eth.sendTransaction(Re).then(Qe=>{console.log("txHash :>> ",Qe),F(!1),Q(Qe.transactionHash);const $e=a==="grid_bot"?"bots_extra_slot":s==="lighter"?"lighter_season_2":s==="variational"?"variational":s==="extended"?"extended":s==="pacifica"?"pacifica":s==="paradex"?"paradex":"";fetch("https://dextrabothypev2.nftinit.io/api/hyper/slots_payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:o?o.toLowerCase():ce,token:Ce,payment_tx:Qe.transactionHash,slot_role:$e,slot_qty:Number(I)})}),G(),te("slot")}).catch(Qe=>{console.log(Qe),Qe.code===-32003||Qe.message.includes("insufficient funds")?J("Insufficient funds."):Qe.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await ge.eth.requestAccounts()};return e?i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:!(X<=n),errorFunds:ne,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9001] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>t(!1)}),i.jsx("div",{className:"relative w-[380px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#404040] max-h-[97dvh] overflow-y-auto p-5",children:i.jsxs("div",{className:"flex flex-col w-full gap-4",children:[i.jsx("div",{className:"text-white/90 font-manrope text-[18px] font-semibold leading-4 mx-auto",children:"Get more slots"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Slot Count"}),i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>P(he=>{const Ce=Number(he||0);return Ce>1?String(Ce-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:I,onChange:he=>{const Ce=he.target.value.trim();if(Ce==="")return P("");pe(Ce)&&P(Ce)},onKeyDown:Y,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>P(he=>{const Ce=Number(he||0);return String(Ce+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),I!==""&&!oe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),i.jsxs("div",{className:"text-[13px] text-[#7C7C7C] font-semibold flex items-center gap-1",children:["Total Price:",i.jsxs("span",{className:"bg-[#1E1E1E] text-[#F8D4AB] font-bold px-2 py-[2px] rounded-md border border-[#3A3A3A]",children:[(I*.012).toFixed(3)," ETH"]})]}),i.jsx("div",{onClick:he=>{he.preventDefault(),oe&&ae(I)},className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] min-w-max font-semibold ${oe?"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy"})]})})]})]}):null},zoe=({open:e=!1,setOpen:t=()=>{}})=>{var os,Gs,mi,ns;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);Jr();const[g,v]=m.useState(1),[w,C]=m.useState(0),[N,I]=m.useState(0),[P,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[Q,ne]=m.useState(null),[J,X]=m.useState(!1),[re,pe]=m.useState(!1),[Y,ie]=m.useState(!1),[oe,G]=m.useState("OFF"),[V,te]=m.useState(""),[ae,he]=m.useState(""),[Ce,ce]=m.useState(""),[ge,Ae]=m.useState(""),[ye,je]=m.useState(""),[Ie,Re]=m.useState(""),[Qe,$e]=m.useState(""),[it,tt]=m.useState(""),[ot,ft]=m.useState([]),[ct,Vt]=m.useState(""),[It,an]=m.useState(""),[Nt,mn]=m.useState(""),[dn,Pt]=m.useState("LONG"),[Xe,Ut]=m.useState("STANDARD"),[Lt,qe]=m.useState("STANDARD"),[Ke,pt]=m.useState("MARKET"),[en,Bt]=m.useState(""),[Et,et]=m.useState(""),[Be,Mt]=m.useState(""),[Ve,ut]=m.useState(!1),[xt,jt]=m.useState(!1),[kt,xn]=m.useState(!1),[un,On]=m.useState(!1),[En,jn]=m.useState(""),[bn,Zn]=m.useState(""),[zn,$n]=m.useState(!0),[nr,wn]=m.useState(!1),[on,Oe]=m.useState(!1),[rn,cn]=m.useState(!1),[_t,Yn]=m.useState(!1),[yn,Dt]=m.useState(""),[sn,Tn]=m.useState(!0),[Kn,ir]=m.useState(!1),[rr,Jt]=m.useState("Hour"),[Un,Qn]=m.useState(1),[Rt,Pn]=m.useState("lighter"),[Ee,p]=m.useState(!1),h=m.useRef(null),[S,_]=m.useState(""),[k,T]=m.useState(null),[B,W]=m.useState(""),[ee,de]=m.useState(!1),fe=k?(k==null?void 0:k.getTime())<=Date.now():!1,xe="https://dextrabothypev2.nftinit.io",we="",ke={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI"},Me=["BTC","ETH","SOL"];m.useEffect(()=>{async function Xt(){if(e)try{const rt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_lighter_coins/")).json();if(rt!=null&&rt.coins){let Ft=rt.coins.map(yt=>{const hn=(yt==null?void 0:yt.label)||"",vn=ke[hn]||hn,lr=vn==="XMR"?"https://app.lighter.xyz/assets/xmr-CV8khZ54.png":vn==="NMR"?"https://app.lighter.xyz/assets/nmr-2YIHMk6g.png":vn==="USELESS"?"https://app.lighter.xyz/assets/useless-BTmgr78l.png":vn==="DOLO"?"https://app.lighter.xyz/assets/dolo-DuOVl-Vo.png":vn==="CRO"?"https://app.lighter.xyz/assets/cro-C7lstwu3.png":vn==="FF"?"https://app.lighter.xyz/assets/ff-CvnDhHny.png":vn==="kTOSHI"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAKx0lEQVR4XtVae3BUVxnfzYO8aHFKsptNeOWxm0JpyANoSi1V+0etIiQpHVoSa5niDOp0xsFa/6DTkIBSq9XWjm3zkqL9Q8eZ6h8ELY5TaaSGEUsgVDrkwWAgaKcBCUIhye7n951z7957v3PvPpLNBr6Z39zd8/x+v/Od75y7icuVLHsE3nXVA8SMW944oeniljHueOJxhk85+1YPTTaOzjxuCuNOJRuzZtyR2UZSjU8eA9oH4wPvHxNm3PiEUcBJTRV83KiYEeOTOIA7n2jw+RyRUOOD24A7OtPg89siIcYHtQF3LlngfthiWsYHswF3Ktng/thiysYHsiHurg1CibcCXj0xpjiXTHD/GJo4teimDqKQJ7hrDbg2AATyKhTnkgXupwVxGe/sQP6lngtIPATPtR8GVx3WkwgE/OzPq1QcTAa4v1MTgXfUMH+rdbL7H9wsCLfh52df+zMs8VXISDDh85u+rjg5k8jdqvodnwi8gwl8srLCak2AkBDhzVPXYGfbe2Hy+tbIKtyo9DWjbSCET4Jap9f7PVUQ8FbCQu8acNX0ILoRf4Pblr+otOd+xy4AvWryDg7kCUsLqsUWaB8MCgEIHb1jQoSsLx6zREIqtRsIQsBTAa57/iIIpDwSEgJ1DE2G+xNo7M4BFNhbhe1we9WgqDWHILWmL7zF3PUT4Bfzq35NXQTeMAJ5QmDhSkgRAsgI0NHU/p4Qocy7whIN9JyXW6qVhSwCtQ8Z/XVQGzeSLc67S+YVTzU0tXWH2+Ys2CISL/crqgiOxhtGEWDrnn22AhBIAGM7hCD1oQsKaQ4a0xiD2hrtSYgmHM8cJan39eC2qFL8iiqArQi8QRTyOpwEeGNQOkwipH7hpCQhIMNeJ2c+Qum7WQBqu7b5ktYnBCnYphkjgOpL7wg4hn9MIijGG8QqAK5Mx6CVvIgA2gbt3eC+96/KSkuYVpeIDMjv7ef0fCCFasdc4Fqvt5NlnTQv5oVi752KPxycj70AvFLDnqPqgByU3Dot+zeEq96Nq38I3JS8FOIcknjnsOZwnXzKLYDiogB1nTcsfdJqDop2racnFX84nu9Weaki8AoNfDA7kCOlvgATAInfcyic+CJD7nU9nNuGJHFDgKBY+XD7DSExZ7GvXPHFCZxXQgWgdwF37YQR+q2HxBEnQh9Dd+tvrsB3eiInP7MYe88FRT7Y/qcxzC8AP/lo0lIvREFxynyrFF+cwHnFJEDZd9WB7CDO6lrtO26FAF5YKAIoMb5yImhD0h7maHHXGQmSt9NF2HvG+eLEUfk8KPwMAerhklJRrw7ihJVVtcIp2qu7Ot8X5Pdi2Mp3g0grH6nOCdp2WRfEyxPdC5yPQA7OzxCBF8QpAIFWamHxKmj8xo9FdqYQ7sBs7v6S7rT5qUOSMUM/7ozvMvNbx9A+Yy5oG1J9cQLnl1AByKFSTxEUPtwFz/7soFbGCXNwYrzeCSaBMMeU5ceWCzi/hArgx5eUxd67xdHn+jJ32Ar90lP2rVGRNPUx0jdcM+rDbQ1hqDyrbgxeH56EN86Na+1CMGf9fxV/7GAkPG425OMV4PFvvyiPPnHux7aaBU9eEX31o1MXw0Jeux3KIzIkLlzyUmSdw++J/iMMp22YDfl4BQh4KgX5tHVXFaI6AX3FeB2H3pYwODIaLuPtzO3p+erxy4pfZnDahtmQj1cA1730bo7h70CQnLy9qhUW4TYpzavEfFEFpV56IvAYLcmvhBIvlSEKysXKD41cgoGRi9B/YVR892Nbf75s6y+ogju95XgBq4Bl+eVSBDx1lhZ9VvEt7KOj2ZCPR4BSzwqx+nTt5StlvcHhip6/iKRGYZFnGfarEDj7nzFBVMfRw32Qgu/65jL3o9eh/5zs68f5KOSHP/4fHDlMvw9Y8wTVcx9nTIC2/klt9UkAigDDEXoOofODJiL0mZzXyVPyNBPtef9DOD1y2VKmY/iTq+G+Z7DNIEbIvLVvQ/oDJzQfJPwOr8ectmE25GMVgMJZ/lqDAqyXtz66vq770RWFgBnk/L/HPoVCfIdY4FsOT2/ZDgPnZcib0dr5W5ty+m6Ukag0HvlQ+8QOxcewADYcBZSCGAUIeKvD5MX+ryMBQuLnLk5kSrhwSa54XoVaZ4PBkcjHIednFiDuq3BrfxDy89cZq49IXfMuPrstIZ9s0B9ouK/RBXDYBrG8DNGLj9j7mhABX5XiVDw4LZKkCedHlTaRQOJzHwmRX4YcBCDwgZzw2ofXxBHGHTr10VmlLBKIwBIMe31fi/BHUYZIGCaOPFFU0KnE/eO8Ei4AgWd0HV37uuD8x5GTIke/6bP9lhrFcQ+IsQ/g01w3NPyJ4hvnFbMAzxxUiTqBVkx19KJYubd/8XvhbNebXWqYx41ROIDjiPFM0Ov5Nnjh7yovVYAIInCidmjDpMgd/V2HRtoEus0Z3/c7i2YHzAenTo9A11t/hPLiz8Gj25qhNFfeJPUx+7WLltk3zsee/DQFoD+E0koTId2ZA1p4drz8K3E5KcH9XIIClJguQp0vvaW1swpl/r4fV7uiuEbsbRKazx32AY/l1h+0C7HKCoxXZM7HWQAy3ihGEQb/dRnDcj/QvizxlIsLku5sb0MmHGuYY0GveGZIMVCYLtFXJ38AfvnKr2HTUi9MtmTBxK4sZb5IKM1FofNkIuQ8ZkwAurD8/ORVpfzBr2wThI83pIfJT+zKFBhHYuM/nA/HHs+B41uyRES8s+8PYgWL8QXnys50uNGcBhMtKFSe/fU2GjiPyOTJIvxHNx88FtBvdnK1DeJBJB7aNQfGkdinTSnQ91gqnECBiu5YAb2b06G88C7cUith8vsZEMhfAfeXqsdaLOD+xyYAGW88TRFKfNXwAQnQMgd++sBcFCRDCHJjTwZMClGyoLcxA1Le2QhHHkuHsztuE2XXd2ZD5u6HAVrSlDGjgfsdO3ndeCcN859SJ4uGviczoNizSpA+sikbjjakGVugBQVAHGucIwSA3anhSCEEvKuh2LcKLmyfq4zrhNynVL8TJgCBTxgN9U+3iG0gVzsTfL77wgLQStPnY43p4D6IArwgv0tkQFF+NSzJLId/bs4Av69GGdsO3N/4yevGO09RhJNPYNZvzIRDG28PEw7uJgGMle5FAVwYAeNI2hwBi/F2mXJkM6xdnIvfs5WxObifUyevGx8kThFe/uCiCP1/NEhiHiREz21L54fFIAx9Mx3SvrfcUkY4jn0DuSsxOaaIuqIIpwH3j2EnpxabqQMp4I6YUeS923ICEIm+r9E+z8HVzrGUF3lIHKsAhNSeBgg2ybxhdyfg/thiWsYHswF3SofI+I20+llwA5PdM2vy8XKTJkQZb7aGOw9/K7JEHqHngvnLkkheNz6oDTh5ug3SbS+0OwsTIBLYTIlQywG4n09uSkExsrVkmCPKCCHtOdlCEULIFv2KCyrw0kTRI3MBn98WCTU+uAN0AUq85UKAJfmrYXjHPEGcToJe7Rgk+D0rxarSUUg3vkmHKCjCC9EJPAlCe+Yq8zliRoxPEgF9X5WhzkNZPjNgsWc1Hnsuhezl5+Za3hv0fnz8iJhx4xNGgU6antfxBWcR/QEEr8nBJjXpmcHHiYqkGp98tjFrxh1JNmrhM9yl5BtdNLhjycBNadzJxOMMn/LmNNXx6eGWtwg/ttgiSfZ/z360yWKNq4wAAAAASUVORK5CYII=":vn==="EDEN"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADjElEQVR4Xu2Zy0prMRiFq1ZrFUFwKkJHDi0WZ04E5/o2YhXfRF/AkU4E30AcdCoUiiCCIxXxhpfmsDbksFnpbnP547lkf7CoJ+z8+bNOspOdVFTiVLggNUoDuCA1SgO4IDVKA7ggNUoDuCA1/rgB39/fXPSj/LgBnU5Hra2tqYmJCVWpVNTY2Jianp5WBwcH6uXlhR+PTnQD2u22mpmZUbVaLessOl0kmIJn8Ds5OcmhoiBuAIb05+en2tzcNDroo7m5OW5CFFED+v2+urm5UePj40ZHQoRRMTU1lcWXRsQA/I+D1dVVI3lpgbe3t3zzQYgYADBn6/W6kbC0MBq2t7e5eW+CDMCQxJzHS44TjSmYgJVEgiADACf3U8KI293d5XScCTKg2Ww6v/Cq1Wr2i6UOf+eXRvwbyyXXKRJivL6+clpOeBmAYY8NDSc0TOiozUan1WplJrgYG7Kb9DLg4+MjG4KcSJEeHh6yek9PTxTJRHdmdnY2W/o41iBtbGxQFHu8DFhZWTGSKBKGKAzzodfrGfGK5DsKvAzgxoskwdHRkdVIaDQaXNUK5yy3traMxvPSHzmS7O3tGe2w0K4PzpmOmvtI5P7+nqsFw+0MUrfb5WojcTaAG2VhKXt/f+dqwWC7rUfXMLniXIMbzAtz9e7ujquIofcQRfL5hLY2ANve8/PzkUnEAm/5w8NDoz2WK041lpeXjQZZseH2WK5Y18ActPnai82wUyWflcA6Y0wBbE/RSJEwPWKjOzpIMMcVawP+V0oDuCA1SgO4IDVKA7ggFH1E/q8gboBmZ2eHi7zRx2MxEI2KzRKusvRX2+LiIj9ijb4Fmp+fz2LBBJwVXlxc0JNhiBqAW17eni4sLDh/HuvjLY6lBVOkCDIgf1c3bI8OXV9fF97t5a+6YBbXLZIEwVFw6GnzkaS1tLTEITJOT09/PzPKTP0MpsXz8zOHciLIAJz2cmK20u8JdMLlDiAvmPD4+MhpORFkAObqycmJ1amttGBa0ZRyIcgAzfHxsZFgTEl+dosYAG5vb72Hso0QW68ykohF029yTlxK6Pz+/n7Whu9N0yDEDNBgK3x5eWn1JreVHvK+11/DEDcgz9nZWdYB/ca3lTYPv19fX5liEdUAgOSxuVlfXzeuvfUtE8p0p2HW1dUVh4lGdAP+dkoDuCA1SgO4IDVKA7ggNUoDuCA1SgO4IDWSN+AXxfi0jU1sI9sAAAAASUVORK5CYII=":vn==="AERO"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAGo0lEQVR4XuWbeWwUVRzHF8Ha0oOi4Sw0RoP6HyCUQ0MQEqOBkNQY/4AEY4z/STwS8EqM/5giIkaDicihUI5EoGgQGg0YFFHBSAQ5Qists0dnd2Z2etCWskDn5/u9YY/5vWmb7ry94Jd8spOdmffe9/eu33v71ufLkkUiV+YZqv+IFlZiRsQPbvB77BlTU+bT9wvOolqglgpMi7Afomqglqafl2aElaWCAMnoYWUJzTfnpqv+OlrQTKNH/GtpObJuhhqYTQuWdVgZaLmyYkJBcgwtX8YsGg1W0czzBSwbLa9UY5lsopnmIZtouaWYHhYyymto+T0ZTbxQoDrSMt0l4UKC6hmWGYXR54civTHBDIWmuCRWkKAWqm9Io4kUOlTfoIYLEJrAnQDV6WrRcKCGvningNqoXsHoS/lCVBO/Sweq12FsVbeWvpArTD0I6z5aD+UV1VBaNgXKyqdy8Hv67HBg03od1Z0w+nA2MfUANOzbx0WmCqbQ99KB6uaWjc0MSrsRgvXrPoHiksmCUA46oqwKiqvrYNTMPqhcYIGUkJxppfqzWvs7tm+HktEDiy56pBFGzgIY5UJTs7cuEIfqz4oDWpovuNd22WQomfQKE20JguOMfBzgnpnABkNFSDcdHOI1VXmOPiCTSNsVUTgTfd9DmwesaRRc8STA6g0AX38HsLUBYMt+YOnJcQBqTjhAD8tJ1I0JEx91CC+tnO5a0yj43tkA73wGsO2ALdgNTRXzSAdc5CUcQG/KIBxqdYzmo+9fINR2vJa//FYUGgdrfefBW3CxuR2ihirk44WMOeDM6VOOQY0KL54D8NVeW5yb4O+PxqCzIwy93W0M1QHNywtcvKYp8+kNL+ysr0+IL3rsuEN4zQpRsC3aguYW01VwnJ4e5hCGzO6Kv1b5DFU5Qm94gTd7UuvVz7qL1vWIu+irbdBzTYPrOzaCNaEIoNIHMNZG9xgJOmDafYP9Vjdc/K2X+OgeF4/TVuqAhs376B+9rqKxhvt+awRr3CiHYIohsQVoESUmtf/jPB8XP/UZZx///XS3IJzXcv1GgHJRaAJ278biWWD+fQJ0FjnSPL0i1QHtusLFP/FiUvjuQ7ccwnsYfT/uHVh0hQ+uL1/Kazob+5FSHfDvhRAsfzvZ3O2RPCn85ool7s2bie5s2AW6FhDSzDRSHYBRWrzmTdMp3q3G+6srwDz5S1ZqeiCkOkBjKzWs+audSeHWww84hbMW0P15XU5FpyLVAcFAELq7klOZo7mz60Xl4+2osLQKamoW8VkjmoNmn4rUaRCDFC6+9Yyj1k9NnAPLVvWCqdtT2KpX3+TL4XiojJ+48/PWmvfgctN5vk9A084EqF1qIIT7dn2H9jjEHz3cBL4ZyaAIr+sP6AlnIO1GEE4cPwZvvL4Gpk2bxZ2DYEspLpnEnbPwqSVCfp7BQIgfXqI30gR3a1Kb/ZaGfj4gHvz5Gp8iv9gVZQsgiy+C4oHS6LkWfPqNeXudP3CQI2tTNBVcBshdDCmXEuJjGz4Avz/sCIa2HbAg3IZ9XuEOOXm6DVZ92AWl8ywYMeP2pgcDr6e/EIOPt5pw9lwITOYcRMjPI9JXg9GmswkH9AYu2DMBGwxRcMNP1xPOsD8tOHdRgyiv9VRxtnNwRjl/MQj7GjVYvb4TVr7bLeTnlYQD9EGa3nDAqS3RBcb4nGEvcwQOkij4v8sq7PrhJmzenwyX8XrP4RvwzzmDi7edIqdcbjg2RKRuiSlNSSewT0Nt5eJTndHVESLLWoWPH5dbVDj2ZxfsZs5Bx8QdhJ/YfYS8PODYEkOjD3gBvWuNK0p0h/6qUraMtae27i5xJXi1M8QHOZlr/aFwiJftgDjXXnvZ0RpiyxbyFV1caGd7UGgdCDqp3bADJHw2E46h+jP2wwi2BvOvX8EaOyIZH7DFz42n54IRanEsgFLF4i9FHWaQtw50kj2YiumnhdsPI2jCg5Lh8T8T3bey1l4cpQyYuPPTve59PobEu0umoLoTlqMjr3ybq6NxP/S99Dz0P1hpO2fMbdi1Nb4IYrWLhXfTYcgjtvSFfIA7yeX7dKB6BbvrD0igZWLUzTWoieoc1GgChQ7VN6Td9cfk0LQ74KAkaqC6hmUFfWQunEbTdzMh4QKB6vBkNPG8RlbNUyuEMcFznx/KosE8/stMMMN/mUm1fAqWhh3kyLK7+m9zqZaLI7aDHnnNlWVqU8XBQJsZ+WaaeqVWxjiBO9aYFk2/4IwfxlKVwf8+H8F7yhF+eClL9j+y7eB1y657sQAAAABJRU5ErkJggg==":vn==="MYX"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAL5ElEQVR4nO3db2xV9R3H8ffvtgnX0Qc/266osU0hdPOJGRoTupEpo2aSJUUhEnyAkYypLItLfGR8NJ9sxj1zmRMFjPzZhGAitJP5YE7GEgOLMSwsUYFJLYTwp2U/lxJr0vLbg/ZCqe3pvb3nnt85535ej1ruued+H/DO75zbc881BGRt821QuA9YBr4LQyeeNoxpBZqAYsj5JCl+DIwDHPjzeAYw5gSeT8EfdW54KNRkJskXs7bVYliJpxfDSmBJkq8vmXUa748A70DhsHOXR5J64ZoHYq1thIbVGB4HswatClIVPwocwrPNueH3av1qNQvE2lYLfguGzWCW1up1pJ75AeBl/PhW59xoLV4h9kCstUVofB7DLwEb9/5FvslfAF6qRSixBmJt80ZM4UXgzjj3K1IefwHvn3Xuyt649hhLILa5tZNrfgfGrIpjfyJV8f4IBfOEuzI0UO2uCtXuwNrmTXhOKA5JDWPux/tPrG3ZVPWu5vtEa20R0/AKmJ9WO4RI7fhd+PGn53tuMq9ArG25DXgXY+6dz/NFEuX9h2A2ODd0rtKnVhyIta2dwAcYOit9rkhAAxh+VOl5SUXnILb523dh+IfikAzqxPOBbW65q5Inlb2CaOWQnDiH4YflriRlBWJt851Q0MoheTGA9993bvjCXBvOeYg18Zdxs09xSI50gnl34v92tLnPQUzDaxjzgzimEkkNw72Yxlfm2qwh6kFrmzdhCr+KbyqRVLmnWLzli9HRr47PtsGs5yDWtnZi/CdgdHm65NkIhrtnO2mPOMTyOxWH1IEmrrFjtgdnDMTa5scw5v7azSSSIoZV1rZsnPmhaSavsfoCTFvtJxNJjXP4sa7p12x9cwUxDVsUh9ShO6Hx+en/eNMKotVD6pzDs9i5IVf6h5tXEK0eUt8m7qMwxc0ryK0tX4DpSHYmkVT5HD/2XefcGExZQaxtWa04RFgCjatLv0w9xHoywDAi6WP849d/BLDWNmEaLusPgyIAfhRvbnduyE2uIA0rFYdIiSlO3hr3+iHW2nDDiKSQ971QCmSyFhGZNNmEsbalFWMuBx5HJH38tdsLQHfoOUTSqXBfAWMqusuDSP3wywp4f3foMURSqqsAuhmDyIwMnQXgjtBziKSSp62AMfqSG5GZGFoL4BWIyMyaCmAaQ08hkk6mWPUX6IjkmQIRiaBARCIoEJEICkQkggIRiaBARCIoEJEICkQkggIRiaBARCIoEJEICkQkggIRiaBARCIE/yxIR3s7/f0H6OjI1o3lR0ausn79Bo4eOxZ6lDlt2fIUL/7m16HHqNhf33+fjRuf4Ouvvw42Q/AVZPDsWXp7H2FwcDD0KBVpalrI/v376F6+PPQokRRHdYIHAoqkVhRH9Yy9tdWHHqJEh1vxWbduLTu2vx56jIqlKQ5IyQpSopUkHmvW9PLa1j+EHqNiaYsDUhYIZD+SZcu+F3SONWt62bH9dRobg7//UpE0xgEpDASyHcnet/5EV9fSIK+vOOKXykAgu5EsWtRGf9/BxCNRHLWR2kBAkZRLcdROqgMBRTIXxVFbqQ8EFMlsFEftZSIQUCTTKY5kZCYQUCQlWY3j6NGjbNq0OTNxQMYCAUWS5TgeXf8YV69eDT1KRTIXCExE8sjaR7l48VLoUSpSbSSKI3mZDATgzJkz9K55uG4iURxhZDYQgFOnTtdFJIojnEwHAtmOZN26tXNupzjCStXl7tXo6lpKf99BFi1qCz1KWQ4e7GPzz55ifHx81m16elaxZ/dOisVigpNVLy9xQA5WkJIsrSSKIztyEwhkIxLFkS25CgTSHYniyJ7cBQLpjERxZFMuA4F0RaI4sis372LNpqtraVlvp9bK1ZGrvLr1NcWRUbkPJO0UR7rl9hArC7Iax4kTJ+oiDlAgwWQ1jpMnT9VNHKBAgshyHL1rHuHSpfBvfCRFgSRMcWSLAkmQ4sgeBZIQxZFNCiQBiiO7FEiNKY5sUyA1pDiyT4HUiOLIBwVSA4ojPxRIzBRHviiQGCmO/FEgMVEc+aRAYqA48kuBVCmrcQwODiqOMiiQKmQ6jl7FUQ4FMk9Zj2Pw7NnQo2SCApkHxVE/FEiFFEd9USAVUBz1R4GUacWKFYqjDimQMnQvX87et/6oOOqQAplD9/Ll7N+/j6amhaFHqYjiiIcCiaA4RIHMQnEIKJAZKQ4pUSDTKA6ZSoFMoThkOgUySXHITBQIikNmV/eBKA6JUteBKA6ZS90GojikHHUZiOKQctVdIIpDKlFXgXR1LWXPnp2KQ8pWN4F0dS2lv+8gLS0toUepiOIIqzH0AEkoxbFoUVvoUSpSThxtbW309KxKcKob+vr6c/9lnrn/nvS8x9Hfd4DvfKcrwcluqIfvSs/1IZbiqK3u7m7e3r+XhQuzdU5XidwGojiSkfdIchmI4khWniPJXSCKI4y8RpKrQPIcx8KFC1MbR0keI8lNIFmN4+LFSzy6fsOccby9f1+q4yjJWyS5CCTLcfSueZhTp05Hbrdn9y66u5cnNFX18hRJ5gPJexwA27ZvZ2xsLIGp4pOXSDIdSD3EAXDo0F/YvPkpRRJAZgOplzhK+vr7FUkAmQxk8eLFdRVHiSJJXuYCaW9v58A7b9ddHCWKJFmZCqS9vZ0/9x+go6Mj9CgViSuOEkWSnMwEojhuluVI3nzzDRYsWBB6lLJkIhDFMbOsRvJgzyr27NmViUhSH4jiiKZIaivVgSiO8iiS2kltIIqjMoqkNlIZiOKYH0USv9QFktU4RkZGgsZRokjilapAshzH+vUbgsdRokjik5pAsh7H0WP/DD3KTRRJPBqKt3zrhdBDKI7a+OzkSYYuD/HQQz8OPUpFlixZzLJ7ltHX18/4+HjQWYIHojhq6/jxf/Hll1/yYE9P6FEqkpZIcn/jOJFqpOYcRCSNFIhIBAUiEkGBiERQICIRFIhIBAUiEkGBiERQICIRFIhIBAUiEkGBiERQICIRFIhIBAUiEqEAjIYeQiSlxgrASOgpRNLJuwLeXwk9hkgqefO/AnAh9BwiqWT8uQIwEHoOkVTyDBTAnAo9h0gqGXOiAP546DlEUsnzaQH8R6HnEEknf7Tg3JULeD4PPYpIqnh/2rnhodJf0g+HnEUkhY7AjUtN+gMOIpJC5h24EchhdMmJyCQ/CuYwTAbi3JDD+76gM4mkxyHnLo/AzVfz7g40jEi6eLaVfjSlH6y1jdDwGcYsCTOVSAp4P+Dc8OLSr9dXEOfcGNwoR6ROvTz1FzP1F2tbLXAGg010JJE08P4CjC92zl1/w+qmTxQ6N+SA3yU+mEg6vDQ1Dpi2ggBYa4vQ8B+MuSO5uUQCm2H1gBk+kz6xgX8uuclE0sA/Oz0OmGEFKbG25X2MWVXboURSwPsjzg0/MNNDEXc1MZvR59Ul9/woBfPEbI/OGohzQwP4a8/UZiiRlPD83F0ZGpjt4Yao546OfnW8WLylA2PuiX0wkeD8LueGX4jaoowbx43/Au8/jmkikXTw/kP8+NNzbTbrSfpU1rbcBuYYho7qJxMJbhDPCueGzs21YVm3HnVu+ALwAN6fr3o0kbAGMTxQThxQwb15nRsaoFDowTM4/9lEQvLnMeahqJPy6co6xJrK2tZO4O863JKMmVg5KogD5nF3d+eGBuDaCrz/sNLnigTh/cd4v7zSOGCeX3/g3JVzMN6D97vm83yR5Pg3YHzF5Hl0xSo+xJrO2uZNGPMqmGK1+xKJ0QjeP+Pc8JvV7KTqQKB0XuJ3Ysz9cexPpCre/w3M5onTgerEEkiJtc2PgXkZY9ri3K9Iefx5PM85N7wnrj1GXmpSqdHRr/5dLC74PZhh4F6MWRjn/kVm5HHAb2F8vXP/jfWqj1hXkKkmP3i1BXgWY/SWsMTP+8+BbWC2Tn4aNnY1C2Qqa1tWA09i+IlO5qVKo5P3cNsN4+9N3mykZhIJpMRa2wQNK4G1wErdYkjKMnFz9cNM3CL3cK1Wi5kkGsh01ra0At1g7gJ/N9AJ3AHGYrwF0xhyPknMKJ4R8EPAJWBg4oud/HHwHzl3JdjXBP4fQFHoFHnhJJwAAAAASUVORK5CYII=":vn==="CC"?"https://app.lighter.xyz/assets/cc-D4WHZ-w6.png":`https://app.hyperliquid.xyz/coins/${vn}.svg`;return{...yt,icon:lr}});Rt==="variational"&&oe==="ON"&&(Ft=Ft.filter(yt=>Me.includes(yt.label))),ft(Ft)}}catch(ue){console.error("Failed to fetch coin list:",ue)}}Xt()},[e,Rt,oe]);const Ye=Xt=>{var ue;return((ue=ot==null?void 0:ot.find(rt=>rt.value===Xt))==null?void 0:ue.maxLeverage)??100},Fe=Xt=>{["e","E","+","-"].includes(Xt.key)&&Xt.preventDefault()},st=Xt=>/^\d*\.?\d{0,6}$/.test(Xt),se=Xt=>/^\d*$/.test(Xt),Se=m.useMemo(()=>{if(It==="")return!1;const Xt=Number(It);return Number.isInteger(Xt)&&Xt>=1&&Xt<=180},[It]),De=m.useMemo(()=>{if(Nt==="")return!1;const Xt=Number(Nt),ue=Ye(it);return Number.isInteger(Xt)&&Xt>=1&&Xt<=ue},[Nt,it,ot]),Le=m.useMemo(()=>{if(en==="")return!1;const Xt=Number(en);return Number.isNaN(Xt)?!1:Xt===0?!0:Xt>=1&&Xt<=1e7},[en]),_e=m.useMemo(()=>{if(Et==="")return!1;const Xt=Number(Et);if(Number.isNaN(Xt))return!1;const ue=Nt===""?null:Number(Nt),rt=ue?ue*100-1:4999;return Xt===0?!0:Xt>0&&Xt<1?!1:Xt>=1&&Xt<=rt},[Et,Nt]);m.useMemo(()=>{if(Be==="")return!1;const Xt=Number(Be);return!Number.isNaN(Xt)&&Xt>0&&Xt<=100},[Be]);const nt=re&&ye.trim()!==""&&V.trim()!==""&&Ce.trim()!==""&&it!==""&&Se&&De&&ct&&(!en||Le)&&(!Et||_e)&&(dn==="LONG"||dn==="SHORT"||dn==="RANDOM")&&(Ke==="LIMIT"||Ke==="MARKET"||Ke==="RANDOM")&&sn,lt=re&&V.trim()!==""&&Ce.trim()!==""&&ye.trim()!==""&&(Rt!=="lighter"||ae.trim()!=="")&&(Rt!=="lighter"||ge.trim()!=="")&&(Rt!=="lighter"||Ie.trim()!=="")&&(Rt!=="lighter"||V.trim()!==ae.trim())&&(Rt!=="lighter"||Ce.trim()!==ge.trim())&&(Rt!=="lighter"||ye.trim().toLowerCase()!==Ie.trim().toLowerCase())&&it!==""&&Se&&De&&ct&&(Rt!=="variational"||S.trim()!=="")&&(Rt!=="variational"||!B)&&(Rt!=="variational"||!fe)&&sn;m.useEffect(()=>{if(oe==="ON"&&Rt==="lighter"){if(Ce&&ge&&Ce.trim()===ge.trim()){jn("Make sure the wallet API indexes are unique for each Slot.");return}if(ye&&Ie&&ye.trim().toLowerCase()===Ie.trim().toLowerCase()){jn("Make sure both the Lighter wallet addresses are unique for each Slot.");return}if(V&&ae&&V.trim()===ae.trim()){jn("Please create an API key for each wallet.");return}jn("")}else jn("")},[oe,Ce,ge,V,ae,ye,Ie]);const bt=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Zt=()=>`lighterCreds:${bt()}`,Ge=()=>{try{const Xt=localStorage.getItem(Zt());if(!Xt)return;const ue=JSON.parse(Xt);ue.apiKey&&te(ue.apiKey),ue.apiKeyTwo&&he(ue.apiKeyTwo),ue.apiKeyIndex&&ce(ue.apiKeyIndex),ue.apiKeyIndexTwo&&Ae(ue.apiKeyIndexTwo),ue.lighterLoginAddress&&je(ue.lighterLoginAddress),ue.lighterLoginAddressTwo&&Re(ue.lighterLoginAddressTwo),typeof ue.remember=="boolean"&&$n(ue.remember)}catch{}},Je=()=>{if(zn)try{localStorage.setItem(Zt(),JSON.stringify({apiKey:V,apiKeyIndex:Ce,lighterLoginAddress:ye,remember:!0}))}catch{}},We=()=>{try{localStorage.removeItem(Zt())}catch{}};m.useEffect(()=>{if(!e)return;const Xt=localStorage.getItem("hyperToken"),ue=localStorage.getItem("hyperAddress");pe(!!(Xt&&ue));const rt=setInterval(()=>{const Ft=localStorage.getItem("hyperToken"),yt=localStorage.getItem("hyperAddress");pe(!!(Ft&&yt))},800);return()=>clearInterval(rt)},[e]),m.useEffect(()=>{!e||!re||(wt(),Kr())},[e,re]),m.useEffect(()=>{e&&(Et===""&&et(we),en===""&&Bt(we),Be===""&&Mt(we))},[e]),m.useEffect(()=>{if(!it)return;const Xt=Ye(it),ue=Number(Nt);!Number.isNaN(ue)&&ue>Xt&&mn(String(Xt)),!Number.isNaN(ue)&&ue<1&&Nt!==""&&mn("1")},[it]),m.useEffect(()=>{e&&(zn&&Je(),zn||We())},[V,Ce,ye,Qe,zn,e]);async function wt(){var Xt,ue,rt,Ft,yt,hn,vn,lr,Nr,fr,cr,ts,is,Or,hr,Jn;try{jt(!0),jn("");const vs=window.localStorage.getItem("hyperToken"),si=window.localStorage.getItem("hyperAddress");if(!vs||!si){ie(!1),Ge();return}const Er=await(await fetch(`${xe}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:si.toLowerCase(),token:vs})})).json();if(!(Er!=null&&Er.success)){if(console.warn("INFO API RESPONSE:",Er==null?void 0:Er.error_message),(Er==null?void 0:Er.error_message)==="You have not a running process"){const Sn=ct?ct.toLowerCase().replace("-","_"):null,Mn=L==null?void 0:L[Sn];if(Sn&&Mn){const at={...L,[Sn]:{...Mn,isStop:!0}};z(at);const er=Object.keys(at).filter(qn=>qn.startsWith("lighter"));if(er.length>0&&!ct){const Ar=er.sort((Zr,Fs)=>{var Hn,zr;const St=parseInt(((Hn=Zr.match(/\d+/))==null?void 0:Hn[0])||0,10),sr=parseInt(((zr=Fs.match(/\d+/))==null?void 0:zr[0])||0,10);return St-sr})[0].match(/\d+/);Ar&&Vt(`Lighter-${Ar[0]}`)}}else Vt("Lighter-1")}Er!=null&&Er.slots_info&&(I((ue=(Xt=Er==null?void 0:Er.slots_info)==null?void 0:Xt.lighter)==null?void 0:ue.total_qty),C((Ft=(rt=Er==null?void 0:Er.slots_info)==null?void 0:rt.lighter)==null?void 0:Ft.active_qty),U((hn=(yt=Er==null?void 0:Er.slots_info)==null?void 0:yt.variational)==null?void 0:hn.total_qty),R((lr=(vn=Er==null?void 0:Er.slots_info)==null?void 0:vn.variational)==null?void 0:lr.active_qty));return}if(Er!=null&&Er.success&&(Er!=null&&Er.data)){const Sn=ct?ct.toLowerCase().replace("-","_"):null,Mn=L==null?void 0:L[Sn],at=Er.data||{};Sn&&!at[Sn]&&Mn&&(at[Sn]={...Mn,isStop:!0}),z(at);const er=Object.keys(at).filter(qn=>qn.startsWith("lighter"));if(er.length>0&&!ct){const Ar=er.sort((Zr,Fs)=>{var Hn,zr;const St=parseInt(((Hn=Zr.match(/\d+/))==null?void 0:Hn[0])||0,10),sr=parseInt(((zr=Fs.match(/\d+/))==null?void 0:zr[0])||0,10);return St-sr})[0].match(/\d+/);Ar&&Vt(`Lighter-${Ar[0]}`)}Er!=null&&Er.slots_info&&(I((fr=(Nr=Er==null?void 0:Er.slots_info)==null?void 0:Nr.lighter)==null?void 0:fr.total_qty),C((ts=(cr=Er==null?void 0:Er.slots_info)==null?void 0:cr.lighter)==null?void 0:ts.active_qty),U((Or=(is=Er==null?void 0:Er.slots_info)==null?void 0:is.variational)==null?void 0:Or.total_qty),R((Jn=(hr=Er==null?void 0:Er.slots_info)==null?void 0:hr.variational)==null?void 0:Jn.active_qty))}}catch{ie(!1),Ge(),G("OFF"),X(!1)}finally{jt(!1)}}const At=m.useMemo(()=>ct?ct.toLowerCase().replace("-","_"):"",[ct]),Gt=!!((os=L==null?void 0:L[At])!=null&&os.delta)&&!!((Gs=L==null?void 0:L[At])!=null&&Gs.from_slot),fn=Gt?`lighter_${(mi=L==null?void 0:L[At])==null?void 0:mi.from_slot}`:At;m.useEffect(()=>{var rt,Ft,yt,hn,vn,lr,Nr,fr,cr,ts,is,Or,hr,Jn,vs,si,ni,Er,Sn,Mn;if(!ct||!L)return;const Xt=fn,ue=L==null?void 0:L[Xt];if(!ue){te(""),he(""),ce(""),Ae(""),je(""),Re(""),tt(""),an(""),mn(""),Pt("LONG"),pt("MARKET"),ie(!1),G("OFF"),X(!1),Jt("Hour"),Bt(""),et(""),_(""),Pn("lighter"),T(null);return}if(ue!=null&&ue.farming_params){ue!=null&&ue.isStop?ie(!1):ie(!0),G("OFF"),X(!1);const at=ue.farming_params,zt=(ue==null?void 0:ue.lighter_api_pkey)??"",er=(ue==null?void 0:ue.lighter_login_address)??"",qn=(ue==null?void 0:ue.lighter_api_index)??"",kr=(ue==null?void 0:ue.slot_number)??"";zt&&te(String(zt)),er&&je(String(er)),qn&&ce(String(qn)),kr&&!Gt&&Vt(`Lighter-${kr}`),at!=null&&at.cycleSeconds&&Jt((at==null?void 0:at.cycleSeconds)===86400?"Day":"Hour"),at!=null&&at.coin&&tt(String(at.coin)),(at==null?void 0:at.orderPerHour)!=null&&an(String(at.orderPerHour)),(at==null?void 0:at.leverage)!=null&&mn(String(at.leverage)),at!=null&&at.direction&&Pt(String(at.direction).toUpperCase()==="SHORT"?"SHORT":String(at.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),at!=null&&at.orderType&&pt(String(at.orderType).toUpperCase()==="MARKET"?"MARKET":String(at.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),at!=null&&at.accountType&&Qn(at.accountType==="standart"?1:2),at!=null&&at.accountType&&Ut(at.accountType==="standart"?"STANDARD":"PREMIUM"),(at==null?void 0:at.tp)!=null&&Bt(String(at.tp)),(at==null?void 0:at.sl)!=null&&et(String(at.sl)),(at==null?void 0:at.spread)!=null&&Mt(String(at.spread))}else if(ue!=null&&ue.source_params){ue!=null&&ue.isStop?ie(!1):ie(!0),G("ON"),X(!1);const at=((rt=ue==null?void 0:ue.source_params)==null?void 0:rt.api_pkey)??"",zt=((Ft=ue==null?void 0:ue.source_params)==null?void 0:Ft.login_wallet)??"",er=((yt=ue==null?void 0:ue.source_params)==null?void 0:yt.api_index)??"",qn=((hn=ue==null?void 0:ue.target_params)==null?void 0:hn.api_pkey)??"",kr=((vn=ue==null?void 0:ue.target_params)==null?void 0:vn.login_wallet)??"",Ar=((lr=ue==null?void 0:ue.target_params)==null?void 0:lr.api_index)??"",Zr=(ue==null?void 0:ue.slot_number)??"";Zr&&!Gt&&Vt(`Lighter-${Zr}`),at&&te(String(at)),qn&&he(String(qn)),zt&&je(String(zt)),kr&&Re(String(kr)),er&&ce(String(er)),Ar&&Ae(String(Ar)),(Nr=ue==null?void 0:ue.source_params)!=null&&Nr.coin&&tt(String((fr=ue==null?void 0:ue.source_params)==null?void 0:fr.coin)),((cr=ue==null?void 0:ue.source_params)==null?void 0:cr.orderPerHour)!=null&&an(String((ts=ue==null?void 0:ue.source_params)==null?void 0:ts.orderPerHour)),((is=ue==null?void 0:ue.source_params)==null?void 0:is.leverage)!=null&&mn(String((Or=ue==null?void 0:ue.source_params)==null?void 0:Or.leverage)),(hr=ue==null?void 0:ue.source_params)!=null&&hr.accountType&&Qn(((Jn=ue==null?void 0:ue.source_params)==null?void 0:Jn.accountType)==="standart"?1:2),(vs=ue==null?void 0:ue.source_params)!=null&&vs.accountType&&Ut(((si=ue==null?void 0:ue.source_params)==null?void 0:si.accountType)==="standart"?"STANDARD":"PREMIUM"),(ni=ue==null?void 0:ue.target_params)!=null&&ni.accountType&&qe(((Er=ue==null?void 0:ue.target_params)==null?void 0:Er.accountType)==="standart"?"STANDARD":"PREMIUM"),ue!=null&&ue.target_app&&Pn((ue==null?void 0:ue.target_app)==="lighter"?"lighter":"variational"),(Sn=ue==null?void 0:ue.target_params)!=null&&Sn.vr_token&&_((Mn=ue==null?void 0:ue.target_params)==null?void 0:Mn.vr_token)}else ie(!1),G("OFF"),X(!1)},[ct,L,Gt,fn]);const Rn=Xt=>{var ue;return Number(((ue=String(Xt||"").match(/\d+/))==null?void 0:ue[0])||0)},An=Xt=>(Xt||"").toLowerCase().replace("-","_"),pr=m.useMemo(()=>{const Xt=L==null?void 0:L[An(ct)];if(Xt!=null&&Xt.delta&&(Xt!=null&&Xt.from_slot))return Number(Xt.from_slot);const ue=Number(Xt==null?void 0:Xt.slot_number);return Number.isFinite(ue)?ue:Rn(ct)},[ct,L]),mt=m.useMemo(()=>{const Xt=Number(g)||0,ue=Array.from({length:Xt},()=>({used:!1,kind:null})),rt=L||{};for(const[Ft,yt]of Object.entries(rt)){if(!Ft.startsWith("lighter_"))continue;const hn=Rn(Ft)-1;hn<0||hn>=Xt||((yt==null?void 0:yt.isStop)===!0?ue[hn]={used:!1,kind:null}:yt!=null&&yt.source_params?ue[hn]={used:!0,kind:"delta-src"}:yt!=null&&yt.target_params||yt!=null&&yt.delta?ue[hn]={used:!0,kind:"delta-shadow"}:yt!=null&&yt.farming_params?ue[hn]={used:!0,kind:"single"}:ue[hn]={used:!0,kind:"unknown"})}return ue},[L,g]),qt=m.useMemo(()=>mt.map((Xt,ue)=>Xt.used&&Xt.kind!=="delta-src-inferred"?`Lighter-${ue+1}`:null).filter(Boolean),[mt]);m.useMemo(()=>mt.filter(Xt=>!Xt.used).length,[mt]);async function Qt(){if(!re){n(!0);return}if(nt)try{xn(!0),jn("");const Xt=window.localStorage.getItem("hyperToken"),ue=window.localStorage.getItem("hyperAddress");if(!Xt||!ue){n(!0);return}const rt={coin:it,orderPerHour:Number(It),leverage:Number(Nt),direction:dn,orderType:Ke,tp:Number(en),sl:Number(Et),cycleSeconds:rr==="Hour"?3600:86400},Ft={address:ue.toLowerCase(),token:Xt,api_pkey:V,api_index:Number(Ce),login_wallet:ye,slot_number:Number(ct==null?void 0:ct.replace("Lighter-","")),farming_params:rt},hn=await(await fetch(`${xe}/api/hyper/lighter_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ft)})).json();hn!=null&&hn.success?(ie(!0),wt(),zn&&Je()):jn((hn==null?void 0:hn.error_message)||"Start failed.")}catch(Xt){jn(Xt.message||"An error occurred while saving.")}finally{xn(!1)}}async function In(){var ue;const Xt=Rn(ct)-1;if(Xt<0){jn("Please select a slot."),xn(!1);return}if((ue=mt[Xt])!=null&&ue.used){jn("Selected slot is already in use."),xn(!1);return}if(!re){n(!0);return}if(lt)try{xn(!0),jn("");const rt=window.localStorage.getItem("hyperToken"),Ft=window.localStorage.getItem("hyperAddress");if(!rt||!Ft){n(!0);return}const yt={api_pkey:V,api_index:Ce,login_wallet:ye,coin:it,orderPerHour:Number(It),leverage:Number(Nt)},hn={...Rt==="lighter"&&{api_pkey:ae,api_index:ge,login_wallet:Ie},coin:it==null?void 0:it.replace("USDT",""),orderPerHour:Number(It),leverage:Number(Nt),...Rt==="variational"&&{vr_token:S}},vn={address:Ft.toLowerCase(),token:rt,slot_number:Number(ct==null?void 0:ct.replace("Lighter-","")),source_app:"lighter",source_params:yt,target_app:Rt==="lighter"?"lighter":"variational_delta",target_params:hn},Nr=await(await fetch(`${xe}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(vn)})).json();Nr!=null&&Nr.success?(ie(!0),wt(),zn&&Je()):jn((Nr==null?void 0:Nr.error_message)||fallback)}catch(rt){jn(rt.message||"An error occurred while saving.")}finally{xn(!1)}}async function or(){if(!re){n(!0);return}try{On(!0),jn("");const Xt=window.localStorage.getItem("hyperToken"),ue=window.localStorage.getItem("hyperAddress");if(!Xt||!ue){n(!0);return}const Ft=await(await fetch(`${xe}/api/hyper/lighter_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ue.toLowerCase(),token:Xt,slot_number:pr})})).json();Ft!=null&&Ft.success?(ie(!1),wt()):jn((Ft==null?void 0:Ft.error_message)||"Stop failed.")}catch(Xt){jn(Xt.message||"An error occurred while stopping.")}finally{On(!1)}}async function Wn(){if(!re){n(!0);return}try{On(!0),jn("");const Xt=window.localStorage.getItem("hyperToken"),ue=window.localStorage.getItem("hyperAddress");if(!Xt||!ue){n(!0);return}const Ft=await(await fetch(`${xe}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ue.toLowerCase(),token:Xt,source_app:"lighter",target_app:Rt==="lighter"?"lighter":"variational_delta",slot_number:pr})})).json();Ft!=null&&Ft.success?(ie(!1),wt()):jn((Ft==null?void 0:Ft.error_message)||"Stop failed.")}catch(Xt){jn(Xt.message||"An error occurred while stopping.")}finally{On(!1)}}const Vn=Xt=>{Pn(Xt??"lighter"),p(!1)},gr=[{value:"lighter",label:"Lighter"},{value:"variational",label:"Variational"}];function Ir(Xt){try{const ue=Xt.split(".");if(ue.length!==3)throw new Error("Invalid JWT format");const Ft=ue[1].replace(/-/g,"+").replace(/_/g,"/"),yt=decodeURIComponent(atob(Ft).split("").map(hn=>"%"+("00"+hn.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(yt)}catch{return null}}const Fr={control:(Xt,ue)=>({...Xt,backgroundColor:"#242424",borderColor:ue.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center",minWidth:"max-content"}),valueContainer:Xt=>({...Xt,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Xt=>({...Xt,height:32}),input:Xt=>({...Xt,color:"#FFFFFF",margin:0,padding:0}),singleValue:Xt=>({...Xt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Xt=>({...Xt,color:"#7F7F7F",fontSize:"12px"}),menu:Xt=>({...Xt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Xt=>({...Xt,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Xt,ue)=>({...Xt,backgroundColor:ue.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Xt=>({...Xt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Xt=>({...Xt,backgroundColor:"#353535"})},Lr=({max:Xt})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Xt,"x"]}),Ht=Xt=>{var ue,rt,Ft;return i.jsx(Ca.Option,{...Xt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(ue=Xt.data)!=null&&ue.icon?i.jsx("img",{src:Xt.data.icon,alt:Xt.data.label,className:`${((rt=Xt.data)==null?void 0:rt.label)==="XRP"||((Ft=Xt.data)==null?void 0:Ft.label)==="MEGA"?"bg-[#4F4F4F] rounded-full":""} w-4 h-4 rounded-[4px]`,onError:yt=>yt.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Xt.data.label}),i.jsx(Lr,{max:Xt.data.maxLeverage})]})})},nn=Xt=>{var ue,rt,Ft;return i.jsx(Ca.SingleValue,{...Xt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(ue=Xt.data)!=null&&ue.icon?i.jsx("img",{src:Xt.data.icon,alt:Xt.data.label,className:`${((rt=Xt.data)==null?void 0:rt.label)==="XRP"||((Ft=Xt.data)==null?void 0:Ft.label)==="MEGA"?"bg-[#4F4F4F] rounded-full":""} w-4 h-4 rounded-[4px]`,onError:yt=>yt.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Xt.data.label}),i.jsx(Lr,{max:Xt.data.maxLeverage})]})})},Sr=Xt=>{const ue=qt.includes(Xt.data.value);return i.jsx(Ca.Option,{...Xt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Xt.data.label}),ue&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},Br=Xt=>i.jsx(Ca.SingleValue,{...Xt,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Xt.data.label})})}),Kr=async()=>{var rt,Ft,yt,hn,vn,lr,Nr,fr;const Xt=window.localStorage.getItem("hyperToken"),ue=window.localStorage.getItem("hyperAddress");if(!(!Xt||!ue))try{ut(!0);const cr=await ji(ue.toLowerCase(),Xt);cr!=null&&cr.success?(r(cr==null?void 0:cr.telegram_chat_id),s(cr==null?void 0:cr.subscriber_role),a(cr==null?void 0:cr.subs_expire_day),o((rt=cr==null?void 0:cr.mushboomer_counts)==null?void 0:rt.eth),l((Ft=cr==null?void 0:cr.mushboomer_counts)==null?void 0:Ft.sol),c(cr==null?void 0:cr.referral_code),u(cr==null?void 0:cr.refcode),d(cr==null?void 0:cr.whitelist),f(Xt),x(ue),Tn(!0),v((hn=(yt=cr==null?void 0:cr.slots_info)==null?void 0:yt.lighter)==null?void 0:hn.total_qty),I((lr=(vn=cr==null?void 0:cr.slots_info)==null?void 0:vn.lighter)==null?void 0:lr.total_qty),C((fr=(Nr=cr==null?void 0:cr.slots_info)==null?void 0:Nr.lighter)==null?void 0:fr.active_qty),ut(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),ut(!1))}catch(cr){console.error("Token verification error:",cr),console.error(cr.message||"An unknown error occurred."),ut(!1)}},As=ot,ms=m.useMemo(()=>Array.from({length:g},(Xt,ue)=>({value:`Lighter-${ue+1}`,label:`Lighter-${ue+1}`})),[g]);if(!e)return null;const vr=xt||kt||un||Ve,Yr=Y&&!un,vi=Ye(it),_r=P===F;return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:_t,setOpen:Yn,transactionHash:yn,transactionLoading:rn,paymentPresaleRole:sn,errorFunds:bn,activeMethod:2}),i.jsx(p5,{open:Kn,setOpen:ir,paymentLighterRole:sn,oldSlotCount:Q,checkAccountLighter:Kr,tradeMarket:"lighter"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!vr&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(Xf,{className:"w-6 h-6 text-[#fff]"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#fff]",children:"Lighter"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] mt-[1px]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Lighter Farming module lets you set up automated farming by providing your API Key, selecting a pair, defining orders per hour, leverage, direction, and TP/SL/Spread percentages."}),i.jsxs("div",{className:"flex flex-col items- justify-start gap-1 relative",children:[i.jsx("div",{className:"absolute -top-12 right-0 text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/lighter-farming-module","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:o5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})}),i.jsxs("div",{onClick:()=>window.open("https://youtu.be/_TxVAzKU5LE","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})]})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[En&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:En==="Get more slots to run Delta Neutral with Variational"?i.jsxs(i.Fragment,{children:[i.jsx("span",{children:En}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self")},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]}):i.jsx("span",{children:En})}),re&&sn&&N===w&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:`No free Lighter slots. All ${(ms==null?void 0:ms.length)||N} in use.`}),re&&_r&&Rt==="variational"&&!Y&&oe==="ON"&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:i.jsxs(i.Fragment,{children:[i.jsx("span",{children:'"No Variational slots available. Purchase Variational slot."'}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self"),t(!1)},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]})}),J&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"You cannot use this area because the delta socket is active in another slot."}),re&&sn&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(r5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[w||0,"/",ms.length]})]})]}),i.jsx(Cl,{styles:Fr,components:{Option:Sr,SingleValue:Br},options:ms,value:ms.find(Xt=>Xt.value===ct)||null,onChange:Xt=>Vt((Xt==null?void 0:Xt.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:"py-1 space-y-3 px-3 sm:px-5",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[oe==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"}),i.jsx("span",{className:"rounded-md w-max text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] bg-[#353535] px-2 h-6 flex items-center",children:"Lighter"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Lighter Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Xt=>je(Xt.target.value),autoComplete:"off",placeholder:"1st Lighter Wallet Address ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/lighter-farming-module",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Xt=>te(Xt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:nr?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr}),i.jsx("button",{type:"button",onClick:()=>wn(Xt=>!Xt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:vr||Yr,children:nr?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ce,onChange:Xt=>{const ue=Xt.target.value.trim();if(ue==="")return ce("");se(ue)&&ce(ue)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ce===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Lighter Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Xt=>je(Xt.target.value),autoComplete:"off",placeholder:"Lighter Wallet Address ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/lighter-farming-module",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Xt=>te(Xt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:nr?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr}),i.jsx("button",{type:"button",onClick:()=>wn(Xt=>!Xt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:vr||Yr,children:nr?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),oe==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"}),i.jsx("div",{children:i.jsxs("div",{ref:h,className:"relative w-[120px]",children:[i.jsxs("div",{className:`${vr||Yr?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-6 flex items-center justify-between`,onClick:Xt=>{Xt.preventDefault(),vr||Yr||p(!Ee)},children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:(ns=gr==null?void 0:gr.find(Xt=>(Xt==null?void 0:Xt.value)===Rt))==null?void 0:ns.label}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${Ee?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),Ee&&i.jsx("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden p-1",children:i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:gr==null?void 0:gr.map((Xt,ue)=>i.jsxs("div",{onClick:rt=>{rt.preventDefault(),vr||Yr||Vn(Xt==null?void 0:Xt.value)},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] min-w-max gap-1 ${(Xt==null?void 0:Xt.value)===Rt?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${vr||Yr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsx("span",{className:"text-white",children:Xt==null?void 0:Xt.label}),(Xt==null?void 0:Xt.value)===Rt&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},ue))})})]})})]}),Rt==="lighter"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Lighter Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ie,onChange:Xt=>Re(Xt.target.value),autoComplete:"off",placeholder:"2nd Lighter Wallet Address",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/lighter-farming-module",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ae,onChange:Xt=>he(Xt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:on?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr}),i.jsx("button",{type:"button",onClick:()=>Oe(Xt=>!Xt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:vr||Yr,children:on?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ge,onChange:Xt=>{const ue=Xt.target.value.trim();if(ue==="")return Ae("");se(ue)&&Ae(ue)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ge===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr})})]})]}),Rt==="variational"&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Variational Token"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Variational Token?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:S,onChange:Xt=>{const ue=Xt.target.value;if(_(ue),!ue.trim()){T(null),W("");return}const rt=Ir(ue);if(rt&&(rt!=null&&rt.exp)){const Ft=new Date((rt==null?void 0:rt.exp)*1e3);T(Ft),W("")}else rt?(T(null),W("The token's expiration date could not be found.")):(T(null),W("Invalid token format."))},type:ee?"text":"password",autoComplete:"off",placeholder:"Variational_Token",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${S===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr}),k&&i.jsxs("div",{className:"text-[12px] mt-1 pl-[3px] flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-[#CECECE] font-medium",children:"Valid Until:"})," ",i.jsx("span",{className:"text-[11px] font-semibold "+(fe?"text-[#FF797C]":"text-[#F8D4AB]"),children:k==null?void 0:k.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),fe&&i.jsx("span",{children:i.jsx("img",{src:ec,alt:"",className:"w-3.5 h-3.5"})})]}),B&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:B}),i.jsx("button",{type:"button",onClick:()=>de(Xt=>!Xt),className:"absolute right-1 top-4 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:vr||Yr,children:ee?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ce,onChange:Xt=>{const ue=Xt.target.value.trim();if(ue==="")return ce("");se(ue)&&ce(ue)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ce===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:vr||Yr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:Fr,components:{Option:Ht,SingleValue:nn},isDisabled:vr||Yr,options:As,value:As.find(Xt=>Xt.value===it)||null,onChange:Xt=>tt((Xt==null?void 0:Xt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:It,onChange:Xt=>{const ue=Xt.target.value.trim();if(ue==="")return an("");se(ue)&&an(ue)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${It===""?"border-[#353535]":Se?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:vr||Yr}),It!==""&&!Se&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:rr,onChange:Xt=>Jt(Xt.target.value),className:`${vr||Yr?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:vr||Yr,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:It,onChange:Xt=>{const ue=Xt.target.value.trim();if(ue==="")return an("");se(ue)&&an(ue)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${It===""?"border-[#353535]":Se?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:vr||Yr}),It!==""&&!Se&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]}),i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral (Requires 2 slots to work)"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(jo,{checked:oe==="ON",onChange:Xt=>G(Xt?"ON":"OFF"),disabled:vr||Yr,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${vr||Yr?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:Nt,onChange:Xt=>{const ue=Xt.target.value.trim();if(ue==="")return mn("");se(ue)&&mn(ue)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:it?`1–${vi}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Nt===""?"border-[#353535]":De?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:vr||Yr})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":dn==="LONG",onClick:()=>!Yr&&Pt("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",vr||Yr?"cursor-not-allowed":"cursor-pointer",dn==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",Nt?` - ${Nt}x`:""]})}),i.jsx("div",{"aria-pressed":dn==="SHORT",onClick:()=>!Yr&&Pt("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",vr||Yr?"cursor-not-allowed":"cursor-pointer",dn==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",Nt?` - ${Nt}x`:""]})}),i.jsx("div",{"aria-pressed":dn==="RANDOM",onClick:()=>!Yr&&Pt("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",vr||Yr?"cursor-not-allowed":"cursor-pointer",dn==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",Nt?` - ${Nt}x`:""]})})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":Ke==="MARKET",onClick:()=>!Yr&&pt("MARKET"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",vr||Yr?"cursor-not-allowed":"cursor-pointer",Ke==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",Ke==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ke==="LIMIT",onClick:()=>!Yr&&pt("LIMIT"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",vr||Yr?"cursor-not-allowed":"cursor-pointer",Ke==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",Ke==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ke==="RANDOM",onClick:()=>!Yr&&pt("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",vr||Yr?"cursor-not-allowed":"cursor-pointer",Ke==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["RANDOM ",Ke==="RANDOM"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:en,onChange:Xt=>{const ue=Xt.target.value.trim();if(ue==="")return Bt("");st(ue)&&Bt(ue)},onKeyDown:Fe,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${en===""?"border-[#353535]":Le?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:vr||Yr})]}),en!==""&&!Le&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Et,onChange:Xt=>{const ue=Xt.target.value.trim();if(ue==="")return et("");st(ue)&&et(ue)},onKeyDown:Fe,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Et===""?"border-[#353535]":_e?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:vr||Yr})]}),Et!==""&&!_e&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",Nt?Math.max(Nt*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),i.jsx("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(jo,{checked:oe==="ON",onChange:Xt=>G(Xt?"ON":"OFF"),disabled:vr||Yr,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${vr||Yr?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]})}),!1]}),i.jsx("div",{className:"py-3 flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl",children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!vr&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:vr,children:"Cancel"}),re?oe==="ON"?Y?i.jsx("button",{onClick:Wn,disabled:vr,className:`${J?"hidden":""} inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60`,children:un?"Stopping...":"Stop"}):i.jsx("button",{onClick:In,disabled:!lt||vr||Rt==="variational"&&_r&&oe==="ON",className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!lt||vr||Rt==="variational"&&_r&&oe==="ON"?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"} ${J?"hidden":""}`,children:kt?"Starting...":"Start"}):Y?i.jsx("button",{onClick:or,disabled:vr,className:`${J?"hidden":""} inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60`,children:un?"Stopping...":"Stop"}):i.jsx("button",{onClick:Qt,disabled:!nt||vr,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!nt||vr?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"} ${J?"hidden":""}`,children:kt?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),xt&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},Hoe=({open:e=!1,setOpen:t=()=>{}})=>{const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);Jr();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(""),[P,R]=m.useState(""),[F,U]=m.useState(""),[L,z]=m.useState(""),[Q,ne]=m.useState(""),[J,X]=m.useState(""),[re,pe]=m.useState(""),[Y,ie]=m.useState("LONG"),[oe,G]=m.useState(!1),[V,te]=m.useState(!1),[ae,he]=m.useState(!1),[Ce,ce]=m.useState(!1),[ge,Ae]=m.useState(""),[ye,je]=m.useState(""),[Ie,Re]=m.useState(!0),[Qe,$e]=m.useState(!1),[it,tt]=m.useState(!1),[ot,ft]=m.useState(!1),[ct,Vt]=m.useState(!1),[It,an]=m.useState(!1),[Nt,mn]=m.useState(!1),[dn,Pt]=m.useState(""),[Xe,Ut]=m.useState(!0);m.useState(1);const Lt="https://dextrabothypev2.nftinit.io",qe=m.useMemo(()=>[{value:"BTC-USDT",label:"BTCUSDT",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:100},{value:"ETH-USDT",label:"ETHUSDT",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:100},{value:"APEX-USDT",label:"APEXUSDT",icon:"https://app.hyperliquid.xyz/coins/APEX.svg",maxLeverage:50},{value:"ASTER-USDT",label:"ASTERUSDT",icon:"https://static.astherus.finance/image/admin_mgs_image_upload/20250916/6dba1412-ddfb-4314-bfdf-87fa11f2daa6.png",maxLeverage:50},{value:"SOL-USDT",label:"SOLUSDT",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE-USDT",label:"HYPEUSDT",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50}],[]),Ke=wn=>{var on;return((on=qe.find(Oe=>Oe.value===wn))==null?void 0:on.maxLeverage)??100},pt=wn=>{["e","E","+","-"].includes(wn.key)&&wn.preventDefault()},en=wn=>/^\d*$/.test(wn),Bt=m.useMemo(()=>{if(J==="")return!1;const wn=Number(J);return Number.isInteger(wn)&&wn>=1&&wn<=100},[J]),Et=m.useMemo(()=>{if(re==="")return!1;const wn=Number(re),on=Ke(Q);return Number.isInteger(wn)&&wn>=1&&wn<=on},[re,Q]),et=g&&N.trim()!==""&&F.trim()!==""&&P.trim()!==""&&L.trim()!==""&&Q!==""&&Bt&&Et&&(Y==="LONG"||Y==="SHORT"||Y==="RANDOM"),Be=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Mt=()=>`apexCreds:${Be()}`,Ve=()=>{try{const wn=localStorage.getItem(Mt());if(!wn)return;const on=JSON.parse(wn);on.apiKey&&I(on.apiKey),on.apiKeySecret&&R(on.apiKeySecret),on.omniKeySeed&&z(on.omniKeySeed),on.apiKeyPass&&U(on.apiKeyPass),typeof on.remember=="boolean"&&Re(on.remember)}catch{}},ut=()=>{if(Ie)try{localStorage.setItem(Mt(),JSON.stringify({apiKey:N,apiKeyPass:F,apiKeySecret:P,omniKeySeed:L,remember:!0}))}catch{}},xt=()=>{try{localStorage.removeItem(Mt())}catch{}};m.useEffect(()=>{if(!e)return;const wn=localStorage.getItem("hyperToken"),on=localStorage.getItem("hyperAddress");v(!!(wn&&on));const Oe=setInterval(()=>{const rn=localStorage.getItem("hyperToken"),cn=localStorage.getItem("hyperAddress");v(!!(rn&&cn))},800);return()=>clearInterval(Oe)},[e]),m.useEffect(()=>{!e||!g||(jt(),bn())},[e,g]),m.useEffect(()=>{if(!Q)return;const wn=Ke(Q),on=Number(re);!Number.isNaN(on)&&on>wn&&pe(String(wn)),!Number.isNaN(on)&&on<1&&re!==""&&pe("1")},[Q]),m.useEffect(()=>{e&&(Ie&&ut(),Ie||xt())},[N,F,P,L,Ie,e]);async function jt(){var wn,on,Oe,rn,cn;try{te(!0),Ae("");const _t=window.localStorage.getItem("hyperToken"),Yn=window.localStorage.getItem("hyperAddress");if(!_t||!Yn){C(!1),Ve();return}const Dt=await(await fetch(`${Lt}/api/hyper/apex_farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Yn.toLowerCase(),token:_t})})).json(),sn=(wn=Dt==null?void 0:Dt.data)==null?void 0:wn.farming_params;if(Dt!=null&&Dt.success&&sn){C(!0);const Tn=((on=Dt==null?void 0:Dt.data)==null?void 0:on.apex_api_pkey)??"",Kn=((Oe=Dt==null?void 0:Dt.data)==null?void 0:Oe.apex_api_pass)??"",ir=((rn=Dt==null?void 0:Dt.data)==null?void 0:rn.apex_api_secret)??"",rr=((cn=Dt==null?void 0:Dt.data)==null?void 0:cn.apex_key_seed)??"";Tn&&I(String(Tn)),Kn&&U(String(Kn)),ir&&R(String(ir)),rr&&z(String(rr)),sn!=null&&sn.symbol&&ne(String(sn.symbol)),(sn==null?void 0:sn.orderPerHour)!=null&&X(String(sn.orderPerHour)),(sn==null?void 0:sn.leverage)!=null&&pe(String(sn.leverage)),sn!=null&&sn.direction&&ie(String(sn.direction).toUpperCase()==="SHORT"?"SHORT":String(sn.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG")}else C(!1);!N&&!F&&!P&&!L&&Ve()}catch{C(!1),Ve()}finally{te(!1)}}async function kt(){if(!g){n(!0);return}if(et)try{he(!0),Ae("");const wn=window.localStorage.getItem("hyperToken"),on=window.localStorage.getItem("hyperAddress");if(!wn||!on){n(!0);return}const Oe={symbol:Q,orderPerHour:Number(J),leverage:Number(re),direction:Y},rn={address:on.toLowerCase(),token:wn,apex_api_pkey:N,apex_api_secret:P,apex_api_pass:F,apex_key_seed:L,farming_params:Oe},_t=await(await fetch(`${Lt}/api/hyper/apex_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(rn)})).json();_t!=null&&_t.success?(C(!0),Ie&&ut()):Ae((_t==null?void 0:_t.error_message)||"Start failed.")}catch(wn){Ae(wn.message||"An error occurred while saving.")}finally{he(!1)}}async function xn(){if(!g){n(!0);return}try{ce(!0),Ae("");const wn=window.localStorage.getItem("hyperToken"),on=window.localStorage.getItem("hyperAddress");if(!wn||!on){n(!0);return}const rn=await(await fetch(`${Lt}/api/hyper/apex_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:on.toLowerCase(),token:wn})})).json();rn!=null&&rn.success?C(!1):Ae((rn==null?void 0:rn.error_message)||"Stop failed.")}catch(wn){Ae(wn.message||"An error occurred while stopping.")}finally{ce(!1)}}const un={control:(wn,on)=>({...wn,backgroundColor:"#242424",borderColor:on.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:wn=>({...wn,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:wn=>({...wn,height:32}),input:wn=>({...wn,color:"#FFFFFF",margin:0,padding:0}),singleValue:wn=>({...wn,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:wn=>({...wn,color:"#7F7F7F",fontSize:"12px"}),menu:wn=>({...wn,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:wn=>({...wn,paddingTop:0,paddingBottom:0}),option:(wn,on)=>({...wn,backgroundColor:on.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:wn=>({...wn,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:wn=>({...wn,backgroundColor:"#353535"})},On=({max:wn})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[wn,"x"]}),En=wn=>{var on;return i.jsx(Ca.Option,{...wn,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((on=wn.data)==null?void 0:on.icon)&&i.jsx("img",{src:wn.data.icon,alt:wn.data.label,className:"w-4 h-4 rounded-[4px]",onError:Oe=>Oe.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:wn.data.label}),i.jsx(On,{max:wn.data.maxLeverage})]})})},jn=wn=>{var on;return i.jsx(Ca.SingleValue,{...wn,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((on=wn.data)==null?void 0:on.icon)&&i.jsx("img",{src:wn.data.icon,alt:wn.data.label,className:"w-4 h-4 rounded-[4px]",onError:Oe=>Oe.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:wn.data.label}),i.jsx(On,{max:wn.data.maxLeverage})]})})},bn=async()=>{var Oe,rn;const wn=window.localStorage.getItem("hyperToken"),on=window.localStorage.getItem("hyperAddress");if(!(!wn||!on))try{G(!0);const cn=await ji(on.toLowerCase(),wn);cn!=null&&cn.success?(r(cn==null?void 0:cn.telegram_chat_id),s(cn==null?void 0:cn.subscriber_role),a(cn==null?void 0:cn.subs_expire_day),o((Oe=cn==null?void 0:cn.mushboomer_counts)==null?void 0:Oe.eth),l((rn=cn==null?void 0:cn.mushboomer_counts)==null?void 0:rn.sol),c(cn==null?void 0:cn.referral_code),u(cn==null?void 0:cn.refcode),d(cn==null?void 0:cn.whitelist),f(wn),x(on),Ut(!0),G(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),G(!1))}catch(cn){console.error("Token verification error:",cn),console.error(cn.message||"An unknown error occurred."),G(!1)}},Zn=qe;if(!e)return null;const zn=V||ae||Ce||oe,$n=w&&!Ce,nr=Ke(Q);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:Nt,setOpen:mn,transactionHash:dn,transactionLoading:It,paymentPresaleRole:Xe,errorFunds:ye,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!zn&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-5 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://omni.apex.exchange/assets/logo_content-CY9uyFbz.svg",alt:""}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] -mt-1",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Apex Farming module lets you set up automated farming by providing your API Key, API Key Passphrase, API Key Secret, Omni Key Seed, selecting a pair, defining orders per hour, leverage and direction."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsxs("div",{onClick:()=>window.open("https://youtu.be/VczH7nAH0Gc","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})})]})]}),i.jsxs("div",{className:"space-y-2 pt-2 pb-2 px-5",children:[ge&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:ge}),i.jsxs("div",{className:"space-y-3 px-3 sm:px-5 py-2",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://omni.apex.exchange/keyManagement",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:N,onChange:wn=>I(wn.target.value),autoComplete:"off",placeholder:"API_KEY",type:Qe?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${N===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:zn||$n}),i.jsx("button",{type:"button",onClick:()=>$e(wn=>!wn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:zn||$n,children:Qe?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Passphrase"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:F,onChange:wn=>U(wn.target.value),autoComplete:"off",placeholder:"API_KEY_PAASSPHRASE",type:ot?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${F===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:zn||$n}),i.jsx("button",{type:"button",onClick:()=>ft(wn=>!wn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:zn||$n,children:ot?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:P,onChange:wn=>R(wn.target.value),autoComplete:"off",placeholder:"API_KEY_SECRET",type:it?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${P===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:zn||$n}),i.jsx("button",{type:"button",onClick:()=>tt(wn=>!wn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:zn||$n,children:it?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Omni Key Seed"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:L,onChange:wn=>z(wn.target.value),autoComplete:"off",placeholder:"OMNI_KEY_SEED",type:ct?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${L===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:zn||$n}),i.jsx("button",{type:"button",onClick:()=>Vt(wn=>!wn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:zn||$n,children:ct?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:un,components:{Option:En,SingleValue:jn},isDisabled:zn||$n,options:Zn,value:Zn.find(wn=>wn.value===Q)||null,onChange:wn=>ne((wn==null?void 0:wn.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:J,onChange:wn=>{const on=wn.target.value.trim();if(on==="")return X("");en(on)&&X(on)},onKeyDown:pt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 100)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${J===""?"border-[#353535]":Bt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:zn||$n}),J!==""&&!Bt&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 100."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:re,onChange:wn=>{const on=wn.target.value.trim();if(on==="")return pe("");en(on)&&pe(on)},onKeyDown:pt,inputMode:"numeric",autoComplete:"off",placeholder:Q?`1–${nr}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${re===""?"border-[#353535]":Et?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:zn||$n})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{"aria-pressed":Y==="LONG",onClick:()=>!$n&&ie("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-8 rounded-[10px] uppercase tracking-wide font-semibold transition-all border w-1/2",re?"text-[10px] px-1.5":"text-[11px] px-2",zn||$n?"opacity-60 cursor-not-allowed":"cursor-pointer",Y==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",re?` - ${re}x`:""]})}),i.jsx("div",{"aria-pressed":Y==="SHORT",onClick:()=>!$n&&ie("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-8 rounded-[10px] uppercase tracking-wide font-semibold transition-all border w-1/2",re?"text-[10px] px-1.5":"text-[11px] px-2",zn||$n?"opacity-60 cursor-not-allowed":"cursor-pointer",Y==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",re?` - ${re}x`:""]})}),i.jsx("div",{"aria-pressed":Y==="RANDOM",onClick:()=>!$n&&ie("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-8 rounded-[10px] uppercase tracking-wide font-semibold transition-all border w-1/2",re?"text-[10px] px-1.5":"text-[11px] px-2",zn||$n?"opacity-60 cursor-not-allowed":"cursor-pointer",Y==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",re?` - ${re}x`:""]})})]})]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4 px-5 py-2 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl",children:[i.jsxs("div",{onClick:()=>window.open("https://join.omni.apex.exchange/AFF-7530","_blank"),className:"cursor-pointer text-[12px] text-zinc-400 text-start transition-colors duration-300 hover:text-zinc-200 flex-1",children:[i.jsxs("p",{children:["Be part of the"," ",i.jsx("span",{className:"text-white font-semibold",children:"Dextrabot x Apex squad!"})," ","Trade under our referral — unlock bonuses instantly"]}),i.jsx("div",{className:"mt-1 inline-flex items-center gap-1 text-emerald-400 font-medium hover:text-emerald-300 transition-colors duration-300",children:"🔗 Join Now"})]}),i.jsxs("div",{className:"ml-auto flex-1 flex justify-end items-center gap-2",children:[i.jsx("button",{onClick:()=>!zn&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:zn,children:"Cancel"}),g?w?i.jsx("button",{onClick:xn,disabled:zn,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Ce?"Stopping...":"Stop"}):i.jsx("button",{onClick:kt,disabled:!et||zn,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!et||zn?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:ae?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})]}),V&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},Voe=({open:e=!1,setOpen:t=()=>{}})=>{var Fr,Lr;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);Jr();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(1),[P,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[Q,ne]=m.useState(null),[J,X]=m.useState(!1),[re,pe]=m.useState("variational");m.useState(!1),m.useRef(null);const[Y,ie]=m.useState(!1),[oe,G]=m.useState(!1),[V,te]=m.useState(0),[ae,he]=m.useState("OFF"),[Ce,ce]=m.useState(""),[ge,Ae]=m.useState(""),[ye,je]=m.useState(""),[Ie,Re]=m.useState(""),[Qe,$e]=m.useState(null),[it,tt]=m.useState(""),[ot,ft]=m.useState(""),[ct,Vt]=m.useState(""),[It,an]=m.useState("");m.useState("");const[Nt,mn]=m.useState("");m.useState([]);const[dn,Pt]=m.useState(""),[Xe,Ut]=m.useState(""),[Lt,qe]=m.useState(""),[Ke,pt]=m.useState("LONG"),[en,Bt]=m.useState("STANDARD"),[Et,et]=m.useState("STANDARD"),[Be,Mt]=m.useState("MARKET"),[Ve,ut]=m.useState(""),[xt,jt]=m.useState(""),[kt,xn]=m.useState(""),[un,On]=m.useState("Hour"),[En,jn]=m.useState(!1),[bn,Zn]=m.useState(!1),[zn,$n]=m.useState(!1),[nr,wn]=m.useState(!1),[on,Oe]=m.useState(""),[rn,cn]=m.useState(""),[_t,Yn]=m.useState(!0),[yn,Dt]=m.useState(!1),[sn,Tn]=m.useState(!1),[Kn,ir]=m.useState(!1),[rr,Jt]=m.useState(!1),[Un,Qn]=m.useState(!1),[Rt,Pn]=m.useState(""),[Ee,p]=m.useState(!0),[h,S]=m.useState(""),_=Qe?(Qe==null?void 0:Qe.getTime())<=Date.now():!1;m.useState(1);const k="https://dextrabothypev2.nftinit.io",T="",B=m.useMemo(()=>[{value:"BTC",label:"BTC",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:50},{value:"ETH",label:"ETH",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:50},{value:"SOL",label:"SOL",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE",label:"HYPE",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50},{value:"XAUT",label:"XAUT",icon:"https://coin-images.coingecko.com/coins/images/10481/large/Tether_Gold.png",maxLeverage:50},{value:"BNB",label:"BNB",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:50},{value:"PUMPFUN",label:"PUMPFUN",icon:"https://coin-images.coingecko.com/coins/images/67164/large/pump.jpg",maxLeverage:50},{value:"KAITO",label:"KAITO",icon:"https://app.hyperliquid.xyz/coins/KAITO.svg",maxLeverage:50},{value:"ZEC",label:"ZEC",icon:"https://app.hyperliquid.xyz/coins/ZEC.svg",maxLeverage:50},{value:"SUI",label:"SUI",icon:"https://app.hyperliquid.xyz/coins/SUI.svg",maxLeverage:50},{value:"VIRTUAL",label:"VIRTUAL",icon:"https://app.hyperliquid.xyz/coins/VIRTUAL.svg",maxLeverage:50},{value:"TAO",label:"TAO",icon:"https://app.hyperliquid.xyz/coins/TAO.svg",maxLeverage:50},{value:"XRP",label:"XRP",icon:"https://app.hyperliquid.xyz/coins/XRP.svg",maxLeverage:50},{value:"TRUMP",label:"TRUMP",icon:"https://app.hyperliquid.xyz/coins/TRUMP.svg",maxLeverage:50},{value:"CRO",label:"CRO",icon:"https://coin-images.coingecko.com/coins/images/7310/large/cro_token_logo.png",maxLeverage:50},{value:"XPL",label:"XPL",icon:"https://app.hyperliquid.xyz/coins/XPL.svg",maxLeverage:50},{value:"IP",label:"IP",icon:"https://app.hyperliquid.xyz/coins/IP.svg",maxLeverage:50},{value:"PAXG",label:"PAXG",icon:"https://app.hyperliquid.xyz/coins/PAXG.svg",maxLeverage:50},{value:"ASTER",label:"ASTER",icon:"https://app.hyperliquid.xyz/coins/ASTER.svg",maxLeverage:50},{value:"DOLO",label:"DOLO",icon:"https://coin-images.coingecko.com/coins/images/54710/large/DOLO-small.png",maxLeverage:50},{value:"RESOLV",label:"RESOLV",icon:"https://app.hyperliquid.xyz/coins/RESOLV.svg",maxLeverage:50},{value:"GRASS",label:"GRASS",icon:"https://app.hyperliquid.xyz/coins/GRASS.svg",maxLeverage:50},{value:"YZY",label:"YZY",icon:"https://app.hyperliquid.xyz/coins/YZY.svg",maxLeverage:50},{value:"PROVE",label:"PROVE",icon:"https://app.hyperliquid.xyz/coins/PROVE.svg",maxLeverage:50},{value:"SYRUP",label:"SYRUP",icon:"https://app.hyperliquid.xyz/coins/SYRUP.svg",maxLeverage:50},{value:"NMR",label:"NMR",icon:"https://coin-images.coingecko.com/coins/images/752/large/numeraire.png",maxLeverage:50},{value:"GMX",label:"GMX",icon:"https://app.hyperliquid.xyz/coins/GMX.svg",maxLeverage:50}],[]),W=Ht=>{var nn;return((nn=B.find(Sr=>Sr.value===Ht))==null?void 0:nn.maxLeverage)??100},ee=Ht=>{["e","E","+","-"].includes(Ht.key)&&Ht.preventDefault()},de=Ht=>/^\d*\.?\d{0,6}$/.test(Ht),fe=Ht=>/^\d*$/.test(Ht),xe=m.useMemo(()=>{if(Xe==="")return!1;const Ht=Number(Xe);return Number.isInteger(Ht)&&Ht>=1&&Ht<=120},[Xe]),we=m.useMemo(()=>{if(Lt==="")return!1;const Ht=Number(Lt),nn=W(Nt);return Number.isInteger(Ht)&&Ht>=1&&Ht<=nn},[Lt,Nt]),ke=m.useMemo(()=>{if(Ve==="")return!1;const Ht=Number(Ve);return Number.isNaN(Ht)?!1:Ht===0?!0:Ht>=1&&Ht<=1e7},[Ve]),Me=m.useMemo(()=>{if(xt==="")return!1;const Ht=Number(xt);if(Number.isNaN(Ht))return!1;const nn=Lt===""?null:Number(Lt),Sr=nn?nn*100-1:4999;return Ht===0?!0:Ht>0&&Ht<1?!1:Ht>=1&&Ht<=Sr},[xt,Lt]);m.useMemo(()=>{if(kt==="")return!1;const Ht=Number(kt);return!Number.isNaN(Ht)&&Ht>0&&Ht<=100},[kt]);const Ye=g&&Ie.trim()!==""&&Nt!==""&&xe&&we&&(!Ve||ke)&&(!xt||Me)&&!_&&!it&&dn&&(Ke==="LONG"||Ke==="SHORT"||Ke==="RANDOM")&&(Be==="LIMIT"||Be==="MARKET"||Be==="RANDOM")&&Ee,Fe=g&&Ie.trim()!==""&&Nt!==""&&xe&&dn&&we&&dn&&Ee,st=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),se=()=>`variationalCreds:${st()}`,Se=()=>{try{const Ht=localStorage.getItem(se());if(!Ht)return;const nn=JSON.parse(Ht);nn.variationalToken&&Re(nn.variationalToken),typeof nn.remember=="boolean"&&Yn(nn.remember)}catch{}},De=()=>{if(_t)try{localStorage.setItem(se(),JSON.stringify({variationalToken:Ie,remember:!0}))}catch{}},Le=()=>{try{localStorage.removeItem(se())}catch{}};m.useEffect(()=>{if(!e)return;const Ht=localStorage.getItem("hyperToken"),nn=localStorage.getItem("hyperAddress");v(!!(Ht&&nn));const Sr=setInterval(()=>{const Br=localStorage.getItem("hyperToken"),Kr=localStorage.getItem("hyperAddress");v(!!(Br&&Kr))},800);return()=>clearInterval(Sr)},[e]),m.useEffect(()=>{!e||!g||(_e(),Qt())},[e,g]),m.useEffect(()=>{e&&(xt===""&&jt(T),Ve===""&&ut(T),kt===""&&xn(T))},[e]),m.useEffect(()=>{if(!Nt)return;const Ht=W(Nt),nn=Number(Lt);!Number.isNaN(nn)&&nn>Ht&&qe(String(Ht)),!Number.isNaN(nn)&&nn<1&&Lt!==""&&qe("1")},[Nt]),m.useEffect(()=>{e&&(_t&&De(),_t||Le())},[Ie,_t,e]);async function _e(){var Ht,nn,Sr,Br,Kr,As,ms,vr;try{Zn(!0),Oe("");const Yr=window.localStorage.getItem("hyperToken"),vi=window.localStorage.getItem("hyperAddress");if(!Yr||!vi){C(!1),Se();return}const os=await(await fetch(`${k}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:vi.toLowerCase(),token:Yr})})).json();if(!(os!=null&&os.success)){if(console.warn("INFO API RESPONSE:",os==null?void 0:os.error_message),(os==null?void 0:os.error_message)==="You have not a running process"){const Gs=dn?dn.toLowerCase().replace("-","_farming_"):null,mi=L==null?void 0:L[Gs];if(Gs&&mi){const ns={...L,[Gs]:{...mi,isStop:!0}};z(ns);const ue=Object.keys(ns).filter(rt=>rt.startsWith("variational"));if(ue.length>0&&!dn){const yt=ue.sort((hn,vn)=>{var fr,cr;const lr=parseInt(((fr=hn.match(/\d+/))==null?void 0:fr[0])||0,10),Nr=parseInt(((cr=vn.match(/\d+/))==null?void 0:cr[0])||0,10);return lr-Nr})[0].match(/\d+/);yt&&Pt(`Variational-${yt[0]}`)}}else Pt("Variational-1")}os!=null&&os.slots_info&&(U((nn=(Ht=os==null?void 0:os.slots_info)==null?void 0:Ht.variational)==null?void 0:nn.total_qty),R((Br=(Sr=os==null?void 0:os.slots_info)==null?void 0:Sr.variational)==null?void 0:Br.active_qty));return}if(os!=null&&os.success&&(os!=null&&os.data)){const Gs=dn?dn.toLowerCase().replace("-","_farming_"):null,mi=L==null?void 0:L[Gs],ns=os.data||{};Gs&&!ns[Gs]&&mi&&(ns[Gs]={...mi,isStop:!0}),z(ns);const ue=Object.keys(ns).filter(rt=>rt.startsWith("variational"));if(ue.length>0&&!dn){const yt=ue.sort((hn,vn)=>{var fr,cr;const lr=parseInt(((fr=hn.match(/\d+/))==null?void 0:fr[0])||0,10),Nr=parseInt(((cr=vn.match(/\d+/))==null?void 0:cr[0])||0,10);return lr-Nr})[0].match(/\d+/);yt&&Pt(`Variational-${yt[0]}`)}os!=null&&os.slots_info&&(U((As=(Kr=os==null?void 0:os.slots_info)==null?void 0:Kr.variational)==null?void 0:As.total_qty),R((vr=(ms=os==null?void 0:os.slots_info)==null?void 0:ms.variational)==null?void 0:vr.active_qty))}}catch{C(!1),Se(),he("OFF"),X(!1)}finally{Zn(!1)}}const nt=m.useMemo(()=>dn?dn.toLowerCase().replace("-","_farming_"):"",[dn]),lt=!!((Fr=L==null?void 0:L[nt])!=null&&Fr.delta)&&!!((Lr=L==null?void 0:L[nt])!=null&&Lr.from_slot),bt=nt;m.useEffect(()=>{var Sr,Br,Kr,As,ms,vr,Yr,vi,_r,os,Gs,mi,ns,Xt;if(!dn||!L)return;const Ht=bt,nn=L==null?void 0:L[Ht];if(!nn){ce(""),Ae(""),je(""),ft(""),Vt(""),an(""),mn(""),Ut(""),S(""),qe(""),pt("LONG"),Mt("MARKET"),C(!1),he("OFF"),X(!1),On("Hour"),ut(""),jt(""),Re(""),$e(null),pe("variational"),G(!1),te(0);return}if((nn==null?void 0:nn.target_params)==null&&nn.source_params){nn!=null&&nn.isStop?C(!1):C(!0),he("OFF"),X(!1),G(!1);const ue=nn.source_params,rt=(nn==null?void 0:nn.slot_number)??"";rt&&!lt&&Pt(`Variational-${rt}`),ue!=null&&ue.cycleSeconds&&On((ue==null?void 0:ue.cycleSeconds)===86400?"Day":"Hour"),ue!=null&&ue.vr_token&&Re(String(ue.vr_token)),ue!=null&&ue.coin&&mn(String(ue.coin)),(ue==null?void 0:ue.orderPerHour)!=null&&Ut(String(ue.orderPerHour)),(ue==null?void 0:ue.leverage)!=null&&qe(String(ue.leverage)),ue!=null&&ue.direction&&pt(String(ue.direction).toUpperCase()==="SHORT"?"SHORT":String(ue.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),ue!=null&&ue.orderType&&Mt(String(ue.orderType).toUpperCase()==="MARKET"?"MARKET":String(ue.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(ue==null?void 0:ue.tp)!=null&&ut(String(ue.tp)),(ue==null?void 0:ue.sl)!=null&&jt(String(ue.sl))}else if((nn==null?void 0:nn.target_params)!==null){nn!=null&&nn.isStop?(C(!1),G(!1)):(C(!0),G(!0)),he("OFF"),X(!1);const ue=(nn==null?void 0:nn.slot_number)??"";te(ue),ue&&!lt&&Pt(`Variational-${ue}`),(Sr=nn==null?void 0:nn.source_params)!=null&&Sr.vr_token&&Re(String((Br=nn==null?void 0:nn.source_params)==null?void 0:Br.vr_token)),(Kr=nn==null?void 0:nn.target_params)!=null&&Kr.coin&&mn(String((As=nn==null?void 0:nn.target_params)==null?void 0:As.coin)),((ms=nn==null?void 0:nn.source_params)==null?void 0:ms.orderPerHour)!=null&&Ut(String((vr=nn==null?void 0:nn.source_params)==null?void 0:vr.orderPerHour)),nn!=null&&nn.source_app&&S(nn==null?void 0:nn.source_app),((Yr=nn==null?void 0:nn.source_params)==null?void 0:Yr.leverage)!=null&&qe(String((vi=nn==null?void 0:nn.source_params)==null?void 0:vi.leverage)),(_r=nn==null?void 0:nn.source_params)!=null&&_r.accountType&&Bt(((os=nn==null?void 0:nn.source_params)==null?void 0:os.accountType)==="standart"?"STANDARD":"PREMIUM"),(Gs=nn==null?void 0:nn.target_params)!=null&&Gs.accountType&&et(((mi=nn==null?void 0:nn.target_params)==null?void 0:mi.accountType)==="standart"?"STANDARD":"PREMIUM"),nn!=null&&nn.target_app&&pe(((nn==null?void 0:nn.target_app)==="variational","variational")),(ns=nn==null?void 0:nn.target_params)!=null&&ns.vr_token&&Re((Xt=nn==null?void 0:nn.target_params)==null?void 0:Xt.vr_token)}else C(!1),he("OFF"),X(!1)},[dn,L,lt,bt]);const Zt=Ht=>{var nn;return Number(((nn=String(Ht||"").match(/\d+/))==null?void 0:nn[0])||0)},Ge=Ht=>(Ht||"").toLowerCase().replace("-","_"),Je=m.useMemo(()=>{const Ht=L==null?void 0:L[Ge(dn)];if(Ht!=null&&Ht.delta&&(Ht!=null&&Ht.from_slot))return Number(Ht.from_slot);const nn=Number(Ht==null?void 0:Ht.slot_number);return Number.isFinite(nn)?nn:Zt(dn)},[dn,L]),We=m.useMemo(()=>{const Ht=Number(N)||0,nn=Array.from({length:Ht},()=>({used:!1,kind:null})),Sr=L||{};for(const[Br,Kr]of Object.entries(Sr)){if(!Br.startsWith("variational_farming"))continue;const As=Zt(Br)-1;As<0||As>=Ht||((Kr==null?void 0:Kr.isStop)===!0?nn[As]={used:!1,kind:null}:Kr!=null&&Kr.source_params?nn[As]={used:!0,kind:"delta-src"}:Kr!=null&&Kr.target_params||Kr!=null&&Kr.delta?nn[As]={used:!0,kind:"delta-shadow"}:Kr!=null&&Kr.farming_params?nn[As]={used:!0,kind:"single"}:nn[As]={used:!0,kind:"unknown"})}return nn},[L,N]),wt=m.useMemo(()=>We.map((Ht,nn)=>Ht.used&&Ht.kind!=="delta-src-inferred"?`Variational-${nn+1}`:null).filter(Boolean),[We]);m.useMemo(()=>We.filter(Ht=>!Ht.used).length,[We]);async function At(){if(!g){n(!0);return}if(Ye)try{$n(!0),Oe("");const Ht=window.localStorage.getItem("hyperToken"),nn=window.localStorage.getItem("hyperAddress");if(!Ht||!nn){n(!0);return}const Sr={vr_token:Ie,coin:Nt,orderPerHour:Number(Xe),leverage:Number(Lt),direction:Ke,orderType:"MARKET",tp:Number(Ve),sl:Number(xt),cycleSeconds:un==="Hour"?3600:86400},Br={api_pkey:ge,api_index:ot,login_wallet:It,coin:Nt==null?void 0:Nt.replace("USDT",""),orderPerHour:Number(Xe),leverage:Number(Lt)},Kr={address:nn.toLowerCase(),token:Ht,source_app:"variational_farming",source_params:Sr,slot_number:Number(dn==null?void 0:dn.replace("Variational-",""))},ms=await(await fetch(`${k}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Kr)})).json();ms!=null&&ms.success?(C(!0),_e(),_t&&De()):Oe((ms==null?void 0:ms.error_message)||"Start failed.")}catch(Ht){Oe(Ht.message||"An error occurred while saving.")}finally{$n(!1)}}async function Gt(){if(!g){n(!0);return}try{wn(!0),Oe("");const Ht=window.localStorage.getItem("hyperToken"),nn=window.localStorage.getItem("hyperAddress");if(!Ht||!nn){n(!0);return}const Br=await(await fetch(`${k}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:nn.toLowerCase(),token:Ht,...oe?{slot_number:V,target_app:"variational_delta",source_app:h}:{source_app:"variational_farming",slot_number:Je}})})).json();Br!=null&&Br.success?(C(!1),_e()):Oe((Br==null?void 0:Br.error_message)||"Stop failed.")}catch(Ht){Oe(Ht.message||"An error occurred while stopping.")}finally{wn(!1)}}const fn={control:(Ht,nn)=>({...Ht,backgroundColor:"#242424",borderColor:nn.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Ht=>({...Ht,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Ht=>({...Ht,height:32}),input:Ht=>({...Ht,color:"#FFFFFF",margin:0,padding:0}),singleValue:Ht=>({...Ht,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Ht=>({...Ht,color:"#7F7F7F",fontSize:"12px"}),menu:Ht=>({...Ht,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Ht=>({...Ht,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Ht,nn)=>({...Ht,backgroundColor:nn.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Ht=>({...Ht,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Ht=>({...Ht,backgroundColor:"#353535"})};m.useEffect(()=>{if(!Ie){$e(null),tt("");return}const Ht=In(Ie);if(Ht&&(Ht!=null&&Ht.exp)){const nn=new Date(Ht.exp*1e3);$e(nn),tt("")}else Ht?($e(null),tt("The token's expiration date could not be found.")):($e(null),tt("Invalid token format."))},[Ie]);const Rn=({max:Ht})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Ht,"x"]}),An=Ht=>{var nn,Sr;return i.jsx(Ca.Option,{...Ht,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(nn=Ht.data)!=null&&nn.icon?i.jsx("img",{src:Ht.data.icon,alt:Ht.data.label,className:`w-4 h-4 ${((Sr=Ht==null?void 0:Ht.data)==null?void 0:Sr.label)==="XRP"?"bg-gray-600 rounded-full":"rounded-[4px]"}`,onError:Br=>Br.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ht.data.label}),i.jsx(Rn,{max:Ht.data.maxLeverage})]})})},pr=Ht=>{var nn,Sr;return i.jsx(Ca.SingleValue,{...Ht,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(nn=Ht.data)!=null&&nn.icon?i.jsx("img",{src:Ht.data.icon,alt:Ht.data.label,className:`w-4 h-4 ${((Sr=Ht==null?void 0:Ht.data)==null?void 0:Sr.label)==="XRP"?"bg-gray-600 rounded-full":"rounded-[4px]"}`,onError:Br=>Br.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ht.data.label}),i.jsx(Rn,{max:Ht.data.maxLeverage})]})})},mt=Ht=>{const nn=wt.includes(Ht.data.value);return i.jsx(Ca.Option,{...Ht,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Ht.data.label}),nn&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},qt=Ht=>i.jsx(Ca.SingleValue,{...Ht,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Ht.data.label})})}),Qt=async()=>{var Sr,Br,Kr,As,ms,vr,Yr,vi;const Ht=window.localStorage.getItem("hyperToken"),nn=window.localStorage.getItem("hyperAddress");if(!(!Ht||!nn))try{jn(!0);const _r=await ji(nn.toLowerCase(),Ht);_r!=null&&_r.success?(r(_r==null?void 0:_r.telegram_chat_id),s(_r==null?void 0:_r.subscriber_role),a(_r==null?void 0:_r.subs_expire_day),o((Sr=_r==null?void 0:_r.mushboomer_counts)==null?void 0:Sr.eth),l((Br=_r==null?void 0:_r.mushboomer_counts)==null?void 0:Br.sol),c(_r==null?void 0:_r.referral_code),u(_r==null?void 0:_r.refcode),d(_r==null?void 0:_r.whitelist),f(Ht),x(nn),p(!0),I((As=(Kr=_r==null?void 0:_r.slots_info)==null?void 0:Kr.variational)==null?void 0:As.total_qty),U((vr=(ms=_r==null?void 0:_r.slots_info)==null?void 0:ms.variational)==null?void 0:vr.total_qty),R((vi=(Yr=_r==null?void 0:_r.slots_info)==null?void 0:Yr.variational)==null?void 0:vi.active_qty),jn(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),jn(!1))}catch(_r){console.error("Token verification error:",_r),console.error(_r.message||"An unknown error occurred."),jn(!1)}};function In(Ht){try{const nn=Ht.split(".");if(nn.length!==3)throw new Error("Invalid JWT format");const Br=nn[1].replace(/-/g,"+").replace(/_/g,"/"),Kr=decodeURIComponent(atob(Br).split("").map(As=>"%"+("00"+As.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(Kr)}catch{return null}}const or=B,Wn=m.useMemo(()=>Array.from({length:N},(Ht,nn)=>({value:`Variational-${nn+1}`,label:`Variational-${nn+1}`})),[N]);if(!e)return null;const Vn=bn||zn||nr||En,gr=w&&!nr,Ir=W(Nt);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:Un,setOpen:Qn,transactionHash:Rt,transactionLoading:rr,paymentPresaleRole:Ee,errorFunds:rn,activeMethod:2}),i.jsx(p5,{open:Y,setOpen:ie,paymentLighterRole:Ee,oldSlotCount:Q,checkAccountLighter:Qt,tradeMarket:"variational"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Vn&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://omni.variational.io/_app/immutable/assets/full_omni_wordmark.DwlcSpMk.svg",alt:"Variational",className:"h-[18px] text-white"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] mt-[1px]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Variational Farming module lets you set up automated farming by providing your Variational Token, selecting a pair, defining orders per hour, leverage, direction and order type ."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:o5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[on&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:on}),g&&Ee&&F===P&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"No free Variational slots. Currently running on Delta Neutral."}),g&&oe&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:`Currently used for Delta Neutral in ${h.charAt(0).toUpperCase()+h.slice(1)} Farming (Slot-${V})`}),g&&Ee&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(r5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[P||0,"/",Wn.length]})]})]}),i.jsx(Cl,{styles:fn,components:{Option:mt,SingleValue:qt},options:Wn,value:Wn.find(Ht=>Ht.value===dn)||null,onChange:Ht=>Pt((Ht==null?void 0:Ht.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:"py-1 space-y-3 px-3 sm:px-5",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[ae==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Variational Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ct,onChange:Ht=>Vt(Ht.target.value),autoComplete:"off",placeholder:"1st Variational Wallet Address ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ct===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Vn||gr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Ce,onChange:Ht=>ce(Ht.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:yn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ce===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Vn||gr}),i.jsx("button",{type:"button",onClick:()=>Dt(Ht=>!Ht),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Vn||gr,children:yn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Ht=>{const nn=Ht.target.value.trim();if(nn==="")return je("");fe(nn)&&je(nn)},onKeyDown:ee,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Vn||gr})})]})]}):i.jsx(i.Fragment,{}),ae==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Variational Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:It,onChange:Ht=>an(Ht.target.value),autoComplete:"off",placeholder:"2nd Variational Wallet Address",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${It===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Vn||gr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ge,onChange:Ht=>Ae(Ht.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:Kn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ge===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Vn||gr}),i.jsx("button",{type:"button",onClick:()=>ir(Ht=>!Ht),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Vn||gr,children:Kn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ot,onChange:Ht=>{const nn=Ht.target.value.trim();if(nn==="")return ft("");fe(nn)&&ft(nn)},onKeyDown:ee,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ot===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Vn||gr})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ae==="ON"?"hidden":""} space-y-2`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Variational Token"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Variational Token?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Ie,onChange:Ht=>{const nn=Ht.target.value;if(Re(nn),!nn.trim()){$e(null),tt("");return}const Sr=In(nn);if(Sr&&(Sr!=null&&Sr.exp)){const Br=new Date((Sr==null?void 0:Sr.exp)*1e3);$e(Br),tt("")}else Sr?($e(null),tt("The token's expiration date could not be found.")):($e(null),tt("Invalid token format."))},type:sn?"text":"password",autoComplete:"off",placeholder:"Variational_Token",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Vn||gr}),Qe&&i.jsxs("div",{className:"text-[12px] mt-1 pl-[3px] flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-[#CECECE] font-medium",children:"Valid Until:"})," ",i.jsx("span",{className:"text-[11px] font-semibold "+(_?"text-[#FF797C]":"text-[#F8D4AB]"),children:Qe==null?void 0:Qe.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),_&&i.jsx("span",{children:i.jsx("img",{src:ec,alt:"",className:"w-3.5 h-3.5"})})]}),it&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:it}),i.jsx("button",{type:"button",onClick:()=>Tn(Ht=>!Ht),className:"absolute right-1 top-4 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Vn||gr,children:sn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:fn,components:{Option:An,SingleValue:pr},isDisabled:Vn||gr,options:or,value:or.find(Ht=>Ht.value===Nt)||null,onChange:Ht=>mn((Ht==null?void 0:Ht.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${ae==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:Xe,onChange:Ht=>{const nn=Ht.target.value.trim();if(nn==="")return Ut("");fe(nn)&&Ut(nn)},onKeyDown:ee,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":xe?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Vn||gr}),Xe!==""&&!xe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 120."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ae==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:un,onChange:Ht=>On(Ht.target.value),className:`${Vn||gr?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:Vn||gr,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:Xe,onChange:Ht=>{const nn=Ht.target.value.trim();if(nn==="")return Ut("");fe(nn)&&Ut(nn)},onKeyDown:ee,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 120)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":xe?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Vn||gr}),Xe!==""&&!xe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 120."})]}),i.jsxs("div",{className:`${ae==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:ae==="ON"?"On":"Off"}),i.jsx(jo,{checked:ae==="ON",onChange:Ht=>he(Ht?"ON":"OFF"),disabled:Vn||gr,className:`${ae==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${Vn||gr?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${ae==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:Lt,onChange:Ht=>{const nn=Ht.target.value.trim();if(nn==="")return qe("");fe(nn)&&qe(nn)},onKeyDown:ee,inputMode:"numeric",autoComplete:"off",placeholder:Nt?`1–${Ir}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Lt===""?"border-[#353535]":we?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Vn||gr})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":Ke==="LONG",onClick:()=>!gr&&pt("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Vn||gr?"cursor-not-allowed":"cursor-pointer",Ke==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",Lt?` - ${Lt}x`:""]})}),i.jsx("div",{"aria-pressed":Ke==="SHORT",onClick:()=>!gr&&pt("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Vn||gr?"cursor-not-allowed":"cursor-pointer",Ke==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",Lt?` - ${Lt}x`:""]})}),i.jsx("div",{"aria-pressed":Ke==="RANDOM",onClick:()=>!gr&&pt("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Vn||gr?"cursor-not-allowed":"cursor-pointer",Ke==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",Lt?` - ${Lt}x`:""]})})]})]}),i.jsxs("div",{className:`${oe?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{"aria-pressed":Be==="MARKET",onClick:()=>!gr&&Mt("MARKET"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2 min-w-max",Vn||gr?"cursor-not-allowed":"cursor-pointer",Be==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",Be==="MARKET"?" ✓":""]})}),i.jsxs("button",{"aria-pressed":Be==="LIMIT",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Be==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["LIMIT ",Be==="LIMIT"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]}),i.jsxs("button",{"aria-pressed":Be==="RANDOM",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Be==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["RANDOM ",Be==="RANDOM"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]})]})]})]}),!1,i.jsxs("div",{className:`${oe?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Ve,onChange:Ht=>{const nn=Ht.target.value.trim();if(nn==="")return ut("");de(nn)&&ut(nn)},onKeyDown:ee,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ve===""?"border-[#353535]":ke?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Vn||gr})]}),Ve!==""&&!ke&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:xt,onChange:Ht=>{const nn=Ht.target.value.trim();if(nn==="")return jt("");de(nn)&&jt(nn)},onKeyDown:ee,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${xt===""?"border-[#353535]":Me?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Vn||gr})]}),xt!==""&&!Me&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",Lt?Math.max(Lt*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]})]}),i.jsx("div",{className:`${ae==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Vn&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:Vn,children:"Cancel"}),g?ae==="ON"?w?i.jsx("button",{onClick:stopLighterFarming,disabled:Vn,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:nr?"Stopping...":"Stop"}):i.jsx("button",{onClick:saveLighterFarming,disabled:!Fe||Vn,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Fe||Vn?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:zn?"Starting...":"Start"}):w?i.jsx("button",{onClick:Gt,disabled:Vn,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:nr?"Stopping...":"Stop"}):i.jsx("button",{onClick:At,disabled:!Ye||Vn,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Ye||Vn?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:zn?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),bn&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},v$=({open:e=!1,setOpen:t=()=>{}})=>{var ni,Er,Sn,Mn;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr),{address:g}=Jr(),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState(1),[R,F]=m.useState(0),[U,L]=m.useState(0),[z,Q]=m.useState(0),[ne,J]=m.useState(0),[X,re]=m.useState({}),[pe,Y]=m.useState(null),[ie,oe]=m.useState("variational"),[G,V]=m.useState(!1),te=m.useRef(null),[ae,he]=m.useState(!1),[Ce,ce]=m.useState("Extended-1"),[ge,Ae]=m.useState("ON"),[ye,je]=m.useState(""),[Ie,Re]=m.useState(""),[Qe,$e]=m.useState(""),[it,tt]=m.useState(""),[ot,ft]=m.useState(""),[ct,Vt]=m.useState(""),[It,an]=m.useState(""),[Nt,mn]=m.useState(""),[dn,Pt]=m.useState([]),[Xe,Ut]=m.useState(""),[Lt,qe]=m.useState(""),[Ke,pt]=m.useState("LONG"),[en,Bt]=m.useState("STANDARD"),[Et,et]=m.useState("STANDARD"),[Be,Mt]=m.useState("LIMIT"),[Ve,ut]=m.useState("LIMIT"),[xt,jt]=m.useState("MARKET"),[kt,xn]=m.useState(""),[un,On]=m.useState(""),[En,jn]=m.useState(""),[bn,Zn]=m.useState(!1),[zn,$n]=m.useState(!1),[nr,wn]=m.useState(!1),[on,Oe]=m.useState(!1),[rn,cn]=m.useState(""),[_t,Yn]=m.useState(""),[yn,Dt]=m.useState(!0),[sn,Tn]=m.useState(!1),[Kn,ir]=m.useState(!1),[rr,Jt]=m.useState(!1),[Un,Qn]=m.useState(!1),[Rt,Pn]=m.useState(!1),[Ee,p]=m.useState(!1),[h,S]=m.useState(!1),[_,k]=m.useState(""),[T,B]=m.useState(!0),[W,ee]=m.useState(""),[de,fe]=m.useState(null),[xe,we]=m.useState(""),[ke,Me]=m.useState(!1),Ye=de?(de==null?void 0:de.getTime())<=Date.now():!1,[Fe,st]=m.useState("Hour"),[se,Se]=m.useState([]),[De,Le]=m.useState(""),[_e,nt]=m.useState(!1),[lt,bt]=m.useState(!1);m.useState(1);const Zt="https://dextrabothypev2.nftinit.io",Ge="",Je=m.useMemo(()=>[{value:"BTC",label:"BTC",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:50},{value:"ETH",label:"ETH",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:50},{value:"SOL",label:"SOL",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE",label:"HYPE",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50},{value:"ZEC",label:"ZEC",icon:"https://app.hyperliquid.xyz/coins/ZEC.svg",maxLeverage:10},{value:"BNB",label:"BNB",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:20},{value:"RESOLV",label:"RESOLV",icon:"https://app.hyperliquid.xyz/coins/RESOLV.svg",maxLeverage:5},{value:"XPL",label:"XPL",icon:"https://app.hyperliquid.xyz/coins/XPL.svg",maxLeverage:20},{value:"GOAT",label:"GOAT",icon:"https://app.hyperliquid.xyz/coins/GOAT.svg",maxLeverage:10},{value:"PUMP",label:"PUMP",icon:"https://app.hyperliquid.xyz/coins/PUMP.svg",maxLeverage:25},{value:"ASTER",label:"ASTER",icon:"https://static.astherus.finance/image/admin_mgs_image_upload/20250916/6dba1412-ddfb-4314-bfdf-87fa11f2daa6.png",maxLeverage:10}],[]),We=m.useMemo(()=>[{value:"BTC",label:"BTC",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:50},{value:"ETH",label:"ETH",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:50},{value:"SOL",label:"SOL",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE",label:"HYPE",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50},{value:"XMR",label:"XMR",icon:"https://cdn.extended.exchange/crypto/XMR.svg",maxLeverage:25},{value:"XRP",label:"XRP",icon:"https://app.hyperliquid.xyz/coins/XRP.svg",maxLeverage:50},{value:"PUMP",label:"PUMP",icon:"https://app.hyperliquid.xyz/coins/PUMP.svg",maxLeverage:50},{value:"BNB",label:"BNB",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:25},{value:"ZEC",label:"ZEC",icon:"https://app.hyperliquid.xyz/coins/ZEC.svg",maxLeverage:10},{value:"LTC",label:"LTC",icon:"https://app.hyperliquid.xyz/coins/LTC.svg",maxLeverage:25},{value:"IP",label:"IP",icon:"https://app.hyperliquid.xyz/coins/IP.svg",maxLeverage:10},{value:"SUI",label:"SUI",icon:"https://app.hyperliquid.xyz/coins/SUI.svg",maxLeverage:50},{value:"AAVE",label:"AAVE",icon:"https://app.hyperliquid.xyz/coins/AAVE.svg",maxLeverage:50},{value:"FARTCOIN",label:"FARTCOIN",icon:"https://app.hyperliquid.xyz/coins/FARTCOIN.svg",maxLeverage:25},{value:"BERA",label:"BERA",icon:"https://app.hyperliquid.xyz/coins/BERA.svg",maxLeverage:10},{value:"ASTER",label:"ASTER",icon:"https://app.hyperliquid.xyz/coins/ASTER.svg",maxLeverage:25},{value:"ENA",label:"ENA",icon:"https://app.hyperliquid.xyz/coins/ENA.svg",maxLeverage:50},{value:"ADA",label:"ADA",icon:"https://app.hyperliquid.xyz/coins/ADA.svg",maxLeverage:50},{value:"TIA",label:"TIA",icon:"https://app.hyperliquid.xyz/coins/TIA.svg",maxLeverage:25},{value:"LINK",label:"LINK",icon:"https://app.hyperliquid.xyz/coins/LINK.svg",maxLeverage:25}],[]),wt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI"};m.useEffect(()=>{async function at(){if(e)try{const er=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=extended")).json();if(er!=null&&er.coins){let qn=er.coins.map(kr=>{const Ar=(kr==null?void 0:kr.label)||"",Zr=wt[Ar]||Ar,Fs=Zr==="XMR"?"https://app.lighter.xyz/assets/xmr-CV8khZ54.png":Zr==="NMR"?"https://app.lighter.xyz/assets/nmr-2YIHMk6g.png":Zr==="USELESS"?"https://app.lighter.xyz/assets/useless-BTmgr78l.png":Zr==="DOLO"?"https://app.lighter.xyz/assets/dolo-DuOVl-Vo.png":Zr==="CRO"?"https://app.lighter.xyz/assets/cro-C7lstwu3.png":Zr==="FF"?"https://app.lighter.xyz/assets/ff-CvnDhHny.png":Zr==="4"||Zr=="EUR"||Zr=="EDEN"||Zr=="XAU"?"":`https://app.hyperliquid.xyz/coins/${Zr}.svg`;return{...kr,icon:Fs}});Pt(qn)}}catch(zt){console.error("Failed to fetch coin list:",zt)}}at()},[e]);async function At(){try{nt(!0);const at=window.localStorage.getItem("hyperToken"),zt=window.localStorage.getItem("hyperAddress");if(!at||!zt){n(!0);return}const er=`${Zt}/api/wallet/list-extended`,kr=await(await fetch(`${er}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:zt.toLowerCase(),token:at})})).json();kr!=null&&kr.success?Se((kr==null?void 0:kr.data)||[]):cn((kr==null?void 0:kr.error_message)||"Failed to load wallets.")}catch(at){cn(at.message||"Wallet list error.")}finally{nt(!1)}}const Gt=at=>{var zt;return((zt=(ge==="ON"?We:Je).find(er=>er.value===at))==null?void 0:zt.maxLeverage)??100},fn=at=>{["e","E","+","-"].includes(at.key)&&at.preventDefault()},Rn=at=>/^\d*\.?\d{0,6}$/.test(at),An=at=>/^\d*$/.test(at),pr=m.useMemo(()=>{if(Xe==="")return!1;const at=Number(Xe);return Number.isInteger(at)&&at>=1&&at<=120},[Xe]),mt=m.useMemo(()=>{if(Lt==="")return!1;const at=Number(Lt),zt=Gt(Nt);return Number.isInteger(at)&&at>=1&&at<=zt},[Lt,Nt]),qt=m.useMemo(()=>{if(kt==="")return!1;const at=Number(kt);return Number.isNaN(at)?!1:at===0?!0:at>=1&&at<=1e7},[kt]),Qt=m.useMemo(()=>{if(un==="")return!1;const at=Number(un);if(Number.isNaN(at))return!1;const zt=Lt===""?null:Number(Lt),er=zt?zt*100-1:4999;return at===0?!0:at>0&&at<1?!1:at>=1&&at<=er},[un,Lt]);m.useMemo(()=>{if(En==="")return!1;const at=Number(En);return!Number.isNaN(at)&&at>0&&at<=100},[En]);const In=ge=="ON"?We:Je,or=m.useMemo(()=>Nt?In.some(at=>at.value===Nt):!1,[Nt,In]),Wn=v&&ye.trim()!==""&&ct.trim()!==""&&Qe.trim()!==""&&it.trim()!==""&&Nt!==""&&pr&&mt&&Ce&&(!kt||qt)&&(!un||Qt)&&(Ke==="LONG"||Ke==="SHORT"||Ke==="RANDOM")&&(Be==="LIMIT"||Be==="MARKET"||Be==="RANDOM")&&T,Vn=v&&De&&Ce&&Nt!==""&&or&&pr&&mt&&(ie!=="variational"||W.trim()!=="")&&(ie!=="variational"||!xe)&&(ie!=="variational"||!Ye)&&T,gr=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Ir=()=>`extendedCreds:${gr()}`,Fr=()=>{try{const at=localStorage.getItem(Ir());if(!at)return;const zt=JSON.parse(at);zt.apiKey&&je(zt.apiKey),zt.apiPrivateKey&&$e(zt.apiPrivateKey),zt.vaultNumber&&tt(zt.vaultNumber),zt.apiPublicKey&&Vt(zt.apiPublicKey),typeof zt.remember=="boolean"&&Dt(zt.remember)}catch{}},Lr=()=>{if(yn)try{localStorage.setItem(Ir(),JSON.stringify({apiKey:ye,apiPrivateKey:Qe,apiPublicKey:ct,vaultNumber:it,remember:!0}))}catch{}},Ht=()=>{try{localStorage.removeItem(Ir())}catch{}};m.useEffect(()=>{if(!e)return;const at=localStorage.getItem("hyperToken"),zt=localStorage.getItem("hyperAddress");w(!!(at&&zt));const er=setInterval(()=>{const qn=localStorage.getItem("hyperToken"),kr=localStorage.getItem("hyperAddress");w(!!(qn&&kr))},800);return()=>clearInterval(er)},[e]),m.useEffect(()=>{!e||!v||(nn(),At(),fr())},[e,v]),m.useEffect(()=>{e&&(un===""&&On(Ge),kt===""&&xn(Ge),En===""&&jn(Ge))},[e]),m.useEffect(()=>{if(!Nt)return;const at=Gt(Nt),zt=Number(Lt);!Number.isNaN(zt)&&zt>at&&qe(String(at)),!Number.isNaN(zt)&&zt<1&&Lt!==""&&qe("1")},[Nt]),m.useEffect(()=>{e&&(yn&&Lr(),yn||Ht())},[ye,Qe,it,ct,yn,e]);async function nn(){var at,zt,er,qn,kr,Ar,Zr,Fs,St,sr,Hn,zr,as,rs,hs,ps;try{$n(!0),cn("");const Bi=window.localStorage.getItem("hyperToken"),Ls=window.localStorage.getItem("hyperAddress");if(!Bi||!Ls){N(!1),Fr();return}const jr=await(await fetch(`${Zt}/api/test_app/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Ls.toLowerCase(),token:Bi})})).json();if(!(jr!=null&&jr.success)){if(console.warn("INFO API RESPONSE:",jr==null?void 0:jr.error_message),(jr==null?void 0:jr.error_message)==="You have not a running process"){const ga=Ce?Ce.toLowerCase().replace("-","_"):null,El=X==null?void 0:X[ga];if(ga&&El){const _l={...X,[ga]:{...El,isStop:!0}};re(_l);const ba=Object.keys(_l).filter(kl=>kl.startsWith("extended"));if(ba.length>0&&!Ce){const $u=ba.sort((xi,yd)=>{var E,O;const dt=parseInt(((E=xi.match(/\d+/))==null?void 0:E[0])||0,10),y=parseInt(((O=yd.match(/\d+/))==null?void 0:O[0])||0,10);return dt-y})[0].match(/\d+/);$u&&ce(`Extended-${$u[0]}`)}}else ce("Extended-1")}jr!=null&&jr.slots_info&&(L((zt=(at=jr==null?void 0:jr.slots_info)==null?void 0:at.extended)==null?void 0:zt.total_qty),F((qn=(er=jr==null?void 0:jr.slots_info)==null?void 0:er.extended)==null?void 0:qn.active_qty),J((Ar=(kr=jr==null?void 0:jr.slots_info)==null?void 0:kr.variational)==null?void 0:Ar.total_qty),Q((Fs=(Zr=jr==null?void 0:jr.slots_info)==null?void 0:Zr.variational)==null?void 0:Fs.active_qty));return}if(jr!=null&&jr.success&&(jr!=null&&jr.data)){const ga=Ce?Ce.toLowerCase().replace("-","_"):null,El=X==null?void 0:X[ga],_l=jr.data||{};ga&&!_l[ga]&&El&&(_l[ga]={...El,isStop:!0}),re(_l);const ba=Object.keys(_l).filter(kl=>kl.startsWith("extended"));if(ba.length>0&&!Ce){const $u=ba.sort((xi,yd)=>{var E,O;const dt=parseInt(((E=xi.match(/\d+/))==null?void 0:E[0])||0,10),y=parseInt(((O=yd.match(/\d+/))==null?void 0:O[0])||0,10);return dt-y})[0].match(/\d+/);$u&&ce(`Extended-${$u[0]}`)}jr!=null&&jr.slots_info&&(L((sr=(St=jr==null?void 0:jr.slots_info)==null?void 0:St.extended)==null?void 0:sr.total_qty),F((zr=(Hn=jr==null?void 0:jr.slots_info)==null?void 0:Hn.extended)==null?void 0:zr.active_qty),J((rs=(as=jr==null?void 0:jr.slots_info)==null?void 0:as.variational)==null?void 0:rs.total_qty),Q((ps=(hs=jr==null?void 0:jr.slots_info)==null?void 0:hs.variational)==null?void 0:ps.active_qty))}}catch{N(!1),Fr(),Ae("ON")}finally{$n(!1)}}const Sr=m.useMemo(()=>Ce?Ce.toLowerCase().replace("-","_"):"",[Ce]),Br=!!((ni=X==null?void 0:X[Sr])!=null&&ni.delta)&&!!((Er=X==null?void 0:X[Sr])!=null&&Er.from_slot),Kr=Br?`extended_${(Sn=X==null?void 0:X[Sr])==null?void 0:Sn.from_slot}`:Sr;m.useEffect(()=>{var er,qn,kr,Ar,Zr,Fs,St,sr,Hn,zr,as,rs,hs,ps,Bi,Ls,xs;if(!Ce||!X)return;const at=Kr,zt=X==null?void 0:X[at];if(!zt){je(""),$e(""),Vt(""),ft(""),tt(""),mn(""),Ut(""),qe(""),pt("LONG"),Mt("LIMIT"),N(!1),Ae("ON"),st("Hour"),xn(""),On(""),ee(""),ut("LIMIT"),jt("MARKET"),oe("variational"),fe(null);return}if((zt==null?void 0:zt.target_params)==null&&zt.source_params){zt!=null&&zt.isStop?N(!1):N(!0),Ae("OFF");const jr=zt.source_params,ga=(zt==null?void 0:zt.slot_number)??"";ga&&!Br&&ce(`Extended-${ga}`),jr!=null&&jr.cycleSeconds&&st((jr==null?void 0:jr.cycleSeconds)===86400?"Day":"Hour");const El=(jr==null?void 0:jr.extendedapikey)??"",_l=(jr==null?void 0:jr.x10privatekey)??"",Bu=(jr==null?void 0:jr.x10publickey)??"",ba=(jr==null?void 0:jr.x10vault)??"";if(El&&je(String(El)),_l&&$e(String(_l)),Bu&&Vt(String(Bu)),ba&&tt(String(ba)),jr!=null&&jr.coin){const kl=String(jr.coin).replace(/-USD$/,"");mn(kl)}(jr==null?void 0:jr.orderPerHour)!=null&&Ut(String(jr.orderPerHour)),(jr==null?void 0:jr.leverage)!=null&&qe(String(jr.leverage)),jr!=null&&jr.direction&&pt(String(jr.direction).toUpperCase()==="SHORT"?"SHORT":String(jr.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),jr!=null&&jr.orderType&&Mt(String(jr.orderType).toUpperCase()==="MARKET"?"MARKET":String(jr.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(jr==null?void 0:jr.tp)!=null&&xn(String(jr.tp)),(jr==null?void 0:jr.sl)!=null&&On(String(jr.sl))}else if((zt==null?void 0:zt.target_params)!==null){zt!=null&&zt.isStop?N(!1):N(!0),Ae("ON");const jr=(zt==null?void 0:zt.slot_number)??"";jr&&!Br&&ce(`Extended-${jr}`);const ga=zt.source_params,El=(ga==null?void 0:ga.extendedapikey)??"",_l=(ga==null?void 0:ga.x10privatekey)??"",Bu=(ga==null?void 0:ga.x10publickey)??"",ba=(ga==null?void 0:ga.x10vault)??"";if(El&&je(String(El)),_l&&$e(String(_l)),Bu&&Vt(String(Bu)),ba&&tt(String(ba)),(er=zt==null?void 0:zt.source_params)!=null&&er.wallet_id&&Le(String((qn=zt==null?void 0:zt.source_params)==null?void 0:qn.wallet_id)),(kr=zt==null?void 0:zt.source_params)!=null&&kr.coin){const kl=String((Ar=zt==null?void 0:zt.source_params)==null?void 0:Ar.coin).replace(/-USD$/,"");mn(kl)}((Zr=zt==null?void 0:zt.source_params)==null?void 0:Zr.orderPerHour)!=null&&Ut(String((Fs=zt==null?void 0:zt.source_params)==null?void 0:Fs.orderPerHour)),((St=zt==null?void 0:zt.source_params)==null?void 0:St.leverage)!=null&&qe(String((sr=zt==null?void 0:zt.source_params)==null?void 0:sr.leverage)),(Hn=zt==null?void 0:zt.source_params)!=null&&Hn.accountType&&Bt(((zr=zt==null?void 0:zt.source_params)==null?void 0:zr.accountType)==="standart"?"STANDARD":"PREMIUM"),(as=zt==null?void 0:zt.target_params)!=null&&as.accountType&&et(((rs=zt==null?void 0:zt.target_params)==null?void 0:rs.accountType)==="standart"?"STANDARD":"PREMIUM"),zt!=null&&zt.target_app&&oe(((zt==null?void 0:zt.target_app)==="variational","variational")),(hs=zt==null?void 0:zt.target_params)!=null&&hs.vr_token&&ee((ps=zt==null?void 0:zt.target_params)==null?void 0:ps.vr_token),(Bi=zt==null?void 0:zt.source_params)!=null&&Bi.source_orderType&&ut(String((Ls=zt==null?void 0:zt.source_params)==null?void 0:Ls.source_orderType).toUpperCase()==="MARKET"?"MARKET":String((xs=zt==null?void 0:zt.source_params)==null?void 0:xs.source_orderType).toUpperCase()==="LIMIT"?"LIMIT":"HYBRID")}else N(!1),Ae("OFF")},[Ce,X,Br,Kr]);const As=at=>{var zt;return Number(((zt=String(at||"").match(/\d+/))==null?void 0:zt[0])||0)},ms=at=>(at||"").toLowerCase().replace("-","_"),vr=m.useMemo(()=>{const at=X==null?void 0:X[ms(Ce)];if(at!=null&&at.delta&&(at!=null&&at.from_slot))return Number(at.from_slot);const zt=Number(at==null?void 0:at.slot_number);return Number.isFinite(zt)?zt:As(Ce)},[Ce,X]),Yr=m.useMemo(()=>{const at=Number(I)||0,zt=Array.from({length:at},()=>({used:!1,kind:null})),er=X||{};for(const[qn,kr]of Object.entries(er)){if(!qn.startsWith("extended"))continue;const Ar=As(qn)-1;Ar<0||Ar>=at||((kr==null?void 0:kr.isStop)===!0?zt[Ar]={used:!1,kind:null}:kr!=null&&kr.source_params?zt[Ar]={used:!0,kind:"delta-src"}:kr!=null&&kr.target_params||kr!=null&&kr.delta?zt[Ar]={used:!0,kind:"delta-shadow"}:kr!=null&&kr.farming_params?zt[Ar]={used:!0,kind:"single"}:zt[Ar]={used:!0,kind:"unknown"})}return zt},[X,I]),vi=m.useMemo(()=>Yr.map((at,zt)=>at.used&&at.kind!=="delta-src-inferred"?`Extended-${zt+1}`:null).filter(Boolean),[Yr]);m.useMemo(()=>Yr.filter(at=>!at.used).length,[Yr]);async function _r(){var zt;const at=As(Ce)-1;if(at<0){cn("Please select a slot."),wn(!1);return}if((zt=Yr[at])!=null&&zt.used){cn("Selected slot is already in use."),wn(!1);return}if(!v){n(!0);return}if(ge==="OFF"){if(!Wn)return}else if(!Vn)return;try{wn(!0),cn("");const er=window.localStorage.getItem("hyperToken"),qn=window.localStorage.getItem("hyperAddress");if(!er||!qn){n(!0);return}const kr={coin:`${Nt}-USD`,leverage:Number(Lt),orderPerHour:Number(Xe),...ge==="ON"?{source_orderType:Ve,wallet_id:De}:{extendedapikey:ye,x10publickey:ct,x10privatekey:Qe,x10vault:it,orderType:Be,cycleSeconds:Fe==="Hour"?3600:86400,tp:Number(kt),sl:Number(un),direction:Ke}},Ar={...ie==="variational"&&{vr_token:W},coin:`${Nt}`,orderPerHour:Number(Xe),leverage:Number(Lt),target_orderType:xt},Zr={address:qn.toLowerCase(),token:er,slot_number:Number(Ce==null?void 0:Ce.replace("Extended-","")),source_app:"extended",source_params:kr,...ge==="ON"?{target_app:ie==="extended"?"extended":"variational_delta",target_params:Ar}:{}},St=await(await fetch(`${Zt}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Zr)})).json();St!=null&&St.success?(N(!0),nn(),yn&&Lr()):cn((St==null?void 0:St.error_message)||"Start failed.")}catch(er){cn(er.message||"An error occurred while saving.")}finally{wn(!1)}}async function os(){if(!v){n(!0);return}try{Oe(!0),cn("");const at=window.localStorage.getItem("hyperToken"),zt=window.localStorage.getItem("hyperAddress");if(!at||!zt){n(!0);return}const qn=await(await fetch(`${Zt}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:zt.toLowerCase(),token:at,source_app:"extended",slot_number:vr,...ge==="ON"?{target_app:ie==="extended"?"extended":"variational_delta"}:{}})})).json();qn!=null&&qn.success?(N(!1),nn()):cn((qn==null?void 0:qn.error_message)||"Stop failed.")}catch(at){cn(at.message||"An error occurred while stopping.")}finally{Oe(!1)}}const Gs=at=>{oe(at??"variational"),V(!1)},mi=[{value:"variational",label:"Variational"}];function ns(at){try{const zt=at.split(".");if(zt.length!==3)throw new Error("Invalid JWT format");const qn=zt[1].replace(/-/g,"+").replace(/_/g,"/"),kr=decodeURIComponent(atob(qn).split("").map(Ar=>"%"+("00"+Ar.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(kr)}catch{return null}}const Xt={control:(at,zt)=>({...at,backgroundColor:"#242424",borderColor:zt.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:at=>({...at,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:at=>({...at,height:32}),input:at=>({...at,color:"#FFFFFF",margin:0,padding:0}),singleValue:at=>({...at,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:at=>({...at,color:"#7F7F7F",fontSize:"12px"}),menu:at=>({...at,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:at=>({...at,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(at,zt)=>({...at,backgroundColor:zt.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:at=>({...at,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:at=>({...at,backgroundColor:"#353535"})},ue=({max:at})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[at,"x"]}),rt=at=>{var zt;return i.jsx(Ca.Option,{...at,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(zt=at.data)!=null&&zt.icon?i.jsx("img",{src:at.data.icon,alt:at.data.label,className:"w-4 h-4 rounded-[4px]",onError:er=>er.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:at.data.label}),i.jsx(ue,{max:at.data.maxLeverage})]})})},Ft=at=>{var zt;return i.jsx(Ca.SingleValue,{...at,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(zt=at.data)!=null&&zt.icon?i.jsx("img",{src:at.data.icon,alt:at.data.label,className:"w-4 h-4 rounded-[4px]",onError:er=>er.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:at.data.label}),i.jsx(ue,{max:at.data.maxLeverage})]})})},yt=at=>{const zt=vi.includes(at.data.value);return i.jsx(Ca.Option,{...at,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:at.data.label}),zt&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},hn=at=>i.jsx(Ca.SingleValue,{...at,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:at.data.label})})}),vn=m.useMemo(()=>se.map(at=>{const zt=(at==null?void 0:at.wallet_name)??(at==null?void 0:at.name)??(at==null?void 0:at.label)??String(at==null?void 0:at.wallet_id),er=(at==null?void 0:at.version)===3?`${zt} - (API-AGENT) Wallet`:zt;return{value:(at==null?void 0:at.wallet_id)??(at==null?void 0:at.id)??(at==null?void 0:at.value)??"",label:er,raw:at}}),[se]),lr=m.useMemo(()=>{var at;return(at=vn.find(zt=>String(zt.value)===String(De)))==null?void 0:at.raw},[vn,De]);m.useMemo(()=>{const at=lr||{};return at.address||at.evm_address||at.wallet_address||at.public_address||at.eth_address||at.addr||null},[lr]);const Nr=at=>i.jsxs(Ca.MenuList,{...at,children:[i.jsxs("div",{onClick:()=>{at.selectProps.setIsGenWalletModal(!0)},className:"mx-2 mt-2 mb-1 px-3 py-2 bg-[#7445ff] hover:bg-[#5834C3] rounded-md text-white text-[13px] font-medium cursor-pointer flex items-center gap-2",children:[i.jsx("span",{className:"text-[18px] leading-none",children:"+"}),"Add Account"]}),i.jsx("div",{className:"h-px bg-[#353535] my-1 mx-2"}),at.children]}),fr=async()=>{var er,qn,kr,Ar,Zr,Fs,St,sr;const at=window.localStorage.getItem("hyperToken"),zt=window.localStorage.getItem("hyperAddress");if(!(!at||!zt))try{Zn(!0);const Hn=await ji(zt.toLowerCase(),at);Hn!=null&&Hn.success?(r(Hn==null?void 0:Hn.telegram_chat_id),s(Hn==null?void 0:Hn.subscriber_role),a(Hn==null?void 0:Hn.subs_expire_day),o((er=Hn==null?void 0:Hn.mushboomer_counts)==null?void 0:er.eth),l((qn=Hn==null?void 0:Hn.mushboomer_counts)==null?void 0:qn.sol),c(Hn==null?void 0:Hn.referral_code),u(Hn==null?void 0:Hn.refcode),d(Hn==null?void 0:Hn.whitelist),f(at),x(zt),B(!0),P((Ar=(kr=Hn==null?void 0:Hn.slots_info)==null?void 0:kr.extended)==null?void 0:Ar.total_qty),L((Fs=(Zr=Hn==null?void 0:Hn.slots_info)==null?void 0:Zr.extended)==null?void 0:Fs.total_qty),F((sr=(St=Hn==null?void 0:Hn.slots_info)==null?void 0:St.extended)==null?void 0:sr.active_qty),Zn(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),Zn(!1))}catch(Hn){console.error("Token verification error:",Hn),console.error(Hn.message||"An unknown error occurred."),Zn(!1)}},cr=async()=>new Sl(window.ethereum).eth.getAccounts(zt=>zt),ts=async(at="extended",zt=24,er=5e3)=>{zt<=0||(await new Promise(qn=>setTimeout(qn,er)),await fr(),at==="extended"&&!T&&ts(at,zt-1,er))},is=async()=>{Yn("");const at=window.localStorage.getItem("hyperToken"),zt=window.localStorage.getItem("hyperAddress");if(!at||!g){n(!0);return}S(!0),p(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(kr){console.error("Failed to switch network",kr),p(!1);return}const er=new Sl(window.ethereum);var qn=await cr();if(qn.length>0?qn=qn[0]:qn=void 0,qn){const Ar={from:qn,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await er.eth.sendTransaction(Ar).then(Zr=>{console.log("txHash :>> ",Zr),p(!1),k(Zr.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:g?g.toLowerCase():zt,token:at,payment_tx:Zr.transactionHash,payment_role:"farming_tools"})}),fr(),ts("extended")}).catch(Zr=>{console.log(Zr),Zr.code===-32003||Zr.message.includes("insufficient funds")?Yn("Insufficient funds."):Zr.message==="MetaMask Tx Signature: User denied transaction signature."&&S(!1)})}else await er.eth.requestAccounts()},Or=m.useMemo(()=>Array.from({length:I},(at,zt)=>({value:`Extended-${zt+1}`,label:`Extended-${zt+1}`})),[I]);if(!e)return null;const hr=zn||nr||on||bn,Jn=C&&!on,vs=Gt(Nt),si=z===ne;return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:h,setOpen:S,transactionHash:_,transactionLoading:Ee,paymentPresaleRole:T,errorFunds:_t,activeMethod:2}),i.jsx(p5,{open:ae,setOpen:he,paymentLighterRole:T,oldSlotCount:pe,checkAccountLighter:fr,tradeMarket:"extended"}),lt&&Na.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(d5,{open:lt,setOpen:bt,handleListRequest:At,handlePageChange:()=>{}})}),document.body),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!hr&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended-long.svg",alt:"Extended",className:"h-[20px] text-white"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Extended Farming module lets you set up automated farming by providing your Extended Token, selecting a pair, defining orders per hour, leverage, direction and order type ."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:o5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[rn&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:rn==="Get more slots to run Delta Neutral with Variational"?i.jsxs(i.Fragment,{children:[i.jsx("span",{children:rn}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self")},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]}):i.jsx("span",{children:rn})}),v&&T&&U===R&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:`No free Extended slots. All ${(Or==null?void 0:Or.length)||U} in use.`}),v&&si&&ie==="variational"&&!C&&ge==="ON"&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:i.jsxs(i.Fragment,{children:[i.jsx("span",{children:'"No Variational slots available. Purchase Variational slot."'}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self"),t(!1)},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]})}),v&&!T&&i.jsx("div",{className:"px-5",children:i.jsxs("div",{className:"flex flex-col items-center justify-start sm:flex-row sm:items-center sm:justify-between gap-2.5 rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("img",{src:ec,alt:"",className:""}),i.jsx("span",{className:"text-[#FF797C] text-[12px] leading-4 font-manrope -mb-0.5",children:"You need an active subscription to start farming. Please complete your subscription first to unlock bot. Make sure you have sufficient Ethereum funds on the Ethereum Mainnet."})]}),i.jsx("div",{onClick:()=>{is()},className:"flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Subscribe / 0.12 ETH"})]})}),v&&T&&i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(r5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[R||0,"/",Or.length]})]})]}),i.jsx(Cl,{styles:Xt,components:{Option:yt,SingleValue:hn},options:Or,value:Or.find(at=>at.value===Ce)||null,onChange:at=>ce((at==null?void 0:at.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsx("div",{className:"flex justify-end items-end w-full ",children:i.jsxs("div",{onClick:at=>{at.preventDefault(),v?bt(!0):n(!0)},className:"h-6 sm:h-8 pl-2 sm:pl-3 pr-4 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] inline-flex justify-center items-center gap-1.5 cursor-pointer w-max",children:[i.jsx("span",{className:"text-[18px] leading-none",children:"+"}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max",children:"Add Account"})]})})]}),i.jsxs("div",{className:"py-1 space-y-3 px-3 sm:px-5",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[ge==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"}),i.jsx("span",{className:"rounded-md w-max text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] bg-[#353535] px-2 h-6 flex items-center",children:"Extended"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Wallet"}),i.jsxs("div",{className:"relative",children:[i.jsx(Cl,{styles:Xt,isDisabled:hr||_e||Jn,isLoading:_e,options:vn,components:{MenuList:Nr},setIsGenWalletModal:bt,value:vn.find(at=>String(at.value)===String(De))||null,onChange:at=>{Jn||Le((at==null?void 0:at.value)??"")},placeholder:v?_e?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{v||n(!0)},menuIsOpen:v?void 0:!1}),!v&&i.jsx("button",{type:"button",onClick:()=>n(!0),className:"absolute inset-0 rounded-md cursor-pointer bg-transparent","aria-label":"Connect to select",title:"Connect"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Order Type"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":Ve==="LIMIT",onClick:()=>!Jn&&ut("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",hr||Jn?"cursor-not-allowed":"cursor-pointer",Ve==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",Ve==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ve==="HYBRID",onClick:()=>!Jn&&ut("HYBRID"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",hr||Jn?"cursor-not-allowed":"cursor-pointer",Ve==="HYBRID"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["HYBRID ",Ve==="HYBRID"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ve==="MARKET",onClick:()=>!Jn&&ut("MARKET"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",hr||Jn?"cursor-not-allowed":"cursor-pointer",Ve==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",Ve==="MARKET"?" ✓":""]})})]})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ye,onChange:at=>je(at.target.value),autoComplete:"off",placeholder:"API_KEY",type:sn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:hr||Jn}),i.jsx("button",{type:"button",onClick:()=>Tn(at=>!at),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:hr||Jn,children:sn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Public"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ct,onChange:at=>Vt(at.target.value),autoComplete:"off",placeholder:"STARK_KEY_PUBLIC",type:Kn?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ct===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:hr||Jn}),i.jsx("button",{type:"button",onClick:()=>ir(at=>!at),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:hr||Jn,children:Kn?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),ge==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"}),i.jsx("div",{children:i.jsxs("div",{ref:te,className:"relative w-[120px]",children:[i.jsxs("div",{className:`${hr||Jn?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-6 flex items-center justify-between`,onClick:at=>{at.preventDefault(),hr||Jn||V(!G)},children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:(Mn=mi==null?void 0:mi.find(at=>(at==null?void 0:at.value)===ie))==null?void 0:Mn.label}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${G?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),G&&i.jsx("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden p-1",children:i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:mi==null?void 0:mi.map((at,zt)=>i.jsxs("div",{onClick:er=>{er.preventDefault(),hr||Jn||Gs(at==null?void 0:at.value)},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] min-w-max gap-1 ${(at==null?void 0:at.value)===ie?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${hr||Jn?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsx("span",{className:"text-white",children:at==null?void 0:at.label}),(at==null?void 0:at.value)===ie&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},zt))})})]})})]}),ie==="extended"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:It,onChange:at=>an(at.target.value),autoComplete:"off",placeholder:"2nd Stark key Public",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${It===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:hr||Jn})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Ie,onChange:at=>Re(at.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:Rt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:hr||Jn}),i.jsx("button",{type:"button",onClick:()=>Pn(at=>!at),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:hr||Jn,children:Rt?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ot,onChange:at=>{const zt=at.target.value.trim();if(zt==="")return ft("");An(zt)&&ft(zt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ot===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:hr||Jn})})]})]}),ie==="variational"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Variational Token"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Variational Token?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:W,onChange:at=>{const zt=at.target.value;if(ee(zt),!zt.trim()){fe(null),we("");return}const er=ns(zt);if(er&&(er!=null&&er.exp)){const qn=new Date((er==null?void 0:er.exp)*1e3);fe(qn),we("")}else er?(fe(null),we("The token's expiration date could not be found.")):(fe(null),we("Invalid token format."))},type:ke?"text":"password",autoComplete:"off",placeholder:"Variational_Token",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${W===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:hr||Jn}),de&&i.jsxs("div",{className:"text-[12px] mt-1 pl-[3px] flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-[#CECECE] font-medium",children:"Valid Until:"})," ",i.jsx("span",{className:"text-[11px] font-semibold "+(Ye?"text-[#FF797C]":"text-[#F8D4AB]"),children:de==null?void 0:de.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),Ye&&i.jsx("span",{children:i.jsx("img",{src:ec,alt:"",className:"w-3.5 h-3.5"})})]}),xe&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:xe}),i.jsx("button",{type:"button",onClick:()=>Me(at=>!at),className:"absolute right-1 top-4 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:hr||Jn,children:ke?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Order Type"}),i.jsx("div",{className:"flex items-center gap-3",children:i.jsx("button",{"aria-pressed":xt==="MARKET",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",xt==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",xt==="MARKET"?" ✓":""]})})})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Private"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Qe,onChange:at=>$e(at.target.value),autoComplete:"off",placeholder:"STARK_KEY_PRIVATE",type:rr?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Qe===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:hr||Jn}),i.jsx("button",{type:"button",onClick:()=>Jt(at=>!at),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:hr||Jn,children:rr?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Vault Number"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:it,onChange:at=>{const zt=at.target.value.trim();if(zt==="")return tt("");An(zt)&&tt(zt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:"VAULT_NUMBER",type:Un?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${it===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:hr||Jn}),i.jsx("button",{type:"button",onClick:()=>Qn(at=>!at),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:hr||Jn,children:Un?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:Xt,components:{Option:rt,SingleValue:Ft},isDisabled:hr||Jn,options:In,value:In.find(at=>at.value===Nt)||null,onChange:at=>mn((at==null?void 0:at.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${ge==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:Xe,onChange:at=>{const zt=at.target.value.trim();if(zt==="")return Ut("");An(zt)&&Ut(zt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 120)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":pr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:hr||Jn}),Xe!==""&&!pr&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 120."})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:Fe,onChange:at=>st(at.target.value),className:`${hr||Jn?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:hr||Jn,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:Xe,onChange:at=>{const zt=at.target.value.trim();if(zt==="")return Ut("");An(zt)&&Ut(zt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 120)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":pr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:hr||Jn}),Xe!==""&&!pr&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ge==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:ge==="ON"?"On":"Off"}),i.jsx(jo,{checked:ge==="ON",onChange:at=>Ae(at?"ON":"OFF"),disabled:hr||Jn,className:`${ge==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${hr||Jn?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${ge==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:Lt,onChange:at=>{const zt=at.target.value.trim();if(zt==="")return qe("");An(zt)&&qe(zt)},onKeyDown:fn,inputMode:"numeric",autoComplete:"off",placeholder:Nt?`1–${vs}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Lt===""?"border-[#353535]":mt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:hr||Jn})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":Ke==="LONG",onClick:()=>!Jn&&pt("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",hr||Jn?"cursor-not-allowed":"cursor-pointer",Ke==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",Lt?` - ${Lt}x`:""]})}),i.jsx("div",{"aria-pressed":Ke==="SHORT",onClick:()=>!Jn&&pt("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",hr||Jn?"cursor-not-allowed":"cursor-pointer",Ke==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",Lt?` - ${Lt}x`:""]})}),i.jsx("div",{"aria-pressed":Ke==="RANDOM",onClick:()=>!Jn&&pt("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",hr||Jn?"cursor-not-allowed":"cursor-pointer",Ke==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",Lt?` - ${Lt}x`:""]})})]})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("button",{"aria-pressed":Be==="MARKET",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Be==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["MARKET ",Be==="MARKET"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]}),i.jsx("button",{"aria-pressed":Be==="LIMIT",onClick:()=>!Jn&&Mt("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",hr||Jn?"cursor-not-allowed":"cursor-pointer",Be==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",Be==="LIMIT"?" ✓":""]})}),i.jsxs("button",{"aria-pressed":Be==="RANDOM",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Be==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["RANDOM ",Be==="RANDOM"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]})]})]})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:kt,onChange:at=>{const zt=at.target.value.trim();if(zt==="")return xn("");Rn(zt)&&xn(zt)},onKeyDown:fn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${kt===""?"border-[#353535]":qt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:hr||Jn})]}),kt!==""&&!qt&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:un,onChange:at=>{const zt=at.target.value.trim();if(zt==="")return On("");Rn(zt)&&On(zt)},onKeyDown:fn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${un===""?"border-[#353535]":Qt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:hr||Jn})]}),un!==""&&!Qt&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",Lt?Math.max(Lt*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),i.jsx("div",{className:`${ge==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:i.jsxs("div",{className:`${ge==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:ge==="ON"?"On":"Off"}),i.jsx(jo,{checked:ge==="ON",onChange:at=>Ae(at?"ON":"OFF"),disabled:hr||Jn,className:`${ge==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${hr||Jn?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${ge==="ON"?"translate-x-3":"translate-x-0"}`})})]})]})})]}),i.jsx("div",{className:`${ge==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!hr&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:hr,children:"Cancel"}),v?ge==="ON"?C?i.jsx("button",{onClick:os,disabled:hr,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:on?"Stopping...":"Stop"}):i.jsx("button",{onClick:_r,disabled:!Vn||hr||ie==="variational"&&si&&ge==="ON",className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Vn||hr||ie==="variational"&&si&&ge==="ON"?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:nr?"Starting...":"Start"}):C?i.jsx("button",{onClick:os,disabled:hr,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:on?"Stopping...":"Stop"}):i.jsx("button",{onClick:_r,disabled:!Wn||hr,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Wn||hr?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:nr?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),zn&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},nMe=({className:e})=>i.jsx("svg",{class:"Logo___StyledParadexLogoText-qr0or9-1 jECvji",width:"128",viewBox:"0 0 836 114",version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("g",{id:"New-Logos",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd",children:i.jsx("g",{id:"Dark_1080x1080",transform:"translate(-122, -183)",fill:"white",children:i.jsxs("g",{id:"paradex-white",transform:"translate(122.2947, 183)",fill:"white",children:[i.jsx("path",{d:"M94.6678094,15.1179294 C93.2804251,13.1247857 91.6650668,11.27494 89.8477888,9.60095989 C83.3993829,3.66712376 74.5149126,0.00651354131 64.6729517,0.00651354131 L0,0.00651354131 L7.88789853,13.7370586 C9.6335276,16.7723689 12.8642441,18.6417552 16.3620158,18.6417552 L35.2903668,18.6417552 L64.6794652,18.6091875 C68.9393212,18.6091875 72.7823106,20.1919781 75.5570792,22.7648269 C78.3448749,25.3181351 80.0709633,28.8615015 80.0709633,32.7631128 C80.0709633,40.5858759 73.1861502,46.9300651 64.6794652,46.9300651 L55.3651011,46.8974974 L12.1347275,46.8974974 L20.022626,60.6280425 C21.7682551,63.6633528 24.9989715,65.5327391 28.4967432,65.5327391 L32.3267055,65.5327391 C33.9681179,65.5327391 35.2968804,66.8615015 35.2968804,68.502914 L35.2968804,114 L50.4669181,102.288653 C52.8639013,100.438807 54.2643126,97.5793624 54.2643126,94.5570792 L54.2643126,68.5094275 C54.2643126,66.8680151 55.5930751,65.5392527 57.2344875,65.5392527 L64.6794652,65.5392527 C78.8268769,65.5392527 91.0397669,57.9444635 96.7781968,46.9365787 C99.018855,42.6506685 100.275968,37.843675 100.275968,32.7696263 C100.275968,26.2691121 98.2176894,20.2245458 94.6743229,15.1309565 L94.6678094,15.1179294 Z",id:"Path"}),i.jsx("polygon",{id:"Vector","fill-rule":"nonzero",points:"835.410613 0.00651354131 811.890215 0.00651354131 789.933067 32.958519 767.975919 0.00651354131 744.455522 0.00651354131 778.176125 50.6037024 744.455522 101.207405 767.975919 101.207405 789.933067 68.2488858 811.890215 101.207405 835.410613 101.207405 801.690009 50.6037024"}),i.jsx("path",{d:"M633.673211,101.207405 L703.719834,101.207405 L703.719834,82.5786767 L633.673211,82.5786767 L633.673211,101.207405 Z M633.673211,18.6352417 L703.576536,18.6352417 L703.576536,0.00651354131 L633.673211,0.00651354131 L633.673211,18.6352417 L633.673211,18.6352417 Z M633.608076,59.9180665 L677.072937,59.9180665 L677.072937,41.2893384 L633.608076,41.2893384 L633.608076,59.9180665 Z",id:"Vector1"}),i.jsx("path",{d:"M595.712292,50.6037024 C595.712292,64.5882756 589.817537,77.2310593 580.281713,86.3825848 C570.745889,95.5471375 557.575508,101.207405 543.037284,101.207405 L515.185381,101.207405 L515.185381,82.5786767 L543.037284,82.5786767 C561.425011,82.5786767 576.32148,68.2619129 576.32148,50.6037024 C576.32148,41.7713404 572.595734,33.7857388 566.570709,27.9952005 C560.545683,22.2111759 552.227891,18.6287281 543.037284,18.6287281 L515.185381,18.6287281 L515.185381,0 L543.037284,0 C572.120246,0 595.712292,22.6475831 595.712292,50.6037024 Z",id:"Vector2","fill-rule":"nonzero"}),i.jsx("polygon",{id:"Vector3","fill-rule":"nonzero",points:"475.394157 101.200891 437.394157 0.00651354131 413.945409 0.00651354131 413.951922 0.00651354131 413.919354 0.00651354131 375.919354 101.207405 399.36159 101.207405 425.656756 31.1868358 451.951922 101.200891"}),i.jsx("path",{d:"M312.868275,63.943435 L338.017058,101.207405 L314.197037,101.207405 L290.136015,65.5262256 L257.483633,65.5262256 L257.483633,46.9300651 L301.684524,46.9300651 C310.360561,46.9300651 317.388672,40.5793624 317.388672,32.7565992 C317.388672,28.854988 315.643043,25.3181351 312.796626,22.7713404 C309.963235,20.1919781 306.042083,18.6091875 301.691038,18.6091875 L257.490146,18.6091875 L257.490146,0.0130270826 L301.691038,0.0130270826 C311.741432,0.0130270826 320.801768,3.68015084 327.386958,9.61398697 C329.23029,11.2814535 330.878216,13.1378128 332.298168,15.1244429 C335.919697,20.2245458 338.023571,26.2691121 338.023571,32.7565992 C338.023571,37.8371615 336.73389,42.6311279 334.447637,46.9300651 C330.181267,54.9482345 322.397585,61.17518 312.874788,63.943435 L312.868275,63.943435 Z",id:"Vector4","fill-rule":"nonzero"}),i.jsx("polygon",{id:"Vector5","fill-rule":"nonzero",points:"217.698922 101.200891 179.698922 0.00651354131 156.256687 0.00651354131 156.256687 0.00651354131 156.22412 0.00651354131 118.22412 101.207405 141.666355 101.207405 167.961521 31.1868358 194.256687 101.200891"})]})})})}),Woe=({open:e=!1,setOpen:t=()=>{}})=>{var lt,bt,Zt;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);Jr();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(1),[P,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[Q,ne]=m.useState(null),[J,X]=m.useState("paradex");m.useState(!1),m.useRef(null);const[re,pe]=m.useState(!1),[Y,ie]=m.useState(""),[oe,G]=m.useState("OFF"),[V,te]=m.useState(""),[ae,he]=m.useState(""),[Ce,ce]=m.useState("");m.useState("");const[ge,Ae]=m.useState(""),[ye,je]=m.useState(""),[Ie,Re]=m.useState(""),[Qe,$e]=m.useState(""),[it,tt]=m.useState([]),[ot,ft]=m.useState(""),[ct,Vt]=m.useState(""),[It,an]=m.useState("LONG"),[Nt,mn]=m.useState("MARKET"),[dn,Pt]=m.useState(""),[Xe,Ut]=m.useState(""),[Lt,qe]=m.useState(""),[Ke,pt]=m.useState(!1),[en,Bt]=m.useState(!1),[Et,et]=m.useState(!1),[Be,Mt]=m.useState(!1),[Ve,ut]=m.useState(""),[xt,jt]=m.useState(""),[kt,xn]=m.useState(!0),[un,On]=m.useState(!1),[En,jn]=m.useState(!1),[bn,Zn]=m.useState(!1),[zn,$n]=m.useState(!1),[nr,wn]=m.useState(""),[on,Oe]=m.useState(!0),[rn,cn]=m.useState("Hour"),_t="https://dextrabothypev2.nftinit.io",Yn="";m.useEffect(()=>{async function Ge(){if(e)try{const We=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=paradex")).json();if(We!=null&&We.coins){const wt=[...We.coins].sort((Gt,fn)=>(fn.maxLeverage||0)-(Gt.maxLeverage||0)),At=wt==null?void 0:wt.map(Gt=>{const An=`https://app.paradex.trade/static/market/${(Gt==null?void 0:Gt.label)||""}.svg`;return{...Gt,icon:An}});tt(At)}}catch(Je){console.error("Failed to fetch coin list:",Je)}}Ge()},[e]);const yn=Ge=>{var Je;return((Je=it.find(We=>We.value===Ge))==null?void 0:Je.maxLeverage)??100},Dt=Ge=>{["e","E","+","-"].includes(Ge.key)&&Ge.preventDefault()},sn=Ge=>/^\d*\.?\d{0,6}$/.test(Ge),Tn=Ge=>/^\d*$/.test(Ge),Kn=m.useMemo(()=>{if(ot==="")return!1;const Ge=Number(ot);return Number.isInteger(Ge)&&Ge>=1&&Ge<=180},[ot]),ir=m.useMemo(()=>{if(ct==="")return!1;const Ge=Number(ct),Je=yn(Qe);return Number.isInteger(Ge)&&Ge>=1&&Ge<=Je},[ct,Qe,it]),rr=m.useMemo(()=>{if(dn==="")return!1;const Ge=Number(dn);return Number.isNaN(Ge)?!1:Ge===0?!0:Ge>=1&&Ge<=1e7},[dn]),Jt=m.useMemo(()=>{if(Xe==="")return!1;const Ge=Number(Xe);if(Number.isNaN(Ge))return!1;const Je=ct===""?null:Number(ct),We=Je?Je*100-1:4999;return Ge===0?!0:Ge>0&&Ge<1?!1:Ge>=1&&Ge<=We},[Xe,ct]);m.useMemo(()=>{if(Lt==="")return!1;const Ge=Number(Lt);return!Number.isNaN(Ge)&&Ge>0&&Ge<=100},[Lt]);const Un=g&&V.trim()!==""&&ye.trim()!==""&&Qe!==""&&Kn&&ir&&(!dn||rr)&&(!Xe||Jt)&&(It==="LONG"||It==="SHORT"||It==="RANDOM")&&(Nt==="LIMIT"||Nt==="MARKET"||Nt==="RANDOM")&&on,Qn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Rt=()=>`paradexCreds:${Qn()}`,Pn=()=>{try{const Ge=localStorage.getItem(Rt());if(!Ge)return;const Je=JSON.parse(Ge);Je.privateKey&&te(Je.privateKey),Je.paradexAddress&&je(Je.paradexAddress),typeof Je.remember=="boolean"&&xn(Je.remember)}catch{}},Ee=()=>{if(kt)try{localStorage.setItem(Rt(),JSON.stringify({privateKey:V,paradexAddress:ye,remember:!0}))}catch{}},p=()=>{try{localStorage.removeItem(Rt())}catch{}};m.useEffect(()=>{if(!e)return;const Ge=localStorage.getItem("hyperToken"),Je=localStorage.getItem("hyperAddress");v(!!(Ge&&Je));const We=setInterval(()=>{const wt=localStorage.getItem("hyperToken"),At=localStorage.getItem("hyperAddress");v(!!(wt&&At))},800);return()=>clearInterval(We)},[e]),m.useEffect(()=>{!e||!g||(h(),se())},[e,g]),m.useEffect(()=>{e&&(Xe===""&&Ut(Yn),dn===""&&Pt(Yn),Lt===""&&qe(Yn))},[e]),m.useEffect(()=>{if(!Qe)return;const Ge=yn(Qe),Je=Number(ct);!Number.isNaN(Je)&&Je>Ge&&Vt(String(Ge)),!Number.isNaN(Je)&&Je<1&&ct!==""&&Vt("1")},[Qe]),m.useEffect(()=>{e&&(kt&&Ee(),kt||p())},[V,ye,kt,e]);async function h(){var Ge,Je,We,wt,At,Gt,fn,Rn;try{Bt(!0),ut("");const An=window.localStorage.getItem("hyperToken"),pr=window.localStorage.getItem("hyperAddress");if(!An||!pr){C(!1),Pn();return}const qt=await(await fetch(`${_t}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:pr.toLowerCase(),token:An})})).json();if(!(qt!=null&&qt.success)){if(console.warn("INFO API RESPONSE:",qt==null?void 0:qt.error_message),(qt==null?void 0:qt.error_message)==="You have not a running process"){const Qt=Y?Y.toLowerCase().replace("-","_"):null,In=L==null?void 0:L[Qt];if(Qt&&In){const or={...L,[Qt]:{...In,isStop:!0}};z(or);const Vn=Object.keys(or).filter(gr=>gr.startsWith("paradex"));if(Vn.length>0&&!Y){const Fr=Vn.sort((Lr,Ht)=>{var Br,Kr;const nn=parseInt(((Br=Lr.match(/\d+/))==null?void 0:Br[0])||0,10),Sr=parseInt(((Kr=Ht.match(/\d+/))==null?void 0:Kr[0])||0,10);return nn-Sr})[0].match(/\d+/);Fr&&ie(`Paradex-${Fr[0]}`)}}else ie("Paradex-1")}qt!=null&&qt.slots_info&&(U((Je=(Ge=qt==null?void 0:qt.slots_info)==null?void 0:Ge.paradex)==null?void 0:Je.total_qty),R((wt=(We=qt==null?void 0:qt.slots_info)==null?void 0:We.paradex)==null?void 0:wt.active_qty));return}if(qt!=null&&qt.success&&(qt!=null&&qt.data)){const Qt=Y?Y.toLowerCase().replace("-","_"):null,In=L==null?void 0:L[Qt],or=qt.data||{};Qt&&!or[Qt]&&In&&(or[Qt]={...In,isStop:!0}),z(or);const Vn=Object.keys(or).filter(gr=>gr.startsWith("paradex"));if(Vn.length>0&&!Y){const Fr=Vn.sort((Lr,Ht)=>{var Br,Kr;const nn=parseInt(((Br=Lr.match(/\d+/))==null?void 0:Br[0])||0,10),Sr=parseInt(((Kr=Ht.match(/\d+/))==null?void 0:Kr[0])||0,10);return nn-Sr})[0].match(/\d+/);Fr&&ie(`Paradex-${Fr[0]}`)}qt!=null&&qt.slots_info&&(U((Gt=(At=qt==null?void 0:qt.slots_info)==null?void 0:At.paradex)==null?void 0:Gt.total_qty),R((Rn=(fn=qt==null?void 0:qt.slots_info)==null?void 0:fn.paradex)==null?void 0:Rn.active_qty))}}catch{C(!1),Pn(),G("OFF")}finally{Bt(!1)}}const S=m.useMemo(()=>Y?Y.toLowerCase().replace("-","_"):"",[Y]),_=!!((lt=L==null?void 0:L[S])!=null&<.delta)&&!!((bt=L==null?void 0:L[S])!=null&&bt.from_slot),k=_?`paradex_${(Zt=L==null?void 0:L[S])==null?void 0:Zt.from_slot}`:S;m.useEffect(()=>{var We,wt,At,Gt,fn,Rn,An,pr,mt,qt;if(!Y||!L)return;const Ge=k,Je=L==null?void 0:L[Ge];if(!Je){te(""),je(""),$e(""),ft(""),Vt(""),an("LONG"),mn("LIMIT"),C(!1),G("OFF"),cn("Hour"),Pt(""),Ut(""),X("paradex");return}if((Je==null?void 0:Je.target_params)==null&&Je.source_params){Je!=null&&Je.isStop?C(!1):C(!0),G("OFF");const Qt=Je.source_params,In=(Je==null?void 0:Je.slot_number)??"";In&&!_&&ie(`Paradex-${In}`),Qt!=null&&Qt.cycleSeconds&&cn((Qt==null?void 0:Qt.cycleSeconds)===86400?"Day":"Hour");const or=(Qt==null?void 0:Qt.paradex_pkey)??"",Wn=(Qt==null?void 0:Qt.paradex_address)??"";if(or&&te(String(or)),Wn&&je(String(Wn)),Qt!=null&&Qt.coin){const Vn=String(Qt.coin).replace(/-USD$/,"");$e(Vn)}(Qt==null?void 0:Qt.orderPerHour)!=null&&ft(String(Qt.orderPerHour)),(Qt==null?void 0:Qt.leverage)!=null&&Vt(String(Qt.leverage)),Qt!=null&&Qt.direction&&an(String(Qt.direction).toUpperCase()==="SHORT"?"SHORT":String(Qt.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),Qt!=null&&Qt.orderType&&mn(String(Qt.orderType).toUpperCase()==="MARKET"?"MARKET":String(Qt.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(Qt==null?void 0:Qt.tp)!=null&&Pt(String(Qt.tp)),(Qt==null?void 0:Qt.sl)!=null&&Ut(String(Qt.sl))}else if((Je==null?void 0:Je.target_params)!==null){Je!=null&&Je.isStop?C(!1):C(!0),G("OFF");const Qt=(Je==null?void 0:Je.slot_number)??"";Qt&&!_&&ie(`Paradex-${Qt}`),(We=Je==null?void 0:Je.source_params)!=null&&We.coin&&$e(String((wt=Je==null?void 0:Je.source_params)==null?void 0:wt.coin)),((At=Je==null?void 0:Je.source_params)==null?void 0:At.orderPerHour)!=null&&ft(String((Gt=Je==null?void 0:Je.source_params)==null?void 0:Gt.orderPerHour)),((fn=Je==null?void 0:Je.source_params)==null?void 0:fn.leverage)!=null&&Vt(String((Rn=Je==null?void 0:Je.source_params)==null?void 0:Rn.leverage)),(An=Je==null?void 0:Je.source_params)!=null&&An.accountType&&setStatusType(((pr=Je==null?void 0:Je.source_params)==null?void 0:pr.accountType)==="standart"?"STANDARD":"PREMIUM"),(mt=Je==null?void 0:Je.target_params)!=null&&mt.accountType&&setStatusTypeTwo(((qt=Je==null?void 0:Je.target_params)==null?void 0:qt.accountType)==="standart"?"STANDARD":"PREMIUM"),Je!=null&&Je.target_app&&X(((Je==null?void 0:Je.target_app)==="paradex","paradex"))}else C(!1),G("OFF")},[Y,L,_,k]);const T=Ge=>{var Je;return Number(((Je=String(Ge||"").match(/\d+/))==null?void 0:Je[0])||0)},B=Ge=>(Ge||"").toLowerCase().replace("-","_"),W=m.useMemo(()=>{const Ge=L==null?void 0:L[B(Y)];if(Ge!=null&&Ge.delta&&(Ge!=null&&Ge.from_slot))return Number(Ge.from_slot);const Je=Number(Ge==null?void 0:Ge.slot_number);return Number.isFinite(Je)?Je:T(Y)},[Y,L]),ee=m.useMemo(()=>{const Ge=Number(N)||0,Je=Array.from({length:Ge},()=>({used:!1,kind:null})),We=L||{};for(const[wt,At]of Object.entries(We)){if(!wt.startsWith("paradex"))continue;const Gt=T(wt)-1;Gt<0||Gt>=Ge||((At==null?void 0:At.isStop)===!0?Je[Gt]={used:!1,kind:null}:At!=null&&At.source_params?Je[Gt]={used:!0,kind:"delta-src"}:At!=null&&At.target_params||At!=null&&At.delta?Je[Gt]={used:!0,kind:"delta-shadow"}:At!=null&&At.farming_params?Je[Gt]={used:!0,kind:"single"}:Je[Gt]={used:!0,kind:"unknown"})}return Je},[L,N]),de=m.useMemo(()=>ee.map((Ge,Je)=>Ge.used&&Ge.kind!=="delta-src-inferred"?`Paradex-${Je+1}`:null).filter(Boolean),[ee]);m.useMemo(()=>ee.filter(Ge=>!Ge.used).length,[ee]);async function fe(){if(!g){n(!0);return}if(Un)try{et(!0),ut("");const Ge=window.localStorage.getItem("hyperToken"),Je=window.localStorage.getItem("hyperAddress");if(!Ge||!Je){n(!0);return}const We={paradex_address:ye,paradex_pkey:V,cycleSeconds:rn==="Hour"?3600:86400,tp:Number(dn),sl:Number(Xe),coin:`${Qe}`,orderPerHour:Number(ot),leverage:Number(ct),direction:It,orderType:Nt},wt={api_pkey:ae,login_wallet:Ie,coin:Qe==null?void 0:Qe.replace("USDT",""),orderPerHour:Number(ot),leverage:Number(ct)},At={address:Je.toLowerCase(),token:Ge,slot_number:Number(Y==null?void 0:Y.replace("Paradex-","")),source_app:"paradex",source_params:We},fn=await(await fetch(`${_t}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(At)})).json();fn!=null&&fn.success?(C(!0),h(),kt&&Ee()):ut((fn==null?void 0:fn.error_message)||"Start failed.")}catch(Ge){ut(Ge.message||"An error occurred while saving.")}finally{et(!1)}}async function xe(){if(!g){n(!0);return}try{Mt(!0),ut("");const Ge=window.localStorage.getItem("hyperToken"),Je=window.localStorage.getItem("hyperAddress");if(!Ge||!Je){n(!0);return}const wt=await(await fetch(`${_t}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Je.toLowerCase(),token:Ge,source_app:"paradex",slot_number:W})})).json();wt!=null&&wt.success?(C(!1),h()):ut((wt==null?void 0:wt.error_message)||"Stop failed.")}catch(Ge){ut(Ge.message||"An error occurred while stopping.")}finally{Mt(!1)}}const we={control:(Ge,Je)=>({...Ge,backgroundColor:"#242424",borderColor:Je.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Ge=>({...Ge,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Ge=>({...Ge,height:32}),input:Ge=>({...Ge,color:"#FFFFFF",margin:0,padding:0}),singleValue:Ge=>({...Ge,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Ge=>({...Ge,color:"#7F7F7F",fontSize:"12px"}),menu:Ge=>({...Ge,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Ge=>({...Ge,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Ge,Je)=>({...Ge,backgroundColor:Je.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Ge=>({...Ge,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Ge=>({...Ge,backgroundColor:"#353535"})},ke=({max:Ge})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Ge,"x"]}),Me=Ge=>{var Je;return i.jsx(Ca.Option,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Je=Ge.data)!=null&&Je.icon?i.jsx("img",{src:Ge.data.icon,alt:Ge.data.label,className:"w-4 h-4 rounded-[4px]",onError:We=>We.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),i.jsx(ke,{max:Ge.data.maxLeverage})]})})},Ye=Ge=>{var Je;return i.jsx(Ca.SingleValue,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Je=Ge.data)!=null&&Je.icon?i.jsx("img",{src:Ge.data.icon,alt:Ge.data.label,className:"w-4 h-4 rounded-[4px]",onError:We=>We.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),i.jsx(ke,{max:Ge.data.maxLeverage})]})})},Fe=Ge=>{const Je=de.includes(Ge.data.value);return i.jsx(Ca.Option,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),Je&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},st=Ge=>i.jsx(Ca.SingleValue,{...Ge,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label})})}),se=async()=>{var We,wt,At,Gt,fn,Rn,An,pr;const Ge=window.localStorage.getItem("hyperToken"),Je=window.localStorage.getItem("hyperAddress");if(!(!Ge||!Je))try{pt(!0);const mt=await ji(Je.toLowerCase(),Ge);mt!=null&&mt.success?(r(mt==null?void 0:mt.telegram_chat_id),s(mt==null?void 0:mt.subscriber_role),a(mt==null?void 0:mt.subs_expire_day),o((We=mt==null?void 0:mt.mushboomer_counts)==null?void 0:We.eth),l((wt=mt==null?void 0:mt.mushboomer_counts)==null?void 0:wt.sol),c(mt==null?void 0:mt.referral_code),u(mt==null?void 0:mt.refcode),d(mt==null?void 0:mt.whitelist),f(Ge),x(Je),Oe(!0),I((Gt=(At=mt==null?void 0:mt.slots_info)==null?void 0:At.paradex)==null?void 0:Gt.total_qty),U((Rn=(fn=mt==null?void 0:mt.slots_info)==null?void 0:fn.paradex)==null?void 0:Rn.total_qty),R((pr=(An=mt==null?void 0:mt.slots_info)==null?void 0:An.paradex)==null?void 0:pr.active_qty),pt(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),pt(!1))}catch(mt){console.error("Token verification error:",mt),console.error(mt.message||"An unknown error occurred."),pt(!1)}},Se=it,De=m.useMemo(()=>Array.from({length:N},(Ge,Je)=>({value:`Paradex-${Je+1}`,label:`Paradex-${Je+1}`})),[N]);if(!e)return null;const Le=en||Et||Be||Ke,_e=w&&!Be,nt=yn(Qe);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:zn,setOpen:$n,transactionHash:nr,transactionLoading:bn,paymentPresaleRole:on,errorFunds:xt,activeMethod:2}),i.jsx(p5,{open:re,setOpen:pe,paymentLighterRole:on,oldSlotCount:Q,checkAccountLighter:se,tradeMarket:"paradex"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Le&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-3",children:[i.jsx(nMe,{className:"text-white"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] -mt-1",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Paradex Farming module lets you set up automated farming by providing your Paradex Address, Paradex Private Key, selecting a pair, defining trade per hour, leverage, direction, order type, take profit and stop loss."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:o5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[Ve&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:Ve}),g&&on&&F===P&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"No free Paradex slots."}),g&&on&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(r5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[P||0,"/",De.length]})]})]}),i.jsx(Cl,{styles:we,components:{Option:Fe,SingleValue:st},options:De,value:De.find(Ge=>Ge.value===Y)||null,onChange:Ge=>ie((Ge==null?void 0:Ge.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:`${oe==="ON"?"py-1":"py-5"} space-y-3 px-3 sm:px-5`,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[oe==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Stark Key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Ge=>je(Ge.target.value),autoComplete:"off",placeholder:"1st Stark Key Public ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Ge=>te(Ge.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:un?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>On(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:un?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ce,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return ce("");Tn(Je)&&ce(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ce===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Paradex Adress"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Ge=>je(Ge.target.value),autoComplete:"off",placeholder:"PARADEX_ADDRESS",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Paradex Private Key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Ge=>te(Ge.target.value),autoComplete:"off",placeholder:"PARADEX_PRIVATE_KEY",type:un?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>On(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:un?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),oe==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ie,onChange:Ge=>Re(Ge.target.value),autoComplete:"off",placeholder:"2nd Stark key Public",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ae,onChange:Ge=>he(Ge.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:En?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>jn(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:En?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ge,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return Ae("");Tn(Je)&&Ae(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ge===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:ot,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return ft("");Tn(Je)&&ft(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ot===""?"border-[#353535]":Kn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e}),ot!==""&&!Kn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:we,components:{Option:Me,SingleValue:Ye},isDisabled:Le||_e,options:Se,value:Se.find(Ge=>Ge.value===Qe)||null,onChange:Ge=>$e((Ge==null?void 0:Ge.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:rn,onChange:Ge=>cn(Ge.target.value),className:`${Le||_e?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:Le||_e,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:ot,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return ft("");Tn(Je)&&ft(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ot===""?"border-[#353535]":Kn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e}),ot!==""&&!Kn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(jo,{checked:oe==="ON",onChange:Ge=>G(Ge?"ON":"OFF"),disabled:Le||_e,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${Le||_e?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:ct,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return Vt("");Tn(Je)&&Vt(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:Qe?`1–${nt}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ct===""?"border-[#353535]":ir?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":It==="LONG",onClick:()=>!_e&&an("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",It==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",ct?` - ${ct}x`:""]})}),i.jsx("div",{"aria-pressed":It==="SHORT",onClick:()=>!_e&&an("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",It==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",ct?` - ${ct}x`:""]})}),i.jsx("div",{"aria-pressed":It==="RANDOM",onClick:()=>!_e&&an("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",It==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",ct?` - ${ct}x`:""]})})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":Nt==="MARKET",onClick:()=>!_e&&mn("MARKET"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",Nt==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",Nt==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Nt==="LIMIT",onClick:()=>!_e&&mn("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",Nt==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",Nt==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Nt==="RANDOM",onClick:()=>!_e&&mn("RANDOM"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",Nt==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["RANDOM ",Nt==="RANDOM"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:dn,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return Pt("");sn(Je)&&Pt(Je)},onKeyDown:Dt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${dn===""?"border-[#353535]":rr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]}),dn!==""&&!rr&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Xe,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return Ut("");sn(Je)&&Ut(Je)},onKeyDown:Dt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":Jt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]}),Xe!==""&&!Jt&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",ct?Math.max(ct*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),!1]}),i.jsx("div",{className:`${oe==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Le&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:Le,children:"Cancel"}),g?oe==="ON"?w?i.jsx("button",{onClick:xe,disabled:Le,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Be?"Stopping...":"Stop"}):i.jsx("button",{onClick:fe,disabled:!Un||Le,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Un||Le?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Et?"Starting...":"Start"}):w?i.jsx("button",{onClick:xe,disabled:Le,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Be?"Stopping...":"Stop"}):i.jsx("button",{onClick:fe,disabled:!Un||Le,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Un||Le?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Et?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),en&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},qoe=({open:e=!1,setOpen:t=()=>{}})=>{var lt,bt,Zt;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Qr);Jr();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(1),[P,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[Q,ne]=m.useState(null),[J,X]=m.useState("pacifica");m.useState(!1),m.useRef(null);const[re,pe]=m.useState(!1),[Y,ie]=m.useState(""),[oe,G]=m.useState("OFF"),[V,te]=m.useState(""),[ae,he]=m.useState(""),[Ce,ce]=m.useState("");m.useState("");const[ge,Ae]=m.useState(""),[ye,je]=m.useState(""),[Ie,Re]=m.useState(""),[Qe,$e]=m.useState(""),[it,tt]=m.useState([]),[ot,ft]=m.useState(""),[ct,Vt]=m.useState(""),[It,an]=m.useState("LONG"),[Nt,mn]=m.useState("MARKET"),[dn,Pt]=m.useState(""),[Xe,Ut]=m.useState(""),[Lt,qe]=m.useState(""),[Ke,pt]=m.useState(!1),[en,Bt]=m.useState(!1),[Et,et]=m.useState(!1),[Be,Mt]=m.useState(!1),[Ve,ut]=m.useState(""),[xt,jt]=m.useState(""),[kt,xn]=m.useState(!0),[un,On]=m.useState(!1),[En,jn]=m.useState(!1),[bn,Zn]=m.useState(!1),[zn,$n]=m.useState(!1),[nr,wn]=m.useState(""),[on,Oe]=m.useState(!0),[rn,cn]=m.useState("Hour"),_t="https://dextrabothypev2.nftinit.io",Yn="";m.useEffect(()=>{async function Ge(){if(e)try{const We=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=pacifica")).json();if(We!=null&&We.coins){let wt=We.coins.map(At=>{const Rn=`https://app.pacifica.fi/imgs/tokens/${(At==null?void 0:At.label)||""}.svg`;return{...At,icon:Rn}});tt(wt)}}catch(Je){console.error("Failed to fetch coin list:",Je)}}Ge()},[e]);const yn=Ge=>{var Je;return((Je=it.find(We=>We.value===Ge))==null?void 0:Je.maxLeverage)??100},Dt=Ge=>{["e","E","+","-"].includes(Ge.key)&&Ge.preventDefault()},sn=Ge=>/^\d*\.?\d{0,6}$/.test(Ge),Tn=Ge=>/^\d*$/.test(Ge),Kn=m.useMemo(()=>{if(ot==="")return!1;const Ge=Number(ot);return Number.isInteger(Ge)&&Ge>=1&&Ge<=180},[ot]),ir=m.useMemo(()=>{if(ct==="")return!1;const Ge=Number(ct),Je=yn(Qe);return Number.isInteger(Ge)&&Ge>=1&&Ge<=Je},[ct,Qe,it]),rr=m.useMemo(()=>{if(dn==="")return!1;const Ge=Number(dn);return Number.isNaN(Ge)?!1:Ge===0?!0:Ge>=1&&Ge<=1e7},[dn]),Jt=m.useMemo(()=>{if(Xe==="")return!1;const Ge=Number(Xe);if(Number.isNaN(Ge))return!1;const Je=ct===""?null:Number(ct),We=Je?Je*100-1:4999;return Ge===0?!0:Ge>0&&Ge<1?!1:Ge>=1&&Ge<=We},[Xe,ct]);m.useMemo(()=>{if(Lt==="")return!1;const Ge=Number(Lt);return!Number.isNaN(Ge)&&Ge>0&&Ge<=100},[Lt]);const Un=g&&V.trim()!==""&&ye.trim()!==""&&Qe!==""&&Kn&&ir&&Y&&(!dn||rr)&&(!Xe||Jt)&&(It==="LONG"||It==="SHORT"||It==="RANDOM")&&(Nt==="LIMIT"||Nt==="MARKET"||Nt==="RANDOM")&&on,Qn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Rt=()=>`pacificaCreds:${Qn()}`,Pn=()=>{try{const Ge=localStorage.getItem(Rt());if(!Ge)return;const Je=JSON.parse(Ge);Je.privateKey&&te(Je.privateKey),Je.loginAddress&&je(Je.loginAddress),typeof Je.remember=="boolean"&&xn(Je.remember)}catch{}},Ee=()=>{if(kt)try{localStorage.setItem(Rt(),JSON.stringify({privateKey:V,loginAddress:ye,remember:!0}))}catch{}},p=()=>{try{localStorage.removeItem(Rt())}catch{}};m.useEffect(()=>{if(!e)return;const Ge=localStorage.getItem("hyperToken"),Je=localStorage.getItem("hyperAddress");v(!!(Ge&&Je));const We=setInterval(()=>{const wt=localStorage.getItem("hyperToken"),At=localStorage.getItem("hyperAddress");v(!!(wt&&At))},800);return()=>clearInterval(We)},[e]),m.useEffect(()=>{!e||!g||(h(),se())},[e,g]),m.useEffect(()=>{e&&(Xe===""&&Ut(Yn),dn===""&&Pt(Yn),Lt===""&&qe(Yn))},[e]),m.useEffect(()=>{if(!Qe)return;const Ge=yn(Qe),Je=Number(ct);!Number.isNaN(Je)&&Je>Ge&&Vt(String(Ge)),!Number.isNaN(Je)&&Je<1&&ct!==""&&Vt("1")},[Qe]),m.useEffect(()=>{e&&(kt&&Ee(),kt||p())},[V,ye,kt,e]);async function h(){var Ge,Je,We,wt,At,Gt,fn,Rn;try{Bt(!0),ut("");const An=window.localStorage.getItem("hyperToken"),pr=window.localStorage.getItem("hyperAddress");if(!An||!pr){C(!1),Pn();return}const qt=await(await fetch(`${_t}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:pr.toLowerCase(),token:An})})).json();if(!(qt!=null&&qt.success)){if(console.warn("INFO API RESPONSE:",qt==null?void 0:qt.error_message),(qt==null?void 0:qt.error_message)==="You have not a running process"){const Qt=Y?Y.toLowerCase().replace("-","_"):null,In=L==null?void 0:L[Qt];if(Qt&&In){const or={...L,[Qt]:{...In,isStop:!0}};z(or);const Vn=Object.keys(or).filter(gr=>gr.startsWith("pacifica"));if(Vn.length>0&&!Y){const Fr=Vn.sort((Lr,Ht)=>{var Br,Kr;const nn=parseInt(((Br=Lr.match(/\d+/))==null?void 0:Br[0])||0,10),Sr=parseInt(((Kr=Ht.match(/\d+/))==null?void 0:Kr[0])||0,10);return nn-Sr})[0].match(/\d+/);Fr&&ie(`Pacifica-${Fr[0]}`)}}else ie("Pacifica-1")}qt!=null&&qt.slots_info&&(U((Je=(Ge=qt==null?void 0:qt.slots_info)==null?void 0:Ge.pacifica)==null?void 0:Je.total_qty),R((wt=(We=qt==null?void 0:qt.slots_info)==null?void 0:We.pacifica)==null?void 0:wt.active_qty));return}if(qt!=null&&qt.success&&(qt!=null&&qt.data)){const Qt=Y?Y.toLowerCase().replace("-","_"):null,In=L==null?void 0:L[Qt],or=qt.data||{};Qt&&!or[Qt]&&In&&(or[Qt]={...In,isStop:!0}),z(or);const Vn=Object.keys(or).filter(gr=>gr.startsWith("pacifica"));if(Vn.length>0&&!Y){const Fr=Vn.sort((Lr,Ht)=>{var Br,Kr;const nn=parseInt(((Br=Lr.match(/\d+/))==null?void 0:Br[0])||0,10),Sr=parseInt(((Kr=Ht.match(/\d+/))==null?void 0:Kr[0])||0,10);return nn-Sr})[0].match(/\d+/);Fr&&ie(`Pacifica-${Fr[0]}`)}qt!=null&&qt.slots_info&&(U((Gt=(At=qt==null?void 0:qt.slots_info)==null?void 0:At.pacifica)==null?void 0:Gt.total_qty),R((Rn=(fn=qt==null?void 0:qt.slots_info)==null?void 0:fn.pacifica)==null?void 0:Rn.active_qty))}}catch{C(!1),Pn(),G("OFF")}finally{Bt(!1)}}const S=m.useMemo(()=>Y?Y.toLowerCase().replace("-","_"):"",[Y]),_=!!((lt=L==null?void 0:L[S])!=null&<.delta)&&!!((bt=L==null?void 0:L[S])!=null&&bt.from_slot),k=_?`pacifica_${(Zt=L==null?void 0:L[S])==null?void 0:Zt.from_slot}`:S;m.useEffect(()=>{var We,wt,At,Gt,fn,Rn,An,pr,mt,qt;if(!Y||!L)return;const Ge=k,Je=L==null?void 0:L[Ge];if(!Je){te(""),je(""),$e(""),ft(""),Vt(""),an("LONG"),mn("LIMIT"),C(!1),G("OFF"),cn("Hour"),Pt(""),Ut(""),X("pacifica");return}if((Je==null?void 0:Je.target_params)==null&&Je.source_params){Je!=null&&Je.isStop?C(!1):C(!0),G("OFF");const Qt=Je.source_params,In=(Je==null?void 0:Je.slot_number)??"";In&&!_&&ie(`Pacifica-${In}`),Qt!=null&&Qt.cycleSeconds&&cn((Qt==null?void 0:Qt.cycleSeconds)===86400?"Day":"Hour");const or=(Qt==null?void 0:Qt.agent_pkey)??"",Wn=(Qt==null?void 0:Qt.login_address)??"";if(or&&te(String(or)),Wn&&je(String(Wn)),Qt!=null&&Qt.coin){const Vn=String(Qt.coin);$e(Vn)}(Qt==null?void 0:Qt.orderPerHour)!=null&&ft(String(Qt.orderPerHour)),(Qt==null?void 0:Qt.leverage)!=null&&Vt(String(Qt.leverage)),Qt!=null&&Qt.direction&&an(String(Qt.direction).toUpperCase()==="SHORT"?"SHORT":String(Qt.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),Qt!=null&&Qt.orderType&&mn(String(Qt.orderType).toUpperCase()==="MARKET"?"MARKET":String(Qt.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(Qt==null?void 0:Qt.tp)!=null&&Pt(String(Qt.tp)),(Qt==null?void 0:Qt.sl)!=null&&Ut(String(Qt.sl))}else if((Je==null?void 0:Je.target_params)!==null){Je!=null&&Je.isStop?C(!1):C(!0),G("OFF");const Qt=(Je==null?void 0:Je.slot_number)??"";Qt&&!_&&ie(`Pacifica-${Qt}`),(We=Je==null?void 0:Je.source_params)!=null&&We.coin&&$e(String((wt=Je==null?void 0:Je.source_params)==null?void 0:wt.coin)),((At=Je==null?void 0:Je.source_params)==null?void 0:At.orderPerHour)!=null&&ft(String((Gt=Je==null?void 0:Je.source_params)==null?void 0:Gt.orderPerHour)),((fn=Je==null?void 0:Je.source_params)==null?void 0:fn.leverage)!=null&&Vt(String((Rn=Je==null?void 0:Je.source_params)==null?void 0:Rn.leverage)),(An=Je==null?void 0:Je.source_params)!=null&&An.accountType&&setStatusType(((pr=Je==null?void 0:Je.source_params)==null?void 0:pr.accountType)==="standart"?"STANDARD":"PREMIUM"),(mt=Je==null?void 0:Je.target_params)!=null&&mt.accountType&&setStatusTypeTwo(((qt=Je==null?void 0:Je.target_params)==null?void 0:qt.accountType)==="standart"?"STANDARD":"PREMIUM"),Je!=null&&Je.target_app&&X(((Je==null?void 0:Je.target_app)==="pacifica","pacifica"))}else C(!1),G("OFF")},[Y,L,_,k]);const T=Ge=>{var Je;return Number(((Je=String(Ge||"").match(/\d+/))==null?void 0:Je[0])||0)},B=Ge=>(Ge||"").toLowerCase().replace("-","_"),W=m.useMemo(()=>{const Ge=L==null?void 0:L[B(Y)];if(Ge!=null&&Ge.delta&&(Ge!=null&&Ge.from_slot))return Number(Ge.from_slot);const Je=Number(Ge==null?void 0:Ge.slot_number);return Number.isFinite(Je)?Je:T(Y)},[Y,L]),ee=m.useMemo(()=>{const Ge=Number(N)||0,Je=Array.from({length:Ge},()=>({used:!1,kind:null})),We=L||{};for(const[wt,At]of Object.entries(We)){if(!wt.startsWith("pacifica"))continue;const Gt=T(wt)-1;Gt<0||Gt>=Ge||((At==null?void 0:At.isStop)===!0?Je[Gt]={used:!1,kind:null}:At!=null&&At.source_params?Je[Gt]={used:!0,kind:"delta-src"}:At!=null&&At.target_params||At!=null&&At.delta?Je[Gt]={used:!0,kind:"delta-shadow"}:At!=null&&At.farming_params?Je[Gt]={used:!0,kind:"single"}:Je[Gt]={used:!0,kind:"unknown"})}return Je},[L,N]),de=m.useMemo(()=>ee.map((Ge,Je)=>Ge.used&&Ge.kind!=="delta-src-inferred"?`Pacifica-${Je+1}`:null).filter(Boolean),[ee]);m.useMemo(()=>ee.filter(Ge=>!Ge.used).length,[ee]);async function fe(){if(!g){n(!0);return}if(Un)try{et(!0),ut("");const Ge=window.localStorage.getItem("hyperToken"),Je=window.localStorage.getItem("hyperAddress");if(!Ge||!Je){n(!0);return}const We={login_address:ye,agent_pkey:V,cycleSeconds:rn==="Hour"?3600:86400,tp:Number(dn),sl:Number(Xe),coin:`${Qe}`,orderPerHour:Number(ot),leverage:Number(ct),direction:It,orderType:Nt},wt={api_pkey:ae,login_wallet:Ie,coin:Qe==null?void 0:Qe.replace("USDT",""),orderPerHour:Number(ot),leverage:Number(ct)},At={address:Je.toLowerCase(),token:Ge,slot_number:Number(Y==null?void 0:Y.replace("Pacifica-","")),source_app:"pacifica",source_params:We},fn=await(await fetch(`${_t}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(At)})).json();fn!=null&&fn.success?(C(!0),h(),kt&&Ee()):ut((fn==null?void 0:fn.error_message)||"Start failed.")}catch(Ge){ut(Ge.message||"An error occurred while saving.")}finally{et(!1)}}async function xe(){if(!g){n(!0);return}try{Mt(!0),ut("");const Ge=window.localStorage.getItem("hyperToken"),Je=window.localStorage.getItem("hyperAddress");if(!Ge||!Je){n(!0);return}const wt=await(await fetch(`${_t}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Je.toLowerCase(),token:Ge,source_app:"pacifica",slot_number:W})})).json();wt!=null&&wt.success?(C(!1),h()):ut((wt==null?void 0:wt.error_message)||"Stop failed.")}catch(Ge){ut(Ge.message||"An error occurred while stopping.")}finally{Mt(!1)}}const we={control:(Ge,Je)=>({...Ge,backgroundColor:"#242424",borderColor:Je.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Ge=>({...Ge,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Ge=>({...Ge,height:32}),input:Ge=>({...Ge,color:"#FFFFFF",margin:0,padding:0}),singleValue:Ge=>({...Ge,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Ge=>({...Ge,color:"#7F7F7F",fontSize:"12px"}),menu:Ge=>({...Ge,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Ge=>({...Ge,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Ge,Je)=>({...Ge,backgroundColor:Je.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Ge=>({...Ge,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Ge=>({...Ge,backgroundColor:"#353535"})},ke=({max:Ge})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Ge,"x"]}),Me=Ge=>{var Je;return i.jsx(Ca.Option,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Je=Ge.data)!=null&&Je.icon?i.jsx("img",{src:Ge.data.icon,alt:Ge.data.label,className:"w-4 h-4 rounded-[4px]",onError:We=>We.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),i.jsx(ke,{max:Ge.data.maxLeverage})]})})},Ye=Ge=>{var Je;return i.jsx(Ca.SingleValue,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Je=Ge.data)!=null&&Je.icon?i.jsx("img",{src:Ge.data.icon,alt:Ge.data.label,className:"w-4 h-4 rounded-[4px]",onError:We=>We.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),i.jsx(ke,{max:Ge.data.maxLeverage})]})})},Fe=Ge=>{const Je=de.includes(Ge.data.value);return i.jsx(Ca.Option,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),Je&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},st=Ge=>i.jsx(Ca.SingleValue,{...Ge,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label})})}),se=async()=>{var We,wt,At,Gt,fn,Rn,An,pr;const Ge=window.localStorage.getItem("hyperToken"),Je=window.localStorage.getItem("hyperAddress");if(!(!Ge||!Je))try{pt(!0);const mt=await ji(Je.toLowerCase(),Ge);mt!=null&&mt.success?(r(mt==null?void 0:mt.telegram_chat_id),s(mt==null?void 0:mt.subscriber_role),a(mt==null?void 0:mt.subs_expire_day),o((We=mt==null?void 0:mt.mushboomer_counts)==null?void 0:We.eth),l((wt=mt==null?void 0:mt.mushboomer_counts)==null?void 0:wt.sol),c(mt==null?void 0:mt.referral_code),u(mt==null?void 0:mt.refcode),d(mt==null?void 0:mt.whitelist),f(Ge),x(Je),Oe(!0),I((Gt=(At=mt==null?void 0:mt.slots_info)==null?void 0:At.pacifica)==null?void 0:Gt.total_qty),U((Rn=(fn=mt==null?void 0:mt.slots_info)==null?void 0:fn.pacifica)==null?void 0:Rn.total_qty),R((pr=(An=mt==null?void 0:mt.slots_info)==null?void 0:An.pacifica)==null?void 0:pr.active_qty),pt(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),pt(!1))}catch(mt){console.error("Token verification error:",mt),console.error(mt.message||"An unknown error occurred."),pt(!1)}},Se=it,De=m.useMemo(()=>Array.from({length:N},(Ge,Je)=>({value:`Pacifica-${Je+1}`,label:`Pacifica-${Je+1}`})),[N]);if(!e)return null;const Le=en||Et||Be||Ke,_e=w&&!Be,nt=yn(Qe);return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:zn,setOpen:$n,transactionHash:nr,transactionLoading:bn,paymentPresaleRole:on,errorFunds:xt,activeMethod:2}),i.jsx(p5,{open:re,setOpen:pe,paymentLighterRole:on,oldSlotCount:Q,checkAccountLighter:se,tradeMarket:"pacifica"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Le&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-3",children:[i.jsx("img",{src:"https://app.pacifica.fi/imgs/logo.svg",alt:"",className:"h-9"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] mt-1",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Pacifica Farming module lets you set up automated farming by providing your Pacifica Address, Pacifica Private Key, selecting a pair, defining trade per hour, leverage, direction, order type, take profit and stop loss."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:o5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[Ve&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:Ve}),g&&on&&F===P&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"No free Pacifica slots."}),g&&on&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(r5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[P||0,"/",De.length]})]})]}),i.jsx(Cl,{styles:we,components:{Option:Fe,SingleValue:st},options:De,value:De.find(Ge=>Ge.value===Y)||null,onChange:Ge=>ie((Ge==null?void 0:Ge.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:`${oe==="ON"?"py-1":"py-5"} space-y-3 px-3 sm:px-5`,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[oe==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Stark Key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Ge=>je(Ge.target.value),autoComplete:"off",placeholder:"1st Stark Key Public ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Ge=>te(Ge.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:un?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>On(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:un?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ce,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return ce("");Tn(Je)&&ce(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ce===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Login Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Ge=>je(Ge.target.value),autoComplete:"off",placeholder:"LOGIN_WALLET_ADDRESS",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Pacifica Private Key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Ge=>te(Ge.target.value),autoComplete:"off",placeholder:"PACIFICA_PRIVATE_KEY",type:un?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>On(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:un?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]})]}),oe==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ie,onChange:Ge=>Re(Ge.target.value),autoComplete:"off",placeholder:"2nd Stark key Public",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ae,onChange:Ge=>he(Ge.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:En?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>jn(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:En?i.jsx(la,{size:14}):i.jsx(ca,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ge,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return Ae("");Tn(Je)&&Ae(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ge===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:ot,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return ft("");Tn(Je)&&ft(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ot===""?"border-[#353535]":Kn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e}),ot!==""&&!Kn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Cl,{styles:we,components:{Option:Me,SingleValue:Ye},isDisabled:Le||_e,options:Se,value:Se.find(Ge=>Ge.value===Qe)||null,onChange:Ge=>$e((Ge==null?void 0:Ge.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:rn,onChange:Ge=>cn(Ge.target.value),className:`${Le||_e?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:Le||_e,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:ot,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return ft("");Tn(Je)&&ft(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ot===""?"border-[#353535]":Kn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e}),ot!==""&&!Kn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(jo,{checked:oe==="ON",onChange:Ge=>G(Ge?"ON":"OFF"),disabled:Le||_e,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${Le||_e?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:ct,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return Vt("");Tn(Je)&&Vt(Je)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:Qe?`1–${nt}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ct===""?"border-[#353535]":ir?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":It==="LONG",onClick:()=>!_e&&an("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",It==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",ct?` - ${ct}x`:""]})}),i.jsx("div",{"aria-pressed":It==="SHORT",onClick:()=>!_e&&an("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",It==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",ct?` - ${ct}x`:""]})}),i.jsx("div",{"aria-pressed":It==="RANDOM",onClick:()=>!_e&&an("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",It==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",ct?` - ${ct}x`:""]})})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":Nt==="MARKET",onClick:()=>!_e&&mn("MARKET"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",Nt==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",Nt==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Nt==="LIMIT",onClick:()=>!_e&&mn("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",Nt==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",Nt==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Nt==="RANDOM",onClick:()=>!_e&&mn("RANDOM"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",Nt==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["RANDOM ",Nt==="RANDOM"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:dn,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return Pt("");sn(Je)&&Pt(Je)},onKeyDown:Dt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${dn===""?"border-[#353535]":rr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]}),dn!==""&&!rr&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Xe,onChange:Ge=>{const Je=Ge.target.value.trim();if(Je==="")return Ut("");sn(Je)&&Ut(Je)},onKeyDown:Dt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":Jt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]}),Xe!==""&&!Jt&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",ct?Math.max(ct*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),!1]}),i.jsx("div",{className:`${oe==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Le&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:Le,children:"Cancel"}),g?oe==="ON"?w?i.jsx("button",{onClick:xe,disabled:Le,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Be?"Stopping...":"Stop"}):i.jsx("button",{onClick:fe,disabled:!Un||Le,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Un||Le?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Et?"Starting...":"Start"}):w?i.jsx("button",{onClick:xe,disabled:Le,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Be?"Stopping...":"Stop"}):i.jsx("button",{onClick:fe,disabled:!Un||Le,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Un||Le?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Et?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),en&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},YTt=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),[s,a]=m.useState(2),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(!1),I=(P=[])=>P==null?void 0:P.map(R=>R.submenu?{...R,submenu:I(R.submenu)}:R.action==="openAster"?{...R,onClick:()=>{a(2),r(!0)}}:R.action==="openFarm"?{...R,onClick:()=>t(!0)}:R.action==="openLighter"?{...R,onClick:()=>l(!0)}:R.action==="openApex"?{...R,onClick:()=>u(!0)}:R.action==="openVariational"?{...R,onClick:()=>f(!0)}:R.action==="openExtended"?{...R,onClick:()=>g(!0)}:R.action==="openParadex"?{...R,onClick:()=>w(!0)}:R.action==="openPacifica"?{...R,onClick:()=>N(!0)}:R);return i.jsxs(i.Fragment,{children:[i.jsx(hl,{to:"https://dextrabot.com/",className:"cursor-pointer",children:i.jsx("div",{className:"flex items-center gap-2 font-manrope",children:i.jsx("img",{src:EA,alt:"Dextrabot",loading:"eager",decoding:"async",width:32,height:32,className:"w-8 h-8 object-contain"})})}),i.jsx("div",{className:"flex items-center gap-1",children:iit.map(P=>P.type==="link"?i.jsx(KTt,{linkTo:P.to,title:P.label},P.to):P.type==="dropdown"?i.jsx(sit,{label:P.label,items:I(P.items),activePaths:P.activePaths,badgeLabel:P.badgeLabel,badgeTone:P.badgeTone},P.label):null)}),i.jsx($oe,{open:e,setOpen:t}),i.jsx(Uoe,{open:n,setOpen:r,defaultMethod:s}),i.jsx(zoe,{open:o,setOpen:l}),i.jsx(Hoe,{open:c,setOpen:u}),i.jsx(Voe,{open:d,setOpen:f}),i.jsx(v$,{open:x,setOpen:g}),i.jsx(Woe,{open:v,setOpen:w}),i.jsx(qoe,{open:C,setOpen:N})]})},_y=({className:e})=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M8.625 15.75C12.56 15.75 15.75 12.56 15.75 8.625C15.75 4.68997 12.56 1.5 8.625 1.5C4.68997 1.5 1.5 4.68997 1.5 8.625C1.5 12.56 4.68997 15.75 8.625 15.75Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M16.5 16.5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),dm=(e,t=null)=>{t&&e.target.src===t?e.target.src=TH:t&&e.target.src!==t?e.target.src=t:e.target.src!==TH&&(e.target.src=TH)},XTt=m.forwardRef(({setOpen:e},t)=>{const{searchTerminalCoin:n,isSearchTerminalError:r}=m.useContext(Qr),[s,a]=m.useState(""),[o,l]=m.useState([]),[c,u]=m.useState([]),[d,f]=m.useState([]),x={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{const C=JSON.parse(localStorage.getItem("recentWallets")||"[]");l(C);const N=JSON.parse(localStorage.getItem("recentCoins")||"[]");u(N)},[]);const g=C=>{a(C.target.value.toLowerCase())},v=C=>{C.key==="Enter"&&w()},w=()=>{if(s)if(s.match(/^0x[a-fA-F0-9]{40}$/)){const C=s==null?void 0:s.toLowerCase(),N=[C,...o.filter(I=>(I==null?void 0:I.toLowerCase())!==C)];N.length>12&&N.pop(),l(N),localStorage.setItem("recentWallets",JSON.stringify(N)),window.open(`/wallet-details/${s}`,"_blank"),e(!1)}else ln.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please enter a valid Ethereum address"})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"380px",minWidth:"380px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})};return m.useEffect(()=>{if(s.length>0){const C=s==null?void 0:s.toLowerCase(),N=n.filter(I=>Array.isArray(I)&&I.some(P=>{var R;return(R=P==null?void 0:P.toLowerCase())==null?void 0:R.includes(C)})).map(I=>I[0]);f(N)}else f([])},[s,n]),i.jsxs("div",{children:[i.jsx("div",{className:"sm:w-[416px] h-12 font-manrope z-[999]",children:i.jsxs("div",{className:"flex justify-between items-center bg-[#303030] h-full px-4 gap-1 sm:gap-2.5",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1 sm:gap-2.5 w-full",children:[i.jsx(_y,{className:"text-white"}),i.jsx("input",{type:"text",ref:t,placeholder:"Search coin or wallet",value:s,onChange:g,onKeyDown:v,className:"w-full bg-transparent text-white placeholder-[#989898] text-sm font-medium font-manrope leading-[8px] placeholder:leading-[8px] tracking-tight focus:outline-none h-12"})]}),i.jsx("div",{onClick:()=>a(""),className:`${(s==null?void 0:s.length)>0?"":"hidden"} text-[#aaa] hover:text-white outline-none focus:outline-none focus:ring-0 border-none w-6 min-w-6 h-[24px] bg-[#353535] hover:bg-[#585858] rounded-md flex justify-center items-center cursor-pointer`,children:i.jsx("img",{src:Ba,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})}),i.jsx("div",{className:`${s.match(/^0x[a-fA-F0-9]{40}$/)?"":"hidden"}`,children:i.jsx("div",{onClick:w,className:"w-16 h-7 px-4 py-3 rounded-[256px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#989898] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-xs font-medium font-inter leading-[8px]",children:"Search"})})})]})}),i.jsxs("div",{className:"recent-wallets",children:[i.jsx("div",{className:`${(d==null?void 0:d.length)===0&&"hidden"} text-white text-[11px] font-bold font-manrope leading-none tracking-wider bg-[#1f1f1f] pl-4 pb-2 pt-4`,children:"SEARCH RESULTS"}),i.jsx("ul",{className:`${(c==null?void 0:c.length)===0&&(o==null?void 0:o.length)===0?"h-full max-h-[320px]":"max-h-[120px]"} overflow-y-scroll overflow-x-hidden h-full pl-4 pb-4 flex flex-wrap gap-1 sm:gap-2`,children:(d==null?void 0:d.length)===0?i.jsx("div",{className:`${!s.match(/^0x[a-fA-F0-9]{40}$/)&&(s==null?void 0:s.length)>0?"min-h-10":""} w-full h-full flex justify-center items-center`,children:i.jsx("div",{className:`${!s.match(/^0x[a-fA-F0-9]{40}$/)&&(s==null?void 0:s.length)>0?"":"hidden"} text-[#989898] text-[13px] font-semibold font-manrope leading-none pt-4`,children:"No results for your search."})}):d==null?void 0:d.map((C,N)=>i.jsx("li",{className:"mt-1 sm:mt-2",children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-6 px-1 rounded-md border border-[#3a3a3a] max-w-max",children:i.jsx("div",{className:"flex justify-start items-center gap-2.5",children:i.jsxs("a",{href:`/terminal/${C}`,target:"_blank",className:"text-[#989898] text-[13px] font-semibold font-manrope leading-none hover:text-white flex gap-1.5 items-center",onClick:()=>{e(!1);const I=JSON.parse(localStorage.getItem("recentCoins")||"[]");I!=null&&I.includes(C)||(I.unshift(C),I.length>14&&I.pop(),localStorage.setItem("recentCoins",JSON.stringify(I)))},children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${x[C]||(C==null?void 0:C.split("/")[0])}.svg`,alt:C,className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-gray-700",loading:"lazy",onError:I=>dm(I)}),C]})})})},N))})]}),i.jsxs("div",{className:`${(c==null?void 0:c.length)===0?"hidden":""} recent-wallets pt-4`,children:[i.jsx("div",{className:"text-white text-[11px] font-bold font-manrope leading-none tracking-wider bg-[#1f1f1f] pl-4 pb-2",children:"RECENT COINS"}),i.jsx("ul",{className:"overflow-y-scroll overflow-x-hidden h-full max-h-[142px] sm:max-h-[132px] pl-4 pb-4 flex flex-wrap gap-1 sm:gap-2",children:Array.isArray(c)&&(c==null?void 0:c.map((C,N)=>i.jsx("li",{className:"mt-1 sm:mt-2",children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-6 px-1 rounded-md border border-[#3a3a3a] max-w-max",children:i.jsx("div",{className:"flex justify-start items-center gap-2.5",children:i.jsxs("a",{href:`/terminal/${C}`,target:"_blank",className:"text-[#989898] text-[13px] font-semibold font-manrope leading-none hover:text-white flex gap-1.5 items-center",onClick:()=>e(!1),children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${x[C]||(C==null?void 0:C.split("/")[0])}.svg`,alt:C,className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-gray-700",loading:"lazy",onError:I=>dm(I)}),C]})})})},N)))})]}),i.jsxs("div",{className:`${(o==null?void 0:o.length)===0?"hidden":""} recent-wallets pt-4`,children:[i.jsx("div",{className:"text-white text-[11px] font-bold font-manrope leading-none tracking-wider bg-[#1f1f1f] pl-4 pb-2",children:"RECENT WALLETS"}),i.jsx("ul",{className:"overflow-y-scroll overflow-x-hidden h-full max-h-[120px] sm:max-h-[190px] pl-4 pb-4 sm:pb-8 flex flex-wrap gap-2",children:o==null?void 0:o.map((C,N)=>i.jsx("li",{className:"mt-1 sm:mt-2",children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-6 px-1 rounded-md border border-[#3a3a3a] w-[120px]",children:i.jsx("div",{className:"flex justify-start items-center gap-2.5",children:i.jsxs("a",{href:`/wallet-details/${C}`,target:"_blank",className:"text-[#989898] text-[13px] font-semibold font-manrope leading-none hover:text-white flex gap-1.5 items-center",onClick:()=>e(!1),children:[i.jsx("img",{src:Ubt,alt:"",className:"w-4 h-4"}),C&&C.slice(0,6)+"..."+C.slice(-4)]})})})},N))})]})]})}),QTt=({open:e,setOpen:t})=>{const n=m.useRef(null);return m.useEffect(()=>{e&&setTimeout(()=>{var r;(r=n.current)==null||r.focus()},0)},[e]),i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden rounded-lg text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in sm:my-8 max-w-max data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95",children:i.jsx("div",{className:"max-w-[320px] sm:max-w-[416px] min-h-[200px] max-h-[600px] relative bg-[#1f1f1f] border-[#404040] rounded-lg shadow backdrop-blur-[32px]",children:i.jsx(XTt,{ref:n,setOpen:t})})})})})]})},rMe=()=>{const[e,t]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(QTt,{open:e,setOpen:t}),i.jsx("div",{onClick:()=>{t(!0)},className:"flex-shrink w-full min-w-[80px] lg:max-w-[250px] h-8 bg-[#353535] rounded-[256px] flex justify-between items-center px-4 cursor-pointer font-manrope group",children:i.jsxs("div",{className:"flex justify-start items-center gap-[11px]",children:[i.jsx("div",{children:i.jsx(_y,{className:"text-[#646464] group-hover:text-[#e2e2e2]"})}),i.jsx("div",{className:"font-manrope leading-none text-[#666666] group-hover:text-[#e2e2e2] text-sm font-medium min-w-max",children:"Search..."})]})})]})};var Gge='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',ZTt={rounded:`SFRounded, ui-rounded, "SF Pro Rounded", ${Gge}`,system:Gge},T7={large:{actionButton:"9999px",connectButton:"12px",modal:"24px",modalMobile:"28px"},medium:{actionButton:"10px",connectButton:"8px",modal:"16px",modalMobile:"18px"},none:{actionButton:"0px",connectButton:"0px",modal:"0px",modalMobile:"0px"},small:{actionButton:"4px",connectButton:"4px",modal:"8px",modalMobile:"8px"}},JTt={large:{modalOverlay:"blur(20px)"},none:{modalOverlay:"blur(0px)"},small:{modalOverlay:"blur(4px)"}},sMe=({borderRadius:e="large",fontStack:t="rounded",overlayBlur:n="none"})=>({blurs:{modalOverlay:JTt[n].modalOverlay},fonts:{body:ZTt[t]},radii:{actionButton:T7[e].actionButton,connectButton:T7[e].connectButton,menuButton:T7[e].connectButton,modal:T7[e].modal,modalMobile:T7[e].modalMobile}}),iMe={blue:{accentColor:"#0E76FD",accentColorForeground:"#FFF"},green:{accentColor:"#1DB847",accentColorForeground:"#FFF"},orange:{accentColor:"#FF801F",accentColorForeground:"#FFF"},pink:{accentColor:"#FF5CA0",accentColorForeground:"#FFF"},purple:{accentColor:"#5F5AFA",accentColorForeground:"#FFF"},red:{accentColor:"#FA423C",accentColorForeground:"#FFF"}},Kge=iMe.blue,aMe=({accentColor:e=Kge.accentColor,accentColorForeground:t=Kge.accentColorForeground,...n}={})=>({...sMe(n),colors:{accentColor:e,accentColorForeground:t,actionButtonBorder:"rgba(0, 0, 0, 0.04)",actionButtonBorderMobile:"rgba(0, 0, 0, 0.06)",actionButtonSecondaryBackground:"rgba(0, 0, 0, 0.06)",closeButton:"rgba(60, 66, 66, 0.8)",closeButtonBackground:"rgba(0, 0, 0, 0.06)",connectButtonBackground:"#FFF",connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.06))",connectButtonText:"#25292E",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(255, 255, 255, 0) 9.49%, rgba(171, 171, 171, 0.04) 71.04%), #FFFFFF",downloadTopCardBackground:"linear-gradient(126deg, rgba(171, 171, 171, 0.2) 9.49%, rgba(255, 255, 255, 0) 71.04%), #FFFFFF",error:"#FF494A",generalBorder:"rgba(0, 0, 0, 0.06)",generalBorderDim:"rgba(0, 0, 0, 0.03)",menuItemBackground:"rgba(60, 66, 66, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.3)",modalBackground:"#FFF",modalBorder:"transparent",modalText:"#25292E",modalTextDim:"rgba(60, 66, 66, 0.3)",modalTextSecondary:"rgba(60, 66, 66, 0.6)",profileAction:"#FFF",profileActionHover:"rgba(255, 255, 255, 0.5)",profileForeground:"rgba(60, 66, 66, 0.06)",selectedOptionBorder:"rgba(60, 66, 66, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.12)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});aMe.accentColors=iMe;var xO="#1A1B1F",oMe={blue:{accentColor:"#3898FF",accentColorForeground:"#FFF"},green:{accentColor:"#4BD166",accentColorForeground:xO},orange:{accentColor:"#FF983D",accentColorForeground:xO},pink:{accentColor:"#FF7AB8",accentColorForeground:xO},purple:{accentColor:"#7A70FF",accentColorForeground:"#FFF"},red:{accentColor:"#FF6257",accentColorForeground:"#FFF"}},Yge=oMe.blue,lMe=({accentColor:e=Yge.accentColor,accentColorForeground:t=Yge.accentColorForeground,...n}={})=>({...sMe(n),colors:{accentColor:e,accentColorForeground:t,actionButtonBorder:"rgba(255, 255, 255, 0.04)",actionButtonBorderMobile:"rgba(255, 255, 255, 0.08)",actionButtonSecondaryBackground:"rgba(255, 255, 255, 0.08)",closeButton:"rgba(224, 232, 255, 0.6)",closeButtonBackground:"rgba(255, 255, 255, 0.08)",connectButtonBackground:xO,connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.15))",connectButtonText:"#FFF",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(0, 0, 0, 0) 9.49%, rgba(120, 120, 120, 0.2) 71.04%), #1A1B1F",downloadTopCardBackground:"linear-gradient(126deg, rgba(120, 120, 120, 0.2) 9.49%, rgba(0, 0, 0, 0) 71.04%), #1A1B1F",error:"#FF494A",generalBorder:"rgba(255, 255, 255, 0.08)",generalBorderDim:"rgba(255, 255, 255, 0.04)",menuItemBackground:"rgba(224, 232, 255, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.5)",modalBackground:"#1A1B1F",modalBorder:"rgba(255, 255, 255, 0.08)",modalText:"#FFF",modalTextDim:"rgba(224, 232, 255, 0.3)",modalTextSecondary:"rgba(255, 255, 255, 0.6)",profileAction:"rgba(224, 232, 255, 0.1)",profileActionHover:"rgba(224, 232, 255, 0.2)",profileForeground:"rgba(224, 232, 255, 0.05)",selectedOptionBorder:"rgba(224, 232, 255, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.24)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});lMe.accentColors=oMe;var Vee=`{
"connect_wallet": {
"label": "Connect Wallet",
"wrong_network": {
"label": "Wrong network"
}
},
"intro": {
"title": "What is a Wallet?",
"description": "A wallet is used to send, receive, store, and display digital assets. It's also a new way to log in, without needing to create new accounts and passwords on every website.",
"digital_asset": {
"title": "A Home for your Digital Assets",
"description": "Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."
},
"login": {
"title": "A New Way to Log In",
"description": "Instead of creating new accounts and passwords on every website, just connect your wallet."
},
"get": {
"label": "Get a Wallet"
},
"learn_more": {
"label": "Learn More"
}
},
"sign_in": {
"label": "Verify your account",
"description": "To finish connecting, you must sign a message in your wallet to verify that you are the owner of this account.",
"message": {
"send": "Sign message",
"preparing": "Preparing message...",
"cancel": "Cancel",
"preparing_error": "Error preparing message, please retry!"
},
"signature": {
"waiting": "Waiting for signature...",
"verifying": "Verifying signature...",
"signing_error": "Error signing message, please retry!",
"verifying_error": "Error verifying signature, please retry!",
"oops_error": "Oops, something went wrong!"
}
},
"connect": {
"label": "Connect",
"title": "Connect a Wallet",
"new_to_ethereum": {
"description": "New to Ethereum wallets?",
"learn_more": {
"label": "Learn More"
}
},
"learn_more": {
"label": "Learn more"
},
"recent": "Recent",
"status": {
"opening": "Opening %{wallet}...",
"connecting": "Connecting",
"connect_mobile": "Continue in %{wallet}",
"not_installed": "%{wallet} is not installed",
"not_available": "%{wallet} is not available",
"confirm": "Confirm connection in the extension",
"confirm_mobile": "Accept connection request in the wallet"
},
"secondary_action": {
"get": {
"description": "Don't have %{wallet}?",
"label": "GET"
},
"install": {
"label": "INSTALL"
},
"retry": {
"label": "RETRY"
}
},
"walletconnect": {
"description": {
"full": "Need the official WalletConnect modal?",
"compact": "Need the WalletConnect modal?"
},
"open": {
"label": "OPEN"
}
}
},
"connect_scan": {
"title": "Scan with %{wallet}",
"fallback_title": "Scan with your phone"
},
"connector_group": {
"installed": "Installed",
"recommended": "Recommended",
"other": "Other",
"popular": "Popular",
"more": "More",
"others": "Others"
},
"get": {
"title": "Get a Wallet",
"action": {
"label": "GET"
},
"mobile": {
"description": "Mobile Wallet"
},
"extension": {
"description": "Browser Extension"
},
"mobile_and_extension": {
"description": "Mobile Wallet and Extension"
},
"mobile_and_desktop": {
"description": "Mobile and Desktop Wallet"
},
"looking_for": {
"title": "Not what you're looking for?",
"mobile": {
"description": "Select a wallet on the main screen to get started with a different wallet provider."
},
"desktop": {
"compact_description": "Select a wallet on the main screen to get started with a different wallet provider.",
"wide_description": "Select a wallet on the left to get started with a different wallet provider."
}
}
},
"get_options": {
"title": "Get started with %{wallet}",
"short_title": "Get %{wallet}",
"mobile": {
"title": "%{wallet} for Mobile",
"description": "Use the mobile wallet to explore the world of Ethereum.",
"download": {
"label": "Get the app"
}
},
"extension": {
"title": "%{wallet} for %{browser}",
"description": "Access your wallet right from your favorite web browser.",
"download": {
"label": "Add to %{browser}"
}
},
"desktop": {
"title": "%{wallet} for %{platform}",
"description": "Access your wallet natively from your powerful desktop.",
"download": {
"label": "Add to %{platform}"
}
}
},
"get_mobile": {
"title": "Install %{wallet}",
"description": "Scan with your phone to download on iOS or Android",
"continue": {
"label": "Continue"
}
},
"get_instructions": {
"mobile": {
"connect": {
"label": "Connect"
},
"learn_more": {
"label": "Learn More"
}
},
"extension": {
"refresh": {
"label": "Refresh"
},
"learn_more": {
"label": "Learn More"
}
},
"desktop": {
"connect": {
"label": "Connect"
},
"learn_more": {
"label": "Learn More"
}
}
},
"chains": {
"title": "Switch Networks",
"wrong_network": "Wrong network detected, switch or disconnect to continue.",
"confirm": "Confirm in Wallet",
"switching_not_supported": "Your wallet does not support switching networks from %{appName}. Try switching networks from within your wallet instead.",
"switching_not_supported_fallback": "Your wallet does not support switching networks from this app. Try switching networks from within your wallet instead.",
"disconnect": "Disconnect",
"connected": "Connected"
},
"profile": {
"disconnect": {
"label": "Disconnect"
},
"copy_address": {
"label": "Copy Address",
"copied": "Copied!"
},
"explorer": {
"label": "View more on explorer"
},
"transactions": {
"description": "%{appName} transactions will appear here...",
"description_fallback": "Your transactions will appear here...",
"recent": {
"title": "Recent Transactions"
},
"clear": {
"label": "Clear All"
}
}
},
"wallet_connectors": {
"argent": {
"qr_code": {
"step1": {
"description": "Put Argent on your home screen for faster access to your wallet.",
"title": "Open the Argent app"
},
"step2": {
"description": "Create a wallet and username, or import an existing wallet.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the Scan QR button"
}
}
},
"berasig": {
"extension": {
"step1": {
"title": "Install the BeraSig extension",
"description": "We recommend pinning BeraSig to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"best": {
"qr_code": {
"step1": {
"title": "Open the Best Wallet app",
"description": "Add Best Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"bifrost": {
"qr_code": {
"step1": {
"description": "We recommend putting Bifrost Wallet on your home screen for quicker access.",
"title": "Open the Bifrost Wallet app"
},
"step2": {
"description": "Create or import a wallet using your recovery phrase.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
}
},
"bitget": {
"qr_code": {
"step1": {
"description": "We recommend putting Bitget Wallet on your home screen for quicker access.",
"title": "Open the Bitget Wallet app"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Bitget Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Bitget Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"bitski": {
"extension": {
"step1": {
"description": "We recommend pinning Bitski to your taskbar for quicker access to your wallet.",
"title": "Install the Bitski extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"bitverse": {
"qr_code": {
"step1": {
"title": "Open the Bitverse Wallet app",
"description": "Add Bitverse Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"bloom": {
"desktop": {
"step1": {
"title": "Open the Bloom Wallet app",
"description": "We recommend putting Bloom Wallet on your home screen for quicker access."
},
"step2": {
"description": "Create or import a wallet using your recovery phrase.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you have a wallet, click on Connect to connect via Bloom. A connection prompt in the app will appear for you to confirm the connection.",
"title": "Click on Connect"
}
}
},
"bybit": {
"qr_code": {
"step1": {
"description": "We recommend putting Bybit on your home screen for faster access to your wallet.",
"title": "Open the Bybit app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "Click at the top right of your browser and pin Bybit Wallet for easy access.",
"title": "Install the Bybit Wallet extension"
},
"step2": {
"description": "Create a new wallet or import an existing one.",
"title": "Create or Import a wallet"
},
"step3": {
"description": "Once you set up Bybit Wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"binance": {
"qr_code": {
"step1": {
"description": "We recommend putting Binance on your home screen for faster access to your wallet.",
"title": "Open the Binance app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the WalletConnect button"
}
}
},
"coin98": {
"qr_code": {
"step1": {
"description": "We recommend putting Coin98 Wallet on your home screen for faster access to your wallet.",
"title": "Open the Coin98 Wallet app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the WalletConnect button"
}
},
"extension": {
"step1": {
"description": "Click at the top right of your browser and pin Coin98 Wallet for easy access.",
"title": "Install the Coin98 Wallet extension"
},
"step2": {
"description": "Create a new wallet or import an existing one.",
"title": "Create or Import a wallet"
},
"step3": {
"description": "Once you set up Coin98 Wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"coinbase": {
"qr_code": {
"step1": {
"description": "We recommend putting Coinbase Wallet on your home screen for quicker access.",
"title": "Open the Coinbase Wallet app"
},
"step2": {
"description": "You can easily backup your wallet using the cloud backup feature.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Coinbase Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Coinbase Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"compass": {
"extension": {
"step1": {
"description": "We recommend pinning Compass Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Compass Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"core": {
"qr_code": {
"step1": {
"description": "We recommend putting Core on your home screen for faster access to your wallet.",
"title": "Open the Core app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the WalletConnect button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Core to your taskbar for quicker access to your wallet.",
"title": "Install the Core extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"fox": {
"qr_code": {
"step1": {
"description": "We recommend putting FoxWallet on your home screen for quicker access.",
"title": "Open the FoxWallet app"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
}
},
"frontier": {
"qr_code": {
"step1": {
"description": "We recommend putting Frontier Wallet on your home screen for quicker access.",
"title": "Open the Frontier Wallet app"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Frontier Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Frontier Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"im_token": {
"qr_code": {
"step1": {
"title": "Open the imToken app",
"description": "Put imToken app on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap Scanner Icon in top right corner",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
}
},
"iopay": {
"qr_code": {
"step1": {
"description": "We recommend putting ioPay on your home screen for faster access to your wallet.",
"title": "Open the ioPay app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the WalletConnect button"
}
}
},
"kaikas": {
"extension": {
"step1": {
"description": "We recommend pinning Kaikas to your taskbar for quicker access to your wallet.",
"title": "Install the Kaikas extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
},
"qr_code": {
"step1": {
"title": "Open the Kaikas app",
"description": "Put Kaikas app on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap Scanner Icon in top right corner",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
}
},
"kaia": {
"extension": {
"step1": {
"description": "We recommend pinning Kaia to your taskbar for quicker access to your wallet.",
"title": "Install the Kaia extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
},
"qr_code": {
"step1": {
"title": "Open the Kaia app",
"description": "Put Kaia app on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap Scanner Icon in top right corner",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
}
},
"kraken": {
"qr_code": {
"step1": {
"title": "Open the Kraken Wallet app",
"description": "Add Kraken Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"kresus": {
"qr_code": {
"step1": {
"title": "Open the Kresus Wallet app",
"description": "Add Kresus Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"magicEden": {
"extension": {
"step1": {
"title": "Install the Magic Eden extension",
"description": "We recommend pinning Magic Eden to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"metamask": {
"qr_code": {
"step1": {
"title": "Open the MetaMask app",
"description": "We recommend putting MetaMask on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
},
"extension": {
"step1": {
"title": "Install the MetaMask extension",
"description": "We recommend pinning MetaMask to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"nestwallet": {
"extension": {
"step1": {
"title": "Install the NestWallet extension",
"description": "We recommend pinning NestWallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"okx": {
"qr_code": {
"step1": {
"title": "Open the OKX Wallet app",
"description": "We recommend putting OKX Wallet on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
},
"extension": {
"step1": {
"title": "Install the OKX Wallet extension",
"description": "We recommend pinning OKX Wallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"omni": {
"qr_code": {
"step1": {
"title": "Open the Omni app",
"description": "Add Omni to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your home screen, scan the code and confirm the prompt to connect."
}
}
},
"1inch": {
"qr_code": {
"step1": {
"description": "Put 1inch Wallet on your home screen for faster access to your wallet.",
"title": "Open the 1inch Wallet app"
},
"step2": {
"description": "Create a wallet and username, or import an existing wallet.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the Scan QR button"
}
}
},
"token_pocket": {
"qr_code": {
"step1": {
"title": "Open the TokenPocket app",
"description": "We recommend putting TokenPocket on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
},
"extension": {
"step1": {
"title": "Install the TokenPocket extension",
"description": "We recommend pinning TokenPocket to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"trust": {
"qr_code": {
"step1": {
"title": "Open the Trust Wallet app",
"description": "Put Trust Wallet on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap WalletConnect in Settings",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
},
"extension": {
"step1": {
"title": "Install the Trust Wallet extension",
"description": "Click at the top right of your browser and pin Trust Wallet for easy access."
},
"step2": {
"title": "Create or Import a wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up Trust Wallet, click below to refresh the browser and load up the extension."
}
}
},
"uniswap": {
"qr_code": {
"step1": {
"title": "Open the Uniswap app",
"description": "Add Uniswap Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"zerion": {
"qr_code": {
"step1": {
"title": "Open the Zerion app",
"description": "We recommend putting Zerion on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
},
"extension": {
"step1": {
"title": "Install the Zerion extension",
"description": "We recommend pinning Zerion to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"rainbow": {
"qr_code": {
"step1": {
"title": "Open the Rainbow app",
"description": "We recommend putting Rainbow on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "You can easily backup your wallet using our backup feature on your phone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
}
},
"enkrypt": {
"extension": {
"step1": {
"description": "We recommend pinning Enkrypt Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Enkrypt Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"frame": {
"extension": {
"step1": {
"description": "We recommend pinning Frame to your taskbar for quicker access to your wallet.",
"title": "Install Frame & the companion extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"one_key": {
"extension": {
"step1": {
"title": "Install the OneKey Wallet extension",
"description": "We recommend pinning OneKey Wallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"paraswap": {
"qr_code": {
"step1": {
"title": "Open the ParaSwap app",
"description": "Add ParaSwap Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},
"phantom": {
"extension": {
"step1": {
"title": "Install the Phantom extension",
"description": "We recommend pinning Phantom to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"rabby": {
"extension": {
"step1": {
"title": "Install the Rabby extension",
"description": "We recommend pinning Rabby to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"ronin": {
"qr_code": {
"step1": {
"description": "We recommend putting Ronin Wallet on your home screen for quicker access.",
"title": "Open the Ronin Wallet app"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the scan button"
}
},
"extension": {
"step1": {
"description": "We recommend pinning Ronin Wallet to your taskbar for quicker access to your wallet.",
"title": "Install the Ronin Wallet extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
}
},
"ramper": {
"extension": {
"step1": {
"title": "Install the Ramper extension",
"description": "We recommend pinning Ramper to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"safeheron": {
"extension": {
"step1": {
"title": "Install the Core extension",
"description": "We recommend pinning Safeheron to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"taho": {
"extension": {
"step1": {
"title": "Install the Taho extension",
"description": "We recommend pinning Taho to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"wigwam": {
"extension": {
"step1": {
"title": "Install the Wigwam extension",
"description": "We recommend pinning Wigwam to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"talisman": {
"extension": {
"step1": {
"title": "Install the Talisman extension",
"description": "We recommend pinning Talisman to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import an Ethereum Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"xdefi": {
"extension": {
"step1": {
"title": "Install the XDEFI Wallet extension",
"description": "We recommend pinning XDEFI Wallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"zeal": {
"qr_code": {
"step1": {
"title": "Open the Zeal app",
"description": "Add Zeal Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
},
"extension": {
"step1": {
"title": "Install the Zeal extension",
"description": "We recommend pinning Zeal to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"safepal": {
"extension": {
"step1": {
"title": "Install the SafePal Wallet extension",
"description": "Click at the top right of your browser and pin SafePal Wallet for easy access."
},
"step2": {
"title": "Create or Import a wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up SafePal Wallet, click below to refresh the browser and load up the extension."
}
},
"qr_code": {
"step1": {
"title": "Open the SafePal Wallet app",
"description": "Put SafePal Wallet on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap WalletConnect in Settings",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
}
},
"desig": {
"extension": {
"step1": {
"title": "Install the Desig extension",
"description": "We recommend pinning Desig to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},
"subwallet": {
"extension": {
"step1": {
"title": "Install the SubWallet extension",
"description": "We recommend pinning SubWallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
},
"qr_code": {
"step1": {
"title": "Open the SubWallet app",
"description": "We recommend putting SubWallet on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
}
},
"clv": {
"extension": {
"step1": {
"title": "Install the CLV Wallet extension",
"description": "We recommend pinning CLV Wallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
},
"qr_code": {
"step1": {
"title": "Open the CLV Wallet app",
"description": "We recommend putting CLV Wallet on your home screen for quicker access."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
}
},
"okto": {
"qr_code": {
"step1": {
"title": "Open the Okto app",
"description": "Add Okto to your home screen for quick access"
},
"step2": {
"title": "Create an MPC Wallet",
"description": "Create an account and generate a wallet"
},
"step3": {
"title": "Tap WalletConnect in Settings",
"description": "Tap the Scan QR icon at the top right and confirm the prompt to connect."
}
}
},
"ledger": {
"desktop": {
"step1": {
"title": "Open the Ledger Live app",
"description": "We recommend putting Ledger Live on your home screen for quicker access."
},
"step2": {
"title": "Set up your Ledger",
"description": "Set up a new Ledger or connect to an existing one."
},
"step3": {
"title": "Connect",
"description": "A connection prompt will appear for you to connect your wallet."
}
},
"qr_code": {
"step1": {
"title": "Open the Ledger Live app",
"description": "We recommend putting Ledger Live on your home screen for quicker access."
},
"step2": {
"title": "Set up your Ledger",
"description": "You can either sync with the desktop app or connect your Ledger."
},
"step3": {
"title": "Scan the code",
"description": "Tap WalletConnect then Switch to Scanner. After you scan, a connection prompt will appear for you to connect your wallet."
}
}
},
"valora": {
"qr_code": {
"step1": {
"title": "Open the Valora app",
"description": "We recommend putting Valora on your home screen for quicker access."
},
"step2": {
"title": "Create or import a wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the scan button",
"description": "After you scan, a connection prompt will appear for you to connect your wallet."
}
}
}
}
}
`;function eIt(e,t){return Object.defineProperty(e,"__recipe__",{value:t,writable:!1}),e}var cMe=eIt;function uMe(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");function n(r){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean"){if(!t.defaultCondition)throw new Error("No default condition");return{[t.defaultCondition]:r}}if(Array.isArray(r)){if(!("responsiveArray"in t))throw new Error("Responsive arrays are not supported");var s={};for(var a in t.responsiveArray)r[a]!=null&&(s[t.responsiveArray[a]]=r[a]);return s}return r}return cMe(n,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createNormalizeValueFn",args:[{conditions:e.conditions}]})}function tIt(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");var n=uMe(e);function r(s,a){if(typeof s=="string"||typeof s=="number"||typeof s=="boolean"){if(!t.defaultCondition)throw new Error("No default condition");return a(s,t.defaultCondition)}var o=Array.isArray(s)?n(s):s,l={};for(var c in o)o[c]!=null&&(l[c]=a(o[c],c));return l}return cMe(r,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createMapValueFn",args:[{conditions:e.conditions}]})}function nIt(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rIt(e){var t=nIt(e,"string");return typeof t=="symbol"?t:String(t)}function sIt(e,t,n){return t=rIt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xge(Object(n),!0).forEach(function(r){sIt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xge(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var iIt=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=Object.assign({},...n.map(c=>c.styles)),a=Object.keys(s),o=a.filter(c=>"mappings"in s[c]),l=c=>{var u=[],d={},f=jV({},c),x=!1;for(var g of o){var v=c[g];if(v!=null){var w=s[g];x=!0;for(var C of w.mappings)d[C]=v,f[C]==null&&delete f[C]}}var N=x?jV(jV({},d),f):c,I=function(){var F=N[P],U=s[P];try{if(U.mappings)return 1;if(typeof F=="string"||typeof F=="number")u.push(U.values[F].defaultClass);else if(Array.isArray(F))for(var L=0;L<F.length;L++){var z=F[L];if(z!=null){var Q=U.responsiveArray[L];u.push(U.values[z].conditions[Q])}}else for(var ne in F){var J=F[ne];J!=null&&u.push(U.values[J].conditions[ne])}}catch(X){throw X}};for(var P in N)I();return e(u.join(" "))};return Object.assign(l,{properties:new Set(a)})},aIt=e=>e,oIt=function(){return iIt(aIt)(...arguments)};function dMe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=dMe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fMe(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=dMe(e))&&(r&&(r+=" "),r+=t);return r}var lIt="AEkU4AngDVgB0QKRAQYBOwDqATEAnwDbAIUApABsAOAAbwCRAEYAiQBPAHYAPgA+ACsANwAlAGMAHwAvACsAJQAWAC8AGwAiACIALwAUACsAEQAiAAsAGwARABcAGAA6ACkALAAsADUAFgAsABEAHQAhAA8AGwAdABUAFgAZAA0ADQAXABAAGQAUABIEqgYJAR4UFjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqfu75wzbIM8IuykDsRQ7APcta6MAoX0YABcEJdcWAR0AuRnNBPoJIEw3CZcJiB4bVllM44NCABMADAAVAA5rVAAhAA4AR+4V2D3zOVjKleYuChAdX01YPewAEwAMABUADmsgXECXAMPrABsAOQzFABsVW6n7Adq4HB0FWwXiAtCfAsSwCkwcpGUUcxptTPUAuw1nAuEACy00iRfJkQKBewETGwC9DWcC4QALLQFIUCWRTAoDLfsFMgnXaRetAddDAEkrEncCMRYhAusnuTdrADnhAfUlAMcOy7UBG2OBALEFAAUAitNJBRvDHwcXAKgn0QGhKy0DmwBnAQoZPu03dAQYFwCqAccCIQDTKxJzOvNQsAWQOncnNUgF+icFWQVYr7gFaTtdQhI6WEGXe5NmX6H4CxMDxQcl8XcjBKNLAlNTAnUbqycBj6OlNVsDRRcEg2EJANEGqz8vIwcpAjldAGsBYR9xAIMdGQCVAUm3ACdpFwGvxQM3LSFDUwFvWQZlAmUA8UkXAykBBQBJQQCrAF0AcwArtQYH8+8ZjX8ACSEAKQCzG0cB0QHbBwsxl3iB6AAKABEANAA9ADgzd3nTwBBfEFwBTQlMbDoVCwKsD6YL5REVDNEqy9PYADSpB+sDUwfrA1MDUwfrB+sDUwfrA1MDUwNTA1McCvAa08AQXw9IBG0FjgWLBNYIgyZJEYEHKAjSVA10HhxHA0UA/CMlSRw7kzMLJUJMDE0DB/w2QmynfTgDRzGrVPWQogPLMk85bAEecRKgACoPcxw1tU5+ekdxoApLT661f0liTmcCvjqoP/gKIQmTb7t3TgY9EBcnoRDzDC8BsQE3DelL1ATtBjcExR95GRUPyZWYCKEt2QzpJt8unYBWI/EqfwXpS/A82QtJUWQPVQthCd86X4FKAx0BCSKHCtkNNQhpEO8KxWcN4RFBBzUD0UmWAKEG/QsNHTEVsSYMYqgLBTlzBvca8guLJqsTJXr4Bc8aHQZJASUa+wDLLuOFrFotXBhPWwX/CyEjwxSkUBwNIUCzeEQaFwcRJaUCjUNsSoNRMh6PIfI8OQ1iLg9ReAfxPAEZSwt9PJpGp0UKEc4+iT1EIkVMKAQxeywrJ4cJyw+BDLV8bgFVCR0JrQxtEy0REzfBCDUHFSmXICcRCB1GkWCWBPObA+8TzQMHBTsJPQcPA7EcKRMqFSUFCYEg0wLvNtEurwKLVnwBEwXHDyEf2xBMR9wO5QiXAmEDfyXnACkVHQATIpcIP18AW4/UUwEuxwjDamgjcANjFONdEW8HjQ5TB6McLxW7HN1wxF4HhgQon6sJVwFxCZUBWwTfCAU1V4ycID1nT4tUGJcgXUE7XfgCLQxhFZtEuYd0AocPZxIXATEBbwc1DP0CcxHpEWcQkQjnhgA1sTP0OiEESyF/IA0KIwNLbMoLIyb1DPRlAZ8SXgMINDl36menYLIgF/kHFTLBQVwh7QuOT8kMmBq9GD5UKhngB7sD7xrvJ+ZBUwX7A58POkkz6gS5C2UIhwk7AEUOnxMH0xhmCm2MzAEthwGzlQNTjX8Ca4sGMwcHAGMHgwV14QAZAqMInwABAMsDUwA1AqkHmQAVAIE9ATkDIysBHeECiwOPCC3HAZErAe8lBBe/DBEA8zNuRgLDrQKAZmaeBdlUAooCRTEBSSEEAUpDTQOrbd0A1wBHBg/bQwERp0bHFt8/AdtrJwDDAPcAATEHAT0ByQHvaQCzAVsLLQmer7EBSeUlAH8AEWcB0wKFANkAMQB77QFPAEkFVfUFzwJLRQENLRQnU10BtwMbAS8BCQB1BseJocUDGwRpB88CEBcV3QLvKgexAyLbE8lCwQK92lEAMhIKNAq1CrQfX/NcLwItbj1MAAofpD7DP0oFTTtPO1Q7TztUO087VDtPO1Q7TztUA5O73rveCmhfQWHnDKIN0ETEOkUT12BNYC4TxC2zFL0VyiVSGTkauCcBJeBVBQ8ALc9mLAgoNHEXuAA7KWSDPWOCHiwKRxzjU41U9C0XAK1LnjOrDagbEUQ8BUN16WImFgoKHgJkfQJiPldJq1c3HAKh8wJolAJmBQKfgDgXBwJmNwJmIgRqBHsDfw8Dfo45AjlzEzl+Oh8fAmwZAjIyOAYCbcMCbarrhi9jQScBYwDaAN0ARgEHlAyJAPoHvgAJsQJ3KwJ2njsCeUc/Ani2GVjXRapG0wJ8OwJ6xAJ9BQJ87AVVBRxH/Eh5XyAAJxFJVEpXERNKyALQ/QLQyEsjA4hLA4fiRMGRLgLynVz/AwOqS8pMKSHLTUhNqwKLOwKK1L0XAxk/YwGzAo4zAo5YPJN9Ao7VAo5YdFGwUzEGUtBUgQKT9wKTCADlABhVGlWrVcwCLBcpkYIy3XhiRTc1ApebAu+uWB2kAFUhApaLApZ4mAClWahaBX1JADcClrEClkpcQFzNApnHAplgXMZdAxUCnJc5vjqZApwSAp+XAp60hgAZCy0mCwKd7QKejgCxOWEwYesCns8CoGoBpQKemxsCnkqhY8RkIyEnAierAiZ6AqD3AqBIAqLZAqHAAqYrAqXKAqf7AHkCp+5oeGit/0VqGGrNAqzfAqyqAq1jAqz+AlcZAlXYArHd0wMfSmyTArK5CQKy5BNs3G1fbURbAyXJArZYNztujAMpQQK4WgK5QxECuSZzcDJw3QK9FQK71nCSAzINAr6Ecf4DM20CvhZzHnNLAsPHAsMAc350RzFBdNwDPKMDPJYDPbsCxXgCxkMCxgyFAshlTQLIQALJSwLJKgJkmQLdznh1XXiqeSFLzAMYn2b+AmHwGe+VIHsHXo5etw0Cz2cCz2grR0/O7w+bAMKpAs9vASXmA04OfkcBAtwjAtuGAtJLA1JYA1NbAP0DVYiAhTvHEulcQYIYgs+CyoOJAtrDAtnahAyERac4A4ahACsDZAqGbVX1AFEC32EC3rRvcwLiK+0QAfMsIwH0lwHyzoMC6+8C6Wx1Aur1AurgAPVDAbUC7oUC65iWppb/Au47A4XcmHVw3HGdAvL/AGUDjhKZjwL3DwORagOSgwL3lAL51QL4YpoYmqe3M5saA51/Av72ARcANZ8Yn68DBYkDpmYDptUAzcEDBmahhKIBBQMMRQELARsHaQZdtWMBALcEZ7sNhx6vCQATcTUAHwMvEkkDhXsBXyMdAIzrAB0A5p8Dm40IswYbn8EApwURu+kdPT4WeAVoNz5AK0IhQrRfcRFfvACWxQUyAJBMGZu5OyZgMhG6zw4vGMYYicn2BVcFWAVXBVgFYwVYBVcFWAVXBVgFVwVYBVcFWEYVCNeFZwICAgpkXukrBMkDsQYvu7sAuwSnuwDnQCkWsgVGPmk+cEI/QrZfdTdf6ABYETOrAIz+zGvL/KbnRno9JiMEKxYnNjV+bd9qwfEZwixpAWvXbjAXBV8FasnBybgIz0lbAAAACnxefYu+ADM/gQADFtEG5a0jBQCMwwsDAQ0A5WUdPSQfSkKxQrxBOCNfJ2A2JzgjCcE9CkQ/Qz54PoE+cD5xAolCvElCO1/LTk9qTQosa1QvagtuH1/gMzobCWebCmIjKzwdJkKrQrwrzAHL/F/JDh8uCQgJIn6d32o6LUoXyavJrAllwcvMCmBBXw/lEKMRAJONHUVCJRupbTnOOAozP0M+cEI/HAcKHUxHbFssLVrhvBIKfe0dK0I/HF0ISgkOM1RDQjcEO0OcLAqBGy1CPxv1CFMiIxgwMQAFj2HwXgpxZMlgC2AtI25DYBk5AhseYLMGAmsQZU5gTREBZOdgFWCVYH1gs2BLYJFoFhcGtQ7cVam8WgtDFqsBuyvNwQIfFQAcAx4BeQJsLzCVUoABigq4RxoA5CN0jgrKDaZN6gGbAoecTwVAXwD39wkANBZXDAulDCQfuq9HAE8MNAAVE58rggh6AtILS2URGwDYTgZ1BAoeWgAxALa4AZonCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cKAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4AZonLTsOzgKQGHtQu1jIdHKO16WbDvWZFT0b7AEpEFwSBg8bAccJOhCTBRArDDYLABEAs84BAgCkAOEAmIIABWtXLwAUAFsbxi5sdioNwRACOyQz0+EcHgsbfQJ7Ls6hHATBCqrxbAA3OS0Opge7CQAQOi7OERkAfavaHA+7GkcczaF3HgE9Kl8cAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvC7OoSoJPA67BZgBG2sKD4sa4QHDARELuxY7AKALOxC7BBige9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewAHuwG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOwAuuwLrDlaouwAeuwJVICp/AAG7AALjAAg7FTwVuwAbuwG9KOClWw6/xAD0AGj7L7ZtvgNIo7vIqDsDAbuVJ0sAAlsACrsEAOfdGbsIGnsIoQUK/3AA37unuxjbGruji3lyBvupm4MAErsGGwsBvAAAhgBtuwYAC7unOwEaO7oIoZzKAbsL7QfAqTsA4XsBvwAA5QAVuwAG+wAJuwBpiwAauwAOuwIYu45pFfsAAVsADmsALkseAAa7ABe7CCEADUoBwgC3ryYBwAAAtAAOmwG+J+QAsloAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAAFDsAEWsAD4sADesADbsAGQsGFhsAFTsAbpsWswG7ALoAEzsDAGkrCgDhSwACOwAEUgAXewUbAAbQABi7AAv7AF+7AGv7AOSLAbsAF3YBvAABcguhAAVKHgF7KFIAOUUA/gcNDHIAKCpwAaQFCF4BvF4jDAkHb0tsXyqJHzwUYi02A6EKtAHYABYC0QNuAXZyR1IUIQNPAhU+ASwGA3NGvHtSekAAKQAxAfsAUwrbAHuQLAErAHblDREyRgFKAFcFAAFQAQeKzAB4OwQgpQBaANYVAJVoNx+LAM1rsQDP1BYIwnVzGxhWHQnRAYiQqyJTU01IEjzCifkAfxw3QCkr4BGXTwByASksMClCGQ8DMFUE98XuAEtl3ABqAnECPxF6Osd4LjXVBgUAEBsdCggMKgQfHSlOU04IuboAChLNACYAARoAhgCJAI41AO4AtADgAJ08ALsAqwCmAKEA8gCfANMAnADrAQwBBwDAAHkAWgDLAM0BBwDXAOsAiACiATUA4wDYANUDAQcqM9TU1NS2wNzN0M5DMhcBTQFXL0cBVQFkAWMBVgFHS0NFaA0BThUHCAMyNgwHACINJCYpLDg6Oj09PT4/DkAeUVFRUVNTUlMpVFVXVlYcXWFhYGJhI2ZocG9ycnJycnJ0dHR0dHR0dHR0dHZ2d3Z1WwBA7ABFAJYAdAAuAGLyAIoAUwBTADMCc+kAh//y8gBgAI/sAJsASwBeAGD5+aoAgQCBAGUAUgCtAB4AsgB/AjwCPwD4AOMA+gD6AOQA+wDlAOUA5ADiACkCdwFNATwBOgFQAToBOgE6ATUBNAE0ATQBGAFUDwArCAAATRcKFgMVFg4AigCSAKIASwBkGAItAHAAaQCRAxIDJCoDHkE+RykAiwJLAMMCUwKgALoCkgKSApICkgKSApIChwKSApICkgKSApICkgKRApEClAKcApMCkgKSApACkAKQApACjgKRAnEB0AKTApsCkgKSApEWeQsA+gUDpwJdAjYXAVAQNQLeEQorEwFKNxNNkQF3pDwBZVkA/wM9RwEAAJMpHhiPagApYABpAC4AiQOUzIvwroRaBborDsIRAZ3VdCoLBCMxbAEzWmwBsgDdfoB/foB+gYKCfoOGhH6FiIaAh4KIgol+in6LfoyKjX6Ofo+CkH6RfpJ+k36Ug5WIloKXftoC2WzhAtdsAIJsJGygAINsbARCBD8EQQREBEIESARFBEAERgRIBEcEQwRFBEgAlmZsAKMDh2wAtGYBBWwAyVFsbADPbAIMbAD2WmwA9gEZAPYA9AD0APUA9AN8XmzUhCNlvwD2APQA9AD1APQcbGwAiVpsAPYAiQEZAPYAiQLsAPYAiQN8XmzUhCNlvxxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN8XmzUhCNlvxxsbACJWmwBGQD2AIkA9gCJAuwA9gCJA3xebNSEI2W/HGwCQwE2bAJKATlsAkvBbGwCV2xsA54C7AOeA54DnwOfA58DnwN8XmzUhCNlvxxsbACJWmwBGQOeAIkDngCJAuwDngCJA3xebNSEI2W/HGwEN2wAiQQ4AIkGjTFtIC9s1m4DJmwA/QDGWgJsbABVWv4UMgJsbACJAmwAVAEAuV5sAmxebGwAiV5sAmxebD3YAEls1gJsbEZFNiJ9FGVAe8xvEZKvxVfKZszAVTBzYBH2d1iyUXEHH7twNw7eZF5JJRHI5EgaRr5D20/3dfONrFLSq5qSrrgd2CEUq722WBQ/LzpA+bx1oREI5xy4BDSZNun0ZWORUJqInZSyMaioyvfSI0l5uFDzbWaQ28/zdB0hwR4OQZ0/jn9ALSLNikjFYGfqR389qtFlhD3a6KdIh97rhZYpywuLc7o8ql5/X8KCbPU3L/QlmCowhRXhsGDvg6wUNprA9bM/49uxlAj7ZVy3ouEY/BgFXBNyK0TLrSjZWeJm/T4nz6QGLT3cJNtWRZVZTvIdtaxMMJRHgig9+S11LjBh7Inr06ykoch1U097Rw0hvgmOrydQyaWcEQDg0RavuMuT0zYabUZl1e33HNSK1oNUCS03eh+9C2EvF3fq9h+XBaAMFuoWeZf+mfZgL4HzyiKDIUtfNU4oFu0aE9qt3VA3U4D3fOSrAcYVnjG3cSkp1vhXZnp3JQm4JknKdBitO2NVnGCYQwU3YMWHWB87NEd+4AHuOKI8BSIH92reW0pfs+kWCTJxDCbRjFv8Cfc4/DSBYJScJYTeAEgg9wTEvcwd/QuHRHqGzAQ4fXf5FUI1lPrO+fvEcPl4JInM1z9AtBT2bL4QYEREe7KiSnnxTwtmAFjn8lqT3mND8qTktX2F16Ae9cakqJ6/pEQsHURqyqWlRMCzKXRKfCHT7sYHWx9/T/ugYTFY6iVN3Btm58ATJR5alYZybKMWojwOw3HbFn23NFyeLl7+Er82RchyYuBoGQ3j7SAWNxiYvp5U+Fq/DEzB9cG5DlJWsqkosRze92OVlCtQEYo1S1lF72Z8xWc4ld/+fFcfTEDTFb9d8tJGQ75dpJEvcWyGmGBiTbiWDdGOcw93Dmxq5ISUrmasygONfHLvhgo83HQZenbdBtSzBkvYrCEQ/xEDMhMZsN6gqplx5jGG9mSQLhM81UEdEeJ59sdNJDAFy/gPyJoKlwPZgB/MkC/kICLiCB8va+nCdO2ry4aDfkmPFpF/H/SGQ3LJ6aAv9dtJ8DniHtLOckZix0BVb0iR5V3LAp521LBSIi6AtV7r2ZB/hQEvAw54EFNOQcFnl1xGUIc67tqK1INNwD2n/RbwgzO9h45LM6VMuN8V1ZNIQ6t+Xy3lTqyVCD5kqLy/t3/b8MLbgDg8JIWDkSZ+LrGhhr+gYpH+pr1TnCUnZPjpUdw6bSL6MWVXoDDciQDWECwU2e6VEpfrcOBbrSOijqGkEIoJPbpmeJLkcwbvA0yWIixQVjo0HnYh7fji+Dfdq1mtV1lG2Zz9R7eFMHS+FK7nybutu2fwzDpFldO2pZBshsHJWaltn3PWOoGJpCT2jE8EHOuC6FkejNWcfsWCqNqMLP9xTwcWArj2EiiI7D+EaDi7/2cqHL1gPiF6C/J7aUo7RQqogPZ11WqbyP97nsoMxPOC78wZMF7B1Y0g7JNXJV/nN1m4xx8hbqWz07KSaqr5hE4icB326DMR/vUKX9LoNjle/ZWtbUhrTAcsdgrLlG5Ne8aiR0bS/2ZhpNOVVxavWIZsEM/rd68EB4vjbbD13NkMK1qvMk74vGbSkL7ULO0sZ9R6APSCo6KH+Xn98wEdw1bCPAnDTaBsD6sidAGN58uiH4a3ovG1KyZAu2XtyGgF/vgWKGxw9R1lfAVcfuYE71DHuxtTzfGZnHaDpDGWmfEq0N4GawE7yIkaoz8jcmVmzJe1ydM8q0p08YIxFcY1YcqQc1djWBEoNETDFcgk5waRftEJasPREkrV++N/TOKkERF1fCLrXS8DFGYGRBeECMQRNEs0ES3FzUtXCcNxpYEM3Uei6XodZruXUIRnn+UXf2b/r7n1vQutoi6WoIbW7svDNWBbUWcDUc7F9SJK3bvSy9KIqhgyJHoW2Kpvv0J4ob14HFXGWWVsYXJzjwxS+SADShTgCRjhoDgjAYRGxwJ1Vonw+cpnCKhz8NQPrb0SFxHIRbmG95Q2hlC4mDxvPBRbkFa60cvWakd7f0kVBxxktzZ9agPJEWyA63RSHYVqt8cPrs2uFJ3rS3k9ETGKn5+A6F9IOrdZHfT1biEyUJKEvwzuscwshGCBJvd16TrefW03xVnJf4xvs72PdxrMidjJO8EiWyN/VWyB3fv9kc34YIuZTFtXGo9DuG3H1Uka5FgBMwDPEvRcSabi3WakNQkXFecJlFk6buLVk5YHpuKWTw6oF632FPPSVIVl5hgUAeHhj0t/sw/PEEvThLQDDFE34eCg/rLOyXT3r+L98oRKrlTO0MdALYQ3rRQqC7d822dJPGxF1K4J2TtfPSMFaCAg0n0NGk9yiaKKOJD1v2aBX9HUOIawjjfvwCmjHZJTR62R9c9x33JnBjWrN4QYEOmehy0oZMP9XM9Zyi6TYoe07PaLceRXcCWZiY/imRUWW6+mci7+wMxSdwMdbXckXtvhJH8sc4iQcTwm7yp+3f7CaesTTQB2qkgeXh+wFiSMXfMlH7Yil0OoZ2QTtRLTip2O0cLZ4SstqWHZ6H+8A2kZXhpm0kPbL9dUanTOvziqIUh6Ambwa3WrCb2eWbuCN3L1hgWUmjRC3JoL3dBhR3imSQI8xuCMfsszlji7cSShNSYdqCXPxEVwbqO9i5B6hf93YI7aeyI8jxgcVXK0I/klbvhSXjkjOIwZgPdVwmsFW7HGPLUAvDRuKm+itybRg7c8+Yqqjg824Qf+/NxsBSUNAK9KCoJpauFqK0XQULrWYj4FnxeKDuvr54iokpi+D57e6Y1zxRJJdsHnDR3JyraCUufHBRTKODWBVzthjm4k3/Hv+Q990XDVR+KW+TcJX045LW86EKhz/97aqj89A8ZvTk1//tczosU90loIPVaHuWegJU3wP//7XHcO7c0yQM2jM/IhQKrf8hiObHWiWDZManF8Uf/HzbmDfC2wT//aiZ4hGTv/xzgKwdb1sD6cGEkceow0s3b89/zg+3plyRm0HlZi886j5wUwFhdHiDTaBidZRo5cx/tMeLyguOATbzq17ydhzbrpxunuHx6lbFGiO97gsd4dk//7iCIo+Ew+hG2so5kvv+ITG4c1fzHPtu1Xn5QfUnqY3/uByVmB7gmnE/E+5zdm+6nDmoews5fr+NzThdSHzK4bBQOL9c4O8OI0xLSqjJ4lbniLJg1aFpQRLwaSMZmpkC9e/j6FOVrTQ6a/a4alGgfrl2ZL1sbHUQ3DOI7ntq9diHFfm3t1mul3rdJEJCHnlW/hlQntipMrpeMs7fUr6wK370D7VbXH0DUHzdYfRg/6Z11Ult1sffJS+heHbco15Sxy3+rDnPesqH1lajk0yu02hPUvEUqvcUXWXL7Ad0wNGMx5gOle4XJxq/r/YY0xdco2wRSEGwcT7YADlBrHc9ZbvzOL0QwyWCWWChB9Obg800v7tyBWaNvdwz+fL7Ph9i2irEeJkRgOzeEDw+JiD/V93vH9FgMEoFIJMoIuogmicZohf94SBuPn6hXaV9jP4VVVA/bu+Wg8S88GLtmEPSNRLdtlXx2XL/nuM8nKkhnlnjaropiKKLIH94pLIASci0pDBfj9Hi5BfaTSXQg5+PMjQX91Ktk4MOqK1K99l4BRPv5+vNovGZ3IxQv8ICvjV4/diThpoaM8uvd3D9d/DE477w3yAbW3IDm2i73pZ9aEj38JqS6h/s8/xgmUIVcuq2JTgefAyuoafzQxAuRASeg3NtG3ach/JEkyuX+JDt2PnDZTShUhyHHG3ttBg/6lhAchGjLJBtopj4e01MlCp2yqQRTr4sBBXru+lKaoanwYX8y2aWCJiR3KnhCOkYVFSvsO0oDRujUFOEptiNDTYrJoUbvOyvl4AhC9h3wORiTXK1MrpMfnvdnndnR/HRVSusMBgIxwrLdn3vq1VcncPiD0SquTx/kNmxeFyCT4uXVUd9AL+rSGmuq7OOCzDKeVPjiNWVaoP5KOFqYq5Xcuf/xW9S+u9eIq9GAtZWtQlgkRecjRtvG1NR4WXXpn+pwsTBTIy079Ikg8rSef1aVapIFcXCd6C2wHVjLXR+N0tw4Taw6x6H90BFRgNrtlq2up6hHKuV3inM5RJaQWZHd84e6RsKkk9po3dk9by54tpPw7cBkFas/G+GbHwuG+AwP55BZyXILTHCIVrPpXHEaUPYfL6nphJP1Rc10xG4UaCeY4IHCwuur8xmSQDgY4aVwhzWhjbtSHG8JO6P2i2nC9/0Bfx0zk6dYQq3aw7k5vIObD7SEKrxhz0fQ0+YTOfHW23CBNeZci1qNsUDhoeqmfyP6PvjoEjHk8QbrFyQVZPHVWijnb8YCM65iYNoEbvnchStZ/9cKg5Vd45j8KnB6UjzXl/bkyZx7VoD47ocUUi117WwgySSb4rXgLJ52Mv5XJbp3I+uBP81BUvOjy4Cacgi+GWWlC/8dwgqwiojjUBDnEOxyRyowwLQfytFra1OZS4XvRYr4uoamAfG3I/p2bA7G90yqKThH8Ke00Tqd+3l3dmJpaCZelBMYjGqNLVa3SM4+LQeL56gY6Bymy2LQPVOxjWfj5tq4o74swcxhyGJPynkS5xAjOXZP1/FAYcBT3u6qLoIkEfErwo4gozmyI1YCvM0oyI3ghjGPQSsof2sKUhq91WsKy9cYWN+4A2v4pG/Mxpdc6w6kI/HX7Xb0TuihmsiOy2wQIsrZbUmr3OBSUo6oDJNgQp+YqYkgTgYcWZDgawJw3DFfdzT//PhVUidgB2qa8uw/j9ToHBAS33iT8YLhhAfyXG0bQUFp7QmH7oQ3i6Flf4OTZLvJdh8pfuflmWu2ohm5pTiSg1pl3vq9uluTJwqXfh1hqy8e2iHoD+Y35gCIViTo6VOtK5dD8HYClucJucXASzwe2kPj4S4eYQtmkYHagXhAzp/F541xE8YFYqSPszDuz3soWzHy0p3E2jwZNQaIcGU9FNQwQxeDw0ZlK9dxXrj9IUHGUPTOyib8CqXmbZ7Ex54bn1rLx3qqAavu/gh6XjV0GmN1p+yyMK9HN5uYEvxgbAk43tsheREhyI+Q5WLIneKTGPmYiM/lxOp8fvqHy8YgXK0TlMiX0tliLI2JtfmWZP8eVV732sdYm+pcWzDzEmKLJZyeelyaZKkjPnnUO9keDwtgiLnmd5+t+Sr5y8brRnlvxcWEWfCqIALQYHvaXx6jTg4dAlye469uGwwOZVZCILLfGjaMg4LUCNMTtMSp1aC2y/3wR2t1v3w/iNBRQ+bNbtDqL2NAr7K4rUcyqbSpNrXZgAWXvjxBBtfYLK1uRYt3q2pfXJOAL0HtWcEwJLddOSJKV1SwvcvEuzg/4MPnA8MIUJOLqm3qI6wFyN99Ck6zYaV/zGSAzF/PGsaNa4vPLe5QnyuqVUnVQ6xELA6gbe53aGgeke+R/ycb2LJVyc7BhuzI90zA+c6wUDTb7NH//gdDSl2u/aW7lRJm8m1fLtPxcNuEM5JbkOCZKPM88HUsLRoC1pmKKlvWyeAXuxILbu0snpSxf8N+RgtLUSe5n2gdjOjoSTaN7mMZ7bF+cWk/MS8mFD4pcyl5UN7CbpFZH2a+Pm1VAnUTVfbw8qrmz1G9m5aKmRzY1SMhhPrlCn2t4uNUXNA3IFe6NOjSC1DEaAFZAfDlEkQCsbNhsZPj6NQPDSB3tLiTo0ZYoEbIeEIaKtU3Wk60rEszawTFuyHVd365LA/c/uarABN5M5rGq/dqTG3Ilye/5EKiYisisuzqNaZjmWv0z9TORc0CKbaTea214oNM9u2sXUZub/eqM3Pi/PjRSyQiOSwPWif2asTgu6hS6fb5UGosCWxdedMqdViIUUSSdIJx+qQ4KShfTT39VAWZbi+mB+iKICNwpt6cflY57Rcbs6d1kA26Iru73cuxYVlSvuJdcR5VfDYZRk8X0AXePROyw3Le6LaUdmTLzYsoNhhgQpd67xVNiHgk3pakmndeIAtTC4DCXy9oS6eU4CWxDdVmY53pKNbdAKmQsP37lrJZC6iDXMELGKcHjNuuZgcDyY8W/yv6ha3DX7OWm/35fpvhw55oitf4V+GULlcPWYyGGuVBdro19c8u0RDddDun40W7G5cSIzHLh/qZxb59R+EPY+wZ2XerkUim92hhXpKyW6WtAh6zQS97DrPyjCvKi3pCw96LeKynOpyjtsMQc2RmI/20zFOZcSa2AK++PoRcT6zeJyxlBZ7kk5mhqXGkLlM2hFKc+/T544xXP0Ua38Q6xdPTLTeG1PHnLMaOvksUQMrEFTB/lizCirmFQL8zYVU+OTeYQEFaITsBSMMYexS9HkajO2gGIf2micvntCZJsZQEwIH3/4JGJQGflBuH5rNXmnRRYXDQs3ZoEQoMtYDr1kFKUS/siiQSUxcTH9XYeBZiKDDFQoExREO9dddKQLO3BwMHvymCSTFyY+vxn3D27NDx6OlU092D5EDUwilttqVHpjJQDUceJYCLsK2swfXeNUVrBJT/w/sk+7si8rPtiMFis+oxvGdGQxirMBID700T39mULuNHzOyN+xBfcFACZcyngF1aSpv0JPkNUrAZTqfplv509cGXFUiEEm5dZb+OsP/blizqdK45/dSsIrufYTrCPY2lgJD6k6QljTfXVlHfYKSq+MsagyUcaMintyr95bD8kdTAeYNLNsMmo/Wdd8a2nStBP49ARIjqqpUHWY4q4mvO5Cq/CgCP+4/B+5zutGwX5pssgVLr1+fIM7WWLfiUQDk4c6ZdHZOWv5hG3g2dgQ5NXnpIY+BWwJpaouf25bXnjDzbHnQNofH/c6m+dEAS9Gs2h7pFRPKOBDnqswZ8KZjhId1ytHUTs533KwBoSiImoxKQUgZ7z6pA9QB3sZ8Cq0vwutJTTkfbX8AzCpm2cFXx/P22niUMHauU8IGc+78R6TsutoonoqFuoNA3l80t387YHMoL5KGAT1JO4zmx+vJ0LbLHlicHraSVYvJjnO9p++qnWgKw9OwFVVUagvZuf9qfiuum+hIicxP1q4zDnzkHsCNriLxBpxY9N+UOmqzdY1MunLMDgkMyi3uvnN3UBXJeZ8YLs5xr8QrOhimYoKuGBebZHAiBIkViv3DG8k2oNpp5OIgX6ulqaRN8V62QUPjn5tl1kPXhT9bcd8qIm8gi4or/FGbvQ6pgGSHmnayrugmf5E0upGxPRf/3xOtitGMaHLKJVm5zhglmVfI91o0yxhJZVS/5wQ8zfxK8Ylw0WmHXoGfRkoBRx9Hsnl/6sgTjAVwpmNuSeZtBwlX4qB8Bh8lxjqBDIuFGJ4I1wxN0XRlAAslzqMKwQfyA7OkuivCXfv+i+3XmhcBFM2n4jdT+NyUmBnQJPV3F2sZfKvJhUlXzSosFR4VevVVcOkFnnjdiRWc0TeSYxj41sJGYMbZTeLI3GvyZ8/gAAudQ1+4oFX+enX5V49MczGCYVBuoC4kHjp7ZVxj+clBwPr9k+v05SsezQK3enxLs1Nt/N7c7AImVUysjGou4iOohHo83Zs9/MI/OWB+OyXzOBD93NbApGHXrv8CVRHp2bwH+xB55cfNrdqFD35HSMx4iVmtzYAmSCIV8kXsHoq3DIb93riTWbubnjxbBW5zConVtbxLRStXHkIyAByaozME952Gc9aAdAbBpZSVCH88Uwb/4bPTVOVl+WoMYD7JIvK8VcMrJ8zHV4bbG0Dg7Kx17A4ej/ZcZ2Z5pVuVLUH1E/AccUTKm81SE+LQ6STTUDscUk0x2OWIbEORhg69tdoTGNkA1RfkGIRZHr5mCXOpLC55WWzCZoGPFUVtZRHwh0nq039CDdjEPo+JyaxSQAvDgR6Iqvxy0frrtEG1A385N81l05SSzN+IDm9bypF9m92EUqblnauZ5sjc37wRykOdl7w4o8WMgQsjii3EE/aJYDfHs1cH6DNBEujjcCc8qAefYFyIAURDcDnzun5UmkbBQsU4eu/W8I9nBE0qJKTdg2hwjq0+XV7a3TJ7R+alvJZCRia9lJ+grNB9dbrOmWEvUotMjvDhq4wV/kq4fvIBkzUGpDeYH74rne8uU3dgoNZdR9pUL6q9YDNRfOiF6Dyk+SYXQIghTjm9qR4tBHh0gnmF/9q3Qv22EzaLhSvDlDOxMrrCNRmLCl1jApzLrBCPn2mjn5zqK7OYK7VxOfQ5GfBfoPdyQwqFEgCVHkJ9oTnagRM3R0+rsuN5jQv9icCav/p1WqiEXSzCdLd/WEA6z6dDP7tPqPbeDYKAkVcz1lLGbFOC9b7cBd3MV0Ve8dZ89oR7OnxGS7uVpSry8banVZwpJg+nkH1jRBYa2BvBMY2xITH9ERXCjHzdZxs+ipdXP2DY7X+eWiBhtT2L0RRGTLPeazn5tpl4tu8iE2rWig731iuJDRbCHHy+g/Mb9+miAyVqfIpXT/iZeOxOxODO0hEpLM78I1+G2Z45yi3lS1K3m4WMQ559Lp4UML5vZUjYGJuxl+OPpUH5klpyBujkjprhei0TmUik10gjvNUp8mDkWlNKikmYspaVTqewbnOzJrmz8FLIpsT67EJLHIIfeDcWEfiP+DJrZ1jfxpoAb2abeMqLx+9RuZGzQoYtYVGgAWwEM9Kek2vPIeBNAKD6ao7nw6sgvfeLZPoXkbYO/tStHJdKzk+WFSFEU2NcALJAEP6S8pcnqqBBt57dwTrzQNCIdk2SocK4dLRbD/pu/VryKnm65ZYXiJCfHJk3mx9MRSl+nSK6OqEBSoGjz0/LADddwF/HqcfK3K3O+6YUGQcmj8pZL4PhZ6KrGkb8B38FmDvvLd3XQXbvS/FQmrXFTvJNkaN/FGo83KuS43BK1UfVnIqigGkCoP5fBda2MwAGTGNKX9K9t4Bx83pMFc5KSORmWKv+8VoVggWxoaBz3/9IBh6RwLd1tebwy89xvE5z6EEpXpDfrXWfRsMs6+ekUHH6idVosno55+xQ8Zqzelh0bxtJTgCcH3Z3/Cxlx9eNIS4JIFKOAVrDqbrXRszmY55a5+niJGHtkO3b6mnIDxLa1WXc7BAe33mt2KyM4Fbc3R6/WVTQN8QhlqAtave2WsQTqzWeSlKuGUVIJRqtObpv294rS0kDN1RKzdstZTXJebR2HlzsQ4P3NbMHUqFZMZw+/IKXnh4t+lY8qocp/B1oMszR03EFs3bPeND8QkItMvllObeCz3SZAjqZrobmLcrpFyQV7mwBjg3C3C8/bc5goQhv8j/IXMLGnt4mF7tybRDG5G0polxoUScQkPvmnga2/K+aapKeqSL0BTmo1Cm5g+booNOtdyKva2KoefRURaBk7113QKo3y+WTuFKtgETIK8HRluYS9DvlcciCDvnG8UaJRfZE2siZsiTHvRmN80xkUIInHeRZl5Re/+ATL6VhKFi8CZ/n/jbFV6T5pZ+Uoppvsi3qjacVFOJgWWfdlwVHKPW/TJO3na9hRM9bS2yo2rEsC6IBzRReVO6IesJU7PItzOamr+ROFfwGZmZ7ue8HNxAgLJKb7P3p8dMqk6Be5PJaT/5Rdc1deYVihWH9cjVKc9uz5EnfHqxLUkOO8iJUENBNVf5LyNy8zjLu/78k5WNTywiPfYeX3CPk7yc6CI3lum/CEZwfUaNpcI3KsPqfn2lmz3kd/acQjKA1ebkJaiuLD+epQ/Fc1llHXXMzofWzz/Kd29SNmOhcjMWw1jq1g3YfrXZ9rzXDYW4ZttfgfMi6oCUtBs0PkMVuxmq5lxEoCaSXPSqCJJ7MlKdRDidVt0AFlxk5cTdX++sBF2+E35mjwfm8ERVxH0FvuAQtsfA4V2G0TKTUxeyRGVjd/u6F1SvuAiU2/WaQjcNCU4Ep7VunXCYSbZj3U3wzu/LWM5MPlYuyQ3FOOCD/zt7K295hY2JhwF+ODDIZ676vGQFKveEQYkWj7lkK7rVmD7MhU0Y/tF8EcTTpo4/yqOufbd/zWIpMajnbDuWK2vn6OPPtz2rc9MIBNlPd8tt+yf+7SC4wqEPbozKMCwY5Bygx4JmoIEDsixWRDcdHd6S3/dZMHXOJAAv7+NIstl00crgSqHZKAEe4g3G4dzIV51EeZB01r7p8GNlfUnG/GjZgNGsqXZdYMBVtAtFNv3hJWPve4GvqZ2XxuiNkHTz5kxWgr0PjQdJlVywJ9Zf2ZvqeeTbolKtvK54re2Lq5BoyzfsRtvDfyao3kmyFzDQ88nM+qx83w74RDlkngtYiArI05Epre3GgBeSlMig0pE6RGQaFznKkGeb0SozLCyiOtxh7hgwZlbKbClzUUfC8ntMiHUOZE375RhTy9c4DA+oMLkUDkztSybZbdmP1xpaIbjUpPAHBq3cIq+CBFzbMlMMCCkUQ6d9LGV6GYCsYiEWZIy3nBnuxOYXeU4YTGDSin9e4/pCjPtQSHlg5LMEvIlF0ElthqrF129iK2RPBEWd3XWOl3SWV5uz5VUyZYp5kEFmz7QfP/B1W1BBzQ2iTGbSVT79lUHzcGXz3PJceSgz4uknETUwo0xffpr2KUvZF0i/r2sL3IFIClYx8CbIZE6Qt7MDJbOPB3xMScwaOcWG66IJfCnDkb0D2Mb+PHzX+oiCbxeTIogtyN+s2NJirNACk/OACSOTtV6vscwbzW4M168xqaI+RzR47S1nlV/rOoZnid87n/Ima2XYa3un3BuGAisNjb8eLMT9OnMtazQROFCuO1HiZXaOc0oUDbNC4eKLToOx8DzVhMgGA8XIAQ2x3b6I0uEyLssQjJX3QphcUMx4KsMgJ+72km4N2aqkBF2coKmUEt1eqIMGn+5txMT4kYVGd3ALO+y9Z4PP3d3l48JQK8s9ZZ/Qx/+NBKgBEJFlQ32psoJiihGO7FSYM5L81q72kaAYcilEFMG+ZK1BcMqELkflyCV7v8JEXLO4Rf/oZYNZHZVjJhfL6fnpP9Tio3Euue5uS7FMkfGOeRCTrBZ06Caev7tgufeTrX34Ur/Vvc+b8ksiIShNJtuF9WmYxOZ4xg8y6zTdy3KAB2y5kYkcRnXsptWwAFyKZ2I/QGySNeoQLkINUMloC+5L3WuMMx297Q1xUYLKqZ9XHavaobo6QQv4auMm+i84IhxRpPt9nUmcav9NcjCcP+TcMmxsQZ/F3mgeoA0fQgwvTsyXuuTaM3Sqtv2jaaajmaFQpK9W6uIbeqwvSDo34ZrY6elDUHwSCjHRRmlwmyy+eOra64Ssq0XSXYljMHtKY+FShcMkHsEUY/4Bw63dJ6KpwDaxmthlDdbdE+TvYF3v33cGSKqO+1H1pKYhJMvZD5ckQcHyNF8zrtiR5b0ko6NPGoRexUZTYP6VbUdn3zzxGBOi8Z0OqHjGqYxRXwN3mYi0GYEEZYq+Q3QvdKcEHILLLj8S+VFepSfErtmfZCdvxbfIifFSpEzKi+7VJsLMT+zEFeyp1OdwRC1VZrfTLIyR7xTPUcZFYPD9qI7D70uTb4hdpqPXsJIRNYbZtNwch1OI3trh3u2ScoQyM9POnInsUa+OovcwkUP1UfIzPb95n4BaF2ev57NHAej0+BVMF9/Cj9663HN2/JN3SQgslL914bKfiTTDFAz9PlQEL/dSv1H8xl3mtWxh1McFO9EJXlRDaKQDsyKO4vOJW90NFE6yw2tjbc2GeF95sbs0I9enAa6QwQVf/kJQhAD2BzUDKggOyjy1TEhED6sfk+418lQy3c/uj8aw8UEzZ6hIMCd8RohAkumMtIj9m73l2yPWoGHVTPaywkC7Yj9tBM1NxMgcrDwRtk4RO2WHT7Ql5kQCKdJj6kNuOTeyEBYBjLMhGz+O5/YGa84HEiTYEpZ6fFzy26GG2hWtTyteuYrhSyG56BjsT/wQeLRytpTY3D7sIMqZnJ9z1FDrfyjFlGl2TNw9BQysbaxOuwYYZs/7I6BANgkqCknWZC7/BBXvaeKwAmC959I+G39BUE9bExkNlbRoFRyEtNzv+NJ91FuisG3JCS6uYBeRnfv8AkAfKTeg9EYamqnsGfAV7d0f9DghHEQ5IsPGDIUhgoSj7obM4Bu5uhQ3/CYEDTHc92AsFvDK4XGrwUeGBWBHPlS+f4x+CxmmHz2sAGmSFNt65kwZC64mnaoWlu2310laYn8r62AqsR5dfjyK18MEdurdagldzfJtjFXlZs7St4QhdPiye6TPh2/ZAQLU/Fip5s7TDEM16KtRWrK9hmxnQ7bmfa/+7pa10Z8WDPK3NuJ+NN/RAbQ5vHx2uX0Lm7/w7cAEH/hvZA+mt7J7zGw7YtQYwnNN6dpgwkGjjrS3yQoeoYt1EnczmtmJfQZWzUlP3Hlg9Wzlr9IH23q3thGth+QNEANFettxKfskkGOlLk8AqoKJwDqOxAa6UzAx07plSSyNBJSGco9zjnC5gGbDoKvsMDuBR6bGRlGzJ+hFsGa/Izt78aI+WZ6dJlZKp4pGISuv9rV0sAS0MWEwCmfauO7oQZMiakHU35LBxiyJoOMddhUWgcZuC8r4Ksvn75TTcQXLJ7kWtYhGuGqPd9dZuFjBWQHNwosXY5snbHFQq72CvHXhIg+shQxycuLOuWYErwCLZeF24b7F78pO7xw4X6lIAR02hUOf5087Rl0nOaeb6CK4i/KA/EZv76ftOWZtjwxslNr0E/u8rWUmnf3amfg6UZmBAluuoj3Dd7UV+9IAJ6iYcDfSJlgmIImohjfIUMJ27z+opj50Ak9af2LCNrWrBJvMovA1OeNO+MF/MwZvnaCxTgG7Cw4QfSPF6AYCGFt21M8PySZFeV3t2Rqqs5JMzMYzGRgq4o+UaKRgBf9GHi/9X9HXA3wxkCsd/UhnHSh2zUVDiraio/6nP4y3XJqs8ABfALAtCYU7DHPMPRjgcM6Ad/HiSXDAbOdSMkvGZPAkHs8wuQTy6X2Ov/JFvcPuKfV3/r9Q28";const Qge=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Zge=4;function cIt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let F=1;F<r;F++)a.push(s+=n());let o=n(),l=t;t+=o;let c=0,u=0;function d(){return c==0&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=31,x=2**f,g=x>>>1,v=g>>1,w=x-1;let C=0;for(let F=0;F<f;F++)C=C<<1|d();let N=[],I=0,P=x;for(;;){let F=Math.floor(((C-I+1)*s-1)/P),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;F<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=I+Math.floor(P*a[U]/s),Q=I+Math.floor(P*a[U+1]/s)-1;for(;!((z^Q)&g);)C=C<<1&w|d(),z=z<<1&w,Q=Q<<1&w|1;for(;z&~Q&v;)C=C&g|C<<1&w>>>1|d(),z=z<<1^g,Q=(Q^g)<<1|g|1;I=z,P=1+Q-z}let R=r-4;return N.map(F=>{switch(F-R){case 3:return R+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return R+256+(e[l++]<<8|e[l++]);case 1:return R+e[l++];default:return F-1}})}function uIt(e){let t=0;return()=>e[t++]}function hMe(e){return uIt(cIt(dIt(e)))}function dIt(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,a)=>t[s.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,a=0,o=0,l=0;s<n;s++)l=l<<6|t[e.charCodeAt(s)],o+=6,o>=8&&(r[a++]=l>>(o-=8));return r}function fIt(e){return e&1?~e>>1:e>>1}function hIt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=fIt(t());return n}function GE(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let a=0;a<s;a++)n.push(t+a);t+=s+1}return n}function pMe(e){return KE(()=>{let t=GE(e);if(t.length)return t})}function mMe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(pIt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(mIt(n,e))}return t.flat()}function KE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function xMe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)hIt(e,n).forEach((a,o)=>r[o].push(a));return r}function pIt(e,t){let n=1+t(),r=t(),s=KE(t);return xMe(s.length,1+e,t).flatMap((o,l)=>{let[c,...u]=o;return Array(s[l]).fill().map((d,f)=>{let x=f*r;return[c+f*n,u.map(g=>g+x)]})})}function mIt(e,t){let n=1+t();return xMe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function xIt(e){let t=[],n=GE(e);return s(r([]),[]),t;function r(a){let o=e(),l=KE(()=>{let c=GE(e).map(u=>n[u]);if(c.length)return r(c)});return{S:o,B:l,Q:a}}function s({S:a,B:o},l,c){if(!(a&4&&c===l[l.length-1])){a&2&&(c=l[l.length-1]),a&1&&t.push(l);for(let u of o)for(let d of u.Q)s(u,[...l,d],c)}}}function gIt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function gMe(e){return`{${gIt(e)}}`}function bIt(e){let t=[];for(let n=0,r=e.length;n<r;){let s=e.codePointAt(n);n+=s<65536?1:2,t.push(s)}return t}function pN(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...e.slice(s,s+=4096)));return r.join("")}function yIt(e,t){let n=e.length,r=n-t.length;for(let s=0;r==0&&s<n;s++)r=e[s]-t[s];return r}var vIt="AEUDVgHLCGMATwDUADIAdAAhADQAFAAtABQAIQAPACcADQASAAoAGAAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAeYDMwCxCl8B8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobWgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vAITAdQZWxDzALN9AhsZVwIcGSkCBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVkFIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rlr3JG9m8w9lIAXltp/v8kfWaIaaR9OwpAES/I3ZVamDXSgB/UsOgAG6D0tq+5CIqE15FiAhV3yA2VhCQ7tj+m6xXaF53FIfGi/IAZIskMGAi2MU7MDVJNCbMzERyHZi+osdPtnFVbvq653O8rwaCy4IAf9OOok65AqJUtUriUfYsGPPVbe6jm0s9lbKlPCUKjdkHsFsEhvX4kT39ZCtAAbwQdn/h4TpO5hTByWAmr5n+Wuwhdegv6bmvX4LyOes3z2+cuHv2JFYwVMNuq2gzn8YHTjlUQd39osyWei4NKl3LAdfxlO876hh5ENp/cOvpuI9bF55guEthLLPOXjD4dktTH04P5TvZrWTM0e4+BHJxj7MLApXIFOs0sWKhNkG8iwuM5wR83my6V3wW06abhDzTXYfOr/ZpFXgXzmv4d12FFyP00/dPGbIVGV5ao8UufGzUwp/IHx6v/wDWJr9iaoCulhWwlZ7A8q/NMoD12+mBdNRgJYnThRLtMx1Bgwttn8/4Qn2CDfOSup9GVXEvA21ILgp0owHYxNOkpwLWz0G7K+WREIDjIzUzSn8I99CuJSmSpPyH0Ke6/NERYiNx+3dncSebPnOUnnWD61AhJ1n/tSLZmU5wYO5GfgzyAYJm6VL91LxZ8hL1lfximQxIDMRhIecQZBmeE5R0XlrpvwplVrJwpa8BBCdp93GPP9lyBeZ2zkRr920CR3cYbKpKHfogvm0nV7XdDz6EbjzlxADCMjSLXuXpIpyuizy39yY+I+H9rmpoIF3YwEjlH9MgGgWcCNTjHEWMqAbprn2Ox7rOHupaVE3lNyg3nt5XaZID6Y+uml5Ja+aOPu+BI+DZbiJVfaspUadakWUX6TA4dETkIqdJJHYnU4Z4yKpt5y8rVIahoMUf8A8kWtAQNCTbjp71gx3/zVdqNz1Sutkw0gFIMVm2BF4Xdv/0olw+NaDIR9Bb3DPweZA2K/cw+/b+AwyWl9ZOP67A9nexmeTNjfdzPGf9J6E6BMPKa5lJh+qNsdUz3HBUevU71eQFCqOcxiIYhacAhh/8PX0J5DdSViZ6WazDDx7cukJNpMfEkYLJ5Ao4vLoVd3d25Pg4qaVa2p2D2L3WvYPJ5Yf/A/MSxptjlgXL/KJtP2U0cRv2I09ATAiWCJYuRwiapeKFsqmi18yMMulDp3HdcIldq+7jkwsJUOHLHCzzzBw5XFvL0CAmo1ub456z7zb7shk3KPGCLZzr47oT1k/j06XNnJvG3Udv6XrP+wsqTBlZ5MaNPt9FOs/4Bt/ja/vbVhTNpBFl9Gq7MqINvGlWKOAwQzwOZy+EzSdjAqKJVV2YcskTuM94aIK+kc/AZaXiZLPREUDpkXIV947IFfj+85TrqPqLfkGcxgboMQjosf+az+odLNXdyp1mDNGsqSdK/pJ2Ca04mt/4d6s1X+lncOEYaGBBeW4pApGcjf7/XJCFbj3N3mFb+BtlIcw8ZiDKoClFX9Rf0bxCqtLpicObKJzBVVHr/6u4siH2hK75RNv7w9GfTbhJOQBYiFUZAByY4rn37tZBHT//kqKsNi3ryL9AqXJRzqiMIJMhILjoi/i8LVEsbu+Ih9bsyW16sgQqjYLO0qda6KaCPKj3DQcu6CfV5lKtjS3ZCdqLAZkOey9MR+QutJBGiz/r15GVD6rCVwJR4UUKC4GNJkfDf00OMW8aQtLSAGLXV8MIi9mbbl/qQEpxCm2L5hutFX4ekeLH4QgBWUFKs/2VVMKy46WtFE6AbwgmYm/Z0yHk5veDIrcl2HpVqb/rSE0PC9EbDzJEWqeaPhh7vF369Umq2kSiB3s5rBI6c/7N9bkRu4h2n+/h5nSwy+7n+/I+6oXQVANo2Jb5zDwtiBPf1ySCzHdT6yJShMzqSRZfnykX49CaFaxhoVF4PBhEuECJ1PrFYSpmHuyYsl14DTAV9ZxRms1XiR/kBrjhZjidOt0UNe+GSml7XNgpVw8YsUTmZXLTK+6iYnyW/wYR1W4UXwOi14xpFROHb6HcZzksgF5DbL2AFXzKNwHU2adjdAY+KCyM/cwRTBkkq/a227NI0q6DR2MkMCRu620t79bGcYUmACtqN3mk/0uNwd3JSXHqE1kzf6Yyj0W2083JNDRnIXDlgBxJ6uf58NN1f6FQiRCWB4egF8QDx74AixV8oTyw7PluIjr3/rj/WzgwPSq4xPojaF7V0xqG2u5ti2L1h6yYHv73Isrukr0kURDIEjClBsBx7kdcXUxaYMS0syT3ymLzDzslNDWQOT1Tao1YNmJHARUenhCkmV9tqCPGI5GqZaRpkiPxyjoncWjyOHYGqvbvRX+Bn1pn7EhRNXa1lqJPmoeN5VqdqIDPhEVhFsyG0d4iQEIYX0wZUbY2XbZWYlpZ/l66IrDDY0q1C1YzBDpHC4h05YqHQLqS9anyl22JQ6lEvjvdBwMHfE7z0luCXD34/rFeDa2TmSeEAykSpYO5j1G/nsgpR3qn0qaQEmLjnnLfcz+veoYqPnRqmRGwCJ6FJ3Gm/Z1/aVX5PSb03MMnjAf41ww54sD5k8FrkfBP+K0b1MrYpapWjtpZfve2HVf4ickX3LKSOhu7qI1Vd4c1kNrn2ajy1t4y93JhV4fnWCKq7OmFpcr7FjdJCXPTql0Drr14Ho3Z87+GPQ4Z/DcTiGqtvZxlRYi8cNuhXABveZIwNl/BX1huhVLaFax5OqypUrQRyb9OE3SSkPlDdy5uo5XGg2EIGEjLY1MO5cr1ibfiFWV7zspcTgkBKkwo5jPyAin04LqizZXb2tDRgwKJjGx4cVk3ngAQixwcxjYAg2Q7vmUR/hpwInMdw7OhC2qyf41vTPkudQAORS0DdLtOGQxb4fH2VYGsvJCkeWPeUwtf1/tuIhzXEThoCZzzSJqqjUtbaPI3ntHm3T5uf849hGUA0zU8ni5W+EEn3/0Y6oUhQFw9z0aGjkljBbAlFXc0y82G2wkd7VdgWa5KTgJJNjNwZMfmdnUIUn1JU5LiWX5UZEZbVlKSN76mlmjUR2ku+fucTNlO4IAAahnLjBhlvQNR9pe9swGBgq0YR7P3VCyI/seYwQ4QBzy9X+HPePgoF8WfKaJ4MBOhLCGHae6Z8xkNXwni9QAKvTNtVA56x8YJflZ/VvONRSlsSLmiSyNMnTjTaE1ko81zkzGEnVwEhjCzlwIqpxmpDAqwsEmtpdr3xpc7i/ZX3f2TzT3M0FdxIEQvO1jgmmiN+D1YpMduAzEhBtj2OBkMN/rv6p7Th4pSH6f5aH3aTvwFTl7EOSgGASI7ttyMehzpm4AVyK+bFEaFg9gnZsSUPpsbAe/0RFhrH+EXZ12Z7thf4dzN1+Sn+G8QrDA1VKaN4IFxD1rQz9Xq9Coii9S9/hPbTGjyBwFH3H1UdQuz5KsgPDEHua4/kPg2Gp/IIItsaLWBqiT9XH45MiQxSosGJ56H/0F2cjcCFd72l1665RNHURdC3lspI77esfJsl+rXXabkAy7vxDXG/XGGcKpwiKDPFfvMEgjkAHil4Za1F36RnyxxvdIAzvgfH8knukYDck07tc++DP4TdWeI7HXuq5Yl6VVFrUQtf64/dkXewlKZSHQo6YvCSpREB0GDrz+Ys2GfO8nw2SwrYwaf88AifzlPvP17bf1mI3AuccJvAjZIpBmqvharKFAebEjVKfGAwpQjWoXlm9LROsq9bCk1UeQ3CJxJqprzssS/Q04JeS1ReCCubL3J7sx86spkP4eNpp95UF+8K748icIs8vdILFklk9skQqi1So6cx3X906pvy1vz+KipTJ8fiVJxsV5MmT0XwA";const YE=44032,_R=4352,kR=4449,TR=4519,bMe=19,yMe=21,mN=28,IR=yMe*mN,wIt=bMe*IR,CIt=YE+wIt,SIt=_R+bMe,NIt=kR+yMe,AIt=TR+mN;function Sj(e){return e>>24&255}function vMe(e){return e&16777215}let Wee,Jge,qee,gO;function jIt(){let e=hMe(vIt);Wee=new Map(pMe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),Jge=new Set(GE(e)),qee=new Map,gO=new Map;for(let[t,n]of mMe(e)){if(!Jge.has(t)&&n.length==2){let[r,s]=n,a=gO.get(r);a||(a=new Map,gO.set(r,a)),a.set(s,t)}qee.set(t,n.reverse())}}function wMe(e){return e>=YE&&e<CIt}function EIt(e,t){if(e>=_R&&e<SIt&&t>=kR&&t<NIt)return YE+(e-_R)*IR+(t-kR)*mN;if(wMe(e)&&t>TR&&t<AIt&&(e-YE)%mN==0)return e+(t-TR);{let n=gO.get(e);return n&&(n=n.get(t),n)?n:-1}}function CMe(e){Wee||jIt();let t=[],n=[],r=!1;function s(a){let o=Wee.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(wMe(a)){let o=a-YE,l=o/IR|0,c=o%IR/mN|0,u=o%mN;s(_R+l),s(kR+c),u>0&&s(TR+u)}else{let o=qee.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=Sj(t[0]);for(let o=1;o<t.length;o++){let l=Sj(t[o]);if(l==0||a<=l){a=l;continue}let c=o-1;for(;;){let u=t[c+1];if(t[c+1]=t[c],t[c]=u,!c||(a=Sj(t[--c]),a<=l))break}a=Sj(t[o])}}return t}function _It(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=Sj(a),l=vMe(a);if(r==-1)o==0?r=l:t.push(l);else if(s>0&&s>=o)o==0?(t.push(r,...n),n.length=0,r=l):n.push(l),s=o;else{let c=EIt(r,l);c>=0?r=c:s==0&&o==0?(t.push(r),r=l):(n.push(l),s=o)}}return r>=0&&t.push(r,...n),t}function SMe(e){return CMe(e).map(vMe)}function kIt(e){return _It(CMe(e))}const e1e=45,NMe=".",AMe=65039,jMe=1,PR=e=>Array.from(e);function XE(e,t){return e.P.has(t)||e.Q.has(t)}class TIt extends Array{get is_emoji(){return!0}}let Gee,EMe,ew,Kee,_Me,u4,EV,AC,Ev,t1e,Yee;function Goe(){if(Gee)return;let e=hMe(lIt);const t=()=>GE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));Gee=new Map(mMe(e)),EMe=n(),ew=t(),Kee=new Set(t().map(d=>ew[d])),ew=new Set(ew),_Me=n(),n();let s=pMe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};u4=KE(d=>{let f=KE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=pN(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),EV=n(),AC=new Map;let l=t().concat(PR(EV)).sort((d,f)=>d-f);l.forEach((d,f)=>{let x=e(),g=l[f]=x?l[f-x]:{V:[],M:new Map};g.V.push(d),EV.has(d)||AC.set(d,g)});for(let{V:d,M:f}of new Set(AC.values())){let x=[];for(let v of d){let w=u4.filter(N=>XE(N,v)),C=x.find(({G:N})=>w.some(I=>N.has(I)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>PR(v.G));for(let{G:v,V:w}of x){let C=new Set(g.filter(N=>!v.has(N)));for(let N of w)f.set(N,C)}}Ev=new Set;let c=new Set;const u=d=>Ev.has(d)?c.add(d):Ev.add(d);for(let d of u4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of Ev)!AC.has(d)&&!c.has(d)&&AC.set(d,jMe);r(Ev,SMe(Ev)),t1e=xIt(e).map(d=>TIt.from(d)).sort(yIt),Yee=new Map;for(let d of t1e){let f=[Yee];for(let x of d){let g=f.map(v=>{let w=v.get(x);return w||(w=new Map,v.set(x,w)),w});x===AMe?f.push(...g):f=g}for(let x of f)x.V=d}}function Koe(e){return(kMe(e)?"":`${Yoe(w$([e]))} `)+gMe(e)}function Yoe(e){return`"${e}"`}function IIt(e){if(e.length>=4&&e[2]==e1e&&e[3]==e1e)throw new Error(`invalid label extension: "${pN(e.slice(0,4))}"`)}function PIt(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function FIt(e){let t=e[0],n=Qge.get(t);if(n)throw e9(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=Qge.get(t);if(o){if(s==a)throw e9(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw e9(`trailing ${n}`)}function w$(e,t=1/0,n=gMe){let r=[];OIt(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let o=0;o<a;o++){let l=e[o];kMe(l)&&(r.push(pN(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(pN(e.slice(s,a))),r.join("")}function OIt(e,t){return Goe(),ew.has(e)}function kMe(e){return Goe(),_Me.has(e)}function MIt(e){return BIt(RIt(e,kIt,zIt))}function RIt(e,t,n){if(!e)return[];Goe();let r=0;return e.split(NMe).map(s=>{let a=bIt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=UIt(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(PIt(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))IIt(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(ew.has(d[0]))throw e9("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&ew.has(C[0]))throw e9(`emoji + combining mark: "${pN(l[w-1])} + ${w$([C[0]])}"`)}FIt(d);let g=PR(new Set(x)),[v]=DIt(g);$It(v,x),LIt(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function LIt(e,t){let n,r=[];for(let s of t){let a=AC.get(s);if(a===jMe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):PR(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>XE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function DIt(e){let t=u4;for(let n of e){let r=t.filter(s=>XE(s,n));if(!r.length)throw u4.some(s=>XE(s,n))?IMe(t[0],n):TMe(n);if(t=r,r.length==1)break}return t}function BIt(e){return e.map(({input:t,error:n,output:r})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${Yoe(w$(t,63))}: ${s}`)}return pN(r)}).join(NMe)}function TMe(e){return new Error(`disallowed character: ${Koe(e)}`)}function IMe(e,t){let n=Koe(t),r=u4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function e9(e){return new Error(`illegal placement: ${e}`)}function $It(e,t){for(let n of t)if(!XE(e,n))throw IMe(e,n);if(e.M){let n=SMe(t);for(let r=1,s=n.length;r<s;r++)if(Kee.has(n[r])){let a=r+1;for(let o;a<s&&Kee.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${Koe(o)}`);if(a-r>Zge)throw new Error(`excessive non-spacing marks: ${Yoe(w$(n.slice(r-1,a)))} (${a-r}/${Zge})`);r=a}}}function UIt(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=HIt(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(Ev.has(o))s.push(o);else{let l=Gee.get(o);if(l)s.push(...l);else if(!EMe.has(o))throw TMe(o)}}}return s.length&&r.push(t(s)),r}function zIt(e){return e.filter(t=>t!=AMe)}function HIt(e,t){let n=Yee,r,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:a}=n;a&&(r=a,e.length=s)}return r}function VIt(e){return MIt(e)}function WIt(e){return VIt(e)}const qIt={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},GIt={block:Fut({format(e){var n;return{transactions:(n=e.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const s=sB(r);return s.typeHex==="0x7e"&&(s.isSystemTx=r.isSystemTx,s.mint=r.mint?nd(r.mint):void 0,s.sourceHash=r.sourceHash,s.type="deposit"),s}),stateRoot:e.stateRoot}}}),transaction:Iut({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?nd(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:nht({format(e){return{l1GasPrice:e.l1GasPrice?nd(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?nd(e.l1GasUsed):null,l1Fee:e.l1Fee?nd(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function KIt(e,t){return QIt(e)?XIt(e):Hpt(e,t)}const YIt={transaction:KIt};function XIt(e){ZIt(e);const{sourceHash:t,data:n,from:r,gas:s,isSystemTx:a,mint:o,to:l,value:c}=e,u=[t,r,l??"0x",o?oi(o):"0x",c?oi(c):"0x",s?oi(s):"0x",a?"0x1":"0x",n??"0x"];return Cm(["0x7e",By(u)])}function QIt(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function ZIt(e){const{from:t,to:n}=e;if(t&&!ic(t))throw new pd({address:t});if(n&&!ic(n))throw new pd({address:n})}const n1e={contracts:qIt,formatters:GIt,serializers:YIt},r1e=fB({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),QE=fB({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),I7=1,s1e=fB({...n1e,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...n1e.contracts,disputeGameFactory:{[I7]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[I7]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[I7]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[I7]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:I7}),i1e=fB({id:137,name:"Polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});var Fb=function(){return Fb=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Fb.apply(this,arguments)};function JIt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function ePt(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var t9="right-scroll-bar-position",n9="width-before-scroll-bar",tPt="with-scroll-bars-hidden",nPt="--removed-body-scroll-bar-size";function _V(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function rPt(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var sPt=typeof window<"u"?m.useLayoutEffect:m.useEffect,a1e=new WeakMap;function PMe(e,t){var n=rPt(null,function(r){return e.forEach(function(s){return _V(s,r)})});return sPt(function(){var r=a1e.get(n);if(r){var s=new Set(r),a=new Set(e),o=n.current;s.forEach(function(l){a.has(l)||_V(l,null)}),a.forEach(function(l){s.has(l)||_V(l,o)})}a1e.set(n,e)},[e]),n}var Xee=function(e,t){return Xee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Xee(e,t)};function FMe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Xee(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var xN=function(){return xN=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},xN.apply(this,arguments)};function Xoe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function OMe(e,t,n,r){var s=arguments.length,a=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(s<3?o(a):s>3?o(t,n,a):o(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a}function MMe(e,t){return function(n,r){t(n,r,e)}}function RMe(e,t,n,r,s,a){function o(N){if(N!==void 0&&typeof N!="function")throw new TypeError("Function expected");return N}for(var l=r.kind,c=l==="getter"?"get":l==="setter"?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),f,x=!1,g=n.length-1;g>=0;g--){var v={};for(var w in r)v[w]=w==="access"?{}:r[w];for(var w in r.access)v.access[w]=r.access[w];v.addInitializer=function(N){if(x)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(N||null))};var C=(0,n[g])(l==="accessor"?{get:d.get,set:d.set}:d[c],v);if(l==="accessor"){if(C===void 0)continue;if(C===null||typeof C!="object")throw new TypeError("Object expected");(f=o(C.get))&&(d.get=f),(f=o(C.set))&&(d.set=f),(f=o(C.init))&&s.unshift(f)}else(f=o(C))&&(l==="field"?s.unshift(f):d[c]=f)}u&&Object.defineProperty(u,r.name,d),x=!0}function LMe(e,t,n){for(var r=arguments.length>2,s=0;s<t.length;s++)n=r?t[s].call(e,n):t[s].call(e);return r?n:void 0}function DMe(e){return typeof e=="symbol"?e:"".concat(e)}function BMe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function $Me(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function UMe(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})}function zMe(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var C$=Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};function HMe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&C$(t,e,n)}function FR(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qoe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)a.push(s.value)}catch(l){o={error:l}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function VMe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Qoe(arguments[t]));return e}function WMe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),s=0,t=0;t<n;t++)for(var a=arguments[t],o=0,l=a.length;o<l;o++,s++)r[s]=a[o];return r}function qMe(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function gN(e){return this instanceof gN?(this.v=e,this):new gN(e)}function GMe(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),s,a=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(g){return function(v){return Promise.resolve(v).then(g,f)}}function l(g,v){r[g]&&(s[g]=function(w){return new Promise(function(C,N){a.push([g,w,C,N])>1||c(g,w)})},v&&(s[g]=v(s[g])))}function c(g,v){try{u(r[g](v))}catch(w){x(a[0][3],w)}}function u(g){g.value instanceof gN?Promise.resolve(g.value.v).then(d,f):x(a[0][2],g)}function d(g){c("next",g)}function f(g){c("throw",g)}function x(g,v){g(v),a.shift(),a.length&&c(a[0][0],a[0][1])}}function KMe(e){var t,n;return t={},r("next"),r("throw",function(s){throw s}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(s,a){t[s]=e[s]?function(o){return(n=!n)?{value:gN(e[s](o)),done:!1}:a?a(o):o}:a}}function YMe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof FR=="function"?FR(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(l,c){o=e[a](o),s(l,c,o.done,o.value)})}}function s(a,o,l,c){Promise.resolve(c).then(function(u){a({value:u,done:l})},o)}}function XMe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var iPt=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function QMe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&C$(t,e,n);return iPt(t,e),t}function ZMe(e){return e&&e.__esModule?e:{default:e}}function JMe(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function eRe(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n}function tRe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function nRe(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(a){return Promise.reject(a)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var aPt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function rRe(e){function t(a){e.error=e.hasError?new aPt(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var n,r=0;function s(){for(;n=e.stack.pop();)try{if(!n.async&&r===1)return r=0,e.stack.push(n),Promise.resolve().then(s);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(a).then(s,function(o){return t(o),s()})}else r|=1}catch(o){t(o)}if(r===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return s()}function sRe(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,s,a,o){return r?t?".jsx":".js":s&&(!a||!o)?n:s+a+"."+o.toLowerCase()+"js"}):e}const oPt={__extends:FMe,__assign:xN,__rest:Xoe,__decorate:OMe,__param:MMe,__esDecorate:RMe,__runInitializers:LMe,__propKey:DMe,__setFunctionName:BMe,__metadata:$Me,__awaiter:UMe,__generator:zMe,__createBinding:C$,__exportStar:HMe,__values:FR,__read:Qoe,__spread:VMe,__spreadArrays:WMe,__spreadArray:qMe,__await:gN,__asyncGenerator:GMe,__asyncDelegator:KMe,__asyncValues:YMe,__makeTemplateObject:XMe,__importStar:QMe,__importDefault:ZMe,__classPrivateFieldGet:JMe,__classPrivateFieldSet:eRe,__classPrivateFieldIn:tRe,__addDisposableResource:nRe,__disposeResources:rRe,__rewriteRelativeImportExtension:sRe},pvn=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:nRe,get __assign(){return xN},__asyncDelegator:KMe,__asyncGenerator:GMe,__asyncValues:YMe,__await:gN,__awaiter:UMe,__classPrivateFieldGet:JMe,__classPrivateFieldIn:tRe,__classPrivateFieldSet:eRe,__createBinding:C$,__decorate:OMe,__disposeResources:rRe,__esDecorate:RMe,__exportStar:HMe,__extends:FMe,__generator:zMe,__importDefault:ZMe,__importStar:QMe,__makeTemplateObject:XMe,__metadata:$Me,__param:MMe,__propKey:DMe,__read:Qoe,__rest:Xoe,__rewriteRelativeImportExtension:sRe,__runInitializers:LMe,__setFunctionName:BMe,__spread:VMe,__spreadArray:qMe,__spreadArrays:WMe,__values:FR,default:oPt},Symbol.toStringTag,{value:"Module"}));function lPt(e){return e}function cPt(e,t){t===void 0&&(t=lPt);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return s}function iRe(e){e===void 0&&(e={});var t=cPt(null);return t.options=xN({async:!0,ssr:!1},e),t}var aRe=function(e){var t=e.sideCar,n=Xoe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,xN({},n))};aRe.isSideCarExport=!0;function oRe(e,t){return e.useMedium(t),aRe}var lRe=iRe(),kV=function(){},S$=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:kV,onWheelCapture:kV,onTouchMoveCapture:kV}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,x=e.sideCar,g=e.noIsolation,v=e.inert,w=e.allowPinchZoom,C=e.as,N=C===void 0?"div":C,I=e.gapMode,P=JIt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=x,F=PMe([n,t]),U=Fb(Fb({},P),s);return m.createElement(m.Fragment,null,d&&m.createElement(R,{sideCar:lRe,removeScrollBar:u,shards:f,noIsolation:g,inert:v,setCallbacks:a,allowPinchZoom:!!w,lockRef:n,gapMode:I}),o?m.cloneElement(m.Children.only(l),Fb(Fb({},U),{ref:F})):m.createElement(N,Fb({},U,{className:c,ref:F}),l))});S$.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};S$.classNames={fullWidth:n9,zeroRight:t9};var uPt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dPt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uPt();return t&&e.setAttribute("nonce",t),e}function fPt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hPt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var pPt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dPt())&&(fPt(t,n),hPt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mPt=function(){var e=pPt();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zoe=function(){var e=mPt(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},xPt={left:0,top:0,right:0,gap:0},TV=function(e){return parseInt(e||"",10)||0},gPt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[TV(n),TV(r),TV(s)]},bPt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xPt;var t=gPt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},yPt=Zoe(),d4="data-scroll-locked",vPt=function(e,t,n,r){var s=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
.`.concat(tPt,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(l,"px ").concat(r,`;
}
body[`).concat(d4,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(s,`px;
padding-top: `).concat(a,`px;
padding-right: `).concat(o,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(t9,` {
right: `).concat(l,"px ").concat(r,`;
}
.`).concat(n9,` {
margin-right: `).concat(l,"px ").concat(r,`;
}
.`).concat(t9," .").concat(t9,` {
right: 0 `).concat(r,`;
}
.`).concat(n9," .").concat(n9,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(d4,`] {
`).concat(nPt,": ").concat(l,`px;
}
`)},o1e=function(){var e=parseInt(document.body.getAttribute(d4)||"0",10);return isFinite(e)?e:0},wPt=function(){m.useEffect(function(){return document.body.setAttribute(d4,(o1e()+1).toString()),function(){var e=o1e()-1;e<=0?document.body.removeAttribute(d4):document.body.setAttribute(d4,e.toString())}},[])},cRe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;wPt();var a=m.useMemo(function(){return bPt(s)},[s]);return m.createElement(yPt,{styles:vPt(a,!t,s,n?"":"!important")})},Qee=!1;if(typeof window<"u")try{var hP=Object.defineProperty({},"passive",{get:function(){return Qee=!0,!0}});window.addEventListener("test",hP,hP),window.removeEventListener("test",hP,hP)}catch{Qee=!1}var q6=Qee?{passive:!1}:!1,CPt=function(e){return e.tagName==="TEXTAREA"},uRe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!CPt(e)&&n[t]==="visible")},SPt=function(e){return uRe(e,"overflowY")},NPt=function(e){return uRe(e,"overflowX")},l1e=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=dRe(e,r);if(s){var a=fRe(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},APt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},jPt=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dRe=function(e,t){return e==="v"?SPt(t):NPt(t)},fRe=function(e,t){return e==="v"?APt(t):jPt(t)},EPt=function(e,t){return e==="h"&&t==="rtl"?-1:1},_Pt=function(e,t,n,r,s){var a=EPt(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,x=0;do{var g=fRe(e,l),v=g[0],w=g[1],C=g[2],N=w-C-a*v;(v||N)&&dRe(e,l)&&(f+=N,x+=v),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(x)<1)&&(u=!0),u},pP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},c1e=function(e){return[e.deltaX,e.deltaY]},u1e=function(e){return e&&"current"in e?e.current:e},kPt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},TPt=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},IPt=0,G6=[];function PPt(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(IPt++)[0],a=m.useState(Zoe)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=ePt([e.lockRef.current],(e.shards||[]).map(u1e),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var N=pP(w),I=n.current,P="deltaX"in w?w.deltaX:I[0]-N[0],R="deltaY"in w?w.deltaY:I[1]-N[1],F,U=w.target,L=Math.abs(P)>Math.abs(R)?"h":"v";if("touches"in w&&L==="h"&&U.type==="range")return!1;var z=l1e(L,U);if(!z)return!0;if(z?F=L:(F=L==="v"?"h":"v",z=l1e(L,U)),!z)return!1;if(!r.current&&"changedTouches"in w&&(P||R)&&(r.current=F),!F)return!0;var Q=r.current||F;return _Pt(Q,C,w,Q==="h"?P:R)},[]),c=m.useCallback(function(w){var C=w;if(!(!G6.length||G6[G6.length-1]!==a)){var N="deltaY"in C?c1e(C):pP(C),I=t.current.filter(function(F){return F.name===C.type&&(F.target===C.target||C.target===F.shadowParent)&&kPt(F.delta,N)})[0];if(I&&I.should){C.cancelable&&C.preventDefault();return}if(!I){var P=(o.current.shards||[]).map(u1e).filter(Boolean).filter(function(F){return F.contains(C.target)}),R=P.length>0?l(C,P[0]):!o.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),u=m.useCallback(function(w,C,N,I){var P={name:w,delta:C,target:N,should:I,shadowParent:FPt(N)};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(R){return R!==P})},1)},[]),d=m.useCallback(function(w){n.current=pP(w),r.current=void 0},[]),f=m.useCallback(function(w){u(w.type,c1e(w),w.target,l(w,e.lockRef.current))},[]),x=m.useCallback(function(w){u(w.type,pP(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return G6.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:x}),document.addEventListener("wheel",c,q6),document.addEventListener("touchmove",c,q6),document.addEventListener("touchstart",d,q6),function(){G6=G6.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,q6),document.removeEventListener("touchmove",c,q6),document.removeEventListener("touchstart",d,q6)}},[]);var g=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(a,{styles:TPt(s)}):null,g?m.createElement(cRe,{gapMode:e.gapMode}):null)}function FPt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const OPt=oRe(lRe,PPt);var hRe=m.forwardRef(function(e,t){return m.createElement(S$,Fb({},e,{ref:t,sideCar:OPt}))});hRe.classNames=S$.classNames;function d1e(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function MPt(e,t){var n=e;for(var r of t){if(!(r in n))throw new Error("Path ".concat(t.join(" -> ")," does not exist in object"));n=n[r]}return n}function pRe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r={};for(var s in e){var a=e[s],o=[...n,s];typeof a=="string"||typeof a=="number"||a==null?r[s]=t(a,o):typeof a=="object"&&!Array.isArray(a)?r[s]=pRe(a,t,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(a)?"Array":typeof a,'"'))}return r}function f1e(e,t){var n={};if(typeof t=="object"){var r=e;pRe(t,(l,c)=>{if(l!=null){var u=MPt(r,c);n[d1e(u)]=String(l)}})}else{var s=e;for(var a in s){var o=s[a];o!=null&&(n[d1e(a)]=o)}}return Object.defineProperty(n,"toString",{value:function(){return Object.keys(this).map(c=>"".concat(c,":").concat(this[c])).join(";")},writable:!1}),n}var Nj={exports:{}},RPt=Nj.exports,h1e;function LPt(){return h1e||(h1e=1,function(e,t){(function(n,r){var s="1.0.40",a="",o="?",l="function",c="undefined",u="object",d="string",f="major",x="model",g="name",v="type",w="vendor",C="version",N="architecture",I="console",P="mobile",R="tablet",F="smarttv",U="wearable",L="embedded",z=500,Q="Amazon",ne="Apple",J="ASUS",X="BlackBerry",re="Browser",pe="Chrome",Y="Edge",ie="Firefox",oe="Google",G="Huawei",V="LG",te="Microsoft",ae="Motorola",he="Opera",Ce="Samsung",ce="Sharp",ge="Sony",Ae="Xiaomi",ye="Zebra",je="Facebook",Ie="Chromium OS",Re="Mac OS",Qe=" Browser",$e=function(Ut,Lt){var qe={};for(var Ke in Ut)Lt[Ke]&&Lt[Ke].length%2===0?qe[Ke]=Lt[Ke].concat(Ut[Ke]):qe[Ke]=Ut[Ke];return qe},it=function(Ut){for(var Lt={},qe=0;qe<Ut.length;qe++)Lt[Ut[qe].toUpperCase()]=Ut[qe];return Lt},tt=function(Ut,Lt){return typeof Ut===d?ot(Lt).indexOf(ot(Ut))!==-1:!1},ot=function(Ut){return Ut.toLowerCase()},ft=function(Ut){return typeof Ut===d?Ut.replace(/[^\d\.]/g,a).split(".")[0]:r},ct=function(Ut,Lt){if(typeof Ut===d)return Ut=Ut.replace(/^\s\s*/,a),typeof Lt===c?Ut:Ut.substring(0,z)},Vt=function(Ut,Lt){for(var qe=0,Ke,pt,en,Bt,Et,et;qe<Lt.length&&!Et;){var Be=Lt[qe],Mt=Lt[qe+1];for(Ke=pt=0;Ke<Be.length&&!Et&&Be[Ke];)if(Et=Be[Ke++].exec(Ut),Et)for(en=0;en<Mt.length;en++)et=Et[++pt],Bt=Mt[en],typeof Bt===u&&Bt.length>0?Bt.length===2?typeof Bt[1]==l?this[Bt[0]]=Bt[1].call(this,et):this[Bt[0]]=Bt[1]:Bt.length===3?typeof Bt[1]===l&&!(Bt[1].exec&&Bt[1].test)?this[Bt[0]]=et?Bt[1].call(this,et,Bt[2]):r:this[Bt[0]]=et?et.replace(Bt[1],Bt[2]):r:Bt.length===4&&(this[Bt[0]]=et?Bt[3].call(this,et.replace(Bt[1],Bt[2])):r):this[Bt]=et||r;qe+=2}},It=function(Ut,Lt){for(var qe in Lt)if(typeof Lt[qe]===u&&Lt[qe].length>0){for(var Ke=0;Ke<Lt[qe].length;Ke++)if(tt(Lt[qe][Ke],Ut))return qe===o?r:qe}else if(tt(Lt[qe],Ut))return qe===o?r:qe;return Lt.hasOwnProperty("*")?Lt["*"]:Ut},an={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Nt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},mn={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[C,[g,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[C,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,C],[/opios[\/ ]+([\w\.]+)/i],[C,[g,he+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[C,[g,he+" GX"]],[/\bopr\/([\w\.]+)/i],[C,[g,he]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[C,[g,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[C,[g,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[g,C],[/quark(?:pc)?\/([-\w\.]+)/i],[C,[g,"Quark"]],[/\bddg\/([\w\.]+)/i],[C,[g,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[C,[g,"UC"+re]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[C,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[C,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[C,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[C,[g,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[C,[g,"Smart Lenovo "+re]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure "+re],C],[/\bfocus\/([\w\.]+)/i],[C,[g,ie+" Focus"]],[/\bopt\/([\w\.]+)/i],[C,[g,he+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[C,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[C,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[C,[g,he+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[C,[g,"MIUI"+Qe]],[/fxios\/([\w\.-]+)/i],[C,[g,ie]],[/\bqihoobrowser\/?([\w\.]*)/i],[C,[g,"360"]],[/\b(qq)\/([\w\.]+)/i],[[g,/(.+)/,"$1Browser"],C],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1"+Qe],C],[/samsungbrowser\/([\w\.]+)/i],[C,[g,Ce+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[C,[g,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[g,"Sogou Mobile"],C],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[g,C],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[g],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[C,g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,je],C],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[g,C],[/\bgsa\/([\w\.]+) .*safari\//i],[C,[g,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[C,[g,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[C,[g,pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,pe+" WebView"],C],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[C,[g,"Android "+re]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,C],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[C,[g,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[C,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[C,It,an]],[/(webkit|khtml)\/([\w\.]+)/i],[g,C],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],C],[/(wolvic|librewolf)\/([\w\.]+)/i],[g,C],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[C,[g,ie+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[g,[C,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[g,[C,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[N,"amd64"]],[/(ia32(?=;))/i],[[N,ot]],[/((?:i[346]|x)86)[;\)]/i],[[N,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[N,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[N,"armhf"]],[/windows (ce|mobile); ppc;/i],[[N,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[N,/ower/,a,ot]],[/(sun4\w)[;\)]/i],[[N,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[N,ot]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[x,[w,Ce],[v,R]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[x,[w,Ce],[v,P]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[x,[w,ne],[v,P]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[x,[w,ne],[v,R]],[/(macintosh);/i],[x,[w,ne]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[x,[w,ce],[v,P]],[/(?:honor)([-\w ]+)[;\)]/i],[x,[w,"Honor"],[v,P]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[x,[w,G],[v,R]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[x,[w,G],[v,P]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[x,/_/g," "],[w,Ae],[v,P]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[x,/_/g," "],[w,Ae],[v,R]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[x,[w,"OPPO"],[v,P]],[/\b(opd2\d{3}a?) bui/i],[x,[w,"OPPO"],[v,R]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[x,[w,"Vivo"],[v,P]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[x,[w,"Realme"],[v,P]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[x,[w,ae],[v,P]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[x,[w,ae],[v,R]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[x,[w,V],[v,R]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[x,[w,V],[v,P]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[x,[w,"Lenovo"],[v,R]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[x,/_/g," "],[w,"Nokia"],[v,P]],[/(pixel c)\b/i],[x,[w,oe],[v,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[x,[w,oe],[v,P]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[x,[w,ge],[v,P]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[x,"Xperia Tablet"],[w,ge],[v,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[x,[w,"OnePlus"],[v,P]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[x,[w,Q],[v,R]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[x,/(.+)/g,"Fire Phone $1"],[w,Q],[v,P]],[/(playbook);[-\w\),; ]+(rim)/i],[x,w,[v,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[x,[w,X],[v,P]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[x,[w,J],[v,R]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[x,[w,J],[v,P]],[/(nexus 9)/i],[x,[w,"HTC"],[v,R]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[w,[x,/_/g," "],[v,P]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[x,[w,"TCL"],[v,R]],[/(itel) ((\w+))/i],[[w,ot],x,[v,It,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[x,[w,"Acer"],[v,R]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[x,[w,"Meizu"],[v,P]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[x,[w,"Ulefone"],[v,P]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[x,[w,"Energizer"],[v,P]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[x,[w,"Cat"],[v,P]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[x,[w,"Smartfren"],[v,P]],[/droid.+; (a(?:015|06[35]|142p?))/i],[x,[w,"Nothing"],[v,P]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[w,x,[v,P]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[w,x,[v,R]],[/(surface duo)/i],[x,[w,te],[v,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[x,[w,"Fairphone"],[v,P]],[/(u304aa)/i],[x,[w,"AT&T"],[v,P]],[/\bsie-(\w*)/i],[x,[w,"Siemens"],[v,P]],[/\b(rct\w+) b/i],[x,[w,"RCA"],[v,R]],[/\b(venue[\d ]{2,7}) b/i],[x,[w,"Dell"],[v,R]],[/\b(q(?:mv|ta)\w+) b/i],[x,[w,"Verizon"],[v,R]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[x,[w,"Barnes & Noble"],[v,R]],[/\b(tm\d{3}\w+) b/i],[x,[w,"NuVision"],[v,R]],[/\b(k88) b/i],[x,[w,"ZTE"],[v,R]],[/\b(nx\d{3}j) b/i],[x,[w,"ZTE"],[v,P]],[/\b(gen\d{3}) b.+49h/i],[x,[w,"Swiss"],[v,P]],[/\b(zur\d{3}) b/i],[x,[w,"Swiss"],[v,R]],[/\b((zeki)?tb.*\b) b/i],[x,[w,"Zeki"],[v,R]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[w,"Dragon Touch"],x,[v,R]],[/\b(ns-?\w{0,9}) b/i],[x,[w,"Insignia"],[v,R]],[/\b((nxa|next)-?\w{0,9}) b/i],[x,[w,"NextBook"],[v,R]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[w,"Voice"],x,[v,P]],[/\b(lvtel\-)?(v1[12]) b/i],[[w,"LvTel"],x,[v,P]],[/\b(ph-1) /i],[x,[w,"Essential"],[v,P]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[x,[w,"Envizen"],[v,R]],[/\b(trio[-\w\. ]+) b/i],[x,[w,"MachSpeed"],[v,R]],[/\btu_(1491) b/i],[x,[w,"Rotor"],[v,R]],[/(shield[\w ]+) b/i],[x,[w,"Nvidia"],[v,R]],[/(sprint) (\w+)/i],[w,x,[v,P]],[/(kin\.[onetw]{3})/i],[[x,/\./g," "],[w,te],[v,P]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[x,[w,ye],[v,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[x,[w,ye],[v,P]],[/smart-tv.+(samsung)/i],[w,[v,F]],[/hbbtv.+maple;(\d+)/i],[[x,/^/,"SmartTV"],[w,Ce],[v,F]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[w,V],[v,F]],[/(apple) ?tv/i],[w,[x,ne+" TV"],[v,F]],[/crkey/i],[[x,pe+"cast"],[w,oe],[v,F]],[/droid.+aft(\w+)( bui|\))/i],[x,[w,Q],[v,F]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[x,[w,ce],[v,F]],[/(bravia[\w ]+)( bui|\))/i],[x,[w,ge],[v,F]],[/(mitv-\w{5}) bui/i],[x,[w,Ae],[v,F]],[/Hbbtv.*(technisat) (.*);/i],[w,x,[v,F]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[w,ct],[x,ct],[v,F]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,F]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[w,x,[v,I]],[/droid.+; (shield) bui/i],[x,[w,"Nvidia"],[v,I]],[/(playstation [345portablevi]+)/i],[x,[w,ge],[v,I]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[x,[w,te],[v,I]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[x,[w,Ce],[v,U]],[/((pebble))app/i],[w,x,[v,U]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[x,[w,ne],[v,U]],[/droid.+; (glass) \d/i],[x,[w,oe],[v,U]],[/droid.+; (wt63?0{2,3})\)/i],[x,[w,ye],[v,U]],[/droid.+; (glass) \d/i],[x,[w,oe],[v,U]],[/(pico) (4|neo3(?: link|pro)?)/i],[w,x,[v,U]],[/; (quest( \d| pro)?)/i],[x,[w,je],[v,U]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[w,[v,L]],[/(aeobc)\b/i],[x,[w,Q],[v,L]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[x,[v,P]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[x,[v,R]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,R]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,P]],[/(android[-\w\. ]{0,9});.+buil/i],[x,[w,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[g,Y+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[g,C],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[g,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[g,C],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[C,g]],os:[[/microsoft (windows) (vista|xp)/i],[g,C],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[g,[C,It,Nt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[C,It,Nt],[g,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[C,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[g,Re],[C,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[C,g],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[g,C],[/\(bb(10);/i],[C,[g,X]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[C,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[C,[g,ie+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[C,[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[C,[g,"watchOS"]],[/crkey\/([\d\.]+)/i],[C,[g,pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,Ie],C],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[g,C],[/(sunos) ?([\w\.\d]*)/i],[[g,"Solaris"],C],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,C]]},dn=function(Ut,Lt){if(typeof Ut===u&&(Lt=Ut,Ut=r),!(this instanceof dn))return new dn(Ut,Lt).getResult();var qe=typeof n!==c&&n.navigator?n.navigator:r,Ke=Ut||(qe&&qe.userAgent?qe.userAgent:a),pt=qe&&qe.userAgentData?qe.userAgentData:r,en=Lt?$e(mn,Lt):mn,Bt=qe&&qe.userAgent==Ke;return this.getBrowser=function(){var Et={};return Et[g]=r,Et[C]=r,Vt.call(Et,Ke,en.browser),Et[f]=ft(Et[C]),Bt&&qe&&qe.brave&&typeof qe.brave.isBrave==l&&(Et[g]="Brave"),Et},this.getCPU=function(){var Et={};return Et[N]=r,Vt.call(Et,Ke,en.cpu),Et},this.getDevice=function(){var Et={};return Et[w]=r,Et[x]=r,Et[v]=r,Vt.call(Et,Ke,en.device),Bt&&!Et[v]&&pt&&pt.mobile&&(Et[v]=P),Bt&&Et[x]=="Macintosh"&&qe&&typeof qe.standalone!==c&&qe.maxTouchPoints&&qe.maxTouchPoints>2&&(Et[x]="iPad",Et[v]=R),Et},this.getEngine=function(){var Et={};return Et[g]=r,Et[C]=r,Vt.call(Et,Ke,en.engine),Et},this.getOS=function(){var Et={};return Et[g]=r,Et[C]=r,Vt.call(Et,Ke,en.os),Bt&&!Et[g]&&pt&&pt.platform&&pt.platform!="Unknown"&&(Et[g]=pt.platform.replace(/chrome os/i,Ie).replace(/macos/i,Re)),Et},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ke},this.setUA=function(Et){return Ke=typeof Et===d&&Et.length>z?ct(Et,z):Et,this},this.setUA(Ke),this};dn.VERSION=s,dn.BROWSER=it([g,C,f]),dn.CPU=it([N]),dn.DEVICE=it([x,w,v,I,P,F,R,U,L]),dn.ENGINE=dn.OS=it([g,C]),e.exports&&(t=e.exports=dn),t.UAParser=dn;var Pt=typeof n!==c&&(n.jQuery||n.Zepto);if(Pt&&!Pt.ua){var Xe=new dn;Pt.ua=Xe.getResult(),Pt.ua.get=function(){return Xe.getUA()},Pt.ua.set=function(Ut){Xe.setUA(Ut);var Lt=Xe.getResult();for(var qe in Lt)Pt.ua[qe]=Lt[qe]}}})(typeof window=="object"?window:RPt)}(Nj,Nj.exports)),Nj.exports}var DPt=LPt(),K6={},IV,p1e;function BPt(){return p1e||(p1e=1,IV=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),IV}var PV={},hb={},m1e;function m5(){if(m1e)return hb;m1e=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return hb.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},hb.getSymbolTotalCodewords=function(r){return t[r]},hb.getBCHDigit=function(n){let r=0;for(;n!==0;)r++,n>>>=1;return r},hb.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');e=r},hb.isKanjiModeEnabled=function(){return typeof e<"u"},hb.toSJIS=function(r){return e(r)},hb}var FV={},x1e;function Joe(){return x1e||(x1e=1,function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,s){if(e.isValid(r))return r;try{return t(r)}catch{return s}}}(FV)),FV}var OV,g1e;function $Pt(){if(g1e)return OV;g1e=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)===1},put:function(t,n){for(let r=0;r<n;r++)this.putBit((t>>>n-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},OV=e,OV}var MV,b1e;function UPt(){if(b1e)return MV;b1e=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,n,r,s){const a=t*this.size+n;this.data[a]=r,s&&(this.reservedBit[a]=!0)},e.prototype.get=function(t,n){return this.data[t*this.size+n]},e.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},e.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},MV=e,MV}var RV={},y1e;function zPt(){return y1e||(y1e=1,function(e){const t=m5().getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,a=t(r),o=a===145?26:Math.ceil((a-13)/(2*s-2))*2,l=[a-7];for(let c=1;c<s-1;c++)l[c]=l[c-1]-o;return l.push(6),l.reverse()},e.getPositions=function(r){const s=[],a=e.getRowColCoords(r),o=a.length;for(let l=0;l<o;l++)for(let c=0;c<o;c++)l===0&&c===0||l===0&&c===o-1||l===o-1&&c===0||s.push([a[l],a[c]]);return s}}(RV)),RV}var LV={},v1e;function HPt(){if(v1e)return LV;v1e=1;const e=m5().getSymbolSize,t=7;return LV.getPositions=function(r){const s=e(r);return[[0,0],[s-t,0],[0,s-t]]},LV}var DV={},w1e;function VPt(){return w1e||(w1e=1,function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const a=s.size;let o=0,l=0,c=0,u=null,d=null;for(let f=0;f<a;f++){l=c=0,u=d=null;for(let x=0;x<a;x++){let g=s.get(f,x);g===u?l++:(l>=5&&(o+=t.N1+(l-5)),u=g,l=1),g=s.get(x,f),g===d?c++:(c>=5&&(o+=t.N1+(c-5)),d=g,c=1)}l>=5&&(o+=t.N1+(l-5)),c>=5&&(o+=t.N1+(c-5))}return o},e.getPenaltyN2=function(s){const a=s.size;let o=0;for(let l=0;l<a-1;l++)for(let c=0;c<a-1;c++){const u=s.get(l,c)+s.get(l,c+1)+s.get(l+1,c)+s.get(l+1,c+1);(u===4||u===0)&&o++}return o*t.N2},e.getPenaltyN3=function(s){const a=s.size;let o=0,l=0,c=0;for(let u=0;u<a;u++){l=c=0;for(let d=0;d<a;d++)l=l<<1&2047|s.get(u,d),d>=10&&(l===1488||l===93)&&o++,c=c<<1&2047|s.get(d,u),d>=10&&(c===1488||c===93)&&o++}return o*t.N3},e.getPenaltyN4=function(s){let a=0;const o=s.data.length;for(let c=0;c<o;c++)a+=s.data[c];return Math.abs(Math.ceil(a*100/o/5)-10)*t.N4};function n(r,s,a){switch(r){case e.Patterns.PATTERN000:return(s+a)%2===0;case e.Patterns.PATTERN001:return s%2===0;case e.Patterns.PATTERN010:return a%3===0;case e.Patterns.PATTERN011:return(s+a)%3===0;case e.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(a/3))%2===0;case e.Patterns.PATTERN101:return s*a%2+s*a%3===0;case e.Patterns.PATTERN110:return(s*a%2+s*a%3)%2===0;case e.Patterns.PATTERN111:return(s*a%3+(s+a)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(s,a){const o=a.size;for(let l=0;l<o;l++)for(let c=0;c<o;c++)a.isReserved(c,l)||a.xor(c,l,n(s,c,l))},e.getBestMask=function(s,a){const o=Object.keys(e.Patterns).length;let l=0,c=1/0;for(let u=0;u<o;u++){a(u),e.applyMask(u,s);const d=e.getPenaltyN1(s)+e.getPenaltyN2(s)+e.getPenaltyN3(s)+e.getPenaltyN4(s);e.applyMask(u,s),d<c&&(c=d,l=u)}return l}}(DV)),DV}var mP={},C1e;function mRe(){if(C1e)return mP;C1e=1;const e=Joe(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return mP.getBlocksCount=function(s,a){switch(a){case e.L:return t[(s-1)*4+0];case e.M:return t[(s-1)*4+1];case e.Q:return t[(s-1)*4+2];case e.H:return t[(s-1)*4+3];default:return}},mP.getTotalCodewordsCount=function(s,a){switch(a){case e.L:return n[(s-1)*4+0];case e.M:return n[(s-1)*4+1];case e.Q:return n[(s-1)*4+2];case e.H:return n[(s-1)*4+3];default:return}},mP}var BV={},P7={},S1e;function WPt(){if(S1e)return P7;S1e=1;const e=new Uint8Array(512),t=new Uint8Array(256);return function(){let r=1;for(let s=0;s<255;s++)e[s]=r,t[r]=s,r<<=1,r&256&&(r^=285);for(let s=255;s<512;s++)e[s]=e[s-255]}(),P7.log=function(r){if(r<1)throw new Error("log("+r+")");return t[r]},P7.exp=function(r){return e[r]},P7.mul=function(r,s){return r===0||s===0?0:e[t[r]+t[s]]},P7}var N1e;function qPt(){return N1e||(N1e=1,function(e){const t=WPt();e.mul=function(r,s){const a=new Uint8Array(r.length+s.length-1);for(let o=0;o<r.length;o++)for(let l=0;l<s.length;l++)a[o+l]^=t.mul(r[o],s[l]);return a},e.mod=function(r,s){let a=new Uint8Array(r);for(;a.length-s.length>=0;){const o=a[0];for(let c=0;c<s.length;c++)a[c]^=t.mul(s[c],o);let l=0;for(;l<a.length&&a[l]===0;)l++;a=a.slice(l)}return a},e.generateECPolynomial=function(r){let s=new Uint8Array([1]);for(let a=0;a<r;a++)s=e.mul(s,new Uint8Array([1,t.exp(a)]));return s}}(BV)),BV}var $V,A1e;function GPt(){if(A1e)return $V;A1e=1;const e=qPt();function t(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(r){this.degree=r,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const s=new Uint8Array(r.length+this.degree);s.set(r);const a=e.mod(s,this.genPoly),o=this.degree-a.length;if(o>0){const l=new Uint8Array(this.degree);return l.set(a,o),l}return a},$V=t,$V}var UV={},zV={},HV={},j1e;function xRe(){return j1e||(j1e=1,HV.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),HV}var Qm={},E1e;function gRe(){if(E1e)return Qm;E1e=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r
]))+`;Qm.KANJI=new RegExp(n,"g"),Qm.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Qm.BYTE=new RegExp(r,"g"),Qm.NUMERIC=new RegExp(e,"g"),Qm.ALPHANUMERIC=new RegExp(t,"g");const s=new RegExp("^"+n+"$"),a=new RegExp("^"+e+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Qm.testKanji=function(c){return s.test(c)},Qm.testNumeric=function(c){return a.test(c)},Qm.testAlphanumeric=function(c){return o.test(c)},Qm}var _1e;function x5(){return _1e||(_1e=1,function(e){const t=xRe(),n=gRe();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,o){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?a.ccBits[0]:o<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return n.testNumeric(a)?e.NUMERIC:n.testAlphanumeric(a)?e.ALPHANUMERIC:n.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(a,o){if(e.isValid(a))return a;try{return r(a)}catch{return o}}}(zV)),zV}var k1e;function KPt(){return k1e||(k1e=1,function(e){const t=m5(),n=mRe(),r=Joe(),s=x5(),a=xRe(),o=7973,l=t.getBCHDigit(o);function c(x,g,v){for(let w=1;w<=40;w++)if(g<=e.getCapacity(w,v,x))return w}function u(x,g){return s.getCharCountIndicator(x,g)+4}function d(x,g){let v=0;return x.forEach(function(w){const C=u(w.mode,g);v+=C+w.getBitsLength()}),v}function f(x,g){for(let v=1;v<=40;v++)if(d(x,v)<=e.getCapacity(v,g,s.MIXED))return v}e.from=function(g,v){return a.isValid(g)?parseInt(g,10):v},e.getCapacity=function(g,v,w){if(!a.isValid(g))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=s.BYTE);const C=t.getSymbolTotalCodewords(g),N=n.getTotalCodewordsCount(g,v),I=(C-N)*8;if(w===s.MIXED)return I;const P=I-u(w,g);switch(w){case s.NUMERIC:return Math.floor(P/10*3);case s.ALPHANUMERIC:return Math.floor(P/11*2);case s.KANJI:return Math.floor(P/13);case s.BYTE:default:return Math.floor(P/8)}},e.getBestVersionForData=function(g,v){let w;const C=r.from(v,r.M);if(Array.isArray(g)){if(g.length>1)return f(g,C);if(g.length===0)return 1;w=g[0]}else w=g;return c(w.mode,w.getLength(),C)},e.getEncodedBits=function(g){if(!a.isValid(g)||g<7)throw new Error("Invalid QR Code version");let v=g<<12;for(;t.getBCHDigit(v)-l>=0;)v^=o<<t.getBCHDigit(v)-l;return g<<12|v}}(UV)),UV}var VV={},T1e;function YPt(){if(T1e)return VV;T1e=1;const e=m5(),t=1335,n=21522,r=e.getBCHDigit(t);return VV.getEncodedBits=function(a,o){const l=a.bit<<3|o;let c=l<<10;for(;e.getBCHDigit(c)-r>=0;)c^=t<<e.getBCHDigit(c)-r;return(l<<10|c)^n},VV}var WV={},qV,I1e;function XPt(){if(I1e)return qV;I1e=1;const e=x5();function t(n){this.mode=e.NUMERIC,this.data=n.toString()}return t.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){let s,a,o;for(s=0;s+3<=this.data.length;s+=3)a=this.data.substr(s,3),o=parseInt(a,10),r.put(o,10);const l=this.data.length-s;l>0&&(a=this.data.substr(s),o=parseInt(a,10),r.put(o,l*3+1))},qV=t,qV}var GV,P1e;function QPt(){if(P1e)return GV;P1e=1;const e=x5(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(r){this.mode=e.ALPHANUMERIC,this.data=r}return n.getBitsLength=function(s){return 11*Math.floor(s/2)+6*(s%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(s){let a;for(a=0;a+2<=this.data.length;a+=2){let o=t.indexOf(this.data[a])*45;o+=t.indexOf(this.data[a+1]),s.put(o,11)}this.data.length%2&&s.put(t.indexOf(this.data[a]),6)},GV=n,GV}var KV,F1e;function ZPt(){if(F1e)return KV;F1e=1;const e=x5();function t(n){this.mode=e.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}return t.getBitsLength=function(r){return r*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){for(let r=0,s=this.data.length;r<s;r++)n.put(this.data[r],8)},KV=t,KV}var YV,O1e;function JPt(){if(O1e)return YV;O1e=1;const e=x5(),t=m5();function n(r){this.mode=e.KANJI,this.data=r}return n.getBitsLength=function(s){return s*13},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let s;for(s=0;s<this.data.length;s++){let a=t.toSJIS(this.data[s]);if(a>=33088&&a<=40956)a-=33088;else if(a>=57408&&a<=60351)a-=49472;else throw new Error("Invalid SJIS character: "+this.data[s]+`
Make sure your charset is UTF-8`);a=(a>>>8&255)*192+(a&255),r.put(a,13)}},YV=n,YV}var XV={exports:{}},M1e;function eFt(){return M1e||(M1e=1,function(e){var t={single_source_shortest_paths:function(n,r,s){var a={},o={};o[r]=0;var l=t.PriorityQueue.make();l.push(r,0);for(var c,u,d,f,x,g,v,w,C;!l.empty();){c=l.pop(),u=c.value,f=c.cost,x=n[u]||{};for(d in x)x.hasOwnProperty(d)&&(g=x[d],v=f+g,w=o[d],C=typeof o[d]>"u",(C||w>v)&&(o[d]=v,l.push(d,v),a[d]=u))}if(typeof s<"u"&&typeof o[s]>"u"){var N=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(N)}return a},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],a=r;a;)s.push(a),n[a],a=n[a];return s.reverse(),s},find_path:function(n,r,s){var a=t.single_source_shortest_paths(n,r,s);return t.extract_shortest_path_from_predecessor_list(a,s)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,s={},a;n=n||{};for(a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t}(XV)),XV.exports}var R1e;function tFt(){return R1e||(R1e=1,function(e){const t=x5(),n=XPt(),r=QPt(),s=ZPt(),a=JPt(),o=gRe(),l=m5(),c=eFt();function u(N){return unescape(encodeURIComponent(N)).length}function d(N,I,P){const R=[];let F;for(;(F=N.exec(P))!==null;)R.push({data:F[0],index:F.index,mode:I,length:F[0].length});return R}function f(N){const I=d(o.NUMERIC,t.NUMERIC,N),P=d(o.ALPHANUMERIC,t.ALPHANUMERIC,N);let R,F;return l.isKanjiModeEnabled()?(R=d(o.BYTE,t.BYTE,N),F=d(o.KANJI,t.KANJI,N)):(R=d(o.BYTE_KANJI,t.BYTE,N),F=[]),I.concat(P,R,F).sort(function(L,z){return L.index-z.index}).map(function(L){return{data:L.data,mode:L.mode,length:L.length}})}function x(N,I){switch(I){case t.NUMERIC:return n.getBitsLength(N);case t.ALPHANUMERIC:return r.getBitsLength(N);case t.KANJI:return a.getBitsLength(N);case t.BYTE:return s.getBitsLength(N)}}function g(N){return N.reduce(function(I,P){const R=I.length-1>=0?I[I.length-1]:null;return R&&R.mode===P.mode?(I[I.length-1].data+=P.data,I):(I.push(P),I)},[])}function v(N){const I=[];for(let P=0;P<N.length;P++){const R=N[P];switch(R.mode){case t.NUMERIC:I.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:I.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:I.push([R,{data:R.data,mode:t.BYTE,length:u(R.data)}]);break;case t.BYTE:I.push([{data:R.data,mode:t.BYTE,length:u(R.data)}])}}return I}function w(N,I){const P={},R={start:{}};let F=["start"];for(let U=0;U<N.length;U++){const L=N[U],z=[];for(let Q=0;Q<L.length;Q++){const ne=L[Q],J=""+U+Q;z.push(J),P[J]={node:ne,lastCount:0},R[J]={};for(let X=0;X<F.length;X++){const re=F[X];P[re]&&P[re].node.mode===ne.mode?(R[re][J]=x(P[re].lastCount+ne.length,ne.mode)-x(P[re].lastCount,ne.mode),P[re].lastCount+=ne.length):(P[re]&&(P[re].lastCount=ne.length),R[re][J]=x(ne.length,ne.mode)+4+t.getCharCountIndicator(ne.mode,I))}}F=z}for(let U=0;U<F.length;U++)R[F[U]].end=0;return{map:R,table:P}}function C(N,I){let P;const R=t.getBestModeForData(N);if(P=t.from(I,R),P!==t.BYTE&&P.bit<R.bit)throw new Error('"'+N+'" cannot be encoded with mode '+t.toString(P)+`.
Suggested mode is: `+t.toString(R));switch(P===t.KANJI&&!l.isKanjiModeEnabled()&&(P=t.BYTE),P){case t.NUMERIC:return new n(N);case t.ALPHANUMERIC:return new r(N);case t.KANJI:return new a(N);case t.BYTE:return new s(N)}}e.fromArray=function(I){return I.reduce(function(P,R){return typeof R=="string"?P.push(C(R,null)):R.data&&P.push(C(R.data,R.mode)),P},[])},e.fromString=function(I,P){const R=f(I,l.isKanjiModeEnabled()),F=v(R),U=w(F,P),L=c.find_path(U.map,"start","end"),z=[];for(let Q=1;Q<L.length-1;Q++)z.push(U.table[L[Q]].node);return e.fromArray(g(z))},e.rawSplit=function(I){return e.fromArray(f(I,l.isKanjiModeEnabled()))}}(WV)),WV}var L1e;function nFt(){if(L1e)return PV;L1e=1;const e=m5(),t=Joe(),n=$Pt(),r=UPt(),s=zPt(),a=HPt(),o=VPt(),l=mRe(),c=GPt(),u=KPt(),d=YPt(),f=x5(),x=tFt();function g(U,L){const z=U.size,Q=a.getPositions(L);for(let ne=0;ne<Q.length;ne++){const J=Q[ne][0],X=Q[ne][1];for(let re=-1;re<=7;re++)if(!(J+re<=-1||z<=J+re))for(let pe=-1;pe<=7;pe++)X+pe<=-1||z<=X+pe||(re>=0&&re<=6&&(pe===0||pe===6)||pe>=0&&pe<=6&&(re===0||re===6)||re>=2&&re<=4&&pe>=2&&pe<=4?U.set(J+re,X+pe,!0,!0):U.set(J+re,X+pe,!1,!0))}}function v(U){const L=U.size;for(let z=8;z<L-8;z++){const Q=z%2===0;U.set(z,6,Q,!0),U.set(6,z,Q,!0)}}function w(U,L){const z=s.getPositions(L);for(let Q=0;Q<z.length;Q++){const ne=z[Q][0],J=z[Q][1];for(let X=-2;X<=2;X++)for(let re=-2;re<=2;re++)X===-2||X===2||re===-2||re===2||X===0&&re===0?U.set(ne+X,J+re,!0,!0):U.set(ne+X,J+re,!1,!0)}}function C(U,L){const z=U.size,Q=u.getEncodedBits(L);let ne,J,X;for(let re=0;re<18;re++)ne=Math.floor(re/3),J=re%3+z-8-3,X=(Q>>re&1)===1,U.set(ne,J,X,!0),U.set(J,ne,X,!0)}function N(U,L,z){const Q=U.size,ne=d.getEncodedBits(L,z);let J,X;for(J=0;J<15;J++)X=(ne>>J&1)===1,J<6?U.set(J,8,X,!0):J<8?U.set(J+1,8,X,!0):U.set(Q-15+J,8,X,!0),J<8?U.set(8,Q-J-1,X,!0):J<9?U.set(8,15-J-1+1,X,!0):U.set(8,15-J-1,X,!0);U.set(Q-8,8,1,!0)}function I(U,L){const z=U.size;let Q=-1,ne=z-1,J=7,X=0;for(let re=z-1;re>0;re-=2)for(re===6&&re--;;){for(let pe=0;pe<2;pe++)if(!U.isReserved(ne,re-pe)){let Y=!1;X<L.length&&(Y=(L[X]>>>J&1)===1),U.set(ne,re-pe,Y),J--,J===-1&&(X++,J=7)}if(ne+=Q,ne<0||z<=ne){ne-=Q,Q=-Q;break}}}function P(U,L,z){const Q=new n;z.forEach(function(pe){Q.put(pe.mode.bit,4),Q.put(pe.getLength(),f.getCharCountIndicator(pe.mode,U)),pe.write(Q)});const ne=e.getSymbolTotalCodewords(U),J=l.getTotalCodewordsCount(U,L),X=(ne-J)*8;for(Q.getLengthInBits()+4<=X&&Q.put(0,4);Q.getLengthInBits()%8!==0;)Q.putBit(0);const re=(X-Q.getLengthInBits())/8;for(let pe=0;pe<re;pe++)Q.put(pe%2?17:236,8);return R(Q,U,L)}function R(U,L,z){const Q=e.getSymbolTotalCodewords(L),ne=l.getTotalCodewordsCount(L,z),J=Q-ne,X=l.getBlocksCount(L,z),re=Q%X,pe=X-re,Y=Math.floor(Q/X),ie=Math.floor(J/X),oe=ie+1,G=Y-ie,V=new c(G);let te=0;const ae=new Array(X),he=new Array(X);let Ce=0;const ce=new Uint8Array(U.buffer);for(let Ie=0;Ie<X;Ie++){const Re=Ie<pe?ie:oe;ae[Ie]=ce.slice(te,te+Re),he[Ie]=V.encode(ae[Ie]),te+=Re,Ce=Math.max(Ce,Re)}const ge=new Uint8Array(Q);let Ae=0,ye,je;for(ye=0;ye<Ce;ye++)for(je=0;je<X;je++)ye<ae[je].length&&(ge[Ae++]=ae[je][ye]);for(ye=0;ye<G;ye++)for(je=0;je<X;je++)ge[Ae++]=he[je][ye];return ge}function F(U,L,z,Q){let ne;if(Array.isArray(U))ne=x.fromArray(U);else if(typeof U=="string"){let Y=L;if(!Y){const ie=x.rawSplit(U);Y=u.getBestVersionForData(ie,z)}ne=x.fromString(U,Y||40)}else throw new Error("Invalid data");const J=u.getBestVersionForData(ne,z);if(!J)throw new Error("The amount of data is too big to be stored in a QR Code");if(!L)L=J;else if(L<J)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+J+`.
`);const X=P(L,z,ne),re=e.getSymbolSize(L),pe=new r(re);return g(pe,L),v(pe),w(pe,L),N(pe,z,0),L>=7&&C(pe,L),I(pe,X),isNaN(Q)&&(Q=o.getBestMask(pe,N.bind(null,pe,z))),o.applyMask(Q,pe),N(pe,z,Q),{modules:pe,version:L,errorCorrectionLevel:z,maskPattern:Q,segments:ne}}return PV.create=function(L,z){if(typeof L>"u"||L==="")throw new Error("No input text");let Q=t.M,ne,J;return typeof z<"u"&&(Q=t.from(z.errorCorrectionLevel,t.M),ne=u.from(z.version),J=o.from(z.maskPattern),z.toSJISFunc&&e.setToSJISFunction(z.toSJISFunc)),F(L,ne,Q,J)},PV}var QV={},ZV={},D1e;function bRe(){return D1e||(D1e=1,function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(a){return[a,a]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,a=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:a,scale:a?4:o,margin:s,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},e.getImageWidth=function(r,s){const a=e.getScale(r,s);return Math.floor((r+s.margin*2)*a)},e.qrToImageData=function(r,s,a){const o=s.modules.size,l=s.modules.data,c=e.getScale(o,a),u=Math.floor((o+a.margin*2)*c),d=a.margin*c,f=[a.color.light,a.color.dark];for(let x=0;x<u;x++)for(let g=0;g<u;g++){let v=(x*u+g)*4,w=a.color.light;if(x>=d&&g>=d&&x<u-d&&g<u-d){const C=Math.floor((x-d)/c),N=Math.floor((g-d)/c);w=f[l[C*o+N]?1:0]}r[v++]=w.r,r[v++]=w.g,r[v++]=w.b,r[v]=w.a}}}(ZV)),ZV}var B1e;function rFt(){return B1e||(B1e=1,function(e){const t=bRe();function n(s,a,o){s.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=o,a.width=o,a.style.height=o+"px",a.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,o,l){let c=l,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=r()),c=t.getOptions(c);const d=t.getImageWidth(a.modules.size,c),f=u.getContext("2d"),x=f.createImageData(d,d);return t.qrToImageData(x.data,a,c),n(f,u,d),f.putImageData(x,0,0),u},e.renderToDataURL=function(a,o,l){let c=l;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=e.render(a,o,c),d=c.type||"image/png",f=c.rendererOpts||{};return u.toDataURL(d,f.quality)}}(QV)),QV}var JV={},$1e;function sFt(){if($1e)return JV;$1e=1;const e=bRe();function t(s,a){const o=s.a/255,l=a+'="'+s.hex+'"';return o<1?l+" "+a+'-opacity="'+o.toFixed(2).slice(1)+'"':l}function n(s,a,o){let l=s+a;return typeof o<"u"&&(l+=" "+o),l}function r(s,a,o){let l="",c=0,u=!1,d=0;for(let f=0;f<s.length;f++){const x=Math.floor(f%a),g=Math.floor(f/a);!x&&!u&&(u=!0),s[f]?(d++,f>0&&x>0&&s[f-1]||(l+=u?n("M",x+o,.5+g+o):n("m",c,0),c=0,u=!1),x+1<a&&s[f+1]||(l+=n("h",d),d=0)):c++}return l}return JV.render=function(a,o,l){const c=e.getOptions(o),u=a.modules.size,d=a.modules.data,f=u+c.margin*2,x=c.color.light.a?"<path "+t(c.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",g="<path "+t(c.color.dark,"stroke")+' d="'+r(d,u,c.margin)+'"/>',v='viewBox="0 0 '+f+" "+f+'"',C='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+v+' shape-rendering="crispEdges">'+x+g+`</svg>
`;return typeof l=="function"&&l(null,C),C},JV}var U1e;function iFt(){if(U1e)return K6;U1e=1;const e=BPt(),t=nFt(),n=rFt(),r=sFt();function s(a,o,l,c,u){const d=[].slice.call(arguments,1),f=d.length,x=typeof d[f-1]=="function";if(!x&&!e())throw new Error("Callback required as last argument");if(x){if(f<2)throw new Error("Too few arguments provided");f===2?(u=l,l=o,o=c=void 0):f===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=l,l=o,o=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(l=o,o=c=void 0):f===2&&!o.getContext&&(c=l,l=o,o=void 0),new Promise(function(g,v){try{const w=t.create(l,c);g(a(w,o,c))}catch(w){v(w)}})}try{const g=t.create(l,c);u(null,a(g,o,c))}catch(g){u(g)}}return K6.create=t.create,K6.toCanvas=s.bind(null,n.render),K6.toDataURL=s.bind(null,n.renderToDataURL),K6.toString=s.bind(null,function(a,o,l){return r.render(a,l)}),K6}var aFt=iFt();const oFt=ki(aFt);N$.type="coinbaseWallet";function N$(e={}){return e.version==="3"||e.headlessMode?cFt(e):lFt(e)}function lFt(e){let t,n,r,s;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:N$.type,async connect({chainId:o,...l}={}){try{const c=await this.getProvider(),u=(await c.request({method:"eth_requestAccounts",params:"instantOnboarding"in l&&l.instantOnboarding?[{onboarding:"instant"}]:[]})).map(f=>Ac(f));n||(n=this.onAccountsChanged.bind(this),c.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),c.on("chainChanged",r)),s||(s=this.onDisconnect.bind(this),c.on("disconnect",s));let d=await this.getChainId();if(o&&d!==o){const f=await this.switchChain({chainId:o}).catch(x=>{if(x.code===bo.code)throw x;return{id:d}});d=(f==null?void 0:f.id)??d}return{accounts:u,chainId:d}}catch(c){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(c.message)?new bo(c):c}},async disconnect(){var l;const o=await this.getProvider();n&&(o.removeListener("accountsChanged",n),n=void 0),r&&(o.removeListener("chainChanged",r),r=void 0),s&&(o.removeListener("disconnect",s),s=void 0),o.disconnect(),(l=o.close)==null||l.call(o)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>Ac(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){if(!t){const o=(()=>{var u;return typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:((u=e.preference)==null?void 0:u.options)??"all"}})(),{createCoinbaseWalletSDK:l}=await ss(async()=>{const{createCoinbaseWalletSDK:u}=await import("./index-2x1T7RD_.js");return{createCoinbaseWalletSDK:u}},__vite__mapDeps([0,1,2,3]));t=l({...e,appChainIds:a.chains.map(u=>u.id),preference:o}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:o,chainId:l}){var d,f,x,g;const c=a.chains.find(v=>v.id===l);if(!c)throw new ip(new C3);const u=await this.getProvider();try{return await u.request({method:"wallet_switchEthereumChain",params:[{chainId:Ds(c.id)}]}),c}catch(v){if(v.code===4902)try{let w;o!=null&&o.blockExplorerUrls?w=o.blockExplorerUrls:w=(d=c.blockExplorers)!=null&&d.default.url?[(f=c.blockExplorers)==null?void 0:f.default.url]:[];let C;(x=o==null?void 0:o.rpcUrls)!=null&&x.length?C=o.rpcUrls:C=[((g=c.rpcUrls.default)==null?void 0:g.http[0])??""];const N={blockExplorerUrls:w,chainId:Ds(l),chainName:(o==null?void 0:o.chainName)??c.name,iconUrls:o==null?void 0:o.iconUrls,nativeCurrency:(o==null?void 0:o.nativeCurrency)??c.nativeCurrency,rpcUrls:C};return await u.request({method:"wallet_addEthereumChain",params:[N]}),c}catch(w){throw new bo(w)}throw new ip(v)}},onAccountsChanged(o){o.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:o.map(l=>Ac(l))})},onChainChanged(o){const l=Number(o);a.emitter.emit("change",{chainId:l})},async onDisconnect(o){a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),r&&(l.removeListener("chainChanged",r),r=void 0),s&&(l.removeListener("disconnect",s),s=void 0)}})}function cFt(e){let n,r,s,a,o;return l=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:N$.type,async connect({chainId:c}={}){try{const u=await this.getProvider(),d=(await u.request({method:"eth_requestAccounts"})).map(x=>Ac(x));s||(s=this.onAccountsChanged.bind(this),u.on("accountsChanged",s)),a||(a=this.onChainChanged.bind(this),u.on("chainChanged",a)),o||(o=this.onDisconnect.bind(this),u.on("disconnect",o));let f=await this.getChainId();if(c&&f!==c){const x=await this.switchChain({chainId:c}).catch(g=>{if(g.code===bo.code)throw g;return{id:f}});f=(x==null?void 0:x.id)??f}return{accounts:d,chainId:f}}catch(u){throw/(user closed modal|accounts received is empty|user denied account)/i.test(u.message)?new bo(u):u}},async disconnect(){const c=await this.getProvider();s&&(c.removeListener("accountsChanged",s),s=void 0),a&&(c.removeListener("chainChanged",a),a=void 0),o&&(c.removeListener("disconnect",o),o=void 0),c.disconnect(),c.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(u=>Ac(u))},async getChainId(){const u=await(await this.getProvider()).request({method:"eth_chainId"});return Number(u)},async getProvider(){var c;if(!r){const u=await(async()=>{const{default:v}=await ss(async()=>{const{default:w}=await import("./index-shx8OlmN.js").then(C=>C.i);return{default:w}},__vite__mapDeps([4,3,5]));return typeof v!="function"&&typeof v.default=="function"?v.default:v})();n=new u({...e,reloadOnDisconnect:!1});const d=(c=n.walletExtension)==null?void 0:c.getChainId(),f=l.chains.find(v=>e.chainId?v.id===e.chainId:v.id===d)||l.chains[0],x=e.chainId||(f==null?void 0:f.id),g=e.jsonRpcUrl||(f==null?void 0:f.rpcUrls.default.http[0]);r=n.makeWeb3Provider(g,x)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:u}){var x,g,v,w;const d=l.chains.find(C=>C.id===u);if(!d)throw new ip(new C3);const f=await this.getProvider();try{return await f.request({method:"wallet_switchEthereumChain",params:[{chainId:Ds(d.id)}]}),d}catch(C){if(C.code===4902)try{let N;c!=null&&c.blockExplorerUrls?N=c.blockExplorerUrls:N=(x=d.blockExplorers)!=null&&x.default.url?[(g=d.blockExplorers)==null?void 0:g.default.url]:[];let I;(v=c==null?void 0:c.rpcUrls)!=null&&v.length?I=c.rpcUrls:I=[((w=d.rpcUrls.default)==null?void 0:w.http[0])??""];const P={blockExplorerUrls:N,chainId:Ds(u),chainName:(c==null?void 0:c.chainName)??d.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??d.nativeCurrency,rpcUrls:I};return await f.request({method:"wallet_addEthereumChain",params:[P]}),d}catch(N){throw new bo(N)}throw new ip(C)}},onAccountsChanged(c){c.length===0?this.onDisconnect():l.emitter.emit("change",{accounts:c.map(u=>Ac(u))})},onChainChanged(c){const u=Number(c);l.emitter.emit("change",{chainId:u})},async onDisconnect(c){l.emitter.emit("disconnect");const u=await this.getProvider();s&&(u.removeListener("accountsChanged",s),s=void 0),a&&(u.removeListener("chainChanged",a),a=void 0),o&&(u.removeListener("disconnect",o),o=void 0)}})}ele.type="safe";function ele(e={}){const{shimDisconnect:t=!1}=e;let n,r;return s=>({id:"safe",name:"Safe",type:ele.type,async connect(){var c;const a=await this.getProvider();if(!a)throw new Wh;const o=await this.getAccounts(),l=await this.getChainId();return r||(r=this.onDisconnect.bind(this),a.on("disconnect",r)),t&&await((c=s.storage)==null?void 0:c.removeItem("safe.disconnected")),{accounts:o,chainId:l}},async disconnect(){var o;const a=await this.getProvider();if(!a)throw new Wh;r&&(a.removeListener("disconnect",r),r=void 0),t&&await((o=s.storage)==null?void 0:o.setItem("safe.disconnected",!0))},async getAccounts(){const a=await this.getProvider();if(!a)throw new Wh;return(await a.request({method:"eth_accounts"})).map(Ac)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!n){const{default:o}=await ss(async()=>{const{default:d}=await import("./index-B8lqC164.js");return{default:d}},__vite__mapDeps([6,7,2])),l=new o(e),c=await Tie(()=>l.safe.getInfo(),{timeout:e.unstable_getInfoTimeout??10});if(!c)throw new Error("Could not load Safe information");const u=await(async()=>{const d=await ss(()=>import("./index-g5wIgCDo.js").then(f=>f.i),__vite__mapDeps([8,7,1,5]));return typeof d.SafeAppProvider!="function"&&typeof d.default.SafeAppProvider=="function"?d.default.SafeAppProvider:d.SafeAppProvider})();n=new u(c,l)}return n}},async getChainId(){const a=await this.getProvider();if(!a)throw new Wh;return Number(a.chainId)},async isAuthorized(){var a;try{return t&&await((a=s.storage)==null?void 0:a.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){s.emitter.emit("disconnect")}})}tle.type="walletConnect";function tle(e){const t=e.isNewChainsStale??!0;let n,r;const s="eip155";let a,o,l,c,u,d;return f=>({id:"walletConnect",name:"WalletConnect",type:tle.type,async setup(){const x=await this.getProvider().catch(()=>null);x&&(l||(l=this.onConnect.bind(this),x.on("connect",l)),u||(u=this.onSessionDelete.bind(this),x.on("session_delete",u)))},async connect({chainId:x,...g}={}){var v,w;try{const C=await this.getProvider();if(!C)throw new Wh;c||(c=this.onDisplayUri,C.on("display_uri",c));let N=x;if(!N){const F=await((v=f.storage)==null?void 0:v.getItem("state"))??{};f.chains.some(L=>L.id===F.chainId)?N=F.chainId:N=(w=f.chains[0])==null?void 0:w.id}if(!N)throw new Error("No chains found on connector.");const I=await this.isChainsStale();if(C.session&&I&&await C.disconnect(),!C.session||I){const F=f.chains.filter(U=>U.id!==N).map(U=>U.id);await C.connect({optionalChains:[N,...F],..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(f.chains.map(U=>U.id))}const P=(await C.enable()).map(F=>Ac(F)),R=await this.getChainId();return c&&(C.removeListener("display_uri",c),c=void 0),l&&(C.removeListener("connect",l),l=void 0),a||(a=this.onAccountsChanged.bind(this),C.on("accountsChanged",a)),o||(o=this.onChainChanged.bind(this),C.on("chainChanged",o)),d||(d=this.onDisconnect.bind(this),C.on("disconnect",d)),u||(u=this.onSessionDelete.bind(this),C.on("session_delete",u)),{accounts:P,chainId:R}}catch(C){throw/(user rejected|connection request reset)/i.test(C==null?void 0:C.message)?new bo(C):C}},async disconnect(){const x=await this.getProvider();try{await(x==null?void 0:x.disconnect())}catch(g){if(!/No matching key/i.test(g.message))throw g}finally{o&&(x==null||x.removeListener("chainChanged",o),o=void 0),d&&(x==null||x.removeListener("disconnect",d),d=void 0),l||(l=this.onConnect.bind(this),x==null||x.on("connect",l)),a&&(x==null||x.removeListener("accountsChanged",a),a=void 0),u&&(x==null||x.removeListener("session_delete",u),u=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(g=>Ac(g))},async getProvider({chainId:x}={}){var v;async function g(){const w=f.chains.map(N=>N.id);if(!w.length)return;const{EthereumProvider:C}=await ss(async()=>{const{EthereumProvider:N}=await import("./index.es-DC4scVf0.js");return{EthereumProvider:N}},__vite__mapDeps([9,5]));return await C.init({...e,disableProviderPing:!0,optionalChains:w,projectId:e.projectId,rpcMap:Object.fromEntries(f.chains.map(N=>{const[I]=W0t({chain:N,transports:f.transports});return[N.id,I]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=g()),n=await r,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY)),x&&await((v=this.switchChain)==null?void 0:v.call(this,{chainId:x})),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[x,g]=await Promise.all([this.getAccounts(),this.getProvider()]);return x.length?await this.isChainsStale()&&g.session?(await g.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:x,chainId:g}){var C,N,I;const v=await this.getProvider();if(!v)throw new Wh;const w=f.chains.find(P=>P.id===g);if(!w)throw new ip(new C3);try{await Promise.all([new Promise(R=>{const F=({chainId:U})=>{U===g&&(f.emitter.off("change",F),R())};f.emitter.on("change",F)}),v.request({method:"wallet_switchEthereumChain",params:[{chainId:Ds(g)}]})]);const P=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...P,g]),w}catch(P){const R=P;if(/(user rejected)/i.test(R.message))throw new bo(R);try{let F;x!=null&&x.blockExplorerUrls?F=x.blockExplorerUrls:F=(C=w.blockExplorers)!=null&&C.default.url?[(N=w.blockExplorers)==null?void 0:N.default.url]:[];let U;(I=x==null?void 0:x.rpcUrls)!=null&&I.length?U=x.rpcUrls:U=[...w.rpcUrls.default.http];const L={blockExplorerUrls:F,chainId:Ds(g),chainName:(x==null?void 0:x.chainName)??w.name,iconUrls:x==null?void 0:x.iconUrls,nativeCurrency:(x==null?void 0:x.nativeCurrency)??w.nativeCurrency,rpcUrls:U};await v.request({method:"wallet_addEthereumChain",params:[L]});const z=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...z,g]),w}catch(F){throw new bo(F)}}},onAccountsChanged(x){x.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:x.map(g=>Ac(g))})},onChainChanged(x){const g=Number(x);f.emitter.emit("change",{chainId:g})},async onConnect(x){const g=Number(x.chainId),v=await this.getAccounts();f.emitter.emit("connect",{accounts:v,chainId:g})},async onDisconnect(x){this.setRequestedChainsIds([]),f.emitter.emit("disconnect");const g=await this.getProvider();a&&(g.removeListener("accountsChanged",a),a=void 0),o&&(g.removeListener("chainChanged",o),o=void 0),d&&(g.removeListener("disconnect",d),d=void 0),u&&(g.removeListener("session_delete",u),u=void 0),l||(l=this.onConnect.bind(this),g.on("connect",l))},onDisplayUri(x){f.emitter.emit("message",{type:"display_uri",data:x})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,v,w;return n?((w=(v=(g=n.session)==null?void 0:g.namespaces[s])==null?void 0:v.accounts)==null?void 0:w.map(C=>Number.parseInt(C.split(":")[1]||"")))??[]:[]},async getRequestedChainsIds(){var x;return await((x=f.storage)==null?void 0:x.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!t)return!1;const x=f.chains.map(w=>w.id),g=this.getNamespaceChainsIds();if(g.length&&!g.some(w=>x.includes(w)))return!1;const v=await this.getRequestedChainsIds();return!x.every(w=>v.includes(w))},async setRequestedChainsIds(x){var g;await((g=f.storage)==null?void 0:g.setItem(this.requestedChainsStorageKey,x))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var OR={},uFt=768;tIt({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}});var dFt=uMe({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),Zee=oIt({conditions:{defaultCondition:"base",conditionNames:["base","hover","active"],responsiveArray:void 0},styles:{background:{values:{accentColor:{conditions:{base:"ju367v9i",hover:"ju367v9j",active:"ju367v9k"},defaultClass:"ju367v9i"},accentColorForeground:{conditions:{base:"ju367v9l",hover:"ju367v9m",active:"ju367v9n"},defaultClass:"ju367v9l"},actionButtonBorder:{conditions:{base:"ju367v9o",hover:"ju367v9p",active:"ju367v9q"},defaultClass:"ju367v9o"},actionButtonBorderMobile:{conditions:{base:"ju367v9r",hover:"ju367v9s",active:"ju367v9t"},defaultClass:"ju367v9r"},actionButtonSecondaryBackground:{conditions:{base:"ju367v9u",hover:"ju367v9v",active:"ju367v9w"},defaultClass:"ju367v9u"},closeButton:{conditions:{base:"ju367v9x",hover:"ju367v9y",active:"ju367v9z"},defaultClass:"ju367v9x"},closeButtonBackground:{conditions:{base:"ju367va0",hover:"ju367va1",active:"ju367va2"},defaultClass:"ju367va0"},connectButtonBackground:{conditions:{base:"ju367va3",hover:"ju367va4",active:"ju367va5"},defaultClass:"ju367va3"},connectButtonBackgroundError:{conditions:{base:"ju367va6",hover:"ju367va7",active:"ju367va8"},defaultClass:"ju367va6"},connectButtonInnerBackground:{conditions:{base:"ju367va9",hover:"ju367vaa",active:"ju367vab"},defaultClass:"ju367va9"},connectButtonText:{conditions:{base:"ju367vac",hover:"ju367vad",active:"ju367vae"},defaultClass:"ju367vac"},connectButtonTextError:{conditions:{base:"ju367vaf",hover:"ju367vag",active:"ju367vah"},defaultClass:"ju367vaf"},connectionIndicator:{conditions:{base:"ju367vai",hover:"ju367vaj",active:"ju367vak"},defaultClass:"ju367vai"},downloadBottomCardBackground:{conditions:{base:"ju367val",hover:"ju367vam",active:"ju367van"},defaultClass:"ju367val"},downloadTopCardBackground:{conditions:{base:"ju367vao",hover:"ju367vap",active:"ju367vaq"},defaultClass:"ju367vao"},error:{conditions:{base:"ju367var",hover:"ju367vas",active:"ju367vat"},defaultClass:"ju367var"},generalBorder:{conditions:{base:"ju367vau",hover:"ju367vav",active:"ju367vaw"},defaultClass:"ju367vau"},generalBorderDim:{conditions:{base:"ju367vax",hover:"ju367vay",active:"ju367vaz"},defaultClass:"ju367vax"},menuItemBackground:{conditions:{base:"ju367vb0",hover:"ju367vb1",active:"ju367vb2"},defaultClass:"ju367vb0"},modalBackdrop:{conditions:{base:"ju367vb3",hover:"ju367vb4",active:"ju367vb5"},defaultClass:"ju367vb3"},modalBackground:{conditions:{base:"ju367vb6",hover:"ju367vb7",active:"ju367vb8"},defaultClass:"ju367vb6"},modalBorder:{conditions:{base:"ju367vb9",hover:"ju367vba",active:"ju367vbb"},defaultClass:"ju367vb9"},modalText:{conditions:{base:"ju367vbc",hover:"ju367vbd",active:"ju367vbe"},defaultClass:"ju367vbc"},modalTextDim:{conditions:{base:"ju367vbf",hover:"ju367vbg",active:"ju367vbh"},defaultClass:"ju367vbf"},modalTextSecondary:{conditions:{base:"ju367vbi",hover:"ju367vbj",active:"ju367vbk"},defaultClass:"ju367vbi"},profileAction:{conditions:{base:"ju367vbl",hover:"ju367vbm",active:"ju367vbn"},defaultClass:"ju367vbl"},profileActionHover:{conditions:{base:"ju367vbo",hover:"ju367vbp",active:"ju367vbq"},defaultClass:"ju367vbo"},profileForeground:{conditions:{base:"ju367vbr",hover:"ju367vbs",active:"ju367vbt"},defaultClass:"ju367vbr"},selectedOptionBorder:{conditions:{base:"ju367vbu",hover:"ju367vbv",active:"ju367vbw"},defaultClass:"ju367vbu"},standby:{conditions:{base:"ju367vbx",hover:"ju367vby",active:"ju367vbz"},defaultClass:"ju367vbx"}}},borderColor:{values:{accentColor:{conditions:{base:"ju367vc0",hover:"ju367vc1",active:"ju367vc2"},defaultClass:"ju367vc0"},accentColorForeground:{conditions:{base:"ju367vc3",hover:"ju367vc4",active:"ju367vc5"},defaultClass:"ju367vc3"},actionButtonBorder:{conditions:{base:"ju367vc6",hover:"ju367vc7",active:"ju367vc8"},defaultClass:"ju367vc6"},actionButtonBorderMobile:{conditions:{base:"ju367vc9",hover:"ju367vca",active:"ju367vcb"},defaultClass:"ju367vc9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vcc",hover:"ju367vcd",active:"ju367vce"},defaultClass:"ju367vcc"},closeButton:{conditions:{base:"ju367vcf",hover:"ju367vcg",active:"ju367vch"},defaultClass:"ju367vcf"},closeButtonBackground:{conditions:{base:"ju367vci",hover:"ju367vcj",active:"ju367vck"},defaultClass:"ju367vci"},connectButtonBackground:{conditions:{base:"ju367vcl",hover:"ju367vcm",active:"ju367vcn"},defaultClass:"ju367vcl"},connectButtonBackgroundError:{conditions:{base:"ju367vco",hover:"ju367vcp",active:"ju367vcq"},defaultClass:"ju367vco"},connectButtonInnerBackground:{conditions:{base:"ju367vcr",hover:"ju367vcs",active:"ju367vct"},defaultClass:"ju367vcr"},connectButtonText:{conditions:{base:"ju367vcu",hover:"ju367vcv",active:"ju367vcw"},defaultClass:"ju367vcu"},connectButtonTextError:{conditions:{base:"ju367vcx",hover:"ju367vcy",active:"ju367vcz"},defaultClass:"ju367vcx"},connectionIndicator:{conditions:{base:"ju367vd0",hover:"ju367vd1",active:"ju367vd2"},defaultClass:"ju367vd0"},downloadBottomCardBackground:{conditions:{base:"ju367vd3",hover:"ju367vd4",active:"ju367vd5"},defaultClass:"ju367vd3"},downloadTopCardBackground:{conditions:{base:"ju367vd6",hover:"ju367vd7",active:"ju367vd8"},defaultClass:"ju367vd6"},error:{conditions:{base:"ju367vd9",hover:"ju367vda",active:"ju367vdb"},defaultClass:"ju367vd9"},generalBorder:{conditions:{base:"ju367vdc",hover:"ju367vdd",active:"ju367vde"},defaultClass:"ju367vdc"},generalBorderDim:{conditions:{base:"ju367vdf",hover:"ju367vdg",active:"ju367vdh"},defaultClass:"ju367vdf"},menuItemBackground:{conditions:{base:"ju367vdi",hover:"ju367vdj",active:"ju367vdk"},defaultClass:"ju367vdi"},modalBackdrop:{conditions:{base:"ju367vdl",hover:"ju367vdm",active:"ju367vdn"},defaultClass:"ju367vdl"},modalBackground:{conditions:{base:"ju367vdo",hover:"ju367vdp",active:"ju367vdq"},defaultClass:"ju367vdo"},modalBorder:{conditions:{base:"ju367vdr",hover:"ju367vds",active:"ju367vdt"},defaultClass:"ju367vdr"},modalText:{conditions:{base:"ju367vdu",hover:"ju367vdv",active:"ju367vdw"},defaultClass:"ju367vdu"},modalTextDim:{conditions:{base:"ju367vdx",hover:"ju367vdy",active:"ju367vdz"},defaultClass:"ju367vdx"},modalTextSecondary:{conditions:{base:"ju367ve0",hover:"ju367ve1",active:"ju367ve2"},defaultClass:"ju367ve0"},profileAction:{conditions:{base:"ju367ve3",hover:"ju367ve4",active:"ju367ve5"},defaultClass:"ju367ve3"},profileActionHover:{conditions:{base:"ju367ve6",hover:"ju367ve7",active:"ju367ve8"},defaultClass:"ju367ve6"},profileForeground:{conditions:{base:"ju367ve9",hover:"ju367vea",active:"ju367veb"},defaultClass:"ju367ve9"},selectedOptionBorder:{conditions:{base:"ju367vec",hover:"ju367ved",active:"ju367vee"},defaultClass:"ju367vec"},standby:{conditions:{base:"ju367vef",hover:"ju367veg",active:"ju367veh"},defaultClass:"ju367vef"}}},boxShadow:{values:{connectButton:{conditions:{base:"ju367vei",hover:"ju367vej",active:"ju367vek"},defaultClass:"ju367vei"},dialog:{conditions:{base:"ju367vel",hover:"ju367vem",active:"ju367ven"},defaultClass:"ju367vel"},profileDetailsAction:{conditions:{base:"ju367veo",hover:"ju367vep",active:"ju367veq"},defaultClass:"ju367veo"},selectedOption:{conditions:{base:"ju367ver",hover:"ju367ves",active:"ju367vet"},defaultClass:"ju367ver"},selectedWallet:{conditions:{base:"ju367veu",hover:"ju367vev",active:"ju367vew"},defaultClass:"ju367veu"},walletLogo:{conditions:{base:"ju367vex",hover:"ju367vey",active:"ju367vez"},defaultClass:"ju367vex"}}},color:{values:{accentColor:{conditions:{base:"ju367vf0",hover:"ju367vf1",active:"ju367vf2"},defaultClass:"ju367vf0"},accentColorForeground:{conditions:{base:"ju367vf3",hover:"ju367vf4",active:"ju367vf5"},defaultClass:"ju367vf3"},actionButtonBorder:{conditions:{base:"ju367vf6",hover:"ju367vf7",active:"ju367vf8"},defaultClass:"ju367vf6"},actionButtonBorderMobile:{conditions:{base:"ju367vf9",hover:"ju367vfa",active:"ju367vfb"},defaultClass:"ju367vf9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vfc",hover:"ju367vfd",active:"ju367vfe"},defaultClass:"ju367vfc"},closeButton:{conditions:{base:"ju367vff",hover:"ju367vfg",active:"ju367vfh"},defaultClass:"ju367vff"},closeButtonBackground:{conditions:{base:"ju367vfi",hover:"ju367vfj",active:"ju367vfk"},defaultClass:"ju367vfi"},connectButtonBackground:{conditions:{base:"ju367vfl",hover:"ju367vfm",active:"ju367vfn"},defaultClass:"ju367vfl"},connectButtonBackgroundError:{conditions:{base:"ju367vfo",hover:"ju367vfp",active:"ju367vfq"},defaultClass:"ju367vfo"},connectButtonInnerBackground:{conditions:{base:"ju367vfr",hover:"ju367vfs",active:"ju367vft"},defaultClass:"ju367vfr"},connectButtonText:{conditions:{base:"ju367vfu",hover:"ju367vfv",active:"ju367vfw"},defaultClass:"ju367vfu"},connectButtonTextError:{conditions:{base:"ju367vfx",hover:"ju367vfy",active:"ju367vfz"},defaultClass:"ju367vfx"},connectionIndicator:{conditions:{base:"ju367vg0",hover:"ju367vg1",active:"ju367vg2"},defaultClass:"ju367vg0"},downloadBottomCardBackground:{conditions:{base:"ju367vg3",hover:"ju367vg4",active:"ju367vg5"},defaultClass:"ju367vg3"},downloadTopCardBackground:{conditions:{base:"ju367vg6",hover:"ju367vg7",active:"ju367vg8"},defaultClass:"ju367vg6"},error:{conditions:{base:"ju367vg9",hover:"ju367vga",active:"ju367vgb"},defaultClass:"ju367vg9"},generalBorder:{conditions:{base:"ju367vgc",hover:"ju367vgd",active:"ju367vge"},defaultClass:"ju367vgc"},generalBorderDim:{conditions:{base:"ju367vgf",hover:"ju367vgg",active:"ju367vgh"},defaultClass:"ju367vgf"},menuItemBackground:{conditions:{base:"ju367vgi",hover:"ju367vgj",active:"ju367vgk"},defaultClass:"ju367vgi"},modalBackdrop:{conditions:{base:"ju367vgl",hover:"ju367vgm",active:"ju367vgn"},defaultClass:"ju367vgl"},modalBackground:{conditions:{base:"ju367vgo",hover:"ju367vgp",active:"ju367vgq"},defaultClass:"ju367vgo"},modalBorder:{conditions:{base:"ju367vgr",hover:"ju367vgs",active:"ju367vgt"},defaultClass:"ju367vgr"},modalText:{conditions:{base:"ju367vgu",hover:"ju367vgv",active:"ju367vgw"},defaultClass:"ju367vgu"},modalTextDim:{conditions:{base:"ju367vgx",hover:"ju367vgy",active:"ju367vgz"},defaultClass:"ju367vgx"},modalTextSecondary:{conditions:{base:"ju367vh0",hover:"ju367vh1",active:"ju367vh2"},defaultClass:"ju367vh0"},profileAction:{conditions:{base:"ju367vh3",hover:"ju367vh4",active:"ju367vh5"},defaultClass:"ju367vh3"},profileActionHover:{conditions:{base:"ju367vh6",hover:"ju367vh7",active:"ju367vh8"},defaultClass:"ju367vh6"},profileForeground:{conditions:{base:"ju367vh9",hover:"ju367vha",active:"ju367vhb"},defaultClass:"ju367vh9"},selectedOptionBorder:{conditions:{base:"ju367vhc",hover:"ju367vhd",active:"ju367vhe"},defaultClass:"ju367vhc"},standby:{conditions:{base:"ju367vhf",hover:"ju367vhg",active:"ju367vhh"},defaultClass:"ju367vhf"}}}}},{conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0},styles:{alignItems:{values:{"flex-start":{conditions:{smallScreen:"ju367v0",largeScreen:"ju367v1"},defaultClass:"ju367v0"},"flex-end":{conditions:{smallScreen:"ju367v2",largeScreen:"ju367v3"},defaultClass:"ju367v2"},center:{conditions:{smallScreen:"ju367v4",largeScreen:"ju367v5"},defaultClass:"ju367v4"}}},display:{values:{none:{conditions:{smallScreen:"ju367v6",largeScreen:"ju367v7"},defaultClass:"ju367v6"},block:{conditions:{smallScreen:"ju367v8",largeScreen:"ju367v9"},defaultClass:"ju367v8"},flex:{conditions:{smallScreen:"ju367va",largeScreen:"ju367vb"},defaultClass:"ju367va"},inline:{conditions:{smallScreen:"ju367vc",largeScreen:"ju367vd"},defaultClass:"ju367vc"}}}}},{conditions:void 0,styles:{margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},alignSelf:{values:{"flex-start":{defaultClass:"ju367ve"},"flex-end":{defaultClass:"ju367vf"},center:{defaultClass:"ju367vg"}}},backgroundSize:{values:{cover:{defaultClass:"ju367vh"}}},borderRadius:{values:{1:{defaultClass:"ju367vi"},6:{defaultClass:"ju367vj"},10:{defaultClass:"ju367vk"},13:{defaultClass:"ju367vl"},actionButton:{defaultClass:"ju367vm"},connectButton:{defaultClass:"ju367vn"},menuButton:{defaultClass:"ju367vo"},modal:{defaultClass:"ju367vp"},modalMobile:{defaultClass:"ju367vq"},"25%":{defaultClass:"ju367vr"},full:{defaultClass:"ju367vs"}}},borderStyle:{values:{solid:{defaultClass:"ju367vt"}}},borderWidth:{values:{0:{defaultClass:"ju367vu"},1:{defaultClass:"ju367vv"},2:{defaultClass:"ju367vw"},4:{defaultClass:"ju367vx"}}},cursor:{values:{pointer:{defaultClass:"ju367vy"},none:{defaultClass:"ju367vz"}}},pointerEvents:{values:{none:{defaultClass:"ju367v10"},all:{defaultClass:"ju367v11"}}},minHeight:{values:{8:{defaultClass:"ju367v12"},44:{defaultClass:"ju367v13"}}},flexDirection:{values:{row:{defaultClass:"ju367v14"},column:{defaultClass:"ju367v15"}}},fontFamily:{values:{body:{defaultClass:"ju367v16"}}},fontSize:{values:{12:{defaultClass:"ju367v17"},13:{defaultClass:"ju367v18"},14:{defaultClass:"ju367v19"},16:{defaultClass:"ju367v1a"},18:{defaultClass:"ju367v1b"},20:{defaultClass:"ju367v1c"},23:{defaultClass:"ju367v1d"}}},fontWeight:{values:{regular:{defaultClass:"ju367v1e"},medium:{defaultClass:"ju367v1f"},semibold:{defaultClass:"ju367v1g"},bold:{defaultClass:"ju367v1h"},heavy:{defaultClass:"ju367v1i"}}},gap:{values:{0:{defaultClass:"ju367v1j"},1:{defaultClass:"ju367v1k"},2:{defaultClass:"ju367v1l"},3:{defaultClass:"ju367v1m"},4:{defaultClass:"ju367v1n"},5:{defaultClass:"ju367v1o"},6:{defaultClass:"ju367v1p"},8:{defaultClass:"ju367v1q"},10:{defaultClass:"ju367v1r"},12:{defaultClass:"ju367v1s"},14:{defaultClass:"ju367v1t"},16:{defaultClass:"ju367v1u"},18:{defaultClass:"ju367v1v"},20:{defaultClass:"ju367v1w"},24:{defaultClass:"ju367v1x"},28:{defaultClass:"ju367v1y"},32:{defaultClass:"ju367v1z"},36:{defaultClass:"ju367v20"},44:{defaultClass:"ju367v21"},64:{defaultClass:"ju367v22"},"-1":{defaultClass:"ju367v23"}}},height:{values:{1:{defaultClass:"ju367v24"},2:{defaultClass:"ju367v25"},4:{defaultClass:"ju367v26"},8:{defaultClass:"ju367v27"},12:{defaultClass:"ju367v28"},20:{defaultClass:"ju367v29"},24:{defaultClass:"ju367v2a"},28:{defaultClass:"ju367v2b"},30:{defaultClass:"ju367v2c"},32:{defaultClass:"ju367v2d"},34:{defaultClass:"ju367v2e"},36:{defaultClass:"ju367v2f"},40:{defaultClass:"ju367v2g"},44:{defaultClass:"ju367v2h"},48:{defaultClass:"ju367v2i"},54:{defaultClass:"ju367v2j"},60:{defaultClass:"ju367v2k"},200:{defaultClass:"ju367v2l"},full:{defaultClass:"ju367v2m"},max:{defaultClass:"ju367v2n"}}},justifyContent:{values:{"flex-start":{defaultClass:"ju367v2o"},"flex-end":{defaultClass:"ju367v2p"},center:{defaultClass:"ju367v2q"},"space-between":{defaultClass:"ju367v2r"},"space-around":{defaultClass:"ju367v2s"}}},textAlign:{values:{left:{defaultClass:"ju367v2t"},center:{defaultClass:"ju367v2u"},inherit:{defaultClass:"ju367v2v"}}},marginBottom:{values:{0:{defaultClass:"ju367v2w"},1:{defaultClass:"ju367v2x"},2:{defaultClass:"ju367v2y"},3:{defaultClass:"ju367v2z"},4:{defaultClass:"ju367v30"},5:{defaultClass:"ju367v31"},6:{defaultClass:"ju367v32"},8:{defaultClass:"ju367v33"},10:{defaultClass:"ju367v34"},12:{defaultClass:"ju367v35"},14:{defaultClass:"ju367v36"},16:{defaultClass:"ju367v37"},18:{defaultClass:"ju367v38"},20:{defaultClass:"ju367v39"},24:{defaultClass:"ju367v3a"},28:{defaultClass:"ju367v3b"},32:{defaultClass:"ju367v3c"},36:{defaultClass:"ju367v3d"},44:{defaultClass:"ju367v3e"},64:{defaultClass:"ju367v3f"},"-1":{defaultClass:"ju367v3g"}}},marginLeft:{values:{0:{defaultClass:"ju367v3h"},1:{defaultClass:"ju367v3i"},2:{defaultClass:"ju367v3j"},3:{defaultClass:"ju367v3k"},4:{defaultClass:"ju367v3l"},5:{defaultClass:"ju367v3m"},6:{defaultClass:"ju367v3n"},8:{defaultClass:"ju367v3o"},10:{defaultClass:"ju367v3p"},12:{defaultClass:"ju367v3q"},14:{defaultClass:"ju367v3r"},16:{defaultClass:"ju367v3s"},18:{defaultClass:"ju367v3t"},20:{defaultClass:"ju367v3u"},24:{defaultClass:"ju367v3v"},28:{defaultClass:"ju367v3w"},32:{defaultClass:"ju367v3x"},36:{defaultClass:"ju367v3y"},44:{defaultClass:"ju367v3z"},64:{defaultClass:"ju367v40"},"-1":{defaultClass:"ju367v41"}}},marginRight:{values:{0:{defaultClass:"ju367v42"},1:{defaultClass:"ju367v43"},2:{defaultClass:"ju367v44"},3:{defaultClass:"ju367v45"},4:{defaultClass:"ju367v46"},5:{defaultClass:"ju367v47"},6:{defaultClass:"ju367v48"},8:{defaultClass:"ju367v49"},10:{defaultClass:"ju367v4a"},12:{defaultClass:"ju367v4b"},14:{defaultClass:"ju367v4c"},16:{defaultClass:"ju367v4d"},18:{defaultClass:"ju367v4e"},20:{defaultClass:"ju367v4f"},24:{defaultClass:"ju367v4g"},28:{defaultClass:"ju367v4h"},32:{defaultClass:"ju367v4i"},36:{defaultClass:"ju367v4j"},44:{defaultClass:"ju367v4k"},64:{defaultClass:"ju367v4l"},"-1":{defaultClass:"ju367v4m"}}},marginTop:{values:{0:{defaultClass:"ju367v4n"},1:{defaultClass:"ju367v4o"},2:{defaultClass:"ju367v4p"},3:{defaultClass:"ju367v4q"},4:{defaultClass:"ju367v4r"},5:{defaultClass:"ju367v4s"},6:{defaultClass:"ju367v4t"},8:{defaultClass:"ju367v4u"},10:{defaultClass:"ju367v4v"},12:{defaultClass:"ju367v4w"},14:{defaultClass:"ju367v4x"},16:{defaultClass:"ju367v4y"},18:{defaultClass:"ju367v4z"},20:{defaultClass:"ju367v50"},24:{defaultClass:"ju367v51"},28:{defaultClass:"ju367v52"},32:{defaultClass:"ju367v53"},36:{defaultClass:"ju367v54"},44:{defaultClass:"ju367v55"},64:{defaultClass:"ju367v56"},"-1":{defaultClass:"ju367v57"}}},maxWidth:{values:{1:{defaultClass:"ju367v58"},2:{defaultClass:"ju367v59"},4:{defaultClass:"ju367v5a"},8:{defaultClass:"ju367v5b"},12:{defaultClass:"ju367v5c"},20:{defaultClass:"ju367v5d"},24:{defaultClass:"ju367v5e"},28:{defaultClass:"ju367v5f"},30:{defaultClass:"ju367v5g"},32:{defaultClass:"ju367v5h"},34:{defaultClass:"ju367v5i"},36:{defaultClass:"ju367v5j"},40:{defaultClass:"ju367v5k"},44:{defaultClass:"ju367v5l"},48:{defaultClass:"ju367v5m"},54:{defaultClass:"ju367v5n"},60:{defaultClass:"ju367v5o"},200:{defaultClass:"ju367v5p"},full:{defaultClass:"ju367v5q"},max:{defaultClass:"ju367v5r"}}},minWidth:{values:{1:{defaultClass:"ju367v5s"},2:{defaultClass:"ju367v5t"},4:{defaultClass:"ju367v5u"},8:{defaultClass:"ju367v5v"},12:{defaultClass:"ju367v5w"},20:{defaultClass:"ju367v5x"},24:{defaultClass:"ju367v5y"},28:{defaultClass:"ju367v5z"},30:{defaultClass:"ju367v60"},32:{defaultClass:"ju367v61"},34:{defaultClass:"ju367v62"},36:{defaultClass:"ju367v63"},40:{defaultClass:"ju367v64"},44:{defaultClass:"ju367v65"},48:{defaultClass:"ju367v66"},54:{defaultClass:"ju367v67"},60:{defaultClass:"ju367v68"},200:{defaultClass:"ju367v69"},full:{defaultClass:"ju367v6a"},max:{defaultClass:"ju367v6b"}}},overflow:{values:{hidden:{defaultClass:"ju367v6c"}}},paddingBottom:{values:{0:{defaultClass:"ju367v6d"},1:{defaultClass:"ju367v6e"},2:{defaultClass:"ju367v6f"},3:{defaultClass:"ju367v6g"},4:{defaultClass:"ju367v6h"},5:{defaultClass:"ju367v6i"},6:{defaultClass:"ju367v6j"},8:{defaultClass:"ju367v6k"},10:{defaultClass:"ju367v6l"},12:{defaultClass:"ju367v6m"},14:{defaultClass:"ju367v6n"},16:{defaultClass:"ju367v6o"},18:{defaultClass:"ju367v6p"},20:{defaultClass:"ju367v6q"},24:{defaultClass:"ju367v6r"},28:{defaultClass:"ju367v6s"},32:{defaultClass:"ju367v6t"},36:{defaultClass:"ju367v6u"},44:{defaultClass:"ju367v6v"},64:{defaultClass:"ju367v6w"},"-1":{defaultClass:"ju367v6x"}}},paddingLeft:{values:{0:{defaultClass:"ju367v6y"},1:{defaultClass:"ju367v6z"},2:{defaultClass:"ju367v70"},3:{defaultClass:"ju367v71"},4:{defaultClass:"ju367v72"},5:{defaultClass:"ju367v73"},6:{defaultClass:"ju367v74"},8:{defaultClass:"ju367v75"},10:{defaultClass:"ju367v76"},12:{defaultClass:"ju367v77"},14:{defaultClass:"ju367v78"},16:{defaultClass:"ju367v79"},18:{defaultClass:"ju367v7a"},20:{defaultClass:"ju367v7b"},24:{defaultClass:"ju367v7c"},28:{defaultClass:"ju367v7d"},32:{defaultClass:"ju367v7e"},36:{defaultClass:"ju367v7f"},44:{defaultClass:"ju367v7g"},64:{defaultClass:"ju367v7h"},"-1":{defaultClass:"ju367v7i"}}},paddingRight:{values:{0:{defaultClass:"ju367v7j"},1:{defaultClass:"ju367v7k"},2:{defaultClass:"ju367v7l"},3:{defaultClass:"ju367v7m"},4:{defaultClass:"ju367v7n"},5:{defaultClass:"ju367v7o"},6:{defaultClass:"ju367v7p"},8:{defaultClass:"ju367v7q"},10:{defaultClass:"ju367v7r"},12:{defaultClass:"ju367v7s"},14:{defaultClass:"ju367v7t"},16:{defaultClass:"ju367v7u"},18:{defaultClass:"ju367v7v"},20:{defaultClass:"ju367v7w"},24:{defaultClass:"ju367v7x"},28:{defaultClass:"ju367v7y"},32:{defaultClass:"ju367v7z"},36:{defaultClass:"ju367v80"},44:{defaultClass:"ju367v81"},64:{defaultClass:"ju367v82"},"-1":{defaultClass:"ju367v83"}}},paddingTop:{values:{0:{defaultClass:"ju367v84"},1:{defaultClass:"ju367v85"},2:{defaultClass:"ju367v86"},3:{defaultClass:"ju367v87"},4:{defaultClass:"ju367v88"},5:{defaultClass:"ju367v89"},6:{defaultClass:"ju367v8a"},8:{defaultClass:"ju367v8b"},10:{defaultClass:"ju367v8c"},12:{defaultClass:"ju367v8d"},14:{defaultClass:"ju367v8e"},16:{defaultClass:"ju367v8f"},18:{defaultClass:"ju367v8g"},20:{defaultClass:"ju367v8h"},24:{defaultClass:"ju367v8i"},28:{defaultClass:"ju367v8j"},32:{defaultClass:"ju367v8k"},36:{defaultClass:"ju367v8l"},44:{defaultClass:"ju367v8m"},64:{defaultClass:"ju367v8n"},"-1":{defaultClass:"ju367v8o"}}},position:{values:{absolute:{defaultClass:"ju367v8p"},fixed:{defaultClass:"ju367v8q"},relative:{defaultClass:"ju367v8r"}}},WebkitUserSelect:{values:{none:{defaultClass:"ju367v8s"}}},right:{values:{0:{defaultClass:"ju367v8t"}}},transition:{values:{default:{defaultClass:"ju367v8u"},transform:{defaultClass:"ju367v8v"}}},userSelect:{values:{none:{defaultClass:"ju367v8w"}}},width:{values:{1:{defaultClass:"ju367v8x"},2:{defaultClass:"ju367v8y"},4:{defaultClass:"ju367v8z"},8:{defaultClass:"ju367v90"},12:{defaultClass:"ju367v91"},20:{defaultClass:"ju367v92"},24:{defaultClass:"ju367v93"},28:{defaultClass:"ju367v94"},30:{defaultClass:"ju367v95"},32:{defaultClass:"ju367v96"},34:{defaultClass:"ju367v97"},36:{defaultClass:"ju367v98"},40:{defaultClass:"ju367v99"},44:{defaultClass:"ju367v9a"},48:{defaultClass:"ju367v9b"},54:{defaultClass:"ju367v9c"},60:{defaultClass:"ju367v9d"},200:{defaultClass:"ju367v9e"},full:{defaultClass:"ju367v9f"},max:{defaultClass:"ju367v9g"}}},backdropFilter:{values:{modalOverlay:{defaultClass:"ju367v9h"}}}}}),z1e={colors:{accentColor:"var(--rk-colors-accentColor)",accentColorForeground:"var(--rk-colors-accentColorForeground)",actionButtonBorder:"var(--rk-colors-actionButtonBorder)",actionButtonBorderMobile:"var(--rk-colors-actionButtonBorderMobile)",actionButtonSecondaryBackground:"var(--rk-colors-actionButtonSecondaryBackground)",closeButton:"var(--rk-colors-closeButton)",closeButtonBackground:"var(--rk-colors-closeButtonBackground)",connectButtonBackground:"var(--rk-colors-connectButtonBackground)",connectButtonBackgroundError:"var(--rk-colors-connectButtonBackgroundError)",connectButtonInnerBackground:"var(--rk-colors-connectButtonInnerBackground)",connectButtonText:"var(--rk-colors-connectButtonText)",connectButtonTextError:"var(--rk-colors-connectButtonTextError)",connectionIndicator:"var(--rk-colors-connectionIndicator)",downloadBottomCardBackground:"var(--rk-colors-downloadBottomCardBackground)",downloadTopCardBackground:"var(--rk-colors-downloadTopCardBackground)",error:"var(--rk-colors-error)",generalBorder:"var(--rk-colors-generalBorder)",generalBorderDim:"var(--rk-colors-generalBorderDim)",menuItemBackground:"var(--rk-colors-menuItemBackground)",modalBackdrop:"var(--rk-colors-modalBackdrop)",modalBackground:"var(--rk-colors-modalBackground)",modalBorder:"var(--rk-colors-modalBorder)",modalText:"var(--rk-colors-modalText)",modalTextDim:"var(--rk-colors-modalTextDim)",modalTextSecondary:"var(--rk-colors-modalTextSecondary)",profileAction:"var(--rk-colors-profileAction)",profileActionHover:"var(--rk-colors-profileActionHover)",profileForeground:"var(--rk-colors-profileForeground)",selectedOptionBorder:"var(--rk-colors-selectedOptionBorder)",standby:"var(--rk-colors-standby)"},fonts:{body:"var(--rk-fonts-body)"},radii:{actionButton:"var(--rk-radii-actionButton)",connectButton:"var(--rk-radii-connectButton)",menuButton:"var(--rk-radii-menuButton)",modal:"var(--rk-radii-modal)",modalMobile:"var(--rk-radii-modalMobile)"},shadows:{connectButton:"var(--rk-shadows-connectButton)",dialog:"var(--rk-shadows-dialog)",profileDetailsAction:"var(--rk-shadows-profileDetailsAction)",selectedOption:"var(--rk-shadows-selectedOption)",selectedWallet:"var(--rk-shadows-selectedWallet)",walletLogo:"var(--rk-shadows-walletLogo)"},blurs:{modalOverlay:"var(--rk-blurs-modalOverlay)"}},fFt={shrink:"_12cbo8i6",shrinkSm:"_12cbo8i7"},hFt="_12cbo8i3 ju367v8r",pFt={grow:"_12cbo8i4",growLg:"_12cbo8i5"};function iu({active:e,hover:t}){return[hFt,t&&pFt[t],fFt[e]]}var yRe=m.createContext(null);function mFt(){const{adapter:e}=m.useContext(yRe)??{};if(!e)throw new Error("No authentication adapter found");return e}function A$(){const e=m.useContext(yRe);return(e==null?void 0:e.status)??null}function vRe(){const e=A$(),{isConnected:t}=Jr();return t?e&&(e==="loading"||e==="unauthenticated")?e:"connected":"disconnected"}function nle(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function xFt(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function gFt(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function g5(){return xFt()||gFt()}function ou(){return nle()||g5()}var bFt="iekbcc0",yFt={a:"iekbcca",blockquote:"iekbcc2",button:"iekbcc9",input:"iekbcc8 iekbcc5 iekbcc4",mark:"iekbcc6",ol:"iekbcc1",q:"iekbcc2",select:"iekbcc7 iekbcc5 iekbcc4",table:"iekbcc3",textarea:"iekbcc5 iekbcc4",ul:"iekbcc1"},vFt=({reset:e,...t})=>{if(!e)return Zee(t);const n=yFt[e],r=Zee(t);return fMe(bFt,n,r)},Nn=Ne.forwardRef(({as:e="div",className:t,testId:n,...r},s)=>{const a={},o={};for(const c in r)Zee.properties.has(c)?a[c]=r[c]:o[c]=r[c];const l=vFt({reset:typeof e=="string"?e:"div",...a});return Ne.createElement(e,{className:fMe(l,t),...o,"data-testid":n?`rk-${n.replace(/^rk-/,"")}`:void 0,ref:s})});Nn.displayName="Box";var wRe=new Map,eW=new Map;async function CRe(e){const t=eW.get(e);if(t)return t;const n=async()=>e().then(async s=>(wRe.set(e,s),s)),r=n().catch(s=>n().catch(a=>{eW.delete(e)}));return eW.set(e,r),r}async function sx(...e){return await Promise.all(e.map(t=>typeof t=="function"?CRe(t):t))}function wFt(){const[,e]=m.useReducer(t=>t+1,0);return e}function rle(e){const t=typeof e=="function"?wRe.get(e):void 0,n=wFt();return m.useEffect(()=>{typeof e=="function"&&!t&&CRe(e).then(n)},[e,t,n]),typeof e=="function"?t:e}function Ic({alt:e,background:t,borderColor:n,borderRadius:r,useAsImage:s,boxShadow:a,height:o,src:l,width:c,testId:u}){const d=g5(),f=rle(l),x=f&&/^http/.test(f),[g,v]=m.useReducer(()=>!0,!1);return Ne.createElement(Nn,{"aria-label":e,borderRadius:r,boxShadow:a,height:typeof o=="string"?o:void 0,overflow:"hidden",position:"relative",role:"img",style:{background:t,height:typeof o=="number"?o:void 0,width:typeof c=="number"?c:void 0},width:typeof c=="string"?c:void 0,testId:u},Ne.createElement(Nn,{...x?{"aria-hidden":!0,as:"img",onLoad:v,src:f}:{"aria-hidden":!0,as:"img",src:f},height:"full",position:"absolute",...d?{WebkitUserSelect:"none"}:{},style:{WebkitTouchCallout:"none",transition:"opacity .15s linear",userSelect:"none",...!s&&x?{opacity:g?1:0}:{}},width:"full"}),n?Ne.createElement(Nn,{...typeof n=="object"&&"custom"in n?{style:{borderColor:n.custom}}:{borderColor:n},borderRadius:r,borderStyle:"solid",borderWidth:"1",height:"full",position:"relative",width:"full"}):null)}var CFt="_1luule42",SFt="_1luule43",NFt=e=>m.useMemo(()=>`${e}_${Math.round(Math.random()*1e9)}`,[e]),ZE=({height:e=21,width:t=21})=>{const n=NFt("spinner");return Ne.createElement("svg",{className:CFt,fill:"none",height:e,viewBox:"0 0 21 21",width:t,xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Loading"),Ne.createElement("clipPath",{id:n},Ne.createElement("path",{d:"M10.5 3C6.35786 3 3 6.35786 3 10.5C3 14.6421 6.35786 18 10.5 18C11.3284 18 12 18.6716 12 19.5C12 20.3284 11.3284 21 10.5 21C4.70101 21 0 16.299 0 10.5C0 4.70101 4.70101 0 10.5 0C16.299 0 21 4.70101 21 10.5C21 11.3284 20.3284 12 19.5 12C18.6716 12 18 11.3284 18 10.5C18 6.35786 14.6421 3 10.5 3Z"})),Ne.createElement("foreignObject",{clipPath:`url(#${n})`,height:"21",width:"21",x:"0",y:"0"},Ne.createElement("div",{className:SFt})))},Qi=["#FC5C54","#FFD95A","#E95D72","#6A87C8","#5FD0F3","#75C06B","#FFDD86","#5FC6D4","#FF949A","#FF8024","#9BA1A4","#EC66FF","#FF8CBC","#FF9A23","#C5DADB","#A8CE63","#71ABFF","#FFE279","#B6B1B6","#FF6780","#A575FF","#4D82FF","#FFB35A"],H1e=[{color:Qi[0],emoji:"🌶"},{color:Qi[1],emoji:"🤑"},{color:Qi[2],emoji:"🐙"},{color:Qi[3],emoji:"🫐"},{color:Qi[4],emoji:"🐳"},{color:Qi[0],emoji:"🤶"},{color:Qi[5],emoji:"🌲"},{color:Qi[6],emoji:"🌞"},{color:Qi[7],emoji:"🐒"},{color:Qi[8],emoji:"🐵"},{color:Qi[9],emoji:"🦊"},{color:Qi[10],emoji:"🐼"},{color:Qi[11],emoji:"🦄"},{color:Qi[12],emoji:"🐷"},{color:Qi[13],emoji:"🐧"},{color:Qi[8],emoji:"🦩"},{color:Qi[14],emoji:"👽"},{color:Qi[0],emoji:"🎈"},{color:Qi[8],emoji:"🍉"},{color:Qi[1],emoji:"🎉"},{color:Qi[15],emoji:"🐲"},{color:Qi[16],emoji:"🌎"},{color:Qi[17],emoji:"🍊"},{color:Qi[18],emoji:"🐭"},{color:Qi[19],emoji:"🍣"},{color:Qi[1],emoji:"🐥"},{color:Qi[20],emoji:"👾"},{color:Qi[15],emoji:"🥦"},{color:Qi[0],emoji:"👹"},{color:Qi[17],emoji:"🙀"},{color:Qi[4],emoji:"⛱"},{color:Qi[21],emoji:"⛵️"},{color:Qi[17],emoji:"🥳"},{color:Qi[8],emoji:"🤯"},{color:Qi[22],emoji:"🤠"}];function AFt(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function jFt(e){const n=Math.abs(AFt((typeof e=="string"?e:"").toLowerCase())%H1e.length);return H1e[n??0]}var EFt=({address:e,ensImage:t,size:n})=>{const[r,s]=m.useState(!1);m.useEffect(()=>{if(t){const l=new Image;l.src=t,l.onload=()=>s(!0)}},[t]);const{color:a,emoji:o}=m.useMemo(()=>jFt(e),[e]);return t?r?Ne.createElement(Nn,{backgroundSize:"cover",borderRadius:"full",position:"absolute",style:{backgroundImage:`url(${t})`,backgroundPosition:"center",height:n,width:n}}):Ne.createElement(Nn,{alignItems:"center",backgroundSize:"cover",borderRadius:"full",color:"modalText",display:"flex",justifyContent:"center",position:"absolute",style:{height:n,width:n}},Ne.createElement(ZE,null)):Ne.createElement(Nn,{alignItems:"center",display:"flex",justifyContent:"center",overflow:"hidden",style:{...!t&&{backgroundColor:a},height:n,width:n}},o)},SRe=EFt,NRe=m.createContext(SRe);function _Ft({address:e,imageUrl:t,loading:n,size:r}){const s=m.useContext(NRe);return Ne.createElement(Nn,{"aria-hidden":!0,borderRadius:"full",overflow:"hidden",position:"relative",style:{height:`${r}px`,width:`${r}px`},userSelect:"none"},Ne.createElement(Nn,{alignItems:"center",borderRadius:"full",display:"flex",justifyContent:"center",overflow:"hidden",position:"absolute",style:{fontSize:`${Math.round(r*.55)}px`,height:`${r}px`,transform:n?"scale(0.72)":void 0,transition:".25s ease",transitionDelay:n?void 0:".1s",width:`${r}px`,willChange:"transform"},userSelect:"none"},Ne.createElement(s,{address:e,ensImage:t,size:r})),n&&Ne.createElement(Nn,{color:"accentColor",display:"flex",height:"full",position:"absolute",width:"full"},Ne.createElement(ZE,{height:"100%",width:"100%"})))}var V1e={defaultLocale:"en",locale:"en"},kFt=class{constructor(e){this.listeners=new Set,this.defaultLocale=V1e.defaultLocale,this.enableFallback=!1,this.locale=V1e.locale,this.cachedLocales=[],this.translations={};for(const[t,n]of Object.entries(e))this.cachedLocales=[...this.cachedLocales,t],this.translations={...this.translations,...this.flattenTranslation(n,t)}}missingMessage(e){return`[missing: "${this.locale}.${e}" translation]`}flattenTranslation(e,t){const n={},r=(s,a)=>{for(const o of Object.keys(s)){const l=`${a}.${o}`,c=s[o];typeof c=="object"&&c!==null?r(c,l):n[l]=c}};return r(e,t),n}translateWithReplacements(e,t={}){let n=e;for(const r in t){const s=t[r];n=n.replace(`%{${r}}`,s)}return n}t(e,t,n){const r=`${this.locale}.${e}`,s=this.translations[r];if(!s){if(this.enableFallback){const a=`${this.defaultLocale}.${e}`,o=this.translations[a];if(o)return this.translateWithReplacements(o,t)}return n!=null&&n.rawKeyIfTranslationMissing?e:this.missingMessage(e)}return this.translateWithReplacements(s,t)}isLocaleCached(e){return this.cachedLocales.includes(e)}updateLocale(e){this.locale=e,this.notifyListeners()}setTranslations(e,t){this.isLocaleCached(e)||(this.cachedLocales=[...this.cachedLocales,e],this.translations={...this.translations,...this.flattenTranslation(t,e)}),this.locale=e,this.notifyListeners()}notifyListeners(){for(const e of this.listeners)e()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},Xh=new kFt({en:JSON.parse(Vee),"en-US":JSON.parse(Vee)});Xh.defaultLocale="en-US";Xh.locale="en-US";Xh.enableFallback=!0;var TFt=async e=>{switch(e){case"ar":case"ar-AR":return(await ss(async()=>{const{default:t}=await import("./ar_AR-ZRPPM56D-d2WEfzQ_.js");return{default:t}},[])).default;case"de":case"de-DE":return(await ss(async()=>{const{default:t}=await import("./de_DE-GYZFZXWH-CYZf24IR.js");return{default:t}},[])).default;case"en":case"en-US":return(await ss(async()=>{const{default:t}=await Promise.resolve().then(()=>yNe);return{default:t}},void 0)).default;case"es":case"es-419":return(await ss(async()=>{const{default:t}=await import("./es_419-OGVOQEFZ-D6BJPTeQ.js");return{default:t}},[])).default;case"fr":case"fr-FR":return(await ss(async()=>{const{default:t}=await import("./fr_FR-Q5QBQBX2-lQoTmpTH.js");return{default:t}},[])).default;case"hi":case"hi-IN":return(await ss(async()=>{const{default:t}=await import("./hi_IN-7I7LRHGW-CTQjmeYe.js");return{default:t}},[])).default;case"id":case"id-ID":return(await ss(async()=>{const{default:t}=await import("./id_ID-ZMGZ2JFV-CgKQKAmU.js");return{default:t}},[])).default;case"ja":case"ja-JP":return(await ss(async()=>{const{default:t}=await import("./ja_JP-NYBCHQTZ-CMaBl8Za.js");return{default:t}},[])).default;case"ko":case"ko-KR":return(await ss(async()=>{const{default:t}=await import("./ko_KR-67WE736M-DHWhIjcm.js");return{default:t}},[])).default;case"ms":case"ms-MY":return(await ss(async()=>{const{default:t}=await import("./ms_MY-65AJIBUS-BLlUrxe6.js");return{default:t}},[])).default;case"pt":case"pt-BR":return(await ss(async()=>{const{default:t}=await import("./pt_BR-DMJANC65-DMs4DrlC.js");return{default:t}},[])).default;case"ru":case"ru-RU":return(await ss(async()=>{const{default:t}=await import("./ru_RU-WER7RQ6A-DsJK55uv.js");return{default:t}},[])).default;case"th":case"th-TH":return(await ss(async()=>{const{default:t}=await import("./th_TH-JOSHEZ6D-Cp87mIRZ.js");return{default:t}},[])).default;case"tr":case"tr-TR":return(await ss(async()=>{const{default:t}=await import("./tr_TR-EAMG2YPO-C52_xfsf.js");return{default:t}},[])).default;case"ua":case"uk-UA":return(await ss(async()=>{const{default:t}=await import("./uk_UA-GO2TRVWA-C1C1400t.js");return{default:t}},[])).default;case"vi":case"vi-VN":return(await ss(async()=>{const{default:t}=await import("./vi_VN-5HLLSOJA-Dj7ferOp.js");return{default:t}},[])).default;case"zh":case"zh-CN":case"zh-Hans":return(await ss(async()=>{const{default:t}=await import("./zh_CN-THPIFVWJ-Cbp71xMR.js");return{default:t}},[])).default;case"zh-HK":return(await ss(async()=>{const{default:t}=await import("./zh_HK-R7XP4TGF-CyJtfKGw.js");return{default:t}},[])).default;case"zh-Hant":case"zh-TW":return(await ss(async()=>{const{default:t}=await import("./zh_TW-F5LD752V-AHFgsYw-.js");return{default:t}},[])).default;default:return(await ss(async()=>{const{default:t}=await Promise.resolve().then(()=>yNe);return{default:t}},void 0)).default}};async function W1e(e){if(Xh.isLocaleCached(e)){Xh.updateLocale(e);return}const n=await TFt(e);Xh.setTranslations(e,JSON.parse(n))}var IFt=()=>{var e;if(typeof window<"u"&&typeof navigator<"u"){if((e=navigator.languages)!=null&&e.length)return navigator.languages[0];if(navigator.language)return navigator.language}},lc=m.createContext({i18n:Xh}),PFt=({children:e,locale:t})=>{const[n,r]=m.useState(0),s=m.useMemo(()=>IFt(),[]);m.useEffect(()=>Xh.onChange(()=>{r(l=>l+1)}),[]),m.useEffect(()=>{t&&t!==Xh.locale?W1e(t):!t&&s&&s!==Xh.locale&&W1e(s)},[t,s]);const a=m.useMemo(()=>({t:(l,c)=>Xh.t(l,c),i18n:Xh}),[n]);return Ne.createElement(lc.Provider,{value:a},e)};function ARe(e){return e!=null}var q1e={iconBackground:"#7290CC",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./apechain-COEQ5RUI-0TDoXOYf.js");return{default:e}},[])).default},tW={iconBackground:"#96bedc",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./arbitrum-HW44W6XR-hPA5bMPt.js");return{default:e}},[])).default},G1e={iconBackground:"#e84141",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./avalanche-MXEFEDSW-DcC5FNt3.js");return{default:e}},[])).default},nW={iconBackground:"#0052ff",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./base-Z4LFBE5D-DHfqMzJC.js");return{default:e}},[])).default},rW={iconBackground:"#814625",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./berachain-ZN3U5LDZ-CAvW_8ws.js");return{default:e}},[])).default},K1e={iconBackground:"#000000",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./blast-46UQLYYY-BV_Xlsq4.js");return{default:e}},[])).default},Y1e={iconBackground:"#ebac0e",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./bsc-RVE67I5L-DVYEF0vl.js");return{default:e}},[])).default},X1e={iconBackground:"#FCFF52",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./celo-E6XU57FO-C5IguUgF.js");return{default:e}},[])).default},Q1e={iconBackground:"#002D74",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./cronos-ROYR77VZ-Prn3LRPZ.js");return{default:e}},[])).default},FFt={iconBackground:"#A36EFD",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./degen-7ROC3GCY-9HqAkHtZ.js");return{default:e}},[])).default},pb={iconBackground:"#484c50",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./ethereum-RFBAMUVK-WsW8NXqo.js");return{default:e}},[])).default},Z1e={iconBackground:"transparent",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./flow-NBCRNYVF-D2XasjKk.js");return{default:e}},[])).default},OFt={iconBackground:"#04795c",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./gnosis-Y56LN66M-D4_J-ZQH.js");return{default:e}},[])).default},J1e={iconBackground:"#000000",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./gravity-LMEBVSFN-DLxWpxhy.js");return{default:e}},[])).default},MFt={iconBackground:"#f9f7ec",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./hardhat-NEEC6JX7-DzuWQYyS.js");return{default:e}},[])).default},RFt={iconBackground:"#000000",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./hyperevm-J6CONVCX-C6oeYIAP.js");return{default:e}},[])).default},ebe={iconBackground:"#7132F5",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./ink-4U4ZVNAB-AlM1MLfQ.js");return{default:e}},[])).default},tbe={iconBackground:"transparent",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./kaia-A33DVQBT-Fgclbhio.js");return{default:e}},[])).default},sW={iconBackground:"#ffffff",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./linea-IALBSJQC-Cmyd7vgA.js");return{default:e}},[])).default},iW={iconBackground:"#ffffff",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./manta-5V6W5D7G-BnjsGzeJ.js");return{default:e}},[])).default},nbe={iconBackground:"#000000",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./mantle-KBL3OIYT-DIpe0poV.js");return{default:e}},[])).default},xP={iconBackground:"#ff5a57",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./optimism-YWJ3IQHA-DYER-OR5.js");return{default:e}},[])).default},aW={iconBackground:"#9f71ec",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./polygon-WWEUOMKW-CNBYSB1T.js");return{default:e}},[])).default},LFt={iconBackground:"#1273EA",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./ronin-PNHX5V6H-BS-WPXjQ.js");return{default:e}},[])).default},DFt={iconBackground:"#000000",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./sanko-RHQYXGM5-OX010CbN.js");return{default:e}},[])).default},rbe={iconBackground:"#FFEEDA",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./scroll-MCKFTBRS-C2gqZSab.js");return{default:e}},[])).default},sbe={iconBackground:"#F50DB4",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./unichain-OQ3BZUDH-CyMLDmFg.js");return{default:e}},[])).default},ibe={iconBackground:"#f9f7ec",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./xdc-X7V4QFNF-CSGs0o6M.js");return{default:e}},[])).default},abe={iconBackground:"#000000",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./zetachain-BMJKVYBN-IK2CZBr3.js");return{default:e}},[])).default},obe={iconBackground:"#f9f7ec",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./zksync-UWUXFL74-Bt0brpXu.js");return{default:e}},[])).default},oW={iconBackground:"#000000",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./zora-YZH32HP3-CY3tp3EJ.js");return{default:e}},[])).default},BFt={apechain:{chainId:33139,name:"ApeChain",...q1e},apechainCurtis:{chainId:33111,name:"ApeChain Curtis",...q1e},arbitrum:{chainId:42161,name:"Arbitrum",...tW},arbitrumGoerli:{chainId:421613,...tW},arbitrumSepolia:{chainId:421614,...tW},avalanche:{chainId:43114,...G1e},avalancheFuji:{chainId:43113,...G1e},base:{chainId:8453,name:"Base",...nW},baseGoerli:{chainId:84531,...nW},baseSepolia:{chainId:84532,...nW},berachain:{chainId:80094,name:"Berachain",...rW},berachainArtio:{chainId:80085,name:"Berachain Artio",...rW},berachainBArtio:{chainId:80084,name:"Berachain bArtio",...rW},blast:{chainId:81457,name:"Blast",...K1e},blastSepolia:{chainId:168587773,...K1e},bsc:{chainId:56,name:"BSC",...Y1e},bscTestnet:{chainId:97,...Y1e},celo:{chainId:42220,name:"Celo",...X1e},celoAlfajores:{chainId:44787,name:"Celo Alfajores",...X1e},cronos:{chainId:25,...Q1e},cronosTestnet:{chainId:338,...Q1e},degen:{chainId:666666666,name:"Degen",...FFt},flow:{chainId:747,...Z1e},flowTestnet:{chainId:545,...Z1e},gnosis:{chainId:100,name:"Gnosis",...OFt},goerli:{chainId:5,...pb},gravity:{chainId:1625,name:"Gravity",...J1e},gravitySepolia:{chainId:13505,name:"Gravity Sepolia",...J1e},hardhat:{chainId:31337,...MFt},holesky:{chainId:17e3,...pb},hyperevm:{chainId:999,...RFt},ink:{chainId:57073,...ebe},inkSepolia:{chainId:763373,...ebe},kaia:{chainId:8217,name:"Kaia",...tbe},kairos:{chainId:1001,name:"Kairos",...tbe},kovan:{chainId:42,...pb},linea:{chainId:59144,name:"Linea",...sW},lineaGoerli:{chainId:59140,name:"Linea Goerli",...sW},lineaSepolia:{chainId:59141,name:"Linea Sepolia",...sW},localhost:{chainId:1337,...pb},mainnet:{chainId:1,name:"Ethereum",...pb},manta:{chainId:169,name:"Manta",...iW},mantaSepolia:{chainId:3441006,...iW},mantaTestnet:{chainId:3441005,...iW},mantle:{chainId:5e3,...nbe},mantleTestnet:{chainId:5001,...nbe},optimism:{chainId:10,name:"Optimism",...xP},optimismGoerli:{chainId:420,...xP},optimismKovan:{chainId:69,...xP},optimismSepolia:{chainId:11155420,...xP},polygon:{chainId:137,name:"Polygon",...aW},polygonAmoy:{chainId:80002,...aW},polygonMumbai:{chainId:80001,...aW},rinkeby:{chainId:4,...pb},ronin:{chainId:2020,...LFt},ropsten:{chainId:3,...pb},sanko:{chainId:1996,name:"Sanko",...DFt},scroll:{chainId:534352,...rbe},scrollSepolia:{chainId:534351,...rbe},sepolia:{chainId:11155111,...pb},unichain:{chainId:130,...sbe},unichainSepolia:{chainId:1301,...sbe},xdc:{chainId:50,name:"XinFin",...ibe},xdcTestnet:{chainId:51,...ibe},zetachain:{chainId:7e3,name:"ZetaChain",...abe},zetachainAthensTestnet:{chainId:7001,name:"Zeta Athens",...abe},zkSync:{chainId:324,name:"zkSync",...obe},zkSyncTestnet:{chainId:280,...obe},zora:{chainId:7777777,name:"Zora",...oW},zoraSepolia:{chainId:999999999,...oW},zoraTestnet:{chainId:999,...oW}},$Ft=Object.fromEntries(Object.values(BFt).filter(ARe).map(({chainId:e,...t})=>[e,t])),UFt=e=>e.map(t=>{const n=$Ft[t.id]??{};return{...t,name:n.name??t.name,iconUrl:t.iconUrl??n.iconUrl,iconBackground:t.iconBackground??n.iconBackground}}),sle=m.createContext({chains:[]});function zFt({children:e,initialChain:t}){const{chains:n}=Al();return Ne.createElement(sle.Provider,{value:m.useMemo(()=>({chains:UFt(n),initialChainId:typeof t=="number"?t:t==null?void 0:t.id}),[n,t])},e)}var $A=()=>m.useContext(sle).chains,HFt=()=>m.useContext(sle).initialChainId,VFt=()=>{const e=$A();return m.useMemo(()=>{const t={};for(const n of e)t[n.id]=n;return t},[e])},jRe=m.createContext({showBalance:void 0,setShowBalance:()=>{}});function WFt({children:e}){const[t,n]=m.useState();return Ne.createElement(jRe.Provider,{value:{showBalance:t,setShowBalance:n}},e)}var qFt=()=>m.useContext(jRe);function GFt(){const[e,t]=m.useState(!1);return m.useEffect(()=>(t(!0),()=>{t(!1)}),[]),m.useCallback(()=>e,[e])}function ERe(){const e=$A(),t=QE.id;return e.some(r=>r.id===t)}function KFt(e){const t=ERe(),n=s=>{try{return WIt(s)}catch{}},{data:r}=rgt({chainId:QE.id,name:e?n(e):void 0,query:{enabled:t}});return r}async function cv(e,t){if(t={headers:{},method:"get",...t,timeout:t.timeout??1e4},!e)throw new Error("rainbowFetch: Missing url argument");const n=new AbortController,r=setTimeout(()=>n.abort(),t.timeout),{body:s,params:a,headers:o,...l}=t,c=s&&typeof s=="object"?JSON.stringify(t.body):t.body,u=await fetch(`${e}${XFt(a)}`,{...l,body:c,headers:{Accept:"application/json","Content-Type":"application/json",...o},signal:n.signal});clearTimeout(r);const d=await YFt(u);if(u.ok){const{headers:g,status:v}=u;return{data:d,headers:g,status:v}}throw QFt({requestBody:s,response:u,responseBody:typeof d=="string"?{error:d}:d})}function YFt(e){const t=e.headers.get("Content-Type");return t!=null&&t.startsWith("application/json")?e.json():e.text()}function XFt(e){return e&&Object.keys(e).length?`?${new URLSearchParams(e)}`:""}function QFt({requestBody:e,response:t,responseBody:n}){const r=(n==null?void 0:n.error)||(t==null?void 0:t.statusText)||"There was an error with the request.",s=new Error(r);return s.response=t,s.responseBody=n,s.requestBody=e,s}var ZFt=class{constructor(e={}){const{baseUrl:t="",...n}=e;this.baseUrl=t,this.opts=n}get(e,t){return cv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"get"})}delete(e,t){return cv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"delete"})}head(e,t){return cv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"head"})}options(e,t){return cv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"options"})}post(e,t,n){return cv(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"post"})}put(e,t,n){return cv(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"put"})}patch(e,t,n){return cv(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"patch"})}};function JFt({baseUrl:e,headers:t,params:n,timeout:r}){return new ZFt({baseUrl:e,headers:t,params:n,timeout:r})}var eOt=!!(typeof process<"u"&&typeof OR<"u"&&OR.RAINBOW_PROVIDER_API_KEY),tOt=JFt({baseUrl:"https://enhanced-provider.rainbow.me",headers:{"x-api-key":typeof process<"u"&&typeof OR<"u"&&OR.RAINBOW_PROVIDER_API_KEY||"LzbasoBiLqltex3VkcQ7LRmL4PtfiiZ1EMJrizrgfonWN6byJReu/l6yrUoo3zLW"}});function nOt(e,t,n={}){return[e,t,n]}function bO(e){return`rk-ens-name-${e}`}function rOt(e){try{const t=e?JSON.parse(e):null;return typeof t=="object"?t:null}catch{return null}}function sOt(e,t){if(!ic(e))return;const n=new Date,r=new Date(n.getTime()+180*6e4);localStorage.setItem(bO(e),JSON.stringify({ensName:t,expires:r.getTime()}))}function iOt(e){const t=rOt(localStorage.getItem(bO(e)));if(!t)return null;const{ensName:n,expires:r}=t;return typeof n!="string"||Number.isNaN(Number(r))||new Date().getTime()>Number(r)?(localStorage.removeItem(bO(e)),null):n}async function aOt({address:e}){const t=iOt(e);if(t)return t;const r=(await tOt.get("/v1/resolve-ens",{params:{address:e}})).data.data;return r&&sOt(e,r),r}function oOt(e){const t=ERe(),{data:n}=sgt({chainId:QE.id,address:e,query:{enabled:t}}),{data:r}=p_e({queryKey:nOt("address",e),queryFn:()=>aOt({address:e}),enabled:!t&&!!e&&eOt,staleTime:10*(60*1e3),retry:1});return n||r}function _Re({address:e,includeBalance:t}){const n=oOt(e),r=KFt(n),{data:s}=m_e({address:t?e:void 0});return{ensName:n,ensAvatar:r,balance:s}}function ile(){const{chain:e}=Jr();return(e==null?void 0:e.id)??null}var kRe="rk-transactions";function lOt(e){try{const t=e?JSON.parse(e):{};return typeof t=="object"?t:{}}catch{return{}}}function lbe(){return lOt(typeof localStorage<"u"?localStorage.getItem(kRe):null)}var cOt=/^0x([A-Fa-f0-9]{64})$/;function uOt(e){const t=[];return cOt.test(e.hash)||t.push("Invalid transaction hash"),typeof e.description!="string"&&t.push("Transaction must have a description"),typeof e.confirmations<"u"&&(!Number.isInteger(e.confirmations)||e.confirmations<1)&&t.push("Transaction confirmations must be a positiver integer"),t}function dOt({provider:e}){let t=lbe(),n=e;const r=new Set,s=new Set,a=new Map;function o(I){n=I}function l(I,P){var R;return((R=t[I])==null?void 0:R[P])??[]}function c(I,P,R){const F=uOt(R);if(F.length>0)throw new Error(["Unable to add transaction",...F].join(`
`));x(I,P,U=>[{...R,status:"pending"},...U.filter(({hash:L})=>L!==R.hash)])}function u(I,P){x(I,P,()=>[])}function d(I,P,R,F){x(I,P,U=>U.map(L=>L.hash===R?{...L,status:F}:L))}async function f(I,P){await Promise.all(l(I,P).filter(R=>R.status==="pending").map(async R=>{const{confirmations:F,hash:U}=R,L=a.get(U);if(L)return await L;const z=n.waitForTransactionReceipt({confirmations:F,hash:U,timeout:3e5}).then(({status:Q})=>{a.delete(U),Q!==void 0&&(d(I,P,U,Q===0||Q==="reverted"?"failed":"confirmed"),w(Q))}).catch(()=>{d(I,P,U,"failed")});return a.set(U,z),await z}))}function x(I,P,R){t=lbe(),t[I]=t[I]??{};let F=0;const U=10,L=R(t[I][P]??[]).filter(({status:z})=>z==="pending"?!0:F++<=U);t[I][P]=L.length>0?L:void 0,g(),v(),f(I,P)}function g(){localStorage.setItem(kRe,JSON.stringify(t))}function v(){for(const I of r)I()}function w(I){for(const P of s)P(I)}function C(I){return r.add(I),()=>{r.delete(I)}}function N(I){return s.add(I),()=>{s.delete(I)}}return{addTransaction:c,clearTransactions:u,getTransactions:l,onTransactionStatus:N,onChange:C,setProvider:o,waitForPendingTransactions:f}}var cbe,TRe=Ne.createContext(null);function fOt({children:e}){const t=x_e(),{address:n}=Jr(),r=ile(),{refetch:s}=m_e({address:n,query:{enabled:!1}}),[a]=Ne.useState(()=>cbe??(cbe=dOt({provider:t}))),o=Ne.useCallback(l=>{l==="success"&&s()},[s]);return Ne.useEffect(()=>{a.setProvider(t)},[a,t]),Ne.useEffect(()=>{n&&r&&a.waitForPendingTransactions(n,r)},[a,n,r]),Ne.useEffect(()=>{if(a&&n&&r)return a.onTransactionStatus(o)},[a,n,r,o]),Ne.createElement(TRe.Provider,{value:a},e)}function IRe(){const e=Ne.useContext(TRe);if(!e)throw new Error("Transaction hooks must be used within RainbowKitProvider");return e}function PRe(){const e=IRe(),{address:t}=Jr(),n=ile(),[r,s]=m.useState(()=>e&&t&&n?e.getTransactions(t,n):[]);return m.useEffect(()=>{if(e&&t&&n)return s(e.getTransactions(t,n)),e.onChange(()=>{s(e.getTransactions(t,n))})},[e,t,n]),r}var ube=e=>typeof e=="function"?e():e;function hOt(e,{extends:t}={}){const n={...f1e(z1e,ube(e))};if(!t)return n;const r=f1e(z1e,ube(t));return Object.fromEntries(Object.entries(n).filter(([a,o])=>o!==r[a]))}function dbe(e,t={}){return Object.entries(hOt(e,t)).map(([n,r])=>`${n}:${r.replace(/[:;{}</>]/g,"")};`).join("")}var FRe={appName:void 0,disclaimer:void 0,learnMoreUrl:"https://learn.rainbow.me/understanding-web3?utm_source=rainbowkit&utm_campaign=learnmore"},sT=m.createContext(FRe),ORe=m.createContext(!1);function pOt(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,e()},t)}}var MRe=()=>{const[e,t]=m.useState({height:void 0,width:void 0});return m.useEffect(()=>{const n=pOt(()=>{t({height:window.innerHeight,width:window.innerWidth})},500);return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)},[]),e},iT=m.createContext({connector:null,setConnector:()=>{}});function mOt({children:e}){const[t,n]=m.useState(null);return Ne.createElement(iT.Provider,{value:m.useMemo(()=>({connector:t,setConnector:n}),[t])},e)}var aT={COMPACT:"compact",WIDE:"wide"},j$=m.createContext(aT.WIDE);function xOt({children:e,modalSize:t}){const{width:n}=MRe(),r=n&&n<uFt,{connector:s}=m.useContext(iT);return Ne.createElement(j$.Provider,{value:r||s?aT.COMPACT:t},e)}var ale=m.createContext(!1),gOt="rk-version";function bOt({version:e}){localStorage.setItem(gOt,e)}function yOt(){const e=m.useCallback(()=>{bOt({version:"2.2.4"})},[]);m.useEffect(()=>{e()},[e])}function vOt(e,t){const n={};for(const r of e){const s=t(r);s&&(n[s]=r)}return n}function ole(){return typeof navigator<"u"&&typeof navigator.userAgent<"u"&&/Version\/([0-9._]+).*Safari/.test(navigator.userAgent)}function wOt(){return typeof document<"u"&&getComputedStyle(document.body).getPropertyValue("--arc-palette-focus")!==""}function lle(){var t,n;if(typeof navigator>"u")return"Browser";const e=(t=navigator.userAgent)==null?void 0:t.toLowerCase();return(n=navigator.brave)!=null&&n.isBrave?"Brave":(e==null?void 0:e.indexOf("edg/"))>-1?"Edge":(e==null?void 0:e.indexOf("op"))>-1?"Opera":wOt()?"Arc":(e==null?void 0:e.indexOf("chrome"))>-1?"Chrome":(e==null?void 0:e.indexOf("firefox"))>-1?"Firefox":ole()?"Safari":"Browser"}var COt=DPt.UAParser(),{os:cle}=COt;function SOt(){return cle.name==="Windows"}function NOt(){return cle.name==="Mac OS"}function AOt(){return["Ubuntu","Mint","Fedora","Debian","Arch","Linux"].includes(cle.name)}function ule(){return SOt()?"Windows":NOt()?"macOS":AOt()?"Linux":"Desktop"}var jOt=e=>{var n,r,s,a,o,l,c,u,d,f,x;const t=lle();return{Arc:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.chrome,Brave:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.chrome,Chrome:(s=e==null?void 0:e.downloadUrls)==null?void 0:s.chrome,Edge:((a=e==null?void 0:e.downloadUrls)==null?void 0:a.edge)||((o=e==null?void 0:e.downloadUrls)==null?void 0:o.chrome),Firefox:(l=e==null?void 0:e.downloadUrls)==null?void 0:l.firefox,Opera:((c=e==null?void 0:e.downloadUrls)==null?void 0:c.opera)||((u=e==null?void 0:e.downloadUrls)==null?void 0:u.chrome),Safari:(d=e==null?void 0:e.downloadUrls)==null?void 0:d.safari,Browser:(f=e==null?void 0:e.downloadUrls)==null?void 0:f.browserExtension}[t]??((x=e==null?void 0:e.downloadUrls)==null?void 0:x.browserExtension)},EOt=e=>{var n,r,s;return(g5()?(n=e==null?void 0:e.downloadUrls)==null?void 0:n.ios:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.android)??((s=e==null?void 0:e.downloadUrls)==null?void 0:s.mobile)},_Ot=e=>{var n,r,s,a,o;const t=ule();return{Windows:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.windows,macOS:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.macos,Linux:(s=e==null?void 0:e.downloadUrls)==null?void 0:s.linux,Desktop:(a=e==null?void 0:e.downloadUrls)==null?void 0:a.desktop}[t]??((o=e==null?void 0:e.downloadUrls)==null?void 0:o.desktop)},RRe=(e,t)=>e.some(n=>n.id===t),kOt=e=>!!e.isRainbowKitConnector,fbe=e=>{var t;return!!(!e.isRainbowKitConnector&&((t=e.icon)!=null&&t.replace(/\n/g,"").startsWith("data:image"))&&e.uid&&e.name)},TOt=(e,t)=>e.id==="walletConnect"&&t?{...e,walletConnectModalConnector:t}:e,IOt=({wallets:e,recentWallets:t})=>[...t,...e.filter(n=>!RRe(t,n.id))],LRe="rk-recent";function POt(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}}function DRe(){return typeof localStorage<"u"?POt(localStorage.getItem(LRe)):[]}function FOt(e){return[...new Set(e)]}function OOt(e){const t=FOt([e,...DRe()]);localStorage.setItem(LRe,JSON.stringify(t))}function JE(e=!1){var R,F,U;const t=$A(),n=HFt(),{connectAsync:r,connectors:s}=tgt(),a=s,{setIsWalletConnectModalOpen:o}=cLe(),l=a.map(L=>({...L,...L.rkDetails||{}}));async function c(L){var ne,J;const z=await L.getChainId(),Q=await r({chainId:n??((ne=t.find(({id:X})=>X===z))==null?void 0:ne.id)??((J=t[0])==null?void 0:J.id),connector:L});return Q&&OOt(L.id),Q}async function u(L){try{o(!0),await c(L),o(!1)}catch(z){const Q=z.name==="UserRejectedRequestError"||z.message==="Connection request reset. Please try again.";if(o(!1),!Q)throw z}}const d=async(L,z)=>{const Q=await L.getProvider();return L.id==="coinbase"?Q.qrUrl:new Promise(ne=>Q.once("display_uri",J=>{ne(z(J))}))},f=l.find(L=>L.id==="walletConnect"&&L.isWalletConnectModalConnector),x=l.filter(fbe).map(L=>({...L,groupIndex:0})),g=l.filter(kOt).filter(L=>!L.isWalletConnectModalConnector).filter(L=>e?!x.some(Q=>Q.id===L.rdns):!0).map(L=>TOt(L,f)),v=[...x,...g],w=vOt(v,L=>L.id),N=DRe().map(L=>w[L]).filter(Boolean).slice(0,3),I=[],P=IOt({wallets:v,recentWallets:N});for(const L of P){if(!L)continue;const z=fbe(L),Q=RRe(N,L.id);if(z){I.push({...L,iconUrl:L.icon,ready:!0,connect:()=>c(L),groupName:"Installed",recent:Q});continue}I.push({...L,ready:L.installed??!0,connect:()=>c(L),desktopDownloadUrl:_Ot(L),extensionDownloadUrl:jOt(L),groupName:L.groupName,mobileDownloadUrl:EOt(L),getQrCodeUri:(R=L.qrCode)!=null&&R.getUri?()=>d(L,L.qrCode.getUri):void 0,getDesktopUri:(F=L.desktop)!=null&&F.getUri?()=>d(L,L.desktop.getUri):void 0,getMobileUri:(U=L.mobile)!=null&&U.getUri?()=>{var ne;return d(L,(ne=L.mobile)==null?void 0:ne.getUri)}:void 0,recent:Q,showWalletConnectModal:L.walletConnectModalConnector?()=>u(L.walletConnectModalConnector):void 0})}return I}var BRe=async()=>(await ss(async()=>{const{default:e}=await import("./assets-NU2OP443-COMs-Mo6.js");return{default:e}},[])).default,MOt=()=>sx(BRe),ROt=()=>Ne.createElement(Ic,{background:"#d0d5de",borderRadius:"10",height:"48",src:BRe,width:"48"}),$Re=async()=>(await ss(async()=>{const{default:e}=await import("./login-CWDTIDNK-DhDUYE4b.js");return{default:e}},[])).default,LOt=()=>sx($Re),DOt=()=>Ne.createElement(Ic,{background:"#d0d5de",borderRadius:"10",height:"48",src:$Re,width:"48"}),Ps=Ne.forwardRef(({as:e="div",children:t,className:n,color:r,display:s,font:a="body",id:o,size:l="16",style:c,tabIndex:u,textAlign:d="inherit",weight:f="regular",testId:x},g)=>Ne.createElement(Nn,{as:e,className:n,color:r,display:s,fontFamily:a,fontSize:l,fontWeight:f,id:o,ref:g,style:c,tabIndex:u,textAlign:d,testId:x},t));Ps.displayName="Text";var BOt={large:{fontSize:"16",paddingX:"24",paddingY:"10"},medium:{fontSize:"14",height:"28",paddingX:"12",paddingY:"4"},small:{fontSize:"14",paddingX:"10",paddingY:"5"}};function hd({disabled:e=!1,href:t,label:n,onClick:r,rel:s="noreferrer noopener",size:a="medium",target:o="_blank",testId:l,type:c="primary"}){const u=c==="primary",d=a!=="large",f=ou(),x=e?"actionButtonSecondaryBackground":u?"accentColor":d?"actionButtonSecondaryBackground":null,{fontSize:g,height:v,paddingX:w,paddingY:C}=BOt[a],N=!f||!d;return Ne.createElement(Nn,{...t?e?{}:{as:"a",href:t,rel:s,target:o}:{as:"button",type:"button"},onClick:e?void 0:r,...N?{borderColor:f&&!d&&!u?"actionButtonBorderMobile":"actionButtonBorder",borderStyle:"solid",borderWidth:"1"}:{},borderRadius:"actionButton",className:!e&&iu({active:"shrinkSm",hover:"grow"}),display:"block",paddingX:w,paddingY:C,style:{willChange:"transform"},testId:l,textAlign:"center",transition:"transform",...x?{background:x}:{},...v?{height:v}:{}},Ne.createElement(Ps,{color:e?"modalTextSecondary":u?"accentColorForeground":"accentColor",size:g,weight:"bold"},n))}var $Ot=()=>ou()?Ne.createElement("svg",{"aria-hidden":!0,fill:"none",height:"11.5",viewBox:"0 0 11.5 11.5",width:"11.5",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Close"),Ne.createElement("path",{d:"M2.13388 0.366117C1.64573 -0.122039 0.854272 -0.122039 0.366117 0.366117C-0.122039 0.854272 -0.122039 1.64573 0.366117 2.13388L3.98223 5.75L0.366117 9.36612C-0.122039 9.85427 -0.122039 10.6457 0.366117 11.1339C0.854272 11.622 1.64573 11.622 2.13388 11.1339L5.75 7.51777L9.36612 11.1339C9.85427 11.622 10.6457 11.622 11.1339 11.1339C11.622 10.6457 11.622 9.85427 11.1339 9.36612L7.51777 5.75L11.1339 2.13388C11.622 1.64573 11.622 0.854272 11.1339 0.366117C10.6457 -0.122039 9.85427 -0.122039 9.36612 0.366117L5.75 3.98223L2.13388 0.366117Z",fill:"currentColor"})):Ne.createElement("svg",{"aria-hidden":!0,fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Close"),Ne.createElement("path",{d:"M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L3.58579 5L0.292893 8.29289C-0.0976311 8.68342 -0.0976311 9.31658 0.292893 9.70711C0.683417 10.0976 1.31658 10.0976 1.70711 9.70711L5 6.41421L8.29289 9.70711C8.68342 10.0976 9.31658 10.0976 9.70711 9.70711C10.0976 9.31658 10.0976 8.68342 9.70711 8.29289L6.41421 5L9.70711 1.70711C10.0976 1.31658 10.0976 0.683417 9.70711 0.292893C9.31658 -0.0976311 8.68342 -0.0976311 8.29289 0.292893L5 3.58579L1.70711 0.292893Z",fill:"currentColor"})),V3=({"aria-label":e="Close",onClose:t})=>{const n=ou();return Ne.createElement(Nn,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:iu({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},Ne.createElement($Ot,null))},URe=async()=>(await ss(async()=>{const{default:e}=await import("./sign-A7IJEUT5-CGsRnPrd.js");return{default:e}},[])).default;function UOt({onClose:e,onCloseModal:t}){const{i18n:n}=m.useContext(lc),[{status:r,...s},a]=Ne.useState({status:"idle"}),o=mFt(),l=m.useCallback(async()=>{try{const v=await o.getNonce();a(w=>({...w,nonce:v}))}catch{a(v=>({...v,errorMessage:n.t("sign_in.message.preparing_error"),status:"idle"}))}},[o,n.t]),c=m.useRef(!1);Ne.useEffect(()=>{c.current||(c.current=!0,l())},[l]);const u=ou(),{address:d,chain:f}=Jr(),{signMessageAsync:x}=g_e(),g=async()=>{try{const v=f==null?void 0:f.id,{nonce:w}=s;if(!d||!v||!w)return;a(I=>({...I,errorMessage:void 0,status:"signing"}));const C=o.createMessage({address:d,chainId:v,nonce:w});let N;try{N=await x({message:C})}catch(I){return I instanceof bo?a(P=>({...P,status:"idle"})):a(P=>({...P,errorMessage:n.t("sign_in.signature.signing_error"),status:"idle"}))}a(I=>({...I,status:"verifying"}));try{if(await o.verify({message:C,signature:N})){t();return}throw new Error}catch{return a(I=>({...I,errorMessage:n.t("sign_in.signature.verifying_error"),status:"idle"}))}}catch{a({errorMessage:n.t("sign_in.signature.oops_error"),status:"idle"})}};return Ne.createElement(Nn,{position:"relative"},Ne.createElement(Nn,{display:"flex",paddingRight:"16",paddingTop:"16",position:"absolute",right:"0"},Ne.createElement(V3,{onClose:e})),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"24",padding:"24",paddingX:"18",style:{paddingTop:u?"60px":"36px"}},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"6":"4",style:{maxWidth:u?320:280}},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"16"},Ne.createElement(Ic,{height:40,src:URe,width:40}),Ne.createElement(Ps,{color:"modalText",size:u?"20":"18",textAlign:"center",weight:"heavy"},n.t("sign_in.label"))),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"16":"12"},Ne.createElement(Ps,{color:"modalTextSecondary",size:u?"16":"14",textAlign:"center"},n.t("sign_in.description")),r==="idle"&&s.errorMessage?Ne.createElement(Ps,{color:"error",size:u?"16":"14",textAlign:"center",weight:"bold"},s.errorMessage):null)),Ne.createElement(Nn,{alignItems:u?void 0:"center",display:"flex",flexDirection:"column",gap:"8",width:"full"},Ne.createElement(hd,{disabled:!s.nonce||r==="signing"||r==="verifying",label:s.nonce?r==="signing"?n.t("sign_in.signature.waiting"):r==="verifying"?n.t("sign_in.signature.verifying"):n.t("sign_in.message.send"):n.t("sign_in.message.preparing"),onClick:g,size:u?"large":"medium",testId:"auth-message-button"}),u?Ne.createElement(hd,{label:"Cancel",onClick:e,size:"large",type:"secondary"}):Ne.createElement(Nn,{as:"button",borderRadius:"full",className:iu({active:"shrink",hover:"grow"}),display:"block",onClick:e,paddingX:"10",paddingY:"5",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ne.createElement(Ps,{color:"closeButton",size:u?"16":"14",weight:"bold"},n.t("sign_in.message.cancel"))))))}function zOt(){const e=$A(),t=JE(),n=A$()==="unauthenticated",r=m.useCallback(()=>{sx(...t.map(s=>s.iconUrl),...e.map(s=>s.iconUrl).filter(ARe)),ou()||(MOt(),LOt()),n&&sx(URe)},[t,e,n]);m.useEffect(()=>{r()},[r])}var zRe="WALLETCONNECT_DEEPLINK_CHOICE";function HOt({mobileUri:e,name:t}){localStorage.setItem(zRe,JSON.stringify({href:e.split("?")[0],name:t}))}function VOt(){localStorage.removeItem(zRe)}var HRe=m.createContext(void 0),Jee="data-rk",VRe=e=>({[Jee]:e||""}),WOt=e=>{if(e&&!/^[a-zA-Z0-9_]+$/.test(e))throw new Error(`Invalid ID: ${e}`);return e?`[${Jee}="${e}"]`:`[${Jee}]`},qOt=()=>{const e=m.useContext(HRe);return VRe(e)},GOt=aMe();function KOt({appInfo:e,avatar:t,children:n,coolMode:r=!1,id:s,initialChain:a,locale:o,modalSize:l=aT.WIDE,showRecentTransactions:c=!1,theme:u=GOt}){if(zOt(),yOt(),e_e({onDisconnect:VOt}),typeof u=="function")throw new Error('A theme function was provided to the "theme" prop instead of a theme object. You must execute this function to get the resulting theme object.');const d=WOt(s),f={...FRe,...e},x=t??SRe;return Ne.createElement(zFt,{initialChain:a},Ne.createElement(mOt,null,Ne.createElement(PFt,{locale:o},Ne.createElement(ORe.Provider,{value:r},Ne.createElement(xOt,{modalSize:l},Ne.createElement(ale.Provider,{value:c},Ne.createElement(fOt,null,Ne.createElement(NRe.Provider,{value:x},Ne.createElement(sT.Provider,{value:f},Ne.createElement(HRe.Provider,{value:s},Ne.createElement(WFt,null,Ne.createElement(cRt,null,u?Ne.createElement("div",{...VRe(s)},Ne.createElement("style",{dangerouslySetInnerHTML:{__html:[`${d}{${dbe("lightMode"in u?u.lightMode:u)}}`,"darkMode"in u?`@media(prefers-color-scheme:dark){${d}{${dbe(u.darkMode,{extends:u.lightMode})}}}`:null].join("")}}),n):n))))))))))))}var YOt="_9pm4ki5 ju367va ju367v15 ju367v8r",XOt="_9pm4ki3 ju367v9h ju367vb3 ju367va ju367v2q ju367v8q",hbe=(e,t)=>{const n=e.querySelectorAll("button:not(:disabled), a[href]");n.length!==0&&n[t==="end"?n.length-1:0].focus()};function QOt(e){const t=m.useRef(null);return m.useEffect(()=>{const n=document.activeElement;return()=>{var r;(r=n.focus)==null||r.call(n)}},[]),m.useEffect(()=>{if(t.current){const n=t.current.querySelector("[data-auto-focus]");n?n.focus():t.current.focus()}},[]),Ne.createElement(Ne.Fragment,null,Ne.createElement("div",{onFocus:m.useCallback(()=>t.current&&hbe(t.current,"end"),[]),tabIndex:0}),Ne.createElement("div",{ref:t,style:{outline:"none"},tabIndex:-1,...e}),Ne.createElement("div",{onFocus:m.useCallback(()=>t.current&&hbe(t.current,"start"),[]),tabIndex:0}))}var ZOt=e=>e.stopPropagation();function MR({children:e,onClose:t,open:n,titleId:r}){m.useEffect(()=>{const u=d=>n&&d.key==="Escape"&&t();return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[n,t]);const[s,a]=m.useState(!0);m.useEffect(()=>{a(getComputedStyle(window.document.body).overflow!=="hidden")},[]);const o=m.useCallback(()=>t(),[t]),l=qOt(),c=ou();return Ne.createElement(Ne.Fragment,null,n?Na.createPortal(Ne.createElement(hRe,{enabled:s},Ne.createElement(Nn,{...l},Ne.createElement(Nn,{...l,alignItems:c?"flex-end":"center","aria-labelledby":r,"aria-modal":!0,className:XOt,onClick:o,position:"fixed",role:"dialog"},Ne.createElement(QOt,{className:YOt,onClick:ZOt,role:"document"},e)))),document.body):null)}var JOt="_1ckjpok7",eMt="_1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",tMt="_1ckjpok4 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",nMt="_1ckjpok6 ju367vq",rMt="_1ckjpok3 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",sMt="_1ckjpok2 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r";function RR({bottomSheetOnMobile:e=!1,children:t,marginTop:n,padding:r="16",paddingBottom:s,wide:a=!1}){const o=ou(),c=m.useContext(j$)===aT.COMPACT;return Ne.createElement(Nn,{marginTop:n},Ne.createElement(Nn,{className:[a?o?sMt:c?tMt:rMt:eMt,o?nMt:null,o&&e?JOt:null].join(" ")},Ne.createElement(Nn,{padding:r,paddingBottom:s??r},t)))}var pbe=["k","m","b","t"];function gP(e,t=1){return e.toString().replace(new RegExp(`(.+\\.\\d{${t}})\\d+`),"$1").replace(/(\.[1-9]*)0+$/,"$1").replace(/\.$/,"")}function WRe(e){if(e<1)return gP(e,3);if(e<10**2)return gP(e,2);if(e<10**4)return new Intl.NumberFormat().format(Number.parseFloat(gP(e,1)));const t=10**1;let n=String(e);for(let r=pbe.length-1;r>=0;r--){const s=10**((r+1)*3);if(s<=e){e=e*t/s/t,n=gP(e,1)+pbe[r];break}}return n}function qRe(e){return e.length<8?e:`${e.substring(0,4)}…${e.substring(e.length-4)}`}function GRe(e){if(!e)return"";const t=e.split("."),n=t.pop();return t.join(".").length>24?`${t.join(".").substring(0,24)}...`:`${t.join(".")}.${n}`}var iMt=()=>Ne.createElement("svg",{fill:"none",height:"13",viewBox:"0 0 13 13",width:"13",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Copied"),Ne.createElement("path",{d:"M4.94568 12.2646C5.41052 12.2646 5.77283 12.0869 6.01892 11.7109L12.39 1.96973C12.5677 1.69629 12.6429 1.44336 12.6429 1.2041C12.6429 0.561523 12.1644 0.0966797 11.5082 0.0966797C11.057 0.0966797 10.7767 0.260742 10.5033 0.691406L4.9115 9.50977L2.07458 5.98926C1.82166 5.68848 1.54822 5.55176 1.16541 5.55176C0.502319 5.55176 0.0238037 6.02344 0.0238037 6.66602C0.0238037 6.95312 0.112671 7.20605 0.358765 7.48633L3.88611 11.7588C4.18005 12.1074 4.50818 12.2646 4.94568 12.2646Z",fill:"currentColor"})),aMt=()=>Ne.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Copy"),Ne.createElement("path",{d:"M3.04236 12.3027H4.18396V13.3008C4.18396 14.8525 5.03845 15.7002 6.59705 15.7002H13.6244C15.183 15.7002 16.0375 14.8525 16.0375 13.3008V6.24609C16.0375 4.69434 15.183 3.84668 13.6244 3.84668H12.4828V2.8418C12.4828 1.29688 11.6283 0.442383 10.0697 0.442383H3.04236C1.48376 0.442383 0.629272 1.29004 0.629272 2.8418V9.90332C0.629272 11.4551 1.48376 12.3027 3.04236 12.3027ZM3.23376 10.5391C2.68689 10.5391 2.39294 10.2656 2.39294 9.68457V3.06055C2.39294 2.47949 2.68689 2.21289 3.23376 2.21289H9.8783C10.4252 2.21289 10.7191 2.47949 10.7191 3.06055V3.84668H6.59705C5.03845 3.84668 4.18396 4.69434 4.18396 6.24609V10.5391H3.23376ZM6.78845 13.9365C6.24158 13.9365 5.94763 13.6699 5.94763 13.0889V6.45801C5.94763 5.87695 6.24158 5.61035 6.78845 5.61035H13.433C13.9799 5.61035 14.2738 5.87695 14.2738 6.45801V13.0889C14.2738 13.6699 13.9799 13.9365 13.433 13.9365H6.78845Z",fill:"currentColor"})),oMt=()=>Ne.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 18 16",width:"18",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Disconnect"),Ne.createElement("path",{d:"M2.67834 15.5908H9.99963C11.5514 15.5908 12.399 14.7432 12.399 13.1777V10.2656H10.6354V12.9863C10.6354 13.5332 10.3688 13.8271 9.78772 13.8271H2.89026C2.3092 13.8271 2.0426 13.5332 2.0426 12.9863V3.15625C2.0426 2.60254 2.3092 2.30859 2.89026 2.30859H9.78772C10.3688 2.30859 10.6354 2.60254 10.6354 3.15625V5.89746H12.399V2.95801C12.399 1.39941 11.5514 0.544922 9.99963 0.544922H2.67834C1.12659 0.544922 0.278931 1.39941 0.278931 2.95801V13.1777C0.278931 14.7432 1.12659 15.5908 2.67834 15.5908ZM7.43616 8.85059H14.0875L15.0924 8.78906L14.566 9.14453L13.6842 9.96484C13.5406 10.1016 13.4586 10.2861 13.4586 10.4844C13.4586 10.8398 13.7321 11.168 14.1217 11.168C14.3199 11.168 14.4635 11.0928 14.6002 10.9561L16.7809 8.68652C16.986 8.48145 17.0543 8.27637 17.0543 8.06445C17.0543 7.85254 16.986 7.64746 16.7809 7.43555L14.6002 5.17285C14.4635 5.03613 14.3199 4.9541 14.1217 4.9541C13.7321 4.9541 13.4586 5.27539 13.4586 5.6377C13.4586 5.83594 13.5406 6.02734 13.6842 6.15723L14.566 6.98438L15.0924 7.33984L14.0875 7.27148H7.43616C7.01917 7.27148 6.65686 7.62012 6.65686 8.06445C6.65686 8.50195 7.01917 8.85059 7.43616 8.85059Z",fill:"currentColor"}));function lMt(){const e=IRe(),{address:t}=Jr(),n=ile();return m.useCallback(()=>{if(!t||!n)throw new Error("No address or chain ID found");e.clearTransactions(t,n)},[e,t,n])}var KRe=e=>{var t,n;return(n=(t=e==null?void 0:e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url},YRe=()=>Ne.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Link"),Ne.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM12.7158 12.1416C13.2432 12.1416 13.5684 11.7549 13.5684 11.1836V7.19336C13.5684 6.44629 13.1377 6.05957 12.417 6.05957H8.40918C7.8291 6.05957 7.45117 6.38477 7.45117 6.91211C7.45117 7.43945 7.8291 7.77344 8.40918 7.77344H9.69238L10.7207 7.63281L9.53418 8.67871L6.73047 11.4912C6.53711 11.6758 6.41406 11.9395 6.41406 12.2031C6.41406 12.7832 6.85352 13.1699 7.39844 13.1699C7.68848 13.1699 7.92578 13.0732 8.1543 12.8623L10.9316 10.0762L11.9775 8.89844L11.8545 9.98828V11.1836C11.8545 11.7725 12.1885 12.1416 12.7158 12.1416Z",fill:"currentColor"})),cMt=()=>Ne.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Cancel"),Ne.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM7.29297 13.3018C7.58301 13.3018 7.81152 13.2139 7.99609 13.0205L10 11.0166L12.0127 13.0205C12.1973 13.2051 12.4258 13.3018 12.707 13.3018C13.2432 13.3018 13.6562 12.8887 13.6562 12.3525C13.6562 12.0977 13.5508 11.8691 13.3662 11.6934L11.3535 9.67188L13.375 7.6416C13.5596 7.44824 13.6562 7.22852 13.6562 6.98242C13.6562 6.44629 13.2432 6.0332 12.7158 6.0332C12.4346 6.0332 12.2148 6.12109 12.0215 6.31445L10 8.32715L7.9873 6.32324C7.80273 6.12988 7.58301 6.04199 7.29297 6.04199C6.76562 6.04199 6.35254 6.45508 6.35254 6.99121C6.35254 7.2373 6.44922 7.46582 6.63379 7.6416L8.65527 9.67188L6.63379 11.6934C6.44922 11.8691 6.35254 12.1064 6.35254 12.3525C6.35254 12.8887 6.76562 13.3018 7.29297 13.3018Z",fill:"currentColor"})),uMt=()=>Ne.createElement("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Success"),Ne.createElement("path",{d:"M10 19.4443C15.0977 19.4443 19.2812 15.252 19.2812 10.1543C19.2812 5.06543 15.0889 0.873047 10 0.873047C4.90234 0.873047 0.71875 5.06543 0.71875 10.1543C0.71875 15.252 4.91113 19.4443 10 19.4443ZM10 17.1328C6.1416 17.1328 3.03906 14.0215 3.03906 10.1543C3.03906 6.2959 6.13281 3.18457 10 3.18457C13.8584 3.18457 16.9697 6.2959 16.9697 10.1543C16.9785 14.0215 13.8672 17.1328 10 17.1328ZM9.07715 14.3379C9.4375 14.3379 9.7627 14.1533 9.97363 13.8369L13.7441 8.00977C13.8848 7.79883 13.9814 7.5791 13.9814 7.36816C13.9814 6.84961 13.5244 6.48926 13.0322 6.48926C12.707 6.48926 12.4258 6.66504 12.2148 7.0166L9.05957 12.0967L7.5918 10.2949C7.37207 10.0225 7.13477 9.9082 6.84473 9.9082C6.33496 9.9082 5.92188 10.3125 5.92188 10.8223C5.92188 11.0684 6.00098 11.2793 6.18555 11.5078L8.1543 13.8545C8.40918 14.1709 8.70801 14.3379 9.07715 14.3379Z",fill:"currentColor"})),dMt=e=>{switch(e){case"pending":return ZE;case"confirmed":return uMt;case"failed":return cMt;default:return ZE}};function fMt({tx:e}){const t=ou(),n=dMt(e.status),r=e.status==="failed"?"error":"accentColor",{chain:s}=Jr(),a=e.status==="confirmed"?"Confirmed":e.status==="failed"?"Failed":"Pending",o=KRe(s);return Ne.createElement(Ne.Fragment,null,Ne.createElement(Nn,{...o?{as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:iu({active:"shrink"}),href:`${o}/tx/${e.hash}`,rel:"noreferrer noopener",target:"_blank",transition:"default"}:{},color:"modalText",display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"8",width:"full"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:t?"16":"14"},Ne.createElement(Nn,{color:r},Ne.createElement(n,null)),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:t?"3":"1"},Ne.createElement(Nn,null,Ne.createElement(Ps,{color:"modalText",font:"body",size:t?"16":"14",weight:"bold"},e==null?void 0:e.description)),Ne.createElement(Nn,null,Ne.createElement(Ps,{color:e.status==="pending"?"modalTextSecondary":r,font:"body",size:"14",weight:t?"medium":"regular"},a)))),o&&Ne.createElement(Nn,{alignItems:"center",color:"modalTextDim",display:"flex"},Ne.createElement(YRe,null))))}var hMt=3;function pMt({address:e}){const t=PRe(),n=lMt(),{chain:r}=Jr(),s=KRe(r),a=t.slice(0,hMt),o=a.length>0,l=ou(),{appName:c}=m.useContext(sT),{i18n:u}=m.useContext(lc);return Ne.createElement(Ne.Fragment,null,Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"10",paddingBottom:"2",paddingTop:"16",paddingX:l?"8":"18"},o&&Ne.createElement(Nn,{paddingBottom:l?"4":"0",paddingTop:"8",paddingX:l?"12":"6"},Ne.createElement(Nn,{display:"flex",justifyContent:"space-between"},Ne.createElement(Ps,{color:"modalTextSecondary",size:l?"16":"14",weight:"semibold"},u.t("profile.transactions.recent.title")),Ne.createElement(Nn,{style:{marginBottom:-6,marginLeft:-10,marginRight:-10,marginTop:-6}},Ne.createElement(Nn,{as:"button",background:{hover:"profileForeground"},borderRadius:"actionButton",className:iu({active:"shrink"}),onClick:n,paddingX:l?"8":"12",paddingY:l?"4":"5",transition:"default",type:"button"},Ne.createElement(Ps,{color:"modalTextSecondary",size:l?"16":"14",weight:"semibold"},u.t("profile.transactions.clear.label")))))),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"4"},o?a.map(d=>Ne.createElement(fMt,{key:d.hash,tx:d})):Ne.createElement(Ne.Fragment,null,Ne.createElement(Nn,{padding:l?"12":"8"},Ne.createElement(Ps,{color:"modalTextDim",size:l?"16":"14",weight:l?"medium":"bold"},c?u.t("profile.transactions.description",{appName:c}):u.t("profile.transactions.description_fallback"))),l&&Ne.createElement(Nn,{background:"generalBorderDim",height:"1",marginX:"12",marginY:"8"})))),s&&Ne.createElement(Nn,{paddingBottom:"18",paddingX:l?"8":"18"},Ne.createElement(Nn,{alignItems:"center",as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:iu({active:"shrink"}),color:"modalTextDim",display:"flex",flexDirection:"row",href:`${s}/address/${e}`,justifyContent:"space-between",paddingX:"8",paddingY:"12",rel:"noreferrer noopener",style:{willChange:"transform"},target:"_blank",transition:"default",width:"full",...l?{paddingLeft:"12"}:{}},Ne.createElement(Ps,{color:"modalText",font:"body",size:l?"16":"14",weight:l?"semibold":"bold"},u.t("profile.explorer.label")),Ne.createElement(YRe,null))))}function mbe({action:e,icon:t,label:n,testId:r,url:s}){const a=ou();return Ne.createElement(Nn,{...s?{as:"a",href:s,rel:"noreferrer noopener",target:"_blank"}:{as:"button",type:"button"},background:{base:"profileAction",...a?{}:{hover:"profileActionHover"}},borderRadius:"menuButton",boxShadow:"profileDetailsAction",className:iu({active:"shrinkSm",hover:a?void 0:"grow"}),display:"flex",onClick:e,padding:a?"6":"8",style:{willChange:"transform"},testId:r,transition:"default",width:"full"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"1",justifyContent:"center",paddingTop:"2",width:"full"},Ne.createElement(Nn,{color:"modalText",height:"max"},t),Ne.createElement(Nn,null,Ne.createElement(Ps,{color:"modalText",size:a?"12":"13",weight:"semibold"},n))))}function mMt({address:e,ensAvatar:t,ensName:n,balance:r,onClose:s,onDisconnect:a}){const o=m.useContext(ale),[l,c]=m.useState(!1),u=m.useCallback(()=>{e&&(navigator.clipboard.writeText(e),c(!0))},[e]);if(m.useEffect(()=>{if(l){const C=setTimeout(()=>{c(!1)},1500);return()=>clearTimeout(C)}},[l]),!e)return null;const d=n?GRe(n):qRe(e),f=r==null?void 0:r.formatted,x=f?WRe(Number.parseFloat(f)):void 0,g="rk_profile_title",v=ou(),{i18n:w}=m.useContext(lc);return Ne.createElement(Ne.Fragment,null,Ne.createElement(Nn,{display:"flex",flexDirection:"column"},Ne.createElement(Nn,{background:"profileForeground",padding:"16"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:v?"16":"12",justifyContent:"center",margin:"8",style:{textAlign:"center"}},Ne.createElement(Nn,{style:{position:"absolute",right:16,top:16,willChange:"transform"}},Ne.createElement(V3,{onClose:s}))," ",Ne.createElement(Nn,{marginTop:v?"24":"0"},Ne.createElement(_Ft,{address:e,imageUrl:t,size:v?82:74})),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:v?"4":"0",textAlign:"center"},Ne.createElement(Nn,{textAlign:"center"},Ne.createElement(Ps,{as:"h1",color:"modalText",id:g,size:v?"20":"18",weight:"heavy"},d)),!!r&&Ne.createElement(Nn,{textAlign:"center"},Ne.createElement(Ps,{as:"h1",color:"modalTextSecondary",id:g,size:v?"16":"14",weight:"semibold"},x," ",r.symbol)))),Ne.createElement(Nn,{display:"flex",flexDirection:"row",gap:"8",margin:"2",marginTop:"16"},Ne.createElement(mbe,{action:u,icon:l?Ne.createElement(iMt,null):Ne.createElement(aMt,null),label:l?w.t("profile.copy_address.copied"):w.t("profile.copy_address.label")}),Ne.createElement(mbe,{action:a,icon:Ne.createElement(oMt,null),label:w.t("profile.disconnect.label"),testId:"disconnect-button"}))),o&&Ne.createElement(Ne.Fragment,null,Ne.createElement(Nn,{background:"generalBorder",height:"1",marginTop:"-1"}),Ne.createElement(Nn,null,Ne.createElement(pMt,{address:e})))))}function xMt({onClose:e,open:t}){const{address:n}=Jr(),{balance:r,ensAvatar:s,ensName:a}=_Re({address:n,includeBalance:t}),{disconnect:o}=vB();return n?Ne.createElement(Ne.Fragment,null,n&&Ne.createElement(MR,{onClose:e,open:t,titleId:"rk_account_modal_title"},Ne.createElement(RR,{bottomSheetOnMobile:!0,padding:"0"},Ne.createElement(mMt,{address:n,ensAvatar:s,ensName:a,balance:r,onClose:e,onDisconnect:o})))):null}var gMt=({size:e})=>Ne.createElement("svg",{fill:"none",height:e,viewBox:"0 0 28 28",width:e,xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Disconnect"),Ne.createElement("path",{d:"M6.742 22.195h8.367c1.774 0 2.743-.968 2.743-2.758V16.11h-2.016v3.11c0 .625-.305.96-.969.96H6.984c-.664 0-.968-.335-.968-.96V7.984c0-.632.304-.968.968-.968h7.883c.664 0 .969.336.969.968v3.133h2.016v-3.36c0-1.78-.97-2.757-2.743-2.757H6.742C4.97 5 4 5.977 4 7.758v11.68c0 1.789.969 2.757 2.742 2.757Zm5.438-7.703h7.601l1.149-.07-.602.406-1.008.938a.816.816 0 0 0-.258.593c0 .407.313.782.758.782.227 0 .39-.086.547-.243l2.492-2.593c.235-.235.313-.47.313-.711 0-.242-.078-.477-.313-.719l-2.492-2.586c-.156-.156-.32-.25-.547-.25-.445 0-.758.367-.758.781 0 .227.094.446.258.594l1.008.945.602.407-1.149-.079H12.18a.904.904 0 0 0 0 1.805Z",fill:"currentColor"})),bMt="v9horb0",dle=Ne.forwardRef(({children:e,currentlySelected:t=!1,onClick:n,testId:r,...s},a)=>{const o=ou();return Ne.createElement(Nn,{as:"button",borderRadius:"menuButton",disabled:t,display:"flex",onClick:n,ref:a,testId:r,type:"button"},Ne.createElement(Nn,{borderRadius:"menuButton",className:[o?bMt:void 0,!t&&iu({active:"shrink"})],padding:o?"8":"6",transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",borderStyle:"solid",borderWidth:"1",boxShadow:"selectedOption",color:"accentColorForeground"}:{background:{hover:"menuItemBackground"},color:"modalText",transition:"default"},...s},e))});dle.displayName="MenuButton";var yMt=({chainId:e,currentChainId:t,switchChain:n,chainIconSize:r,isLoading:s,src:a,name:o,iconBackground:l,idx:c})=>{const u=ou(),{i18n:d}=m.useContext(lc),f=$A(),x=t===e;return Ne.createElement(m.Fragment,null,Ne.createElement(dle,{currentlySelected:x,onClick:x?void 0:()=>n({chainId:e}),testId:`chain-option-${e}`},Ne.createElement(Nn,{fontFamily:"body",fontSize:"16",fontWeight:"bold"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:r},a&&Ne.createElement(Nn,{height:"full",marginRight:"8"},Ne.createElement(Ic,{alt:o,background:l,borderRadius:"full",height:r,src:a,width:r,testId:`chain-option-${e}-icon`})),Ne.createElement("div",null,o??o)),x&&Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},Ne.createElement(Ps,{color:"accentColorForeground",size:"14",weight:"medium"},d.t("chains.connected")),Ne.createElement(Nn,{background:"connectionIndicator",borderColor:"selectedOptionBorder",borderRadius:"full",borderStyle:"solid",borderWidth:"1",height:"8",marginLeft:"8",width:"8"})),s&&Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},Ne.createElement(Ps,{color:"modalText",size:"14",weight:"medium"},d.t("chains.confirm")),Ne.createElement(Nn,{background:"standby",borderRadius:"full",height:"8",marginLeft:"8",width:"8"}))))),u&&c<f.length-1&&Ne.createElement(Nn,{background:"generalBorderDim",height:"1",marginX:"8"}))},vMt=yMt,wMt="_18dqw9x0",CMt="_18dqw9x1";function SMt({onClose:e,open:t}){const{chainId:n}=Jr(),{chains:r}=Al(),[s,a]=m.useState(null),{switchChain:o}=Vie({mutation:{onMutate:({chainId:v})=>{a(v)},onSuccess:()=>{s&&a(null)},onError:()=>{s&&a(null)},onSettled:()=>{e()}}}),{i18n:l}=m.useContext(lc),{disconnect:c}=vB(),u="rk_chain_modal_title",d=ou(),f=r.some(v=>v.id===n),x=d?"36":"28",g=$A();return n?Ne.createElement(MR,{onClose:e,open:t,titleId:u},Ne.createElement(RR,{bottomSheetOnMobile:!0,paddingBottom:"0"},Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"14"},Ne.createElement(Nn,{display:"flex",flexDirection:"row",justifyContent:"space-between"},d&&Ne.createElement(Nn,{width:"30"}),Ne.createElement(Nn,{paddingBottom:"0",paddingLeft:"8",paddingTop:"4"},Ne.createElement(Ps,{as:"h1",color:"modalText",id:u,size:d?"20":"18",weight:"heavy"},l.t("chains.title"))),Ne.createElement(V3,{onClose:e})),!f&&Ne.createElement(Nn,{marginX:"8",textAlign:d?"center":"left"},Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},l.t("chains.wrong_network"))),Ne.createElement(Nn,{className:d?CMt:wMt,display:"flex",flexDirection:"column",gap:"4",padding:"2",paddingBottom:"16"},g.map(({iconBackground:v,iconUrl:w,id:C,name:N},I)=>Ne.createElement(vMt,{key:C,chainId:C,currentChainId:n,switchChain:o,chainIconSize:x,isLoading:s===C,src:w,name:N,iconBackground:v,idx:I})),!f&&Ne.createElement(Ne.Fragment,null,Ne.createElement(Nn,{background:"generalBorderDim",height:"1",marginX:"8"}),Ne.createElement(dle,{onClick:()=>c(),testId:"chain-option-disconnect"},Ne.createElement(Nn,{color:"error",fontFamily:"body",fontSize:"16",fontWeight:"bold"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:x},Ne.createElement(Nn,{alignItems:"center",color:"error",height:x,justifyContent:"center",marginRight:"8"},Ne.createElement(gMt,{size:Number(x)})),Ne.createElement("div",null,l.t("chains.disconnect"))))))))))):null}function NMt(e,t){const n={};for(const r of e){const s=t(r);s&&(n[s]||(n[s]=[]),n[s].push(r))}return n}var fle=({children:e,href:t})=>Ne.createElement(Nn,{as:"a",color:"accentColor",href:t,rel:"noreferrer",target:"_blank"},e),hle=({children:e})=>Ne.createElement(Ps,{color:"modalTextSecondary",size:"12",weight:"medium"},e);function xbe({compactModeEnabled:e=!1,getWallet:t}){const{disclaimer:n,learnMoreUrl:r}=m.useContext(sT),{i18n:s}=m.useContext(lc);return Ne.createElement(Ne.Fragment,null,Ne.createElement(Nn,{alignItems:"center",color:"accentColor",display:"flex",flexDirection:"column",height:"full",justifyContent:"space-around"},Ne.createElement(Nn,{marginBottom:"10"},!e&&Ne.createElement(Ps,{color:"modalText",size:"18",weight:"heavy"},s.t("intro.title"))),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"32",justifyContent:"center",marginY:"20",style:{maxWidth:312}},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Ne.createElement(Nn,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},Ne.createElement(ROt,null)),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"4"},Ne.createElement(Ps,{color:"modalText",size:"14",weight:"bold"},s.t("intro.digital_asset.title")),Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.digital_asset.description")))),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Ne.createElement(Nn,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},Ne.createElement(DOt,null)),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"4"},Ne.createElement(Ps,{color:"modalText",size:"14",weight:"bold"},s.t("intro.login.title")),Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.login.description"))))),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",margin:"10"},Ne.createElement(hd,{label:s.t("intro.get.label"),onClick:t}),Ne.createElement(Nn,{as:"a",className:iu({active:"shrink",hover:"grow"}),display:"block",href:r,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ne.createElement(Ps,{color:"accentColor",size:"14",weight:"bold"},s.t("intro.learn_more.label")))),n&&!e&&Ne.createElement(Nn,{marginBottom:"8",marginTop:"12",textAlign:"center"},Ne.createElement(n,{Link:fle,Text:hle}))))}var XRe=()=>Ne.createElement("svg",{fill:"none",height:"17",viewBox:"0 0 11 17",width:"11",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Back"),Ne.createElement("path",{d:"M0.99707 8.6543C0.99707 9.08496 1.15527 9.44531 1.51562 9.79688L8.16016 16.3096C8.43262 16.5732 8.74902 16.7051 9.13574 16.7051C9.90918 16.7051 10.5508 16.0811 10.5508 15.3076C10.5508 14.9121 10.3838 14.5605 10.0938 14.2705L4.30176 8.64551L10.0938 3.0293C10.3838 2.74805 10.5508 2.3877 10.5508 2.00098C10.5508 1.23633 9.90918 0.603516 9.13574 0.603516C8.74902 0.603516 8.43262 0.735352 8.16016 0.999023L1.51562 7.51172C1.15527 7.85449 1.00586 8.21484 0.99707 8.6543Z",fill:"currentColor"})),AMt=()=>Ne.createElement("svg",{fill:"none",height:"12",viewBox:"0 0 8 12",width:"8",xmlns:"http://www.w3.org/2000/svg"},Ne.createElement("title",null,"Info"),Ne.createElement("path",{d:"M3.64258 7.99609C4.19336 7.99609 4.5625 7.73828 4.68555 7.24609C4.69141 7.21094 4.70312 7.16406 4.70898 7.13477C4.80859 6.60742 5.05469 6.35547 6.04492 5.76367C7.14648 5.10156 7.67969 4.3457 7.67969 3.24414C7.67969 1.39844 6.17383 0.255859 3.95898 0.255859C2.32422 0.255859 1.05859 0.894531 0.548828 1.86719C0.396484 2.14844 0.320312 2.44727 0.320312 2.74023C0.314453 3.37305 0.742188 3.79492 1.42188 3.79492C1.91406 3.79492 2.33594 3.54883 2.53516 3.11523C2.78711 2.47656 3.23242 2.21289 3.83594 2.21289C4.55664 2.21289 5.10742 2.65234 5.10742 3.29102C5.10742 3.9707 4.7793 4.29883 3.81836 4.87891C3.02148 5.36523 2.50586 5.92773 2.50586 6.76562V6.90039C2.50586 7.55664 2.96289 7.99609 3.64258 7.99609ZM3.67188 11.4473C4.42773 11.4473 5.04297 10.8672 5.04297 10.1406C5.04297 9.41406 4.42773 8.83984 3.67188 8.83984C2.91602 8.83984 2.30664 9.41406 2.30664 10.1406C2.30664 10.8672 2.91602 11.4473 3.67188 11.4473Z",fill:"currentColor"})),jMt=({"aria-label":e="Info",onClick:t})=>{const n=ou();return Ne.createElement(Nn,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:iu({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},Ne.createElement(AMt,null))},QRe=e=>{const t=m.useRef(null),n=m.useContext(ORe),r=rle(e);return m.useEffect(()=>{if(n&&t.current&&r)return _Mt(t.current,r)},[n,r]),t},EMt=()=>{const e="_rk_coolMode",t=document.getElementById(e);if(t)return t;const n=document.createElement("div");return n.setAttribute("id",e),n.setAttribute("style",["overflow:hidden","position:fixed","height:100%","top:0","left:0","right:0","bottom:0","pointer-events:none","z-index:2147483647"].join(";")),document.body.appendChild(n),n},gbe=0;function _Mt(e,t){gbe++;const n=[15,20,25,35,45],r=35;let s=[],a=!1,o=0,l=0;const c=EMt();function u(){const R=n[Math.floor(Math.random()*n.length)],F=Math.random()*10,U=Math.random()*25,L=Math.random()*360,z=Math.random()*35*(Math.random()<=.5?-1:1),Q=l-R/2,ne=o-R/2,J=Math.random()<=.5?-1:1,X=document.createElement("div");X.innerHTML=`<img src="${t}" width="${R}" height="${R}" style="border-radius: 25%">`,X.setAttribute("style",["position:absolute","will-change:transform",`top:${Q}px`,`left:${ne}px`,`transform:rotate(${L}deg)`].join(";")),c.appendChild(X),s.push({direction:J,element:X,left:ne,size:R,speedHorz:F,speedUp:U,spinSpeed:z,spinVal:L,top:Q})}function d(){for(const R of s)R.left=R.left-R.speedHorz*R.direction,R.top=R.top-R.speedUp,R.speedUp=Math.min(R.size,R.speedUp-1),R.spinVal=R.spinVal+R.spinSpeed,R.top>=Math.max(window.innerHeight,document.body.clientHeight)+R.size&&(s=s.filter(F=>F!==R),R.element.remove()),R.element.setAttribute("style",["position:absolute","will-change:transform",`top:${R.top}px`,`left:${R.left}px`,`transform:rotate(${R.spinVal}deg)`].join(";"))}let f;function x(){a&&s.length<r&&u(),d(),f=requestAnimationFrame(x)}x();const g="ontouchstart"in window||navigator.msMaxTouchPoints,v=g?"touchstart":"mousedown",w=g?"touchend":"mouseup",C=g?"touchmove":"mousemove",N=R=>{var F,U;"touches"in R?(o=(F=R.touches)==null?void 0:F[0].clientX,l=(U=R.touches)==null?void 0:U[0].clientY):(o=R.clientX,l=R.clientY)},I=R=>{N(R),a=!0},P=()=>{a=!1};return e.addEventListener(C,N,{passive:!1}),e.addEventListener(v,I),e.addEventListener(w,P),e.addEventListener("mouseleave",P),()=>{e.removeEventListener(C,N),e.removeEventListener(v,I),e.removeEventListener(w,P),e.removeEventListener("mouseleave",P);const R=setInterval(()=>{f&&s.length===0&&(cancelAnimationFrame(f),clearInterval(R),--gbe===0&&c.remove())},500)}}var kMt="g5kl0l0",ZRe=({as:e="button",currentlySelected:t=!1,iconBackground:n,iconUrl:r,name:s,onClick:a,ready:o,recent:l,testId:c,isRainbowKitConnector:u,...d})=>{const f=QRe(r),[x,g]=Ne.useState(!1),{i18n:v}=Ne.useContext(lc);return Ne.createElement(Nn,{display:"flex",flexDirection:"column",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),ref:f},Ne.createElement(Nn,{as:e,borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:t?void 0:[kMt,iu({active:"shrink"})],disabled:t,onClick:a,padding:"5",style:{willChange:"transform"},testId:c,transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",boxShadow:"selectedWallet"}:{background:{hover:"menuItemBackground"}},...d},Ne.createElement(Nn,{color:t?"accentColorForeground":"modalText",disabled:!o,fontFamily:"body",fontSize:"16",fontWeight:"bold",transition:"default"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"12"},Ne.createElement(Ic,{background:n,...!x&&u?{borderColor:"actionButtonBorder"}:{},useAsImage:!u,borderRadius:"6",height:"28",src:r,width:"28"}),Ne.createElement(Nn,null,Ne.createElement(Nn,{style:{marginTop:l?-2:void 0},maxWidth:"200"},s),l&&Ne.createElement(Ps,{color:t?"accentColorForeground":"accentColor",size:"12",style:{lineHeight:1,marginTop:-1},weight:"medium"},v.t("connect.recent")))))))};ZRe.displayName="ModalSelection";var TMt="rk-latest-id";function IMt(e){localStorage.setItem(TMt,e)}var lW=(e,t=1)=>{let n=e.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=Number.parseInt(n.substring(0,2),16),s=Number.parseInt(n.substring(2,4),16),a=Number.parseInt(n.substring(4,6),16);return t>1&&t<=100&&(t=t/100),`rgba(${r},${s},${a},${t})`},PMt=e=>e?[lW(e,.2),lW(e,.14),lW(e,.1)]:null,FMt=e=>/^#([0-9a-f]{3}){1,2}$/i.test(e),JRe=async()=>(await ss(async()=>{const{default:e}=await import("./connect-MR6XDLIE-BET5HMNk.js");return{default:e}},[])).default,OMt=()=>sx(JRe),MMt=()=>Ne.createElement(Ic,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:JRe,width:"48"}),eLe=async()=>(await ss(async()=>{const{default:e}=await import("./create-X4WFHLCW-De9pC3ym.js");return{default:e}},[])).default,tLe=()=>sx(eLe),RMt=()=>Ne.createElement(Ic,{background:"#e3a5e8",borderColor:"generalBorder",borderRadius:"10",height:"48",src:eLe,width:"48"}),nLe=async()=>(await ss(async()=>{const{default:e}=await import("./refresh-HJGJRASX-D0rkc63_.js");return{default:e}},[])).default,LMt=()=>sx(nLe),DMt=()=>Ne.createElement(Ic,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:nLe,width:"48"}),rLe=async()=>(await ss(async()=>{const{default:e}=await import("./scan-DEOT2M37-1-mJ5OyF.js");return{default:e}},[])).default,sLe=()=>sx(rLe),BMt=()=>Ne.createElement(Ic,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:rLe,width:"48"}),$Mt="_1vwt0cg0",UMt="_1vwt0cg2 ju367v7a ju367v7v",zMt="_1vwt0cg3",HMt="_1vwt0cg4",VMt=(e,t)=>{const n=Array.prototype.slice.call(oFt.create(e,{errorCorrectionLevel:t}).modules.data,0),r=Math.sqrt(n.length);return n.reduce((s,a,o)=>(o%r===0?s.push([a]):s[s.length-1].push(a))&&s,[])};function iLe({ecl:e="M",logoBackground:t,logoMargin:n=10,logoSize:r=50,logoUrl:s,size:a=200,uri:o}){const l="20",c=a-Number.parseInt(l,10)*2,u=m.useMemo(()=>{const x=[],g=VMt(o,e),v=c/g.length;[{x:0,y:0},{x:1,y:0},{x:0,y:1}].forEach(({x:P,y:R})=>{const F=(g.length-7)*v*P,U=(g.length-7)*v*R;for(let L=0;L<3;L++)x.push(Ne.createElement("rect",{fill:L%2!==0?"white":"black",height:v*(7-L*2),key:`${L}-${P}-${R}`,rx:(L-2)*-5+(L===0?2:0),ry:(L-2)*-5+(L===0?2:0),width:v*(7-L*2),x:F+v*L,y:U+v*L}))});const C=Math.floor((r+25)/v),N=g.length/2-C/2,I=g.length/2+C/2-1;return g.forEach((P,R)=>{P.forEach((F,U)=>{g[R][U]&&(R<7&&U<7||R>g.length-8&&U<7||R<7&&U>g.length-8||R>N&&R<I&&U>N&&U<I||x.push(Ne.createElement("circle",{cx:R*v+v/2,cy:U*v+v/2,fill:"black",key:`circle-${R}-${U}`,r:v/3})))})}),x},[e,r,c,o]),d=c/2-r/2,f=r+n*2;return Ne.createElement(Nn,{borderColor:"generalBorder",borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:$Mt,padding:l,width:"max"},Ne.createElement(Nn,{style:{height:c,userSelect:"none",width:c},userSelect:"none"},Ne.createElement(Nn,{display:"flex",justifyContent:"center",position:"relative",style:{height:0,top:d,width:c},width:"full"},Ne.createElement(Ic,{background:t,borderColor:{custom:"rgba(0, 0, 0, 0.06)"},borderRadius:"13",height:r,src:s,width:r})),Ne.createElement("svg",{height:c,style:{all:"revert"},width:c},Ne.createElement("title",null,"QR Code"),Ne.createElement("defs",null,Ne.createElement("clipPath",{id:"clip-wrapper"},Ne.createElement("rect",{height:f,width:f})),Ne.createElement("clipPath",{id:"clip-logo"},Ne.createElement("rect",{height:r,width:r}))),Ne.createElement("rect",{fill:"transparent",height:c,width:c}),u)))}var aLe=async()=>{switch(lle()){case"Arc":return(await ss(async()=>{const{default:t}=await import("./Arc-R3PUWRPJ-CUdEQO8X.js");return{default:t}},[])).default;case"Brave":return(await ss(async()=>{const{default:t}=await import("./Brave-24BM36UM-C6C5mkTK.js");return{default:t}},[])).default;case"Chrome":return(await ss(async()=>{const{default:t}=await import("./Chrome-TLI42HDP-BgiVz-ma.js");return{default:t}},[])).default;case"Edge":return(await ss(async()=>{const{default:t}=await import("./Edge-AZ34LAFM-EBh9cG_z.js");return{default:t}},[])).default;case"Firefox":return(await ss(async()=>{const{default:t}=await import("./Firefox-ZDK7RHKK-5nyhB0sj.js");return{default:t}},[])).default;case"Opera":return(await ss(async()=>{const{default:t}=await import("./Opera-BKMCKUXC-CCypmVaM.js");return{default:t}},[])).default;case"Safari":return(await ss(async()=>{const{default:t}=await import("./Safari-PXQIVS6N-B-Lfxb9r.js");return{default:t}},[])).default;default:return(await ss(async()=>{const{default:t}=await import("./Browser-4R4QKTV2-D3ON1q-S.js");return{default:t}},[])).default}},WMt=()=>sx(aLe),oLe=async()=>{switch(ule()){case"Windows":return(await ss(async()=>{const{default:t}=await import("./Windows-GTAT3OTE-K9Pt3pUF.js");return{default:t}},[])).default;case"macOS":return(await ss(async()=>{const{default:t}=await import("./Macos-5QL4JBJE-DLNYPiln.js");return{default:t}},[])).default;case"Linux":return(await ss(async()=>{const{default:t}=await import("./Linux-VYP66PDO--MOvpQUa.js");return{default:t}},[])).default;default:return(await ss(async()=>{const{default:t}=await import("./Linux-VYP66PDO--MOvpQUa.js");return{default:t}},[])).default}},qMt=()=>sx(oLe);function GMt({getWalletDownload:e,compactModeEnabled:t}){const r=JE().filter(a=>a.isRainbowKitConnector).splice(0,5),{i18n:s}=m.useContext(lc);return Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginTop:"18",width:"full"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"28",height:"full",width:"full"},r==null?void 0:r.filter(a=>{var o;return a.extensionDownloadUrl||a.desktopDownloadUrl||a.qrCode&&((o=a.downloadUrls)==null?void 0:o.qrCode)}).map(a=>{const{downloadUrls:o,iconBackground:l,iconUrl:c,id:u,name:d,qrCode:f}=a,x=(o==null?void 0:o.qrCode)&&f,g=!!a.extensionDownloadUrl,v=(o==null?void 0:o.qrCode)&&g,w=(o==null?void 0:o.qrCode)&&!!a.desktopDownloadUrl;return Ne.createElement(Nn,{alignItems:"center",display:"flex",gap:"16",justifyContent:"space-between",key:a.id,width:"full"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Ne.createElement(Ic,{background:l,borderColor:"actionButtonBorder",borderRadius:"10",height:"48",src:c,width:"48"}),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"2"},Ne.createElement(Ps,{color:"modalText",size:"14",weight:"bold"},d),Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},v?s.t("get.mobile_and_extension.description"):w?s.t("get.mobile_and_desktop.description"):x?s.t("get.mobile.description"):g?s.t("get.extension.description"):null))),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"4"},Ne.createElement(hd,{label:s.t("get.action.label"),onClick:()=>e(u),type:"secondary"})))})),Ne.createElement(Nn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"column",gap:"8",justifyContent:"space-between",marginBottom:"4",paddingY:"8",style:{maxWidth:275,textAlign:"center"}},Ne.createElement(Ps,{color:"modalText",size:"14",weight:"bold"},s.t("get.looking_for.title")),Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},t?s.t("get.looking_for.desktop.compact_description"):s.t("get.looking_for.desktop.wide_description"))))}var cW="44";function KMt({changeWalletStep:e,compactModeEnabled:t,connectionError:n,onClose:r,qrCodeUri:s,reconnect:a,wallet:o}){const{downloadUrls:l,iconBackground:c,iconUrl:u,name:d,qrCode:f,ready:x,showWalletConnectModal:g,getDesktopUri:v}=o,w=!!v,C=ole(),{i18n:N}=m.useContext(lc),I=!!o.extensionDownloadUrl,P=(l==null?void 0:l.qrCode)&&I,R=(l==null?void 0:l.qrCode)&&!!o.desktopDownloadUrl,F=f&&s,U=async()=>{const ne=await(v==null?void 0:v());window.open(ne,C?"_blank":"_self")},L=g?{description:t?N.t("connect.walletconnect.description.compact"):N.t("connect.walletconnect.description.full"),label:N.t("connect.walletconnect.open.label"),onClick:()=>{r(),g()}}:F?{description:N.t("connect.secondary_action.get.description",{wallet:d}),label:N.t("connect.secondary_action.get.label"),onClick:()=>e(P||R?"DOWNLOAD_OPTIONS":"DOWNLOAD")}:null,{width:z}=MRe(),Q=z&&z<768;return m.useEffect(()=>{WMt(),qMt()},[]),Ne.createElement(Nn,{display:"flex",flexDirection:"column",height:"full",width:"full"},F?Ne.createElement(Nn,{alignItems:"center",display:"flex",height:"full",justifyContent:"center"},Ne.createElement(iLe,{logoBackground:c,logoSize:t?60:72,logoUrl:u,size:t?318:Q?Math.max(280,Math.min(z-308,382)):382,uri:s})):Ne.createElement(Nn,{alignItems:"center",display:"flex",justifyContent:"center",style:{flexGrow:1}},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8"},Ne.createElement(Nn,{borderRadius:"10",height:cW,overflow:"hidden"},Ne.createElement(Ic,{useAsImage:!o.isRainbowKitConnector,height:cW,src:u,width:cW})),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"4",paddingX:"32",style:{textAlign:"center"}},Ne.createElement(Ps,{color:"modalText",size:"18",weight:"bold"},x?N.t("connect.status.opening",{wallet:d}):I?N.t("connect.status.not_installed",{wallet:d}):N.t("connect.status.not_available",{wallet:d})),!x&&I?Ne.createElement(Nn,{paddingTop:"20"},Ne.createElement(hd,{href:o.extensionDownloadUrl,label:N.t("connect.secondary_action.install.label"),type:"secondary"})):null,x&&!F&&Ne.createElement(Ne.Fragment,null,Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",textAlign:"center",weight:"medium"},N.t("connect.status.confirm"))),Ne.createElement(Nn,{alignItems:"center",color:"modalText",display:"flex",flexDirection:"row",height:"32",marginTop:"8"},n?Ne.createElement(hd,{label:N.t("connect.secondary_action.retry.label"),onClick:async()=>{w&&U(),a(o)}}):Ne.createElement(Nn,{color:"modalTextSecondary"},Ne.createElement(ZE,null))))))),Ne.createElement(Nn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"28",justifyContent:"space-between",marginTop:"12"},x&&L&&Ne.createElement(Ne.Fragment,null,Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},L.description),Ne.createElement(hd,{label:L.label,onClick:L.onClick,type:"secondary"}))))}var uW=({actionLabel:e,description:t,iconAccent:n,iconBackground:r,iconUrl:s,isCompact:a,onAction:o,title:l,url:c,variant:u})=>{const d=u==="browser",f=!d&&n&&PMt(n);return Ne.createElement(Nn,{alignItems:"center",borderRadius:"13",display:"flex",justifyContent:"center",overflow:"hidden",paddingX:a?"18":"44",position:"relative",style:{flex:1,isolation:"isolate"},width:"full"},Ne.createElement(Nn,{borderColor:"actionButtonBorder",borderRadius:"13",borderStyle:"solid",borderWidth:"1",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1}}),d&&Ne.createElement(Nn,{background:"downloadTopCardBackground",height:"full",position:"absolute",style:{zIndex:0},width:"full"},Ne.createElement(Nn,{display:"flex",flexDirection:"row",justifyContent:"space-between",style:{bottom:"0",filter:"blur(20px)",left:"0",position:"absolute",right:"0",top:"0",transform:"translate3d(0, 0, 0)"}},Ne.createElement(Nn,{style:{filter:"blur(100px)",marginLeft:-27,marginTop:-20,opacity:.6,transform:"translate3d(0, 0, 0)"}},Ne.createElement(Ic,{borderRadius:"full",height:"200",src:s,width:"200"})),Ne.createElement(Nn,{style:{filter:"blur(100px)",marginRight:0,marginTop:105,opacity:.6,overflow:"auto",transform:"translate3d(0, 0, 0)"}},Ne.createElement(Ic,{borderRadius:"full",height:"200",src:s,width:"200"})))),!d&&f&&Ne.createElement(Nn,{background:"downloadBottomCardBackground",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0"}},Ne.createElement(Nn,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${f[0]} 0%, ${f[1]} 25%, rgba(0,0,0,0) 100%)`,height:564,left:-215,top:-197,transform:"translate3d(0, 0, 0)",width:564}}),Ne.createElement(Nn,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${f[2]} 0%, rgba(0, 0, 0, 0) 100%)`,height:564,left:-1,top:-76,transform:"translate3d(0, 0, 0)",width:564}})),Ne.createElement(Nn,{alignItems:"flex-start",display:"flex",flexDirection:"row",gap:"24",height:"max",justifyContent:"center",style:{zIndex:1}},Ne.createElement(Nn,null,Ne.createElement(Ic,{height:"60",src:s,width:"60",...r?{background:r,borderColor:"generalBorder",borderRadius:"10"}:null})),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"4",style:{flex:1},width:"full"},Ne.createElement(Ps,{color:"modalText",size:"14",weight:"bold"},l),Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},t),Ne.createElement(Nn,{marginTop:"14",width:"max"},Ne.createElement(hd,{href:c,label:e,onClick:o,size:"medium"})))))};function YMt({changeWalletStep:e,wallet:t}){const n=lle(),r=ule(),a=m.useContext(j$)==="compact",{desktop:o,desktopDownloadUrl:l,extension:c,extensionDownloadUrl:u,mobileDownloadUrl:d}=t,{i18n:f}=m.useContext(lc);return m.useEffect(()=>{tLe(),sLe(),LMt(),OMt()},[]),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",marginBottom:"8",marginTop:"4",width:"full"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8",height:"full",justifyContent:"center",width:"full"},u&&Ne.createElement(uW,{actionLabel:f.t("get_options.extension.download.label",{browser:n}),description:f.t("get_options.extension.description"),iconUrl:aLe,isCompact:a,onAction:()=>e(c!=null&&c.instructions?"INSTRUCTIONS_EXTENSION":"CONNECT"),title:f.t("get_options.extension.title",{wallet:t.name,browser:n}),url:u,variant:"browser"}),l&&Ne.createElement(uW,{actionLabel:f.t("get_options.desktop.download.label",{platform:r}),description:f.t("get_options.desktop.description"),iconUrl:oLe,isCompact:a,onAction:()=>e(o!=null&&o.instructions?"INSTRUCTIONS_DESKTOP":"CONNECT"),title:f.t("get_options.desktop.title",{wallet:t.name,platform:r}),url:l,variant:"desktop"}),d&&Ne.createElement(uW,{actionLabel:f.t("get_options.mobile.download.label",{wallet:t.name}),description:f.t("get_options.mobile.description"),iconAccent:t.iconAccent,iconBackground:t.iconBackground,iconUrl:t.iconUrl,isCompact:a,onAction:()=>{e("DOWNLOAD")},title:f.t("get_options.mobile.title",{wallet:t.name}),variant:"app"})))}function XMt({changeWalletStep:e,wallet:t}){const{downloadUrls:n,qrCode:r}=t,{i18n:s}=m.useContext(lc);return m.useEffect(()=>{tLe(),sLe()},[]),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",width:"full"},Ne.createElement(Nn,{style:{maxWidth:220,textAlign:"center"}},Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"semibold"},s.t("get_mobile.description"))),Ne.createElement(Nn,{height:"full"},n!=null&&n.qrCode?Ne.createElement(iLe,{logoSize:0,size:268,uri:n.qrCode}):null),Ne.createElement(Nn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"34",justifyContent:"space-between",marginBottom:"12",paddingY:"8"},Ne.createElement(hd,{label:s.t("get_mobile.continue.label"),onClick:()=>e(r!=null&&r.instructions?"INSTRUCTIONS_MOBILE":"CONNECT")})))}var Gg={connect:()=>Ne.createElement(MMt,null),create:()=>Ne.createElement(RMt,null),install:e=>Ne.createElement(Ic,{background:e.iconBackground,borderColor:"generalBorder",borderRadius:"10",height:"48",src:e.iconUrl,width:"48"}),refresh:()=>Ne.createElement(DMt,null),scan:()=>Ne.createElement(BMt,null)};function QMt({connectWallet:e,wallet:t}){var r,s,a,o;const{i18n:n}=m.useContext(lc);return Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(s=(r=t==null?void 0:t.qrCode)==null?void 0:r.instructions)==null?void 0:s.steps.map((l,c)=>{var u;return Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c},Ne.createElement(Nn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(u=Gg[l.step])==null?void 0:u.call(Gg,t)),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"4"},Ne.createElement(Ps,{color:"modalText",size:"14",weight:"bold"},n.t(l.title,void 0,{rawKeyIfTranslationMissing:!0})),Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(l.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Ne.createElement(hd,{label:n.t("get_instructions.mobile.connect.label"),onClick:()=>e(t)}),Ne.createElement(Nn,{as:"a",className:iu({active:"shrink",hover:"grow"}),display:"block",href:(o=(a=t==null?void 0:t.qrCode)==null?void 0:a.instructions)==null?void 0:o.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ne.createElement(Ps,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.mobile.learn_more.label")))))}function ZMt({wallet:e}){var n,r,s,a;const{i18n:t}=m.useContext(lc);return Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(r=(n=e==null?void 0:e.extension)==null?void 0:n.instructions)==null?void 0:r.steps.map((o,l)=>{var c;return Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:l},Ne.createElement(Nn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(c=Gg[o.step])==null?void 0:c.call(Gg,e)),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"4"},Ne.createElement(Ps,{color:"modalText",size:"14",weight:"bold"},t.t(o.title,void 0,{rawKeyIfTranslationMissing:!0})),Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},t.t(o.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Ne.createElement(hd,{label:t.t("get_instructions.extension.refresh.label"),onClick:window.location.reload.bind(window.location)}),Ne.createElement(Nn,{as:"a",className:iu({active:"shrink",hover:"grow"}),display:"block",href:(a=(s=e==null?void 0:e.extension)==null?void 0:s.instructions)==null?void 0:a.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ne.createElement(Ps,{color:"accentColor",size:"14",weight:"bold"},t.t("get_instructions.extension.learn_more.label")))))}function JMt({connectWallet:e,wallet:t}){var r,s,a,o;const{i18n:n}=m.useContext(lc);return Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(s=(r=t==null?void 0:t.desktop)==null?void 0:r.instructions)==null?void 0:s.steps.map((l,c)=>{var u;return Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c},Ne.createElement(Nn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(u=Gg[l.step])==null?void 0:u.call(Gg,t)),Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"4"},Ne.createElement(Ps,{color:"modalText",size:"14",weight:"bold"},n.t(l.title,void 0,{rawKeyIfTranslationMissing:!0})),Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(l.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Ne.createElement(hd,{label:n.t("get_instructions.desktop.connect.label"),onClick:()=>e(t)}),Ne.createElement(Nn,{as:"a",className:iu({active:"shrink",hover:"grow"}),display:"block",href:(o=(a=t==null?void 0:t.desktop)==null?void 0:a.instructions)==null?void 0:o.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ne.createElement(Ps,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.desktop.learn_more.label")))))}function eRt({onClose:e}){const t="rk_connect_title",[n,r]=m.useState(),[s,a]=m.useState(),[o,l]=m.useState(),c=!!(s!=null&&s.qrCode)&&o,[u,d]=m.useState(!1),x=m.useContext(j$)===aT.COMPACT,{disclaimer:g}=m.useContext(sT),{i18n:v}=m.useContext(lc),w=ole(),C=m.useRef(!1),{connector:N}=m.useContext(iT),P=JE(!N).filter(ce=>ce.ready||!!ce.extensionDownloadUrl).sort((ce,ge)=>ce.groupIndex-ge.groupIndex),R=JE(),F=NMt(P,ce=>ce.groupName),U=["Recommended","Other","Popular","More","Others","Installed"];m.useEffect(()=>{N&&!C.current&&(re("CONNECT"),ne(N),C.current=!0)},[N]);const L=ce=>{var ge,Ae;d(!1),ce.ready&&((Ae=(ge=ce==null?void 0:ce.connect)==null?void 0:ge.call(ce))==null||Ae.catch(()=>{d(!0)}))},z=async ce=>{const ge=P.find(Ae=>ce.id===Ae.id);ge!=null&&ge.getDesktopUri&&setTimeout(async()=>{var ye;const Ae=await((ye=ge==null?void 0:ge.getDesktopUri)==null?void 0:ye.call(ge));Ae&&window.open(Ae,w?"_blank":"_self")},0)},Q=async ce=>{var ye;const ge=P.find(je=>ce.id===je.id),Ae=await((ye=ge==null?void 0:ge.getQrCodeUri)==null?void 0:ye.call(ge));l(Ae),setTimeout(()=>{a(ge),re("CONNECT")},Ae?0:50)},ne=async ce=>{IMt(ce.id),ce.ready&&(Q(ce),z(ce)),L(ce),r(ce.id),ce.ready||(a(ce),re(ce!=null&&ce.extensionDownloadUrl?"DOWNLOAD_OPTIONS":"CONNECT"))},J=ce=>{var Ie;const ge=R.find(Re=>ce===Re.id),Ae=(Ie=ge==null?void 0:ge.downloadUrls)==null?void 0:Ie.qrCode,ye=!!(ge!=null&&ge.desktopDownloadUrl),je=!!(ge!=null&&ge.extensionDownloadUrl);a(ge),re(Ae&&(je||ye)?"DOWNLOAD_OPTIONS":Ae?"DOWNLOAD":ye?"INSTRUCTIONS_DESKTOP":"INSTRUCTIONS_EXTENSION")},X=()=>{r(void 0),a(void 0),l(void 0)},re=(ce,ge=!1)=>{ge&&ce==="GET"&&pe==="GET"?X():!ge&&ce==="GET"?Y("GET"):!ge&&ce==="CONNECT"&&Y("CONNECT"),oe(ce)},[pe,Y]=m.useState("NONE"),[ie,oe]=m.useState("NONE");let G=null,V=null,te=null,ae;m.useEffect(()=>{d(!1)},[ie,s]);const Ce=!!(!!(s!=null&&s.extensionDownloadUrl)&&(s!=null&&s.mobileDownloadUrl));switch(ie){case"NONE":G=Ne.createElement(xbe,{getWallet:()=>re("GET")});break;case"LEARN_COMPACT":G=Ne.createElement(xbe,{compactModeEnabled:x,getWallet:()=>re("GET")}),V=v.t("intro.title"),te="NONE";break;case"GET":G=Ne.createElement(GMt,{getWalletDownload:J,compactModeEnabled:x}),V=v.t("get.title"),te=x?"LEARN_COMPACT":"NONE";break;case"CONNECT":G=s&&Ne.createElement(KMt,{changeWalletStep:re,compactModeEnabled:x,connectionError:u,onClose:e,qrCodeUri:o,reconnect:L,wallet:s}),V=c&&(s.name==="WalletConnect"?v.t("connect_scan.fallback_title"):v.t("connect_scan.title",{wallet:s.name})),te=x?N?null:"NONE":null,ae=x?N?()=>{}:X:()=>{};break;case"DOWNLOAD_OPTIONS":G=s&&Ne.createElement(YMt,{changeWalletStep:re,wallet:s}),V=s&&v.t("get_options.short_title",{wallet:s.name}),te=N?"CONNECT":x?"NONE":pe;break;case"DOWNLOAD":G=s&&Ne.createElement(XMt,{changeWalletStep:re,wallet:s}),V=s&&v.t("get_mobile.title",{wallet:s.name}),te=Ce?"DOWNLOAD_OPTIONS":pe;break;case"INSTRUCTIONS_MOBILE":G=s&&Ne.createElement(QMt,{connectWallet:ne,wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),te="DOWNLOAD";break;case"INSTRUCTIONS_EXTENSION":G=s&&Ne.createElement(ZMt,{wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),te="DOWNLOAD_OPTIONS";break;case"INSTRUCTIONS_DESKTOP":G=s&&Ne.createElement(JMt,{connectWallet:ne,wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),te="DOWNLOAD_OPTIONS";break}return Ne.createElement(Nn,{display:"flex",flexDirection:"row",style:{maxHeight:x?468:504}},(x?ie==="NONE":!0)&&Ne.createElement(Nn,{className:x?HMt:zMt,display:"flex",flexDirection:"column",marginTop:"16"},Ne.createElement(Nn,{display:"flex",justifyContent:"space-between"},x&&g&&Ne.createElement(Nn,{marginLeft:"16",width:"28"},Ne.createElement(jMt,{onClick:()=>re("LEARN_COMPACT")})),x&&!g&&Ne.createElement(Nn,{marginLeft:"16",width:"28"}),Ne.createElement(Nn,{marginLeft:x?"0":"6",paddingBottom:"8",paddingTop:"2",paddingX:"18"},Ne.createElement(Ps,{as:"h1",color:"modalText",id:t,size:"18",weight:"heavy",testId:"connect-header-label"},v.t("connect.title"))),x&&Ne.createElement(Nn,{marginRight:"16"},Ne.createElement(V3,{onClose:e}))),Ne.createElement(Nn,{className:UMt,paddingBottom:"18"},Object.entries(F).map(([ce,ge],Ae)=>ge.length>0&&Ne.createElement(m.Fragment,{key:Ae},ce?Ne.createElement(Nn,{marginBottom:"8",marginTop:"16",marginX:"6"},Ne.createElement(Ps,{color:ce==="Installed"?"accentColor":"modalTextSecondary",size:"14",weight:"bold"},U.includes(ce)?v.t(`connector_group.${ce.toLowerCase()}`):ce)):null,Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"4"},ge.map(ye=>Ne.createElement(ZRe,{currentlySelected:ye.id===n,iconBackground:ye.iconBackground,iconUrl:ye.iconUrl,key:ye.id,name:ye.name,onClick:()=>ne(ye),ready:ye.ready,recent:ye.recent,testId:`wallet-option-${ye.id}`,isRainbowKitConnector:ye.isRainbowKitConnector})))))),x&&Ne.createElement(Ne.Fragment,null,Ne.createElement(Nn,{background:"generalBorder",height:"1",marginTop:"-1"}),g?Ne.createElement(Nn,{paddingX:"24",paddingY:"16",textAlign:"center"},Ne.createElement(g,{Link:fle,Text:hle})):Ne.createElement(Nn,{alignItems:"center",display:"flex",justifyContent:"space-between",paddingX:"24",paddingY:"16"},Ne.createElement(Nn,{paddingY:"4"},Ne.createElement(Ps,{color:"modalTextSecondary",size:"14",weight:"medium"},v.t("connect.new_to_ethereum.description"))),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",justifyContent:"center"},Ne.createElement(Nn,{className:iu({active:"shrink",hover:"grow"}),cursor:"pointer",onClick:()=>re("LEARN_COMPACT"),paddingY:"4",style:{willChange:"transform"},transition:"default"},Ne.createElement(Ps,{color:"accentColor",size:"14",weight:"bold"},v.t("connect.new_to_ethereum.learn_more.label"))))))),(x?ie!=="NONE":!0)&&Ne.createElement(Ne.Fragment,null,!x&&Ne.createElement(Nn,{background:"generalBorder",minWidth:"1",width:"1"}),Ne.createElement(Nn,{display:"flex",flexDirection:"column",margin:"16",style:{flexGrow:1}},Ne.createElement(Nn,{alignItems:"center",display:"flex",justifyContent:"space-between",marginBottom:"12"},Ne.createElement(Nn,{width:"28"},te&&Ne.createElement(Nn,{as:"button",className:iu({active:"shrinkSm",hover:"growLg"}),color:"accentColor",onClick:()=>{te&&re(te,!0),ae==null||ae()},paddingX:"8",paddingY:"4",style:{boxSizing:"content-box",height:17,willChange:"transform"},transition:"default",type:"button"},Ne.createElement(XRe,null))),Ne.createElement(Nn,{display:"flex",justifyContent:"center",style:{flexGrow:1}},V&&Ne.createElement(Ps,{color:"modalText",size:"18",textAlign:"center",weight:"heavy"},V)),Ne.createElement(V3,{onClose:e})),Ne.createElement(Nn,{display:"flex",flexDirection:"column",style:{minHeight:x?396:432}},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"6",height:"full",justifyContent:"center",marginX:"8"},G)))))}var tRt="_1am14412",nRt="_1am14410",rRt="_1am14413",sRt=({wallet:e})=>Ne.createElement("svg",{className:rRt,viewBox:"0 0 86 86",width:"86",height:"86"},Ne.createElement("title",null,"Loading"),Ne.createElement("rect",{x:"3",y:"3",width:80,height:80,rx:20,ry:20,strokeDasharray:`${160/3} ${2*160/3}`,strokeDashoffset:160,className:tRt,style:{stroke:(e==null?void 0:e.iconAccent)||"#0D3887"}}));function lLe({onClose:e,wallet:t,connecting:n}){const{connect:r,iconBackground:s,iconUrl:a,id:o,name:l,getMobileUri:c,ready:u,shortName:d,showWalletConnectModal:f}=t,x=QRe(a),g=m.useRef(!1),{i18n:v}=m.useContext(lc),w=m.useCallback(async()=>{if(o!=="walletConnect"&&(async()=>{const N=await(c==null?void 0:c());if(N)if(N&&HOt({mobileUri:N,name:l}),N.startsWith("http")){const I=document.createElement("a");I.href=N,I.target="_blank",I.rel="noreferrer noopener",I.click()}else window.location.href=N})(),f){f(),e==null||e();return}r==null||r()},[r,c,f,e,l,o]);return m.useEffect(()=>{n&&!g.current&&(w(),g.current=!0)},[n,w]),Ne.createElement(Nn,{as:"button",color:u?"modalText":"modalTextSecondary",disabled:!u,fontFamily:"body",key:o,onClick:w,ref:x,style:{overflow:"visible",textAlign:"center"},testId:`wallet-option-${o}`,type:"button",width:"full"},Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},Ne.createElement(Nn,{display:"flex",alignItems:"center",justifyContent:"center",paddingBottom:"8",paddingTop:"10",position:"relative"},n?Ne.createElement(sRt,{wallet:t}):null,Ne.createElement(Ic,{background:s,borderRadius:"13",boxShadow:"walletLogo",height:"60",src:a,width:"60"})),n?null:Ne.createElement(Nn,{display:"flex",flexDirection:"column",textAlign:"center"},Ne.createElement(Ps,{as:"h2",color:t.ready?"modalText":"modalTextSecondary",size:"13",weight:"medium"},Ne.createElement(Nn,{as:"span",position:"relative"},d??l,!t.ready&&" (unsupported)")),t.recent&&Ne.createElement(Ps,{color:"accentColor",size:"12",weight:"medium"},v.t("connect.recent")))))}function iRt({onClose:e}){var g;const t="rk_connect_title",n=JE().filter(v=>v.isRainbowKitConnector),{disclaimer:r,learnMoreUrl:s}=m.useContext(sT);let a=null,o=null,l=!1,c=null;const[u,d]=m.useState("CONNECT"),{i18n:f}=m.useContext(lc),x=g5();switch(u){case"CONNECT":{a=f.t("connect.title"),l=!0,o=Ne.createElement(Nn,null,Ne.createElement(Nn,{background:"profileForeground",className:nRt,display:"flex",paddingBottom:"20",paddingTop:"6"},Ne.createElement(Nn,{display:"flex",style:{margin:"0 auto"}},n.filter(v=>v.ready).map(v=>Ne.createElement(Nn,{key:v.id,paddingX:"20"},Ne.createElement(Nn,{width:"60"},Ne.createElement(lLe,{onClose:e,wallet:v})))))),Ne.createElement(Nn,{background:"generalBorder",height:"1",marginBottom:"32",marginTop:"-1"}),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"32",paddingX:"32",style:{textAlign:"center"}},Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"8",textAlign:"center"},Ne.createElement(Ps,{color:"modalText",size:"16",weight:"bold"},f.t("intro.title")),Ne.createElement(Ps,{color:"modalTextSecondary",size:"16"},f.t("intro.description")))),Ne.createElement(Nn,{paddingTop:"32",paddingX:"20"},Ne.createElement(Nn,{display:"flex",gap:"14",justifyContent:"center"},Ne.createElement(hd,{label:f.t("intro.get.label"),onClick:()=>d("GET"),size:"large",type:"secondary"}),Ne.createElement(hd,{href:s,label:f.t("intro.learn_more.label"),size:"large",type:"secondary"}))),r&&Ne.createElement(Nn,{marginTop:"28",marginX:"32",textAlign:"center"},Ne.createElement(r,{Link:fle,Text:hle})));break}case"GET":{a=f.t("get.title"),c="CONNECT";const v=(g=n==null?void 0:n.filter(w=>{var C,N,I;return((C=w.downloadUrls)==null?void 0:C.ios)||((N=w.downloadUrls)==null?void 0:N.android)||((I=w.downloadUrls)==null?void 0:I.mobile)}))==null?void 0:g.splice(0,3);o=Ne.createElement(Nn,null,Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginBottom:"36",marginTop:"5",paddingTop:"12",width:"full"},v.map((w,C)=>{const{downloadUrls:N,iconBackground:I,iconUrl:P,name:R}=w;return!(N!=null&&N.ios)&&!(N!=null&&N.android)&&!(N!=null&&N.mobile)?null:Ne.createElement(Nn,{display:"flex",gap:"16",key:w.id,paddingX:"20",width:"full"},Ne.createElement(Nn,{style:{minHeight:48,minWidth:48}},Ne.createElement(Ic,{background:I,borderColor:"generalBorder",borderRadius:"10",height:"48",src:P,width:"48"})),Ne.createElement(Nn,{display:"flex",flexDirection:"column",width:"full"},Ne.createElement(Nn,{alignItems:"center",display:"flex",height:"48"},Ne.createElement(Nn,{width:"full"},Ne.createElement(Ps,{color:"modalText",size:"18",weight:"bold"},R)),Ne.createElement(hd,{href:(x?N==null?void 0:N.ios:N==null?void 0:N.android)||(N==null?void 0:N.mobile),label:f.t("get.action.label"),size:"small",type:"secondary"})),C<v.length-1&&Ne.createElement(Nn,{background:"generalBorderDim",height:"1",marginY:"10",width:"full"})))})),Ne.createElement(Nn,{style:{marginBottom:"42px"}}),Ne.createElement(Nn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"36",paddingX:"36",style:{textAlign:"center"}},Ne.createElement(Nn,{display:"flex",flexDirection:"column",gap:"12",textAlign:"center"},Ne.createElement(Ps,{color:"modalText",size:"16",weight:"bold"},f.t("get.looking_for.title")),Ne.createElement(Ps,{color:"modalTextSecondary",size:"16"},f.t("get.looking_for.mobile.description")))));break}}return Ne.createElement(Nn,{display:"flex",flexDirection:"column",paddingBottom:"36"},Ne.createElement(Nn,{background:l?"profileForeground":"modalBackground",display:"flex",flexDirection:"column",paddingBottom:"4",paddingTop:"14"},Ne.createElement(Nn,{display:"flex",justifyContent:"center",paddingBottom:"6",paddingX:"20",position:"relative"},c&&Ne.createElement(Nn,{display:"flex",position:"absolute",style:{left:0,marginBottom:-20,marginTop:-20}},Ne.createElement(Nn,{alignItems:"center",as:"button",className:iu({active:"shrinkSm",hover:"growLg"}),color:"accentColor",display:"flex",marginLeft:"4",marginTop:"20",onClick:()=>d(c),padding:"16",style:{height:17,willChange:"transform"},transition:"default",type:"button"},Ne.createElement(XRe,null))),Ne.createElement(Nn,{marginTop:"4",textAlign:"center",width:"full"},Ne.createElement(Ps,{as:"h1",color:"modalText",id:t,size:"20",weight:"bold"},a)),Ne.createElement(Nn,{alignItems:"center",display:"flex",height:"32",paddingRight:"14",position:"absolute",right:"0"},Ne.createElement(Nn,{style:{marginBottom:-20,marginTop:-20}},Ne.createElement(V3,{onClose:e}))))),Ne.createElement(Nn,{display:"flex",flexDirection:"column"},o))}var aRt=({onClose:e})=>{const{connector:t}=m.useContext(iT),{i18n:n}=m.useContext(lc),r=(t==null?void 0:t.name)||"";return Ne.createElement(Nn,null,Ne.createElement(Nn,{display:"flex",paddingBottom:"32",justifyContent:"center",alignItems:"center",background:"profileForeground",flexDirection:"column"},Ne.createElement(Nn,{width:"full",display:"flex",justifyContent:"flex-end",marginTop:"18",marginRight:"24"},Ne.createElement(V3,{onClose:e})),Ne.createElement(Nn,{width:"60"},Ne.createElement(lLe,{onClose:e,wallet:t,connecting:!0})),Ne.createElement(Nn,{marginTop:"20"},Ne.createElement(Ps,{textAlign:"center",color:"modalText",size:"18",weight:"semibold"},n.t("connect.status.connect_mobile",{wallet:r}))),Ne.createElement(Nn,{maxWidth:"full",marginTop:"8"},Ne.createElement(Ps,{textAlign:"center",color:"modalText",size:"16",weight:"medium"},n.t("connect.status.confirm_mobile",{wallet:r})))))};function oRt({onClose:e}){const{connector:t}=m.useContext(iT);return ou()?t?Ne.createElement(aRt,{onClose:e}):Ne.createElement(iRt,{onClose:e}):Ne.createElement(eRt,{onClose:e})}function lRt({onClose:e,open:t}){const n="rk_connect_title",r=vRe(),{disconnect:s}=vB(),{isConnecting:a}=Jr(),o=Ne.useCallback(()=>{e(),s()},[e,s]),l=Ne.useCallback(()=>{a&&s(),e()},[e,s,a]);return r==="disconnected"?Ne.createElement(MR,{onClose:l,open:t,titleId:n},Ne.createElement(RR,{bottomSheetOnMobile:!0,padding:"0",wide:!0},Ne.createElement(oRt,{onClose:l}))):r==="unauthenticated"?Ne.createElement(MR,{onClose:o,open:t,titleId:n},Ne.createElement(RR,{bottomSheetOnMobile:!0,padding:"0"},Ne.createElement(UOt,{onClose:o,onCloseModal:e}))):null}function dW(){const[e,t]=m.useState(!1);return{closeModal:m.useCallback(()=>t(!1),[]),isModalOpen:e,openModal:m.useCallback(()=>t(!0),[])}}var UA=m.createContext({accountModalOpen:!1,chainModalOpen:!1,connectModalOpen:!1,isWalletConnectModalOpen:!1,setIsWalletConnectModalOpen:()=>{}});function cRt({children:e}){const{closeModal:t,isModalOpen:n,openModal:r}=dW(),{closeModal:s,isModalOpen:a,openModal:o}=dW(),{closeModal:l,isModalOpen:c,openModal:u}=dW(),[d,f]=m.useState(!1),x=vRe(),{chainId:g}=Jr(),{chains:v}=Al(),w=v.some(I=>I.id===g),C=m.useCallback(({keepConnectModalOpen:I=!1}={})=>{I||t(),s(),l()},[t,s,l]),N=A$()==="unauthenticated";return e_e({onConnect:()=>C({keepConnectModalOpen:N}),onDisconnect:()=>C()}),m.useEffect(()=>{N&&C()},[N,C]),Ne.createElement(UA.Provider,{value:m.useMemo(()=>({accountModalOpen:a,chainModalOpen:c,connectModalOpen:n,isWalletConnectModalOpen:d,openAccountModal:w&&x==="connected"?o:void 0,openChainModal:x==="connected"?u:void 0,openConnectModal:x==="disconnected"||x==="unauthenticated"?r:void 0,setIsWalletConnectModalOpen:f}),[x,a,c,n,o,u,r,w,d])},e,Ne.createElement(lRt,{onClose:t,open:n}),Ne.createElement(xMt,{onClose:s,open:a}),Ne.createElement(SMt,{onClose:l,open:c}))}function uRt(){const{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}=m.useContext(UA);return{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}}function dRt(){const{accountModalOpen:e,openAccountModal:t}=m.useContext(UA);return{accountModalOpen:e,openAccountModal:t}}function fRt(){const{chainModalOpen:e,openChainModal:t}=m.useContext(UA);return{chainModalOpen:e,openChainModal:t}}function cLe(){const{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}=m.useContext(UA);return{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}}function b5(){const{connectModalOpen:e,openConnectModal:t}=m.useContext(UA),{isWalletConnectModalOpen:n}=cLe();return{connectModalOpen:e||n,openConnectModal:t}}var fW=()=>{};function hRt({children:e}){const t=GFt(),{address:n}=Jr(),{chainId:r}=Jr(),{chains:s}=Al(),a=s.some(X=>X.id===r),o=VFt(),l=A$()??void 0,c=r?o[r]:void 0,u=(c==null?void 0:c.name)??void 0,d=(c==null?void 0:c.iconUrl)??void 0,f=(c==null?void 0:c.iconBackground)??void 0,x=rle(d),g=m.useContext(ale),v=PRe().some(({status:X})=>X==="pending")&&g,{showBalance:w}=qFt(),N=typeof w=="boolean"?w:w?dFt(w)[ou()?"smallScreen":"largeScreen"]:!0,{balance:I,ensAvatar:P,ensName:R}=_Re({address:n,includeBalance:N}),F=I?`${WRe(Number.parseFloat(I.formatted))} ${I.symbol}`:void 0,{openConnectModal:U}=b5(),{openChainModal:L}=fRt(),{openAccountModal:z}=dRt(),{accountModalOpen:Q,chainModalOpen:ne,connectModalOpen:J}=uRt();return Ne.createElement(Ne.Fragment,null,e({account:n?{address:n,balanceDecimals:I==null?void 0:I.decimals,balanceFormatted:I==null?void 0:I.formatted,balanceSymbol:I==null?void 0:I.symbol,displayBalance:F,displayName:R?GRe(R):qRe(n),ensAvatar:P??void 0,ensName:R??void 0,hasPendingTransactions:v}:void 0,accountModalOpen:Q,authenticationStatus:l,chain:r?{hasIcon:!!d,iconBackground:f,iconUrl:x,id:r,name:u,unsupported:!a}:void 0,chainModalOpen:ne,connectModalOpen:J,mounted:t(),openAccountModal:z??fW,openChainModal:L??fW,openConnectModal:U??fW}))}hRt.displayName="ConnectButton.Custom";var uLe=({appName:e,appDescription:t,appUrl:n,appIcon:r})=>({name:e,description:t??e,url:n??(typeof window<"u"?window.location.href:""),icons:[...r?[r]:[]]});function pRt(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0))}function mRt(e,t){const n=[];for(const r of e)n.some(s=>s[t]===r[t])||n.push(r);return n}var xRt=(e,{projectId:t,walletConnectParameters:n,appName:r,appDescription:s,appUrl:a,appIcon:o})=>{if(!e.length)throw new Error("No wallet list was provided");for(const{wallets:g,groupName:v}of e)if(!g.length)throw new Error(`No wallets provided for group: ${v}`);let l=-1;const c=[],u=[],d=[],f=uLe({appName:r,appDescription:s,appUrl:a,appIcon:o});for(const[g,{groupName:v,wallets:w}]of e.entries())for(const C of w){l++;const N=C({projectId:t,appName:r,appIcon:o,options:{metadata:f,...n},walletConnectParameters:{metadata:f,...n}});if(N!=null&&N.iconAccent&&!FMt(N==null?void 0:N.iconAccent))throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${N.name}`);const I={...N,groupIndex:g+1,groupName:v,index:l};typeof N.hidden=="function"?d.push(I):u.push(I)}const x=mRt([...u,...d],"id");for(const{createConnector:g,groupIndex:v,groupName:w,hidden:C,...N}of x){if(typeof C=="function"&&C())continue;const I=F=>({rkDetails:pRt({...N,groupIndex:v,groupName:w,isRainbowKitConnector:!0,...F||{}})});N.id==="walletConnect"&&c.push(g(I({isWalletConnectModalConnector:!0,showQrModal:!0})));const R=g(I());c.push(R)}return c},bbe=new Map,gRt=({projectId:e,walletConnectParameters:t,rkDetailsShowQrModal:n})=>{let r={...t||{},projectId:e,showQrModal:!1};n&&(r={...r,showQrModal:!0});const s=JSON.stringify(r),a=bbe.get(s);if(a)return a;const o=tle(r);return bbe.set(s,o),o};function bRt({projectId:e,walletDetails:t,walletConnectParameters:n}){return r=>({...gRt({projectId:e,walletConnectParameters:n,rkDetailsShowQrModal:t.rkDetails.showQrModal})(r),...t})}function ple({projectId:e,walletConnectParameters:t}){const n="21fef48091f12692cad574a6f7753643";if(!e||e==="")throw new Error("No projectId found. Every dApp must now provide a WalletConnect Cloud projectId to enable WalletConnect v2 https://www.rainbowkit.com/docs/installation#configure");return e==="YOUR_PROJECT_ID"&&(e=n),r=>bRt({projectId:e,walletDetails:r,walletConnectParameters:t})}function dLe(e){const t=typeof window<"u"?window:void 0;if(typeof t>"u"||typeof t.ethereum>"u")return;const n=t.ethereum.providers;return n?n.find(r=>r[e]):t.ethereum[e]?t.ethereum:void 0}function fLe(e){const t=(n,r)=>{const[s,...a]=r.split("."),o=n[s];if(o)return a.length===0?o:t(o,a.join("."))};if(typeof window<"u")return t(window,e)}function hLe({flag:e,namespace:t}){return!!(t&&typeof fLe(t)<"u"||e&&typeof dLe(e)<"u")}function yRt({flag:e,namespace:t}){var s;const n=typeof window<"u"?window:void 0;if(typeof n>"u")return;if(t){const a=fLe(t);if(a)return a}const r=(s=n.ethereum)==null?void 0:s.providers;if(e){const a=dLe(e);if(a)return a}return typeof r<"u"&&r.length>0?r[0]:n.ethereum}function vRt(e){return t=>{const n=e?{target:()=>({id:t.rkDetails.id,name:t.rkDetails.name,provider:e})}:{};return r=>({...gB(n)(r),...t})}}function pLe({flag:e,namespace:t,target:n}){const r=n||yRt({flag:e,namespace:t});return vRt(r)}var mLe=({appName:e,appIcon:t})=>{const n=s=>s,r=g5();return{id:"coinbase",name:"Coinbase Wallet",shortName:"Coinbase",rdns:"com.coinbase.wallet",iconUrl:async()=>(await ss(async()=>{const{default:s}=await import("./coinbaseWallet-WWX6LF36-BMRj6mTC.js");return{default:s}},[])).default,iconAccent:"#2c5ff6",iconBackground:"#2c5ff6",installed:!0,downloadUrls:{android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/us/app/coinbase-wallet-store-crypto/id1278383455",mobile:"https://coinbase.com/wallet/downloads",qrCode:"https://coinbase-wallet.onelink.me/q5Sx/fdb9b250",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad",browserExtension:"https://coinbase.com/wallet"},...r?{}:{qrCode:{getUri:n,instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-mobile",steps:[{description:"wallet_connectors.coinbase.qr_code.step1.description",step:"install",title:"wallet_connectors.coinbase.qr_code.step1.title"},{description:"wallet_connectors.coinbase.qr_code.step2.description",step:"create",title:"wallet_connectors.coinbase.qr_code.step2.title"},{description:"wallet_connectors.coinbase.qr_code.step3.description",step:"scan",title:"wallet_connectors.coinbase.qr_code.step3.title"}]}},extension:{instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-extension",steps:[{description:"wallet_connectors.coinbase.extension.step1.description",step:"install",title:"wallet_connectors.coinbase.extension.step1.title"},{description:"wallet_connectors.coinbase.extension.step2.description",step:"create",title:"wallet_connectors.coinbase.extension.step2.title"},{description:"wallet_connectors.coinbase.extension.step3.description",step:"refresh",title:"wallet_connectors.coinbase.extension.step3.title"}]}}},createConnector:s=>{const a=N$({appName:e,appLogoUrl:t,preference:mLe.preference});return o=>({...a(o),...s})}}};function wRt(e){return!(!(e!=null&&e.isMetaMask)||e.isBraveWallet&&!e._events&&!e._state||e.isApexWallet||e.isAvalanche||e.isBackpack||e.isBifrost||e.isBitKeep||e.isBitski||e.isBlockWallet||e.isCoinbaseWallet||e.isDawn||e.isEnkrypt||e.isExodus||e.isFrame||e.isFrontier||e.isGamestop||e.isHyperPay||e.isImToken||e.isKuCoinWallet||e.isMathWallet||e.isNestWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPhantom||e.isPortal||e.isRabby||e.isRainbow||e.isStatus||e.isTalisman||e.isTally||e.isTokenPocket||e.isTokenary||e.isTrust||e.isTrustWallet||e.isXDEFI||e.isZeal||e.isZerion||e.__seif)}var CRt=({projectId:e,walletConnectParameters:t})=>{var a,o;const n=hLe({flag:"isMetaMask"}),r=!n,s=l=>nle()?l:g5()?`metamask://wc?uri=${encodeURIComponent(l)}`:`https://metamask.app.link/wc?uri=${encodeURIComponent(l)}`;return{id:"metaMask",name:"MetaMask",rdns:"io.metamask",iconUrl:async()=>(await ss(async()=>{const{default:l}=await import("./metaMaskWallet-YFHEHW7V-BggUDXad.js");return{default:l}},[])).default,iconAccent:"#f6851a",iconBackground:"#fff",installed:r?void 0:n,downloadUrls:{android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/us/app/metamask/id1438144202",mobile:"https://metamask.io/download",qrCode:"https://metamask.io/download",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask",opera:"https://addons.opera.com/extensions/details/metamask-10",browserExtension:"https://metamask.io/download"},mobile:{getUri:r?s:void 0},qrCode:r?{getUri:s,instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.qr_code.step1.description",step:"install",title:"wallet_connectors.metamask.qr_code.step1.title"},{description:"wallet_connectors.metamask.qr_code.step2.description",step:"create",title:"wallet_connectors.metamask.qr_code.step2.title"},{description:"wallet_connectors.metamask.qr_code.step3.description",step:"refresh",title:"wallet_connectors.metamask.qr_code.step3.title"}]}}:void 0,extension:{instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.extension.step1.description",step:"install",title:"wallet_connectors.metamask.extension.step1.title"},{description:"wallet_connectors.metamask.extension.step2.description",step:"create",title:"wallet_connectors.metamask.extension.step2.title"},{description:"wallet_connectors.metamask.extension.step3.description",step:"refresh",title:"wallet_connectors.metamask.extension.step3.title"}]}},createConnector:r?ple({projectId:e,walletConnectParameters:t}):pLe({target:typeof window<"u"?((o=(a=window.ethereum)==null?void 0:a.providers)==null?void 0:o.find(wRt))??window.ethereum:void 0})}},SRt=({projectId:e,walletConnectParameters:t})=>{const n=hLe({flag:"isRainbow"}),r=!n,s=a=>nle()?a:g5()?`rainbow://wc?uri=${encodeURIComponent(a)}&connector=rainbowkit`:`https://rnbwapp.com/wc?uri=${encodeURIComponent(a)}&connector=rainbowkit`;return{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",iconUrl:async()=>(await ss(async()=>{const{default:a}=await import("./rainbowWallet-2SR6TVBF-kimcGeuf.js");return{default:a}},[])).default,iconBackground:"#0c2f78",installed:r?void 0:n,downloadUrls:{android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",ios:"https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",mobile:"https://rainbow.download?utm_source=rainbowkit",qrCode:"https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",browserExtension:"https://rainbow.me/extension?utm_source=rainbowkit"},mobile:{getUri:r?s:void 0},qrCode:r?{getUri:s,instructions:{learnMoreUrl:"https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",steps:[{description:"wallet_connectors.rainbow.qr_code.step1.description",step:"install",title:"wallet_connectors.rainbow.qr_code.step1.title"},{description:"wallet_connectors.rainbow.qr_code.step2.description",step:"create",title:"wallet_connectors.rainbow.qr_code.step2.title"},{description:"wallet_connectors.rainbow.qr_code.step3.description",step:"scan",title:"wallet_connectors.rainbow.qr_code.step3.title"}]}}:void 0,createConnector:r?ple({projectId:e,walletConnectParameters:t}):pLe({flag:"isRainbow"})}},NRt=()=>({id:"safe",name:"Safe",iconAccent:"#12ff80",iconBackground:"#fff",iconUrl:async()=>(await ss(async()=>{const{default:e}=await import("./safeWallet-VUYZPLY4-CXnodgMs.js");return{default:e}},[])).default,installed:!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,downloadUrls:{},createConnector:e=>t=>({...ele()(t),...e})}),ARt=({projectId:e,options:t})=>({id:"walletConnect",name:"WalletConnect",installed:void 0,iconUrl:async()=>(await ss(async()=>{const{default:r}=await import("./walletConnectWallet-FNSU4KNU-B0ci71fU.js");return{default:r}},[])).default,iconBackground:"#3b99fc",qrCode:{getUri:r=>r},createConnector:ple({projectId:e,walletConnectParameters:t})}),jRt=e=>e.reduce((n,r)=>{const s=r.id;return n[s]=cj(),n},{}),ERt=({appName:e,appDescription:t,appUrl:n,appIcon:r,wallets:s,projectId:a,...o})=>{const{transports:l,chains:c,...u}=o,d=uLe({appName:e,appDescription:t,appUrl:n,appIcon:r}),f=xRt(s||[{groupName:"Popular",wallets:[NRt,SRt,mLe,CRt,ARt]}],{projectId:a,appName:e,appDescription:t,appUrl:n,appIcon:r,walletConnectParameters:{metadata:d}});return H0t({connectors:f,chains:c,transports:l||jRt(c),...u})};function _Rt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M13.836 2.477a.75.75 0 0 1 .75.75v3.182a.75.75 0 0 1-.75.75h-3.182a.75.75 0 0 1 0-1.5h1.37l-.84-.841a4.5 4.5 0 0 0-7.08.932.75.75 0 0 1-1.3-.75 6 6 0 0 1 9.44-1.242l.842.84V3.227a.75.75 0 0 1 .75-.75Zm-.911 7.5A.75.75 0 0 1 13.199 11a6 6 0 0 1-9.44 1.241l-.84-.84v1.371a.75.75 0 0 1-1.5 0V9.591a.75.75 0 0 1 .75-.75H5.35a.75.75 0 0 1 0 1.5H3.98l.841.841a4.5 4.5 0 0 0 7.08-.932.75.75 0 0 1 1.025-.273Z",clipRule:"evenodd"}))}const ybe=m.forwardRef(_Rt);function kRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z",clipRule:"evenodd"}))}const xy=m.forwardRef(kRt);function TRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const IRt=m.forwardRef(TRt);function PRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M8.75 2.5a.75.75 0 0 0-1.5 0v.508a32.661 32.661 0 0 0-4.624.434.75.75 0 0 0 .246 1.48l.13-.021-1.188 4.75a.75.75 0 0 0 .33.817A3.487 3.487 0 0 0 4 11c.68 0 1.318-.195 1.856-.532a.75.75 0 0 0 .33-.818l-1.25-5a31.31 31.31 0 0 1 2.314-.141V12.012c-.882.027-1.752.104-2.607.226a.75.75 0 0 0 .213 1.485 22.188 22.188 0 0 1 6.288 0 .75.75 0 1 0 .213-1.485 23.657 23.657 0 0 0-2.607-.226V4.509c.779.018 1.55.066 2.314.14L9.814 9.65a.75.75 0 0 0 .329.818 3.487 3.487 0 0 0 1.856.532c.68 0 1.318-.195 1.856-.532a.75.75 0 0 0 .33-.818L12.997 4.9l.13.022a.75.75 0 1 0 .247-1.48 32.66 32.66 0 0 0-4.624-.434V2.5ZM3.42 9.415a2 2 0 0 0 1.16 0L4 7.092l-.58 2.323ZM12 9.5a2 2 0 0 1-.582-.085L12 7.092l.58 2.323A2 2 0 0 1 12 9.5Z",clipRule:"evenodd"}))}const FRt=m.forwardRef(PRt);function ORt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z",clipRule:"evenodd"}))}const MRt=m.forwardRef(ORt),RRt=()=>{const{address:e}=Jr(),{disconnect:t}=vB(),{subsExpireDay:n}=m.useContext(Qr),[r,s]=m.useState(!1),a=c=>c<=3?"red":c<=7?"yellow":"green",o=Number(n)||0,l=a(o);return i.jsxs(i.Fragment,{children:[i.jsx(d5,{open:r,setOpen:s,handleListRequest:()=>{},handlePageChange:()=>{}}),i.jsxs(OD,{as:"div",className:"relative inline-block text-left font-manrope",children:[i.jsx("div",{children:i.jsxs(PD,{className:"bg-[#232323] hover:bg-[#404040] border-none rounded-[256px] justify-start items-center gap-2 inline-flex focus:outline-none focus:ring-0 py-1.5 pl-4 pr-3 text-[13px] font-semibold text-white",children:[window.localStorage.getItem("hyperAddress")&&e.slice(0,6)+"..."+e.slice(-4),i.jsx(IRt,{className:"size-4 fill-white/60"})]})}),i.jsx(FD,{transition:!0,anchor:"bottom end",className:"origin-top-right absolute right-0 top-10 w-36 rounded-xl px-2 py-2.5 text-sm/6 text-white transition duration-100 ease-out [--anchor-gap:var(--spacing-1)] focus:outline-none data-[closed]:scale-95 data-[closed]:opacity-0 z-[60]",children:i.jsx(jC,{children:i.jsxs("button",{className:"group flex flex-col gap-[6px] items-center rounded-lg px-1 py-2 focus:outline-none focus:ring-0 border-none origin-top-right bg-[#363636] border border-[#404040] shadow-lg ring-1 ring-black ring-opacity-5 z-20 h-max w-full",children:[i.jsxs("div",{onClick:()=>{window.open("/wallet-management#hyperliquid#add-account#hyperliquid","_blank")},className:"h-8 px-1 py-3 bg-[#7445ff] rounded-md shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] flex justify-center items-center gap-1 cursor-pointer relative",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max -mb-[1px]",children:"Add Account"}),i.jsx("div",{className:"absolute -top-[15.5px] right-[1px]",children:i.jsx("img",{src:tke,alt:""})})]}),i.jsx("div",{onClick:()=>{window.open("/my-profile","_blank")},className:"h-8 w-[calc(100%-6px)] px-1 py-3 bg-[#7445ff] rounded-md shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] flex justify-center items-center gap-1 cursor-pointer",children:i.jsxs("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max -mb-[1px] flex items-center gap-2",children:[l!=="green"&&i.jsx("span",{className:`${l==="red"?"bg-[#FF4A4A]":""} ${l==="yellow"?"bg-[#FFD447]":""} w-2 h-2 min-w-2 min-h-2 rounded-full inline-block live-dot`}),"My Profile"]})}),i.jsx("div",{onClick:()=>{t(),window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),window.dispatchEvent(new Event("localStorageUpdated"))},className:"py-2 px-3 text-13px rounded-md flex justify-between items-center hover:bg-[#404040] relative w-full",children:"Disconnect"})]})})})]})]})},LRt=()=>{const e=il(),[t,n]=m.useState(Date.now()),{isConnected:r,address:s,isDisconnected:a}=Jr(),{walletLogin:o,signIn:l,hyperToken:c,hyperAddress:u,setTelegramChatId:d,setSubscriberRole:f,setSubsExpireDay:x,setIsReferralCode:g,setIsReferralCodeName:v,setMushboomerETH:w,setMushboomerSOL:C,setIsWhitelist:N,setHyperToken:I,setHyperAddress:P,setSignModalOpen:R,signInConnectButtonOpen:F,setSignInConnectButtonOpen:U}=m.useContext(Qr),{openConnectModal:L}=b5(),z=typeof window<"u"&&window.matchMedia("(max-width:640px)").matches;m.useEffect(()=>{!a&&s==null&&!z&&(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),I(""),P(""))},[a]);const Q=()=>{window.localStorage.getItem("hyperToken")&&c?o():l(1)};m.useEffect(()=>{F&&(R(!0),U(!1))},[F]),m.useEffect(()=>{s!=null&&window.localStorage.getItem("hyperAddress")!=null&&window.localStorage.getItem("hyperAddress").toLowerCase()!==s.toLowerCase()&&!z&&(window.localStorage.removeItem("hyperToken"),I(""))},[s,u]);const ne=m.useRef(!1);return m.useEffect(()=>{const J=async()=>{var Y,ie;if(ne.current)return;ne.current=!0;const re=window.localStorage.getItem("hyperToken"),pe=window.localStorage.getItem("hyperAddress");if(!re||!pe){ne.current=!1;return}try{const oe=await ji(pe.toLowerCase(),re);oe!=null&&oe.success?(d(oe==null?void 0:oe.telegram_chat_id),f(oe==null?void 0:oe.subscriber_role),x(oe==null?void 0:oe.subs_expire_day),w((Y=oe==null?void 0:oe.mushboomer_counts)==null?void 0:Y.eth),C((ie=oe==null?void 0:oe.mushboomer_counts)==null?void 0:ie.sol),g(oe==null?void 0:oe.referral_code),v(oe==null?void 0:oe.refcode),N(oe==null?void 0:oe.whitelist),I(re),P(pe)):(window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),I(""),P(""))}catch(oe){console.error("Token verification error:",oe),oe.response?console.error("Server Error Response:",oe.response):oe.message?console.error("Network or Other Error:",oe.message):console.error("Unknown Error:",oe)}finally{ne.current=!1}},X=()=>{if(document.visibilityState==="visible"){const re=Date.now();re-t>1e3&&J(),n(re)}};return document.addEventListener("visibilitychange",X),()=>{document.removeEventListener("visibilitychange",X)}},[e,t]),i.jsx(i.Fragment,{children:r?s&&window.localStorage.getItem("hyperAddress")?i.jsxs("div",{className:"sm:block relative font-manrope",children:[i.jsx(RRt,{}),i.jsx("div",{className:"absolute right-4",children:(s==null?void 0:s.toLowerCase())!==window.localStorage.getItem("hyperAddress")?i.jsxs("div",{className:"flex justify-end font-manrope",children:[i.jsx("img",{src:zbt,alt:""}),i.jsx("span",{className:"text-[#D35B5B] text-[10px] leading-4 font-medium",children:"Not connected"})]}):i.jsxs("div",{className:"flex justify-end font-manrope",children:[i.jsx("img",{src:Hbt,alt:""}),i.jsx("span",{className:"text-[#0A9C55] text-[10px] leading-4 font-medium",children:"Connected"})]})})]}):i.jsx("div",{onClick:J=>Q(),style:{background:"linear-gradient(98deg, #FFF1FF 0%, #6FDBBF 28.15%, #57DCF5 57.96%, #D834D8 98.77%)"},className:"h-[30.60px] rounded-[256px] justify-center items-center gap-2.5 sm:inline-flex w-[91px] p-[1.4px] cursor-pointer font-manrope",children:i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-none w-full h-full flex items-center justify-center rounded-[256px] bg-[#161616]",children:"Sign In"})}):i.jsx("div",{onClick:()=>{L(),U(!0)},style:{background:"linear-gradient(98deg, #FFF1FF 0%, #6FDBBF 28.15%, #57DCF5 57.96%, #D834D8 98.77%)"},className:"h-[30.60px] rounded-[256px] justify-center items-center gap-2.5 sm:inline-flex w-[91px] p-[1.4px] cursor-pointer",children:i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-none w-full h-full flex items-center justify-center rounded-[256px] bg-[#161616]",children:"Connect"})})})};var Y6={},hW={exports:{}},pW,vbe;function DRt(){if(vbe)return pW;vbe=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return pW=e,pW}var mW,wbe;function BRt(){if(wbe)return mW;wbe=1;var e=DRt();function t(){}function n(){}return n.resetWarningCache=t,mW=function(){function r(o,l,c,u,d,f){if(f!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function s(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},mW}var Cbe;function E$(){return Cbe||(Cbe=1,hW.exports=BRt()()),hW.exports}var xW,Sbe;function xLe(){return Sbe||(Sbe=1,xW={L:1,M:0,Q:3,H:2}),xW}var gW,Nbe;function gLe(){return Nbe||(Nbe=1,gW={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),gW}var bW,Abe;function $Rt(){if(Abe)return bW;Abe=1;var e=gLe();function t(n){this.mode=e.MODE_8BIT_BYTE,this.data=n}return t.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},bW=t,bW}var yW,jbe;function URt(){if(jbe)return yW;jbe=1;var e=xLe();function t(n,r){this.totalCount=n,this.dataCount=r}return t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t.getRSBlocks=function(n,r){var s=t.getRsBlockTable(n,r);if(s==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var a=s.length/3,o=new Array,l=0;l<a;l++)for(var c=s[l*3+0],u=s[l*3+1],d=s[l*3+2],f=0;f<c;f++)o.push(new t(u,d));return o},t.getRsBlockTable=function(n,r){switch(r){case e.L:return t.RS_BLOCK_TABLE[(n-1)*4+0];case e.M:return t.RS_BLOCK_TABLE[(n-1)*4+1];case e.Q:return t.RS_BLOCK_TABLE[(n-1)*4+2];case e.H:return t.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},yW=t,yW}var vW,Ebe;function zRt(){if(Ebe)return vW;Ebe=1;function e(){this.buffer=new Array,this.length=0}return e.prototype={get:function(t){var n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)==1},put:function(t,n){for(var r=0;r<n;r++)this.putBit((t>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},vW=e,vW}var wW,_be;function bLe(){if(_be)return wW;_be=1;for(var e={glog:function(n){if(n<1)throw new Error("glog("+n+")");return e.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return e.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},t=0;t<8;t++)e.EXP_TABLE[t]=1<<t;for(var t=8;t<256;t++)e.EXP_TABLE[t]=e.EXP_TABLE[t-4]^e.EXP_TABLE[t-5]^e.EXP_TABLE[t-6]^e.EXP_TABLE[t-8];for(var t=0;t<255;t++)e.LOG_TABLE[e.EXP_TABLE[t]]=t;return wW=e,wW}var CW,kbe;function yLe(){if(kbe)return CW;kbe=1;var e=bLe();function t(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var s=0;s<n.length&&n[s]==0;)s++;this.num=new Array(n.length-s+r);for(var a=0;a<n.length-s;a++)this.num[a]=n[a+s]}return t.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),s=0;s<this.getLength();s++)for(var a=0;a<n.getLength();a++)r[s+a]^=e.gexp(e.glog(this.get(s))+e.glog(n.get(a)));return new t(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=e.glog(this.get(0))-e.glog(n.get(0)),s=new Array(this.getLength()),a=0;a<this.getLength();a++)s[a]=this.get(a);for(var a=0;a<n.getLength();a++)s[a]^=e.gexp(e.glog(n.get(a))+r);return new t(s,0).mod(n)}},CW=t,CW}var SW,Tbe;function HRt(){if(Tbe)return SW;Tbe=1;var e=gLe(),t=yLe(),n=bLe(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var o=a<<10;s.getBCHDigit(o)-s.getBCHDigit(s.G15)>=0;)o^=s.G15<<s.getBCHDigit(o)-s.getBCHDigit(s.G15);return(a<<10|o)^s.G15_MASK},getBCHTypeNumber:function(a){for(var o=a<<12;s.getBCHDigit(o)-s.getBCHDigit(s.G18)>=0;)o^=s.G18<<s.getBCHDigit(o)-s.getBCHDigit(s.G18);return a<<12|o},getBCHDigit:function(a){for(var o=0;a!=0;)o++,a>>>=1;return o},getPatternPosition:function(a){return s.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,o,l){switch(a){case r.PATTERN000:return(o+l)%2==0;case r.PATTERN001:return o%2==0;case r.PATTERN010:return l%3==0;case r.PATTERN011:return(o+l)%3==0;case r.PATTERN100:return(Math.floor(o/2)+Math.floor(l/3))%2==0;case r.PATTERN101:return o*l%2+o*l%3==0;case r.PATTERN110:return(o*l%2+o*l%3)%2==0;case r.PATTERN111:return(o*l%3+(o+l)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var o=new t([1],0),l=0;l<a;l++)o=o.multiply(new t([1,n.gexp(l)],0));return o},getLengthInBits:function(a,o){if(1<=o&&o<10)switch(a){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(o<27)switch(a){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else if(o<41)switch(a){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}else throw new Error("type:"+o)},getLostPoint:function(a){for(var o=a.getModuleCount(),l=0,c=0;c<o;c++)for(var u=0;u<o;u++){for(var d=0,f=a.isDark(c,u),x=-1;x<=1;x++)if(!(c+x<0||o<=c+x))for(var g=-1;g<=1;g++)u+g<0||o<=u+g||x==0&&g==0||f==a.isDark(c+x,u+g)&&d++;d>5&&(l+=3+d-5)}for(var c=0;c<o-1;c++)for(var u=0;u<o-1;u++){var v=0;a.isDark(c,u)&&v++,a.isDark(c+1,u)&&v++,a.isDark(c,u+1)&&v++,a.isDark(c+1,u+1)&&v++,(v==0||v==4)&&(l+=3)}for(var c=0;c<o;c++)for(var u=0;u<o-6;u++)a.isDark(c,u)&&!a.isDark(c,u+1)&&a.isDark(c,u+2)&&a.isDark(c,u+3)&&a.isDark(c,u+4)&&!a.isDark(c,u+5)&&a.isDark(c,u+6)&&(l+=40);for(var u=0;u<o;u++)for(var c=0;c<o-6;c++)a.isDark(c,u)&&!a.isDark(c+1,u)&&a.isDark(c+2,u)&&a.isDark(c+3,u)&&a.isDark(c+4,u)&&!a.isDark(c+5,u)&&a.isDark(c+6,u)&&(l+=40);for(var w=0,u=0;u<o;u++)for(var c=0;c<o;c++)a.isDark(c,u)&&w++;var C=Math.abs(100*w/o/o-50)/5;return l+=C*10,l}};return SW=s,SW}var NW,Ibe;function VRt(){if(Ibe)return NW;Ibe=1;var e=$Rt(),t=URt(),n=zRt(),r=HRt(),s=yLe();function a(l,c){this.typeNumber=l,this.errorCorrectLevel=c,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var o=a.prototype;return o.addData=function(l){var c=new e(l);this.dataList.push(c),this.dataCache=null},o.isDark=function(l,c){if(l<0||this.moduleCount<=l||c<0||this.moduleCount<=c)throw new Error(l+","+c);return this.modules[l][c]},o.getModuleCount=function(){return this.moduleCount},o.make=function(){if(this.typeNumber<1){var l=1;for(l=1;l<40;l++){for(var c=t.getRSBlocks(l,this.errorCorrectLevel),u=new n,d=0,f=0;f<c.length;f++)d+=c[f].dataCount;for(var f=0;f<this.dataList.length;f++){var x=this.dataList[f];u.put(x.mode,4),u.put(x.getLength(),r.getLengthInBits(x.mode,l)),x.write(u)}if(u.getLengthInBits()<=d*8)break}this.typeNumber=l}this.makeImpl(!1,this.getBestMaskPattern())},o.makeImpl=function(l,c){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var u=0;u<this.moduleCount;u++){this.modules[u]=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++)this.modules[u][d]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(l,c),this.typeNumber>=7&&this.setupTypeNumber(l),this.dataCache==null&&(this.dataCache=a.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},o.setupPositionProbePattern=function(l,c){for(var u=-1;u<=7;u++)if(!(l+u<=-1||this.moduleCount<=l+u))for(var d=-1;d<=7;d++)c+d<=-1||this.moduleCount<=c+d||(0<=u&&u<=6&&(d==0||d==6)||0<=d&&d<=6&&(u==0||u==6)||2<=u&&u<=4&&2<=d&&d<=4?this.modules[l+u][c+d]=!0:this.modules[l+u][c+d]=!1)},o.getBestMaskPattern=function(){for(var l=0,c=0,u=0;u<8;u++){this.makeImpl(!0,u);var d=r.getLostPoint(this);(u==0||l>d)&&(l=d,c=u)}return c},o.createMovieClip=function(l,c,u){var d=l.createEmptyMovieClip(c,u),f=1;this.make();for(var x=0;x<this.modules.length;x++)for(var g=x*f,v=0;v<this.modules[x].length;v++){var w=v*f,C=this.modules[x][v];C&&(d.beginFill(0,100),d.moveTo(w,g),d.lineTo(w+f,g),d.lineTo(w+f,g+f),d.lineTo(w,g+f),d.endFill())}return d},o.setupTimingPattern=function(){for(var l=8;l<this.moduleCount-8;l++)this.modules[l][6]==null&&(this.modules[l][6]=l%2==0);for(var c=8;c<this.moduleCount-8;c++)this.modules[6][c]==null&&(this.modules[6][c]=c%2==0)},o.setupPositionAdjustPattern=function(){for(var l=r.getPatternPosition(this.typeNumber),c=0;c<l.length;c++)for(var u=0;u<l.length;u++){var d=l[c],f=l[u];if(this.modules[d][f]==null)for(var x=-2;x<=2;x++)for(var g=-2;g<=2;g++)x==-2||x==2||g==-2||g==2||x==0&&g==0?this.modules[d+x][f+g]=!0:this.modules[d+x][f+g]=!1}},o.setupTypeNumber=function(l){for(var c=r.getBCHTypeNumber(this.typeNumber),u=0;u<18;u++){var d=!l&&(c>>u&1)==1;this.modules[Math.floor(u/3)][u%3+this.moduleCount-8-3]=d}for(var u=0;u<18;u++){var d=!l&&(c>>u&1)==1;this.modules[u%3+this.moduleCount-8-3][Math.floor(u/3)]=d}},o.setupTypeInfo=function(l,c){for(var u=this.errorCorrectLevel<<3|c,d=r.getBCHTypeInfo(u),f=0;f<15;f++){var x=!l&&(d>>f&1)==1;f<6?this.modules[f][8]=x:f<8?this.modules[f+1][8]=x:this.modules[this.moduleCount-15+f][8]=x}for(var f=0;f<15;f++){var x=!l&&(d>>f&1)==1;f<8?this.modules[8][this.moduleCount-f-1]=x:f<9?this.modules[8][15-f-1+1]=x:this.modules[8][15-f-1]=x}this.modules[this.moduleCount-8][8]=!l},o.mapData=function(l,c){for(var u=-1,d=this.moduleCount-1,f=7,x=0,g=this.moduleCount-1;g>0;g-=2)for(g==6&&g--;;){for(var v=0;v<2;v++)if(this.modules[d][g-v]==null){var w=!1;x<l.length&&(w=(l[x]>>>f&1)==1);var C=r.getMask(c,d,g-v);C&&(w=!w),this.modules[d][g-v]=w,f--,f==-1&&(x++,f=7)}if(d+=u,d<0||this.moduleCount<=d){d-=u,u=-u;break}}},a.PAD0=236,a.PAD1=17,a.createData=function(l,c,u){for(var d=t.getRSBlocks(l,c),f=new n,x=0;x<u.length;x++){var g=u[x];f.put(g.mode,4),f.put(g.getLength(),r.getLengthInBits(g.mode,l)),g.write(f)}for(var v=0,x=0;x<d.length;x++)v+=d[x].dataCount;if(f.getLengthInBits()>v*8)throw new Error("code length overflow. ("+f.getLengthInBits()+">"+v*8+")");for(f.getLengthInBits()+4<=v*8&&f.put(0,4);f.getLengthInBits()%8!=0;)f.putBit(!1);for(;!(f.getLengthInBits()>=v*8||(f.put(a.PAD0,8),f.getLengthInBits()>=v*8));)f.put(a.PAD1,8);return a.createBytes(f,d)},a.createBytes=function(l,c){for(var u=0,d=0,f=0,x=new Array(c.length),g=new Array(c.length),v=0;v<c.length;v++){var w=c[v].dataCount,C=c[v].totalCount-w;d=Math.max(d,w),f=Math.max(f,C),x[v]=new Array(w);for(var N=0;N<x[v].length;N++)x[v][N]=255&l.buffer[N+u];u+=w;var I=r.getErrorCorrectPolynomial(C),P=new s(x[v],I.getLength()-1),R=P.mod(I);g[v]=new Array(I.getLength()-1);for(var N=0;N<g[v].length;N++){var F=N+R.getLength()-g[v].length;g[v][N]=F>=0?R.get(F):0}}for(var U=0,N=0;N<c.length;N++)U+=c[N].totalCount;for(var L=new Array(U),z=0,N=0;N<d;N++)for(var v=0;v<c.length;v++)N<x[v].length&&(L[z++]=x[v][N]);for(var N=0;N<f;N++)for(var v=0;v<c.length;v++)N<g[v].length&&(L[z++]=g[v][N]);return L},NW=a,NW}var bP={},Pbe;function WRt(){if(Pbe)return bP;Pbe=1,Object.defineProperty(bP,"__esModule",{value:!0});var e=Object.assign||function(u){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var x in f)Object.prototype.hasOwnProperty.call(f,x)&&(u[x]=f[x])}return u},t=E$(),n=a(t),r=ax(),s=a(r);function a(u){return u&&u.__esModule?u:{default:u}}function o(u,d){var f={};for(var x in u)d.indexOf(x)>=0||Object.prototype.hasOwnProperty.call(u,x)&&(f[x]=u[x]);return f}var l={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},c=(0,r.forwardRef)(function(u,d){var f=u.bgColor,x=u.bgD,g=u.fgD,v=u.fgColor,w=u.size,C=u.title,N=u.viewBoxSize,I=u.xmlns,P=I===void 0?"http://www.w3.org/2000/svg":I,R=o(u,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return s.default.createElement("svg",e({},R,{height:w,ref:d,viewBox:"0 0 "+N+" "+N,width:w,xmlns:P}),C?s.default.createElement("title",null,C):null,s.default.createElement("path",{d:x,fill:f}),s.default.createElement("path",{d:g,fill:v}))});return c.displayName="QRCodeSvg",c.propTypes=l,bP.default=c,bP}var Fbe;function qRt(){if(Fbe)return Y6;Fbe=1,Object.defineProperty(Y6,"__esModule",{value:!0}),Y6.QRCode=void 0;var e=Object.assign||function(w){for(var C=1;C<arguments.length;C++){var N=arguments[C];for(var I in N)Object.prototype.hasOwnProperty.call(N,I)&&(w[I]=N[I])}return w},t=E$(),n=f(t),r=xLe(),s=f(r),a=VRt(),o=f(a),l=ax(),c=f(l),u=WRt(),d=f(u);function f(w){return w&&w.__esModule?w:{default:w}}function x(w,C){var N={};for(var I in w)C.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(w,I)&&(N[I]=w[I]);return N}var g={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},v=(0,l.forwardRef)(function(w,C){var N=w.bgColor,I=N===void 0?"#FFFFFF":N,P=w.fgColor,R=P===void 0?"#000000":P,F=w.level,U=F===void 0?"L":F,L=w.size,z=L===void 0?256:L,Q=w.value,ne=x(w,["bgColor","fgColor","level","size","value"]),J=new o.default(-1,s.default[U]);J.addData(Q),J.make();var X=J.modules;return c.default.createElement(d.default,e({},ne,{bgColor:I,bgD:X.map(function(re,pe){return re.map(function(Y,ie){return Y?"":"M "+ie+" "+pe+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:R,fgD:X.map(function(re,pe){return re.map(function(Y,ie){return Y?"M "+ie+" "+pe+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:C,size:z,viewBoxSize:X.length}))});return Y6.QRCode=v,v.displayName="QRCode",v.propTypes=g,Y6.default=v,Y6}var GRt=qRt();const KRt=ki(GRt),up=({isOpen:e,onClose:t,children:n,fullscreen:r=!1,blurBackground:s=!1})=>{const[a,o]=m.useState(e),[l,c]=m.useState(!1);m.useEffect(()=>{e?(o(!0),c(!0)):(c(!1),o(!1))},[e]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&u()};return a&&(document.body.style.overflow="hidden",document.addEventListener("keydown",d)),()=>{document.body.style.overflow="",document.removeEventListener("keydown",d)}},[a]);const u=()=>{c(!1),t()};return a?Na.createPortal(i.jsxs("div",{className:`fixed inset-0 z-[9999] transition-opacity duration-0 ${l?"opacity-100":"opacity-0"} flex items-center justify-center`,children:[i.jsx("div",{className:`absolute inset-0 ${s?"backdrop-blur-md bg-black/50":"bg-black/50"}`,onClick:u}),i.jsxs("div",{className:`relative bg-[#101010] shadow-lg transform transition-transform duration-0 ${l?"translate-y-0":"translate-y-full"} ${r?"w-screen h-[100dvh] rounded-none p-0":"w-auto max-w-[95vw] max-h-[95vh] rounded-[24px] p-2"}`,onClick:d=>d.stopPropagation(),children:[n,i.jsx("div",{className:`absolute ${r?"top-4 right-4 text-white":"top-2 right-4 text-gray-400 hover:text-white"} text-2xl cursor-pointer z-50`,onClick:u,children:"×"})]})]}),document.body):null},YRt=({progress:e=0,size:t=24,strokeWidth:n=3})=>{const r=(t-n)/2,s=2*Math.PI*r,a=s-e/100*s;return i.jsxs("svg",{width:t,height:t,style:{transform:"rotate(-90deg)"},children:[i.jsx("circle",{stroke:"#FFFFFF",fill:"transparent",strokeWidth:n,r,cx:t/2,cy:t/2}),i.jsx("circle",{stroke:"#000000",fill:"transparent",strokeWidth:n,r,cx:t/2,cy:t/2,strokeDasharray:s,strokeDashoffset:a,strokeLinecap:"round"})]})},XRt=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(null),[s,a]=m.useState(0),[o,l]=m.useState(15),c=window.localStorage.getItem("hyperToken"),u=window.localStorage.getItem("hyperAddress"),d=m.useRef(null),f=m.useRef(null),x=2e3;m.useEffect(()=>{let I=null;return n&&(l(15),I=setInterval(()=>{l(P=>P<=1?(clearInterval(I),v(),0):P-1)},1e3)),()=>{I&&clearInterval(I)}},[n]);const g=()=>{r(null),a(0),t(!0)},v=()=>{t(!1),N()},w=()=>{a(0),f.current=Date.now(),d.current=setInterval(()=>{const P=(Date.now()-f.current)/x,R=Math.min(P*100,100);a(R),P>=1&&(clearInterval(d.current),d.current=null,a(100),ds.post("https://dextrabothypev2.nftinit.io/api/subscriber/sign_mobile_start/",{address:u,token:c}).then(F=>{const{temp_mobile_password:U}=F.data;r(U)}).catch(F=>{console.error("Axios error:",F)}))},30)},C=()=>{N()},N=()=>{d.current&&(clearInterval(d.current),d.current=null),a(0)};return m.useEffect(()=>()=>{d.current&&clearInterval(d.current)},[]),i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:g,className:"cursor-pointer text-white flex items-center justify-center",children:i.jsx(A6t,{className:"mr-2"})}),i.jsx(up,{isOpen:e,onClose:v,children:i.jsx("div",{className:"flex flex-col items-center text-center text-white px-4 py-6 rounded-md mx-auto",children:n?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:qi,className:"w-12 h-12 mb-4",alt:"Dextrabot"}),i.jsx("h2",{className:"mt-2 text-xl font-semibold",children:"Link Mobile Device"}),i.jsx("p",{className:"mt-2 text-sm leading-normal text-gray-300",children:"Scan this QR code with your native camera to connect."}),i.jsx("div",{className:"mt-4 bg-white p-2",children:i.jsx(KRt,{value:`${window.location.origin}/mobile-auth?temp_mobile_password=${n}`})}),i.jsxs("p",{className:"mt-4 text-sm text-gray-400",children:["This window will close automatically in"," ",i.jsx("span",{className:"text-white font-semibold",children:o})," ","seconds."]})]}):i.jsxs(i.Fragment,{children:[i.jsx("img",{src:qi,className:"w-12 h-12 mb-4",alt:"Dextrabot"}),i.jsx("h2",{className:"mt-2 text-xl font-semibold",children:"Link Mobile Device"}),i.jsxs("p",{className:"mt-2 text-sm leading-normal text-gray-300",children:["Just open your camera and scan the QR code to log in to"," ",i.jsx("span",{className:"text-[#46eda1]",children:"Dextra."}),i.jsx("br",{}),"This QR code enables mobile copy trading (not deposits or withdrawals). Do not share this code or screenshots of it with anyone. Make sure you're not sharing your screen."]}),i.jsxs("button",{onMouseDown:w,onMouseUp:C,onMouseLeave:C,onTouchStart:w,onTouchEnd:C,className:`mt-6 flex items-center space-x-2 px-4 py-2 rounded-md
bg-[#46eda1] text-black font-medium text-sm`,children:[i.jsx("div",{className:"text-black",children:i.jsx(YRt,{progress:s,size:16,strokeWidth:3})}),i.jsx("span",{children:"Hold to Reveal"})]})]})})})]})},Ts=({className:e})=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M13.5525 10.8225L9.00001 15.375L4.44751 10.8225",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9 2.62506V15.2476",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})]}),Fa=({content:e,positionTop:t,alignRight:n})=>i.jsxs("span",{className:`tooltip ${n?"left-5 top-1/2 -translate-y-1/2 ":t?"-top-6 -translate-x-1/2 left-1/2":"-bottom-6 -translate-x-1/2 left-1/2"} transform bg-[#353535] text-white font-manrope font-semibold text-xs leading-3 py-1 px-1.5 rounded-sm relative whitespace-nowrap`,children:[e,i.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`absolute transform -z-1 ${n?"-rotate-90 left-1 -translate-x-full -translate-y-1/2 top-1/2 ":t?"-bottom-1 rotate-180 -translate-x-1/2 left-1/2":"-top-1 -translate-x-1/2 left-1/2"}`,children:i.jsx("path",{d:"M3.70096 1.25C4.27831 0.25 5.72169 0.25 6.29904 1.25L8.89711 5.75C9.47446 6.75 8.75278 8 7.59808 8H2.40192C1.24722 8 0.525536 6.75 1.10289 5.75L3.70096 1.25Z",fill:"#353535"})})]}),QRt=()=>{const{hyperToken:e,notificationData:t,setNotificationData:n,announcementData:r,setAnnouncementData:s,handleAnnouncement:a}=m.useContext(Qr),{isConnected:o,address:l}=Jr(),[c,u]=m.useState(window.localStorage.getItem("selectedNotificationTab")||"notification"),f=localStorage.getItem("isDateNotificationFormat")||"date",[x,g]=m.useState(f),w=localStorage.getItem("isDateAnnouncementFormat")||"date",[C,N]=m.useState(w),[I,P]=m.useState(!1);m.useEffect(()=>{localStorage.setItem("isDateNotificationFormat",x)},[x]),m.useEffect(()=>{localStorage.setItem("isDateNotificationFormat",C)},[C]),m.useEffect(()=>{if(!window.localStorage.getItem("hyperToken")||!l){n([]),s([]);return}const Q=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`,ne=J=>{if(J.key===Q){const X=JSON.parse(J.newValue||"[]");n(X)}};return window.addEventListener("storage",ne),()=>window.removeEventListener("storage",ne)},[e,l]),m.useEffect(()=>{const L=window.localStorage.getItem("hyperToken");if(!I||c!="notification"||!L)return;const Q=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`;if(!t.some(X=>!X.is_read))return;const J=setTimeout(()=>{const X=t.map(re=>re.is_read?re:{...re,is_read:!0});n(X),localStorage.setItem(Q,JSON.stringify(X))},1e3);return()=>clearTimeout(J)},[t,I,c]),m.useEffect(()=>{var Q;if(!I||c!=="announcement"||!(r!=null&&r.announcements)||((Q=r==null?void 0:r.announcements)==null?void 0:Q.length)===0)return;const L="readNotSignAnnouncementIds",z=setTimeout(()=>{const ne=JSON.parse(localStorage.getItem(L)||"[]"),J=r==null?void 0:r.announcements.map(X=>X.id).filter(X=>!ne.includes(X));if(J.length>0){const X=[...ne,...J];localStorage.setItem(L,JSON.stringify(X))}},1e3);return()=>clearTimeout(z)},[r,I,c,e]);const R=async()=>{try{const L=window.localStorage.getItem("hyperToken"),z="https://dextrabothypev2.nftinit.io/api/subscriber/announcement/setlastseenannouncement/";if(!o||!L)return;const Q=await fetch(z,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l==null?void 0:l.toLowerCase(),token:L})});if(!Q.ok)throw new Error(`Server responded with status ${Q.status}`);const ne=await Q.json();ne.success?a():console.log(ne.error_message)}catch(L){console.error("Error in handleAnnouncement:",L)}};m.useEffect(()=>{!I||c!=="announcement"||(r==null?void 0:r.new_announcement_count)>0&&e&&o&&R()},[I,c]);const F=t.filter(L=>!L.is_read).length,U=(()=>{var Q,ne;const L=l==null?void 0:l.toLowerCase(),z=window.localStorage.getItem("hyperToken");if(!L||!z){const J="readNotSignAnnouncementIds",X=new Set(JSON.parse(localStorage.getItem(J)||"[]").map(String)),re=new Date,pe=new Date;return pe.setDate(re.getDate()-2),(Q=r==null?void 0:r.announcements)==null?void 0:Q.filter(Y=>{const ie=new Date(Y==null?void 0:Y.created_at);return!X.has(String(Y==null?void 0:Y.id))&&ie>=pe}).length}if(L&&z&&(r==null?void 0:r.new_announcement_count)>0){const J="readNotSignAnnouncementIds",X=new Set(JSON.parse(localStorage.getItem(J)||"[]").map(String));return((ne=r==null?void 0:r.announcements)==null?void 0:ne.filter(pe=>pe.is_new&&!X.has(String(pe.id))).length)||0}return(r==null?void 0:r.new_announcement_count)||0})();return i.jsx(OD,{as:"div",className:"relative hidden sm:inline-block text-left",children:({open:L,close:z})=>{var Q,ne;return m.useEffect(()=>{P(L)},[L]),i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsxs(PD,{className:"relative inline-flex w-full justify-center rounded-md gap-x-1.5 p-1 text-[11px] font-semibold text-gray-900 shadow-sm focus:outline-none focus:ring-0 border-none bg-transparent mt-[2px]",children:[i.jsxs("div",{className:"relative",children:[U>0&&i.jsx("span",{className:"absolute flex h-6 w-6 rounded-full bg-[#FF797C] opacity-55 animate-ping duration-[30000ms] top-0 left-0"}),i.jsx("img",{src:myt,alt:"",className:`${U>0?"bg-transparent":"bg-[#1a1a1a]"} w-[18px] h-[18px] min-w-[18px] min-h-[18px] relative z-10`})]}),(U>0||F>0)&&i.jsx("span",{className:`${U+F>99?"":"w-5 h-5"} absolute -top-1 bg-[#FF373B] text-white rounded-full flex items-center justify-center text-[10px] -right-1 p-0.5 z-20`,children:U+F>99?"99+":U+F})]})}),i.jsx(a8e,{as:m.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:i.jsxs(FD,{className:"absolute -right-3 mt-2 w-[432px] min-h-60 max-h-96 sm:max-h-[600px] origin-top-right rounded-lg bg-[#242424] ring-1 ring-black ring-opacity-5 focus:outline-none flex flex-col gap-[15px] z-[55]",children:[i.jsxs("div",{className:"flex flex-col gap-4 bg-[#242424] relative rounded-tl-lg rounded-tr-lg px-4 pt-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"absolute -top-2 right-[21px]",children:i.jsx("img",{src:tke})}),i.jsx("span",{className:"flex gap-1.5 items-center text-white text-base font-semibold font-['Manrope'] leading-[21px] select-none",children:"Notifications"}),i.jsx("div",{className:"flex justify-center items-center gap-2",children:c!="announcement"&&i.jsxs("div",{className:"flex justify-center items-center relative has-tooltip",children:[i.jsx(MRt,{onClick:J=>{J.preventDefault();const X=window.localStorage.getItem("hyperToken");if(!l||!X)return;const re=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`;n([]),localStorage.removeItem(re)},className:`${(t==null?void 0:t.length)>0?"text-[#7f7f7f] hover:text-[#c8c6c6]":"text-[#7f7f7f]"} w-4 h-4 cursor-pointer -mt-[2px]`}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Clear All",positionTop:!1,alignRight:!1})})]})})]}),i.jsx("div",{className:"flex flex-col justify-start items-start w-full",children:i.jsxs("div",{className:"flex justify-stretch w-full gap-[15px]",children:[i.jsxs("div",{onClick:()=>{u("notification"),window.localStorage.setItem("selectedNotificationTab","notification")},className:`relative ${c==="notification"?"text-white bg-[#494949] rounded-lg inline-flex justify-center items-center gap-1":"text-[#919191]"} flex h-7 px-1.5 py-1 justify-center items-center gap-2 itext-white text-[13px] font-semibold font-['Manrope'] leading-[18px] cursor-pointer select-none`,children:["Notifications",F>0&&i.jsx("div",{className:"w-[18px] h-[18px] bg-[#ff373b] rounded-[256px] inline-flex justify-center items-center gap-2.5",children:i.jsx("div",{className:"justify-start text-white text-[11px] font-bold font-['Manrope'] leading-[10px]",children:F})})]}),i.jsxs("div",{onClick:()=>{u("announcement"),window.localStorage.setItem("selectedNotificationTab","announcement")},className:`relative ${c==="announcement"?"text-white bg-[#494949] rounded-lg inline-flex justify-center items-center gap-1":"text-[#919191]"} flex h-7 px-1.5 py-1 justify-center items-center gap-2 itext-white text-[13px] font-semibold font-['Manrope'] leading-[18px] cursor-pointer select-none`,children:["Announcements",U>0&&i.jsx("div",{className:"w-[18px] h-[18px] bg-[#ff373b] rounded-[256px] inline-flex justify-center items-center gap-2.5",children:i.jsx("div",{className:"justify-start text-white text-[11px] font-bold font-['Manrope'] leading-[10px]",children:U})})]})]})})]}),i.jsx("div",{className:"px-2 mb-4 overflow-auto text-[13px] leading-4 font-semibold",children:c==="notification"&&(t==null?void 0:t.length)>0?i.jsx("div",{className:"flex flex-col items-start justify-center gap-1 w-full",children:t==null?void 0:t.map((J,X)=>i.jsx(ZRt,{listenUser:J==null?void 0:J.listen_user,asset:J==null?void 0:J.coin,feeToken:J==null?void 0:J.feeToken,dir:J==null?void 0:J.dir,leverage:J==null?void 0:J.leverage,type:J==null?void 0:J.fill_direction_type,time:J==null?void 0:J.time,status:J.message,isDateFormat:x,setIsDateFormat:g,close:z,isError:J==null?void 0:J.success,traderPNL:J==null?void 0:J.trader_pnl,targetPlatform:J==null?void 0:J.target_platform},X))}):c==="announcement"&&((Q=r==null?void 0:r.announcements)==null?void 0:Q.length)>0?i.jsx("div",{className:"flex flex-col items-start justify-center gap-1 w-full",children:(ne=r==null?void 0:r.announcements)==null?void 0:ne.map((J,X)=>i.jsx(JRt,{address:J==null?void 0:J.address,content:J==null?void 0:J.content,createdAt:J==null?void 0:J.created_at,typeId:J==null?void 0:J.type_id,isDateAnnouncementFormat:C,setIsDateAnnouncementFormat:N},X))}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center gap-2 py-9",children:[i.jsx("span",{children:i.jsx("img",{src:tyt,alt:""})}),i.jsx("span",{className:"text-[#9C9C9C] text-[13px] leading-4 font-semibold text-center px-4",children:"So clean! You have no new notifications"})]})})]})})]})}})},ZRt=({asset:e,type:t,status:n,feeToken:r,dir:s,leverage:a,listenUser:o,time:l,isDateFormat:c,setIsDateFormat:u,close:d,isError:f,traderPNL:x,targetPlatform:g})=>{function v({date:C}){const[N,I]=m.useState(Oo(C));return m.useEffect(()=>{const P=setInterval(()=>{I(Oo(C))},1e3);return()=>clearInterval(P)},[C]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:N.dateTime})}const w={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("span",{onClick:()=>{window.location.pathname+window.location.hash==="/tracker#my-activities"?d():window.open("/tracker","_self")},className:"flex gap-2 items-start justify-start px-3 pt-3 pb-2 bg-[#2b2b2b] rounded-2xl min-w-full hover:bg-[#373737] cursor-pointer min-h-16 relative",children:[i.jsx("div",{className:`${f?"bg-[#67ffbd]":"bg-[#ff787b]"} w-0.5 h-10 min-h-10 absolute left-0 top-[27.5%]`}),i.jsxs("div",{className:"flex flex-col items-center gap-3",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${w[e]||(e==null?void 0:e.split("/")[0])}.svg`||dummyImage,alt:e,className:"rounded-full w-8 h-8 min-w-8 min-h-8 bg-white",loading:"lazy",onError:C=>dm(C)}),g==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"})}):g==="lighter"?i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"})}):""]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[3px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center gap-1 w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsxs("div",{className:"text-white text-[13px] font-bold font-['Manrope'] leading-[18px]",children:[e,"/",r??"USDC"]}),i.jsxs("div",{className:"flex justify-start gap-1 items-center ml-[2px]",children:[i.jsxs("div",{className:`${s!=null&&s.includes("Long")?s==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":s==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":s=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-[18px] pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex min-w-max`,children:[i.jsx("div",{className:"w-2.5 h-2.5 justify-center items-center flex",children:i.jsx("div",{className:"w-2.5 h-2.5 relative",children:s!=null&&s.includes("Long")?s==="Short > Long"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):s==="Long > Short"?i.jsx(Ts,{className:"text-[#FF797C] w-2.5 h-2.5"}):i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):s=="Buy"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):i.jsx(Ts,{className:"text-[#FF797C] w-2.5 h-2.5"})})}),i.jsxs("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:[s=="Sell"?"Sell":s=="Buy"?"Buy":s=="Close Short"?"Short":s=="Close Long"?"Long":s=="Open Short"?"Short":s=="Open Long"?"Long":s||"--",a?" - "+a+"X":""]})]}),i.jsxs("div",{onClick:C=>{C.stopPropagation(),window.open(`/wallet-details/${o}`,"_blank")},className:"flex justify-start items-center gap-1 cursor-pointer min-w-max h-[18px] px-1.5 py-[3px] bg-white/20 rounded-md",children:[i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-none ",children:o&&(o==null?void 0:o.slice(0,5))+"..."+(o==null?void 0:o.slice(-4))}),i.jsx("img",{onClick:C=>{C.stopPropagation(),navigator.clipboard.writeText(o),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})]}),i.jsx("div",{className:"w-[18px] h-[18px] min-w-[18px] min-h-[18px] flex justify-center items-center rounded",children:i.jsx("img",{src:nae,alt:""})})]}),i.jsx("span",{className:"text-[#b7b7b7] text-xs font-medium font-['Manrope'] leading-[15px] tracking-tight select-none max-w-[92%]",children:n&&(n==null?void 0:n.length)>100?(n==null?void 0:n.slice(0,105))+"...":n}),i.jsxs("div",{className:`${x!=null&&x!==0?"justify-between":"justify-end"} flex items-center w-full`,children:[i.jsx("div",{className:`${x!=null&&x!==0?x>0?"text-[#67ffbd] bg-[#67ffbd]/20":"bg-[#ff787b]/20 text-[#ff787b]":"hidden"} text-[11px] font-semibold font-['Manrope'] leading-[8px] p-1.5 rounded-md inline-flex justify-center items-center gap-1 max-h-5`,children:x!=null&&x!==0?x>0?`+$${Cr(x)}`:`-$${Cr(Math.abs(x))}`:""}),i.jsx("div",{onClick:C=>{C.stopPropagation(),u(c=="time"?"date":"time")},className:"flex justify-center items-center text-[#a5a5a5] text-[11px] font-medium font-['Manrope'] leading-[13px] tracking-tight cursor-pointer min-w-max w-max",children:c=="time"?i.jsx(v,{date:l}):su(l)})]})]})]})},JRt=({address:e,content:t,createdAt:n,typeId:r,isDateAnnouncementFormat:s,setIsDateAnnouncementFormat:a})=>{function o({date:u}){const[d,f]=m.useState(Oo(u));return m.useEffect(()=>{const x=setInterval(()=>{f(Oo(u))},1e3);return()=>clearInterval(x)},[u]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:d.dateTime})}function l(u){if(!u)return null;try{const f=new URL(u).searchParams.get("v");return f?`https://img.youtube.com/vi/${f}/default.jpg`:null}catch(d){return console.error("Invalid YouTube URL:",u,d),null}}const c=l(t==null?void 0:t.url);return i.jsxs("span",{onClick:u=>{var d;u.preventDefault(),typeof(t==null?void 0:t.url)=="string"&&t.url.trim()!==""&&window.open((d=t==null?void 0:t.url)==null?void 0:d.trim(),"_blank")},className:`${typeof(t==null?void 0:t.url)=="string"&&t.url.trim()!==""?"cursor-pointer":""} flex gap-2 items-start justify-start px-3 pt-3 pb-2 bg-[#2b2b2b] rounded-2xl min-w-full hover:bg-[#404040] min-h-16 relative`,children:[i.jsx("div",{className:`${r==1?"w-8 h-8 min-w-8 min-h-8 bg-[#ff4848] rounded-full":r==2?c?"w-[75px] h-[56px] min-w-[75px] min-h-[56px] rounded-xl":"w-8 h-8 min-w-8 min-h-8 bg-[#FF0000] rounded-full":"w-8 h-8 min-w-8 min-h-8 bg-[#191919] rounded-full"} flex justify-center items-center overflow-hidden`,children:i.jsx("img",{src:r==1?pyt:r==2?c||gyt:xyt,alt:"",className:`${r==2?c?"w-[75px] h-[56px] min-w-[75px] min-h-[56px]":"w-[10px] h-[12px] min-w-[10px] min-h-[12px] ml-[2px]":r==3?"w-[13.92px] h-[13px] min-w-[13.92px] min-h-[13px]":"w-[18px] h-[18px] min-w-[18px] min-h-[18px]"} `,loading:"lazy",onError:u=>dm(u)})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[3px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center gap-1 w-full",children:[i.jsx("div",{className:"text-white text-[13px] font-bold font-['Manrope'] leading-[18px]",children:t==null?void 0:t.title}),typeof(t==null?void 0:t.url)=="string"&&t.url.trim()!==""&&i.jsx("div",{className:"w-[18px] h-[18px] min-w-[18px] min-h-[18px] flex justify-center items-center rounded",children:i.jsx("img",{src:nae,alt:""})})]}),i.jsx("span",{className:"text-[#B7B7B7] text-xs font-medium font-['Manrope'] leading-[15px] tracking-tight select-none max-w-[92%]",children:t==null?void 0:t.message}),i.jsx("div",{className:"flex justify-end items-center w-full",children:i.jsx("div",{onClick:u=>{u.stopPropagation(),a(s=="time"?"date":"time")},className:"flex justify-end items-center text-[#a5a5a5] text-[11px] font-medium font-['Manrope'] leading-[13px] tracking-tight cursor-pointer min-w-max w-max",children:s=="time"?i.jsx(o,{date:n}):su(n)})})]})]})},eLt=()=>{const{hyperToken:e}=m.useContext(Qr),[t,n]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(v$,{open:t,setOpen:n}),i.jsx("div",{className:"bg-[#171717] w-full px-2 sm:px-6 border-b border-[#2a2a2a] z-50",children:i.jsxs("div",{className:"flex items-center w-full h-16 gap-2",children:[i.jsx("div",{className:"flex-none",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(YTt,{}),i.jsx("div",{onClick:()=>{window.location.href="/terminal/extended/BTC#gridbot"},className:"inline-flex font-manrope justify-center items-center gap-2 text-[13px] font-semibold text-white border border-[#6bb8ff] rounded-full px-3 py-[4px] cursor-pointer mr-2 shadow-[0_0_6px_rgba(116,192,252,0.35)] hover:shadow-[0_0_10px_rgba(116,192,252,0.55)] hover:border-[#8ccaff] hover:bg-[#1b2836] transition-all duration-200",children:"Extended Grid Bot"}),i.jsx("div",{onClick:()=>{window.location.href="/dca-bot"},className:"inline-flex font-manrope justify-center items-center gap-2 text-[13px] font-semibold text-white border border-[#6bb8ff] rounded-full px-3 py-[4px] cursor-pointer mr-2 shadow-[0_0_6px_rgba(116,192,252,0.35)] hover:shadow-[0_0_10px_rgba(116,192,252,0.55)] hover:border-[#8ccaff] hover:bg-[#1b2836] transition-all duration-200",children:"Extended DCA Bot"}),i.jsxs("div",{onClick:()=>{n(!0)},className:"inline-flex font-manrope justify-center items-center gap-2 text-[13px] font-semibold text-white border border-[#6bb8ff] rounded-full px-3 py-[4px] cursor-pointer mr-2 shadow-[0_0_6px_rgba(116,192,252,0.35)] hover:shadow-[0_0_10px_rgba(116,192,252,0.55)] hover:border-[#8ccaff] hover:bg-[#1b2836] transition-all duration-200",children:["Extended Farming",i.jsx(v0,{label:"NEW",tone:"emerald"})]})]})}),i.jsxs("div",{className:"ml-auto flex items-center",children:[i.jsx("div",{className:"hidden sm:block w-[140px] mr-[12px]",children:i.jsx(rMe,{})}),e&&i.jsx(XRt,{}),i.jsx(QRt,{}),i.jsx("span",{className:"hidden sm:block ml-2",children:i.jsx(LRt,{})})]})]})})]})},Yh=({className:e})=>i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M9.96004 4.4751L6.70004 7.7351C6.31504 8.1201 5.68504 8.1201 5.30004 7.7351L2.04004 4.4751",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})});var Ss;(function(e){e[e.QR_CODE=0]="QR_CODE",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=3]="CODE_39",e[e.CODE_93=4]="CODE_93",e[e.CODE_128=5]="CODE_128",e[e.DATA_MATRIX=6]="DATA_MATRIX",e[e.MAXICODE=7]="MAXICODE",e[e.ITF=8]="ITF",e[e.EAN_13=9]="EAN_13",e[e.EAN_8=10]="EAN_8",e[e.PDF_417=11]="PDF_417",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Ss||(Ss={}));var Obe=new Map([[Ss.QR_CODE,"QR_CODE"],[Ss.AZTEC,"AZTEC"],[Ss.CODABAR,"CODABAR"],[Ss.CODE_39,"CODE_39"],[Ss.CODE_93,"CODE_93"],[Ss.CODE_128,"CODE_128"],[Ss.DATA_MATRIX,"DATA_MATRIX"],[Ss.MAXICODE,"MAXICODE"],[Ss.ITF,"ITF"],[Ss.EAN_13,"EAN_13"],[Ss.EAN_8,"EAN_8"],[Ss.PDF_417,"PDF_417"],[Ss.RSS_14,"RSS_14"],[Ss.RSS_EXPANDED,"RSS_EXPANDED"],[Ss.UPC_A,"UPC_A"],[Ss.UPC_E,"UPC_E"],[Ss.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Mbe;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.URL=1]="URL"})(Mbe||(Mbe={}));function tLt(e){return Object.values(Ss).includes(e)}var LR;(function(e){e[e.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",e[e.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(LR||(LR={}));var nLt=function(){function e(){}return e.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",e.SCAN_DEFAULT_FPS=2,e.DEFAULT_DISABLE_FLIP=!1,e.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,e.DEFAULT_SUPPORTED_SCAN_TYPE=[LR.SCAN_TYPE_CAMERA,LR.SCAN_TYPE_FILE],e}(),vLe=function(){function e(t,n){this.format=t,this.formatName=n}return e.prototype.toString=function(){return this.formatName},e.create=function(t){if(!Obe.has(t))throw"".concat(t," not in html5QrcodeSupportedFormatsTextMap");return new e(t,Obe.get(t))},e}(),Rbe=function(){function e(){}return e.createFromText=function(t){var n={text:t};return{decodedText:t,result:n}},e.createFromQrcodeResult=function(t){return{decodedText:t.text,result:t}},e}(),ete;(function(e){e[e.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",e[e.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",e[e.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(ete||(ete={}));var rLt=function(){function e(){}return e.createFrom=function(t){return{errorMessage:t,type:ete.UNKWOWN_ERROR}},e}(),sLt=function(){function e(t){this.verbose=t}return e.prototype.log=function(t){this.verbose&&console.log(t)},e.prototype.warn=function(t){this.verbose&&console.warn(t)},e.prototype.logError=function(t,n){(this.verbose||n===!0)&&console.error(t)},e.prototype.logErrors=function(t){if(t.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(t)},e}();function ag(e){return typeof e>"u"||e===null}var LC=function(){function e(){}return e.codeParseError=function(t){return"QR code parse error, error = ".concat(t)},e.errorGettingUserMedia=function(t){return"Error getting userMedia, error = ".concat(t)},e.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},e.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},e.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},e.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},e.scannerPaused=function(){return"Scanner paused"},e}(),wLe=function(){function e(){}return e.isMediaStreamConstraintsValid=function(t,n){if(typeof t!="object"){var r=typeof t;return n.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(r,"."),!0),!1}for(var s=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],a=new Set(s),o=Object.keys(t),l=0,c=o;l<c.length;l++){var u=c[l];if(a.has(u))return n.logError("".concat(u," is not supported videoConstaints."),!0),!1}return!0},e}(),Aj={exports:{}},iLt=Aj.exports,Lbe;function aLt(){return Lbe||(Lbe=1,function(e,t){(function(n,r){r(t)})(iLt,function(n){function r(dt){return dt==null}var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(dt,y){dt.__proto__=y}||function(dt,y){for(var E in y)y.hasOwnProperty(E)&&(dt[E]=y[E])};function a(dt,y){s(dt,y);function E(){this.constructor=dt}dt.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}function o(dt,y){var E=Object.setPrototypeOf;E?E(dt,y):dt.__proto__=y}function l(dt,y){y===void 0&&(y=dt.constructor);var E=Error.captureStackTrace;E&&E(dt,y)}var c=function(dt){a(y,dt);function y(E){var O=this.constructor,$=dt.call(this,E)||this;return Object.defineProperty($,"name",{value:O.name,enumerable:!1}),o($,O.prototype),l($),$}return y}(Error);class u extends c{constructor(y=void 0){super(y),this.message=y}getKind(){return this.constructor.kind}}u.kind="Exception";class d extends u{}d.kind="ArgumentException";class f extends u{}f.kind="IllegalArgumentException";class x{constructor(y){if(this.binarizer=y,y===null)throw new f("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(y,E){return this.binarizer.getBlackRow(y,E)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(y,E,O,$){const H=this.binarizer.getLuminanceSource().crop(y,E,O,$);return new x(this.binarizer.createBinarizer(H))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const y=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new x(this.binarizer.createBinarizer(y))}rotateCounterClockwise45(){const y=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new x(this.binarizer.createBinarizer(y))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class g extends u{static getChecksumInstance(){return new g}}g.kind="ChecksumException";class v{constructor(y){this.source=y}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class w{static arraycopy(y,E,O,$,H){for(;H--;)O[$++]=y[E++]}static currentTimeMillis(){return Date.now()}}class C extends u{}C.kind="IndexOutOfBoundsException";class N extends C{constructor(y=void 0,E=void 0){super(E),this.index=y,this.message=E}}N.kind="ArrayIndexOutOfBoundsException";class I{static fill(y,E){for(let O=0,$=y.length;O<$;O++)y[O]=E}static fillWithin(y,E,O,$){I.rangeCheck(y.length,E,O);for(let H=E;H<O;H++)y[H]=$}static rangeCheck(y,E,O){if(E>O)throw new f("fromIndex("+E+") > toIndex("+O+")");if(E<0)throw new N(E);if(O>y)throw new N(O)}static asList(...y){return y}static create(y,E,O){return Array.from({length:y}).map(H=>Array.from({length:E}).fill(O))}static createInt32Array(y,E,O){return Array.from({length:y}).map(H=>Int32Array.from({length:E}).fill(O))}static equals(y,E){if(!y||!E||!y.length||!E.length||y.length!==E.length)return!1;for(let O=0,$=y.length;O<$;O++)if(y[O]!==E[O])return!1;return!0}static hashCode(y){if(y===null)return 0;let E=1;for(const O of y)E=31*E+O;return E}static fillUint8Array(y,E){for(let O=0;O!==y.length;O++)y[O]=E}static copyOf(y,E){return y.slice(0,E)}static copyOfUint8Array(y,E){if(y.length<=E){const O=new Uint8Array(E);return O.set(y),O}return y.slice(0,E)}static copyOfRange(y,E,O){const $=O-E,H=new Int32Array($);return w.arraycopy(y,E,H,0,$),H}static binarySearch(y,E,O){O===void 0&&(O=I.numberComparator);let $=0,H=y.length-1;for(;$<=H;){const K=H+$>>1,le=O(E,y[K]);if(le>0)$=K+1;else if(le<0)H=K-1;else return K}return-$-1}static numberComparator(y,E){return y-E}}class P{static numberOfTrailingZeros(y){let E;if(y===0)return 32;let O=31;return E=y<<16,E!==0&&(O-=16,y=E),E=y<<8,E!==0&&(O-=8,y=E),E=y<<4,E!==0&&(O-=4,y=E),E=y<<2,E!==0&&(O-=2,y=E),O-(y<<1>>>31)}static numberOfLeadingZeros(y){if(y===0)return 32;let E=1;return y>>>16||(E+=16,y<<=16),y>>>24||(E+=8,y<<=8),y>>>28||(E+=4,y<<=4),y>>>30||(E+=2,y<<=2),E-=y>>>31,E}static toHexString(y){return y.toString(16)}static toBinaryString(y){return String(parseInt(String(y),2))}static bitCount(y){return y=y-(y>>>1&1431655765),y=(y&858993459)+(y>>>2&858993459),y=y+(y>>>4)&252645135,y=y+(y>>>8),y=y+(y>>>16),y&63}static truncDivision(y,E){return Math.trunc(y/E)}static parseInt(y,E=void 0){return parseInt(y,E)}}P.MIN_VALUE_32_BITS=-2147483648,P.MAX_VALUE=Number.MAX_SAFE_INTEGER;class R{constructor(y,E){y===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=y,E==null?this.bits=R.makeArray(y):this.bits=E)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(y){if(y>this.bits.length*32){const E=R.makeArray(y);w.arraycopy(this.bits,0,E,0,this.bits.length),this.bits=E}}get(y){return(this.bits[Math.floor(y/32)]&1<<(y&31))!==0}set(y){this.bits[Math.floor(y/32)]|=1<<(y&31)}flip(y){this.bits[Math.floor(y/32)]^=1<<(y&31)}getNextSet(y){const E=this.size;if(y>=E)return E;const O=this.bits;let $=Math.floor(y/32),H=O[$];H&=~((1<<(y&31))-1);const K=O.length;for(;H===0;){if(++$===K)return E;H=O[$]}const le=$*32+P.numberOfTrailingZeros(H);return le>E?E:le}getNextUnset(y){const E=this.size;if(y>=E)return E;const O=this.bits;let $=Math.floor(y/32),H=~O[$];H&=~((1<<(y&31))-1);const K=O.length;for(;H===0;){if(++$===K)return E;H=~O[$]}const le=$*32+P.numberOfTrailingZeros(H);return le>E?E:le}setBulk(y,E){this.bits[Math.floor(y/32)]=E}setRange(y,E){if(E<y||y<0||E>this.size)throw new f;if(E===y)return;E--;const O=Math.floor(y/32),$=Math.floor(E/32),H=this.bits;for(let K=O;K<=$;K++){const le=K>O?0:y&31,Te=(2<<(K<$?31:E&31))-(1<<le);H[K]|=Te}}clear(){const y=this.bits.length,E=this.bits;for(let O=0;O<y;O++)E[O]=0}isRange(y,E,O){if(E<y||y<0||E>this.size)throw new f;if(E===y)return!0;E--;const $=Math.floor(y/32),H=Math.floor(E/32),K=this.bits;for(let le=$;le<=H;le++){const ve=le>$?0:y&31,Ze=(2<<(le<H?31:E&31))-(1<<ve)&4294967295;if((K[le]&Ze)!==(O?Ze:0))return!1}return!0}appendBit(y){this.ensureCapacity(this.size+1),y&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(y,E){if(E<0||E>32)throw new f("Num bits must be between 0 and 32");this.ensureCapacity(this.size+E);for(let O=E;O>0;O--)this.appendBit((y>>O-1&1)===1)}appendBitArray(y){const E=y.size;this.ensureCapacity(this.size+E);for(let O=0;O<E;O++)this.appendBit(y.get(O))}xor(y){if(this.size!==y.size)throw new f("Sizes don't match");const E=this.bits;for(let O=0,$=E.length;O<$;O++)E[O]^=y.bits[O]}toBytes(y,E,O,$){for(let H=0;H<$;H++){let K=0;for(let le=0;le<8;le++)this.get(y)&&(K|=1<<7-le),y++;E[O+H]=K}}getBitArray(){return this.bits}reverse(){const y=new Int32Array(this.bits.length),E=Math.floor((this.size-1)/32),O=E+1,$=this.bits;for(let H=0;H<O;H++){let K=$[H];K=K>>1&1431655765|(K&1431655765)<<1,K=K>>2&858993459|(K&858993459)<<2,K=K>>4&252645135|(K&252645135)<<4,K=K>>8&16711935|(K&16711935)<<8,K=K>>16&65535|(K&65535)<<16,y[E-H]=K}if(this.size!==O*32){const H=O*32-this.size;let K=y[0]>>>H;for(let le=1;le<O;le++){const ve=y[le];K|=ve<<32-H,y[le-1]=K,K=ve>>>H}y[O-1]=K}this.bits=y}static makeArray(y){return new Int32Array(Math.floor((y+31)/32))}equals(y){if(!(y instanceof R))return!1;const E=y;return this.size===E.size&&I.equals(this.bits,E.bits)}hashCode(){return 31*this.size+I.hashCode(this.bits)}toString(){let y="";for(let E=0,O=this.size;E<O;E++)E&7||(y+=" "),y+=this.get(E)?"X":".";return y}clone(){return new R(this.size,this.bits.slice())}}var F;(function(dt){dt[dt.OTHER=0]="OTHER",dt[dt.PURE_BARCODE=1]="PURE_BARCODE",dt[dt.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",dt[dt.TRY_HARDER=3]="TRY_HARDER",dt[dt.CHARACTER_SET=4]="CHARACTER_SET",dt[dt.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",dt[dt.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",dt[dt.ASSUME_GS1=7]="ASSUME_GS1",dt[dt.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",dt[dt.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",dt[dt.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(F||(F={}));var U=F;class L extends u{static getFormatInstance(){return new L}}L.kind="FormatException";var z;(function(dt){dt[dt.Cp437=0]="Cp437",dt[dt.ISO8859_1=1]="ISO8859_1",dt[dt.ISO8859_2=2]="ISO8859_2",dt[dt.ISO8859_3=3]="ISO8859_3",dt[dt.ISO8859_4=4]="ISO8859_4",dt[dt.ISO8859_5=5]="ISO8859_5",dt[dt.ISO8859_6=6]="ISO8859_6",dt[dt.ISO8859_7=7]="ISO8859_7",dt[dt.ISO8859_8=8]="ISO8859_8",dt[dt.ISO8859_9=9]="ISO8859_9",dt[dt.ISO8859_10=10]="ISO8859_10",dt[dt.ISO8859_11=11]="ISO8859_11",dt[dt.ISO8859_13=12]="ISO8859_13",dt[dt.ISO8859_14=13]="ISO8859_14",dt[dt.ISO8859_15=14]="ISO8859_15",dt[dt.ISO8859_16=15]="ISO8859_16",dt[dt.SJIS=16]="SJIS",dt[dt.Cp1250=17]="Cp1250",dt[dt.Cp1251=18]="Cp1251",dt[dt.Cp1252=19]="Cp1252",dt[dt.Cp1256=20]="Cp1256",dt[dt.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",dt[dt.UTF8=22]="UTF8",dt[dt.ASCII=23]="ASCII",dt[dt.Big5=24]="Big5",dt[dt.GB18030=25]="GB18030",dt[dt.EUC_KR=26]="EUC_KR"})(z||(z={}));class Q{constructor(y,E,O,...$){this.valueIdentifier=y,this.name=O,typeof E=="number"?this.values=Int32Array.from([E]):this.values=E,this.otherEncodingNames=$,Q.VALUE_IDENTIFIER_TO_ECI.set(y,this),Q.NAME_TO_ECI.set(O,this);const H=this.values;for(let K=0,le=H.length;K!==le;K++){const ve=H[K];Q.VALUES_TO_ECI.set(ve,this)}for(const K of $)Q.NAME_TO_ECI.set(K,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(y){if(y<0||y>=900)throw new L("incorect value");const E=Q.VALUES_TO_ECI.get(y);if(E===void 0)throw new L("incorect value");return E}static getCharacterSetECIByName(y){const E=Q.NAME_TO_ECI.get(y);if(E===void 0)throw new L("incorect value");return E}equals(y){if(!(y instanceof Q))return!1;const E=y;return this.getName()===E.getName()}}Q.VALUE_IDENTIFIER_TO_ECI=new Map,Q.VALUES_TO_ECI=new Map,Q.NAME_TO_ECI=new Map,Q.Cp437=new Q(z.Cp437,Int32Array.from([0,2]),"Cp437"),Q.ISO8859_1=new Q(z.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),Q.ISO8859_2=new Q(z.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),Q.ISO8859_3=new Q(z.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),Q.ISO8859_4=new Q(z.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),Q.ISO8859_5=new Q(z.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),Q.ISO8859_6=new Q(z.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),Q.ISO8859_7=new Q(z.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),Q.ISO8859_8=new Q(z.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),Q.ISO8859_9=new Q(z.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),Q.ISO8859_10=new Q(z.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),Q.ISO8859_11=new Q(z.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),Q.ISO8859_13=new Q(z.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),Q.ISO8859_14=new Q(z.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),Q.ISO8859_15=new Q(z.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),Q.ISO8859_16=new Q(z.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),Q.SJIS=new Q(z.SJIS,20,"SJIS","Shift_JIS"),Q.Cp1250=new Q(z.Cp1250,21,"Cp1250","windows-1250"),Q.Cp1251=new Q(z.Cp1251,22,"Cp1251","windows-1251"),Q.Cp1252=new Q(z.Cp1252,23,"Cp1252","windows-1252"),Q.Cp1256=new Q(z.Cp1256,24,"Cp1256","windows-1256"),Q.UnicodeBigUnmarked=new Q(z.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),Q.UTF8=new Q(z.UTF8,26,"UTF8","UTF-8"),Q.ASCII=new Q(z.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),Q.Big5=new Q(z.Big5,28,"Big5"),Q.GB18030=new Q(z.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),Q.EUC_KR=new Q(z.EUC_KR,30,"EUC_KR","EUC-KR");class ne extends u{}ne.kind="UnsupportedOperationException";class J{static decode(y,E){const O=this.encodingName(E);return this.customDecoder?this.customDecoder(y,O):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(O)?this.decodeFallback(y,O):new TextDecoder(O).decode(y)}static shouldDecodeOnFallback(y){return!J.isBrowser()&&y==="ISO-8859-1"}static encode(y,E){const O=this.encodingName(E);return this.customEncoder?this.customEncoder(y,O):typeof TextEncoder>"u"?this.encodeFallback(y):new TextEncoder().encode(y)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(y){return typeof y=="string"?y:y.getName()}static encodingCharacterSet(y){return y instanceof Q?y:Q.getCharacterSetECIByName(y)}static decodeFallback(y,E){const O=this.encodingCharacterSet(E);if(J.isDecodeFallbackSupported(O)){let $="";for(let H=0,K=y.length;H<K;H++){let le=y[H].toString(16);le.length<2&&(le="0"+le),$+="%"+le}return decodeURIComponent($)}if(O.equals(Q.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(y.buffer));throw new ne(`Encoding ${this.encodingName(E)} not supported by fallback.`)}static isDecodeFallbackSupported(y){return y.equals(Q.UTF8)||y.equals(Q.ISO8859_1)||y.equals(Q.ASCII)}static encodeFallback(y){const O=btoa(unescape(encodeURIComponent(y))).split(""),$=[];for(let H=0;H<O.length;H++)$.push(O[H].charCodeAt(0));return new Uint8Array($)}}class X{static castAsNonUtf8Char(y,E=null){const O=E?E.getName():this.ISO88591;return J.decode(new Uint8Array([y]),O)}static guessEncoding(y,E){if(E!=null&&E.get(U.CHARACTER_SET)!==void 0)return E.get(U.CHARACTER_SET).toString();const O=y.length;let $=!0,H=!0,K=!0,le=0,ve=0,Te=0,Ze=0,ht=0,Tt=0,tn=0,vt=0,$t=0,Kt=0,_n=0;const ur=y.length>3&&y[0]===239&&y[1]===187&&y[2]===191;for(let br=0;br<O&&($||H||K);br++){const wr=y[br]&255;K&&(le>0?wr&128?le--:K=!1:wr&128&&(wr&64?(le++,wr&32?(le++,wr&16?(le++,wr&8?K=!1:Ze++):Te++):ve++):K=!1)),$&&(wr>127&&wr<160?$=!1:wr>159&&(wr<192||wr===215||wr===247)&&_n++),H&&(ht>0?wr<64||wr===127||wr>252?H=!1:ht--:wr===128||wr===160||wr>239?H=!1:wr>160&&wr<224?(Tt++,vt=0,tn++,tn>$t&&($t=tn)):wr>127?(ht++,tn=0,vt++,vt>Kt&&(Kt=vt)):(tn=0,vt=0))}return K&&le>0&&(K=!1),H&&ht>0&&(H=!1),K&&(ur||ve+Te+Ze>0)?X.UTF8:H&&(X.ASSUME_SHIFT_JIS||$t>=3||Kt>=3)?X.SHIFT_JIS:$&&H?$t===2&&Tt===2||_n*10>=O?X.SHIFT_JIS:X.ISO88591:$?X.ISO88591:H?X.SHIFT_JIS:K?X.UTF8:X.PLATFORM_DEFAULT_ENCODING}static format(y,...E){let O=-1;function $(K,le,ve,Te,Ze,ht){if(K==="%%")return"%";if(E[++O]===void 0)return;K=Te?parseInt(Te.substr(1)):void 0;let Tt=Ze?parseInt(Ze.substr(1)):void 0,tn;switch(ht){case"s":tn=E[O];break;case"c":tn=E[O][0];break;case"f":tn=parseFloat(E[O]).toFixed(K);break;case"p":tn=parseFloat(E[O]).toPrecision(K);break;case"e":tn=parseFloat(E[O]).toExponential(K);break;case"x":tn=parseInt(E[O]).toString(Tt||16);break;case"d":tn=parseFloat(parseInt(E[O],Tt||10).toPrecision(K)).toFixed(0);break}tn=typeof tn=="object"?JSON.stringify(tn):(+tn).toString(Tt);let vt=parseInt(ve),$t=ve&&ve[0]+""=="0"?"0":" ";for(;tn.length<vt;)tn=le!==void 0?tn+$t:$t+tn;return tn}let H=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return y.replace(H,$)}static getBytes(y,E){return J.encode(y,E)}static getCharCode(y,E=0){return y.charCodeAt(E)}static getCharAt(y){return String.fromCharCode(y)}}X.SHIFT_JIS=Q.SJIS.getName(),X.GB2312="GB2312",X.ISO88591=Q.ISO8859_1.getName(),X.EUC_JP="EUC_JP",X.UTF8=Q.UTF8.getName(),X.PLATFORM_DEFAULT_ENCODING=X.UTF8,X.ASSUME_SHIFT_JIS=!1;class re{constructor(y=""){this.value=y}enableDecoding(y){return this.encoding=y,this}append(y){return typeof y=="string"?this.value+=y.toString():this.encoding?this.value+=X.castAsNonUtf8Char(y,this.encoding):this.value+=String.fromCharCode(y),this}appendChars(y,E,O){for(let $=E;E<E+O;$++)this.append(y[$]);return this}length(){return this.value.length}charAt(y){return this.value.charAt(y)}deleteCharAt(y){this.value=this.value.substr(0,y)+this.value.substring(y+1)}setCharAt(y,E){this.value=this.value.substr(0,y)+E+this.value.substr(y+1)}substring(y,E){return this.value.substring(y,E)}setLengthToZero(){this.value=""}toString(){return this.value}insert(y,E){this.value=this.value.substr(0,y)+E+this.value.substr(y+E.length)}}class pe{constructor(y,E,O,$){if(this.width=y,this.height=E,this.rowSize=O,this.bits=$,E==null&&(E=y),this.height=E,y<1||E<1)throw new f("Both dimensions must be greater than 0");O==null&&(O=Math.floor((y+31)/32)),this.rowSize=O,$==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(y){const E=y.length,O=y[0].length,$=new pe(O,E);for(let H=0;H<E;H++){const K=y[H];for(let le=0;le<O;le++)K[le]&&$.set(le,H)}return $}static parseFromString(y,E,O){if(y===null)throw new f("stringRepresentation cannot be null");const $=new Array(y.length);let H=0,K=0,le=-1,ve=0,Te=0;for(;Te<y.length;)if(y.charAt(Te)===`
`||y.charAt(Te)==="\r"){if(H>K){if(le===-1)le=H-K;else if(H-K!==le)throw new f("row lengths do not match");K=H,ve++}Te++}else if(y.substring(Te,Te+E.length)===E)Te+=E.length,$[H]=!0,H++;else if(y.substring(Te,Te+O.length)===O)Te+=O.length,$[H]=!1,H++;else throw new f("illegal character encountered: "+y.substring(Te));if(H>K){if(le===-1)le=H-K;else if(H-K!==le)throw new f("row lengths do not match");ve++}const Ze=new pe(le,ve);for(let ht=0;ht<H;ht++)$[ht]&&Ze.set(Math.floor(ht%le),Math.floor(ht/le));return Ze}get(y,E){const O=E*this.rowSize+Math.floor(y/32);return(this.bits[O]>>>(y&31)&1)!==0}set(y,E){const O=E*this.rowSize+Math.floor(y/32);this.bits[O]|=1<<(y&31)&4294967295}unset(y,E){const O=E*this.rowSize+Math.floor(y/32);this.bits[O]&=~(1<<(y&31)&4294967295)}flip(y,E){const O=E*this.rowSize+Math.floor(y/32);this.bits[O]^=1<<(y&31)&4294967295}xor(y){if(this.width!==y.getWidth()||this.height!==y.getHeight()||this.rowSize!==y.getRowSize())throw new f("input matrix dimensions do not match");const E=new R(Math.floor(this.width/32)+1),O=this.rowSize,$=this.bits;for(let H=0,K=this.height;H<K;H++){const le=H*O,ve=y.getRow(H,E).getBitArray();for(let Te=0;Te<O;Te++)$[le+Te]^=ve[Te]}}clear(){const y=this.bits,E=y.length;for(let O=0;O<E;O++)y[O]=0}setRegion(y,E,O,$){if(E<0||y<0)throw new f("Left and top must be nonnegative");if($<1||O<1)throw new f("Height and width must be at least 1");const H=y+O,K=E+$;if(K>this.height||H>this.width)throw new f("The region must fit inside the matrix");const le=this.rowSize,ve=this.bits;for(let Te=E;Te<K;Te++){const Ze=Te*le;for(let ht=y;ht<H;ht++)ve[Ze+Math.floor(ht/32)]|=1<<(ht&31)&4294967295}}getRow(y,E){E==null||E.getSize()<this.width?E=new R(this.width):E.clear();const O=this.rowSize,$=this.bits,H=y*O;for(let K=0;K<O;K++)E.setBulk(K*32,$[H+K]);return E}setRow(y,E){w.arraycopy(E.getBitArray(),0,this.bits,y*this.rowSize,this.rowSize)}rotate180(){const y=this.getWidth(),E=this.getHeight();let O=new R(y),$=new R(y);for(let H=0,K=Math.floor((E+1)/2);H<K;H++)O=this.getRow(H,O),$=this.getRow(E-1-H,$),O.reverse(),$.reverse(),this.setRow(H,$),this.setRow(E-1-H,O)}getEnclosingRectangle(){const y=this.width,E=this.height,O=this.rowSize,$=this.bits;let H=y,K=E,le=-1,ve=-1;for(let Te=0;Te<E;Te++)for(let Ze=0;Ze<O;Ze++){const ht=$[Te*O+Ze];if(ht!==0){if(Te<K&&(K=Te),Te>ve&&(ve=Te),Ze*32<H){let Tt=0;for(;!(ht<<31-Tt&4294967295);)Tt++;Ze*32+Tt<H&&(H=Ze*32+Tt)}if(Ze*32+31>le){let Tt=31;for(;!(ht>>>Tt);)Tt--;Ze*32+Tt>le&&(le=Ze*32+Tt)}}}return le<H||ve<K?null:Int32Array.from([H,K,le-H+1,ve-K+1])}getTopLeftOnBit(){const y=this.rowSize,E=this.bits;let O=0;for(;O<E.length&&E[O]===0;)O++;if(O===E.length)return null;const $=O/y;let H=O%y*32;const K=E[O];let le=0;for(;!(K<<31-le&4294967295);)le++;return H+=le,Int32Array.from([H,$])}getBottomRightOnBit(){const y=this.rowSize,E=this.bits;let O=E.length-1;for(;O>=0&&E[O]===0;)O--;if(O<0)return null;const $=Math.floor(O/y);let H=Math.floor(O%y)*32;const K=E[O];let le=31;for(;!(K>>>le);)le--;return H+=le,Int32Array.from([H,$])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(y){if(!(y instanceof pe))return!1;const E=y;return this.width===E.width&&this.height===E.height&&this.rowSize===E.rowSize&&I.equals(this.bits,E.bits)}hashCode(){let y=this.width;return y=31*y+this.width,y=31*y+this.height,y=31*y+this.rowSize,y=31*y+I.hashCode(this.bits),y}toString(y="X ",E=" ",O=`
`){return this.buildToString(y,E,O)}buildToString(y,E,O){let $=new re;for(let H=0,K=this.height;H<K;H++){for(let le=0,ve=this.width;le<ve;le++)$.append(this.get(le,H)?y:E);$.append(O)}return $.toString()}clone(){return new pe(this.width,this.height,this.rowSize,this.bits.slice())}}class Y extends u{static getNotFoundInstance(){return new Y}}Y.kind="NotFoundException";class ie extends v{constructor(y){super(y),this.luminances=ie.EMPTY,this.buckets=new Int32Array(ie.LUMINANCE_BUCKETS)}getBlackRow(y,E){const O=this.getLuminanceSource(),$=O.getWidth();E==null||E.getSize()<$?E=new R($):E.clear(),this.initArrays($);const H=O.getRow(y,this.luminances),K=this.buckets;for(let ve=0;ve<$;ve++)K[(H[ve]&255)>>ie.LUMINANCE_SHIFT]++;const le=ie.estimateBlackPoint(K);if($<3)for(let ve=0;ve<$;ve++)(H[ve]&255)<le&&E.set(ve);else{let ve=H[0]&255,Te=H[1]&255;for(let Ze=1;Ze<$-1;Ze++){const ht=H[Ze+1]&255;(Te*4-ve-ht)/2<le&&E.set(Ze),ve=Te,Te=ht}}return E}getBlackMatrix(){const y=this.getLuminanceSource(),E=y.getWidth(),O=y.getHeight(),$=new pe(E,O);this.initArrays(E);const H=this.buckets;for(let ve=1;ve<5;ve++){const Te=Math.floor(O*ve/5),Ze=y.getRow(Te,this.luminances),ht=Math.floor(E*4/5);for(let Tt=Math.floor(E/5);Tt<ht;Tt++){const tn=Ze[Tt]&255;H[tn>>ie.LUMINANCE_SHIFT]++}}const K=ie.estimateBlackPoint(H),le=y.getMatrix();for(let ve=0;ve<O;ve++){const Te=ve*E;for(let Ze=0;Ze<E;Ze++)(le[Te+Ze]&255)<K&&$.set(Ze,ve)}return $}createBinarizer(y){return new ie(y)}initArrays(y){this.luminances.length<y&&(this.luminances=new Uint8ClampedArray(y));const E=this.buckets;for(let O=0;O<ie.LUMINANCE_BUCKETS;O++)E[O]=0}static estimateBlackPoint(y){const E=y.length;let O=0,$=0,H=0;for(let Ze=0;Ze<E;Ze++)y[Ze]>H&&($=Ze,H=y[Ze]),y[Ze]>O&&(O=y[Ze]);let K=0,le=0;for(let Ze=0;Ze<E;Ze++){const ht=Ze-$,Tt=y[Ze]*ht*ht;Tt>le&&(K=Ze,le=Tt)}if($>K){const Ze=$;$=K,K=Ze}if(K-$<=E/16)throw new Y;let ve=K-1,Te=-1;for(let Ze=K-1;Ze>$;Ze--){const ht=Ze-$,Tt=ht*ht*(K-Ze)*(O-y[Ze]);Tt>Te&&(ve=Ze,Te=Tt)}return ve<<ie.LUMINANCE_SHIFT}}ie.LUMINANCE_BITS=5,ie.LUMINANCE_SHIFT=8-ie.LUMINANCE_BITS,ie.LUMINANCE_BUCKETS=1<<ie.LUMINANCE_BITS,ie.EMPTY=Uint8ClampedArray.from([0]);class oe extends ie{constructor(y){super(y),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const y=this.getLuminanceSource(),E=y.getWidth(),O=y.getHeight();if(E>=oe.MINIMUM_DIMENSION&&O>=oe.MINIMUM_DIMENSION){const $=y.getMatrix();let H=E>>oe.BLOCK_SIZE_POWER;E&oe.BLOCK_SIZE_MASK&&H++;let K=O>>oe.BLOCK_SIZE_POWER;O&oe.BLOCK_SIZE_MASK&&K++;const le=oe.calculateBlackPoints($,H,K,E,O),ve=new pe(E,O);oe.calculateThresholdForBlock($,H,K,E,O,le,ve),this.matrix=ve}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(y){return new oe(y)}static calculateThresholdForBlock(y,E,O,$,H,K,le){const ve=H-oe.BLOCK_SIZE,Te=$-oe.BLOCK_SIZE;for(let Ze=0;Ze<O;Ze++){let ht=Ze<<oe.BLOCK_SIZE_POWER;ht>ve&&(ht=ve);const Tt=oe.cap(Ze,2,O-3);for(let tn=0;tn<E;tn++){let vt=tn<<oe.BLOCK_SIZE_POWER;vt>Te&&(vt=Te);const $t=oe.cap(tn,2,E-3);let Kt=0;for(let ur=-2;ur<=2;ur++){const br=K[Tt+ur];Kt+=br[$t-2]+br[$t-1]+br[$t]+br[$t+1]+br[$t+2]}const _n=Kt/25;oe.thresholdBlock(y,vt,ht,_n,$,le)}}}static cap(y,E,O){return y<E?E:y>O?O:y}static thresholdBlock(y,E,O,$,H,K){for(let le=0,ve=O*H+E;le<oe.BLOCK_SIZE;le++,ve+=H)for(let Te=0;Te<oe.BLOCK_SIZE;Te++)(y[ve+Te]&255)<=$&&K.set(E+Te,O+le)}static calculateBlackPoints(y,E,O,$,H){const K=H-oe.BLOCK_SIZE,le=$-oe.BLOCK_SIZE,ve=new Array(O);for(let Te=0;Te<O;Te++){ve[Te]=new Int32Array(E);let Ze=Te<<oe.BLOCK_SIZE_POWER;Ze>K&&(Ze=K);for(let ht=0;ht<E;ht++){let Tt=ht<<oe.BLOCK_SIZE_POWER;Tt>le&&(Tt=le);let tn=0,vt=255,$t=0;for(let _n=0,ur=Ze*$+Tt;_n<oe.BLOCK_SIZE;_n++,ur+=$){for(let br=0;br<oe.BLOCK_SIZE;br++){const wr=y[ur+br]&255;tn+=wr,wr<vt&&(vt=wr),wr>$t&&($t=wr)}if($t-vt>oe.MIN_DYNAMIC_RANGE)for(_n++,ur+=$;_n<oe.BLOCK_SIZE;_n++,ur+=$)for(let br=0;br<oe.BLOCK_SIZE;br++)tn+=y[ur+br]&255}let Kt=tn>>oe.BLOCK_SIZE_POWER*2;if($t-vt<=oe.MIN_DYNAMIC_RANGE&&(Kt=vt/2,Te>0&&ht>0)){const _n=(ve[Te-1][ht]+2*ve[Te][ht-1]+ve[Te-1][ht-1])/4;vt<_n&&(Kt=_n)}ve[Te][ht]=Kt}}return ve}}oe.BLOCK_SIZE_POWER=3,oe.BLOCK_SIZE=1<<oe.BLOCK_SIZE_POWER,oe.BLOCK_SIZE_MASK=oe.BLOCK_SIZE-1,oe.MINIMUM_DIMENSION=oe.BLOCK_SIZE*5,oe.MIN_DYNAMIC_RANGE=24;class G{constructor(y,E){this.width=y,this.height=E}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(y,E,O,$){throw new ne("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new ne("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new ne("This luminance source does not support rotation by 45 degrees.")}toString(){const y=new Uint8ClampedArray(this.width);let E=new re;for(let O=0;O<this.height;O++){const $=this.getRow(O,y);for(let H=0;H<this.width;H++){const K=$[H]&255;let le;K<64?le="#":K<128?le="+":K<192?le=".":le=" ",E.append(le)}E.append(`
`)}return E.toString()}}class V extends G{constructor(y){super(y.getWidth(),y.getHeight()),this.delegate=y}getRow(y,E){const O=this.delegate.getRow(y,E),$=this.getWidth();for(let H=0;H<$;H++)O[H]=255-(O[H]&255);return O}getMatrix(){const y=this.delegate.getMatrix(),E=this.getWidth()*this.getHeight(),O=new Uint8ClampedArray(E);for(let $=0;$<E;$++)O[$]=255-(y[$]&255);return O}isCropSupported(){return this.delegate.isCropSupported()}crop(y,E,O,$){return new V(this.delegate.crop(y,E,O,$))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new V(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new V(this.delegate.rotateCounterClockwise45())}}class te extends G{constructor(y){super(y.width,y.height),this.canvas=y,this.tempCanvasElement=null,this.buffer=te.makeBufferFromCanvasImageData(y)}static makeBufferFromCanvasImageData(y){const E=y.getContext("2d").getImageData(0,0,y.width,y.height);return te.toGrayscaleBuffer(E.data,y.width,y.height)}static toGrayscaleBuffer(y,E,O){const $=new Uint8ClampedArray(E*O);for(let H=0,K=0,le=y.length;H<le;H+=4,K++){let ve;if(y[H+3]===0)ve=255;else{const Ze=y[H],ht=y[H+1],Tt=y[H+2];ve=306*Ze+601*ht+117*Tt+512>>10}$[K]=ve}return $}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const O=this.getWidth(),$=y*O;return E===null?E=this.buffer.slice($,$+O):(E.length<O&&(E=new Uint8ClampedArray(O)),E.set(this.buffer.slice($,$+O))),E}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(y,E,O,$){return super.crop(y,E,O,$),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const y=this.canvas.ownerDocument.createElement("canvas");y.width=this.canvas.width,y.height=this.canvas.height,this.tempCanvasElement=y}return this.tempCanvasElement}rotate(y){const E=this.getTempCanvasElement(),O=E.getContext("2d"),$=y*te.DEGREE_TO_RADIANS,H=this.canvas.width,K=this.canvas.height,le=Math.ceil(Math.abs(Math.cos($))*H+Math.abs(Math.sin($))*K),ve=Math.ceil(Math.abs(Math.sin($))*H+Math.abs(Math.cos($))*K);return E.width=le,E.height=ve,O.translate(le/2,ve/2),O.rotate($),O.drawImage(this.canvas,H/-2,K/-2),this.buffer=te.makeBufferFromCanvasImageData(E),this}invert(){return new V(this)}}te.DEGREE_TO_RADIANS=Math.PI/180;class ae{constructor(y,E,O){this.deviceId=y,this.label=E,this.kind="videoinput",this.groupId=O||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var he=(globalThis||Tu||self||window||void 0)&&(globalThis||Tu||self||window||void 0).__awaiter||function(dt,y,E,O){function $(H){return H instanceof E?H:new E(function(K){K(H)})}return new(E||(E=Promise))(function(H,K){function le(Ze){try{Te(O.next(Ze))}catch(ht){K(ht)}}function ve(Ze){try{Te(O.throw(Ze))}catch(ht){K(ht)}}function Te(Ze){Ze.done?H(Ze.value):$(Ze.value).then(le,ve)}Te((O=O.apply(dt,y||[])).next())})};class Ce{constructor(y,E=500,O){this.reader=y,this.timeBetweenScansMillis=E,this._hints=O,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return typeof navigator<"u"}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(y){this._timeBetweenDecodingAttempts=y<0?0:y}set hints(y){this._hints=y||null}get hints(){return this._hints}listVideoInputDevices(){return he(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const y=yield navigator.mediaDevices.enumerateDevices(),E=[];for(const O of y){const $=O.kind==="video"?"videoinput":O.kind;if($!=="videoinput")continue;const H=O.deviceId||O.id,K=O.label||`Video device ${E.length+1}`,le=O.groupId,ve={deviceId:H,label:K,kind:$,groupId:le};E.push(ve)}return E})}getVideoInputDevices(){return he(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(E=>new ae(E.deviceId,E.label))})}findDeviceById(y){return he(this,void 0,void 0,function*(){const E=yield this.listVideoInputDevices();return E?E.find(O=>O.deviceId===y):null})}decodeFromInputVideoDevice(y,E){return he(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(y,E)})}decodeOnceFromVideoDevice(y,E){return he(this,void 0,void 0,function*(){this.reset();let O;y?O={deviceId:{exact:y}}:O={facingMode:"environment"};const $={video:O};return yield this.decodeOnceFromConstraints($,E)})}decodeOnceFromConstraints(y,E){return he(this,void 0,void 0,function*(){const O=yield navigator.mediaDevices.getUserMedia(y);return yield this.decodeOnceFromStream(O,E)})}decodeOnceFromStream(y,E){return he(this,void 0,void 0,function*(){this.reset();const O=yield this.attachStreamToVideo(y,E);return yield this.decodeOnce(O)})}decodeFromInputVideoDeviceContinuously(y,E,O){return he(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(y,E,O)})}decodeFromVideoDevice(y,E,O){return he(this,void 0,void 0,function*(){let $;y?$={deviceId:{exact:y}}:$={facingMode:"environment"};const H={video:$};return yield this.decodeFromConstraints(H,E,O)})}decodeFromConstraints(y,E,O){return he(this,void 0,void 0,function*(){const $=yield navigator.mediaDevices.getUserMedia(y);return yield this.decodeFromStream($,E,O)})}decodeFromStream(y,E,O){return he(this,void 0,void 0,function*(){this.reset();const $=yield this.attachStreamToVideo(y,E);return yield this.decodeContinuously($,O)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(y,E){return he(this,void 0,void 0,function*(){const O=this.prepareVideoElement(E);return this.addVideoSource(O,y),this.videoElement=O,this.stream=y,yield this.playVideoOnLoadAsync(O),O})}playVideoOnLoadAsync(y){return new Promise((E,O)=>this.playVideoOnLoad(y,()=>E()))}playVideoOnLoad(y,E){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(y),y.addEventListener("ended",this.videoEndedListener),y.addEventListener("canplay",this.videoCanPlayListener),y.addEventListener("playing",E),this.tryPlayVideo(y)}isVideoPlaying(y){return y.currentTime>0&&!y.paused&&!y.ended&&y.readyState>2}tryPlayVideo(y){return he(this,void 0,void 0,function*(){if(this.isVideoPlaying(y)){console.warn("Trying to play video that is already playing.");return}try{yield y.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(y,E){const O=document.getElementById(y);if(!O)throw new d(`element with id '${y}' not found`);if(O.nodeName.toLowerCase()!==E.toLowerCase())throw new d(`element with id '${y}' must be an ${E} element`);return O}decodeFromImage(y,E){if(!y&&!E)throw new d("either imageElement with a src set or an url must be provided");return E&&!y?this.decodeFromImageUrl(E):this.decodeFromImageElement(y)}decodeFromVideo(y,E){if(!y&&!E)throw new d("Either an element with a src set or an URL must be provided");return E&&!y?this.decodeFromVideoUrl(E):this.decodeFromVideoElement(y)}decodeFromVideoContinuously(y,E,O){if(y===void 0&&E===void 0)throw new d("Either an element with a src set or an URL must be provided");return E&&!y?this.decodeFromVideoUrlContinuously(E,O):this.decodeFromVideoElementContinuously(y,O)}decodeFromImageElement(y){if(!y)throw new d("An image element must be provided.");this.reset();const E=this.prepareImageElement(y);this.imageElement=E;let O;return this.isImageLoaded(E)?O=this.decodeOnce(E,!1,!0):O=this._decodeOnLoadImage(E),O}decodeFromVideoElement(y){const E=this._decodeFromVideoElementSetup(y);return this._decodeOnLoadVideo(E)}decodeFromVideoElementContinuously(y,E){const O=this._decodeFromVideoElementSetup(y);return this._decodeOnLoadVideoContinuously(O,E)}_decodeFromVideoElementSetup(y){if(!y)throw new d("A video element must be provided.");this.reset();const E=this.prepareVideoElement(y);return this.videoElement=E,E}decodeFromImageUrl(y){if(!y)throw new d("An URL must be provided.");this.reset();const E=this.prepareImageElement();this.imageElement=E;const O=this._decodeOnLoadImage(E);return E.src=y,O}decodeFromVideoUrl(y){if(!y)throw new d("An URL must be provided.");this.reset();const E=this.prepareVideoElement(),O=this.decodeFromVideoElement(E);return E.src=y,O}decodeFromVideoUrlContinuously(y,E){if(!y)throw new d("An URL must be provided.");this.reset();const O=this.prepareVideoElement(),$=this.decodeFromVideoElementContinuously(O,E);return O.src=y,$}_decodeOnLoadImage(y){return new Promise((E,O)=>{this.imageLoadedListener=()=>this.decodeOnce(y,!1,!0).then(E,O),y.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(y){return he(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(y),yield this.decodeOnce(y)})}_decodeOnLoadVideoContinuously(y,E){return he(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(y),this.decodeContinuously(y,E)})}isImageLoaded(y){return!(!y.complete||y.naturalWidth===0)}prepareImageElement(y){let E;return typeof y>"u"&&(E=document.createElement("img"),E.width=200,E.height=200),typeof y=="string"&&(E=this.getMediaElement(y,"img")),y instanceof HTMLImageElement&&(E=y),E}prepareVideoElement(y){let E;return!y&&typeof document<"u"&&(E=document.createElement("video"),E.width=200,E.height=200),typeof y=="string"&&(E=this.getMediaElement(y,"video")),y instanceof HTMLVideoElement&&(E=y),E.setAttribute("autoplay","true"),E.setAttribute("muted","true"),E.setAttribute("playsinline","true"),E}decodeOnce(y,E=!0,O=!0){this._stopAsyncDecode=!1;const $=(H,K)=>{if(this._stopAsyncDecode){K(new Y("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const le=this.decode(y);H(le)}catch(le){const ve=E&&le instanceof Y,Ze=(le instanceof g||le instanceof L)&&O;if(ve||Ze)return setTimeout($,this._timeBetweenDecodingAttempts,H,K);K(le)}};return new Promise((H,K)=>$(H,K))}decodeContinuously(y,E){this._stopContinuousDecode=!1;const O=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const $=this.decode(y);E($,null),setTimeout(O,this.timeBetweenScansMillis)}catch($){E(null,$);const H=$ instanceof g||$ instanceof L,K=$ instanceof Y;(H||K)&&setTimeout(O,this._timeBetweenDecodingAttempts)}};O()}decode(y){const E=this.createBinaryBitmap(y);return this.decodeBitmap(E)}_isHTMLVideoElement(y){return y.videoWidth!==0}drawFrameOnCanvas(y,E,O){E||(E={sx:0,sy:0,sWidth:y.videoWidth,sHeight:y.videoHeight,dx:0,dy:0,dWidth:y.videoWidth,dHeight:y.videoHeight}),O||(O=this.captureCanvasContext),O.drawImage(y,E.sx,E.sy,E.sWidth,E.sHeight,E.dx,E.dy,E.dWidth,E.dHeight)}drawImageOnCanvas(y,E,O=this.captureCanvasContext){E||(E={sx:0,sy:0,sWidth:y.naturalWidth,sHeight:y.naturalHeight,dx:0,dy:0,dWidth:y.naturalWidth,dHeight:y.naturalHeight}),O||(O=this.captureCanvasContext),O.drawImage(y,E.sx,E.sy,E.sWidth,E.sHeight,E.dx,E.dy,E.dWidth,E.dHeight)}createBinaryBitmap(y){this.getCaptureCanvasContext(y),this._isHTMLVideoElement(y)?this.drawFrameOnCanvas(y):this.drawImageOnCanvas(y);const E=this.getCaptureCanvas(y),O=new te(E),$=new oe(O);return new x($)}getCaptureCanvasContext(y){if(!this.captureCanvasContext){const O=this.getCaptureCanvas(y).getContext("2d");this.captureCanvasContext=O}return this.captureCanvasContext}getCaptureCanvas(y){if(!this.captureCanvas){const E=this.createCaptureCanvas(y);this.captureCanvas=E}return this.captureCanvas}decodeBitmap(y){return this.reader.decode(y,this._hints)}createCaptureCanvas(y){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const E=document.createElement("canvas");let O,$;return typeof y<"u"&&(y instanceof HTMLVideoElement?(O=y.videoWidth,$=y.videoHeight):y instanceof HTMLImageElement&&(O=y.naturalWidth||y.width,$=y.naturalHeight||y.height)),E.style.width=O+"px",E.style.height=$+"px",E.width=O,E.height=$,E}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(y=>y.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(y,E){try{y.srcObject=E}catch{y.src=URL.createObjectURL(E)}}cleanVideoSource(y){try{y.srcObject=null}catch{y.src=""}this.videoElement.removeAttribute("src")}}class ce{constructor(y,E,O=E==null?0:8*E.length,$,H,K=w.currentTimeMillis()){this.text=y,this.rawBytes=E,this.numBits=O,this.resultPoints=$,this.format=H,this.timestamp=K,this.text=y,this.rawBytes=E,O==null?this.numBits=E==null?0:8*E.length:this.numBits=O,this.resultPoints=$,this.format=H,this.resultMetadata=null,K==null?this.timestamp=w.currentTimeMillis():this.timestamp=K}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(y,E){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(y,E)}putAllMetadata(y){y!==null&&(this.resultMetadata===null?this.resultMetadata=y:this.resultMetadata=new Map(y))}addResultPoints(y){const E=this.resultPoints;if(E===null)this.resultPoints=y;else if(y!==null&&y.length>0){const O=new Array(E.length+y.length);w.arraycopy(E,0,O,0,E.length),w.arraycopy(y,0,O,E.length,y.length),this.resultPoints=O}}getTimestamp(){return this.timestamp}toString(){return this.text}}var ge;(function(dt){dt[dt.AZTEC=0]="AZTEC",dt[dt.CODABAR=1]="CODABAR",dt[dt.CODE_39=2]="CODE_39",dt[dt.CODE_93=3]="CODE_93",dt[dt.CODE_128=4]="CODE_128",dt[dt.DATA_MATRIX=5]="DATA_MATRIX",dt[dt.EAN_8=6]="EAN_8",dt[dt.EAN_13=7]="EAN_13",dt[dt.ITF=8]="ITF",dt[dt.MAXICODE=9]="MAXICODE",dt[dt.PDF_417=10]="PDF_417",dt[dt.QR_CODE=11]="QR_CODE",dt[dt.RSS_14=12]="RSS_14",dt[dt.RSS_EXPANDED=13]="RSS_EXPANDED",dt[dt.UPC_A=14]="UPC_A",dt[dt.UPC_E=15]="UPC_E",dt[dt.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(ge||(ge={}));var Ae=ge,ye;(function(dt){dt[dt.OTHER=0]="OTHER",dt[dt.ORIENTATION=1]="ORIENTATION",dt[dt.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",dt[dt.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",dt[dt.ISSUE_NUMBER=4]="ISSUE_NUMBER",dt[dt.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",dt[dt.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",dt[dt.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",dt[dt.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",dt[dt.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",dt[dt.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(ye||(ye={}));var je=ye;class Ie{constructor(y,E,O,$,H=-1,K=-1){this.rawBytes=y,this.text=E,this.byteSegments=O,this.ecLevel=$,this.structuredAppendSequenceNumber=H,this.structuredAppendParity=K,this.numBits=y==null?0:8*y.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(y){this.numBits=y}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(y){this.errorsCorrected=y}getErasures(){return this.erasures}setErasures(y){this.erasures=y}getOther(){return this.other}setOther(y){this.other=y}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Re{exp(y){return this.expTable[y]}log(y){if(y===0)throw new f;return this.logTable[y]}static addOrSubtract(y,E){return y^E}}class Qe{constructor(y,E){if(E.length===0)throw new f;this.field=y;const O=E.length;if(O>1&&E[0]===0){let $=1;for(;$<O&&E[$]===0;)$++;$===O?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(O-$),w.arraycopy(E,$,this.coefficients,0,this.coefficients.length))}else this.coefficients=E}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(y){return this.coefficients[this.coefficients.length-1-y]}evaluateAt(y){if(y===0)return this.getCoefficient(0);const E=this.coefficients;let O;if(y===1){O=0;for(let K=0,le=E.length;K!==le;K++){const ve=E[K];O=Re.addOrSubtract(O,ve)}return O}O=E[0];const $=E.length,H=this.field;for(let K=1;K<$;K++)O=Re.addOrSubtract(H.multiply(y,O),E[K]);return O}addOrSubtract(y){if(!this.field.equals(y.field))throw new f("GenericGFPolys do not have same GenericGF field");if(this.isZero())return y;if(y.isZero())return this;let E=this.coefficients,O=y.coefficients;if(E.length>O.length){const K=E;E=O,O=K}let $=new Int32Array(O.length);const H=O.length-E.length;w.arraycopy(O,0,$,0,H);for(let K=H;K<O.length;K++)$[K]=Re.addOrSubtract(E[K-H],O[K]);return new Qe(this.field,$)}multiply(y){if(!this.field.equals(y.field))throw new f("GenericGFPolys do not have same GenericGF field");if(this.isZero()||y.isZero())return this.field.getZero();const E=this.coefficients,O=E.length,$=y.coefficients,H=$.length,K=new Int32Array(O+H-1),le=this.field;for(let ve=0;ve<O;ve++){const Te=E[ve];for(let Ze=0;Ze<H;Ze++)K[ve+Ze]=Re.addOrSubtract(K[ve+Ze],le.multiply(Te,$[Ze]))}return new Qe(le,K)}multiplyScalar(y){if(y===0)return this.field.getZero();if(y===1)return this;const E=this.coefficients.length,O=this.field,$=new Int32Array(E),H=this.coefficients;for(let K=0;K<E;K++)$[K]=O.multiply(H[K],y);return new Qe(O,$)}multiplyByMonomial(y,E){if(y<0)throw new f;if(E===0)return this.field.getZero();const O=this.coefficients,$=O.length,H=new Int32Array($+y),K=this.field;for(let le=0;le<$;le++)H[le]=K.multiply(O[le],E);return new Qe(K,H)}divide(y){if(!this.field.equals(y.field))throw new f("GenericGFPolys do not have same GenericGF field");if(y.isZero())throw new f("Divide by 0");const E=this.field;let O=E.getZero(),$=this;const H=y.getCoefficient(y.getDegree()),K=E.inverse(H);for(;$.getDegree()>=y.getDegree()&&!$.isZero();){const le=$.getDegree()-y.getDegree(),ve=E.multiply($.getCoefficient($.getDegree()),K),Te=y.multiplyByMonomial(le,ve),Ze=E.buildMonomial(le,ve);O=O.addOrSubtract(Ze),$=$.addOrSubtract(Te)}return[O,$]}toString(){let y="";for(let E=this.getDegree();E>=0;E--){let O=this.getCoefficient(E);if(O!==0){if(O<0?(y+=" - ",O=-O):y.length>0&&(y+=" + "),E===0||O!==1){const $=this.field.log(O);$===0?y+="1":$===1?y+="a":(y+="a^",y+=$)}E!==0&&(E===1?y+="x":(y+="x^",y+=E))}}return y}}class $e extends u{}$e.kind="ArithmeticException";class it extends Re{constructor(y,E,O){super(),this.primitive=y,this.size=E,this.generatorBase=O;const $=new Int32Array(E);let H=1;for(let le=0;le<E;le++)$[le]=H,H*=2,H>=E&&(H^=y,H&=E-1);this.expTable=$;const K=new Int32Array(E);for(let le=0;le<E-1;le++)K[$[le]]=le;this.logTable=K,this.zero=new Qe(this,Int32Array.from([0])),this.one=new Qe(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(y,E){if(y<0)throw new f;if(E===0)return this.zero;const O=new Int32Array(y+1);return O[0]=E,new Qe(this,O)}inverse(y){if(y===0)throw new $e;return this.expTable[this.size-this.logTable[y]-1]}multiply(y,E){return y===0||E===0?0:this.expTable[(this.logTable[y]+this.logTable[E])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+P.toHexString(this.primitive)+","+this.size+")"}equals(y){return y===this}}it.AZTEC_DATA_12=new it(4201,4096,1),it.AZTEC_DATA_10=new it(1033,1024,1),it.AZTEC_DATA_6=new it(67,64,1),it.AZTEC_PARAM=new it(19,16,1),it.QR_CODE_FIELD_256=new it(285,256,0),it.DATA_MATRIX_FIELD_256=new it(301,256,1),it.AZTEC_DATA_8=it.DATA_MATRIX_FIELD_256,it.MAXICODE_FIELD_64=it.AZTEC_DATA_6;class tt extends u{}tt.kind="ReedSolomonException";class ot extends u{}ot.kind="IllegalStateException";class ft{constructor(y){this.field=y}decode(y,E){const O=this.field,$=new Qe(O,y),H=new Int32Array(E);let K=!0;for(let tn=0;tn<E;tn++){const vt=$.evaluateAt(O.exp(tn+O.getGeneratorBase()));H[H.length-1-tn]=vt,vt!==0&&(K=!1)}if(K)return;const le=new Qe(O,H),ve=this.runEuclideanAlgorithm(O.buildMonomial(E,1),le,E),Te=ve[0],Ze=ve[1],ht=this.findErrorLocations(Te),Tt=this.findErrorMagnitudes(Ze,ht);for(let tn=0;tn<ht.length;tn++){const vt=y.length-1-O.log(ht[tn]);if(vt<0)throw new tt("Bad error location");y[vt]=it.addOrSubtract(y[vt],Tt[tn])}}runEuclideanAlgorithm(y,E,O){if(y.getDegree()<E.getDegree()){const tn=y;y=E,E=tn}const $=this.field;let H=y,K=E,le=$.getZero(),ve=$.getOne();for(;K.getDegree()>=(O/2|0);){let tn=H,vt=le;if(H=K,le=ve,H.isZero())throw new tt("r_{i-1} was zero");K=tn;let $t=$.getZero();const Kt=H.getCoefficient(H.getDegree()),_n=$.inverse(Kt);for(;K.getDegree()>=H.getDegree()&&!K.isZero();){const ur=K.getDegree()-H.getDegree(),br=$.multiply(K.getCoefficient(K.getDegree()),_n);$t=$t.addOrSubtract($.buildMonomial(ur,br)),K=K.addOrSubtract(H.multiplyByMonomial(ur,br))}if(ve=$t.multiply(le).addOrSubtract(vt),K.getDegree()>=H.getDegree())throw new ot("Division algorithm failed to reduce polynomial?")}const Te=ve.getCoefficient(0);if(Te===0)throw new tt("sigmaTilde(0) was zero");const Ze=$.inverse(Te),ht=ve.multiplyScalar(Ze),Tt=K.multiplyScalar(Ze);return[ht,Tt]}findErrorLocations(y){const E=y.getDegree();if(E===1)return Int32Array.from([y.getCoefficient(1)]);const O=new Int32Array(E);let $=0;const H=this.field;for(let K=1;K<H.getSize()&&$<E;K++)y.evaluateAt(K)===0&&(O[$]=H.inverse(K),$++);if($!==E)throw new tt("Error locator degree does not match number of roots");return O}findErrorMagnitudes(y,E){const O=E.length,$=new Int32Array(O),H=this.field;for(let K=0;K<O;K++){const le=H.inverse(E[K]);let ve=1;for(let Te=0;Te<O;Te++)if(K!==Te){const Ze=H.multiply(E[Te],le),ht=Ze&1?Ze&-2:Ze|1;ve=H.multiply(ve,ht)}$[K]=H.multiply(y.evaluateAt(le),H.inverse(ve)),H.getGeneratorBase()!==0&&($[K]=H.multiply($[K],le))}return $}}var ct;(function(dt){dt[dt.UPPER=0]="UPPER",dt[dt.LOWER=1]="LOWER",dt[dt.MIXED=2]="MIXED",dt[dt.DIGIT=3]="DIGIT",dt[dt.PUNCT=4]="PUNCT",dt[dt.BINARY=5]="BINARY"})(ct||(ct={}));class Vt{decode(y){this.ddata=y;let E=y.getBits(),O=this.extractBits(E),$=this.correctBits(O),H=Vt.convertBoolArrayToByteArray($),K=Vt.getEncodedData($),le=new Ie(H,K,null,null);return le.setNumBits($.length),le}static highLevelDecode(y){return this.getEncodedData(y)}static getEncodedData(y){let E=y.length,O=ct.UPPER,$=ct.UPPER,H="",K=0;for(;K<E;)if($===ct.BINARY){if(E-K<5)break;let le=Vt.readCode(y,K,5);if(K+=5,le===0){if(E-K<11)break;le=Vt.readCode(y,K,11)+31,K+=11}for(let ve=0;ve<le;ve++){if(E-K<8){K=E;break}const Te=Vt.readCode(y,K,8);H+=X.castAsNonUtf8Char(Te),K+=8}$=O}else{let le=$===ct.DIGIT?4:5;if(E-K<le)break;let ve=Vt.readCode(y,K,le);K+=le;let Te=Vt.getCharacter($,ve);Te.startsWith("CTRL_")?(O=$,$=Vt.getTable(Te.charAt(5)),Te.charAt(6)==="L"&&(O=$)):(H+=Te,$=O)}return H}static getTable(y){switch(y){case"L":return ct.LOWER;case"P":return ct.PUNCT;case"M":return ct.MIXED;case"D":return ct.DIGIT;case"B":return ct.BINARY;case"U":default:return ct.UPPER}}static getCharacter(y,E){switch(y){case ct.UPPER:return Vt.UPPER_TABLE[E];case ct.LOWER:return Vt.LOWER_TABLE[E];case ct.MIXED:return Vt.MIXED_TABLE[E];case ct.PUNCT:return Vt.PUNCT_TABLE[E];case ct.DIGIT:return Vt.DIGIT_TABLE[E];default:throw new ot("Bad table")}}correctBits(y){let E,O;this.ddata.getNbLayers()<=2?(O=6,E=it.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(O=8,E=it.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(O=10,E=it.AZTEC_DATA_10):(O=12,E=it.AZTEC_DATA_12);let $=this.ddata.getNbDatablocks(),H=y.length/O;if(H<$)throw new L;let K=y.length%O,le=new Int32Array(H);for(let Tt=0;Tt<H;Tt++,K+=O)le[Tt]=Vt.readCode(y,K,O);try{new ft(E).decode(le,H-$)}catch(Tt){throw new L(Tt)}let ve=(1<<O)-1,Te=0;for(let Tt=0;Tt<$;Tt++){let tn=le[Tt];if(tn===0||tn===ve)throw new L;(tn===1||tn===ve-1)&&Te++}let Ze=new Array($*O-Te),ht=0;for(let Tt=0;Tt<$;Tt++){let tn=le[Tt];if(tn===1||tn===ve-1)Ze.fill(tn>1,ht,ht+O-1),ht+=O-1;else for(let vt=O-1;vt>=0;--vt)Ze[ht++]=(tn&1<<vt)!==0}return Ze}extractBits(y){let E=this.ddata.isCompact(),O=this.ddata.getNbLayers(),$=(E?11:14)+O*4,H=new Int32Array($),K=new Array(this.totalBitsInLayer(O,E));if(E)for(let le=0;le<H.length;le++)H[le]=le;else{let le=$+1+2*P.truncDivision(P.truncDivision($,2)-1,15),ve=$/2,Te=P.truncDivision(le,2);for(let Ze=0;Ze<ve;Ze++){let ht=Ze+P.truncDivision(Ze,15);H[ve-Ze-1]=Te-ht-1,H[ve+Ze]=Te+ht+1}}for(let le=0,ve=0;le<O;le++){let Te=(O-le)*4+(E?9:12),Ze=le*2,ht=$-1-Ze;for(let Tt=0;Tt<Te;Tt++){let tn=Tt*2;for(let vt=0;vt<2;vt++)K[ve+tn+vt]=y.get(H[Ze+vt],H[Ze+Tt]),K[ve+2*Te+tn+vt]=y.get(H[Ze+Tt],H[ht-vt]),K[ve+4*Te+tn+vt]=y.get(H[ht-vt],H[ht-Tt]),K[ve+6*Te+tn+vt]=y.get(H[ht-Tt],H[Ze+vt])}ve+=Te*8}return K}static readCode(y,E,O){let $=0;for(let H=E;H<E+O;H++)$<<=1,y[H]&&($|=1);return $}static readByte(y,E){let O=y.length-E;return O>=8?Vt.readCode(y,E,8):Vt.readCode(y,E,O)<<8-O}static convertBoolArrayToByteArray(y){let E=new Uint8Array((y.length+7)/8);for(let O=0;O<E.length;O++)E[O]=Vt.readByte(y,8*O);return E}totalBitsInLayer(y,E){return((E?88:112)+16*y)*y}}Vt.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],Vt.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],Vt.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],Vt.PUNCT_TABLE=["","\r",`\r
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],Vt.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class It{constructor(){}static round(y){return y===NaN?0:y<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:y>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:y+(y<0?-.5:.5)|0}static distance(y,E,O,$){const H=y-O,K=E-$;return Math.sqrt(H*H+K*K)}static sum(y){let E=0;for(let O=0,$=y.length;O!==$;O++){const H=y[O];E+=H}return E}}class an{static floatToIntBits(y){return y}}an.MAX_VALUE=Number.MAX_SAFE_INTEGER;class Nt{constructor(y,E){this.x=y,this.y=E}getX(){return this.x}getY(){return this.y}equals(y){if(y instanceof Nt){const E=y;return this.x===E.x&&this.y===E.y}return!1}hashCode(){return 31*an.floatToIntBits(this.x)+an.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(y){const E=this.distance(y[0],y[1]),O=this.distance(y[1],y[2]),$=this.distance(y[0],y[2]);let H,K,le;if(O>=E&&O>=$?(K=y[0],H=y[1],le=y[2]):$>=O&&$>=E?(K=y[1],H=y[0],le=y[2]):(K=y[2],H=y[0],le=y[1]),this.crossProductZ(H,K,le)<0){const ve=H;H=le,le=ve}y[0]=H,y[1]=K,y[2]=le}static distance(y,E){return It.distance(y.x,y.y,E.x,E.y)}static crossProductZ(y,E,O){const $=E.x,H=E.y;return(O.x-$)*(y.y-H)-(O.y-H)*(y.x-$)}}class mn{constructor(y,E){this.bits=y,this.points=E}getBits(){return this.bits}getPoints(){return this.points}}class dn extends mn{constructor(y,E,O,$,H){super(y,E),this.compact=O,this.nbDatablocks=$,this.nbLayers=H}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class Pt{constructor(y,E,O,$){this.image=y,this.height=y.getHeight(),this.width=y.getWidth(),E==null&&(E=Pt.INIT_SIZE),O==null&&(O=y.getWidth()/2|0),$==null&&($=y.getHeight()/2|0);const H=E/2|0;if(this.leftInit=O-H,this.rightInit=O+H,this.upInit=$-H,this.downInit=$+H,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Y}detect(){let y=this.leftInit,E=this.rightInit,O=this.upInit,$=this.downInit,H=!1,K=!0,le=!1,ve=!1,Te=!1,Ze=!1,ht=!1;const Tt=this.width,tn=this.height;for(;K;){K=!1;let vt=!0;for(;(vt||!ve)&&E<Tt;)vt=this.containsBlackPoint(O,$,E,!1),vt?(E++,K=!0,ve=!0):ve||E++;if(E>=Tt){H=!0;break}let $t=!0;for(;($t||!Te)&&$<tn;)$t=this.containsBlackPoint(y,E,$,!0),$t?($++,K=!0,Te=!0):Te||$++;if($>=tn){H=!0;break}let Kt=!0;for(;(Kt||!Ze)&&y>=0;)Kt=this.containsBlackPoint(O,$,y,!1),Kt?(y--,K=!0,Ze=!0):Ze||y--;if(y<0){H=!0;break}let _n=!0;for(;(_n||!ht)&&O>=0;)_n=this.containsBlackPoint(y,E,O,!0),_n?(O--,K=!0,ht=!0):ht||O--;if(O<0){H=!0;break}K&&(le=!0)}if(!H&&le){const vt=E-y;let $t=null;for(let br=1;$t===null&&br<vt;br++)$t=this.getBlackPointOnSegment(y,$-br,y+br,$);if($t==null)throw new Y;let Kt=null;for(let br=1;Kt===null&&br<vt;br++)Kt=this.getBlackPointOnSegment(y,O+br,y+br,O);if(Kt==null)throw new Y;let _n=null;for(let br=1;_n===null&&br<vt;br++)_n=this.getBlackPointOnSegment(E,O+br,E-br,O);if(_n==null)throw new Y;let ur=null;for(let br=1;ur===null&&br<vt;br++)ur=this.getBlackPointOnSegment(E,$-br,E-br,$);if(ur==null)throw new Y;return this.centerEdges(ur,$t,_n,Kt)}else throw new Y}getBlackPointOnSegment(y,E,O,$){const H=It.round(It.distance(y,E,O,$)),K=(O-y)/H,le=($-E)/H,ve=this.image;for(let Te=0;Te<H;Te++){const Ze=It.round(y+Te*K),ht=It.round(E+Te*le);if(ve.get(Ze,ht))return new Nt(Ze,ht)}return null}centerEdges(y,E,O,$){const H=y.getX(),K=y.getY(),le=E.getX(),ve=E.getY(),Te=O.getX(),Ze=O.getY(),ht=$.getX(),Tt=$.getY(),tn=Pt.CORR;return H<this.width/2?[new Nt(ht-tn,Tt+tn),new Nt(le+tn,ve+tn),new Nt(Te-tn,Ze-tn),new Nt(H+tn,K-tn)]:[new Nt(ht+tn,Tt+tn),new Nt(le+tn,ve-tn),new Nt(Te-tn,Ze+tn),new Nt(H-tn,K-tn)]}containsBlackPoint(y,E,O,$){const H=this.image;if($){for(let K=y;K<=E;K++)if(H.get(K,O))return!0}else for(let K=y;K<=E;K++)if(H.get(O,K))return!0;return!1}}Pt.INIT_SIZE=10,Pt.CORR=1;class Xe{static checkAndNudgePoints(y,E){const O=y.getWidth(),$=y.getHeight();let H=!0;for(let K=0;K<E.length&&H;K+=2){const le=Math.floor(E[K]),ve=Math.floor(E[K+1]);if(le<-1||le>O||ve<-1||ve>$)throw new Y;H=!1,le===-1?(E[K]=0,H=!0):le===O&&(E[K]=O-1,H=!0),ve===-1?(E[K+1]=0,H=!0):ve===$&&(E[K+1]=$-1,H=!0)}H=!0;for(let K=E.length-2;K>=0&&H;K-=2){const le=Math.floor(E[K]),ve=Math.floor(E[K+1]);if(le<-1||le>O||ve<-1||ve>$)throw new Y;H=!1,le===-1?(E[K]=0,H=!0):le===O&&(E[K]=O-1,H=!0),ve===-1?(E[K+1]=0,H=!0):ve===$&&(E[K+1]=$-1,H=!0)}}}class Ut{constructor(y,E,O,$,H,K,le,ve,Te){this.a11=y,this.a21=E,this.a31=O,this.a12=$,this.a22=H,this.a32=K,this.a13=le,this.a23=ve,this.a33=Te}static quadrilateralToQuadrilateral(y,E,O,$,H,K,le,ve,Te,Ze,ht,Tt,tn,vt,$t,Kt){const _n=Ut.quadrilateralToSquare(y,E,O,$,H,K,le,ve);return Ut.squareToQuadrilateral(Te,Ze,ht,Tt,tn,vt,$t,Kt).times(_n)}transformPoints(y){const E=y.length,O=this.a11,$=this.a12,H=this.a13,K=this.a21,le=this.a22,ve=this.a23,Te=this.a31,Ze=this.a32,ht=this.a33;for(let Tt=0;Tt<E;Tt+=2){const tn=y[Tt],vt=y[Tt+1],$t=H*tn+ve*vt+ht;y[Tt]=(O*tn+K*vt+Te)/$t,y[Tt+1]=($*tn+le*vt+Ze)/$t}}transformPointsWithValues(y,E){const O=this.a11,$=this.a12,H=this.a13,K=this.a21,le=this.a22,ve=this.a23,Te=this.a31,Ze=this.a32,ht=this.a33,Tt=y.length;for(let tn=0;tn<Tt;tn++){const vt=y[tn],$t=E[tn],Kt=H*vt+ve*$t+ht;y[tn]=(O*vt+K*$t+Te)/Kt,E[tn]=($*vt+le*$t+Ze)/Kt}}static squareToQuadrilateral(y,E,O,$,H,K,le,ve){const Te=y-O+H-le,Ze=E-$+K-ve;if(Te===0&&Ze===0)return new Ut(O-y,H-O,y,$-E,K-$,E,0,0,1);{const ht=O-H,Tt=le-H,tn=$-K,vt=ve-K,$t=ht*vt-Tt*tn,Kt=(Te*vt-Tt*Ze)/$t,_n=(ht*Ze-Te*tn)/$t;return new Ut(O-y+Kt*O,le-y+_n*le,y,$-E+Kt*$,ve-E+_n*ve,E,Kt,_n,1)}}static quadrilateralToSquare(y,E,O,$,H,K,le,ve){return Ut.squareToQuadrilateral(y,E,O,$,H,K,le,ve).buildAdjoint()}buildAdjoint(){return new Ut(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)}times(y){return new Ut(this.a11*y.a11+this.a21*y.a12+this.a31*y.a13,this.a11*y.a21+this.a21*y.a22+this.a31*y.a23,this.a11*y.a31+this.a21*y.a32+this.a31*y.a33,this.a12*y.a11+this.a22*y.a12+this.a32*y.a13,this.a12*y.a21+this.a22*y.a22+this.a32*y.a23,this.a12*y.a31+this.a22*y.a32+this.a32*y.a33,this.a13*y.a11+this.a23*y.a12+this.a33*y.a13,this.a13*y.a21+this.a23*y.a22+this.a33*y.a23,this.a13*y.a31+this.a23*y.a32+this.a33*y.a33)}}class Lt extends Xe{sampleGrid(y,E,O,$,H,K,le,ve,Te,Ze,ht,Tt,tn,vt,$t,Kt,_n,ur,br){const wr=Ut.quadrilateralToQuadrilateral($,H,K,le,ve,Te,Ze,ht,Tt,tn,vt,$t,Kt,_n,ur,br);return this.sampleGridWithTransform(y,E,O,wr)}sampleGridWithTransform(y,E,O,$){if(E<=0||O<=0)throw new Y;const H=new pe(E,O),K=new Float32Array(2*E);for(let le=0;le<O;le++){const ve=K.length,Te=le+.5;for(let Ze=0;Ze<ve;Ze+=2)K[Ze]=Ze/2+.5,K[Ze+1]=Te;$.transformPoints(K),Xe.checkAndNudgePoints(y,K);try{for(let Ze=0;Ze<ve;Ze+=2)y.get(Math.floor(K[Ze]),Math.floor(K[Ze+1]))&&H.set(Ze/2,le)}catch{throw new Y}}return H}}class qe{static setGridSampler(y){qe.gridSampler=y}static getInstance(){return qe.gridSampler}}qe.gridSampler=new Lt;class Ke{constructor(y,E){this.x=y,this.y=E}toResultPoint(){return new Nt(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class pt{constructor(y){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=y}detect(){return this.detectMirror(!1)}detectMirror(y){let E=this.getMatrixCenter(),O=this.getBullsEyeCorners(E);if(y){let K=O[0];O[0]=O[2],O[2]=K}this.extractParameters(O);let $=this.sampleGrid(this.image,O[this.shift%4],O[(this.shift+1)%4],O[(this.shift+2)%4],O[(this.shift+3)%4]),H=this.getMatrixCornerPoints(O);return new dn($,H,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(y){if(!this.isValidPoint(y[0])||!this.isValidPoint(y[1])||!this.isValidPoint(y[2])||!this.isValidPoint(y[3]))throw new Y;let E=2*this.nbCenterLayers,O=new Int32Array([this.sampleLine(y[0],y[1],E),this.sampleLine(y[1],y[2],E),this.sampleLine(y[2],y[3],E),this.sampleLine(y[3],y[0],E)]);this.shift=this.getRotation(O,E);let $=0;for(let K=0;K<4;K++){let le=O[(this.shift+K)%4];this.compact?($<<=7,$+=le>>1&127):($<<=10,$+=(le>>2&992)+(le>>1&31))}let H=this.getCorrectedParameterData($,this.compact);this.compact?(this.nbLayers=(H>>6)+1,this.nbDataBlocks=(H&63)+1):(this.nbLayers=(H>>11)+1,this.nbDataBlocks=(H&2047)+1)}getRotation(y,E){let O=0;y.forEach(($,H,K)=>{let le=($>>E-2<<1)+($&1);O=(O<<3)+le}),O=((O&1)<<11)+(O>>1);for(let $=0;$<4;$++)if(P.bitCount(O^this.EXPECTED_CORNER_BITS[$])<=2)return $;throw new Y}getCorrectedParameterData(y,E){let O,$;E?(O=7,$=2):(O=10,$=4);let H=O-$,K=new Int32Array(O);for(let ve=O-1;ve>=0;--ve)K[ve]=y&15,y>>=4;try{new ft(it.AZTEC_PARAM).decode(K,H)}catch{throw new Y}let le=0;for(let ve=0;ve<$;ve++)le=(le<<4)+K[ve];return le}getBullsEyeCorners(y){let E=y,O=y,$=y,H=y,K=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let ht=this.getFirstDifferent(E,K,1,-1),Tt=this.getFirstDifferent(O,K,1,1),tn=this.getFirstDifferent($,K,-1,1),vt=this.getFirstDifferent(H,K,-1,-1);if(this.nbCenterLayers>2){let $t=this.distancePoint(vt,ht)*this.nbCenterLayers/(this.distancePoint(H,E)*(this.nbCenterLayers+2));if($t<.75||$t>1.25||!this.isWhiteOrBlackRectangle(ht,Tt,tn,vt))break}E=ht,O=Tt,$=tn,H=vt,K=!K}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new Y;this.compact=this.nbCenterLayers===5;let le=new Nt(E.getX()+.5,E.getY()-.5),ve=new Nt(O.getX()+.5,O.getY()+.5),Te=new Nt($.getX()-.5,$.getY()+.5),Ze=new Nt(H.getX()-.5,H.getY()-.5);return this.expandSquare([le,ve,Te,Ze],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let y,E,O,$;try{let le=new Pt(this.image).detect();y=le[0],E=le[1],O=le[2],$=le[3]}catch{let ve=this.image.getWidth()/2,Te=this.image.getHeight()/2;y=this.getFirstDifferent(new Ke(ve+7,Te-7),!1,1,-1).toResultPoint(),E=this.getFirstDifferent(new Ke(ve+7,Te+7),!1,1,1).toResultPoint(),O=this.getFirstDifferent(new Ke(ve-7,Te+7),!1,-1,1).toResultPoint(),$=this.getFirstDifferent(new Ke(ve-7,Te-7),!1,-1,-1).toResultPoint()}let H=It.round((y.getX()+$.getX()+E.getX()+O.getX())/4),K=It.round((y.getY()+$.getY()+E.getY()+O.getY())/4);try{let le=new Pt(this.image,15,H,K).detect();y=le[0],E=le[1],O=le[2],$=le[3]}catch{y=this.getFirstDifferent(new Ke(H+7,K-7),!1,1,-1).toResultPoint(),E=this.getFirstDifferent(new Ke(H+7,K+7),!1,1,1).toResultPoint(),O=this.getFirstDifferent(new Ke(H-7,K+7),!1,-1,1).toResultPoint(),$=this.getFirstDifferent(new Ke(H-7,K-7),!1,-1,-1).toResultPoint()}return H=It.round((y.getX()+$.getX()+E.getX()+O.getX())/4),K=It.round((y.getY()+$.getY()+E.getY()+O.getY())/4),new Ke(H,K)}getMatrixCornerPoints(y){return this.expandSquare(y,2*this.nbCenterLayers,this.getDimension())}sampleGrid(y,E,O,$,H){let K=qe.getInstance(),le=this.getDimension(),ve=le/2-this.nbCenterLayers,Te=le/2+this.nbCenterLayers;return K.sampleGrid(y,le,le,ve,ve,Te,ve,Te,Te,ve,Te,E.getX(),E.getY(),O.getX(),O.getY(),$.getX(),$.getY(),H.getX(),H.getY())}sampleLine(y,E,O){let $=0,H=this.distanceResultPoint(y,E),K=H/O,le=y.getX(),ve=y.getY(),Te=K*(E.getX()-y.getX())/H,Ze=K*(E.getY()-y.getY())/H;for(let ht=0;ht<O;ht++)this.image.get(It.round(le+ht*Te),It.round(ve+ht*Ze))&&($|=1<<O-ht-1);return $}isWhiteOrBlackRectangle(y,E,O,$){let H=3;y=new Ke(y.getX()-H,y.getY()+H),E=new Ke(E.getX()-H,E.getY()-H),O=new Ke(O.getX()+H,O.getY()-H),$=new Ke($.getX()+H,$.getY()+H);let K=this.getColor($,y);if(K===0)return!1;let le=this.getColor(y,E);return le!==K||(le=this.getColor(E,O),le!==K)?!1:(le=this.getColor(O,$),le===K)}getColor(y,E){let O=this.distancePoint(y,E),$=(E.getX()-y.getX())/O,H=(E.getY()-y.getY())/O,K=0,le=y.getX(),ve=y.getY(),Te=this.image.get(y.getX(),y.getY()),Ze=Math.ceil(O);for(let Tt=0;Tt<Ze;Tt++)le+=$,ve+=H,this.image.get(It.round(le),It.round(ve))!==Te&&K++;let ht=K/O;return ht>.1&&ht<.9?0:ht<=.1===Te?1:-1}getFirstDifferent(y,E,O,$){let H=y.getX()+O,K=y.getY()+$;for(;this.isValid(H,K)&&this.image.get(H,K)===E;)H+=O,K+=$;for(H-=O,K-=$;this.isValid(H,K)&&this.image.get(H,K)===E;)H+=O;for(H-=O;this.isValid(H,K)&&this.image.get(H,K)===E;)K+=$;return K-=$,new Ke(H,K)}expandSquare(y,E,O){let $=O/(2*E),H=y[0].getX()-y[2].getX(),K=y[0].getY()-y[2].getY(),le=(y[0].getX()+y[2].getX())/2,ve=(y[0].getY()+y[2].getY())/2,Te=new Nt(le+$*H,ve+$*K),Ze=new Nt(le-$*H,ve-$*K);H=y[1].getX()-y[3].getX(),K=y[1].getY()-y[3].getY(),le=(y[1].getX()+y[3].getX())/2,ve=(y[1].getY()+y[3].getY())/2;let ht=new Nt(le+$*H,ve+$*K),Tt=new Nt(le-$*H,ve-$*K);return[Te,ht,Ze,Tt]}isValid(y,E){return y>=0&&y<this.image.getWidth()&&E>0&&E<this.image.getHeight()}isValidPoint(y){let E=It.round(y.getX()),O=It.round(y.getY());return this.isValid(E,O)}distancePoint(y,E){return It.distance(y.getX(),y.getY(),E.getX(),E.getY())}distanceResultPoint(y,E){return It.distance(y.getX(),y.getY(),E.getX(),E.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(P.truncDivision(this.nbLayers-4,8)+1)+15}}class en{decode(y,E=null){let O=null,$=new pt(y.getBlackMatrix()),H=null,K=null;try{let Ze=$.detectMirror(!1);H=Ze.getPoints(),this.reportFoundResultPoints(E,H),K=new Vt().decode(Ze)}catch(Ze){O=Ze}if(K==null)try{let Ze=$.detectMirror(!0);H=Ze.getPoints(),this.reportFoundResultPoints(E,H),K=new Vt().decode(Ze)}catch(Ze){throw O??Ze}let le=new ce(K.getText(),K.getRawBytes(),K.getNumBits(),H,Ae.AZTEC,w.currentTimeMillis()),ve=K.getByteSegments();ve!=null&&le.putMetadata(je.BYTE_SEGMENTS,ve);let Te=K.getECLevel();return Te!=null&&le.putMetadata(je.ERROR_CORRECTION_LEVEL,Te),le}reportFoundResultPoints(y,E){if(y!=null){let O=y.get(U.NEED_RESULT_POINT_CALLBACK);O!=null&&E.forEach(($,H,K)=>{O.foundPossibleResultPoint($)})}}reset(){}}class Bt extends Ce{constructor(y=500){super(new en,y)}}class Et{decode(y,E){try{return this.doDecode(y,E)}catch{if(E&&E.get(U.TRY_HARDER)===!0&&y.isRotateSupported()){const H=y.rotateCounterClockwise(),K=this.doDecode(H,E),le=K.getResultMetadata();let ve=270;le!==null&&le.get(je.ORIENTATION)===!0&&(ve=ve+le.get(je.ORIENTATION)%360),K.putMetadata(je.ORIENTATION,ve);const Te=K.getResultPoints();if(Te!==null){const Ze=H.getHeight();for(let ht=0;ht<Te.length;ht++)Te[ht]=new Nt(Ze-Te[ht].getY()-1,Te[ht].getX())}return K}else throw new Y}}reset(){}doDecode(y,E){const O=y.getWidth(),$=y.getHeight();let H=new R(O);const K=E&&E.get(U.TRY_HARDER)===!0,le=Math.max(1,$>>(K?8:5));let ve;K?ve=$:ve=15;const Te=Math.trunc($/2);for(let Ze=0;Ze<ve;Ze++){const ht=Math.trunc((Ze+1)/2),Tt=(Ze&1)===0,tn=Te+le*(Tt?ht:-ht);if(tn<0||tn>=$)break;try{H=y.getBlackRow(tn,H)}catch{continue}for(let vt=0;vt<2;vt++){if(vt===1&&(H.reverse(),E&&E.get(U.NEED_RESULT_POINT_CALLBACK)===!0)){const $t=new Map;E.forEach((Kt,_n)=>$t.set(_n,Kt)),$t.delete(U.NEED_RESULT_POINT_CALLBACK),E=$t}try{const $t=this.decodeRow(tn,H,E);if(vt===1){$t.putMetadata(je.ORIENTATION,180);const Kt=$t.getResultPoints();Kt!==null&&(Kt[0]=new Nt(O-Kt[0].getX()-1,Kt[0].getY()),Kt[1]=new Nt(O-Kt[1].getX()-1,Kt[1].getY()))}return $t}catch{}}}throw new Y}static recordPattern(y,E,O){const $=O.length;for(let Te=0;Te<$;Te++)O[Te]=0;const H=y.getSize();if(E>=H)throw new Y;let K=!y.get(E),le=0,ve=E;for(;ve<H;){if(y.get(ve)!==K)O[le]++;else{if(++le===$)break;O[le]=1,K=!K}ve++}if(!(le===$||le===$-1&&ve===H))throw new Y}static recordPatternInReverse(y,E,O){let $=O.length,H=y.get(E);for(;E>0&&$>=0;)y.get(--E)!==H&&($--,H=!H);if($>=0)throw new Y;Et.recordPattern(y,E+1,O)}static patternMatchVariance(y,E,O){const $=y.length;let H=0,K=0;for(let Te=0;Te<$;Te++)H+=y[Te],K+=E[Te];if(H<K)return Number.POSITIVE_INFINITY;const le=H/K;O*=le;let ve=0;for(let Te=0;Te<$;Te++){const Ze=y[Te],ht=E[Te]*le,Tt=Ze>ht?Ze-ht:ht-Ze;if(Tt>O)return Number.POSITIVE_INFINITY;ve+=Tt}return ve/H}}class et extends Et{static findStartPattern(y){const E=y.getSize(),O=y.getNextSet(0);let $=0,H=Int32Array.from([0,0,0,0,0,0]),K=O,le=!1;const ve=6;for(let Te=O;Te<E;Te++)if(y.get(Te)!==le)H[$]++;else{if($===ve-1){let Ze=et.MAX_AVG_VARIANCE,ht=-1;for(let Tt=et.CODE_START_A;Tt<=et.CODE_START_C;Tt++){const tn=Et.patternMatchVariance(H,et.CODE_PATTERNS[Tt],et.MAX_INDIVIDUAL_VARIANCE);tn<Ze&&(Ze=tn,ht=Tt)}if(ht>=0&&y.isRange(Math.max(0,K-(Te-K)/2),K,!1))return Int32Array.from([K,Te,ht]);K+=H[0]+H[1],H=H.slice(2,H.length-1),H[$-1]=0,H[$]=0,$--}else $++;H[$]=1,le=!le}throw new Y}static decodeCode(y,E,O){Et.recordPattern(y,O,E);let $=et.MAX_AVG_VARIANCE,H=-1;for(let K=0;K<et.CODE_PATTERNS.length;K++){const le=et.CODE_PATTERNS[K],ve=this.patternMatchVariance(E,le,et.MAX_INDIVIDUAL_VARIANCE);ve<$&&($=ve,H=K)}if(H>=0)return H;throw new Y}decodeRow(y,E,O){const $=O&&O.get(U.ASSUME_GS1)===!0,H=et.findStartPattern(E),K=H[2];let le=0;const ve=new Uint8Array(20);ve[le++]=K;let Te;switch(K){case et.CODE_START_A:Te=et.CODE_CODE_A;break;case et.CODE_START_B:Te=et.CODE_CODE_B;break;case et.CODE_START_C:Te=et.CODE_CODE_C;break;default:throw new L}let Ze=!1,ht=!1,Tt="",tn=H[0],vt=H[1];const $t=Int32Array.from([0,0,0,0,0,0]);let Kt=0,_n=0,ur=K,br=0,wr=!0,ws=!1,Ks=!1;for(;!Ze;){const Ii=ht;switch(ht=!1,Kt=_n,_n=et.decodeCode(E,$t,vt),ve[le++]=_n,_n!==et.CODE_STOP&&(wr=!0),_n!==et.CODE_STOP&&(br++,ur+=br*_n),tn=vt,vt+=$t.reduce((Em,P1)=>Em+P1,0),_n){case et.CODE_START_A:case et.CODE_START_B:case et.CODE_START_C:throw new L}switch(Te){case et.CODE_CODE_A:if(_n<64)Ks===ws?Tt+=String.fromCharCode(32+_n):Tt+=String.fromCharCode(32+_n+128),Ks=!1;else if(_n<96)Ks===ws?Tt+=String.fromCharCode(_n-64):Tt+=String.fromCharCode(_n+64),Ks=!1;else switch(_n!==et.CODE_STOP&&(wr=!1),_n){case et.CODE_FNC_1:$&&(Tt.length===0?Tt+="]C1":Tt+="");break;case et.CODE_FNC_2:case et.CODE_FNC_3:break;case et.CODE_FNC_4_A:!ws&&Ks?(ws=!0,Ks=!1):ws&&Ks?(ws=!1,Ks=!1):Ks=!0;break;case et.CODE_SHIFT:ht=!0,Te=et.CODE_CODE_B;break;case et.CODE_CODE_B:Te=et.CODE_CODE_B;break;case et.CODE_CODE_C:Te=et.CODE_CODE_C;break;case et.CODE_STOP:Ze=!0;break}break;case et.CODE_CODE_B:if(_n<96)Ks===ws?Tt+=String.fromCharCode(32+_n):Tt+=String.fromCharCode(32+_n+128),Ks=!1;else switch(_n!==et.CODE_STOP&&(wr=!1),_n){case et.CODE_FNC_1:$&&(Tt.length===0?Tt+="]C1":Tt+="");break;case et.CODE_FNC_2:case et.CODE_FNC_3:break;case et.CODE_FNC_4_B:!ws&&Ks?(ws=!0,Ks=!1):ws&&Ks?(ws=!1,Ks=!1):Ks=!0;break;case et.CODE_SHIFT:ht=!0,Te=et.CODE_CODE_A;break;case et.CODE_CODE_A:Te=et.CODE_CODE_A;break;case et.CODE_CODE_C:Te=et.CODE_CODE_C;break;case et.CODE_STOP:Ze=!0;break}break;case et.CODE_CODE_C:if(_n<100)_n<10&&(Tt+="0"),Tt+=_n;else switch(_n!==et.CODE_STOP&&(wr=!1),_n){case et.CODE_FNC_1:$&&(Tt.length===0?Tt+="]C1":Tt+="");break;case et.CODE_CODE_A:Te=et.CODE_CODE_A;break;case et.CODE_CODE_B:Te=et.CODE_CODE_B;break;case et.CODE_STOP:Ze=!0;break}break}Ii&&(Te=Te===et.CODE_CODE_A?et.CODE_CODE_B:et.CODE_CODE_A)}const uc=vt-tn;if(vt=E.getNextUnset(vt),!E.isRange(vt,Math.min(E.getSize(),vt+(vt-tn)/2),!1))throw new Y;if(ur-=br*Kt,ur%103!==Kt)throw new g;const Za=Tt.length;if(Za===0)throw new Y;Za>0&&wr&&(Te===et.CODE_CODE_C?Tt=Tt.substring(0,Za-2):Tt=Tt.substring(0,Za-1));const Ja=(H[1]+H[0])/2,da=tn+uc/2,_a=ve.length,Vo=new Uint8Array(_a);for(let Ii=0;Ii<_a;Ii++)Vo[Ii]=ve[Ii];const vd=[new Nt(Ja,y),new Nt(da,y)];return new ce(Tt,Vo,0,vd,Ae.CODE_128,new Date().getTime())}}et.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],et.MAX_AVG_VARIANCE=.25,et.MAX_INDIVIDUAL_VARIANCE=.7,et.CODE_SHIFT=98,et.CODE_CODE_C=99,et.CODE_CODE_B=100,et.CODE_CODE_A=101,et.CODE_FNC_1=102,et.CODE_FNC_2=97,et.CODE_FNC_3=96,et.CODE_FNC_4_A=101,et.CODE_FNC_4_B=100,et.CODE_START_A=103,et.CODE_START_B=104,et.CODE_START_C=105,et.CODE_STOP=106;class Be extends Et{constructor(y=!1,E=!1){super(),this.usingCheckDigit=y,this.extendedMode=E,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(y,E,O){let $=this.counters;$.fill(0),this.decodeRowResult="";let H=Be.findAsteriskPattern(E,$),K=E.getNextSet(H[1]),le=E.getSize(),ve,Te;do{Be.recordPattern(E,K,$);let $t=Be.toNarrowWidePattern($);if($t<0)throw new Y;ve=Be.patternToChar($t),this.decodeRowResult+=ve,Te=K;for(let Kt of $)K+=Kt;K=E.getNextSet(K)}while(ve!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let Ze=0;for(let $t of $)Ze+=$t;let ht=K-Te-Ze;if(K!==le&&ht*2<Ze)throw new Y;if(this.usingCheckDigit){let $t=this.decodeRowResult.length-1,Kt=0;for(let _n=0;_n<$t;_n++)Kt+=Be.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(_n));if(this.decodeRowResult.charAt($t)!==Be.ALPHABET_STRING.charAt(Kt%43))throw new g;this.decodeRowResult=this.decodeRowResult.substring(0,$t)}if(this.decodeRowResult.length===0)throw new Y;let Tt;this.extendedMode?Tt=Be.decodeExtended(this.decodeRowResult):Tt=this.decodeRowResult;let tn=(H[1]+H[0])/2,vt=Te+Ze/2;return new ce(Tt,null,0,[new Nt(tn,y),new Nt(vt,y)],Ae.CODE_39,new Date().getTime())}static findAsteriskPattern(y,E){let O=y.getSize(),$=y.getNextSet(0),H=0,K=$,le=!1,ve=E.length;for(let Te=$;Te<O;Te++)if(y.get(Te)!==le)E[H]++;else{if(H===ve-1){if(this.toNarrowWidePattern(E)===Be.ASTERISK_ENCODING&&y.isRange(Math.max(0,K-Math.floor((Te-K)/2)),K,!1))return[K,Te];K+=E[0]+E[1],E.copyWithin(0,2,2+H-1),E[H-1]=0,E[H]=0,H--}else H++;E[H]=1,le=!le}throw new Y}static toNarrowWidePattern(y){let E=y.length,O=0,$;do{let H=2147483647;for(let ve of y)ve<H&&ve>O&&(H=ve);O=H,$=0;let K=0,le=0;for(let ve=0;ve<E;ve++){let Te=y[ve];Te>O&&(le|=1<<E-1-ve,$++,K+=Te)}if($===3){for(let ve=0;ve<E&&$>0;ve++){let Te=y[ve];if(Te>O&&($--,Te*2>=K))return-1}return le}}while($>3);return-1}static patternToChar(y){for(let E=0;E<Be.CHARACTER_ENCODINGS.length;E++)if(Be.CHARACTER_ENCODINGS[E]===y)return Be.ALPHABET_STRING.charAt(E);if(y===Be.ASTERISK_ENCODING)return"*";throw new Y}static decodeExtended(y){let E=y.length,O="";for(let $=0;$<E;$++){let H=y.charAt($);if(H==="+"||H==="$"||H==="%"||H==="/"){let K=y.charAt($+1),le="\0";switch(H){case"+":if(K>="A"&&K<="Z")le=String.fromCharCode(K.charCodeAt(0)+32);else throw new L;break;case"$":if(K>="A"&&K<="Z")le=String.fromCharCode(K.charCodeAt(0)-64);else throw new L;break;case"%":if(K>="A"&&K<="E")le=String.fromCharCode(K.charCodeAt(0)-38);else if(K>="F"&&K<="J")le=String.fromCharCode(K.charCodeAt(0)-11);else if(K>="K"&&K<="O")le=String.fromCharCode(K.charCodeAt(0)+16);else if(K>="P"&&K<="T")le=String.fromCharCode(K.charCodeAt(0)+43);else if(K==="U")le="\0";else if(K==="V")le="@";else if(K==="W")le="`";else if(K==="X"||K==="Y"||K==="Z")le="";else throw new L;break;case"/":if(K>="A"&&K<="O")le=String.fromCharCode(K.charCodeAt(0)-32);else if(K==="Z")le=":";else throw new L;break}O+=le,$++}else O+=H}return O}}Be.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",Be.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],Be.ASTERISK_ENCODING=148;class Mt extends Et{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(y,E,O){let $=this.decodeStart(E),H=this.decodeEnd(E),K=new re;Mt.decodeMiddle(E,$[1],H[0],K);let le=K.toString(),ve=null;O!=null&&(ve=O.get(U.ALLOWED_LENGTHS)),ve==null&&(ve=Mt.DEFAULT_ALLOWED_LENGTHS);let Te=le.length,Ze=!1,ht=0;for(let vt of ve){if(Te===vt){Ze=!0;break}vt>ht&&(ht=vt)}if(!Ze&&Te>ht&&(Ze=!0),!Ze)throw new L;const Tt=[new Nt($[1],y),new Nt(H[0],y)];return new ce(le,null,0,Tt,Ae.ITF,new Date().getTime())}static decodeMiddle(y,E,O,$){let H=new Int32Array(10),K=new Int32Array(5),le=new Int32Array(5);for(H.fill(0),K.fill(0),le.fill(0);E<O;){Et.recordPattern(y,E,H);for(let Te=0;Te<5;Te++){let Ze=2*Te;K[Te]=H[Ze],le[Te]=H[Ze+1]}let ve=Mt.decodeDigit(K);$.append(ve.toString()),ve=this.decodeDigit(le),$.append(ve.toString()),H.forEach(function(Te){E+=Te})}}decodeStart(y){let E=Mt.skipWhiteSpace(y),O=Mt.findGuardPattern(y,E,Mt.START_PATTERN);return this.narrowLineWidth=(O[1]-O[0])/4,this.validateQuietZone(y,O[0]),O}validateQuietZone(y,E){let O=this.narrowLineWidth*10;O=O<E?O:E;for(let $=E-1;O>0&&$>=0&&!y.get($);$--)O--;if(O!==0)throw new Y}static skipWhiteSpace(y){const E=y.getSize(),O=y.getNextSet(0);if(O===E)throw new Y;return O}decodeEnd(y){y.reverse();try{let E=Mt.skipWhiteSpace(y),O;try{O=Mt.findGuardPattern(y,E,Mt.END_PATTERN_REVERSED[0])}catch(H){H instanceof Y&&(O=Mt.findGuardPattern(y,E,Mt.END_PATTERN_REVERSED[1]))}this.validateQuietZone(y,O[0]);let $=O[0];return O[0]=y.getSize()-O[1],O[1]=y.getSize()-$,O}finally{y.reverse()}}static findGuardPattern(y,E,O){let $=O.length,H=new Int32Array($),K=y.getSize(),le=!1,ve=0,Te=E;H.fill(0);for(let Ze=E;Ze<K;Ze++)if(y.get(Ze)!==le)H[ve]++;else{if(ve===$-1){if(Et.patternMatchVariance(H,O,Mt.MAX_INDIVIDUAL_VARIANCE)<Mt.MAX_AVG_VARIANCE)return[Te,Ze];Te+=H[0]+H[1],w.arraycopy(H,2,H,0,ve-1),H[ve-1]=0,H[ve]=0,ve--}else ve++;H[ve]=1,le=!le}throw new Y}static decodeDigit(y){let E=Mt.MAX_AVG_VARIANCE,O=-1,$=Mt.PATTERNS.length;for(let H=0;H<$;H++){let K=Mt.PATTERNS[H],le=Et.patternMatchVariance(y,K,Mt.MAX_INDIVIDUAL_VARIANCE);le<E?(E=le,O=H):le===E&&(O=-1)}if(O>=0)return O%10;throw new Y}}Mt.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],Mt.MAX_AVG_VARIANCE=.38,Mt.MAX_INDIVIDUAL_VARIANCE=.5,Mt.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],Mt.START_PATTERN=Int32Array.from([1,1,1,1]),Mt.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class Ve extends Et{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(y){let E=!1,O,$=0,H=Int32Array.from([0,0,0]);for(;!E;){H=Int32Array.from([0,0,0]),O=Ve.findGuardPattern(y,$,!1,this.START_END_PATTERN,H);let K=O[0];$=O[1];let le=K-($-K);le>=0&&(E=y.isRange(le,K,!1))}return O}static checkChecksum(y){return Ve.checkStandardUPCEANChecksum(y)}static checkStandardUPCEANChecksum(y){let E=y.length;if(E===0)return!1;let O=parseInt(y.charAt(E-1),10);return Ve.getStandardUPCEANChecksum(y.substring(0,E-1))===O}static getStandardUPCEANChecksum(y){let E=y.length,O=0;for(let $=E-1;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}O*=3;for(let $=E-2;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}return(1e3-O)%10}static decodeEnd(y,E){return Ve.findGuardPattern(y,E,!1,Ve.START_END_PATTERN,new Int32Array(Ve.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(y,E,O,$){return this.findGuardPattern(y,E,O,$,new Int32Array($.length))}static findGuardPattern(y,E,O,$,H){let K=y.getSize();E=O?y.getNextUnset(E):y.getNextSet(E);let le=0,ve=E,Te=$.length,Ze=O;for(let ht=E;ht<K;ht++)if(y.get(ht)!==Ze)H[le]++;else{if(le===Te-1){if(Et.patternMatchVariance(H,$,Ve.MAX_INDIVIDUAL_VARIANCE)<Ve.MAX_AVG_VARIANCE)return Int32Array.from([ve,ht]);ve+=H[0]+H[1];let Tt=H.slice(2,H.length-1);for(let tn=0;tn<le-1;tn++)H[tn]=Tt[tn];H[le-1]=0,H[le]=0,le--}else le++;H[le]=1,Ze=!Ze}throw new Y}static decodeDigit(y,E,O,$){this.recordPattern(y,O,E);let H=this.MAX_AVG_VARIANCE,K=-1,le=$.length;for(let ve=0;ve<le;ve++){let Te=$[ve],Ze=Et.patternMatchVariance(E,Te,Ve.MAX_INDIVIDUAL_VARIANCE);Ze<H&&(H=Ze,K=ve)}if(K>=0)return K;throw new Y}}Ve.MAX_AVG_VARIANCE=.48,Ve.MAX_INDIVIDUAL_VARIANCE=.7,Ve.START_END_PATTERN=Int32Array.from([1,1,1]),Ve.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),Ve.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Ve.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class ut{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(y,E,O){let $=this.decodeRowStringBuffer,H=this.decodeMiddle(E,O,$),K=$.toString(),le=ut.parseExtensionString(K),ve=[new Nt((O[0]+O[1])/2,y),new Nt(H,y)],Te=new ce(K,null,0,ve,Ae.UPC_EAN_EXTENSION,new Date().getTime());return le!=null&&Te.putAllMetadata(le),Te}decodeMiddle(y,E,O){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1],le=0;for(let Te=0;Te<5&&K<H;Te++){let Ze=Ve.decodeDigit(y,$,K,Ve.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Ze%10);for(let ht of $)K+=ht;Ze>=10&&(le|=1<<4-Te),Te!==4&&(K=y.getNextSet(K),K=y.getNextUnset(K))}if(O.length!==5)throw new Y;let ve=this.determineCheckDigit(le);if(ut.extensionChecksum(O.toString())!==ve)throw new Y;return K}static extensionChecksum(y){let E=y.length,O=0;for(let $=E-2;$>=0;$-=2)O+=y.charAt($).charCodeAt(0)-48;O*=3;for(let $=E-1;$>=0;$-=2)O+=y.charAt($).charCodeAt(0)-48;return O*=3,O%10}determineCheckDigit(y){for(let E=0;E<10;E++)if(y===this.CHECK_DIGIT_ENCODINGS[E])return E;throw new Y}static parseExtensionString(y){if(y.length!==5)return null;let E=ut.parseExtension5String(y);return E==null?null:new Map([[je.SUGGESTED_PRICE,E]])}static parseExtension5String(y){let E;switch(y.charAt(0)){case"0":E="£";break;case"5":E="$";break;case"9":switch(y){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}E="";break;default:E="";break}let O=parseInt(y.substring(1)),$=(O/100).toString(),H=O%100,K=H<10?"0"+H:H.toString();return E+$+"."+K}}class xt{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(y,E,O){let $=this.decodeRowStringBuffer,H=this.decodeMiddle(E,O,$),K=$.toString(),le=xt.parseExtensionString(K),ve=[new Nt((O[0]+O[1])/2,y),new Nt(H,y)],Te=new ce(K,null,0,ve,Ae.UPC_EAN_EXTENSION,new Date().getTime());return le!=null&&Te.putAllMetadata(le),Te}decodeMiddle(y,E,O){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1],le=0;for(let ve=0;ve<2&&K<H;ve++){let Te=Ve.decodeDigit(y,$,K,Ve.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Te%10);for(let Ze of $)K+=Ze;Te>=10&&(le|=1<<1-ve),ve!==1&&(K=y.getNextSet(K),K=y.getNextUnset(K))}if(O.length!==2)throw new Y;if(parseInt(O.toString())%4!==le)throw new Y;return K}static parseExtensionString(y){return y.length!==2?null:new Map([[je.ISSUE_NUMBER,parseInt(y)]])}}class jt{static decodeRow(y,E,O){let $=Ve.findGuardPattern(E,O,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new ut().decodeRow(y,E,$)}catch{return new xt().decodeRow(y,E,$)}}}jt.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class kt extends Ve{constructor(){super(),this.decodeRowStringBuffer="",kt.L_AND_G_PATTERNS=kt.L_PATTERNS.map(y=>Int32Array.from(y));for(let y=10;y<20;y++){let E=kt.L_PATTERNS[y-10],O=new Int32Array(E.length);for(let $=0;$<E.length;$++)O[$]=E[E.length-$-1];kt.L_AND_G_PATTERNS[y]=O}}decodeRow(y,E,O){let $=kt.findStartGuardPattern(E),H=O==null?null:O.get(U.NEED_RESULT_POINT_CALLBACK);if(H!=null){const wr=new Nt(($[0]+$[1])/2,y);H.foundPossibleResultPoint(wr)}let K=this.decodeMiddle(E,$,this.decodeRowStringBuffer),le=K.rowOffset,ve=K.resultString;if(H!=null){const wr=new Nt(le,y);H.foundPossibleResultPoint(wr)}let Te=this.decodeEnd(E,le);if(H!=null){const wr=new Nt((Te[0]+Te[1])/2,y);H.foundPossibleResultPoint(wr)}let Ze=Te[1],ht=Ze+(Ze-Te[0]);if(ht>=E.getSize()||!E.isRange(Ze,ht,!1))throw new Y;let Tt=ve.toString();if(Tt.length<8)throw new L;if(!kt.checkChecksum(Tt))throw new g;let tn=($[1]+$[0])/2,vt=(Te[1]+Te[0])/2,$t=this.getBarcodeFormat(),Kt=[new Nt(tn,y),new Nt(vt,y)],_n=new ce(Tt,null,0,Kt,$t,new Date().getTime()),ur=0;try{let wr=jt.decodeRow(y,E,Te[1]);_n.putMetadata(je.UPC_EAN_EXTENSION,wr.getText()),_n.putAllMetadata(wr.getResultMetadata()),_n.addResultPoints(wr.getResultPoints()),ur=wr.getText().length}catch{}let br=O==null?null:O.get(U.ALLOWED_EAN_EXTENSIONS);if(br!=null){let wr=!1;for(let ws in br)if(ur.toString()===ws){wr=!0;break}if(!wr)throw new Y}return _n}decodeEnd(y,E){return kt.findGuardPattern(y,E,!1,kt.START_END_PATTERN,new Int32Array(kt.START_END_PATTERN.length).fill(0))}static checkChecksum(y){return kt.checkStandardUPCEANChecksum(y)}static checkStandardUPCEANChecksum(y){let E=y.length;if(E===0)return!1;let O=parseInt(y.charAt(E-1),10);return kt.getStandardUPCEANChecksum(y.substring(0,E-1))===O}static getStandardUPCEANChecksum(y){let E=y.length,O=0;for(let $=E-1;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}O*=3;for(let $=E-2;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}return(1e3-O)%10}}class xn extends kt{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(y,E,O){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1],le=0;for(let Te=0;Te<6&&K<H;Te++){let Ze=kt.decodeDigit(y,$,K,kt.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Ze%10);for(let ht of $)K+=ht;Ze>=10&&(le|=1<<5-Te)}O=xn.determineFirstDigit(O,le),K=kt.findGuardPattern(y,K,!0,kt.MIDDLE_PATTERN,new Int32Array(kt.MIDDLE_PATTERN.length).fill(0))[1];for(let Te=0;Te<6&&K<H;Te++){let Ze=kt.decodeDigit(y,$,K,kt.L_PATTERNS);O+=String.fromCharCode(48+Ze);for(let ht of $)K+=ht}return{rowOffset:K,resultString:O}}getBarcodeFormat(){return Ae.EAN_13}static determineFirstDigit(y,E){for(let O=0;O<10;O++)if(E===this.FIRST_DIGIT_ENCODINGS[O])return y=String.fromCharCode(48+O)+y,y;throw new Y}}xn.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class un extends kt{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(y,E,O){const $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1];for(let ve=0;ve<4&&K<H;ve++){let Te=kt.decodeDigit(y,$,K,kt.L_PATTERNS);O+=String.fromCharCode(48+Te);for(let Ze of $)K+=Ze}K=kt.findGuardPattern(y,K,!0,kt.MIDDLE_PATTERN,new Int32Array(kt.MIDDLE_PATTERN.length).fill(0))[1];for(let ve=0;ve<4&&K<H;ve++){let Te=kt.decodeDigit(y,$,K,kt.L_PATTERNS);O+=String.fromCharCode(48+Te);for(let Ze of $)K+=Ze}return{rowOffset:K,resultString:O}}getBarcodeFormat(){return Ae.EAN_8}}class On extends kt{constructor(){super(...arguments),this.ean13Reader=new xn}getBarcodeFormat(){return Ae.UPC_A}decode(y,E){return this.maybeReturnResult(this.ean13Reader.decode(y))}decodeRow(y,E,O){return this.maybeReturnResult(this.ean13Reader.decodeRow(y,E,O))}decodeMiddle(y,E,O){return this.ean13Reader.decodeMiddle(y,E,O)}maybeReturnResult(y){let E=y.getText();if(E.charAt(0)==="0"){let O=new ce(E.substring(1),null,null,y.getResultPoints(),Ae.UPC_A);return y.getResultMetadata()!=null&&O.putAllMetadata(y.getResultMetadata()),O}else throw new Y}reset(){this.ean13Reader.reset()}}class En extends kt{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(y,E,O){const $=this.decodeMiddleCounters.map(Te=>Te);$[0]=0,$[1]=0,$[2]=0,$[3]=0;const H=y.getSize();let K=E[1],le=0;for(let Te=0;Te<6&&K<H;Te++){const Ze=En.decodeDigit(y,$,K,En.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Ze%10);for(let ht of $)K+=ht;Ze>=10&&(le|=1<<5-Te)}let ve=En.determineNumSysAndCheckDigit(O,le);return{rowOffset:K,resultString:ve}}decodeEnd(y,E){return En.findGuardPatternWithoutCounters(y,E,!0,En.MIDDLE_END_PATTERN)}checkChecksum(y){return kt.checkChecksum(En.convertUPCEtoUPCA(y))}static determineNumSysAndCheckDigit(y,E){for(let O=0;O<=1;O++)for(let $=0;$<10;$++)if(E===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[O][$]){let H=String.fromCharCode(48+O),K=String.fromCharCode(48+$);return H+y+K}throw Y.getNotFoundInstance()}getBarcodeFormat(){return Ae.UPC_E}static convertUPCEtoUPCA(y){const E=y.slice(1,7).split("").map(H=>H.charCodeAt(0)),O=new re;O.append(y.charAt(0));let $=E[5];switch($){case 0:case 1:case 2:O.appendChars(E,0,2),O.append($),O.append("0000"),O.appendChars(E,2,3);break;case 3:O.appendChars(E,0,3),O.append("00000"),O.appendChars(E,3,2);break;case 4:O.appendChars(E,0,4),O.append("00000"),O.append(E[4]);break;default:O.appendChars(E,0,5),O.append("0000"),O.append($);break}return y.length>=8&&O.append(y.charAt(7)),O.toString()}}En.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),En.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,26])];class jn extends Et{constructor(y){super();let E=y==null?null:y.get(U.POSSIBLE_FORMATS),O=[];r(E)?(O.push(new xn),O.push(new On),O.push(new un),O.push(new En)):(E.indexOf(Ae.EAN_13)>-1&&O.push(new xn),E.indexOf(Ae.UPC_A)>-1&&O.push(new On),E.indexOf(Ae.EAN_8)>-1&&O.push(new un),E.indexOf(Ae.UPC_E)>-1&&O.push(new En)),this.readers=O}decodeRow(y,E,O){for(let $ of this.readers)try{const H=$.decodeRow(y,E,O),K=H.getBarcodeFormat()===Ae.EAN_13&&H.getText().charAt(0)==="0",le=O==null?null:O.get(U.POSSIBLE_FORMATS),ve=le==null||le.includes(Ae.UPC_A);if(K&&ve){const Te=H.getRawBytes(),Ze=new ce(H.getText().substring(1),Te,Te?Te.length:null,H.getResultPoints(),Ae.UPC_A);return Ze.putAllMetadata(H.getResultMetadata()),Ze}return H}catch{}throw new Y}reset(){for(let y of this.readers)y.reset()}}class bn extends Et{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(y,E){for(let O=0;O<E.length;O++)if(Et.patternMatchVariance(y,E[O],bn.MAX_INDIVIDUAL_VARIANCE)<bn.MAX_AVG_VARIANCE)return O;throw new Y}static count(y){return It.sum(new Int32Array(y))}static increment(y,E){let O=0,$=E[0];for(let H=1;H<y.length;H++)E[H]>$&&($=E[H],O=H);y[O]++}static decrement(y,E){let O=0,$=E[0];for(let H=1;H<y.length;H++)E[H]<$&&($=E[H],O=H);y[O]--}static isFinderPattern(y){let E=y[0]+y[1],O=E+y[2]+y[3],$=E/O;if($>=bn.MIN_FINDER_PATTERN_RATIO&&$<=bn.MAX_FINDER_PATTERN_RATIO){let H=Number.MAX_SAFE_INTEGER,K=Number.MIN_SAFE_INTEGER;for(let le of y)le>K&&(K=le),le<H&&(H=le);return K<10*H}return!1}}bn.MAX_AVG_VARIANCE=.2,bn.MAX_INDIVIDUAL_VARIANCE=.45,bn.MIN_FINDER_PATTERN_RATIO=9.5/12,bn.MAX_FINDER_PATTERN_RATIO=12.5/14;class Zn{constructor(y,E){this.value=y,this.checksumPortion=E}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(y){if(!(y instanceof Zn))return!1;const E=y;return this.value===E.value&&this.checksumPortion===E.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class zn{constructor(y,E,O,$,H){this.value=y,this.startEnd=E,this.value=y,this.startEnd=E,this.resultPoints=new Array,this.resultPoints.push(new Nt(O,H)),this.resultPoints.push(new Nt($,H))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(y){if(!(y instanceof zn))return!1;const E=y;return this.value===E.value}hashCode(){return this.value}}class $n{constructor(){}static getRSSvalue(y,E,O){let $=0;for(let ve of y)$+=ve;let H=0,K=0,le=y.length;for(let ve=0;ve<le-1;ve++){let Te;for(Te=1,K|=1<<ve;Te<y[ve];Te++,K&=~(1<<ve)){let Ze=$n.combins($-Te-1,le-ve-2);if(O&&K===0&&$-Te-(le-ve-1)>=le-ve-1&&(Ze-=$n.combins($-Te-(le-ve),le-ve-2)),le-ve-1>1){let ht=0;for(let Tt=$-Te-(le-ve-2);Tt>E;Tt--)ht+=$n.combins($-Te-Tt-1,le-ve-3);Ze-=ht*(le-1-ve)}else $-Te>E&&Ze--;H+=Ze}$-=Te}return H}static combins(y,E){let O,$;y-E>E?($=E,O=y-E):($=y-E,O=E);let H=1,K=1;for(let le=y;le>O;le--)H*=le,K<=$&&(H/=K,K++);for(;K<=$;)H/=K,K++;return H}}class nr{static buildBitArray(y){let E=y.length*2-1;y[y.length-1].getRightChar()==null&&(E-=1);let O=12*E,$=new R(O),H=0,le=y[0].getRightChar().getValue();for(let ve=11;ve>=0;--ve)le&1<<ve&&$.set(H),H++;for(let ve=1;ve<y.length;++ve){let Te=y[ve],Ze=Te.getLeftChar().getValue();for(let ht=11;ht>=0;--ht)Ze&1<<ht&&$.set(H),H++;if(Te.getRightChar()!=null){let ht=Te.getRightChar().getValue();for(let Tt=11;Tt>=0;--Tt)ht&1<<Tt&&$.set(H),H++}}return $}}class wn{constructor(y,E){E?this.decodedInformation=null:(this.finished=y,this.decodedInformation=E)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class on{constructor(y){this.newPosition=y}getNewPosition(){return this.newPosition}}class Oe extends on{constructor(y,E){super(y),this.value=E}getValue(){return this.value}isFNC1(){return this.value===Oe.FNC1}}Oe.FNC1="$";class rn extends on{constructor(y,E,O){super(y),O?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=E}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class cn extends on{constructor(y,E,O){if(super(y),E<0||E>10||O<0||O>10)throw new L;this.firstDigit=E,this.secondDigit=O}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===cn.FNC1}isSecondDigitFNC1(){return this.secondDigit===cn.FNC1}isAnyFNC1(){return this.firstDigit===cn.FNC1||this.secondDigit===cn.FNC1}}cn.FNC1=10;class _t{constructor(){}static parseFieldsInGeneralPurpose(y){if(!y)return null;if(y.length<2)throw new Y;let E=y.substring(0,2);for(let H of _t.TWO_DIGIT_DATA_LENGTH)if(H[0]===E)return H[1]===_t.VARIABLE_LENGTH?_t.processVariableAI(2,H[2],y):_t.processFixedAI(2,H[1],y);if(y.length<3)throw new Y;let O=y.substring(0,3);for(let H of _t.THREE_DIGIT_DATA_LENGTH)if(H[0]===O)return H[1]===_t.VARIABLE_LENGTH?_t.processVariableAI(3,H[2],y):_t.processFixedAI(3,H[1],y);for(let H of _t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(H[0]===O)return H[1]===_t.VARIABLE_LENGTH?_t.processVariableAI(4,H[2],y):_t.processFixedAI(4,H[1],y);if(y.length<4)throw new Y;let $=y.substring(0,4);for(let H of _t.FOUR_DIGIT_DATA_LENGTH)if(H[0]===$)return H[1]===_t.VARIABLE_LENGTH?_t.processVariableAI(4,H[2],y):_t.processFixedAI(4,H[1],y);throw new Y}static processFixedAI(y,E,O){if(O.length<y)throw new Y;let $=O.substring(0,y);if(O.length<y+E)throw new Y;let H=O.substring(y,y+E),K=O.substring(y+E),le="("+$+")"+H,ve=_t.parseFieldsInGeneralPurpose(K);return ve==null?le:le+ve}static processVariableAI(y,E,O){let $=O.substring(0,y),H;O.length<y+E?H=O.length:H=y+E;let K=O.substring(y,H),le=O.substring(H),ve="("+$+")"+K,Te=_t.parseFieldsInGeneralPurpose(le);return Te==null?ve:ve+Te}}_t.VARIABLE_LENGTH=[],_t.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",_t.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",_t.VARIABLE_LENGTH,20],["22",_t.VARIABLE_LENGTH,29],["30",_t.VARIABLE_LENGTH,8],["37",_t.VARIABLE_LENGTH,8],["90",_t.VARIABLE_LENGTH,30],["91",_t.VARIABLE_LENGTH,30],["92",_t.VARIABLE_LENGTH,30],["93",_t.VARIABLE_LENGTH,30],["94",_t.VARIABLE_LENGTH,30],["95",_t.VARIABLE_LENGTH,30],["96",_t.VARIABLE_LENGTH,30],["97",_t.VARIABLE_LENGTH,3],["98",_t.VARIABLE_LENGTH,30],["99",_t.VARIABLE_LENGTH,30]],_t.THREE_DIGIT_DATA_LENGTH=[["240",_t.VARIABLE_LENGTH,30],["241",_t.VARIABLE_LENGTH,30],["242",_t.VARIABLE_LENGTH,6],["250",_t.VARIABLE_LENGTH,30],["251",_t.VARIABLE_LENGTH,30],["253",_t.VARIABLE_LENGTH,17],["254",_t.VARIABLE_LENGTH,20],["400",_t.VARIABLE_LENGTH,30],["401",_t.VARIABLE_LENGTH,30],["402",17],["403",_t.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",_t.VARIABLE_LENGTH,20],["421",_t.VARIABLE_LENGTH,15],["422",3],["423",_t.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],_t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",_t.VARIABLE_LENGTH,15],["391",_t.VARIABLE_LENGTH,18],["392",_t.VARIABLE_LENGTH,15],["393",_t.VARIABLE_LENGTH,18],["703",_t.VARIABLE_LENGTH,30]],_t.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",_t.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",_t.VARIABLE_LENGTH,20],["8003",_t.VARIABLE_LENGTH,30],["8004",_t.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",_t.VARIABLE_LENGTH,30],["8008",_t.VARIABLE_LENGTH,12],["8018",18],["8020",_t.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",_t.VARIABLE_LENGTH,70],["8200",_t.VARIABLE_LENGTH,70]];class Yn{constructor(y){this.buffer=new re,this.information=y}decodeAllCodes(y,E){let O=E,$=null;do{let H=this.decodeGeneralPurposeField(O,$),K=_t.parseFieldsInGeneralPurpose(H.getNewString());if(K!=null&&y.append(K),H.isRemaining()?$=""+H.getRemainingValue():$=null,O===H.getNewPosition())break;O=H.getNewPosition()}while(!0);return y.toString()}isStillNumeric(y){if(y+7>this.information.getSize())return y+4<=this.information.getSize();for(let E=y;E<y+3;++E)if(this.information.get(E))return!0;return this.information.get(y+3)}decodeNumeric(y){if(y+7>this.information.getSize()){let H=this.extractNumericValueFromBitArray(y,4);return H===0?new cn(this.information.getSize(),cn.FNC1,cn.FNC1):new cn(this.information.getSize(),H-1,cn.FNC1)}let E=this.extractNumericValueFromBitArray(y,7),O=(E-8)/11,$=(E-8)%11;return new cn(y+7,O,$)}extractNumericValueFromBitArray(y,E){return Yn.extractNumericValueFromBitArray(this.information,y,E)}static extractNumericValueFromBitArray(y,E,O){let $=0;for(let H=0;H<O;++H)y.get(E+H)&&($|=1<<O-H-1);return $}decodeGeneralPurposeField(y,E){this.buffer.setLengthToZero(),E!=null&&this.buffer.append(E),this.current.setPosition(y);let O=this.parseBlocks();return O!=null&&O.isRemaining()?new rn(this.current.getPosition(),this.buffer.toString(),O.getRemainingValue()):new rn(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let y,E;do{let O=this.current.getPosition();if(this.current.isAlpha()?(E=this.parseAlphaBlock(),y=E.isFinished()):this.current.isIsoIec646()?(E=this.parseIsoIec646Block(),y=E.isFinished()):(E=this.parseNumericBlock(),y=E.isFinished()),!(O!==this.current.getPosition())&&!y)break}while(!y);return E.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let y=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(y.getNewPosition()),y.isFirstDigitFNC1()){let E;return y.isSecondDigitFNC1()?E=new rn(this.current.getPosition(),this.buffer.toString()):E=new rn(this.current.getPosition(),this.buffer.toString(),y.getSecondDigit()),new wn(!0,E)}if(this.buffer.append(y.getFirstDigit()),y.isSecondDigitFNC1()){let E=new rn(this.current.getPosition(),this.buffer.toString());return new wn(!0,E)}this.buffer.append(y.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new wn(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let y=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(y.getNewPosition()),y.isFNC1()){let E=new rn(this.current.getPosition(),this.buffer.toString());return new wn(!0,E)}this.buffer.append(y.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new wn(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let y=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(y.getNewPosition()),y.isFNC1()){let E=new rn(this.current.getPosition(),this.buffer.toString());return new wn(!0,E)}this.buffer.append(y.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new wn(!1)}isStillIsoIec646(y){if(y+5>this.information.getSize())return!1;let E=this.extractNumericValueFromBitArray(y,5);if(E>=5&&E<16)return!0;if(y+7>this.information.getSize())return!1;let O=this.extractNumericValueFromBitArray(y,7);if(O>=64&&O<116)return!0;if(y+8>this.information.getSize())return!1;let $=this.extractNumericValueFromBitArray(y,8);return $>=232&&$<253}decodeIsoIec646(y){let E=this.extractNumericValueFromBitArray(y,5);if(E===15)return new Oe(y+5,Oe.FNC1);if(E>=5&&E<15)return new Oe(y+5,"0"+(E-5));let O=this.extractNumericValueFromBitArray(y,7);if(O>=64&&O<90)return new Oe(y+7,""+(O+1));if(O>=90&&O<116)return new Oe(y+7,""+(O+7));let $=this.extractNumericValueFromBitArray(y,8),H;switch($){case 232:H="!";break;case 233:H='"';break;case 234:H="%";break;case 235:H="&";break;case 236:H="'";break;case 237:H="(";break;case 238:H=")";break;case 239:H="*";break;case 240:H="+";break;case 241:H=",";break;case 242:H="-";break;case 243:H=".";break;case 244:H="/";break;case 245:H=":";break;case 246:H=";";break;case 247:H="<";break;case 248:H="=";break;case 249:H=">";break;case 250:H="?";break;case 251:H="_";break;case 252:H=" ";break;default:throw new L}return new Oe(y+8,H)}isStillAlpha(y){if(y+5>this.information.getSize())return!1;let E=this.extractNumericValueFromBitArray(y,5);if(E>=5&&E<16)return!0;if(y+6>this.information.getSize())return!1;let O=this.extractNumericValueFromBitArray(y,6);return O>=16&&O<63}decodeAlphanumeric(y){let E=this.extractNumericValueFromBitArray(y,5);if(E===15)return new Oe(y+5,Oe.FNC1);if(E>=5&&E<15)return new Oe(y+5,"0"+(E-5));let O=this.extractNumericValueFromBitArray(y,6);if(O>=32&&O<58)return new Oe(y+6,""+(O+33));let $;switch(O){case 58:$="*";break;case 59:$=",";break;case 60:$="-";break;case 61:$=".";break;case 62:$="/";break;default:throw new ot("Decoding invalid alphanumeric value: "+O)}return new Oe(y+6,$)}isAlphaTo646ToAlphaLatch(y){if(y+1>this.information.getSize())return!1;for(let E=0;E<5&&E+y<this.information.getSize();++E)if(E===2){if(!this.information.get(y+2))return!1}else if(this.information.get(y+E))return!1;return!0}isAlphaOr646ToNumericLatch(y){if(y+3>this.information.getSize())return!1;for(let E=y;E<y+3;++E)if(this.information.get(E))return!1;return!0}isNumericToAlphaNumericLatch(y){if(y+1>this.information.getSize())return!1;for(let E=0;E<4&&E+y<this.information.getSize();++E)if(this.information.get(y+E))return!1;return!0}}class yn{constructor(y){this.information=y,this.generalDecoder=new Yn(y)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Dt extends yn{constructor(y){super(y)}encodeCompressedGtin(y,E){y.append("(01)");let O=y.length();y.append("9"),this.encodeCompressedGtinWithoutAI(y,E,O)}encodeCompressedGtinWithoutAI(y,E,O){for(let $=0;$<4;++$){let H=this.getGeneralDecoder().extractNumericValueFromBitArray(E+10*$,10);H/100===0&&y.append("0"),H/10===0&&y.append("0"),y.append(H)}Dt.appendCheckDigit(y,O)}static appendCheckDigit(y,E){let O=0;for(let $=0;$<13;$++){let H=y.charAt($+E).charCodeAt(0)-48;O+=$&1?H:3*H}O=10-O%10,O===10&&(O=0),y.append(O)}}Dt.GTIN_SIZE=40;class sn extends Dt{constructor(y){super(y)}parseInformation(){let y=new re;y.append("(01)");let E=y.length(),O=this.getGeneralDecoder().extractNumericValueFromBitArray(sn.HEADER_SIZE,4);return y.append(O),this.encodeCompressedGtinWithoutAI(y,sn.HEADER_SIZE+4,E),this.getGeneralDecoder().decodeAllCodes(y,sn.HEADER_SIZE+44)}}sn.HEADER_SIZE=4;class Tn extends yn{constructor(y){super(y)}parseInformation(){let y=new re;return this.getGeneralDecoder().decodeAllCodes(y,Tn.HEADER_SIZE)}}Tn.HEADER_SIZE=5;class Kn extends Dt{constructor(y){super(y)}encodeCompressedWeight(y,E,O){let $=this.getGeneralDecoder().extractNumericValueFromBitArray(E,O);this.addWeightCode(y,$);let H=this.checkWeight($),K=1e5;for(let le=0;le<5;++le)H/K===0&&y.append("0"),K/=10;y.append(H)}}class ir extends Kn{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()!=ir.HEADER_SIZE+Kn.GTIN_SIZE+ir.WEIGHT_SIZE)throw new Y;let y=new re;return this.encodeCompressedGtin(y,ir.HEADER_SIZE),this.encodeCompressedWeight(y,ir.HEADER_SIZE+Kn.GTIN_SIZE,ir.WEIGHT_SIZE),y.toString()}}ir.HEADER_SIZE=5,ir.WEIGHT_SIZE=15;class rr extends ir{constructor(y){super(y)}addWeightCode(y,E){y.append("(3103)")}checkWeight(y){return y}}class Jt extends ir{constructor(y){super(y)}addWeightCode(y,E){E<1e4?y.append("(3202)"):y.append("(3203)")}checkWeight(y){return y<1e4?y:y-1e4}}class Un extends Dt{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()<Un.HEADER_SIZE+Dt.GTIN_SIZE)throw new Y;let y=new re;this.encodeCompressedGtin(y,Un.HEADER_SIZE);let E=this.getGeneralDecoder().extractNumericValueFromBitArray(Un.HEADER_SIZE+Dt.GTIN_SIZE,Un.LAST_DIGIT_SIZE);y.append("(392"),y.append(E),y.append(")");let O=this.getGeneralDecoder().decodeGeneralPurposeField(Un.HEADER_SIZE+Dt.GTIN_SIZE+Un.LAST_DIGIT_SIZE,null);return y.append(O.getNewString()),y.toString()}}Un.HEADER_SIZE=8,Un.LAST_DIGIT_SIZE=2;class Qn extends Dt{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()<Qn.HEADER_SIZE+Dt.GTIN_SIZE)throw new Y;let y=new re;this.encodeCompressedGtin(y,Qn.HEADER_SIZE);let E=this.getGeneralDecoder().extractNumericValueFromBitArray(Qn.HEADER_SIZE+Dt.GTIN_SIZE,Qn.LAST_DIGIT_SIZE);y.append("(393"),y.append(E),y.append(")");let O=this.getGeneralDecoder().extractNumericValueFromBitArray(Qn.HEADER_SIZE+Dt.GTIN_SIZE+Qn.LAST_DIGIT_SIZE,Qn.FIRST_THREE_DIGITS_SIZE);O/100==0&&y.append("0"),O/10==0&&y.append("0"),y.append(O);let $=this.getGeneralDecoder().decodeGeneralPurposeField(Qn.HEADER_SIZE+Dt.GTIN_SIZE+Qn.LAST_DIGIT_SIZE+Qn.FIRST_THREE_DIGITS_SIZE,null);return y.append($.getNewString()),y.toString()}}Qn.HEADER_SIZE=8,Qn.LAST_DIGIT_SIZE=2,Qn.FIRST_THREE_DIGITS_SIZE=10;class Rt extends Kn{constructor(y,E,O){super(y),this.dateCode=O,this.firstAIdigits=E}parseInformation(){if(this.getInformation().getSize()!=Rt.HEADER_SIZE+Rt.GTIN_SIZE+Rt.WEIGHT_SIZE+Rt.DATE_SIZE)throw new Y;let y=new re;return this.encodeCompressedGtin(y,Rt.HEADER_SIZE),this.encodeCompressedWeight(y,Rt.HEADER_SIZE+Rt.GTIN_SIZE,Rt.WEIGHT_SIZE),this.encodeCompressedDate(y,Rt.HEADER_SIZE+Rt.GTIN_SIZE+Rt.WEIGHT_SIZE),y.toString()}encodeCompressedDate(y,E){let O=this.getGeneralDecoder().extractNumericValueFromBitArray(E,Rt.DATE_SIZE);if(O==38400)return;y.append("("),y.append(this.dateCode),y.append(")");let $=O%32;O/=32;let H=O%12+1;O/=12;let K=O;K/10==0&&y.append("0"),y.append(K),H/10==0&&y.append("0"),y.append(H),$/10==0&&y.append("0"),y.append($)}addWeightCode(y,E){y.append("("),y.append(this.firstAIdigits),y.append(E/1e5),y.append(")")}checkWeight(y){return y%1e5}}Rt.HEADER_SIZE=8,Rt.WEIGHT_SIZE=20,Rt.DATE_SIZE=16;function Pn(dt){try{if(dt.get(1))return new sn(dt);if(!dt.get(2))return new Tn(dt);switch(Yn.extractNumericValueFromBitArray(dt,1,4)){case 4:return new rr(dt);case 5:return new Jt(dt)}switch(Yn.extractNumericValueFromBitArray(dt,1,5)){case 12:return new Un(dt);case 13:return new Qn(dt)}switch(Yn.extractNumericValueFromBitArray(dt,1,7)){case 56:return new Rt(dt,"310","11");case 57:return new Rt(dt,"320","11");case 58:return new Rt(dt,"310","13");case 59:return new Rt(dt,"320","13");case 60:return new Rt(dt,"310","15");case 61:return new Rt(dt,"320","15");case 62:return new Rt(dt,"310","17");case 63:return new Rt(dt,"320","17")}}catch(y){throw console.log(y),new ot("unknown decoder: "+dt)}}class Ee{constructor(y,E,O,$){this.leftchar=y,this.rightchar=E,this.finderpattern=O,this.maybeLast=$}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return this.rightchar==null}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"}static equals(y,E){return y instanceof Ee?Ee.equalsOrNull(y.leftchar,E.leftchar)&&Ee.equalsOrNull(y.rightchar,E.rightchar)&&Ee.equalsOrNull(y.finderpattern,E.finderpattern):!1}static equalsOrNull(y,E){return y===null?E===null:Ee.equals(y,E)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class p{constructor(y,E,O){this.pairs=y,this.rowNumber=E,this.wasReversed=O}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(y){return this.checkEqualitity(this,y)}toString(){return"{ "+this.pairs+" }"}equals(y,E){return y instanceof p?this.checkEqualitity(y,E)&&y.wasReversed===E.wasReversed:!1}checkEqualitity(y,E){if(!y||!E)return;let O;return y.forEach(($,H)=>{E.forEach(K=>{$.getLeftChar().getValue()===K.getLeftChar().getValue()&&$.getRightChar().getValue()===K.getRightChar().getValue()&&$.getFinderPatter().getValue()===K.getFinderPatter().getValue()&&(O=!0)})}),O}}class h extends bn{constructor(y){super(...arguments),this.pairs=new Array(h.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=y===!0}decodeRow(y,E,O){this.pairs.length=0,this.startFromEven=!1;try{return h.constructResult(this.decodeRow2pairs(y,E))}catch($){this.verbose&&console.log($)}return this.pairs.length=0,this.startFromEven=!0,h.constructResult(this.decodeRow2pairs(y,E))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(y,E){let O=!1;for(;!O;)try{this.pairs.push(this.retrieveNextPair(E,this.pairs,y))}catch(H){if(H instanceof Y){if(!this.pairs.length)throw new Y;O=!0}}if(this.checkChecksum())return this.pairs;let $;if(this.rows.length?$=!0:$=!1,this.storeRow(y,!1),$){let H=this.checkRowsBoolean(!1);if(H!=null||(H=this.checkRowsBoolean(!0),H!=null))return H}throw new Y}checkRowsBoolean(y){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,y&&(this.rows=this.rows.reverse());let E=null;try{E=this.checkRows(new Array,0)}catch(O){this.verbose&&console.log(O)}return y&&(this.rows=this.rows.reverse()),E}checkRows(y,E){for(let O=E;O<this.rows.length;O++){let $=this.rows[O];this.pairs.length=0;for(let K of y)this.pairs.push(K.getPairs());if(this.pairs.push($.getPairs()),!h.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let H=new Array(y);H.push($);try{return this.checkRows(H,O+1)}catch(K){this.verbose&&console.log(K)}}throw new Y}static isValidSequence(y){for(let E of h.FINDER_PATTERN_SEQUENCES){if(y.length>E.length)continue;let O=!0;for(let $=0;$<y.length;$++)if(y[$].getFinderPattern().getValue()!=E[$]){O=!1;break}if(O)return!0}return!1}storeRow(y,E){let O=0,$=!1,H=!1;for(;O<this.rows.length;){let K=this.rows[O];if(K.getRowNumber()>y){H=K.isEquivalent(this.pairs);break}$=K.isEquivalent(this.pairs),O++}H||$||h.isPartialRow(this.pairs,this.rows)||(this.rows.push(O,new p(this.pairs,y,E)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(y,E){for(let O of E)if(O.getPairs().length!==y.length){for(let $ of O.getPairs())for(let H of y)if(Ee.equals($,H))break}}static isPartialRow(y,E){for(let O of E){let $=!0;for(let H of y){let K=!1;for(let le of O.getPairs())if(H.equals(le)){K=!0;break}if(!K){$=!1;break}}if($)return!0}return!1}getRows(){return this.rows}static constructResult(y){let E=nr.buildBitArray(y),$=Pn(E).parseInformation(),H=y[0].getFinderPattern().getResultPoints(),K=y[y.length-1].getFinderPattern().getResultPoints(),le=[H[0],H[1],K[0],K[1]];return new ce($,null,null,le,Ae.RSS_EXPANDED,null)}checkChecksum(){let y=this.pairs.get(0),E=y.getLeftChar(),O=y.getRightChar();if(O==null)return!1;let $=O.getChecksumPortion(),H=2;for(let le=1;le<this.pairs.size();++le){let ve=this.pairs.get(le);$+=ve.getLeftChar().getChecksumPortion(),H++;let Te=ve.getRightChar();Te!=null&&($+=Te.getChecksumPortion(),H++)}return $%=211,211*(H-4)+$==E.getValue()}static getNextSecondBar(y,E){let O;return y.get(E)?(O=y.getNextUnset(E),O=y.getNextSet(O)):(O=y.getNextSet(E),O=y.getNextUnset(O)),O}retrieveNextPair(y,E,O){let $=E.length%2==0;this.startFromEven&&($=!$);let H,K=!0,le=-1;do this.findNextPair(y,E,le),H=this.parseFoundFinderPattern(y,O,$),H==null?le=h.getNextSecondBar(y,this.startEnd[0]):K=!1;while(K);let ve=this.decodeDataCharacter(y,H,$,!0);if(!this.isEmptyPair(E)&&E[E.length-1].mustBeLast())throw new Y;let Te;try{Te=this.decodeDataCharacter(y,H,$,!1)}catch(Ze){Te=null,this.verbose&&console.log(Ze)}return new Ee(ve,Te,H,!0)}isEmptyPair(y){return y.length===0}findNextPair(y,E,O){let $=this.getDecodeFinderCounters();$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K;O>=0?K=O:this.isEmptyPair(E)?K=0:K=E[E.length-1].getFinderPattern().getStartEnd()[1];let le=E.length%2!=0;this.startFromEven&&(le=!le);let ve=!1;for(;K<H&&(ve=!y.get(K),!!ve);)K++;let Te=0,Ze=K;for(let ht=K;ht<H;ht++)if(y.get(ht)!=ve)$[Te]++;else{if(Te==3){if(le&&h.reverseCounters($),h.isFinderPattern($)){this.startEnd[0]=Ze,this.startEnd[1]=ht;return}le&&h.reverseCounters($),Ze+=$[0]+$[1],$[0]=$[2],$[1]=$[3],$[2]=0,$[3]=0,Te--}else Te++;$[Te]=1,ve=!ve}throw new Y}static reverseCounters(y){let E=y.length;for(let O=0;O<E/2;++O){let $=y[O];y[O]=y[E-O-1],y[E-O-1]=$}}parseFoundFinderPattern(y,E,O){let $,H,K;if(O){let Te=this.startEnd[0]-1;for(;Te>=0&&!y.get(Te);)Te--;Te++,$=this.startEnd[0]-Te,H=Te,K=this.startEnd[1]}else H=this.startEnd[0],K=y.getNextUnset(this.startEnd[1]+1),$=K-this.startEnd[1];let le=this.getDecodeFinderCounters();w.arraycopy(le,0,le,1,le.length-1),le[0]=$;let ve;try{ve=this.parseFinderValue(le,h.FINDER_PATTERNS)}catch{return null}return new zn(ve,[H,K],H,K,E)}decodeDataCharacter(y,E,O,$){let H=this.getDataCharacterCounters();for(let da=0;da<H.length;da++)H[da]=0;if($)h.recordPatternInReverse(y,E.getStartEnd()[0],H);else{h.recordPattern(y,E.getStartEnd()[1],H);for(let da=0,_a=H.length-1;da<_a;da++,_a--){let Vo=H[da];H[da]=H[_a],H[_a]=Vo}}let K=17,le=It.sum(new Int32Array(H))/K,ve=(E.getStartEnd()[1]-E.getStartEnd()[0])/15;if(Math.abs(le-ve)/ve>.3)throw new Y;let Te=this.getOddCounts(),Ze=this.getEvenCounts(),ht=this.getOddRoundingErrors(),Tt=this.getEvenRoundingErrors();for(let da=0;da<H.length;da++){let _a=1*H[da]/le,Vo=_a+.5;if(Vo<1){if(_a<.3)throw new Y;Vo=1}else if(Vo>8){if(_a>8.7)throw new Y;Vo=8}let vd=da/2;da&1?(Ze[vd]=Vo,Tt[vd]=_a-Vo):(Te[vd]=Vo,ht[vd]=_a-Vo)}this.adjustOddEvenCounts(K);let tn=4*E.getValue()+(O?0:2)+($?0:1)-1,vt=0,$t=0;for(let da=Te.length-1;da>=0;da--){if(h.isNotA1left(E,O,$)){let _a=h.WEIGHTS[tn][2*da];$t+=Te[da]*_a}vt+=Te[da]}let Kt=0;for(let da=Ze.length-1;da>=0;da--)if(h.isNotA1left(E,O,$)){let _a=h.WEIGHTS[tn][2*da+1];Kt+=Ze[da]*_a}let _n=$t+Kt;if(vt&1||vt>13||vt<4)throw new Y;let ur=(13-vt)/2,br=h.SYMBOL_WIDEST[ur],wr=9-br,ws=$n.getRSSvalue(Te,br,!0),Ks=$n.getRSSvalue(Ze,wr,!1),uc=h.EVEN_TOTAL_SUBSET[ur],Za=h.GSUM[ur],Ja=ws*uc+Ks+Za;return new Zn(Ja,_n)}static isNotA1left(y,E,O){return!(y.getValue()==0&&E&&O)}adjustOddEvenCounts(y){let E=It.sum(new Int32Array(this.getOddCounts())),O=It.sum(new Int32Array(this.getEvenCounts())),$=!1,H=!1;E>13?H=!0:E<4&&($=!0);let K=!1,le=!1;O>13?le=!0:O<4&&(K=!0);let ve=E+O-y,Te=(E&1)==1,Ze=(O&1)==0;if(ve==1)if(Te){if(Ze)throw new Y;H=!0}else{if(!Ze)throw new Y;le=!0}else if(ve==-1)if(Te){if(Ze)throw new Y;$=!0}else{if(!Ze)throw new Y;K=!0}else if(ve==0){if(Te){if(!Ze)throw new Y;E<O?($=!0,le=!0):(H=!0,K=!0)}else if(Ze)throw new Y}else throw new Y;if($){if(H)throw new Y;h.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(H&&h.decrement(this.getOddCounts(),this.getOddRoundingErrors()),K){if(le)throw new Y;h.increment(this.getEvenCounts(),this.getOddRoundingErrors())}le&&h.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}h.SYMBOL_WIDEST=[7,5,4,3,1],h.EVEN_TOTAL_SUBSET=[4,20,52,104,204],h.GSUM=[0,348,1388,2948,3988],h.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],h.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],h.FINDER_PAT_A=0,h.FINDER_PAT_B=1,h.FINDER_PAT_C=2,h.FINDER_PAT_D=3,h.FINDER_PAT_E=4,h.FINDER_PAT_F=5,h.FINDER_PATTERN_SEQUENCES=[[h.FINDER_PAT_A,h.FINDER_PAT_A],[h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B],[h.FINDER_PAT_A,h.FINDER_PAT_C,h.FINDER_PAT_B,h.FINDER_PAT_D],[h.FINDER_PAT_A,h.FINDER_PAT_E,h.FINDER_PAT_B,h.FINDER_PAT_D,h.FINDER_PAT_C],[h.FINDER_PAT_A,h.FINDER_PAT_E,h.FINDER_PAT_B,h.FINDER_PAT_D,h.FINDER_PAT_D,h.FINDER_PAT_F],[h.FINDER_PAT_A,h.FINDER_PAT_E,h.FINDER_PAT_B,h.FINDER_PAT_D,h.FINDER_PAT_E,h.FINDER_PAT_F,h.FINDER_PAT_F],[h.FINDER_PAT_A,h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B,h.FINDER_PAT_C,h.FINDER_PAT_C,h.FINDER_PAT_D,h.FINDER_PAT_D],[h.FINDER_PAT_A,h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B,h.FINDER_PAT_C,h.FINDER_PAT_C,h.FINDER_PAT_D,h.FINDER_PAT_E,h.FINDER_PAT_E],[h.FINDER_PAT_A,h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B,h.FINDER_PAT_C,h.FINDER_PAT_C,h.FINDER_PAT_D,h.FINDER_PAT_E,h.FINDER_PAT_F,h.FINDER_PAT_F],[h.FINDER_PAT_A,h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B,h.FINDER_PAT_C,h.FINDER_PAT_D,h.FINDER_PAT_D,h.FINDER_PAT_E,h.FINDER_PAT_E,h.FINDER_PAT_F,h.FINDER_PAT_F]],h.MAX_PAIRS=11;class S extends Zn{constructor(y,E,O){super(y,E),this.count=0,this.finderPattern=O}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class _ extends bn{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(y,E,O){const $=this.decodePair(E,!1,y,O);_.addOrTally(this.possibleLeftPairs,$),E.reverse();let H=this.decodePair(E,!0,y,O);_.addOrTally(this.possibleRightPairs,H),E.reverse();for(let K of this.possibleLeftPairs)if(K.getCount()>1){for(let le of this.possibleRightPairs)if(le.getCount()>1&&_.checkChecksum(K,le))return _.constructResult(K,le)}throw new Y}static addOrTally(y,E){if(E==null)return;let O=!1;for(let $ of y)if($.getValue()===E.getValue()){$.incrementCount(),O=!0;break}O||y.push(E)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(y,E){let O=4537077*y.getValue()+E.getValue(),$=new String(O).toString(),H=new re;for(let Te=13-$.length;Te>0;Te--)H.append("0");H.append($);let K=0;for(let Te=0;Te<13;Te++){let Ze=H.charAt(Te).charCodeAt(0)-48;K+=Te&1?Ze:3*Ze}K=10-K%10,K===10&&(K=0),H.append(K.toString());let le=y.getFinderPattern().getResultPoints(),ve=E.getFinderPattern().getResultPoints();return new ce(H.toString(),null,0,[le[0],le[1],ve[0],ve[1]],Ae.RSS_14,new Date().getTime())}static checkChecksum(y,E){let O=(y.getChecksumPortion()+16*E.getChecksumPortion())%79,$=9*y.getFinderPattern().getValue()+E.getFinderPattern().getValue();return $>72&&$--,$>8&&$--,O===$}decodePair(y,E,O,$){try{let H=this.findFinderPattern(y,E),K=this.parseFoundFinderPattern(y,O,E,H),le=$==null?null:$.get(U.NEED_RESULT_POINT_CALLBACK);if(le!=null){let Ze=(H[0]+H[1])/2;E&&(Ze=y.getSize()-1-Ze),le.foundPossibleResultPoint(new Nt(Ze,O))}let ve=this.decodeDataCharacter(y,K,!0),Te=this.decodeDataCharacter(y,K,!1);return new S(1597*ve.getValue()+Te.getValue(),ve.getChecksumPortion()+4*Te.getChecksumPortion(),K)}catch{return null}}decodeDataCharacter(y,E,O){let $=this.getDataCharacterCounters();for(let Kt=0;Kt<$.length;Kt++)$[Kt]=0;if(O)Et.recordPatternInReverse(y,E.getStartEnd()[0],$);else{Et.recordPattern(y,E.getStartEnd()[1]+1,$);for(let Kt=0,_n=$.length-1;Kt<_n;Kt++,_n--){let ur=$[Kt];$[Kt]=$[_n],$[_n]=ur}}let H=O?16:15,K=It.sum(new Int32Array($))/H,le=this.getOddCounts(),ve=this.getEvenCounts(),Te=this.getOddRoundingErrors(),Ze=this.getEvenRoundingErrors();for(let Kt=0;Kt<$.length;Kt++){let _n=$[Kt]/K,ur=Math.floor(_n+.5);ur<1?ur=1:ur>8&&(ur=8);let br=Math.floor(Kt/2);Kt&1?(ve[br]=ur,Ze[br]=_n-ur):(le[br]=ur,Te[br]=_n-ur)}this.adjustOddEvenCounts(O,H);let ht=0,Tt=0;for(let Kt=le.length-1;Kt>=0;Kt--)Tt*=9,Tt+=le[Kt],ht+=le[Kt];let tn=0,vt=0;for(let Kt=ve.length-1;Kt>=0;Kt--)tn*=9,tn+=ve[Kt],vt+=ve[Kt];let $t=Tt+3*tn;if(O){if(ht&1||ht>12||ht<4)throw new Y;let Kt=(12-ht)/2,_n=_.OUTSIDE_ODD_WIDEST[Kt],ur=9-_n,br=$n.getRSSvalue(le,_n,!1),wr=$n.getRSSvalue(ve,ur,!0),ws=_.OUTSIDE_EVEN_TOTAL_SUBSET[Kt],Ks=_.OUTSIDE_GSUM[Kt];return new Zn(br*ws+wr+Ks,$t)}else{if(vt&1||vt>10||vt<4)throw new Y;let Kt=(10-vt)/2,_n=_.INSIDE_ODD_WIDEST[Kt],ur=9-_n,br=$n.getRSSvalue(le,_n,!0),wr=$n.getRSSvalue(ve,ur,!1),ws=_.INSIDE_ODD_TOTAL_SUBSET[Kt],Ks=_.INSIDE_GSUM[Kt];return new Zn(wr*ws+br+Ks,$t)}}findFinderPattern(y,E){let O=this.getDecodeFinderCounters();O[0]=0,O[1]=0,O[2]=0,O[3]=0;let $=y.getSize(),H=!1,K=0;for(;K<$&&(H=!y.get(K),E!==H);)K++;let le=0,ve=K;for(let Te=K;Te<$;Te++)if(y.get(Te)!==H)O[le]++;else{if(le===3){if(bn.isFinderPattern(O))return[ve,Te];ve+=O[0]+O[1],O[0]=O[2],O[1]=O[3],O[2]=0,O[3]=0,le--}else le++;O[le]=1,H=!H}throw new Y}parseFoundFinderPattern(y,E,O,$){let H=y.get($[0]),K=$[0]-1;for(;K>=0&&H!==y.get(K);)K--;K++;const le=$[0]-K,ve=this.getDecodeFinderCounters(),Te=new Int32Array(ve.length);w.arraycopy(ve,0,Te,1,ve.length-1),Te[0]=le;const Ze=this.parseFinderValue(Te,_.FINDER_PATTERNS);let ht=K,Tt=$[1];return O&&(ht=y.getSize()-1-ht,Tt=y.getSize()-1-Tt),new zn(Ze,[K,$[1]],ht,Tt,E)}adjustOddEvenCounts(y,E){let O=It.sum(new Int32Array(this.getOddCounts())),$=It.sum(new Int32Array(this.getEvenCounts())),H=!1,K=!1,le=!1,ve=!1;y?(O>12?K=!0:O<4&&(H=!0),$>12?ve=!0:$<4&&(le=!0)):(O>11?K=!0:O<5&&(H=!0),$>10?ve=!0:$<4&&(le=!0));let Te=O+$-E,Ze=(O&1)===(y?1:0),ht=($&1)===1;if(Te===1)if(Ze){if(ht)throw new Y;K=!0}else{if(!ht)throw new Y;ve=!0}else if(Te===-1)if(Ze){if(ht)throw new Y;H=!0}else{if(!ht)throw new Y;le=!0}else if(Te===0){if(Ze){if(!ht)throw new Y;O<$?(H=!0,ve=!0):(K=!0,le=!0)}else if(ht)throw new Y}else throw new Y;if(H){if(K)throw new Y;bn.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(K&&bn.decrement(this.getOddCounts(),this.getOddRoundingErrors()),le){if(ve)throw new Y;bn.increment(this.getEvenCounts(),this.getOddRoundingErrors())}ve&&bn.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}_.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],_.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],_.OUTSIDE_GSUM=[0,161,961,2015,2715],_.INSIDE_GSUM=[0,336,1036,1516],_.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],_.INSIDE_ODD_WIDEST=[2,4,6,8],_.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];class k extends Et{constructor(y,E){super(),this.readers=[],this.verbose=E===!0;const O=y?y.get(U.POSSIBLE_FORMATS):null,$=y&&y.get(U.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;O?((O.includes(Ae.EAN_13)||O.includes(Ae.UPC_A)||O.includes(Ae.EAN_8)||O.includes(Ae.UPC_E))&&this.readers.push(new jn(y)),O.includes(Ae.CODE_39)&&this.readers.push(new Be($)),O.includes(Ae.CODE_128)&&this.readers.push(new et),O.includes(Ae.ITF)&&this.readers.push(new Mt),O.includes(Ae.RSS_14)&&this.readers.push(new _),O.includes(Ae.RSS_EXPANDED)&&this.readers.push(new h(this.verbose))):(this.readers.push(new jn(y)),this.readers.push(new Be),this.readers.push(new jn(y)),this.readers.push(new et),this.readers.push(new Mt),this.readers.push(new _),this.readers.push(new h(this.verbose)))}decodeRow(y,E,O){for(let $=0;$<this.readers.length;$++)try{return this.readers[$].decodeRow(y,E,O)}catch{}throw new Y}reset(){this.readers.forEach(y=>y.reset())}}class T extends Ce{constructor(y=500,E){super(new k(E),y,E)}}class B{constructor(y,E,O){this.ecCodewords=y,this.ecBlocks=[E],O&&this.ecBlocks.push(O)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class W{constructor(y,E){this.count=y,this.dataCodewords=E}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class ee{constructor(y,E,O,$,H,K){this.versionNumber=y,this.symbolSizeRows=E,this.symbolSizeColumns=O,this.dataRegionSizeRows=$,this.dataRegionSizeColumns=H,this.ecBlocks=K;let le=0;const ve=K.getECCodewords(),Te=K.getECBlocks();for(let Ze of Te)le+=Ze.getCount()*(Ze.getDataCodewords()+ve);this.totalCodewords=le}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(y,E){if(y&1||E&1)throw new L;for(let O of ee.VERSIONS)if(O.symbolSizeRows===y&&O.symbolSizeColumns===E)return O;throw new L}toString(){return""+this.versionNumber}static buildVersions(){return[new ee(1,10,10,8,8,new B(5,new W(1,3))),new ee(2,12,12,10,10,new B(7,new W(1,5))),new ee(3,14,14,12,12,new B(10,new W(1,8))),new ee(4,16,16,14,14,new B(12,new W(1,12))),new ee(5,18,18,16,16,new B(14,new W(1,18))),new ee(6,20,20,18,18,new B(18,new W(1,22))),new ee(7,22,22,20,20,new B(20,new W(1,30))),new ee(8,24,24,22,22,new B(24,new W(1,36))),new ee(9,26,26,24,24,new B(28,new W(1,44))),new ee(10,32,32,14,14,new B(36,new W(1,62))),new ee(11,36,36,16,16,new B(42,new W(1,86))),new ee(12,40,40,18,18,new B(48,new W(1,114))),new ee(13,44,44,20,20,new B(56,new W(1,144))),new ee(14,48,48,22,22,new B(68,new W(1,174))),new ee(15,52,52,24,24,new B(42,new W(2,102))),new ee(16,64,64,14,14,new B(56,new W(2,140))),new ee(17,72,72,16,16,new B(36,new W(4,92))),new ee(18,80,80,18,18,new B(48,new W(4,114))),new ee(19,88,88,20,20,new B(56,new W(4,144))),new ee(20,96,96,22,22,new B(68,new W(4,174))),new ee(21,104,104,24,24,new B(56,new W(6,136))),new ee(22,120,120,18,18,new B(68,new W(6,175))),new ee(23,132,132,20,20,new B(62,new W(8,163))),new ee(24,144,144,22,22,new B(62,new W(8,156),new W(2,155))),new ee(25,8,18,6,16,new B(7,new W(1,5))),new ee(26,8,32,6,14,new B(11,new W(1,10))),new ee(27,12,26,10,24,new B(14,new W(1,16))),new ee(28,12,36,10,16,new B(18,new W(1,22))),new ee(29,16,36,14,16,new B(24,new W(1,32))),new ee(30,16,48,14,22,new B(28,new W(1,49)))]}}ee.VERSIONS=ee.buildVersions();class de{constructor(y){const E=y.getHeight();if(E<8||E>144||E&1)throw new L;this.version=de.readVersion(y),this.mappingBitMatrix=this.extractDataRegion(y),this.readMappingMatrix=new pe(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(y){const E=y.getHeight(),O=y.getWidth();return ee.getVersionForDimensions(E,O)}readCodewords(){const y=new Int8Array(this.version.getTotalCodewords());let E=0,O=4,$=0;const H=this.mappingBitMatrix.getHeight(),K=this.mappingBitMatrix.getWidth();let le=!1,ve=!1,Te=!1,Ze=!1;do if(O===H&&$===0&&!le)y[E++]=this.readCorner1(H,K)&255,O-=2,$+=2,le=!0;else if(O===H-2&&$===0&&K&3&&!ve)y[E++]=this.readCorner2(H,K)&255,O-=2,$+=2,ve=!0;else if(O===H+4&&$===2&&!(K&7)&&!Te)y[E++]=this.readCorner3(H,K)&255,O-=2,$+=2,Te=!0;else if(O===H-2&&$===0&&(K&7)===4&&!Ze)y[E++]=this.readCorner4(H,K)&255,O-=2,$+=2,Ze=!0;else{do O<H&&$>=0&&!this.readMappingMatrix.get($,O)&&(y[E++]=this.readUtah(O,$,H,K)&255),O-=2,$+=2;while(O>=0&&$<K);O+=1,$+=3;do O>=0&&$<K&&!this.readMappingMatrix.get($,O)&&(y[E++]=this.readUtah(O,$,H,K)&255),O+=2,$-=2;while(O<H&&$>=0);O+=3,$+=1}while(O<H||$<K);if(E!==this.version.getTotalCodewords())throw new L;return y}readModule(y,E,O,$){return y<0&&(y+=O,E+=4-(O+4&7)),E<0&&(E+=$,y+=4-($+4&7)),this.readMappingMatrix.set(E,y),this.mappingBitMatrix.get(E,y)}readUtah(y,E,O,$){let H=0;return this.readModule(y-2,E-2,O,$)&&(H|=1),H<<=1,this.readModule(y-2,E-1,O,$)&&(H|=1),H<<=1,this.readModule(y-1,E-2,O,$)&&(H|=1),H<<=1,this.readModule(y-1,E-1,O,$)&&(H|=1),H<<=1,this.readModule(y-1,E,O,$)&&(H|=1),H<<=1,this.readModule(y,E-2,O,$)&&(H|=1),H<<=1,this.readModule(y,E-1,O,$)&&(H|=1),H<<=1,this.readModule(y,E,O,$)&&(H|=1),H}readCorner1(y,E){let O=0;return this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,1,y,E)&&(O|=1),O<<=1,this.readModule(y-1,2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O<<=1,this.readModule(2,E-1,y,E)&&(O|=1),O<<=1,this.readModule(3,E-1,y,E)&&(O|=1),O}readCorner2(y,E){let O=0;return this.readModule(y-3,0,y,E)&&(O|=1),O<<=1,this.readModule(y-2,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(0,E-4,y,E)&&(O|=1),O<<=1,this.readModule(0,E-3,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O}readCorner3(y,E){let O=0;return this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,E-1,y,E)&&(O|=1),O<<=1,this.readModule(0,E-3,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-3,y,E)&&(O|=1),O<<=1,this.readModule(1,E-2,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O}readCorner4(y,E){let O=0;return this.readModule(y-3,0,y,E)&&(O|=1),O<<=1,this.readModule(y-2,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O<<=1,this.readModule(2,E-1,y,E)&&(O|=1),O<<=1,this.readModule(3,E-1,y,E)&&(O|=1),O}extractDataRegion(y){const E=this.version.getSymbolSizeRows(),O=this.version.getSymbolSizeColumns();if(y.getHeight()!==E)throw new f("Dimension of bitMatrix must match the version size");const $=this.version.getDataRegionSizeRows(),H=this.version.getDataRegionSizeColumns(),K=E/$|0,le=O/H|0,ve=K*$,Te=le*H,Ze=new pe(Te,ve);for(let ht=0;ht<K;++ht){const Tt=ht*$;for(let tn=0;tn<le;++tn){const vt=tn*H;for(let $t=0;$t<$;++$t){const Kt=ht*($+2)+1+$t,_n=Tt+$t;for(let ur=0;ur<H;++ur){const br=tn*(H+2)+1+ur;if(y.get(br,Kt)){const wr=vt+ur;Ze.set(wr,_n)}}}}}return Ze}}class fe{constructor(y,E){this.numDataCodewords=y,this.codewords=E}static getDataBlocks(y,E){const O=E.getECBlocks();let $=0;const H=O.getECBlocks();for(let $t of H)$+=$t.getCount();const K=new Array($);let le=0;for(let $t of H)for(let Kt=0;Kt<$t.getCount();Kt++){const _n=$t.getDataCodewords(),ur=O.getECCodewords()+_n;K[le++]=new fe(_n,new Uint8Array(ur))}const Te=K[0].codewords.length-O.getECCodewords(),Ze=Te-1;let ht=0;for(let $t=0;$t<Ze;$t++)for(let Kt=0;Kt<le;Kt++)K[Kt].codewords[$t]=y[ht++];const Tt=E.getVersionNumber()===24,tn=Tt?8:le;for(let $t=0;$t<tn;$t++)K[$t].codewords[Te-1]=y[ht++];const vt=K[0].codewords.length;for(let $t=Te;$t<vt;$t++)for(let Kt=0;Kt<le;Kt++){const _n=Tt?(Kt+8)%le:Kt,ur=Tt&&_n>7?$t-1:$t;K[_n].codewords[ur]=y[ht++]}if(ht!==y.length)throw new f;return K}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class xe{constructor(y){this.bytes=y,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(y){if(y<1||y>32||y>this.available())throw new f(""+y);let E=0,O=this.bitOffset,$=this.byteOffset;const H=this.bytes;if(O>0){const K=8-O,le=y<K?y:K,ve=K-le,Te=255>>8-le<<ve;E=(H[$]&Te)>>ve,y-=le,O+=le,O===8&&(O=0,$++)}if(y>0){for(;y>=8;)E=E<<8|H[$]&255,$++,y-=8;if(y>0){const K=8-y,le=255>>K<<K;E=E<<y|(H[$]&le)>>K,O+=y}}return this.bitOffset=O,this.byteOffset=$,E}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var we;(function(dt){dt[dt.PAD_ENCODE=0]="PAD_ENCODE",dt[dt.ASCII_ENCODE=1]="ASCII_ENCODE",dt[dt.C40_ENCODE=2]="C40_ENCODE",dt[dt.TEXT_ENCODE=3]="TEXT_ENCODE",dt[dt.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",dt[dt.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",dt[dt.BASE256_ENCODE=6]="BASE256_ENCODE"})(we||(we={}));class ke{static decode(y){const E=new xe(y),O=new re,$=new re,H=new Array;let K=we.ASCII_ENCODE;do if(K===we.ASCII_ENCODE)K=this.decodeAsciiSegment(E,O,$);else{switch(K){case we.C40_ENCODE:this.decodeC40Segment(E,O);break;case we.TEXT_ENCODE:this.decodeTextSegment(E,O);break;case we.ANSIX12_ENCODE:this.decodeAnsiX12Segment(E,O);break;case we.EDIFACT_ENCODE:this.decodeEdifactSegment(E,O);break;case we.BASE256_ENCODE:this.decodeBase256Segment(E,O,H);break;default:throw new L}K=we.ASCII_ENCODE}while(K!==we.PAD_ENCODE&&E.available()>0);return $.length()>0&&O.append($.toString()),new Ie(y,O.toString(),H.length===0?null:H,null)}static decodeAsciiSegment(y,E,O){let $=!1;do{let H=y.readBits(8);if(H===0)throw new L;if(H<=128)return $&&(H+=128),E.append(String.fromCharCode(H-1)),we.ASCII_ENCODE;if(H===129)return we.PAD_ENCODE;if(H<=229){const K=H-130;K<10&&E.append("0"),E.append(""+K)}else switch(H){case 230:return we.C40_ENCODE;case 231:return we.BASE256_ENCODE;case 232:E.append("");break;case 233:case 234:break;case 235:$=!0;break;case 236:E.append("[)>05"),O.insert(0,"");break;case 237:E.append("[)>06"),O.insert(0,"");break;case 238:return we.ANSIX12_ENCODE;case 239:return we.TEXT_ENCODE;case 240:return we.EDIFACT_ENCODE;case 241:break;default:if(H!==254||y.available()!==0)throw new L;break}}while(y.available()>0);return we.ASCII_ENCODE}static decodeC40Segment(y,E){let O=!1;const $=[];let H=0;do{if(y.available()===8)return;const K=y.readBits(8);if(K===254)return;this.parseTwoBytes(K,y.readBits(8),$);for(let le=0;le<3;le++){const ve=$[le];switch(H){case 0:if(ve<3)H=ve+1;else if(ve<this.C40_BASIC_SET_CHARS.length){const Te=this.C40_BASIC_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else throw new L;break;case 1:O?(E.append(String.fromCharCode(ve+128)),O=!1):E.append(String.fromCharCode(ve)),H=0;break;case 2:if(ve<this.C40_SHIFT2_SET_CHARS.length){const Te=this.C40_SHIFT2_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else switch(ve){case 27:E.append("");break;case 30:O=!0;break;default:throw new L}H=0;break;case 3:O?(E.append(String.fromCharCode(ve+224)),O=!1):E.append(String.fromCharCode(ve+96)),H=0;break;default:throw new L}}}while(y.available()>0)}static decodeTextSegment(y,E){let O=!1,$=[],H=0;do{if(y.available()===8)return;const K=y.readBits(8);if(K===254)return;this.parseTwoBytes(K,y.readBits(8),$);for(let le=0;le<3;le++){const ve=$[le];switch(H){case 0:if(ve<3)H=ve+1;else if(ve<this.TEXT_BASIC_SET_CHARS.length){const Te=this.TEXT_BASIC_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else throw new L;break;case 1:O?(E.append(String.fromCharCode(ve+128)),O=!1):E.append(String.fromCharCode(ve)),H=0;break;case 2:if(ve<this.TEXT_SHIFT2_SET_CHARS.length){const Te=this.TEXT_SHIFT2_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else switch(ve){case 27:E.append("");break;case 30:O=!0;break;default:throw new L}H=0;break;case 3:if(ve<this.TEXT_SHIFT3_SET_CHARS.length){const Te=this.TEXT_SHIFT3_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te),H=0}else throw new L;break;default:throw new L}}}while(y.available()>0)}static decodeAnsiX12Segment(y,E){const O=[];do{if(y.available()===8)return;const $=y.readBits(8);if($===254)return;this.parseTwoBytes($,y.readBits(8),O);for(let H=0;H<3;H++){const K=O[H];switch(K){case 0:E.append("\r");break;case 1:E.append("*");break;case 2:E.append(">");break;case 3:E.append(" ");break;default:if(K<14)E.append(String.fromCharCode(K+44));else if(K<40)E.append(String.fromCharCode(K+51));else throw new L;break}}}while(y.available()>0)}static parseTwoBytes(y,E,O){let $=(y<<8)+E-1,H=Math.floor($/1600);O[0]=H,$-=H*1600,H=Math.floor($/40),O[1]=H,O[2]=$-H*40}static decodeEdifactSegment(y,E){do{if(y.available()<=16)return;for(let O=0;O<4;O++){let $=y.readBits(6);if($===31){const H=8-y.getBitOffset();H!==8&&y.readBits(H);return}$&32||($|=64),E.append(String.fromCharCode($))}}while(y.available()>0)}static decodeBase256Segment(y,E,O){let $=1+y.getByteOffset();const H=this.unrandomize255State(y.readBits(8),$++);let K;if(H===0?K=y.available()/8|0:H<250?K=H:K=250*(H-249)+this.unrandomize255State(y.readBits(8),$++),K<0)throw new L;const le=new Uint8Array(K);for(let ve=0;ve<K;ve++){if(y.available()<8)throw new L;le[ve]=this.unrandomize255State(y.readBits(8),$++)}O.push(le);try{E.append(J.decode(le,X.ISO88591))}catch(ve){throw new ot("Platform does not support required encoding: "+ve.message)}}static unrandomize255State(y,E){const O=149*E%255+1,$=y-O;return $>=0?$:$+256}}ke.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ke.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],ke.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],ke.TEXT_SHIFT2_SET_CHARS=ke.C40_SHIFT2_SET_CHARS,ke.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",""];class Me{constructor(){this.rsDecoder=new ft(it.DATA_MATRIX_FIELD_256)}decode(y){const E=new de(y),O=E.getVersion(),$=E.readCodewords(),H=fe.getDataBlocks($,O);let K=0;for(let Te of H)K+=Te.getNumDataCodewords();const le=new Uint8Array(K),ve=H.length;for(let Te=0;Te<ve;Te++){const Ze=H[Te],ht=Ze.getCodewords(),Tt=Ze.getNumDataCodewords();this.correctErrors(ht,Tt);for(let tn=0;tn<Tt;tn++)le[tn*ve+Te]=ht[tn]}return ke.decode(le)}correctErrors(y,E){const O=new Int32Array(y);try{this.rsDecoder.decode(O,y.length-E)}catch{throw new g}for(let $=0;$<E;$++)y[$]=O[$]}}class Ye{constructor(y){this.image=y,this.rectangleDetector=new Pt(this.image)}detect(){const y=this.rectangleDetector.detect();let E=this.detectSolid1(y);if(E=this.detectSolid2(E),E[3]=this.correctTopRight(E),!E[3])throw new Y;E=this.shiftToModuleCenter(E);const O=E[0],$=E[1],H=E[2],K=E[3];let le=this.transitionsBetween(O,K)+1,ve=this.transitionsBetween(H,K)+1;(le&1)===1&&(le+=1),(ve&1)===1&&(ve+=1),4*le<7*ve&&4*ve<7*le&&(le=ve=Math.max(le,ve));let Te=Ye.sampleGrid(this.image,O,$,H,K,le,ve);return new mn(Te,[O,$,H,K])}static shiftPoint(y,E,O){let $=(E.getX()-y.getX())/(O+1),H=(E.getY()-y.getY())/(O+1);return new Nt(y.getX()+$,y.getY()+H)}static moveAway(y,E,O){let $=y.getX(),H=y.getY();return $<E?$-=1:$+=1,H<O?H-=1:H+=1,new Nt($,H)}detectSolid1(y){let E=y[0],O=y[1],$=y[3],H=y[2],K=this.transitionsBetween(E,O),le=this.transitionsBetween(O,$),ve=this.transitionsBetween($,H),Te=this.transitionsBetween(H,E),Ze=K,ht=[H,E,O,$];return Ze>le&&(Ze=le,ht[0]=E,ht[1]=O,ht[2]=$,ht[3]=H),Ze>ve&&(Ze=ve,ht[0]=O,ht[1]=$,ht[2]=H,ht[3]=E),Ze>Te&&(ht[0]=$,ht[1]=H,ht[2]=E,ht[3]=O),ht}detectSolid2(y){let E=y[0],O=y[1],$=y[2],H=y[3],K=this.transitionsBetween(E,H),le=Ye.shiftPoint(O,$,(K+1)*4),ve=Ye.shiftPoint($,O,(K+1)*4),Te=this.transitionsBetween(le,E),Ze=this.transitionsBetween(ve,H);return Te<Ze?(y[0]=E,y[1]=O,y[2]=$,y[3]=H):(y[0]=O,y[1]=$,y[2]=H,y[3]=E),y}correctTopRight(y){let E=y[0],O=y[1],$=y[2],H=y[3],K=this.transitionsBetween(E,H),le=this.transitionsBetween(O,H),ve=Ye.shiftPoint(E,O,(le+1)*4),Te=Ye.shiftPoint($,O,(K+1)*4);K=this.transitionsBetween(ve,H),le=this.transitionsBetween(Te,H);let Ze=new Nt(H.getX()+($.getX()-O.getX())/(K+1),H.getY()+($.getY()-O.getY())/(K+1)),ht=new Nt(H.getX()+(E.getX()-O.getX())/(le+1),H.getY()+(E.getY()-O.getY())/(le+1));if(!this.isValid(Ze))return this.isValid(ht)?ht:null;if(!this.isValid(ht))return Ze;let Tt=this.transitionsBetween(ve,Ze)+this.transitionsBetween(Te,Ze),tn=this.transitionsBetween(ve,ht)+this.transitionsBetween(Te,ht);return Tt>tn?Ze:ht}shiftToModuleCenter(y){let E=y[0],O=y[1],$=y[2],H=y[3],K=this.transitionsBetween(E,H)+1,le=this.transitionsBetween($,H)+1,ve=Ye.shiftPoint(E,O,le*4),Te=Ye.shiftPoint($,O,K*4);K=this.transitionsBetween(ve,H)+1,le=this.transitionsBetween(Te,H)+1,(K&1)===1&&(K+=1),(le&1)===1&&(le+=1);let Ze=(E.getX()+O.getX()+$.getX()+H.getX())/4,ht=(E.getY()+O.getY()+$.getY()+H.getY())/4;E=Ye.moveAway(E,Ze,ht),O=Ye.moveAway(O,Ze,ht),$=Ye.moveAway($,Ze,ht),H=Ye.moveAway(H,Ze,ht);let Tt,tn;return ve=Ye.shiftPoint(E,O,le*4),ve=Ye.shiftPoint(ve,H,K*4),Tt=Ye.shiftPoint(O,E,le*4),Tt=Ye.shiftPoint(Tt,$,K*4),Te=Ye.shiftPoint($,H,le*4),Te=Ye.shiftPoint(Te,O,K*4),tn=Ye.shiftPoint(H,$,le*4),tn=Ye.shiftPoint(tn,E,K*4),[ve,Tt,Te,tn]}isValid(y){return y.getX()>=0&&y.getX()<this.image.getWidth()&&y.getY()>0&&y.getY()<this.image.getHeight()}static sampleGrid(y,E,O,$,H,K,le){return qe.getInstance().sampleGrid(y,K,le,.5,.5,K-.5,.5,K-.5,le-.5,.5,le-.5,E.getX(),E.getY(),H.getX(),H.getY(),$.getX(),$.getY(),O.getX(),O.getY())}transitionsBetween(y,E){let O=Math.trunc(y.getX()),$=Math.trunc(y.getY()),H=Math.trunc(E.getX()),K=Math.trunc(E.getY()),le=Math.abs(K-$)>Math.abs(H-O);if(le){let $t=O;O=$,$=$t,$t=H,H=K,K=$t}let ve=Math.abs(H-O),Te=Math.abs(K-$),Ze=-ve/2,ht=$<K?1:-1,Tt=O<H?1:-1,tn=0,vt=this.image.get(le?$:O,le?O:$);for(let $t=O,Kt=$;$t!==H;$t+=Tt){let _n=this.image.get(le?Kt:$t,le?$t:Kt);if(_n!==vt&&(tn++,vt=_n),Ze+=Te,Ze>0){if(Kt===K)break;Kt+=ht,Ze-=ve}}return tn}}class Fe{constructor(){this.decoder=new Me}decode(y,E=null){let O,$;if(E!=null&&E.has(U.PURE_BARCODE)){const Te=Fe.extractPureBits(y.getBlackMatrix());O=this.decoder.decode(Te),$=Fe.NO_POINTS}else{const Te=new Ye(y.getBlackMatrix()).detect();O=this.decoder.decode(Te.getBits()),$=Te.getPoints()}const H=O.getRawBytes(),K=new ce(O.getText(),H,8*H.length,$,Ae.DATA_MATRIX,w.currentTimeMillis()),le=O.getByteSegments();le!=null&&K.putMetadata(je.BYTE_SEGMENTS,le);const ve=O.getECLevel();return ve!=null&&K.putMetadata(je.ERROR_CORRECTION_LEVEL,ve),K}reset(){}static extractPureBits(y){const E=y.getTopLeftOnBit(),O=y.getBottomRightOnBit();if(E==null||O==null)throw new Y;const $=this.moduleSize(E,y);let H=E[1];const K=O[1];let le=E[0];const Te=(O[0]-le+1)/$,Ze=(K-H+1)/$;if(Te<=0||Ze<=0)throw new Y;const ht=$/2;H+=ht,le+=ht;const Tt=new pe(Te,Ze);for(let tn=0;tn<Ze;tn++){const vt=H+tn*$;for(let $t=0;$t<Te;$t++)y.get(le+$t*$,vt)&&Tt.set($t,tn)}return Tt}static moduleSize(y,E){const O=E.getWidth();let $=y[0];const H=y[1];for(;$<O&&E.get($,H);)$++;if($===O)throw new Y;const K=$-y[0];if(K===0)throw new Y;return K}}Fe.NO_POINTS=[];class st extends Ce{constructor(y=500){super(new Fe,y)}}var se;(function(dt){dt[dt.L=0]="L",dt[dt.M=1]="M",dt[dt.Q=2]="Q",dt[dt.H=3]="H"})(se||(se={}));class Se{constructor(y,E,O){this.value=y,this.stringValue=E,this.bits=O,Se.FOR_BITS.set(O,this),Se.FOR_VALUE.set(y,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(y){switch(y){case"L":return Se.L;case"M":return Se.M;case"Q":return Se.Q;case"H":return Se.H;default:throw new d(y+"not available")}}toString(){return this.stringValue}equals(y){if(!(y instanceof Se))return!1;const E=y;return this.value===E.value}static forBits(y){if(y<0||y>=Se.FOR_BITS.size)throw new f;return Se.FOR_BITS.get(y)}}Se.FOR_BITS=new Map,Se.FOR_VALUE=new Map,Se.L=new Se(se.L,"L",1),Se.M=new Se(se.M,"M",0),Se.Q=new Se(se.Q,"Q",3),Se.H=new Se(se.H,"H",2);class De{constructor(y){this.errorCorrectionLevel=Se.forBits(y>>3&3),this.dataMask=y&7}static numBitsDiffering(y,E){return P.bitCount(y^E)}static decodeFormatInformation(y,E){const O=De.doDecodeFormatInformation(y,E);return O!==null?O:De.doDecodeFormatInformation(y^De.FORMAT_INFO_MASK_QR,E^De.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(y,E){let O=Number.MAX_SAFE_INTEGER,$=0;for(const H of De.FORMAT_INFO_DECODE_LOOKUP){const K=H[0];if(K===y||K===E)return new De(H[1]);let le=De.numBitsDiffering(y,K);le<O&&($=H[1],O=le),y!==E&&(le=De.numBitsDiffering(E,K),le<O&&($=H[1],O=le))}return O<=3?new De($):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(y){if(!(y instanceof De))return!1;const E=y;return this.errorCorrectionLevel===E.errorCorrectionLevel&&this.dataMask===E.dataMask}}De.FORMAT_INFO_MASK_QR=21522,De.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];class Le{constructor(y,...E){this.ecCodewordsPerBlock=y,this.ecBlocks=E}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let y=0;const E=this.ecBlocks;for(const O of E)y+=O.getCount();return y}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class _e{constructor(y,E){this.count=y,this.dataCodewords=E}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class nt{constructor(y,E,...O){this.versionNumber=y,this.alignmentPatternCenters=E,this.ecBlocks=O;let $=0;const H=O[0].getECCodewordsPerBlock(),K=O[0].getECBlocks();for(const le of K)$+=le.getCount()*(le.getDataCodewords()+H);this.totalCodewords=$}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(y){return this.ecBlocks[y.getValue()]}static getProvisionalVersionForDimension(y){if(y%4!==1)throw new L;try{return this.getVersionForNumber((y-17)/4)}catch{throw new L}}static getVersionForNumber(y){if(y<1||y>40)throw new f;return nt.VERSIONS[y-1]}static decodeVersionInformation(y){let E=Number.MAX_SAFE_INTEGER,O=0;for(let $=0;$<nt.VERSION_DECODE_INFO.length;$++){const H=nt.VERSION_DECODE_INFO[$];if(H===y)return nt.getVersionForNumber($+7);const K=De.numBitsDiffering(y,H);K<E&&(O=$+7,E=K)}return E<=3?nt.getVersionForNumber(O):null}buildFunctionPattern(){const y=this.getDimensionForVersion(),E=new pe(y);E.setRegion(0,0,9,9),E.setRegion(y-8,0,8,9),E.setRegion(0,y-8,9,8);const O=this.alignmentPatternCenters.length;for(let $=0;$<O;$++){const H=this.alignmentPatternCenters[$]-2;for(let K=0;K<O;K++)$===0&&(K===0||K===O-1)||$===O-1&&K===0||E.setRegion(this.alignmentPatternCenters[K]-2,H,5,5)}return E.setRegion(6,9,1,y-17),E.setRegion(9,6,y-17,1),this.versionNumber>6&&(E.setRegion(y-11,0,3,6),E.setRegion(0,y-11,6,3)),E}toString(){return""+this.versionNumber}}nt.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),nt.VERSIONS=[new nt(1,new Int32Array(0),new Le(7,new _e(1,19)),new Le(10,new _e(1,16)),new Le(13,new _e(1,13)),new Le(17,new _e(1,9))),new nt(2,Int32Array.from([6,18]),new Le(10,new _e(1,34)),new Le(16,new _e(1,28)),new Le(22,new _e(1,22)),new Le(28,new _e(1,16))),new nt(3,Int32Array.from([6,22]),new Le(15,new _e(1,55)),new Le(26,new _e(1,44)),new Le(18,new _e(2,17)),new Le(22,new _e(2,13))),new nt(4,Int32Array.from([6,26]),new Le(20,new _e(1,80)),new Le(18,new _e(2,32)),new Le(26,new _e(2,24)),new Le(16,new _e(4,9))),new nt(5,Int32Array.from([6,30]),new Le(26,new _e(1,108)),new Le(24,new _e(2,43)),new Le(18,new _e(2,15),new _e(2,16)),new Le(22,new _e(2,11),new _e(2,12))),new nt(6,Int32Array.from([6,34]),new Le(18,new _e(2,68)),new Le(16,new _e(4,27)),new Le(24,new _e(4,19)),new Le(28,new _e(4,15))),new nt(7,Int32Array.from([6,22,38]),new Le(20,new _e(2,78)),new Le(18,new _e(4,31)),new Le(18,new _e(2,14),new _e(4,15)),new Le(26,new _e(4,13),new _e(1,14))),new nt(8,Int32Array.from([6,24,42]),new Le(24,new _e(2,97)),new Le(22,new _e(2,38),new _e(2,39)),new Le(22,new _e(4,18),new _e(2,19)),new Le(26,new _e(4,14),new _e(2,15))),new nt(9,Int32Array.from([6,26,46]),new Le(30,new _e(2,116)),new Le(22,new _e(3,36),new _e(2,37)),new Le(20,new _e(4,16),new _e(4,17)),new Le(24,new _e(4,12),new _e(4,13))),new nt(10,Int32Array.from([6,28,50]),new Le(18,new _e(2,68),new _e(2,69)),new Le(26,new _e(4,43),new _e(1,44)),new Le(24,new _e(6,19),new _e(2,20)),new Le(28,new _e(6,15),new _e(2,16))),new nt(11,Int32Array.from([6,30,54]),new Le(20,new _e(4,81)),new Le(30,new _e(1,50),new _e(4,51)),new Le(28,new _e(4,22),new _e(4,23)),new Le(24,new _e(3,12),new _e(8,13))),new nt(12,Int32Array.from([6,32,58]),new Le(24,new _e(2,92),new _e(2,93)),new Le(22,new _e(6,36),new _e(2,37)),new Le(26,new _e(4,20),new _e(6,21)),new Le(28,new _e(7,14),new _e(4,15))),new nt(13,Int32Array.from([6,34,62]),new Le(26,new _e(4,107)),new Le(22,new _e(8,37),new _e(1,38)),new Le(24,new _e(8,20),new _e(4,21)),new Le(22,new _e(12,11),new _e(4,12))),new nt(14,Int32Array.from([6,26,46,66]),new Le(30,new _e(3,115),new _e(1,116)),new Le(24,new _e(4,40),new _e(5,41)),new Le(20,new _e(11,16),new _e(5,17)),new Le(24,new _e(11,12),new _e(5,13))),new nt(15,Int32Array.from([6,26,48,70]),new Le(22,new _e(5,87),new _e(1,88)),new Le(24,new _e(5,41),new _e(5,42)),new Le(30,new _e(5,24),new _e(7,25)),new Le(24,new _e(11,12),new _e(7,13))),new nt(16,Int32Array.from([6,26,50,74]),new Le(24,new _e(5,98),new _e(1,99)),new Le(28,new _e(7,45),new _e(3,46)),new Le(24,new _e(15,19),new _e(2,20)),new Le(30,new _e(3,15),new _e(13,16))),new nt(17,Int32Array.from([6,30,54,78]),new Le(28,new _e(1,107),new _e(5,108)),new Le(28,new _e(10,46),new _e(1,47)),new Le(28,new _e(1,22),new _e(15,23)),new Le(28,new _e(2,14),new _e(17,15))),new nt(18,Int32Array.from([6,30,56,82]),new Le(30,new _e(5,120),new _e(1,121)),new Le(26,new _e(9,43),new _e(4,44)),new Le(28,new _e(17,22),new _e(1,23)),new Le(28,new _e(2,14),new _e(19,15))),new nt(19,Int32Array.from([6,30,58,86]),new Le(28,new _e(3,113),new _e(4,114)),new Le(26,new _e(3,44),new _e(11,45)),new Le(26,new _e(17,21),new _e(4,22)),new Le(26,new _e(9,13),new _e(16,14))),new nt(20,Int32Array.from([6,34,62,90]),new Le(28,new _e(3,107),new _e(5,108)),new Le(26,new _e(3,41),new _e(13,42)),new Le(30,new _e(15,24),new _e(5,25)),new Le(28,new _e(15,15),new _e(10,16))),new nt(21,Int32Array.from([6,28,50,72,94]),new Le(28,new _e(4,116),new _e(4,117)),new Le(26,new _e(17,42)),new Le(28,new _e(17,22),new _e(6,23)),new Le(30,new _e(19,16),new _e(6,17))),new nt(22,Int32Array.from([6,26,50,74,98]),new Le(28,new _e(2,111),new _e(7,112)),new Le(28,new _e(17,46)),new Le(30,new _e(7,24),new _e(16,25)),new Le(24,new _e(34,13))),new nt(23,Int32Array.from([6,30,54,78,102]),new Le(30,new _e(4,121),new _e(5,122)),new Le(28,new _e(4,47),new _e(14,48)),new Le(30,new _e(11,24),new _e(14,25)),new Le(30,new _e(16,15),new _e(14,16))),new nt(24,Int32Array.from([6,28,54,80,106]),new Le(30,new _e(6,117),new _e(4,118)),new Le(28,new _e(6,45),new _e(14,46)),new Le(30,new _e(11,24),new _e(16,25)),new Le(30,new _e(30,16),new _e(2,17))),new nt(25,Int32Array.from([6,32,58,84,110]),new Le(26,new _e(8,106),new _e(4,107)),new Le(28,new _e(8,47),new _e(13,48)),new Le(30,new _e(7,24),new _e(22,25)),new Le(30,new _e(22,15),new _e(13,16))),new nt(26,Int32Array.from([6,30,58,86,114]),new Le(28,new _e(10,114),new _e(2,115)),new Le(28,new _e(19,46),new _e(4,47)),new Le(28,new _e(28,22),new _e(6,23)),new Le(30,new _e(33,16),new _e(4,17))),new nt(27,Int32Array.from([6,34,62,90,118]),new Le(30,new _e(8,122),new _e(4,123)),new Le(28,new _e(22,45),new _e(3,46)),new Le(30,new _e(8,23),new _e(26,24)),new Le(30,new _e(12,15),new _e(28,16))),new nt(28,Int32Array.from([6,26,50,74,98,122]),new Le(30,new _e(3,117),new _e(10,118)),new Le(28,new _e(3,45),new _e(23,46)),new Le(30,new _e(4,24),new _e(31,25)),new Le(30,new _e(11,15),new _e(31,16))),new nt(29,Int32Array.from([6,30,54,78,102,126]),new Le(30,new _e(7,116),new _e(7,117)),new Le(28,new _e(21,45),new _e(7,46)),new Le(30,new _e(1,23),new _e(37,24)),new Le(30,new _e(19,15),new _e(26,16))),new nt(30,Int32Array.from([6,26,52,78,104,130]),new Le(30,new _e(5,115),new _e(10,116)),new Le(28,new _e(19,47),new _e(10,48)),new Le(30,new _e(15,24),new _e(25,25)),new Le(30,new _e(23,15),new _e(25,16))),new nt(31,Int32Array.from([6,30,56,82,108,134]),new Le(30,new _e(13,115),new _e(3,116)),new Le(28,new _e(2,46),new _e(29,47)),new Le(30,new _e(42,24),new _e(1,25)),new Le(30,new _e(23,15),new _e(28,16))),new nt(32,Int32Array.from([6,34,60,86,112,138]),new Le(30,new _e(17,115)),new Le(28,new _e(10,46),new _e(23,47)),new Le(30,new _e(10,24),new _e(35,25)),new Le(30,new _e(19,15),new _e(35,16))),new nt(33,Int32Array.from([6,30,58,86,114,142]),new Le(30,new _e(17,115),new _e(1,116)),new Le(28,new _e(14,46),new _e(21,47)),new Le(30,new _e(29,24),new _e(19,25)),new Le(30,new _e(11,15),new _e(46,16))),new nt(34,Int32Array.from([6,34,62,90,118,146]),new Le(30,new _e(13,115),new _e(6,116)),new Le(28,new _e(14,46),new _e(23,47)),new Le(30,new _e(44,24),new _e(7,25)),new Le(30,new _e(59,16),new _e(1,17))),new nt(35,Int32Array.from([6,30,54,78,102,126,150]),new Le(30,new _e(12,121),new _e(7,122)),new Le(28,new _e(12,47),new _e(26,48)),new Le(30,new _e(39,24),new _e(14,25)),new Le(30,new _e(22,15),new _e(41,16))),new nt(36,Int32Array.from([6,24,50,76,102,128,154]),new Le(30,new _e(6,121),new _e(14,122)),new Le(28,new _e(6,47),new _e(34,48)),new Le(30,new _e(46,24),new _e(10,25)),new Le(30,new _e(2,15),new _e(64,16))),new nt(37,Int32Array.from([6,28,54,80,106,132,158]),new Le(30,new _e(17,122),new _e(4,123)),new Le(28,new _e(29,46),new _e(14,47)),new Le(30,new _e(49,24),new _e(10,25)),new Le(30,new _e(24,15),new _e(46,16))),new nt(38,Int32Array.from([6,32,58,84,110,136,162]),new Le(30,new _e(4,122),new _e(18,123)),new Le(28,new _e(13,46),new _e(32,47)),new Le(30,new _e(48,24),new _e(14,25)),new Le(30,new _e(42,15),new _e(32,16))),new nt(39,Int32Array.from([6,26,54,82,110,138,166]),new Le(30,new _e(20,117),new _e(4,118)),new Le(28,new _e(40,47),new _e(7,48)),new Le(30,new _e(43,24),new _e(22,25)),new Le(30,new _e(10,15),new _e(67,16))),new nt(40,Int32Array.from([6,30,58,86,114,142,170]),new Le(30,new _e(19,118),new _e(6,119)),new Le(28,new _e(18,47),new _e(31,48)),new Le(30,new _e(34,24),new _e(34,25)),new Le(30,new _e(20,15),new _e(61,16)))];var lt;(function(dt){dt[dt.DATA_MASK_000=0]="DATA_MASK_000",dt[dt.DATA_MASK_001=1]="DATA_MASK_001",dt[dt.DATA_MASK_010=2]="DATA_MASK_010",dt[dt.DATA_MASK_011=3]="DATA_MASK_011",dt[dt.DATA_MASK_100=4]="DATA_MASK_100",dt[dt.DATA_MASK_101=5]="DATA_MASK_101",dt[dt.DATA_MASK_110=6]="DATA_MASK_110",dt[dt.DATA_MASK_111=7]="DATA_MASK_111"})(lt||(lt={}));class bt{constructor(y,E){this.value=y,this.isMasked=E}unmaskBitMatrix(y,E){for(let O=0;O<E;O++)for(let $=0;$<E;$++)this.isMasked(O,$)&&y.flip($,O)}}bt.values=new Map([[lt.DATA_MASK_000,new bt(lt.DATA_MASK_000,(dt,y)=>(dt+y&1)===0)],[lt.DATA_MASK_001,new bt(lt.DATA_MASK_001,(dt,y)=>(dt&1)===0)],[lt.DATA_MASK_010,new bt(lt.DATA_MASK_010,(dt,y)=>y%3===0)],[lt.DATA_MASK_011,new bt(lt.DATA_MASK_011,(dt,y)=>(dt+y)%3===0)],[lt.DATA_MASK_100,new bt(lt.DATA_MASK_100,(dt,y)=>(Math.floor(dt/2)+Math.floor(y/3)&1)===0)],[lt.DATA_MASK_101,new bt(lt.DATA_MASK_101,(dt,y)=>dt*y%6===0)],[lt.DATA_MASK_110,new bt(lt.DATA_MASK_110,(dt,y)=>dt*y%6<3)],[lt.DATA_MASK_111,new bt(lt.DATA_MASK_111,(dt,y)=>(dt+y+dt*y%3&1)===0)]]);class Zt{constructor(y){const E=y.getHeight();if(E<21||(E&3)!==1)throw new L;this.bitMatrix=y}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let y=0;for(let H=0;H<6;H++)y=this.copyBit(H,8,y);y=this.copyBit(7,8,y),y=this.copyBit(8,8,y),y=this.copyBit(8,7,y);for(let H=5;H>=0;H--)y=this.copyBit(8,H,y);const E=this.bitMatrix.getHeight();let O=0;const $=E-7;for(let H=E-1;H>=$;H--)O=this.copyBit(8,H,O);for(let H=E-8;H<E;H++)O=this.copyBit(H,8,O);if(this.parsedFormatInfo=De.decodeFormatInformation(y,O),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new L}readVersion(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;const y=this.bitMatrix.getHeight(),E=Math.floor((y-17)/4);if(E<=6)return nt.getVersionForNumber(E);let O=0;const $=y-11;for(let K=5;K>=0;K--)for(let le=y-9;le>=$;le--)O=this.copyBit(le,K,O);let H=nt.decodeVersionInformation(O);if(H!==null&&H.getDimensionForVersion()===y)return this.parsedVersion=H,H;O=0;for(let K=5;K>=0;K--)for(let le=y-9;le>=$;le--)O=this.copyBit(K,le,O);if(H=nt.decodeVersionInformation(O),H!==null&&H.getDimensionForVersion()===y)return this.parsedVersion=H,H;throw new L}copyBit(y,E,O){return(this.isMirror?this.bitMatrix.get(E,y):this.bitMatrix.get(y,E))?O<<1|1:O<<1}readCodewords(){const y=this.readFormatInformation(),E=this.readVersion(),O=bt.values.get(y.getDataMask()),$=this.bitMatrix.getHeight();O.unmaskBitMatrix(this.bitMatrix,$);const H=E.buildFunctionPattern();let K=!0;const le=new Uint8Array(E.getTotalCodewords());let ve=0,Te=0,Ze=0;for(let ht=$-1;ht>0;ht-=2){ht===6&&ht--;for(let Tt=0;Tt<$;Tt++){const tn=K?$-1-Tt:Tt;for(let vt=0;vt<2;vt++)H.get(ht-vt,tn)||(Ze++,Te<<=1,this.bitMatrix.get(ht-vt,tn)&&(Te|=1),Ze===8&&(le[ve++]=Te,Ze=0,Te=0))}K=!K}if(ve!==E.getTotalCodewords())throw new L;return le}remask(){if(this.parsedFormatInfo===null)return;const y=bt.values[this.parsedFormatInfo.getDataMask()],E=this.bitMatrix.getHeight();y.unmaskBitMatrix(this.bitMatrix,E)}setMirror(y){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=y}mirror(){const y=this.bitMatrix;for(let E=0,O=y.getWidth();E<O;E++)for(let $=E+1,H=y.getHeight();$<H;$++)y.get(E,$)!==y.get($,E)&&(y.flip($,E),y.flip(E,$))}}class Ge{constructor(y,E){this.numDataCodewords=y,this.codewords=E}static getDataBlocks(y,E,O){if(y.length!==E.getTotalCodewords())throw new f;const $=E.getECBlocksForLevel(O);let H=0;const K=$.getECBlocks();for(const vt of K)H+=vt.getCount();const le=new Array(H);let ve=0;for(const vt of K)for(let $t=0;$t<vt.getCount();$t++){const Kt=vt.getDataCodewords(),_n=$.getECCodewordsPerBlock()+Kt;le[ve++]=new Ge(Kt,new Uint8Array(_n))}const Te=le[0].codewords.length;let Ze=le.length-1;for(;Ze>=0&&le[Ze].codewords.length!==Te;)Ze--;Ze++;const ht=Te-$.getECCodewordsPerBlock();let Tt=0;for(let vt=0;vt<ht;vt++)for(let $t=0;$t<ve;$t++)le[$t].codewords[vt]=y[Tt++];for(let vt=Ze;vt<ve;vt++)le[vt].codewords[ht]=y[Tt++];const tn=le[0].codewords.length;for(let vt=ht;vt<tn;vt++)for(let $t=0;$t<ve;$t++){const Kt=$t<Ze?vt:vt+1;le[$t].codewords[Kt]=y[Tt++]}return le}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var Je;(function(dt){dt[dt.TERMINATOR=0]="TERMINATOR",dt[dt.NUMERIC=1]="NUMERIC",dt[dt.ALPHANUMERIC=2]="ALPHANUMERIC",dt[dt.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",dt[dt.BYTE=4]="BYTE",dt[dt.ECI=5]="ECI",dt[dt.KANJI=6]="KANJI",dt[dt.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",dt[dt.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",dt[dt.HANZI=9]="HANZI"})(Je||(Je={}));class We{constructor(y,E,O,$){this.value=y,this.stringValue=E,this.characterCountBitsForVersions=O,this.bits=$,We.FOR_BITS.set($,this),We.FOR_VALUE.set(y,this)}static forBits(y){const E=We.FOR_BITS.get(y);if(E===void 0)throw new f;return E}getCharacterCountBits(y){const E=y.getVersionNumber();let O;return E<=9?O=0:E<=26?O=1:O=2,this.characterCountBitsForVersions[O]}getValue(){return this.value}getBits(){return this.bits}equals(y){if(!(y instanceof We))return!1;const E=y;return this.value===E.value}toString(){return this.stringValue}}We.FOR_BITS=new Map,We.FOR_VALUE=new Map,We.TERMINATOR=new We(Je.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),We.NUMERIC=new We(Je.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),We.ALPHANUMERIC=new We(Je.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),We.STRUCTURED_APPEND=new We(Je.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),We.BYTE=new We(Je.BYTE,"BYTE",Int32Array.from([8,16,16]),4),We.ECI=new We(Je.ECI,"ECI",Int32Array.from([0,0,0]),7),We.KANJI=new We(Je.KANJI,"KANJI",Int32Array.from([8,10,12]),8),We.FNC1_FIRST_POSITION=new We(Je.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),We.FNC1_SECOND_POSITION=new We(Je.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),We.HANZI=new We(Je.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class wt{static decode(y,E,O,$){const H=new xe(y);let K=new re;const le=new Array;let ve=-1,Te=-1;try{let Ze=null,ht=!1,Tt;do{if(H.available()<4)Tt=We.TERMINATOR;else{const tn=H.readBits(4);Tt=We.forBits(tn)}switch(Tt){case We.TERMINATOR:break;case We.FNC1_FIRST_POSITION:case We.FNC1_SECOND_POSITION:ht=!0;break;case We.STRUCTURED_APPEND:if(H.available()<16)throw new L;ve=H.readBits(8),Te=H.readBits(8);break;case We.ECI:const tn=wt.parseECIValue(H);if(Ze=Q.getCharacterSetECIByValue(tn),Ze===null)throw new L;break;case We.HANZI:const vt=H.readBits(4),$t=H.readBits(Tt.getCharacterCountBits(E));vt===wt.GB2312_SUBSET&&wt.decodeHanziSegment(H,K,$t);break;default:const Kt=H.readBits(Tt.getCharacterCountBits(E));switch(Tt){case We.NUMERIC:wt.decodeNumericSegment(H,K,Kt);break;case We.ALPHANUMERIC:wt.decodeAlphanumericSegment(H,K,Kt,ht);break;case We.BYTE:wt.decodeByteSegment(H,K,Kt,Ze,le,$);break;case We.KANJI:wt.decodeKanjiSegment(H,K,Kt);break;default:throw new L}break}}while(Tt!==We.TERMINATOR)}catch{throw new L}return new Ie(y,K.toString(),le.length===0?null:le,O===null?null:O.toString(),ve,Te)}static decodeHanziSegment(y,E,O){if(O*13>y.available())throw new L;const $=new Uint8Array(2*O);let H=0;for(;O>0;){const K=y.readBits(13);let le=K/96<<8&4294967295|K%96;le<959?le+=41377:le+=42657,$[H]=le>>8&255,$[H+1]=le&255,H+=2,O--}try{E.append(J.decode($,X.GB2312))}catch(K){throw new L(K)}}static decodeKanjiSegment(y,E,O){if(O*13>y.available())throw new L;const $=new Uint8Array(2*O);let H=0;for(;O>0;){const K=y.readBits(13);let le=K/192<<8&4294967295|K%192;le<7936?le+=33088:le+=49472,$[H]=le>>8,$[H+1]=le,H+=2,O--}try{E.append(J.decode($,X.SHIFT_JIS))}catch(K){throw new L(K)}}static decodeByteSegment(y,E,O,$,H,K){if(8*O>y.available())throw new L;const le=new Uint8Array(O);for(let Te=0;Te<O;Te++)le[Te]=y.readBits(8);let ve;$===null?ve=X.guessEncoding(le,K):ve=$.getName();try{E.append(J.decode(le,ve))}catch(Te){throw new L(Te)}H.push(le)}static toAlphaNumericChar(y){if(y>=wt.ALPHANUMERIC_CHARS.length)throw new L;return wt.ALPHANUMERIC_CHARS[y]}static decodeAlphanumericSegment(y,E,O,$){const H=E.length();for(;O>1;){if(y.available()<11)throw new L;const K=y.readBits(11);E.append(wt.toAlphaNumericChar(Math.floor(K/45))),E.append(wt.toAlphaNumericChar(K%45)),O-=2}if(O===1){if(y.available()<6)throw new L;E.append(wt.toAlphaNumericChar(y.readBits(6)))}if($)for(let K=H;K<E.length();K++)E.charAt(K)==="%"&&(K<E.length()-1&&E.charAt(K+1)==="%"?E.deleteCharAt(K+1):E.setCharAt(K,""))}static decodeNumericSegment(y,E,O){for(;O>=3;){if(y.available()<10)throw new L;const $=y.readBits(10);if($>=1e3)throw new L;E.append(wt.toAlphaNumericChar(Math.floor($/100))),E.append(wt.toAlphaNumericChar(Math.floor($/10)%10)),E.append(wt.toAlphaNumericChar($%10)),O-=3}if(O===2){if(y.available()<7)throw new L;const $=y.readBits(7);if($>=100)throw new L;E.append(wt.toAlphaNumericChar(Math.floor($/10))),E.append(wt.toAlphaNumericChar($%10))}else if(O===1){if(y.available()<4)throw new L;const $=y.readBits(4);if($>=10)throw new L;E.append(wt.toAlphaNumericChar($))}}static parseECIValue(y){const E=y.readBits(8);if(!(E&128))return E&127;if((E&192)===128){const O=y.readBits(8);return(E&63)<<8&4294967295|O}if((E&224)===192){const O=y.readBits(16);return(E&31)<<16&4294967295|O}throw new L}}wt.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",wt.GB2312_SUBSET=1;class At{constructor(y){this.mirrored=y}isMirrored(){return this.mirrored}applyMirroredCorrection(y){if(!this.mirrored||y===null||y.length<3)return;const E=y[0];y[0]=y[2],y[2]=E}}class Gt{constructor(){this.rsDecoder=new ft(it.QR_CODE_FIELD_256)}decodeBooleanArray(y,E){return this.decodeBitMatrix(pe.parseFromBooleanArray(y),E)}decodeBitMatrix(y,E){const O=new Zt(y);let $=null;try{return this.decodeBitMatrixParser(O,E)}catch(H){$=H}try{O.remask(),O.setMirror(!0),O.readVersion(),O.readFormatInformation(),O.mirror();const H=this.decodeBitMatrixParser(O,E);return H.setOther(new At(!0)),H}catch(H){throw $!==null?$:H}}decodeBitMatrixParser(y,E){const O=y.readVersion(),$=y.readFormatInformation().getErrorCorrectionLevel(),H=y.readCodewords(),K=Ge.getDataBlocks(H,O,$);let le=0;for(const Ze of K)le+=Ze.getNumDataCodewords();const ve=new Uint8Array(le);let Te=0;for(const Ze of K){const ht=Ze.getCodewords(),Tt=Ze.getNumDataCodewords();this.correctErrors(ht,Tt);for(let tn=0;tn<Tt;tn++)ve[Te++]=ht[tn]}return wt.decode(ve,O,$,E)}correctErrors(y,E){const O=new Int32Array(y);try{this.rsDecoder.decode(O,y.length-E)}catch{throw new g}for(let $=0;$<E;$++)y[$]=O[$]}}class fn extends Nt{constructor(y,E,O){super(y,E),this.estimatedModuleSize=O}aboutEquals(y,E,O){if(Math.abs(E-this.getY())<=y&&Math.abs(O-this.getX())<=y){const $=Math.abs(y-this.estimatedModuleSize);return $<=1||$<=this.estimatedModuleSize}return!1}combineEstimate(y,E,O){const $=(this.getX()+E)/2,H=(this.getY()+y)/2,K=(this.estimatedModuleSize+O)/2;return new fn($,H,K)}}class Rn{constructor(y,E,O,$,H,K,le){this.image=y,this.startX=E,this.startY=O,this.width=$,this.height=H,this.moduleSize=K,this.resultPointCallback=le,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const y=this.startX,E=this.height,O=this.width,$=y+O,H=this.startY+E/2,K=new Int32Array(3),le=this.image;for(let ve=0;ve<E;ve++){const Te=H+(ve&1?-Math.floor((ve+1)/2):Math.floor((ve+1)/2));K[0]=0,K[1]=0,K[2]=0;let Ze=y;for(;Ze<$&&!le.get(Ze,Te);)Ze++;let ht=0;for(;Ze<$;){if(le.get(Ze,Te))if(ht===1)K[1]++;else if(ht===2){if(this.foundPatternCross(K)){const Tt=this.handlePossibleCenter(K,Te,Ze);if(Tt!==null)return Tt}K[0]=K[2],K[1]=1,K[2]=0,ht=1}else K[++ht]++;else ht===1&&ht++,K[ht]++;Ze++}if(this.foundPatternCross(K)){const Tt=this.handlePossibleCenter(K,Te,$);if(Tt!==null)return Tt}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new Y}static centerFromEnd(y,E){return E-y[2]-y[1]/2}foundPatternCross(y){const E=this.moduleSize,O=E/2;for(let $=0;$<3;$++)if(Math.abs(E-y[$])>=O)return!1;return!0}crossCheckVertical(y,E,O,$){const H=this.image,K=H.getHeight(),le=this.crossCheckStateCount;le[0]=0,le[1]=0,le[2]=0;let ve=y;for(;ve>=0&&H.get(E,ve)&&le[1]<=O;)le[1]++,ve--;if(ve<0||le[1]>O)return NaN;for(;ve>=0&&!H.get(E,ve)&&le[0]<=O;)le[0]++,ve--;if(le[0]>O)return NaN;for(ve=y+1;ve<K&&H.get(E,ve)&&le[1]<=O;)le[1]++,ve++;if(ve===K||le[1]>O)return NaN;for(;ve<K&&!H.get(E,ve)&&le[2]<=O;)le[2]++,ve++;if(le[2]>O)return NaN;const Te=le[0]+le[1]+le[2];return 5*Math.abs(Te-$)>=2*$?NaN:this.foundPatternCross(le)?Rn.centerFromEnd(le,ve):NaN}handlePossibleCenter(y,E,O){const $=y[0]+y[1]+y[2],H=Rn.centerFromEnd(y,O),K=this.crossCheckVertical(E,H,2*y[1],$);if(!isNaN(K)){const le=(y[0]+y[1]+y[2])/3;for(const Te of this.possibleCenters)if(Te.aboutEquals(le,K,H))return Te.combineEstimate(K,H,le);const ve=new fn(H,K,le);this.possibleCenters.push(ve),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(ve)}return null}}class An extends Nt{constructor(y,E,O,$){super(y,E),this.estimatedModuleSize=O,this.count=$,$===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(y,E,O){if(Math.abs(E-this.getY())<=y&&Math.abs(O-this.getX())<=y){const $=Math.abs(y-this.estimatedModuleSize);return $<=1||$<=this.estimatedModuleSize}return!1}combineEstimate(y,E,O){const $=this.count+1,H=(this.count*this.getX()+E)/$,K=(this.count*this.getY()+y)/$,le=(this.count*this.estimatedModuleSize+O)/$;return new An(H,K,le,$)}}class pr{constructor(y){this.bottomLeft=y[0],this.topLeft=y[1],this.topRight=y[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class mt{constructor(y,E){this.image=y,this.resultPointCallback=E,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=E}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(y){const E=y!=null&&y.get(U.TRY_HARDER)!==void 0,O=y!=null&&y.get(U.PURE_BARCODE)!==void 0,$=this.image,H=$.getHeight(),K=$.getWidth();let le=Math.floor(3*H/(4*mt.MAX_MODULES));(le<mt.MIN_SKIP||E)&&(le=mt.MIN_SKIP);let ve=!1;const Te=new Int32Array(5);for(let ht=le-1;ht<H&&!ve;ht+=le){Te[0]=0,Te[1]=0,Te[2]=0,Te[3]=0,Te[4]=0;let Tt=0;for(let tn=0;tn<K;tn++)if($.get(tn,ht))(Tt&1)===1&&Tt++,Te[Tt]++;else if(Tt&1)Te[Tt]++;else if(Tt===4)if(mt.foundPatternCross(Te)){if(this.handlePossibleCenter(Te,ht,tn,O)===!0)if(le=2,this.hasSkipped===!0)ve=this.haveMultiplyConfirmedCenters();else{const $t=this.findRowSkip();$t>Te[2]&&(ht+=$t-Te[2]-le,tn=K-1)}else{Te[0]=Te[2],Te[1]=Te[3],Te[2]=Te[4],Te[3]=1,Te[4]=0,Tt=3;continue}Tt=0,Te[0]=0,Te[1]=0,Te[2]=0,Te[3]=0,Te[4]=0}else Te[0]=Te[2],Te[1]=Te[3],Te[2]=Te[4],Te[3]=1,Te[4]=0,Tt=3;else Te[++Tt]++;mt.foundPatternCross(Te)&&this.handlePossibleCenter(Te,ht,K,O)===!0&&(le=Te[0],this.hasSkipped&&(ve=this.haveMultiplyConfirmedCenters()))}const Ze=this.selectBestPatterns();return Nt.orderBestPatterns(Ze),new pr(Ze)}static centerFromEnd(y,E){return E-y[4]-y[3]-y[2]/2}static foundPatternCross(y){let E=0;for(let H=0;H<5;H++){const K=y[H];if(K===0)return!1;E+=K}if(E<7)return!1;const O=E/7,$=O/2;return Math.abs(O-y[0])<$&&Math.abs(O-y[1])<$&&Math.abs(3*O-y[2])<3*$&&Math.abs(O-y[3])<$&&Math.abs(O-y[4])<$}getCrossCheckStateCount(){const y=this.crossCheckStateCount;return y[0]=0,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y}crossCheckDiagonal(y,E,O,$){const H=this.getCrossCheckStateCount();let K=0;const le=this.image;for(;y>=K&&E>=K&&le.get(E-K,y-K);)H[2]++,K++;if(y<K||E<K)return!1;for(;y>=K&&E>=K&&!le.get(E-K,y-K)&&H[1]<=O;)H[1]++,K++;if(y<K||E<K||H[1]>O)return!1;for(;y>=K&&E>=K&&le.get(E-K,y-K)&&H[0]<=O;)H[0]++,K++;if(H[0]>O)return!1;const ve=le.getHeight(),Te=le.getWidth();for(K=1;y+K<ve&&E+K<Te&&le.get(E+K,y+K);)H[2]++,K++;if(y+K>=ve||E+K>=Te)return!1;for(;y+K<ve&&E+K<Te&&!le.get(E+K,y+K)&&H[3]<O;)H[3]++,K++;if(y+K>=ve||E+K>=Te||H[3]>=O)return!1;for(;y+K<ve&&E+K<Te&&le.get(E+K,y+K)&&H[4]<O;)H[4]++,K++;if(H[4]>=O)return!1;const Ze=H[0]+H[1]+H[2]+H[3]+H[4];return Math.abs(Ze-$)<2*$&&mt.foundPatternCross(H)}crossCheckVertical(y,E,O,$){const H=this.image,K=H.getHeight(),le=this.getCrossCheckStateCount();let ve=y;for(;ve>=0&&H.get(E,ve);)le[2]++,ve--;if(ve<0)return NaN;for(;ve>=0&&!H.get(E,ve)&&le[1]<=O;)le[1]++,ve--;if(ve<0||le[1]>O)return NaN;for(;ve>=0&&H.get(E,ve)&&le[0]<=O;)le[0]++,ve--;if(le[0]>O)return NaN;for(ve=y+1;ve<K&&H.get(E,ve);)le[2]++,ve++;if(ve===K)return NaN;for(;ve<K&&!H.get(E,ve)&&le[3]<O;)le[3]++,ve++;if(ve===K||le[3]>=O)return NaN;for(;ve<K&&H.get(E,ve)&&le[4]<O;)le[4]++,ve++;if(le[4]>=O)return NaN;const Te=le[0]+le[1]+le[2]+le[3]+le[4];return 5*Math.abs(Te-$)>=2*$?NaN:mt.foundPatternCross(le)?mt.centerFromEnd(le,ve):NaN}crossCheckHorizontal(y,E,O,$){const H=this.image,K=H.getWidth(),le=this.getCrossCheckStateCount();let ve=y;for(;ve>=0&&H.get(ve,E);)le[2]++,ve--;if(ve<0)return NaN;for(;ve>=0&&!H.get(ve,E)&&le[1]<=O;)le[1]++,ve--;if(ve<0||le[1]>O)return NaN;for(;ve>=0&&H.get(ve,E)&&le[0]<=O;)le[0]++,ve--;if(le[0]>O)return NaN;for(ve=y+1;ve<K&&H.get(ve,E);)le[2]++,ve++;if(ve===K)return NaN;for(;ve<K&&!H.get(ve,E)&&le[3]<O;)le[3]++,ve++;if(ve===K||le[3]>=O)return NaN;for(;ve<K&&H.get(ve,E)&&le[4]<O;)le[4]++,ve++;if(le[4]>=O)return NaN;const Te=le[0]+le[1]+le[2]+le[3]+le[4];return 5*Math.abs(Te-$)>=$?NaN:mt.foundPatternCross(le)?mt.centerFromEnd(le,ve):NaN}handlePossibleCenter(y,E,O,$){const H=y[0]+y[1]+y[2]+y[3]+y[4];let K=mt.centerFromEnd(y,O),le=this.crossCheckVertical(E,Math.floor(K),y[2],H);if(!isNaN(le)&&(K=this.crossCheckHorizontal(Math.floor(K),Math.floor(le),y[2],H),!isNaN(K)&&(!$||this.crossCheckDiagonal(Math.floor(le),Math.floor(K),y[2],H)))){const ve=H/7;let Te=!1;const Ze=this.possibleCenters;for(let ht=0,Tt=Ze.length;ht<Tt;ht++){const tn=Ze[ht];if(tn.aboutEquals(ve,le,K)){Ze[ht]=tn.combineEstimate(le,K,ve),Te=!0;break}}if(!Te){const ht=new An(K,le,ve);Ze.push(ht),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(ht)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let E=null;for(const O of this.possibleCenters)if(O.getCount()>=mt.CENTER_QUORUM)if(E==null)E=O;else return this.hasSkipped=!0,Math.floor((Math.abs(E.getX()-O.getX())-Math.abs(E.getY()-O.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let y=0,E=0;const O=this.possibleCenters.length;for(const K of this.possibleCenters)K.getCount()>=mt.CENTER_QUORUM&&(y++,E+=K.getEstimatedModuleSize());if(y<3)return!1;const $=E/O;let H=0;for(const K of this.possibleCenters)H+=Math.abs(K.getEstimatedModuleSize()-$);return H<=.05*E}selectBestPatterns(){const y=this.possibleCenters.length;if(y<3)throw new Y;const E=this.possibleCenters;let O;if(y>3){let $=0,H=0;for(const ve of this.possibleCenters){const Te=ve.getEstimatedModuleSize();$+=Te,H+=Te*Te}O=$/y;let K=Math.sqrt(H/y-O*O);E.sort((ve,Te)=>{const Ze=Math.abs(Te.getEstimatedModuleSize()-O),ht=Math.abs(ve.getEstimatedModuleSize()-O);return Ze<ht?-1:Ze>ht?1:0});const le=Math.max(.2*O,K);for(let ve=0;ve<E.length&&E.length>3;ve++){const Te=E[ve];Math.abs(Te.getEstimatedModuleSize()-O)>le&&(E.splice(ve,1),ve--)}}if(E.length>3){let $=0;for(const H of E)$+=H.getEstimatedModuleSize();O=$/E.length,E.sort((H,K)=>{if(K.getCount()===H.getCount()){const le=Math.abs(K.getEstimatedModuleSize()-O),ve=Math.abs(H.getEstimatedModuleSize()-O);return le<ve?1:le>ve?-1:0}else return K.getCount()-H.getCount()}),E.splice(3)}return[E[0],E[1],E[2]]}}mt.CENTER_QUORUM=2,mt.MIN_SKIP=3,mt.MAX_MODULES=57;class qt{constructor(y){this.image=y}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(y){this.resultPointCallback=y==null?null:y.get(U.NEED_RESULT_POINT_CALLBACK);const O=new mt(this.image,this.resultPointCallback).find(y);return this.processFinderPatternInfo(O)}processFinderPatternInfo(y){const E=y.getTopLeft(),O=y.getTopRight(),$=y.getBottomLeft(),H=this.calculateModuleSize(E,O,$);if(H<1)throw new Y("No pattern found in proccess finder.");const K=qt.computeDimension(E,O,$,H),le=nt.getProvisionalVersionForDimension(K),ve=le.getDimensionForVersion()-7;let Te=null;if(le.getAlignmentPatternCenters().length>0){const tn=O.getX()-E.getX()+$.getX(),vt=O.getY()-E.getY()+$.getY(),$t=1-3/ve,Kt=Math.floor(E.getX()+$t*(tn-E.getX())),_n=Math.floor(E.getY()+$t*(vt-E.getY()));for(let ur=4;ur<=16;ur<<=1)try{Te=this.findAlignmentInRegion(H,Kt,_n,ur);break}catch(br){if(!(br instanceof Y))throw br}}const Ze=qt.createTransform(E,O,$,Te,K),ht=qt.sampleGrid(this.image,Ze,K);let Tt;return Te===null?Tt=[$,E,O]:Tt=[$,E,O,Te],new mn(ht,Tt)}static createTransform(y,E,O,$,H){const K=H-3.5;let le,ve,Te,Ze;return $!==null?(le=$.getX(),ve=$.getY(),Te=K-3,Ze=Te):(le=E.getX()-y.getX()+O.getX(),ve=E.getY()-y.getY()+O.getY(),Te=K,Ze=K),Ut.quadrilateralToQuadrilateral(3.5,3.5,K,3.5,Te,Ze,3.5,K,y.getX(),y.getY(),E.getX(),E.getY(),le,ve,O.getX(),O.getY())}static sampleGrid(y,E,O){return qe.getInstance().sampleGridWithTransform(y,O,O,E)}static computeDimension(y,E,O,$){const H=It.round(Nt.distance(y,E)/$),K=It.round(Nt.distance(y,O)/$);let le=Math.floor((H+K)/2)+7;switch(le&3){case 0:le++;break;case 2:le--;break;case 3:throw new Y("Dimensions could be not found.")}return le}calculateModuleSize(y,E,O){return(this.calculateModuleSizeOneWay(y,E)+this.calculateModuleSizeOneWay(y,O))/2}calculateModuleSizeOneWay(y,E){const O=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(y.getX()),Math.floor(y.getY()),Math.floor(E.getX()),Math.floor(E.getY())),$=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(E.getX()),Math.floor(E.getY()),Math.floor(y.getX()),Math.floor(y.getY()));return isNaN(O)?$/7:isNaN($)?O/7:(O+$)/14}sizeOfBlackWhiteBlackRunBothWays(y,E,O,$){let H=this.sizeOfBlackWhiteBlackRun(y,E,O,$),K=1,le=y-(O-y);le<0?(K=y/(y-le),le=0):le>=this.image.getWidth()&&(K=(this.image.getWidth()-1-y)/(le-y),le=this.image.getWidth()-1);let ve=Math.floor(E-($-E)*K);return K=1,ve<0?(K=E/(E-ve),ve=0):ve>=this.image.getHeight()&&(K=(this.image.getHeight()-1-E)/(ve-E),ve=this.image.getHeight()-1),le=Math.floor(y+(le-y)*K),H+=this.sizeOfBlackWhiteBlackRun(y,E,le,ve),H-1}sizeOfBlackWhiteBlackRun(y,E,O,$){const H=Math.abs($-E)>Math.abs(O-y);if(H){let tn=y;y=E,E=tn,tn=O,O=$,$=tn}const K=Math.abs(O-y),le=Math.abs($-E);let ve=-K/2;const Te=y<O?1:-1,Ze=E<$?1:-1;let ht=0;const Tt=O+Te;for(let tn=y,vt=E;tn!==Tt;tn+=Te){const $t=H?vt:tn,Kt=H?tn:vt;if(ht===1===this.image.get($t,Kt)){if(ht===2)return It.distance(tn,vt,y,E);ht++}if(ve+=le,ve>0){if(vt===$)break;vt+=Ze,ve-=K}}return ht===2?It.distance(O+Te,$,y,E):NaN}findAlignmentInRegion(y,E,O,$){const H=Math.floor($*y),K=Math.max(0,E-H),le=Math.min(this.image.getWidth()-1,E+H);if(le-K<y*3)throw new Y("Alignment top exceeds estimated module size.");const ve=Math.max(0,O-H),Te=Math.min(this.image.getHeight()-1,O+H);if(Te-ve<y*3)throw new Y("Alignment bottom exceeds estimated module size.");return new Rn(this.image,K,ve,le-K,Te-ve,y,this.resultPointCallback).find()}}class Qt{constructor(){this.decoder=new Gt}getDecoder(){return this.decoder}decode(y,E){let O,$;if(E!=null&&E.get(U.PURE_BARCODE)!==void 0){const ve=Qt.extractPureBits(y.getBlackMatrix());O=this.decoder.decodeBitMatrix(ve,E),$=Qt.NO_POINTS}else{const ve=new qt(y.getBlackMatrix()).detect(E);O=this.decoder.decodeBitMatrix(ve.getBits(),E),$=ve.getPoints()}O.getOther()instanceof At&&O.getOther().applyMirroredCorrection($);const H=new ce(O.getText(),O.getRawBytes(),void 0,$,Ae.QR_CODE,void 0),K=O.getByteSegments();K!==null&&H.putMetadata(je.BYTE_SEGMENTS,K);const le=O.getECLevel();return le!==null&&H.putMetadata(je.ERROR_CORRECTION_LEVEL,le),O.hasStructuredAppend()&&(H.putMetadata(je.STRUCTURED_APPEND_SEQUENCE,O.getStructuredAppendSequenceNumber()),H.putMetadata(je.STRUCTURED_APPEND_PARITY,O.getStructuredAppendParity())),H}reset(){}static extractPureBits(y){const E=y.getTopLeftOnBit(),O=y.getBottomRightOnBit();if(E===null||O===null)throw new Y;const $=this.moduleSize(E,y);let H=E[1],K=O[1],le=E[0],ve=O[0];if(le>=ve||H>=K)throw new Y;if(K-H!==ve-le&&(ve=le+(K-H),ve>=y.getWidth()))throw new Y;const Te=Math.round((ve-le+1)/$),Ze=Math.round((K-H+1)/$);if(Te<=0||Ze<=0)throw new Y;if(Ze!==Te)throw new Y;const ht=Math.floor($/2);H+=ht,le+=ht;const Tt=le+Math.floor((Te-1)*$)-ve;if(Tt>0){if(Tt>ht)throw new Y;le-=Tt}const tn=H+Math.floor((Ze-1)*$)-K;if(tn>0){if(tn>ht)throw new Y;H-=tn}const vt=new pe(Te,Ze);for(let $t=0;$t<Ze;$t++){const Kt=H+Math.floor($t*$);for(let _n=0;_n<Te;_n++)y.get(le+Math.floor(_n*$),Kt)&&vt.set(_n,$t)}return vt}static moduleSize(y,E){const O=E.getHeight(),$=E.getWidth();let H=y[0],K=y[1],le=!0,ve=0;for(;H<$&&K<O;){if(le!==E.get(H,K)){if(++ve===5)break;le=!le}H++,K++}if(H===$||K===O)throw new Y;return(H-y[0])/7}}Qt.NO_POINTS=new Array;class In{PDF417Common(){}static getBitCountSum(y){return It.sum(y)}static toIntArray(y){if(y==null||!y.length)return In.EMPTY_INT_ARRAY;const E=new Int32Array(y.length);let O=0;for(const $ of y)E[O++]=$;return E}static getCodeword(y){const E=I.binarySearch(In.SYMBOL_TABLE,y&262143);return E<0?-1:(In.CODEWORD_TABLE[E]-1)%In.NUMBER_OF_CODEWORDS}}In.NUMBER_OF_CODEWORDS=929,In.MAX_CODEWORDS_IN_BARCODE=In.NUMBER_OF_CODEWORDS-1,In.MIN_ROWS_IN_BARCODE=3,In.MAX_ROWS_IN_BARCODE=90,In.MODULES_IN_CODEWORD=17,In.MODULES_IN_STOP_PATTERN=18,In.BARS_IN_MODULE=8,In.EMPTY_INT_ARRAY=new Int32Array([]),In.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),In.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);class or{constructor(y,E){this.bits=y,this.points=E}getBits(){return this.bits}getPoints(){return this.points}}class Wn{static detectMultiple(y,E,O){let $=y.getBlackMatrix(),H=Wn.detect(O,$);return H.length||($=$.clone(),$.rotate180(),H=Wn.detect(O,$)),new or($,H)}static detect(y,E){const O=new Array;let $=0,H=0,K=!1;for(;$<E.getHeight();){const le=Wn.findVertices(E,$,H);if(le[0]==null&&le[3]==null){if(!K)break;K=!1,H=0;for(const ve of O)ve[1]!=null&&($=Math.trunc(Math.max($,ve[1].getY()))),ve[3]!=null&&($=Math.max($,Math.trunc(ve[3].getY())));$+=Wn.ROW_STEP;continue}if(K=!0,O.push(le),!y)break;le[2]!=null?(H=Math.trunc(le[2].getX()),$=Math.trunc(le[2].getY())):(H=Math.trunc(le[4].getX()),$=Math.trunc(le[4].getY()))}return O}static findVertices(y,E,O){const $=y.getHeight(),H=y.getWidth(),K=new Array(8);return Wn.copyToResult(K,Wn.findRowsWithPattern(y,$,H,E,O,Wn.START_PATTERN),Wn.INDEXES_START_PATTERN),K[4]!=null&&(O=Math.trunc(K[4].getX()),E=Math.trunc(K[4].getY())),Wn.copyToResult(K,Wn.findRowsWithPattern(y,$,H,E,O,Wn.STOP_PATTERN),Wn.INDEXES_STOP_PATTERN),K}static copyToResult(y,E,O){for(let $=0;$<O.length;$++)y[O[$]]=E[$]}static findRowsWithPattern(y,E,O,$,H,K){const le=new Array(4);let ve=!1;const Te=new Int32Array(K.length);for(;$<E;$+=Wn.ROW_STEP){let ht=Wn.findGuardPattern(y,H,$,O,!1,K,Te);if(ht!=null){for(;$>0;){const Tt=Wn.findGuardPattern(y,H,--$,O,!1,K,Te);if(Tt!=null)ht=Tt;else{$++;break}}le[0]=new Nt(ht[0],$),le[1]=new Nt(ht[1],$),ve=!0;break}}let Ze=$+1;if(ve){let ht=0,Tt=Int32Array.from([Math.trunc(le[0].getX()),Math.trunc(le[1].getX())]);for(;Ze<E;Ze++){const tn=Wn.findGuardPattern(y,Tt[0],Ze,O,!1,K,Te);if(tn!=null&&Math.abs(Tt[0]-tn[0])<Wn.MAX_PATTERN_DRIFT&&Math.abs(Tt[1]-tn[1])<Wn.MAX_PATTERN_DRIFT)Tt=tn,ht=0;else{if(ht>Wn.SKIPPED_ROW_COUNT_MAX)break;ht++}}Ze-=ht+1,le[2]=new Nt(Tt[0],Ze),le[3]=new Nt(Tt[1],Ze)}return Ze-$<Wn.BARCODE_MIN_HEIGHT&&I.fill(le,null),le}static findGuardPattern(y,E,O,$,H,K,le){I.fillWithin(le,0,le.length,0);let ve=E,Te=0;for(;y.get(ve,O)&&ve>0&&Te++<Wn.MAX_PIXEL_DRIFT;)ve--;let Ze=ve,ht=0,Tt=K.length;for(let tn=H;Ze<$;Ze++)if(y.get(Ze,O)!==tn)le[ht]++;else{if(ht===Tt-1){if(Wn.patternMatchVariance(le,K,Wn.MAX_INDIVIDUAL_VARIANCE)<Wn.MAX_AVG_VARIANCE)return new Int32Array([ve,Ze]);ve+=le[0]+le[1],w.arraycopy(le,2,le,0,ht-1),le[ht-1]=0,le[ht]=0,ht--}else ht++;le[ht]=1,tn=!tn}return ht===Tt-1&&Wn.patternMatchVariance(le,K,Wn.MAX_INDIVIDUAL_VARIANCE)<Wn.MAX_AVG_VARIANCE?new Int32Array([ve,Ze-1]):null}static patternMatchVariance(y,E,O){let $=y.length,H=0,K=0;for(let Te=0;Te<$;Te++)H+=y[Te],K+=E[Te];if(H<K)return 1/0;let le=H/K;O*=le;let ve=0;for(let Te=0;Te<$;Te++){let Ze=y[Te],ht=E[Te]*le,Tt=Ze>ht?Ze-ht:ht-Ze;if(Tt>O)return 1/0;ve+=Tt}return ve/H}}Wn.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),Wn.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),Wn.MAX_AVG_VARIANCE=.42,Wn.MAX_INDIVIDUAL_VARIANCE=.8,Wn.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),Wn.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),Wn.MAX_PIXEL_DRIFT=3,Wn.MAX_PATTERN_DRIFT=5,Wn.SKIPPED_ROW_COUNT_MAX=25,Wn.ROW_STEP=5,Wn.BARCODE_MIN_HEIGHT=10;class Vn{constructor(y,E){if(E.length===0)throw new f;this.field=y;let O=E.length;if(O>1&&E[0]===0){let $=1;for(;$<O&&E[$]===0;)$++;$===O?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(O-$),w.arraycopy(E,$,this.coefficients,0,this.coefficients.length))}else this.coefficients=E}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(y){return this.coefficients[this.coefficients.length-1-y]}evaluateAt(y){if(y===0)return this.getCoefficient(0);if(y===1){let $=0;for(let H of this.coefficients)$=this.field.add($,H);return $}let E=this.coefficients[0],O=this.coefficients.length;for(let $=1;$<O;$++)E=this.field.add(this.field.multiply(y,E),this.coefficients[$]);return E}add(y){if(!this.field.equals(y.field))throw new f("ModulusPolys do not have same ModulusGF field");if(this.isZero())return y;if(y.isZero())return this;let E=this.coefficients,O=y.coefficients;if(E.length>O.length){let K=E;E=O,O=K}let $=new Int32Array(O.length),H=O.length-E.length;w.arraycopy(O,0,$,0,H);for(let K=H;K<O.length;K++)$[K]=this.field.add(E[K-H],O[K]);return new Vn(this.field,$)}subtract(y){if(!this.field.equals(y.field))throw new f("ModulusPolys do not have same ModulusGF field");return y.isZero()?this:this.add(y.negative())}multiply(y){return y instanceof Vn?this.multiplyOther(y):this.multiplyScalar(y)}multiplyOther(y){if(!this.field.equals(y.field))throw new f("ModulusPolys do not have same ModulusGF field");if(this.isZero()||y.isZero())return new Vn(this.field,new Int32Array([0]));let E=this.coefficients,O=E.length,$=y.coefficients,H=$.length,K=new Int32Array(O+H-1);for(let le=0;le<O;le++){let ve=E[le];for(let Te=0;Te<H;Te++)K[le+Te]=this.field.add(K[le+Te],this.field.multiply(ve,$[Te]))}return new Vn(this.field,K)}negative(){let y=this.coefficients.length,E=new Int32Array(y);for(let O=0;O<y;O++)E[O]=this.field.subtract(0,this.coefficients[O]);return new Vn(this.field,E)}multiplyScalar(y){if(y===0)return new Vn(this.field,new Int32Array([0]));if(y===1)return this;let E=this.coefficients.length,O=new Int32Array(E);for(let $=0;$<E;$++)O[$]=this.field.multiply(this.coefficients[$],y);return new Vn(this.field,O)}multiplyByMonomial(y,E){if(y<0)throw new f;if(E===0)return new Vn(this.field,new Int32Array([0]));let O=this.coefficients.length,$=new Int32Array(O+y);for(let H=0;H<O;H++)$[H]=this.field.multiply(this.coefficients[H],E);return new Vn(this.field,$)}toString(){let y=new re;for(let E=this.getDegree();E>=0;E--){let O=this.getCoefficient(E);O!==0&&(O<0?(y.append(" - "),O=-O):y.length()>0&&y.append(" + "),(E===0||O!==1)&&y.append(O),E!==0&&(E===1?y.append("x"):(y.append("x^"),y.append(E))))}return y.toString()}}class gr{add(y,E){return(y+E)%this.modulus}subtract(y,E){return(this.modulus+y-E)%this.modulus}exp(y){return this.expTable[y]}log(y){if(y===0)throw new f;return this.logTable[y]}inverse(y){if(y===0)throw new $e;return this.expTable[this.modulus-this.logTable[y]-1]}multiply(y,E){return y===0||E===0?0:this.expTable[(this.logTable[y]+this.logTable[E])%(this.modulus-1)]}getSize(){return this.modulus}equals(y){return y===this}}class Ir extends gr{constructor(y,E){super(),this.modulus=y,this.expTable=new Int32Array(y),this.logTable=new Int32Array(y);let O=1;for(let $=0;$<y;$++)this.expTable[$]=O,O=O*E%y;for(let $=0;$<y-1;$++)this.logTable[this.expTable[$]]=$;this.zero=new Vn(this,new Int32Array([0])),this.one=new Vn(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(y,E){if(y<0)throw new f;if(E===0)return this.zero;let O=new Int32Array(y+1);return O[0]=E,new Vn(this,O)}}Ir.PDF417_GF=new Ir(In.NUMBER_OF_CODEWORDS,3);class Fr{constructor(){this.field=Ir.PDF417_GF}decode(y,E,O){let $=new Vn(this.field,y),H=new Int32Array(E),K=!1;for(let vt=E;vt>0;vt--){let $t=$.evaluateAt(this.field.exp(vt));H[E-vt]=$t,$t!==0&&(K=!0)}if(!K)return 0;let le=this.field.getOne();if(O!=null)for(const vt of O){let $t=this.field.exp(y.length-1-vt),Kt=new Vn(this.field,new Int32Array([this.field.subtract(0,$t),1]));le=le.multiply(Kt)}let ve=new Vn(this.field,H),Te=this.runEuclideanAlgorithm(this.field.buildMonomial(E,1),ve,E),Ze=Te[0],ht=Te[1],Tt=this.findErrorLocations(Ze),tn=this.findErrorMagnitudes(ht,Ze,Tt);for(let vt=0;vt<Tt.length;vt++){let $t=y.length-1-this.field.log(Tt[vt]);if($t<0)throw g.getChecksumInstance();y[$t]=this.field.subtract(y[$t],tn[vt])}return Tt.length}runEuclideanAlgorithm(y,E,O){if(y.getDegree()<E.getDegree()){let Tt=y;y=E,E=Tt}let $=y,H=E,K=this.field.getZero(),le=this.field.getOne();for(;H.getDegree()>=Math.round(O/2);){let Tt=$,tn=K;if($=H,K=le,$.isZero())throw g.getChecksumInstance();H=Tt;let vt=this.field.getZero(),$t=$.getCoefficient($.getDegree()),Kt=this.field.inverse($t);for(;H.getDegree()>=$.getDegree()&&!H.isZero();){let _n=H.getDegree()-$.getDegree(),ur=this.field.multiply(H.getCoefficient(H.getDegree()),Kt);vt=vt.add(this.field.buildMonomial(_n,ur)),H=H.subtract($.multiplyByMonomial(_n,ur))}le=vt.multiply(K).subtract(tn).negative()}let ve=le.getCoefficient(0);if(ve===0)throw g.getChecksumInstance();let Te=this.field.inverse(ve),Ze=le.multiply(Te),ht=H.multiply(Te);return[Ze,ht]}findErrorLocations(y){let E=y.getDegree(),O=new Int32Array(E),$=0;for(let H=1;H<this.field.getSize()&&$<E;H++)y.evaluateAt(H)===0&&(O[$]=this.field.inverse(H),$++);if($!==E)throw g.getChecksumInstance();return O}findErrorMagnitudes(y,E,O){let $=E.getDegree(),H=new Int32Array($);for(let Te=1;Te<=$;Te++)H[$-Te]=this.field.multiply(Te,E.getCoefficient(Te));let K=new Vn(this.field,H),le=O.length,ve=new Int32Array(le);for(let Te=0;Te<le;Te++){let Ze=this.field.inverse(O[Te]),ht=this.field.subtract(0,y.evaluateAt(Ze)),Tt=this.field.inverse(K.evaluateAt(Ze));ve[Te]=this.field.multiply(ht,Tt)}return ve}}class Lr{constructor(y,E,O,$,H){y instanceof Lr?this.constructor_2(y):this.constructor_1(y,E,O,$,H)}constructor_1(y,E,O,$,H){const K=E==null||O==null,le=$==null||H==null;if(K&&le)throw new Y;K?(E=new Nt(0,$.getY()),O=new Nt(0,H.getY())):le&&($=new Nt(y.getWidth()-1,E.getY()),H=new Nt(y.getWidth()-1,O.getY())),this.image=y,this.topLeft=E,this.bottomLeft=O,this.topRight=$,this.bottomRight=H,this.minX=Math.trunc(Math.min(E.getX(),O.getX())),this.maxX=Math.trunc(Math.max($.getX(),H.getX())),this.minY=Math.trunc(Math.min(E.getY(),$.getY())),this.maxY=Math.trunc(Math.max(O.getY(),H.getY()))}constructor_2(y){this.image=y.image,this.topLeft=y.getTopLeft(),this.bottomLeft=y.getBottomLeft(),this.topRight=y.getTopRight(),this.bottomRight=y.getBottomRight(),this.minX=y.getMinX(),this.maxX=y.getMaxX(),this.minY=y.getMinY(),this.maxY=y.getMaxY()}static merge(y,E){return y==null?E:E==null?y:new Lr(y.image,y.topLeft,y.bottomLeft,E.topRight,E.bottomRight)}addMissingRows(y,E,O){let $=this.topLeft,H=this.bottomLeft,K=this.topRight,le=this.bottomRight;if(y>0){let ve=O?this.topLeft:this.topRight,Te=Math.trunc(ve.getY()-y);Te<0&&(Te=0);let Ze=new Nt(ve.getX(),Te);O?$=Ze:K=Ze}if(E>0){let ve=O?this.bottomLeft:this.bottomRight,Te=Math.trunc(ve.getY()+E);Te>=this.image.getHeight()&&(Te=this.image.getHeight()-1);let Ze=new Nt(ve.getX(),Te);O?H=Ze:le=Ze}return new Lr(this.image,$,H,K,le)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Ht{constructor(y,E,O,$){this.columnCount=y,this.errorCorrectionLevel=$,this.rowCountUpperPart=E,this.rowCountLowerPart=O,this.rowCount=E+O}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class nn{constructor(){this.buffer=""}static form(y,E){let O=-1;function $(K,le,ve,Te,Ze,ht){if(K==="%%")return"%";if(E[++O]===void 0)return;K=Te?parseInt(Te.substr(1)):void 0;let Tt=Ze?parseInt(Ze.substr(1)):void 0,tn;switch(ht){case"s":tn=E[O];break;case"c":tn=E[O][0];break;case"f":tn=parseFloat(E[O]).toFixed(K);break;case"p":tn=parseFloat(E[O]).toPrecision(K);break;case"e":tn=parseFloat(E[O]).toExponential(K);break;case"x":tn=parseInt(E[O]).toString(Tt||16);break;case"d":tn=parseFloat(parseInt(E[O],Tt||10).toPrecision(K)).toFixed(0);break}tn=typeof tn=="object"?JSON.stringify(tn):(+tn).toString(Tt);let vt=parseInt(ve),$t=ve&&ve[0]+""=="0"?"0":" ";for(;tn.length<vt;)tn=le!==void 0?tn+$t:$t+tn;return tn}let H=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return y.replace(H,$)}format(y,...E){this.buffer+=nn.form(y,E)}toString(){return this.buffer}}class Sr{constructor(y){this.boundingBox=new Lr(y),this.codewords=new Array(y.getMaxY()-y.getMinY()+1)}getCodewordNearby(y){let E=this.getCodeword(y);if(E!=null)return E;for(let O=1;O<Sr.MAX_NEARBY_DISTANCE;O++){let $=this.imageRowToCodewordIndex(y)-O;if($>=0&&(E=this.codewords[$],E!=null)||($=this.imageRowToCodewordIndex(y)+O,$<this.codewords.length&&(E=this.codewords[$],E!=null)))return E}return null}imageRowToCodewordIndex(y){return y-this.boundingBox.getMinY()}setCodeword(y,E){this.codewords[this.imageRowToCodewordIndex(y)]=E}getCodeword(y){return this.codewords[this.imageRowToCodewordIndex(y)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const y=new nn;let E=0;for(const O of this.codewords){if(O==null){y.format("%3d: | %n",E++);continue}y.format("%3d: %3d|%3d%n",E++,O.getRowNumber(),O.getValue())}return y.toString()}}Sr.MAX_NEARBY_DISTANCE=5;class Br{constructor(){this.values=new Map}setValue(y){y=Math.trunc(y);let E=this.values.get(y);E==null&&(E=0),E++,this.values.set(y,E)}getValue(){let y=-1,E=new Array;for(const[O,$]of this.values.entries()){const H={getKey:()=>O,getValue:()=>$};H.getValue()>y?(y=H.getValue(),E=[],E.push(H.getKey())):H.getValue()===y&&E.push(H.getKey())}return In.toIntArray(E)}getConfidence(y){return this.values.get(y)}}class Kr extends Sr{constructor(y,E){super(y),this._isLeft=E}setRowNumbers(){for(let y of this.getCodewords())y!=null&&y.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(y){let E=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(E,y);let O=this.getBoundingBox(),$=this._isLeft?O.getTopLeft():O.getTopRight(),H=this._isLeft?O.getBottomLeft():O.getBottomRight(),K=this.imageRowToCodewordIndex(Math.trunc($.getY())),le=this.imageRowToCodewordIndex(Math.trunc(H.getY())),ve=-1,Te=1,Ze=0;for(let ht=K;ht<le;ht++){if(E[ht]==null)continue;let Tt=E[ht],tn=Tt.getRowNumber()-ve;if(tn===0)Ze++;else if(tn===1)Te=Math.max(Te,Ze),Ze=1,ve=Tt.getRowNumber();else if(tn<0||Tt.getRowNumber()>=y.getRowCount()||tn>ht)E[ht]=null;else{let vt;Te>2?vt=(Te-2)*tn:vt=tn;let $t=vt>=ht;for(let Kt=1;Kt<=vt&&!$t;Kt++)$t=E[ht-Kt]!=null;$t?E[ht]=null:(ve=Tt.getRowNumber(),Ze=1)}}}getRowHeights(){let y=this.getBarcodeMetadata();if(y==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(y);let E=new Int32Array(y.getRowCount());for(let O of this.getCodewords())if(O!=null){let $=O.getRowNumber();if($>=E.length)continue;E[$]++}return E}adjustIncompleteIndicatorColumnRowNumbers(y){let E=this.getBoundingBox(),O=this._isLeft?E.getTopLeft():E.getTopRight(),$=this._isLeft?E.getBottomLeft():E.getBottomRight(),H=this.imageRowToCodewordIndex(Math.trunc(O.getY())),K=this.imageRowToCodewordIndex(Math.trunc($.getY())),le=this.getCodewords(),ve=-1;for(let Te=H;Te<K;Te++){if(le[Te]==null)continue;let Ze=le[Te];Ze.setRowNumberAsRowIndicatorColumn();let ht=Ze.getRowNumber()-ve;ht===0||(ht===1?ve=Ze.getRowNumber():Ze.getRowNumber()>=y.getRowCount()?le[Te]=null:ve=Ze.getRowNumber())}}getBarcodeMetadata(){let y=this.getCodewords(),E=new Br,O=new Br,$=new Br,H=new Br;for(let le of y){if(le==null)continue;le.setRowNumberAsRowIndicatorColumn();let ve=le.getValue()%30,Te=le.getRowNumber();switch(this._isLeft||(Te+=2),Te%3){case 0:O.setValue(ve*3+1);break;case 1:H.setValue(ve/3),$.setValue(ve%3);break;case 2:E.setValue(ve+1);break}}if(E.getValue().length===0||O.getValue().length===0||$.getValue().length===0||H.getValue().length===0||E.getValue()[0]<1||O.getValue()[0]+$.getValue()[0]<In.MIN_ROWS_IN_BARCODE||O.getValue()[0]+$.getValue()[0]>In.MAX_ROWS_IN_BARCODE)return null;let K=new Ht(E.getValue()[0],O.getValue()[0],$.getValue()[0],H.getValue()[0]);return this.removeIncorrectCodewords(y,K),K}removeIncorrectCodewords(y,E){for(let O=0;O<y.length;O++){let $=y[O];if(y[O]==null)continue;let H=$.getValue()%30,K=$.getRowNumber();if(K>E.getRowCount()){y[O]=null;continue}switch(this._isLeft||(K+=2),K%3){case 0:H*3+1!==E.getRowCountUpperPart()&&(y[O]=null);break;case 1:(Math.trunc(H/3)!==E.getErrorCorrectionLevel()||H%3!==E.getRowCountLowerPart())&&(y[O]=null);break;case 2:H+1!==E.getColumnCount()&&(y[O]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+`
`+super.toString()}}class As{constructor(y,E){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=y,this.barcodeColumnCount=y.getColumnCount(),this.boundingBox=E,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let y=In.MAX_CODEWORDS_IN_BARCODE,E;do E=y,y=this.adjustRowNumbersAndGetCount();while(y>0&&y<E);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(y){y!=null&&y.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let y=this.adjustRowNumbersByRow();if(y===0)return 0;for(let E=1;E<this.barcodeColumnCount+1;E++){let O=this.detectionResultColumns[E].getCodewords();for(let $=0;$<O.length;$++)O[$]!=null&&(O[$].hasValidRowNumber()||this.adjustRowNumbers(E,$,O))}return y}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let y=this.detectionResultColumns[0].getCodewords(),E=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let O=0;O<y.length;O++)if(y[O]!=null&&E[O]!=null&&y[O].getRowNumber()===E[O].getRowNumber())for(let $=1;$<=this.barcodeColumnCount;$++){let H=this.detectionResultColumns[$].getCodewords()[O];H!=null&&(H.setRowNumber(y[O].getRowNumber()),H.hasValidRowNumber()||(this.detectionResultColumns[$].getCodewords()[O]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let y=0,E=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let O=0;O<E.length;O++){if(E[O]==null)continue;let $=E[O].getRowNumber(),H=0;for(let K=this.barcodeColumnCount+1;K>0&&H<this.ADJUST_ROW_NUMBER_SKIP;K--){let le=this.detectionResultColumns[K].getCodewords()[O];le!=null&&(H=As.adjustRowNumberIfValid($,H,le),le.hasValidRowNumber()||y++)}}return y}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let y=0,E=this.detectionResultColumns[0].getCodewords();for(let O=0;O<E.length;O++){if(E[O]==null)continue;let $=E[O].getRowNumber(),H=0;for(let K=1;K<this.barcodeColumnCount+1&&H<this.ADJUST_ROW_NUMBER_SKIP;K++){let le=this.detectionResultColumns[K].getCodewords()[O];le!=null&&(H=As.adjustRowNumberIfValid($,H,le),le.hasValidRowNumber()||y++)}}return y}static adjustRowNumberIfValid(y,E,O){return O==null||O.hasValidRowNumber()||(O.isValidRowNumber(y)?(O.setRowNumber(y),E=0):++E),E}adjustRowNumbers(y,E,O){if(!this.detectionResultColumns[y-1])return;let $=O[E],H=this.detectionResultColumns[y-1].getCodewords(),K=H;this.detectionResultColumns[y+1]!=null&&(K=this.detectionResultColumns[y+1].getCodewords());let le=new Array(14);le[2]=H[E],le[3]=K[E],E>0&&(le[0]=O[E-1],le[4]=H[E-1],le[5]=K[E-1]),E>1&&(le[8]=O[E-2],le[10]=H[E-2],le[11]=K[E-2]),E<O.length-1&&(le[1]=O[E+1],le[6]=H[E+1],le[7]=K[E+1]),E<O.length-2&&(le[9]=O[E+2],le[12]=H[E+2],le[13]=K[E+2]);for(let ve of le)if(As.adjustRowNumber($,ve))return}static adjustRowNumber(y,E){return E==null?!1:E.hasValidRowNumber()&&E.getBucket()===y.getBucket()?(y.setRowNumber(E.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(y){this.boundingBox=y}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(y,E){this.detectionResultColumns[y]=E}getDetectionResultColumn(y){return this.detectionResultColumns[y]}toString(){let y=this.detectionResultColumns[0];y==null&&(y=this.detectionResultColumns[this.barcodeColumnCount+1]);let E=new nn;for(let O=0;O<y.getCodewords().length;O++){E.format("CW %3d:",O);for(let $=0;$<this.barcodeColumnCount+2;$++){if(this.detectionResultColumns[$]==null){E.format(" | ");continue}let H=this.detectionResultColumns[$].getCodewords()[O];if(H==null){E.format(" | ");continue}E.format(" %3d|%3d",H.getRowNumber(),H.getValue())}E.format("%n")}return E.toString()}}class ms{constructor(y,E,O,$){this.rowNumber=ms.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(y),this.endX=Math.trunc(E),this.bucket=Math.trunc(O),this.value=Math.trunc($)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(y){return y!==ms.BARCODE_ROW_UNKNOWN&&this.bucket===y%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(y){this.rowNumber=y}toString(){return this.rowNumber+"|"+this.value}}ms.BARCODE_ROW_UNKNOWN=-1;class vr{static initialize(){for(let y=0;y<In.SYMBOL_TABLE.length;y++){let E=In.SYMBOL_TABLE[y],O=E&1;for(let $=0;$<In.BARS_IN_MODULE;$++){let H=0;for(;(E&1)===O;)H+=1,E>>=1;O=E&1,vr.RATIOS_TABLE[y]||(vr.RATIOS_TABLE[y]=new Array(In.BARS_IN_MODULE)),vr.RATIOS_TABLE[y][In.BARS_IN_MODULE-$-1]=Math.fround(H/In.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(y){let E=vr.getDecodedCodewordValue(vr.sampleBitCounts(y));return E!==-1?E:vr.getClosestDecodedValue(y)}static sampleBitCounts(y){let E=It.sum(y),O=new Int32Array(In.BARS_IN_MODULE),$=0,H=0;for(let K=0;K<In.MODULES_IN_CODEWORD;K++){let le=E/(2*In.MODULES_IN_CODEWORD)+K*E/In.MODULES_IN_CODEWORD;H+y[$]<=le&&(H+=y[$],$++),O[$]++}return O}static getDecodedCodewordValue(y){let E=vr.getBitValue(y);return In.getCodeword(E)===-1?-1:E}static getBitValue(y){let E=0;for(let O=0;O<y.length;O++)for(let $=0;$<y[O];$++)E=E<<1|(O%2===0?1:0);return Math.trunc(E)}static getClosestDecodedValue(y){let E=It.sum(y),O=new Array(In.BARS_IN_MODULE);if(E>1)for(let K=0;K<O.length;K++)O[K]=Math.fround(y[K]/E);let $=an.MAX_VALUE,H=-1;this.bSymbolTableReady||vr.initialize();for(let K=0;K<vr.RATIOS_TABLE.length;K++){let le=0,ve=vr.RATIOS_TABLE[K];for(let Te=0;Te<In.BARS_IN_MODULE;Te++){let Ze=Math.fround(ve[Te]-O[Te]);if(le+=Math.fround(Ze*Ze),le>=$)break}le<$&&($=le,H=In.SYMBOL_TABLE[K])}return H}}vr.bSymbolTableReady=!1,vr.RATIOS_TABLE=new Array(In.SYMBOL_TABLE.length).map(dt=>new Array(In.BARS_IN_MODULE));class Yr{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(y){this.segmentIndex=y}getFileId(){return this.fileId}setFileId(y){this.fileId=y}getOptionalData(){return this.optionalData}setOptionalData(y){this.optionalData=y}isLastSegment(){return this.lastSegment}setLastSegment(y){this.lastSegment=y}getSegmentCount(){return this.segmentCount}setSegmentCount(y){this.segmentCount=y}getSender(){return this.sender||null}setSender(y){this.sender=y}getAddressee(){return this.addressee||null}setAddressee(y){this.addressee=y}getFileName(){return this.fileName}setFileName(y){this.fileName=y}getFileSize(){return this.fileSize}setFileSize(y){this.fileSize=y}getChecksum(){return this.checksum}setChecksum(y){this.checksum=y}getTimestamp(){return this.timestamp}setTimestamp(y){this.timestamp=y}}class vi{static parseLong(y,E=void 0){return parseInt(y,E)}}class _r extends u{}_r.kind="NullPointerException";class os{writeBytes(y){this.writeBytesOffset(y,0,y.length)}writeBytesOffset(y,E,O){if(y==null)throw new _r;if(E<0||E>y.length||O<0||E+O>y.length||E+O<0)throw new C;if(O===0)return;for(let $=0;$<O;$++)this.write(y[E+$])}flush(){}close(){}}class Gs extends u{}class mi extends os{constructor(y=32){if(super(),this.count=0,y<0)throw new f("Negative initial size: "+y);this.buf=new Uint8Array(y)}ensureCapacity(y){y-this.buf.length>0&&this.grow(y)}grow(y){let O=this.buf.length<<1;if(O-y<0&&(O=y),O<0){if(y<0)throw new Gs;O=P.MAX_VALUE}this.buf=I.copyOfUint8Array(this.buf,O)}write(y){this.ensureCapacity(this.count+1),this.buf[this.count]=y,this.count+=1}writeBytesOffset(y,E,O){if(E<0||E>y.length||O<0||E+O-y.length>0)throw new C;this.ensureCapacity(this.count+O),w.arraycopy(y,E,this.buf,this.count,O),this.count+=O}writeTo(y){y.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return I.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(y){return y?typeof y=="string"?this.toString_string(y):this.toString_number(y):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(y){return new String(this.buf).toString()}toString_number(y){return new String(this.buf).toString()}close(){}}var ns;(function(dt){dt[dt.ALPHA=0]="ALPHA",dt[dt.LOWER=1]="LOWER",dt[dt.MIXED=2]="MIXED",dt[dt.PUNCT=3]="PUNCT",dt[dt.ALPHA_SHIFT=4]="ALPHA_SHIFT",dt[dt.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(ns||(ns={}));function Xt(){if(typeof window<"u")return window.BigInt||null;if(typeof Tu<"u")return Tu.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let ue;function rt(dt){if(typeof ue>"u"&&(ue=Xt()),ue===null)throw new Error("BigInt is not supported!");return ue(dt)}function Ft(){let dt=[];dt[0]=rt(1);let y=rt(900);dt[1]=y;for(let E=2;E<16;E++)dt[E]=dt[E-1]*y;return dt}class yt{static decode(y,E){let O=new re(""),$=Q.ISO8859_1;O.enableDecoding($);let H=1,K=y[H++],le=new Yr;for(;H<y[0];){switch(K){case yt.TEXT_COMPACTION_MODE_LATCH:H=yt.textCompaction(y,H,O);break;case yt.BYTE_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:H=yt.byteCompaction(K,y,$,H,O);break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:O.append(y[H++]);break;case yt.NUMERIC_COMPACTION_MODE_LATCH:H=yt.numericCompaction(y,H,O);break;case yt.ECI_CHARSET:Q.getCharacterSetECIByValue(y[H++]);break;case yt.ECI_GENERAL_PURPOSE:H+=2;break;case yt.ECI_USER_DEFINED:H++;break;case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:H=yt.decodeMacroBlock(y,H,le);break;case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:throw new L;default:H--,H=yt.textCompaction(y,H,O);break}if(H<y.length)K=y[H++];else throw L.getFormatInstance()}if(O.length()===0)throw L.getFormatInstance();let ve=new Ie(null,O.toString(),null,E);return ve.setOther(le),ve}static decodeMacroBlock(y,E,O){if(E+yt.NUMBER_OF_SEQUENCE_CODEWORDS>y[0])throw L.getFormatInstance();let $=new Int32Array(yt.NUMBER_OF_SEQUENCE_CODEWORDS);for(let le=0;le<yt.NUMBER_OF_SEQUENCE_CODEWORDS;le++,E++)$[le]=y[E];O.setSegmentIndex(P.parseInt(yt.decodeBase900toBase10($,yt.NUMBER_OF_SEQUENCE_CODEWORDS)));let H=new re;E=yt.textCompaction(y,E,H),O.setFileId(H.toString());let K=-1;for(y[E]===yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(K=E+1);E<y[0];)switch(y[E]){case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(E++,y[E]){case yt.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let le=new re;E=yt.textCompaction(y,E+1,le),O.setFileName(le.toString());break;case yt.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let ve=new re;E=yt.textCompaction(y,E+1,ve),O.setSender(ve.toString());break;case yt.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let Te=new re;E=yt.textCompaction(y,E+1,Te),O.setAddressee(Te.toString());break;case yt.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let Ze=new re;E=yt.numericCompaction(y,E+1,Ze),O.setSegmentCount(P.parseInt(Ze.toString()));break;case yt.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let ht=new re;E=yt.numericCompaction(y,E+1,ht),O.setTimestamp(vi.parseLong(ht.toString()));break;case yt.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let Tt=new re;E=yt.numericCompaction(y,E+1,Tt),O.setChecksum(P.parseInt(Tt.toString()));break;case yt.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let tn=new re;E=yt.numericCompaction(y,E+1,tn),O.setFileSize(vi.parseLong(tn.toString()));break;default:throw L.getFormatInstance()}break;case yt.MACRO_PDF417_TERMINATOR:E++,O.setLastSegment(!0);break;default:throw L.getFormatInstance()}if(K!==-1){let le=E-K;O.isLastSegment()&&le--,O.setOptionalData(I.copyOfRange(y,K,K+le))}return E}static textCompaction(y,E,O){let $=new Int32Array((y[0]-E)*2),H=new Int32Array((y[0]-E)*2),K=0,le=!1;for(;E<y[0]&&!le;){let ve=y[E++];if(ve<yt.TEXT_COMPACTION_MODE_LATCH)$[K]=ve/30,$[K+1]=ve%30,K+=2;else switch(ve){case yt.TEXT_COMPACTION_MODE_LATCH:$[K++]=yt.TEXT_COMPACTION_MODE_LATCH;break;case yt.BYTE_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:case yt.NUMERIC_COMPACTION_MODE_LATCH:case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:E--,le=!0;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$[K]=yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,ve=y[E++],H[K]=ve,K++;break}}return yt.decodeTextCompaction($,H,K,O),E}static decodeTextCompaction(y,E,O,$){let H=ns.ALPHA,K=ns.ALPHA,le=0;for(;le<O;){let ve=y[le],Te="";switch(H){case ns.ALPHA:if(ve<26)Te=String.fromCharCode(65+ve);else switch(ve){case 26:Te=" ";break;case yt.LL:H=ns.LOWER;break;case yt.ML:H=ns.MIXED;break;case yt.PS:K=H,H=ns.PUNCT_SHIFT;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=ns.ALPHA;break}break;case ns.LOWER:if(ve<26)Te=String.fromCharCode(97+ve);else switch(ve){case 26:Te=" ";break;case yt.AS:K=H,H=ns.ALPHA_SHIFT;break;case yt.ML:H=ns.MIXED;break;case yt.PS:K=H,H=ns.PUNCT_SHIFT;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=ns.ALPHA;break}break;case ns.MIXED:if(ve<yt.PL)Te=yt.MIXED_CHARS[ve];else switch(ve){case yt.PL:H=ns.PUNCT;break;case 26:Te=" ";break;case yt.LL:H=ns.LOWER;break;case yt.AL:H=ns.ALPHA;break;case yt.PS:K=H,H=ns.PUNCT_SHIFT;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=ns.ALPHA;break}break;case ns.PUNCT:if(ve<yt.PAL)Te=yt.PUNCT_CHARS[ve];else switch(ve){case yt.PAL:H=ns.ALPHA;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=ns.ALPHA;break}break;case ns.ALPHA_SHIFT:if(H=K,ve<26)Te=String.fromCharCode(65+ve);else switch(ve){case 26:Te=" ";break;case yt.TEXT_COMPACTION_MODE_LATCH:H=ns.ALPHA;break}break;case ns.PUNCT_SHIFT:if(H=K,ve<yt.PAL)Te=yt.PUNCT_CHARS[ve];else switch(ve){case yt.PAL:H=ns.ALPHA;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=ns.ALPHA;break}break}Te!==""&&$.append(Te),le++}}static byteCompaction(y,E,O,$,H){let K=new mi,le=0,ve=0,Te=!1;switch(y){case yt.BYTE_COMPACTION_MODE_LATCH:let Ze=new Int32Array(6),ht=E[$++];for(;$<E[0]&&!Te;)switch(Ze[le++]=ht,ve=900*ve+ht,ht=E[$++],ht){case yt.TEXT_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH:case yt.NUMERIC_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:$--,Te=!0;break;default:if(le%5===0&&le>0){for(let Tt=0;Tt<6;++Tt)K.write(Number(rt(ve)>>rt(8*(5-Tt))));ve=0,le=0}break}$===E[0]&&ht<yt.TEXT_COMPACTION_MODE_LATCH&&(Ze[le++]=ht);for(let Tt=0;Tt<le;Tt++)K.write(Ze[Tt]);break;case yt.BYTE_COMPACTION_MODE_LATCH_6:for(;$<E[0]&&!Te;){let Tt=E[$++];if(Tt<yt.TEXT_COMPACTION_MODE_LATCH)le++,ve=900*ve+Tt;else switch(Tt){case yt.TEXT_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH:case yt.NUMERIC_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:$--,Te=!0;break}if(le%5===0&&le>0){for(let tn=0;tn<6;++tn)K.write(Number(rt(ve)>>rt(8*(5-tn))));ve=0,le=0}}break}return H.append(J.decode(K.toByteArray(),O)),$}static numericCompaction(y,E,O){let $=0,H=!1,K=new Int32Array(yt.MAX_NUMERIC_CODEWORDS);for(;E<y[0]&&!H;){let le=y[E++];if(E===y[0]&&(H=!0),le<yt.TEXT_COMPACTION_MODE_LATCH)K[$]=le,$++;else switch(le){case yt.TEXT_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:E--,H=!0;break}($%yt.MAX_NUMERIC_CODEWORDS===0||le===yt.NUMERIC_COMPACTION_MODE_LATCH||H)&&$>0&&(O.append(yt.decodeBase900toBase10(K,$)),$=0)}return E}static decodeBase900toBase10(y,E){let O=rt(0);for(let H=0;H<E;H++)O+=yt.EXP900[E-H-1]*rt(y[H]);let $=O.toString();if($.charAt(0)!=="1")throw new L;return $.substring(1)}}yt.TEXT_COMPACTION_MODE_LATCH=900,yt.BYTE_COMPACTION_MODE_LATCH=901,yt.NUMERIC_COMPACTION_MODE_LATCH=902,yt.BYTE_COMPACTION_MODE_LATCH_6=924,yt.ECI_USER_DEFINED=925,yt.ECI_GENERAL_PURPOSE=926,yt.ECI_CHARSET=927,yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,yt.MACRO_PDF417_TERMINATOR=922,yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,yt.MAX_NUMERIC_CODEWORDS=15,yt.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,yt.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,yt.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,yt.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,yt.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,yt.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,yt.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,yt.PL=25,yt.LL=27,yt.AS=27,yt.ML=28,yt.AL=28,yt.PS=29,yt.PAL=29,yt.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
-.$/"|*()?{}'`,yt.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",yt.EXP900=Xt()?Ft():[],yt.NUMBER_OF_SEQUENCE_CODEWORDS=2;class hn{constructor(){}static decode(y,E,O,$,H,K,le){let ve=new Lr(y,E,O,$,H),Te=null,Ze=null,ht;for(let vt=!0;;vt=!1){if(E!=null&&(Te=hn.getRowIndicatorColumn(y,ve,E,!0,K,le)),$!=null&&(Ze=hn.getRowIndicatorColumn(y,ve,$,!1,K,le)),ht=hn.merge(Te,Ze),ht==null)throw Y.getNotFoundInstance();let $t=ht.getBoundingBox();if(vt&&$t!=null&&($t.getMinY()<ve.getMinY()||$t.getMaxY()>ve.getMaxY()))ve=$t;else break}ht.setBoundingBox(ve);let Tt=ht.getBarcodeColumnCount()+1;ht.setDetectionResultColumn(0,Te),ht.setDetectionResultColumn(Tt,Ze);let tn=Te!=null;for(let vt=1;vt<=Tt;vt++){let $t=tn?vt:Tt-vt;if(ht.getDetectionResultColumn($t)!==void 0)continue;let Kt;$t===0||$t===Tt?Kt=new Kr(ve,$t===0):Kt=new Sr(ve),ht.setDetectionResultColumn($t,Kt);let _n=-1,ur=_n;for(let br=ve.getMinY();br<=ve.getMaxY();br++){if(_n=hn.getStartColumn(ht,$t,br,tn),_n<0||_n>ve.getMaxX()){if(ur===-1)continue;_n=ur}let wr=hn.detectCodeword(y,ve.getMinX(),ve.getMaxX(),tn,_n,br,K,le);wr!=null&&(Kt.setCodeword(br,wr),ur=_n,K=Math.min(K,wr.getWidth()),le=Math.max(le,wr.getWidth()))}}return hn.createDecoderResult(ht)}static merge(y,E){if(y==null&&E==null)return null;let O=hn.getBarcodeMetadata(y,E);if(O==null)return null;let $=Lr.merge(hn.adjustBoundingBox(y),hn.adjustBoundingBox(E));return new As(O,$)}static adjustBoundingBox(y){if(y==null)return null;let E=y.getRowHeights();if(E==null)return null;let O=hn.getMax(E),$=0;for(let le of E)if($+=O-le,le>0)break;let H=y.getCodewords();for(let le=0;$>0&&H[le]==null;le++)$--;let K=0;for(let le=E.length-1;le>=0&&(K+=O-E[le],!(E[le]>0));le--);for(let le=H.length-1;K>0&&H[le]==null;le--)K--;return y.getBoundingBox().addMissingRows($,K,y.isLeft())}static getMax(y){let E=-1;for(let O of y)E=Math.max(E,O);return E}static getBarcodeMetadata(y,E){let O;if(y==null||(O=y.getBarcodeMetadata())==null)return E==null?null:E.getBarcodeMetadata();let $;return E==null||($=E.getBarcodeMetadata())==null?O:O.getColumnCount()!==$.getColumnCount()&&O.getErrorCorrectionLevel()!==$.getErrorCorrectionLevel()&&O.getRowCount()!==$.getRowCount()?null:O}static getRowIndicatorColumn(y,E,O,$,H,K){let le=new Kr(E,$);for(let ve=0;ve<2;ve++){let Te=ve===0?1:-1,Ze=Math.trunc(Math.trunc(O.getX()));for(let ht=Math.trunc(Math.trunc(O.getY()));ht<=E.getMaxY()&&ht>=E.getMinY();ht+=Te){let Tt=hn.detectCodeword(y,0,y.getWidth(),$,Ze,ht,H,K);Tt!=null&&(le.setCodeword(ht,Tt),$?Ze=Tt.getStartX():Ze=Tt.getEndX())}}return le}static adjustCodewordCount(y,E){let O=E[0][1],$=O.getValue(),H=y.getBarcodeColumnCount()*y.getBarcodeRowCount()-hn.getNumberOfECCodeWords(y.getBarcodeECLevel());if($.length===0){if(H<1||H>In.MAX_CODEWORDS_IN_BARCODE)throw Y.getNotFoundInstance();O.setValue(H)}else $[0]!==H&&O.setValue(H)}static createDecoderResult(y){let E=hn.createBarcodeMatrix(y);hn.adjustCodewordCount(y,E);let O=new Array,$=new Int32Array(y.getBarcodeRowCount()*y.getBarcodeColumnCount()),H=[],K=new Array;for(let ve=0;ve<y.getBarcodeRowCount();ve++)for(let Te=0;Te<y.getBarcodeColumnCount();Te++){let Ze=E[ve][Te+1].getValue(),ht=ve*y.getBarcodeColumnCount()+Te;Ze.length===0?O.push(ht):Ze.length===1?$[ht]=Ze[0]:(K.push(ht),H.push(Ze))}let le=new Array(H.length);for(let ve=0;ve<le.length;ve++)le[ve]=H[ve];return hn.createDecoderResultFromAmbiguousValues(y.getBarcodeECLevel(),$,In.toIntArray(O),In.toIntArray(K),le)}static createDecoderResultFromAmbiguousValues(y,E,O,$,H){let K=new Int32Array($.length),le=100;for(;le-- >0;){for(let ve=0;ve<K.length;ve++)E[$[ve]]=H[ve][K[ve]];try{return hn.decodeCodewords(E,y,O)}catch(ve){if(!(ve instanceof g))throw ve}if(K.length===0)throw g.getChecksumInstance();for(let ve=0;ve<K.length;ve++)if(K[ve]<H[ve].length-1){K[ve]++;break}else if(K[ve]=0,ve===K.length-1)throw g.getChecksumInstance()}throw g.getChecksumInstance()}static createBarcodeMatrix(y){let E=Array.from({length:y.getBarcodeRowCount()},()=>new Array(y.getBarcodeColumnCount()+2));for(let $=0;$<E.length;$++)for(let H=0;H<E[$].length;H++)E[$][H]=new Br;let O=0;for(let $ of y.getDetectionResultColumns()){if($!=null){for(let H of $.getCodewords())if(H!=null){let K=H.getRowNumber();if(K>=0){if(K>=E.length)continue;E[K][O].setValue(H.getValue())}}}O++}return E}static isValidBarcodeColumn(y,E){return E>=0&&E<=y.getBarcodeColumnCount()+1}static getStartColumn(y,E,O,$){let H=$?1:-1,K=null;if(hn.isValidBarcodeColumn(y,E-H)&&(K=y.getDetectionResultColumn(E-H).getCodeword(O)),K!=null)return $?K.getEndX():K.getStartX();if(K=y.getDetectionResultColumn(E).getCodewordNearby(O),K!=null)return $?K.getStartX():K.getEndX();if(hn.isValidBarcodeColumn(y,E-H)&&(K=y.getDetectionResultColumn(E-H).getCodewordNearby(O)),K!=null)return $?K.getEndX():K.getStartX();let le=0;for(;hn.isValidBarcodeColumn(y,E-H);){E-=H;for(let ve of y.getDetectionResultColumn(E).getCodewords())if(ve!=null)return($?ve.getEndX():ve.getStartX())+H*le*(ve.getEndX()-ve.getStartX());le++}return $?y.getBoundingBox().getMinX():y.getBoundingBox().getMaxX()}static detectCodeword(y,E,O,$,H,K,le,ve){H=hn.adjustCodewordStartColumn(y,E,O,$,H,K);let Te=hn.getModuleBitCount(y,E,O,$,H,K);if(Te==null)return null;let Ze,ht=It.sum(Te);if($)Ze=H+ht;else{for(let vt=0;vt<Te.length/2;vt++){let $t=Te[vt];Te[vt]=Te[Te.length-1-vt],Te[Te.length-1-vt]=$t}Ze=H,H=Ze-ht}if(!hn.checkCodewordSkew(ht,le,ve))return null;let Tt=vr.getDecodedValue(Te),tn=In.getCodeword(Tt);return tn===-1?null:new ms(H,Ze,hn.getCodewordBucketNumber(Tt),tn)}static getModuleBitCount(y,E,O,$,H,K){let le=H,ve=new Int32Array(8),Te=0,Ze=$?1:-1,ht=$;for(;($?le<O:le>=E)&&Te<ve.length;)y.get(le,K)===ht?(ve[Te]++,le+=Ze):(Te++,ht=!ht);return Te===ve.length||le===($?O:E)&&Te===ve.length-1?ve:null}static getNumberOfECCodeWords(y){return 2<<y}static adjustCodewordStartColumn(y,E,O,$,H,K){let le=H,ve=$?-1:1;for(let Te=0;Te<2;Te++){for(;($?le>=E:le<O)&&$===y.get(le,K);){if(Math.abs(H-le)>hn.CODEWORD_SKEW_SIZE)return H;le+=ve}ve=-ve,$=!$}return le}static checkCodewordSkew(y,E,O){return E-hn.CODEWORD_SKEW_SIZE<=y&&y<=O+hn.CODEWORD_SKEW_SIZE}static decodeCodewords(y,E,O){if(y.length===0)throw L.getFormatInstance();let $=1<<E+1,H=hn.correctErrors(y,O,$);hn.verifyCodewordCount(y,$);let K=yt.decode(y,""+E);return K.setErrorsCorrected(H),K.setErasures(O.length),K}static correctErrors(y,E,O){if(E!=null&&E.length>O/2+hn.MAX_ERRORS||O<0||O>hn.MAX_EC_CODEWORDS)throw g.getChecksumInstance();return hn.errorCorrection.decode(y,O,E)}static verifyCodewordCount(y,E){if(y.length<4)throw L.getFormatInstance();let O=y[0];if(O>y.length)throw L.getFormatInstance();if(O===0)if(E<y.length)y[0]=y.length-E;else throw L.getFormatInstance()}static getBitCountForCodeword(y){let E=new Int32Array(8),O=0,$=E.length-1;for(;!((y&1)!==O&&(O=y&1,$--,$<0));)E[$]++,y>>=1;return E}static getCodewordBucketNumber(y){return y instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(y):this.getCodewordBucketNumber_number(y)}static getCodewordBucketNumber_number(y){return hn.getCodewordBucketNumber(hn.getBitCountForCodeword(y))}static getCodewordBucketNumber_Int32Array(y){return(y[0]-y[2]+y[4]-y[6]+9)%9}static toString(y){let E=new nn;for(let O=0;O<y.length;O++){E.format("Row %2d: ",O);for(let $=0;$<y[O].length;$++){let H=y[O][$];H.getValue().length===0?E.format(" ",null):E.format("%4d(%2d)",H.getValue()[0],H.getConfidence(H.getValue()[0]))}E.format("%n")}return E.toString()}}hn.CODEWORD_SKEW_SIZE=2,hn.MAX_ERRORS=3,hn.MAX_EC_CODEWORDS=512,hn.errorCorrection=new Fr;class vn{decode(y,E=null){let O=vn.decode(y,E,!1);if(O==null||O.length===0||O[0]==null)throw Y.getNotFoundInstance();return O[0]}decodeMultiple(y,E=null){try{return vn.decode(y,E,!0)}catch(O){throw O instanceof L||O instanceof g?Y.getNotFoundInstance():O}}static decode(y,E,O){const $=new Array,H=Wn.detectMultiple(y,E,O);for(const K of H.getPoints()){const le=hn.decode(H.getBits(),K[4],K[5],K[6],K[7],vn.getMinCodewordWidth(K),vn.getMaxCodewordWidth(K)),ve=new ce(le.getText(),le.getRawBytes(),void 0,K,Ae.PDF_417);ve.putMetadata(je.ERROR_CORRECTION_LEVEL,le.getECLevel());const Te=le.getOther();Te!=null&&ve.putMetadata(je.PDF417_EXTRA_METADATA,Te),$.push(ve)}return $.map(K=>K)}static getMaxWidth(y,E){return y==null||E==null?0:Math.trunc(Math.abs(y.getX()-E.getX()))}static getMinWidth(y,E){return y==null||E==null?P.MAX_VALUE:Math.trunc(Math.abs(y.getX()-E.getX()))}static getMaxCodewordWidth(y){return Math.floor(Math.max(Math.max(vn.getMaxWidth(y[0],y[4]),vn.getMaxWidth(y[6],y[2])*In.MODULES_IN_CODEWORD/In.MODULES_IN_STOP_PATTERN),Math.max(vn.getMaxWidth(y[1],y[5]),vn.getMaxWidth(y[7],y[3])*In.MODULES_IN_CODEWORD/In.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(y){return Math.floor(Math.min(Math.min(vn.getMinWidth(y[0],y[4]),vn.getMinWidth(y[6],y[2])*In.MODULES_IN_CODEWORD/In.MODULES_IN_STOP_PATTERN),Math.min(vn.getMinWidth(y[1],y[5]),vn.getMinWidth(y[7],y[3])*In.MODULES_IN_CODEWORD/In.MODULES_IN_STOP_PATTERN)))}reset(){}}class lr extends u{}lr.kind="ReaderException";class Nr{constructor(y,E){this.verbose=y===!0,E&&this.setHints(E)}decode(y,E){return E&&this.setHints(E),this.decodeInternal(y)}decodeWithState(y){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(y)}setHints(y){this.hints=y;const E=!r(y)&&y.get(U.TRY_HARDER)===!0,O=r(y)?null:y.get(U.POSSIBLE_FORMATS),$=new Array;if(!r(O)){const H=O.some(K=>K===Ae.UPC_A||K===Ae.UPC_E||K===Ae.EAN_13||K===Ae.EAN_8||K===Ae.CODABAR||K===Ae.CODE_39||K===Ae.CODE_93||K===Ae.CODE_128||K===Ae.ITF||K===Ae.RSS_14||K===Ae.RSS_EXPANDED);H&&!E&&$.push(new k(y,this.verbose)),O.includes(Ae.QR_CODE)&&$.push(new Qt),O.includes(Ae.DATA_MATRIX)&&$.push(new Fe),O.includes(Ae.AZTEC)&&$.push(new en),O.includes(Ae.PDF_417)&&$.push(new vn),H&&E&&$.push(new k(y,this.verbose))}$.length===0&&(E||$.push(new k(y,this.verbose)),$.push(new Qt),$.push(new Fe),$.push(new en),$.push(new vn),E&&$.push(new k(y,this.verbose))),this.readers=$}reset(){if(this.readers!==null)for(const y of this.readers)y.reset()}decodeInternal(y){if(this.readers===null)throw new lr("No readers where selected, nothing can be read.");for(const E of this.readers)try{return E.decode(y,this.hints)}catch(O){if(O instanceof lr)continue}throw new Y("No MultiFormat Readers were able to detect the code.")}}class fr extends Ce{constructor(y=null,E=500){const O=new Nr;O.setHints(y),super(O,E)}decodeBitmap(y){return this.reader.decodeWithState(y)}}class cr extends Ce{constructor(y=500){super(new vn,y)}}class ts extends Ce{constructor(y=500){super(new Qt,y)}}var is;(function(dt){dt[dt.ERROR_CORRECTION=0]="ERROR_CORRECTION",dt[dt.CHARACTER_SET=1]="CHARACTER_SET",dt[dt.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",dt[dt.MIN_SIZE=3]="MIN_SIZE",dt[dt.MAX_SIZE=4]="MAX_SIZE",dt[dt.MARGIN=5]="MARGIN",dt[dt.PDF417_COMPACT=6]="PDF417_COMPACT",dt[dt.PDF417_COMPACTION=7]="PDF417_COMPACTION",dt[dt.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",dt[dt.AZTEC_LAYERS=9]="AZTEC_LAYERS",dt[dt.QR_VERSION=10]="QR_VERSION"})(is||(is={}));var Or=is;class hr{constructor(y){this.field=y,this.cachedGenerators=[],this.cachedGenerators.push(new Qe(y,Int32Array.from([1])))}buildGenerator(y){const E=this.cachedGenerators;if(y>=E.length){let O=E[E.length-1];const $=this.field;for(let H=E.length;H<=y;H++){const K=O.multiply(new Qe($,Int32Array.from([1,$.exp(H-1+$.getGeneratorBase())])));E.push(K),O=K}}return E[y]}encode(y,E){if(E===0)throw new f("No error correction bytes");const O=y.length-E;if(O<=0)throw new f("No data bytes provided");const $=this.buildGenerator(E),H=new Int32Array(O);w.arraycopy(y,0,H,0,O);let K=new Qe(this.field,H);K=K.multiplyByMonomial(E,1);const ve=K.divide($)[1].getCoefficients(),Te=E-ve.length;for(let Ze=0;Ze<Te;Ze++)y[O+Ze]=0;w.arraycopy(ve,0,y,O+Te,ve.length)}}class Jn{constructor(){}static applyMaskPenaltyRule1(y){return Jn.applyMaskPenaltyRule1Internal(y,!0)+Jn.applyMaskPenaltyRule1Internal(y,!1)}static applyMaskPenaltyRule2(y){let E=0;const O=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let K=0;K<H-1;K++){const le=O[K];for(let ve=0;ve<$-1;ve++){const Te=le[ve];Te===le[ve+1]&&Te===O[K+1][ve]&&Te===O[K+1][ve+1]&&E++}}return Jn.N2*E}static applyMaskPenaltyRule3(y){let E=0;const O=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let K=0;K<H;K++)for(let le=0;le<$;le++){const ve=O[K];le+6<$&&ve[le]===1&&ve[le+1]===0&&ve[le+2]===1&&ve[le+3]===1&&ve[le+4]===1&&ve[le+5]===0&&ve[le+6]===1&&(Jn.isWhiteHorizontal(ve,le-4,le)||Jn.isWhiteHorizontal(ve,le+7,le+11))&&E++,K+6<H&&O[K][le]===1&&O[K+1][le]===0&&O[K+2][le]===1&&O[K+3][le]===1&&O[K+4][le]===1&&O[K+5][le]===0&&O[K+6][le]===1&&(Jn.isWhiteVertical(O,le,K-4,K)||Jn.isWhiteVertical(O,le,K+7,K+11))&&E++}return E*Jn.N3}static isWhiteHorizontal(y,E,O){E=Math.max(E,0),O=Math.min(O,y.length);for(let $=E;$<O;$++)if(y[$]===1)return!1;return!0}static isWhiteVertical(y,E,O,$){O=Math.max(O,0),$=Math.min($,y.length);for(let H=O;H<$;H++)if(y[H][E]===1)return!1;return!0}static applyMaskPenaltyRule4(y){let E=0;const O=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let ve=0;ve<H;ve++){const Te=O[ve];for(let Ze=0;Ze<$;Ze++)Te[Ze]===1&&E++}const K=y.getHeight()*y.getWidth();return Math.floor(Math.abs(E*2-K)*10/K)*Jn.N4}static getDataMaskBit(y,E,O){let $,H;switch(y){case 0:$=O+E&1;break;case 1:$=O&1;break;case 2:$=E%3;break;case 3:$=(O+E)%3;break;case 4:$=Math.floor(O/2)+Math.floor(E/3)&1;break;case 5:H=O*E,$=(H&1)+H%3;break;case 6:H=O*E,$=(H&1)+H%3&1;break;case 7:H=O*E,$=H%3+(O+E&1)&1;break;default:throw new f("Invalid mask pattern: "+y)}return $===0}static applyMaskPenaltyRule1Internal(y,E){let O=0;const $=E?y.getHeight():y.getWidth(),H=E?y.getWidth():y.getHeight(),K=y.getArray();for(let le=0;le<$;le++){let ve=0,Te=-1;for(let Ze=0;Ze<H;Ze++){const ht=E?K[le][Ze]:K[Ze][le];ht===Te?ve++:(ve>=5&&(O+=Jn.N1+(ve-5)),ve=1,Te=ht)}ve>=5&&(O+=Jn.N1+(ve-5))}return O}}Jn.N1=3,Jn.N2=3,Jn.N3=40,Jn.N4=10;class vs{constructor(y,E){this.width=y,this.height=E;const O=new Array(E);for(let $=0;$!==E;$++)O[$]=new Uint8Array(y);this.bytes=O}getHeight(){return this.height}getWidth(){return this.width}get(y,E){return this.bytes[E][y]}getArray(){return this.bytes}setNumber(y,E,O){this.bytes[E][y]=O}setBoolean(y,E,O){this.bytes[E][y]=O?1:0}clear(y){for(const E of this.bytes)I.fill(E,y)}equals(y){if(!(y instanceof vs))return!1;const E=y;if(this.width!==E.width||this.height!==E.height)return!1;for(let O=0,$=this.height;O<$;++O){const H=this.bytes[O],K=E.bytes[O];for(let le=0,ve=this.width;le<ve;++le)if(H[le]!==K[le])return!1}return!0}toString(){const y=new re;for(let E=0,O=this.height;E<O;++E){const $=this.bytes[E];for(let H=0,K=this.width;H<K;++H)switch($[H]){case 0:y.append(" 0");break;case 1:y.append(" 1");break;default:y.append(" ");break}y.append(`
`)}return y.toString()}}class si{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const y=new re;return y.append(`<<
`),y.append(" mode: "),y.append(this.mode?this.mode.toString():"null"),y.append(`
ecLevel: `),y.append(this.ecLevel?this.ecLevel.toString():"null"),y.append(`
version: `),y.append(this.version?this.version.toString():"null"),y.append(`
maskPattern: `),y.append(this.maskPattern.toString()),this.matrix?(y.append(`
matrix:
`),y.append(this.matrix.toString())):y.append(`
matrix: null
`),y.append(`>>
`),y.toString()}setMode(y){this.mode=y}setECLevel(y){this.ecLevel=y}setVersion(y){this.version=y}setMaskPattern(y){this.maskPattern=y}setMatrix(y){this.matrix=y}static isValidMaskPattern(y){return y>=0&&y<si.NUM_MASK_PATTERNS}}si.NUM_MASK_PATTERNS=8;class ni extends u{}ni.kind="WriterException";class Er{constructor(){}static clearMatrix(y){y.clear(255)}static buildMatrix(y,E,O,$,H){Er.clearMatrix(H),Er.embedBasicPatterns(O,H),Er.embedTypeInfo(E,$,H),Er.maybeEmbedVersionInfo(O,H),Er.embedDataBits(y,$,H)}static embedBasicPatterns(y,E){Er.embedPositionDetectionPatternsAndSeparators(E),Er.embedDarkDotAtLeftBottomCorner(E),Er.maybeEmbedPositionAdjustmentPatterns(y,E),Er.embedTimingPatterns(E)}static embedTypeInfo(y,E,O){const $=new R;Er.makeTypeInfoBits(y,E,$);for(let H=0,K=$.getSize();H<K;++H){const le=$.get($.getSize()-1-H),ve=Er.TYPE_INFO_COORDINATES[H],Te=ve[0],Ze=ve[1];if(O.setBoolean(Te,Ze,le),H<8){const ht=O.getWidth()-H-1;O.setBoolean(ht,8,le)}else{const Tt=O.getHeight()-7+(H-8);O.setBoolean(8,Tt,le)}}}static maybeEmbedVersionInfo(y,E){if(y.getVersionNumber()<7)return;const O=new R;Er.makeVersionInfoBits(y,O);let $=6*3-1;for(let H=0;H<6;++H)for(let K=0;K<3;++K){const le=O.get($);$--,E.setBoolean(H,E.getHeight()-11+K,le),E.setBoolean(E.getHeight()-11+K,H,le)}}static embedDataBits(y,E,O){let $=0,H=-1,K=O.getWidth()-1,le=O.getHeight()-1;for(;K>0;){for(K===6&&(K-=1);le>=0&&le<O.getHeight();){for(let ve=0;ve<2;++ve){const Te=K-ve;if(!Er.isEmpty(O.get(Te,le)))continue;let Ze;$<y.getSize()?(Ze=y.get($),++$):Ze=!1,E!==255&&Jn.getDataMaskBit(E,Te,le)&&(Ze=!Ze),O.setBoolean(Te,le,Ze)}le+=H}H=-H,le+=H,K-=2}if($!==y.getSize())throw new ni("Not all bits consumed: "+$+"/"+y.getSize())}static findMSBSet(y){return 32-P.numberOfLeadingZeros(y)}static calculateBCHCode(y,E){if(E===0)throw new f("0 polynomial");const O=Er.findMSBSet(E);for(y<<=O-1;Er.findMSBSet(y)>=O;)y^=E<<Er.findMSBSet(y)-O;return y}static makeTypeInfoBits(y,E,O){if(!si.isValidMaskPattern(E))throw new ni("Invalid mask pattern");const $=y.getBits()<<3|E;O.appendBits($,5);const H=Er.calculateBCHCode($,Er.TYPE_INFO_POLY);O.appendBits(H,10);const K=new R;if(K.appendBits(Er.TYPE_INFO_MASK_PATTERN,15),O.xor(K),O.getSize()!==15)throw new ni("should not happen but we got: "+O.getSize())}static makeVersionInfoBits(y,E){E.appendBits(y.getVersionNumber(),6);const O=Er.calculateBCHCode(y.getVersionNumber(),Er.VERSION_INFO_POLY);if(E.appendBits(O,12),E.getSize()!==18)throw new ni("should not happen but we got: "+E.getSize())}static isEmpty(y){return y===255}static embedTimingPatterns(y){for(let E=8;E<y.getWidth()-8;++E){const O=(E+1)%2;Er.isEmpty(y.get(E,6))&&y.setNumber(E,6,O),Er.isEmpty(y.get(6,E))&&y.setNumber(6,E,O)}}static embedDarkDotAtLeftBottomCorner(y){if(y.get(8,y.getHeight()-8)===0)throw new ni;y.setNumber(8,y.getHeight()-8,1)}static embedHorizontalSeparationPattern(y,E,O){for(let $=0;$<8;++$){if(!Er.isEmpty(O.get(y+$,E)))throw new ni;O.setNumber(y+$,E,0)}}static embedVerticalSeparationPattern(y,E,O){for(let $=0;$<7;++$){if(!Er.isEmpty(O.get(y,E+$)))throw new ni;O.setNumber(y,E+$,0)}}static embedPositionAdjustmentPattern(y,E,O){for(let $=0;$<5;++$){const H=Er.POSITION_ADJUSTMENT_PATTERN[$];for(let K=0;K<5;++K)O.setNumber(y+K,E+$,H[K])}}static embedPositionDetectionPattern(y,E,O){for(let $=0;$<7;++$){const H=Er.POSITION_DETECTION_PATTERN[$];for(let K=0;K<7;++K)O.setNumber(y+K,E+$,H[K])}}static embedPositionDetectionPatternsAndSeparators(y){const E=Er.POSITION_DETECTION_PATTERN[0].length;Er.embedPositionDetectionPattern(0,0,y),Er.embedPositionDetectionPattern(y.getWidth()-E,0,y),Er.embedPositionDetectionPattern(0,y.getWidth()-E,y);const O=8;Er.embedHorizontalSeparationPattern(0,O-1,y),Er.embedHorizontalSeparationPattern(y.getWidth()-O,O-1,y),Er.embedHorizontalSeparationPattern(0,y.getWidth()-O,y);const $=7;Er.embedVerticalSeparationPattern($,0,y),Er.embedVerticalSeparationPattern(y.getHeight()-$-1,0,y),Er.embedVerticalSeparationPattern($,y.getHeight()-$,y)}static maybeEmbedPositionAdjustmentPatterns(y,E){if(y.getVersionNumber()<2)return;const O=y.getVersionNumber()-1,$=Er.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[O];for(let H=0,K=$.length;H!==K;H++){const le=$[H];if(le>=0)for(let ve=0;ve!==K;ve++){const Te=$[ve];Te>=0&&Er.isEmpty(E.get(Te,le))&&Er.embedPositionAdjustmentPattern(Te-2,le-2,E)}}}}Er.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),Er.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),Er.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),Er.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),Er.VERSION_INFO_POLY=7973,Er.TYPE_INFO_POLY=1335,Er.TYPE_INFO_MASK_PATTERN=21522;class Sn{constructor(y,E){this.dataBytes=y,this.errorCorrectionBytes=E}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Mn{constructor(){}static calculateMaskPenalty(y){return Jn.applyMaskPenaltyRule1(y)+Jn.applyMaskPenaltyRule2(y)+Jn.applyMaskPenaltyRule3(y)+Jn.applyMaskPenaltyRule4(y)}static encode(y,E,O=null){let $=Mn.DEFAULT_BYTE_MODE_ENCODING;const H=O!==null&&O.get(Or.CHARACTER_SET)!==void 0;H&&($=O.get(Or.CHARACTER_SET).toString());const K=this.chooseMode(y,$),le=new R;if(K===We.BYTE&&(H||Mn.DEFAULT_BYTE_MODE_ENCODING!==$)){const br=Q.getCharacterSetECIByName($);br!==void 0&&this.appendECI(br,le)}this.appendModeInfo(K,le);const ve=new R;this.appendBytes(y,K,ve,$);let Te;if(O!==null&&O.get(Or.QR_VERSION)!==void 0){const br=Number.parseInt(O.get(Or.QR_VERSION).toString(),10);Te=nt.getVersionForNumber(br);const wr=this.calculateBitsNeeded(K,le,ve,Te);if(!this.willFit(wr,Te,E))throw new ni("Data too big for requested version")}else Te=this.recommendVersion(E,K,le,ve);const Ze=new R;Ze.appendBitArray(le);const ht=K===We.BYTE?ve.getSizeInBytes():y.length;this.appendLengthInfo(ht,Te,K,Ze),Ze.appendBitArray(ve);const Tt=Te.getECBlocksForLevel(E),tn=Te.getTotalCodewords()-Tt.getTotalECCodewords();this.terminateBits(tn,Ze);const vt=this.interleaveWithECBytes(Ze,Te.getTotalCodewords(),tn,Tt.getNumBlocks()),$t=new si;$t.setECLevel(E),$t.setMode(K),$t.setVersion(Te);const Kt=Te.getDimensionForVersion(),_n=new vs(Kt,Kt),ur=this.chooseMaskPattern(vt,E,Te,_n);return $t.setMaskPattern(ur),Er.buildMatrix(vt,E,Te,ur,_n),$t.setMatrix(_n),$t}static recommendVersion(y,E,O,$){const H=this.calculateBitsNeeded(E,O,$,nt.getVersionForNumber(1)),K=this.chooseVersion(H,y),le=this.calculateBitsNeeded(E,O,$,K);return this.chooseVersion(le,y)}static calculateBitsNeeded(y,E,O,$){return E.getSize()+y.getCharacterCountBits($)+O.getSize()}static getAlphanumericCode(y){return y<Mn.ALPHANUMERIC_TABLE.length?Mn.ALPHANUMERIC_TABLE[y]:-1}static chooseMode(y,E=null){if(Q.SJIS.getName()===E&&this.isOnlyDoubleByteKanji(y))return We.KANJI;let O=!1,$=!1;for(let H=0,K=y.length;H<K;++H){const le=y.charAt(H);if(Mn.isDigit(le))O=!0;else if(this.getAlphanumericCode(le.charCodeAt(0))!==-1)$=!0;else return We.BYTE}return $?We.ALPHANUMERIC:O?We.NUMERIC:We.BYTE}static isOnlyDoubleByteKanji(y){let E;try{E=J.encode(y,Q.SJIS)}catch{return!1}const O=E.length;if(O%2!==0)return!1;for(let $=0;$<O;$+=2){const H=E[$]&255;if((H<129||H>159)&&(H<224||H>235))return!1}return!0}static chooseMaskPattern(y,E,O,$){let H=Number.MAX_SAFE_INTEGER,K=-1;for(let le=0;le<si.NUM_MASK_PATTERNS;le++){Er.buildMatrix(y,E,O,le,$);let ve=this.calculateMaskPenalty($);ve<H&&(H=ve,K=le)}return K}static chooseVersion(y,E){for(let O=1;O<=40;O++){const $=nt.getVersionForNumber(O);if(Mn.willFit(y,$,E))return $}throw new ni("Data too big")}static willFit(y,E,O){const $=E.getTotalCodewords(),K=E.getECBlocksForLevel(O).getTotalECCodewords(),le=$-K,ve=(y+7)/8;return le>=ve}static terminateBits(y,E){const O=y*8;if(E.getSize()>O)throw new ni("data bits cannot fit in the QR Code"+E.getSize()+" > "+O);for(let K=0;K<4&&E.getSize()<O;++K)E.appendBit(!1);const $=E.getSize()&7;if($>0)for(let K=$;K<8;K++)E.appendBit(!1);const H=y-E.getSizeInBytes();for(let K=0;K<H;++K)E.appendBits(K&1?17:236,8);if(E.getSize()!==O)throw new ni("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(y,E,O,$,H,K){if($>=O)throw new ni("Block ID too large");const le=y%O,ve=O-le,Te=Math.floor(y/O),Ze=Te+1,ht=Math.floor(E/O),Tt=ht+1,tn=Te-ht,vt=Ze-Tt;if(tn!==vt)throw new ni("EC bytes mismatch");if(O!==ve+le)throw new ni("RS blocks mismatch");if(y!==(ht+tn)*ve+(Tt+vt)*le)throw new ni("Total bytes mismatch");$<ve?(H[0]=ht,K[0]=tn):(H[0]=Tt,K[0]=vt)}static interleaveWithECBytes(y,E,O,$){if(y.getSizeInBytes()!==O)throw new ni("Number of bits and data bytes does not match");let H=0,K=0,le=0;const ve=new Array;for(let Ze=0;Ze<$;++Ze){const ht=new Int32Array(1),Tt=new Int32Array(1);Mn.getNumDataBytesAndNumECBytesForBlockID(E,O,$,Ze,ht,Tt);const tn=ht[0],vt=new Uint8Array(tn);y.toBytes(8*H,vt,0,tn);const $t=Mn.generateECBytes(vt,Tt[0]);ve.push(new Sn(vt,$t)),K=Math.max(K,tn),le=Math.max(le,$t.length),H+=ht[0]}if(O!==H)throw new ni("Data bytes does not match offset");const Te=new R;for(let Ze=0;Ze<K;++Ze)for(const ht of ve){const Tt=ht.getDataBytes();Ze<Tt.length&&Te.appendBits(Tt[Ze],8)}for(let Ze=0;Ze<le;++Ze)for(const ht of ve){const Tt=ht.getErrorCorrectionBytes();Ze<Tt.length&&Te.appendBits(Tt[Ze],8)}if(E!==Te.getSizeInBytes())throw new ni("Interleaving error: "+E+" and "+Te.getSizeInBytes()+" differ.");return Te}static generateECBytes(y,E){const O=y.length,$=new Int32Array(O+E);for(let K=0;K<O;K++)$[K]=y[K]&255;new hr(it.QR_CODE_FIELD_256).encode($,E);const H=new Uint8Array(E);for(let K=0;K<E;K++)H[K]=$[O+K];return H}static appendModeInfo(y,E){E.appendBits(y.getBits(),4)}static appendLengthInfo(y,E,O,$){const H=O.getCharacterCountBits(E);if(y>=1<<H)throw new ni(y+" is bigger than "+((1<<H)-1));$.appendBits(y,H)}static appendBytes(y,E,O,$){switch(E){case We.NUMERIC:Mn.appendNumericBytes(y,O);break;case We.ALPHANUMERIC:Mn.appendAlphanumericBytes(y,O);break;case We.BYTE:Mn.append8BitBytes(y,O,$);break;case We.KANJI:Mn.appendKanjiBytes(y,O);break;default:throw new ni("Invalid mode: "+E)}}static getDigit(y){return y.charCodeAt(0)-48}static isDigit(y){const E=Mn.getDigit(y);return E>=0&&E<=9}static appendNumericBytes(y,E){const O=y.length;let $=0;for(;$<O;){const H=Mn.getDigit(y.charAt($));if($+2<O){const K=Mn.getDigit(y.charAt($+1)),le=Mn.getDigit(y.charAt($+2));E.appendBits(H*100+K*10+le,10),$+=3}else if($+1<O){const K=Mn.getDigit(y.charAt($+1));E.appendBits(H*10+K,7),$+=2}else E.appendBits(H,4),$++}}static appendAlphanumericBytes(y,E){const O=y.length;let $=0;for(;$<O;){const H=Mn.getAlphanumericCode(y.charCodeAt($));if(H===-1)throw new ni;if($+1<O){const K=Mn.getAlphanumericCode(y.charCodeAt($+1));if(K===-1)throw new ni;E.appendBits(H*45+K,11),$+=2}else E.appendBits(H,6),$++}}static append8BitBytes(y,E,O){let $;try{$=J.encode(y,O)}catch(H){throw new ni(H)}for(let H=0,K=$.length;H!==K;H++){const le=$[H];E.appendBits(le,8)}}static appendKanjiBytes(y,E){let O;try{O=J.encode(y,Q.SJIS)}catch(H){throw new ni(H)}const $=O.length;for(let H=0;H<$;H+=2){const K=O[H]&255,le=O[H+1]&255,ve=K<<8&4294967295|le;let Te=-1;if(ve>=33088&&ve<=40956?Te=ve-33088:ve>=57408&&ve<=60351&&(Te=ve-49472),Te===-1)throw new ni("Invalid byte sequence");const Ze=(Te>>8)*192+(Te&255);E.appendBits(Ze,13)}}static appendECI(y,E){E.appendBits(We.ECI.getBits(),4),E.appendBits(y.getValue(),8)}}Mn.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Mn.DEFAULT_BYTE_MODE_ENCODING=Q.UTF8.getName();class at{write(y,E,O,$=null){if(y.length===0)throw new f("Found empty contents");if(E<0||O<0)throw new f("Requested dimensions are too small: "+E+"x"+O);let H=Se.L,K=at.QUIET_ZONE_SIZE;$!==null&&($.get(Or.ERROR_CORRECTION)!==void 0&&(H=Se.fromString($.get(Or.ERROR_CORRECTION).toString())),$.get(Or.MARGIN)!==void 0&&(K=Number.parseInt($.get(Or.MARGIN).toString(),10)));const le=Mn.encode(y,H,$);return this.renderResult(le,E,O,K)}writeToDom(y,E,O,$,H=null){typeof y=="string"&&(y=document.querySelector(y));const K=this.write(E,O,$,H);y&&y.appendChild(K)}renderResult(y,E,O,$){const H=y.getMatrix();if(H===null)throw new ot;const K=H.getWidth(),le=H.getHeight(),ve=K+$*2,Te=le+$*2,Ze=Math.max(E,ve),ht=Math.max(O,Te),Tt=Math.min(Math.floor(Ze/ve),Math.floor(ht/Te)),tn=Math.floor((Ze-K*Tt)/2),vt=Math.floor((ht-le*Tt)/2),$t=this.createSVGElement(Ze,ht);for(let Kt=0,_n=vt;Kt<le;Kt++,_n+=Tt)for(let ur=0,br=tn;ur<K;ur++,br+=Tt)if(H.get(ur,Kt)===1){const wr=this.createSvgRectElement(br,_n,Tt,Tt);$t.appendChild(wr)}return $t}createSVGElement(y,E){const O=document.createElementNS(at.SVG_NS,"svg");return O.setAttributeNS(null,"height",y.toString()),O.setAttributeNS(null,"width",E.toString()),O}createSvgRectElement(y,E,O,$){const H=document.createElementNS(at.SVG_NS,"rect");return H.setAttributeNS(null,"x",y.toString()),H.setAttributeNS(null,"y",E.toString()),H.setAttributeNS(null,"height",O.toString()),H.setAttributeNS(null,"width",$.toString()),H.setAttributeNS(null,"fill","#000000"),H}}at.QUIET_ZONE_SIZE=4,at.SVG_NS="http://www.w3.org/2000/svg";class zt{encode(y,E,O,$,H){if(y.length===0)throw new f("Found empty contents");if(E!==Ae.QR_CODE)throw new f("Can only encode QR_CODE, but got "+E);if(O<0||$<0)throw new f(`Requested dimensions are too small: ${O}x${$}`);let K=Se.L,le=zt.QUIET_ZONE_SIZE;H!==null&&(H.get(Or.ERROR_CORRECTION)!==void 0&&(K=Se.fromString(H.get(Or.ERROR_CORRECTION).toString())),H.get(Or.MARGIN)!==void 0&&(le=Number.parseInt(H.get(Or.MARGIN).toString(),10)));const ve=Mn.encode(y,K,H);return zt.renderResult(ve,O,$,le)}static renderResult(y,E,O,$){const H=y.getMatrix();if(H===null)throw new ot;const K=H.getWidth(),le=H.getHeight(),ve=K+$*2,Te=le+$*2,Ze=Math.max(E,ve),ht=Math.max(O,Te),Tt=Math.min(Math.floor(Ze/ve),Math.floor(ht/Te)),tn=Math.floor((Ze-K*Tt)/2),vt=Math.floor((ht-le*Tt)/2),$t=new pe(Ze,ht);for(let Kt=0,_n=vt;Kt<le;Kt++,_n+=Tt)for(let ur=0,br=tn;ur<K;ur++,br+=Tt)H.get(ur,Kt)===1&&$t.setRegion(br,_n,Tt,Tt);return $t}}zt.QUIET_ZONE_SIZE=4;class er{encode(y,E,O,$,H){let K;switch(E){case Ae.QR_CODE:K=new zt;break;default:throw new f("No encoder available for format "+E)}return K.encode(y,E,O,$,H)}}class qn extends G{constructor(y,E,O,$,H,K,le,ve){if(super(K,le),this.yuvData=y,this.dataWidth=E,this.dataHeight=O,this.left=$,this.top=H,$+K>E||H+le>O)throw new f("Crop rectangle does not fit within image data.");ve&&this.reverseHorizontal(K,le)}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const O=this.getWidth();(E==null||E.length<O)&&(E=new Uint8ClampedArray(O));const $=(y+this.top)*this.dataWidth+this.left;return w.arraycopy(this.yuvData,$,E,0,O),E}getMatrix(){const y=this.getWidth(),E=this.getHeight();if(y===this.dataWidth&&E===this.dataHeight)return this.yuvData;const O=y*E,$=new Uint8ClampedArray(O);let H=this.top*this.dataWidth+this.left;if(y===this.dataWidth)return w.arraycopy(this.yuvData,H,$,0,O),$;for(let K=0;K<E;K++){const le=K*y;w.arraycopy(this.yuvData,H,$,le,y),H+=this.dataWidth}return $}isCropSupported(){return!0}crop(y,E,O,$){return new qn(this.yuvData,this.dataWidth,this.dataHeight,this.left+y,this.top+E,O,$,!1)}renderThumbnail(){const y=this.getWidth()/qn.THUMBNAIL_SCALE_FACTOR,E=this.getHeight()/qn.THUMBNAIL_SCALE_FACTOR,O=new Int32Array(y*E),$=this.yuvData;let H=this.top*this.dataWidth+this.left;for(let K=0;K<E;K++){const le=K*y;for(let ve=0;ve<y;ve++){const Te=$[H+ve*qn.THUMBNAIL_SCALE_FACTOR]&255;O[le+ve]=4278190080|Te*65793}H+=this.dataWidth*qn.THUMBNAIL_SCALE_FACTOR}return O}getThumbnailWidth(){return this.getWidth()/qn.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/qn.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(y,E){const O=this.yuvData;for(let $=0,H=this.top*this.dataWidth+this.left;$<E;$++,H+=this.dataWidth){const K=H+y/2;for(let le=H,ve=H+y-1;le<K;le++,ve--){const Te=O[le];O[le]=O[ve],O[ve]=Te}}}invert(){return new V(this)}}qn.THUMBNAIL_SCALE_FACTOR=2;class kr extends G{constructor(y,E,O,$,H,K,le){if(super(E,O),this.dataWidth=$,this.dataHeight=H,this.left=K,this.top=le,y.BYTES_PER_ELEMENT===4){const ve=E*O,Te=new Uint8ClampedArray(ve);for(let Ze=0;Ze<ve;Ze++){const ht=y[Ze],Tt=ht>>16&255,tn=ht>>7&510,vt=ht&255;Te[Ze]=(Tt+tn+vt)/4&255}this.luminances=Te}else this.luminances=y;if($===void 0&&(this.dataWidth=E),H===void 0&&(this.dataHeight=O),K===void 0&&(this.left=0),le===void 0&&(this.top=0),this.left+E>this.dataWidth||this.top+O>this.dataHeight)throw new f("Crop rectangle does not fit within image data.")}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const O=this.getWidth();(E==null||E.length<O)&&(E=new Uint8ClampedArray(O));const $=(y+this.top)*this.dataWidth+this.left;return w.arraycopy(this.luminances,$,E,0,O),E}getMatrix(){const y=this.getWidth(),E=this.getHeight();if(y===this.dataWidth&&E===this.dataHeight)return this.luminances;const O=y*E,$=new Uint8ClampedArray(O);let H=this.top*this.dataWidth+this.left;if(y===this.dataWidth)return w.arraycopy(this.luminances,H,$,0,O),$;for(let K=0;K<E;K++){const le=K*y;w.arraycopy(this.luminances,H,$,le,y),H+=this.dataWidth}return $}isCropSupported(){return!0}crop(y,E,O,$){return new kr(this.luminances,O,$,this.dataWidth,this.dataHeight,this.left+y,this.top+E)}invert(){return new V(this)}}class Ar extends Q{static forName(y){return this.getCharacterSetECIByName(y)}}class Zr{}Zr.ISO_8859_1=Q.ISO8859_1;class Fs{isCompact(){return this.compact}setCompact(y){this.compact=y}getSize(){return this.size}setSize(y){this.size=y}getLayers(){return this.layers}setLayers(y){this.layers=y}getCodeWords(){return this.codeWords}setCodeWords(y){this.codeWords=y}getMatrix(){return this.matrix}setMatrix(y){this.matrix=y}}class St{static singletonList(y){return[y]}static min(y,E){return y.sort(E)[0]}}class sr{constructor(y){this.previous=y}getPrevious(){return this.previous}}class Hn extends sr{constructor(y,E,O){super(y),this.value=E,this.bitCount=O}appendTo(y,E){y.appendBits(this.value,this.bitCount)}add(y,E){return new Hn(this,y,E)}addBinaryShift(y,E){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Hn(this,y,E)}toString(){let y=this.value&(1<<this.bitCount)-1;return y|=1<<this.bitCount,"<"+P.toBinaryString(y|1<<this.bitCount).substring(1)+">"}}class zr extends Hn{constructor(y,E,O){super(y,0,0),this.binaryShiftStart=E,this.binaryShiftByteCount=O}appendTo(y,E){for(let O=0;O<this.binaryShiftByteCount;O++)(O===0||O===31&&this.binaryShiftByteCount<=62)&&(y.appendBits(31,5),this.binaryShiftByteCount>62?y.appendBits(this.binaryShiftByteCount-31,16):O===0?y.appendBits(Math.min(this.binaryShiftByteCount,31),5):y.appendBits(this.binaryShiftByteCount-31,5)),y.appendBits(E[this.binaryShiftStart+O],8)}addBinaryShift(y,E){return new zr(this,y,E)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function as(dt,y,E){return new zr(dt,y,E)}function rs(dt,y,E){return new Hn(dt,y,E)}const hs=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],ps=0,Bi=1,Ls=2,xs=3,jr=4,ga=new Hn(null,0,0),El=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function _l(dt){for(let y of dt)I.fill(y,-1);return dt[ps][jr]=0,dt[Bi][jr]=0,dt[Bi][ps]=28,dt[xs][jr]=0,dt[Ls][jr]=0,dt[Ls][ps]=15,dt}const Bu=_l(I.createInt32Array(6,6));class ba{constructor(y,E,O,$){this.token=y,this.mode=E,this.binaryShiftByteCount=O,this.bitCount=$}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(y,E){let O=this.bitCount,$=this.token;if(y!==this.mode){let K=El[this.mode][y];$=rs($,K&65535,K>>16),O+=K>>16}let H=y===Ls?4:5;return $=rs($,E,H),new ba($,y,0,O+H)}shiftAndAppend(y,E){let O=this.token,$=this.mode===Ls?4:5;return O=rs(O,Bu[this.mode][y],$),O=rs(O,E,5),new ba(O,this.mode,0,this.bitCount+$+5)}addBinaryShiftChar(y){let E=this.token,O=this.mode,$=this.bitCount;if(this.mode===jr||this.mode===Ls){let le=El[O][ps];E=rs(E,le&65535,le>>16),$+=le>>16,O=ps}let H=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,K=new ba(E,O,this.binaryShiftByteCount+1,$+H);return K.binaryShiftByteCount===2078&&(K=K.endBinaryShift(y+1)),K}endBinaryShift(y){if(this.binaryShiftByteCount===0)return this;let E=this.token;return E=as(E,y-this.binaryShiftByteCount,this.binaryShiftByteCount),new ba(E,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(y){let E=this.bitCount+(El[this.mode][y.mode]>>16);return this.binaryShiftByteCount<y.binaryShiftByteCount?E+=ba.calculateBinaryShiftCost(y)-ba.calculateBinaryShiftCost(this):this.binaryShiftByteCount>y.binaryShiftByteCount&&y.binaryShiftByteCount>0&&(E+=10),E<=y.bitCount}toBitArray(y){let E=[];for(let $=this.endBinaryShift(y.length).token;$!==null;$=$.getPrevious())E.unshift($);let O=new R;for(const $ of E)$.appendTo(O,y);return O}toString(){return X.format("%s bits=%d bytes=%d",hs[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(y){return y.binaryShiftByteCount>62?21:y.binaryShiftByteCount>31?20:y.binaryShiftByteCount>0?10:0}}ba.INITIAL_STATE=new ba(ga,ps,0,0);function kl(dt){const y=X.getCharCode(" "),E=X.getCharCode("."),O=X.getCharCode(",");dt[ps][y]=1;const $=X.getCharCode("Z"),H=X.getCharCode("A");for(let Tt=H;Tt<=$;Tt++)dt[ps][Tt]=Tt-H+2;dt[Bi][y]=1;const K=X.getCharCode("z"),le=X.getCharCode("a");for(let Tt=le;Tt<=K;Tt++)dt[Bi][Tt]=Tt-le+2;dt[Ls][y]=1;const ve=X.getCharCode("9"),Te=X.getCharCode("0");for(let Tt=Te;Tt<=ve;Tt++)dt[Ls][Tt]=Tt-Te+2;dt[Ls][O]=12,dt[Ls][E]=13;const Ze=["\0"," ","","","","","","","\x07","\b"," ",`
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let Tt=0;Tt<Ze.length;Tt++)dt[xs][X.getCharCode(Ze[Tt])]=Tt;const ht=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let Tt=0;Tt<ht.length;Tt++)X.getCharCode(ht[Tt])>0&&(dt[jr][X.getCharCode(ht[Tt])]=Tt);return dt}const px=kl(I.createInt32Array(5,256));class $u{constructor(y){this.text=y}encode(){const y=X.getCharCode(" "),E=X.getCharCode(`
`);let O=St.singletonList(ba.INITIAL_STATE);for(let H=0;H<this.text.length;H++){let K,le=H+1<this.text.length?this.text[H+1]:0;switch(this.text[H]){case X.getCharCode("\r"):K=le===E?2:0;break;case X.getCharCode("."):K=le===y?3:0;break;case X.getCharCode(","):K=le===y?4:0;break;case X.getCharCode(":"):K=le===y?5:0;break;default:K=0}K>0?(O=$u.updateStateListForPair(O,H,K),H++):O=this.updateStateListForChar(O,H)}return St.min(O,(H,K)=>H.getBitCount()-K.getBitCount()).toBitArray(this.text)}updateStateListForChar(y,E){const O=[];for(let $ of y)this.updateStateForChar($,E,O);return $u.simplifyStates(O)}updateStateForChar(y,E,O){let $=this.text[E]&255,H=px[y.getMode()][$]>0,K=null;for(let le=0;le<=jr;le++){let ve=px[le][$];if(ve>0){if(K==null&&(K=y.endBinaryShift(E)),!H||le===y.getMode()||le===Ls){const Te=K.latchAndAppend(le,ve);O.push(Te)}if(!H&&Bu[y.getMode()][le]>=0){const Te=K.shiftAndAppend(le,ve);O.push(Te)}}}if(y.getBinaryShiftByteCount()>0||px[y.getMode()][$]===0){let le=y.addBinaryShiftChar(E);O.push(le)}}static updateStateListForPair(y,E,O){const $=[];for(let H of y)this.updateStateForPair(H,E,O,$);return this.simplifyStates($)}static updateStateForPair(y,E,O,$){let H=y.endBinaryShift(E);if($.push(H.latchAndAppend(jr,O)),y.getMode()!==jr&&$.push(H.shiftAndAppend(jr,O)),O===3||O===4){let K=H.latchAndAppend(Ls,16-O).latchAndAppend(Ls,1);$.push(K)}if(y.getBinaryShiftByteCount()>0){let K=y.addBinaryShiftChar(E).addBinaryShiftChar(E+1);$.push(K)}}static simplifyStates(y){let E=[];for(const O of y){let $=!0;for(const H of E){if(H.isBetterThanOrEqualTo(O)){$=!1;break}O.isBetterThanOrEqualTo(H)&&(E=E.filter(K=>K!==H))}$&&E.push(O)}return E}}class xi{constructor(){}static encodeBytes(y){return xi.encode(y,xi.DEFAULT_EC_PERCENT,xi.DEFAULT_AZTEC_LAYERS)}static encode(y,E,O){let $=new $u(y).encode(),H=P.truncDivision($.getSize()*E,100)+11,K=$.getSize()+H,le,ve,Te,Ze,ht;if(O!==xi.DEFAULT_AZTEC_LAYERS){if(le=O<0,ve=Math.abs(O),ve>(le?xi.MAX_NB_BITS_COMPACT:xi.MAX_NB_BITS))throw new f(X.format("Illegal value %s for layers",O));Te=xi.totalBitsInLayer(ve,le),Ze=xi.WORD_SIZE[ve];let wr=Te-Te%Ze;if(ht=xi.stuffBits($,Ze),ht.getSize()+H>wr)throw new f("Data to large for user specified layer");if(le&&ht.getSize()>Ze*64)throw new f("Data to large for user specified layer")}else{Ze=0,ht=null;for(let wr=0;;wr++){if(wr>xi.MAX_NB_BITS)throw new f("Data too large for an Aztec code");if(le=wr<=3,ve=le?wr+1:wr,Te=xi.totalBitsInLayer(ve,le),K>Te)continue;(ht==null||Ze!==xi.WORD_SIZE[ve])&&(Ze=xi.WORD_SIZE[ve],ht=xi.stuffBits($,Ze));let ws=Te-Te%Ze;if(!(le&&ht.getSize()>Ze*64)&&ht.getSize()+H<=ws)break}}let Tt=xi.generateCheckWords(ht,Te,Ze),tn=ht.getSize()/Ze,vt=xi.generateModeMessage(le,ve,tn),$t=(le?11:14)+ve*4,Kt=new Int32Array($t),_n;if(le){_n=$t;for(let wr=0;wr<Kt.length;wr++)Kt[wr]=wr}else{_n=$t+1+2*P.truncDivision(P.truncDivision($t,2)-1,15);let wr=P.truncDivision($t,2),ws=P.truncDivision(_n,2);for(let Ks=0;Ks<wr;Ks++){let uc=Ks+P.truncDivision(Ks,15);Kt[wr-Ks-1]=ws-uc-1,Kt[wr+Ks]=ws+uc+1}}let ur=new pe(_n);for(let wr=0,ws=0;wr<ve;wr++){let Ks=(ve-wr)*4+(le?9:12);for(let uc=0;uc<Ks;uc++){let Za=uc*2;for(let Ja=0;Ja<2;Ja++)Tt.get(ws+Za+Ja)&&ur.set(Kt[wr*2+Ja],Kt[wr*2+uc]),Tt.get(ws+Ks*2+Za+Ja)&&ur.set(Kt[wr*2+uc],Kt[$t-1-wr*2-Ja]),Tt.get(ws+Ks*4+Za+Ja)&&ur.set(Kt[$t-1-wr*2-Ja],Kt[$t-1-wr*2-uc]),Tt.get(ws+Ks*6+Za+Ja)&&ur.set(Kt[$t-1-wr*2-uc],Kt[wr*2+Ja])}ws+=Ks*8}if(xi.drawModeMessage(ur,le,_n,vt),le)xi.drawBullsEye(ur,P.truncDivision(_n,2),5);else{xi.drawBullsEye(ur,P.truncDivision(_n,2),7);for(let wr=0,ws=0;wr<P.truncDivision($t,2)-1;wr+=15,ws+=16)for(let Ks=P.truncDivision(_n,2)&1;Ks<_n;Ks+=2)ur.set(P.truncDivision(_n,2)-ws,Ks),ur.set(P.truncDivision(_n,2)+ws,Ks),ur.set(Ks,P.truncDivision(_n,2)-ws),ur.set(Ks,P.truncDivision(_n,2)+ws)}let br=new Fs;return br.setCompact(le),br.setSize(_n),br.setLayers(ve),br.setCodeWords(tn),br.setMatrix(ur),br}static drawBullsEye(y,E,O){for(let $=0;$<O;$+=2)for(let H=E-$;H<=E+$;H++)y.set(H,E-$),y.set(H,E+$),y.set(E-$,H),y.set(E+$,H);y.set(E-O,E-O),y.set(E-O+1,E-O),y.set(E-O,E-O+1),y.set(E+O,E-O),y.set(E+O,E-O+1),y.set(E+O,E+O-1)}static generateModeMessage(y,E,O){let $=new R;return y?($.appendBits(E-1,2),$.appendBits(O-1,6),$=xi.generateCheckWords($,28,4)):($.appendBits(E-1,5),$.appendBits(O-1,11),$=xi.generateCheckWords($,40,4)),$}static drawModeMessage(y,E,O,$){let H=P.truncDivision(O,2);if(E)for(let K=0;K<7;K++){let le=H-3+K;$.get(K)&&y.set(le,H-5),$.get(K+7)&&y.set(H+5,le),$.get(20-K)&&y.set(le,H+5),$.get(27-K)&&y.set(H-5,le)}else for(let K=0;K<10;K++){let le=H-5+K+P.truncDivision(K,5);$.get(K)&&y.set(le,H-7),$.get(K+10)&&y.set(H+7,le),$.get(29-K)&&y.set(le,H+7),$.get(39-K)&&y.set(H-7,le)}}static generateCheckWords(y,E,O){let $=y.getSize()/O,H=new hr(xi.getGF(O)),K=P.truncDivision(E,O),le=xi.bitsToWords(y,O,K);H.encode(le,K-$);let ve=E%O,Te=new R;Te.appendBits(0,ve);for(const Ze of Array.from(le))Te.appendBits(Ze,O);return Te}static bitsToWords(y,E,O){let $=new Int32Array(O),H,K;for(H=0,K=y.getSize()/E;H<K;H++){let le=0;for(let ve=0;ve<E;ve++)le|=y.get(H*E+ve)?1<<E-ve-1:0;$[H]=le}return $}static getGF(y){switch(y){case 4:return it.AZTEC_PARAM;case 6:return it.AZTEC_DATA_6;case 8:return it.AZTEC_DATA_8;case 10:return it.AZTEC_DATA_10;case 12:return it.AZTEC_DATA_12;default:throw new f("Unsupported word size "+y)}}static stuffBits(y,E){let O=new R,$=y.getSize(),H=(1<<E)-2;for(let K=0;K<$;K+=E){let le=0;for(let ve=0;ve<E;ve++)(K+ve>=$||y.get(K+ve))&&(le|=1<<E-1-ve);(le&H)===H?(O.appendBits(le&H,E),K--):le&H?O.appendBits(le,E):(O.appendBits(le|1,E),K--)}return O}static totalBitsInLayer(y,E){return((E?88:112)+16*y)*y}}xi.DEFAULT_EC_PERCENT=33,xi.DEFAULT_AZTEC_LAYERS=0,xi.MAX_NB_BITS=32,xi.MAX_NB_BITS_COMPACT=4,xi.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class yd{encode(y,E,O,$){return this.encodeWithHints(y,E,O,$,null)}encodeWithHints(y,E,O,$,H){let K=Zr.ISO_8859_1,le=xi.DEFAULT_EC_PERCENT,ve=xi.DEFAULT_AZTEC_LAYERS;return H!=null&&(H.has(Or.CHARACTER_SET)&&(K=Ar.forName(H.get(Or.CHARACTER_SET).toString())),H.has(Or.ERROR_CORRECTION)&&(le=P.parseInt(H.get(Or.ERROR_CORRECTION).toString())),H.has(Or.AZTEC_LAYERS)&&(ve=P.parseInt(H.get(Or.AZTEC_LAYERS).toString()))),yd.encodeLayers(y,E,O,$,K,le,ve)}static encodeLayers(y,E,O,$,H,K,le){if(E!==Ae.AZTEC)throw new f("Can only encode AZTEC, but got "+E);let ve=xi.encode(X.getBytes(y,H),K,le);return yd.renderResult(ve,O,$)}static renderResult(y,E,O){let $=y.getMatrix();if($==null)throw new ot;let H=$.getWidth(),K=$.getHeight(),le=Math.max(E,H),ve=Math.max(O,K),Te=Math.min(le/H,ve/K),Ze=(le-H*Te)/2,ht=(ve-K*Te)/2,Tt=new pe(le,ve);for(let tn=0,vt=ht;tn<K;tn++,vt+=Te)for(let $t=0,Kt=Ze;$t<H;$t++,Kt+=Te)$.get($t,tn)&&Tt.setRegion(Kt,vt,Te,Te);return Tt}}n.AbstractExpandedDecoder=yn,n.ArgumentException=d,n.ArithmeticException=$e,n.AztecCode=Fs,n.AztecCodeReader=en,n.AztecCodeWriter=yd,n.AztecDecoder=Vt,n.AztecDetector=pt,n.AztecDetectorResult=dn,n.AztecEncoder=xi,n.AztecHighLevelEncoder=$u,n.AztecPoint=Ke,n.BarcodeFormat=Ae,n.Binarizer=v,n.BinaryBitmap=x,n.BitArray=R,n.BitMatrix=pe,n.BitSource=xe,n.BrowserAztecCodeReader=Bt,n.BrowserBarcodeReader=T,n.BrowserCodeReader=Ce,n.BrowserDatamatrixCodeReader=st,n.BrowserMultiFormatReader=fr,n.BrowserPDF417Reader=cr,n.BrowserQRCodeReader=ts,n.BrowserQRCodeSvgWriter=at,n.CharacterSetECI=Q,n.ChecksumException=g,n.Code128Reader=et,n.Code39Reader=Be,n.DataMatrixDecodedBitStreamParser=ke,n.DataMatrixReader=Fe,n.DecodeHintType=U,n.DecoderResult=Ie,n.DefaultGridSampler=Lt,n.DetectorResult=mn,n.EAN13Reader=xn,n.EncodeHintType=Or,n.Exception=u,n.FormatException=L,n.GenericGF=it,n.GenericGFPoly=Qe,n.GlobalHistogramBinarizer=ie,n.GridSampler=Xe,n.GridSamplerInstance=qe,n.HTMLCanvasElementLuminanceSource=te,n.HybridBinarizer=oe,n.ITFReader=Mt,n.IllegalArgumentException=f,n.IllegalStateException=ot,n.InvertedLuminanceSource=V,n.LuminanceSource=G,n.MathUtils=It,n.MultiFormatOneDReader=k,n.MultiFormatReader=Nr,n.MultiFormatWriter=er,n.NotFoundException=Y,n.OneDReader=Et,n.PDF417DecodedBitStreamParser=yt,n.PDF417DecoderErrorCorrection=Fr,n.PDF417Reader=vn,n.PDF417ResultMetadata=Yr,n.PerspectiveTransform=Ut,n.PlanarYUVLuminanceSource=qn,n.QRCodeByteMatrix=vs,n.QRCodeDataMask=bt,n.QRCodeDecodedBitStreamParser=wt,n.QRCodeDecoderErrorCorrectionLevel=Se,n.QRCodeDecoderFormatInformation=De,n.QRCodeEncoder=Mn,n.QRCodeEncoderQRCode=si,n.QRCodeMaskUtil=Jn,n.QRCodeMatrixUtil=Er,n.QRCodeMode=We,n.QRCodeReader=Qt,n.QRCodeVersion=nt,n.QRCodeWriter=zt,n.RGBLuminanceSource=kr,n.RSS14Reader=_,n.RSSExpandedReader=h,n.ReaderException=lr,n.ReedSolomonDecoder=ft,n.ReedSolomonEncoder=hr,n.ReedSolomonException=tt,n.Result=ce,n.ResultMetadataType=je,n.ResultPoint=Nt,n.StringUtils=X,n.UnsupportedOperationException=ne,n.VideoInputDevice=ae,n.WhiteRectangleDetector=Pt,n.WriterException=ni,n.ZXingArrays=I,n.ZXingCharset=Ar,n.ZXingInteger=P,n.ZXingStandardCharsets=Zr,n.ZXingStringBuilder=re,n.ZXingStringEncoding=J,n.ZXingSystem=w,n.createAbstractExpandedDecoder=Pn,Object.defineProperty(n,"__esModule",{value:!0})})}(Aj,Aj.exports)),Aj.exports}var po=aLt();const oLt=ki(po),lLt=INe({__proto__:null,default:oLt},[po]);var Dbe=function(){function e(t,n,r){if(this.formatMap=new Map([[Ss.QR_CODE,po.BarcodeFormat.QR_CODE],[Ss.AZTEC,po.BarcodeFormat.AZTEC],[Ss.CODABAR,po.BarcodeFormat.CODABAR],[Ss.CODE_39,po.BarcodeFormat.CODE_39],[Ss.CODE_93,po.BarcodeFormat.CODE_93],[Ss.CODE_128,po.BarcodeFormat.CODE_128],[Ss.DATA_MATRIX,po.BarcodeFormat.DATA_MATRIX],[Ss.MAXICODE,po.BarcodeFormat.MAXICODE],[Ss.ITF,po.BarcodeFormat.ITF],[Ss.EAN_13,po.BarcodeFormat.EAN_13],[Ss.EAN_8,po.BarcodeFormat.EAN_8],[Ss.PDF_417,po.BarcodeFormat.PDF_417],[Ss.RSS_14,po.BarcodeFormat.RSS_14],[Ss.RSS_EXPANDED,po.BarcodeFormat.RSS_EXPANDED],[Ss.UPC_A,po.BarcodeFormat.UPC_A],[Ss.UPC_E,po.BarcodeFormat.UPC_E],[Ss.UPC_EAN_EXTENSION,po.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!lLt)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=r;var s=this.createZXingFormats(t),a=new Map;a.set(po.DecodeHintType.POSSIBLE_FORMATS,s),a.set(po.DecodeHintType.TRY_HARDER,!1),this.hints=a}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(r,s){try{r(n.decode(t))}catch(a){s(a)}})},e.prototype.decode=function(t){var n=new po.MultiFormatReader(this.verbose,this.hints),r=new po.HTMLCanvasElementLuminanceSource(t),s=new po.BinaryBitmap(new po.HybridBinarizer(r)),a=n.decode(s);return{text:a.text,format:vLe.create(this.toHtml5QrcodeSupportedFormats(a.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,r,s){t.set(n,r)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],r=0,s=t;r<s.length;r++){var a=s[r];this.formatMap.has(a)?n.push(this.formatMap.get(a)):this.logger.logError("".concat(a," is not supported by")+"ZXingHtml5QrcodeShim")}return n},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),cLt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},uLt=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Bbe=function(){function e(t,n,r){if(this.formatMap=new Map([[Ss.QR_CODE,"qr_code"],[Ss.AZTEC,"aztec"],[Ss.CODABAR,"codabar"],[Ss.CODE_39,"code_39"],[Ss.CODE_93,"code_93"],[Ss.CODE_128,"code_128"],[Ss.DATA_MATRIX,"data_matrix"],[Ss.ITF,"itf"],[Ss.EAN_13,"ean_13"],[Ss.EAN_8,"ean_8"],[Ss.PDF_417,"pdf417"],[Ss.UPC_A,"upc_a"],[Ss.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=r;var s=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(s),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t<"u"},e.prototype.decodeAsync=function(t){return cLt(this,void 0,void 0,function(){var n,r;return uLt(this,function(s){switch(s.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=s.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return r=this.selectLargestBarcode(n),[2,{text:r.rawValue,format:vLe.create(this.toHtml5QrcodeSupportedFormats(r.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,r=0,s=0,a=t;s<a.length;s++){var o=a[s],l=o.boundingBox.width*o.boundingBox.height;l>r&&(r=l,n=o)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],r=0,s=t;r<s.length;r++){var a=s[r];this.formatMap.has(a)?n.push(this.formatMap.get(a)):this.logger.warn("".concat(a," is not supported by")+"BarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,r,s){t.set(n,r)}),t},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),$be=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},Ube=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},dLt=function(){function e(t,n,r,s){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=r,n&&Bbe.isSupported()?(this.primaryDecoder=new Bbe(t,r,s),this.secondaryDecoder=new Dbe(t,r,s)):this.primaryDecoder=new Dbe(t,r,s)}return e.prototype.decodeAsync=function(t){return $be(this,void 0,void 0,function(){var n;return Ube(this,function(r){switch(r.label){case 0:n=performance.now(),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,r.sent()];case 3:return this.possiblyLogPerformance(n),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(t){return $be(this,void 0,void 0,function(){var n,r;return Ube(this,function(s){switch(s.label){case 0:n=performance.now(),s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,s.sent()];case 3:if(r=s.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw r;case 4:return this.possiblyLogPerformance(n),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(t){if(this.verbose){var n=performance.now()-t;this.executionResults.push(n),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,r=this.executionResults;n<r.length;n++){var s=r[n];t+=s}var a=t/this.executionResults.length;console.log("".concat(a," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),mle=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),DR=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},BR=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},CLe=function(){function e(t,n){this.name=t,this.track=n}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(t){var n={};n[this.name]=t;var r={advanced:[n]};return this.track.applyConstraints(r)},e.prototype.value=function(){var t=this.track.getSettings();if(this.name in t){var n=t[this.name];return n}return null},e}(),fLt=function(e){mle(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(n){var r={};r[this.name]=n;var s={advanced:[r]};return this.track.applyConstraints(s)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var n=this.track.getCapabilities(),r=n[this.name];return{min:r.min,max:r.max,step:r.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(CLe),hLt=function(e){mle(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}(fLt),pLt=function(e){mle(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(CLe),mLt=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new hLt(this.track)},e.prototype.torchFeature=function(){return new pLt(this.track)},e}(),xLt=function(){function e(t,n,r){this.isClosed=!1,this.parentElement=t,this.mediaStream=n,this.callbacks=r,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width="".concat(t,"px"),n.style.display="block",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var n=function(){var r=t.surface.clientWidth,s=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(r,s),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,r,s){return DR(this,void 0,void 0,function(){var a,o;return BR(this,function(l){switch(l.label){case 0:return a=new e(t,n,s),r.aspectRatio?(o={aspectRatio:r.aspectRatio},[4,a.getFirstTrackOrFail().applyConstraints(o)]):[3,2];case 1:l.sent(),l.label=2;case 2:return a.setupSurface(),[2,a]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(t){this.failIfClosed();var n=this,r=function(){setTimeout(t,200),n.surface.removeEventListener("playing",r)};this.surface.addEventListener("playing",r),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(t){return DR(this,void 0,void 0,function(){return BR(this,function(n){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(n,r){var s=t.mediaStream.getVideoTracks(),a=s.length,o=0;t.mediaStream.getVideoTracks().forEach(function(l){t.mediaStream.removeTrack(l),l.stop(),++o,o>=a&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),n())})})},e.prototype.getCapabilities=function(){return new mLt(this.getFirstTrackOrFail())},e}(),gLt=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,r){return DR(this,void 0,void 0,function(){return BR(this,function(s){return[2,xLt.create(t,this.mediaStream,n,r)]})})},e.create=function(t){return DR(this,void 0,void 0,function(){var n,r;return BR(this,function(s){switch(s.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return r=s.sent(),[2,new e(r)]}})})},e}(),zbe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},Hbe=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},bLt=function(){function e(){}return e.failIfNotSupported=function(){return zbe(this,void 0,void 0,function(){return Hbe(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(t){return zbe(this,void 0,void 0,function(){return Hbe(this,function(n){return[2,gLt.create(t)]})})},e}(),yLt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},vLt=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},wLt=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=LC.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=LC.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var t=location.host.split(":")[0];return t==="127.0.0.1"||t==="localhost"},e.getCamerasFromMediaDevices=function(){return yLt(this,void 0,void 0,function(){var t,n,r,s,a,o,l;return vLt(this,function(c){switch(c.label){case 0:return t=function(u){for(var d=u.getVideoTracks(),f=0,x=d;f<x.length;f++){var g=x[f];g.enabled=!1,g.stop(),u.removeTrack(g)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return n=c.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(r=c.sent(),s=[],a=0,o=r;a<o.length;a++)l=o[a],l.kind==="videoinput"&&s.push({id:l.deviceId,label:l.label});return t(n),[2,s]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var r=function(a){for(var o=[],l=0,c=a;l<c.length;l++){var u=c[l];u.kind==="video"&&o.push({id:u.id,label:u.label})}t(o)},s=MediaStreamTrack;s.getSources(r)})},e}(),Qo;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(Qo||(Qo={}));var CLt=function(){function e(){this.state=Qo.NOT_STARTED,this.onGoingTransactionNewState=Qo.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===Qo.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=Qo.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===Qo.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=Qo.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==Qo.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case Qo.UNKNOWN:throw"Transition from unknown is not allowed";case Qo.NOT_STARTED:this.failIfNewStateIs(t,[Qo.PAUSED]);break;case Qo.SCANNING:break;case Qo.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var r=0,s=n;r<s.length;r++){var a=s[r];if(t===a)throw"Cannot transition from ".concat(this.state," to ").concat(t)}},e}(),SLt=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===Qo.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==Qo.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===Qo.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===Qo.PAUSED},e}(),NLt=function(){function e(){}return e.create=function(){return new SLt(new CLt)},e}(),ALt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_f=function(e){ALt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(nLt),jLt=function(){function e(t,n){this.logger=n,this.fps=_f.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=_f.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?wLe.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!ag(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),Vbe=function(){function e(t,n){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id=".concat(t," not found");this.elementId=t,this.verbose=!1;var r;typeof n=="boolean"?this.verbose=n===!0:n&&(r=n,this.verbose=r.verbose===!0,r.experimentalFeatures),this.logger=new sLt(this.verbose),this.qrcode=new dLt(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(r),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=NLt.create()}return e.prototype.start=function(t,n,r,s){var a=this;if(!t)throw"cameraIdOrConfig is required";if(!r||typeof r!="function")throw"qrCodeSuccessCallback is required and should be a function.";var o;s?o=s:o=this.verbose?this.logger.log:function(){};var l=jLt.create(n,this.logger);this.clearElement();var c=!1;l.videoConstraints&&(l.isMediaStreamConstraintsValid()?c=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var u=c,d=document.getElementById(this.elementId);d.clientWidth?d.clientWidth:_f.DEFAULT_WIDTH,d.style.position="relative",this.shouldScan=!0,this.element=d;var f=this,x=this.stateManagerProxy.startTransition(Qo.SCANNING);return new Promise(function(g,v){var w=u?l.videoConstraints:f.createVideoConstraints(t);if(!w){x.cancel(),v("videoConstraints should be defined");return}var C={};(!u||l.aspectRatio)&&(C.aspectRatio=l.aspectRatio);var N={onRenderSurfaceReady:function(I,P){f.setupUi(I,P,l),f.isScanning=!0,f.foreverScan(l,r,o)}};bLt.failIfNotSupported().then(function(I){I.create(w).then(function(P){return P.render(a.element,C,N).then(function(R){f.renderedCamera=R,x.execute(),g(null)}).catch(function(R){x.cancel(),v(R)})}).catch(function(P){x.cancel(),v(LC.errorGettingUserMedia(P))})}).catch(function(I){x.cancel(),v(LC.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(Qo.PAUSED),this.showPausedState(),(ag(t)||t!==!0)&&(t=!1),t&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var t=this,n=function(){t.stateManagerProxy.directTransition(Qo.SCANNING),t.hidePausedState()};if(!this.renderedCamera.isPaused()){n();return}this.renderedCamera.resume(function(){n()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(Qo.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var r=function(){if(t.element){var a=document.getElementById(_f.SHADED_REGION_ELEMENT_ID);a&&t.element.removeChild(a)}},s=this;return this.renderedCamera.close().then(function(){return s.renderedCamera=null,s.element&&(s.element.removeChild(s.canvasElement),s.canvasElement=null),r(),s.qrRegion&&(s.qrRegion=null),s.context&&(s.context=null),n.execute(),s.hidePausedState(),s.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(r){return r.decodedText})},e.prototype.scanFileV2=function(t,n){var r=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(ag(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(s,a){r.possiblyCloseLastScanImageFile(),r.clearElement(),r.lastScanImageFile=URL.createObjectURL(t);var o=new Image;o.onload=function(){var l=o.width,c=o.height,u=document.getElementById(r.elementId),d=u.clientWidth?u.clientWidth:_f.DEFAULT_WIDTH,f=Math.max(u.clientHeight?u.clientHeight:c,_f.FILE_SCAN_MIN_HEIGHT),x=r.computeCanvasDrawConfig(l,c,d,f);if(n){var g=r.createCanvasElement(d,f,"qr-canvas-visible");g.style.display="inline-block",u.appendChild(g);var v=g.getContext("2d");if(!v)throw"Unable to get 2d context from canvas";v.canvas.width=d,v.canvas.height=f,v.drawImage(o,0,0,l,c,x.x,x.y,x.width,x.height)}var w=_f.FILE_SCAN_HIDDEN_CANVAS_PADDING,C=Math.max(o.width,x.width),N=Math.max(o.height,x.height),I=C+2*w,P=N+2*w,R=r.createCanvasElement(I,P);u.appendChild(R);var F=R.getContext("2d");if(!F)throw"Unable to get 2d context from canvas";F.canvas.width=I,F.canvas.height=P,F.drawImage(o,0,0,l,c,w,w,C,N);try{r.qrcode.decodeRobustlyAsync(R).then(function(U){s(Rbe.createFromQrcodeResult(U))}).catch(a)}catch(U){a("QR code parse error, error = ".concat(U))}},o.onerror=a,o.onabort=a,o.onstalled=a,o.onsuspend=a,o.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return wLt.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(t){if(t){if(!wLe.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(t){var n=[Ss.QR_CODE,Ss.AZTEC,Ss.CODABAR,Ss.CODE_39,Ss.CODE_93,Ss.CODE_128,Ss.DATA_MATRIX,Ss.MAXICODE,Ss.ITF,Ss.EAN_13,Ss.EAN_8,Ss.PDF_417,Ss.RSS_14,Ss.RSS_EXPANDED,Ss.UPC_A,Ss.UPC_E,Ss.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var r=[],s=0,a=t.formatsToSupport;s<a.length;s++){var o=a[s];tLt(o)?r.push(o):this.logger.warn("Invalid format: ".concat(o," passed in config, ignoring."))}if(r.length===0)throw"None of formatsToSupport match supported values.";return r},e.prototype.getUseBarCodeDetectorIfSupported=function(t){if(ag(t))return!0;if(!ag(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(ag(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return ag(n.useBarCodeDetectorIfSupported)?!0:n.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(t,n,r){var s=this,a=r.qrbox;this.validateQrboxConfig(a);var o=this.toQrdimensions(t,n,a),l=function(u){if(u<_f.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(_f.MIN_QR_BOX_SIZE,"px.")},c=function(u){return u>t&&(s.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),u=t),u};l(o.width),l(o.height),o.width=c(o.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,r){if(typeof r=="number")return{width:r,height:r};if(typeof r=="function")try{return r(t,n)}catch(s){throw new Error("qrbox config was passed as a function but it failed with unknown error"+s)}return r},e.prototype.setupUi=function(t,n,r){r.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,r);var s=ag(r.qrbox)?{width:t,height:n}:r.qrbox;this.validateQrboxConfig(s);var a=this.toQrdimensions(t,n,s);a.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var o=r.isShadedBoxEnabled()&&a.height<=n,l={x:0,y:0,width:t,height:n},c=o?this.getShadedRegionBounds(t,n,a):l,u=this.createCanvasElement(c.width,c.height),d={willReadFrequently:!0},f=u.getContext("2d",d);f.canvas.width=c.width,f.canvas.height=c.height,this.element.append(u),o&&this.possiblyInsertShadingElement(this.element,t,n,a),this.createScannerPausedUiElement(this.element),this.qrRegion=c,this.context=f,this.canvasElement=u},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText=LC.scannerPaused(),n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="rgba(9, 9, 9, 0.46)",n.style.color="#FFECEC",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var r=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(s){return t(s.text,Rbe.createFromQrcodeResult(s)),r.possiblyUpdateShaders(!0),!0}).catch(function(s){r.possiblyUpdateShaders(!1);var a=LC.codeParseError(s);return n(a,rLt.createFrom(a)),!1})},e.prototype.foreverScan=function(t,n,r){var s=this;if(this.shouldScan&&this.renderedCamera){var a=this.renderedCamera.getSurface(),o=a.videoWidth/a.clientWidth,l=a.videoHeight/a.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var c=this.qrRegion.width*o,u=this.qrRegion.height*l,d=this.qrRegion.x*o,f=this.qrRegion.y*l;this.context.drawImage(a,d,f,c,u,0,0,this.qrRegion.width,this.qrRegion.height);var x=function(){s.foreverScanTimeout=setTimeout(function(){s.foreverScan(t,n,r)},s.getTimeoutFps(t.fps))};this.scanContext(n,r).then(function(g){!g&&t.disableFlip!==!0?(s.context.translate(s.context.canvas.width,0),s.context.scale(-1,1),s.scanContext(n,r).finally(function(){x()})):x()}).catch(function(g){s.logger.logError("Error happend while scanning context",g),x()})}},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",r="deviceId",s={user:!0,environment:!0},a="exact",o=function(v){if(v in s)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(v,"'")},l=Object.keys(t);if(l.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(l.length," keys");var c=Object.keys(t)[0];if(c!==n&&c!==r)throw"Only '".concat(n,"' and '").concat(r,"' ")+" are supported for 'cameraIdOrConfig'";if(c===n){var u=t.facingMode;if(typeof u=="string"){if(o(u))return{facingMode:u}}else if(typeof u=="object")if(a in u){if(o(u["".concat(a)]))return{facingMode:{exact:u["".concat(a)]}}}else throw"'facingMode' should be string or object with"+" ".concat(a," as key.");else{var d=typeof u;throw"Invalid type of 'facingMode' = ".concat(d)}}else{var f=t.deviceId;if(typeof f=="string")return{deviceId:f};if(typeof f=="object"){if(a in f)return{deviceId:{exact:f["".concat(a)]}};throw"'deviceId' should be string or object with"+" ".concat(a," as key.")}else{var x=typeof f;throw"Invalid type of 'deviceId' = ".concat(x)}}}var g=typeof t;throw"Invalid type of 'cameraIdOrConfig' = ".concat(g)},e.prototype.computeCanvasDrawConfig=function(t,n,r,s){if(t<=r&&n<=s){var a=(r-t)/2,o=(s-n)/2;return{x:a,y:o,width:t,height:n}}else{var l=t,c=n;return t>r&&(n=r/t*n,t=r),n>s&&(t=s/n*t,n=s),this.logger.log("Image downsampled from "+"".concat(l,"X").concat(c)+" to ".concat(t,"X").concat(n,".")),this.computeCanvasDrawConfig(t,n,r,s)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?_f.BORDER_SHADER_MATCH_COLOR:_f.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,r){var s=t,a=n,o=document.createElement("canvas");return o.style.width="".concat(s,"px"),o.style.height="".concat(a,"px"),o.style.display="none",o.id=ag(r)?"qr-canvas":r,o},e.prototype.getShadedRegionBounds=function(t,n,r){if(r.width>t||r.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-r.width)/2,y:(n-r.height)/2,width:r.width,height:r.height}},e.prototype.possiblyInsertShadingElement=function(t,n,r,s){if(!(n-s.width<1||r-s.height<1)){var a=document.createElement("div");a.style.position="absolute";var o=(n-s.width)/2,l=(r-s.height)/2;if(a.style.borderLeft="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),a.style.borderRight="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),a.style.borderTop="".concat(l,"px solid rgba(0, 0, 0, 0.48)"),a.style.borderBottom="".concat(l,"px solid rgba(0, 0, 0, 0.48)"),a.style.boxSizing="border-box",a.style.top="0px",a.style.bottom="0px",a.style.left="0px",a.style.right="0px",a.id="".concat(_f.SHADED_REGION_ELEMENT_ID),n-s.width<11||r-s.height<11)this.hasBorderShaders=!1;else{var c=5,u=40;this.insertShaderBorders(a,u,c,-c,null,0,!0),this.insertShaderBorders(a,u,c,-c,null,0,!1),this.insertShaderBorders(a,u,c,null,-c,0,!0),this.insertShaderBorders(a,u,c,null,-c,0,!1),this.insertShaderBorders(a,c,u+c,-c,null,-c,!0),this.insertShaderBorders(a,c,u+c,null,-c,-c,!0),this.insertShaderBorders(a,c,u+c,-c,null,-c,!1),this.insertShaderBorders(a,c,u+c,null,-c,-c,!1),this.hasBorderShaders=!0}t.append(a)}},e.prototype.insertShaderBorders=function(t,n,r,s,a,o,l){var c=document.createElement("div");c.style.position="absolute",c.style.backgroundColor=_f.BORDER_SHADER_DEFAULT_COLOR,c.style.width="".concat(n,"px"),c.style.height="".concat(r,"px"),s!==null&&(c.style.top="".concat(s,"px")),a!==null&&(c.style.bottom="".concat(a,"px")),l?c.style.left="".concat(o,"px"):c.style.right="".concat(o,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(c),t.appendChild(c)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(t){return 1e3/t},e}(),Wbe;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(Wbe||(Wbe={}));function e_(){const[e,t]=m.useState(!1),[n,r]=m.useState([]),[s,a]=m.useState(null),[o,l]=m.useState(null),c=m.useRef(null);m.useEffect(()=>{l(localStorage.getItem("hyperAddress"))},[]),m.useEffect(()=>{e&&Vbe.getCameras().then(d=>{r(d||[]);const x=d.find(g=>/back|environment/i.test(g.label))||d[0];x&&a(x.id)})},[e]),m.useEffect(()=>{if(!e||!s)return;const d=new Vbe("reader"),f={deviceId:{exact:s}},x={fps:10,qrbox:250};return d.start(f,x,g=>window.location.href=g,console.error),()=>d.stop().then(()=>d.clear())},[e,s]);const u=()=>{l(null),window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),setHyperToken(""),setHyperAddress(""),window.location.reload()};return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:o?u:()=>t(!0),className:"font-bold w-full",children:o?i.jsx("span",{className:"text-red-400",children:"Logout"}):i.jsx("span",{className:"text-white",children:"Connect"})}),e&&i.jsx("div",{className:"fixed inset-0 grid place-items-center bg-black/60",children:i.jsxs("div",{className:"bg-[#1b1b1b] p-4 rounded-xl space-y-4",children:[i.jsx("select",{value:s||"",onChange:d=>a(d.target.value),className:"w-full p-2 rounded text-sm bg-slate-950 font-manrope font-bold",children:n.map(d=>i.jsx("option",{value:d.id,children:d.label||d.id},d.id))}),i.jsx("div",{id:"reader",ref:c,className:"w-[300px]"}),i.jsx("button",{onClick:()=>t(!1),className:"w-full p-2 rounded text-sm bg-red-400 text-black font-bold font-manrope",children:"Close"})]})})]})}const ELt=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),[s,a]=m.useState(!1),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(!1),I=()=>{t(!e)};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"bg-[#171717] w-full px-2 sm:px-6 flex justify-between items-center border-b border-[#2a2a2a] z-50 h-[60px]",children:[i.jsx(hl,{to:"/",className:"cursor-pointer",children:i.jsx("div",{className:"flex justify-start items-center gap-[8.09px] font-manrope",children:i.jsxs("div",{className:"flex justify-start items-center min-w-max",children:[i.jsx("img",{src:qi,alt:"Dextrabot",className:"w-[30.91321px] h-8"}),i.jsx("span",{className:"text-white font-manrope text-sm ml-2 font-semibold",children:"Dextrabot"})]})})}),i.jsxs("div",{className:"w-[84px] h-6 p-2 bg-[#232323] rounded-[256px] justify-start items-center gap-2.5 hidden sm:inline-flex cursor-not-allowed",children:[i.jsxs("div",{className:"h-4 justify-start items-center gap-[5px] flex",children:[i.jsx("img",{src:dx,alt:"Dextrabot",className:"w-3.5 h-3.5"}),i.jsx("div",{className:"text-white text-[11px] font-extrabold font-manrope leading-none",children:"HYPE"})]}),i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx(Yh,{className:"text-white w-3 h-3"})})]}),i.jsx("div",{onClick:I,className:"p-2 bg-[#171717] cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 fill-current text-white",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]}),e&&i.jsxs("div",{className:"fixed inset-0 w-screen h-screen bg-[#171717]/10 z-50 backdrop-blur-xl overflow-hidden",children:[i.jsx("div",{onClick:I,className:"absolute top-3 right-2 p-2 bg-transparent cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 fill-current text-white",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),i.jsx("div",{className:"w-full h-full px-4 pt-5 pb-16 overflow-y-auto",children:i.jsxs("div",{className:"flex flex-col gap-2 w-full text-xl font-manrope items-start text-left [&>a]:text-white [&>a]:font-bold",children:[i.jsx(e_,{}),i.jsx(hl,{to:"/terminal/BTC",onClick:()=>t(!1),children:"Terminal"}),i.jsx(hl,{to:"/discover-wallets",onClick:()=>t(!1),children:"Discover Wallets"}),i.jsx(hl,{to:"/hyperliquid-vaults",onClick:()=>t(!1),children:"Discover Vaults"}),i.jsx(hl,{to:"/copy-trade",onClick:()=>t(!1),children:"My Copy Trading"}),i.jsx(hl,{to:"/wallet-management",onClick:()=>t(!1),children:"Wallet Management"}),i.jsx(hl,{to:"/ticker",onClick:()=>t(!1),children:"Ticker"}),i.jsx(hl,{to:"/leaderboard",onClick:()=>t(!1),children:"Leaderboard"}),i.jsx(hl,{to:"/referral",onClick:()=>t(!1),children:"Referral"}),i.jsx(hl,{to:"/tracked-wallets",onClick:()=>t(!1),children:"Tracked Wallets"}),i.jsx(hl,{to:"/tracker",onClick:()=>t(!1),children:"My Activities"}),i.jsx(hl,{to:"/hyperliquid-whale-trades",onClick:()=>t(!1),children:"Whale trades"}),i.jsx(hl,{to:"/back-testing",onClick:()=>t(!1),children:"Backtest"}),i.jsx(hl,{to:"/hyperliquid-fee-calculator ",onClick:()=>t(!1),children:"HL Fee Calculator"}),i.jsxs(hl,{to:"/terminal/extended/BTC#gridbot",onClick:()=>t(!1),children:["Extended Grid Bot ",i.jsx(v0,{})]}),i.jsxs(hl,{to:"/dca-bot",onClick:()=>t(!1),children:["Extended DCA Bot ",i.jsx(v0,{})]}),i.jsxs("div",{onClick:()=>g(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:["Extended Farming ",i.jsx(v0,{tone:"emerald",label:"SMART"})]}),i.jsxs(hl,{to:"/terminal/lighter/BTC#gridbot",onClick:()=>t(!1),children:["Lighter Grid Bot ",i.jsx(v0,{})]}),i.jsxs(hl,{to:"/terminal/hyperliquid/BTC#gridbot",onClick:()=>t(!1),children:["HL Grid Bot ",i.jsx(v0,{})]}),i.jsx(hl,{to:"/market-maker",onClick:()=>t(!1),children:"HL Market Maker"}),i.jsx("div",{onClick:()=>a(!0),className:"text-white font-bold cursor-pointer",children:"Aster Farming"}),i.jsx("div",{onClick:()=>r(!0),className:"text-white font-bold cursor-pointer",children:"BasedApp Farming"}),i.jsx("div",{onClick:()=>l(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Lighter Farming"}),i.jsx("div",{onClick:()=>u(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Apex Farming"}),i.jsx("div",{onClick:()=>f(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Variational Farming"}),i.jsx("div",{onClick:()=>w(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Paradex Farming"}),i.jsx("div",{onClick:()=>N(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Pacifica Farming"})]})})]}),i.jsx($oe,{open:n,setOpen:r}),i.jsx(Uoe,{open:s,setOpen:a}),i.jsx(zoe,{open:o,setOpen:l}),i.jsx(Hoe,{open:c,setOpen:u}),i.jsx(Voe,{open:d,setOpen:f}),i.jsx(v$,{open:x,setOpen:g}),i.jsx(Woe,{open:v,setOpen:w}),i.jsx(qoe,{open:C,setOpen:N})]})},SLe=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",className:e,children:[i.jsx("path",{d:"M1 9L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9 9L1 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),_Lt=()=>{var pe,Y,ie,oe,G,V;const e=m.useRef(null),[t,n]=m.useState(!1),[r,s]=m.useState([]),[a,o]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(()=>{const te=localStorage.getItem("isToasterMinimized");return te===null?!1:te==="true"});m.useEffect(()=>{localStorage.setItem("isToasterMinimized",f)},[f]);const[g,v]=m.useState([]),C=localStorage.getItem("isDateToasterFormat")||"date",[N,I]=m.useState(C);m.useEffect(()=>{localStorage.setItem("isDateToasterFormat",N)},[N]);const[P,R]=m.useState(0),F=m.useRef(null),[U,L]=m.useState(null),[z,Q]=m.useState(0),ne=1e4;m.useEffect(()=>{if(l||r.length===0||t){clearInterval(F.current);return}const te=Date.now();return L(te),F.current=setTimeout(()=>{R(ae=>(ae+1)%r.length),Q(0)},ne-z),()=>clearTimeout(F.current)},[l,r.length,t,P,z]),m.useEffect(()=>{P>=(r==null?void 0:r.length)&&R(0)},[r]);async function J(){try{d(!0);const te=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/analysis/getallmetrics/");if(!te.ok)throw new Error(`Server responded with status ${te.status}`);const ae=await te.json();ae&&s(ae.refcodes)}catch(te){return console.error("Error fetching metrics:",te.message),null}finally{d(!1)}}m.useEffect(()=>{let te;return f||(J(),te=setInterval(()=>{J()},6e4)),()=>{te&&clearInterval(te)}},[f]),m.useEffect(()=>{var te;if((r==null?void 0:r.length)>0)if((a==null?void 0:a.length)<(r==null?void 0:r.length)){const ae=[...a??[]],he=Array.from({length:(r==null?void 0:r.length)-((a==null?void 0:a.length)??0)},(Ae,ye)=>ye+((a==null?void 0:a.length)??0)),Ce=he==null?void 0:he.sort(()=>Math.random()-.5),ce=[...ae,...Ce??[]];o(ce);const ge=ce==null?void 0:ce.map(Ae=>r==null?void 0:r[Ae]);v(ge)}else{const ae=(te=a==null?void 0:a.map(he=>r==null?void 0:r[he]))==null?void 0:te.filter(Boolean);v(ae)}},[r]);const[X,re]=m.useState(!1);return i.jsxs("div",{className:"absolute right-6 bottom-[72px] sm:bottom-6 rounded-[20px] z-50",children:[f&&i.jsx("div",{onClick:()=>{x(te=>{const ae=!te;return localStorage.setItem("isToasterMinimized",ae?"true":"false"),ae})},className:"fixed bottom-10 right-4 z-50 cursor-pointer bg-[#2a2a2a]/60 hover:bg-[#2a2a2a] rounded-full w-12 h-12 flex items-center justify-center shadow-md group",children:i.jsx("img",{src:ske,alt:"Toggle",className:"w-8 h-8 opacity-90 group-hover:opacity-100"})}),(!f||X)&&i.jsxs("div",{style:{background:"rgba(32, 32, 32, 0.86)",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"},className:`${X?"bounceShrink-Close-Toaster-Close":""} w-full h-full min-h-full relative rounded-[20px]`,children:[i.jsxs("div",{onClick:()=>{c(!l)},style:{backgroundColor:"rgba(40, 40, 42, 0.75)",backdropFilter:"blur(10px)"},className:`${(r==null?void 0:r.length)>0?"":"hidden"} cursor-pointer w-full h-[20px] rounded-t-full flex justify-center items-center relative`,children:[i.jsx("div",{className:"w-[36px] h-[4px] bg-[rgba(255,255,255,0.3)] rounded-[2px]"}),i.jsx("div",{onClick:te=>{te.stopPropagation(),re(!0),setTimeout(()=>{x(ae=>{const he=!ae;return localStorage.setItem("isToasterMinimized",he?"true":"false"),he}),re(!1)},600)},className:"w-6 h-4 rounded-[2px] absolute group right-[14px]",children:i.jsx("span",{className:"flex items-center justify-center h-full",children:i.jsx(SLe,{className:"w-2 h-2 text-[#7A7A7A] group-hover:text-white"})})})]}),i.jsx("div",{className:`${l?"max-h-[70vh] lg:max-h-[75vh] min-h-[100px] overflow-y-scroll pl-2 py-2 pr-1 rounded-[20px]":"min-h-full h-full p-0 rounded-b-[20px]"} flex flex-col items-start gap-2 bg-transparent max-w-[356px] transition-all duration-300 overflow-hidden`,children:!l&&(r==null?void 0:r.length)>0?i.jsx("div",{style:{backgroundColor:" rgba(32, 32, 32, 0.86)",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.64)",backdropFilter:"blur(16px)"},onMouseEnter:()=>{e.current&&(e.current.style.animationPlayState="paused"),n(!0),U&&Q(te=>te+(Date.now()-U))},onMouseLeave:()=>{e.current&&(e.current.style.animationPlayState="running"),n(!1)},className:"relative h-full w-full overflow-hidden",children:i.jsx("div",{className:"w-full h-full flex flex-col justify-start items-start animate-fade-slide transition-all duration-500",children:i.jsx(qbe,{content:(pe=g[P])==null?void 0:pe.result,createdAt:(Y=g[P])==null?void 0:Y.created_at,category:(ie=g[P])==null?void 0:ie.category,metric:(oe=g[P])==null?void 0:oe.metric,metricId:(G=g[P])==null?void 0:G.metric_definition_id,isDeleted:(V=g[P])==null?void 0:V.is_deleted,isDateToasterFormat:N,setIsDateToasterFormat:I,isDropdownOpen:l,activeIndex:P,progressRef:e})},`toast-${P}`)}):g==null?void 0:g.map((te,ae)=>i.jsx(qbe,{content:te==null?void 0:te.result,createdAt:te==null?void 0:te.created_at,category:te==null?void 0:te.category,metric:te==null?void 0:te.metric,metricId:te==null?void 0:te.metric_definition_id,isDeleted:te==null?void 0:te.is_deleted,isDateToasterFormat:N,setIsDateToasterFormat:I,isDropdownOpen:l,progressRef:e},ae))})]})]})},qbe=({content:e,createdAt:t,category:n,metric:r,metricId:s,isDeleted:a,isDateToasterFormat:o,setIsDateToasterFormat:l,isDropdownOpen:c,activeIndex:u,progressRef:d})=>{var I,P;function f({date:R}){const[F,U]=m.useState(Oo(R));return m.useEffect(()=>{const L=setInterval(()=>{U(Oo(R))},1e3);return()=>clearInterval(L)},[R]),i.jsxs("span",{className:"text-[#989898] text-[11px] font-normal font-inter leading-[13px] tracking-tight italic",children:["updated ",F==null?void 0:F.dateTime]})}const x=s===1||s===2||s===3,g=s===4||s===5||s===6,v=s===7||s===8||s===9,w=s===1||s===4||s===7,C=s===2||s===5||s===8,N=s===3||s===6||s===9;return i.jsxs("div",{onClick:R=>{R.preventDefault(),window.open(`/wallet-details/${(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress)}`,"_blank")},style:x?{background:"rgba(32, 32, 32, 0.86)",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"}:g?{background:"#FF42170A",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"}:v?{background:"#00FF910A",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"}:{},className:`${c?"rounded-[20px]":"rounded-b-[20px]"} ${x||v?"min-h-[107px]":g?"min-h-[123px]":""}
w-full flex gap-2 items-start justify-start px-3 pt-3 pb-2 bg-[#2b2b2b] hover:bg-[#404040] relative overflow-hidden cursor-pointer`,children:[i.jsx("div",{className:"w-10 h-10 rounded-[256px] blur-xl absolute -z-10 top-2 left-2"}),i.jsx("div",{style:x?{backgroundColor:"#FFC526"}:g?{background:"linear-gradient(180deg, #FF7300 0%, #FF2525 100%)",backgroundBlendMode:"lighten, normal, normal",boxShadow:"0px 4px 24px 0px rgba(255, 96, 10, 0.32), 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"}:v?{background:"linear-gradient(180deg, #00FF90 0%, #00FF4D 100%)",boxShadow:"0px 4px 24px 0px rgba(44, 255, 163, 0.32), 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"}:{},className:`${c?"":"toaster-animation-shake-animate"} flex justify-center items-center overflow-hidden w-10 h-10 min-w-10 min-h-10 rounded-full`,children:i.jsx("img",{src:`${x?ske:g?nke:v?wyt:""}`,alt:"",className:`${x?"w-[40px] h-[40px] min-w-[40px] min-h-[40px]":"w-[24px] h-[24px] min-w-[24px] min-h-[24px]"}`,loading:"lazy",onError:R=>dm(R)})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[3px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center gap-1",children:[i.jsxs("p",{className:"text-white text-[13px] font-semibold font-['Manrope'] leading-[16px]",children:[i.jsxs("span",{className:"inline-flex justify-start items-center gap-1 cursor-pointer min-w-max max-w-max h-[18px] p-1 mr-1 bg-white/[0.06] rounded-md",children:[i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope leading-none ",children:e!=null&&e.dextraaddress||e!=null&&e.sourceaddress?((I=(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress))==null?void 0:I.slice(0,5))+".."+((P=(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress))==null?void 0:P.slice(-4)):"--"}),i.jsx("img",{onClick:R=>{R.stopPropagation(),navigator.clipboard.writeText((e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress)),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),x?`is one of ${w?"today's":C?"week's":N?"month's":""} most profitable Top Follower Wallets!`:g?`has generated $${e!=null&&e.earned_rpnl?Cr(e==null?void 0:e.earned_rpnl):"-"} in profits for its followers ${w?"today":C?"this week":N?"this month":""} - a wallet you’ll want to watch!`:v?`is one of ${w?"today's":C?"this week's":N?"this month's":""} most copied wallets!`:""]}),i.jsx("div",{className:`${x?"-mt-[18px]":g?"-mt-[30px]":v?"-mt-[16px]":""} w-[18px] h-[18px] min-w-[18px] min-h-[18px] flex justify-center items-start rounded `,children:i.jsx("img",{src:nae,alt:""})})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1 mt-2",children:[i.jsxs("div",{className:`${c?"":"toaster-animation-shake-new-profit-animate"} p-1.5 bg-[#67ffbd]/20 rounded-md inline-flex justify-center items-center gap-1 max-h-5`,children:[v&&i.jsx("img",{src:Cyt,alt:"",className:"w-[14px] h-[14px]"}),g&&i.jsx("img",{src:Syt,alt:"",className:"w-[14px] h-[10px]"}),i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-['Manrope'] leading-[8px]",children:x?`+$${e!=null&&e.rpnl?Cr(e==null?void 0:e.rpnl):"-"}`:g?`+$${e!=null&&e.earned_rpnl?Cr(e==null?void 0:e.earned_rpnl):"-"}`:v?Cr(e==null?void 0:e.copier_count):""})]}),i.jsx("div",{className:`${x?"bg-white/20":g?"bg-[#FF670029]":v?"bg-[#67FFBD29]":""} p-1.5 rounded-md inline-flex justify-center items-center gap-1`,children:i.jsx("div",{className:`${x?"text-white":g?"text-[#FF6700]":v?"text-[#67FFBD]":""} justify-start text-[11px] font-semibold font-['Manrope'] leading-[8px]`,children:x?"Top Follower Wallets":g?"Top Source Wallets":v?"Most Copied Wallets":""})}),i.jsx("div",{className:`${x?"bg-white/20":g?"bg-[#FF670029]":v?"bg-[#67FFBD29]":""} w-max p-1.5 rounded-md inline-flex justify-center items-center gap-1"
`,children:i.jsx("div",{className:`${x?"text-white":g?"text-[#FF6700]":v?"text-[#67FFBD]":""} justify-start text-[11px] font-semibold font-['Manrope'] leading-[8px]`,children:w?"1D":C?"7D":N?"30D":""})})]}),i.jsxs("div",{className:`${c?"justify-start":"justify-between"} flex items-center w-full mt-1.5`,children:[i.jsx("div",{onClick:R=>{R.stopPropagation(),l(o=="date"?"time":"date")},className:"flex justify-end items-center text-[#989898] text-[11px] font-medium font-['Inter'] leading-[13px] tracking-tight cursor-pointer min-w-max w-max italic",children:o=="date"?i.jsx(f,{date:t}):su(t)}),!c&&i.jsx("div",{className:"w-[26px] h-[3px] bg-[#3a3a3a] rounded overflow-hidden",children:!c&&i.jsx("div",{ref:d,className:"h-full bg-white progress-bar-animate"},`progress-${u}`)})]})]})]})},kLt=()=>i.jsx("div",{onClick:()=>{window.open("https://x.com/dextrabot","_blank")},className:"flex justify-center items-center bg-transparent rounded-full cursor-pointer h-6 w-6 min-h-6",children:i.jsx("img",{src:yyt,alt:"",className:"w-[14px] h-[14px]"})}),TLt=()=>i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank")},className:"flex justify-center items-center gap-2.5 bg-transparent rounded-2xl cursor-pointer h-6 w-6 min-h-6",children:i.jsx("img",{src:rke,alt:"",className:"w-[14px] h-[14px]"})}),ILt=()=>i.jsx("div",{onClick:()=>{window.open("https://t.me/Dextrabot_Official","_blank")},className:"flex justify-center items-center gap-2.5 bg-transparent rounded-2xl cursor-pointer h-6 w-6 min-h-6",children:i.jsx("img",{src:vyt,alt:"",className:"w-[14px] h-[14px]"})}),PLt=()=>i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/","_blank"),className:"h-6 w-max min-h-6 py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("img",{src:o5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]}),FLt=({open:e,setOpen:t,favoriteName:n,setFavoriteName:r,likeError:s,like:a,setLikeError:o})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-[34px]",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),r(""),o("")},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gbt,alt:"",className:"w-[64px h-[64px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manrope leading-7 pt-[3px]",children:"Track Wallet"}),i.jsx("div",{className:"w-[248px] text-center text-white/60 text-sm font-medium font-manrope leading-none tracking-tight -mt-[8px]",children:"Enter tag for your wallet"}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-full pt-[39px] pl-[20px]",children:[i.jsx("div",{className:"text-[#b7b7b7] text-[13px] font-semibold font-manrope leading-[8px]",children:"Tag"}),i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"(ex:twain_wallet)"})]}),i.jsx("input",{type:"text",value:n,onChange:l=>r(l.target.value),placeholder:"Wallet Tag",className:"px-2.5 py-3 focus:outline-none focus:ring-0 outline-none w-[286px] min-w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white placeholder:text-[#7b7b7b] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px] -mt-[2px]"}),i.jsxs("div",{onClick:()=>{a(n)},className:"w-[285px] h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer -mt-[2px]",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Track"})]}),i.jsx("div",{className:"text-[#ff6e67] text-xs font-semibold font-manrope absolute bottom-2.5 mx-auto w-full pl-[58px]",children:s&&s})]})]})})})})})]});function y5({walletAddress:e,children:t}){const{isConnected:n,address:r}=Jr(),{trackedWatchList:s,getTrackedWatchList:a,setSignModalOpen:o}=m.useContext(Qr),[l,c]=m.useState(""),[u,d]=m.useState(!1),[f,x]=m.useState(""),g=async C=>{try{const N=window.localStorage.getItem("hyperToken"),I="https://dextrabothypev2.nftinit.io/api/hyper/tracker/save/",P=window.localStorage.getItem("hyperAddress");if(N||o(!0),!C){x("Please enter a wallet label.");return}const R=await fetch(I,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:r?r.toLowerCase():P,token:N,track_address:e,tag:C})});R.ok;const F=await R.json();F.success?(a(),c(""),d(!1),x(""),ln.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:e.slice(0,5)+"..."+e.slice(-3)}),i.jsxs("span",{style:{color:"#67ffbd",paddingLeft:"5px"},children:[" ","added to tracked wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"380px",minWidth:"380px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})):(console.log(F.error_message),ln.error(F.error_message),x(F.error_message))}catch(N){console.error("Error in like function:",N),ln.error(N.message||"Something went wrong!"),x(N.message)}},v=async()=>{try{const C=window.localStorage.getItem("hyperToken"),N=window.localStorage.getItem("hyperAddress"),I="https://dextrabothypev2.nftinit.io/api/hyper/tracker/unfollow/";C||o(!0);const P=await fetch(I,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:r?r.toLowerCase():N,token:C,track_address:e})});if(!P.ok)throw new Error(`Failed to unlike: ${P.status} ${P.statusText}`);const R=await P.json();R.success?(a(),ln.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:e.slice(0,5)+"..."+e.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from tracked wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.error(R.error_message),ln.error(R.error_message))}catch(C){console.error("Error in unlike function:",C),ln.error(C.message||"Something went wrong!")}},w=()=>{window.localStorage.getItem("hyperToken")?d(!0):o(!0)};return i.jsxs(i.Fragment,{children:[i.jsx(FLt,{open:u,setOpen:d,like:g,favoriteName:l,setFavoriteName:c,likeError:f,setLikeError:x}),i.jsx("div",{className:"",onClick:()=>{s!=null&&s.some(C=>C.wallet_address===e)?v():w()},children:t})]})}function OLt({open:e,setOpen:t,copyTradeSave:n}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manropeleading-7",children:"Are you sure?"}),i.jsx("div",{className:"w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:"You have not set a Stop Loss or Take Profit for this trade. In order to set a secondary security option for potential Hyperliquid data delays, server issues, or other technical disruptions, you may want to set up your own stop loss and take profit values."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{n()},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Yes"})})]})]})})})})})]})}const ra=(e,t=null)=>{t&&e.target.src===t?e.target.src=Va:t&&e.target.src!==t?e.target.src=t:e.target.src!==Va&&(e.target.src=Va)};function MLt({positions:e,loading:t}){const[n,r]=m.useState(!1),[s,a]=m.useState("upnl"),[o,l]=m.useState("desc"),c=d=>{s===d?l(o==="asc"?"desc":"asc"):(a(d),l("asc"))},u=m.useMemo(()=>{if(!e||e.length===0)return[];const d=[...e];return s&&d.sort((f,x)=>{var g,v;if(s==="coin"){const w=((g=f.asset)==null?void 0:g.toLowerCase())||"",C=((v=x.asset)==null?void 0:v.toLowerCase())||"";return w<C?o==="asc"?-1:1:w>C?o==="asc"?1:-1:0}if(s==="upnl"){const w=parseFloat(f.unrealizedPnl)||0,C=parseFloat(x.unrealizedPnl)||0;return w<C?o==="asc"?-1:1:w>C?o==="asc"?1:-1:0}return 0}),d},[e,s,o]);return m.useEffect(()=>{if(t)r(!1);else{r(!1);const d=setTimeout(()=>{r(!0)},500);return()=>clearTimeout(d)}},[t]),t||!n?i.jsx("div",{className:"flex w-full justify-center items-center text-center h-[36vh] max-h-[170px]",children:i.jsx(Da,{})}):!u||u.length===0?i.jsx("div",{className:"flex w-full justify-center items-center text-center h-[36vh] max-h-[170px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No open positions are currently available"})})]})}):i.jsx("div",{className:"relative w-full",children:i.jsx("div",{className:"w-full overflow-y-auto max-h-[156px] h-full flex-grow mt-[1px] mb-3 pb-24",children:i.jsxs("table",{className:"w-full relative border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"sticky top-0 z-[3] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] bg-[#242424] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky left-0 h-10 pl-2 sm:pl-6 min-w-[80px] z-[8] cursor-pointer",onClick:()=>c("coin"),children:i.jsxs("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max",children:["Coin",s==="coin"?o==="asc"?i.jsx(I3,{}):i.jsx(T3,{}):i.jsx(P3,{})]})}),i.jsx("th",{scope:"col",className:"px-1",children:i.jsx("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max",children:"Type"})}),i.jsx("th",{scope:"col",className:"px-4 text-right cursor-pointer",onClick:()=>c("upnl"),children:i.jsxs("div",{className:"inline-flex items-center justify-end w-full gap-1",children:[i.jsx("span",{children:"uPnL"}),s==="upnl"?o==="asc"?i.jsx(I3,{}):i.jsx(T3,{}):i.jsx(P3,{})]})})]})}),i.jsx("tbody",{children:u.map((d,f)=>{const x=parseFloat(d.unrealizedPnl)>=0,g=d.type==="Long"?"text-[#67FFBD] rotate-180":"text-[#FF797C]";return i.jsxs("tr",{className:`relative group hover:bg-[#222222] text-white h-[32px] max-h-[32px] rounded-2xl ${f%2===0?"bg-[#202020]":"bg-[#2D2D2D]"}`,children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] rounded-l-xl",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${d==null?void 0:d.asset}`,"_blank")},className:"flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${d==null?void 0:d.asset}.svg`,alt:d==null?void 0:d.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:v=>ra(v)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:d.asset})]})})}),i.jsx("td",{children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${d.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:i.jsx(Ts,{className:`${g} w-3 h-3`})})}),i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:d.type})]})})}),i.jsx("td",{className:"rounded-r-xl text-right pr-2",children:i.jsx("div",{className:`${x?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-tight`,children:`$${Cr(d.unrealizedPnl||0)}`})})]},f)})})]})})})}const{min:RLt,max:LLt}=Math,r3=(e,t=0,n=1)=>RLt(LLt(t,e),n),xle=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=r3(e[t],0,255)):t===3&&(e[t]=r3(e[t],0,1));return e},NLe={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])NLe[`[object ${e}]`]=e.toLowerCase();function Hi(e){return NLe[Object.prototype.toString.call(e)]||"object"}const Ti=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):Hi(e[0])=="object"&&t?t.split("").filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),zA=e=>{if(e.length<2)return null;const t=e.length-1;return Hi(e[t])=="string"?e[t].toLowerCase():null},{PI:_$,min:ALe,max:jLe}=Math,tp=e=>Math.round(e*100)/100,tte=e=>Math.round(e*100)/100,pg=_$*2,AW=_$/3,DLt=_$/180,BLt=180/_$;function ELe(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const Ai={format:{},autodetect:[]};let Xr=class{constructor(...t){const n=this;if(Hi(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=zA(t),s=!1;if(!r){s=!0,Ai.sorted||(Ai.autodetect=Ai.autodetect.sort((a,o)=>o.p-a.p),Ai.sorted=!0);for(let a of Ai.autodetect)if(r=a.test(...t),r)break}if(Ai.format[r]){const a=Ai.format[r].apply(null,s?t:t.slice(0,-1));n._rgb=xle(a)}else throw new Error("unknown format: "+t);n._rgb.length===3&&n._rgb.push(1)}toString(){return Hi(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const $Lt="3.1.2",hi=(...e)=>new Xr(...e);hi.version=$Lt;const bN={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},ULt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,zLt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,_Le=e=>{if(e.match(ULt)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e,16),n=t>>16,r=t>>8&255,s=t&255;return[n,r,s,1]}if(e.match(zLt)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e,16),n=t>>24&255,r=t>>16&255,s=t>>8&255,a=Math.round((t&255)/255*100)/100;return[n,r,s,a]}throw new Error(`unknown hex color: ${e}`)},{round:yP}=Math,kLe=(...e)=>{let[t,n,r,s]=Ti(e,"rgba"),a=zA(e)||"auto";s===void 0&&(s=1),a==="auto"&&(a=s<1?"rgba":"rgb"),t=yP(t),n=yP(n),r=yP(r);let l="000000"+(t<<16|n<<8|r).toString(16);l=l.substr(l.length-6);let c="0"+yP(s*255).toString(16);switch(c=c.substr(c.length-2),a.toLowerCase()){case"rgba":return`#${l}${c}`;case"argb":return`#${c}${l}`;default:return`#${l}`}};Xr.prototype.name=function(){const e=kLe(this._rgb,"rgb");for(let t of Object.keys(bN))if(bN[t]===e)return t.toLowerCase();return e};Ai.format.named=e=>{if(e=e.toLowerCase(),bN[e])return _Le(bN[e]);throw new Error("unknown color name: "+e)};Ai.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Hi(e)==="string"&&bN[e.toLowerCase()])return"named"}});Xr.prototype.alpha=function(e,t=!1){return e!==void 0&&Hi(e)==="number"?t?(this._rgb[3]=e,this):new Xr([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};Xr.prototype.clipped=function(){return this._rgb._clipped||!1};const $0={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},HLt=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Rg(e){const t=HLt.get(String(e).toLowerCase());if(!t)throw new Error("unknown Lab illuminant "+e);$0.labWhitePoint=e,$0.Xn=t[0],$0.Zn=t[1]}function t_(){return $0.labWhitePoint}const gle=(...e)=>{e=Ti(e,"lab");const[t,n,r]=e,[s,a,o]=VLt(t,n,r),[l,c,u]=TLe(s,a,o);return[l,c,u,e.length>3?e[3]:1]},VLt=(e,t,n)=>{const{kE:r,kK:s,kKE:a,Xn:o,Yn:l,Zn:c}=$0,u=(e+16)/116,d=.002*t+u,f=u-.005*n,x=d*d*d,g=f*f*f,v=x>r?x:(116*d-16)/s,w=e>a?Math.pow((e+16)/116,3):e/s,C=g>r?g:(116*f-16)/s,N=v*o,I=w*l,P=C*c;return[N,I,P]},jW=e=>{const t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055)*t},TLe=(e,t,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:s,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:l,Yn:c,Zn:u}=$0,d=l*r.m00+c*r.m10+u*r.m20,f=l*r.m01+c*r.m11+u*r.m21,x=l*r.m02+c*r.m12+u*r.m22,g=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,v=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,w=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,C=(e*r.m00+t*r.m10+n*r.m20)*(g/d),N=(e*r.m01+t*r.m11+n*r.m21)*(v/f),I=(e*r.m02+t*r.m12+n*r.m22)*(w/x),P=C*s.m00+N*s.m10+I*s.m20,R=C*s.m01+N*s.m11+I*s.m21,F=C*s.m02+N*s.m12+I*s.m22,U=jW(P*a.m00+R*a.m10+F*a.m20),L=jW(P*a.m01+R*a.m11+F*a.m21),z=jW(P*a.m02+R*a.m12+F*a.m22);return[U*255,L*255,z*255]},ble=(...e)=>{const[t,n,r,...s]=Ti(e,"rgb"),[a,o,l]=ILe(t,n,r),[c,u,d]=WLt(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};function WLt(e,t,n){const{Xn:r,Yn:s,Zn:a,kE:o,kK:l}=$0,c=e/r,u=t/s,d=n/a,f=c>o?Math.pow(c,1/3):(l*c+16)/116,x=u>o?Math.pow(u,1/3):(l*u+16)/116,g=d>o?Math.pow(d,1/3):(l*d+16)/116;return[116*x-16,500*(f-x),200*(x-g)]}function EW(e){const t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4))*t}const ILe=(e,t,n)=>{e=EW(e/255),t=EW(t/255),n=EW(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:s,MtxAdaptMaI:a,Xn:o,Yn:l,Zn:c,As:u,Bs:d,Cs:f}=$0;let x=e*r.m00+t*r.m10+n*r.m20,g=e*r.m01+t*r.m11+n*r.m21,v=e*r.m02+t*r.m12+n*r.m22;const w=o*s.m00+l*s.m10+c*s.m20,C=o*s.m01+l*s.m11+c*s.m21,N=o*s.m02+l*s.m12+c*s.m22;let I=x*s.m00+g*s.m10+v*s.m20,P=x*s.m01+g*s.m11+v*s.m21,R=x*s.m02+g*s.m12+v*s.m22;return I*=w/u,P*=C/d,R*=N/f,x=I*a.m00+P*a.m10+R*a.m20,g=I*a.m01+P*a.m11+R*a.m21,v=I*a.m02+P*a.m12+R*a.m22,[x,g,v]};Xr.prototype.lab=function(){return ble(this._rgb)};const qLt=(...e)=>new Xr(...e,"lab");Object.assign(hi,{lab:qLt,getLabWhitePoint:t_,setLabWhitePoint:Rg});Ai.format.lab=gle;Ai.autodetect.push({p:2,test:(...e)=>{if(e=Ti(e,"lab"),Hi(e)==="array"&&e.length===3)return"lab"}});Xr.prototype.darken=function(e=1){const t=this,n=t.lab();return n[0]-=$0.Kn*e,new Xr(n,"lab").alpha(t.alpha(),!0)};Xr.prototype.brighten=function(e=1){return this.darken(-e)};Xr.prototype.darker=Xr.prototype.darken;Xr.prototype.brighter=Xr.prototype.brighten;Xr.prototype.get=function(e){const[t,n]=e.split("."),r=this[t]();if(n){const s=t.indexOf(n)-(t.substr(0,2)==="ok"?2:0);if(s>-1)return r[s];throw new Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:GLt}=Math,KLt=1e-7,YLt=20;Xr.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&Hi(e)==="number"){if(e===0)return new Xr([0,0,0,this._rgb[3]],"rgb");if(e===1)return new Xr([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=YLt;const s=(o,l)=>{const c=o.interpolate(l,.5,t),u=c.luminance();return Math.abs(e-u)<KLt||!r--?c:u>e?s(o,c):s(c,l)},a=(n>e?s(new Xr([0,0,0]),this):s(this,new Xr([255,255,255]))).rgb();return new Xr([...a,this._rgb[3]])}return XLt(...this._rgb.slice(0,3))};const XLt=(e,t,n)=>(e=_W(e),t=_W(t),n=_W(n),.2126*e+.7152*t+.0722*n),_W=e=>(e/=255,e<=.03928?e/12.92:GLt((e+.055)/1.055,2.4)),Fu={},yN=(e,t,n=.5,...r)=>{let s=r[0]||"lrgb";if(!Fu[s]&&!r.length&&(s=Object.keys(Fu)[0]),!Fu[s])throw new Error(`interpolation mode ${s} is not defined`);return Hi(e)!=="object"&&(e=new Xr(e)),Hi(t)!=="object"&&(t=new Xr(t)),Fu[s](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};Xr.prototype.mix=Xr.prototype.interpolate=function(e,t=.5,...n){return yN(this,e,t,...n)};Xr.prototype.premultiply=function(e=!1){const t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new Xr([t[0]*n,t[1]*n,t[2]*n,n],"rgb")};const{sin:QLt,cos:ZLt}=Math,PLe=(...e)=>{let[t,n,r]=Ti(e,"lch");return isNaN(r)&&(r=0),r=r*DLt,[t,ZLt(r)*n,QLt(r)*n]},yle=(...e)=>{e=Ti(e,"lch");const[t,n,r]=e,[s,a,o]=PLe(t,n,r),[l,c,u]=gle(s,a,o);return[l,c,u,e.length>3?e[3]:1]},JLt=(...e)=>{const t=ELe(Ti(e,"hcl"));return yle(...t)},{sqrt:eDt,atan2:tDt,round:nDt}=Math,FLe=(...e)=>{const[t,n,r]=Ti(e,"lab"),s=eDt(n*n+r*r);let a=(tDt(r,n)*BLt+360)%360;return nDt(s*1e4)===0&&(a=Number.NaN),[t,s,a]},vle=(...e)=>{const[t,n,r,...s]=Ti(e,"rgb"),[a,o,l]=ble(t,n,r),[c,u,d]=FLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};Xr.prototype.lch=function(){return vle(this._rgb)};Xr.prototype.hcl=function(){return ELe(vle(this._rgb))};const rDt=(...e)=>new Xr(...e,"lch"),sDt=(...e)=>new Xr(...e,"hcl");Object.assign(hi,{lch:rDt,hcl:sDt});Ai.format.lch=yle;Ai.format.hcl=JLt;["lch","hcl"].forEach(e=>Ai.autodetect.push({p:2,test:(...t)=>{if(t=Ti(t,e),Hi(t)==="array"&&t.length===3)return e}}));Xr.prototype.saturate=function(e=1){const t=this,n=t.lch();return n[1]+=$0.Kn*e,n[1]<0&&(n[1]=0),new Xr(n,"lch").alpha(t.alpha(),!0)};Xr.prototype.desaturate=function(e=1){return this.saturate(-e)};Xr.prototype.set=function(e,t,n=!1){const[r,s]=e.split("."),a=this[r]();if(s){const o=r.indexOf(s)-(r.substr(0,2)==="ok"?2:0);if(o>-1){if(Hi(t)=="string")switch(t.charAt(0)){case"+":a[o]+=+t;break;case"-":a[o]+=+t;break;case"*":a[o]*=+t.substr(1);break;case"/":a[o]/=+t.substr(1);break;default:a[o]=+t}else if(Hi(t)==="number")a[o]=t;else throw new Error("unsupported value for Color.set");const l=new Xr(a,r);return n?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${s} in mode ${r}`)}else return a};Xr.prototype.tint=function(e=.5,...t){return yN(this,"white",e,...t)};Xr.prototype.shade=function(e=.5,...t){return yN(this,"black",e,...t)};const iDt=(e,t,n)=>{const r=e._rgb,s=t._rgb;return new Xr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"rgb")};Fu.rgb=iDt;const{sqrt:kW,pow:X6}=Math,aDt=(e,t,n)=>{const[r,s,a]=e._rgb,[o,l,c]=t._rgb;return new Xr(kW(X6(r,2)*(1-n)+X6(o,2)*n),kW(X6(s,2)*(1-n)+X6(l,2)*n),kW(X6(a,2)*(1-n)+X6(c,2)*n),"rgb")};Fu.lrgb=aDt;const oDt=(e,t,n)=>{const r=e.lab(),s=t.lab();return new Xr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"lab")};Fu.lab=oDt;const HA=(e,t,n,r)=>{let s,a;r==="hsl"?(s=e.hsl(),a=t.hsl()):r==="hsv"?(s=e.hsv(),a=t.hsv()):r==="hcg"?(s=e.hcg(),a=t.hcg()):r==="hsi"?(s=e.hsi(),a=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",s=e.hcl(),a=t.hcl()):r==="oklch"&&(s=e.oklch().reverse(),a=t.oklch().reverse());let o,l,c,u,d,f;(r.substr(0,1)==="h"||r==="oklch")&&([o,c,d]=s,[l,u,f]=a);let x,g,v,w;return!isNaN(o)&&!isNaN(l)?(l>o&&l-o>180?w=l-(o+360):l<o&&o-l>180?w=l+360-o:w=l-o,g=o+n*w):isNaN(o)?isNaN(l)?g=Number.NaN:(g=l,(d==1||d==0)&&r!="hsv"&&(x=u)):(g=o,(f==1||f==0)&&r!="hsv"&&(x=c)),x===void 0&&(x=c+n*(u-c)),v=d+n*(f-d),r==="oklch"?new Xr([v,x,g],r):new Xr([g,x,v],r)},OLe=(e,t,n)=>HA(e,t,n,"lch");Fu.lch=OLe;Fu.hcl=OLe;const lDt=e=>{if(Hi(e)=="number"&&e>=0&&e<=16777215){const t=e>>16,n=e>>8&255,r=e&255;return[t,n,r,1]}throw new Error("unknown num color: "+e)},cDt=(...e)=>{const[t,n,r]=Ti(e,"rgb");return(t<<16)+(n<<8)+r};Xr.prototype.num=function(){return cDt(this._rgb)};const uDt=(...e)=>new Xr(...e,"num");Object.assign(hi,{num:uDt});Ai.format.num=lDt;Ai.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&Hi(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return"num"}});const dDt=(e,t,n)=>{const r=e.num(),s=t.num();return new Xr(r+n*(s-r),"num")};Fu.num=dDt;const{floor:fDt}=Math,hDt=(...e)=>{e=Ti(e,"hcg");let[t,n,r]=e,s,a,o;r=r*255;const l=n*255;if(n===0)s=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const c=fDt(t),u=t-c,d=r*(1-n),f=d+l*(1-u),x=d+l*u,g=d+l;switch(c){case 0:[s,a,o]=[g,x,d];break;case 1:[s,a,o]=[f,g,d];break;case 2:[s,a,o]=[d,g,x];break;case 3:[s,a,o]=[d,f,g];break;case 4:[s,a,o]=[x,d,g];break;case 5:[s,a,o]=[g,d,f];break}}return[s,a,o,e.length>3?e[3]:1]},pDt=(...e)=>{const[t,n,r]=Ti(e,"rgb"),s=ALe(t,n,r),a=jLe(t,n,r),o=a-s,l=o*100/255,c=s/(255-o)*100;let u;return o===0?u=Number.NaN:(t===a&&(u=(n-r)/o),n===a&&(u=2+(r-t)/o),r===a&&(u=4+(t-n)/o),u*=60,u<0&&(u+=360)),[u,l,c]};Xr.prototype.hcg=function(){return pDt(this._rgb)};const mDt=(...e)=>new Xr(...e,"hcg");hi.hcg=mDt;Ai.format.hcg=hDt;Ai.autodetect.push({p:1,test:(...e)=>{if(e=Ti(e,"hcg"),Hi(e)==="array"&&e.length===3)return"hcg"}});const xDt=(e,t,n)=>HA(e,t,n,"hcg");Fu.hcg=xDt;const{cos:Q6}=Math,gDt=(...e)=>{e=Ti(e,"hsi");let[t,n,r]=e,s,a,o;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(o=(1-n)/3,s=(1+n*Q6(pg*t)/Q6(AW-pg*t))/3,a=1-(o+s)):t<2/3?(t-=1/3,s=(1-n)/3,a=(1+n*Q6(pg*t)/Q6(AW-pg*t))/3,o=1-(s+a)):(t-=2/3,a=(1-n)/3,o=(1+n*Q6(pg*t)/Q6(AW-pg*t))/3,s=1-(a+o)),s=r3(r*s*3),a=r3(r*a*3),o=r3(r*o*3),[s*255,a*255,o*255,e.length>3?e[3]:1]},{min:bDt,sqrt:yDt,acos:vDt}=Math,wDt=(...e)=>{let[t,n,r]=Ti(e,"rgb");t/=255,n/=255,r/=255;let s;const a=bDt(t,n,r),o=(t+n+r)/3,l=o>0?1-a/o:0;return l===0?s=NaN:(s=(t-n+(t-r))/2,s/=yDt((t-n)*(t-n)+(t-r)*(n-r)),s=vDt(s),r>n&&(s=pg-s),s/=pg),[s*360,l,o]};Xr.prototype.hsi=function(){return wDt(this._rgb)};const CDt=(...e)=>new Xr(...e,"hsi");hi.hsi=CDt;Ai.format.hsi=gDt;Ai.autodetect.push({p:2,test:(...e)=>{if(e=Ti(e,"hsi"),Hi(e)==="array"&&e.length===3)return"hsi"}});const SDt=(e,t,n)=>HA(e,t,n,"hsi");Fu.hsi=SDt;const nte=(...e)=>{e=Ti(e,"hsl");const[t,n,r]=e;let s,a,o;if(n===0)s=a=o=r*255;else{const l=[0,0,0],c=[0,0,0],u=r<.5?r*(1+n):r+n-r*n,d=2*r-u,f=t/360;l[0]=f+1/3,l[1]=f,l[2]=f-1/3;for(let x=0;x<3;x++)l[x]<0&&(l[x]+=1),l[x]>1&&(l[x]-=1),6*l[x]<1?c[x]=d+(u-d)*6*l[x]:2*l[x]<1?c[x]=u:3*l[x]<2?c[x]=d+(u-d)*(2/3-l[x])*6:c[x]=d;[s,a,o]=[c[0]*255,c[1]*255,c[2]*255]}return e.length>3?[s,a,o,e[3]]:[s,a,o,1]},MLe=(...e)=>{e=Ti(e,"rgba");let[t,n,r]=e;t/=255,n/=255,r/=255;const s=ALe(t,n,r),a=jLe(t,n,r),o=(a+s)/2;let l,c;return a===s?(l=0,c=Number.NaN):l=o<.5?(a-s)/(a+s):(a-s)/(2-a-s),t==a?c=(n-r)/(a-s):n==a?c=2+(r-t)/(a-s):r==a&&(c=4+(t-n)/(a-s)),c*=60,c<0&&(c+=360),e.length>3&&e[3]!==void 0?[c,l,o,e[3]]:[c,l,o]};Xr.prototype.hsl=function(){return MLe(this._rgb)};const NDt=(...e)=>new Xr(...e,"hsl");hi.hsl=NDt;Ai.format.hsl=nte;Ai.autodetect.push({p:2,test:(...e)=>{if(e=Ti(e,"hsl"),Hi(e)==="array"&&e.length===3)return"hsl"}});const ADt=(e,t,n)=>HA(e,t,n,"hsl");Fu.hsl=ADt;const{floor:jDt}=Math,EDt=(...e)=>{e=Ti(e,"hsv");let[t,n,r]=e,s,a,o;if(r*=255,n===0)s=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const l=jDt(t),c=t-l,u=r*(1-n),d=r*(1-n*c),f=r*(1-n*(1-c));switch(l){case 0:[s,a,o]=[r,f,u];break;case 1:[s,a,o]=[d,r,u];break;case 2:[s,a,o]=[u,r,f];break;case 3:[s,a,o]=[u,d,r];break;case 4:[s,a,o]=[f,u,r];break;case 5:[s,a,o]=[r,u,d];break}}return[s,a,o,e.length>3?e[3]:1]},{min:_Dt,max:kDt}=Math,TDt=(...e)=>{e=Ti(e,"rgb");let[t,n,r]=e;const s=_Dt(t,n,r),a=kDt(t,n,r),o=a-s;let l,c,u;return u=a/255,a===0?(l=Number.NaN,c=0):(c=o/a,t===a&&(l=(n-r)/o),n===a&&(l=2+(r-t)/o),r===a&&(l=4+(t-n)/o),l*=60,l<0&&(l+=360)),[l,c,u]};Xr.prototype.hsv=function(){return TDt(this._rgb)};const IDt=(...e)=>new Xr(...e,"hsv");hi.hsv=IDt;Ai.format.hsv=EDt;Ai.autodetect.push({p:2,test:(...e)=>{if(e=Ti(e,"hsv"),Hi(e)==="array"&&e.length===3)return"hsv"}});const PDt=(e,t,n)=>HA(e,t,n,"hsv");Fu.hsv=PDt;function $R(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(o=>[o]));let r=t[0].length,s=t[0].map((o,l)=>t.map(c=>c[l])),a=e.map(o=>s.map(l=>Array.isArray(o)?o.reduce((c,u,d)=>c+u*(l[d]||0),0):l.reduce((c,u)=>c+u*o,0)));return n===1&&(a=a[0]),r===1?a.map(o=>o[0]):a}const wle=(...e)=>{e=Ti(e,"lab");const[t,n,r,...s]=e,[a,o,l]=FDt([t,n,r]),[c,u,d]=TLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};function FDt(e){var t=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=$R(n,e);return $R(t,r.map(s=>s**3))}const Cle=(...e)=>{const[t,n,r,...s]=Ti(e,"rgb"),a=ILe(t,n,r);return[...ODt(a),...s.length>0&&s[0]<1?[s[0]]:[]]};function ODt(e){const t=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=$R(t,e);return $R(n,r.map(s=>Math.cbrt(s)))}Xr.prototype.oklab=function(){return Cle(this._rgb)};const MDt=(...e)=>new Xr(...e,"oklab");Object.assign(hi,{oklab:MDt});Ai.format.oklab=wle;Ai.autodetect.push({p:2,test:(...e)=>{if(e=Ti(e,"oklab"),Hi(e)==="array"&&e.length===3)return"oklab"}});const RDt=(e,t,n)=>{const r=e.oklab(),s=t.oklab();return new Xr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"oklab")};Fu.oklab=RDt;const LDt=(e,t,n)=>HA(e,t,n,"oklch");Fu.oklch=LDt;const{pow:TW,sqrt:IW,PI:PW,cos:Gbe,sin:Kbe,atan2:DDt}=Math,BDt=(e,t="lrgb",n=null)=>{const r=e.length;n||(n=Array.from(new Array(r)).map(()=>1));const s=r/n.reduce(function(f,x){return f+x});if(n.forEach((f,x)=>{n[x]*=s}),e=e.map(f=>new Xr(f)),t==="lrgb")return $Dt(e,n);const a=e.shift(),o=a.get(t),l=[];let c=0,u=0;for(let f=0;f<o.length;f++)if(o[f]=(o[f]||0)*n[0],l.push(isNaN(o[f])?0:n[0]),t.charAt(f)==="h"&&!isNaN(o[f])){const x=o[f]/180*PW;c+=Gbe(x)*n[0],u+=Kbe(x)*n[0]}let d=a.alpha()*n[0];e.forEach((f,x)=>{const g=f.get(t);d+=f.alpha()*n[x+1];for(let v=0;v<o.length;v++)if(!isNaN(g[v]))if(l[v]+=n[x+1],t.charAt(v)==="h"){const w=g[v]/180*PW;c+=Gbe(w)*n[x+1],u+=Kbe(w)*n[x+1]}else o[v]+=g[v]*n[x+1]});for(let f=0;f<o.length;f++)if(t.charAt(f)==="h"){let x=DDt(u/l[f],c/l[f])/PW*180;for(;x<0;)x+=360;for(;x>=360;)x-=360;o[f]=x}else o[f]=o[f]/l[f];return d/=r,new Xr(o,t).alpha(d>.99999?1:d,!0)},$Dt=(e,t)=>{const n=e.length,r=[0,0,0,0];for(let s=0;s<e.length;s++){const a=e[s],o=t[s]/n,l=a._rgb;r[0]+=TW(l[0],2)*o,r[1]+=TW(l[1],2)*o,r[2]+=TW(l[2],2)*o,r[3]+=l[3]*o}return r[0]=IW(r[0]),r[1]=IW(r[1]),r[2]=IW(r[2]),r[3]>.9999999&&(r[3]=1),new Xr(xle(r))},{pow:UDt}=Math;function UR(e){let t="rgb",n=hi("#ccc"),r=0,s=[0,1],a=[],o=[0,0],l=!1,c=[],u=!1,d=0,f=1,x=!1,g={},v=!0,w=1;const C=function(L){if(L=L||["#fff","#000"],L&&Hi(L)==="string"&&hi.brewer&&hi.brewer[L.toLowerCase()]&&(L=hi.brewer[L.toLowerCase()]),Hi(L)==="array"){L.length===1&&(L=[L[0],L[0]]),L=L.slice(0);for(let z=0;z<L.length;z++)L[z]=hi(L[z]);a.length=0;for(let z=0;z<L.length;z++)a.push(z/(L.length-1))}return F(),c=L},N=function(L){if(l!=null){const z=l.length-1;let Q=0;for(;Q<z&&L>=l[Q];)Q++;return Q-1}return 0};let I=L=>L,P=L=>L;const R=function(L,z){let Q,ne;if(z==null&&(z=!1),isNaN(L)||L===null)return n;z?ne=L:l&&l.length>2?ne=N(L)/(l.length-2):f!==d?ne=(L-d)/(f-d):ne=1,ne=P(ne),z||(ne=I(ne)),w!==1&&(ne=UDt(ne,w)),ne=o[0]+ne*(1-o[0]-o[1]),ne=r3(ne,0,1);const J=Math.floor(ne*1e4);if(v&&g[J])Q=g[J];else{if(Hi(c)==="array")for(let X=0;X<a.length;X++){const re=a[X];if(ne<=re){Q=c[X];break}if(ne>=re&&X===a.length-1){Q=c[X];break}if(ne>re&&ne<a[X+1]){ne=(ne-re)/(a[X+1]-re),Q=hi.interpolate(c[X],c[X+1],ne,t);break}}else Hi(c)==="function"&&(Q=c(ne));v&&(g[J]=Q)}return Q};var F=()=>g={};C(e);const U=function(L){const z=hi(R(L));return u&&z[u]?z[u]():z};return U.classes=function(L){if(L!=null){if(Hi(L)==="array")l=L,s=[L[0],L[L.length-1]];else{const z=hi.analyze(s);L===0?l=[z.min,z.max]:l=hi.limits(z,"e",L)}return U}return l},U.domain=function(L){if(!arguments.length)return s;d=L[0],f=L[L.length-1],a=[];const z=c.length;if(L.length===z&&d!==f)for(let Q of Array.from(L))a.push((Q-d)/(f-d));else{for(let Q=0;Q<z;Q++)a.push(Q/(z-1));if(L.length>2){const Q=L.map((J,X)=>X/(L.length-1)),ne=L.map(J=>(J-d)/(f-d));ne.every((J,X)=>Q[X]===J)||(P=J=>{if(J<=0||J>=1)return J;let X=0;for(;J>=ne[X+1];)X++;const re=(J-ne[X])/(ne[X+1]-ne[X]);return Q[X]+re*(Q[X+1]-Q[X])})}}return s=[d,f],U},U.mode=function(L){return arguments.length?(t=L,F(),U):t},U.range=function(L,z){return C(L),U},U.out=function(L){return u=L,U},U.spread=function(L){return arguments.length?(r=L,U):r},U.correctLightness=function(L){return L==null&&(L=!0),x=L,F(),x?I=function(z){const Q=R(0,!0).lab()[0],ne=R(1,!0).lab()[0],J=Q>ne;let X=R(z,!0).lab()[0];const re=Q+(ne-Q)*z;let pe=X-re,Y=0,ie=1,oe=20;for(;Math.abs(pe)>.01&&oe-- >0;)(function(){return J&&(pe*=-1),pe<0?(Y=z,z+=(ie-z)*.5):(ie=z,z+=(Y-z)*.5),X=R(z,!0).lab()[0],pe=X-re})();return z}:I=z=>z,U},U.padding=function(L){return L!=null?(Hi(L)==="number"&&(L=[L,L]),o=L,U):o},U.colors=function(L,z){arguments.length<2&&(z="hex");let Q=[];if(arguments.length===0)Q=c.slice(0);else if(L===1)Q=[U(.5)];else if(L>1){const ne=s[0],J=s[1]-ne;Q=zDt(0,L).map(X=>U(ne+X/(L-1)*J))}else{e=[];let ne=[];if(l&&l.length>2)for(let J=1,X=l.length,re=1<=X;re?J<X:J>X;re?J++:J--)ne.push((l[J-1]+l[J])*.5);else ne=s;Q=ne.map(J=>U(J))}return hi[z]&&(Q=Q.map(ne=>ne[z]())),Q},U.cache=function(L){return L!=null?(v=L,U):v},U.gamma=function(L){return L!=null?(w=L,U):w},U.nodata=function(L){return L!=null?(n=hi(L),U):n},U}function zDt(e,t,n){let r=[],s=e<t,a=t;for(let o=e;s?o<a:o>a;s?o++:o--)r.push(o);return r}const HDt=function(e){let t=[1,1];for(let n=1;n<e;n++){let r=[1];for(let s=1;s<=t.length;s++)r[s]=(t[s]||0)+t[s-1];t=r}return t},VDt=function(e){let t,n,r,s;if(e=e.map(a=>new Xr(a)),e.length===2)[n,r]=e.map(a=>a.lab()),t=function(a){const o=[0,1,2].map(l=>n[l]+a*(r[l]-n[l]));return new Xr(o,"lab")};else if(e.length===3)[n,r,s]=e.map(a=>a.lab()),t=function(a){const o=[0,1,2].map(l=>(1-a)*(1-a)*n[l]+2*(1-a)*a*r[l]+a*a*s[l]);return new Xr(o,"lab")};else if(e.length===4){let a;[n,r,s,a]=e.map(o=>o.lab()),t=function(o){const l=[0,1,2].map(c=>(1-o)*(1-o)*(1-o)*n[c]+3*(1-o)*(1-o)*o*r[c]+3*(1-o)*o*o*s[c]+o*o*o*a[c]);return new Xr(l,"lab")}}else if(e.length>=5){let a,o,l;a=e.map(c=>c.lab()),l=e.length-1,o=HDt(l),t=function(c){const u=1-c,d=[0,1,2].map(f=>a.reduce((x,g,v)=>x+o[v]*u**(l-v)*c**v*g[f],0));return new Xr(d,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return t},WDt=e=>{const t=VDt(e);return t.scale=()=>UR(t),t},{round:RLe}=Math;Xr.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(RLe)};Xr.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:RLe(t):t)};const qDt=(...e)=>new Xr(...e,"rgb");Object.assign(hi,{rgb:qDt});Ai.format.rgb=(...e)=>{const t=Ti(e,"rgba");return t[3]===void 0&&(t[3]=1),t};Ai.autodetect.push({p:3,test:(...e)=>{if(e=Ti(e,"rgba"),Hi(e)==="array"&&(e.length===3||e.length===4&&Hi(e[3])=="number"&&e[3]>=0&&e[3]<=1))return"rgb"}});const vm=(e,t,n)=>{if(!vm[n])throw new Error("unknown blend mode "+n);return vm[n](e,t)},f2=e=>(t,n)=>{const r=hi(n).rgb(),s=hi(t).rgb();return hi.rgb(e(r,s))},h2=e=>(t,n)=>{const r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},GDt=e=>e,KDt=(e,t)=>e*t/255,YDt=(e,t)=>e>t?t:e,XDt=(e,t)=>e>t?e:t,QDt=(e,t)=>255*(1-(1-e/255)*(1-t/255)),ZDt=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),JDt=(e,t)=>255*(1-(1-t/255)/(e/255)),eBt=(e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e);vm.normal=f2(h2(GDt));vm.multiply=f2(h2(KDt));vm.screen=f2(h2(QDt));vm.overlay=f2(h2(ZDt));vm.darken=f2(h2(YDt));vm.lighten=f2(h2(XDt));vm.dodge=f2(h2(eBt));vm.burn=f2(h2(JDt));const{pow:tBt,sin:nBt,cos:rBt}=Math;function sBt(e=300,t=-1.5,n=1,r=1,s=[0,1]){let a=0,o;Hi(s)==="array"?o=s[1]-s[0]:(o=0,s=[s,s]);const l=function(c){const u=pg*((e+120)/360+t*c),d=tBt(s[0]+o*c,r),x=(a!==0?n[0]+c*a:n)*d*(1-d)/2,g=rBt(u),v=nBt(u),w=d+x*(-.14861*g+1.78277*v),C=d+x*(-.29227*g-.90649*v),N=d+x*(1.97294*g);return hi(xle([w*255,C*255,N*255,1]))};return l.start=function(c){return c==null?e:(e=c,l)},l.rotations=function(c){return c==null?t:(t=c,l)},l.gamma=function(c){return c==null?r:(r=c,l)},l.hue=function(c){return c==null?n:(n=c,Hi(n)==="array"?(a=n[1]-n[0],a===0&&(n=n[1])):a=0,l)},l.lightness=function(c){return c==null?s:(Hi(c)==="array"?(s=c,o=c[1]-c[0]):(s=[c,c],o=0),l)},l.scale=()=>hi.scale(l),l.hue(n),l}const iBt="0123456789abcdef",{floor:aBt,random:oBt}=Math,lBt=()=>{let e="#";for(let t=0;t<6;t++)e+=iBt.charAt(aBt(oBt()*16));return new Xr(e,"hex")},{log:Ybe,pow:cBt,floor:uBt,abs:dBt}=Math;function LLe(e,t=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Hi(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&Hi(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,s)=>DLe(n,r,s),n}function DLe(e,t="equal",n=7){Hi(e)=="array"&&(e=LLe(e));const{min:r,max:s}=e,a=e.values.sort((l,c)=>l-c);if(n===1)return[r,s];const o=[];if(t.substr(0,1)==="c"&&(o.push(r),o.push(s)),t.substr(0,1)==="e"){o.push(r);for(let l=1;l<n;l++)o.push(r+l/n*(s-r));o.push(s)}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const l=Math.LOG10E*Ybe(r),c=Math.LOG10E*Ybe(s);o.push(r);for(let u=1;u<n;u++)o.push(cBt(10,l+u/n*(c-l)));o.push(s)}else if(t.substr(0,1)==="q"){o.push(r);for(let l=1;l<n;l++){const c=(a.length-1)*l/n,u=uBt(c);if(u===c)o.push(a[u]);else{const d=c-u;o.push(a[u]*(1-d)+a[u+1]*d)}}o.push(s)}else if(t.substr(0,1)==="k"){let l;const c=a.length,u=new Array(c),d=new Array(n);let f=!0,x=0,g=null;g=[],g.push(r);for(let C=1;C<n;C++)g.push(r+C/n*(s-r));for(g.push(s);f;){for(let N=0;N<n;N++)d[N]=0;for(let N=0;N<c;N++){const I=a[N];let P=Number.MAX_VALUE,R;for(let F=0;F<n;F++){const U=dBt(g[F]-I);U<P&&(P=U,R=F),d[R]++,u[N]=R}}const C=new Array(n);for(let N=0;N<n;N++)C[N]=null;for(let N=0;N<c;N++)l=u[N],C[l]===null?C[l]=a[N]:C[l]+=a[N];for(let N=0;N<n;N++)C[N]*=1/d[N];f=!1;for(let N=0;N<n;N++)if(C[N]!==g[N]){f=!0;break}g=C,x++,x>200&&(f=!1)}const v={};for(let C=0;C<n;C++)v[C]=[];for(let C=0;C<c;C++)l=u[C],v[l].push(a[C]);let w=[];for(let C=0;C<n;C++)w.push(v[C][0]),w.push(v[C][v[C].length-1]);w=w.sort((C,N)=>C-N),o.push(w[0]);for(let C=1;C<w.length;C+=2){const N=w[C];!isNaN(N)&&o.indexOf(N)===-1&&o.push(N)}}return o}const fBt=(e,t)=>{e=new Xr(e),t=new Xr(t);const n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)};/**
* @license
*
* The APCA contrast prediction algorithm is based of the formulas published
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
*
* Note that the APCA implementation is still beta, so please update to
* future versions of chroma.js when they become available.
*
* You can read more about the APCA Readability Criterion at
* https://readtech.org/ARC/
*/const Xbe=.027,hBt=5e-4,pBt=.1,Qbe=1.14,vP=.022,Zbe=1.414,mBt=(e,t)=>{e=new Xr(e),t=new Xr(t),e.alpha()<1&&(e=yN(t,e,e.alpha(),"rgb"));const n=Jbe(...e.rgb()),r=Jbe(...t.rgb()),s=n>=vP?n:n+Math.pow(vP-n,Zbe),a=r>=vP?r:r+Math.pow(vP-r,Zbe),o=Math.pow(a,.56)-Math.pow(s,.57),l=Math.pow(a,.65)-Math.pow(s,.62),c=Math.abs(a-s)<hBt?0:s<a?o*Qbe:l*Qbe;return(Math.abs(c)<pBt?0:c>0?c-Xbe:c+Xbe)*100};function Jbe(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:qx,pow:Pl,min:xBt,max:gBt,atan2:eye,abs:tye,cos:wP,sin:nye,exp:bBt,PI:rye}=Math;function yBt(e,t,n=1,r=1,s=1){var a=function(Ce){return 360*Ce/(2*rye)},o=function(Ce){return 2*rye*Ce/360};e=new Xr(e),t=new Xr(t);const[l,c,u]=Array.from(e.lab()),[d,f,x]=Array.from(t.lab()),g=(l+d)/2,v=qx(Pl(c,2)+Pl(u,2)),w=qx(Pl(f,2)+Pl(x,2)),C=(v+w)/2,N=.5*(1-qx(Pl(C,7)/(Pl(C,7)+Pl(25,7)))),I=c*(1+N),P=f*(1+N),R=qx(Pl(I,2)+Pl(u,2)),F=qx(Pl(P,2)+Pl(x,2)),U=(R+F)/2,L=a(eye(u,I)),z=a(eye(x,P)),Q=L>=0?L:L+360,ne=z>=0?z:z+360,J=tye(Q-ne)>180?(Q+ne+360)/2:(Q+ne)/2,X=1-.17*wP(o(J-30))+.24*wP(o(2*J))+.32*wP(o(3*J+6))-.2*wP(o(4*J-63));let re=ne-Q;re=tye(re)<=180?re:ne<=Q?re+360:re-360,re=2*qx(R*F)*nye(o(re)/2);const pe=d-l,Y=F-R,ie=1+.015*Pl(g-50,2)/qx(20+Pl(g-50,2)),oe=1+.045*U,G=1+.015*U*X,V=30*bBt(-Pl((J-275)/25,2)),ae=-(2*qx(Pl(U,7)/(Pl(U,7)+Pl(25,7))))*nye(2*o(V)),he=qx(Pl(pe/(n*ie),2)+Pl(Y/(r*oe),2)+Pl(re/(s*G),2)+ae*(Y/(r*oe))*(re/(s*G)));return gBt(0,xBt(100,he))}function vBt(e,t,n="lab"){e=new Xr(e),t=new Xr(t);const r=e.get(n),s=t.get(n);let a=0;for(let o in r){const l=(r[o]||0)-(s[o]||0);a+=l*l}return Math.sqrt(a)}const wBt=(...e)=>{try{return new Xr(...e),!0}catch{return!1}},CBt={cool(){return UR([hi.hsl(180,1,.9),hi.hsl(250,.7,.4)])},hot(){return UR(["#000","#f00","#ff0","#fff"]).mode("rgb")}},rte={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},BLe=Object.keys(rte),sye=new Map(BLe.map(e=>[e.toLowerCase(),e])),SBt=typeof Proxy=="function"?new Proxy(rte,{get(e,t){const n=t.toLowerCase();if(sye.has(n))return e[sye.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(BLe)}}):rte,NBt=(...e)=>{e=Ti(e,"cmyk");const[t,n,r,s]=e,a=e.length>4?e[4]:1;return s===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-s),n>=1?0:255*(1-n)*(1-s),r>=1?0:255*(1-r)*(1-s),a]},{max:iye}=Math,ABt=(...e)=>{let[t,n,r]=Ti(e,"rgb");t=t/255,n=n/255,r=r/255;const s=1-iye(t,iye(n,r)),a=s<1?1/(1-s):0,o=(1-t-s)*a,l=(1-n-s)*a,c=(1-r-s)*a;return[o,l,c,s]};Xr.prototype.cmyk=function(){return ABt(this._rgb)};const jBt=(...e)=>new Xr(...e,"cmyk");Object.assign(hi,{cmyk:jBt});Ai.format.cmyk=NBt;Ai.autodetect.push({p:2,test:(...e)=>{if(e=Ti(e,"cmyk"),Hi(e)==="array"&&e.length===4)return"cmyk"}});const EBt=(...e)=>{const t=Ti(e,"hsla");let n=zA(e)||"lsa";return t[0]=tp(t[0]||0)+"deg",t[1]=tp(t[1]*100)+"%",t[2]=tp(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},_Bt=(...e)=>{const t=Ti(e,"lab");let n=zA(e)||"lab";return t[0]=tp(t[0])+"%",t[1]=tp(t[1]),t[2]=tp(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},kBt=(...e)=>{const t=Ti(e,"lch");let n=zA(e)||"lab";return t[0]=tp(t[0])+"%",t[1]=tp(t[1]),t[2]=isNaN(t[2])?"none":tp(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},TBt=(...e)=>{const t=Ti(e,"lab");return t[0]=tp(t[0]*100)+"%",t[1]=tte(t[1]),t[2]=tte(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},$Le=(...e)=>{const[t,n,r,...s]=Ti(e,"rgb"),[a,o,l]=Cle(t,n,r),[c,u,d]=FLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]},IBt=(...e)=>{const t=Ti(e,"lch");return t[0]=tp(t[0]*100)+"%",t[1]=tte(t[1]),t[2]=isNaN(t[2])?"none":tp(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:FW}=Math,PBt=(...e)=>{const t=Ti(e,"rgba");let n=zA(e)||"rgb";if(n.substr(0,3)==="hsl")return EBt(MLe(t),n);if(n.substr(0,3)==="lab"){const r=t_();Rg("d50");const s=_Bt(ble(t),n);return Rg(r),s}if(n.substr(0,3)==="lch"){const r=t_();Rg("d50");const s=kBt(vle(t),n);return Rg(r),s}return n.substr(0,5)==="oklab"?TBt(Cle(t)):n.substr(0,5)==="oklch"?IBt($Le(t)):(t[0]=FW(t[0]),t[1]=FW(t[1]),t[2]=FW(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},ULe=(...e)=>{e=Ti(e,"lch");const[t,n,r,...s]=e,[a,o,l]=PLe(t,n,r),[c,u,d]=wle(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]},Kg=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,fm=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,zR=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,dp=/\s*/.source,VA=/\s+/.source,Sle=/\s*,\s*/.source,k$=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,WA=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,zLe=new RegExp("^rgba?\\("+dp+[Kg,Kg,Kg].join(VA)+WA+"\\)$"),HLe=new RegExp("^rgb\\("+dp+[Kg,Kg,Kg].join(Sle)+dp+"\\)$"),VLe=new RegExp("^rgba\\("+dp+[Kg,Kg,Kg,fm].join(Sle)+dp+"\\)$"),WLe=new RegExp("^hsla?\\("+dp+[k$,zR,zR].join(VA)+WA+"\\)$"),qLe=new RegExp("^hsl?\\("+dp+[k$,zR,zR].join(Sle)+dp+"\\)$"),GLe=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,KLe=new RegExp("^lab\\("+dp+[fm,fm,fm].join(VA)+WA+"\\)$"),YLe=new RegExp("^lch\\("+dp+[fm,fm,k$].join(VA)+WA+"\\)$"),XLe=new RegExp("^oklab\\("+dp+[fm,fm,fm].join(VA)+WA+"\\)$"),QLe=new RegExp("^oklch\\("+dp+[fm,fm,k$].join(VA)+WA+"\\)$"),{round:ZLe}=Math,Z6=e=>e.map((t,n)=>n<=2?r3(ZLe(t),0,255):t),Fl=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),Gu=(e,t)=>e==="none"?t:e,Nle=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Ai.format.named)try{return Ai.format.named(e)}catch{}if((t=e.match(zLe))||(t=e.match(HLe))){let n=t.slice(1,4);for(let s=0;s<3;s++)n[s]=+Fl(Gu(n[s],0),0,255);n=Z6(n);const r=t[4]!==void 0?+Fl(t[4],0,1):1;return n[3]=r,n}if(t=e.match(VLe)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+Fl(n[r],0,255);return n}if((t=e.match(WLe))||(t=e.match(qLe))){const n=t.slice(1,4);n[0]=+Gu(n[0].replace("deg",""),0),n[1]=+Fl(Gu(n[1],0),0,100)*.01,n[2]=+Fl(Gu(n[2],0),0,100)*.01;const r=Z6(nte(n)),s=t[4]!==void 0?+Fl(t[4],0,1):1;return r[3]=s,r}if(t=e.match(GLe)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=nte(n);for(let s=0;s<3;s++)r[s]=ZLe(r[s]);return r[3]=+t[4],r}if(t=e.match(KLe)){const n=t.slice(1,4);n[0]=Fl(Gu(n[0],0),0,100),n[1]=Fl(Gu(n[1],0),-125,125,!0),n[2]=Fl(Gu(n[2],0),-125,125,!0);const r=t_();Rg("d50");const s=Z6(gle(n));Rg(r);const a=t[4]!==void 0?+Fl(t[4],0,1):1;return s[3]=a,s}if(t=e.match(YLe)){const n=t.slice(1,4);n[0]=Fl(n[0],0,100),n[1]=Fl(Gu(n[1],0),0,150,!1),n[2]=+Gu(n[2].replace("deg",""),0);const r=t_();Rg("d50");const s=Z6(yle(n));Rg(r);const a=t[4]!==void 0?+Fl(t[4],0,1):1;return s[3]=a,s}if(t=e.match(XLe)){const n=t.slice(1,4);n[0]=Fl(Gu(n[0],0),0,1),n[1]=Fl(Gu(n[1],0),-.4,.4,!0),n[2]=Fl(Gu(n[2],0),-.4,.4,!0);const r=Z6(wle(n)),s=t[4]!==void 0?+Fl(t[4],0,1):1;return r[3]=s,r}if(t=e.match(QLe)){const n=t.slice(1,4);n[0]=Fl(Gu(n[0],0),0,1),n[1]=Fl(Gu(n[1],0),0,.4,!1),n[2]=+Gu(n[2].replace("deg",""),0);const r=Z6(ULe(n)),s=t[4]!==void 0?+Fl(t[4],0,1):1;return r[3]=s,r}};Nle.test=e=>zLe.test(e)||WLe.test(e)||KLe.test(e)||YLe.test(e)||XLe.test(e)||QLe.test(e)||HLe.test(e)||VLe.test(e)||qLe.test(e)||GLe.test(e)||e==="transparent";Xr.prototype.css=function(e){return PBt(this._rgb,e)};const FBt=(...e)=>new Xr(...e,"css");hi.css=FBt;Ai.format.css=Nle;Ai.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Hi(e)==="string"&&Nle.test(e))return"css"}});Ai.format.gl=(...e)=>{const t=Ti(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const OBt=(...e)=>new Xr(...e,"gl");hi.gl=OBt;Xr.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};Xr.prototype.hex=function(e){return kLe(this._rgb,e)};const MBt=(...e)=>new Xr(...e,"hex");hi.hex=MBt;Ai.format.hex=_Le;Ai.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&Hi(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:CP}=Math,JLe=e=>{const t=e/100;let n,r,s;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*CP(r),s=t<20?0:-254.76935184120902+.8274096064007395*(s=t-10)+115.67994401066147*CP(s)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*CP(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*CP(r),s=255),[n,r,s,1]},{round:RBt}=Math,LBt=(...e)=>{const t=Ti(e,"rgb"),n=t[0],r=t[2];let s=1e3,a=4e4;const o=.4;let l;for(;a-s>o;){l=(a+s)*.5;const c=JLe(l);c[2]/c[0]>=r/n?a=l:s=l}return RBt(l)};Xr.prototype.temp=Xr.prototype.kelvin=Xr.prototype.temperature=function(){return LBt(this._rgb)};const OW=(...e)=>new Xr(...e,"temp");Object.assign(hi,{temp:OW,kelvin:OW,temperature:OW});Ai.format.temp=Ai.format.kelvin=Ai.format.temperature=JLe;Xr.prototype.oklch=function(){return $Le(this._rgb)};const DBt=(...e)=>new Xr(...e,"oklch");Object.assign(hi,{oklch:DBt});Ai.format.oklch=ULe;Ai.autodetect.push({p:2,test:(...e)=>{if(e=Ti(e,"oklch"),Hi(e)==="array"&&e.length===3)return"oklch"}});Object.assign(hi,{analyze:LLe,average:BDt,bezier:WDt,blend:vm,brewer:SBt,Color:Xr,colors:bN,contrast:fBt,contrastAPCA:mBt,cubehelix:sBt,deltaE:yBt,distance:vBt,input:Ai,interpolate:yN,limits:DLe,mix:yN,random:lBt,scale:UR,scales:CBt,valid:wBt});const BBt=({className:e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",className:e,children:i.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.875 3.67C7.875 3.025 7.315 2.5 6.625 2.5C5.935 2.5 5.375 3.025 5.375 3.67C5.375 4.316 5.935 4.84 6.625 4.84C7.315 4.84 7.875 4.316 7.875 3.67ZM7.875 12.33C7.875 11.684 7.315 11.16 6.625 11.16C5.935 11.16 5.375 11.684 5.375 12.33C5.375 12.975 5.935 13.5 6.625 13.5C7.315 13.5 7.875 12.975 7.875 12.33ZM6.625 6.83C7.315 6.83 7.875 7.355 7.875 8C7.875 8.645 7.315 9.17 6.625 9.17C5.935 9.17 5.375 8.645 5.375 8C5.375 7.355 5.935 6.83 6.625 6.83ZM11.625 3.67C11.625 3.025 11.065 2.5 10.375 2.5C9.685 2.5 9.125 3.025 9.125 3.67C9.125 4.316 9.685 4.84 10.375 4.84C11.065 4.84 11.625 4.316 11.625 3.67ZM10.375 11.16C11.065 11.16 11.625 11.684 11.625 12.33C11.625 12.975 11.065 13.5 10.375 13.5C9.685 13.5 9.125 12.975 9.125 12.33C9.125 11.684 9.685 11.16 10.375 11.16ZM11.625 8C11.625 7.355 11.065 6.83 10.375 6.83C9.685 6.83 9.125 7.355 9.125 8C9.125 8.645 9.685 9.17 10.375 9.17C11.065 9.17 11.625 8.645 11.625 8Z",fill:"currentColor"})}),tw=({className:e})=>i.jsxs("svg",{width:"7",height:"8",viewBox:"0 0 7 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M0.660034 6.83L6.32003 1.17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M6.32003 6.83L0.660034 1.17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),MW=({dataCoin:e,coinInclude:t,coinExclude:n,setCoinInclude:r,setCoinExclude:s,isLoadingCoin:a})=>{const[o,l]=m.useState(!1),[c,u]=m.useState(""),d=()=>{l(C=>!C)};m.useEffect(()=>{const C=e.filter(N=>!(n!=null&&n.includes(N.value))).map(N=>N.value);r(C)},[e,n]);const f=C=>{t!=null&&t.includes(C)?(r(t.filter(N=>N!==C)),s([...n,C])):(s(n.filter(N=>N!==C)),r([...t,C]))},x=()=>{const C=e.map(N=>N.value);r(C),s([])},g=()=>{const C=e.map(N=>N.value);s(C),r([])},v=e==null?void 0:e.filter(C=>{var N;return(N=C.label.toLowerCase())==null?void 0:N.includes(c.toLowerCase())}),w=()=>{u("")};return i.jsxs("div",{className:"col-span-1 flex flex-col gap-[4px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Asset Management"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"Choose which assets to include or exclude from copy trading. You can customize which coins you want to trade.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"relative w-full max-w-full",children:[i.jsxs("div",{className:" flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8",onClick:d,children:[i.jsx("div",{className:"flex justify-start items-center text-[#7c7c7c] text-sm font-semibold font-manrope leading-[8px]",children:i.jsxs("div",{className:"flex justify-start items-center gap-[3px]",children:[i.jsx("div",{className:"w-1.5 h-1.5 bg-[#67ffbd] rounded-full"}),i.jsxs("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px]",children:["Include"," ",i.jsx("span",{className:`${(t==null?void 0:t.length)>0?"text-[#67ffbd]":"text-white"} text-[11px] font-semibold font-manrope leading-[8px]`,children:`(${t==null?void 0:t.length})`})]}),i.jsx("div",{className:"w-1.5 h-1.5 bg-[#ff787b] rounded-full ml-[6px]"}),i.jsxs("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px]",children:["Exclude"," ",i.jsx("span",{className:`${(n==null?void 0:n.length)>0?"text-[#ff787b]":"text-white"} text-[11px] font-semibold font-manrope leading-[8px]`,children:`(${n==null?void 0:n.length})`})]})]})}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${o?"rotate-180":""}`})]}),o&&i.jsxs("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:[i.jsxs("div",{className:"flex justify-between items-center space-x-4 mb-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{onClick:x,className:"h-4 p-1.5 rounded-md outline outline-1 outline-[#67ffbd] inline-flex justify-start items-center gap-2 cursor-pointer",children:i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px]",children:"Select All Include"})}),i.jsx("div",{onClick:g,className:"h-4 p-1.5 rounded-md outline outline-1 outline-[#ff787b] inline-flex justify-start items-center gap-2 cursor-pointer",children:i.jsx("div",{className:"justify-start text-[#ff787b] text-[11px] font-semibold font-manrope leading-[8px]",children:"Select All Exclude"})})]}),i.jsxs("div",{className:"flex items-center relative",children:[i.jsx("input",{type:"text",placeholder:"Search Coin",value:c,onChange:C=>u(C.target.value),className:`${c?"border border-[#7F7F7F]":""} py-[4px] bg-[#1B1B1B] border border-[#303030] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-full sm:w-[153px] lg:w-full pl-[30px] pr-6 focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[32px]`}),i.jsx(_y,{className:"text-[#646464] absolute left-1.5"}),c&&i.jsx("span",{onClick:w,className:"flex justify-center items-center cursor-pointer absolute right-2 w-[10px] h-[10px]",children:i.jsx(tw,{className:"hover:text-[#cdcdcd] text-[#7C7C7C] w-[10px] h-[10px]"})})]})]}),i.jsx("div",{className:"max-h-[230px] overflow-y-auto scrollbar-custom-scrollbar-dark",children:a?i.jsx("span",{className:"flex justify-center items-center w-full text-[#7e7e7e] text-sm font-medium font-inter leading-[8px] my-2",children:"Loading..."}):!v||v.length===0?i.jsx("span",{className:"flex justify-center items-center w-full text-[#7e7e7e] text-sm font-medium font-inter leading-[8px] my-4",children:c?"No coins match your search":"No data available at the moment. Please try again later."}):v==null?void 0:v.map((C,N)=>i.jsxs("div",{className:`${t!=null&&t.includes(C.value)?"bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30":"bg-[#ff797c]/20 hover:bg-[#ff797c]/30"} flex justify-between items-center h-8 p-2 text-xs text-white rounded-md mb-[2px]`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-[26px]",children:[i.jsx(BBt,{className:`${t!=null&&t.includes(C.value)?"text-[#67FFBD]":"text-[#FF797C]"} w-4 h-4`}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("img",{src:C==null?void 0:C.icon,alt:C==null?void 0:C.icon,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:I=>dm(I)}),i.jsx("span",{className:`${t!=null&&t.includes(C.value)?"text-[#67FFBD]":"text-[#FF797C]"} justify-start text-[11px] font-semibold font-manrope leading-[13px] tracking-tight`,children:C.label})]})]}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx("div",{onClick:()=>f(C.value),className:`${t!=null&&t.includes(C.value)?"bg-green-500 border-[#67ffbd]":"border-[#cdcdcd]"} h-4 p-1.5 rounded-md border inline-flex justify-start items-center gap-2 text-white cursor-pointer`,children:i.jsx("div",{className:"justify-start text-[11px] font-semibold font-manrope leading-[8px]",children:"Include"})}),i.jsx("div",{onClick:()=>f(C.value),className:`${t!=null&&t.includes(C.value)?"border-[#cdcdcd]":"bg-[#ff787b] border-[#ff787b]"} h-4 p-1.5 rounded-md border inline-flex justify-start items-center gap-2 text-white cursor-pointer`,children:i.jsx("div",{className:"justify-start text-[11px] font-semibold font-manrope leading-[8px]",children:"Exclude"})})]})]},N))})]})]})]})},RW=new Map,$Bt=e=>{if(!e)return Math.floor(Math.random()*1240);const t=e.toLowerCase().replace(/^0x/,"");return parseInt(t.slice(0,8),16)%1240};function eDe({wallet:e,className:t=""}){const[n,r]=m.useState(()=>RW.get(e)||null),[s,a]=m.useState(!1);return m.useEffect(()=>{if(RW.has(e))return;const o=$Bt(e);ds.get(`https://apiv7.nftinit.io/api/f5WNdSBmQ/${o}`).then(({data:l})=>{let c=l==null?void 0:l.image;c!=null&&c.startsWith("ipfs://")&&(c=`https://ipfs.io/ipfs/${c.slice(7)}`),RW.set(e,c),r(c)}).catch(console.error)},[e]),n?i.jsx("img",{src:n,alt:"NFT avatar",className:`${t} ${s?"":"invisible"}`,onLoad:()=>a(!0),onError:()=>a(!0)}):i.jsx("div",{className:`${t} bg-gray-800 rounded-full animate-pulse`})}const UBt=({open:e,setOpen:t,setCopyTradeModal:n,onClose:r,setIsUnderstand:s})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[320px] sm:w-[480px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-4",children:[i.jsx("div",{className:"w-80 sm:w-96 text-center text-white font-manrope text-[16px] sm:text-[20px] font-semibold leading-[8px]",children:"Potential Bot Wallet Detected"}),i.jsx("div",{className:"w-[270px] sm:w-[398px] text-center text-white/60 text-[13px] sm:text-[16px] font-medium font-manrope leading-5",children:"The wallet you're trying to copy trade appears to be likely operated by a bot. Following bot wallets may result in significant financial losses as they often use automated strategies that may not be profitable."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1),r()},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{t(!1),s(!0)},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"I Understand, Continue"})})]})]})})})})})]}),zBt=({open:e,setOpen:t,setCopyTradeModal:n,onClose:r,setIsLighterUnderstand:s})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[320px] sm:w-[480px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-4",children:[i.jsx("div",{className:"w-80 sm:w-96 text-center text-white font-manrope text-[16px] sm:text-[20px] font-semibold leading-[8px]",children:"Rate Limit Warning"}),i.jsx("div",{className:"w-[270px] sm:w-[410px] text-center text-white/60 text-[13px] sm:text-[16px] font-medium font-manrope leading-5",children:"The wallet you’re trying to follow may execute frequent transactions. To ensure reliable copy-trading without rate-limit interruptions, please switch your account type to Premium before proceeding. Otherwise, trades may fail to execute due to API rate restrictions."}),i.jsxs("div",{onClick:()=>window.open("https://docs.lighter.xyz/perpetual-futures/account-types","_blank"),className:"flex justify-center items-center w-max gap-1.5 rounded-[10px] cursor-pointer",children:[i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-[18px] tracking-tight w-full sm:max-w-[500px] mb-2",children:"Learn more about Lighter account types here"}),i.jsx("img",{src:xm,alt:"routing",className:"w-3 h-3 mb-2"})]})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1),r()},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{t(!1),s(!0)},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"I Understand, Continue"})})]})]})})})})})]}),HBt=({checkAccountCopy:e,setIsLighterSub:t,setLighterSubError:n,setSlotCount:r,setSlotSubsCount:s,setSlotUsingCount:a,setSlotTotalCount:o,setSlotCountWallets:l})=>{const{setSignModalOpen:c,setTelegramChatId:u,setSubscriberRole:d,setSubsExpireDay:f,setMushboomerETH:x,setMushboomerSOL:g,setIsReferralCode:v,setIsReferralCodeName:w,setIsWhitelist:C,setHyperToken:N,setHyperAddress:I}=m.useContext(Qr),{address:P}=Jr(),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,Q]=m.useState(""),[ne,J]=m.useState(""),[X,re]=m.useState(""),[pe,Y]=m.useState(!1),ie=async()=>{var he,Ce,ce,ge,Ae,ye;const te=window.localStorage.getItem("hyperToken"),ae=window.localStorage.getItem("hyperAddress");if(!(!te||!ae))try{Y(!0);const je=await ji(ae.toLowerCase(),te);je!=null&&je.success?(u(je==null?void 0:je.telegram_chat_id),d(je==null?void 0:je.subscriber_role),f(je==null?void 0:je.subs_expire_day),x((he=je==null?void 0:je.mushboomer_counts)==null?void 0:he.eth),g((Ce=je==null?void 0:je.mushboomer_counts)==null?void 0:Ce.sol),v(je==null?void 0:je.referral_code),w(je==null?void 0:je.refcode),C(je==null?void 0:je.whitelist),N(te),I(ae),re(je==null?void 0:je.farming_tools),t(je==null?void 0:je.farming_tools),Y(!1),je!=null&&je.farming_tools&&n(!1),r((ce=je==null?void 0:je.copy_trade_slots_info)==null?void 0:ce.extra_slot_count),s((ge=je==null?void 0:je.copy_trade_slots_info)==null?void 0:ge.subs_slot_count),a((Ae=je==null?void 0:je.copy_trade_slots_info)==null?void 0:Ae.using_slot_count),o((ye=je==null?void 0:je.copy_trade_slots_info)==null?void 0:ye.total_slot_count),l(je==null?void 0:je.copy_trade_slots_wallets)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),N(""),I(""),Y(!1))}catch(je){console.error("Token verification error:",je),console.error(je.message||"An unknown error occurred."),Y(!1)}},oe=async()=>new Sl(window.ethereum).eth.getAccounts(ae=>ae),G=async(te="farming",ae=24,he=5e3)=>{ae<=0||(await new Promise(Ce=>setTimeout(Ce,he)),await ie(),te==="farming"&&!X?G(te,ae-1,he):e())},V=async()=>{J("");const te=window.localStorage.getItem("hyperToken"),ae=window.localStorage.getItem("hyperAddress");if(!te||!P){c(!0);return}L(!0),F(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(ce){console.error("Failed to switch network",ce),F(!1);return}const he=new Sl(window.ethereum);var Ce=await oe();if(Ce.length>0?Ce=Ce[0]:Ce=void 0,Ce){const ge={from:Ce,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await he.eth.sendTransaction(ge).then(Ae=>{console.log("txHash :>> ",Ae),F(!1),Q(Ae.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():ae,token:te,payment_tx:Ae.transactionHash,payment_role:"farming_tools"})}),ie(),G("farming")}).catch(Ae=>{console.log(Ae),Ae.code===-32003||Ae.message.includes("insufficient funds")?J("Insufficient funds."):Ae.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await he.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:X,errorFunds:ne,activeMethod:2}),i.jsx("div",{children:i.jsx("div",{onClick:()=>{V()},className:"flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Subscribe / 0.12 ETH"})})]})},Ale=({open:e=!1,setOpen:t=()=>{},oldSlotCount:n,checkAccountTrade:r,tradeMarket:s})=>{const{address:a}=Jr(),{setSignModalOpen:o,setTelegramChatId:l,setSubscriberRole:c,setSubsExpireDay:u,setMushboomerETH:d,setMushboomerSOL:f,setIsReferralCode:x,setIsReferralCodeName:g,setIsWhitelist:v,setHyperToken:w,setHyperAddress:C}=m.useContext(Qr),[N,I]=m.useState(1),[P,R]=m.useState(!1),[F,U]=m.useState(!1),[L,z]=m.useState(""),[Q,ne]=m.useState(""),[J,X]=m.useState(""),re=ae=>/^\d*$/.test(ae),pe=ae=>{["e","E","+","-"].includes(ae.key)&&ae.preventDefault()};m.useEffect(()=>{e||I(1)},[e]);const Y=m.useRef(J);m.useEffect(()=>{Y.current=J},[J]);const ie=m.useMemo(()=>{if(N==="")return!1;const ae=Number(N);return Number.isInteger(ae)&&ae>=1},[N]),oe=async()=>{var Ce,ce,ge;const ae=window.localStorage.getItem("hyperToken"),he=window.localStorage.getItem("hyperAddress");if(!(!ae||!he))try{const Ae=await ji(he.toLowerCase(),ae);Ae!=null&&Ae.success?(l(Ae==null?void 0:Ae.telegram_chat_id),c(Ae==null?void 0:Ae.subscriber_role),u(Ae==null?void 0:Ae.subs_expire_day),d((Ce=Ae==null?void 0:Ae.mushboomer_counts)==null?void 0:Ce.eth),f((ce=Ae==null?void 0:Ae.mushboomer_counts)==null?void 0:ce.sol),x(Ae==null?void 0:Ae.referral_code),g(Ae==null?void 0:Ae.refcode),v(Ae==null?void 0:Ae.whitelist),w(ae),C(he),X((ge=Ae==null?void 0:Ae.copy_trade_slots_info)==null?void 0:ge.extra_slot_count)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),w(""),C(""))}catch(Ae){console.error("Token verification error:",Ae),console.error(Ae.message||"An unknown error occurred.")}},G=async()=>new Sl(window.ethereum).eth.getAccounts(he=>he),V=async(ae="slot",he=24,Ce=5e3)=>{he<=0||(await new Promise(ce=>setTimeout(ce,Ce)),await oe(),ae==="slot"&&Y.current<=n?V(ae,he-1,Ce):r())},te=async ae=>{ne("");const he=window.localStorage.getItem("hyperToken"),Ce=window.localStorage.getItem("hyperAddress");if(!he||!a){o(!0);return}U(!0),R(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Ae){console.error("Failed to switch network",Ae),R(!1);return}const ce=new Sl(window.ethereum);var ge=await G();if(ge.length>0?ge=ge[0]:ge=void 0,ge){const ye=ae*.012,je=ce.utils.toWei(ye.toString(),"ether"),Ie={from:ge,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:je};await ce.eth.sendTransaction(Ie).then(Re=>{console.log("txHash :>> ",Re),R(!1),z(Re.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/slots_payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Ce,token:he,payment_tx:Re.transactionHash,slot_role:"lighter_copy_trade",slot_qty:Number(N)})}),oe(),V("slot")}).catch(Re=>{console.log(Re),Re.code===-32003||Re.message.includes("insufficient funds")?ne("Insufficient funds."):Re.message==="MetaMask Tx Signature: User denied transaction signature."&&U(!1)})}else await ce.eth.requestAccounts()};return e?i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:F,setOpen:U,transactionHash:L,transactionLoading:P,paymentPresaleRole:!(J<=n),errorFunds:Q,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[51] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>t(!1)}),i.jsx("div",{className:"relative w-[380px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#404040] max-h-[97dvh] overflow-y-auto p-5",children:i.jsxs("div",{className:"flex flex-col w-full gap-4",children:[i.jsx("div",{className:"text-white/90 font-manrope text-[18px] font-semibold leading-4 mx-auto",children:"Get more slots"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Slot Count"}),i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>I(ae=>{const he=Number(ae||0);return he>1?String(he-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:N,onChange:ae=>{const he=ae.target.value.trim();if(he==="")return I("");re(he)&&I(he)},onKeyDown:pe,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>I(ae=>{const he=Number(ae||0);return String(he+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),N!==""&&!ie&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),i.jsxs("div",{className:"text-[13px] text-[#7C7C7C] font-semibold flex items-center gap-1",children:["Total Price:",i.jsxs("span",{className:"bg-[#1E1E1E] text-[#F8D4AB] font-bold px-2 py-[2px] rounded-md border border-[#3A3A3A]",children:[(N*.012).toFixed(3)," ETH"]})]}),i.jsx("div",{onClick:ae=>{ae.preventDefault(),ie&&te(N)},className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] min-w-max font-semibold ${ie?"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy"})]})})]})]}):null},VBt=({normalizedCopyTradeList:e,selectedWmIndex:t,setSelectedWmIndex:n,getSettingList:r,setIsNewSetting:s})=>i.jsxs("div",{children:[i.jsx("span",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px]",children:"ACTIVE BOTS"}),(e==null?void 0:e.length)>0?i.jsxs("div",{className:"flex flex-col gap-2.5 p-2.5 mt-1.5 border border-white/5 rounded-xl bg-gradient-to-b from-[#1a1a1a] to-[#141414] shadow-lg",children:[i.jsxs("button",{onClick:r,className:`${t===null?"bg-[#2d4a3e] border border-[#3a6b5a] text-white shadow-[0_0_0_1px_rgba(116,70,255,0.3)]":"bg-[#181818] border border-[#7446FF40] text-white hover:bg-[#5834C320] hover:border-[#5834C370]"} px-3 py-2 rounded-lg text-left text-[12px] font-semibold transition-all duration-200 flex items-center justify-start gap-2 relative group`,children:[i.jsx("div",{className:`${t===null?"bg-[#3a6b5a] group-hover:bg-[#2d4a3e]":"bg-[#7446FF30] group-hover:bg-[#5834C350]"} flex items-center justify-center w-4 h-4 rounded transition-colors`,children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`${t===null?"text-[#fff]":"text-[#7446FF]"} w-3 h-3 `,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})})}),i.jsx("span",{children:"Copy with Another Wallet"}),i.jsx("span",{className:`${t===null?"text-white bg-[#3a6b5a]":"text-white bg-[#7446FF]"} ml-auto px-1.5 py-0.5 rounded text-[9px] font-bold `,children:"NEW"})]}),i.jsx("div",{className:"w-full h-px bg-white/5"}),i.jsx("div",{className:"flex flex-col gap-2 max-h-[21vh] overflow-y-scroll scrollbar-custom-scrollbar-dark",children:e==null?void 0:e.map((a,o)=>{var l,c,u,d;return i.jsxs("button",{onClick:()=>{n(o),s(!1)},className:`px-3 py-2 rounded-lg text-left text-[12px] font-medium transition-all duration-200
${t===o?"bg-[#2d4a3e] border border-[#3a6b5a] text-white shadow-[0_0_0_1px_rgba(58,107,90,0.3)]":"bg-[#181818] border border-[#2a2a2a] text-white hover:bg-[#1f1f1f] hover:border-[#353535]"} flex justify-between items-center gap-2`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"flex justify-start items-center gap-2",children:(a==null?void 0:a.target_platform)==="hyper"?i.jsx(i.Fragment,{children:i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"})}):i.jsx(i.Fragment,{children:i.jsx(dy,{className:"w-4 h-4 text-white"})})}),i.jsx("span",{className:`min-w-max ${t===o?"text-white":"text-[#d3d3d3]"}`,children:((l=a==null?void 0:a.wm_name)==null?void 0:l.length)>15?`${(c=a==null?void 0:a.wm_name)==null?void 0:c.slice(0,15)}...`:a==null?void 0:a.wm_name}),i.jsx("span",{className:"text-[#9b9b9b]",children:"-"}),i.jsx("span",{className:t===o?"text-white":"text-[#d3d3d3]",children:((u=a==null?void 0:a.tag)==null?void 0:u.length)>18?`${(d=a==null?void 0:a.tag)==null?void 0:d.slice(0,18)}...`:a==null?void 0:a.tag})]}),i.jsx(pi,{content:`${a!=null&&a.copy_trait_mode?"Run: ON":"Run: OFF"}`,children:i.jsx("div",{className:"flex justify-start items-center has-tooltip relative",children:i.jsx("span",{className:"flex items-center gap-2",children:i.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${a!=null&&a.copy_trait_mode?"bg-green-500":"bg-red-500"}`})})})})]},o)})})]}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No trades have been made with this wallet."})})]})]});function v5({open:e,setOpen:t,copyTradeData:n,copyTradeWallet:r,setCopyTradeWallet:s,isScalper:a,setCopyTradeData:o,sourcePage:l="default"}){var qn,kr,Ar,Zr,Fs;const{getCopyTradeWatchList:c,copyTradeWatchList:u,mushboomerETH:d,mushboomerSOL:f,trackedWatchList:x,isWhitelist:g,setTelegramChatId:v,setSubscriberRole:w,setSubsExpireDay:C,setMushboomerETH:N,setMushboomerSOL:I,setIsReferralCode:P,setIsReferralCodeName:R,setIsWhitelist:F,setHyperToken:U,setHyperAddress:L}=m.useContext(Qr),{address:z}=Jr(),[Q,ne]=m.useState(!1),[J,X]=m.useState(!1),[re,pe]=m.useState("method_two"),[Y,ie]=m.useState("All"),[oe,G]=m.useState([]),[V,te]=m.useState(!1),[ae,he]=m.useState(null),[Ce,ce]=m.useState(!1),[ge,Ae]=m.useState(!1),[ye,je]=m.useState(!1),[Ie,Re]=m.useState(!1),[Qe,$e]=m.useState(!1),[it,tt]=m.useState(!1),[ot,ft]=m.useState(!1),[ct,Vt]=m.useState(!1),[It,an]=m.useState(""),[Nt,mn]=m.useState(""),[dn,Pt]=m.useState(""),[Xe,Ut]=m.useState(""),[Lt,qe]=m.useState(""),[Ke,pt]=m.useState(""),[en,Bt]=m.useState(""),[Et,et]=m.useState(""),[Be,Mt]=m.useState(100),[Ve,ut]=m.useState(!0),[xt,jt]=m.useState(!0),[kt,xn]=m.useState(!1),[un,On]=m.useState(!0),[En,jn]=m.useState(!0),[bn,Zn]=m.useState(null),[zn,$n]=m.useState(null),[nr,wn]=m.useState(""),[on,Oe]=m.useState(""),[rn,cn]=m.useState({inputValue:"",selectValue:"%"}),[_t,Yn]=m.useState({inputValue:"",selectValue:"%"}),[yn,Dt]=m.useState([]),[sn,Tn]=m.useState(!0),[Kn,ir]=m.useState([]),[rr,Jt]=m.useState([]);m.useState(!1),m.useState(!1);const[Un,Qn]=m.useState(!1),[Rt,Pn]=m.useState(null),[Ee,p]=m.useState(null),[h,S]=m.useState(null),[_,k]=m.useState(null),[T,B]=m.useState(!1),[W,ee]=m.useState(!1),[de,fe]=m.useState(!1),[xe,we]=m.useState(!1),[ke,Me]=m.useState(!1),Ye=m.useRef(null),[Fe,st]=m.useState(null),[se,Se]=m.useState(!1),De=m.useRef(null),[Le,_e]=m.useState(!1),[nt,lt]=m.useState(!1),[bt,Zt]=m.useState(!1),[Ge,Je]=m.useState([]),[We,wt]=m.useState([]),[At,Gt]=m.useState(!1),[fn,Rn]=m.useState(!1),[An,pr]=m.useState(!1),[mt,qt]=m.useState(0),[Qt,In]=m.useState(0),[or,Wn]=m.useState(0),[Vn,gr]=m.useState(0),[Ir,Fr]=m.useState(null),[Lr,Ht]=m.useState(!1),[nn,Sr]=m.useState(!1),[Br,Kr]=m.useState([]),[As,ms]=m.useState(null),[vr,Yr]=m.useState(!1),vi=async St=>{var as,rs,hs,ps,Bi,Ls;if(!e)return;const sr=St||Fe,Hn=window.localStorage.getItem("hyperToken"),zr=window.localStorage.getItem("hyperAddress");if(!(!Hn||!zr))try{pr(!0);const xs=await ji(zr.toLowerCase(),Hn);xs!=null&&xs.success?(v(xs==null?void 0:xs.telegram_chat_id),w(xs==null?void 0:xs.subscriber_role),C(xs==null?void 0:xs.subs_expire_day),N((as=xs==null?void 0:xs.mushboomer_counts)==null?void 0:as.eth),I((rs=xs==null?void 0:xs.mushboomer_counts)==null?void 0:rs.sol),P(xs==null?void 0:xs.referral_code),R(xs==null?void 0:xs.refcode),F(xs==null?void 0:xs.whitelist),U(Hn),L(zr),qt((hs=xs==null?void 0:xs.copy_trade_slots_info)==null?void 0:hs.extra_slot_count),In((ps=xs==null?void 0:xs.copy_trade_slots_info)==null?void 0:ps.subs_slot_count),Wn((Bi=xs==null?void 0:xs.copy_trade_slots_info)==null?void 0:Bi.using_slot_count),gr((Ls=xs==null?void 0:xs.copy_trade_slots_info)==null?void 0:Ls.total_slot_count),Kr(xs==null?void 0:xs.copy_trade_slots_wallets),Gt(xs==null?void 0:xs.farming_tools),sr==="lighter"?xs!=null&&xs.farming_tools?Rn(!1):Rn(!0):Rn(!1),pr(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),U(""),L(""),pr(!1))}catch(xs){console.error("Token verification error:",xs),console.error(xs.message||"An unknown error occurred."),pr(!1)}};m.useEffect(()=>{if(e)if(At&&Vn==0&&Fe==="lighter"&&bn){const St=Br==null?void 0:Br.includes(bn);Sr(!St)}else Sr(!1)},[bn,Fe,Vn,At,e]);const _r=m.useMemo(()=>n?Array.isArray(n)?n:[]:[],[n]);m.useEffect(()=>{if(l==="default"||!l||!_r.length)return;const St=_r.findIndex(sr=>(sr==null?void 0:sr.wallet_id)===l);St!==-1&&ms(St)},[l,_r]),m.useEffect(()=>{l!=="default"||!_r.length||As===null&&ms(0)},[_r,l]);const os=_r[As]||null,Gs=m.useMemo(()=>!vr||!bn?!1:_r.some(St=>(St==null?void 0:St.wallet_id)===bn),[vr,bn,_r,Fe]);function mi(St){return String(St).trim().toUpperCase()}const ns=St=>{St&&(an(St==null?void 0:St.margin_used_rate),mn(St==null?void 0:St.min_usd_per_order),Pt(St==null?void 0:St.max_usd_per_order),Ut(St==null?void 0:St.max_usd_per_positions),qe(St==null?void 0:St.initial_order_max_usd),pt(St==null?void 0:St.margin_used_amount),Bt(St==null?void 0:St.increase_limit),et(St==null?void 0:St.copy_current_percentage),Mt((St==null?void 0:St.scaling)==null?100:St==null?void 0:St.scaling),ie((St==null?void 0:St.position_type)===0?"All":(St==null?void 0:St.position_type)===1?"LONG":(St==null?void 0:St.position_type)===2?"SHORT":"All"),st(St!=null&&St.target_platform?(St==null?void 0:St.target_platform)==="hyper"?"hyper":St==null?void 0:St.target_platform:"hyper"),pe((St==null?void 0:St.method_type)===1?"method_one":(St==null?void 0:St.method_type)===2?"method_two":(St==null?void 0:St.method_type)===2e3?"method_twothousand":"method_two"),ut((St==null?void 0:St.copy_trait_mode)==null?!0:St==null?void 0:St.copy_trait_mode),jt((St==null?void 0:St.open_with_increase)!==null?St==null?void 0:St.open_with_increase:!0),xn((St==null?void 0:St.included_twaps)!==null?St==null?void 0:St.included_twaps:!1),On((St==null?void 0:St.future_listed_tokens)!==null?St==null?void 0:St.future_listed_tokens:!0),jn((St==null?void 0:St.copy_current)!==null?St==null?void 0:St.copy_current:!0),Zn(St==null?void 0:St.wallet_id),$n(St==null?void 0:St.wallet_id),wn(St==null?void 0:St.tag),Oe(St==null?void 0:St.comments),cn({inputValue:St==null?void 0:St.stop_loss_amount,selectValue:(St==null?void 0:St.stop_loss_type)??"%"}),Yn({inputValue:St==null?void 0:St.target_price_amount,selectValue:St==null?void 0:St.target_price_type}),ir((St==null?void 0:St.include_coins)||[]),Jt((St==null?void 0:St.exclude_coins)||[]),vs(St!=null&&St.target_platform?(St==null?void 0:St.target_platform)==="hyper"?"hyper":St==null?void 0:St.target_platform:"hyper"))};m.useEffect(()=>{os===null&&n!==null?vr||ns(Array.isArray(n)?n[0]:n):ns(os)},[os,n]),m.useEffect(()=>{e&&n===null&&(async()=>{try{const St=window.localStorage.getItem("hyperToken"),sr=window.localStorage.getItem("hyperAddress");if(!St)return;const[Hn,zr]=await Promise.all([fetch("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():sr,token:St})}),fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():sr,token:St})})]),[as,rs]=await Promise.all([Hn.json(),zr.json()]),hs=as!=null&&as.success?as.data:[],ps=rs!=null&&rs.success?rs.data:[];hs.length>0?st("hyper"):ps.length>0?st("lighter"):st("hyper")}catch(St){console.error("Wallet auto-select error:",St)}})()},[e,n]);const Xt=u==null?void 0:u.some(St=>(St==null?void 0:St.wallet_address)===r),ue=async()=>{try{const St=window.localStorage.getItem("hyperToken"),sr=window.localStorage.getItem("hyperAddress");if(!St){setSignModalOpen(!0);return}const Hn="https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",zr={address:z?z.toLowerCase():sr,token:St},as=await fetch(Hn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(zr)});if(!as.ok)throw new Error(`Server responded with status ${as.status}`);const rs=await as.json();if(rs.success){Yr(!0);const hs=rs==null?void 0:rs.data;ns(hs),ms(null)}else console.log(rs.error_message),ln.error(rs.error_message)}catch(St){console.error("Error in like function:",St),ln.error(St.message||"Something went wrong!")}},rt=St=>{let sr=St.target.value;if(sr===""){cn(Hn=>({...Hn,inputValue:""}));return}/^\d*\.?\d{0,2}$/.test(sr)&&cn(Hn=>({...Hn,inputValue:sr}))},Ft=St=>{let sr=St.target.value;if(sr===""){Yn(Hn=>({...Hn,inputValue:""}));return}/^\d*\.?\d{0,2}$/.test(sr)&&Yn(Hn=>({...Hn,inputValue:sr}))},yt=St=>{let sr=St.target.value.trim();if(sr===""){an(null);return}/^\d*\.?\d{0,2}$/.test(sr)&&an(sr)},hn=St=>{let sr=St.target.value.trim();if(sr===""){mn(null);return}if(/^\d*\.?\d{0,2}$/.test(sr)){mn(sr);const Hn=parseFloat(sr),zr=re==="method_twothousand"&&(dn!=null&&!isNaN(dn)&&dn&&Hn>Number(dn)||Xe!=null&&!isNaN(Xe)&&Xe&&Hn>Number(Xe));tt(zr);const as=re==="method_twothousand"&&dn!=null&&!isNaN(dn)&&dn&&Hn!=null&&!isNaN(Hn)&&Hn&&Hn>Number(dn);$e(as);const rs=re==="method_twothousand"&&Xe!=null&&!isNaN(Xe)&&Xe&&Hn>Number(Xe);Vt(rs)}},vn=St=>{let sr=St.target.value.trim();if(sr===""){Pt(null);return}if(/^\d*\.?\d{0,2}$/.test(sr)){Pt(sr);const Hn=parseFloat(sr),zr=re==="method_twothousand"&&(Hn==null||isNaN(Hn)||!Hn||Nt!=null&&!isNaN(Nt)&&Nt&&Hn<Number(Nt)||Hn!=null&&!isNaN(Hn)&&Hn&&Xe!=null&&!isNaN(Xe)&&Xe&&Hn>Number(Xe));$e(zr);const as=re==="method_twothousand"&&Nt!=null&&!isNaN(Nt)&&Nt&&Hn<Number(Nt);tt(as);const rs=re==="method_twothousand"&&Hn!=null&&!isNaN(Hn)&&Hn&&Xe!=null&&!isNaN(Xe)&&Xe&&Hn>Number(Xe);Vt(rs)}},lr=St=>{let sr=St.target.value.trim();if(sr===""){qe(null);return}if(/^\d*\.?\d{0,2}$/.test(sr)){qe(sr);const Hn=parseFloat(sr),zr=re==="method_twothousand"&&Xe!=null&&!isNaN(Xe)&&Xe&&Hn&&Hn>Number(Xe);ft(zr),Vt(zr)}},Nr=St=>{let sr=St.target.value.trim();if(sr===""){Ut(null);return}if(/^\d*\.?\d{0,2}$/.test(sr)){Ut(sr);const Hn=parseFloat(sr),zr=re==="method_twothousand"&&(dn!=null&&!isNaN(dn)&&dn&&Hn<Number(dn)||Nt!=null&&!isNaN(Nt)&&Nt&&Hn<Number(Nt)||Lt!=null&&!isNaN(Lt)&&Lt&&Hn<Number(Lt));Vt(zr);const as=re==="method_twothousand"&&dn!=null&&!isNaN(dn)&&dn&&Hn!=null&&!isNaN(Hn)&&Hn&&Hn<Number(dn);$e(as);const rs=re==="method_twothousand"&&Nt!=null&&!isNaN(Nt)&&Nt&&Hn<Number(Nt);tt(rs);const hs=re==="method_twothousand"&&Lt!=null&&!isNaN(Lt)&&Lt&&Hn<Number(Lt);ft(hs)}},fr=St=>{wn(St.target.value),je(!1)},cr=St=>{let sr=St.target.value;if(sr===""){pt("");return}/^\d*\.?\d{0,2}$/.test(sr)&&pt(sr),Ae(!1)},ts=St=>{let sr=St.target.value;if(sr===""){Bt("");return}/^\d*\.?\d{0,2}$/.test(sr)&&Bt(sr)},is=St=>{let sr=St.target.value;if(sr===""){Mt("");return}/^\d*\.?\d{0,2}$/.test(sr)&&Mt(sr)},Or=St=>{["-","+","e"].includes(St.key)&&St.preventDefault()};async function hr(){try{X(!0);const St=bn,sr=window.localStorage.getItem("hyperToken"),Hn="https://dextrabothypev2.nftinit.io/",zr=window.localStorage.getItem("hyperAddress");if(!sr||!r)throw new Error("Authentication token is missing. Please log in again.");const rs=await(await fetch(Hn+"api/test_app/following/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():zr,token:sr,follow_address:r.toLowerCase(),copy_trait_mode:Ve??!1,open_with_increase:xt??!1,included_twaps:kt??!1,future_listed_tokens:un??!1,copy_current:En??!1,margin_used_rate:It??null,min_usd_per_order:Nt??null,max_usd_per_order:dn??null,max_usd_per_positions:Xe??null,initial_order_max_usd:Lt||null,margin_used_amount:Ke||null,increase_limit:en||null,copy_current_percentage:Et||null,scaling:Be||null,method_type:re=="method_two"?2:re=="method_twothousand"?2e3:re=="method_one"?1:null,position_type:Y=="All"?0:Y=="LONG"?1:Y=="SHORT"?2:null,tag:nr??null,comments:on??null,stop_loss_amount:rn.inputValue?rn.inputValue:null,stop_loss_type:rn.selectValue??"%",target_price_amount:_t.inputValue?_t.inputValue:null,target_price_type:_t.selectValue??"%",wallet_id:bn??null,include_coins:Array.isArray(Kn)&&(Kn==null?void 0:Kn.length)>0?Kn:null,exclude_coins:Array.isArray(rr)&&(rr==null?void 0:rr.length)>0?rr:null,target_platform:Fe??"hyper"})})).json();if(rs.success){X(!1),c();const hs=Array.isArray(rs.data)?rs.data.filter(Ls=>{var xs;return((xs=Ls==null?void 0:Ls.wallet_address)==null?void 0:xs.toLowerCase())===(r==null?void 0:r.toLowerCase())}):[],ps=hs==null?void 0:hs.sort((Ls,xs)=>new Date(xs.created_at)-new Date(Ls.created_at));o(ps);const Bi=ps==null?void 0:ps.findIndex(Ls=>(Ls==null?void 0:Ls.wallet_id)===St);ms(Bi!==-1?Bi:0),vi(Fe),Qn(!1),ln.success(`${(r==null?void 0:r.slice(0,5))+"..."+(r==null?void 0:r.slice(-3))} ${Xt?"Copy Trade settings saved":"Successfully added to Copy Trade"}`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"440px",minWidth:"440px",whiteSpace:"nowrap"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),Yr(!1)}else X(!1),ln.error(rs.error_message||"Registration failed.")}catch(St){console.error("Error in copyTradeSave:",St),ln.error(St.message||"An unexpected error occurred."),X(!1)}}const Jn=async()=>{try{ne(!0);const St=window.localStorage.getItem("hyperToken"),sr="https://dextrabothypev2.nftinit.io/api/test_app/following/unfollow/",Hn=window.localStorage.getItem("hyperAddress");if(!St||!r)throw new Error("Required information is missing. Please log in or connect your wallet.");const zr=await fetch(sr,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():Hn,token:St,follow_address:r,target_platform:Fe??"hyper",wallet_id:bn??null})});if(!zr.ok)throw new Error(`Failed to unlike: ${zr.status} ${zr.statusText}`);const as=await zr.json();if(as.success){ne(!1),c();const rs=Array.isArray(as.data)?as.data.filter(ps=>{var Bi;return((Bi=ps==null?void 0:ps.wallet_address)==null?void 0:Bi.toLowerCase())===(r==null?void 0:r.toLowerCase())}):[],hs=Array.isArray(rs)?[...rs].sort((ps,Bi)=>new Date(Bi.created_at)-new Date(ps.created_at)):[];o(hs),hs.length>0?ms(0):ms(null),vi(Fe),rs&&rs.length===0&&ue(),ln.success(`${r.slice(0,5)+"..."+r.slice(-3)} Successfully removed from Copy Trade`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"480px",minWidth:"480px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})}else console.error(as.error_message),ln.error(as.error_message),ne(!1)}catch(St){console.error("Error in unlike function:",St),ln.error(St.message||"Something went wrong!"),ne(!1)}},vs=async St=>{if(!e)return;const sr=St||Fe;try{te(!0);const Hn=window.localStorage.getItem("hyperToken"),zr=window.localStorage.getItem("hyperAddress"),as=sr==="hyper"?"https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list":"https://dextrabothypev2.nftinit.io/api/wallet/list-lighter";if(!Hn)return;const hs=await(await fetch(as,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():zr,token:Hn})})).json();hs.success?(G(hs==null?void 0:hs.data),te(!1)):(console.log(hs.error_message),te(!1),he(hs.error_message))}catch(Hn){console.error("Error generate wallet list:",Hn),te(!1),he(Hn.message)}},si=async()=>{try{const St=window.localStorage.getItem("hyperToken"),sr=window.localStorage.getItem("hyperAddress");if(!St)return;const[Hn,zr]=await Promise.all([fetch("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():sr,token:St})}),fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():sr,token:St})})]),[as,rs]=await Promise.all([Hn.json(),zr.json()]);as.success&&Je(as.data),rs!=null&&rs.success&&wt(rs.data)}catch(St){console.error("Error fetching wallet lists:",St)}},ni=St=>St!=null&&St.assetPositions?St.assetPositions.filter(sr=>{if(!sr.position||!sr.position.szi)return!1;const Hn=parseFloat(sr.position.szi);return!isNaN(Hn)&&Hn!==0}).map(sr=>{const Hn=sr.position,zr=parseFloat(Hn.szi),as=parseFloat(Hn.entryPx),rs=parseFloat(Hn.positionValue),hs=parseFloat(Hn.unrealizedPnl),ps=parseFloat(Hn.returnOnEquity)*100,Bi=parseFloat(Hn.marginUsed),Ls=Hn.leverage.value,xs=parseFloat(Hn.cumFunding.sinceOpen),jr=zr>0?"Long":"Short";return{asset:Hn.coin,type:jr,size:Math.abs(zr),entryPrice:as.toFixed(2),currentPrice:(rs/Math.abs(zr)).toFixed(2),leverage:Ls,positionValue:rs.toFixed(2),marginUsed:Bi.toFixed(2),unrealizedPnl:hs.toFixed(2),roe:ps.toFixed(2),funding:xs.toFixed(4),liquidationPrice:Hn.liquidationPx?parseFloat(Hn.liquidationPx).toFixed(2):"N/A"}}):[];m.useEffect(()=>{const St=async()=>{const zr=await ds.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:r});if(zr.data){Pn(zr.data);const as=ni(zr.data);p(as)}},sr=async()=>{var as,rs,hs;const zr=await ds.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:r});if(zr.data){const ps=((rs=(as=zr.data.find(Ls=>Ls[0]==="perpMonth"))==null?void 0:as[1])==null?void 0:rs.pnlHistory)||[],Bi=((hs=ps[ps.length-1])==null?void 0:hs[1])??0;S(Bi)}},Hn=async()=>{var rs;const as=await(await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=30&order=-perp_pnl&offset=0&limit=50&user_token=${r}`)).json();k(((rs=as==null?void 0:as.results[0])==null?void 0:rs.win_complated_rate)||"-")};r&&(St(),sr(),Hn())},[r]),m.useEffect(()=>{if(!e)return;let St=!1;async function sr(){var Hn,zr;try{Tn(!0);const rs=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),hs=()=>hi.random().hex(),ps={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},Bi=(zr=(Hn=rs.coins)==null?void 0:Hn.filter(Ls=>!Ls.startsWith("@")&&!Ls.endsWith("/USDC")))==null?void 0:zr.map(Ls=>({value:Ls,label:Ls.endsWith("/USDC")?Ls+" (Spot)":Ls,color:hs(),icon:`https://app.hyperliquid.xyz/coins/${ps[Ls]||Ls.split("/")[0]}.svg`}));St||(Dt(Bi),Tn(!1))}catch(as){St||(console.error("Data retrieval error:",as),Tn(!1))}}return sr(),()=>{St=!0}},[e]),m.useEffect(()=>{e&&(vs(Fe),vi(Fe))},[Fe,e]),m.useEffect(()=>{e&&si()},[e]),m.useEffect(()=>{if(!e||!Xt||!os||!Array.isArray(yn)||yn.length===0)return;const St=yn.map(hs=>typeof hs=="string"?hs:hs.value).filter(Boolean),sr=new Map(St.map(hs=>[mi(hs),hs])),Hn=St.map(mi),zr=new Set([...(os.include_coins||[]).map(mi),...(os.exclude_coins||[]).map(mi)]),as=Hn.filter(hs=>!zr.has(hs));if(as.length===0)return;const rs=as.map(hs=>sr.get(hs)||hs);os.future_listed_tokens?ir(hs=>Array.from(new Set([...hs||[],...rs]))):Jt(hs=>Array.from(new Set([...hs||[],...rs])))},[e,Xt,yn,os]),m.useEffect(()=>{e||(t(!1),an(null),mn(null),Pt(null),Ut(null),qe(null),pt(null),Bt(null),et(null),Mt(100),pe("method_two"),st(null),ie("All"),ut(!0),jt(!0),xn(!1),On(!0),jn(!0),Zn(null),$n(null),wn(null),Oe(null),cn({inputValue:null,selectValue:"%"}),Yn({inputValue:null,selectValue:"%"}),ir(null),Jt(null),ce(!1),Ae(!1),$e(!1),tt(!1),ft(!1),Vt(!1),je(!1),Re(!1),fe(!1),Zt(!1),Me(!1),Se(!1),Gt(!1),Rn(!1),Sr(!1),Yr(!1),G([]),o(null),ms(null))},[e]),m.useEffect(()=>{const St=oe.find(sr=>(sr==null?void 0:sr.wallet_id)===(n==null?void 0:n.wallet_id));St&&Zn(St==null?void 0:St.wallet_id)},[oe,n]),m.useEffect(()=>{Fe==="lighter"?(Be!==""&&Number(Be)>100?Re(!0):Re(!1),Rn(!At)):(Re(!1),Rn(!1))},[Be,Fe]);const Er=St=>{Zn(St??null),ce(!1),Me(!1)},Sn=St=>{st(St),Se(!1),jn(!1),St==="lighter"&&(re=="method_twothousand"||re=="method_one")&&pe("method_two"),Zn(null)},Mn=()=>{vs(Fe)};m.useEffect(()=>{const St=sr=>{Ye.current&&!Ye.current.contains(sr.target)&&Me(!1),De.current&&!De.current.contains(sr.target)&&Se(!1)};return document.addEventListener("mousedown",St),()=>{document.removeEventListener("mousedown",St)}},[]);const at=[Ce,ge,Qe,it,ot,ct,ye,fn,nn].filter(Boolean).length;m.useEffect(()=>{e&&a&&!W&&(u!=null&&u.some(St=>(St==null?void 0:St.wallet_address)===r)||B(!0),ee(!0)),e||ee(!1)},[e,a]),m.useEffect(()=>{e&&a&&!nt&&Fe!==null&&!T&&(u!=null&&u.some(St=>(St==null?void 0:St.wallet_address)===r)||Fe==="lighter"&&_e(!0),lt(!0)),e||lt(!1)},[e,a,Fe,T]);const zt=()=>{_e(!1),B(!1),t(!1)},er=[{id:1,label:"Hyperliquid",value:"hyper"},{id:2,label:"Lighter",value:"lighter"}];return i.jsxs(i.Fragment,{children:[i.jsx(OLt,{open:Un,setOpen:Qn,copyTradeSave:hr}),i.jsx(UBt,{open:T,setOpen:B,setCopyTradeModal:t,onClose:zt,setIsUnderstand:fe}),i.jsx(d5,{open:xe,setOpen:we,handleListRequest:vs,handlePageChange:()=>{}}),i.jsx(zBt,{open:Le,setOpen:_e,setCopyTradeModal:t,onClose:zt,setIsLighterUnderstand:Zt}),Lr&&Na.createPortal(i.jsx(Ale,{open:Lr,setOpen:Ht,oldSlotCount:Ir,checkAccountTrade:vi,tradeMarket:"copyTrade"}),document.body),i.jsxs(Ea,{open:e,onClose:zt,className:"relative z-50",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#1B1B1B] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl w-full lg:w-[70%]",children:i.jsx("div",{className:`${a&&!de&&T&&!(u!=null&&u.some(St=>(St==null?void 0:St.wallet_address)===r))?"blur-3xl":""} flex flex-col justify-start items-center gap-8 w-full h-max relative bg-[#1B1B1B] rounded-3xl py-2 text-white font-manrope px-2`,children:i.jsx(i.Fragment,{children:V?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Da,{})}):g||d>0||f>0?(oe==null?void 0:oe.length)>0||(Ge==null?void 0:Ge.length)>0||(We==null?void 0:We.length)>0?i.jsxs("div",{className:"flex flex-col lg:flex-row w-full",children:[i.jsxs("div",{className:"w-full lg:w-2/5 min-h-full bg-[#242424] rounded-2xl",children:[i.jsx("div",{className:"absolute right-5 top-5 z-50 bg-black/70 backdrop-blur-md rounded-full w-6 h-6 flex lg:hidden justify-center items-center font-bold font-manrope text-xs",onClick:()=>t(!1),children:i.jsx(DIe,{})}),i.jsx("div",{style:{backgroundImage:`url(${Zbt})`,backgroundSize:"cover",backgroundPosition:"center"},className:"h-24 p-4 rounded-t-xl relative",children:i.jsx("div",{className:"absolute top-16 w-[64px] h-[64px] rounded-full bg-[#53BAA1] border-4 border-[#242424] flex items-center justify-center",children:i.jsx(eDe,{wallet:r,className:"w-full h-full rounded-full object-cover"})})}),i.jsxs("div",{className:"p-4 mt-6 ml-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("a",{className:"text-white font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px] cursor-pointer hover:text-white",href:`/wallet-details/${r}`,target:"_blank",rel:"noreferrer",children:r?r.slice(0,6)+"..."+r.slice(-4):"-"}),i.jsx("span",{children:i.jsx("img",{onClick:St=>{St.stopPropagation(),navigator.clipboard.writeText(r),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})}),i.jsx("span",{className:"ml-auto cursor-pointer",children:i.jsx(y5,{walletAddress:r,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:x.some(St=>St.wallet_address===r)?i.jsx("img",{src:a5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})})]}),i.jsxs("div",{className:"w-full mt-0.5",children:[i.jsxs("div",{className:"w-full border-b border-[#353535] flex relative",children:[i.jsxs("div",{className:"w-1/2 relative py-3 after:content-[''] after:absolute after:top-1/2 after:-translate-y-1/2 after:right-0 after:h-2/4 after:w-[1px] after:bg-[#353535]",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"PERP EQUITY"}),i.jsxs("div",{className:"text-[#67FFBD] font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]",children:["$",Rt?Cr(Rt==null?void 0:Rt.marginSummary.accountValue):"-"]})]}),i.jsxs("div",{className:"w-1/2 flex flex-col justify-center items-end py-3",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"uPnL"}),i.jsxs("div",{className:`${Rt&&Ee&&Ee.reduce((St,sr)=>St+parseFloat(sr.unrealizedPnl),0)>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]`,children:["$",Rt&&Ee?Cr(Math.abs(Ee.reduce((St,sr)=>St+parseFloat(sr.unrealizedPnl||0),0))):"-"]})]})]}),i.jsxs("div",{className:"w-full border-b border-[#353535] flex relative",children:[i.jsxs("div",{className:"w-1/2 relative py-3 after:content-[''] after:absolute after:top-1/2 after:-translate-y-1/2 after:right-0 after:h-2/4 after:w-[1px] after:bg-[#353535]",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"WIN RATE"}),i.jsx("div",{className:"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer relative -top-1",children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})})]}),i.jsxs("div",{className:"text-white font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]",children:[_,"%"]})]}),i.jsxs("div",{className:"w-1/2 flex flex-col justify-center items-end py-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"PnL"}),i.jsx("div",{className:"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer relative -top-1",children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})})]}),i.jsxs("div",{className:`${h&&h>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]`,children:["$",h?Cr(Math.abs(h)):"-"]})]})]}),i.jsxs("div",{className:"mt-3",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px]",children:"OPEN POSITIONS"}),i.jsx(MLt,{positions:Ee})]}),i.jsx("div",{className:"w-full h-px bg-[#353535] mb-1"}),i.jsx("div",{className:"mt-2",children:i.jsx(VBt,{normalizedCopyTradeList:_r,selectedWmIndex:As,setSelectedWmIndex:ms,getSettingList:ue,setIsNewSetting:Yr})})]})]})]}),i.jsxs("div",{className:"flex w-full lg:w-3/5 flex-col justify-start items-center gap-2 p-4 rounded-2xl bg-[#242424] ml-0 lg:ml-4 mt-4 lg:mt-0 relative",children:[i.jsx("div",{role:"status",className:`${J||Q?"block":"hidden"} flex justify-center items-center w-full h-full absolute bg-[#101010]/80 z-50 -mt-[64px] rounded-3xl`,children:i.jsx(Da,{})}),i.jsxs("div",{className:"flex-col justify-between items-center gap-4 w-full border-b border-[#353535] pb-3",children:[at>0&&i.jsxs("div",{className:"absolute right-4 flex sm:hidden rounded-[8px] bg-[rgba(255,121,124,0.16)] backdrop-blur-[16px] w-12 h-10 justify-center items-center text-[#FF797C] font-manrope text-[12px] font-semibold leading-[12px] tracking-[0.22px] gap-2",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),at]}),i.jsxs("div",{className:"flex flex-col items-baseline justify-start sm:flex-row sm:justify-between sm:items-start lg:flex-col lg:items-baseline lg:justify-start xl:flex-row xl:items-start xl:justify-between gap-3 sm:gap-1 lg:gap-3 xl:gap-1 space-y-3",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start space-y-2",children:[i.jsxs("span",{className:"text-[#7C7C7C] font-manrope text-[13px] font-semibold leading-[8px] min-w-max max-h-[12px] flex items-center gap-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:["Select target platform",i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-3.5 min-w-3.5 min-h-3.5 h-3.5"}),i.jsx("span",{children:i.jsx(ro,{content:i.jsxs("div",{className:"text-[9px] flex flex-col gap-1 text-white",children:[i.jsx("span",{className:"uppercase",children:"Hyperliquid"}),i.jsxs("ul",{className:"list-disc pl-4",children:[i.jsx("li",{children:"Method II"}),i.jsx("li",{children:"Method III"})]}),i.jsx("span",{className:"text-[#fff] uppercase mt-2",children:"Lighter"}),i.jsx("ul",{className:"list-disc pl-4",children:i.jsx("li",{children:"Method III"})})]}),positionTop:!1,alignRight:!0,tooltipCss:"max-w-[100px] min-w-[100px] mt-10 leading-[16px]"})})]})]}),i.jsx(v0,{})]}),i.jsxs("div",{ref:De,className:"relative w-full max-w-[250px]",children:[i.jsxs("div",{className:`${Xt&&!vr?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-8 flex items-center justify-between`,onClick:St=>{St.preventDefault(),(!Xt&&vr||Xt&&vr||!Xt&&!vr)&&Se(!se)},children:[i.jsxs("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] flex items-center gap-2",children:[Fe==="hyper"?i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"}):i.jsx(dy,{className:"w-4 h-4 text-white"}),Fe==="hyper"?"Hyperliquid":"Lighter"]}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${se?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),se&&i.jsx("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden p-1",children:i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:er==null?void 0:er.map(St=>i.jsxs("div",{onClick:sr=>{sr.preventDefault(),(!Xt&&vr||Xt&&vr||!Xt&&!vr)&&(Sn(St.value),St.value==="lighter"&&!bt&&a&&_e(!0))},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] ${St.value===Fe?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${Xt&&!vr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsxs("span",{className:"text-white flex items-center gap-2",children:[St.label==="Hyperliquid"?i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"}):i.jsx(dy,{className:"w-4 h-4 text-white"}),St.label]}),St.value===Fe&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},St.id))})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{onClick:()=>{Mn()},className:"hidden sm:flex lg:hidden xl:flex justify-center items-center cursor-pointer",children:i.jsx(ybe,{className:"w-4 h-4 text-[#929292] hover:text-white"})}),i.jsxs("div",{className:"flex flex-col items-start justify-start space-y-2",children:[i.jsx("span",{className:"text-[#7C7C7C] font-manrope text-[13px] font-semibold leading-[8px] -mt-2",children:"Select your wallet"}),i.jsxs("div",{ref:Ye,className:"relative w-full min-w-[240px] max-w-[260px]",children:[i.jsxs("div",{className:"rounded-md bg-[#353535] text-white px-2 h-8 flex items-center justify-between cursor-pointer min-w-max sm:min-w-[260px]",onClick:()=>Me(!ke),children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:bn?((qn=oe==null?void 0:oe.find(St=>(St==null?void 0:St.wallet_id)===bn))==null?void 0:qn.wallet_name)==="Dextrabot"&&((kr=oe==null?void 0:oe.find(St=>(St==null?void 0:St.wallet_id)===bn))==null?void 0:kr.version)===3?((Ar=oe==null?void 0:oe.find(St=>(St==null?void 0:St.wallet_id)===bn))==null?void 0:Ar.wallet_name)+" (API-AGENT) Wallet":(Zr=oe==null?void 0:oe.find(St=>(St==null?void 0:St.wallet_id)===bn))==null?void 0:Zr.wallet_name:"Select"}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${ke?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),ke&&i.jsxs("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden px-2.5 py-1.5",children:[i.jsxs("div",{onClick:()=>{const St=Fe==="hyper"?"hyperliquid":"lighter";window.open(`/wallet-management#${St}#add-account#${St}`,"_blank"),Me(!1)},className:"px-3 py-2 text-[#1de674] font-semibold text-sm cursor-pointer flex justify-start items-center gap-1.5 border border-[#8860ff] rounded-md my-1 bg-[#7445ff]",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Add Account"})]}),i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:oe&&((Fs=[...oe].sort((St,sr)=>{var as,rs;const Hn=(as=St==null?void 0:St.wallet_name)==null?void 0:as.includes("Dextrabot"),zr=(rs=sr==null?void 0:sr.wallet_name)==null?void 0:rs.includes("Dextrabot");return Hn&&!zr?-1:!Hn&&zr?1:0}))==null?void 0:Fs.map((St,sr)=>i.jsxs("div",{onClick:Hn=>{Hn.preventDefault(),(!Xt&&vr||Xt&&vr||!Xt&&!vr)&&Er(St==null?void 0:St.wallet_id)},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] ${Xt&&!vr?"cursor-not-allowed":"cursor-pointer"} ${(St==null?void 0:St.wallet_id)===bn?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white`,children:[i.jsx("span",{className:"text-white",children:(St==null?void 0:St.wallet_name)==="Dextrabot"&&(St==null?void 0:St.version)===3?(St==null?void 0:St.wallet_name)+" (API-AGENT) Wallet":St==null?void 0:St.wallet_name}),(St==null?void 0:St.wallet_id)===bn&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},(St==null?void 0:St.wallet_id)??sr)))})]}),Ce&&i.jsx("div",{className:"absolute top-8 left-0 px-3 py-1 bg-[#3b2626] rounded-md h-7",children:i.jsx("div",{className:"text-[#ff787b] text-xs font-semibold font-manrope",children:"You need to choose a wallet"})})]})]}),i.jsx("div",{onClick:()=>{Mn()},className:"flex sm:hidden lg:flex xl:hidden justify-center items-center cursor-pointer",children:i.jsx(ybe,{className:"w-4 h-4 text-[#929292] hover:text-white"})})]})]})]}),i.jsxs("div",{className:"flex flex-row items-center justify-between rounded-md w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-between rounded-md",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx("div",{className:"w-8 lg:w-12 h-8 lg:h-12 flex items-center justify-center rounded-full bg-[rgba(255,217,121,0.16)]",children:i.jsx("span",{className:"text-[#F2C94C] text-xl",children:i.jsx("img",{src:Jbt,alt:"Dextrabot",className:"w-[18px] h-[18px]"})})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("span",{className:"text-white font-manrope text-[14px] font-semibold leading-[8px]",children:"Trade Settings"}),i.jsx("div",{className:"text-[#979797] font-manrope text-[12px] font-normal leading-[8px] tracking-[0.24px]",children:"Make your settings for this Trader"})]})]}),i.jsx("div",{className:`${fn||Fe==="hyper"?"hidden":""} flex justify-center items-center space-x-4 mt-1 ml-10 lg:ml-[60px]`,children:i.jsxs("a",{href:"https://docs.dextrabot.com/copy-trade/methodology",target:"_blank",rel:"noopener noreferrer",className:"flex items-center bg-[#4A4A4A] rounded-lg text-[#CECECE] font-manrope text-[11px] font-semibold leading-[8px] px-3 py-2 hover:text-white",children:[i.jsx("img",{src:Vme,alt:"Dextrabot",className:"w-4 h-4 mr-2"}),"Methodology"]})})]}),fn||Fe==="hyper"?i.jsx("div",{className:"flex justify-center items-center space-x-4 mt-2 ml-10 lg:ml-[60px]",children:i.jsxs("a",{href:"https://docs.dextrabot.com/copy-trade/methodology",target:"_blank",rel:"noopener noreferrer",className:"flex items-center bg-[#4A4A4A] rounded-lg text-[#CECECE] font-manrope text-[11px] font-semibold leading-[8px] px-3 py-2 hover:text-white",children:[i.jsx("img",{src:Vme,alt:"Dextrabot",className:"w-4 h-4 mr-2"}),"Methodology"]})}):Fe==="lighter"&&i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold w-full",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(r5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[or||0,"/",Vn+or||0]})]})]}),i.jsx("div",{onClick:()=>{Fr(mt),Ht(!0)},className:"flex items-center justify-center h-8 px-2 sm:px-6 rounded-[10px] text-[11px] sm:text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Get more slots"})]})]}),i.jsx("div",{className:`${fn?"mt-2":""} flex flex-col justify-start items-start w-full`,children:i.jsxs("div",{className:"flex justify-stretch w-full gap-[5px] xl:gap-[14px] pt-[2px] border-b border-[#353535]",children:[i.jsxs("div",{onClick:()=>{(re!=="method_two"&&re!=="method_twothousand"&&Fe==="hyper"||(re=="method_two"||re=="method_twothousand")&&(!Xt||Xt&&vr)&&Fe==="hyper")&&pe("method_one")},className:`relative ${re==="method_one"?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"text-[#7C7C7C]"} flex-1 h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[14px] font-medium leading-[8px] tracking-[-0.28px] rounded-tl-lg rounded-tr-lg ${(re==="method_two"||re==="method_twothousand")&&Xt&&!vr||Fe!=="hyper"?"cursor-not-allowed":"cursor-pointer"} min-w-max`,children:[i.jsxs("span",{className:"relative",children:["Method I"," ",i.jsx("div",{className:"text-[#ff787b] bg-[#ff797c]/20 text-[9px] font-semibold font-manrope leading-[8px] rounded-md p-1 absolute -top-4 left-[45px] lg:hidden animate-bounce",children:"LEGACY"})]}),i.jsx("div",{className:"text-[#ff787b] bg-[#ff797c]/20 text-[11px] font-semibold font-manrope leading-[8px] rounded-md p-2 hidden lg:flex",children:"LEGACY"}),re==="method_one"&&i.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-[#67FFBD]"})]}),i.jsxs("div",{onClick:()=>{(re!=="method_one"&&re!=="method_two"&&Fe==="hyper"||(re=="method_one"||re=="method_two")&&(!Xt||Xt&&vr)&&Fe==="hyper")&&pe("method_twothousand")},className:`relative ${re==="method_twothousand"?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"text-[#7C7C7C]"} flex-1 h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[14px] font-medium leading-[8px] tracking-[-0.28px] ${(re==="method_one"||re==="method_two")&&Xt&&!vr||Fe!=="hyper"?"cursor-not-allowed":"cursor-pointer"} rounded-tl-lg rounded-tr-lg min-w-max`,children:["Method II",re==="method_twothousand"&&i.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-[#67FFBD]"})]}),i.jsxs("div",{onClick:()=>{(re!=="method_one"&&re!=="method_twothousand"||(re=="method_one"||re=="method_twothousand")&&(!Xt||Xt&&vr))&&pe("method_two")},className:`relative ${re==="method_two"?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"text-[#7C7C7C]"} flex-1 h-[37px] px-2 py-1.5 justify-center items-center gap-x-2 inline-flex text-[14px] font-medium leading-[8px] tracking-[-0.28px] rounded-tl-lg rounded-tr-lg ${(re==="method_one"||re==="method_twothousand")&&Xt&&!vr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsxs("div",{className:"flex justify-center flex-grow whitespace-nowrap text-center gap-2",children:["Method III"," ",i.jsx("span",{className:"hidden lg:block",children:"(Mirror)"})]}),i.jsx("div",{className:"bg-[rgba(103,255,189,0.16)] text-[#67FFBD] text-[11px] font-semibold font-manrope leading-[8px] rounded-md p-2 hidden lg:flex",children:"Preferred"}),re==="method_two"&&i.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-[#67FFBD]"})]})]})}),re==="method_one"&&i.jsxs("div",{className:"w-full space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Use % of Trader margin per position"}),i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Use % of Trader Margin"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsxs("div",{className:"relative w-full",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{value:It||"",onChange:yt,type:"text",name:"marginUsedRate",onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Used Rate",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${It?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})})]}),i.jsxs("div",{className:"flex flex-col justify-start relative",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Initial Margin Cap"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Ke||"",onChange:cr,type:"text",name:"marginUsedAmount",onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-7
${ge?"border border-[#FF797C]":Ke?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Margin Increase Limit"}),i.jsxs("div",{className:"flex mt-2 relative w-full",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:en||"",onChange:ts,type:"text",name:"marginIncreaseLimit",onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Increase Limit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-7
${en?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Copy Increase as Open Position"}),i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Copy Inc. as Open Pos."}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:xt?"On":"Off"}),i.jsx(jo,{checked:xt,onChange:jt,className:`${xt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Stop Loss"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:rn.inputValue||"",onChange:rt,onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Stop Loss",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-14
${rn.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Take Profit"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:_t.inputValue||"",onChange:Ft,onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Take Profit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-14
${_t.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Include TWAP Orders"}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:kt?"On":"Off"}),i.jsx(jo,{checked:kt,onChange:xn,className:`${kt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Direction Filter"}),i.jsxs("div",{className:"hidden items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(Gx,{title:"All",set_click:()=>ie("All"),isPositionType:Y}),i.jsx(Gx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Y}),i.jsx(Gx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Y})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Copy Current"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:Xt?"This option can only be set when starting copy trading. It cannot be changed later.":"If enabled, your wallet will immediately copy all currently open positions from the Source Wallet.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:En?"On":"Off"}),i.jsx(jo,{checked:En,onChange:St=>{(!Xt||Xt&&vr)&&Ve&&jn(St)},className:`${En?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
${Xt&&!vr||!Ve?"cursor-not-allowed opacity-50":"cursor-pointer"}
rounded-full p-1 transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
${En?"translate-x-3":""}`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Future Listed Tokens"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:un?"On":"Off"}),i.jsx(jo,{checked:un,onChange:On,className:`${un?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4",children:i.jsx("div",{className:"flex flex-col items-start justify-start",children:i.jsx("div",{className:"flex relative w-full",children:i.jsx(MW,{dataCoin:yn,coinInclude:Kn,coinExclude:rr,setCoinInclude:ir,setCoinExclude:Jt,isLoadingCoin:sn})})})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"relative flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Tag"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsx("input",{type:"text",value:nr||"",onChange:fr,placeholder:"Tag",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-2 pr-7
${ye?"border border-[#FF797C]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Run"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When ON, copy trading will start immediately after saving. When OFF, settings will be saved but trading remains paused.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Ve?"On":"Off"}),i.jsx(jo,{checked:Ve,onChange:St=>{ut(St),St||jn(!1)},className:`${Ve?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px]
translate-x-0 rounded-full bg-white ring-0 shadow-lg
transition duration-200 ease-in-out group-data-[checked]:translate-x-3`})})]})]})]})]}),re==="method_twothousand"&&i.jsxs("div",{className:"w-full space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsxs("div",{className:`${ct?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Max. Margin per Positions (Optional)"}),i.jsxs("div",{className:`${ct?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:"Must be greater than or equal to Min Margin per Order, greater than or equal to Max Margin per Order, and greater than or equal to Initial Margin Cap.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${ct?"mt-1":"mt-2"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Xe||"",onChange:Nr,type:"text",name:"maxUsdPerpPositions",onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${ct?"border border-[#FF797C] focus:outline-none focus:ring-0":Xe?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}
placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:`${ot?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Initial Margin Cap (Optional)"}),i.jsxs("div",{className:`${ot?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:"Must be less than or equal to Max Margin per Position.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${ot?"":"mt-1"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Lt||"",onChange:lr,type:"text",name:"initialOrderMaxUsd",onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope leading-none rounded-md w-full h-8 pl-6 pr-7
${ot?"border border-[#FF797C] focus:outline-none focus:ring-0":Lt?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"} placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsxs("div",{className:`${it?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Min. Margin per Order (Optional)"}),i.jsxs("div",{className:`${it?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:"Must be less than or equal to Max Margin per Order and less than or equal to Max Margin per Position.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${it?"mt-1":"mt-2"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Nt||"",onChange:hn,type:"text",name:"minUsdPerOrder",onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${it?"border border-[#FF797C] focus:outline-none focus:ring-0":Nt?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}
placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:`${Qe&&(Xe||Nt)?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Max. Margin per Order"}),i.jsxs("div",{className:`${Qe&&(Xe||Nt)?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:"Must be greater than or equal to Min Margin per Order and less than or equal to Max Margin per Position.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${Qe&&(Xe||Nt)?"":"mt-1"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:dn||"",onChange:vn,type:"text",name:"maxUsdPerOrder",onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${Qe?"border border-[#FF797C] focus:outline-none focus:ring-0":dn?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}
placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Copy Current"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:Xt?"This option can only be set when starting copy trading. It cannot be changed later.":"If enabled, your wallet will immediately copy all currently open positions from the Source Wallet.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:En?"On":"Off"}),i.jsx(jo,{checked:En,onChange:St=>{(!Xt||Xt&&vr)&&Ve&&jn(St)},className:`${En?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
${Xt&&!vr||!Ve?"cursor-not-allowed opacity-50":"cursor-pointer"}
rounded-full p-1 transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
${En?"translate-x-3":""}`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Copy Increase as Open Position"}),i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Copy Inc. as Open Pos."}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:xt?"On":"Off"}),i.jsx(jo,{checked:xt,onChange:jt,className:`${xt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex items-center justify-start gap-1",children:[i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Stop Loss"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:rn.inputValue||"",onChange:rt,onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Stop Loss",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${rn.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Take Profit"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:_t.inputValue||"",onChange:Ft,onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Take Profit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-2
${_t.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2 mt-[6px]",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Direction Filter"}),i.jsxs("div",{className:"hidden items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(Gx,{title:"All",set_click:()=>ie("All"),isPositionType:Y}),i.jsx(Gx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Y}),i.jsx(Gx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Y})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Include TWAP Orders"}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:kt?"On":"Off"}),i.jsx(jo,{checked:kt,onChange:xn,className:`${kt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Future Listed Tokens"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:un?"On":"Off"}),i.jsx(jo,{checked:un,onChange:On,className:`${un?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4",children:i.jsx("div",{className:"flex flex-col items-start justify-start",children:i.jsx("div",{className:"flex relative w-full",children:i.jsx(MW,{dataCoin:yn,coinInclude:Kn,coinExclude:rr,setCoinInclude:ir,setCoinExclude:Jt,isLoadingCoin:sn})})})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"relative flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Tag"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsx("input",{type:"text",value:nr||"",onChange:fr,placeholder:"Tag",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-2 pr-7
${ye?"border border-[#FF797C]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Run"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When ON, copy trading will start immediately after saving. When OFF, settings will be saved but trading remains paused.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Ve?"On":"Off"}),i.jsx(jo,{checked:Ve,onChange:St=>{ut(St),St||jn(!1)},className:`${Ve?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px]
translate-x-0 rounded-full bg-white ring-0 shadow-lg
transition duration-200 ease-in-out group-data-[checked]:translate-x-3`})})]})]})]})]}),re==="method_two"&&i.jsxs("div",{className:"w-full space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Scaling"}),i.jsxs("div",{className:"flex mt-2 w-full relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{value:Be||"",onChange:is,type:"text",name:"scalingPercentage",onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Scaling",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-7 ${Be?Ie?"border border-[#D97706]":"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`}),Ie&&i.jsxs("span",{className:"absolute left-0 top-11 -translate-y-1/2 text-[#F59E0B] font-semibold text-[9px] leading-2 flex",children:[i.jsx(TM,{className:"w-4 h-4 text-[#F59E0B]"}),i.jsx("span",{className:"text-[9px] leading-[10px] ml-1",children:"If scaling produces sizes above your available margin, orders will fail."})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Copy Increase as Open Position"}),i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Copy Inc. as Open Pos."}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:xt?"On":"Off"}),i.jsx(jo,{checked:xt,onChange:jt,className:`${xt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Stop Loss"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:rn.inputValue||"",onChange:rt,onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Stop Loss",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-14
${rn.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Take Profit"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:_t.inputValue||"",onChange:Ft,onKeyDown:Or,autoComplete:"off",min:"0",placeholder:"Take Profit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-6 pr-14
${_t.inputValue?"border border-[#C5C5C5]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Include TWAP Orders"}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:kt?"On":"Off"}),i.jsx(jo,{checked:kt,onChange:xn,className:`${kt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Direction Filter"}),i.jsxs("div",{className:"hidden items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(Gx,{title:"All",set_click:()=>ie("All"),isPositionType:Y}),i.jsx(Gx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Y}),i.jsx(Gx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Y})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Copy Current"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(ro,{content:Fe==="lighter"?"Coming Soon":Xt?"This option can only be set when starting copy trading. It cannot be changed later.":"If enabled, your wallet will immediately copy all currently open positions from the Source Wallet.",positionTop:!1,alignRight:!0,tooltipCss:`${Fe==="lighter"?"max-w-[120px]":"mt-8 max-w-[300px]"} min-w-[120px] leading-[16px]`})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:En?"On":"Off"}),i.jsx(jo,{checked:En,onChange:St=>{(!Xt||Xt&&vr)&&Ve&&Fe==="hyper"&&jn(St)},className:`${En?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
${Xt&&!vr||!Ve||Fe==="lighter"?"cursor-not-allowed opacity-50":"cursor-pointer"}
rounded-full p-1 transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
${En?"translate-x-3":""}`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Future Listed Tokens"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:un?"On":"Off"}),i.jsx(jo,{checked:un,onChange:On,className:`${un?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
group-data-[checked]:translate-x-3`})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4",children:i.jsx("div",{className:"flex flex-col items-start justify-start",children:i.jsx("div",{className:"flex relative w-full",children:i.jsx(MW,{dataCoin:yn,coinInclude:Kn,coinExclude:rr,setCoinInclude:ir,setCoinExclude:Jt,isLoadingCoin:sn})})})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"relative flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Tag"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsx("input",{type:"text",value:nr||"",onChange:fr,placeholder:"Tag",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
leading-none rounded-md w-full h-8 pl-2 pr-7
${ye?"border border-[#FF797C]":""}
outline-[#404040] placeholder:text-[#7F7F7F]`})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Run"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(ro,{content:"When ON, copy trading will start immediately after saving. When OFF, settings will be saved but trading remains paused.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Ve?"On":"Off"}),i.jsx(jo,{checked:Ve,onChange:St=>{ut(St),St||jn(!1)},className:`${Ve?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px]
translate-x-0 rounded-full bg-white ring-0 shadow-lg
transition duration-200 ease-in-out group-data-[checked]:translate-x-3`})})]})]})]}),Fe==="lighter"?fn?i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"Copy Trading on Lighter requires an active Dextrabot subscription. Get access to copy this trader and more."}):nn?i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"Your current slot count is not sufficient for this action. To proceed, please purchase additional slots using the ‘Get more slots’ button."}):Gs?i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"This wallet already has an active Copy Trade. Please select a different wallet to create a new Copy Trade."}):i.jsx("div",{className:"text-[#F59E0B] font-semibold text-[10px] leading-4 border border-[#D97706] rounded-md px-3 py-1",children:"All positions opened via Lighter Copy Trade are executed in Cross Margin Mode."}):Gs&&i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"This wallet already has an active Copy Trade. Please select a different wallet to create a new Copy Trade."})]}),i.jsxs("div",{className:"flex items-center w-full mt-auto h-16 border-t border-t-[#353535] bg-[rgba(27,27,27,0.32)] backdrop-blur-[16px] p-2 rounded-b-2xl",children:[at>0&&!fn&&i.jsxs("div",{className:"hidden sm:flex rounded-[8px] bg-[rgba(255,121,124,0.16)] backdrop-blur-[16px] w-12 h-10 justify-center items-center text-[#FF797C] font-manrope text-[12px] font-semibold leading-[12px] tracking-[0.22px] gap-2",children:[i.jsx("img",{src:ec,alt:"Dextrabot"}),at]}),i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsx("button",{onClick:()=>t(!1),className:"rounded-[12px] border bg-black/5 border-[#353535] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] hover:border-white px-[24px] py-[12px] font-inter font-[13px] mr-2 h-[32px] flex items-center justify-center text-medium leading-[8px] tracking-[-0.26px]",children:"Cancel"}),i.jsx("button",{onClick:St=>{bn!=null&&!isNaN(bn)&&(re!=="method_one"||Ke!=null&&!isNaN(Ke)&&Ke)&&(re!=="method_twothousand"||dn!=null&&!isNaN(dn)&&dn&&(!(Xe!=null&&!isNaN(Xe)&&Xe)||Number(Xe)>=Number(dn)&&(!(Nt!=null&&!isNaN(Nt)&&Nt)||Number(Xe)>=Number(Nt))&&(!(Lt!=null&&!isNaN(Lt)&&Lt)||Number(Xe)>=Number(Lt)))&&(!(Nt!=null&&!isNaN(Nt)&&Nt)||Number(dn)>=Number(Nt)))&&nr&&(Fe!=="lighter"||At)&&(Fe!=="lighter"||!nn)?!rn.inputValue||!_t.inputValue?Qn(!0):hr():(ce(bn==null||isNaN(bn)),Ae(re==="method_one"&&(Ke==null||isNaN(Ke)||!Ke)),$e(re==="method_twothousand"&&(dn==null||isNaN(dn)||!dn||dn!=null&&!isNaN(dn)&&dn&&Nt!=null&&!isNaN(Nt)&&Nt&&Number(Nt)>Number(dn)||dn!=null&&!isNaN(dn)&&dn&&Xe!=null&&!isNaN(Xe)&&Xe&&Number(dn)>Number(Xe))),tt(re==="method_twothousand"&&(dn!=null&&!isNaN(dn)&&dn&&Nt!=null&&!isNaN(Nt)&&Nt&&Number(Nt)>Number(dn)||Xe!=null&&!isNaN(Xe)&&Xe&&Nt!=null&&!isNaN(Nt)&&Nt&&Number(Nt)>Number(Xe))),ft(re==="method_twothousand"&&Xe!=null&&!isNaN(Xe)&&Xe&&Lt!=null&&!isNaN(Lt)&&Lt&&Number(Lt)>Number(Xe)),Vt(re==="method_twothousand"&&Xe!=null&&!isNaN(Xe)&&Xe&&(dn!=null&&!isNaN(dn)&&dn&&Number(dn)>Number(Xe)||Nt!=null&&!isNaN(Nt)&&Nt&&Number(Nt)>Number(Xe)||Lt!=null&&!isNaN(Lt)&&Lt&&Number(Lt)>Number(Xe))),je(!nr||nr===""),Re(Fe==="lighter"&&Be&&Be>100),Rn(Fe==="lighter"&&!At))},type:"button",className:`${re==="method_one"||Fe==="lighter"&&fn||Fe==="lighter"&&nn||Gs?"hidden":""} rounded-[10px] border border-[#8861FF] bg-[#7446FF] hover:bg-[#5834C3] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] font-inter px-[24px] py-[12px] font-[13px] h-[32px] flex items-center justify-center text-medium mr-2 leading-[8px] tracking-[-0.26px]`,children:"Apply"}),at>0&&Fe==="lighter"&&fn&&i.jsx(HBt,{checkAccountCopy:vi,setIsLighterSub:Gt,setLighterSubError:Rn,setSlotCount:qt,setSlotSubsCount:In,setSlotUsingCount:Wn,setSlotTotalCount:gr,setSlotCountWallets:Kr}),at>0&&!fn&&nn&&Fe==="lighter"&&i.jsx("div",{onClick:()=>{Fr(mt),Ht(!0)},className:"flex items-center justify-center h-8 px-2 sm:px-6 rounded-[10px] text-[11px] sm:text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Get more slots"}),i.jsx("button",{onClick:St=>{St.preventDefault(),u!=null&&u.some(sr=>sr.wallet_address===r)&&Jn()},type:"button",className:`rounded-[12px] border border-[#353535] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] hover:border-[#FF797C] font-inter px-[24px] py-[12px] font-[13px] h-[32px] text-medium leading-[8px] tracking-[-0.26px] flex !text-[#FF797C] items-center justify-center bg-[rgba(27,27,27,0.32)]" ${u!=null&&u.some(St=>St.wallet_address===r)&&!vr?"":"hidden"}`,children:"Delete"})]})]})]})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 my-16 px-4",children:[i.jsx("div",{className:"py-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsx("span",{className:"text-center mb-5 font-bold mt-3 text-[21px]",children:"Wallet Required!"}),i.jsx("span",{className:"text-center mb-5 font-medium px-10 -mt-6",children:"You need to create and fund at least one wallet before starting copy trading."}),i.jsx("div",{onClick:()=>{window.location.href="/wallet-management"},className:"w-[284px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer ",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Go to Wallet Management"})})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 mt-16 mb-8 px-4 text-white",children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsx("span",{className:"text-center mb-5 font-bold mt-10 text-[21px]",children:"Closed Beta Has Started! 🚀"}),i.jsx("span",{className:"text-center mb-5 font-medium px-10 -mt-6",children:"Follow our Discord to stay updated and be ready for the full launch!"}),i.jsx("span",{className:"text-center mb-5 font-medium px-10 -mt-6",children:"Early access requirements:"}),i.jsx("div",{onClick:()=>{window.open("https://www.tensor.trade/trade/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Sol"})}),i.jsx("div",{onClick:()=>{window.open("https://blur.io/collection/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Eth"})}),i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Join Our Discord"})})]})})})})})})]})]})}const Gx=({title:e,set_click:t,isPositionType:n})=>i.jsx("div",{onClick:t,className:`${n==e?n=="LONG"?"bg-[#67ffbd]/20 text-[#67FFBD]":n=="SHORT"?"bg-[#ff797c]/20 text-[#FF797C]":(n=="All","bg-[#3d3d3d] text-white"):"bg-transparent text-[#9b9b9b]"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:e});function tDe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=tDe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function sa(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=tDe(e))&&(r&&(r+=" "),r+=t);return r}var LW,aye;function df(){if(aye)return LW;aye=1;var e=Array.isArray;return LW=e,LW}var DW,oye;function nDe(){if(oye)return DW;oye=1;var e=typeof Tu=="object"&&Tu&&Tu.Object===Object&&Tu;return DW=e,DW}var BW,lye;function hx(){if(lye)return BW;lye=1;var e=nDe(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return BW=n,BW}var $W,cye;function oT(){if(cye)return $W;cye=1;var e=hx(),t=e.Symbol;return $W=t,$W}var UW,uye;function WBt(){if(uye)return UW;uye=1;var e=oT(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function a(o){var l=n.call(o,s),c=o[s];try{o[s]=void 0;var u=!0}catch{}var d=r.call(o);return u&&(l?o[s]=c:delete o[s]),d}return UW=a,UW}var zW,dye;function qBt(){if(dye)return zW;dye=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return zW=n,zW}var HW,fye;function _1(){if(fye)return HW;fye=1;var e=oT(),t=WBt(),n=qBt(),r="[object Null]",s="[object Undefined]",a=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?s:r:a&&a in Object(l)?t(l):n(l)}return HW=o,HW}var VW,hye;function k1(){if(hye)return VW;hye=1;function e(t){return t!=null&&typeof t=="object"}return VW=e,VW}var WW,pye;function qA(){if(pye)return WW;pye=1;var e=_1(),t=k1(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return WW=r,WW}var qW,mye;function jle(){if(mye)return qW;mye=1;var e=df(),t=qA(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(a,o){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||o!=null&&a in Object(o)}return qW=s,qW}var GW,xye;function p2(){if(xye)return GW;xye=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return GW=e,GW}var KW,gye;function Ele(){if(gye)return KW;gye=1;var e=_1(),t=p2(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",a="[object Proxy]";function o(l){if(!t(l))return!1;var c=e(l);return c==r||c==s||c==n||c==a}return KW=o,KW}var YW,bye;function GBt(){if(bye)return YW;bye=1;var e=hx(),t=e["__core-js_shared__"];return YW=t,YW}var XW,yye;function KBt(){if(yye)return XW;yye=1;var e=GBt(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return XW=n,XW}var QW,vye;function rDe(){if(vye)return QW;vye=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return QW=n,QW}var ZW,wye;function YBt(){if(wye)return ZW;wye=1;var e=Ele(),t=KBt(),n=p2(),r=rDe(),s=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(x){if(!n(x)||t(x))return!1;var g=e(x)?d:a;return g.test(r(x))}return ZW=f,ZW}var JW,Cye;function XBt(){if(Cye)return JW;Cye=1;function e(t,n){return t==null?void 0:t[n]}return JW=e,JW}var eq,Sye;function w5(){if(Sye)return eq;Sye=1;var e=YBt(),t=XBt();function n(r,s){var a=t(r,s);return e(a)?a:void 0}return eq=n,eq}var tq,Nye;function T$(){if(Nye)return tq;Nye=1;var e=w5(),t=e(Object,"create");return tq=t,tq}var nq,Aye;function QBt(){if(Aye)return nq;Aye=1;var e=T$();function t(){this.__data__=e?e(null):{},this.size=0}return nq=t,nq}var rq,jye;function ZBt(){if(jye)return rq;jye=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return rq=e,rq}var sq,Eye;function JBt(){if(Eye)return sq;Eye=1;var e=T$(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(a){var o=this.__data__;if(e){var l=o[a];return l===t?void 0:l}return r.call(o,a)?o[a]:void 0}return sq=s,sq}var iq,_ye;function e$t(){if(_ye)return iq;_ye=1;var e=T$(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var a=this.__data__;return e?a[s]!==void 0:n.call(a,s)}return iq=r,iq}var aq,kye;function t$t(){if(kye)return aq;kye=1;var e=T$(),t="__lodash_hash_undefined__";function n(r,s){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&s===void 0?t:s,this}return aq=n,aq}var oq,Tye;function n$t(){if(Tye)return oq;Tye=1;var e=QBt(),t=ZBt(),n=JBt(),r=e$t(),s=t$t();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,oq=a,oq}var lq,Iye;function r$t(){if(Iye)return lq;Iye=1;function e(){this.__data__=[],this.size=0}return lq=e,lq}var cq,Pye;function _le(){if(Pye)return cq;Pye=1;function e(t,n){return t===n||t!==t&&n!==n}return cq=e,cq}var uq,Fye;function I$(){if(Fye)return uq;Fye=1;var e=_le();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return uq=t,uq}var dq,Oye;function s$t(){if(Oye)return dq;Oye=1;var e=I$(),t=Array.prototype,n=t.splice;function r(s){var a=this.__data__,o=e(a,s);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():n.call(a,o,1),--this.size,!0}return dq=r,dq}var fq,Mye;function i$t(){if(Mye)return fq;Mye=1;var e=I$();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return fq=t,fq}var hq,Rye;function a$t(){if(Rye)return hq;Rye=1;var e=I$();function t(n){return e(this.__data__,n)>-1}return hq=t,hq}var pq,Lye;function o$t(){if(Lye)return pq;Lye=1;var e=I$();function t(n,r){var s=this.__data__,a=e(s,n);return a<0?(++this.size,s.push([n,r])):s[a][1]=r,this}return pq=t,pq}var mq,Dye;function P$(){if(Dye)return mq;Dye=1;var e=r$t(),t=s$t(),n=i$t(),r=a$t(),s=o$t();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,mq=a,mq}var xq,Bye;function kle(){if(Bye)return xq;Bye=1;var e=w5(),t=hx(),n=e(t,"Map");return xq=n,xq}var gq,$ye;function l$t(){if($ye)return gq;$ye=1;var e=n$t(),t=P$(),n=kle();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return gq=r,gq}var bq,Uye;function c$t(){if(Uye)return bq;Uye=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return bq=e,bq}var yq,zye;function F$(){if(zye)return yq;zye=1;var e=c$t();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return yq=t,yq}var vq,Hye;function u$t(){if(Hye)return vq;Hye=1;var e=F$();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return vq=t,vq}var wq,Vye;function d$t(){if(Vye)return wq;Vye=1;var e=F$();function t(n){return e(this,n).get(n)}return wq=t,wq}var Cq,Wye;function f$t(){if(Wye)return Cq;Wye=1;var e=F$();function t(n){return e(this,n).has(n)}return Cq=t,Cq}var Sq,qye;function h$t(){if(qye)return Sq;qye=1;var e=F$();function t(n,r){var s=e(this,n),a=s.size;return s.set(n,r),this.size+=s.size==a?0:1,this}return Sq=t,Sq}var Nq,Gye;function Tle(){if(Gye)return Nq;Gye=1;var e=l$t(),t=u$t(),n=d$t(),r=f$t(),s=h$t();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,Nq=a,Nq}var Aq,Kye;function sDe(){if(Kye)return Aq;Kye=1;var e=Tle(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var a=function(){var o=arguments,l=s?s.apply(this,o):o[0],c=a.cache;if(c.has(l))return c.get(l);var u=r.apply(this,o);return a.cache=c.set(l,u)||c,u};return a.cache=new(n.Cache||e),a}return n.Cache=e,Aq=n,Aq}var jq,Yye;function p$t(){if(Yye)return jq;Yye=1;var e=sDe(),t=500;function n(r){var s=e(r,function(o){return a.size===t&&a.clear(),o}),a=s.cache;return s}return jq=n,jq}var Eq,Xye;function m$t(){if(Xye)return Eq;Xye=1;var e=p$t(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(t,function(o,l,c,u){a.push(c?u.replace(n,"$1"):l||o)}),a});return Eq=r,Eq}var _q,Qye;function Ile(){if(Qye)return _q;Qye=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,a=Array(s);++r<s;)a[r]=n(t[r],r,t);return a}return _q=e,_q}var kq,Zye;function x$t(){if(Zye)return kq;Zye=1;var e=oT(),t=Ile(),n=df(),r=qA(),s=e?e.prototype:void 0,a=s?s.toString:void 0;function o(l){if(typeof l=="string")return l;if(n(l))return t(l,o)+"";if(r(l))return a?a.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return kq=o,kq}var Tq,Jye;function iDe(){if(Jye)return Tq;Jye=1;var e=x$t();function t(n){return n==null?"":e(n)}return Tq=t,Tq}var Iq,e2e;function aDe(){if(e2e)return Iq;e2e=1;var e=df(),t=jle(),n=m$t(),r=iDe();function s(a,o){return e(a)?a:t(a,o)?[a]:n(r(a))}return Iq=s,Iq}var Pq,t2e;function O$(){if(t2e)return Pq;t2e=1;var e=qA();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Pq=t,Pq}var Fq,n2e;function Ple(){if(n2e)return Fq;n2e=1;var e=aDe(),t=O$();function n(r,s){s=e(s,r);for(var a=0,o=s.length;r!=null&&a<o;)r=r[t(s[a++])];return a&&a==o?r:void 0}return Fq=n,Fq}var Oq,r2e;function oDe(){if(r2e)return Oq;r2e=1;var e=Ple();function t(n,r,s){var a=n==null?void 0:e(n,r);return a===void 0?s:a}return Oq=t,Oq}var g$t=oDe();const np=ki(g$t);var Mq,s2e;function b$t(){if(s2e)return Mq;s2e=1;function e(t){return t==null}return Mq=e,Mq}var y$t=b$t();const yi=ki(y$t);var Rq,i2e;function v$t(){if(i2e)return Rq;i2e=1;var e=_1(),t=df(),n=k1(),r="[object String]";function s(a){return typeof a=="string"||!t(a)&&n(a)&&e(a)==r}return Rq=s,Rq}var w$t=v$t();const W3=ki(w$t);var C$t=Ele();const Ni=ki(C$t);var S$t=p2();const GA=ki(S$t);var Lq={exports:{}},Ia={};/**
* @license React
* react-is.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 a2e;function N$t(){if(a2e)return Ia;a2e=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v;v=Symbol.for("react.module.reference");function w(C){if(typeof C=="object"&&C!==null){var N=C.$$typeof;switch(N){case e:switch(C=C.type,C){case n:case s:case r:case u:case d:return C;default:switch(C=C&&C.$$typeof,C){case l:case o:case c:case x:case f:case a:return C;default:return N}}case t:return N}}}return Ia.ContextConsumer=o,Ia.ContextProvider=a,Ia.Element=e,Ia.ForwardRef=c,Ia.Fragment=n,Ia.Lazy=x,Ia.Memo=f,Ia.Portal=t,Ia.Profiler=s,Ia.StrictMode=r,Ia.Suspense=u,Ia.SuspenseList=d,Ia.isAsyncMode=function(){return!1},Ia.isConcurrentMode=function(){return!1},Ia.isContextConsumer=function(C){return w(C)===o},Ia.isContextProvider=function(C){return w(C)===a},Ia.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===e},Ia.isForwardRef=function(C){return w(C)===c},Ia.isFragment=function(C){return w(C)===n},Ia.isLazy=function(C){return w(C)===x},Ia.isMemo=function(C){return w(C)===f},Ia.isPortal=function(C){return w(C)===t},Ia.isProfiler=function(C){return w(C)===s},Ia.isStrictMode=function(C){return w(C)===r},Ia.isSuspense=function(C){return w(C)===u},Ia.isSuspenseList=function(C){return w(C)===d},Ia.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===n||C===s||C===r||C===u||C===d||C===g||typeof C=="object"&&C!==null&&(C.$$typeof===x||C.$$typeof===f||C.$$typeof===a||C.$$typeof===o||C.$$typeof===c||C.$$typeof===v||C.getModuleId!==void 0)},Ia.typeOf=w,Ia}var o2e;function A$t(){return o2e||(o2e=1,Lq.exports=N$t()),Lq.exports}var j$t=A$t(),Dq,l2e;function lDe(){if(l2e)return Dq;l2e=1;var e=_1(),t=k1(),n="[object Number]";function r(s){return typeof s=="number"||t(s)&&e(s)==n}return Dq=r,Dq}var Bq,c2e;function E$t(){if(c2e)return Bq;c2e=1;var e=lDe();function t(n){return e(n)&&n!=+n}return Bq=t,Bq}var _$t=E$t();const KA=ki(_$t);var k$t=lDe();const T$t=ki(k$t);var om=function(t){return t===0?0:t>0?1:-1},nw=function(t){return W3(t)&&t.indexOf("%")===t.length-1},es=function(t){return T$t(t)&&!KA(t)},rc=function(t){return es(t)||W3(t)},I$t=0,C5=function(t){var n=++I$t;return"".concat(t||"").concat(n)},q3=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!es(t)&&!W3(t))return r;var a;if(nw(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return KA(a)&&(a=r),s&&a>n&&(a=n),a},Ob=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},P$t=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s<n;s++)if(!r[t[s]])r[t[s]]=!0;else return!0;return!1},wl=function(t,n){return es(t)&&es(n)?function(r){return t+r*(n-t)}:function(){return n}};function HR(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):np(r,t))===n})}var F$t=function(t){if(!t||!t.length)return null;for(var n=t.length,r=0,s=0,a=0,o=0,l=1/0,c=-1/0,u=0,d=0,f=0;f<n;f++)u=t[f].cx||0,d=t[f].cy||0,r+=u,s+=d,a+=u*d,o+=u*u,l=Math.min(l,u),c=Math.max(c,u);var x=n*o!==r*r?(n*a-r*s)/(n*o-r*r):0;return{xmin:l,xmax:c,a:x,b:(s-x*r)/n}},O$t=function(t,n){return es(t)&&es(n)?t-n:W3(t)&&W3(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function f4(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function ste(e){"@babel/helpers - typeof";return ste=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ste(e)}var M$t=["viewBox","children"],R$t=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],u2e=["points","pathLength"],$q={svg:M$t,polygon:u2e,polyline:u2e},Fle=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],VR=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!GA(r))return null;var s={};return Object.keys(r).forEach(function(a){Fle.includes(a)&&(s[a]=n||function(o){return r[a](r,o)})}),s},L$t=function(t,n,r){return function(s){return t(n,r,s),null}},n_=function(t,n,r){if(!GA(t)||ste(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(a){var o=t[a];Fle.includes(a)&&typeof o=="function"&&(s||(s={}),s[a]=L$t(o,n,r))}),s},D$t=["children"],B$t=["children"];function d2e(e,t){if(e==null)return{};var n=$$t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $$t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ite(e){"@babel/helpers - typeof";return ite=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ite(e)}var f2e={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Yg=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},h2e=null,Uq=null,Ole=function e(t){if(t===h2e&&Array.isArray(Uq))return Uq;var n=[];return m.Children.forEach(t,function(r){yi(r)||(j$t.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Uq=n,h2e=t,n};function sf(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return Yg(s)}):r=[Yg(t)],Ole(e).forEach(function(s){var a=np(s,"type.displayName")||np(s,"type.name");r.indexOf(a)!==-1&&n.push(s)}),n}function Mf(e,t){var n=sf(e,t);return n[0]}var p2e=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!es(r)||r<=0||!es(s)||s<=0)},U$t=["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"],z$t=function(t){return t&&t.type&&W3(t.type)&&U$t.indexOf(t.type)>=0},cDe=function(t){return t&&ite(t)==="object"&&"clipDot"in t},H$t=function(t,n,r,s){var a,o=(a=$q==null?void 0:$q[s])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!Ni(t)&&(s&&o.includes(n)||R$t.includes(n))||r&&Fle.includes(n)},bi=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(m.isValidElement(t)&&(s=t.props),!GA(s))return null;var a={};return Object.keys(s).forEach(function(o){var l;H$t((l=s)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=s[o])}),a},ate=function e(t,n){if(t===n)return!0;var r=m.Children.count(t);if(r!==m.Children.count(n))return!1;if(r===0)return!0;if(r===1)return m2e(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s<r;s++){var a=t[s],o=n[s];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!m2e(a,o))return!1}return!0},m2e=function(t,n){if(yi(t)&&yi(n))return!0;if(!yi(t)&&!yi(n)){var r=t.props||{},s=r.children,a=d2e(r,D$t),o=n.props||{},l=o.children,c=d2e(o,B$t);return s&&l?f4(a,c)&&ate(s,l):!s&&!l?f4(a,c):!1}return!1},x2e=function(t,n){var r=[],s={};return Ole(t).forEach(function(a,o){if(z$t(a))r.push(a);else if(a){var l=Yg(a.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!s[l])){var f=u(a,l,o);r.push(f),s[l]=!0}}}),r},V$t=function(t){var n=t&&t.type;return n&&f2e[n]?f2e[n]:null},W$t=function(t,n){return Ole(n).indexOf(t)},q$t=["children","width","height","viewBox","className","style","title","desc"];function ote(){return ote=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ote.apply(this,arguments)}function G$t(e,t){if(e==null)return{};var n=K$t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function K$t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function lte(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=G$t(e,q$t),d=s||{width:n,height:r,x:0,y:0},f=sa("recharts-surface",a);return Ne.createElement("svg",ote({},bi(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),Ne.createElement("title",null,l),Ne.createElement("desc",null,c),t)}var Y$t=["children","className"];function cte(){return cte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cte.apply(this,arguments)}function X$t(e,t){if(e==null)return{};var n=Q$t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Q$t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Sa=Ne.forwardRef(function(e,t){var n=e.children,r=e.className,s=X$t(e,Y$t),a=sa("recharts-layer",r);return Ne.createElement("g",cte({className:a},bi(s,!0),{ref:t}),n)}),Xg=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a]},zq,g2e;function Z$t(){if(g2e)return zq;g2e=1;function e(t,n,r){var s=-1,a=t.length;n<0&&(n=-n>a?0:a+n),r=r>a?a:r,r<0&&(r+=a),a=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(a);++s<a;)o[s]=t[s+n];return o}return zq=e,zq}var Hq,b2e;function J$t(){if(b2e)return Hq;b2e=1;var e=Z$t();function t(n,r,s){var a=n.length;return s=s===void 0?a:s,!r&&s>=a?n:e(n,r,s)}return Hq=t,Hq}var Vq,y2e;function uDe(){if(y2e)return Vq;y2e=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,a="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+e+s+a+"]");function c(u){return l.test(u)}return Vq=c,Vq}var Wq,v2e;function eUt(){if(v2e)return Wq;v2e=1;function e(t){return t.split("")}return Wq=e,Wq}var qq,w2e;function tUt(){if(w2e)return qq;w2e=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,a="\\ufe0e\\ufe0f",o="["+e+"]",l="["+s+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",d="[^"+e+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",v=u+"?",w="["+a+"]?",C="(?:"+g+"(?:"+[d,f,x].join("|")+")"+w+v+")*",N=w+v+C,I="(?:"+[d+l+"?",l,f,x,o].join("|")+")",P=RegExp(c+"(?="+c+")|"+I+N,"g");function R(F){return F.match(P)||[]}return qq=R,qq}var Gq,C2e;function nUt(){if(C2e)return Gq;C2e=1;var e=eUt(),t=uDe(),n=tUt();function r(s){return t(s)?n(s):e(s)}return Gq=r,Gq}var Kq,S2e;function rUt(){if(S2e)return Kq;S2e=1;var e=J$t(),t=uDe(),n=nUt(),r=iDe();function s(a){return function(o){o=r(o);var l=t(o)?n(o):void 0,c=l?l[0]:o.charAt(0),u=l?e(l,1).join(""):o.slice(1);return c[a]()+u}}return Kq=s,Kq}var Yq,N2e;function sUt(){if(N2e)return Yq;N2e=1;var e=rUt(),t=e("toUpperCase");return Yq=t,Yq}var iUt=sUt();const M$=ki(iUt);function io(e){return function(){return e}}const dDe=Math.cos,WR=Math.sin,jm=Math.sqrt,qR=Math.PI,R$=2*qR,ute=Math.PI,dte=2*ute,_v=1e-6,aUt=dte-_v;function fDe(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function oUt(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return fDe;const n=10**t;return function(r){this._+=r[0];for(let s=1,a=r.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}class lUt{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?fDe:oUt(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,s){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,n,r,s,a,o){this._append`C${+t},${+n},${+r},${+s},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,s,a){if(t=+t,n=+n,r=+r,s=+s,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,u=s-n,d=o-t,f=l-n,x=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(x>_v)if(!(Math.abs(f*c-u*d)>_v)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,v=s-l,w=c*c+u*u,C=g*g+v*v,N=Math.sqrt(w),I=Math.sqrt(x),P=a*Math.tan((ute-Math.acos((w+x-C)/(2*N*I)))/2),R=P/I,F=P/N;Math.abs(R-1)>_v&&this._append`L${t+R*d},${n+R*f}`,this._append`A${a},${a},0,0,${+(f*g>d*v)},${this._x1=t+F*c},${this._y1=n+F*u}`}}arc(t,n,r,s,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(s),c=r*Math.sin(s),u=t+l,d=n+c,f=1^o,x=o?s-a:a-s;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>_v||Math.abs(this._y1-d)>_v)&&this._append`L${u},${d}`,r&&(x<0&&(x=x%dte+dte),x>aUt?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:x>_v&&this._append`A${r},${r},0,${+(x>=ute)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function Mle(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new lUt(t)}function Rle(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function hDe(e){this._context=e}hDe.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function L$(e){return new hDe(e)}function pDe(e){return e[0]}function mDe(e){return e[1]}function xDe(e,t){var n=io(!0),r=null,s=L$,a=null,o=Mle(l);e=typeof e=="function"?e:e===void 0?pDe:io(e),t=typeof t=="function"?t:t===void 0?mDe:io(t);function l(c){var u,d=(c=Rle(c)).length,f,x=!1,g;for(r==null&&(a=s(g=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===x&&((x=!x)?a.lineStart():a.lineEnd()),x&&a.point(+e(f,u,c),+t(f,u,c));if(g)return a=null,g+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:io(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:io(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:io(!!c),l):n},l.curve=function(c){return arguments.length?(s=c,r!=null&&(a=s(r)),l):s},l.context=function(c){return arguments.length?(c==null?r=a=null:a=s(r=c),l):r},l}function SP(e,t,n){var r=null,s=io(!0),a=null,o=L$,l=null,c=Mle(u);e=typeof e=="function"?e:e===void 0?pDe:io(+e),t=typeof t=="function"?t:io(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?mDe:io(+n);function u(f){var x,g,v,w=(f=Rle(f)).length,C,N=!1,I,P=new Array(w),R=new Array(w);for(a==null&&(l=o(I=c())),x=0;x<=w;++x){if(!(x<w&&s(C=f[x],x,f))===N)if(N=!N)g=x,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=x-1;v>=g;--v)l.point(P[v],R[v]);l.lineEnd(),l.areaEnd()}N&&(P[x]=+e(C,x,f),R[x]=+t(C,x,f),l.point(r?+r(C,x,f):P[x],n?+n(C,x,f):R[x]))}if(I)return l=null,I+""||null}function d(){return xDe().defined(s).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:io(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:io(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:io(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:io(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:io(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:io(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(s=typeof f=="function"?f:io(!!f),u):s},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class gDe{constructor(t,n){this._context=t,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(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function cUt(e){return new gDe(e,!0)}function uUt(e){return new gDe(e,!1)}const Lle={draw(e,t){const n=jm(t/qR);e.moveTo(n,0),e.arc(0,0,n,0,R$)}},dUt={draw(e,t){const n=jm(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},bDe=jm(1/3),fUt=bDe*2,hUt={draw(e,t){const n=jm(t/fUt),r=n*bDe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},pUt={draw(e,t){const n=jm(t),r=-n/2;e.rect(r,r,n,n)}},mUt=.8908130915292852,yDe=WR(qR/10)/WR(7*qR/10),xUt=WR(R$/10)*yDe,gUt=-dDe(R$/10)*yDe,bUt={draw(e,t){const n=jm(t*mUt),r=xUt*n,s=gUt*n;e.moveTo(0,-n),e.lineTo(r,s);for(let a=1;a<5;++a){const o=R$*a/5,l=dDe(o),c=WR(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*s,c*r+l*s)}e.closePath()}},Xq=jm(3),yUt={draw(e,t){const n=-jm(t/(Xq*3));e.moveTo(0,n*2),e.lineTo(-Xq*n,-n),e.lineTo(Xq*n,-n),e.closePath()}},wh=-.5,Ch=jm(3)/2,fte=1/jm(12),vUt=(fte/2+1)*3,wUt={draw(e,t){const n=jm(t/vUt),r=n/2,s=n*fte,a=r,o=n*fte+n,l=-a,c=o;e.moveTo(r,s),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(wh*r-Ch*s,Ch*r+wh*s),e.lineTo(wh*a-Ch*o,Ch*a+wh*o),e.lineTo(wh*l-Ch*c,Ch*l+wh*c),e.lineTo(wh*r+Ch*s,wh*s-Ch*r),e.lineTo(wh*a+Ch*o,wh*o-Ch*a),e.lineTo(wh*l+Ch*c,wh*c-Ch*l),e.closePath()}};function CUt(e,t){let n=null,r=Mle(s);e=typeof e=="function"?e:io(e||Lle),t=typeof t=="function"?t:io(t===void 0?64:+t);function s(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return s.type=function(a){return arguments.length?(e=typeof a=="function"?a:io(a),s):e},s.size=function(a){return arguments.length?(t=typeof a=="function"?a:io(+a),s):t},s.context=function(a){return arguments.length?(n=a??null,s):n},s}function GR(){}function KR(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function vDe(e){this._context=e}vDe.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:KR(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:KR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function SUt(e){return new vDe(e)}function wDe(e){this._context=e}wDe.prototype={areaStart:GR,areaEnd:GR,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:KR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function NUt(e){return new wDe(e)}function CDe(e){this._context=e}CDe.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(e,t){switch(e=+e,t=+t,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+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:KR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AUt(e){return new CDe(e)}function SDe(e){this._context=e}SDe.prototype={areaStart:GR,areaEnd:GR,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function jUt(e){return new SDe(e)}function A2e(e){return e<0?-1:1}function j2e(e,t,n){var r=e._x1-e._x0,s=t-e._x1,a=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),l=(a*s+o*r)/(r+s);return(A2e(a)+A2e(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function E2e(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Qq(e,t,n){var r=e._x0,s=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,s+l*t,a-l,o-l*n,a,o)}function YR(e){this._context=e}YR.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:Qq(this,this._t0,E2e(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Qq(this,E2e(this,n=j2e(this,e,t)),n);break;default:Qq(this,this._t0,n=j2e(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function NDe(e){this._context=new ADe(e)}(NDe.prototype=Object.create(YR.prototype)).point=function(e,t){YR.prototype.point.call(this,t,e)};function ADe(e){this._context=e}ADe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,s,a){this._context.bezierCurveTo(t,e,r,n,a,s)}};function EUt(e){return new YR(e)}function _Ut(e){return new NDe(e)}function jDe(e){this._context=e}jDe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=_2e(e),s=_2e(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],s[0][a],r[1][a],s[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function _2e(e){var t,n=e.length-1,r,s=new Array(n),a=new Array(n),o=new Array(n);for(s[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)s[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=s[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(s[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)s[t]=(o[t]-s[t+1])/a[t];for(a[n-1]=(e[n]+s[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-s[t+1];return[s,a]}function kUt(e){return new jDe(e)}function D$(e,t){this._context=e,this._t=t}D$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function TUt(e){return new D$(e,.5)}function IUt(e){return new D$(e,0)}function PUt(e){return new D$(e,1)}function vN(e,t){if((o=e.length)>1)for(var n=1,r,s,a=e[t[0]],o,l=a.length;n<o;++n)for(s=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(s[r][1])?s[r][0]:s[r][1]}function hte(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function FUt(e,t){return e[t]}function OUt(e){const t=[];return t.key=e,t}function MUt(){var e=io([]),t=hte,n=vN,r=FUt;function s(a){var o=Array.from(e.apply(this,arguments),OUt),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,a)]).data=f;for(l=0,d=Rle(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return s.keys=function(a){return arguments.length?(e=typeof a=="function"?a:io(Array.from(a)),s):e},s.value=function(a){return arguments.length?(r=typeof a=="function"?a:io(+a),s):r},s.order=function(a){return arguments.length?(t=a==null?hte:typeof a=="function"?a:io(Array.from(a)),s):t},s.offset=function(a){return arguments.length?(n=a??vN,s):n},s}function RUt(e,t){if((r=e.length)>0){for(var n,r,s=0,a=e[0].length,o;s<a;++s){for(o=n=0;n<r;++n)o+=e[n][s][1]||0;if(o)for(n=0;n<r;++n)e[n][s][1]/=o}vN(e,t)}}function LUt(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,a=r.length;n<a;++n){for(var o=0,l=0;o<s;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}vN(e,t)}}function DUt(e,t){if(!(!((o=e.length)>0)||!((a=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,a,o;r<a;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[r][1]||0,x=d[r-1][1]||0,g=(f-x)/2,v=0;v<l;++v){var w=e[t[v]],C=w[r][1]||0,N=w[r-1][1]||0;g+=C-N}c+=f,u+=g*f}s[r-1][1]+=s[r-1][0]=n,c&&(n-=u/c)}s[r-1][1]+=s[r-1][0]=n,vN(e,t)}}function r_(e){"@babel/helpers - typeof";return r_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r_(e)}var BUt=["type","size","sizeType"];function pte(){return pte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pte.apply(this,arguments)}function k2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function T2e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k2e(Object(n),!0).forEach(function(r){$Ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Ut(e,t,n){return t=UUt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UUt(e){var t=zUt(e,"string");return r_(t)=="symbol"?t:t+""}function zUt(e,t){if(r_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(r_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HUt(e,t){if(e==null)return{};var n=VUt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VUt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var EDe={symbolCircle:Lle,symbolCross:dUt,symbolDiamond:hUt,symbolSquare:pUt,symbolStar:bUt,symbolTriangle:yUt,symbolWye:wUt},WUt=Math.PI/180,qUt=function(t){var n="symbol".concat(M$(t));return EDe[n]||Lle},GUt=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*WUt;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},KUt=function(t,n){EDe["symbol".concat(M$(t))]=n},B$=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,a=s===void 0?64:s,o=t.sizeType,l=o===void 0?"area":o,c=HUt(t,BUt),u=T2e(T2e({},c),{},{type:r,size:a,sizeType:l}),d=function(){var C=qUt(r),N=CUt().type(C).size(GUt(a,l,r));return N()},f=u.className,x=u.cx,g=u.cy,v=bi(u,!0);return x===+x&&g===+g&&a===+a?Ne.createElement("path",pte({},v,{className:sa("recharts-symbols",f),transform:"translate(".concat(x,", ").concat(g,")"),d:d()})):null};B$.registerSymbol=KUt;function wN(e){"@babel/helpers - typeof";return wN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wN(e)}function mte(){return mte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mte.apply(this,arguments)}function I2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function YUt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I2e(Object(n),!0).forEach(function(r){s_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XUt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QUt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kDe(r.key),r)}}function ZUt(e,t,n){return QUt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function JUt(e,t,n){return t=XR(t),ezt(e,_De()?Reflect.construct(t,n||[],XR(e).constructor):t.apply(e,n))}function ezt(e,t){if(t&&(wN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tzt(e)}function tzt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _De(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_De=function(){return!!e})()}function XR(e){return XR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},XR(e)}function nzt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xte(e,t)}function xte(e,t){return xte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},xte(e,t)}function s_(e,t,n){return t=kDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kDe(e){var t=rzt(e,"string");return wN(t)=="symbol"?t:t+""}function rzt(e,t){if(wN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(wN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ip=32,Dle=function(e){function t(){return XUt(this,t),JUt(this,t,arguments)}return nzt(t,e),ZUt(t,[{key:"renderIcon",value:function(r){var s=this.props.inactiveColor,a=Ip/2,o=Ip/6,l=Ip/3,c=r.inactive?s:r.color;if(r.type==="plainline")return Ne.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:Ip,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return Ne.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,`
H`).concat(Ip,"M").concat(2*l,",").concat(a,`
A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return Ne.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Ip/8,"h").concat(Ip,"v").concat(Ip*3/4,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(Ne.isValidElement(r.legendIcon)){var u=YUt({},r);return delete u.legendIcon,Ne.cloneElement(r.legendIcon,u)}return Ne.createElement(B$,{fill:c,cx:a,cy:a,size:Ip,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,s=this.props,a=s.payload,o=s.iconSize,l=s.layout,c=s.formatter,u=s.inactiveColor,d={x:0,y:0,width:Ip,height:Ip},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},x={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(g,v){var w=g.formatter||c,C=sa(s_(s_({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",g.inactive));if(g.type==="none")return null;var N=Ni(g.value)?null:g.value;Xg(!Ni(g.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var I=g.inactive?u:g.color;return Ne.createElement("li",mte({className:C,style:f,key:"legend-item-".concat(v)},n_(r.props,g,v)),Ne.createElement(lte,{width:o,height:o,viewBox:d,style:x},r.renderIcon(g)),Ne.createElement("span",{className:"recharts-legend-item-text",style:{color:I}},w?w(N,g,v):N))})}},{key:"render",value:function(){var r=this.props,s=r.payload,a=r.layout,o=r.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Ne.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(m.PureComponent);s_(Dle,"displayName","Legend");s_(Dle,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Zq,P2e;function szt(){if(P2e)return Zq;P2e=1;var e=P$();function t(){this.__data__=new e,this.size=0}return Zq=t,Zq}var Jq,F2e;function izt(){if(F2e)return Jq;F2e=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Jq=e,Jq}var eG,O2e;function azt(){if(O2e)return eG;O2e=1;function e(t){return this.__data__.get(t)}return eG=e,eG}var tG,M2e;function ozt(){if(M2e)return tG;M2e=1;function e(t){return this.__data__.has(t)}return tG=e,tG}var nG,R2e;function lzt(){if(R2e)return nG;R2e=1;var e=P$(),t=kle(),n=Tle(),r=200;function s(a,o){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<r-1)return c.push([a,o]),this.size=++l.size,this;l=this.__data__=new n(c)}return l.set(a,o),this.size=l.size,this}return nG=s,nG}var rG,L2e;function TDe(){if(L2e)return rG;L2e=1;var e=P$(),t=szt(),n=izt(),r=azt(),s=ozt(),a=lzt();function o(l){var c=this.__data__=new e(l);this.size=c.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,rG=o,rG}var sG,D2e;function czt(){if(D2e)return sG;D2e=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return sG=t,sG}var iG,B2e;function uzt(){if(B2e)return iG;B2e=1;function e(t){return this.__data__.has(t)}return iG=e,iG}var aG,$2e;function IDe(){if($2e)return aG;$2e=1;var e=Tle(),t=czt(),n=uzt();function r(s){var a=-1,o=s==null?0:s.length;for(this.__data__=new e;++a<o;)this.add(s[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,aG=r,aG}var oG,U2e;function PDe(){if(U2e)return oG;U2e=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return oG=e,oG}var lG,z2e;function FDe(){if(z2e)return lG;z2e=1;function e(t,n){return t.has(n)}return lG=e,lG}var cG,H2e;function ODe(){if(H2e)return cG;H2e=1;var e=IDe(),t=PDe(),n=FDe(),r=1,s=2;function a(o,l,c,u,d,f){var x=c&r,g=o.length,v=l.length;if(g!=v&&!(x&&v>g))return!1;var w=f.get(o),C=f.get(l);if(w&&C)return w==l&&C==o;var N=-1,I=!0,P=c&s?new e:void 0;for(f.set(o,l),f.set(l,o);++N<g;){var R=o[N],F=l[N];if(u)var U=x?u(F,R,N,l,o,f):u(R,F,N,o,l,f);if(U!==void 0){if(U)continue;I=!1;break}if(P){if(!t(l,function(L,z){if(!n(P,z)&&(R===L||d(R,L,c,u,f)))return P.push(z)})){I=!1;break}}else if(!(R===F||d(R,F,c,u,f))){I=!1;break}}return f.delete(o),f.delete(l),I}return cG=a,cG}var uG,V2e;function dzt(){if(V2e)return uG;V2e=1;var e=hx(),t=e.Uint8Array;return uG=t,uG}var dG,W2e;function fzt(){if(W2e)return dG;W2e=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,a){r[++n]=[a,s]}),r}return dG=e,dG}var fG,q2e;function Ble(){if(q2e)return fG;q2e=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return fG=e,fG}var hG,G2e;function hzt(){if(G2e)return hG;G2e=1;var e=oT(),t=dzt(),n=_le(),r=ODe(),s=fzt(),a=Ble(),o=1,l=2,c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Map]",x="[object Number]",g="[object RegExp]",v="[object Set]",w="[object String]",C="[object Symbol]",N="[object ArrayBuffer]",I="[object DataView]",P=e?e.prototype:void 0,R=P?P.valueOf:void 0;function F(U,L,z,Q,ne,J,X){switch(z){case I:if(U.byteLength!=L.byteLength||U.byteOffset!=L.byteOffset)return!1;U=U.buffer,L=L.buffer;case N:return!(U.byteLength!=L.byteLength||!J(new t(U),new t(L)));case c:case u:case x:return n(+U,+L);case d:return U.name==L.name&&U.message==L.message;case g:case w:return U==L+"";case f:var re=s;case v:var pe=Q&o;if(re||(re=a),U.size!=L.size&&!pe)return!1;var Y=X.get(U);if(Y)return Y==L;Q|=l,X.set(U,L);var ie=r(re(U),re(L),Q,ne,J,X);return X.delete(U),ie;case C:if(R)return R.call(U)==R.call(L)}return!1}return hG=F,hG}var pG,K2e;function MDe(){if(K2e)return pG;K2e=1;function e(t,n){for(var r=-1,s=n.length,a=t.length;++r<s;)t[a+r]=n[r];return t}return pG=e,pG}var mG,Y2e;function pzt(){if(Y2e)return mG;Y2e=1;var e=MDe(),t=df();function n(r,s,a){var o=s(r);return t(r)?o:e(o,a(r))}return mG=n,mG}var xG,X2e;function mzt(){if(X2e)return xG;X2e=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,a=0,o=[];++r<s;){var l=t[r];n(l,r,t)&&(o[a++]=l)}return o}return xG=e,xG}var gG,Q2e;function xzt(){if(Q2e)return gG;Q2e=1;function e(){return[]}return gG=e,gG}var bG,Z2e;function gzt(){if(Z2e)return bG;Z2e=1;var e=mzt(),t=xzt(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(o){return o==null?[]:(o=Object(o),e(s(o),function(l){return r.call(o,l)}))}:t;return bG=a,bG}var yG,J2e;function bzt(){if(J2e)return yG;J2e=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return yG=e,yG}var vG,eve;function yzt(){if(eve)return vG;eve=1;var e=_1(),t=k1(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return vG=r,vG}var wG,tve;function $le(){if(tve)return wG;tve=1;var e=yzt(),t=k1(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,a=e(function(){return arguments}())?e:function(o){return t(o)&&r.call(o,"callee")&&!s.call(o,"callee")};return wG=a,wG}var jj={exports:{}},CG,nve;function vzt(){if(nve)return CG;nve=1;function e(){return!1}return CG=e,CG}jj.exports;var rve;function RDe(){return rve||(rve=1,function(e,t){var n=hx(),r=vzt(),s=t&&!t.nodeType&&t,a=s&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===s,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u}(jj,jj.exports)),jj.exports}var SG,sve;function Ule(){if(sve)return SG;sve=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var a=typeof r;return s=s??e,!!s&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return SG=n,SG}var NG,ive;function zle(){if(ive)return NG;ive=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return NG=t,NG}var AG,ave;function wzt(){if(ave)return AG;ave=1;var e=_1(),t=zle(),n=k1(),r="[object Arguments]",s="[object Array]",a="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",x="[object RegExp]",g="[object Set]",v="[object String]",w="[object WeakMap]",C="[object ArrayBuffer]",N="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",R="[object Int8Array]",F="[object Int16Array]",U="[object Int32Array]",L="[object Uint8Array]",z="[object Uint8ClampedArray]",Q="[object Uint16Array]",ne="[object Uint32Array]",J={};J[I]=J[P]=J[R]=J[F]=J[U]=J[L]=J[z]=J[Q]=J[ne]=!0,J[r]=J[s]=J[C]=J[a]=J[N]=J[o]=J[l]=J[c]=J[u]=J[d]=J[f]=J[x]=J[g]=J[v]=J[w]=!1;function X(re){return n(re)&&t(re.length)&&!!J[e(re)]}return AG=X,AG}var jG,ove;function LDe(){if(ove)return jG;ove=1;function e(t){return function(n){return t(n)}}return jG=e,jG}var Ej={exports:{}};Ej.exports;var lve;function Czt(){return lve||(lve=1,function(e,t){var n=nDe(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===r,o=a&&n.process,l=function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l}(Ej,Ej.exports)),Ej.exports}var EG,cve;function DDe(){if(cve)return EG;cve=1;var e=wzt(),t=LDe(),n=Czt(),r=n&&n.isTypedArray,s=r?t(r):e;return EG=s,EG}var _G,uve;function Szt(){if(uve)return _G;uve=1;var e=bzt(),t=$le(),n=df(),r=RDe(),s=Ule(),a=DDe(),o=Object.prototype,l=o.hasOwnProperty;function c(u,d){var f=n(u),x=!f&&t(u),g=!f&&!x&&r(u),v=!f&&!x&&!g&&a(u),w=f||x||g||v,C=w?e(u.length,String):[],N=C.length;for(var I in u)(d||l.call(u,I))&&!(w&&(I=="length"||g&&(I=="offset"||I=="parent")||v&&(I=="buffer"||I=="byteLength"||I=="byteOffset")||s(I,N)))&&C.push(I);return C}return _G=c,_G}var kG,dve;function Nzt(){if(dve)return kG;dve=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return kG=t,kG}var TG,fve;function BDe(){if(fve)return TG;fve=1;function e(t,n){return function(r){return t(n(r))}}return TG=e,TG}var IG,hve;function Azt(){if(hve)return IG;hve=1;var e=BDe(),t=e(Object.keys,Object);return IG=t,IG}var PG,pve;function jzt(){if(pve)return PG;pve=1;var e=Nzt(),t=Azt(),n=Object.prototype,r=n.hasOwnProperty;function s(a){if(!e(a))return t(a);var o=[];for(var l in Object(a))r.call(a,l)&&l!="constructor"&&o.push(l);return o}return PG=s,PG}var FG,mve;function lT(){if(mve)return FG;mve=1;var e=Ele(),t=zle();function n(r){return r!=null&&t(r.length)&&!e(r)}return FG=n,FG}var OG,xve;function $$(){if(xve)return OG;xve=1;var e=Szt(),t=jzt(),n=lT();function r(s){return n(s)?e(s):t(s)}return OG=r,OG}var MG,gve;function Ezt(){if(gve)return MG;gve=1;var e=pzt(),t=gzt(),n=$$();function r(s){return e(s,n,t)}return MG=r,MG}var RG,bve;function _zt(){if(bve)return RG;bve=1;var e=Ezt(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(a,o,l,c,u,d){var f=l&t,x=e(a),g=x.length,v=e(o),w=v.length;if(g!=w&&!f)return!1;for(var C=g;C--;){var N=x[C];if(!(f?N in o:r.call(o,N)))return!1}var I=d.get(a),P=d.get(o);if(I&&P)return I==o&&P==a;var R=!0;d.set(a,o),d.set(o,a);for(var F=f;++C<g;){N=x[C];var U=a[N],L=o[N];if(c)var z=f?c(L,U,N,o,a,d):c(U,L,N,a,o,d);if(!(z===void 0?U===L||u(U,L,l,c,d):z)){R=!1;break}F||(F=N=="constructor")}if(R&&!F){var Q=a.constructor,ne=o.constructor;Q!=ne&&"constructor"in a&&"constructor"in o&&!(typeof Q=="function"&&Q instanceof Q&&typeof ne=="function"&&ne instanceof ne)&&(R=!1)}return d.delete(a),d.delete(o),R}return RG=s,RG}var LG,yve;function kzt(){if(yve)return LG;yve=1;var e=w5(),t=hx(),n=e(t,"DataView");return LG=n,LG}var DG,vve;function Tzt(){if(vve)return DG;vve=1;var e=w5(),t=hx(),n=e(t,"Promise");return DG=n,DG}var BG,wve;function $De(){if(wve)return BG;wve=1;var e=w5(),t=hx(),n=e(t,"Set");return BG=n,BG}var $G,Cve;function Izt(){if(Cve)return $G;Cve=1;var e=w5(),t=hx(),n=e(t,"WeakMap");return $G=n,$G}var UG,Sve;function Pzt(){if(Sve)return UG;Sve=1;var e=kzt(),t=kle(),n=Tzt(),r=$De(),s=Izt(),a=_1(),o=rDe(),l="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",x="[object DataView]",g=o(e),v=o(t),w=o(n),C=o(r),N=o(s),I=a;return(e&&I(new e(new ArrayBuffer(1)))!=x||t&&I(new t)!=l||n&&I(n.resolve())!=u||r&&I(new r)!=d||s&&I(new s)!=f)&&(I=function(P){var R=a(P),F=R==c?P.constructor:void 0,U=F?o(F):"";if(U)switch(U){case g:return x;case v:return l;case w:return u;case C:return d;case N:return f}return R}),UG=I,UG}var zG,Nve;function Fzt(){if(Nve)return zG;Nve=1;var e=TDe(),t=ODe(),n=hzt(),r=_zt(),s=Pzt(),a=df(),o=RDe(),l=DDe(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",x=Object.prototype,g=x.hasOwnProperty;function v(w,C,N,I,P,R){var F=a(w),U=a(C),L=F?d:s(w),z=U?d:s(C);L=L==u?f:L,z=z==u?f:z;var Q=L==f,ne=z==f,J=L==z;if(J&&o(w)){if(!o(C))return!1;F=!0,Q=!1}if(J&&!Q)return R||(R=new e),F||l(w)?t(w,C,N,I,P,R):n(w,C,L,N,I,P,R);if(!(N&c)){var X=Q&&g.call(w,"__wrapped__"),re=ne&&g.call(C,"__wrapped__");if(X||re){var pe=X?w.value():w,Y=re?C.value():C;return R||(R=new e),P(pe,Y,N,I,R)}}return J?(R||(R=new e),r(w,C,N,I,P,R)):!1}return zG=v,zG}var HG,Ave;function Hle(){if(Ave)return HG;Ave=1;var e=Fzt(),t=k1();function n(r,s,a,o,l){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,a,o,n,l)}return HG=n,HG}var VG,jve;function Ozt(){if(jve)return VG;jve=1;var e=TDe(),t=Hle(),n=1,r=2;function s(a,o,l,c){var u=l.length,d=u,f=!c;if(a==null)return!d;for(a=Object(a);u--;){var x=l[u];if(f&&x[2]?x[1]!==a[x[0]]:!(x[0]in a))return!1}for(;++u<d;){x=l[u];var g=x[0],v=a[g],w=x[1];if(f&&x[2]){if(v===void 0&&!(g in a))return!1}else{var C=new e;if(c)var N=c(v,w,g,a,o,C);if(!(N===void 0?t(w,v,n|r,c,C):N))return!1}}return!0}return VG=s,VG}var WG,Eve;function UDe(){if(Eve)return WG;Eve=1;var e=p2();function t(n){return n===n&&!e(n)}return WG=t,WG}var qG,_ve;function Mzt(){if(_ve)return qG;_ve=1;var e=UDe(),t=$$();function n(r){for(var s=t(r),a=s.length;a--;){var o=s[a],l=r[o];s[a]=[o,l,e(l)]}return s}return qG=n,qG}var GG,kve;function zDe(){if(kve)return GG;kve=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return GG=e,GG}var KG,Tve;function Rzt(){if(Tve)return KG;Tve=1;var e=Ozt(),t=Mzt(),n=zDe();function r(s){var a=t(s);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(o){return o===s||e(o,s,a)}}return KG=r,KG}var YG,Ive;function Lzt(){if(Ive)return YG;Ive=1;function e(t,n){return t!=null&&n in Object(t)}return YG=e,YG}var XG,Pve;function Dzt(){if(Pve)return XG;Pve=1;var e=aDe(),t=$le(),n=df(),r=Ule(),s=zle(),a=O$();function o(l,c,u){c=e(c,l);for(var d=-1,f=c.length,x=!1;++d<f;){var g=a(c[d]);if(!(x=l!=null&&u(l,g)))break;l=l[g]}return x||++d!=f?x:(f=l==null?0:l.length,!!f&&s(f)&&r(g,f)&&(n(l)||t(l)))}return XG=o,XG}var QG,Fve;function Bzt(){if(Fve)return QG;Fve=1;var e=Lzt(),t=Dzt();function n(r,s){return r!=null&&t(r,s,e)}return QG=n,QG}var ZG,Ove;function $zt(){if(Ove)return ZG;Ove=1;var e=Hle(),t=oDe(),n=Bzt(),r=jle(),s=UDe(),a=zDe(),o=O$(),l=1,c=2;function u(d,f){return r(d)&&s(f)?a(o(d),f):function(x){var g=t(x,d);return g===void 0&&g===f?n(x,d):e(f,g,l|c)}}return ZG=u,ZG}var JG,Mve;function YA(){if(Mve)return JG;Mve=1;function e(t){return t}return JG=e,JG}var eK,Rve;function Uzt(){if(Rve)return eK;Rve=1;function e(t){return function(n){return n==null?void 0:n[t]}}return eK=e,eK}var tK,Lve;function zzt(){if(Lve)return tK;Lve=1;var e=Ple();function t(n){return function(r){return e(r,n)}}return tK=t,tK}var nK,Dve;function Hzt(){if(Dve)return nK;Dve=1;var e=Uzt(),t=zzt(),n=jle(),r=O$();function s(a){return n(a)?e(r(a)):t(a)}return nK=s,nK}var rK,Bve;function m2(){if(Bve)return rK;Bve=1;var e=Rzt(),t=$zt(),n=YA(),r=df(),s=Hzt();function a(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):s(o)}return rK=a,rK}var sK,$ve;function HDe(){if($ve)return sK;$ve=1;function e(t,n,r,s){for(var a=t.length,o=r+(s?1:-1);s?o--:++o<a;)if(n(t[o],o,t))return o;return-1}return sK=e,sK}var iK,Uve;function Vzt(){if(Uve)return iK;Uve=1;function e(t){return t!==t}return iK=e,iK}var aK,zve;function Wzt(){if(zve)return aK;zve=1;function e(t,n,r){for(var s=r-1,a=t.length;++s<a;)if(t[s]===n)return s;return-1}return aK=e,aK}var oK,Hve;function qzt(){if(Hve)return oK;Hve=1;var e=HDe(),t=Vzt(),n=Wzt();function r(s,a,o){return a===a?n(s,a,o):e(s,t,o)}return oK=r,oK}var lK,Vve;function Gzt(){if(Vve)return lK;Vve=1;var e=qzt();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return lK=t,lK}var cK,Wve;function Kzt(){if(Wve)return cK;Wve=1;function e(t,n,r){for(var s=-1,a=t==null?0:t.length;++s<a;)if(r(n,t[s]))return!0;return!1}return cK=e,cK}var uK,qve;function Yzt(){if(qve)return uK;qve=1;function e(){}return uK=e,uK}var dK,Gve;function Xzt(){if(Gve)return dK;Gve=1;var e=$De(),t=Yzt(),n=Ble(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(a){return new e(a)}:t;return dK=s,dK}var fK,Kve;function Qzt(){if(Kve)return fK;Kve=1;var e=IDe(),t=Gzt(),n=Kzt(),r=FDe(),s=Xzt(),a=Ble(),o=200;function l(c,u,d){var f=-1,x=t,g=c.length,v=!0,w=[],C=w;if(d)v=!1,x=n;else if(g>=o){var N=u?null:s(c);if(N)return a(N);v=!1,x=r,C=new e}else C=u?[]:w;e:for(;++f<g;){var I=c[f],P=u?u(I):I;if(I=d||I!==0?I:0,v&&P===P){for(var R=C.length;R--;)if(C[R]===P)continue e;u&&C.push(P),w.push(I)}else x(C,P,d)||(C!==w&&C.push(P),w.push(I))}return w}return fK=l,fK}var hK,Yve;function Zzt(){if(Yve)return hK;Yve=1;var e=m2(),t=Qzt();function n(r,s){return r&&r.length?t(r,e(s,2)):[]}return hK=n,hK}var Jzt=Zzt();const Xve=ki(Jzt);function VDe(e,t,n){return t===!0?Xve(e,n):Ni(t)?Xve(e,t):e}function CN(e){"@babel/helpers - typeof";return CN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},CN(e)}var eHt=["ref"];function Qve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Kx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qve(Object(n),!0).forEach(function(r){U$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qve(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zve(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qDe(r.key),r)}}function nHt(e,t,n){return Zve(e.prototype,t),Zve(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rHt(e,t,n){return t=QR(t),sHt(e,WDe()?Reflect.construct(t,n,QR(e).constructor):t.apply(e,n))}function sHt(e,t){if(t&&(CN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iHt(e)}function iHt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WDe=function(){return!!e})()}function QR(e){return QR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},QR(e)}function aHt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&>e(e,t)}function gte(e,t){return gte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},gte(e,t)}function U$(e,t,n){return t=qDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qDe(e){var t=oHt(e,"string");return CN(t)=="symbol"?t:t+""}function oHt(e,t){if(CN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(CN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lHt(e,t){if(e==null)return{};var n=cHt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cHt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function uHt(e){return e.value}function dHt(e,t){if(Ne.isValidElement(e))return Ne.cloneElement(e,t);if(typeof e=="function")return Ne.createElement(e,t);t.ref;var n=lHt(t,eHt);return Ne.createElement(Dle,n)}var Jve=1,s3=function(e){function t(){var n;tHt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=rHt(this,t,[].concat(s)),U$(n,"lastBoundingBox",{width:-1,height:-1}),n}return aHt(t,e),nHt(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>Jve||Math.abs(s.height-this.lastBoundingBox.height)>Jve)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(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?Kx({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,a=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,u=s.chartWidth,d=s.chartHeight,f,x;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var g=this.getBBoxSnapshot();f={left:((u||0)-g.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var v=this.getBBoxSnapshot();x={top:((d||0)-v.height)/2}}else x=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Kx(Kx({},f),x)}},{key:"render",value:function(){var r=this,s=this.props,a=s.content,o=s.width,l=s.height,c=s.wrapperStyle,u=s.payloadUniqBy,d=s.payload,f=Kx(Kx({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return Ne.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(g){r.wrapperNode=g}},dHt(a,Kx(Kx({},this.props),{},{payload:VDe(d,u,uHt)})))}}],[{key:"getWithHeight",value:function(r,s){var a=Kx(Kx({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&es(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])}(m.PureComponent);U$(s3,"displayName","Legend");U$(s3,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var pK,ewe;function fHt(){if(ewe)return pK;ewe=1;var e=oT(),t=$le(),n=df(),r=e?e.isConcatSpreadable:void 0;function s(a){return n(a)||t(a)||!!(r&&a&&a[r])}return pK=s,pK}var mK,twe;function GDe(){if(twe)return mK;twe=1;var e=MDe(),t=fHt();function n(r,s,a,o,l){var c=-1,u=r.length;for(a||(a=t),l||(l=[]);++c<u;){var d=r[c];s>0&&a(d)?s>1?n(d,s-1,a,o,l):e(l,d):o||(l[l.length]=d)}return l}return mK=n,mK}var xK,nwe;function hHt(){if(nwe)return xK;nwe=1;function e(t){return function(n,r,s){for(var a=-1,o=Object(n),l=s(n),c=l.length;c--;){var u=l[t?c:++a];if(r(o[u],u,o)===!1)break}return n}}return xK=e,xK}var gK,rwe;function pHt(){if(rwe)return gK;rwe=1;var e=hHt(),t=e();return gK=t,gK}var bK,swe;function KDe(){if(swe)return bK;swe=1;var e=pHt(),t=$$();function n(r,s){return r&&e(r,s,t)}return bK=n,bK}var yK,iwe;function mHt(){if(iwe)return yK;iwe=1;var e=lT();function t(n,r){return function(s,a){if(s==null)return s;if(!e(s))return n(s,a);for(var o=s.length,l=r?o:-1,c=Object(s);(r?l--:++l<o)&&a(c[l],l,c)!==!1;);return s}}return yK=t,yK}var vK,awe;function Vle(){if(awe)return vK;awe=1;var e=KDe(),t=mHt(),n=t(e);return vK=n,vK}var wK,owe;function YDe(){if(owe)return wK;owe=1;var e=Vle(),t=lT();function n(r,s){var a=-1,o=t(r)?Array(r.length):[];return e(r,function(l,c,u){o[++a]=s(l,c,u)}),o}return wK=n,wK}var CK,lwe;function xHt(){if(lwe)return CK;lwe=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return CK=e,CK}var SK,cwe;function gHt(){if(cwe)return SK;cwe=1;var e=qA();function t(n,r){if(n!==r){var s=n!==void 0,a=n===null,o=n===n,l=e(n),c=r!==void 0,u=r===null,d=r===r,f=e(r);if(!u&&!f&&!l&&n>r||l&&c&&d&&!u&&!f||a&&c&&d||!s&&d||!o)return 1;if(!a&&!l&&!f&&n<r||f&&s&&o&&!a&&!l||u&&s&&o||!c&&o||!d)return-1}return 0}return SK=t,SK}var NK,uwe;function bHt(){if(uwe)return NK;uwe=1;var e=gHt();function t(n,r,s){for(var a=-1,o=n.criteria,l=r.criteria,c=o.length,u=s.length;++a<c;){var d=e(o[a],l[a]);if(d){if(a>=u)return d;var f=s[a];return d*(f=="desc"?-1:1)}}return n.index-r.index}return NK=t,NK}var AK,dwe;function yHt(){if(dwe)return AK;dwe=1;var e=Ile(),t=Ple(),n=m2(),r=YDe(),s=xHt(),a=LDe(),o=bHt(),l=YA(),c=df();function u(d,f,x){f.length?f=e(f,function(w){return c(w)?function(C){return t(C,w.length===1?w[0]:w)}:w}):f=[l];var g=-1;f=e(f,a(n));var v=r(d,function(w,C,N){var I=e(f,function(P){return P(w)});return{criteria:I,index:++g,value:w}});return s(v,function(w,C){return o(w,C,x)})}return AK=u,AK}var jK,fwe;function vHt(){if(fwe)return jK;fwe=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return jK=e,jK}var EK,hwe;function wHt(){if(hwe)return EK;hwe=1;var e=vHt(),t=Math.max;function n(r,s,a){return s=t(s===void 0?r.length-1:s,0),function(){for(var o=arguments,l=-1,c=t(o.length-s,0),u=Array(c);++l<c;)u[l]=o[s+l];l=-1;for(var d=Array(s+1);++l<s;)d[l]=o[l];return d[s]=a(u),e(r,this,d)}}return EK=n,EK}var _K,pwe;function CHt(){if(pwe)return _K;pwe=1;function e(t){return function(){return t}}return _K=e,_K}var kK,mwe;function XDe(){if(mwe)return kK;mwe=1;var e=w5(),t=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}}();return kK=t,kK}var TK,xwe;function SHt(){if(xwe)return TK;xwe=1;var e=CHt(),t=XDe(),n=YA(),r=t?function(s,a){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return TK=r,TK}var IK,gwe;function NHt(){if(gwe)return IK;gwe=1;var e=800,t=16,n=Date.now;function r(s){var a=0,o=0;return function(){var l=n(),c=t-(l-o);if(o=l,c>0){if(++a>=e)return arguments[0]}else a=0;return s.apply(void 0,arguments)}}return IK=r,IK}var PK,bwe;function AHt(){if(bwe)return PK;bwe=1;var e=SHt(),t=NHt(),n=t(e);return PK=n,PK}var FK,ywe;function jHt(){if(ywe)return FK;ywe=1;var e=YA(),t=wHt(),n=AHt();function r(s,a){return n(t(s,a,e),s+"")}return FK=r,FK}var OK,vwe;function z$(){if(vwe)return OK;vwe=1;var e=_le(),t=lT(),n=Ule(),r=p2();function s(a,o,l){if(!r(l))return!1;var c=typeof o;return(c=="number"?t(l)&&n(o,l.length):c=="string"&&o in l)?e(l[o],a):!1}return OK=s,OK}var MK,wwe;function EHt(){if(wwe)return MK;wwe=1;var e=GDe(),t=yHt(),n=jHt(),r=z$(),s=n(function(a,o){if(a==null)return[];var l=o.length;return l>1&&r(a,o[0],o[1])?o=[]:l>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return MK=s,MK}var _Ht=EHt();const Wle=ki(_Ht);function i_(e){"@babel/helpers - typeof";return i_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i_(e)}function bte(){return bte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bte.apply(this,arguments)}function kHt(e,t){return FHt(e)||PHt(e,t)||IHt(e,t)||THt()}function THt(){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 IHt(e,t){if(e){if(typeof e=="string")return Cwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cwe(e,t)}}function Cwe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PHt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function FHt(e){if(Array.isArray(e))return e}function Swe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function RK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Swe(Object(n),!0).forEach(function(r){OHt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Swe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OHt(e,t,n){return t=MHt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MHt(e){var t=RHt(e,"string");return i_(t)=="symbol"?t:t+""}function RHt(e,t){if(i_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(i_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LHt(e){return Array.isArray(e)&&rc(e[0])&&rc(e[1])?e.join(" ~ "):e}var DHt=function(t){var n=t.separator,r=n===void 0?" : ":n,s=t.contentStyle,a=s===void 0?{}:s,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,x=t.itemSorter,g=t.wrapperClassName,v=t.labelClassName,w=t.label,C=t.labelFormatter,N=t.accessibilityLayer,I=N===void 0?!1:N,P=function(){if(d&&d.length){var X={padding:0,margin:0},re=(x?Wle(d,x):d).map(function(pe,Y){if(pe.type==="none")return null;var ie=RK({display:"block",paddingTop:4,paddingBottom:4,color:pe.color||"#000"},l),oe=pe.formatter||f||LHt,G=pe.value,V=pe.name,te=G,ae=V;if(te!=null&&ae!=null){var he=oe(G,V,pe,Y,d);if(Array.isArray(he)){var Ce=kHt(he,2);te=Ce[0],ae=Ce[1]}else te=he}return Ne.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Y),style:ie},rc(ae)?Ne.createElement("span",{className:"recharts-tooltip-item-name"},ae):null,rc(ae)?Ne.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,Ne.createElement("span",{className:"recharts-tooltip-item-value"},te),Ne.createElement("span",{className:"recharts-tooltip-item-unit"},pe.unit||""))});return Ne.createElement("ul",{className:"recharts-tooltip-item-list",style:X},re)}return null},R=RK({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),F=RK({margin:0},u),U=!yi(w),L=U?w:"",z=sa("recharts-default-tooltip",g),Q=sa("recharts-tooltip-label",v);U&&C&&d!==void 0&&d!==null&&(L=C(w,d));var ne=I?{role:"status","aria-live":"assertive"}:{};return Ne.createElement("div",bte({className:z,style:R},ne),Ne.createElement("p",{className:Q,style:F},Ne.isValidElement(L)?L:"".concat(L)),P())};function a_(e){"@babel/helpers - typeof";return a_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a_(e)}function NP(e,t,n){return t=BHt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BHt(e){var t=$Ht(e,"string");return a_(t)=="symbol"?t:t+""}function $Ht(e,t){if(a_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(a_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var F7="recharts-tooltip-wrapper",UHt={visibility:"hidden"};function zHt(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return sa(F7,NP(NP(NP(NP({},"".concat(F7,"-right"),es(n)&&t&&es(t.x)&&n>=t.x),"".concat(F7,"-left"),es(n)&&t&&es(t.x)&&n<t.x),"".concat(F7,"-bottom"),es(r)&&t&&es(t.y)&&r>=t.y),"".concat(F7,"-top"),es(r)&&t&&es(t.y)&&r<t.y))}function Nwe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,s=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&es(a[r]))return a[r];var d=n[r]-l-s,f=n[r]+s;if(t[r])return o[r]?d:f;if(o[r]){var x=d,g=c[r];return x<g?Math.max(f,c[r]):Math.max(d,c[r])}var v=f+l,w=c[r]+u;return v>w?Math.max(d,c[r]):Math.max(f,c[r])}function HHt(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function VHt(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=Nwe({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=Nwe({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=HHt({translateX:d,translateY:f,useTranslate3d:l})):u=UHt,{cssProperties:u,cssClasses:zHt({translateX:d,translateY:f,coordinate:n})}}function SN(e){"@babel/helpers - typeof";return SN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},SN(e)}function Awe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jwe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Awe(Object(n),!0).forEach(function(r){vte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Awe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qHt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ZDe(r.key),r)}}function GHt(e,t,n){return qHt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function KHt(e,t,n){return t=ZR(t),YHt(e,QDe()?Reflect.construct(t,n,ZR(e).constructor):t.apply(e,n))}function YHt(e,t){if(t&&(SN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XHt(e)}function XHt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QDe=function(){return!!e})()}function ZR(e){return ZR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ZR(e)}function QHt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yte(e,t)}function yte(e,t){return yte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},yte(e,t)}function vte(e,t,n){return t=ZDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZDe(e){var t=ZHt(e,"string");return SN(t)=="symbol"?t:t+""}function ZHt(e,t){if(SN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(SN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ewe=1,JHt=function(e){function t(){var n;WHt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=KHt(this,t,[].concat(s)),vte(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),vte(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return QHt(t,e),GHt(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>Ewe||Math.abs(r.height-this.state.lastBoundingBox.height)>Ewe)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,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,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.children,d=s.coordinate,f=s.hasPayload,x=s.isAnimationActive,g=s.offset,v=s.position,w=s.reverseDirection,C=s.useTranslate3d,N=s.viewBox,I=s.wrapperStyle,P=VHt({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:g,position:v,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:C,viewBox:N}),R=P.cssClasses,F=P.cssProperties,U=jwe(jwe({transition:x&&a?"transform ".concat(l,"ms ").concat(c):void 0},F),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},I);return Ne.createElement("div",{tabIndex:-1,className:R,style:U,ref:function(z){r.wrapperNode=z}},u)}}])}(m.PureComponent),eVt=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},hm={isSsr:eVt(),get:function(t){return hm[t]},set:function(t,n){if(typeof t=="string")hm[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(s){hm[s]=t[s]})}}};function NN(e){"@babel/helpers - typeof";return NN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},NN(e)}function _we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function kwe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_we(Object(n),!0).forEach(function(r){qle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_we(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tVt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nVt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eBe(r.key),r)}}function rVt(e,t,n){return nVt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function sVt(e,t,n){return t=JR(t),iVt(e,JDe()?Reflect.construct(t,n||[],JR(e).constructor):t.apply(e,n))}function iVt(e,t){if(t&&(NN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aVt(e)}function aVt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JDe=function(){return!!e})()}function JR(e){return JR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},JR(e)}function oVt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wte(e,t)}function wte(e,t){return wte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},wte(e,t)}function qle(e,t,n){return t=eBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eBe(e){var t=lVt(e,"string");return NN(t)=="symbol"?t:t+""}function lVt(e,t){if(NN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(NN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cVt(e){return e.dataKey}function uVt(e,t){return Ne.isValidElement(e)?Ne.cloneElement(e,t):typeof e=="function"?Ne.createElement(e,t):Ne.createElement(DHt,t)}var Yp=function(e){function t(){return tVt(this,t),sVt(this,t,arguments)}return oVt(t,e),rVt(t,[{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.content,d=s.coordinate,f=s.filterNull,x=s.isAnimationActive,g=s.offset,v=s.payload,w=s.payloadUniqBy,C=s.position,N=s.reverseDirection,I=s.useTranslate3d,P=s.viewBox,R=s.wrapperStyle,F=v??[];f&&F.length&&(F=VDe(v.filter(function(L){return L.value!=null&&(L.hide!==!0||r.props.includeHidden)}),w,cVt));var U=F.length>0;return Ne.createElement(JHt,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:x,active:a,coordinate:d,hasPayload:U,offset:g,position:C,reverseDirection:N,useTranslate3d:I,viewBox:P,wrapperStyle:R},uVt(u,kwe(kwe({},this.props),{},{payload:F})))}}])}(m.PureComponent);qle(Yp,"displayName","Tooltip");qle(Yp,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!hm.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 LK,Twe;function dVt(){if(Twe)return LK;Twe=1;var e=hx(),t=function(){return e.Date.now()};return LK=t,LK}var DK,Iwe;function fVt(){if(Iwe)return DK;Iwe=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return DK=t,DK}var BK,Pwe;function hVt(){if(Pwe)return BK;Pwe=1;var e=fVt(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return BK=n,BK}var $K,Fwe;function tBe(){if(Fwe)return $K;Fwe=1;var e=hVt(),t=p2(),n=qA(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(n(u))return r;if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=a.test(u);return f||o.test(u)?l(u.slice(2),f?2:8):s.test(u)?r:+u}return $K=c,$K}var UK,Owe;function nBe(){if(Owe)return UK;Owe=1;var e=p2(),t=dVt(),n=tBe(),r="Expected a function",s=Math.max,a=Math.min;function o(l,c,u){var d,f,x,g,v,w,C=0,N=!1,I=!1,P=!0;if(typeof l!="function")throw new TypeError(r);c=n(c)||0,e(u)&&(N=!!u.leading,I="maxWait"in u,x=I?s(n(u.maxWait)||0,c):x,P="trailing"in u?!!u.trailing:P);function R(re){var pe=d,Y=f;return d=f=void 0,C=re,g=l.apply(Y,pe),g}function F(re){return C=re,v=setTimeout(z,c),N?R(re):g}function U(re){var pe=re-w,Y=re-C,ie=c-pe;return I?a(ie,x-Y):ie}function L(re){var pe=re-w,Y=re-C;return w===void 0||pe>=c||pe<0||I&&Y>=x}function z(){var re=t();if(L(re))return Q(re);v=setTimeout(z,U(re))}function Q(re){return v=void 0,P&&d?R(re):(d=f=void 0,g)}function ne(){v!==void 0&&clearTimeout(v),C=0,d=w=f=v=void 0}function J(){return v===void 0?g:Q(t())}function X(){var re=t(),pe=L(re);if(d=arguments,f=this,w=re,pe){if(v===void 0)return F(w);if(I)return clearTimeout(v),v=setTimeout(z,c),R(w)}return v===void 0&&(v=setTimeout(z,c)),g}return X.cancel=ne,X.flush=J,X}return UK=o,UK}var zK,Mwe;function pVt(){if(Mwe)return zK;Mwe=1;var e=nBe(),t=p2(),n="Expected a function";function r(s,a,o){var l=!0,c=!0;if(typeof s!="function")throw new TypeError(n);return t(o)&&(l="leading"in o?!!o.leading:l,c="trailing"in o?!!o.trailing:c),e(s,a,{leading:l,maxWait:a,trailing:c})}return zK=r,zK}var mVt=pVt();const rBe=ki(mVt);function o_(e){"@babel/helpers - typeof";return o_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o_(e)}function Rwe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function AP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rwe(Object(n),!0).forEach(function(r){xVt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rwe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xVt(e,t,n){return t=gVt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gVt(e){var t=bVt(e,"string");return o_(t)=="symbol"?t:t+""}function bVt(e,t){if(o_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(o_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yVt(e,t){return SVt(e)||CVt(e,t)||wVt(e,t)||vVt()}function vVt(){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 wVt(e,t){if(e){if(typeof e=="string")return Lwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lwe(e,t)}}function Lwe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function CVt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function SVt(e){if(Array.isArray(e))return e}var sBe=m.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,s=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,x=e.maxHeight,g=e.children,v=e.debounce,w=v===void 0?0:v,C=e.id,N=e.className,I=e.onResize,P=e.style,R=P===void 0?{}:P,F=m.useRef(null),U=m.useRef();U.current=I,m.useImperativeHandle(t,function(){return Object.defineProperty(F.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),F.current},configurable:!0})});var L=m.useState({containerWidth:s.width,containerHeight:s.height}),z=yVt(L,2),Q=z[0],ne=z[1],J=m.useCallback(function(re,pe){ne(function(Y){var ie=Math.round(re),oe=Math.round(pe);return Y.containerWidth===ie&&Y.containerHeight===oe?Y:{containerWidth:ie,containerHeight:oe}})},[]);m.useEffect(function(){var re=function(V){var te,ae=V[0].contentRect,he=ae.width,Ce=ae.height;J(he,Ce),(te=U.current)===null||te===void 0||te.call(U,he,Ce)};w>0&&(re=rBe(re,w,{trailing:!0,leading:!1}));var pe=new ResizeObserver(re),Y=F.current.getBoundingClientRect(),ie=Y.width,oe=Y.height;return J(ie,oe),pe.observe(F.current),function(){pe.disconnect()}},[J,w]);var X=m.useMemo(function(){var re=Q.containerWidth,pe=Q.containerHeight;if(re<0||pe<0)return null;Xg(nw(o)||nw(c),`The width(%s) and height(%s) are both fixed numbers,
maybe you don't need to use a ResponsiveContainer.`,o,c),Xg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var Y=nw(o)?re:o,ie=nw(c)?pe:c;n&&n>0&&(Y?ie=Y/n:ie&&(Y=ie*n),x&&ie>x&&(ie=x)),Xg(Y>0||ie>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.`,Y,ie,o,c,d,f,n);var oe=!Array.isArray(g)&&Yg(g.type).endsWith("Chart");return Ne.Children.map(g,function(G){return Ne.isValidElement(G)?m.cloneElement(G,AP({width:Y,height:ie},oe?{style:AP({height:"100%",width:"100%",maxHeight:ie,maxWidth:Y},G.props.style)}:{})):G})},[n,g,c,x,f,d,Q,o]);return Ne.createElement("div",{id:C?"".concat(C):void 0,className:sa("recharts-responsive-container",N),style:AP(AP({},R),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:x}),ref:F},X)}),Gle=function(t){return null};Gle.displayName="Cell";function l_(e){"@babel/helpers - typeof";return l_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l_(e)}function Dwe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Cte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dwe(Object(n),!0).forEach(function(r){NVt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dwe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NVt(e,t,n){return t=AVt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AVt(e){var t=jVt(e,"string");return l_(t)=="symbol"?t:t+""}function jVt(e,t){if(l_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(l_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J6={widthCache:{},cacheCount:0},EVt=2e3,_Vt={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Bwe="recharts_measurement_span";function kVt(e){var t=Cte({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var r9=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||hm.isSsr)return{width:0,height:0};var r=kVt(n),s=JSON.stringify({text:t,copyStyle:r});if(J6.widthCache[s])return J6.widthCache[s];try{var a=document.getElementById(Bwe);a||(a=document.createElement("span"),a.setAttribute("id",Bwe),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Cte(Cte({},_Vt),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return J6.widthCache[s]=c,++J6.cacheCount>EVt&&(J6.cacheCount=0,J6.widthCache={}),c}catch{return{width:0,height:0}}},TVt=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function c_(e){"@babel/helpers - typeof";return c_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c_(e)}function eL(e,t){return OVt(e)||FVt(e,t)||PVt(e,t)||IVt()}function IVt(){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 PVt(e,t){if(e){if(typeof e=="string")return $we(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $we(e,t)}}function $we(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FVt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function OVt(e){if(Array.isArray(e))return e}function MVt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LVt(r.key),r)}}function RVt(e,t,n){return Uwe(e.prototype,t),Uwe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LVt(e){var t=DVt(e,"string");return c_(t)=="symbol"?t:t+""}function DVt(e,t){if(c_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(c_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zwe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Hwe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,BVt=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,$Vt=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,iBe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},UVt=Object.keys(iBe),DC="NaN";function zVt(e,t){return e*iBe[t]}var jP=function(){function e(t,n){MVt(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!BVt.test(n)&&(this.num=NaN,this.unit=""),UVt.includes(n)&&(this.num=zVt(t,n),this.unit="px")}return RVt(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,s=(r=$Vt.exec(n))!==null&&r!==void 0?r:[],a=eL(s,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function aBe(e){if(e.includes(DC))return DC;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=zwe.exec(t))!==null&&n!==void 0?n:[],s=eL(r,4),a=s[1],o=s[2],l=s[3],c=jP.parse(a??""),u=jP.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return DC;t=t.replace(zwe,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,x=(f=Hwe.exec(t))!==null&&f!==void 0?f:[],g=eL(x,4),v=g[1],w=g[2],C=g[3],N=jP.parse(v??""),I=jP.parse(C??""),P=w==="+"?N.add(I):N.subtract(I);if(P.isNaN())return DC;t=t.replace(Hwe,P.toString())}return t}var Vwe=/\(([^()]*)\)/;function HVt(e){for(var t=e;t.includes("(");){var n=Vwe.exec(t),r=eL(n,2),s=r[1];t=t.replace(Vwe,aBe(s))}return t}function VVt(e){var t=e.replace(/\s+/g,"");return t=HVt(t),t=aBe(t),t}function WVt(e){try{return VVt(e)}catch{return DC}}function HK(e){var t=WVt(e.slice(5,-1));return t===DC?"":t}var qVt=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],GVt=["dx","dy","angle","className","breakAll"];function Ste(){return Ste=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ste.apply(this,arguments)}function Wwe(e,t){if(e==null)return{};var n=KVt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KVt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qwe(e,t){return ZVt(e)||QVt(e,t)||XVt(e,t)||YVt()}function YVt(){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 XVt(e,t){if(e){if(typeof e=="string")return Gwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gwe(e,t)}}function Gwe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function QVt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function ZVt(e){if(Array.isArray(e))return e}var oBe=/[ \f\n\r\t\v\u2028\u2029]+/,lBe=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var a=[];yi(n)||(r?a=n.toString().split(""):a=n.toString().split(oBe));var o=a.map(function(c){return{word:c,width:r9(c,s).width}}),l=r?0:r9(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},JVt=function(t,n,r,s,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=es(o),f=l,x=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Y.reduce(function(ie,oe){var G=oe.word,V=oe.width,te=ie[ie.length-1];if(te&&(s==null||a||te.width+V+r<Number(s)))te.words.push(G),te.width+=V+r;else{var ae={words:[G],width:V};ie.push(ae)}return ie},[])},g=x(n),v=function(Y){return Y.reduce(function(ie,oe){return ie.width>oe.width?ie:oe})};if(!d)return g;for(var w="…",C=function(Y){var ie=f.slice(0,Y),oe=lBe({breakAll:u,style:c,children:ie+w}).wordsWithComputedWidth,G=x(oe),V=G.length>o||v(G).width>Number(s);return[V,G]},N=0,I=f.length-1,P=0,R;N<=I&&P<=f.length-1;){var F=Math.floor((N+I)/2),U=F-1,L=C(U),z=qwe(L,2),Q=z[0],ne=z[1],J=C(F),X=qwe(J,1),re=X[0];if(!Q&&!re&&(N=F+1),Q&&re&&(I=F-1),!Q&&re){R=ne;break}P++}return R||g},Kwe=function(t){var n=yi(t)?[]:t.toString().split(oBe);return[{words:n}]},eWt=function(t){var n=t.width,r=t.scaleToFit,s=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!hm.isSsr){var c,u,d=lBe({breakAll:o,children:s,style:a});if(d){var f=d.wordsWithComputedWidth,x=d.spaceWidth;c=f,u=x}else return Kwe(s);return JVt({breakAll:o,children:s,maxLines:l,style:a},c,u,n,r)}return Kwe(s)},Ywe="#808080",tL=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,x=t.textAnchor,g=x===void 0?"start":x,v=t.verticalAnchor,w=v===void 0?"end":v,C=t.fill,N=C===void 0?Ywe:C,I=Wwe(t,qVt),P=m.useMemo(function(){return eWt({breakAll:I.breakAll,children:I.children,maxLines:I.maxLines,scaleToFit:f,style:I.style,width:I.width})},[I.breakAll,I.children,I.maxLines,f,I.style,I.width]),R=I.dx,F=I.dy,U=I.angle,L=I.className,z=I.breakAll,Q=Wwe(I,GVt);if(!rc(r)||!rc(a))return null;var ne=r+(es(R)?R:0),J=a+(es(F)?F:0),X;switch(w){case"start":X=HK("calc(".concat(u,")"));break;case"middle":X=HK("calc(".concat((P.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:X=HK("calc(".concat(P.length-1," * -").concat(l,")"));break}var re=[];if(f){var pe=P[0].width,Y=I.width;re.push("scale(".concat((es(Y)?Y/pe:1)/pe,")"))}return U&&re.push("rotate(".concat(U,", ").concat(ne,", ").concat(J,")")),re.length&&(Q.transform=re.join(" ")),Ne.createElement("text",Ste({},bi(Q,!0),{x:ne,y:J,className:sa("recharts-text",L),textAnchor:g,fill:N.includes("url")?Ywe:N}),P.map(function(ie,oe){var G=ie.words.join(z?"":" ");return Ne.createElement("tspan",{x:ne,dy:oe===0?X:l,key:"".concat(G,"-").concat(oe)},G)}))};function ky(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function tWt(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Kle(e){let t,n,r;e.length!==2?(t=ky,n=(l,c)=>ky(e(l),c),r=(l,c)=>e(l)-c):(t=e===ky||e===tWt?e:nWt,n=e,r=e);function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=s(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:s,center:o,right:a}}function nWt(){return 0}function cBe(e){return e===null?NaN:+e}function*rWt(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const sWt=Kle(ky),cT=sWt.right;Kle(cBe).center;class Xwe extends Map{constructor(t,n=oWt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(Qwe(this,t))}has(t){return super.has(Qwe(this,t))}set(t,n){return super.set(iWt(this,t),n)}delete(t){return super.delete(aWt(this,t))}}function Qwe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function iWt({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function aWt({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function oWt(e){return e!==null&&typeof e=="object"?e.valueOf():e}function lWt(e=ky){if(e===ky)return uBe;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function uBe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const cWt=Math.sqrt(50),uWt=Math.sqrt(10),dWt=Math.sqrt(2);function nL(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),a=r/Math.pow(10,s),o=a>=cWt?10:a>=uWt?5:a>=dWt?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,s)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?nL(e,t,n*2):[l,c,u]}function Nte(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[s,a,o]=r?nL(t,e,n):nL(e,t,n);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(a-u)/-o;else for(let u=0;u<l;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(s+u)/-o;else for(let u=0;u<l;++u)c[u]=(s+u)*o;return c}function Ate(e,t,n){return t=+t,e=+e,n=+n,nL(e,t,n)[2]}function jte(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?Ate(t,e,n):Ate(e,t,n);return(r?-1:1)*(s<0?1/-s:s)}function Zwe(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Jwe(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function dBe(e,t,n=0,r=1/0,s){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(s=s===void 0?uBe:lWt(s);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),x=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*f/c+x)),v=Math.min(r,Math.floor(t+(c-u)*f/c+x));dBe(e,t,g,v,s)}const a=e[t];let o=n,l=r;for(O7(e,n,t),s(e[r],a)>0&&O7(e,n,r);o<l;){for(O7(e,o,l),++o,--l;s(e[o],a)<0;)++o;for(;s(e[l],a)>0;)--l}s(e[n],a)===0?O7(e,n,l):(++l,O7(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function O7(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function fWt(e,t,n){if(e=Float64Array.from(rWt(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Jwe(e);if(t>=1)return Zwe(e);var r,s=(r-1)*t,a=Math.floor(s),o=Zwe(dBe(e,a).subarray(0,a+1)),l=Jwe(e.subarray(a+1));return o+(l-o)*(s-a)}}function hWt(e,t,n=cBe){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,a=Math.floor(s),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(s-a)}}function pWt(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(s);++r<s;)a[r]=e+r*n;return a}function pp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function T1(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Ete=Symbol("implicit");function Yle(){var e=new Xwe,t=[],n=[],r=Ete;function s(a){let o=e.get(a);if(o===void 0){if(r!==Ete)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return s.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new Xwe;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(a){return arguments.length?(n=Array.from(a),s):n.slice()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return Yle(t,n).unknown(r)},pp.apply(s,arguments),s}function u_(){var e=Yle().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,a,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var x=t().length,g=s<r,v=g?s:r,w=g?r:s;a=(w-v)/Math.max(1,x-c+u*2),l&&(a=Math.floor(a)),v+=(w-v-a*(x-c))*d,o=a*(1-c),l&&(v=Math.round(v),o=Math.round(o));var C=pWt(x).map(function(N){return v+a*N});return n(g?C.reverse():C)}return e.domain=function(x){return arguments.length?(t(x),f()):t()},e.range=function(x){return arguments.length?([r,s]=x,r=+r,s=+s,f()):[r,s]},e.rangeRound=function(x){return[r,s]=x,r=+r,s=+s,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(x){return arguments.length?(l=!!x,f()):l},e.padding=function(x){return arguments.length?(c=Math.min(1,u=+x),f()):c},e.paddingInner=function(x){return arguments.length?(c=Math.min(1,x),f()):c},e.paddingOuter=function(x){return arguments.length?(u=+x,f()):u},e.align=function(x){return arguments.length?(d=Math.max(0,Math.min(1,x)),f()):d},e.copy=function(){return u_(t(),[r,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},pp.apply(f(),arguments)}function fBe(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return fBe(t())},e}function s9(){return fBe(u_.apply(null,arguments).paddingInner(1))}function Xle(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hBe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function uT(){}var d_=.7,rL=1/d_,h4="\\s*([+-]?\\d+)\\s*",f_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",U0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mWt=/^#([0-9a-f]{3,8})$/,xWt=new RegExp(`^rgb\\(${h4},${h4},${h4}\\)$`),gWt=new RegExp(`^rgb\\(${U0},${U0},${U0}\\)$`),bWt=new RegExp(`^rgba\\(${h4},${h4},${h4},${f_}\\)$`),yWt=new RegExp(`^rgba\\(${U0},${U0},${U0},${f_}\\)$`),vWt=new RegExp(`^hsl\\(${f_},${U0},${U0}\\)$`),wWt=new RegExp(`^hsla\\(${f_},${U0},${U0},${f_}\\)$`),e3e={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xle(uT,h_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:t3e,formatHex:t3e,formatHex8:CWt,formatHsl:SWt,formatRgb:n3e,toString:n3e});function t3e(){return this.rgb().formatHex()}function CWt(){return this.rgb().formatHex8()}function SWt(){return pBe(this).formatHsl()}function n3e(){return this.rgb().formatRgb()}function h_(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=mWt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?r3e(t):n===3?new Zd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?EP(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?EP(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=xWt.exec(e))?new Zd(t[1],t[2],t[3],1):(t=gWt.exec(e))?new Zd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bWt.exec(e))?EP(t[1],t[2],t[3],t[4]):(t=yWt.exec(e))?EP(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vWt.exec(e))?a3e(t[1],t[2]/100,t[3]/100,1):(t=wWt.exec(e))?a3e(t[1],t[2]/100,t[3]/100,t[4]):e3e.hasOwnProperty(e)?r3e(e3e[e]):e==="transparent"?new Zd(NaN,NaN,NaN,0):null}function r3e(e){return new Zd(e>>16&255,e>>8&255,e&255,1)}function EP(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zd(e,t,n,r)}function NWt(e){return e instanceof uT||(e=h_(e)),e?(e=e.rgb(),new Zd(e.r,e.g,e.b,e.opacity)):new Zd}function _te(e,t,n,r){return arguments.length===1?NWt(e):new Zd(e,t,n,r??1)}function Zd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xle(Zd,_te,hBe(uT,{brighter(e){return e=e==null?rL:Math.pow(rL,e),new Zd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?d_:Math.pow(d_,e),new Zd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zd(i3(this.r),i3(this.g),i3(this.b),sL(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:s3e,formatHex:s3e,formatHex8:AWt,formatRgb:i3e,toString:i3e}));function s3e(){return`#${rw(this.r)}${rw(this.g)}${rw(this.b)}`}function AWt(){return`#${rw(this.r)}${rw(this.g)}${rw(this.b)}${rw((isNaN(this.opacity)?1:this.opacity)*255)}`}function i3e(){const e=sL(this.opacity);return`${e===1?"rgb(":"rgba("}${i3(this.r)}, ${i3(this.g)}, ${i3(this.b)}${e===1?")":`, ${e})`}`}function sL(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function i3(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rw(e){return e=i3(e),(e<16?"0":"")+e.toString(16)}function a3e(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new rm(e,t,n,r)}function pBe(e){if(e instanceof rm)return new rm(e.h,e.s,e.l,e.opacity);if(e instanceof uT||(e=h_(e)),!e)return new rm;if(e instanceof rm)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-s,c=(a+s)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+s:2-a-s,o*=60):l=c>0&&c<1?0:o,new rm(o,l,c,e.opacity)}function jWt(e,t,n,r){return arguments.length===1?pBe(e):new rm(e,t,n,r??1)}function rm(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xle(rm,jWt,hBe(uT,{brighter(e){return e=e==null?rL:Math.pow(rL,e),new rm(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?d_:Math.pow(d_,e),new rm(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Zd(VK(e>=240?e-240:e+120,s,r),VK(e,s,r),VK(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new rm(o3e(this.h),_P(this.s),_P(this.l),sL(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 e=sL(this.opacity);return`${e===1?"hsl(":"hsla("}${o3e(this.h)}, ${_P(this.s)*100}%, ${_P(this.l)*100}%${e===1?")":`, ${e})`}`}}));function o3e(e){return e=(e||0)%360,e<0?e+360:e}function _P(e){return Math.max(0,Math.min(1,e||0))}function VK(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Qle=e=>()=>e;function EWt(e,t){return function(n){return e+n*t}}function _Wt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function kWt(e){return(e=+e)==1?mBe:function(t,n){return n-t?_Wt(t,n,e):Qle(isNaN(t)?n:t)}}function mBe(e,t){var n=t-e;return n?EWt(e,n):Qle(isNaN(e)?t:e)}const l3e=function e(t){var n=kWt(t);function r(s,a){var o=n((s=_te(s)).r,(a=_te(a)).r),l=n(s.g,a.g),c=n(s.b,a.b),u=mBe(s.opacity,a.opacity);return function(d){return s.r=o(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function TWt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(a){for(s=0;s<n;++s)r[s]=e[s]*(1-a)+t[s]*a;return r}}function IWt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function PWt(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)s[o]=XA(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=s[o](l);return a}}function FWt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function iL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function OWt(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=XA(e[s],t[s]):r[s]=t[s];return function(a){for(s in n)r[s]=n[s](a);return r}}var kte=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,WK=new RegExp(kte.source,"g");function MWt(e){return function(){return e}}function RWt(e){return function(t){return e(t)+""}}function LWt(e,t){var n=kte.lastIndex=WK.lastIndex=0,r,s,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=kte.exec(e))&&(s=WK.exec(t));)(a=s.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:iL(r,s)})),n=WK.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?RWt(c[0].x):MWt(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function XA(e,t){var n=typeof t,r;return t==null||n==="boolean"?Qle(t):(n==="number"?iL:n==="string"?(r=h_(t))?(t=r,l3e):LWt:t instanceof h_?l3e:t instanceof Date?FWt:IWt(t)?TWt:Array.isArray(t)?PWt:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?OWt:iL)(e,t)}function Zle(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function DWt(e,t){t===void 0&&(t=e,e=XA);for(var n=0,r=t.length-1,s=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(s,s=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function BWt(e){return function(){return e}}function aL(e){return+e}var c3e=[0,1];function ld(e){return e}function Tte(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:BWt(isNaN(t)?NaN:.5)}function $Wt(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function UWt(e,t,n){var r=e[0],s=e[1],a=t[0],o=t[1];return s<r?(r=Tte(s,r),a=n(o,a)):(r=Tte(r,s),a=n(a,o)),function(l){return a(r(l))}}function zWt(e,t,n){var r=Math.min(e.length,t.length)-1,s=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)s[o]=Tte(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=cT(e,l,1,r)-1;return a[c](s[c](l))}}function dT(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function H$(){var e=c3e,t=c3e,n=XA,r,s,a,o=ld,l,c,u;function d(){var x=Math.min(e.length,t.length);return o!==ld&&(o=$Wt(e[0],e[x-1])),l=x>2?zWt:UWt,c=u=null,f}function f(x){return x==null||isNaN(x=+x)?a:(c||(c=l(e.map(r),t,n)))(r(o(x)))}return f.invert=function(x){return o(s((u||(u=l(t,e.map(r),iL)))(x)))},f.domain=function(x){return arguments.length?(e=Array.from(x,aL),d()):e.slice()},f.range=function(x){return arguments.length?(t=Array.from(x),d()):t.slice()},f.rangeRound=function(x){return t=Array.from(x),n=Zle,d()},f.clamp=function(x){return arguments.length?(o=x?!0:ld,d()):o!==ld},f.interpolate=function(x){return arguments.length?(n=x,d()):n},f.unknown=function(x){return arguments.length?(a=x,f):a},function(x,g){return r=x,s=g,d()}}function Jle(){return H$()(ld,ld)}function HWt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function oL(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function AN(e){return e=oL(Math.abs(e)),e?e[1]:NaN}function VWt(e,t){return function(n,r){for(var s=n.length,a=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(s-=l,s+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function WWt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var qWt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function p_(e){if(!(t=qWt.exec(e)))throw new Error("invalid format: "+e);var t;return new ece({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}p_.prototype=ece.prototype;function ece(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ece.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 GWt(e){e:for(var t=e.length,n=1,r=-1,s;n<t;++n)switch(e[n]){case".":r=s=n;break;case"0":r===0&&(r=n),s=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var xBe;function KWt(e,t){var n=oL(e,t);if(!n)return e+"";var r=n[0],s=n[1],a=s-(xBe=Math.max(-8,Math.min(8,Math.floor(s/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")+oL(e,Math.max(0,t+a-1))[0]}function u3e(e,t){var n=oL(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const d3e={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:HWt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>u3e(e*100,t),r:u3e,s:KWt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function f3e(e){return e}var h3e=Array.prototype.map,p3e=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function YWt(e){var t=e.grouping===void 0||e.thousands===void 0?f3e:VWt(h3e.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?f3e:WWt(h3e.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=p_(f);var x=f.fill,g=f.align,v=f.sign,w=f.symbol,C=f.zero,N=f.width,I=f.comma,P=f.precision,R=f.trim,F=f.type;F==="n"?(I=!0,F="g"):d3e[F]||(P===void 0&&(P=12),R=!0,F="g"),(C||x==="0"&&g==="=")&&(C=!0,x="0",g="=");var U=w==="$"?n:w==="#"&&/[boxX]/.test(F)?"0"+F.toLowerCase():"",L=w==="$"?r:/[%p]/.test(F)?o:"",z=d3e[F],Q=/[defgprs%]/.test(F);P=P===void 0?6:/[gprs]/.test(F)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function ne(J){var X=U,re=L,pe,Y,ie;if(F==="c")re=z(J)+re,J="";else{J=+J;var oe=J<0||1/J<0;if(J=isNaN(J)?c:z(Math.abs(J),P),R&&(J=GWt(J)),oe&&+J==0&&v!=="+"&&(oe=!1),X=(oe?v==="("?v:l:v==="-"||v==="("?"":v)+X,re=(F==="s"?p3e[8+xBe/3]:"")+re+(oe&&v==="("?")":""),Q){for(pe=-1,Y=J.length;++pe<Y;)if(ie=J.charCodeAt(pe),48>ie||ie>57){re=(ie===46?s+J.slice(pe+1):J.slice(pe))+re,J=J.slice(0,pe);break}}}I&&!C&&(J=t(J,1/0));var G=X.length+J.length+re.length,V=G<N?new Array(N-G+1).join(x):"";switch(I&&C&&(J=t(V+J,V.length?N-re.length:1/0),V=""),g){case"<":J=X+J+re+V;break;case"=":J=X+V+J+re;break;case"^":J=V.slice(0,G=V.length>>1)+X+J+re+V.slice(G);break;default:J=V+X+J+re;break}return a(J)}return ne.toString=function(){return f+""},ne}function d(f,x){var g=u((f=p_(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(AN(x)/3)))*3,w=Math.pow(10,-v),C=p3e[8+v/3];return function(N){return g(w*N)+C}}return{format:u,formatPrefix:d}}var kP,tce,gBe;XWt({thousands:",",grouping:[3],currency:["$",""]});function XWt(e){return kP=YWt(e),tce=kP.format,gBe=kP.formatPrefix,kP}function QWt(e){return Math.max(0,-AN(Math.abs(e)))}function ZWt(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(AN(t)/3)))*3-AN(Math.abs(e)))}function JWt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,AN(t)-AN(e))+1}function bBe(e,t,n,r){var s=jte(e,t,n),a;switch(r=p_(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=ZWt(s,o))&&(r.precision=a),gBe(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=JWt(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=QWt(s))&&(r.precision=a-(r.type==="%")*2);break}}return tce(r)}function x2(e){var t=e.domain;return e.ticks=function(n){var r=t();return Nte(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return bBe(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,a=r.length-1,o=r[s],l=r[a],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=s,s=a,a=u);d-- >0;){if(u=Ate(o,l,n),u===c)return r[s]=o,r[a]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function lL(){var e=Jle();return e.copy=function(){return dT(e,lL())},pp.apply(e,arguments),x2(e)}function yBe(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,aL),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return yBe(e).unknown(t)},e=arguments.length?Array.from(e,aL):[0,1],x2(n)}function vBe(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],a=e[r],o;return a<s&&(o=n,n=r,r=o,o=s,s=a,a=o),e[n]=t.floor(s),e[r]=t.ceil(a),e}function m3e(e){return Math.log(e)}function x3e(e){return Math.exp(e)}function eqt(e){return-Math.log(-e)}function tqt(e){return-Math.exp(-e)}function nqt(e){return isFinite(e)?+("1e"+e):e<0?0:e}function rqt(e){return e===10?nqt:e===Math.E?Math.exp:t=>Math.pow(e,t)}function sqt(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function g3e(e){return(t,n)=>-e(-t,n)}function nce(e){const t=e(m3e,x3e),n=t.domain;let r=10,s,a;function o(){return s=sqt(r),a=rqt(r),n()[0]<0?(s=g3e(s),a=g3e(a),e(eqt,tqt)):e(m3e,x3e),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let x=s(u),g=s(d),v,w;const C=l==null?10:+l;let N=[];if(!(r%1)&&g-x<C){if(x=Math.floor(x),g=Math.ceil(g),u>0){for(;x<=g;++x)for(v=1;v<r;++v)if(w=x<0?v/a(-x):v*a(x),!(w<u)){if(w>d)break;N.push(w)}}else for(;x<=g;++x)for(v=r-1;v>=1;--v)if(w=x>0?v/a(-x):v*a(x),!(w<u)){if(w>d)break;N.push(w)}N.length*2<C&&(N=Nte(u,d,C))}else N=Nte(x,g,Math.min(g-x,C)).map(a);return f?N.reverse():N},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=p_(c)).precision==null&&(c.trim=!0),c=tce(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(s(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(vBe(n(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function wBe(){const e=nce(H$()).domain([1,10]);return e.copy=()=>dT(e,wBe()).base(e.base()),pp.apply(e,arguments),e}function b3e(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function y3e(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function rce(e){var t=1,n=e(b3e(t),y3e(t));return n.constant=function(r){return arguments.length?e(b3e(t=+r),y3e(t)):t},x2(n)}function CBe(){var e=rce(H$());return e.copy=function(){return dT(e,CBe()).constant(e.constant())},pp.apply(e,arguments)}function v3e(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iqt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function aqt(e){return e<0?-e*e:e*e}function sce(e){var t=e(ld,ld),n=1;function r(){return n===1?e(ld,ld):n===.5?e(iqt,aqt):e(v3e(n),v3e(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},x2(t)}function ice(){var e=sce(H$());return e.copy=function(){return dT(e,ice()).exponent(e.exponent())},pp.apply(e,arguments),e}function oqt(){return ice.apply(null,arguments).exponent(.5)}function w3e(e){return Math.sign(e)*e*e}function lqt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function SBe(){var e=Jle(),t=[0,1],n=!1,r;function s(a){var o=lqt(e(a));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(a){return e.invert(w3e(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,aL)).map(w3e)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(n=!!a,s):n},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return SBe(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},pp.apply(s,arguments),x2(s)}function NBe(){var e=[],t=[],n=[],r;function s(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=hWt(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[cT(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(ky),s()},a.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return NBe().domain(e).range(t).unknown(r)},pp.apply(a,arguments)}function ABe(){var e=0,t=1,n=1,r=[.5],s=[0,1],a;function o(c){return c!=null&&c<=c?s[cT(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var u=s.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return ABe().domain([e,t]).range(s).unknown(a)},pp.apply(x2(o),arguments)}function jBe(){var e=[.5],t=[0,1],n,r=1;function s(a){return a!=null&&a<=a?t[cT(e,a,0,r)]:n}return s.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return jBe().domain(e).range(t).unknown(n)},pp.apply(s,arguments)}const qK=new Date,GK=new Date;function cc(e,t,n,r){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const o=s(a),l=s.ceil(a);return a-o<l-a?o:l},s.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),s.range=(a,o,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},s.filter=a=>cc(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(s.count=(a,o)=>(qK.setTime(+a),GK.setTime(+o),e(qK),e(GK),Math.floor(n(qK,GK))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(r?o=>r(o)%a===0:o=>s.count(0,o)%a===0):s)),s}const cL=cc(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);cL.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?cc(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):cL);cL.range;const Lg=1e3,Zh=Lg*60,Dg=Zh*60,m1=Dg*24,ace=m1*7,C3e=m1*30,KK=m1*365,sw=cc(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Lg)},(e,t)=>(t-e)/Lg,e=>e.getUTCSeconds());sw.range;const oce=cc(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lg)},(e,t)=>{e.setTime(+e+t*Zh)},(e,t)=>(t-e)/Zh,e=>e.getMinutes());oce.range;const lce=cc(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Zh)},(e,t)=>(t-e)/Zh,e=>e.getUTCMinutes());lce.range;const cce=cc(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lg-e.getMinutes()*Zh)},(e,t)=>{e.setTime(+e+t*Dg)},(e,t)=>(t-e)/Dg,e=>e.getHours());cce.range;const uce=cc(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dg)},(e,t)=>(t-e)/Dg,e=>e.getUTCHours());uce.range;const fT=cc(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zh)/m1,e=>e.getDate()-1);fT.range;const V$=cc(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/m1,e=>e.getUTCDate()-1);V$.range;const EBe=cc(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/m1,e=>Math.floor(e/m1));EBe.range;function S5(e){return cc(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Zh)/ace)}const W$=S5(0),uL=S5(1),cqt=S5(2),uqt=S5(3),jN=S5(4),dqt=S5(5),fqt=S5(6);W$.range;uL.range;cqt.range;uqt.range;jN.range;dqt.range;fqt.range;function N5(e){return cc(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/ace)}const q$=N5(0),dL=N5(1),hqt=N5(2),pqt=N5(3),EN=N5(4),mqt=N5(5),xqt=N5(6);q$.range;dL.range;hqt.range;pqt.range;EN.range;mqt.range;xqt.range;const dce=cc(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());dce.range;const fce=cc(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());fce.range;const x1=cc(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());x1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:cc(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});x1.range;const g1=cc(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());g1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:cc(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});g1.range;function _Be(e,t,n,r,s,a){const o=[[sw,1,Lg],[sw,5,5*Lg],[sw,15,15*Lg],[sw,30,30*Lg],[a,1,Zh],[a,5,5*Zh],[a,15,15*Zh],[a,30,30*Zh],[s,1,Dg],[s,3,3*Dg],[s,6,6*Dg],[s,12,12*Dg],[r,1,m1],[r,2,2*m1],[n,1,ace],[t,1,C3e],[t,3,3*C3e],[e,1,KK]];function l(u,d,f){const x=d<u;x&&([u,d]=[d,u]);const g=f&&typeof f.range=="function"?f:c(u,d,f),v=g?g.range(u,+d+1):[];return x?v.reverse():v}function c(u,d,f){const x=Math.abs(d-u)/f,g=Kle(([,,C])=>C).right(o,x);if(g===o.length)return e.every(jte(u/KK,d/KK,f));if(g===0)return cL.every(Math.max(jte(u,d,f),1));const[v,w]=o[x/o[g-1][2]<o[g][2]/x?g-1:g];return v.every(w)}return[l,c]}const[gqt,bqt]=_Be(g1,fce,q$,EBe,uce,lce),[yqt,vqt]=_Be(x1,dce,W$,fT,cce,oce);function YK(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function XK(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function M7(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function wqt(e){var t=e.dateTime,n=e.date,r=e.time,s=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=R7(s),d=L7(s),f=R7(a),x=L7(a),g=R7(o),v=L7(o),w=R7(l),C=L7(l),N=R7(c),I=L7(c),P={a:oe,A:G,b:V,B:te,c:null,d:_3e,e:_3e,f:Vqt,g:eGt,G:nGt,H:Uqt,I:zqt,j:Hqt,L:kBe,m:Wqt,M:qqt,p:ae,q:he,Q:I3e,s:P3e,S:Gqt,u:Kqt,U:Yqt,V:Xqt,w:Qqt,W:Zqt,x:null,X:null,y:Jqt,Y:tGt,Z:rGt,"%":T3e},R={a:Ce,A:ce,b:ge,B:Ae,c:null,d:k3e,e:k3e,f:oGt,g:gGt,G:yGt,H:sGt,I:iGt,j:aGt,L:IBe,m:lGt,M:cGt,p:ye,q:je,Q:I3e,s:P3e,S:uGt,u:dGt,U:fGt,V:hGt,w:pGt,W:mGt,x:null,X:null,y:xGt,Y:bGt,Z:vGt,"%":T3e},F={a:ne,A:J,b:X,B:re,c:pe,d:j3e,e:j3e,f:Lqt,g:A3e,G:N3e,H:E3e,I:E3e,j:Fqt,L:Rqt,m:Pqt,M:Oqt,p:Q,q:Iqt,Q:Bqt,s:$qt,S:Mqt,u:jqt,U:Eqt,V:_qt,w:Aqt,W:kqt,x:Y,X:ie,y:A3e,Y:N3e,Z:Tqt,"%":Dqt};P.x=U(n,P),P.X=U(r,P),P.c=U(t,P),R.x=U(n,R),R.X=U(r,R),R.c=U(t,R);function U(Ie,Re){return function(Qe){var $e=[],it=-1,tt=0,ot=Ie.length,ft,ct,Vt;for(Qe instanceof Date||(Qe=new Date(+Qe));++it<ot;)Ie.charCodeAt(it)===37&&($e.push(Ie.slice(tt,it)),(ct=S3e[ft=Ie.charAt(++it)])!=null?ft=Ie.charAt(++it):ct=ft==="e"?" ":"0",(Vt=Re[ft])&&(ft=Vt(Qe,ct)),$e.push(ft),tt=it+1);return $e.push(Ie.slice(tt,it)),$e.join("")}}function L(Ie,Re){return function(Qe){var $e=M7(1900,void 0,1),it=z($e,Ie,Qe+="",0),tt,ot;if(it!=Qe.length)return null;if("Q"in $e)return new Date($e.Q);if("s"in $e)return new Date($e.s*1e3+("L"in $e?$e.L:0));if(Re&&!("Z"in $e)&&($e.Z=0),"p"in $e&&($e.H=$e.H%12+$e.p*12),$e.m===void 0&&($e.m="q"in $e?$e.q:0),"V"in $e){if($e.V<1||$e.V>53)return null;"w"in $e||($e.w=1),"Z"in $e?(tt=XK(M7($e.y,0,1)),ot=tt.getUTCDay(),tt=ot>4||ot===0?dL.ceil(tt):dL(tt),tt=V$.offset(tt,($e.V-1)*7),$e.y=tt.getUTCFullYear(),$e.m=tt.getUTCMonth(),$e.d=tt.getUTCDate()+($e.w+6)%7):(tt=YK(M7($e.y,0,1)),ot=tt.getDay(),tt=ot>4||ot===0?uL.ceil(tt):uL(tt),tt=fT.offset(tt,($e.V-1)*7),$e.y=tt.getFullYear(),$e.m=tt.getMonth(),$e.d=tt.getDate()+($e.w+6)%7)}else("W"in $e||"U"in $e)&&("w"in $e||($e.w="u"in $e?$e.u%7:"W"in $e?1:0),ot="Z"in $e?XK(M7($e.y,0,1)).getUTCDay():YK(M7($e.y,0,1)).getDay(),$e.m=0,$e.d="W"in $e?($e.w+6)%7+$e.W*7-(ot+5)%7:$e.w+$e.U*7-(ot+6)%7);return"Z"in $e?($e.H+=$e.Z/100|0,$e.M+=$e.Z%100,XK($e)):YK($e)}}function z(Ie,Re,Qe,$e){for(var it=0,tt=Re.length,ot=Qe.length,ft,ct;it<tt;){if($e>=ot)return-1;if(ft=Re.charCodeAt(it++),ft===37){if(ft=Re.charAt(it++),ct=F[ft in S3e?Re.charAt(it++):ft],!ct||($e=ct(Ie,Qe,$e))<0)return-1}else if(ft!=Qe.charCodeAt($e++))return-1}return $e}function Q(Ie,Re,Qe){var $e=u.exec(Re.slice(Qe));return $e?(Ie.p=d.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function ne(Ie,Re,Qe){var $e=g.exec(Re.slice(Qe));return $e?(Ie.w=v.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function J(Ie,Re,Qe){var $e=f.exec(Re.slice(Qe));return $e?(Ie.w=x.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function X(Ie,Re,Qe){var $e=N.exec(Re.slice(Qe));return $e?(Ie.m=I.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function re(Ie,Re,Qe){var $e=w.exec(Re.slice(Qe));return $e?(Ie.m=C.get($e[0].toLowerCase()),Qe+$e[0].length):-1}function pe(Ie,Re,Qe){return z(Ie,t,Re,Qe)}function Y(Ie,Re,Qe){return z(Ie,n,Re,Qe)}function ie(Ie,Re,Qe){return z(Ie,r,Re,Qe)}function oe(Ie){return o[Ie.getDay()]}function G(Ie){return a[Ie.getDay()]}function V(Ie){return c[Ie.getMonth()]}function te(Ie){return l[Ie.getMonth()]}function ae(Ie){return s[+(Ie.getHours()>=12)]}function he(Ie){return 1+~~(Ie.getMonth()/3)}function Ce(Ie){return o[Ie.getUTCDay()]}function ce(Ie){return a[Ie.getUTCDay()]}function ge(Ie){return c[Ie.getUTCMonth()]}function Ae(Ie){return l[Ie.getUTCMonth()]}function ye(Ie){return s[+(Ie.getUTCHours()>=12)]}function je(Ie){return 1+~~(Ie.getUTCMonth()/3)}return{format:function(Ie){var Re=U(Ie+="",P);return Re.toString=function(){return Ie},Re},parse:function(Ie){var Re=L(Ie+="",!1);return Re.toString=function(){return Ie},Re},utcFormat:function(Ie){var Re=U(Ie+="",R);return Re.toString=function(){return Ie},Re},utcParse:function(Ie){var Re=L(Ie+="",!0);return Re.toString=function(){return Ie},Re}}}var S3e={"-":"",_:" ",0:"0"},Rc=/^\s*\d+/,Cqt=/^%/,Sqt=/[\\^$*+?|[\]().{}]/g;function ma(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",a=s.length;return r+(a<n?new Array(n-a+1).join(t)+s:s)}function Nqt(e){return e.replace(Sqt,"\\$&")}function R7(e){return new RegExp("^(?:"+e.map(Nqt).join("|")+")","i")}function L7(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Aqt(e,t,n){var r=Rc.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function jqt(e,t,n){var r=Rc.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Eqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function _qt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function N3e(e,t,n){var r=Rc.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function A3e(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Tqt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Iqt(e,t,n){var r=Rc.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Pqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function j3e(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Fqt(e,t,n){var r=Rc.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function E3e(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Oqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Mqt(e,t,n){var r=Rc.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Rqt(e,t,n){var r=Rc.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Lqt(e,t,n){var r=Rc.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Dqt(e,t,n){var r=Cqt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Bqt(e,t,n){var r=Rc.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function $qt(e,t,n){var r=Rc.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function _3e(e,t){return ma(e.getDate(),t,2)}function Uqt(e,t){return ma(e.getHours(),t,2)}function zqt(e,t){return ma(e.getHours()%12||12,t,2)}function Hqt(e,t){return ma(1+fT.count(x1(e),e),t,3)}function kBe(e,t){return ma(e.getMilliseconds(),t,3)}function Vqt(e,t){return kBe(e,t)+"000"}function Wqt(e,t){return ma(e.getMonth()+1,t,2)}function qqt(e,t){return ma(e.getMinutes(),t,2)}function Gqt(e,t){return ma(e.getSeconds(),t,2)}function Kqt(e){var t=e.getDay();return t===0?7:t}function Yqt(e,t){return ma(W$.count(x1(e)-1,e),t,2)}function TBe(e){var t=e.getDay();return t>=4||t===0?jN(e):jN.ceil(e)}function Xqt(e,t){return e=TBe(e),ma(jN.count(x1(e),e)+(x1(e).getDay()===4),t,2)}function Qqt(e){return e.getDay()}function Zqt(e,t){return ma(uL.count(x1(e)-1,e),t,2)}function Jqt(e,t){return ma(e.getFullYear()%100,t,2)}function eGt(e,t){return e=TBe(e),ma(e.getFullYear()%100,t,2)}function tGt(e,t){return ma(e.getFullYear()%1e4,t,4)}function nGt(e,t){var n=e.getDay();return e=n>=4||n===0?jN(e):jN.ceil(e),ma(e.getFullYear()%1e4,t,4)}function rGt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ma(t/60|0,"0",2)+ma(t%60,"0",2)}function k3e(e,t){return ma(e.getUTCDate(),t,2)}function sGt(e,t){return ma(e.getUTCHours(),t,2)}function iGt(e,t){return ma(e.getUTCHours()%12||12,t,2)}function aGt(e,t){return ma(1+V$.count(g1(e),e),t,3)}function IBe(e,t){return ma(e.getUTCMilliseconds(),t,3)}function oGt(e,t){return IBe(e,t)+"000"}function lGt(e,t){return ma(e.getUTCMonth()+1,t,2)}function cGt(e,t){return ma(e.getUTCMinutes(),t,2)}function uGt(e,t){return ma(e.getUTCSeconds(),t,2)}function dGt(e){var t=e.getUTCDay();return t===0?7:t}function fGt(e,t){return ma(q$.count(g1(e)-1,e),t,2)}function PBe(e){var t=e.getUTCDay();return t>=4||t===0?EN(e):EN.ceil(e)}function hGt(e,t){return e=PBe(e),ma(EN.count(g1(e),e)+(g1(e).getUTCDay()===4),t,2)}function pGt(e){return e.getUTCDay()}function mGt(e,t){return ma(dL.count(g1(e)-1,e),t,2)}function xGt(e,t){return ma(e.getUTCFullYear()%100,t,2)}function gGt(e,t){return e=PBe(e),ma(e.getUTCFullYear()%100,t,2)}function bGt(e,t){return ma(e.getUTCFullYear()%1e4,t,4)}function yGt(e,t){var n=e.getUTCDay();return e=n>=4||n===0?EN(e):EN.ceil(e),ma(e.getUTCFullYear()%1e4,t,4)}function vGt(){return"+0000"}function T3e(){return"%"}function I3e(e){return+e}function P3e(e){return Math.floor(+e/1e3)}var eC,FBe,OBe;wGt({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 wGt(e){return eC=wqt(e),FBe=eC.format,eC.parse,OBe=eC.utcFormat,eC.utcParse,eC}function CGt(e){return new Date(e)}function SGt(e){return e instanceof Date?+e:+new Date(+e)}function hce(e,t,n,r,s,a,o,l,c,u){var d=Jle(),f=d.invert,x=d.domain,g=u(".%L"),v=u(":%S"),w=u("%I:%M"),C=u("%I %p"),N=u("%a %d"),I=u("%b %d"),P=u("%B"),R=u("%Y");function F(U){return(c(U)<U?g:l(U)<U?v:o(U)<U?w:a(U)<U?C:r(U)<U?s(U)<U?N:I:n(U)<U?P:R)(U)}return d.invert=function(U){return new Date(f(U))},d.domain=function(U){return arguments.length?x(Array.from(U,SGt)):x().map(CGt)},d.ticks=function(U){var L=x();return e(L[0],L[L.length-1],U??10)},d.tickFormat=function(U,L){return L==null?F:u(L)},d.nice=function(U){var L=x();return(!U||typeof U.range!="function")&&(U=t(L[0],L[L.length-1],U??10)),U?x(vBe(L,U)):d},d.copy=function(){return dT(d,hce(e,t,n,r,s,a,o,l,c,u))},d}function NGt(){return pp.apply(hce(yqt,vqt,x1,dce,W$,fT,cce,oce,sw,FBe).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function AGt(){return pp.apply(hce(gqt,bqt,g1,fce,q$,V$,uce,lce,sw,OBe).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function G$(){var e=0,t=1,n,r,s,a,o=ld,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(s===0?.5:(f=(a(f)-n)*s,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),s=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(x){var g,v;return arguments.length?([g,v]=x,o=f(g,v),u):[o(0),o(1)]}}return u.range=d(XA),u.rangeRound=d(Zle),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,n=f(e),r=f(t),s=n===r?0:1/(r-n),u}}function g2(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function MBe(){var e=x2(G$()(ld));return e.copy=function(){return g2(e,MBe())},T1.apply(e,arguments)}function RBe(){var e=nce(G$()).domain([1,10]);return e.copy=function(){return g2(e,RBe()).base(e.base())},T1.apply(e,arguments)}function LBe(){var e=rce(G$());return e.copy=function(){return g2(e,LBe()).constant(e.constant())},T1.apply(e,arguments)}function pce(){var e=sce(G$());return e.copy=function(){return g2(e,pce()).exponent(e.exponent())},T1.apply(e,arguments)}function jGt(){return pce.apply(null,arguments).exponent(.5)}function DBe(){var e=[],t=ld;function n(r){if(r!=null&&!isNaN(r=+r))return t((cT(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let s of r)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(ky),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,s)=>t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,a)=>fWt(e,a/r))},n.copy=function(){return DBe(t).domain(e)},T1.apply(n,arguments)}function K$(){var e=0,t=.5,n=1,r=1,s,a,o,l,c,u=ld,d,f=!1,x;function g(w){return isNaN(w=+w)?x:(w=.5+((w=+d(w))-a)*(r*w<r*a?l:c),u(f?Math.max(0,Math.min(1,w)):w))}g.domain=function(w){return arguments.length?([e,t,n]=w,s=d(e=+e),a=d(t=+t),o=d(n=+n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,g):[e,t,n]},g.clamp=function(w){return arguments.length?(f=!!w,g):f},g.interpolator=function(w){return arguments.length?(u=w,g):u};function v(w){return function(C){var N,I,P;return arguments.length?([N,I,P]=C,u=DWt(w,[N,I,P]),g):[u(0),u(.5),u(1)]}}return g.range=v(XA),g.rangeRound=v(Zle),g.unknown=function(w){return arguments.length?(x=w,g):x},function(w){return d=w,s=w(e),a=w(t),o=w(n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,g}}function BBe(){var e=x2(K$()(ld));return e.copy=function(){return g2(e,BBe())},T1.apply(e,arguments)}function $Be(){var e=nce(K$()).domain([.1,1,10]);return e.copy=function(){return g2(e,$Be()).base(e.base())},T1.apply(e,arguments)}function UBe(){var e=rce(K$());return e.copy=function(){return g2(e,UBe()).constant(e.constant())},T1.apply(e,arguments)}function mce(){var e=sce(K$());return e.copy=function(){return g2(e,mce()).exponent(e.exponent())},T1.apply(e,arguments)}function EGt(){return mce.apply(null,arguments).exponent(.5)}const F3e=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:u_,scaleDiverging:BBe,scaleDivergingLog:$Be,scaleDivergingPow:mce,scaleDivergingSqrt:EGt,scaleDivergingSymlog:UBe,scaleIdentity:yBe,scaleImplicit:Ete,scaleLinear:lL,scaleLog:wBe,scaleOrdinal:Yle,scalePoint:s9,scalePow:ice,scaleQuantile:NBe,scaleQuantize:ABe,scaleRadial:SBe,scaleSequential:MBe,scaleSequentialLog:RBe,scaleSequentialPow:pce,scaleSequentialQuantile:DBe,scaleSequentialSqrt:jGt,scaleSequentialSymlog:LBe,scaleSqrt:oqt,scaleSymlog:CBe,scaleThreshold:jBe,scaleTime:NGt,scaleUtc:AGt,tickFormat:bBe},Symbol.toStringTag,{value:"Module"}));var QK,O3e;function zBe(){if(O3e)return QK;O3e=1;var e=qA();function t(n,r,s){for(var a=-1,o=n.length;++a<o;){var l=n[a],c=r(l);if(c!=null&&(u===void 0?c===c&&!e(c):s(c,u)))var u=c,d=l}return d}return QK=t,QK}var ZK,M3e;function _Gt(){if(M3e)return ZK;M3e=1;function e(t,n){return t>n}return ZK=e,ZK}var JK,R3e;function kGt(){if(R3e)return JK;R3e=1;var e=zBe(),t=_Gt(),n=YA();function r(s){return s&&s.length?e(s,n,t):void 0}return JK=r,JK}var TGt=kGt();const gy=ki(TGt);var eY,L3e;function IGt(){if(L3e)return eY;L3e=1;function e(t,n){return t<n}return eY=e,eY}var tY,D3e;function PGt(){if(D3e)return tY;D3e=1;var e=zBe(),t=IGt(),n=YA();function r(s){return s&&s.length?e(s,n,t):void 0}return tY=r,tY}var FGt=PGt();const Y$=ki(FGt);var nY,B3e;function OGt(){if(B3e)return nY;B3e=1;var e=Ile(),t=m2(),n=YDe(),r=df();function s(a,o){var l=r(a)?e:n;return l(a,t(o,3))}return nY=s,nY}var rY,$3e;function MGt(){if($3e)return rY;$3e=1;var e=GDe(),t=OGt();function n(r,s){return e(t(r,s),1)}return rY=n,rY}var RGt=MGt();const LGt=ki(RGt);var sY,U3e;function DGt(){if(U3e)return sY;U3e=1;var e=Hle();function t(n,r){return e(n,r)}return sY=t,sY}var BGt=DGt();const G3=ki(BGt);var QA=1e9,$Gt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},gce,Po=!0,fp="[DecimalError] ",a3=fp+"Invalid argument: ",xce=fp+"Exponent out of range: ",ZA=Math.floor,kv=Math.pow,UGt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Df,Sc=1e7,yo=7,HBe=9007199254740991,fL=ZA(HBe/yo),Es={};Es.absoluteValue=Es.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Es.comparedTo=Es.cmp=function(e){var t,n,r,s,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,s=e.d.length,t=0,n=r<s?r:s;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===s?0:r>s^a.s<0?1:-1};Es.decimalPlaces=Es.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*yo;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Es.dividedBy=Es.div=function(e){return Qg(this,new this.constructor(e))};Es.dividedToIntegerBy=Es.idiv=function(e){var t=this,n=t.constructor;return Ya(Qg(t,new n(e),0,1),n.precision)};Es.equals=Es.eq=function(e){return!this.cmp(e)};Es.exponent=function(){return Vl(this)};Es.greaterThan=Es.gt=function(e){return this.cmp(e)>0};Es.greaterThanOrEqualTo=Es.gte=function(e){return this.cmp(e)>=0};Es.isInteger=Es.isint=function(){return this.e>this.d.length-2};Es.isNegative=Es.isneg=function(){return this.s<0};Es.isPositive=Es.ispos=function(){return this.s>0};Es.isZero=function(){return this.s===0};Es.lessThan=Es.lt=function(e){return this.cmp(e)<0};Es.lessThanOrEqualTo=Es.lte=function(e){return this.cmp(e)<1};Es.logarithm=Es.log=function(e){var t,n=this,r=n.constructor,s=r.precision,a=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Df))throw Error(fp+"NaN");if(n.s<1)throw Error(fp+(n.s?"NaN":"-Infinity"));return n.eq(Df)?new r(0):(Po=!1,t=Qg(m_(n,a),m_(e,a),a),Po=!0,Ya(t,s))};Es.minus=Es.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?qBe(t,e):VBe(t,(e.s=-e.s,e))};Es.modulo=Es.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(fp+"NaN");return n.s?(Po=!1,t=Qg(n,e,0,1).times(e),Po=!0,n.minus(t)):Ya(new r(n),s)};Es.naturalExponential=Es.exp=function(){return WBe(this)};Es.naturalLogarithm=Es.ln=function(){return m_(this)};Es.negated=Es.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Es.plus=Es.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?VBe(t,e):qBe(t,(e.s=-e.s,e))};Es.precision=Es.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(a3+e);if(t=Vl(s)+1,r=s.d.length-1,n=r*yo+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Es.squareRoot=Es.sqrt=function(){var e,t,n,r,s,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(fp+"NaN")}for(e=Vl(l),Po=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=k0(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=ZA((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(s.toString()),n=c.precision,s=o=n+3;;)if(a=r,r=a.plus(Qg(l,a,o+2)).times(.5),k0(a.d).slice(0,o)===(t=k0(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(Ya(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return Po=!0,Ya(r,n)};Es.times=Es.mul=function(e){var t,n,r,s,a,o,l,c,u,d=this,f=d.constructor,x=d.d,g=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=x.length,u=g.length,c<u&&(a=x,x=g,g=a,o=c,c=u,u=o),a=[],o=c+u,r=o;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,s=c+r;s>r;)l=a[s]+g[r]*x[s-r-1]+t,a[s--]=l%Sc|0,t=l/Sc|0;a[s]=(a[s]+t)%Sc|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Po?Ya(e,f.precision):e};Es.toDecimalPlaces=Es.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ix(e,0,QA),t===void 0?t=r.rounding:ix(t,0,8),Ya(n,e+Vl(n)+1,t))};Es.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=K3(r,!0):(ix(e,0,QA),t===void 0?t=s.rounding:ix(t,0,8),r=Ya(new s(r),e+1,t),n=K3(r,!0,e+1)),n};Es.toFixed=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?K3(s):(ix(e,0,QA),t===void 0?t=a.rounding:ix(t,0,8),r=Ya(new a(s),e+Vl(s)+1,t),n=K3(r.abs(),!1,e+Vl(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};Es.toInteger=Es.toint=function(){var e=this,t=e.constructor;return Ya(new t(e),Vl(e)+1,t.rounding)};Es.toNumber=function(){return+this};Es.toPower=Es.pow=function(e){var t,n,r,s,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Df);if(l=new c(l),!l.s){if(e.s<1)throw Error(fp+"Infinity");return l}if(l.eq(Df))return l;if(r=c.precision,e.eq(Df))return Ya(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=HBe){for(s=new c(Df),t=Math.ceil(r/yo+4),Po=!1;n%2&&(s=s.times(l),H3e(s.d,t)),n=ZA(n/2),n!==0;)l=l.times(l),H3e(l.d,t);return Po=!0,e.s<0?new c(Df).div(s):Ya(s,r)}}else if(a<0)throw Error(fp+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Po=!1,s=e.times(m_(l,r+u)),Po=!0,s=WBe(s),s.s=a,s};Es.toPrecision=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?(n=Vl(s),r=K3(s,n<=a.toExpNeg||n>=a.toExpPos)):(ix(e,1,QA),t===void 0?t=a.rounding:ix(t,0,8),s=Ya(new a(s),e,t),n=Vl(s),r=K3(s,e<=n||n<=a.toExpNeg,e)),r};Es.toSignificantDigits=Es.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ix(e,1,QA),t===void 0?t=r.rounding:ix(t,0,8)),Ya(new r(n),e,t)};Es.toString=Es.valueOf=Es.val=Es.toJSON=Es[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Vl(e),n=e.constructor;return K3(e,t<=n.toExpNeg||t>=n.toExpPos)};function VBe(e,t){var n,r,s,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Po?Ya(t,f):t;if(c=e.d,u=t.d,o=e.e,s=t.e,c=c.slice(),a=o-s,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,s=o,l=c.length),o=Math.ceil(f/yo),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Sc|0,c[a]%=Sc;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,Po?Ya(t,f):t}function ix(e,t,n){if(e!==~~e||e<t||e>n)throw Error(a3+e)}function k0(e){var t,n,r,s=e.length-1,a="",o=e[0];if(s>0){for(a+=o,t=1;t<s;t++)r=e[t]+"",n=yo-r.length,n&&(a+=Tb(n)),a+=r;o=e[t],r=o+"",n=yo-r.length,n&&(a+=Tb(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Qg=function(){function e(r,s){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*s+o,r[l]=a%Sc|0,o=a/Sc|0;return o&&r.unshift(o),r}function t(r,s,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=s[l]){c=r[l]>s[l]?1:-1;break}return c}function n(r,s,a){for(var o=0;a--;)r[a]-=o,o=r[a]<s[a]?1:0,r[a]=o*Sc+r[a]-s[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,a,o){var l,c,u,d,f,x,g,v,w,C,N,I,P,R,F,U,L,z,Q=r.constructor,ne=r.s==s.s?1:-1,J=r.d,X=s.d;if(!r.s)return new Q(r);if(!s.s)throw Error(fp+"Division by zero");for(c=r.e-s.e,L=X.length,F=J.length,g=new Q(ne),v=g.d=[],u=0;X[u]==(J[u]||0);)++u;if(X[u]>(J[u]||0)&&--c,a==null?I=a=Q.precision:o?I=a+(Vl(r)-Vl(s))+1:I=a,I<0)return new Q(0);if(I=I/yo+2|0,u=0,L==1)for(d=0,X=X[0],I++;(u<F||d)&&I--;u++)P=d*Sc+(J[u]||0),v[u]=P/X|0,d=P%X|0;else{for(d=Sc/(X[0]+1)|0,d>1&&(X=e(X,d),J=e(J,d),L=X.length,F=J.length),R=L,w=J.slice(0,L),C=w.length;C<L;)w[C++]=0;z=X.slice(),z.unshift(0),U=X[0],X[1]>=Sc/2&&++U;do d=0,l=t(X,w,L,C),l<0?(N=w[0],L!=C&&(N=N*Sc+(w[1]||0)),d=N/U|0,d>1?(d>=Sc&&(d=Sc-1),f=e(X,d),x=f.length,C=w.length,l=t(f,w,x,C),l==1&&(d--,n(f,L<x?z:X,x))):(d==0&&(l=d=1),f=X.slice()),x=f.length,x<C&&f.unshift(0),n(w,f,C),l==-1&&(C=w.length,l=t(X,w,L,C),l<1&&(d++,n(w,L<C?z:X,C))),C=w.length):l===0&&(d++,w=[0]),v[u++]=d,l&&w[0]?w[C++]=J[R]||0:(w=[J[R]],C=1);while((R++<F||w[0]!==void 0)&&I--)}return v[0]||v.shift(),g.e=c,Ya(g,o?a+Vl(g)+1:a)}}();function WBe(e,t){var n,r,s,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Vl(e)>16)throw Error(xce+Vl(e));if(!e.s)return new d(Df);for(t==null?(Po=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(kv(2,u))/Math.LN10*2+5|0,l+=r,n=s=a=new d(Df),d.precision=l;;){if(s=Ya(s.times(e),l),n=n.times(++c),o=a.plus(Qg(s,n,l)),k0(o.d).slice(0,l)===k0(a.d).slice(0,l)){for(;u--;)a=Ya(a.times(a),l);return d.precision=f,t==null?(Po=!0,Ya(a,f)):a}a=o}}function Vl(e){for(var t=e.e*yo,n=e.d[0];n>=10;n/=10)t++;return t}function iY(e,t,n){if(t>e.LN10.sd())throw Po=!0,n&&(e.precision=n),Error(fp+"LN10 precision limit exceeded");return Ya(new e(e.LN10),t)}function Tb(e){for(var t="";e--;)t+="0";return t}function m_(e,t){var n,r,s,a,o,l,c,u,d,f=1,x=10,g=e,v=g.d,w=g.constructor,C=w.precision;if(g.s<1)throw Error(fp+(g.s?"NaN":"-Infinity"));if(g.eq(Df))return new w(0);if(t==null?(Po=!1,u=C):u=t,g.eq(10))return t==null&&(Po=!0),iY(w,u);if(u+=x,w.precision=u,n=k0(v),r=n.charAt(0),a=Vl(g),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=k0(g.d),r=n.charAt(0),f++;a=Vl(g),r>1?(g=new w("0."+n),a++):g=new w(r+"."+n.slice(1))}else return c=iY(w,u+2,C).times(a+""),g=m_(new w(r+"."+n.slice(1)),u-x).plus(c),w.precision=C,t==null?(Po=!0,Ya(g,C)):g;for(l=o=g=Qg(g.minus(Df),g.plus(Df),u),d=Ya(g.times(g),u),s=3;;){if(o=Ya(o.times(d),u),c=l.plus(Qg(o,new w(s),u)),k0(c.d).slice(0,u)===k0(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(iY(w,u+2,C).times(a+""))),l=Qg(l,new w(f),u),w.precision=C,t==null?(Po=!0,Ya(l,C)):l;l=c,s+=2}}function z3e(e,t){var n,r,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=ZA(n/yo),e.d=[],r=(n+1)%yo,n<0&&(r+=yo),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=yo;r<s;)e.d.push(+t.slice(r,r+=yo));t=t.slice(r),r=yo-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),Po&&(e.e>fL||e.e<-fL))throw Error(xce+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ya(e,t,n){var r,s,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=yo,s=t,u=f[d=0];else{if(d=Math.ceil((r+1)/yo),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=yo,s=r-yo+o}if(n!==void 0&&(a=kv(10,o-s-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?s>0?u/kv(10,o-s):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Vl(e),f.length=1,t=t-a-1,f[0]=kv(10,(yo-t%yo)%yo),e.e=ZA(-t/yo)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=kv(10,yo-r),f[d]=s>0?(u/kv(10,o-s)%kv(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Sc&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Sc)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(Po&&(e.e>fL||e.e<-fL))throw Error(xce+Vl(e));return e}function qBe(e,t){var n,r,s,a,o,l,c,u,d,f,x=e.constructor,g=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),Po?Ya(t,g):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),s=Math.max(Math.ceil(g/yo),l)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=c.length,l=f.length,d=s<l,d&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){d=c[s]<f[s];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>o;){if(c[--s]<f[s]){for(a=s;a&&c[--a]===0;)c[a]=Sc-1;--c[a],c[s]+=Sc}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Po?Ya(t,g):t):new x(0)}function K3(e,t,n){var r,s=Vl(e),a=k0(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Tb(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+Tb(-s-1)+a,n&&(r=n-o)>0&&(a+=Tb(r))):s>=o?(a+=Tb(s+1-o),n&&(r=n-s-1)>0&&(a=a+"."+Tb(r))):((r=s+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(s+1===o&&(a+="."),a+=Tb(r))),e.s<0?"-"+a:a}function H3e(e,t){if(e.length>t)return e.length=t,!0}function GBe(e){var t,n,r;function s(a){var o=this;if(!(o instanceof s))return new s(a);if(o.constructor=s,a instanceof s){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(a3+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 z3e(o,a.toString())}else if(typeof a!="string")throw Error(a3+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,UGt.test(a))z3e(o,a);else throw Error(a3+a)}if(s.prototype=Es,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=GBe,s.config=s.set=zGt,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return s.config(e),s}function zGt(e){if(!e||typeof e!="object")throw Error(fp+"Object expected");var t,n,r,s=["precision",1,QA,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((r=e[n=s[t]])!==void 0)if(ZA(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(a3+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(a3+n+": "+r);return this}var gce=GBe($Gt);Df=new gce(1);const za=gce;function HGt(e){return GGt(e)||qGt(e)||WGt(e)||VGt()}function VGt(){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 WGt(e,t){if(e){if(typeof e=="string")return Ite(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ite(e,t)}}function qGt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function GGt(e){if(Array.isArray(e))return Ite(e)}function Ite(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var KGt=function(t){return t},KBe={"@@functional/placeholder":!0},YBe=function(t){return t===KBe},V3e=function(t){return function n(){return arguments.length===0||arguments.length===1&&YBe(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},YGt=function e(t,n){return t===1?n:V3e(function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];var o=s.filter(function(l){return l!==KBe}).length;return o>=t?n.apply(void 0,s):e(t-o,V3e(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=s.map(function(f){return YBe(f)?c.shift():f});return n.apply(void 0,HGt(d).concat(c))}))})},X$=function(t){return YGt(t.length,t)},Pte=function(t,n){for(var r=[],s=t;s<n;++s)r[s-t]=s;return r},XGt=X$(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),QGt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return KGt;var s=n.reverse(),a=s[0],o=s.slice(1);return function(){return o.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},Fte=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},XBe=function(t){var n=null,r=null;return function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return n&&a.every(function(l,c){return l===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function ZGt(e){var t;return e===0?t=1:t=Math.floor(new za(e).abs().log(10).toNumber())+1,t}function JGt(e,t,n){for(var r=new za(e),s=0,a=[];r.lt(t)&&s<1e5;)a.push(r.toNumber()),r=r.add(n),s++;return a}var eKt=X$(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),tKt=X$(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),nKt=X$(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Q$={rangeStep:JGt,getDigitCount:ZGt,interpolateNumber:eKt,uninterpolateNumber:tKt,uninterpolateTruncation:nKt};function Ote(e){return iKt(e)||sKt(e)||QBe(e)||rKt()}function rKt(){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 sKt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function iKt(e){if(Array.isArray(e))return Mte(e)}function x_(e,t){return lKt(e)||oKt(e,t)||QBe(e,t)||aKt()}function aKt(){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 QBe(e,t){if(e){if(typeof e=="string")return Mte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mte(e,t)}}function Mte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oKt(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){s=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw a}}return n}}function lKt(e){if(Array.isArray(e))return e}function ZBe(e){var t=x_(e,2),n=t[0],r=t[1],s=n,a=r;return n>r&&(s=r,a=n),[s,a]}function JBe(e,t,n){if(e.lte(0))return new za(0);var r=Q$.getDigitCount(e.toNumber()),s=new za(10).pow(r),a=e.div(s),o=r!==1?.05:.1,l=new za(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(s);return t?c:new za(Math.ceil(c))}function cKt(e,t,n){var r=1,s=new za(e);if(!s.isint()&&n){var a=Math.abs(e);a<1?(r=new za(10).pow(Q$.getDigitCount(e)-1),s=new za(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new za(Math.floor(e)))}else e===0?s=new za(Math.floor((t-1)/2)):n||(s=new za(Math.floor(e)));var o=Math.floor((t-1)/2),l=QGt(XGt(function(c){return s.add(new za(c-o).mul(r)).toNumber()}),Pte);return l(0,t)}function e$e(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new za(0),tickMin:new za(0),tickMax:new za(0)};var a=JBe(new za(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new za(0):(o=new za(e).add(t).div(2),o=o.sub(new za(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new za(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?e$e(e,t,n,r,s+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new za(l).mul(a)),tickMax:o.add(new za(c).mul(a))})}function uKt(e){var t=x_(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=ZBe([n,r]),c=x_(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Ote(Pte(0,s-1).map(function(){return 1/0}))):[].concat(Ote(Pte(0,s-1).map(function(){return-1/0})),[d]);return n>r?Fte(f):f}if(u===d)return cKt(u,s,a);var x=e$e(u,d,o,a),g=x.step,v=x.tickMin,w=x.tickMax,C=Q$.rangeStep(v,w.add(new za(.1).mul(g)),g);return n>r?Fte(C):C}function dKt(e,t){var n=x_(e,2),r=n[0],s=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=ZBe([r,s]),l=x_(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,s];if(c===u)return[c];var d=Math.max(t,2),f=JBe(new za(u).sub(c).div(d-1),a,0),x=[].concat(Ote(Q$.rangeStep(new za(c),new za(u).sub(new za(.99).mul(f)),f)),[u]);return r>s?Fte(x):x}var fKt=XBe(uKt),hKt=XBe(dKt),pKt="Invariant failed";function Y3(e,t){throw new Error(pKt)}var mKt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function _N(e){"@babel/helpers - typeof";return _N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_N(e)}function hL(){return hL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hL.apply(this,arguments)}function xKt(e,t){return vKt(e)||yKt(e,t)||bKt(e,t)||gKt()}function gKt(){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 bKt(e,t){if(e){if(typeof e=="string")return W3e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W3e(e,t)}}function W3e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yKt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function vKt(e){if(Array.isArray(e))return e}function wKt(e,t){if(e==null)return{};var n=CKt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function CKt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function SKt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NKt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r$e(r.key),r)}}function AKt(e,t,n){return NKt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jKt(e,t,n){return t=pL(t),EKt(e,t$e()?Reflect.construct(t,n||[],pL(e).constructor):t.apply(e,n))}function EKt(e,t){if(t&&(_N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _Kt(e)}function _Kt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t$e=function(){return!!e})()}function pL(e){return pL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pL(e)}function kKt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rte(e,t)}function Rte(e,t){return Rte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Rte(e,t)}function n$e(e,t,n){return t=r$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r$e(e){var t=TKt(e,"string");return _N(t)=="symbol"?t:t+""}function TKt(e,t){if(_N(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_N(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JA=function(e){function t(){return SKt(this,t),jKt(this,t,arguments)}return kKt(t,e),AKt(t,[{key:"render",value:function(){var r=this.props,s=r.offset,a=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,x=wKt(r,mKt),g=bi(x,!1);this.props.direction==="x"&&d.type!=="number"&&Y3();var v=c.map(function(w){var C=u(w,l),N=C.x,I=C.y,P=C.value,R=C.errorVal;if(!R)return null;var F=[],U,L;if(Array.isArray(R)){var z=xKt(R,2);U=z[0],L=z[1]}else U=L=R;if(a==="vertical"){var Q=d.scale,ne=I+s,J=ne+o,X=ne-o,re=Q(P-U),pe=Q(P+L);F.push({x1:pe,y1:J,x2:pe,y2:X}),F.push({x1:re,y1:ne,x2:pe,y2:ne}),F.push({x1:re,y1:J,x2:re,y2:X})}else if(a==="horizontal"){var Y=f.scale,ie=N+s,oe=ie-o,G=ie+o,V=Y(P-U),te=Y(P+L);F.push({x1:oe,y1:te,x2:G,y2:te}),F.push({x1:ie,y1:V,x2:ie,y2:te}),F.push({x1:oe,y1:V,x2:G,y2:V})}return Ne.createElement(Sa,hL({className:"recharts-errorBar",key:"bar-".concat(F.map(function(ae){return"".concat(ae.x1,"-").concat(ae.x2,"-").concat(ae.y1,"-").concat(ae.y2)}))},g),F.map(function(ae){return Ne.createElement("line",hL({},ae,{key:"line-".concat(ae.x1,"-").concat(ae.x2,"-").concat(ae.y1,"-").concat(ae.y2)}))}))});return Ne.createElement(Sa,{className:"recharts-errorBars"},v)}}])}(Ne.Component);n$e(JA,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});n$e(JA,"displayName","ErrorBar");function g_(e){"@babel/helpers - typeof";return g_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g_(e)}function q3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q3e(Object(n),!0).forEach(function(r){IKt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q3e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IKt(e,t,n){return t=PKt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PKt(e){var t=FKt(e,"string");return g_(t)=="symbol"?t:t+""}function FKt(e,t){if(g_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(g_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var s$e=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,a=t.legendContent,o=Mf(n,s3);if(!o)return null;var l=s3.defaultProps,c=l!==void 0?uv(uv({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:a==="children"?u=(r||[]).reduce(function(d,f){var x=f.item,g=f.props,v=g.sectors||g.data||[];return d.concat(v.map(function(w){return{type:o.props.iconType||x.props.legendType,value:w.name,color:w.fill,payload:w}}))},[]):u=(r||[]).map(function(d){var f=d.item,x=f.type.defaultProps,g=x!==void 0?uv(uv({},x),f.props):{},v=g.dataKey,w=g.name,C=g.legendType,N=g.hide;return{inactive:N,dataKey:v,type:c.iconType||C||"square",color:bce(f),value:w||v,payload:g}}),uv(uv(uv({},c),s3.getWithHeight(o,s)),{},{payload:u,item:o})};function b_(e){"@babel/helpers - typeof";return b_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b_(e)}function G3e(e){return LKt(e)||RKt(e)||MKt(e)||OKt()}function OKt(){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 MKt(e,t){if(e){if(typeof e=="string")return Lte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lte(e,t)}}function RKt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function LKt(e){if(Array.isArray(e))return Lte(e)}function Lte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function K3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function el(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K3e(Object(n),!0).forEach(function(r){p4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K3e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p4(e,t,n){return t=DKt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DKt(e){var t=BKt(e,"string");return b_(t)=="symbol"?t:t+""}function BKt(e,t){if(b_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(b_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sc(e,t,n){return yi(e)||yi(t)?n:rc(t)?np(e,t,n):Ni(t)?t(e):n}function i9(e,t,n,r){var s=LGt(e,function(l){return sc(l,t)});if(n==="number"){var a=s.filter(function(l){return es(l)||parseFloat(l)});return a.length?[Y$(a),gy(a)]:[1/0,-1/0]}var o=r?s.filter(function(l){return!yi(l)}):s;return o.map(function(l){return rc(l)||l instanceof Date?l:""})}var $Kt=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<l;u++){var d=u>0?s[u-1].coordinate:s[l-1].coordinate,f=s[u].coordinate,x=u>=l-1?s[0].coordinate:s[u+1].coordinate,g=void 0;if(om(f-d)!==om(x-f)){var v=[];if(om(x-f)===om(c[1]-c[0])){g=x;var w=f+c[1]-c[0];v[0]=Math.min(w,(w+d)/2),v[1]=Math.max(w,(w+d)/2)}else{g=d;var C=x+c[1]-c[0];v[0]=Math.min(f,(C+f)/2),v[1]=Math.max(f,(C+f)/2)}var N=[Math.min(f,(g+f)/2),Math.max(f,(g+f)/2)];if(t>N[0]&&t<=N[1]||t>=v[0]&&t<=v[1]){o=s[u].index;break}}else{var I=Math.min(d,x),P=Math.max(d,x);if(t>(I+f)/2&&t<=(P+f)/2){o=s[u].index;break}}}else for(var R=0;R<l;R++)if(R===0&&t<=(r[R].coordinate+r[R+1].coordinate)/2||R>0&&R<l-1&&t>(r[R].coordinate+r[R-1].coordinate)/2&&t<=(r[R].coordinate+r[R+1].coordinate)/2||R===l-1&&t>(r[R].coordinate+r[R-1].coordinate)/2){o=r[R].index;break}return o},bce=function(t){var n,r=t,s=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?el(el({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(s){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},UKt=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,a=s===void 0?{}:s;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,f=Object.keys(d),x=0,g=f.length;x<g;x++){var v=d[f[x]],w=v.items,C=v.cateAxisId,N=w.filter(function(L){return Yg(L.type).indexOf("Bar")>=0});if(N&&N.length){var I=N[0].type.defaultProps,P=I!==void 0?el(el({},I),N[0].props):N[0].props,R=P.barSize,F=P[C];o[F]||(o[F]=[]);var U=yi(R)?n:R;o[F].push({item:N[0],stackList:N.slice(1),barSize:yi(U)?void 0:q3(U,r,0)})}}return o},zKt=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=q3(n,s,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var x=!1,g=s/c,v=o.reduce(function(R,F){return R+F.barSize||0},0);v+=(c-1)*u,v>=s&&(v-=(c-1)*u,u=0),v>=s&&g>0&&(x=!0,g*=.9,v=c*g);var w=(s-v)/2>>0,C={offset:w-u,size:0};d=o.reduce(function(R,F){var U={item:F.item,position:{offset:C.offset+C.size+u,size:x?g:F.barSize}},L=[].concat(G3e(R),[U]);return C=L[L.length-1].position,F.stackList&&F.stackList.length&&F.stackList.forEach(function(z){L.push({item:z,position:C})}),L},f)}else{var N=q3(r,s,0,!0);s-2*N-(c-1)*u<=0&&(u=0);var I=(s-2*N-(c-1)*u)/c;I>1&&(I>>=0);var P=l===+l?Math.min(I,l):I;d=o.reduce(function(R,F,U){var L=[].concat(G3e(R),[{item:F.item,position:{offset:N+(I+u)*U+(I-P)/2,size:P}}]);return F.stackList&&F.stackList.length&&F.stackList.forEach(function(z){L.push({item:z,position:L[L.length-1].position})}),L},f)}return d},HKt=function(t,n,r,s){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=s$e({children:a,legendWidth:c});if(u){var d=s||{},f=d.width,x=d.height,g=u.align,v=u.verticalAlign,w=u.layout;if((w==="vertical"||w==="horizontal"&&v==="middle")&&g!=="center"&&es(t[g]))return el(el({},t),{},p4({},g,t[g]+(f||0)));if((w==="horizontal"||w==="vertical"&&g==="center")&&v!=="middle"&&es(t[v]))return el(el({},t),{},p4({},v,t[v]+(x||0)))}return t},VKt=function(t,n,r){return yi(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},i$e=function(t,n,r,s,a){var o=n.props.children,l=sf(o,JA).filter(function(u){return VKt(s,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=sc(d,r);if(yi(f))return u;var x=Array.isArray(f)?[Y$(f),gy(f)]:[f,f],g=c.reduce(function(v,w){var C=sc(d,w,0),N=x[0]-Math.abs(Array.isArray(C)?C[0]:C),I=x[1]+Math.abs(Array.isArray(C)?C[1]:C);return[Math.min(N,v[0]),Math.max(I,v[1])]},[1/0,-1/0]);return[Math.min(g[0],u[0]),Math.max(g[1],u[1])]},[1/0,-1/0])}return null},WKt=function(t,n,r,s,a){var o=n.map(function(l){return i$e(t,l,r,a,s)}).filter(function(l){return!yi(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},a$e=function(t,n,r,s,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&i$e(t,c,u,s)||i9(t,u,r,a)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},o$e=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},l$e=function(t,n,r,s){if(s)return t.map(function(c){return c.coordinate});var a,o,l=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(o=!0),c.coordinate});return a||l.push(n),o||l.push(r),l},Bg=function(t,n,r){if(!t)return null;var s=t.scale,a=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,u=(n||r)&&o==="category"&&s.bandwidth?s.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?om(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var x=a?a.indexOf(f):f;return{coordinate:s(x)+u,value:f,offset:u}});return d.filter(function(f){return!KA(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,x){return{coordinate:s(f)+u,value:f,index:x,offset:u}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(f){return{coordinate:s(f)+u,value:f,offset:u}}):s.domain().map(function(f,x){return{coordinate:s(f)+u,value:a?a[f]:f,index:x,offset:u}})},aY=new WeakMap,TP=function(t,n){if(typeof n!="function")return t;aY.has(t)||aY.set(t,new WeakMap);var r=aY.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},qKt=function(t,n,r){var s=t.scale,a=t.type,o=t.layout,l=t.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:u_(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:lL(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:s9(),realScaleType:"point"}:a==="category"?{scale:u_(),realScaleType:"band"}:{scale:lL(),realScaleType:"linear"};if(W3(s)){var c="scale".concat(M$(s));return{scale:(F3e[c]||s9)(),realScaleType:F3e[c]?c:"point"}}return Ni(s)?{scale:s}:{scale:s9(),realScaleType:"point"}},Y3e=1e-4,GKt=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),a=Math.min(s[0],s[1])-Y3e,o=Math.max(s[0],s[1])+Y3e,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},KKt=function(t,n){if(!t)return null;for(var r=0,s=t.length;r<s;r++)if(t[r].item===n)return t[r].position;return null},YKt=function(t,n){if(!n||n.length!==2||!es(n[0])||!es(n[1]))return t;var r=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!es(t[0])||t[0]<r)&&(a[0]=r),(!es(t[1])||t[1]>s)&&(a[1]=s),a[0]>s&&(a[0]=s),a[1]<r&&(a[1]=r),a},XKt=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0,l=0;l<n;++l){var c=KA(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},QKt=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0;o<n;++o){var l=KA(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},ZKt={sign:XKt,expand:RUt,none:vN,silhouette:LUt,wiggle:DUt,positive:QKt},JKt=function(t,n,r){var s=n.map(function(l){return l.props.dataKey}),a=ZKt[r],o=MUt().keys(s).value(function(l,c){return+sc(l,c,0)}).order(hte).offset(a);return o(t)},eYt=function(t,n,r,s,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,x){var g,v=(g=x.type)!==null&&g!==void 0&&g.defaultProps?el(el({},x.type.defaultProps),x.props):x.props,w=v.stackId,C=v.hide;if(C)return f;var N=v[r],I=f[N]||{hasStack:!1,stackGroups:{}};if(rc(w)){var P=I.stackGroups[w]||{numericAxisId:r,cateAxisId:s,items:[]};P.items.push(x),I.hasStack=!0,I.stackGroups[w]=P}else I.stackGroups[C5("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[x]};return el(el({},f),{},p4({},N,I))},c),d={};return Object.keys(u).reduce(function(f,x){var g=u[x];if(g.hasStack){var v={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(w,C){var N=g.stackGroups[C];return el(el({},w),{},p4({},C,{numericAxisId:r,cateAxisId:s,items:N.items,stackedData:JKt(t,N.items,a)}))},v)}return el(el({},f),{},p4({},x,g))},d)},tYt=function(t,n){var r=n.realScaleType,s=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=fKt(u,a,l);return t.domain([Y$(d),gy(d)]),{niceTicks:d}}if(a&&s==="number"){var f=t.domain(),x=hKt(f,a,l);return{niceTicks:x}}return null};function kN(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!yi(s[t.dataKey])){var l=HR(n,"value",s[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=sc(s,yi(o)?t.dataKey:o);return yi(c)?null:t.scale(c)}var X3e=function(t){var n=t.axis,r=t.ticks,s=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+s:null;var c=sc(o,n.dataKey,n.domain[l]);return yi(c)?null:n.scale(c)-a/2+s},nYt=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return s<=0&&a>=0?0:a<0?a:s}return r[0]},rYt=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?el(el({},t.type.defaultProps),t.props):t.props,a=s.stackId;if(rc(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},sYt=function(t){return t.reduce(function(n,r){return[Y$(r.concat([n[0]]).filter(es)),gy(r.concat([n[1]]).filter(es))]},[1/0,-1/0])},c$e=function(t,n,r){return Object.keys(t).reduce(function(s,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var f=sYt(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},Q3e=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Z3e=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Dte=function(t,n,r){if(Ni(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(es(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(Q3e.test(t[0])){var a=+Q3e.exec(t[0])[1];s[0]=n[0]-a}else Ni(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(es(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(Z3e.test(t[1])){var o=+Z3e.exec(t[1])[1];s[1]=n[1]+o}else Ni(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},mL=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var a=Wle(n,function(f){return f.coordinate}),o=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},J3e=function(t,n,r){return!t||!t.length||G3(t,np(r,"type.defaultProps.domain"))?n:t},u$e=function(t,n){var r=t.type.defaultProps?el(el({},t.type.defaultProps),t.props):t.props,s=r.dataKey,a=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return el(el({},bi(t,!1)),{},{dataKey:s,unit:o,formatter:l,name:a||s,color:bce(t),value:sc(n,s),type:c,payload:n,chartType:u,hide:d})};function y_(e){"@babel/helpers - typeof";return y_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y_(e)}function e5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function t5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e5e(Object(n),!0).forEach(function(r){iYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iYt(e,t,n){return t=aYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aYt(e){var t=oYt(e,"string");return y_(t)=="symbol"?t:t+""}function oYt(e,t){if(y_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(y_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xL=Math.PI/180,lYt=function(t){return t*180/Math.PI},tu=function(t,n,r,s){return{x:t+Math.cos(-xL*s)*r,y:n+Math.sin(-xL*s)*r}},cYt=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(s-o,2))},uYt=function(t,n){var r=t.x,s=t.y,a=n.cx,o=n.cy,l=cYt({x:r,y:s},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return s>o&&(u=2*Math.PI-u),{radius:l,angle:lYt(u),angleInRadian:u}},dYt=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(s,a);return{startAngle:n-o*360,endAngle:r-o*360}},fYt=function(t,n){var r=n.startAngle,s=n.endAngle,a=Math.floor(r/360),o=Math.floor(s/360),l=Math.min(a,o);return t+l*360},n5e=function(t,n){var r=t.x,s=t.y,a=uYt({x:r,y:s},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=dYt(n),f=d.startAngle,x=d.endAngle,g=l,v;if(f<=x){for(;g>x;)g-=360;for(;g<f;)g+=360;v=g>=f&&g<=x}else{for(;g>f;)g-=360;for(;g<x;)g+=360;v=g>=x&&g<=f}return v?t5e(t5e({},n),{},{radius:o,angle:fYt(g,n)}):null};function v_(e){"@babel/helpers - typeof";return v_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v_(e)}var hYt=["offset"];function pYt(e){return bYt(e)||gYt(e)||xYt(e)||mYt()}function mYt(){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 xYt(e,t){if(e){if(typeof e=="string")return Bte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bte(e,t)}}function gYt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bYt(e){if(Array.isArray(e))return Bte(e)}function Bte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yYt(e,t){if(e==null)return{};var n=vYt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vYt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function r5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ql(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r5e(Object(n),!0).forEach(function(r){wYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wYt(e,t,n){return t=CYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CYt(e){var t=SYt(e,"string");return v_(t)=="symbol"?t:t+""}function SYt(e,t){if(v_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(v_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function w_(){return w_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w_.apply(this,arguments)}var NYt=function(t){var n=t.value,r=t.formatter,s=yi(t.children)?n:t.children;return Ni(r)?r(s):s},AYt=function(t,n){var r=om(n-t),s=Math.min(Math.abs(n-t),360);return r*s},jYt=function(t,n,r){var s=t.position,a=t.viewBox,o=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,f=c.innerRadius,x=c.outerRadius,g=c.startAngle,v=c.endAngle,w=c.clockWise,C=(f+x)/2,N=AYt(g,v),I=N>=0?1:-1,P,R;s==="insideStart"?(P=g+I*o,R=w):s==="insideEnd"?(P=v-I*o,R=!w):s==="end"&&(P=v+I*o,R=w),R=N<=0?R:!R;var F=tu(u,d,C,P),U=tu(u,d,C,P+(R?1:-1)*359),L="M".concat(F.x,",").concat(F.y,`
A`).concat(C,",").concat(C,",0,1,").concat(R?0:1,`,
`).concat(U.x,",").concat(U.y),z=yi(t.id)?C5("recharts-radial-line-"):t.id;return Ne.createElement("text",w_({},r,{dominantBaseline:"central",className:sa("recharts-radial-bar-label",l)}),Ne.createElement("defs",null,Ne.createElement("path",{id:z,d:L})),Ne.createElement("textPath",{xlinkHref:"#".concat(z)},n))},EYt=function(t){var n=t.viewBox,r=t.offset,s=t.position,a=n,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,x=(d+f)/2;if(s==="outside"){var g=tu(o,l,u+r,x),v=g.x,w=g.y;return{x:v,y:w,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var C=(c+u)/2,N=tu(o,l,C,x),I=N.x,P=N.y;return{x:I,y:P,textAnchor:"middle",verticalAnchor:"middle"}},_Yt=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,x=f*s,g=f>0?"end":"start",v=f>0?"start":"end",w=u>=0?1:-1,C=w*s,N=w>0?"end":"start",I=w>0?"start":"end";if(a==="top"){var P={x:l+u/2,y:c-f*s,textAnchor:"middle",verticalAnchor:g};return Ql(Ql({},P),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var R={x:l+u/2,y:c+d+x,textAnchor:"middle",verticalAnchor:v};return Ql(Ql({},R),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var F={x:l-C,y:c+d/2,textAnchor:N,verticalAnchor:"middle"};return Ql(Ql({},F),r?{width:Math.max(F.x-r.x,0),height:d}:{})}if(a==="right"){var U={x:l+u+C,y:c+d/2,textAnchor:I,verticalAnchor:"middle"};return Ql(Ql({},U),r?{width:Math.max(r.x+r.width-U.x,0),height:d}:{})}var L=r?{width:u,height:d}:{};return a==="insideLeft"?Ql({x:l+C,y:c+d/2,textAnchor:I,verticalAnchor:"middle"},L):a==="insideRight"?Ql({x:l+u-C,y:c+d/2,textAnchor:N,verticalAnchor:"middle"},L):a==="insideTop"?Ql({x:l+u/2,y:c+x,textAnchor:"middle",verticalAnchor:v},L):a==="insideBottom"?Ql({x:l+u/2,y:c+d-x,textAnchor:"middle",verticalAnchor:g},L):a==="insideTopLeft"?Ql({x:l+C,y:c+x,textAnchor:I,verticalAnchor:v},L):a==="insideTopRight"?Ql({x:l+u-C,y:c+x,textAnchor:N,verticalAnchor:v},L):a==="insideBottomLeft"?Ql({x:l+C,y:c+d-x,textAnchor:I,verticalAnchor:g},L):a==="insideBottomRight"?Ql({x:l+u-C,y:c+d-x,textAnchor:N,verticalAnchor:g},L):GA(a)&&(es(a.x)||nw(a.x))&&(es(a.y)||nw(a.y))?Ql({x:l+q3(a.x,u),y:c+q3(a.y,d),textAnchor:"end",verticalAnchor:"end"},L):Ql({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},L)},kYt=function(t){return"cx"in t&&es(t.cx)};function ju(e){var t=e.offset,n=t===void 0?5:t,r=yYt(e,hYt),s=Ql({offset:n},r),a=s.viewBox,o=s.position,l=s.value,c=s.children,u=s.content,d=s.className,f=d===void 0?"":d,x=s.textBreakAll;if(!a||yi(l)&&yi(c)&&!m.isValidElement(u)&&!Ni(u))return null;if(m.isValidElement(u))return m.cloneElement(u,s);var g;if(Ni(u)){if(g=m.createElement(u,s),m.isValidElement(g))return g}else g=NYt(s);var v=kYt(a),w=bi(s,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return jYt(s,g,w);var C=v?EYt(s):_Yt(s);return Ne.createElement(tL,w_({className:sa("recharts-label",f)},w,C,{breakAll:x}),g)}ju.displayName="Label";var d$e=function(t){var n=t.cx,r=t.cy,s=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,x=t.y,g=t.top,v=t.left,w=t.width,C=t.height,N=t.clockWise,I=t.labelViewBox;if(I)return I;if(es(w)&&es(C)){if(es(f)&&es(x))return{x:f,y:x,width:w,height:C};if(es(g)&&es(v))return{x:g,y:v,width:w,height:C}}return es(f)&&es(x)?{x:f,y:x,width:0,height:0}:es(n)&&es(r)?{cx:n,cy:r,startAngle:a||s||0,endAngle:o||s||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:N}:t.viewBox?t.viewBox:{}},TYt=function(t,n){return t?t===!0?Ne.createElement(ju,{key:"label-implicit",viewBox:n}):rc(t)?Ne.createElement(ju,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===ju?m.cloneElement(t,{key:"label-implicit",viewBox:n}):Ne.createElement(ju,{key:"label-implicit",content:t,viewBox:n}):Ni(t)?Ne.createElement(ju,{key:"label-implicit",content:t,viewBox:n}):GA(t)?Ne.createElement(ju,w_({viewBox:n},t,{key:"label-implicit"})):null:null},IYt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var s=t.children,a=d$e(t),o=sf(s,ju).map(function(c,u){return m.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=TYt(t.label,n||a);return[l].concat(pYt(o))};ju.parseViewBox=d$e;ju.renderCallByParent=IYt;var oY,s5e;function PYt(){if(s5e)return oY;s5e=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return oY=e,oY}var FYt=PYt();const OYt=ki(FYt);function C_(e){"@babel/helpers - typeof";return C_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C_(e)}var MYt=["valueAccessor"],RYt=["data","dataKey","clockWise","id","textBreakAll"];function LYt(e){return UYt(e)||$Yt(e)||BYt(e)||DYt()}function DYt(){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 BYt(e,t){if(e){if(typeof e=="string")return $te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $te(e,t)}}function $Yt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UYt(e){if(Array.isArray(e))return $te(e)}function $te(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gL(){return gL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gL.apply(this,arguments)}function i5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function a5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i5e(Object(n),!0).forEach(function(r){zYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zYt(e,t,n){return t=HYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HYt(e){var t=VYt(e,"string");return C_(t)=="symbol"?t:t+""}function VYt(e,t){if(C_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(C_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o5e(e,t){if(e==null)return{};var n=WYt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WYt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var qYt=function(t){return Array.isArray(t.value)?OYt(t.value):t.value};function z0(e){var t=e.valueAccessor,n=t===void 0?qYt:t,r=o5e(e,MYt),s=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=o5e(r,RYt);return!s||!s.length?null:Ne.createElement(Sa,{className:"recharts-label-list"},s.map(function(d,f){var x=yi(a)?n(d,f):sc(d&&d.payload,a),g=yi(l)?{}:{id:"".concat(l,"-").concat(f)};return Ne.createElement(ju,gL({},bi(d,!0),u,g,{parentViewBox:d.parentViewBox,value:x,textBreakAll:c,viewBox:ju.parseViewBox(yi(o)?d:a5e(a5e({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}z0.displayName="LabelList";function GYt(e,t){return e?e===!0?Ne.createElement(z0,{key:"labelList-implicit",data:t}):Ne.isValidElement(e)||Ni(e)?Ne.createElement(z0,{key:"labelList-implicit",data:t,content:e}):GA(e)?Ne.createElement(z0,gL({data:t},e,{key:"labelList-implicit"})):null:null}function KYt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,s=sf(r,z0).map(function(o,l){return m.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return s;var a=GYt(e.label,t);return[a].concat(LYt(s))}z0.renderCallByParent=KYt;function S_(e){"@babel/helpers - typeof";return S_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S_(e)}function Ute(){return Ute=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ute.apply(this,arguments)}function l5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function c5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l5e(Object(n),!0).forEach(function(r){YYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YYt(e,t,n){return t=XYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XYt(e){var t=QYt(e,"string");return S_(t)=="symbol"?t:t+""}function QYt(e,t){if(S_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(S_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZYt=function(t,n){var r=om(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},IP=function(t){var n=t.cx,r=t.cy,s=t.radius,a=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+s,f=Math.asin(c/d)/xL,x=u?a:a+o*f,g=tu(n,r,d,x),v=tu(n,r,s,x),w=u?a-o*f:a,C=tu(n,r,d*Math.cos(f*xL),w);return{center:g,circleTangency:v,lineTangency:C,theta:f}},f$e=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=ZYt(o,l),u=o+c,d=tu(n,r,a,o),f=tu(n,r,a,u),x="M ".concat(d.x,",").concat(d.y,`
A `).concat(a,",").concat(a,`,0,
`).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
`).concat(f.x,",").concat(f.y,`
`);if(s>0){var g=tu(n,r,s,o),v=tu(n,r,s,u);x+="L ".concat(v.x,",").concat(v.y,`
A `).concat(s,",").concat(s,`,0,
`).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
`).concat(g.x,",").concat(g.y," Z")}else x+="L ".concat(n,",").concat(r," Z");return x},JYt=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=om(d-u),x=IP({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),g=x.circleTangency,v=x.lineTangency,w=x.theta,C=IP({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),N=C.circleTangency,I=C.lineTangency,P=C.theta,R=c?Math.abs(u-d):Math.abs(u-d)-w-P;if(R<0)return l?"M ".concat(v.x,",").concat(v.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
`):f$e({cx:n,cy:r,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d});var F="M ".concat(v.x,",").concat(v.y,`
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(g.x,",").concat(g.y,`
A`).concat(a,",").concat(a,",0,").concat(+(R>180),",").concat(+(f<0),",").concat(N.x,",").concat(N.y,`
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(I.x,",").concat(I.y,`
`);if(s>0){var U=IP({cx:n,cy:r,radius:s,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),L=U.circleTangency,z=U.lineTangency,Q=U.theta,ne=IP({cx:n,cy:r,radius:s,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),J=ne.circleTangency,X=ne.lineTangency,re=ne.theta,pe=c?Math.abs(u-d):Math.abs(u-d)-Q-re;if(pe<0&&o===0)return"".concat(F,"L").concat(n,",").concat(r,"Z");F+="L".concat(X.x,",").concat(X.y,`
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(J.x,",").concat(J.y,`
A`).concat(s,",").concat(s,",0,").concat(+(pe>180),",").concat(+(f>0),",").concat(L.x,",").concat(L.y,`
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(z.x,",").concat(z.y,"Z")}else F+="L".concat(n,",").concat(r,"Z");return F},eXt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},h$e=function(t){var n=c5e(c5e({},eXt),t),r=n.cx,s=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,x=n.className;if(o<a||d===f)return null;var g=sa("recharts-sector",x),v=o-a,w=q3(l,v,0,!0),C;return w>0&&Math.abs(d-f)<360?C=JYt({cx:r,cy:s,innerRadius:a,outerRadius:o,cornerRadius:Math.min(w,v/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):C=f$e({cx:r,cy:s,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),Ne.createElement("path",Ute({},bi(n,!0),{className:g,d:C,role:"img"}))};function N_(e){"@babel/helpers - typeof";return N_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N_(e)}function zte(){return zte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zte.apply(this,arguments)}function u5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function d5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u5e(Object(n),!0).forEach(function(r){tXt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tXt(e,t,n){return t=nXt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nXt(e){var t=rXt(e,"string");return N_(t)=="symbol"?t:t+""}function rXt(e,t){if(N_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(N_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var f5e={curveBasisClosed:NUt,curveBasisOpen:AUt,curveBasis:SUt,curveBumpX:cUt,curveBumpY:uUt,curveLinearClosed:jUt,curveLinear:L$,curveMonotoneX:EUt,curveMonotoneY:_Ut,curveNatural:kUt,curveStep:TUt,curveStepAfter:PUt,curveStepBefore:IUt},PP=function(t){return t.x===+t.x&&t.y===+t.y},D7=function(t){return t.x},B7=function(t){return t.y},sXt=function(t,n){if(Ni(t))return t;var r="curve".concat(M$(t));return(r==="curveMonotone"||r==="curveBump")&&n?f5e["".concat(r).concat(n==="vertical"?"Y":"X")]:f5e[r]||L$},iXt=function(t){var n=t.type,r=n===void 0?"linear":n,s=t.points,a=s===void 0?[]:s,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=sXt(r,l),f=u?a.filter(function(w){return PP(w)}):a,x;if(Array.isArray(o)){var g=u?o.filter(function(w){return PP(w)}):o,v=f.map(function(w,C){return d5e(d5e({},w),{},{base:g[C]})});return l==="vertical"?x=SP().y(B7).x1(D7).x0(function(w){return w.base.x}):x=SP().x(D7).y1(B7).y0(function(w){return w.base.y}),x.defined(PP).curve(d),x(v)}return l==="vertical"&&es(o)?x=SP().y(B7).x1(D7).x0(o):es(o)?x=SP().x(D7).y1(B7).y0(o):x=xDe().x(D7).y(B7),x.defined(PP).curve(d),x(f)},o3=function(t){var n=t.className,r=t.points,s=t.path,a=t.pathRef;if((!r||!r.length)&&!s)return null;var o=r&&r.length?iXt(t):s;return Ne.createElement("path",zte({},bi(t,!1),VR(t),{className:sa("recharts-curve",n),d:o,ref:a}))},aXt=E$();const Pa=ki(aXt);var oXt=Object.getOwnPropertyNames,lXt=Object.getOwnPropertySymbols,cXt=Object.prototype.hasOwnProperty;function h5e(e,t){return function(r,s,a){return e(r,s,a)&&t(r,s,a)}}function FP(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);var a=s.cache,o=a.get(n),l=a.get(r);if(o&&l)return o===r&&l===n;a.set(n,r),a.set(r,n);var c=e(n,r,s);return a.delete(n),a.delete(r),c}}function p5e(e){return oXt(e).concat(lXt(e))}var uXt=Object.hasOwn||function(e,t){return cXt.call(e,t)};function A5(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var dXt="__v",fXt="__o",hXt="_owner",m5e=Object.getOwnPropertyDescriptor,x5e=Object.keys;function pXt(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function mXt(e,t){return A5(e.getTime(),t.getTime())}function xXt(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function gXt(e,t){return e===t}function g5e(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),a=e.entries(),o,l,c=0;(o=a.next())&&!o.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(s[f]){f++;continue}var x=o.value,g=l.value;if(n.equals(x[0],g[0],c,f,e,t,n)&&n.equals(x[1],g[1],x[0],g[0],e,t,n)){d=s[f]=!0;break}f++}if(!d)return!1;c++}return!0}var bXt=A5;function yXt(e,t,n){var r=x5e(e),s=r.length;if(x5e(t).length!==s)return!1;for(;s-- >0;)if(!p$e(e,t,n,r[s]))return!1;return!0}function $7(e,t,n){var r=p5e(e),s=r.length;if(p5e(t).length!==s)return!1;for(var a,o,l;s-- >0;)if(a=r[s],!p$e(e,t,n,a)||(o=m5e(e,a),l=m5e(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function vXt(e,t){return A5(e.valueOf(),t.valueOf())}function wXt(e,t){return e.source===t.source&&e.flags===t.flags}function b5e(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),a=e.values(),o,l;(o=a.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!s[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function CXt(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function SXt(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function p$e(e,t,n,r){return(r===hXt||r===fXt||r===dXt)&&(e.$$typeof||t.$$typeof)?!0:uXt(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var NXt="[object Arguments]",AXt="[object Boolean]",jXt="[object Date]",EXt="[object Error]",_Xt="[object Map]",kXt="[object Number]",TXt="[object Object]",IXt="[object RegExp]",PXt="[object Set]",FXt="[object String]",OXt="[object URL]",MXt=Array.isArray,y5e=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,v5e=Object.assign,RXt=Object.prototype.toString.call.bind(Object.prototype.toString);function LXt(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,s=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,x=e.areUrlsEqual;return function(v,w,C){if(v===w)return!0;if(v==null||w==null)return!1;var N=typeof v;if(N!==typeof w)return!1;if(N!=="object")return N==="number"?o(v,w,C):N==="function"?s(v,w,C):!1;var I=v.constructor;if(I!==w.constructor)return!1;if(I===Object)return l(v,w,C);if(MXt(v))return t(v,w,C);if(y5e!=null&&y5e(v))return f(v,w,C);if(I===Date)return n(v,w,C);if(I===RegExp)return u(v,w,C);if(I===Map)return a(v,w,C);if(I===Set)return d(v,w,C);var P=RXt(v);return P===jXt?n(v,w,C):P===IXt?u(v,w,C):P===_Xt?a(v,w,C):P===PXt?d(v,w,C):P===TXt?typeof v.then!="function"&&typeof w.then!="function"&&l(v,w,C):P===OXt?x(v,w,C):P===EXt?r(v,w,C):P===NXt?l(v,w,C):P===AXt||P===kXt||P===FXt?c(v,w,C):!1}}function DXt(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?$7:pXt,areDatesEqual:mXt,areErrorsEqual:xXt,areFunctionsEqual:gXt,areMapsEqual:r?h5e(g5e,$7):g5e,areNumbersEqual:bXt,areObjectsEqual:r?$7:yXt,arePrimitiveWrappersEqual:vXt,areRegExpsEqual:wXt,areSetsEqual:r?h5e(b5e,$7):b5e,areTypedArraysEqual:r?$7:CXt,areUrlsEqual:SXt};if(n&&(s=v5e({},s,n(s))),t){var a=FP(s.areArraysEqual),o=FP(s.areMapsEqual),l=FP(s.areObjectsEqual),c=FP(s.areSetsEqual);s=v5e({},s,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function BXt(e){return function(t,n,r,s,a,o,l){return e(t,n,l)}}function $Xt(e){var t=e.circular,n=e.comparator,r=e.createState,s=e.equals,a=e.strict;if(r)return function(c,u){var d=r(),f=d.cache,x=f===void 0?t?new WeakMap:void 0:f,g=d.meta;return n(c,u,{cache:x,equals:s,meta:g,strict:a})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:s,meta:void 0,strict:a})};var o={cache:void 0,equals:s,meta:void 0,strict:a};return function(c,u){return n(c,u,o)}}var UXt=b2();b2({strict:!0});b2({circular:!0});b2({circular:!0,strict:!0});b2({createInternalComparator:function(){return A5}});b2({strict:!0,createInternalComparator:function(){return A5}});b2({circular:!0,createInternalComparator:function(){return A5}});b2({circular:!0,createInternalComparator:function(){return A5},strict:!0});function b2(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,s=e.createState,a=e.strict,o=a===void 0?!1:a,l=DXt(e),c=LXt(l),u=r?r(c):BXt(c);return $Xt({circular:n,comparator:c,createState:s,equals:u,strict:o})}function zXt(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function w5e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(a){n<0&&(n=a),a-n>t?(e(a),n=-1):zXt(s)};requestAnimationFrame(r)}function Hte(e){"@babel/helpers - typeof";return Hte=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hte(e)}function HXt(e){return GXt(e)||qXt(e)||WXt(e)||VXt()}function VXt(){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 WXt(e,t){if(e){if(typeof e=="string")return C5e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C5e(e,t)}}function C5e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qXt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GXt(e){if(Array.isArray(e))return e}function KXt(){var e={},t=function(){return null},n=!1,r=function s(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var o=a,l=HXt(o),c=l[0],u=l.slice(1);if(typeof c=="number"){w5e(s.bind(null,u),c);return}s(c),w5e(s.bind(null,u));return}Hte(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function A_(e){"@babel/helpers - typeof";return A_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A_(e)}function S5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function N5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S5e(Object(n),!0).forEach(function(r){m$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m$e(e,t,n){return t=YXt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YXt(e){var t=XXt(e,"string");return A_(t)==="symbol"?t:String(t)}function XXt(e,t){if(A_(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(A_(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QXt=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(a){return s.includes(a)})})},ZXt=function(t){return t},JXt=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},a9=function(t,n){return Object.keys(n).reduce(function(r,s){return N5e(N5e({},r),{},m$e({},s,t(s,n[s])))},{})},A5e=function(t,n,r){return t.map(function(s){return"".concat(JXt(s)," ").concat(n,"ms ").concat(r)}).join(",")};function eQt(e,t){return rQt(e)||nQt(e,t)||x$e(e,t)||tQt()}function tQt(){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 nQt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function rQt(e){if(Array.isArray(e))return e}function sQt(e){return oQt(e)||aQt(e)||x$e(e)||iQt()}function iQt(){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 x$e(e,t){if(e){if(typeof e=="string")return Vte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vte(e,t)}}function aQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oQt(e){if(Array.isArray(e))return Vte(e)}function Vte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bL=1e-4,g$e=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},b$e=function(t,n){return t.map(function(r,s){return r*Math.pow(n,s)}).reduce(function(r,s){return r+s})},j5e=function(t,n){return function(r){var s=g$e(t,n);return b$e(s,r)}},lQt=function(t,n){return function(r){var s=g$e(t,n),a=[].concat(sQt(s.map(function(o,l){return o*l}).slice(1)),[0]);return b$e(a,r)}},E5e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0],a=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":s=0,a=0,o=1,l=1;break;case"ease":s=.25,a=.1,o=.25,l=1;break;case"ease-in":s=.42,a=0,o=1,l=1;break;case"ease-out":s=.42,a=0,o=.58,l=1;break;case"ease-in-out":s=0,a=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(C){return parseFloat(C)}),d=eQt(u,4);s=d[0],a=d[1],o=d[2],l=d[3]}}}var f=j5e(s,o),x=j5e(a,l),g=lQt(s,o),v=function(N){return N>1?1:N<0?0:N},w=function(N){for(var I=N>1?1:N,P=I,R=0;R<8;++R){var F=f(P)-I,U=g(P);if(Math.abs(F-I)<bL||U<bL)return x(P);P=v(P-F/U)}return x(P)};return w.isStepper=!1,w},cQt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,a=s===void 0?8:s,o=t.dt,l=o===void 0?17:o,c=function(d,f,x){var g=-(d-f)*r,v=x*a,w=x+(g-v)*l/1e3,C=x*l/1e3+d;return Math.abs(C-f)<bL&&Math.abs(w)<bL?[f,0]:[C,w]};return c.isStepper=!0,c.dt=l,c},uQt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return E5e(s);case"spring":return cQt();default:if(s.split("(")[0]==="cubic-bezier")return E5e(s)}return typeof s=="function"?s:null};function j_(e){"@babel/helpers - typeof";return j_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j_(e)}function _5e(e){return hQt(e)||fQt(e)||y$e(e)||dQt()}function dQt(){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 fQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hQt(e){if(Array.isArray(e))return qte(e)}function k5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k5e(Object(n),!0).forEach(function(r){Wte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wte(e,t,n){return t=pQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pQt(e){var t=mQt(e,"string");return j_(t)==="symbol"?t:String(t)}function mQt(e,t){if(j_(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(j_(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xQt(e,t){return yQt(e)||bQt(e,t)||y$e(e,t)||gQt()}function gQt(){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 y$e(e,t){if(e){if(typeof e=="string")return qte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qte(e,t)}}function qte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bQt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function yQt(e){if(Array.isArray(e))return e}var yL=function(t,n,r){return t+(n-t)*r},Gte=function(t){var n=t.from,r=t.to;return n!==r},vQt=function e(t,n,r){var s=a9(function(a,o){if(Gte(o)){var l=t(o.from,o.to,o.velocity),c=xQt(l,2),u=c[0],d=c[1];return qc(qc({},o),{},{from:u,velocity:d})}return o},n);return r<1?a9(function(a,o){return Gte(o)?qc(qc({},o),{},{velocity:yL(o.velocity,s[a].velocity,r),from:yL(o.from,s[a].from,r)}):o},n):e(t,s,r-1)};const wQt=function(e,t,n,r,s){var a=QXt(e,t),o=a.reduce(function(C,N){return qc(qc({},C),{},Wte({},N,[e[N],t[N]]))},{}),l=a.reduce(function(C,N){return qc(qc({},C),{},Wte({},N,{from:e[N],velocity:0,to:t[N]}))},{}),c=-1,u,d,f=function(){return null},x=function(){return a9(function(N,I){return I.from},l)},g=function(){return!Object.values(l).filter(Gte).length},v=function(N){u||(u=N);var I=N-u,P=I/n.dt;l=vQt(n,l,P),s(qc(qc(qc({},e),t),x())),u=N,g()||(c=requestAnimationFrame(f))},w=function(N){d||(d=N);var I=(N-d)/r,P=a9(function(F,U){return yL.apply(void 0,_5e(U).concat([n(I)]))},o);if(s(qc(qc(qc({},e),t),P)),I<1)c=requestAnimationFrame(f);else{var R=a9(function(F,U){return yL.apply(void 0,_5e(U).concat([n(1)]))},o);s(qc(qc(qc({},e),t),R))}};return f=n.isStepper?v:w,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function TN(e){"@babel/helpers - typeof";return TN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},TN(e)}var CQt=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function SQt(e,t){if(e==null)return{};var n=NQt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function NQt(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function lY(e){return _Qt(e)||EQt(e)||jQt(e)||AQt()}function AQt(){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 jQt(e,t){if(e){if(typeof e=="string")return Kte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kte(e,t)}}function EQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _Qt(e){if(Array.isArray(e))return Kte(e)}function Kte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Pp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T5e(Object(n),!0).forEach(function(r){_j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _j(e,t,n){return t=v$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kQt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TQt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v$e(r.key),r)}}function IQt(e,t,n){return TQt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function v$e(e){var t=PQt(e,"string");return TN(t)==="symbol"?t:String(t)}function PQt(e,t){if(TN(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(TN(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FQt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yte(e,t)}function Yte(e,t){return Yte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Yte(e,t)}function OQt(e){var t=MQt();return function(){var r=vL(e),s;if(t){var a=vL(this).constructor;s=Reflect.construct(r,arguments,a)}else s=r.apply(this,arguments);return Xte(this,s)}}function Xte(e,t){if(t&&(TN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qte(e)}function Qte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MQt(){if(typeof Reflect>"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 vL(e){return vL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vL(e)}var wm=function(e){FQt(n,e);var t=OQt(n);function n(r,s){var a;kQt(this,n),a=t.call(this,r,s);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,x=o.children,g=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Qte(a)),a.changeStyle=a.changeStyle.bind(Qte(a)),!l||g<=0)return a.state={style:{}},typeof x=="function"&&(a.state={style:d}),Xte(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof x=="function")return a.state={style:u},Xte(a);a.state={style:c?_j({},c,u):u}}else a.state={style:{}};return a}return IQt(n,[{key:"componentDidMount",value:function(){var s=this.props,a=s.isActive,o=s.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,x=this.state.style;if(l){if(!o){var g={style:c?_j({},c,d):d};this.state&&x&&(c&&x[c]!==d||!c&&x!==d)&&this.setState(g);return}if(!(UXt(s.to,d)&&s.canBegin&&s.isActive)){var v=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=v||u?f:s.to;if(this.state&&x){var C={style:c?_j({},c,w):w};(c&&x[c]!==w||!c&&x!==w)&&this.setState(C)}this.runAnimation(Pp(Pp({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var a=this,o=s.from,l=s.to,c=s.duration,u=s.easing,d=s.begin,f=s.onAnimationEnd,x=s.onAnimationStart,g=wQt(o,l,uQt(u),c,this.changeStyle),v=function(){a.stopJSAnimation=g()};this.manager.start([x,d,v,c,f])}},{key:"runStepAnimation",value:function(s){var a=this,o=s.steps,l=s.begin,c=s.onAnimationStart,u=o[0],d=u.style,f=u.duration,x=f===void 0?0:f,g=function(w,C,N){if(N===0)return w;var I=C.duration,P=C.easing,R=P===void 0?"ease":P,F=C.style,U=C.properties,L=C.onAnimationEnd,z=N>0?o[N-1]:C,Q=U||Object.keys(F);if(typeof R=="function"||R==="spring")return[].concat(lY(w),[a.runJSAnimation.bind(a,{from:z.style,to:F,duration:I,easing:R}),I]);var ne=A5e(Q,I,R),J=Pp(Pp(Pp({},z.style),F),{},{transition:ne});return[].concat(lY(w),[J,I,L]).filter(ZXt)};return this.manager.start([c].concat(lY(o.reduce(g,[d,Math.max(x,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=KXt());var a=s.begin,o=s.duration,l=s.attributeName,c=s.to,u=s.easing,d=s.onAnimationStart,f=s.onAnimationEnd,x=s.steps,g=s.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof g=="function"||u==="spring"){this.runJSAnimation(s);return}if(x.length>1){this.runStepAnimation(s);return}var w=l?_j({},l,c):c,C=A5e(Object.keys(w),o,u);v.start([d,a,Pp(Pp({},w),{},{transition:C}),o,f])}},{key:"render",value:function(){var s=this.props,a=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=SQt(s,CQt),u=m.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var f=function(g){var v=g.props,w=v.style,C=w===void 0?{}:w,N=v.className,I=m.cloneElement(g,Pp(Pp({},c),{},{style:Pp(Pp({},C),d),className:N}));return I};return u===1?f(m.Children.only(a)):Ne.createElement("div",null,m.Children.map(a,function(x){return f(x)}))}}]),n}(m.PureComponent);wm.displayName="Animate";wm.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};wm.propTypes={from:Pa.oneOfType([Pa.object,Pa.string]),to:Pa.oneOfType([Pa.object,Pa.string]),attributeName:Pa.string,duration:Pa.number,begin:Pa.number,easing:Pa.oneOfType([Pa.string,Pa.func]),steps:Pa.arrayOf(Pa.shape({duration:Pa.number.isRequired,style:Pa.object.isRequired,easing:Pa.oneOfType([Pa.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Pa.func]),properties:Pa.arrayOf("string"),onAnimationEnd:Pa.func})),children:Pa.oneOfType([Pa.node,Pa.func]),isActive:Pa.bool,canBegin:Pa.bool,onAnimationEnd:Pa.func,shouldReAnimate:Pa.bool,onAnimationStart:Pa.func,onAnimationReStart:Pa.func};function E_(e){"@babel/helpers - typeof";return E_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E_(e)}function wL(){return wL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wL.apply(this,arguments)}function RQt(e,t){return $Qt(e)||BQt(e,t)||DQt(e,t)||LQt()}function LQt(){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 DQt(e,t){if(e){if(typeof e=="string")return I5e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I5e(e,t)}}function I5e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BQt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function $Qt(e){if(Array.isArray(e))return e}function P5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function F5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P5e(Object(n),!0).forEach(function(r){UQt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UQt(e,t,n){return t=zQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zQt(e){var t=HQt(e,"string");return E_(t)=="symbol"?t:t+""}function HQt(e,t){if(E_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(E_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O5e=function(t,n,r,s,a){var o=Math.min(Math.abs(r)/2,Math.abs(s)/2),l=s>=0?1:-1,c=r>=0?1:-1,u=s>=0&&r>=0||s<0&&r<0?1:0,d;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],x=0,g=4;x<g;x++)f[x]=a[x]>o?o:a[x];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
`).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+s-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
`).concat(t+r-c*f[2],",").concat(n+s)),d+="L ".concat(t+c*f[3],",").concat(n+s),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
`).concat(t,",").concat(n+s-l*f[3])),d+="Z"}else if(o>0&&a===+a&&a>0){var v=Math.min(o,a);d="M ".concat(t,",").concat(n+l*v,`
A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+c*v,",").concat(n,`
L `).concat(t+r-c*v,",").concat(n,`
A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*v,`
L `).concat(t+r,",").concat(n+s-l*v,`
A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+r-c*v,",").concat(n+s,`
L `).concat(t+c*v,",").concat(n+s,`
A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(n+s-l*v," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(s," h ").concat(-r," Z");return d},VQt=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,a=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(o,o+c),x=Math.max(o,o+c);return r>=u&&r<=d&&s>=f&&s<=x}return!1},WQt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yce=function(t){var n=F5e(F5e({},WQt),t),r=m.useRef(),s=m.useState(-1),a=RQt(s,2),o=a[0],l=a[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var R=r.current.getTotalLength();R&&l(R)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,x=n.radius,g=n.className,v=n.animationEasing,w=n.animationDuration,C=n.animationBegin,N=n.isAnimationActive,I=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var P=sa("recharts-rectangle",g);return I?Ne.createElement(wm,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:w,animationEasing:v,isActive:I},function(R){var F=R.width,U=R.height,L=R.x,z=R.y;return Ne.createElement(wm,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:C,duration:w,isActive:N,easing:v},Ne.createElement("path",wL({},bi(n,!0),{className:P,d:O5e(L,z,F,U,x),ref:r})))}):Ne.createElement("path",wL({},bi(n,!0),{className:P,d:O5e(c,u,d,f,x)}))};function Zte(){return Zte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zte.apply(this,arguments)}var Z$=function(t){var n=t.cx,r=t.cy,s=t.r,a=t.className,o=sa("recharts-dot",a);return n===+n&&r===+r&&s===+s?Ne.createElement("circle",Zte({},bi(t,!1),VR(t),{className:o,cx:n,cy:r,r:s})):null};function __(e){"@babel/helpers - typeof";return __=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},__(e)}var qQt=["x","y","top","left","width","height","className"];function Jte(){return Jte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jte.apply(this,arguments)}function M5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function GQt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M5e(Object(n),!0).forEach(function(r){KQt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KQt(e,t,n){return t=YQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YQt(e){var t=XQt(e,"string");return __(t)=="symbol"?t:t+""}function XQt(e,t){if(__(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(__(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QQt(e,t){if(e==null)return{};var n=ZQt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ZQt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var JQt=function(t,n,r,s,a,o){return"M".concat(t,",").concat(a,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},eZt=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,x=t.height,g=x===void 0?0:x,v=t.className,w=QQt(t,qQt),C=GQt({x:r,y:a,top:l,left:u,width:f,height:g},w);return!es(r)||!es(a)||!es(f)||!es(g)||!es(l)||!es(u)?null:Ne.createElement("path",Jte({},bi(C,!0),{className:sa("recharts-cross",v),d:JQt(r,a,f,g,l,u)}))},cY,R5e;function tZt(){if(R5e)return cY;R5e=1;var e=BDe(),t=e(Object.getPrototypeOf,Object);return cY=t,cY}var uY,L5e;function nZt(){if(L5e)return uY;L5e=1;var e=_1(),t=tZt(),n=k1(),r="[object Object]",s=Function.prototype,a=Object.prototype,o=s.toString,l=a.hasOwnProperty,c=o.call(Object);function u(d){if(!n(d)||e(d)!=r)return!1;var f=t(d);if(f===null)return!0;var x=l.call(f,"constructor")&&f.constructor;return typeof x=="function"&&x instanceof x&&o.call(x)==c}return uY=u,uY}var rZt=nZt();const sZt=ki(rZt);var dY,D5e;function iZt(){if(D5e)return dY;D5e=1;var e=_1(),t=k1(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return dY=r,dY}var aZt=iZt();const oZt=ki(aZt);function k_(e){"@babel/helpers - typeof";return k_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k_(e)}function CL(){return CL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CL.apply(this,arguments)}function lZt(e,t){return fZt(e)||dZt(e,t)||uZt(e,t)||cZt()}function cZt(){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 uZt(e,t){if(e){if(typeof e=="string")return B5e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B5e(e,t)}}function B5e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dZt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function fZt(e){if(Array.isArray(e))return e}function $5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function U5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$5e(Object(n),!0).forEach(function(r){hZt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hZt(e,t,n){return t=pZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pZt(e){var t=mZt(e,"string");return k_(t)=="symbol"?t:t+""}function mZt(e,t){if(k_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(k_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var z5e=function(t,n,r,s,a){var o=r-s,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+a),l+="L ".concat(t+r-o/2-s,",").concat(n+a),l+="L ".concat(t,",").concat(n," Z"),l},xZt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},gZt=function(t){var n=U5e(U5e({},xZt),t),r=m.useRef(),s=m.useState(-1),a=lZt(s,2),o=a[0],l=a[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var P=r.current.getTotalLength();P&&l(P)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,x=n.height,g=n.className,v=n.animationEasing,w=n.animationDuration,C=n.animationBegin,N=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||x!==+x||d===0&&f===0||x===0)return null;var I=sa("recharts-trapezoid",g);return N?Ne.createElement(wm,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:x,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:x,x:c,y:u},duration:w,animationEasing:v,isActive:N},function(P){var R=P.upperWidth,F=P.lowerWidth,U=P.height,L=P.x,z=P.y;return Ne.createElement(wm,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:C,duration:w,easing:v},Ne.createElement("path",CL({},bi(n,!0),{className:I,d:z5e(L,z,R,F,U),ref:r})))}):Ne.createElement("g",null,Ne.createElement("path",CL({},bi(n,!0),{className:I,d:z5e(c,u,d,f,x)})))},bZt=["option","shapeType","propTransformer","activeClassName","isActive"];function T_(e){"@babel/helpers - typeof";return T_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T_(e)}function yZt(e,t){if(e==null)return{};var n=vZt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vZt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function H5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function SL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H5e(Object(n),!0).forEach(function(r){wZt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wZt(e,t,n){return t=CZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CZt(e){var t=SZt(e,"string");return T_(t)=="symbol"?t:t+""}function SZt(e,t){if(T_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(T_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NZt(e,t){return SL(SL({},t),e)}function AZt(e,t){return e==="symbols"}function V5e(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return Ne.createElement(yce,n);case"trapezoid":return Ne.createElement(gZt,n);case"sector":return Ne.createElement(h$e,n);case"symbols":if(AZt(t))return Ne.createElement(B$,n);break;default:return null}}function jZt(e){return m.isValidElement(e)?e.props:e}function ene(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?NZt:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=yZt(e,bZt),u;if(m.isValidElement(t))u=m.cloneElement(t,SL(SL({},c),jZt(t)));else if(Ni(t))u=t(c);else if(sZt(t)&&!oZt(t)){var d=s(t,c);u=Ne.createElement(V5e,{shapeType:n,elementProps:d})}else{var f=c;u=Ne.createElement(V5e,{shapeType:n,elementProps:f})}return l?Ne.createElement(Sa,{className:o},u):u}function J$(e,t){return t!=null&&"trapezoids"in e.props}function eU(e,t){return t!=null&&"sectors"in e.props}function I_(e,t){return t!=null&&"points"in e.props}function EZt(e,t){var n,r,s=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return s&&a}function _Zt(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function kZt(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function TZt(e,t){var n;return J$(e,t)?n=EZt:eU(e,t)?n=_Zt:I_(e,t)&&(n=kZt),n}function IZt(e,t){var n;return J$(e,t)?n="trapezoids":eU(e,t)?n="sectors":I_(e,t)&&(n="points"),n}function PZt(e,t){if(J$(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(eU(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return I_(e,t)?t.payload:{}}function FZt(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=IZt(n,t),a=PZt(n,t),o=r.filter(function(c,u){var d=G3(a,c),f=n.props[s].filter(function(v){var w=TZt(n,t);return w(v,t)}),x=n.props[s].indexOf(f[f.length-1]),g=u===x;return d&&g}),l=r.indexOf(o[o.length-1]);return l}var fY,W5e;function OZt(){if(W5e)return fY;W5e=1;var e=Math.ceil,t=Math.max;function n(r,s,a,o){for(var l=-1,c=t(e((s-r)/(a||1)),0),u=Array(c);c--;)u[o?c:++l]=r,r+=a;return u}return fY=n,fY}var hY,q5e;function w$e(){if(q5e)return hY;q5e=1;var e=tBe(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-1/0){var a=s<0?-1:1;return a*n}return s===s?s:0}return hY=r,hY}var pY,G5e;function MZt(){if(G5e)return pY;G5e=1;var e=OZt(),t=z$(),n=w$e();function r(s){return function(a,o,l){return l&&typeof l!="number"&&t(a,o,l)&&(o=l=void 0),a=n(a),o===void 0?(o=a,a=0):o=n(o),l=l===void 0?a<o?1:-1:n(l),e(a,o,l,s)}}return pY=r,pY}var mY,K5e;function RZt(){if(K5e)return mY;K5e=1;var e=MZt(),t=e();return mY=t,mY}var LZt=RZt();const NL=ki(LZt);function P_(e){"@babel/helpers - typeof";return P_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P_(e)}function Y5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function X5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y5e(Object(n),!0).forEach(function(r){C$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C$e(e,t,n){return t=DZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DZt(e){var t=BZt(e,"string");return P_(t)=="symbol"?t:t+""}function BZt(e,t){if(P_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(P_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $Zt=["Webkit","Moz","O","ms"],UZt=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),s=$Zt.reduce(function(a,o){return X5e(X5e({},a),{},C$e({},o+r,n))},{});return s[t]=n,s};function IN(e){"@babel/helpers - typeof";return IN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},IN(e)}function AL(){return AL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AL.apply(this,arguments)}function Q5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function xY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q5e(Object(n),!0).forEach(function(r){Tf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zZt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z5e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,N$e(r.key),r)}}function HZt(e,t,n){return Z5e(e.prototype,t),Z5e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VZt(e,t,n){return t=jL(t),WZt(e,S$e()?Reflect.construct(t,n,jL(e).constructor):t.apply(e,n))}function WZt(e,t){if(t&&(IN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qZt(e)}function qZt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S$e=function(){return!!e})()}function jL(e){return jL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jL(e)}function GZt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tne(e,t)}function tne(e,t){return tne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},tne(e,t)}function Tf(e,t,n){return t=N$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N$e(e){var t=KZt(e,"string");return IN(t)=="symbol"?t:t+""}function KZt(e,t){if(IN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(IN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var YZt=function(t){var n=t.data,r=t.startIndex,s=t.endIndex,a=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=s9().domain(NL(0,c)).range([a,a+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(s),scale:u,scaleValues:d}},J5e=function(t){return t.changedTouches&&!!t.changedTouches.length},PN=function(e){function t(n){var r;return zZt(this,t),r=VZt(this,t,[n]),Tf(r,"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),Tf(r,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),Tf(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,a=s.endIndex,o=s.onDragEnd,l=s.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Tf(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Tf(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Tf(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Tf(r,"handleSlideDragStart",function(s){var a=J5e(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return GZt(t,e),HZt(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(s,a),x=Math.max(s,a),g=t.getIndexInRange(o,f),v=t.getIndexInRange(o,x);return{startIndex:g-g%c,endIndex:v===d?d:v-v%c}}},{key:"getTextOfTick",value:function(r){var s=this.props,a=s.data,o=s.tickFormatter,l=s.dataKey,c=sc(a[r],l,r);return Ni(o)?o(c,r):c}},{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 s=this.state,a=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,x=c.startIndex,g=c.endIndex,v=c.onChange,w=r.pageX-a;w>0?w=Math.min(w,u+d-f-l,u+d-f-o):w<0&&(w=Math.max(w,u-o,u-l));var C=this.getIndex({startX:o+w,endX:l+w});(C.startIndex!==x||C.endIndex!==g)&&v&&v(C),this.setState({startX:o+w,endX:l+w,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var a=J5e(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,a=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,u=this.state[o],d=this.props,f=d.x,x=d.width,g=d.travellerWidth,v=d.onChange,w=d.gap,C=d.data,N={startX:this.state.startX,endX:this.state.endX},I=r.pageX-a;I>0?I=Math.min(I,f+x-g-u):I<0&&(I=Math.max(I,f-u)),N[o]=u+I;var P=this.getIndex(N),R=P.startIndex,F=P.endIndex,U=function(){var z=C.length-1;return o==="startX"&&(l>c?R%w===0:F%w===0)||l<c&&F===z||o==="endX"&&(l>c?F%w===0:R%w===0)||l>c&&F===z};this.setState(Tf(Tf({},o,u+I),"brushMoveStartX",r.pageX),function(){v&&U()&&v(P)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[s],f=l.indexOf(d);if(f!==-1){var x=f+r;if(!(x===-1||x>=l.length)){var g=l[x];s==="startX"&&g>=u||s==="endX"&&g<=c||this.setState(Tf({},s,g),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return Ne.createElement("rect",{stroke:u,fill:c,x:s,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=m.Children.only(u);return f?Ne.cloneElement(f,{x:s,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,s){var a,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,x=c.traveller,g=c.ariaLabel,v=c.data,w=c.startIndex,C=c.endIndex,N=Math.max(r,this.props.x),I=xY(xY({},bi(this.props,!1)),{},{x:N,y:u,width:d,height:f}),P=g||"Min value: ".concat((a=v[w])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[C])===null||o===void 0?void 0:o.name);return Ne.createElement(Sa,{tabIndex:0,role:"slider","aria-label":P,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(F){["ArrowLeft","ArrowRight"].includes(F.key)&&(F.preventDefault(),F.stopPropagation(),l.handleTravellerMoveKeyboard(F.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(x,I))}},{key:"renderSlide",value:function(r,s){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,s)+u,f=Math.max(Math.abs(s-r)-u,0);return Ne.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,a=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,x=d.endX,g=5,v={pointerEvents:"none",fill:u};return Ne.createElement(Sa,{className:"recharts-brush-texts"},Ne.createElement(tL,AL({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,x)-g,y:o+l/2},v),this.getTextOfTick(s)),Ne.createElement(tL,AL({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,x)+c+g,y:o+l/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,s=r.data,a=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,x=this.state,g=x.startX,v=x.endX,w=x.isTextActive,C=x.isSlideMoving,N=x.isTravellerMoving,I=x.isTravellerFocused;if(!s||!s.length||!es(l)||!es(c)||!es(u)||!es(d)||u<=0||d<=0)return null;var P=sa("recharts-brush",a),R=Ne.Children.count(o)===1,F=UZt("userSelect","none");return Ne.createElement(Sa,{className:P,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:F},this.renderBackground(),R&&this.renderPanorama(),this.renderSlide(g,v),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(v,"endX"),(w||C||N||I||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return Ne.createElement(Ne.Fragment,null,Ne.createElement("rect",{x:s,y:a,width:o,height:l,fill:c,stroke:"none"}),Ne.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),Ne.createElement("line",{x1:s+1,y1:u+2,x2:s+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var a;return Ne.isValidElement(r)?a=Ne.cloneElement(r,s):Ni(r)?a=r(s):a=t.renderDefaultTraveller(s),a}},{key:"getDerivedStateFromProps",value:function(r,s){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(a!==s.prevData||u!==s.prevUpdateId)return xY({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?YZt({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var x=s.scale.domain().map(function(g){return s.scale(g)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:x}}return null}},{key:"getIndexInRange",value:function(r,s){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>s?l=c:o=c}return s>=r[l]?l:o}}])}(m.PureComponent);Tf(PN,"displayName","Brush");Tf(PN,"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 gY,e6e;function XZt(){if(e6e)return gY;e6e=1;var e=Vle();function t(n,r){var s;return e(n,function(a,o,l){return s=r(a,o,l),!s}),!!s}return gY=t,gY}var bY,t6e;function QZt(){if(t6e)return bY;t6e=1;var e=PDe(),t=m2(),n=XZt(),r=df(),s=z$();function a(o,l,c){var u=r(o)?e:n;return c&&s(o,l,c)&&(l=void 0),u(o,t(l,3))}return bY=a,bY}var ZZt=QZt();const JZt=ki(ZZt);var H0=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},yY,n6e;function eJt(){if(n6e)return yY;n6e=1;var e=XDe();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return yY=t,yY}var vY,r6e;function tJt(){if(r6e)return vY;r6e=1;var e=eJt(),t=KDe(),n=m2();function r(s,a){var o={};return a=n(a,3),t(s,function(l,c,u){e(o,c,a(l,c,u))}),o}return vY=r,vY}var nJt=tJt();const rJt=ki(nJt);var wY,s6e;function sJt(){if(s6e)return wY;s6e=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(!n(t[r],r,t))return!1;return!0}return wY=e,wY}var CY,i6e;function iJt(){if(i6e)return CY;i6e=1;var e=Vle();function t(n,r){var s=!0;return e(n,function(a,o,l){return s=!!r(a,o,l),s}),s}return CY=t,CY}var SY,a6e;function aJt(){if(a6e)return SY;a6e=1;var e=sJt(),t=iJt(),n=m2(),r=df(),s=z$();function a(o,l,c){var u=r(o)?e:t;return c&&s(o,l,c)&&(l=void 0),u(o,n(l,3))}return SY=a,SY}var oJt=aJt();const A$e=ki(oJt);var lJt=["x","y"];function F_(e){"@babel/helpers - typeof";return F_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F_(e)}function nne(){return nne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nne.apply(this,arguments)}function o6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function U7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o6e(Object(n),!0).forEach(function(r){cJt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cJt(e,t,n){return t=uJt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uJt(e){var t=dJt(e,"string");return F_(t)=="symbol"?t:t+""}function dJt(e,t){if(F_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(F_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fJt(e,t){if(e==null)return{};var n=hJt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hJt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function pJt(e,t){var n=e.x,r=e.y,s=fJt(e,lJt),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||s.height),d=parseInt(u,10),f="".concat(t.width||s.width),x=parseInt(f,10);return U7(U7(U7(U7(U7({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:x,name:t.name,radius:t.radius})}function l6e(e){return Ne.createElement(ene,nne({shapeType:"rectangle",propTransformer:pJt,activeClassName:"recharts-active-bar"},e))}var mJt=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var a=typeof r=="number";return a?t(r,s):(a||Y3(),n)}},xJt=["value","background"],j$e;function FN(e){"@babel/helpers - typeof";return FN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},FN(e)}function gJt(e,t){if(e==null)return{};var n=bJt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bJt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function EL(){return EL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EL.apply(this,arguments)}function c6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ml(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c6e(Object(n),!0).forEach(function(r){by(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_$e(r.key),r)}}function vJt(e,t,n){return u6e(e.prototype,t),u6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wJt(e,t,n){return t=_L(t),CJt(e,E$e()?Reflect.construct(t,n,_L(e).constructor):t.apply(e,n))}function CJt(e,t){if(t&&(FN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SJt(e)}function SJt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E$e=function(){return!!e})()}function _L(e){return _L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_L(e)}function NJt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rne(e,t)}function rne(e,t){return rne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},rne(e,t)}function by(e,t,n){return t=_$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _$e(e){var t=AJt(e,"string");return FN(t)=="symbol"?t:t+""}function AJt(e,t){if(FN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(FN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var e8=function(e){function t(){var n;yJt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=wJt(this,t,[].concat(s)),by(n,"state",{isAnimationFinished:!1}),by(n,"id",C5("recharts-bar-")),by(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),by(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return NJt(t,e),vJt(t,[{key:"renderRectanglesStatically",value:function(r){var s=this,a=this.props,o=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=bi(this.props,!1);return r&&r.map(function(f,x){var g=x===c,v=g?u:o,w=Ml(Ml(Ml({},d),f),{},{isActive:g,option:v,index:x,dataKey:l,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return Ne.createElement(Sa,EL({className:"recharts-bar-rectangle"},n_(s.props,f,x),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(x)}),Ne.createElement(l6e,w))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,s=this.props,a=s.data,o=s.layout,l=s.isAnimationActive,c=s.animationBegin,u=s.animationDuration,d=s.animationEasing,f=s.animationId,x=this.state.prevData;return Ne.createElement(wm,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var v=g.t,w=a.map(function(C,N){var I=x&&x[N];if(I){var P=wl(I.x,C.x),R=wl(I.y,C.y),F=wl(I.width,C.width),U=wl(I.height,C.height);return Ml(Ml({},C),{},{x:P(v),y:R(v),width:F(v),height:U(v)})}if(o==="horizontal"){var L=wl(0,C.height),z=L(v);return Ml(Ml({},C),{},{y:C.y+C.height-z,height:z})}var Q=wl(0,C.width),ne=Q(v);return Ml(Ml({},C),{},{width:ne})});return Ne.createElement(Sa,null,r.renderRectanglesStatically(w))})}},{key:"renderRectangles",value:function(){var r=this.props,s=r.data,a=r.isAnimationActive,o=this.state.prevData;return a&&s&&s.length&&(!o||!G3(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var r=this,s=this.props,a=s.data,o=s.dataKey,l=s.activeIndex,c=bi(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,x=gJt(u,xJt);if(!f)return null;var g=Ml(Ml(Ml(Ml(Ml({},x),{},{fill:"#eee"},f),c),n_(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return Ne.createElement(l6e,EL({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},g))})}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=sf(d,JA);if(!f)return null;var x=u==="vertical"?o[0].height/2:o[0].width/2,g=function(C,N){var I=Array.isArray(C.value)?C.value[1]:C.value;return{x:C.x,y:C.y,value:I,errorVal:sc(C,N)}},v={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Ne.createElement(Sa,v,f.map(function(w){return Ne.cloneElement(w,{key:"error-bar-".concat(s,"-").concat(w.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:x,dataPointFormatter:g})}))}},{key:"render",value:function(){var r=this.props,s=r.hide,a=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,x=r.height,g=r.isAnimationActive,v=r.background,w=r.id;if(s||!a||!a.length)return null;var C=this.state.isAnimationFinished,N=sa("recharts-bar",o),I=l&&l.allowDataOverflow,P=c&&c.allowDataOverflow,R=I||P,F=yi(w)?this.id:w;return Ne.createElement(Sa,{className:N},I||P?Ne.createElement("defs",null,Ne.createElement("clipPath",{id:"clipPath-".concat(F)},Ne.createElement("rect",{x:I?u:u-f/2,y:P?d:d-x/2,width:I?f:f*2,height:P?x:x*2}))):null,Ne.createElement(Sa,{className:"recharts-bar-rectangles",clipPath:R?"url(#clipPath-".concat(F,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(R,F),(!g||C)&&z0.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:s.curData}:r.data!==s.curData?{curData:r.data}:null}}])}(m.PureComponent);j$e=e8;by(e8,"displayName","Bar");by(e8,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!hm.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});by(e8,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,s=e.bandSize,a=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,x=e.offset,g=KKt(r,n);if(!g)return null;var v=t.layout,w=n.type.defaultProps,C=w!==void 0?Ml(Ml({},w),n.props):n.props,N=C.dataKey,I=C.children,P=C.minPointSize,R=v==="horizontal"?o:a,F=u?R.scale.domain():null,U=nYt({numericAxis:R}),L=sf(I,Gle),z=f.map(function(Q,ne){var J,X,re,pe,Y,ie;u?J=YKt(u[d+ne],F):(J=sc(Q,N),Array.isArray(J)||(J=[U,J]));var oe=mJt(P,j$e.defaultProps.minPointSize)(J[1],ne);if(v==="horizontal"){var G,V=[o.scale(J[0]),o.scale(J[1])],te=V[0],ae=V[1];X=X3e({axis:a,ticks:l,bandSize:s,offset:g.offset,entry:Q,index:ne}),re=(G=ae??te)!==null&&G!==void 0?G:void 0,pe=g.size;var he=te-ae;if(Y=Number.isNaN(he)?0:he,ie={x:X,y:o.y,width:pe,height:o.height},Math.abs(oe)>0&&Math.abs(Y)<Math.abs(oe)){var Ce=om(Y||oe)*(Math.abs(oe)-Math.abs(Y));re-=Ce,Y+=Ce}}else{var ce=[a.scale(J[0]),a.scale(J[1])],ge=ce[0],Ae=ce[1];if(X=ge,re=X3e({axis:o,ticks:c,bandSize:s,offset:g.offset,entry:Q,index:ne}),pe=Ae-ge,Y=g.size,ie={x:a.x,y:re,width:a.width,height:Y},Math.abs(oe)>0&&Math.abs(pe)<Math.abs(oe)){var ye=om(pe||oe)*(Math.abs(oe)-Math.abs(pe));pe+=ye}}return Ml(Ml(Ml({},Q),{},{x:X,y:re,width:pe,height:Y,value:u?J:J[1],payload:Q,background:ie},L[ne]&&L[ne].props),{},{tooltipPayload:[u$e(n,Q)],tooltipPosition:{x:X+pe/2,y:re+Y/2}})});return Ml({data:z,layout:v},x)});function O_(e){"@babel/helpers - typeof";return O_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O_(e)}function jJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,k$e(r.key),r)}}function EJt(e,t,n){return d6e(e.prototype,t),d6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Xp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f6e(Object(n),!0).forEach(function(r){tU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tU(e,t,n){return t=k$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k$e(e){var t=_Jt(e,"string");return O_(t)=="symbol"?t:t+""}function _Jt(e,t){if(O_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(O_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T$e=function(t,n,r,s,a){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},x=!!Mf(u,e8);return d.reduce(function(g,v){var w=n[v],C=w.orientation,N=w.domain,I=w.padding,P=I===void 0?{}:I,R=w.mirror,F=w.reversed,U="".concat(C).concat(R?"Mirror":""),L,z,Q,ne,J;if(w.type==="number"&&(w.padding==="gap"||w.padding==="no-gap")){var X=N[1]-N[0],re=1/0,pe=w.categoricalDomain.sort(O$t);if(pe.forEach(function(ce,ge){ge>0&&(re=Math.min((ce||0)-(pe[ge-1]||0),re))}),Number.isFinite(re)){var Y=re/X,ie=w.layout==="vertical"?r.height:r.width;if(w.padding==="gap"&&(L=Y*ie/2),w.padding==="no-gap"){var oe=q3(t.barCategoryGap,Y*ie),G=Y*ie/2;L=G-oe-(G-oe)/ie*oe}}}s==="xAxis"?z=[r.left+(P.left||0)+(L||0),r.left+r.width-(P.right||0)-(L||0)]:s==="yAxis"?z=c==="horizontal"?[r.top+r.height-(P.bottom||0),r.top+(P.top||0)]:[r.top+(P.top||0)+(L||0),r.top+r.height-(P.bottom||0)-(L||0)]:z=w.range,F&&(z=[z[1],z[0]]);var V=qKt(w,a,x),te=V.scale,ae=V.realScaleType;te.domain(N).range(z),GKt(te);var he=tYt(te,Xp(Xp({},w),{},{realScaleType:ae}));s==="xAxis"?(J=C==="top"&&!R||C==="bottom"&&R,Q=r.left,ne=f[U]-J*w.height):s==="yAxis"&&(J=C==="left"&&!R||C==="right"&&R,Q=f[U]-J*w.width,ne=r.top);var Ce=Xp(Xp(Xp({},w),he),{},{realScaleType:ae,x:Q,y:ne,scale:te,width:s==="xAxis"?r.width:w.width,height:s==="yAxis"?r.height:w.height});return Ce.bandSize=mL(Ce,he),!w.hide&&s==="xAxis"?f[U]+=(J?-1:1)*Ce.height:w.hide||(f[U]+=(J?-1:1)*Ce.width),Xp(Xp({},g),{},tU({},v,Ce))},{})},I$e=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(s,o),width:Math.abs(a-r),height:Math.abs(o-s)}},kJt=function(t){var n=t.x1,r=t.y1,s=t.x2,a=t.y2;return I$e({x:n,y:r},{x:s,y:a})},P$e=function(){function e(t){jJt(this,e),this.scale=t}return EJt(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=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 l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(s){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),s=r[0],a=r[r.length-1];return s<=a?n>=s&&n<=a:n>=a&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])}();tU(P$e,"EPS",1e-4);var vce=function(t){var n=Object.keys(t).reduce(function(r,s){return Xp(Xp({},r),{},tU({},s,P$e.create(t[s])))},{});return Xp(Xp({},n),{},{apply:function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return rJt(s,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return A$e(s,function(a,o){return n[o].isInRange(a)})}})};function TJt(e){return(e%180+180)%180}var IJt=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=TJt(s),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},NY,h6e;function PJt(){if(h6e)return NY;h6e=1;var e=m2(),t=lT(),n=$$();function r(s){return function(a,o,l){var c=Object(a);if(!t(a)){var u=e(o,3);a=n(a),o=function(f){return u(c[f],f,c)}}var d=s(a,o,l);return d>-1?c[u?a[d]:d]:void 0}}return NY=r,NY}var AY,p6e;function FJt(){if(p6e)return AY;p6e=1;var e=w$e();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return AY=t,AY}var jY,m6e;function OJt(){if(m6e)return jY;m6e=1;var e=HDe(),t=m2(),n=FJt(),r=Math.max;function s(a,o,l){var c=a==null?0:a.length;if(!c)return-1;var u=l==null?0:n(l);return u<0&&(u=r(c+u,0)),e(a,t(o,3),u)}return jY=s,jY}var EY,x6e;function MJt(){if(x6e)return EY;x6e=1;var e=PJt(),t=OJt(),n=e(t);return EY=n,EY}var RJt=MJt();const LJt=ki(RJt);var DJt=sDe();const BJt=ki(DJt);var $Jt=BJt(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),wce=m.createContext(void 0),Cce=m.createContext(void 0),F$e=m.createContext(void 0),O$e=m.createContext({}),M$e=m.createContext(void 0),R$e=m.createContext(0),L$e=m.createContext(0),g6e=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=$Jt(a);return Ne.createElement(wce.Provider,{value:r},Ne.createElement(Cce.Provider,{value:s},Ne.createElement(O$e.Provider,{value:a},Ne.createElement(F$e.Provider,{value:d},Ne.createElement(M$e.Provider,{value:o},Ne.createElement(R$e.Provider,{value:u},Ne.createElement(L$e.Provider,{value:c},l)))))))},UJt=function(){return m.useContext(M$e)},D$e=function(t){var n=m.useContext(wce);n==null&&Y3();var r=n[t];return r==null&&Y3(),r},zJt=function(){var t=m.useContext(wce);return Ob(t)},HJt=function(){var t=m.useContext(Cce),n=LJt(t,function(r){return A$e(r.domain,Number.isFinite)});return n||Ob(t)},B$e=function(t){var n=m.useContext(Cce);n==null&&Y3();var r=n[t];return r==null&&Y3(),r},VJt=function(){var t=m.useContext(F$e);return t},WJt=function(){return m.useContext(O$e)},Sce=function(){return m.useContext(L$e)},Nce=function(){return m.useContext(R$e)};function ON(e){"@babel/helpers - typeof";return ON=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ON(e)}function qJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GJt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,U$e(r.key),r)}}function KJt(e,t,n){return GJt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function YJt(e,t,n){return t=kL(t),XJt(e,$$e()?Reflect.construct(t,n||[],kL(e).constructor):t.apply(e,n))}function XJt(e,t){if(t&&(ON(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QJt(e)}function QJt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($$e=function(){return!!e})()}function kL(e){return kL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kL(e)}function ZJt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sne(e,t)}function sne(e,t){return sne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},sne(e,t)}function b6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function y6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b6e(Object(n),!0).forEach(function(r){Ace(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ace(e,t,n){return t=U$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U$e(e){var t=JJt(e,"string");return ON(t)=="symbol"?t:t+""}function JJt(e,t){if(ON(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ON(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function een(e,t){return sen(e)||ren(e,t)||nen(e,t)||ten()}function ten(){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 nen(e,t){if(e){if(typeof e=="string")return v6e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v6e(e,t)}}function v6e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ren(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function sen(e){if(Array.isArray(e))return e}function ine(){return ine=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ine.apply(this,arguments)}var ien=function(t,n){var r;return Ne.isValidElement(t)?r=Ne.cloneElement(t,n):Ni(t)?r=t(n):r=Ne.createElement("line",ine({},n,{className:"recharts-reference-line-line"})),r},aen=function(t,n,r,s,a,o,l,c,u){var d=a.x,f=a.y,x=a.width,g=a.height;if(r){var v=u.y,w=t.y.apply(v,{position:o});if(H0(u,"discard")&&!t.y.isInRange(w))return null;var C=[{x:d+x,y:w},{x:d,y:w}];return c==="left"?C.reverse():C}if(n){var N=u.x,I=t.x.apply(N,{position:o});if(H0(u,"discard")&&!t.x.isInRange(I))return null;var P=[{x:I,y:f+g},{x:I,y:f}];return l==="top"?P.reverse():P}if(s){var R=u.segment,F=R.map(function(U){return t.apply(U,{position:o})});return H0(u,"discard")&&JZt(F,function(U){return!t.isInRange(U)})?null:F}return null};function oen(e){var t=e.x,n=e.y,r=e.segment,s=e.xAxisId,a=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=UJt(),d=D$e(s),f=B$e(a),x=VJt();if(!u||!x)return null;Xg(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=vce({x:d.scale,y:f.scale}),v=rc(t),w=rc(n),C=r&&r.length===2,N=aen(g,v,w,C,x,e.position,d.orientation,f.orientation,e);if(!N)return null;var I=een(N,2),P=I[0],R=P.x,F=P.y,U=I[1],L=U.x,z=U.y,Q=H0(e,"hidden")?"url(#".concat(u,")"):void 0,ne=y6e(y6e({clipPath:Q},bi(e,!0)),{},{x1:R,y1:F,x2:L,y2:z});return Ne.createElement(Sa,{className:sa("recharts-reference-line",l)},ien(o,ne),ju.renderCallByParent(e,kJt({x1:R,y1:F,x2:L,y2:z})))}var jce=function(e){function t(){return qJt(this,t),YJt(this,t,arguments)}return ZJt(t,e),KJt(t,[{key:"render",value:function(){return Ne.createElement(oen,this.props)}}])}(Ne.Component);Ace(jce,"displayName","ReferenceLine");Ace(jce,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function ane(){return ane=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ane.apply(this,arguments)}function MN(e){"@babel/helpers - typeof";return MN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},MN(e)}function w6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function C6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w6e(Object(n),!0).forEach(function(r){nU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function len(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cen(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,H$e(r.key),r)}}function uen(e,t,n){return cen(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function den(e,t,n){return t=TL(t),fen(e,z$e()?Reflect.construct(t,n||[],TL(e).constructor):t.apply(e,n))}function fen(e,t){if(t&&(MN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hen(e)}function hen(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(z$e=function(){return!!e})()}function TL(e){return TL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},TL(e)}function pen(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&one(e,t)}function one(e,t){return one=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},one(e,t)}function nU(e,t,n){return t=H$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H$e(e){var t=men(e,"string");return MN(t)=="symbol"?t:t+""}function men(e,t){if(MN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(MN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xen=function(t){var n=t.x,r=t.y,s=t.xAxis,a=t.yAxis,o=vce({x:s.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return H0(t,"discard")&&!o.isInRange(l)?null:l},rU=function(e){function t(){return len(this,t),den(this,t,arguments)}return pen(t,e),uen(t,[{key:"render",value:function(){var r=this.props,s=r.x,a=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=rc(s),d=rc(a);if(Xg(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=xen(this.props);if(!f)return null;var x=f.x,g=f.y,v=this.props,w=v.shape,C=v.className,N=H0(this.props,"hidden")?"url(#".concat(c,")"):void 0,I=C6e(C6e({clipPath:N},bi(this.props,!0)),{},{cx:x,cy:g});return Ne.createElement(Sa,{className:sa("recharts-reference-dot",C)},t.renderDot(w,I),ju.renderCallByParent(this.props,{x:x-o,y:g-o,width:2*o,height:2*o}))}}])}(Ne.Component);nU(rU,"displayName","ReferenceDot");nU(rU,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});nU(rU,"renderDot",function(e,t){var n;return Ne.isValidElement(e)?n=Ne.cloneElement(e,t):Ni(e)?n=e(t):n=Ne.createElement(Z$,ane({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function lne(){return lne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lne.apply(this,arguments)}function RN(e){"@babel/helpers - typeof";return RN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},RN(e)}function S6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function N6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S6e(Object(n),!0).forEach(function(r){sU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gen(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ben(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,W$e(r.key),r)}}function yen(e,t,n){return ben(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ven(e,t,n){return t=IL(t),wen(e,V$e()?Reflect.construct(t,n||[],IL(e).constructor):t.apply(e,n))}function wen(e,t){if(t&&(RN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cen(e)}function Cen(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V$e=function(){return!!e})()}function IL(e){return IL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},IL(e)}function Sen(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cne(e,t)}function cne(e,t){return cne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},cne(e,t)}function sU(e,t,n){return t=W$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W$e(e){var t=Nen(e,"string");return RN(t)=="symbol"?t:t+""}function Nen(e,t){if(RN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(RN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Aen=function(t,n,r,s,a){var o=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,f=a.yAxis;if(!d||!f)return null;var x=vce({x:d.scale,y:f.scale}),g={x:t?x.x.apply(o,{position:"start"}):x.x.rangeMin,y:r?x.y.apply(c,{position:"start"}):x.y.rangeMin},v={x:n?x.x.apply(l,{position:"end"}):x.x.rangeMax,y:s?x.y.apply(u,{position:"end"}):x.y.rangeMax};return H0(a,"discard")&&(!x.isInRange(g)||!x.isInRange(v))?null:I$e(g,v)},iU=function(e){function t(){return gen(this,t),ven(this,t,arguments)}return Sen(t,e),yen(t,[{key:"render",value:function(){var r=this.props,s=r.x1,a=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;Xg(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=rc(s),x=rc(a),g=rc(o),v=rc(l),w=this.props.shape;if(!f&&!x&&!g&&!v&&!w)return null;var C=Aen(f,x,g,v,this.props);if(!C&&!w)return null;var N=H0(this.props,"hidden")?"url(#".concat(d,")"):void 0;return Ne.createElement(Sa,{className:sa("recharts-reference-area",c)},t.renderRect(w,N6e(N6e({clipPath:N},bi(this.props,!0)),C)),ju.renderCallByParent(this.props,C))}}])}(Ne.Component);sU(iU,"displayName","ReferenceArea");sU(iU,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});sU(iU,"renderRect",function(e,t){var n;return Ne.isValidElement(e)?n=Ne.cloneElement(e,t):Ni(e)?n=e(t):n=Ne.createElement(yce,lne({},t,{className:"recharts-reference-area-rect"})),n});function q$e(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],s=0;s<e.length;s+=t)r.push(e[s]);return r}function jen(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return IJt(r,n)}function Een(e,t,n){var r=n==="width",s=e.x,a=e.y,o=e.width,l=e.height;return t===1?{start:r?s:a,end:r?s+o:a+l}:{start:r?s+o:a+l,end:r?s:a}}function PL(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function _en(e,t){return q$e(e,t+1)}function ken(e,t,n,r,s){for(var a=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var v=r==null?void 0:r[c];if(v===void 0)return{v:q$e(r,u)};var w=c,C,N=function(){return C===void 0&&(C=n(v,w)),C},I=v.coordinate,P=c===0||PL(e,I,N,d,l);P||(c=0,d=o,u+=1),P&&(d=I+e*(N()/2+s),c+=u)},x;u<=a.length;)if(x=f(),x)return x.v;return[]}function M_(e){"@babel/helpers - typeof";return M_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M_(e)}function A6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Cu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A6e(Object(n),!0).forEach(function(r){Ten(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ten(e,t,n){return t=Ien(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ien(e){var t=Pen(e,"string");return M_(t)=="symbol"?t:t+""}function Pen(e,t){if(M_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(M_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fen(e,t,n,r,s){for(var a=(r||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(x){var g=a[x],v,w=function(){return v===void 0&&(v=n(g,x)),v};if(x===o-1){var C=e*(g.coordinate+e*w()/2-c);a[x]=g=Cu(Cu({},g),{},{tickCoord:C>0?g.coordinate-C*e:g.coordinate})}else a[x]=g=Cu(Cu({},g),{},{tickCoord:g.coordinate});var N=PL(e,g.tickCoord,w,l,c);N&&(c=g.tickCoord-e*(w()/2+s),a[x]=Cu(Cu({},g),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function Oen(e,t,n,r,s,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=r[l-1],f=n(d,l-1),x=e*(d.coordinate+e*f/2-u);o[l-1]=d=Cu(Cu({},d),{},{tickCoord:x>0?d.coordinate-x*e:d.coordinate});var g=PL(e,d.tickCoord,function(){return f},c,u);g&&(u=d.tickCoord-e*(f/2+s),o[l-1]=Cu(Cu({},d),{},{isShow:!0}))}for(var v=a?l-1:l,w=function(I){var P=o[I],R,F=function(){return R===void 0&&(R=n(P,I)),R};if(I===0){var U=e*(P.coordinate-e*F()/2-c);o[I]=P=Cu(Cu({},P),{},{tickCoord:U<0?P.coordinate-U*e:P.coordinate})}else o[I]=P=Cu(Cu({},P),{},{tickCoord:P.coordinate});var L=PL(e,P.tickCoord,F,c,u);L&&(c=P.tickCoord+e*(F()/2+s),o[I]=Cu(Cu({},P),{},{isShow:!0}))},C=0;C<v;C++)w(C);return o}function Ece(e,t,n){var r=e.tick,s=e.ticks,a=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!s||!s.length||!r)return[];if(es(c)||hm.isSsr)return _en(s,typeof c=="number"&&es(c)?c:0);var x=[],g=l==="top"||l==="bottom"?"width":"height",v=d&&g==="width"?r9(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},w=function(P,R){var F=Ni(u)?u(P.value,R):P.value;return g==="width"?jen(r9(F,{fontSize:t,letterSpacing:n}),v,f):r9(F,{fontSize:t,letterSpacing:n})[g]},C=s.length>=2?om(s[1].coordinate-s[0].coordinate):1,N=Een(a,C,g);return c==="equidistantPreserveStart"?ken(C,N,w,s,o):(c==="preserveStart"||c==="preserveStartEnd"?x=Oen(C,N,w,s,o,c==="preserveStartEnd"):x=Fen(C,N,w,s,o),x.filter(function(I){return I.isShow}))}var Men=["viewBox"],Ren=["viewBox"],Len=["ticks"];function LN(e){"@babel/helpers - typeof";return LN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},LN(e)}function BC(){return BC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BC.apply(this,arguments)}function j6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ku(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j6e(Object(n),!0).forEach(function(r){_ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Y(e,t){if(e==null)return{};var n=Den(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Den(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ben(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,K$e(r.key),r)}}function $en(e,t,n){return E6e(e.prototype,t),E6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uen(e,t,n){return t=FL(t),zen(e,G$e()?Reflect.construct(t,n,FL(e).constructor):t.apply(e,n))}function zen(e,t){if(t&&(LN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hen(e)}function Hen(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G$e=function(){return!!e})()}function FL(e){return FL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},FL(e)}function Ven(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&une(e,t)}function une(e,t){return une=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},une(e,t)}function _ce(e,t,n){return t=K$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K$e(e){var t=Wen(e,"string");return LN(t)=="symbol"?t:t+""}function Wen(e,t){if(LN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(LN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var t8=function(e){function t(n){var r;return Ben(this,t),r=Uen(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Ven(t,e),$en(t,[{key:"shouldComponentUpdate",value:function(r,s){var a=r.viewBox,o=_Y(r,Men),l=this.props,c=l.viewBox,u=_Y(l,Ren);return!f4(a,c)||!f4(o,u)||!f4(s,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var s=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var s=this.props,a=s.x,o=s.y,l=s.width,c=s.height,u=s.orientation,d=s.tickSize,f=s.mirror,x=s.tickMargin,g,v,w,C,N,I,P=f?-1:1,R=r.tickSize||d,F=es(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":g=v=r.coordinate,C=o+ +!f*c,w=C-P*R,I=w-P*x,N=F;break;case"left":w=C=r.coordinate,v=a+ +!f*l,g=v-P*R,N=g-P*x,I=F;break;case"right":w=C=r.coordinate,v=a+ +f*l,g=v+P*R,N=g+P*x,I=F;break;default:g=v=r.coordinate,C=o+ +f*c,w=C+P*R,I=w+P*x,N=F;break}return{line:{x1:g,y1:w,x2:v,y2:C},tick:{x:N,y:I}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,s=r.orientation,a=r.mirror,o;switch(s){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,s=r.orientation,a=r.mirror,o="end";switch(s){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=Ku(Ku(Ku({},bi(this.props,!1)),bi(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var x=+(c==="top"&&!u||c==="bottom"&&u);f=Ku(Ku({},f),{},{x1:s,y1:a+x*l,x2:s+o,y2:a+x*l})}else{var g=+(c==="left"&&!u||c==="right"&&u);f=Ku(Ku({},f),{},{x1:s+g*o,y1:a,x2:s+g*o,y2:a+l})}return Ne.createElement("line",BC({},f,{className:sa("recharts-cartesian-axis-line",np(d,"className"))}))}},{key:"renderTicks",value:function(r,s,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,x=l.unit,g=Ece(Ku(Ku({},this.props),{},{ticks:r}),s,a),v=this.getTickTextAnchor(),w=this.getTickVerticalAnchor(),C=bi(this.props,!1),N=bi(d,!1),I=Ku(Ku({},C),{},{fill:"none"},bi(c,!1)),P=g.map(function(R,F){var U=o.getTickLineCoord(R),L=U.line,z=U.tick,Q=Ku(Ku(Ku(Ku({textAnchor:v,verticalAnchor:w},C),{},{stroke:"none",fill:u},N),z),{},{index:F,payload:R,visibleTicksCount:g.length,tickFormatter:f});return Ne.createElement(Sa,BC({className:"recharts-cartesian-axis-tick",key:"tick-".concat(R.value,"-").concat(R.coordinate,"-").concat(R.tickCoord)},n_(o.props,R,F)),c&&Ne.createElement("line",BC({},I,L,{className:sa("recharts-cartesian-axis-tick-line",np(c,"className"))})),d&&t.renderTickItem(d,Q,"".concat(Ni(f)?f(R.value,F):R.value).concat(x||"")))});return Ne.createElement("g",{className:"recharts-cartesian-axis-ticks"},P)}},{key:"render",value:function(){var r=this,s=this.props,a=s.axisLine,o=s.width,l=s.height,c=s.ticksGenerator,u=s.className,d=s.hide;if(d)return null;var f=this.props,x=f.ticks,g=_Y(f,Len),v=x;return Ni(c)&&(v=x&&x.length>0?c(this.props):c(g)),o<=0||l<=0||!v||!v.length?null:Ne.createElement(Sa,{className:sa("recharts-cartesian-axis",u),ref:function(C){r.layerReference=C}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),ju.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,a){var o;return Ne.isValidElement(r)?o=Ne.cloneElement(r,s):Ni(r)?o=r(s):o=Ne.createElement(tL,BC({},s,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(m.Component);_ce(t8,"displayName","CartesianAxis");_ce(t8,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var qen=["x1","y1","x2","y2","key"],Gen=["offset"];function X3(e){"@babel/helpers - typeof";return X3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X3(e)}function _6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Eu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_6e(Object(n),!0).forEach(function(r){Ken(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ken(e,t,n){return t=Yen(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yen(e){var t=Xen(e,"string");return X3(t)=="symbol"?t:t+""}function Xen(e,t){if(X3(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(X3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iw(){return iw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iw.apply(this,arguments)}function k6e(e,t){if(e==null)return{};var n=Qen(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qen(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Zen=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,s=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return Ne.createElement("rect",{x:s,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Y$e(e,t){var n;if(Ne.isValidElement(e))n=Ne.cloneElement(e,t);else if(Ni(e))n=e(t);else{var r=t.x1,s=t.y1,a=t.x2,o=t.y2,l=t.key,c=k6e(t,qen),u=bi(c,!1);u.offset;var d=k6e(u,Gen);n=Ne.createElement("line",iw({},d,{x1:r,y1:s,x2:a,y2:o,fill:"none",key:l}))}return n}function Jen(e){var t=e.x,n=e.width,r=e.horizontal,s=r===void 0?!0:r,a=e.horizontalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Eu(Eu({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return Y$e(s,u)});return Ne.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function etn(e){var t=e.y,n=e.height,r=e.vertical,s=r===void 0?!0:r,a=e.verticalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Eu(Eu({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return Y$e(s,u)});return Ne.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function ttn(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,s=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(x){return Math.round(x+s-s)}).sort(function(x,g){return x-g});s!==d[0]&&d.unshift(0);var f=d.map(function(x,g){var v=!d[g+1],w=v?s+o-x:d[g+1]-x;if(w<=0)return null;var C=g%t.length;return Ne.createElement("rect",{key:"react-".concat(g),y:x,x:r,height:w,width:a,stroke:"none",fill:t[C],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return Ne.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function ntn(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,s=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(x){return Math.round(x+a-a)}).sort(function(x,g){return x-g});a!==d[0]&&d.unshift(0);var f=d.map(function(x,g){var v=!d[g+1],w=v?a+l-x:d[g+1]-x;if(w<=0)return null;var C=g%r.length;return Ne.createElement("rect",{key:"react-".concat(g),x,y:o,width:w,height:c,stroke:"none",fill:r[C],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return Ne.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var rtn=function(t,n){var r=t.xAxis,s=t.width,a=t.height,o=t.offset;return l$e(Ece(Eu(Eu(Eu({},t8.defaultProps),r),{},{ticks:Bg(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.left,o.left+o.width,n)},stn=function(t,n){var r=t.yAxis,s=t.width,a=t.height,o=t.offset;return l$e(Ece(Eu(Eu(Eu({},t8.defaultProps),r),{},{ticks:Bg(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.top,o.top+o.height,n)},tC={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function X$e(e){var t,n,r,s,a,o,l=Sce(),c=Nce(),u=WJt(),d=Eu(Eu({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:tC.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:tC.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:tC.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:tC.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:tC.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:tC.verticalFill,x:es(e.x)?e.x:u.left,y:es(e.y)?e.y:u.top,width:es(e.width)?e.width:u.width,height:es(e.height)?e.height:u.height}),f=d.x,x=d.y,g=d.width,v=d.height,w=d.syncWithTicks,C=d.horizontalValues,N=d.verticalValues,I=zJt(),P=HJt();if(!es(g)||g<=0||!es(v)||v<=0||!es(f)||f!==+f||!es(x)||x!==+x)return null;var R=d.verticalCoordinatesGenerator||rtn,F=d.horizontalCoordinatesGenerator||stn,U=d.horizontalPoints,L=d.verticalPoints;if((!U||!U.length)&&Ni(F)){var z=C&&C.length,Q=F({yAxis:P?Eu(Eu({},P),{},{ticks:z?C:P.ticks}):void 0,width:l,height:c,offset:u},z?!0:w);Xg(Array.isArray(Q),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(X3(Q),"]")),Array.isArray(Q)&&(U=Q)}if((!L||!L.length)&&Ni(R)){var ne=N&&N.length,J=R({xAxis:I?Eu(Eu({},I),{},{ticks:ne?N:I.ticks}):void 0,width:l,height:c,offset:u},ne?!0:w);Xg(Array.isArray(J),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(X3(J),"]")),Array.isArray(J)&&(L=J)}return Ne.createElement("g",{className:"recharts-cartesian-grid"},Ne.createElement(Zen,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),Ne.createElement(Jen,iw({},d,{offset:u,horizontalPoints:U,xAxis:I,yAxis:P})),Ne.createElement(etn,iw({},d,{offset:u,verticalPoints:L,xAxis:I,yAxis:P})),Ne.createElement(ttn,iw({},d,{horizontalPoints:U})),Ne.createElement(ntn,iw({},d,{verticalPoints:L})))}X$e.displayName="CartesianGrid";var itn=["type","layout","connectNulls","ref"],atn=["key"];function DN(e){"@babel/helpers - typeof";return DN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},DN(e)}function T6e(e,t){if(e==null)return{};var n=otn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function otn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function o9(){return o9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o9.apply(this,arguments)}function I6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I6e(Object(n),!0).forEach(function(r){Qp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nC(e){return dtn(e)||utn(e)||ctn(e)||ltn()}function ltn(){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 ctn(e,t){if(e){if(typeof e=="string")return dne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dne(e,t)}}function utn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dtn(e){if(Array.isArray(e))return dne(e)}function dne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ftn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z$e(r.key),r)}}function htn(e,t,n){return P6e(e.prototype,t),P6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ptn(e,t,n){return t=OL(t),mtn(e,Q$e()?Reflect.construct(t,n,OL(e).constructor):t.apply(e,n))}function mtn(e,t){if(t&&(DN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xtn(e)}function xtn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q$e=function(){return!!e})()}function OL(e){return OL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},OL(e)}function gtn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fne(e,t)}function fne(e,t){return fne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},fne(e,t)}function Qp(e,t,n){return t=Z$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z$e(e){var t=btn(e,"string");return DN(t)=="symbol"?t:t+""}function btn(e,t){if(DN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(DN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T0=function(e){function t(){var n;ftn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=ptn(this,t,[].concat(s)),Qp(n,"state",{isAnimationFinished:!0,totalLength:0}),Qp(n,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Qp(n,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(N,I){return N+I});if(!u)return n.generateSimpleStrokeDasharray(l,o);for(var d=Math.floor(o/u),f=o%u,x=l-o,g=[],v=0,w=0;v<c.length;w+=c[v],++v)if(w+c[v]>f){g=[].concat(nC(c.slice(0,v)),[f-w]);break}var C=g.length%2===0?[0,x]:[x];return[].concat(nC(t.repeat(c,d)),nC(g),C).map(function(N){return"".concat(N,"px")}).join(", ")}),Qp(n,"id",C5("recharts-line-")),Qp(n,"pathRef",function(o){n.mainCurve=o}),Qp(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Qp(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return gtn(t,e),htn(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=sf(d,JA);if(!f)return null;var x=function(w,C){return{x:w.x,y:w.y,value:w.value,errorVal:sc(w.payload,C)}},g={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Ne.createElement(Sa,g,f.map(function(v){return Ne.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:x})}))}},{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=bi(this.props,!1),x=bi(c,!0),g=u.map(function(w,C){var N=Ef(Ef(Ef({key:"dot-".concat(C),r:3},f),x),{},{index:C,cx:w.x,cy:w.y,value:w.value,dataKey:d,payload:w.payload,points:u});return t.renderDotItem(c,N)}),v={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return Ne.createElement(Sa,o9({className:"recharts-line-dots",key:"dots"},v),g)}},{key:"renderCurveStatically",value:function(r,s,a,o){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=T6e(l,itn),x=Ef(Ef(Ef({},bi(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(a,")"):null,points:r},o),{},{type:c,layout:u,connectNulls:d});return Ne.createElement(o3,o9({},x,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,x=o.animationEasing,g=o.animationId,v=o.animateNewValues,w=o.width,C=o.height,N=this.state,I=N.prevPoints,P=N.totalLength;return Ne.createElement(wm,{begin:d,duration:f,isActive:u,easing:x,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(R){var F=R.t;if(I){var U=I.length/l.length,L=l.map(function(X,re){var pe=Math.floor(re*U);if(I[pe]){var Y=I[pe],ie=wl(Y.x,X.x),oe=wl(Y.y,X.y);return Ef(Ef({},X),{},{x:ie(F),y:oe(F)})}if(v){var G=wl(w*2,X.x),V=wl(C/2,X.y);return Ef(Ef({},X),{},{x:G(F),y:V(F)})}return Ef(Ef({},X),{},{x:X.x,y:X.y})});return a.renderCurveStatically(L,r,s)}var z=wl(0,P),Q=z(F),ne;if(c){var J="".concat(c).split(/[,\s]+/gim).map(function(X){return parseFloat(X)});ne=a.getStrokeDasharray(Q,P,J)}else ne=a.generateSimpleStrokeDasharray(P,Q);return a.renderCurveStatically(l,r,s,{strokeDasharray:ne})})}},{key:"renderCurve",value:function(r,s){var a=this.props,o=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&o&&o.length&&(!u&&d>0||!G3(u,o))?this.renderCurveWithAnimation(r,s):this.renderCurveStatically(o,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.xAxis,d=s.yAxis,f=s.top,x=s.left,g=s.width,v=s.height,w=s.isAnimationActive,C=s.id;if(a||!l||!l.length)return null;var N=this.state.isAnimationFinished,I=l.length===1,P=sa("recharts-line",c),R=u&&u.allowDataOverflow,F=d&&d.allowDataOverflow,U=R||F,L=yi(C)?this.id:C,z=(r=bi(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},Q=z.r,ne=Q===void 0?3:Q,J=z.strokeWidth,X=J===void 0?2:J,re=cDe(o)?o:{},pe=re.clipDot,Y=pe===void 0?!0:pe,ie=ne*2+X;return Ne.createElement(Sa,{className:P},R||F?Ne.createElement("defs",null,Ne.createElement("clipPath",{id:"clipPath-".concat(L)},Ne.createElement("rect",{x:R?x:x-g/2,y:F?f:f-v/2,width:R?g:g*2,height:F?v:v*2})),!Y&&Ne.createElement("clipPath",{id:"clipPath-dots-".concat(L)},Ne.createElement("rect",{x:x-ie/2,y:f-ie/2,width:g+ie,height:v+ie}))):null,!I&&this.renderCurve(U,L),this.renderErrorBar(U,L),(I||o)&&this.renderDots(U,Y,L),(!w||N)&&z0.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,s){for(var a=r.length%2!==0?[].concat(nC(r),[0]):r,o=[],l=0;l<s;++l)o=[].concat(nC(o),nC(a));return o}},{key:"renderDotItem",value:function(r,s){var a;if(Ne.isValidElement(r))a=Ne.cloneElement(r,s);else if(Ni(r))a=r(s);else{var o=s.key,l=T6e(s,atn),c=sa("recharts-line-dot",typeof r!="boolean"?r.className:"");a=Ne.createElement(Z$,o9({key:o},l,{className:c}))}return a}}])}(m.PureComponent);Qp(T0,"displayName","Line");Qp(T0,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!hm.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Qp(T0,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,s=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(x,g){var v=sc(x,o);return d==="horizontal"?{x:kN({axis:n,ticks:s,bandSize:l,entry:x,index:g}),y:yi(v)?null:r.scale(v),value:v,payload:x}:{x:yi(v)?null:n.scale(v),y:kN({axis:r,ticks:a,bandSize:l,entry:x,index:g}),value:v,payload:x}});return Ef({points:f,layout:d},u)});var ytn=["layout","type","stroke","connectNulls","isRange","ref"],vtn=["key"],J$e;function BN(e){"@babel/helpers - typeof";return BN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},BN(e)}function eUe(e,t){if(e==null)return{};var n=wtn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wtn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function aw(){return aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aw.apply(this,arguments)}function F6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ab(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F6e(Object(n),!0).forEach(function(r){I0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ctn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nUe(r.key),r)}}function Stn(e,t,n){return O6e(e.prototype,t),O6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ntn(e,t,n){return t=ML(t),Atn(e,tUe()?Reflect.construct(t,n,ML(e).constructor):t.apply(e,n))}function Atn(e,t){if(t&&(BN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jtn(e)}function jtn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tUe=function(){return!!e})()}function ML(e){return ML=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ML(e)}function Etn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hne(e,t)}function hne(e,t){return hne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},hne(e,t)}function I0(e,t,n){return t=nUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nUe(e){var t=_tn(e,"string");return BN(t)=="symbol"?t:t+""}function _tn(e,t){if(BN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(BN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var j5=function(e){function t(){var n;Ctn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=Ntn(this,t,[].concat(s)),I0(n,"state",{isAnimationFinished:!0}),I0(n,"id",C5("recharts-area-")),I0(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Ni(o)&&o()}),I0(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Ni(o)&&o()}),n}return Etn(t,e),Stn(t,[{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,x=bi(this.props,!1),g=bi(u,!0),v=d.map(function(C,N){var I=Ab(Ab(Ab({key:"dot-".concat(N),r:3},x),g),{},{index:N,cx:C.x,cy:C.y,dataKey:f,value:C.value,payload:C.payload,points:d});return t.renderDotItem(u,I)}),w={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return Ne.createElement(Sa,aw({className:"recharts-area-dots"},w),v)}},{key:"renderHorizontalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=r*Math.abs(c-u),f=gy(o.map(function(x){return x.y||0}));return es(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(gy(a.map(function(x){return x.y||0})),f)),es(f)?Ne.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=r*Math.abs(c-u),f=gy(o.map(function(x){return x.x||0}));return es(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(gy(a.map(function(x){return x.x||0})),f)),es(f)?Ne.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(r){var s=this.props.layout;return s==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,s,a,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,x=l.isRange;l.ref;var g=eUe(l,ytn);return Ne.createElement(Sa,{clipPath:a?"url(#clipPath-".concat(o,")"):null},Ne.createElement(o3,aw({},bi(g,!0),{points:r,connectNulls:f,type:u,baseLine:s,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&Ne.createElement(o3,aw({},bi(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:r})),d!=="none"&&x&&Ne.createElement(o3,aw({},bi(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:s})))}},{key:"renderAreaWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,x=o.animationEasing,g=o.animationId,v=this.state,w=v.prevPoints,C=v.prevBaseLine;return Ne.createElement(wm,{begin:d,duration:f,isActive:u,easing:x,from:{t:0},to:{t:1},key:"area-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var I=N.t;if(w){var P=w.length/l.length,R=l.map(function(z,Q){var ne=Math.floor(Q*P);if(w[ne]){var J=w[ne],X=wl(J.x,z.x),re=wl(J.y,z.y);return Ab(Ab({},z),{},{x:X(I),y:re(I)})}return z}),F;if(es(c)&&typeof c=="number"){var U=wl(C,c);F=U(I)}else if(yi(c)||KA(c)){var L=wl(C,0);F=L(I)}else F=c.map(function(z,Q){var ne=Math.floor(Q*P);if(C[ne]){var J=C[ne],X=wl(J.x,z.x),re=wl(J.y,z.y);return Ab(Ab({},z),{},{x:X(I),y:re(I)})}return z});return a.renderAreaStatically(R,F,r,s)}return Ne.createElement(Sa,null,Ne.createElement("defs",null,Ne.createElement("clipPath",{id:"animationClipPath-".concat(s)},a.renderClipRect(I))),Ne.createElement(Sa,{clipPath:"url(#animationClipPath-".concat(s,")")},a.renderAreaStatically(l,c,r,s)))})}},{key:"renderArea",value:function(r,s){var a=this.props,o=a.points,l=a.baseLine,c=a.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,x=u.totalLength;return c&&o&&o.length&&(!d&&x>0||!G3(d,o)||!G3(f,l))?this.renderAreaWithAnimation(r,s):this.renderAreaStatically(o,l,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.top,d=s.left,f=s.xAxis,x=s.yAxis,g=s.width,v=s.height,w=s.isAnimationActive,C=s.id;if(a||!l||!l.length)return null;var N=this.state.isAnimationFinished,I=l.length===1,P=sa("recharts-area",c),R=f&&f.allowDataOverflow,F=x&&x.allowDataOverflow,U=R||F,L=yi(C)?this.id:C,z=(r=bi(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},Q=z.r,ne=Q===void 0?3:Q,J=z.strokeWidth,X=J===void 0?2:J,re=cDe(o)?o:{},pe=re.clipDot,Y=pe===void 0?!0:pe,ie=ne*2+X;return Ne.createElement(Sa,{className:P},R||F?Ne.createElement("defs",null,Ne.createElement("clipPath",{id:"clipPath-".concat(L)},Ne.createElement("rect",{x:R?d:d-g/2,y:F?u:u-v/2,width:R?g:g*2,height:F?v:v*2})),!Y&&Ne.createElement("clipPath",{id:"clipPath-dots-".concat(L)},Ne.createElement("rect",{x:d-ie/2,y:u-ie/2,width:g+ie,height:v+ie}))):null,I?null:this.renderArea(U,L),(o||I)&&this.renderDots(U,Y,L),(!w||N)&&z0.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:r.points!==s.curPoints||r.baseLine!==s.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(m.PureComponent);J$e=j5;I0(j5,"displayName","Area");I0(j5,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!hm.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});I0(j5,"getBaseValue",function(e,t,n,r){var s=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(es(l)&&typeof l=="number")return l;var c=s==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});I0(j5,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,s=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,x=e.offset,g=t.layout,v=u&&u.length,w=J$e.getBaseValue(t,n,r,s),C=g==="horizontal",N=!1,I=f.map(function(R,F){var U;v?U=u[d+F]:(U=sc(R,c),Array.isArray(U)?N=!0:U=[w,U]);var L=U[1]==null||v&&sc(R,c)==null;return C?{x:kN({axis:r,ticks:a,bandSize:l,entry:R,index:F}),y:L?null:s.scale(U[1]),value:U,payload:R}:{x:L?null:r.scale(U[1]),y:kN({axis:s,ticks:o,bandSize:l,entry:R,index:F}),value:U,payload:R}}),P;return v||N?P=I.map(function(R){var F=Array.isArray(R.value)?R.value[0]:null;return C?{x:R.x,y:F!=null&&R.y!=null?s.scale(F):null}:{x:F!=null?r.scale(F):null,y:R.y}}):P=C?s.scale(w):r.scale(w),Ab({points:I,baseLine:P,layout:g,isRange:N},x)});I0(j5,"renderDotItem",function(e,t){var n;if(Ne.isValidElement(e))n=Ne.cloneElement(e,t);else if(Ni(e))n=e(t);else{var r=sa("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,a=eUe(t,vtn);n=Ne.createElement(Z$,aw({},a,{key:s,className:r}))}return n});function $N(e){"@babel/helpers - typeof";return $N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$N(e)}function ktn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ttn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iUe(r.key),r)}}function Itn(e,t,n){return Ttn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ptn(e,t,n){return t=RL(t),Ftn(e,rUe()?Reflect.construct(t,n||[],RL(e).constructor):t.apply(e,n))}function Ftn(e,t){if(t&&($N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Otn(e)}function Otn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rUe=function(){return!!e})()}function RL(e){return RL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},RL(e)}function Mtn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pne(e,t)}function pne(e,t){return pne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},pne(e,t)}function sUe(e,t,n){return t=iUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iUe(e){var t=Rtn(e,"string");return $N(t)=="symbol"?t:t+""}function Rtn(e,t){if($N(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($N(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aU=function(e){function t(){return ktn(this,t),Ptn(this,t,arguments)}return Mtn(t,e),Itn(t,[{key:"render",value:function(){return null}}])}(Ne.Component);sUe(aU,"displayName","ZAxis");sUe(aU,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var Ltn=["option","isActive"];function l9(){return l9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l9.apply(this,arguments)}function Dtn(e,t){if(e==null)return{};var n=Btn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Btn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $tn(e){var t=e.option,n=e.isActive,r=Dtn(e,Ltn);return typeof t=="string"?Ne.createElement(ene,l9({option:Ne.createElement(B$,l9({type:t},r)),isActive:n,shapeType:"symbols"},r)):Ne.createElement(ene,l9({option:t,isActive:n,shapeType:"symbols"},r))}function UN(e){"@babel/helpers - typeof";return UN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},UN(e)}function c9(){return c9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c9.apply(this,arguments)}function M6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Oh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M6e(Object(n),!0).forEach(function(r){yy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Utn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oUe(r.key),r)}}function ztn(e,t,n){return R6e(e.prototype,t),R6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Htn(e,t,n){return t=LL(t),Vtn(e,aUe()?Reflect.construct(t,n,LL(e).constructor):t.apply(e,n))}function Vtn(e,t){if(t&&(UN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wtn(e)}function Wtn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aUe=function(){return!!e})()}function LL(e){return LL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},LL(e)}function qtn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mne(e,t)}function mne(e,t){return mne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},mne(e,t)}function yy(e,t,n){return t=oUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oUe(e){var t=Gtn(e,"string");return UN(t)=="symbol"?t:t+""}function Gtn(e,t){if(UN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(UN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oU=function(e){function t(){var n;Utn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=Htn(this,t,[].concat(s)),yy(n,"state",{isAnimationFinished:!1}),yy(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0})}),yy(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1})}),yy(n,"id",C5("recharts-scatter-")),n}return qtn(t,e),ztn(t,[{key:"renderSymbolsStatically",value:function(r){var s=this,a=this.props,o=a.shape,l=a.activeShape,c=a.activeIndex,u=bi(this.props,!1);return r.map(function(d,f){var x=c===f,g=x?l:o,v=Oh(Oh({},u),d);return Ne.createElement(Sa,c9({className:"recharts-scatter-symbol",key:"symbol-".concat(d==null?void 0:d.cx,"-").concat(d==null?void 0:d.cy,"-").concat(d==null?void 0:d.size,"-").concat(f)},n_(s.props,d,f),{role:"img"}),Ne.createElement($tn,c9({option:g,isActive:x,key:"symbol-".concat(f)},v)))})}},{key:"renderSymbolsWithAnimation",value:function(){var r=this,s=this.props,a=s.points,o=s.isAnimationActive,l=s.animationBegin,c=s.animationDuration,u=s.animationEasing,d=s.animationId,f=this.state.prevPoints;return Ne.createElement(wm,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var g=x.t,v=a.map(function(w,C){var N=f&&f[C];if(N){var I=wl(N.cx,w.cx),P=wl(N.cy,w.cy),R=wl(N.size,w.size);return Oh(Oh({},w),{},{cx:I(g),cy:P(g),size:R(g)})}var F=wl(0,w.size);return Oh(Oh({},w),{},{size:F(g)})});return Ne.createElement(Sa,null,r.renderSymbolsStatically(v))})}},{key:"renderSymbols",value:function(){var r=this.props,s=r.points,a=r.isAnimationActive,o=this.state.prevPoints;return a&&s&&s.length&&(!o||!G3(o,s))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(s)}},{key:"renderErrorBar",value:function(){var r=this.props.isAnimationActive;if(r&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.points,o=s.xAxis,l=s.yAxis,c=s.children,u=sf(c,JA);return u?u.map(function(d,f){var x=d.props,g=x.direction,v=x.dataKey;return Ne.cloneElement(d,{key:"".concat(g,"-").concat(v,"-").concat(a[f]),data:a,xAxis:o,yAxis:l,layout:g==="x"?"vertical":"horizontal",dataPointFormatter:function(C,N){return{x:C.cx,y:C.cy,value:g==="x"?+C.node.x:+C.node.y,errorVal:sc(C,N)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,s=r.points,a=r.line,o=r.lineType,l=r.lineJointType,c=bi(this.props,!1),u=bi(a,!1),d,f;if(o==="joint")d=s.map(function(P){return{x:P.cx,y:P.cy}});else if(o==="fitting"){var x=F$t(s),g=x.xmin,v=x.xmax,w=x.a,C=x.b,N=function(R){return w*R+C};d=[{x:g,y:N(g)},{x:v,y:N(v)}]}var I=Oh(Oh(Oh({},c),{},{fill:"none",stroke:c&&c.fill},u),{},{points:d});return Ne.isValidElement(a)?f=Ne.cloneElement(a,I):Ni(a)?f=a(I):f=Ne.createElement(o3,c9({},I,{type:l})),Ne.createElement(Sa,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var r=this.props,s=r.hide,a=r.points,o=r.line,l=r.className,c=r.xAxis,u=r.yAxis,d=r.left,f=r.top,x=r.width,g=r.height,v=r.id,w=r.isAnimationActive;if(s||!a||!a.length)return null;var C=this.state.isAnimationFinished,N=sa("recharts-scatter",l),I=c&&c.allowDataOverflow,P=u&&u.allowDataOverflow,R=I||P,F=yi(v)?this.id:v;return Ne.createElement(Sa,{className:N,clipPath:R?"url(#clipPath-".concat(F,")"):null},I||P?Ne.createElement("defs",null,Ne.createElement("clipPath",{id:"clipPath-".concat(F)},Ne.createElement("rect",{x:I?d:d-x/2,y:P?f:f-g/2,width:I?x:x*2,height:P?g:g*2}))):null,o&&this.renderLine(),this.renderErrorBar(),Ne.createElement(Sa,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!w||C)&&z0.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}}])}(m.PureComponent);yy(oU,"displayName","Scatter");yy(oU,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!hm.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});yy(oU,"getComposedData",function(e){var t=e.xAxis,n=e.yAxis,r=e.zAxis,s=e.item,a=e.displayedData,o=e.xAxisTicks,l=e.yAxisTicks,c=e.offset,u=s.props.tooltipType,d=sf(s.props.children,Gle),f=yi(t.dataKey)?s.props.dataKey:t.dataKey,x=yi(n.dataKey)?s.props.dataKey:n.dataKey,g=r&&r.dataKey,v=r?r.range:aU.defaultProps.range,w=v&&v[0],C=t.scale.bandwidth?t.scale.bandwidth():0,N=n.scale.bandwidth?n.scale.bandwidth():0,I=a.map(function(P,R){var F=sc(P,f),U=sc(P,x),L=!yi(g)&&sc(P,g)||"-",z=[{name:yi(t.dataKey)?s.props.name:t.name||t.dataKey,unit:t.unit||"",value:F,payload:P,dataKey:f,type:u},{name:yi(n.dataKey)?s.props.name:n.name||n.dataKey,unit:n.unit||"",value:U,payload:P,dataKey:x,type:u}];L!=="-"&&z.push({name:r.name||r.dataKey,unit:r.unit||"",value:L,payload:P,dataKey:g,type:u});var Q=kN({axis:t,ticks:o,bandSize:C,entry:P,index:R,dataKey:f}),ne=kN({axis:n,ticks:l,bandSize:N,entry:P,index:R,dataKey:x}),J=L!=="-"?r.scale(L):w,X=Math.sqrt(Math.max(J,0)/Math.PI);return Oh(Oh({},P),{},{cx:Q,cy:ne,x:Q-X,y:ne-X,xAxis:t,yAxis:n,zAxis:r,width:2*X,height:2*X,size:J,node:{x:F,y:U,z:L},tooltipPayload:z,tooltipPosition:{x:Q,y:ne},payload:P},d[R]&&d[R].props)});return Oh({points:I},c)});function zN(e){"@babel/helpers - typeof";return zN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zN(e)}function Ktn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ytn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,uUe(r.key),r)}}function Xtn(e,t,n){return Ytn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qtn(e,t,n){return t=DL(t),Ztn(e,lUe()?Reflect.construct(t,n||[],DL(e).constructor):t.apply(e,n))}function Ztn(e,t){if(t&&(zN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jtn(e)}function Jtn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lUe=function(){return!!e})()}function DL(e){return DL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},DL(e)}function enn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xne(e,t)}function xne(e,t){return xne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},xne(e,t)}function cUe(e,t,n){return t=uUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uUe(e){var t=tnn(e,"string");return zN(t)=="symbol"?t:t+""}function tnn(e,t){if(zN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gne(){return gne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gne.apply(this,arguments)}function nnn(e){var t=e.xAxisId,n=Sce(),r=Nce(),s=D$e(t);return s==null?null:Ne.createElement(t8,gne({},s,{className:sa("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Bg(o,!0)}}))}var n8=function(e){function t(){return Ktn(this,t),Qtn(this,t,arguments)}return enn(t,e),Xtn(t,[{key:"render",value:function(){return Ne.createElement(nnn,this.props)}}])}(Ne.Component);cUe(n8,"displayName","XAxis");cUe(n8,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function HN(e){"@babel/helpers - typeof";return HN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HN(e)}function rnn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function snn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hUe(r.key),r)}}function inn(e,t,n){return snn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ann(e,t,n){return t=BL(t),onn(e,dUe()?Reflect.construct(t,n||[],BL(e).constructor):t.apply(e,n))}function onn(e,t){if(t&&(HN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lnn(e)}function lnn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dUe=function(){return!!e})()}function BL(e){return BL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},BL(e)}function cnn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bne(e,t)}function bne(e,t){return bne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},bne(e,t)}function fUe(e,t,n){return t=hUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hUe(e){var t=unn(e,"string");return HN(t)=="symbol"?t:t+""}function unn(e,t){if(HN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(HN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yne(){return yne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yne.apply(this,arguments)}var dnn=function(t){var n=t.yAxisId,r=Sce(),s=Nce(),a=B$e(n);return a==null?null:Ne.createElement(t8,yne({},a,{className:sa("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(l){return Bg(l,!0)}}))},r8=function(e){function t(){return rnn(this,t),ann(this,t,arguments)}return cnn(t,e),inn(t,[{key:"render",value:function(){return Ne.createElement(dnn,this.props)}}])}(Ne.Component);fUe(r8,"displayName","YAxis");fUe(r8,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function L6e(e){return mnn(e)||pnn(e)||hnn(e)||fnn()}function fnn(){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 hnn(e,t){if(e){if(typeof e=="string")return vne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vne(e,t)}}function pnn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mnn(e){if(Array.isArray(e))return vne(e)}function vne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var wne=function(t,n,r,s,a){var o=sf(t,jce),l=sf(t,rU),c=[].concat(L6e(o),L6e(l)),u=sf(t,iU),d="".concat(s,"Id"),f=s[0],x=n;if(c.length&&(x=c.reduce(function(w,C){if(C.props[d]===r&&H0(C.props,"extendDomain")&&es(C.props[f])){var N=C.props[f];return[Math.min(w[0],N),Math.max(w[1],N)]}return w},x)),u.length){var g="".concat(f,"1"),v="".concat(f,"2");x=u.reduce(function(w,C){if(C.props[d]===r&&H0(C.props,"extendDomain")&&es(C.props[g])&&es(C.props[v])){var N=C.props[g],I=C.props[v];return[Math.min(w[0],N,I),Math.max(w[1],N,I)]}return w},x)}return a&&a.length&&(x=a.reduce(function(w,C){return es(C)?[Math.min(w[0],C),Math.max(w[1],C)]:w},x)),x},kY={exports:{}},D6e;function xnn(){return D6e||(D6e=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,x){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new s(d,f||c,x),v=n?n+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],g]:c._events[v].push(g):(c._events[v]=g,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var x=0,g=f.length,v=new Array(g);x<g;x++)v[x]=f[x].fn;return v},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,x,g,v){var w=n?n+u:u;if(!this._events[w])return!1;var C=this._events[w],N=arguments.length,I,P;if(C.fn){switch(C.once&&this.removeListener(u,C.fn,void 0,!0),N){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,d),!0;case 3:return C.fn.call(C.context,d,f),!0;case 4:return C.fn.call(C.context,d,f,x),!0;case 5:return C.fn.call(C.context,d,f,x,g),!0;case 6:return C.fn.call(C.context,d,f,x,g,v),!0}for(P=1,I=new Array(N-1);P<N;P++)I[P-1]=arguments[P];C.fn.apply(C.context,I)}else{var R=C.length,F;for(P=0;P<R;P++)switch(C[P].once&&this.removeListener(u,C[P].fn,void 0,!0),N){case 1:C[P].fn.call(C[P].context);break;case 2:C[P].fn.call(C[P].context,d);break;case 3:C[P].fn.call(C[P].context,d,f);break;case 4:C[P].fn.call(C[P].context,d,f,x);break;default:if(!I)for(F=1,I=new Array(N-1);F<N;F++)I[F-1]=arguments[F];C[P].fn.apply(C[P].context,I)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,x){var g=n?n+u:u;if(!this._events[g])return this;if(!d)return o(this,g),this;var v=this._events[g];if(v.fn)v.fn===d&&(!x||v.once)&&(!f||v.context===f)&&o(this,g);else{for(var w=0,C=[],N=v.length;w<N;w++)(v[w].fn!==d||x&&!v[w].once||f&&v[w].context!==f)&&C.push(v[w]);C.length?this._events[g]=C.length===1?C[0]:C:o(this,g)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l}(kY)),kY.exports}var gnn=xnn();const bnn=ki(gnn);var TY=new bnn,IY="recharts.syncMouseEvents";function R_(e){"@babel/helpers - typeof";return R_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R_(e)}function ynn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vnn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pUe(r.key),r)}}function wnn(e,t,n){return vnn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function PY(e,t,n){return t=pUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pUe(e){var t=Cnn(e,"string");return R_(t)=="symbol"?t:t+""}function Cnn(e,t){if(R_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(R_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Snn=function(){function e(){ynn(this,e),PY(this,"activeIndex",0),PY(this,"coordinateList",[]),PY(this,"layout","horizontal")}return wnn(e,[{key:"setDetails",value:function(n){var r,s=n.coordinateList,a=s===void 0?null:s,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,x=n.mouseHandlerCallback,g=x===void 0?null:x;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=g??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),a=s.x,o=s.y,l=s.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=a+c+u,x=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:x})}}}])}();function Nnn(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],s=e==null?void 0:e[1];if(r&&s&&es(r)&&es(s))return!0}return!1}function Ann(e,t,n,r){var s=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-s,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function mUe(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,a=e.endAngle,o=tu(t,n,r,s),l=tu(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:s,endAngle:a}}function jnn(e,t,n){var r,s,a,o;if(e==="horizontal")r=t.x,a=r,s=n.top,o=n.top+n.height;else if(e==="vertical")s=t.y,o=s,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,x=tu(l,c,u,f),g=tu(l,c,d,f);r=x.x,s=x.y,a=g.x,o=g.y}else return mUe(t);return[{x:r,y:s},{x:a,y:o}]}function L_(e){"@babel/helpers - typeof";return L_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L_(e)}function B6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function OP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B6e(Object(n),!0).forEach(function(r){Enn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Enn(e,t,n){return t=_nn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _nn(e){var t=knn(e,"string");return L_(t)=="symbol"?t:t+""}function knn(e,t){if(L_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(L_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tnn(e){var t,n,r=e.element,s=e.tooltipEventType,a=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,x=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!a||!o||x!=="ScatterChart"&&s!=="axis")return null;var v,w=o3;if(x==="ScatterChart")v=o,w=eZt;else if(x==="BarChart")v=Ann(f,o,c,d),w=yce;else if(f==="radial"){var C=mUe(o),N=C.cx,I=C.cy,P=C.radius,R=C.startAngle,F=C.endAngle;v={cx:N,cy:I,startAngle:R,endAngle:F,innerRadius:P,outerRadius:P},w=h$e}else v={points:jnn(f,o,c)},w=o3;var U=OP(OP(OP(OP({stroke:"#ccc",pointerEvents:"none"},c),v),bi(g,!1)),{},{payload:l,payloadIndex:u,className:sa("recharts-tooltip-cursor",g.className)});return m.isValidElement(g)?m.cloneElement(g,U):m.createElement(w,U)}var Inn=["item"],Pnn=["children","className","width","height","style","compact","title","desc"];function VN(e){"@babel/helpers - typeof";return VN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},VN(e)}function $C(){return $C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$C.apply(this,arguments)}function $6e(e,t){return Mnn(e)||Onn(e,t)||gUe(e,t)||Fnn()}function Fnn(){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 Onn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function Mnn(e){if(Array.isArray(e))return e}function U6e(e,t){if(e==null)return{};var n=Rnn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rnn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Lnn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dnn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bUe(r.key),r)}}function Bnn(e,t,n){return Dnn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $nn(e,t,n){return t=$L(t),Unn(e,xUe()?Reflect.construct(t,n,$L(e).constructor):t.apply(e,n))}function Unn(e,t){if(t&&(VN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return znn(e)}function znn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xUe=function(){return!!e})()}function $L(e){return $L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$L(e)}function Hnn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cne(e,t)}function Cne(e,t){return Cne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Cne(e,t)}function WN(e){return qnn(e)||Wnn(e)||gUe(e)||Vnn()}function Vnn(){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 gUe(e,t){if(e){if(typeof e=="string")return Sne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sne(e,t)}}function Wnn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qnn(e){if(Array.isArray(e))return Sne(e)}function Sne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function z6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function yr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z6e(Object(n),!0).forEach(function(r){Qs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qs(e,t,n){return t=bUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bUe(e){var t=Gnn(e,"string");return VN(t)=="symbol"?t:t+""}function Gnn(e,t){if(VN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(VN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Knn={xAxis:["bottom","top"],yAxis:["left","right"]},Ynn={width:"100%",height:"100%"},yUe={x:0,y:0};function MP(e){return e}var Xnn=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Qnn=function(t,n,r,s){var a=n.find(function(d){return d&&d.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,l=s.radius;return yr(yr(yr({},s),tu(s.cx,s.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=s.angle;return yr(yr(yr({},s),tu(s.cx,s.cy,c,u)),{},{angle:u,radius:c})}return yUe},lU=function(t,n){var r=n.graphicalItems,s=n.dataStartIndex,a=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(WN(l),WN(u)):l},[]);return o.length>0?o:t&&t.length&&es(s)&&es(a)?t.slice(s,a+1):[]};function vUe(e){return e==="number"?[0,"auto"]:void 0}var Nne=function(t,n,r,s){var a=t.graphicalItems,o=t.tooltipAxis,l=lU(n,t);return r<0||!a||!a.length||r>=l.length?null:a.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var x;if(o.dataKey&&!o.allowDuplicatedCategory){var g=f===void 0?l:f;x=HR(g,o.dataKey,s)}else x=f&&f[r]||l[r];return x?[].concat(WN(c),[u$e(u,x)]):c},[])},H6e=function(t,n,r,s){var a=s||{x:t.chartX,y:t.chartY},o=Xnn(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=$Kt(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,x=Nne(t,n,d,f),g=Qnn(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:x,activeCoordinate:g}}return null},Znn=function(t,n){var r=n.axes,s=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,x=t.stackOffset,g=o$e(d,a);return r.reduce(function(v,w){var C,N=w.type.defaultProps!==void 0?yr(yr({},w.type.defaultProps),w.props):w.props,I=N.type,P=N.dataKey,R=N.allowDataOverflow,F=N.allowDuplicatedCategory,U=N.scale,L=N.ticks,z=N.includeHidden,Q=N[o];if(v[Q])return v;var ne=lU(t.data,{graphicalItems:s.filter(function(he){var Ce,ce=o in he.props?he.props[o]:(Ce=he.type.defaultProps)===null||Ce===void 0?void 0:Ce[o];return ce===Q}),dataStartIndex:c,dataEndIndex:u}),J=ne.length,X,re,pe;Nnn(N.domain,R,I)&&(X=Dte(N.domain,null,R),g&&(I==="number"||U!=="auto")&&(pe=i9(ne,P,"category")));var Y=vUe(I);if(!X||X.length===0){var ie,oe=(ie=N.domain)!==null&&ie!==void 0?ie:Y;if(P){if(X=i9(ne,P,I),I==="category"&&g){var G=P$t(X);F&&G?(re=X,X=NL(0,J)):F||(X=J3e(oe,X,w).reduce(function(he,Ce){return he.indexOf(Ce)>=0?he:[].concat(WN(he),[Ce])},[]))}else if(I==="category")F?X=X.filter(function(he){return he!==""&&!yi(he)}):X=J3e(oe,X,w).reduce(function(he,Ce){return he.indexOf(Ce)>=0||Ce===""||yi(Ce)?he:[].concat(WN(he),[Ce])},[]);else if(I==="number"){var V=WKt(ne,s.filter(function(he){var Ce,ce,ge=o in he.props?he.props[o]:(Ce=he.type.defaultProps)===null||Ce===void 0?void 0:Ce[o],Ae="hide"in he.props?he.props.hide:(ce=he.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return ge===Q&&(z||!Ae)}),P,a,d);V&&(X=V)}g&&(I==="number"||U!=="auto")&&(pe=i9(ne,P,"category"))}else g?X=NL(0,J):l&&l[Q]&&l[Q].hasStack&&I==="number"?X=x==="expand"?[0,1]:c$e(l[Q].stackGroups,c,u):X=a$e(ne,s.filter(function(he){var Ce=o in he.props?he.props[o]:he.type.defaultProps[o],ce="hide"in he.props?he.props.hide:he.type.defaultProps.hide;return Ce===Q&&(z||!ce)}),I,d,!0);if(I==="number")X=wne(f,X,Q,a,L),oe&&(X=Dte(oe,X,R));else if(I==="category"&&oe){var te=oe,ae=X.every(function(he){return te.indexOf(he)>=0});ae&&(X=te)}}return yr(yr({},v),{},Qs({},Q,yr(yr({},N),{},{axisType:a,domain:X,categoricalDomain:pe,duplicateDomain:re,originalDomain:(C=N.domain)!==null&&C!==void 0?C:Y,isCategorical:g,layout:d})))},{})},Jnn=function(t,n){var r=n.graphicalItems,s=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,x=lU(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),g=x.length,v=o$e(d,a),w=-1;return r.reduce(function(C,N){var I=N.type.defaultProps!==void 0?yr(yr({},N.type.defaultProps),N.props):N.props,P=I[o],R=vUe("number");if(!C[P]){w++;var F;return v?F=NL(0,g):l&&l[P]&&l[P].hasStack?(F=c$e(l[P].stackGroups,c,u),F=wne(f,F,P,a)):(F=Dte(R,a$e(x,r.filter(function(U){var L,z,Q=o in U.props?U.props[o]:(L=U.type.defaultProps)===null||L===void 0?void 0:L[o],ne="hide"in U.props?U.props.hide:(z=U.type.defaultProps)===null||z===void 0?void 0:z.hide;return Q===P&&!ne}),"number",d),s.defaultProps.allowDataOverflow),F=wne(f,F,P,a)),yr(yr({},C),{},Qs({},P,yr(yr({axisType:a},s.defaultProps),{},{hide:!0,orientation:np(Knn,"".concat(a,".").concat(w%2),null),domain:F,originalDomain:R,isCategorical:v,layout:d})))}return C},{})},ern=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(s,"Id"),x=sf(d,a),g={};return x.length?g=Znn(t,{axes:x,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(g=Jnn(t,{Axis:a,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),g},trn=function(t){var n=Ob(t),r=Bg(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Wle(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:mL(n,r)}},V6e=function(t){var n=t.children,r=t.defaultShowTooltip,s=Mf(n,PN),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(a=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},nrn=function(t){return!t||!t.length?!1:t.some(function(n){var r=Yg(n&&n.type);return r&&r.indexOf("Bar")>=0})},W6e=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},rrn=function(t,n){var r=t.props,s=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,x=r.margin||{},g=Mf(f,PN),v=Mf(f,s3),w=Object.keys(c).reduce(function(F,U){var L=c[U],z=L.orientation;return!L.mirror&&!L.hide?yr(yr({},F),{},Qs({},z,F[z]+L.width)):F},{left:x.left||0,right:x.right||0}),C=Object.keys(o).reduce(function(F,U){var L=o[U],z=L.orientation;return!L.mirror&&!L.hide?yr(yr({},F),{},Qs({},z,np(F,"".concat(z))+L.height)):F},{top:x.top||0,bottom:x.bottom||0}),N=yr(yr({},C),w),I=N.bottom;g&&(N.bottom+=g.props.height||PN.defaultProps.height),v&&n&&(N=HKt(N,s,r,n));var P=u-N.left-N.right,R=d-N.top-N.bottom;return yr(yr({brushBottom:I},N),{},{width:Math.max(P,0),height:Math.max(R,0)})},srn=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},wUe=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,a=s===void 0?"axis":s,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,x=function(N,I){var P=I.graphicalItems,R=I.stackGroups,F=I.offset,U=I.updateId,L=I.dataStartIndex,z=I.dataEndIndex,Q=N.barSize,ne=N.layout,J=N.barGap,X=N.barCategoryGap,re=N.maxBarSize,pe=W6e(ne),Y=pe.numericAxisName,ie=pe.cateAxisName,oe=nrn(P),G=[];return P.forEach(function(V,te){var ae=lU(N.data,{graphicalItems:[V],dataStartIndex:L,dataEndIndex:z}),he=V.type.defaultProps!==void 0?yr(yr({},V.type.defaultProps),V.props):V.props,Ce=he.dataKey,ce=he.maxBarSize,ge=he["".concat(Y,"Id")],Ae=he["".concat(ie,"Id")],ye={},je=c.reduce(function(Nt,mn){var dn=I["".concat(mn.axisType,"Map")],Pt=he["".concat(mn.axisType,"Id")];dn&&dn[Pt]||mn.axisType==="zAxis"||Y3();var Xe=dn[Pt];return yr(yr({},Nt),{},Qs(Qs({},mn.axisType,Xe),"".concat(mn.axisType,"Ticks"),Bg(Xe)))},ye),Ie=je[ie],Re=je["".concat(ie,"Ticks")],Qe=R&&R[ge]&&R[ge].hasStack&&rYt(V,R[ge].stackGroups),$e=Yg(V.type).indexOf("Bar")>=0,it=mL(Ie,Re),tt=[],ot=oe&&UKt({barSize:Q,stackGroups:R,totalSize:srn(je,ie)});if($e){var ft,ct,Vt=yi(ce)?re:ce,It=(ft=(ct=mL(Ie,Re,!0))!==null&&ct!==void 0?ct:Vt)!==null&&ft!==void 0?ft:0;tt=zKt({barGap:J,barCategoryGap:X,bandSize:It!==it?It:it,sizeList:ot[Ae],maxBarSize:Vt}),It!==it&&(tt=tt.map(function(Nt){return yr(yr({},Nt),{},{position:yr(yr({},Nt.position),{},{offset:Nt.position.offset-It/2})})}))}var an=V&&V.type&&V.type.getComposedData;an&&G.push({props:yr(yr({},an(yr(yr({},je),{},{displayedData:ae,props:N,dataKey:Ce,item:V,bandSize:it,barPosition:tt,offset:F,stackedData:Qe,layout:ne,dataStartIndex:L,dataEndIndex:z}))),{},Qs(Qs(Qs({key:V.key||"item-".concat(te)},Y,je[Y]),ie,je[ie]),"animationId",U)),childIndex:W$t(V,N.children),item:V})}),G},g=function(N,I){var P=N.props,R=N.dataStartIndex,F=N.dataEndIndex,U=N.updateId;if(!p2e({props:P}))return null;var L=P.children,z=P.layout,Q=P.stackOffset,ne=P.data,J=P.reverseStackOrder,X=W6e(z),re=X.numericAxisName,pe=X.cateAxisName,Y=sf(L,r),ie=eYt(ne,Y,"".concat(re,"Id"),"".concat(pe,"Id"),Q,J),oe=c.reduce(function(he,Ce){var ce="".concat(Ce.axisType,"Map");return yr(yr({},he),{},Qs({},ce,ern(P,yr(yr({},Ce),{},{graphicalItems:Y,stackGroups:Ce.axisType===re&&ie,dataStartIndex:R,dataEndIndex:F}))))},{}),G=rrn(yr(yr({},oe),{},{props:P,graphicalItems:Y}),I==null?void 0:I.legendBBox);Object.keys(oe).forEach(function(he){oe[he]=d(P,oe[he],G,he.replace("Map",""),n)});var V=oe["".concat(pe,"Map")],te=trn(V),ae=x(P,yr(yr({},oe),{},{dataStartIndex:R,dataEndIndex:F,updateId:U,graphicalItems:Y,stackGroups:ie,offset:G}));return yr(yr({formattedGraphicalItems:ae,graphicalItems:Y,offset:G,stackGroups:ie},te),oe)},v=function(C){function N(I){var P,R,F;return Lnn(this,N),F=$nn(this,N,[I]),Qs(F,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Qs(F,"accessibilityManager",new Snn),Qs(F,"handleLegendBBoxUpdate",function(U){if(U){var L=F.state,z=L.dataStartIndex,Q=L.dataEndIndex,ne=L.updateId;F.setState(yr({legendBBox:U},g({props:F.props,dataStartIndex:z,dataEndIndex:Q,updateId:ne},yr(yr({},F.state),{},{legendBBox:U}))))}}),Qs(F,"handleReceiveSyncEvent",function(U,L,z){if(F.props.syncId===U){if(z===F.eventEmitterSymbol&&typeof F.props.syncMethod!="function")return;F.applySyncEvent(L)}}),Qs(F,"handleBrushChange",function(U){var L=U.startIndex,z=U.endIndex;if(L!==F.state.dataStartIndex||z!==F.state.dataEndIndex){var Q=F.state.updateId;F.setState(function(){return yr({dataStartIndex:L,dataEndIndex:z},g({props:F.props,dataStartIndex:L,dataEndIndex:z,updateId:Q},F.state))}),F.triggerSyncEvent({dataStartIndex:L,dataEndIndex:z})}}),Qs(F,"handleMouseEnter",function(U){var L=F.getMouseInfo(U);if(L){var z=yr(yr({},L),{},{isTooltipActive:!0});F.setState(z),F.triggerSyncEvent(z);var Q=F.props.onMouseEnter;Ni(Q)&&Q(z,U)}}),Qs(F,"triggeredAfterMouseMove",function(U){var L=F.getMouseInfo(U),z=L?yr(yr({},L),{},{isTooltipActive:!0}):{isTooltipActive:!1};F.setState(z),F.triggerSyncEvent(z);var Q=F.props.onMouseMove;Ni(Q)&&Q(z,U)}),Qs(F,"handleItemMouseEnter",function(U){F.setState(function(){return{isTooltipActive:!0,activeItem:U,activePayload:U.tooltipPayload,activeCoordinate:U.tooltipPosition||{x:U.cx,y:U.cy}}})}),Qs(F,"handleItemMouseLeave",function(){F.setState(function(){return{isTooltipActive:!1}})}),Qs(F,"handleMouseMove",function(U){U.persist(),F.throttleTriggeredAfterMouseMove(U)}),Qs(F,"handleMouseLeave",function(U){F.throttleTriggeredAfterMouseMove.cancel();var L={isTooltipActive:!1};F.setState(L),F.triggerSyncEvent(L);var z=F.props.onMouseLeave;Ni(z)&&z(L,U)}),Qs(F,"handleOuterEvent",function(U){var L=V$t(U),z=np(F.props,"".concat(L));if(L&&Ni(z)){var Q,ne;/.*touch.*/i.test(L)?ne=F.getMouseInfo(U.changedTouches[0]):ne=F.getMouseInfo(U),z((Q=ne)!==null&&Q!==void 0?Q:{},U)}}),Qs(F,"handleClick",function(U){var L=F.getMouseInfo(U);if(L){var z=yr(yr({},L),{},{isTooltipActive:!0});F.setState(z),F.triggerSyncEvent(z);var Q=F.props.onClick;Ni(Q)&&Q(z,U)}}),Qs(F,"handleMouseDown",function(U){var L=F.props.onMouseDown;if(Ni(L)){var z=F.getMouseInfo(U);L(z,U)}}),Qs(F,"handleMouseUp",function(U){var L=F.props.onMouseUp;if(Ni(L)){var z=F.getMouseInfo(U);L(z,U)}}),Qs(F,"handleTouchMove",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&F.throttleTriggeredAfterMouseMove(U.changedTouches[0])}),Qs(F,"handleTouchStart",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&F.handleMouseDown(U.changedTouches[0])}),Qs(F,"handleTouchEnd",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&F.handleMouseUp(U.changedTouches[0])}),Qs(F,"handleDoubleClick",function(U){var L=F.props.onDoubleClick;if(Ni(L)){var z=F.getMouseInfo(U);L(z,U)}}),Qs(F,"handleContextMenu",function(U){var L=F.props.onContextMenu;if(Ni(L)){var z=F.getMouseInfo(U);L(z,U)}}),Qs(F,"triggerSyncEvent",function(U){F.props.syncId!==void 0&&TY.emit(IY,F.props.syncId,U,F.eventEmitterSymbol)}),Qs(F,"applySyncEvent",function(U){var L=F.props,z=L.layout,Q=L.syncMethod,ne=F.state.updateId,J=U.dataStartIndex,X=U.dataEndIndex;if(U.dataStartIndex!==void 0||U.dataEndIndex!==void 0)F.setState(yr({dataStartIndex:J,dataEndIndex:X},g({props:F.props,dataStartIndex:J,dataEndIndex:X,updateId:ne},F.state)));else if(U.activeTooltipIndex!==void 0){var re=U.chartX,pe=U.chartY,Y=U.activeTooltipIndex,ie=F.state,oe=ie.offset,G=ie.tooltipTicks;if(!oe)return;if(typeof Q=="function")Y=Q(G,U);else if(Q==="value"){Y=-1;for(var V=0;V<G.length;V++)if(G[V].value===U.activeLabel){Y=V;break}}var te=yr(yr({},oe),{},{x:oe.left,y:oe.top}),ae=Math.min(re,te.x+te.width),he=Math.min(pe,te.y+te.height),Ce=G[Y]&&G[Y].value,ce=Nne(F.state,F.props.data,Y),ge=G[Y]?{x:z==="horizontal"?G[Y].coordinate:ae,y:z==="horizontal"?he:G[Y].coordinate}:yUe;F.setState(yr(yr({},U),{},{activeLabel:Ce,activeCoordinate:ge,activePayload:ce,activeTooltipIndex:Y}))}else F.setState(U)}),Qs(F,"renderCursor",function(U){var L,z=F.state,Q=z.isTooltipActive,ne=z.activeCoordinate,J=z.activePayload,X=z.offset,re=z.activeTooltipIndex,pe=z.tooltipAxisBandSize,Y=F.getTooltipEventType(),ie=(L=U.props.active)!==null&&L!==void 0?L:Q,oe=F.props.layout,G=U.key||"_recharts-cursor";return Ne.createElement(Tnn,{key:G,activeCoordinate:ne,activePayload:J,activeTooltipIndex:re,chartName:n,element:U,isActive:ie,layout:oe,offset:X,tooltipAxisBandSize:pe,tooltipEventType:Y})}),Qs(F,"renderPolarAxis",function(U,L,z){var Q=np(U,"type.axisType"),ne=np(F.state,"".concat(Q,"Map")),J=U.type.defaultProps,X=J!==void 0?yr(yr({},J),U.props):U.props,re=ne&&ne[X["".concat(Q,"Id")]];return m.cloneElement(U,yr(yr({},re),{},{className:sa(Q,re.className),key:U.key||"".concat(L,"-").concat(z),ticks:Bg(re,!0)}))}),Qs(F,"renderPolarGrid",function(U){var L=U.props,z=L.radialLines,Q=L.polarAngles,ne=L.polarRadius,J=F.state,X=J.radiusAxisMap,re=J.angleAxisMap,pe=Ob(X),Y=Ob(re),ie=Y.cx,oe=Y.cy,G=Y.innerRadius,V=Y.outerRadius;return m.cloneElement(U,{polarAngles:Array.isArray(Q)?Q:Bg(Y,!0).map(function(te){return te.coordinate}),polarRadius:Array.isArray(ne)?ne:Bg(pe,!0).map(function(te){return te.coordinate}),cx:ie,cy:oe,innerRadius:G,outerRadius:V,key:U.key||"polar-grid",radialLines:z})}),Qs(F,"renderLegend",function(){var U=F.state.formattedGraphicalItems,L=F.props,z=L.children,Q=L.width,ne=L.height,J=F.props.margin||{},X=Q-(J.left||0)-(J.right||0),re=s$e({children:z,formattedGraphicalItems:U,legendWidth:X,legendContent:u});if(!re)return null;var pe=re.item,Y=U6e(re,Inn);return m.cloneElement(pe,yr(yr({},Y),{},{chartWidth:Q,chartHeight:ne,margin:J,onBBoxUpdate:F.handleLegendBBoxUpdate}))}),Qs(F,"renderTooltip",function(){var U,L=F.props,z=L.children,Q=L.accessibilityLayer,ne=Mf(z,Yp);if(!ne)return null;var J=F.state,X=J.isTooltipActive,re=J.activeCoordinate,pe=J.activePayload,Y=J.activeLabel,ie=J.offset,oe=(U=ne.props.active)!==null&&U!==void 0?U:X;return m.cloneElement(ne,{viewBox:yr(yr({},ie),{},{x:ie.left,y:ie.top}),active:oe,label:Y,payload:oe?pe:[],coordinate:re,accessibilityLayer:Q})}),Qs(F,"renderBrush",function(U){var L=F.props,z=L.margin,Q=L.data,ne=F.state,J=ne.offset,X=ne.dataStartIndex,re=ne.dataEndIndex,pe=ne.updateId;return m.cloneElement(U,{key:U.key||"_recharts-brush",onChange:TP(F.handleBrushChange,U.props.onChange),data:Q,x:es(U.props.x)?U.props.x:J.left,y:es(U.props.y)?U.props.y:J.top+J.height+J.brushBottom-(z.bottom||0),width:es(U.props.width)?U.props.width:J.width,startIndex:X,endIndex:re,updateId:"brush-".concat(pe)})}),Qs(F,"renderReferenceElement",function(U,L,z){if(!U)return null;var Q=F,ne=Q.clipPathId,J=F.state,X=J.xAxisMap,re=J.yAxisMap,pe=J.offset,Y=U.type.defaultProps||{},ie=U.props,oe=ie.xAxisId,G=oe===void 0?Y.xAxisId:oe,V=ie.yAxisId,te=V===void 0?Y.yAxisId:V;return m.cloneElement(U,{key:U.key||"".concat(L,"-").concat(z),xAxis:X[G],yAxis:re[te],viewBox:{x:pe.left,y:pe.top,width:pe.width,height:pe.height},clipPathId:ne})}),Qs(F,"renderActivePoints",function(U){var L=U.item,z=U.activePoint,Q=U.basePoint,ne=U.childIndex,J=U.isRange,X=[],re=L.props.key,pe=L.item.type.defaultProps!==void 0?yr(yr({},L.item.type.defaultProps),L.item.props):L.item.props,Y=pe.activeDot,ie=pe.dataKey,oe=yr(yr({index:ne,dataKey:ie,cx:z.x,cy:z.y,r:4,fill:bce(L.item),strokeWidth:2,stroke:"#fff",payload:z.payload,value:z.value},bi(Y,!1)),VR(Y));return X.push(N.renderActiveDot(Y,oe,"".concat(re,"-activePoint-").concat(ne))),Q?X.push(N.renderActiveDot(Y,yr(yr({},oe),{},{cx:Q.x,cy:Q.y}),"".concat(re,"-basePoint-").concat(ne))):J&&X.push(null),X}),Qs(F,"renderGraphicChild",function(U,L,z){var Q=F.filterFormatItem(U,L,z);if(!Q)return null;var ne=F.getTooltipEventType(),J=F.state,X=J.isTooltipActive,re=J.tooltipAxis,pe=J.activeTooltipIndex,Y=J.activeLabel,ie=F.props.children,oe=Mf(ie,Yp),G=Q.props,V=G.points,te=G.isRange,ae=G.baseLine,he=Q.item.type.defaultProps!==void 0?yr(yr({},Q.item.type.defaultProps),Q.item.props):Q.item.props,Ce=he.activeDot,ce=he.hide,ge=he.activeBar,Ae=he.activeShape,ye=!!(!ce&&X&&oe&&(Ce||ge||Ae)),je={};ne!=="axis"&&oe&&oe.props.trigger==="click"?je={onClick:TP(F.handleItemMouseEnter,U.props.onClick)}:ne!=="axis"&&(je={onMouseLeave:TP(F.handleItemMouseLeave,U.props.onMouseLeave),onMouseEnter:TP(F.handleItemMouseEnter,U.props.onMouseEnter)});var Ie=m.cloneElement(U,yr(yr({},Q.props),je));function Re(mn){return typeof re.dataKey=="function"?re.dataKey(mn.payload):null}if(ye)if(pe>=0){var Qe,$e;if(re.dataKey&&!re.allowDuplicatedCategory){var it=typeof re.dataKey=="function"?Re:"payload.".concat(re.dataKey.toString());Qe=HR(V,it,Y),$e=te&&ae&&HR(ae,it,Y)}else Qe=V==null?void 0:V[pe],$e=te&&ae&&ae[pe];if(Ae||ge){var tt=U.props.activeIndex!==void 0?U.props.activeIndex:pe;return[m.cloneElement(U,yr(yr(yr({},Q.props),je),{},{activeIndex:tt})),null,null]}if(!yi(Qe))return[Ie].concat(WN(F.renderActivePoints({item:Q,activePoint:Qe,basePoint:$e,childIndex:pe,isRange:te})))}else{var ot,ft=(ot=F.getItemByXY(F.state.activeCoordinate))!==null&&ot!==void 0?ot:{graphicalItem:Ie},ct=ft.graphicalItem,Vt=ct.item,It=Vt===void 0?U:Vt,an=ct.childIndex,Nt=yr(yr(yr({},Q.props),je),{},{activeIndex:an});return[m.cloneElement(It,Nt),null,null]}return te?[Ie,null,null]:[Ie,null]}),Qs(F,"renderCustomized",function(U,L,z){return m.cloneElement(U,yr(yr({key:"recharts-customized-".concat(z)},F.props),F.state))}),Qs(F,"renderMap",{CartesianGrid:{handler:MP,once:!0},ReferenceArea:{handler:F.renderReferenceElement},ReferenceLine:{handler:MP},ReferenceDot:{handler:F.renderReferenceElement},XAxis:{handler:MP},YAxis:{handler:MP},Brush:{handler:F.renderBrush,once:!0},Bar:{handler:F.renderGraphicChild},Line:{handler:F.renderGraphicChild},Area:{handler:F.renderGraphicChild},Radar:{handler:F.renderGraphicChild},RadialBar:{handler:F.renderGraphicChild},Scatter:{handler:F.renderGraphicChild},Pie:{handler:F.renderGraphicChild},Funnel:{handler:F.renderGraphicChild},Tooltip:{handler:F.renderCursor,once:!0},PolarGrid:{handler:F.renderPolarGrid,once:!0},PolarAngleAxis:{handler:F.renderPolarAxis},PolarRadiusAxis:{handler:F.renderPolarAxis},Customized:{handler:F.renderCustomized}}),F.clipPathId="".concat((P=I.id)!==null&&P!==void 0?P:C5("recharts"),"-clip"),F.throttleTriggeredAfterMouseMove=rBe(F.triggeredAfterMouseMove,(R=I.throttleDelay)!==null&&R!==void 0?R:1e3/60),F.state={},F}return Hnn(N,C),Bnn(N,[{key:"componentDidMount",value:function(){var P,R;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(P=this.props.margin.left)!==null&&P!==void 0?P:0,top:(R=this.props.margin.top)!==null&&R!==void 0?R:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var P=this.props,R=P.children,F=P.data,U=P.height,L=P.layout,z=Mf(R,Yp);if(z){var Q=z.props.defaultIndex;if(!(typeof Q!="number"||Q<0||Q>this.state.tooltipTicks.length-1)){var ne=this.state.tooltipTicks[Q]&&this.state.tooltipTicks[Q].value,J=Nne(this.state,F,Q,ne),X=this.state.tooltipTicks[Q].coordinate,re=(this.state.offset.top+U)/2,pe=L==="horizontal",Y=pe?{x:X,y:re}:{y:X,x:re},ie=this.state.formattedGraphicalItems.find(function(G){var V=G.item;return V.type.name==="Scatter"});ie&&(Y=yr(yr({},Y),ie.props.points[Q].tooltipPosition),J=ie.props.points[Q].tooltipPayload);var oe={activeTooltipIndex:Q,isTooltipActive:!0,activeLabel:ne,activePayload:J,activeCoordinate:Y};this.setState(oe),this.renderCursor(z),this.accessibilityManager.setIndex(Q)}}}},{key:"getSnapshotBeforeUpdate",value:function(P,R){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==R.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==P.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==P.margin){var F,U;this.accessibilityManager.setDetails({offset:{left:(F=this.props.margin.left)!==null&&F!==void 0?F:0,top:(U=this.props.margin.top)!==null&&U!==void 0?U:0}})}return null}},{key:"componentDidUpdate",value:function(P){ate([Mf(P.children,Yp)],[Mf(this.props.children,Yp)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var P=Mf(this.props.children,Yp);if(P&&typeof P.props.shared=="boolean"){var R=P.props.shared?"axis":"item";return l.indexOf(R)>=0?R:a}return a}},{key:"getMouseInfo",value:function(P){if(!this.container)return null;var R=this.container,F=R.getBoundingClientRect(),U=TVt(F),L={chartX:Math.round(P.pageX-U.left),chartY:Math.round(P.pageY-U.top)},z=F.width/R.offsetWidth||1,Q=this.inRange(L.chartX,L.chartY,z);if(!Q)return null;var ne=this.state,J=ne.xAxisMap,X=ne.yAxisMap,re=this.getTooltipEventType(),pe=H6e(this.state,this.props.data,this.props.layout,Q);if(re!=="axis"&&J&&X){var Y=Ob(J).scale,ie=Ob(X).scale,oe=Y&&Y.invert?Y.invert(L.chartX):null,G=ie&&ie.invert?ie.invert(L.chartY):null;return yr(yr({},L),{},{xValue:oe,yValue:G},pe)}return pe?yr(yr({},L),pe):null}},{key:"inRange",value:function(P,R){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,U=this.props.layout,L=P/F,z=R/F;if(U==="horizontal"||U==="vertical"){var Q=this.state.offset,ne=L>=Q.left&&L<=Q.left+Q.width&&z>=Q.top&&z<=Q.top+Q.height;return ne?{x:L,y:z}:null}var J=this.state,X=J.angleAxisMap,re=J.radiusAxisMap;if(X&&re){var pe=Ob(X);return n5e({x:L,y:z},pe)}return null}},{key:"parseEventsOfWrapper",value:function(){var P=this.props.children,R=this.getTooltipEventType(),F=Mf(P,Yp),U={};F&&R==="axis"&&(F.props.trigger==="click"?U={onClick:this.handleClick}:U={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var L=VR(this.props,this.handleOuterEvent);return yr(yr({},L),U)}},{key:"addListener",value:function(){TY.on(IY,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){TY.removeListener(IY,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(P,R,F){for(var U=this.state.formattedGraphicalItems,L=0,z=U.length;L<z;L++){var Q=U[L];if(Q.item===P||Q.props.key===P.key||R===Yg(Q.item.type)&&F===Q.childIndex)return Q}return null}},{key:"renderClipPath",value:function(){var P=this.clipPathId,R=this.state.offset,F=R.left,U=R.top,L=R.height,z=R.width;return Ne.createElement("defs",null,Ne.createElement("clipPath",{id:P},Ne.createElement("rect",{x:F,y:U,height:L,width:z})))}},{key:"getXScales",value:function(){var P=this.state.xAxisMap;return P?Object.entries(P).reduce(function(R,F){var U=$6e(F,2),L=U[0],z=U[1];return yr(yr({},R),{},Qs({},L,z.scale))},{}):null}},{key:"getYScales",value:function(){var P=this.state.yAxisMap;return P?Object.entries(P).reduce(function(R,F){var U=$6e(F,2),L=U[0],z=U[1];return yr(yr({},R),{},Qs({},L,z.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(P){var R;return(R=this.state.xAxisMap)===null||R===void 0||(R=R[P])===null||R===void 0?void 0:R.scale}},{key:"getYScaleByAxisId",value:function(P){var R;return(R=this.state.yAxisMap)===null||R===void 0||(R=R[P])===null||R===void 0?void 0:R.scale}},{key:"getItemByXY",value:function(P){var R=this.state,F=R.formattedGraphicalItems,U=R.activeItem;if(F&&F.length)for(var L=0,z=F.length;L<z;L++){var Q=F[L],ne=Q.props,J=Q.item,X=J.type.defaultProps!==void 0?yr(yr({},J.type.defaultProps),J.props):J.props,re=Yg(J.type);if(re==="Bar"){var pe=(ne.data||[]).find(function(G){return VQt(P,G)});if(pe)return{graphicalItem:Q,payload:pe}}else if(re==="RadialBar"){var Y=(ne.data||[]).find(function(G){return n5e(P,G)});if(Y)return{graphicalItem:Q,payload:Y}}else if(J$(Q,U)||eU(Q,U)||I_(Q,U)){var ie=FZt({graphicalItem:Q,activeTooltipItem:U,itemData:X.data}),oe=X.activeIndex===void 0?ie:X.activeIndex;return{graphicalItem:yr(yr({},Q),{},{childIndex:oe}),payload:I_(Q,U)?X.data[ie]:Q.props.data[ie]}}}return null}},{key:"render",value:function(){var P=this;if(!p2e(this))return null;var R=this.props,F=R.children,U=R.className,L=R.width,z=R.height,Q=R.style,ne=R.compact,J=R.title,X=R.desc,re=U6e(R,Pnn),pe=bi(re,!1);if(ne)return Ne.createElement(g6e,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Ne.createElement(lte,$C({},pe,{width:L,height:z,title:J,desc:X}),this.renderClipPath(),x2e(F,this.renderMap)));if(this.props.accessibilityLayer){var Y,ie;pe.tabIndex=(Y=this.props.tabIndex)!==null&&Y!==void 0?Y:0,pe.role=(ie=this.props.role)!==null&&ie!==void 0?ie:"application",pe.onKeyDown=function(G){P.accessibilityManager.keyboardEvent(G)},pe.onFocus=function(){P.accessibilityManager.focus()}}var oe=this.parseEventsOfWrapper();return Ne.createElement(g6e,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Ne.createElement("div",$C({className:sa("recharts-wrapper",U),style:yr({position:"relative",cursor:"default",width:L,height:z},Q)},oe,{ref:function(V){P.container=V}}),Ne.createElement(lte,$C({},pe,{width:L,height:z,title:J,desc:X,style:Ynn}),this.renderClipPath(),x2e(F,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(m.Component);Qs(v,"displayName",n),Qs(v,"defaultProps",yr({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Qs(v,"getDerivedStateFromProps",function(C,N){var I=C.dataKey,P=C.data,R=C.children,F=C.width,U=C.height,L=C.layout,z=C.stackOffset,Q=C.margin,ne=N.dataStartIndex,J=N.dataEndIndex;if(N.updateId===void 0){var X=V6e(C);return yr(yr(yr({},X),{},{updateId:0},g(yr(yr({props:C},X),{},{updateId:0}),N)),{},{prevDataKey:I,prevData:P,prevWidth:F,prevHeight:U,prevLayout:L,prevStackOffset:z,prevMargin:Q,prevChildren:R})}if(I!==N.prevDataKey||P!==N.prevData||F!==N.prevWidth||U!==N.prevHeight||L!==N.prevLayout||z!==N.prevStackOffset||!f4(Q,N.prevMargin)){var re=V6e(C),pe={chartX:N.chartX,chartY:N.chartY,isTooltipActive:N.isTooltipActive},Y=yr(yr({},H6e(N,P,L)),{},{updateId:N.updateId+1}),ie=yr(yr(yr({},re),pe),Y);return yr(yr(yr({},ie),g(yr({props:C},ie),N)),{},{prevDataKey:I,prevData:P,prevWidth:F,prevHeight:U,prevLayout:L,prevStackOffset:z,prevMargin:Q,prevChildren:R})}if(!ate(R,N.prevChildren)){var oe,G,V,te,ae=Mf(R,PN),he=ae&&(oe=(G=ae.props)===null||G===void 0?void 0:G.startIndex)!==null&&oe!==void 0?oe:ne,Ce=ae&&(V=(te=ae.props)===null||te===void 0?void 0:te.endIndex)!==null&&V!==void 0?V:J,ce=he!==ne||Ce!==J,ge=!yi(P),Ae=ge&&!ce?N.updateId:N.updateId+1;return yr(yr({updateId:Ae},g(yr(yr({props:C},N),{},{updateId:Ae,dataStartIndex:he,dataEndIndex:Ce}),N)),{},{prevChildren:R,dataStartIndex:he,dataEndIndex:Ce})}return null}),Qs(v,"renderActiveDot",function(C,N,I){var P;return m.isValidElement(C)?P=m.cloneElement(C,N):Ni(C)?P=C(N):P=Ne.createElement(Z$,N),Ne.createElement(Sa,{className:"recharts-active-dot",key:I},P)});var w=m.forwardRef(function(N,I){return Ne.createElement(v,$C({},N,{ref:I}))});return w.displayName=v.displayName,w},irn=wUe({chartName:"LineChart",GraphicalChild:T0,axisComponents:[{axisType:"xAxis",AxisComp:n8},{axisType:"yAxis",AxisComp:r8}],formatAxisMap:T$e}),arn=wUe({chartName:"ComposedChart",GraphicalChild:[T0,j5,e8,oU],axisComponents:[{axisType:"xAxis",AxisComp:n8},{axisType:"yAxis",AxisComp:r8},{axisType:"zAxis",AxisComp:aU}],formatAxisMap:T$e});const orn=({wallet:e})=>{const[t,n]=m.useState([]),[r]=m.useState("allTime"),[s]=m.useState("pnlHistory"),[a,o]=m.useState(!1),l=m.useRef(null),c=e||"";return m.useEffect(()=>{let u=new AbortController;const d=async()=>{var x,g,v;const f=`perp${r.charAt(0).toUpperCase()+r.slice(1)}`;o(!0);try{const I=(((g=(x=(await ds.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:c},{headers:{Accept:"*/*","Content-Type":"application/json"},signal:u.signal})).data.find(P=>P[0]===f))==null?void 0:x[1])==null?void 0:g[s])||[]).map(([P,R])=>({time:new Date(P).getTime(),value:parseFloat(R)}));n(I)}catch(w){((v=w.response)==null?void 0:v.status)===429?(console.warn("Error 429..."),l.current=setTimeout(d,15e3)):w.name!=="CanceledError"&&(console.error("Error fetching chart data:",w),l.current=setTimeout(d,15e3))}finally{o(!1)}};return d(),()=>{u.abort(),l.current&&clearTimeout(l.current)}},[r,s,c]),i.jsx("div",{className:"bg-transparent rounded-2xl w-full",style:{minHeight:"40px"},children:a?i.jsx("div",{className:"w-full h-full flex justify-center items-center",children:i.jsx(KNe,{className:"w-5 h-5 -mb-[41px]"})}):t.length===0?i.jsx("div",{className:"w-full h-full flex justify-center items-center",children:i.jsx("span",{className:"text-gray-600 text-xs -mb-[41px]",children:"No chart data"})}):i.jsx(sBe,{width:"100%",height:40,children:i.jsxs(irn,{data:t,children:[i.jsx(n8,{dataKey:"time",hide:!0}),i.jsx(r8,{hide:!0}),i.jsx(Yp,{cursor:{stroke:"#555",strokeWidth:1},content:({active:u,payload:d})=>{if(u&&d&&d.length){const f=d[0].payload,x=new Date(f.time),g=x.toLocaleDateString("en-GB",{month:"short",day:"2-digit"}).toUpperCase(),v=x.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"});return i.jsxs("div",{style:{background:"#1B1B1B",padding:"6px 10px",borderRadius:"12px",fontSize:"12px",color:"#fff",border:"1px solid #353535"},children:[i.jsxs("div",{className:"text-[12px] font-medium text-[#909090]",children:[g," ",v]}),i.jsxs("div",{className:"text-[14px] font-semibold flex items-center",children:[i.jsx("span",{className:"inline-block w-[8px] h-[8px] bg-[#67FFBD] rounded-full mr-1"}),i.jsx("span",{className:"text-[#67FFBD] mr-2",children:"PnL"}),i.jsxs("span",{children:["$",Cr(f.value)]})]})]})}return null},wrapperStyle:{marginLeft:"-40px",marginTop:"-50px"}}),i.jsx(T0,{type:"monotone",dataKey:"value",stroke:"#67FFBD",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})},lrn="https://dextradata.nftinit.io/api/hyper/analytics/wallet_backtest_summary/?format=json&limit=48&offset=0&order_by=three_month_pnl&order_dir=desc",crn=({handleAddedTime:e})=>{const{trackedWatchList:t,copyTradeWatchList:n,setSignModalOpen:r}=m.useContext(Qr),{address:s}=Jr(),[a,o]=m.useState([]),[l,c]=m.useState(!0),[u,d]=m.useState(null),[f,x]=m.useState(1),g=typeof window<"u"&&window.innerWidth>640?4:2,[v,w]=m.useState(!1),[C,N]=m.useState(null),[I,P]=m.useState(null),[R,F]=m.useState("");m.useEffect(()=>{(async()=>{try{c(!0),d(null);const J=await fetch(lrn);if(!J.ok)throw new Error(`HTTP error! status: ${J.status}`);const X=await J.json();o((X==null?void 0:X.data)||[])}catch{d("Failed to fetch wallets.")}finally{c(!1)}})()},[]);const U=async({walletAddress:ne,isFollow:J,isScalper:X})=>{try{F(ne);const re=window.localStorage.getItem("hyperToken"),pe=window.localStorage.getItem("hyperAddress");if(!re){r(!0);return}const Y=J?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",ie=J?{address:s?s.toLowerCase():pe,token:re,follow_address:ne.toLowerCase()}:{address:s?s.toLowerCase():pe,token:re},oe=await fetch(Y,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ie)});if(!oe.ok)throw new Error(`Server responded with status ${oe.status}`);const G=await oe.json();G.success?(N(Array.isArray(G==null?void 0:G.data)?[...G.data].sort((V,te)=>new Date(te.created_at||0)-new Date(V.created_at||0)):G==null?void 0:G.data),P(X),w(!0)):ln.error(G.error_message)}catch(re){ln.error(re.message||"Something went wrong!")}},L=Math.ceil(a.length/g),z=(f-1)*g,Q=a.slice(z,z+g);return i.jsxs(i.Fragment,{children:[i.jsx(v5,{open:v,setOpen:w,copyTradeData:C,copyTradeWallet:R,setCopyTradeWallet:F,isScalper:I,setCopyTradeData:N}),i.jsx("div",{className:"grid grid-cols-2 gap-4 w-full",children:l?i.jsx("div",{className:"flex justify-center items-center w-full h-[300px] col-span-2",children:i.jsx(Da,{})}):i.jsxs(i.Fragment,{children:[Q==null?void 0:Q.map((ne,J)=>{var pe,Y,ie,oe,G,V,te,ae,he;const X=t==null?void 0:t.some(Ce=>Ce.wallet_address===(ne==null?void 0:ne.user_token)),re=n==null?void 0:n.some(Ce=>Ce.wallet_address===(ne==null?void 0:ne.user_token));return i.jsx(sm.div,{initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,delay:J*.06,ease:[.22,1,.36,1]},whileHover:{y:-4,scale:1.01},whileTap:{scale:.99},className:"col-span-2 md:col-span-1 w-full relative rounded-[18px] p-[1px] bg-gradient-to-br from-[#67ffbd33] via-[#67ffbd66] to-[#67ffbd99]",children:i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full min-h-max sm:min-h-[220px] rounded-[18px] border border-[#2a2a2a] p-4 bg-[#0a0a0a]",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5 sm:gap-2 w-full",children:[i.jsx("img",{src:qi,alt:"",className:"w-7 h-7 sm:w-8 sm:h-8 rounded-md"}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${ne==null?void 0:ne.user_token}`,"_blank"),e()},className:"text-white text-[12px] sm:text-base font-semibold font-manrope leading-none tracking-wide cursor-pointer",children:(ne==null?void 0:ne.user_token)&&(ne==null?void 0:ne.user_token.slice(0,6))+"..."+(ne==null?void 0:ne.user_token.slice(-4))}),i.jsx(y5,{walletAddress:ne==null?void 0:ne.user_token,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:X?i.jsx("img",{src:a5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})}),i.jsx(orn,{wallet:ne==null?void 0:ne.user_token})]}),i.jsxs("div",{className:"flex flex-col items-start gap-4 w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start sm:flex-row sm:justify-between sm:items-center gap-2 md:gap-6 lg:gap-10 min-w-full h-[120px] sm:h-auto overflow-y-auto sm:overflow-hidden pr-2 sm:pr-0",children:[i.jsx(FY,{title:"PNL",data:[{label:"7D:",value:(pe=ne==null?void 0:ne.source_data)==null?void 0:pe.portfolio_perp_week_pnl,format:Is},{label:"30D:",value:(Y=ne==null?void 0:ne.source_data)==null?void 0:Y.portfolio_perp_month_pnl,format:Is},{label:"90D:",value:(ie=ne==null?void 0:ne.source_data)==null?void 0:ie.portfolio_perp_3month_pnl,format:Is}]}),i.jsx(FY,{title:"Growth Rate",data:[{label:"7D:",value:(oe=ne==null?void 0:ne.source_data)==null?void 0:oe.portfolio_perp_week_growth_rate},{label:"30D:",value:(G=ne==null?void 0:ne.source_data)==null?void 0:G.portfolio_perp_month_growth_rate},{label:"90D:",value:(V=ne==null?void 0:ne.source_data)==null?void 0:V.portfolio_perp_3month_growth_rate}]}),i.jsx(FY,{title:"Drawdown",data:[{label:"7D:",value:(te=ne==null?void 0:ne.source_data)==null?void 0:te.portfolio_perp_week_dd,format:Is},{label:"30D:",value:(ae=ne==null?void 0:ne.source_data)==null?void 0:ae.portfolio_perp_month_dd,format:Is},{label:"90D:",value:(he=ne==null?void 0:ne.source_data)==null?void 0:he.portfolio_perp_3month_dd,format:Is}]})]}),i.jsxs(sm.button,{onClick:Ce=>{Ce.preventDefault(),U({walletAddress:ne==null?void 0:ne.user_token,isFollow:re,isScalper:ne==null?void 0:ne.is_scalper})},whileHover:{scale:1.02},whileTap:{scale:.98},className:`relative overflow-hidden w-full h-9 rounded-xl px-4 inline-flex items-center justify-center font-semibold cursor-pointer ${re?"bg-[#67ffbd] text-[#161616]":"text-[#161616]"}`,children:[i.jsx("span",{className:"relative z-10",children:re?"Adjust Copy":"Copy Trade"}),!re&&i.jsxs(i.Fragment,{children:[i.jsx(sm.span,{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-xl",style:{background:"linear-gradient(90deg, #67FFCD 0%, #67FFBD 50%, #67FFFD 100%)",backgroundSize:"300% 100%"},initial:{backgroundPosition:"0% 50%",opacity:1},animate:{backgroundPosition:["0% 50%","100% 50%","0% 50%"]},transition:{duration:3.2,repeat:1/0,ease:"linear"}}),i.jsx(sm.span,{"aria-hidden":!0,className:"pointer-events-none absolute -inset-1 rounded-xl blur-lg",style:{background:"radial-gradient(60% 60% at 50% 50%, rgba(117,53,254,0.55), transparent 60%)"},initial:{opacity:.6},animate:{opacity:[.55,.95,.55],scale:[1,1.03,1]},transition:{duration:1.6,repeat:1/0,ease:"easeInOut"}})]})]})]})]})},`${z+J}-${ne==null?void 0:ne.user_token}`)}),i.jsxs("div",{className:"flex justify-center items-center gap-4 w-full col-span-2",children:[i.jsx("button",{className:"px-3 py-1 rounded bg-[#333] text-white disabled:opacity-50 focus:outline-none focus:ring-0 border-none",onClick:()=>x(ne=>ne-1),disabled:f===1,children:"Prev"}),i.jsxs("span",{className:"text-white text-sm",children:["Page ",f," of ",L]}),i.jsx("button",{className:"px-3 py-1 rounded bg-[#333] text-white disabled:opacity-50 focus:outline-none focus:ring-0 border-none",onClick:()=>x(ne=>ne+1),disabled:f===L,children:"Next"})]})]})})]})},FY=({title:e,data:t})=>i.jsxs("div",{className:"flex flex-col justify-start items-start gap-4 w-full",children:[i.jsxs("div",{className:"flex flex-col items-start gap-2 w-full",children:[i.jsx("div",{className:"text-[#fff] text-xs font-normal font-manrope leading-[13px] tracking-wide min-w-max",children:e}),t.map((n,r)=>i.jsxs("div",{className:"flex justify-between sm:justify-start items-center gap-2 w-full",children:[i.jsx("span",{className:"flex justify-start items-center text-[#9b9b9b] text-xs font-medium min-w-[30px]",children:n.label}),i.jsxs("span",{className:`${n.value==null||isNaN(parseFloat(n.value))||n.value==0?"text-white":n.value>0?"text-[#1DE6A3]":"text-[#FF7173]"} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:[e==="Growth Rate"||e==="Drawdown"?"":"$",n.format?n.format(Math.abs(n.value)):Is(n.value),e==="Growth Rate"||e==="Drawdown"?"%":""]})]},r))]}),(e==="Growth Rate"||e==="PNL")&&i.jsx("div",{className:"h-px w-full min-w-full sm:hidden bg-[#404040]"})]}),urn=({open:e,setOpen:t,sevenSelectShow:n})=>{const[r,s]=m.useState(!1),a=()=>{if(n)if(r){const l=Date.now()+6048e5;localStorage.setItem("dailyPicksBlockedUntil",l.toString())}else localStorage.setItem("dailyPicksDismissedAt",Date.now().toString());t(!1)},o=()=>{if(n)if(r){const l=Date.now()+6048e5;localStorage.setItem("dailyPicksBlockedUntil",l.toString())}else localStorage.setItem("dailyPicksDismissedAt",Date.now().toString())};return i.jsxs(Ea,{open:e,onClose:a,className:"relative z-50",children:[i.jsx(ja,{as:sm.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 backdrop-blur-md",style:{background:"radial-gradient(120% 120% at 10% 10%, rgba(117,53,254,0.26), transparent 60%), radial-gradient(120% 120% at 90% 10%, rgba(103,255,189,0.20), transparent 60%), rgba(0,0,0,0.55)"}}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(xa,{as:sm.div,initial:{opacity:0,y:22,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",bounce:.22,duration:.5},className:"relative transform overflow-hidden rounded-3xl w-full xl:w-[70%] 2xl:w-[60%] p-[1px] bg-gradient-to-br from-black/90 via-black/70 to-black/50",children:i.jsxs("div",{className:"relative flex flex-col justify-start items-center gap-6 w-full min-h-[420px] p-4 sm:p-8 rounded-3xl",children:[i.jsxs("div",{className:"absolute inset-0 -z-10 overflow-hidden rounded-3xl",children:[i.jsx(sm.div,{className:"absolute -inset-28 opacity-60",style:{background:"radial-gradient(60% 60% at 20% 20%, rgba(103,255,189,0.18) 0%, transparent 60%), radial-gradient(60% 60% at 80% 30%, rgba(117,53,254,0.18) 0%, transparent 60%), radial-gradient(70% 70% at 50% 90%, rgba(255,121,124,0.18) 0%, transparent 60%)"},animate:{rotate:[0,360]},transition:{duration:60,repeat:1/0,ease:"linear"}}),i.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top,rgba(255,255,255,0.06),transparent_60%)]"}),i.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.06)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.06)_1px,transparent_1px)] bg-[size:18px_18px] opacity-10"})]}),i.jsx("button",{onClick:a,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{className:"p-1",src:Ba,alt:"close"})}),i.jsx("div",{className:"flex justify-start items-center w-full",children:i.jsxs("div",{className:"flex flex-col items-start w-full gap-3 sm:gap-5",children:[i.jsx("div",{className:"text-white font-manrope text-[20px] sm:text-[22px] font-extrabold leading-none -ml-[3px] tracking-[-0.2px]",children:"🔥 Daily Picks"}),i.jsx("div",{className:"text-[13px] sm:text-[14px] text-start text-white/90 font-manrope font-semibold leading-[18px] max-w-[70ch]",children:"Our algorithm highlights traders with proven skills, strong profits, and low drawdowns — ready for you to copy."})]})}),i.jsx("div",{className:"flex justify-start items-center w-full",children:i.jsx(crn,{handleAddedTime:o})}),n&&i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full",children:[i.jsx("input",{type:"checkbox",checked:r,onChange:l=>s(l.target.checked),className:"w-4 h-4 accent-[#7535FE]"}),i.jsx("label",{className:"text-[12px] sm:text-[13px] text-white/90 font-manrope font-semibold leading-[16px]",children:"Don’t show this popup again for the next 7 days"})]})]})})})})]})},drn=()=>{const[e,t]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(urn,{open:e,setOpen:t,sevenSelectShow:!1}),i.jsxs("div",{onClick:()=>t(!0),className:"flex justify-start items-center gap-1.5 rounded-2xl text-white bg-transparent px-2 py-0.5 cursor-pointer w-max",children:[i.jsxs("svg",{className:"bn-svg !text-[16px] w-3.5 h-3.5 -mt-[1.5px]",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M3.3 20.7h17.4V6.3H3.3v14.4zm19.2.3l-.008.153a1.5 1.5 0 01-1.339 1.34L21 22.5H3l-.153-.008a1.5 1.5 0 01-1.34-1.339L1.5 21V6a1.5 1.5 0 011.347-1.492L3 4.5h18l.153.008A1.5 1.5 0 0122.5 6v15z",fill:"currentColor"}),i.jsx("path",{d:"M6.1 5V2.5a.9.9 0 011.8 0V5a.9.9 0 01-1.8 0zM16.1 5V2.5a.9.9 0 011.8 0V5a.9.9 0 01-1.8 0zM21 9.1l.092.004a.9.9 0 010 1.792L21 10.9H2.5a.9.9 0 010-1.8H21zM11.1 12.5v4.517l-1.507-1.32a.9.9 0 00-1.186 1.356l3 2.625.066.052a.9.9 0 001.12-.052l3-2.625.066-.065a.9.9 0 00-1.18-1.347l-.072.056-1.507 1.32V12.5a.9.9 0 00-1.8 0z",fill:"currentColor"})]}),i.jsx("span",{className:"text-white text-[11px] font-semibold font-manrope",children:"Daily Picks"})]})]})};function frn(){return i.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-[60] h-[30px] bg-[#0B0B0B]/70 backdrop-blur",children:i.jsxs("div",{className:"flex justify-between items-center h-full w-full gap-2 sm:gap-4 pl-2 sm:pl-4 pr-5",children:[i.jsx("div",{className:"flex justify-start items-center",children:i.jsx(drn,{})}),i.jsxs("div",{className:"h-full w-full flex items-center justify-end gap-2",children:[i.jsx(kLt,{}),i.jsx(TLt,{}),i.jsx(ILt,{}),i.jsx(PLt,{})]})]})})}const hrn=()=>{const e=Mc();return i.jsxs("div",{className:"flex flex-col items-stretch justify-start w-screen h-[100dvh] overflow-hidden p-0 m-0 realtive",children:[(e.pathname==="/discover-wallets"||e.pathname==="/hyperliquid-whale-trades")&&i.jsx(_Lt,{}),i.jsx("div",{className:"hidden sm:block",children:i.jsx(eLt,{})}),i.jsx("div",{className:"block sm:hidden",children:i.jsx(ELt,{})}),i.jsx("div",{style:{height:"calc(100vh - 4.875rem)"},className:"flex flex-col items-stretch justify-start flex-grow h-full w-[100vw] overflow-auto",children:i.jsx("main",{children:i.jsx($Ke,{})})}),i.jsx(frn,{})]})},aa=({info1:e,info2:t,padding:n,icon:r,info1_Color:s,info2_Color:a,rowTwo:o,info3:l})=>i.jsxs("div",{className:`${n||"pl-1 pr-2"} flex flex-col gap-2 font-manrope`,children:[i.jsxs("div",{className:`${s} ${o?"-mt-3.5":""} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:[i.jsx("img",{src:r,alt:"",className:""}),l?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#1DE6A3]",children:e})," /"," ",i.jsx("span",{className:"text-[#FF7173]",children:l})]}):e]}),t&&i.jsx("div",{className:`${a} text-xs font-normal not-italic font-inter flex items-center justify-end leading-3 min-w-max text-[#979797]`,children:t})]}),Xa=({className:e})=>i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M11.9467 5.45312H7.79341H4.05341C3.41341 5.45312 3.09341 6.22646 3.54674 6.67979L7.00008 10.1331C7.55341 10.6865 8.45341 10.6865 9.00674 10.1331L10.3201 8.81979L12.4601 6.67979C12.9067 6.22646 12.5867 5.45312 11.9467 5.45312Z",fill:"currentColor"})}),cU=({sortKey:e,state:t,className:n})=>"-"+e===t?i.jsx(Xa,{className:"text-white hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] rotate-180 "+n}):e===t?i.jsx(Xa,{className:"text-white hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] "+n}):i.jsx(Xa,{className:"text-[#9B9B9B] hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] "+n}),Ko=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s,isFilter:a})=>{const o=()=>{r(n===`-${t}`?t:`-${t}`)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>o(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope cursor-pointer`,children:[i.jsx("div",{className:`${n===t||n===`-${t}`?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(cU,{sortKey:t,state:n,className:""})]})})};function Ol(e){const[t,n]=m.useState(e.minFilterType||""),[r,s]=m.useState(e.maxFilterType||"");m.useEffect(()=>{n(e.minFilterType||"")},[e.minFilterType]),m.useEffect(()=>{s(e.maxFilterType||"")},[e.maxFilterType]);const a=()=>{e.handleChange({target:{name:e.minInputName,value:t}})},o=()=>{e.handleChange({target:{name:e.maxInputName,value:r}})},l=f=>f.preventDefault(),c=f=>f.target.addEventListener("wheel",l,{passive:!1}),u=f=>f.target.removeEventListener("wheel",l),d=f=>{["-","+","e"].includes(f.key)&&f.preventDefault()};return i.jsxs("div",{className:"col-span-1 flex flex-col justify-start max-w-full z-3 font-manrope gap-[13px]",children:[i.jsxs("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px] flex justify-start items-center gap-1",children:[e.name,e.isTooltip&&i.jsxs("span",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#c9c9c9] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!0})})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{value:t,onChange:f=>n(f.target.value),onBlur:a,onFocus:c,onBlurCapture:u,type:"number",name:e.minInputName,onKeyDown:["Win Count","Loss Count","Trades Count","Tx Count","Perp Equity","Margin %","Margin Used","Avg. Lvg.","Drawdown PnL"].includes(e.name)?d:void 0,placeholder:"Min",className:`py-0.5 bg-[#1b1b1b] rounded-md border border-[#303030] h-8 block text-white text-sm font-medium font-inter leading-[8px] w-1/2 px-2 ${t!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`}),i.jsx("input",{value:r,onChange:f=>s(f.target.value),onBlur:o,onFocus:c,onBlurCapture:u,type:"number",name:e.maxInputName,onKeyDown:["Win Count","Loss Count","Trades Count","Tx Count","Perp Equity","Margin %","Margin Used","Avg. Lvg.","Drawdown PnL"].includes(e.name)?d:void 0,placeholder:"Max",className:`bg-[#1b1b1b] rounded-md border border-[#303030] py-0.5 h-8 block sm:text-sm font-semibold font-manrope leading-none w-1/2 px-2 ${r!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`})]})]})}function q6e(e){m.useEffect(()=>{const s=e.minFilterType,a=e.maxFilterType;s&&e.setMinValue(t(s)),a&&e.setMaxValue(t(a))},[e.minInputName,e.maxInputName]);const t=s=>{const a=new Date(Number(s));if(isNaN(a.getTime()))return"";const o=a.getFullYear(),l=String(a.getMonth()+1).padStart(2,"0"),c=String(a.getDate()).padStart(2,"0");return String(a.getHours()).padStart(2,"0"),String(a.getMinutes()).padStart(2,"0"),`${o}-${l}-${c}`},n=s=>{const{name:a,value:o}=s.target;if(!o){e.setAdvancedFilters(c=>({...c,[a]:""})),a===e.minInputName?e.setMinValue(""):a===e.maxInputName&&e.setMaxValue("");return}const l=new Date(o).getTime();e.setAdvancedFilters(c=>({...c,[a]:l})),a===e.minInputName?e.setMinValue(o):a===e.maxInputName&&e.setMaxValue(o)},r=async()=>{const s={...e.advancedFilters,[e.minInputName]:"",[e.maxInputName]:""};e.setMinValue(""),e.setMaxValue(""),e.setAdvancedFilters(s)};return i.jsxs("div",{className:"col-span-1 flex flex-col justify-start gap-[7px] min-w-max xl:w-full z-3 font-manrope",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:e.name}),i.jsx("div",{onClick:()=>{r()},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("input",{value:e.minValue||"",onChange:n,type:"date",name:e.minInputName,placeholder:"Min",className:`${e.minValue!==void 0&&e.minValue!==null&&e.minValue!==""?"border border-[#8d67ff] input-data-time-local-white-full":"input-data-time-local-dark-empty"} shadow-sm py-0.5 bg-[#1b1b1b] h-8 border border-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md w-full px-2 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353]`}),i.jsx("input",{value:e.maxValue||"",onChange:n,type:"date",name:e.maxInputName,placeholder:"Max",className:`${e.maxValue!==void 0&&e.maxValue!==null&&e.maxValue!==""?"border border-[#8d67ff] input-data-time-local-white-full":"input-data-time-local-dark-empty"} shadow-sm py-0.5 bg-[#1b1b1b] h-8 border border-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md w-full px-2 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353]`})]})]})}const prn=({className:e})=>i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M11.62 5.22084L7.81667 9.02417C7.3675 9.47334 6.6325 9.47334 6.18334 9.02417L2.38 5.22084",stroke:"#7C7C7C",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})}),OY=({title:e,titleInfo:t,icon:n,children:r})=>{const[s,a]=m.useState(!1),o=()=>{a(!s)};return i.jsxs("div",{className:"overflow-hidden w-full border-t border-t-[#353535]",children:[i.jsxs("div",{className:"w-full flex items-center justify-between pt-3 cursor-pointer",onClick:o,children:[i.jsxs("div",{className:"flex items-center",children:[n&&i.jsx("span",{className:"w-[18px] h-[18px] mr-[8px]",children:n}),i.jsx("span",{className:"text-white font-manrope text-[13px] font-semibold leading-[8px]",children:e}),i.jsx("span",{className:`${t>0?"bg-[#67ffbd]/40 text-[#7bf4bf] shadow-2xl shadow-green-500 text-[10px] font-bold flex justify-center items-center rounded-md px-1.5 py-1 tracking-wide ml-1":"text-white text-[13px] font-semibold"} font-['Manrope'] leading-[8px] `,children:t>0?t:"(0)"})]}),i.jsx("span",{className:`transform transition-transform duration-300 ${s?"rotate-180":"rotate-0"}`,children:i.jsx(prn,{})})]}),i.jsx("div",{className:`flex flex-col transition-[opacity,padding] duration-300 ease-in-out ${s?"opacity-100 pt-4 pb-4 space-y-4 m-1":"opacity-0 h-0 p-0"}`,children:s&&r})]})},mrn=({className:e})=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M11.1375 2.96251V5.81251H10.0125V2.96251C10.0125 2.76001 9.8325 2.66251 9.7125 2.66251C9.675 2.66251 9.6375 2.67001 9.6 2.68501L3.6525 4.92751C3.255 5.07751 3 5.45251 3 5.88001V6.38251C2.3175 6.89251 1.875 7.71001 1.875 8.63251V5.88001C1.875 4.98751 2.4225 4.19251 3.255 3.87751L9.21 1.62751C9.375 1.56751 9.5475 1.53751 9.7125 1.53751C10.4625 1.53751 11.1375 2.14501 11.1375 2.96251Z",fill:"currentColor"}),i.jsx("path",{d:"M16.125 10.875V11.625C16.125 11.8275 15.9675 11.9925 15.7575 12H14.6625C14.265 12 13.905 11.7075 13.875 11.3175C13.8525 11.085 13.9425 10.8675 14.0925 10.7175C14.2275 10.575 14.415 10.5 14.6175 10.5H15.75C15.9675 10.5075 16.125 10.6725 16.125 10.875Z",fill:"currentColor"}),i.jsx("path",{d:"M14.61 9.7125H15.375C15.7875 9.7125 16.125 9.375 16.125 8.9625V8.6325C16.125 7.08 14.8575 5.8125 13.305 5.8125H4.695C4.0575 5.8125 3.4725 6.0225 3 6.3825C2.3175 6.8925 1.875 7.71 1.875 8.6325V13.68C1.875 15.2325 3.1425 16.5 4.695 16.5H13.305C14.8575 16.5 16.125 15.2325 16.125 13.68V13.5375C16.125 13.125 15.7875 12.7875 15.375 12.7875H14.7225C14.0025 12.7875 13.3125 12.345 13.125 11.6475C12.9675 11.0775 13.155 10.53 13.53 10.1625C13.8075 9.8775 14.19 9.7125 14.61 9.7125ZM10.5 9.5625H5.25C4.9425 9.5625 4.6875 9.3075 4.6875 9C4.6875 8.6925 4.9425 8.4375 5.25 8.4375H10.5C10.8075 8.4375 11.0625 8.6925 11.0625 9C11.0625 9.3075 10.8075 9.5625 10.5 9.5625Z",fill:"currentColor"})]}),xrn=({className:e})=>i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M12.1425 1.5H5.8575C3.1275 1.5 1.5 3.1275 1.5 5.8575V12.135C1.5 14.8725 3.1275 16.5 5.8575 16.5H12.135C14.865 16.5 16.4925 14.8725 16.4925 12.1425V5.8575C16.5 3.1275 14.8725 1.5 12.1425 1.5ZM12.945 7.47L11.2125 9.705C10.995 9.9825 10.6875 10.1625 10.335 10.2C9.9825 10.245 9.6375 10.1475 9.36 9.93L7.9875 8.85C7.935 8.805 7.875 8.805 7.845 8.8125C7.815 8.8125 7.7625 8.8275 7.7175 8.8875L5.9325 11.205C5.82 11.3475 5.655 11.4225 5.49 11.4225C5.37 11.4225 5.25 11.385 5.145 11.3025C4.8975 11.115 4.8525 10.7625 5.04 10.515L6.825 8.1975C7.0425 7.92 7.35 7.74 7.7025 7.695C8.0475 7.65 8.4 7.7475 8.6775 7.965L10.05 9.045C10.1025 9.09 10.155 9.09 10.1925 9.0825C10.2225 9.0825 10.275 9.0675 10.32 9.0075L12.0525 6.7725C12.24 6.525 12.6 6.48 12.84 6.675C13.0875 6.8775 13.1325 7.23 12.945 7.47Z",fill:"white"})}),grn=({className:e})=>i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M12.1425 1.5H5.8575C3.1275 1.5 1.5 3.1275 1.5 5.8575V12.135C1.5 14.8725 3.1275 16.5 5.8575 16.5H12.135C14.865 16.5 16.4925 14.8725 16.4925 12.1425V5.8575C16.5 3.1275 14.8725 1.5 12.1425 1.5ZM7.5975 10.875C7.815 11.0925 7.815 11.4525 7.5975 11.67C7.485 11.7825 7.3425 11.835 7.2 11.835C7.0575 11.835 6.915 11.7825 6.8025 11.67L4.935 9.8025C4.4925 9.36 4.4925 8.6475 4.935 8.205L6.8025 6.3375C7.02 6.12 7.38 6.12 7.5975 6.3375C7.815 6.555 7.815 6.915 7.5975 7.1325L5.73 9L7.5975 10.875ZM13.065 9.795L11.1975 11.6625C11.085 11.775 10.9425 11.8275 10.8 11.8275C10.6575 11.8275 10.515 11.775 10.4025 11.6625C10.185 11.445 10.185 11.085 10.4025 10.8675L12.27 9L10.4025 7.125C10.185 6.9075 10.185 6.5475 10.4025 6.33C10.62 6.1125 10.98 6.1125 11.1975 6.33L13.065 8.1975C13.5075 8.64 13.5075 9.36 13.065 9.795Z",fill:"white"})});nBe();function brn(e){var Q,ne,J,X,re,pe,Y,ie,oe,G;const[t,n]=m.useState(!1),r=m.useRef(null),[s,a]=m.useState(!1),o=m.useRef(null);m.useEffect(()=>{var te;const V=(te=e.advancedFilters)==null?void 0:te.coin;if(e.dataCoin.length>0){const he=V.split(",").map(Ce=>e.dataCoin.find(ce=>ce.value===Ce)).filter(Boolean);e.setSelectedCoins(he)}},[e.dataCoin]),m.useEffect(()=>{var te;const V=(te=e.advancedFilters)==null?void 0:te.refcode;if(V&&e.dataReferral.length>0){const he=V.split(",").map(Ce=>e.dataReferral.find(ce=>ce.value===Ce)).filter(Boolean);e.setSelectedReferrals(he)}},[e.dataReferral]);const l=V=>{if(!V)return;const ae=Array.isArray(V)?V:[V],he=e.selectedCoins||[],Ce=[...he,...ae.filter(Ae=>!he.some(ye=>ye.value===Ae.value))],ge=Ce.map(Ae=>Ae.value).join(",");e.setSelectedCoins(Ce),e.setAdvancedFilters(Ae=>({...Ae,coin:ge}))},c=V=>{if(!V)return;const ae=Array.isArray(V)?V:[V],he=e.selectedReferrals||[],Ce=[...he,...ae.filter(ge=>!he.some(Ae=>Ae.value===ge.value))],ce=Ce.map(ge=>ge.value);ce.join(","),e.setSelectedReferrals(Ce),e.setAdvancedFilters(ge=>({...ge,refcode:ce}))},u=V=>{const{name:te,value:ae}=V.target;e.setAdvancedFilters(he=>({...he,[te]:ae}))},d={control:(V,{isFocused:te})=>{var ae,he,Ce,ce,ge,Ae,ye,je;return{...V,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",border:Array.isArray((ae=e.advancedFilters)==null?void 0:ae.coin)&&((he=e.advancedFilters)==null?void 0:he.coin.length)>0||typeof((Ce=e.advancedFilters)==null?void 0:Ce.coin)=="string"&&((ce=e.advancedFilters)==null?void 0:ce.coin.trim())!==""?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:Array.isArray((ge=e.advancedFilters)==null?void 0:ge.coin)&&((Ae=e.advancedFilters)==null?void 0:Ae.coin.length)>0||typeof((ye=e.advancedFilters)==null?void 0:ye.coin)=="string"&&((je=e.advancedFilters)==null?void 0:je.coin.trim())!==""?"1px solid #8d67ff":"none"}}},menu:V=>({...V,backgroundColor:"#353535",maxWidth:"248px"}),menuList:V=>({...V,backgroundColor:"#353535",maxHeight:"180px",zIndex:50}),clearIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",padding:"0px",paddingRight:"5px",":hover":{color:"white"}}),dropdownIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",alignItems:"center",justifyContent:"center",width:"25px",height:"25px",minWidth:"25px",minHeight:"25px",padding:"0px",paddingRight:"5px",paddingLeft:"5px",display:"none",":hover":{color:"white"}}),indicatorSeparator:()=>({display:"none"}),option:(V,{data:te,isDisabled:ae,isFocused:he,isSelected:Ce})=>{const ce=hi(te.color);return{...V,fontSize:"14px",fontWeight:"600",backgroundColor:ae?void 0:Ce?te.color:he?ce.alpha(.1).css():void 0,color:"white",cursor:ae?"not-allowed":"pointer",":active":{...V[":active"],backgroundColor:ae?void 0:Ce?te.color:ce.alpha(.9).css()}}},multiValue:(V,{data:te})=>{const ae=hi(te.color);return{...V,backgroundColor:ae.alpha(.4).css()}},multiValueLabel:(V,{data:te})=>({...V,color:"white"}),multiValueRemove:(V,{data:te})=>({...V,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:V=>({...V,color:"white"}),valueContainer:V=>({...V,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},f={control:(V,{isFocused:te})=>{var ae,he,Ce,ce,ge,Ae,ye,je;return{...V,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",border:Array.isArray((ae=e.advancedFilters)==null?void 0:ae.refcode)&&((he=e.advancedFilters)==null?void 0:he.refcode.length)>0||typeof((Ce=e.advancedFilters)==null?void 0:Ce.refcode)=="string"&&((ce=e.advancedFilters)==null?void 0:ce.refcode.trim())!==""?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:Array.isArray((ge=e.advancedFilters)==null?void 0:ge.refcode)&&((Ae=e.advancedFilters)==null?void 0:Ae.refcode.length)>0||typeof((ye=e.advancedFilters)==null?void 0:ye.refcode)=="string"&&((je=e.advancedFilters)==null?void 0:je.refcode.trim())!==""?"1px solid #8d67ff":"none"}}},menu:V=>({...V,backgroundColor:"#353535",maxWidth:"248px"}),menuList:V=>({...V,backgroundColor:"#353535",maxHeight:"180px",zIndex:4}),clearIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",padding:"0px",paddingRight:"5px",":hover":{color:"white"}}),dropdownIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",alignItems:"center",justifyContent:"center",width:"25px",height:"25px",minWidth:"25px",minHeight:"25px",padding:"0px",paddingRight:"5px",paddingLeft:"5px",display:"none",":hover":{color:"white"}}),indicatorSeparator:()=>({display:"none"}),option:(V,{data:te,isDisabled:ae,isFocused:he,isSelected:Ce})=>{const ce=hi(te.color);return{...V,fontSize:"14px",fontWeight:"600",backgroundColor:ae?void 0:Ce?te.color:he?ce.alpha(.1).css():void 0,color:"white",cursor:ae?"not-allowed":"pointer",":active":{...V[":active"],backgroundColor:ae?void 0:Ce?te.color:ce.alpha(.9).css()}}},multiValue:(V,{data:te})=>{const ae=hi(te.color);return{...V,backgroundColor:ae.alpha(.4).css()}},multiValueLabel:(V,{data:te})=>({...V,color:"white"}),multiValueRemove:(V,{data:te})=>({...V,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:V=>({...V,color:"white"}),valueContainer:V=>({...V,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},x=(V,te)=>{var he;const ae=(he=te.selectedCoins)==null?void 0:he.filter(Ce=>Ce.value!==V.value);te.setSelectedCoins(ae),te.setAdvancedFilters(Ce=>({...Ce,coin:ae==null?void 0:ae.map(ge=>ge.value)}))},g=(V,te)=>{var he;const ae=(he=te.selectedReferrals)==null?void 0:he.filter(Ce=>Ce.value!==V.value);te.setSelectedReferrals(ae),te.setAdvancedFilters(Ce=>({...Ce,refcode:ae==null?void 0:ae.map(ge=>ge.value)}))};m.useEffect(()=>{const V=te=>{r.current&&!r.current.contains(te.target)&&n(!1)};return document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[]),m.useEffect(()=>{const V=te=>{o.current&&!o.current.contains(te.target)&&a(!1)};return document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[]);const v=async()=>{e.setAdvancedFilters(V=>({...V,user_token:""}))},w=({src:V,alt:te})=>{const[ae,he]=Ne.useState(!1);return ae?i.jsx("div",{className:"rounded-full w-5 h-5 min-w-5 min-h-5 mr-1 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}):i.jsx("img",{src:V,alt:te,className:"rounded-full w-5 h-5 min-w-5 min-h-5 mr-1",loading:"lazy",onError:()=>he(!0)})},C=V=>{const{data:te,innerRef:ae,innerProps:he,selectProps:Ce}=V,ce=Ce.styles.option({},V);return i.jsxs("div",{ref:ae,...he,style:ce,className:"flex items-center p-2",children:[i.jsx(w,{src:te.icon,alt:te.label}),te.label]})},N=(V,te)=>te.reduce((ae,he)=>{const Ce=V[he];return Ce!==void 0&&Ce!==""&&Ce!==null&&ae++,ae},0),I=()=>{const V=e.advancedFilters.is_favorite_wallet?"":!0;e.setAdvancedFilters(te=>({...te,is_favorite_wallet:V}))},P=["min_pnl","max_pnl","min_win_complated_rate","max_win_complated_rate","min_complated_trades_count","max_complated_trades_count","min_complated_win_count","max_complated_win_count","min_complated_loss_count","max_complated_loss_count","min_long_kar","max_long_kar","min_short_kar","max_short_kar","min_long_win_rate","max_long_win_rate","min_short_win_rate","max_short_win_rate","min_rTx_count","max_rTx_count"],R=["min_pnl","max_pnl"],F=["min_uPnl","max_uPnl","max_sharpe","min_sharpe","max_growth_rate","min_growth_rate","max_perp_dd","min_perp_dd","max_perp_dd_pnl","min_perp_dd_pnl","min_perp_equity","max_perp_equity","min_margin_roi","max_margin_roi","min_margin_used_percentage","max_margin_used_percentage","min_margin_used","max_margin_used","min_avg_uLeverage_value","max_avg_uLeverage_value","min_funding","max_funding","min_rToken_count","max_rToken_count","min_uToken_count","max_uToken_count"],U=["min_uPnl","max_uPnl","max_perp_dd_pnl","min_perp_dd_pnl","min_perp_equity","max_perp_equity","min_margin_roi","max_margin_roi","min_margin_used_percentage","max_margin_used_percentage","min_margin_used","max_margin_used","min_avg_uLeverage_value","max_avg_uLeverage_value","min_funding","max_funding","min_uToken_count","max_uToken_count"],L=["min_uPnl","max_uPnl","max_perp_dd_pnl","min_perp_dd_pnl","min_perp_equity","max_perp_equity","min_margin_roi","max_margin_roi","min_margin_used_percentage","max_margin_used_percentage","min_margin_used","max_margin_used","min_avg_uLeverage_value","max_avg_uLeverage_value","min_funding","max_funding","min_rToken_count","max_rToken_count","min_uToken_count","max_uToken_count"],z=["min_first_time","max_first_time","min_end_time","max_end_time"];return i.jsxs("div",{className:"text-white flex flex-wrap justify-start sm:justify-center font-manrope gap-4 pt-2",children:[i.jsxs("div",{className:"col-span-1 flex flex-col justify-start gap-[7px] w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Search Wallet"}),i.jsx("div",{onClick:()=>{v()},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"flex items-center relative",children:[i.jsx("input",{value:(Q=e.advancedFilters)==null?void 0:Q.user_token,onChange:u,type:"text",name:"user_token",placeholder:"Search Wallet",className:`${(ne=e.advancedFilters)!=null&&ne.user_token?"border border-[#8d67ff]":""} py-[4px] bg-[#353535] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-full sm:w-full pl-[30px] pr-2 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[32px]`}),i.jsx(_y,{className:"text-[#646464] absolute left-1.5"})]})]}),e.period!=999&&i.jsxs("div",{className:"col-span-1 flex flex-col gap-[7px] justify-start w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Search Coin"}),i.jsx("div",{onClick:()=>{e.setSelectedCoins([]),e.setAdvancedFilters(V=>({...V,coin:[]}))},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear Coins"})})]}),i.jsx("div",{className:"float-left w-full",ref:r,children:i.jsxs("div",{className:"min-w-full relative",children:[i.jsx(_y,{className:"text-[#646464] absolute left-[6px] top-[7px] z-10"}),i.jsx(Cl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataCoin.filter(V=>Array.isArray(e.selectedCoins)&&!e.selectedCoins.some(te=>te.value===V.value)),components:{Option:C},styles:d,onChange:l,menuIsOpen:t,onMenuOpen:()=>n(!0),placeholder:e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Search Coin"}),noOptionsMessage:()=>e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"No data available"})}),i.jsx("div",{className:`absolute top-[220px] z-[4] left-0 w-full max-w-[248px] bg-[#303030] flex flex-wrap gap-1 p-2 border border-[#3a3a3a] mt-1 ${t?"block":"hidden"} ${t&&((J=e.selectedCoins)==null?void 0:J.length)>0?"block":"hidden"}`,children:e.selectedCoins&&((X=e.selectedCoins)==null?void 0:X.map(V=>i.jsxs("div",{className:"h-6 pl-1 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex",children:[i.jsx(w,{src:V==null?void 0:V.icon,alt:V==null?void 0:V.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:te=>{te.stopPropagation(),x(V,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(tw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))}),i.jsx("div",{className:`${((re=e.selectedCoins)==null?void 0:re.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[248px]`,children:e.selectedCoins&&((pe=e.selectedCoins)==null?void 0:pe.map(V=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-1.5 flex",children:[i.jsx(w,{src:V==null?void 0:V.icon,alt:V==null?void 0:V.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:()=>x(V,e),className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(tw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))})]})})]}),i.jsxs("div",{className:"flex justify-between items-center gap-1 w-full h-8 bg-[#353535] rounded-xl px-2.5",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1 w-max",children:[i.jsx("div",{style:{boxShadow:"0px 4px 24px 0px #FF600A, 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"},className:"w-[18px] h-[18px] px-2 py-1.5 bg-gradient-to-b from-[#ff7200] to-[#ff2525] rounded-[5px] flex justify-center items-center",children:i.jsx("img",{src:nke,alt:"",className:"w-[9.67px] h-[12px] min-w-[9.67px] min-h-[12px]"})}),i.jsx("span",{className:"text-white text-[13px] font-semibold font-['Manrope'] leading-[8px] ml-1",children:"Show Popular Wallets"})]}),i.jsx("div",{onClick:I,style:{boxShadow:"0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"},className:`w-[17px] h-[17px] rounded-md flex items-center justify-center transition-all
${e.advancedFilters.is_favorite_wallet?"bg-[#3ec78c] border-[#3ec78c]":"bg-transparent border border-[#12d782]"}
cursor-pointer
`,children:e.advancedFilters.is_favorite_wallet&&i.jsx("svg",{className:"w-[12px] h-[12px] text-[#0c623d]",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})})}),i.jsx("input",{type:"checkbox",checked:e.advancedFilters.is_favorite_wallet===!0,onChange:I,className:"hidden"})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[7px] justify-start w-full z-3 bg-[#353535] rounded-xl pt-3 pb-1 px-1",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{style:{boxShadow:"0px 4px 24px 0px #9137FF, 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"},className:"flex justify-center items-center w-[18px] h-[18px] px-2 py-1.5 bg-[#8b2cff] rounded-[5px] ml-[5px]",children:i.jsx("img",{src:byt,alt:"",className:"w-[16px] h-[16px] min-w-[16px] min-h-[16px]"})}),i.jsx("div",{className:"flex justify-start text-white text-[13px] font-semibold font-['Manrope'] leading-[8px] ml-[5px]",children:"Filter by Referrer"})]}),i.jsxs("div",{className:"flex flex-col gap-[7px] bg-[#1f1f1f] rounded-xl p-2.5",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-['Manrope'] leading-[8px]",children:"Filter by Referrer"})}),i.jsx("div",{onClick:()=>{e.setSelectedReferrals([]),e.setAdvancedFilters(V=>({...V,refcode:[]}))},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsx("div",{className:"float-left w-full",ref:o,children:i.jsxs("div",{className:"min-w-full relative",children:[i.jsx(_y,{className:`${t?"-z-10":"z-10"} text-[#646464] absolute left-[6px] top-[7px]`}),i.jsx(Cl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataReferral.filter(V=>Array.isArray(e.selectedReferrals)&&!e.selectedReferrals.some(te=>te.value===V.value)),styles:f,onChange:c,menuIsOpen:s,onMenuOpen:()=>a(!0),placeholder:e.isLoadingReferral?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Search Referrer"}),noOptionsMessage:()=>e.isLoadingReferral?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"No data available"})}),i.jsx("div",{className:`absolute top-[220px] z-[4] left-0 w-full max-w-[248px] bg-[#303030] flex flex-wrap gap-1 p-2 border border-[#3a3a3a] mt-1 ${s?"block":"hidden"} ${s&&((Y=e.selectedReferrals)==null?void 0:Y.length)>0?"block":"hidden"}`,children:e.selectedReferrals&&((ie=e.selectedReferrals)==null?void 0:ie.map(V=>i.jsxs("div",{className:"h-6 pl-1 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex",children:[i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:te=>{te.stopPropagation(),g(V,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(tw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))}),i.jsx("div",{className:`${((oe=e.selectedReferrals)==null?void 0:oe.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[248px]`,children:e.selectedReferrals&&((G=e.selectedReferrals)==null?void 0:G.map(V=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-1.5 flex",children:[i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:()=>g(V,e),className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(tw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))})]})})]})]}),i.jsxs(OY,{title:"Wallet Filters",titleInfo:N(e.advancedFilters,e.period!=999?P:R),icon:i.jsx(mrn,{className:"text-white"}),children:[i.jsx(Ol,{minFilterType:e.advancedFilters.min_pnl,maxFilterType:e.advancedFilters.max_pnl,handleChange:u,minInputName:"min_pnl",maxInputName:"max_pnl",name:"PnL",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_win_complated_rate,maxFilterType:e.advancedFilters.max_win_complated_rate,handleChange:u,minInputName:"min_win_complated_rate",maxInputName:"max_win_complated_rate",name:"Win Rate",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_complated_trades_count,maxFilterType:e.advancedFilters.max_complated_trades_count,handleChange:u,minInputName:"min_complated_trades_count",maxInputName:"max_complated_trades_count",name:"Trades Count",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_complated_win_count,maxFilterType:e.advancedFilters.max_complated_win_count,handleChange:u,minInputName:"min_complated_win_count",maxInputName:"max_complated_win_count",name:"Win Count",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_complated_loss_count,maxFilterType:e.advancedFilters.max_complated_loss_count,handleChange:u,minInputName:"min_complated_loss_count",maxInputName:"max_complated_loss_count",name:"Loss Count",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_long_kar,maxFilterType:e.advancedFilters.max_long_kar,handleChange:u,minInputName:"min_long_kar",maxInputName:"max_long_kar",name:"Long PnL",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_short_kar,maxFilterType:e.advancedFilters.max_short_kar,handleChange:u,minInputName:"min_short_kar",maxInputName:"max_short_kar",name:"Short PnL",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_rTx_count,maxFilterType:e.advancedFilters.max_rTx_count,handleChange:u,minInputName:"min_rTx_count",maxInputName:"max_rTx_count",name:"Tx Count",isTooltip:!1})]}),i.jsxs(OY,{title:"Performance Filters",titleInfo:N(e.advancedFilters,e.period==999?U:e.period==1?L:F),icon:i.jsx(xrn,{}),children:[i.jsx(Ol,{minFilterType:e.advancedFilters.min_uPnl,maxFilterType:e.advancedFilters.max_uPnl,handleChange:u,minInputName:"min_uPnl",maxInputName:"max_uPnl",name:"uPnL",isTooltip:!1}),e.period!=1&&e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_growth_rate,maxFilterType:e.advancedFilters.max_growth_rate,handleChange:u,minInputName:"min_growth_rate",maxInputName:"max_growth_rate",name:"Growth Rate",isTooltip:!1}),e.period!=1&&e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_perp_dd,maxFilterType:e.advancedFilters.max_perp_dd,handleChange:u,minInputName:"min_perp_dd",maxInputName:"max_perp_dd",name:"Drawdown",isTooltip:!1}),e.period!=1&&e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_sharpe,maxFilterType:e.advancedFilters.max_sharpe,handleChange:u,minInputName:"min_sharpe",maxInputName:"max_sharpe",name:"Sharpe",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_perp_equity,maxFilterType:e.advancedFilters.max_perp_equity,handleChange:u,minInputName:"min_perp_equity",maxInputName:"max_perp_equity",name:"Perp Equity",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_margin_roi,maxFilterType:e.advancedFilters.max_margin_roi,handleChange:u,minInputName:"min_margin_roi",maxInputName:"max_margin_roi",name:"ROE",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_margin_used_percentage,maxFilterType:e.advancedFilters.max_margin_used_percentage,handleChange:u,minInputName:"min_margin_used_percentage",maxInputName:"max_margin_used_percentage",name:"Margin %",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_margin_used,maxFilterType:e.advancedFilters.max_margin_used,handleChange:u,minInputName:"min_margin_used",maxInputName:"max_margin_used",name:"Margin Used",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_avg_uLeverage_value,maxFilterType:e.advancedFilters.max_avg_uLeverage_value,handleChange:u,minInputName:"min_avg_uLeverage_value",maxInputName:"max_avg_uLeverage_value",name:"Avg. Lvg.",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_funding,maxFilterType:e.advancedFilters.max_funding,handleChange:u,minInputName:"min_funding",maxInputName:"max_funding",name:"Funding",isTooltip:!1}),e.period!=999&&i.jsx(Ol,{minFilterType:e.advancedFilters.min_rToken_count,maxFilterType:e.advancedFilters.max_rToken_count,handleChange:u,minInputName:"min_rToken_count",maxInputName:"max_rToken_count",name:"rToken",isTooltip:!1}),i.jsx(Ol,{minFilterType:e.advancedFilters.min_uToken_count,maxFilterType:e.advancedFilters.max_uToken_count,handleChange:u,minInputName:"min_uToken_count",maxInputName:"max_uToken_count",name:"uToken",isTooltip:!1})]}),e.period!=999&&i.jsxs(OY,{title:"Date Filters",titleInfo:N(e.advancedFilters,z),icon:i.jsx(grn,{}),children:[i.jsx(q6e,{minFilterType:e.advancedFilters.min_first_time,maxFilterType:e.advancedFilters.max_first_time,advancedFilters:e.advancedFilters,setAdvancedFilters:e.setAdvancedFilters,minInputName:"min_first_time",maxInputName:"max_first_time",name:"First Tx Time",minValue:e.minFirstValue,maxValue:e.maxFirstValue,setMinValue:e.setMinFirstValue,setMaxValue:e.setMaxFirstValue,setFilters:e.setFilters}),i.jsx(q6e,{minFilterType:e.advancedFilters.min_end_time,maxFilterType:e.advancedFilters.max_end_time,advancedFilters:e.advancedFilters,setAdvancedFilters:e.setAdvancedFilters,minInputName:"min_end_time",maxInputName:"max_end_time",name:"Last Tx Time",minValue:e.minEndValue,maxValue:e.maxEndValue,setMinValue:e.setMinEndValue,setMaxValue:e.setMaxEndValue,setFilters:e.setFilters})]})]})}const yrn=({period:e,advancedFilters:t,setAdvancedFilters:n,resetFilters:r,setFilters:s,minFirstValue:a,setMinFirstValue:o,maxFirstValue:l,setMaxFirstValue:c,minEndValue:u,setMinEndValue:d,maxEndValue:f,setMaxEndValue:x,dataCoin:g,selectedCoins:v,setSelectedCoins:w,isLoadingCoin:C,setIsLoadingCoin:N,dataReferral:I,selectedReferrals:P,setSelectedReferrals:R,isLoadingReferral:F,setIsLoadingReferral:U})=>{const[L,z]=m.useState(!1);return m.useEffect(()=>{localStorage.getItem("fire_ref_modal_seen")||z(!0)},[]),i.jsx(i.Fragment,{children:i.jsxs("div",{className:"bg-[#232323] rounded-2xl min-h-[340px] sm:max-h-full lg:min-h-[66vh] order-last lg:order-none lg:w-min min-w-[286px] lg:max-w-[286px] p-1 py-3 font-manrope overflow-hidden relative h-[calc(100vh-150px)] sm:h-[calc(100vh-125px)]",children:[i.jsxs("div",{className:"w-full flex justify-between items-center pt-[2px] pl-3 pr-1 pb-[10px]",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[8px]",children:"Filters"}),i.jsx("div",{className:"flex sm:hidden justify-center",children:i.jsx("div",{onClick:()=>s(),className:"w-[134px] h-6 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] pointer-events-none",children:"Search"})})}),i.jsx("div",{onClick:()=>{r()},className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex mr-3 cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("div",{className:"h-full w-full overflow-y-scroll font-manrope py-1 px-3",children:i.jsx("div",{className:"font-manrope font-normal pb-[120px] sm:pb-[80px] max-w-full lg:max-w-[256px]",children:i.jsx(brn,{period:e,resetFilters:r,setFilters:s,advancedFilters:t,setAdvancedFilters:n,minFirstValue:a,setMinFirstValue:o,maxFirstValue:l,setMaxFirstValue:c,minEndValue:u,setMinEndValue:d,maxEndValue:f,setMaxEndValue:x,dataCoin:g,selectedCoins:v,setSelectedCoins:w,isLoadingCoin:C,setIsLoadingCoin:N,dataReferral:I,selectedReferrals:P,setSelectedReferrals:R,isLoadingReferral:F,setIsLoadingReferral:U})})}),i.jsx("div",{className:"hidden sm:block absolute bottom-0 w-full",children:i.jsx("div",{className:"sticky h-12 bg-[#1b1b1b]/30 rounded-bl-2xl rounded-br-2xl border-t border-[#353535] backdrop-blur-[32px] min-h-14 pt-[11px] w-full z-10",children:i.jsx("div",{className:"flex justify-center -ml-3",children:i.jsx("div",{onClick:()=>s(),className:"w-[234px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] pointer-events-none",children:"Search"})})})})})]})})},CUe=()=>i.jsxs("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:[i.jsx("div",{className:"p-4 bg-#FFA756 bg-opacity-20 rounded-full",children:i.jsx("img",{src:$bt,alt:"",className:"w-8 h-8"})}),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx("div",{className:"text-#FFA756",children:"No Data"}),i.jsxs("div",{className:"text-#767676",children:["There isn't any data"," ",i.jsxs("span",{children:["for this",i.jsx("br",{})," time range at the moment"]})]})]})]}),G6e=({content:e,positionTop:t,alignRight:n,type:r})=>{const s=e?r==="coin"?e.split(", ").map(a=>{const[o,l]=a.split(" (");return{name:o,value:l==null?void 0:l.replace(")","")}}):r==="position"?e==null?void 0:e.map(a=>({name:a.coin,value:a.unrealized_pnl})):[]:[];return i.jsx("span",{className:`tooltip ${n?"left-5 top-1/2 -translate-y-1/2 ":t?"-top-6 translate-x-[10%] -left-[20%]":"-top-6 translate-x-[10%] right-[20%] mr-9"} transform text-white font-manrope font-semibold text-xs leading-3 whitespace-nowrap mt-1`,children:i.jsxs("div",{className:`${t?"ml-6":"mr-6"} border border-[#404040] bg-[#222222] p-2 rounded-sm relative`,children:[i.jsx("div",{className:"overflow-y-auto scroll-design-search-scroll w-max min-h-[31px] h-max max-h-[160px]",children:i.jsx("ul",{style:{margin:0,padding:0,listStyle:"none"},children:(s==null?void 0:s.length)>0?s==null?void 0:s.map((a,o)=>i.jsxs("li",{className:`${o===(s==null?void 0:s.length)-1?"mb-0":"mb-[5px]"} flex justify-between pl-1 pr-2 h-max p-2 rounded border border-[#7d7c7c]`,children:[i.jsx("span",{className:`${(a==null?void 0:a.value)==null||isNaN(parseFloat(a==null?void 0:a.value))||(a==null?void 0:a.value)==0?"text-white":(a==null?void 0:a.value)>0?"text-[#1DE6A3]":"text-[#FF7173]"} flex justify-start items-center gap-1 min-w-20 border-r border-white`,children:a==null?void 0:a.name}),i.jsx("span",{className:`${(a==null?void 0:a.value)==null||isNaN(parseFloat(a==null?void 0:a.value))||(a==null?void 0:a.value)==0?"text-white":(a==null?void 0:a.value)>0?"text-[#1DE6A3]":"text-[#FF7173]"} pl-4`,children:`${(a==null?void 0:a.value)==null||isNaN(parseFloat(a==null?void 0:a.value))?"-":Is(Math.abs(a==null?void 0:a.value))}`})]},o)):i.jsx("span",{children:"No data available"})})}),i.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`absolute transform -z-1 ${n?"-rotate-90 left-1 -translate-x-full -translate-y-1/2 top-1/2 ":t?"-left-2 top-[15%] -rotate-90 -translate-y-1/2":"-right-2 top-[15%] rotate-90 -translate-y-1/2"}`,children:i.jsx("path",{d:"M3.70096 1.25C4.27831 0.25 5.72169 0.25 6.29904 1.25L8.89711 5.75C9.47446 6.75 8.75278 8 7.59808 8H2.40192C1.24722 8 0.525536 6.75 1.10289 5.75L3.70096 1.25Z",fill:"#404040",stroke:"#404040"})})]})})},kce=({periods:e,selectedPeriod:t,handlePeriod:n,borderColor:r})=>i.jsx(i.Fragment,{children:e?i.jsx("div",{className:`${r=="ticker"?"border-[#333333]":"border-[#232323]"} flex items-center justify-center w-max h-[28px] rounded-lg border font-manrope p-[3px] `,children:e.map((s,a)=>i.jsx("button",{onClick:o=>n(o.target.dataset.value),"data-value":s.value,className:`${s.value===t?"bg-[#3d3d3d] text-white":"bg-transparent text-[#9b9b9b]"} flex justify-center items-center uppercase font-manrope focus:outline-none focus:ring-0 border-none rounded-md text-xs font-bold leading-[8px] tracking-wide h-5 w-[35.5px] sm:w-[48px]`,children:s.name},a))}):null});function vrn({currentPage:e,offset:t,setOffset:n,totalPage:r,totalWalletCount:s}){return i.jsxs("header",{className:"flex items-center justify-between gap-2 z-4 bg-[#161616] font-manrope",children:[i.jsxs("div",{className:"flex justify-center items-center gap-1",children:[i.jsx(Si,{className:"text-white hidden sm:block"}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("span",{className:"text-white text-[12px] font-semibold font-manrope leading-[14px]",children:s}),i.jsx("span",{className:"text-[#7e7e7e] text-[12px] font-semibold font-manrope leading-[14px]",children:"wallets found"})]})]}),i.jsxs("div",{className:"flex items-center justify-start gap-[4px]",children:[i.jsx("button",{onClick:e===1?()=>{}:()=>n(t===0?0:t-50),type:"button",className:e===1?"relative inline-flex items-center p-1.5 text-sm font-medium text-white/20 rounded-md focus:ring-0 focus:outline-none border-none cursor-not-allowed bg-[#3d3d3d] w-6 h-6":"relative inline-flex items-center p-1.5 rounded-md bg-[#3d3d3d] text-sm font-medium text-white hover:bg-white/40 focus:outline-none focus:ring-0 border-none focus:z-10",children:i.jsx(Yh,{className:`${e===1?"text-white/30":"text-white"} w-3 h-3 rotate-90`})}),i.jsxs("div",{type:"button",className:"-ml-px relative inline-flex items-center px-2 py-2 bg-[#3d3d3d]/60 text-sm font-medium text-white focus:z-10 focus:outline-none focus:ring-0 outline-none min-w-max h-6 max-h-6 rounded-md",children:[e," / ",r]}),i.jsx("button",{onClick:e===r||r===0?()=>{}:()=>n(t+50),type:"button",className:e===r?"bg-[#3d3d3d] w-6 h-6 cursor-not-allowed relative inline-flex items-center p-1.5 rounded-md text-sm font-medium text-black focus:z-10 focus:outline-none focus:ring-0 border-none":"relative inline-flex items-center p-1.5 rounded-md bg-[#3d3d3d] w-6 h-6 text-sm font-medium text-white hover:bg-white/40 focus:z-10 focus:outline-none focus:ring-0 border-none",children:i.jsx(Yh,{className:`${e===r?"text-white/30":"text-white"} w-3 h-3 -rotate-90`})})]})]})}const wrn=({info1:e,info2:t,padding:n,icon:r,info1_Color:s,info2_Color:a,rowTwo:o,info3:l})=>i.jsxs("div",{className:`${n||"pl-1 pr-2"} flex flex-col gap-2 font-manrope`,children:[t&&i.jsx("div",{className:`${a} text-xs font-normal not-italic font-inter flex items-center justify-end leading-3 min-w-max text-white`,children:t}),i.jsxs("div",{className:`${s} ${o?"-mt-3.5":""} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:[i.jsx("img",{src:r,alt:"",className:""}),l?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#1DE6A3]",children:e})," /"," ",i.jsx("span",{className:"text-[#FF7173]",children:l})]}):e]})]});function Crn({open:e,setOpen:t}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4",children:[i.jsx("div",{className:"text-center text-white text-[32px] font-manrope font-semibold leading-loose",children:"Coming Soon"}),i.jsx("div",{className:"w-[300px] text-center text-white/60 text-sm font-medium font-manrope leading-[18px] tracking-[0.28px] pt-4 pb-8 px-5",children:"Join Dextrabot on Discord for the latest features and announcements!"}),i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank"),t(!1)},className:"flex justify-center items-center w-[348px] h-12 bg-[#7446FF] rounded-2xl mt-2 cursor-pointer",children:i.jsx("div",{className:"text-center text-white text-sm font-semibold font-manrope leading-[0.28px] tracking-tight",children:"Join Dextrabot on Discord"})})]})]})})})})})]})}function Srn(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}const Nrn=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Ty(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let rC=null;function SUe(e={}){return rC||(e.includeStyleProperties?(rC=e.includeStyleProperties,rC):(rC=Ty(window.getComputedStyle(document.documentElement)),rC))}function UL(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Arn(e){const t=UL(e,"border-left-width"),n=UL(e,"border-right-width");return e.clientWidth+t+n}function jrn(e){const t=UL(e,"border-top-width"),n=UL(e,"border-bottom-width");return e.clientHeight+t+n}function NUe(e,t={}){const n=t.width||Arn(e),r=t.height||jrn(e);return{width:n,height:r}}function Ern(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Af=16384;function _rn(e){(e.width>Af||e.height>Af)&&(e.width>Af&&e.height>Af?e.width>e.height?(e.height*=Af/e.width,e.width=Af):(e.width*=Af/e.height,e.height=Af):e.width>Af?(e.height*=Af/e.width,e.width=Af):(e.width*=Af/e.height,e.height=Af))}function zL(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function krn(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Trn(e,t,n){const r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),s.appendChild(a),a.appendChild(e),krn(s)}const af=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||af(n,t)};function Irn(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Prn(e,t){return SUe(t).map(n=>{const r=e.getPropertyValue(n),s=e.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function Frn(e,t,n,r){const s=`.${e}:${t}`,a=n.cssText?Irn(n):Prn(n,r);return document.createTextNode(`${s}{${a}}`)}function K6e(e,t,n,r){const s=window.getComputedStyle(e,n),a=s.getPropertyValue("content");if(a===""||a==="none")return;const o=Nrn();try{t.className=`${t.className} ${o}`}catch{return}const l=document.createElement("style");l.appendChild(Frn(o,n,s,r)),t.appendChild(l)}function Orn(e,t,n){K6e(e,t,":before",n),K6e(e,t,":after",n)}const Y6e="application/font-woff",X6e="image/jpeg",Mrn={woff:Y6e,woff2:Y6e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:X6e,jpeg:X6e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Rrn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Tce(e){const t=Rrn(e).toLowerCase();return Mrn[t]||""}function Lrn(e){return e.split(/,/)[1]}function Ane(e){return e.search(/^(data:)/)!==-1}function Drn(e,t){return`data:${t};base64,${e}`}async function AUe(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const s=await r.blob();return new Promise((a,o)=>{const l=new FileReader;l.onerror=o,l.onloadend=()=>{try{a(n({res:r,result:l.result}))}catch(c){o(c)}},l.readAsDataURL(s)})}const MY={};function Brn(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Ice(e,t,n){const r=Brn(e,t,n.includeQueryParams);if(MY[r]!=null)return MY[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const a=await AUe(e,n.fetchRequestInit,({res:o,result:l})=>(t||(t=o.headers.get("Content-Type")||""),Lrn(l)));s=Drn(a,t)}catch(a){s=n.imagePlaceholder||"";let o=`Failed to fetch resource: ${e}`;a&&(o=typeof a=="string"?a:a.message),o&&console.warn(o)}return MY[r]=s,s}async function $rn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):zL(t)}async function Urn(e,t){if(e.currentSrc){const a=document.createElement("canvas"),o=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,o==null||o.drawImage(e,0,0,a.width,a.height);const l=a.toDataURL();return zL(l)}const n=e.poster,r=Tce(n),s=await Ice(n,r,t);return zL(s)}async function zrn(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await uU(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Hrn(e,t){return af(e,HTMLCanvasElement)?$rn(e):af(e,HTMLVideoElement)?Urn(e,t):af(e,HTMLIFrameElement)?zrn(e,t):e.cloneNode(jUe(e))}const Vrn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",jUe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Wrn(e,t,n){var r,s;if(jUe(t))return t;let a=[];return Vrn(e)&&e.assignedNodes?a=Ty(e.assignedNodes()):af(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=Ty(e.contentDocument.body.childNodes):a=Ty(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),a.length===0||af(e,HTMLVideoElement)||await a.reduce((o,l)=>o.then(()=>uU(l,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function qrn(e,t,n){const r=t.style;if(!r)return;const s=window.getComputedStyle(e);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):SUe(n).forEach(a=>{let o=s.getPropertyValue(a);a==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),af(e,HTMLIFrameElement)&&a==="display"&&o==="inline"&&(o="block"),a==="d"&&t.getAttribute("d")&&(o=`path(${t.getAttribute("d")})`),r.setProperty(a,o,s.getPropertyPriority(a))})}function Grn(e,t){af(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),af(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Krn(e,t){if(af(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(s=>e.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function Yrn(e,t,n){return af(t,Element)&&(qrn(e,t,n),Orn(e,t,n),Grn(e,t),Krn(e,t)),t}async function Xrn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const l=n[a].getAttribute("xlink:href");if(l){const c=e.querySelector(l),u=document.querySelector(l);!c&&u&&!r[l]&&(r[l]=await uU(u,t,!0))}}const s=Object.values(r);if(s.length){const a="http://www.w3.org/1999/xhtml",o=document.createElementNS(a,"svg");o.setAttribute("xmlns",a),o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.overflow="hidden",o.style.display="none";const l=document.createElementNS(a,"defs");o.appendChild(l);for(let c=0;c<s.length;c++)l.appendChild(s[c]);e.appendChild(o)}return e}async function uU(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Hrn(r,t)).then(r=>Wrn(e,r,t)).then(r=>Yrn(e,r,t)).then(r=>Xrn(r,t))}const EUe=/url\((['"]?)([^'"]+?)\1\)/g,Qrn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Zrn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Jrn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function esn(e){const t=[];return e.replace(EUe,(n,r,s)=>(t.push(s),n)),t.filter(n=>!Ane(n))}async function tsn(e,t,n,r,s){try{const a=n?Srn(t,n):t,o=Tce(t);let l;return s||(l=await Ice(a,o,r)),e.replace(Jrn(t),`$1${l}$3`)}catch{}return e}function nsn(e,{preferredFontFormat:t}){return t?e.replace(Zrn,n=>{for(;;){const[r,,s]=Qrn.exec(n)||[];if(!s)return"";if(s===t)return`src: ${r};`}}):e}function _Ue(e){return e.search(EUe)!==-1}async function kUe(e,t,n){if(!_Ue(e))return e;const r=nsn(e,n);return esn(r).reduce((a,o)=>a.then(l=>tsn(l,o,t,n)),Promise.resolve(r))}async function sC(e,t,n){var r;const s=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(s){const a=await kUe(s,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function rsn(e,t){await sC("background",e,t)||await sC("background-image",e,t),await sC("mask",e,t)||await sC("-webkit-mask",e,t)||await sC("mask-image",e,t)||await sC("-webkit-mask-image",e,t)}async function ssn(e,t){const n=af(e,HTMLImageElement);if(!(n&&!Ane(e.src))&&!(af(e,SVGImageElement)&&!Ane(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,s=await Ice(r,Tce(r),t);await new Promise((a,o)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...c)=>{try{a(t.onImageErrorHandler(...c))}catch(u){o(u)}}:o;const l=e;l.decode&&(l.decode=a),l.loading==="lazy"&&(l.loading="eager"),n?(e.srcset="",e.src=s):e.href.baseVal=s})}async function isn(e,t){const r=Ty(e.childNodes).map(s=>TUe(s,t));await Promise.all(r).then(()=>e)}async function TUe(e,t){af(e,Element)&&(await rsn(e,t),await ssn(e,t),await isn(e,t))}function asn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(s=>{n[s]=r[s]}),e}const Q6e={};async function Z6e(e){let t=Q6e[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Q6e[e]=t,t}async function J6e(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async o=>{let l=o.replace(r,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),AUe(l,t.fetchRequestInit,({result:c})=>(n=n.replace(o,`url(${c})`),[o,c]))});return Promise.all(a).then(()=>n)}function eCe(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=s.exec(r);if(c===null)break;t.push(c[0])}r=r.replace(s,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(o,"gi");for(;;){let c=a.exec(r);if(c===null){if(c=l.exec(r),c===null)break;a.lastIndex=l.lastIndex}else l.lastIndex=a.lastIndex;t.push(c[0])}return t}async function osn(e,t){const n=[],r=[];return e.forEach(s=>{if("cssRules"in s)try{Ty(s.cssRules||[]).forEach((a,o)=>{if(a.type===CSSRule.IMPORT_RULE){let l=o+1;const c=a.href,u=Z6e(c).then(d=>J6e(d,t)).then(d=>eCe(d).forEach(f=>{try{s.insertRule(f,f.startsWith("@import")?l+=1:s.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:f,error:x})}})).catch(d=>{console.error("Error loading remote css",d.toString())});r.push(u)}})}catch(a){const o=e.find(l=>l.href==null)||document.styleSheets[0];s.href!=null&&r.push(Z6e(s.href).then(l=>J6e(l,t)).then(l=>eCe(l).forEach(c=>{o.insertRule(c,o.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(s=>{if("cssRules"in s)try{Ty(s.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${s.href}`,a)}}),n))}function lsn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>_Ue(t.style.getPropertyValue("src")))}async function csn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Ty(e.ownerDocument.styleSheets),r=await osn(n,t);return lsn(r)}function IUe(e){return e.trim().replace(/["']/g,"")}function usn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(IUe(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function dsn(e,t){const n=await csn(e,t),r=usn(e);return(await Promise.all(n.filter(a=>r.has(IUe(a.style.fontFamily))).map(a=>{const o=a.parentStyleSheet?a.parentStyleSheet.href:null;return kUe(a.cssText,o,t)}))).join(`
`)}async function fsn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await dsn(e,t);if(n){const r=document.createElement("style"),s=document.createTextNode(n);r.appendChild(s),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function hsn(e,t={}){const{width:n,height:r}=NUe(e,t),s=await uU(e,t,!0);return await fsn(s,t),await TUe(s,t),asn(s,t),await Trn(s,n,r)}async function psn(e,t={}){const{width:n,height:r}=NUe(e,t),s=await hsn(e,t),a=await zL(s),o=document.createElement("canvas"),l=o.getContext("2d"),c=t.pixelRatio||Ern(),u=t.canvasWidth||n,d=t.canvasHeight||r;return o.width=u*c,o.height=d*c,t.skipAutoScale||_rn(o),o.style.width=`${u}`,o.style.height=`${d}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,o.width,o.height)),l.drawImage(a,0,0,o.width,o.height),o}async function I1(e,t={}){return(await psn(e,t)).toDataURL()}function msn({open:e,setOpen:t,data:n,setTradeInfo:r,period:s}){const a=m.useRef(null),o=async()=>{if(a.current)try{await document.fonts.ready,await new Promise(u=>setTimeout(u,500));const l=await I1(a.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),c=document.createElement("a");c.href=l,c.download="dextrabot.png",document.body.appendChild(c),c.click(),document.body.removeChild(c),ln.success("PNG successfully downloaded!")}catch(l){console.error("Error generating PNG:",l),ln.error("Failed to download PNG.")}};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(l=>({...l,pnl:0,winRate:0,tradeCount:0,longWinRate:0,shortWinRate:0,leverage:0,roe:0,unrealizedPnL:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:a,style:{overflow:"visible",position:"relative"},className:"w-[838px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[830px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[482px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[42px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:`${s==999?"mt-20":"mt-[44px]"} flex flex-col items-start justify-start gap-2 `,children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"PnL"}),i.jsx("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[66px] font-semibold font-manrope leading-[52px] inline-flex justify-center items-center min-w-max`,children:(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`$${Is(Math.abs(n==null?void 0:n.pnl))}`})]}),i.jsxs("div",{className:`${s==999?"hidden":""} flex justify-start items-start gap-[65px] pt-[26px]`,children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max min-w-[140px]",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"WIN RATE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.winRate)==null||isNaN(parseFloat(n==null?void 0:n.winRate))?"--":(n==null?void 0:n.winRate)+"%"}`})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"TX COUNT"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.tradeCount)==null||isNaN(parseFloat(n==null?void 0:n.tradeCount))?"--":Is(n==null?void 0:n.tradeCount)}`})]})]}),i.jsxs("div",{className:`${s==999?"hidden":""} flex justify-start items-start gap-[65px] pt-[8px]`,children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"LONG WIN RATE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.longWinRate)==null||isNaN(parseFloat(n==null?void 0:n.longWinRate))?"--":(n==null?void 0:n.longWinRate)+"%"}`})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"SHORT WIN RATE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.shortWinRate)==null||isNaN(parseFloat(n==null?void 0:n.shortWinRate))?"--":(n==null?void 0:n.shortWinRate)+"%"}`})]})]}),(n==null?void 0:n.referral)&&i.jsx("div",{className:`${s==999?"pt-[150px]":"pt-[26px]"} flex justify-start items-start gap-[65px]`,children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral?"pt-[1px]":s==999?"pt-[240px]":"pt-[82px]"} flex justify-start items-start `,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:(n==null?void 0:n.pnl)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Numbers don’t lie! 🔥 Total Profit:"," ",(n==null?void 0:n.pnl)>=0?"":"-",(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`$${Is(Math.abs(n==null?void 0:n.pnl))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders and save 4% on fees using my referral: ",n==null?void 0:n.referral," ","@Dextrabot"," "]}):i.jsxs("span",{children:["Numbers don’t lie! 🔥 Total Profit:"," ",(n==null?void 0:n.pnl)>=0?"":"-",(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`$${Is(Math.abs(n==null?void 0:n.pnl))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders! @Dextrabot"]})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:l=>{l.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:()=>{o()},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Numbers%20don’t%20lie!%20🔥%20Total%20Profit:%20${(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`${(n==null?void 0:n.pnl)>=0?"":"-"}%24${Is(Math.abs(n==null?void 0:n.pnl))}`}%20🚀%20Tap%20into%20the%20best%20trades%20with%20Dextrabot%20on%20Hyperliquid!%20Copy%20top%20traders${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20and%20save%204%25%20on%20fees%20using%20my%20referral:%20${n==null?void 0:n.referral}`:"!"}%20%40Dextrabot%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}function xsn({open:e,setOpen:t,data:n,setTradeInfo:r}){const s=m.useRef(null),a=async()=>{if(s.current)try{await document.fonts.ready,await new Promise(c=>setTimeout(c,500));const o=await I1(s.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),l=document.createElement("a");l.href=o,l.download="dextrabot.png",document.body.appendChild(l),l.click(),document.body.removeChild(l),ln.success("PNG successfully downloaded!")}catch(o){console.error("Error generating PNG:",o),ln.error("Failed to download PNG.")}};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(o=>({...o,pnl:0,winRate:0,tradeCount:0,longWinRate:0,shortWinRate:0,leverage:0,roe:0,unrealizedPnL:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:s,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[42px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsx("div",{className:"flex justify-start items-center gap-2 relative mt-16",children:i.jsx("div",{className:"bg-[#67ffbd]/20 text-[#67ffbd] h-9 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide",children:`${(n==null?void 0:n.leverage)==null||isNaN(parseFloat(n==null?void 0:n.leverage))?"--":`${parseFloat(n==null?void 0:n.leverage).toFixed(2)}x`}`})}),i.jsxs("div",{className:`${(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.roe)>=0?"+":"-",`${(n==null?void 0:n.roe)==null||isNaN(parseFloat(n==null?void 0:n.roe))?"--":`${Is(Math.abs(n==null?void 0:n.roe))}%`}`]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[22px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max min-w-[130px]",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"UNREALIZED PNL"}),i.jsx("div",{className:`${(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))||(n==null?void 0:n.unrealizedPnL)==0?"text-white":(n==null?void 0:n.unrealizedPnL)>0?"text-[#1DE6A3]":"text-[#FF7173]"} text-[32px] font-semibold font-manrope leading-none flex`,children:(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`$${Is(Math.abs(n==null?void 0:n.unrealizedPnL))}`})]})}),(n==null?void 0:n.referral)&&i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[26px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral?"pt-[16px]":"pt-[112px]"} flex justify-start items-start`,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[398px] overflow-hidden",children:(n==null?void 0:n.roe)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Numbers don’t lie! 🔥 Unrealized PnL:"," ",(n==null?void 0:n.unrealizedPnL)>=0?"":"-",(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`$${Is(Math.abs(n==null?void 0:n.unrealizedPnL))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders and save 4% on fees using my referral: ",n==null?void 0:n.referral," ","@Dextrabot"," "]}):i.jsxs("span",{children:["Numbers don’t lie! 🔥 Unrealized PnL:"," ",(n==null?void 0:n.unrealizedPnL)>=0?"":"-",(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`$${Is(Math.abs(n==null?void 0:n.unrealizedPnL))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders! @Dextrabot"]})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:o=>{o.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:()=>{a()},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Numbers%20don’t%20lie!%20🔥%20Unrealized%20PnL:%20${(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`${(n==null?void 0:n.unrealizedPnL)>=0?"":"-"}$${Is(Math.abs(n==null?void 0:n.unrealizedPnL))}`}%20🚀%20Tap%20into%20the%20best%20trades%20with%20Dextrabot%20on%20Hyperliquid!%20Copy%20top%20traders${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20and%20save%204%25%20on%20fees%20using%20my%20referral:%20${n==null?void 0:n.referral}`:"!"}%20%40Dextrabot%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}const PUe=()=>{const[e,t]=m.useState(!1);m.useEffect(()=>{(()=>{localStorage.getItem("isCopyTradeIntroductionModal")||(t(!0),localStorage.removeItem("copyTradeIntroductionModal"))})()},[]),m.useEffect(()=>{const r=s=>{s.key==="Escape"&&(localStorage.setItem("isCopyTradeIntroductionModal","true"),t(!1))};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[]);const n=()=>{localStorage.setItem("isCopyTradeIntroductionModal","true"),t(!1)};return i.jsxs(Ea,{open:e,onClose:n,className:"relative z-50 font-manrope hidden lg:block",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#1b1b1b] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[480px] h-max relative bg-[#1b1b1b] rounded-3xl pb-8",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{n()},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#67FFBD52]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-2 px-2",children:i.jsx("img",{src:eyt,alt:""})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4 pt-[14px]",children:[i.jsxs("div",{className:"text-center justify-center",children:[i.jsxs("span",{className:"text-white text-2xl font-semibold font-manrope leading-7 tracking-tight",children:["You can start"," "]}),i.jsx("span",{className:"text-[#67ffbd] text-2xl font-semibold font-manrope leading-7 tracking-tight",children:"Copy Trading"}),i.jsxs("span",{className:"text-white text-2xl font-semibold font-manrope leading-7 tracking-tight",children:[" ","now!"]})]}),i.jsx("div",{className:"w-[320px] text-center justify-start text-[#979797] text-[13px] font-normal font-manrope leading-4 tracking-tight",children:"Hyperliquid Copy Trading is live on Dextrabot. Best wallets. Auto trades. Simple. 🚀"})]})]})})})})})]})},gsn=({info1:e,info2:t,info3:n,padding:r,icon:s,info1_Color:a,info2_Color:o,info3_Color:l,rowTwo:c})=>i.jsx("div",{className:`${r||"pl-1 pr-2"} flex flex-col gap-2 font-manrope`,children:i.jsx("div",{className:`${c?"-mt-3.5":""} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] text-white`,children:e=="--"&&t=="--"&&n=="--"?"--":i.jsxs(i.Fragment,{children:[i.jsx("span",{className:`${a}`,children:`${e}/`}),i.jsx("span",{className:`${o}`,children:`${t}/`}),i.jsx("span",{className:`${l}`,children:`${n}`})]})})}),bsn=({setCurrentPage:e,offset:t,setOffset:n,setTotalPage:r,setTotalWalletCount:s,period:a,periods:o,totalPage:l,totalWalletCount:c,currentPage:u,handlePeriodChange:d})=>{const[f,x]=m.useState([]),[g,v]=m.useState(!0),[w,C]=m.useState(null),{hyperToken:N,copyTradeWatchList:I,getCopyTradeWatchList:P,trackedWatchList:R,getTrackedWatchList:F,setSignModalOpen:U,setTelegramChatId:L,setSubscriberRole:z,setSubsExpireDay:Q,setMushboomerETH:ne,setMushboomerSOL:J,setIsReferralCode:X,isReferralCodeName:re,setIsReferralCodeName:pe,setIsWhitelist:Y,setHyperToken:ie,setHyperAddress:oe}=m.useContext(Qr),{isConnected:G,address:V}=Jr();il(),Mc();const[te,ae]=m.useState(!1),[he,Ce]=m.useState(null),[ce,ge]=m.useState(null),[Ae,ye]=m.useState(""),[je,Ie]=m.useState(""),[Re,Qe]=m.useState(""),[$e,it]=m.useState(""),[tt,ot]=m.useState(""),[ft,ct]=m.useState([]),[Vt,It]=m.useState(!0),[an,Nt]=m.useState([]),[mn,dn]=m.useState([]),[Pt,Xe]=m.useState(!0),[Ut,Lt]=m.useState([]),[qe,Ke]=m.useState(!1),[pt,en]=m.useState(!1),Bt=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_pnl`,Et=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_dd`,et=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_growth_rate`,Be=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_sharpe`;function Mt(Oe){if(!Oe)return"--";const rn=parseInt(Oe==null?void 0:Oe.split(":")[0]),cn=parseInt(Oe==null?void 0:Oe.split(":")[1]);return`${rn}h ${cn}m`}m.useEffect(()=>{(async()=>{var _t,Yn;const rn=window.localStorage.getItem("hyperToken"),cn=window.localStorage.getItem("hyperAddress");if(!(!rn||!cn))try{const yn=await ji(cn.toLowerCase(),rn);yn!=null&&yn.success?(L(yn==null?void 0:yn.telegram_chat_id),z(yn==null?void 0:yn.subscriber_role),Q(yn==null?void 0:yn.subs_expire_day),ne((_t=yn==null?void 0:yn.mushboomer_counts)==null?void 0:_t.eth),J((Yn=yn==null?void 0:yn.mushboomer_counts)==null?void 0:Yn.sol),X(yn==null?void 0:yn.referral_code),pe(yn==null?void 0:yn.refcode),Y(yn==null?void 0:yn.whitelist),ie(rn),oe(cn)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ie(""),oe(""))}catch(yn){console.error("Token verification error:",yn),console.error(yn.message||"An unknown error occurred.")}})()},[]);const Ve={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{(async()=>{var rn,cn;try{const Yn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),yn=()=>hi.random().hex(),Dt=(cn=(rn=Yn.coins)==null?void 0:rn.filter(sn=>!sn.startsWith("@")&&!sn.endsWith("/USDC")))==null?void 0:cn.map(sn=>({value:sn,label:sn.endsWith("/USDC")?sn+" (Spot)":sn,color:yn(),icon:`https://app.hyperliquid.xyz/coins/${Ve[sn]||(sn==null?void 0:sn.split("/")[0])}.svg`}));ct(Dt),It(!1)}catch(_t){console.error("Data retrieval error:",_t),It(!1)}})()},[]),m.useEffect(()=>{(async()=>{var rn,cn;try{const Yn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_refcodes/")).json(),yn=()=>hi.random().hex(),Dt=(cn=(rn=Yn==null?void 0:Yn.refcodes)==null?void 0:rn.filter(sn=>sn.code!=="DEXTRABOT"))==null?void 0:cn.slice(0,1300).map(sn=>({value:sn.code,label:sn.code,color:yn()}));dn(Dt),Xe(!1)}catch(_t){console.error("Data retrieval error:",_t),Xe(!1)}})()},[]);const ut=Oe=>{const rn=["Growth Rate","Drawdown","Drawdown PnL","Sharpe"],cn=[{header:"Popular Wallet",value:_t=>{const Yn=Number(_t.copier_count)||0;return Yn===0?"":Yn<=5?"F":Yn<=10?"FF":"FFF"}},{header:"Wallet",value:_t=>_t.user_token},{header:"PnL",value:_t=>(_t==null?void 0:_t[Bt])==null||isNaN(+(_t==null?void 0:_t[Bt]))?"--":`$${Is(_t==null?void 0:_t[Bt])}`},{header:"uPnL",value:_t=>_t.total_unrealized_pnl==null||isNaN(+_t.total_unrealized_pnl)?"--":`$${Is(_t.total_unrealized_pnl)}`},{header:"Perp Equity",value:_t=>_t.portfolio_perp_all_time_value==null||isNaN(+_t.portfolio_perp_all_time_value)?"--":`$${Is(Math.abs(_t.portfolio_perp_all_time_value))}`},{header:"Win Rate",value:_t=>_t.win_complated_rate==null||isNaN(+_t.win_complated_rate)||Oe==999?"--":`%${Math.abs(_t.win_complated_rate)}`},{header:"Trades Count",value:_t=>_t.complated_trades_count==null||isNaN(+_t.complated_trades_count)||Oe==999?"--":`${Is(Math.abs(_t.complated_trades_count))}`},{header:"Win Count",value:_t=>_t.complated_win_count==null||isNaN(+_t.complated_win_count)||Oe==999?"--":`${Is(Math.abs(_t.complated_win_count))}`},{header:"Loss Count",value:_t=>_t.complated_loss_count==null||isNaN(+_t.complated_loss_count)?"--":`${Is(Math.abs(_t.complated_loss_count))}`},{header:"Long PnL",value:_t=>_t.long_kar==null||isNaN(+_t.long_kar)||Oe==999?"--":`$${Is(Math.abs(_t.long_kar))}`},{header:"Short PnL",value:_t=>_t.short_kar==null||isNaN(+_t.short_kar)||Oe==999?"--":`$${Is(_t.short_kar)}`},{header:"Growth Rate",value:_t=>(_t==null?void 0:_t[et])==null||isNaN(+(_t==null?void 0:_t[et]))||Oe==1||Oe==999?"--":`%${Is(_t==null?void 0:_t[et])}`},{header:"Drawdown",value:_t=>(_t==null?void 0:_t[Et])==null||isNaN(+(_t==null?void 0:_t[Et]))||Oe==999?"--":`%${Is(_t==null?void 0:_t[Et])}`},{header:"Sharpe",value:_t=>(_t==null?void 0:_t[Be])==null||isNaN(+(_t==null?void 0:_t[Be]))||Oe==999?"--":`${_t==null?void 0:_t[Be]}`},{header:"Tx Count",value:_t=>_t.rtx_count==null||isNaN(+_t.rtx_count)||Oe==999?"--":`${Is(_t.rtx_count)}`},{header:"ROE (%)",value:_t=>_t.margin_roi==null||isNaN(+_t.margin_roi)?"--":`${Is(_t.margin_roi)}%`},{header:"Margin / Used",value:_t=>_t.margin_used==null||isNaN(+_t.margin_used)||_t.margin_percentage==null||isNaN(+_t.margin_percentage)?"--":`${Is(_t.margin_used)} / %${parseFloat(_t.margin_percentage).toFixed(2)}`},{header:"Avg. Lvg.",value:_t=>_t.avg_uleverage_value==null||isNaN(+_t.avg_uleverage_value)?"--":`${parseFloat(_t.avg_uleverage_value).toFixed(2)}x`},{header:"Funding",value:_t=>_t.funding==null||isNaN(+_t.funding)?"--":`$${Is(_t.funding)}`},{header:"rToken #",value:_t=>_t.token_count==null||isNaN(+_t.token_count)||Oe==999?"--":Is(_t.token_count)},{header:"uToken #",value:_t=>_t.position_count==null||isNaN(+_t.position_count)?"--":Is(_t.position_count)},{header:"Avg. Dur.",value:_t=>Oe==999?"--":`${Mt(_t.complated_avg_duration)}`},{header:"First Tx Time",value:_t=>Oe==999?"--":PI(_t.first_time)},{header:"Last Tx Time",value:_t=>Oe==999?"--":PI(_t.end_time)}];return Oe===1?cn.filter(_t=>!rn.includes(_t.header)):cn},xt=()=>{if(!(f!=null&&f.length))return;const Oe=new Date,rn=Kn=>Kn.toString().padStart(2,"0"),cn=`discoverwallet_${rn(Oe.getDate())}${rn(Oe.getMonth()+1)}${Oe.getFullYear()}_${rn(Oe.getHours())}${rn(Oe.getMinutes())}.csv`,_t=ut(a),Yn=_t.map(Kn=>`"${Kn.header}"`).join(","),yn=f==null?void 0:f.map(Kn=>_t==null?void 0:_t.map(ir=>`"${ir.value(Kn)}"`).join(",")),Dt=new Blob([Yn+`\r
`+yn.join(`\r
`)],{type:"text/csv;charset=utf-8;"}),sn=URL.createObjectURL(Dt);Object.assign(document.createElement("a"),{href:sn,download:cn}).click(),URL.revokeObjectURL(sn)},[jt,kt]=m.useState("-perp_pnl"),[xn,un]=m.useState({max_first_time:"",min_first_time:"",max_end_time:"",min_end_time:"",max_short_kar:"",min_short_kar:"",max_long_kar:"",min_long_kar:"",max_pnl:"",min_pnl:"",max_uPnl:"",min_uPnl:"",max_rToken_count:"",min_rToken_count:"",max_uToken_count:"",min_uToken_count:"",max_perp_equity:"",min_perp_equity:"",max_margin_used:"",min_margin_used:"",max_margin_used_percentage:"",min_margin_used_percentage:"",max_avg_uLeverage_value:"",min_avg_uLeverage_value:"",max_funding:"",min_funding:"",max_margin_roi:"",min_margin_roi:"",max_rTx_count:"",min_rTx_count:"",max_sharpe:"",min_sharpe:"",max_growth_rate:"",min_growth_rate:"",max_perp_dd:"",min_perp_dd:"",max_perp_dd_pnl:"",min_perp_dd_pnl:"",max_win_complated_rate:"",min_win_complated_rate:"",max_complated_trades_count:"",min_complated_trades_count:"",max_complated_win_count:"",min_complated_win_count:"",max_complated_loss_count:"",min_complated_loss_count:"",user_token:"",coin:"",refcode:"",is_favorite_wallet:""});m.useEffect(()=>{async function Oe(){try{v(!0);const rn={period:a===999?"all_time":a,order:jt,offset:t===-50?"0":t.toString(),limit:"50",...xn},cn=Object.entries(rn).filter(([sn,Tn])=>Tn!=null).map(([sn,Tn])=>`${encodeURIComponent(sn)}=${encodeURIComponent(Tn)}`).join("&"),_t=`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?${cn}`,Yn=await fetch(_t.toString());if(!Yn.ok)throw new Error(`HTTP error! status: ${Yn.status}`);const yn=await Yn.json();r(Math.ceil(yn.count/50)),s(yn.count),e((t+50)/50),window.localStorage.getItem("hyperToken")&&(P(),F()),x(yn.results)}catch(rn){x([]),console.error("Error fetching data:",rn),C(rn.message)}finally{v(!1)}}Oe()},[t,jt,a]);async function On(Oe){try{v(!0);const rn={period:a===999?"all_time":a,order:jt,offset:t===-50?"0":t.toString(),limit:"50",...xn},cn=Object.entries(rn).filter(([sn,Tn])=>Tn!=null).map(([sn,Tn])=>`${encodeURIComponent(sn)}=${encodeURIComponent(Tn)}`).join("&"),_t=`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?${cn}`,Yn=await fetch(_t);if(!Yn.ok)throw new Error(`HTTP error! status: ${Yn.status}`);const yn=await Yn.json();e(1),r(Math.ceil(yn.count/50)),s(yn.count),n(0),window.localStorage.getItem("hyperToken")&&(P(),F()),x(yn.results)}catch(rn){x([]),console.error("Error fetching data:",rn),C(rn.message)}finally{v(!1)}}async function En(Oe){try{v(!0);const rn=await fetch(`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?period=${a==999?"all_time":a}&order=${jt}&offset=0&limit=50`);if(!rn.ok)throw new Error(`HTTP error! status: ${rn.status}`);const cn=await rn.json();e(50/50),r(Math.ceil(cn.count/50)),s(cn.count),n(0),x(cn.results),window.localStorage.getItem("hyperToken")&&(P(),F()),un({max_first_time:"",min_first_time:"",max_end_time:"",min_end_time:"",max_short_kar:"",min_short_kar:"",max_long_kar:"",min_long_kar:"",max_pnl:"",min_pnl:"",max_uPnl:"",min_uPnl:"",max_rToken_count:"",min_rToken_count:"",max_uToken_count:"",min_uToken_count:"",max_perp_equity:"",min_perp_equity:"",max_margin_used:"",min_margin_used:"",max_margin_used_percentage:"",min_margin_used_percentage:"",max_avg_uLeverage_value:"",min_avg_uLeverage_value:"",max_funding:"",min_funding:"",max_margin_roi:"",min_margin_roi:"",max_rTx_count:"",min_rTx_count:"",max_sharpe:"",min_sharpe:"",max_growth_rate:"",min_growth_rate:"",max_perp_dd:"",min_perp_dd:"",max_perp_dd_pnl:"",min_perp_dd_pnl:"",max_win_complated_rate:"",min_win_complated_rate:"",max_complated_trades_count:"",min_complated_trades_count:"",max_complated_win_count:"",min_complated_win_count:"",max_complated_loss_count:"",min_complated_loss_count:"",user_token:"",coin:"",refcode:"",is_favorite_wallet:""}),Ie(""),Qe(""),it(""),ot(""),Nt([])}catch(rn){x([]),console.error("Error resetting filters:",rn),C(rn.message)}finally{v(!1)}}const jn=async({walletAddress:Oe,isFollow:rn,isScalper:cn})=>{try{ye(Oe);const _t=window.localStorage.getItem("hyperToken"),Yn=window.localStorage.getItem("hyperAddress");if(!_t){U(!0);return}const yn=rn?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",Dt=rn?{address:V?V.toLowerCase():Yn,token:_t,follow_address:Oe.toLowerCase()}:{address:V?V.toLowerCase():Yn,token:_t},sn=await fetch(yn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Dt)});if(!sn.ok)throw new Error(`Server responded with status ${sn.status}`);const Tn=await sn.json();Tn.success?(Ce(Array.isArray(Tn==null?void 0:Tn.data)?[...Tn.data].sort((Kn,ir)=>new Date(ir.created_at||0)-new Date(Kn.created_at||0)):Tn==null?void 0:Tn.data),ge(cn),ae(!0)):(console.log(Tn.error_message),ln.error(Tn.error_message))}catch(_t){console.error("Error in like function:",_t),ln.error(_t.message||"Something went wrong!")}},bn=Oe=>Oe>=640&&Oe<1024?7:Oe>=1024&&Oe<1240?6:Oe>=1240&&Oe<1540?7:Oe>=1540?10:4,[Zn,zn]=m.useState(!1),[$n,nr]=m.useState(!1),[wn,on]=m.useState({pnl:0,winRate:0,tradeCount:0,longWinRate:0,shortWinRate:0,leverage:0,roe:0,unrealizedPnL:0,referral:""});return i.jsxs(i.Fragment,{children:[i.jsx(PUe,{}),i.jsx(Crn,{open:qe,setOpen:Ke}),i.jsx(v5,{open:te,setOpen:ae,copyTradeData:he,setCopyTradeData:Ce,copyTradeWallet:Ae,setCopyTradeWallet:ye,isScalper:ce}),i.jsx(msn,{open:Zn,setOpen:zn,data:wn,setTradeInfo:on,period:a}),i.jsx(xsn,{open:$n,setOpen:nr,data:wn,setTradeInfo:on}),i.jsxs("div",{className:"block lg:hidden w-full p-2 space-y-2",children:[i.jsx(rMe,{}),i.jsx("button",{className:"px-2 py-2 text-xs font-bold rounded-2xl border border-gray-600 text-white hover:bg-[#1D1D1D] bg-[#171717] h-8 font-manrope w-full",onClick:xt,children:"Export CSV"})]}),i.jsx("div",{className:"lg:hidden flex w-full p-2",children:i.jsx("button",{className:"px-2 py-2 text-xs font-medium rounded-2xl border border-gray-600 text-white hover:bg-[#1D1D1D] w-full bg-[#171717]",onClick:()=>en(!pt),children:pt?"Hide Filters":"Show Filters"})}),i.jsxs("div",{className:"flex-grow flex flex-col lg:flex-row items-start justify-start gap-2 lg:gap-6 bg-[#161616] w-full h-full overflow-y-scroll pl-1 sm:pl-4 pt-1 sm:pt-4 pr-0.5 pb-3 font-manrope relative",children:[i.jsx("div",{className:`${pt?"block":"hidden"} lg:flex flex-shrink-0 lg:w-auto w-full lg:max-w-none max-w-full h-full`,children:i.jsx(yrn,{period:a,advancedFilters:xn,setAdvancedFilters:un,resetFilters:En,setFilters:On,minFirstValue:je,setMinFirstValue:Ie,maxFirstValue:Re,setMaxFirstValue:Qe,minEndValue:$e,setMinEndValue:it,maxEndValue:tt,setMaxEndValue:ot,dataCoin:ft,selectedCoins:an,setSelectedCoins:Nt,isLoadingCoin:Vt,setIsLoadingCoin:It,dataReferral:mn,selectedReferrals:Ut,setSelectedReferrals:Lt,isLoadingReferral:Pt,setIsLoadingReferral:Xe})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[10px] bg-[#161616] max-h-full lg:min-w-0 lg:flex-grow max-w-full lg:max-w-none overflow-auto font-manrope",children:[i.jsxs("div",{className:"sticky sm:static top-0 sm:mt-2 flex flex-row sm:flex-col items-center sm:items-start justify-between sm:justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] pl-2 sm:pl-0 pb-2 sm:pb-0 pr-2 sm:pr-0 z-10",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 min-w-max mt-[10px] sm:mt-0",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-[16px] sm:text-[18px] font-medium font-manrope leading-[21px]",children:"Discover Wallets"})})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-end sm:items-center justify-between w-full gap-1 pr-0 sm:pr-2",children:[i.jsx("div",{className:"flex",children:i.jsx(kce,{periods:o,selectedPeriod:a,handlePeriod:d,borderColor:"discover"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(vrn,{offset:t,setOffset:n,totalPage:l,totalWalletCount:c,currentPage:u}),i.jsx("div",{className:"hidden lg:block",children:i.jsx("button",{className:"px-2 py-2 text-xs font-bold rounded-2xl border border-gray-600 text-white hover:bg-[#1D1D1D] bg-[#171717] h-8 font-manrope",onClick:xt,children:"Export CSV"})})]})]})]}),i.jsx("div",{className:"w-full overflow-scroll h-[calc(100vh-200px)] flex-grow bg-[#161616] rounded mt-2 sm:mt-0",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-10",children:[i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-0 h-10 pl-2 sm:pl-4 min-w-[130px] sm:min-w-[130px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max ",children:i.jsx("div",{className:"flex items-center justify-start group",children:"Action"})})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[130px] h-10 px-1 min-w-[50px] sm:min-w-[50px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:["🔥",i.jsx("span",{className:"",children:i.jsx(ro,{content:"🔥🔥🔥 Copytrend indicator. More flames = more followers.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[215px] min-w-[215px] leading-[16px] -mb-5"})})]})}),i.jsx(Ko,{title:"",sortKey:"copier_count",sortOption:jt,setSortOption:kt,isFilterIcon:!1,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[180px] h-10 px-1 min-w-[120px] sm:min-w-[140px] z-[7]",children:i.jsx(Ko,{title:"Wallet",sortKey:"user_token",sortOption:jt,setSortOption:kt,isFilterIcon:!1,isFilter:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[140px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Realized profit/loss from completed trades.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[200px] min-w-[200px] leading-[16px] -mb-5"})})]})}),i.jsx(Ko,{title:"PnL",sortKey:"perp_pnl",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[140px] sm:min-w-[170px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"uPnL",sortKey:"total_unrealized_pnl",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[150px] sm:min-w-[170px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Perp Equity",sortKey:"portfolio_perp_all_time_value",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[140px] sm:min-w-[165px] px-1"}`,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Win Rate",sortKey:"win_complated_rate",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[170px] sm:min-w-[200px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Total/Win/Loss",sortKey:"complated_trades_count",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[160px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Long PnL",sortKey:"long_kar",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[160px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Short PnL",sortKey:"short_kar",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==1||a==999?"min-w-[120px] sm:min-w-[150px] px-1":"min-w-[150px] sm:min-w-[170px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:`${a==1||a==999?"flex":"hidden"} justify-end items-center has-tooltip relative`,children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Available for 7, 30, 90 days",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] h-10 -mb-2"})})]})}),a==1||a==999?i.jsx("div",{className:"flex items-center justify-start",children:"Growth Rate"}):i.jsx(Ko,{title:"Growth Rate",sortKey:"growth_rate",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==1||a==999?"min-w-[120px] sm:min-w-[140px] px-1":"min-w-[140px] sm:min-w-[160px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:`${a==1||a==999?"flex":"hidden"} justify-end items-center has-tooltip relative`,children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Available for 7, 30, 90 days",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] h-10 -mb-2"})})]})}),a==1||a==999?i.jsx("div",{className:"flex items-center justify-start",children:"Drawdown"}):i.jsx(Ko,{title:"Drawdown",sortKey:"perp_dd",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==1||a==999?"min-w-[100px] sm:min-w-[120px] px-1":"min-w-[120px] sm:min-w-[145px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:a==1||a==999?"Available for 7, 30, 90 days":"Sharpe_tooltip",positionTop:!1,alignRight:!1,tooltipCss:a==1||a==999?"max-w-[180px] min-w-[180px] leading-[16px] h-10 -mb-2":"max-w-[80px] min-w-[80px] leading-[16px] -mb-12"})})]})}),a==1||a==999?i.jsx("div",{className:"flex items-center justify-start",children:"Sharpe"}):i.jsx(Ko,{title:"Sharpe",sortKey:"sharpe",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[150px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Tx Count",sortKey:"rtx_count",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[135px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"ROE",sortKey:"margin_roi",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[125px] sm:min-w-[150px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Margin",sortKey:"margin_percentage",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[150px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Avg. Lvg.",sortKey:"avg_uleverage_value",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[125px] sm:min-w-[155px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Funding",sortKey:"funding",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[150px] pr-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"rToken #",sortKey:"token_count",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"min-w-[120px] sm:min-w-[150px] pl-1 pr-7":"min-w-[120px] sm:min-w-[150px] pr-1"}`,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"uToken #",sortKey:"position_count",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[120px] sm:min-w-[150px] pr-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Ko,{title:"Avg. Dur.",sortKey:"complated_avg_duration",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[140px] sm:min-w-[160px] pl-1 pr-1.5"} `,children:i.jsx(Ko,{title:"First Tx Time",sortKey:"first_time",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[150px] sm:min-w-[180px] pl-1 pr-7"} `,children:i.jsx(Ko,{title:"Last Tx Time",sortKey:"end_time",sortOption:jt,setSortOption:kt,isFilterIcon:!0,isFilter:!1})})]})}),i.jsx("tbody",{children:!f||g?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:bn(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[46vh] lg:min-h-[66vh] flex-col justify-center items-center fixed top-[20%] lg:top-[25%] left-[45%] sm:left-[50%] lg:left-[60%] 2xl:left-[55%] z-10",children:i.jsx(Da,{})})})}):w&&!f?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:bn(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[46vh] lg:min-h-[66vh] flex-col justify-center items-center fixed top-[20%] lg:top-[25%] left-[45%] sm:left-[50%] lg:left-[60%] 2xl:left-[55%] z-10",children:i.jsx(Error,{})})})}):(f==null?void 0:f.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:bn(window.innerWidth),className:"h-[30vh]",children:!pt&&i.jsx("div",{className:"flex flex-col justify-center items-center fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",children:i.jsx(CUe,{})})})}):f&&(f==null?void 0:f.map((Oe,rn)=>i.jsxs(Ne.Fragment,{children:[i.jsxs("tr",{className:`${rn%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} relative group hover:bg-[#222222] h-[56px] max-h-[56px] text-white rounded-2xl`,style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:`${rn%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222] sm:rounded-l-2xl`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-4 h-14 max-h-14 rounded-2xl",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{onClick:cn=>{cn.preventDefault();const _t=I==null?void 0:I.some(Yn=>Yn.wallet_address===(Oe==null?void 0:Oe.user_token));jn({walletAddress:Oe==null?void 0:Oe.user_token,isFollow:_t,isScalper:Oe==null?void 0:Oe.is_scalper})},className:`
${I.some(cn=>cn.wallet_address===(Oe==null?void 0:Oe.user_token))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"}
h-[22px] rounded-[256px] justify-center items-center gap-1 inline-flex cursor-pointer text-xs font-['Manrope'] leading-[8px] tracking-tight px-2 min-w-max`,children:"Copy Trade"}),i.jsx(y5,{walletAddress:Oe==null?void 0:Oe.user_token,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:R.some(cn=>cn.wallet_address===(Oe==null?void 0:Oe.user_token))?i.jsx("img",{src:a5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${rn%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} sm:sticky sm:left-[130px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 mr-6 sm:mr-0",children:i.jsx("div",{className:"pl-2 pr-2 flex flex-col gap-2 font-manrope hover:scale-125 transition-transform duration-150 cursor-pointer",children:i.jsxs("div",{className:"flex items-center justify-end gap-[3px]",children:[i.jsx("div",{className:`${Oe!=null&&Oe.is_favorite_wallet?"":"hidden"} relative w-1 h-[16px] bg-[#4a3131] rounded-md`,children:i.jsx("div",{className:`${(Oe==null?void 0:Oe.copier_count)>=1&&(Oe==null?void 0:Oe.copier_count)<=5?"bg-[#FFAA22] shadow-[0px_2px_4px_0px_rgba(255,170,34,0.32)]":(Oe==null?void 0:Oe.copier_count)>5&&(Oe==null?void 0:Oe.copier_count)<=10?"bg-[#FF8C00] shadow-[0px_2px_4px_0px_rgba(255,140,0,0.32)]":(Oe==null?void 0:Oe.copier_count)>10?"bg-gradient-to-b from-[#ff0000] to-[#ff8c00] shadow-[0px_2px_4px_0px_rgba(255,45,45,0.32)]":"bg-[#FF8C00] shadow-[0px_2px_4px_0px_rgba(255,140,0,0.32)]"} absolute bottom-0 w-full rounded-md`,style:{height:`${(Oe==null?void 0:Oe.copier_count)>=1&&(Oe==null?void 0:Oe.copier_count)<=5?25:(Oe==null?void 0:Oe.copier_count)>5&&(Oe==null?void 0:Oe.copier_count)<=10?50:(Oe==null?void 0:Oe.copier_count)>10?100:0}%`,transition:"height 0.3s ease"}})}),i.jsx("span",{className:"text-[14px] text-white font-semibold font-manrope leading-[8px]",children:Oe!=null&&Oe.is_favorite_wallet?"🔥":""})]})})})})}),i.jsx("td",{scope:"row",className:`${rn%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} sm:sticky sm:left-[180px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Oe==null?void 0:Oe.user_token}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 mr-6 sm:mr-0",children:[i.jsx(aa,{info1:`${(Oe==null?void 0:Oe.user_token).slice(0,5)+"..."+(Oe==null?void 0:Oe.user_token).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:cn=>{cn.stopPropagation(),navigator.clipboard.writeText(Oe==null?void 0:Oe.user_token),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})})}),i.jsx("td",{className:"",children:i.jsxs("div",{onClick:cn=>{cn.preventDefault(),(Oe==null?void 0:Oe[Bt])!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe[Bt]))&&(on(_t=>({..._t,pnl:Oe==null?void 0:Oe[Bt],winRate:Oe==null?void 0:Oe.win_complated_rate,tradeCount:Oe==null?void 0:Oe.rtx_count,longWinRate:Oe==null?void 0:Oe.long_win_rate,shortWinRate:Oe==null?void 0:Oe.short_win_rate,roe:Oe==null?void 0:Oe.margin_roi,referral:window.localStorage.getItem("hyperToken")?re:null})),zn(!0))},className:`${(Oe==null?void 0:Oe[Bt])!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe[Bt]))?"cursor-pointer":""} flex justify-end items-center gap-1 min-w-max px-1`,children:[i.jsx(aa,{info1:`$${Is(Math.abs(Oe==null?void 0:Oe[Bt]))}`,info1_Color:`${(Oe==null?void 0:Oe[Bt])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Bt]))||(Oe==null?void 0:Oe[Bt])==0?"text-white":(Oe==null?void 0:Oe[Bt])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1}),(Oe==null?void 0:Oe[Bt])!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe[Bt]))&&i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:xm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{className:"",children:i.jsxs("div",{onClick:cn=>{cn.preventDefault(),(Oe==null?void 0:Oe.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))&&(on(_t=>({..._t,pnl:Oe==null?void 0:Oe[Bt],unrealizedPnL:Oe==null?void 0:Oe.total_unrealized_pnl,roe:Oe==null?void 0:Oe.margin_roi,leverage:Oe==null?void 0:Oe.avg_uleverage_value,referral:N?re:null})),nr(!0))},className:`${(Oe==null?void 0:Oe.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))?"cursor-pointer":""} flex justify-end items-center gap-1 min-w-max px-1`,children:[i.jsx(aa,{info1:(Oe==null?void 0:Oe.total_unrealized_pnl)==null||isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))?"--":`$${Is(Math.abs(Oe==null?void 0:Oe.total_unrealized_pnl))}`,info1_Color:`${(Oe==null?void 0:Oe.total_unrealized_pnl)==null||isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))||(Oe==null?void 0:Oe.total_unrealized_pnl)==0?"text-white":(Oe==null?void 0:Oe.total_unrealized_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1}),(Oe==null?void 0:Oe.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))&&i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:xm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{className:"",children:i.jsx(aa,{info1:(Oe==null?void 0:Oe.portfolio_perp_all_time_value)==null||isNaN(parseFloat(Oe==null?void 0:Oe.portfolio_perp_all_time_value))?"--":`$${Is(Math.abs(Oe==null?void 0:Oe.portfolio_perp_all_time_value))}`,info1_Color:`${(Oe==null?void 0:Oe.portfolio_perp_all_time_value)==null||isNaN(parseFloat(Oe==null?void 0:Oe.portfolio_perp_all_time_value))||(Oe==null?void 0:Oe.portfolio_perp_all_time_value)==0?"text-white":(Oe==null?void 0:Oe.portfolio_perp_all_time_value)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:(Oe==null?void 0:Oe.win_complated_rate)==null||isNaN(parseFloat(Oe==null?void 0:Oe.win_complated_rate))?"--":`${Math.abs(Oe==null?void 0:Oe.win_complated_rate)}%`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(gsn,{info1:(Oe==null?void 0:Oe.complated_trades_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.complated_trades_count))?"--":`${Is(Math.abs(Oe==null?void 0:Oe.complated_trades_count))}`,info2:(Oe==null?void 0:Oe.complated_win_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.complated_win_count))?"--":`${Is(Math.abs(Oe==null?void 0:Oe.complated_win_count))}`,info3:(Oe==null?void 0:Oe.complated_loss_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.complated_loss_count))?"--":`${Is(Math.abs(Oe==null?void 0:Oe.complated_loss_count))}`,info1_Color:"text-white",info2_Color:"text-[#1DE6A3]",info3_Color:"text-[#FF7173]",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:(Oe==null?void 0:Oe.long_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.long_kar))?"--":`$${Is(Math.abs(Oe==null?void 0:Oe.long_kar))}`,info1_Color:`${(Oe==null?void 0:Oe.long_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.long_kar))||(Oe==null?void 0:Oe.long_kar)==0?"text-white":(Oe==null?void 0:Oe.long_kar)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:`$${(Oe==null?void 0:Oe.short_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.short_kar))?"--":Is(Math.abs(Oe==null?void 0:Oe.short_kar))}`,info1_Color:`${(Oe==null?void 0:Oe.short_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.short_kar))||(Oe==null?void 0:Oe.short_kar)==0?"text-white":(Oe==null?void 0:Oe.short_kar)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:a==1||a==999?i.jsx("div",{className:"space-y-2 flex justify-end items-center",children:i.jsx(pi,{content:"Available for 7, 30, 90 days",children:i.jsx("div",{className:"text-gray-500 text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] w-max pl-16 h-10",children:"--"})})}):i.jsx(aa,{info1:`${a==1||a==999||(Oe==null?void 0:Oe[et])==null||isNaN(parseFloat(Oe==null?void 0:Oe[et]))||et=="portfolio_perp_day_growth_rate"?"--":`${Is(Oe==null?void 0:Oe[et])}%`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Oe==null?void 0:Oe[et])==null||isNaN(parseFloat(Oe==null?void 0:Oe[et]))||et=="portfolio_perp_day_growth_rate"||(Oe==null?void 0:Oe[et])==0?"text-white":(Oe==null?void 0:Oe[et])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:a==1||a==999?i.jsx("div",{className:"space-y-2 flex justify-end items-center",children:i.jsx(pi,{content:"Available for 7, 30, 90 days",children:i.jsx("div",{className:"text-gray-500 text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] w-max pl-16 h-10",children:"--"})})}):i.jsx(aa,{info1:`${a==1||a==999||(Oe==null?void 0:Oe[Et])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Et]))||Et=="portfolio_perp_day_dd"?"--":`${Is(Math.abs(Oe==null?void 0:Oe[Et]))}%`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Oe==null?void 0:Oe[Et])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Et]))||Et=="portfolio_perp_day_dd"||(Oe==null?void 0:Oe[Et])==0?"text-white":(Oe==null?void 0:Oe[Et])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:a==1||a==999?i.jsx("div",{className:"space-y-2 flex justify-end items-center",children:i.jsx(pi,{content:"Available for 7, 30, 90 days",children:i.jsx("div",{className:"text-gray-500 text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] w-max pl-16 h-10",children:"--"})})}):i.jsx(aa,{info1:`${a==1||a==999||(Oe==null?void 0:Oe[Be])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Be]))||Be=="portfolio_perp_day_sharpe"?"--":`${Cr(Oe==null?void 0:Oe[Be])}`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Oe==null?void 0:Oe[Be])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Be]))||Be=="portfolio_perp_day_sharpe"?"text-white":(Oe==null?void 0:Oe[Be])>=1&&(Oe==null?void 0:Oe[Be])<=2?"text-[#E5BB18]":(Oe==null?void 0:Oe[Be])>2?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:`${(Oe==null?void 0:Oe.rtx_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.rtx_count))?"--":Is(Oe==null?void 0:Oe.rtx_count)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{children:i.jsx(aa,{info1:`${(Oe==null?void 0:Oe.margin_roi)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_roi))?"--":`${Is(Math.abs(Oe==null?void 0:Oe.margin_roi))}%`}`,info1_Color:`${(Oe==null?void 0:Oe.margin_roi)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_roi))||(Oe==null?void 0:Oe.margin_roi)==0?"text-white":(Oe==null?void 0:Oe.margin_roi)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:i.jsx(wrn,{info1:`${(Oe==null?void 0:Oe.margin_used)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_used))?"--":Is(Oe==null?void 0:Oe.margin_used)}`,info2:`${(Oe==null?void 0:Oe.margin_percentage)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_percentage))?"--":parseFloat(Oe==null?void 0:Oe.margin_percentage).toFixed(2)+"%"}`,info1_Color:"text-white",info2_Color:"text-[#979797]",rowTwo:!1})}),i.jsx("td",{children:i.jsx(aa,{info1:`${(Oe==null?void 0:Oe.avg_uleverage_value)==null||isNaN(parseFloat(Oe==null?void 0:Oe.avg_uleverage_value))?"--":`${parseFloat(Oe==null?void 0:Oe.avg_uleverage_value).toFixed(2)}x`}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{children:i.jsx(aa,{info1:`${(Oe==null?void 0:Oe.funding)==null||isNaN(parseFloat(Oe==null?void 0:Oe.funding))?"--":`$${Is(Math.abs(Oe==null?void 0:Oe.funding))}`}`,info1_Color:`${(Oe==null?void 0:Oe.funding)==null||isNaN(parseFloat(Oe==null?void 0:Oe.funding))||(Oe==null?void 0:Oe.funding)==0?"text-white":(Oe==null?void 0:Oe.funding)<0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-1",children:i.jsx("div",{className:"text-sm font-medium font-manrope leading-none flex items-center justify-center gap-0.5",children:i.jsxs("div",{className:"has-tooltip relative w-5 h-5",children:[i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-center gap-2 font-manrope w-full h-full has-tooltip",children:i.jsx("div",{className:`${(Oe==null?void 0:Oe.token_count)>0?"underline underline-offset-2":""} text-white text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:(Oe==null?void 0:Oe.token_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.token_count))?"--":Is(Oe==null?void 0:Oe.token_count)})}),(Oe==null?void 0:Oe.token_count)>0&&i.jsx(G6e,{content:Oe==null?void 0:Oe.coins_with_profit,positionTop:!0,alignRight:!1,type:"coin"})]})})})}),i.jsx("td",{className:`${a==999?"pr-6 sm:rounded-r-2xl":""} `,children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-1",children:i.jsx("div",{className:"text-sm font-medium font-manrope leading-none flex items-center justify-center gap-0.5",children:i.jsxs("div",{className:"has-tooltip relative w-5 h-5",children:[i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-center gap-2 font-manrope w-full h-full has-tooltip",children:i.jsx("div",{className:`${(Oe==null?void 0:Oe.position_count)>0?"underline underline-offset-2":""} text-white text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:(Oe==null?void 0:Oe.position_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.position_count))?"--":Is(Oe==null?void 0:Oe.position_count)})}),(Oe==null?void 0:Oe.position_count)>0&&i.jsx(G6e,{content:Oe==null?void 0:Oe.open_positions,positionTop:a!=999,alignRight:!1,type:"position"})]})})})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:`${Mt(Oe==null?void 0:Oe.complated_avg_duration)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(aa,{info1:`${PI(Oe==null?void 0:Oe.first_time)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":"pr-6 sm:rounded-r-2xl"}`,children:i.jsx(aa,{info1:`${PI(Oe==null?void 0:Oe.end_time)}`,info1_Color:"text-white",rowTwo:!1})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},rn)))})]})})]})]})]})};var RY,tCe;function ysn(){if(tCe)return RY;tCe=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function s(a,o){if(a===o)return!0;if(a&&o&&typeof a=="object"&&typeof o=="object"){if(a.constructor!==o.constructor)return!1;var l,c,u;if(Array.isArray(a)){if(l=a.length,l!=o.length)return!1;for(c=l;c--!==0;)if(!s(a[c],o[c]))return!1;return!0}var d;if(t&&a instanceof Map&&o instanceof Map){if(a.size!==o.size)return!1;for(d=a.entries();!(c=d.next()).done;)if(!o.has(c.value[0]))return!1;for(d=a.entries();!(c=d.next()).done;)if(!s(c.value[1],o.get(c.value[0])))return!1;return!0}if(n&&a instanceof Set&&o instanceof Set){if(a.size!==o.size)return!1;for(d=a.entries();!(c=d.next()).done;)if(!o.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(o)){if(l=a.length,l!=o.length)return!1;for(c=l;c--!==0;)if(a[c]!==o[c])return!1;return!0}if(a.constructor===RegExp)return a.source===o.source&&a.flags===o.flags;if(a.valueOf!==Object.prototype.valueOf&&typeof a.valueOf=="function"&&typeof o.valueOf=="function")return a.valueOf()===o.valueOf();if(a.toString!==Object.prototype.toString&&typeof a.toString=="function"&&typeof o.toString=="function")return a.toString()===o.toString();if(u=Object.keys(a),l=u.length,l!==Object.keys(o).length)return!1;for(c=l;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,u[c]))return!1;if(e&&a instanceof Element)return!1;for(c=l;c--!==0;)if(!((u[c]==="_owner"||u[c]==="__v"||u[c]==="__o")&&a.$$typeof)&&!s(a[u[c]],o[u[c]]))return!1;return!0}return a!==a&&o!==o}return RY=function(o,l){try{return s(o,l)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},RY}var vsn=ysn();const wsn=ki(vsn);var LY,nCe;function Csn(){if(nCe)return LY;nCe=1;var e=function(t,n,r,s,a,o,l,c){if(!t){var u;if(n===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,s,a,o,l,c],f=0;u=new Error(n.replace(/%s/g,function(){return d[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};return LY=e,LY}var Ssn=Csn();const rCe=ki(Ssn);var DY,sCe;function Nsn(){return sCe||(sCe=1,DY=function(t,n,r,s){var a=r?r.call(s,t,n):void 0;if(a!==void 0)return!!a;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var o=Object.keys(t),l=Object.keys(n);if(o.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(n),u=0;u<o.length;u++){var d=o[u];if(!c(d))return!1;var f=t[d],x=n[d];if(a=r?r.call(s,f,x,d):void 0,a===!1||a===void 0&&f!==x)return!1}return!0}),DY}var Asn=Nsn();const jsn=ki(Asn);var FUe=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(FUe||{}),BY={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},iCe=Object.values(FUe),Pce={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Esn=Object.entries(Pce).reduce((e,[t,n])=>(e[n]=t,e),{}),lm="data-rh",m4={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},x4=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},_sn=e=>{let t=x4(e,"title");const n=x4(e,m4.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=x4(e,m4.DEFAULT_TITLE);return t||r||void 0},ksn=e=>x4(e,m4.ON_CHANGE_CLIENT_STATE)||(()=>{}),$Y=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),Tsn=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const s=Object.keys(r);for(let a=0;a<s.length;a+=1){const l=s[a].toLowerCase();if(e.indexOf(l)!==-1&&r[l])return n.concat(r)}}return n},[]),Isn=e=>console&&typeof console.warn=="function"&&console.warn(e),z7=(e,t,n)=>{const r={};return n.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&Isn(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const o={};a.filter(c=>{let u;const d=Object.keys(c);for(let x=0;x<d.length;x+=1){const g=d[x],v=g.toLowerCase();t.indexOf(v)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(v==="rel"&&c[v].toLowerCase()==="stylesheet")&&(u=v),t.indexOf(g)!==-1&&(g==="innerHTML"||g==="cssText"||g==="itemprop")&&(u=g)}if(!u||!c[u])return!1;const f=c[u].toLowerCase();return r[u]||(r[u]={}),o[u]||(o[u]={}),r[u][f]?!1:(o[u][f]=!0,!0)}).reverse().forEach(c=>s.push(c));const l=Object.keys(o);for(let c=0;c<l.length;c+=1){const u=l[c],d={...r[u],...o[u]};r[u]=d}return s},[]).reverse()},Psn=(e,t)=>{if(Array.isArray(e)&&e.length){for(let n=0;n<e.length;n+=1)if(e[n][t])return!0}return!1},Fsn=e=>({baseTag:Tsn(["href"],e),bodyAttributes:$Y("bodyAttributes",e),defer:x4(e,m4.DEFER),encode:x4(e,m4.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:$Y("htmlAttributes",e),linkTags:z7("link",["rel","href"],e),metaTags:z7("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:z7("noscript",["innerHTML"],e),onChangeClientState:ksn(e),scriptTags:z7("script",["src","innerHTML"],e),styleTags:z7("style",["cssText"],e),title:_sn(e),titleAttributes:$Y("titleAttributes",e),prioritizeSeoTags:Psn(e,m4.PRIORITIZE_SEO_TAGS)}),OUe=e=>Array.isArray(e)?e.join(""):e,Osn=(e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},UY=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(Osn(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},aCe=(e,t)=>({...e,[t]:void 0}),Msn=["noscript","script","style"],jne=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),MUe=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),Rsn=(e,t,n,r)=>{const s=MUe(n),a=OUe(t);return s?`<${e} ${lm}="true" ${s}>${jne(a,r)}</${e}>`:`<${e} ${lm}="true">${jne(a,r)}</${e}>`},Lsn=(e,t,n=!0)=>t.reduce((r,s)=>{const a=s,o=Object.keys(a).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const f=typeof a[d]>"u"?d:`${d}="${jne(a[d],n)}"`;return u?`${u} ${f}`:f},""),l=a.innerHTML||a.cssText||"",c=Msn.indexOf(e)===-1;return`${r}<${e} ${lm}="true" ${o}${c?"/>":`>${l}</${e}>`}`},""),RUe=(e,t={})=>Object.keys(e).reduce((n,r)=>{const s=Pce[r];return n[s||r]=e[r],n},t),Dsn=(e,t,n)=>{const r={key:t,[lm]:!0},s=RUe(n,r);return[Ne.createElement("title",s,t)]},yO=(e,t)=>t.map((n,r)=>{const s={key:r,[lm]:!0};return Object.keys(n).forEach(a=>{const l=Pce[a]||a;if(l==="innerHTML"||l==="cssText"){const c=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[l]=n[a]}),Ne.createElement(e,s)}),Mh=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>Dsn(e,t.title,t.titleAttributes),toString:()=>Rsn(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>RUe(t),toString:()=>MUe(t)};default:return{toComponent:()=>yO(e,t),toString:()=>Lsn(e,t,n)}}},Bsn=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const s=UY(e,BY.meta),a=UY(t,BY.link),o=UY(n,BY.script);return{priorityMethods:{toComponent:()=>[...yO("meta",s.priority),...yO("link",a.priority),...yO("script",o.priority)],toString:()=>`${Mh("meta",s.priority,r)} ${Mh("link",a.priority,r)} ${Mh("script",o.priority,r)}`},metaTags:s.default,linkTags:a.default,scriptTags:o.default}},$sn=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:a,styleTags:o,title:l="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:f,scriptTags:x}=e,g={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:g,linkTags:d,metaTags:f,scriptTags:x}=Bsn(e)),{priority:g,base:Mh("base",t,r),bodyAttributes:Mh("bodyAttributes",n,r),htmlAttributes:Mh("htmlAttributes",s,r),link:Mh("link",d,r),meta:Mh("meta",f,r),noscript:Mh("noscript",a,r),script:Mh("script",x,r),style:Mh("style",o,r),title:Mh("title",{title:l,titleAttributes:c},r)}},LUe=$sn,RP=[],DUe=!!(typeof window<"u"&&window.document&&window.document.createElement),Ene=class{constructor(e,t){Bn(this,"instances",[]);Bn(this,"canUseDOM",DUe);Bn(this,"context");Bn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?RP:this.instances,add:e=>{(this.canUseDOM?RP:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?RP:this.instances).indexOf(e);(this.canUseDOM?RP:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=LUe({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Usn={},BUe=Ne.createContext(Usn),$w,Mo=($w=class extends m.Component{constructor(n){super(n);Bn(this,"helmetData");this.helmetData=new Ene(this.props.context||{},$w.canUseDOM)}render(){return Ne.createElement(BUe.Provider,{value:this.helmetData.value},this.props.children)}},Bn($w,"canUseDOM",DUe),$w),iC=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${lm}]`),s=[].slice.call(r),a=[];let o;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u))if(u==="innerHTML")c.innerHTML=l.innerHTML;else if(u==="cssText")c.styleSheet?c.styleSheet.cssText=l.cssText:c.appendChild(document.createTextNode(l.cssText));else{const d=u,f=typeof l[d]>"u"?"":l[d];c.setAttribute(u,f)}c.setAttribute(lm,"true"),s.some((u,d)=>(o=d,c.isEqualNode(u)))?s.splice(o,1):a.push(c)}),s.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),a.forEach(l=>n.appendChild(l)),{oldTags:s,newTags:a}},_ne=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(lm),s=r?r.split(","):[],a=[...s],o=Object.keys(t);for(const l of o){const c=t[l]||"";n.getAttribute(l)!==c&&n.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);const u=a.indexOf(l);u!==-1&&a.splice(u,1)}for(let l=a.length-1;l>=0;l-=1)n.removeAttribute(a[l]);s.length===a.length?n.removeAttribute(lm):n.getAttribute(lm)!==o.join(",")&&n.setAttribute(lm,o.join(","))},zsn=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=OUe(e)),_ne("title",t)},oCe=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:a,metaTags:o,noscriptTags:l,onChangeClientState:c,scriptTags:u,styleTags:d,title:f,titleAttributes:x}=e;_ne("body",r),_ne("html",s),zsn(f,x);const g={baseTag:iC("base",n),linkTags:iC("link",a),metaTags:iC("meta",o),noscriptTags:iC("noscript",l),scriptTags:iC("script",u),styleTags:iC("style",d)},v={},w={};Object.keys(g).forEach(C=>{const{newTags:N,oldTags:I}=g[C];N.length&&(v[C]=N),I.length&&(w[C]=g[C].oldTags)}),t&&t(),c(e,v,w)},H7=null,Hsn=e=>{H7&&cancelAnimationFrame(H7),e.defer?H7=requestAnimationFrame(()=>{oCe(e,()=>{H7=null})}):(oCe(e),H7=null)},Vsn=Hsn,lCe=class extends m.Component{constructor(){super(...arguments);Bn(this,"rendered",!1)}shouldComponentUpdate(t){return!jsn(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const s=Fsn(t.get().map(a=>{const o={...a.props};return delete o.context,o}));Mo.canUseDOM?Vsn(s):r=LUe(s),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},aQ,Ho=(aQ=class extends m.Component{shouldComponentUpdate(e){return!wsn(aCe(this.props,"helmetData"),aCe(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return rCe(iCe.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${iCe.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),rCe(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return Ne.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:s,...a}=r.props,o=Object.keys(a).reduce((c,u)=>(c[Esn[u]||u]=a[u],c),{});let{type:l}=r;switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(r,s),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,o,s);break;default:t=this.mapObjectTypeChildren(r,t,o,s);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof Ene)){const s=r;r=new Ene(s.context,!0),delete n.helmetData}return r?Ne.createElement(lCe,{...n,context:r.value}):Ne.createElement(BUe.Consumer,null,s=>Ne.createElement(lCe,{...n,context:s}))}},Bn(aQ,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),aQ);const Wsn=()=>{const[e,t]=m.useState(1),[n,r]=m.useState("-"),[s,a]=m.useState("-"),o=0,[l,c]=m.useState(o),u=[{index:0,name:"1D",value:1},{index:1,name:"7D",value:7},{index:2,name:"30D",value:30},{index:3,name:"90D",value:90},{index:4,name:"All",value:999}],d=parseInt(localStorage.getItem("discover_period")),f=!isNaN(d)&&u[d]?u[d].value:u[1].value,[x,g]=m.useState(f),v=w=>{g(Number(w)),localStorage.setItem("discover_period",u.findIndex(C=>C.value===Number(w)).toFixed(0))};return i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Discover Top HyperLiquid Wallets for Copy Trading - Dextrabot"}),i.jsx("meta",{name:"description",content:"Find and analyze the best HyperLiquid wallets for copy trading. Use powerful filters to discover profitable traders and automate your trades effortlessly."}),i.jsx("meta",{name:"og:title",content:"Discover Top HyperLiquid Wallets for Copy Trading - Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Find and analyze the best HyperLiquid wallets for copy trading. Use powerful filters to discover profitable traders and automate your trades effortlessly."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/discover-wallets"})]})}),i.jsx("div",{className:"flex flex-col items-stretch justify-start sm:justify-center text-white w-full bg-[#161616] overflow-hidden min-h-[calc(100vh)] sm:min-h-[calc(100vh-5rem)] sm:h-[calc(100vh-5rem)] overflow-y-auto sm:pb-0",children:i.jsx(bsn,{currentPage:e,setCurrentPage:t,offset:l,setOffset:c,totalPage:n,totalWalletCount:s,setTotalPage:r,setTotalWalletCount:a,period:x,periods:u,handlePeriodChange:v})})]})},di=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s})=>{const a=()=>{r(n===`-${t}`?t:`-${t}`)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>a(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope`,children:[i.jsx("div",{className:`${n.includes(t)?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(cU,{sortKey:t,state:n,className:""})]})})};var LP={},DP={exports:{}};/*!
* ApexCharts v3.54.1
* (c) 2018-2024 ApexCharts
* Released under the MIT License.
*/var cCe;function qsn(){return cCe||(cCe=1,function(e,t){function n(Ee,p){(p==null||p>Ee.length)&&(p=Ee.length);for(var h=0,S=Array(p);h<p;h++)S[h]=Ee[h];return S}function r(Ee){if(Ee===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ee}function s(Ee,p){if(!(Ee instanceof p))throw new TypeError("Cannot call a class as a function")}function a(Ee,p){for(var h=0;h<p.length;h++){var S=p[h];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(Ee,I(S.key),S)}}function o(Ee,p,h){return p&&a(Ee.prototype,p),h&&a(Ee,h),Object.defineProperty(Ee,"prototype",{writable:!1}),Ee}function l(Ee,p){var h=typeof Symbol<"u"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(!h){if(Array.isArray(Ee)||(h=R(Ee))||p){h&&(Ee=h);var S=0,_=function(){};return{s:_,n:function(){return S>=Ee.length?{done:!0}:{done:!1,value:Ee[S++]}},e:function(W){throw W},f:_}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var k,T=!0,B=!1;return{s:function(){h=h.call(Ee)},n:function(){var W=h.next();return T=W.done,W},e:function(W){B=!0,k=W},f:function(){try{T||h.return==null||h.return()}finally{if(B)throw k}}}}function c(Ee){var p=x();return function(){var h,S=d(Ee);if(p){var _=d(this).constructor;h=Reflect.construct(S,arguments,_)}else h=S.apply(this,arguments);return function(k,T){if(T&&(typeof T=="object"||typeof T=="function"))return T;if(T!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return r(k)}(this,h)}}function u(Ee,p,h){return(p=I(p))in Ee?Object.defineProperty(Ee,p,{value:h,enumerable:!0,configurable:!0,writable:!0}):Ee[p]=h,Ee}function d(Ee){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},d(Ee)}function f(Ee,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");Ee.prototype=Object.create(p&&p.prototype,{constructor:{value:Ee,writable:!0,configurable:!0}}),Object.defineProperty(Ee,"prototype",{writable:!1}),p&&w(Ee,p)}function x(){try{var Ee=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x=function(){return!!Ee})()}function g(Ee,p){var h=Object.keys(Ee);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(Ee);p&&(S=S.filter(function(_){return Object.getOwnPropertyDescriptor(Ee,_).enumerable})),h.push.apply(h,S)}return h}function v(Ee){for(var p=1;p<arguments.length;p++){var h=arguments[p]!=null?arguments[p]:{};p%2?g(Object(h),!0).forEach(function(S){u(Ee,S,h[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ee,Object.getOwnPropertyDescriptors(h)):g(Object(h)).forEach(function(S){Object.defineProperty(Ee,S,Object.getOwnPropertyDescriptor(h,S))})}return Ee}function w(Ee,p){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(h,S){return h.__proto__=S,h},w(Ee,p)}function C(Ee,p){return function(h){if(Array.isArray(h))return h}(Ee)||function(h,S){var _=h==null?null:typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(_!=null){var k,T,B,W,ee=[],de=!0,fe=!1;try{if(B=(_=_.call(h)).next,S===0){if(Object(_)!==_)return;de=!1}else for(;!(de=(k=B.call(_)).done)&&(ee.push(k.value),ee.length!==S);de=!0);}catch(xe){fe=!0,T=xe}finally{try{if(!de&&_.return!=null&&(W=_.return(),Object(W)!==W))return}finally{if(fe)throw T}}return ee}}(Ee,p)||R(Ee,p)||function(){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 N(Ee){return function(p){if(Array.isArray(p))return n(p)}(Ee)||function(p){if(typeof Symbol<"u"&&p[Symbol.iterator]!=null||p["@@iterator"]!=null)return Array.from(p)}(Ee)||R(Ee)||function(){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 I(Ee){var p=function(h,S){if(typeof h!="object"||!h)return h;var _=h[Symbol.toPrimitive];if(_!==void 0){var k=_.call(h,S||"default");if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(h)}(Ee,"string");return typeof p=="symbol"?p:p+""}function P(Ee){return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},P(Ee)}function R(Ee,p){if(Ee){if(typeof Ee=="string")return n(Ee,p);var h={}.toString.call(Ee).slice(8,-1);return h==="Object"&&Ee.constructor&&(h=Ee.constructor.name),h==="Map"||h==="Set"?Array.from(Ee):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?n(Ee,p):void 0}}var F=function(){function Ee(){s(this,Ee)}return o(Ee,[{key:"shadeRGBColor",value:function(p,h){var S=h.split(","),_=p<0?0:255,k=p<0?-1*p:p,T=parseInt(S[0].slice(4),10),B=parseInt(S[1],10),W=parseInt(S[2],10);return"rgb("+(Math.round((_-T)*k)+T)+","+(Math.round((_-B)*k)+B)+","+(Math.round((_-W)*k)+W)+")"}},{key:"shadeHexColor",value:function(p,h){var S=parseInt(h.slice(1),16),_=p<0?0:255,k=p<0?-1*p:p,T=S>>16,B=S>>8&255,W=255&S;return"#"+(16777216+65536*(Math.round((_-T)*k)+T)+256*(Math.round((_-B)*k)+B)+(Math.round((_-W)*k)+W)).toString(16).slice(1)}},{key:"shadeColor",value:function(p,h){return Ee.isColorHex(h)?this.shadeHexColor(p,h):this.shadeRGBColor(p,h)}}],[{key:"bind",value:function(p,h){return function(){return p.apply(h,arguments)}}},{key:"isObject",value:function(p){return p&&P(p)==="object"&&!Array.isArray(p)&&p!=null}},{key:"is",value:function(p,h){return Object.prototype.toString.call(h)==="[object "+p+"]"}},{key:"listToArray",value:function(p){var h,S=[];for(h=0;h<p.length;h++)S[h]=p[h];return S}},{key:"extend",value:function(p,h){var S=this;typeof Object.assign!="function"&&(Object.assign=function(k){if(k==null)throw new TypeError("Cannot convert undefined or null to object");for(var T=Object(k),B=1;B<arguments.length;B++){var W=arguments[B];if(W!=null)for(var ee in W)W.hasOwnProperty(ee)&&(T[ee]=W[ee])}return T});var _=Object.assign({},p);return this.isObject(p)&&this.isObject(h)&&Object.keys(h).forEach(function(k){S.isObject(h[k])&&k in p?_[k]=S.extend(p[k],h[k]):Object.assign(_,u({},k,h[k]))}),_}},{key:"extendArray",value:function(p,h){var S=[];return p.map(function(_){S.push(Ee.extend(h,_))}),p=S}},{key:"monthMod",value:function(p){return p%12}},{key:"clone",value:function(p){if(Ee.is("Array",p)){for(var h=[],S=0;S<p.length;S++)h[S]=this.clone(p[S]);return h}if(Ee.is("Null",p))return null;if(Ee.is("Date",p))return p;if(P(p)==="object"){var _={};for(var k in p)p.hasOwnProperty(k)&&(_[k]=this.clone(p[k]));return _}return p}},{key:"log10",value:function(p){return Math.log(p)/Math.LN10}},{key:"roundToBase10",value:function(p){return Math.pow(10,Math.floor(Math.log10(p)))}},{key:"roundToBase",value:function(p,h){return Math.pow(h,Math.floor(Math.log(p)/Math.log(h)))}},{key:"parseNumber",value:function(p){return p===null?p:parseFloat(p)}},{key:"stripNumber",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Number.isInteger(p)?p:parseFloat(p.toPrecision(h))}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(p){var h=String(p).split(/[eE]/);if(h.length===1)return h[0];var S="",_=p<0?"-":"",k=h[0].replace(".",""),T=Number(h[1])+1;if(T<0){for(S=_+"0.";T++;)S+="0";return S+k.replace(/^-/,"")}for(T-=k.length;T--;)S+="0";return k+S}},{key:"getDimensions",value:function(p){var h=getComputedStyle(p,null),S=p.clientHeight,_=p.clientWidth;return S-=parseFloat(h.paddingTop)+parseFloat(h.paddingBottom),[_-=parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),S]}},{key:"getBoundingClientRect",value:function(p){var h=p.getBoundingClientRect();return{top:h.top,right:h.right,bottom:h.bottom,left:h.left,width:p.clientWidth,height:p.clientHeight,x:h.left,y:h.top}}},{key:"getLargestStringFromArr",value:function(p){return p.reduce(function(h,S){return Array.isArray(S)&&(S=S.reduce(function(_,k){return _.length>k.length?_:k})),h.length>S.length?h:S},0)}},{key:"hexToRgba",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#999999",h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;p.substring(0,1)!=="#"&&(p="#999999");var S=p.replace("#","");S=S.match(new RegExp("(.{"+S.length/3+"})","g"));for(var _=0;_<S.length;_++)S[_]=parseInt(S[_].length===1?S[_]+S[_]:S[_],16);return h!==void 0&&S.push(h),"rgba("+S.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(p){return parseFloat(p.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(p){return(p=p.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&p.length===4?"#"+("0"+parseInt(p[1],10).toString(16)).slice(-2)+("0"+parseInt(p[2],10).toString(16)).slice(-2)+("0"+parseInt(p[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(p){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(p)}},{key:"getPolygonPos",value:function(p,h){for(var S=[],_=2*Math.PI/h,k=0;k<h;k++){var T={};T.x=p*Math.sin(k*_),T.y=-p*Math.cos(k*_),S.push(T)}return S}},{key:"polarToCartesian",value:function(p,h,S,_){var k=(_-90)*Math.PI/180;return{x:p+S*Math.cos(k),y:h+S*Math.sin(k)}}},{key:"escapeString",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x",S=p.toString().slice();return S=S.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,h)}},{key:"negToZero",value:function(p){return p<0?0:p}},{key:"moveIndexInArray",value:function(p,h,S){if(S>=p.length)for(var _=S-p.length+1;_--;)p.push(void 0);return p.splice(S,0,p.splice(h,1)[0]),p}},{key:"extractNumber",value:function(p){return parseFloat(p.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(p,h){for(;(p=p.parentElement)&&!p.classList.contains(h););return p}},{key:"setELstyles",value:function(p,h){for(var S in h)h.hasOwnProperty(S)&&(p.style.key=h[S])}},{key:"preciseAddition",value:function(p,h){var S=(String(p).split(".")[1]||"").length,_=(String(h).split(".")[1]||"").length,k=Math.pow(10,Math.max(S,_));return(Math.round(p*k)+Math.round(h*k))/k}},{key:"isNumber",value:function(p){return!isNaN(p)&&parseFloat(Number(p))===p&&!isNaN(parseInt(p,10))}},{key:"isFloat",value:function(p){return Number(p)===p&&p%1!=0}},{key:"isSafari",value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:"isFirefox",value:function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}},{key:"isMsEdge",value:function(){var p=window.navigator.userAgent,h=p.indexOf("Edge/");return h>0&&parseInt(p.substring(h+5,p.indexOf(".",h)),10)}},{key:"getGCD",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,_=Math.pow(10,S-Math.floor(Math.log10(Math.max(p,h))));for(p=Math.round(Math.abs(p)*_),h=Math.round(Math.abs(h)*_);h;){var k=h;h=p%h,p=k}return p/_}},{key:"getPrimeFactors",value:function(p){for(var h=[],S=2;p>=2;)p%S==0?(h.push(S),p/=S):S++;return h}},{key:"mod",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,_=Math.pow(10,S-Math.floor(Math.log10(Math.max(p,h))));return(p=Math.round(Math.abs(p)*_))%(h=Math.round(Math.abs(h)*_))/_}}]),Ee}(),U=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.setEasingFunctions()}return o(Ee,[{key:"setEasingFunctions",value:function(){var p;if(!this.w.globals.easing){switch(this.w.config.chart.animations.easing){case"linear":p="-";break;case"easein":p="<";break;case"easeout":p=">";break;case"easeinout":default:p="<>";break;case"swing":p=function(h){var S=1.70158;return(h-=1)*h*((S+1)*h+S)+1};break;case"bounce":p=function(h){return h<1/2.75?7.5625*h*h:h<2/2.75?7.5625*(h-=1.5/2.75)*h+.75:h<2.5/2.75?7.5625*(h-=2.25/2.75)*h+.9375:7.5625*(h-=2.625/2.75)*h+.984375};break;case"elastic":p=function(h){return h===!!h?h:Math.pow(2,-10*h)*Math.sin((h-.075)*(2*Math.PI)/.3)+1}}this.w.globals.easing=p}}},{key:"animateLine",value:function(p,h,S,_){p.attr(h).animate(_).attr(S)}},{key:"animateMarker",value:function(p,h,S,_){p.attr({opacity:0}).animate(h,S).attr({opacity:1}).afterAll(function(){_()})}},{key:"animateRect",value:function(p,h,S,_,k){p.attr(h).animate(_).attr(S).afterAll(function(){return k()})}},{key:"animatePathsGradually",value:function(p){var h=p.el,S=p.realIndex,_=p.j,k=p.fill,T=p.pathFrom,B=p.pathTo,W=p.speed,ee=p.delay,de=this.w,fe=0;de.config.chart.animations.animateGradually.enabled&&(fe=de.config.chart.animations.animateGradually.delay),de.config.chart.animations.dynamicAnimation.enabled&&de.globals.dataChanged&&de.config.chart.type!=="bar"&&(fe=0),this.morphSVG(h,S,_,de.config.chart.type!=="line"||de.globals.comboCharts?k:"stroke",T,B,W,ee*fe)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach(function(p){var h=p.el;h.classList.remove("apexcharts-element-hidden"),h.classList.add("apexcharts-hidden-element-shown")})}},{key:"animationCompleted",value:function(p){var h=this.w;h.globals.animationEnded||(h.globals.animationEnded=!0,this.showDelayedElements(),typeof h.config.chart.events.animationEnd=="function"&&h.config.chart.events.animationEnd(this.ctx,{el:p,w:h}))}},{key:"morphSVG",value:function(p,h,S,_,k,T,B,W){var ee=this,de=this.w;k||(k=p.attr("pathFrom")),T||(T=p.attr("pathTo"));var fe=function(xe){return de.config.chart.type==="radar"&&(B=1),"M 0 ".concat(de.globals.gridHeight)};(!k||k.indexOf("undefined")>-1||k.indexOf("NaN")>-1)&&(k=fe()),(!T||T.indexOf("undefined")>-1||T.indexOf("NaN")>-1)&&(T=fe()),de.globals.shouldAnimate||(B=1),p.plot(k).animate(1,de.globals.easing,W).plot(k).animate(B,de.globals.easing,W).plot(T).afterAll(function(){F.isNumber(S)?S===de.globals.series[de.globals.maxValsInArrayIndex].length-2&&de.globals.shouldAnimate&&ee.animationCompleted(p):_!=="none"&&de.globals.shouldAnimate&&(!de.globals.comboCharts&&h===de.globals.series.length-1||de.globals.comboCharts)&&ee.animationCompleted(p),ee.showDelayedElements()})}}]),Ee}(),L=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"getDefaultFilter",value:function(p,h){var S=this.w;p.unfilter(!0),new window.SVG.Filter().size("120%","180%","-5%","-40%"),S.config.states.normal.filter!=="none"?this.applyFilter(p,h,S.config.states.normal.filter.type,S.config.states.normal.filter.value):S.config.chart.dropShadow.enabled&&this.dropShadow(p,S.config.chart.dropShadow,h)}},{key:"addNormalFilter",value:function(p,h){var S=this.w;S.config.chart.dropShadow.enabled&&!p.node.classList.contains("apexcharts-marker")&&this.dropShadow(p,S.config.chart.dropShadow,h)}},{key:"addLightenFilter",value:function(p,h,S){var _=this,k=this.w,T=S.intensity;p.unfilter(!0),new window.SVG.Filter,p.filter(function(B){var W=k.config.chart.dropShadow;(W.enabled?_.addShadow(B,h,W):B).componentTransfer({rgb:{type:"linear",slope:1.5,intercept:T}})}),p.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(p.filterer.node)}},{key:"addDarkenFilter",value:function(p,h,S){var _=this,k=this.w,T=S.intensity;p.unfilter(!0),new window.SVG.Filter,p.filter(function(B){var W=k.config.chart.dropShadow;(W.enabled?_.addShadow(B,h,W):B).componentTransfer({rgb:{type:"linear",slope:T}})}),p.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(p.filterer.node)}},{key:"applyFilter",value:function(p,h,S){var _=arguments.length>3&&arguments[3]!==void 0?arguments[3]:.5;switch(S){case"none":this.addNormalFilter(p,h);break;case"lighten":this.addLightenFilter(p,h,{intensity:_});break;case"darken":this.addDarkenFilter(p,h,{intensity:_})}}},{key:"addShadow",value:function(p,h,S){var _,k=this.w,T=S.blur,B=S.top,W=S.left,ee=S.color,de=S.opacity;if(((_=k.config.chart.dropShadow.enabledOnSeries)===null||_===void 0?void 0:_.length)>0&&k.config.chart.dropShadow.enabledOnSeries.indexOf(h)===-1)return p;var fe=p.flood(Array.isArray(ee)?ee[h]:ee,de).composite(p.sourceAlpha,"in").offset(W,B).gaussianBlur(T).merge(p.source);return p.blend(p.source,fe)}},{key:"dropShadow",value:function(p,h){var S,_,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,T=h.top,B=h.left,W=h.blur,ee=h.color,de=h.opacity,fe=h.noUserSpaceOnUse,xe=this.w;return p.unfilter(!0),F.isMsEdge()&&xe.config.chart.type==="radialBar"||((S=xe.config.chart.dropShadow.enabledOnSeries)===null||S===void 0?void 0:S.length)>0&&((_=xe.config.chart.dropShadow.enabledOnSeries)===null||_===void 0?void 0:_.indexOf(k))===-1||(ee=Array.isArray(ee)?ee[k]:ee,p.filter(function(we){var ke=null;ke=F.isSafari()||F.isFirefox()||F.isMsEdge()?we.flood(ee,de).composite(we.sourceAlpha,"in").offset(B,T).gaussianBlur(W):we.flood(ee,de).composite(we.sourceAlpha,"in").offset(B,T).gaussianBlur(W).merge(we.source),we.blend(we.source,ke)}),fe||p.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(p.filterer.node)),p}},{key:"setSelectionFilter",value:function(p,h,S){var _=this.w;if(_.globals.selectedDataPoints[h]!==void 0&&_.globals.selectedDataPoints[h].indexOf(S)>-1){p.node.setAttribute("selected",!0);var k=_.config.states.active.filter;k!=="none"&&this.applyFilter(p,h,k.type,k.value)}}},{key:"_scaleFilterSize",value:function(p){(function(h){for(var S in h)h.hasOwnProperty(S)&&p.setAttribute(S,h[S])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}]),Ee}(),z=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"roundPathCorners",value:function(p,h){function S(nt,lt,bt){var Zt=lt.x-nt.x,Ge=lt.y-nt.y,Je=Math.sqrt(Zt*Zt+Ge*Ge);return _(nt,lt,Math.min(1,bt/Je))}function _(nt,lt,bt){return{x:nt.x+(lt.x-nt.x)*bt,y:nt.y+(lt.y-nt.y)*bt}}function k(nt,lt){nt.length>2&&(nt[nt.length-2]=lt.x,nt[nt.length-1]=lt.y)}function T(nt){return{x:parseFloat(nt[nt.length-2]),y:parseFloat(nt[nt.length-1])}}p.indexOf("NaN")>-1&&(p="");var B=p.split(/[,\s]/).reduce(function(nt,lt){var bt=lt.match("([a-zA-Z])(.+)");return bt?(nt.push(bt[1]),nt.push(bt[2])):nt.push(lt),nt},[]).reduce(function(nt,lt){return parseFloat(lt)==lt&&nt.length?nt[nt.length-1].push(lt):nt.push([lt]),nt},[]),W=[];if(B.length>1){var ee=T(B[0]),de=null;B[B.length-1][0]=="Z"&&B[0].length>2&&(de=["L",ee.x,ee.y],B[B.length-1]=de),W.push(B[0]);for(var fe=1;fe<B.length;fe++){var xe=W[W.length-1],we=B[fe],ke=we==de?B[1]:B[fe+1];if(ke&&xe&&xe.length>2&&we[0]=="L"&&ke.length>2&&ke[0]=="L"){var Me,Ye,Fe=T(xe),st=T(we),se=T(ke);Me=S(st,Fe,h),Ye=S(st,se,h),k(we,Me),we.origPoint=st,W.push(we);var Se=_(Me,st,.5),De=_(st,Ye,.5),Le=["C",Se.x,Se.y,De.x,De.y,Ye.x,Ye.y];Le.origPoint=st,W.push(Le)}else W.push(we)}if(de){var _e=T(W[W.length-1]);W.push(["Z"]),k(W[0],_e)}}else W=B;return W.reduce(function(nt,lt){return nt+lt.join(" ")+" "},"")}},{key:"drawLine",value:function(p,h,S,_){var k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"#a8a8a8",T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,B=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,W=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"butt";return this.w.globals.dom.Paper.line().attr({x1:p,y1:h,x2:S,y2:_,stroke:k,"stroke-dasharray":T,"stroke-width":B,"stroke-linecap":W})}},{key:"drawRect",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"#fefefe",B=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1,W=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,ee=arguments.length>8&&arguments[8]!==void 0?arguments[8]:null,de=arguments.length>9&&arguments[9]!==void 0?arguments[9]:0,fe=this.w.globals.dom.Paper.rect();return fe.attr({x:p,y:h,width:S>0?S:0,height:_>0?_:0,rx:k,ry:k,opacity:B,"stroke-width":W!==null?W:0,stroke:ee!==null?ee:"none","stroke-dasharray":de}),fe.node.setAttribute("fill",T),fe}},{key:"drawPolygon",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"#e1e1e1",S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"none";return this.w.globals.dom.Paper.polygon(p).attr({fill:_,stroke:h,"stroke-width":S})}},{key:"drawCircle",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;p<0&&(p=0);var S=this.w.globals.dom.Paper.circle(2*p);return h!==null&&S.attr(h),S}},{key:"drawPath",value:function(p){var h=p.d,S=h===void 0?"":h,_=p.stroke,k=_===void 0?"#a8a8a8":_,T=p.strokeWidth,B=T===void 0?1:T,W=p.fill,ee=p.fillOpacity,de=ee===void 0?1:ee,fe=p.strokeOpacity,xe=fe===void 0?1:fe,we=p.classes,ke=p.strokeLinecap,Me=ke===void 0?null:ke,Ye=p.strokeDashArray,Fe=Ye===void 0?0:Ye,st=this.w;return Me===null&&(Me=st.config.stroke.lineCap),(S.indexOf("undefined")>-1||S.indexOf("NaN")>-1)&&(S="M 0 ".concat(st.globals.gridHeight)),st.globals.dom.Paper.path(S).attr({fill:W,"fill-opacity":de,stroke:k,"stroke-opacity":xe,"stroke-linecap":Me,"stroke-width":B,"stroke-dasharray":Fe,class:we})}},{key:"group",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,h=this.w.globals.dom.Paper.group();return p!==null&&h.attr(p),h}},{key:"move",value:function(p,h){var S=["M",p,h].join(" ");return S}},{key:"line",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=null;return S===null?_=[" L",p,h].join(" "):S==="H"?_=[" H",p].join(" "):S==="V"&&(_=[" V",h].join(" ")),_}},{key:"curve",value:function(p,h,S,_,k,T){var B=["C",p,h,S,_,k,T].join(" ");return B}},{key:"quadraticCurve",value:function(p,h,S,_){return["Q",p,h,S,_].join(" ")}},{key:"arc",value:function(p,h,S,_,k,T,B){var W="A";arguments.length>7&&arguments[7]!==void 0&&arguments[7]&&(W="a");var ee=[W,p,h,S,_,k,T,B].join(" ");return ee}},{key:"renderPaths",value:function(p){var h,S=p.j,_=p.realIndex,k=p.pathFrom,T=p.pathTo,B=p.stroke,W=p.strokeWidth,ee=p.strokeLinecap,de=p.fill,fe=p.animationDelay,xe=p.initialSpeed,we=p.dataChangeSpeed,ke=p.className,Me=p.chartType,Ye=p.shouldClipToGrid,Fe=Ye===void 0||Ye,st=p.bindEventsOnPaths,se=st===void 0||st,Se=p.drawShadow,De=Se===void 0||Se,Le=this.w,_e=new L(this.ctx),nt=new U(this.ctx),lt=this.w.config.chart.animations.enabled,bt=lt&&this.w.config.chart.animations.dynamicAnimation.enabled,Zt=!!(lt&&!Le.globals.resized||bt&&Le.globals.dataChanged&&Le.globals.shouldAnimate);Zt?h=k:(h=T,Le.globals.animationEnded=!0);var Ge=Le.config.stroke.dashArray,Je=0;Je=Array.isArray(Ge)?Ge[_]:Le.config.stroke.dashArray;var We=this.drawPath({d:h,stroke:B,strokeWidth:W,fill:de,fillOpacity:1,classes:ke,strokeLinecap:ee,strokeDashArray:Je});if(We.attr("index",_),Fe&&(Me==="bar"&&!Le.globals.isHorizontal||Le.globals.comboCharts?We.attr({"clip-path":"url(#gridRectBarMask".concat(Le.globals.cuid,")")}):We.attr({"clip-path":"url(#gridRectMask".concat(Le.globals.cuid,")")})),Le.config.states.normal.filter.type!=="none")_e.getDefaultFilter(We,_);else if(Le.config.chart.dropShadow.enabled&&De){var wt=Le.config.chart.dropShadow;_e.dropShadow(We,wt,_)}se&&(We.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,We)),We.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,We)),We.node.addEventListener("mousedown",this.pathMouseDown.bind(this,We))),We.attr({pathTo:T,pathFrom:k});var At={el:We,j:S,realIndex:_,pathFrom:k,pathTo:T,fill:de,strokeWidth:W,delay:fe};return!lt||Le.globals.resized||Le.globals.dataChanged?!Le.globals.resized&&Le.globals.dataChanged||nt.showDelayedElements():nt.animatePathsGradually(v(v({},At),{},{speed:xe})),Le.globals.dataChanged&&bt&&Zt&&nt.animatePathsGradually(v(v({},At),{},{speed:we})),We}},{key:"drawPattern",value:function(p,h,S){var _=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"#a8a8a8",k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;return this.w.globals.dom.Paper.pattern(h,S,function(T){p==="horizontalLines"?T.line(0,0,S,0).stroke({color:_,width:k+1}):p==="verticalLines"?T.line(0,0,0,h).stroke({color:_,width:k+1}):p==="slantedLines"?T.line(0,0,h,S).stroke({color:_,width:k}):p==="squares"?T.rect(h,S).fill("none").stroke({color:_,width:k}):p==="circles"&&T.circle(h).fill("none").stroke({color:_,width:k})})}},{key:"drawGradient",value:function(p,h,S,_,k){var T,B=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,W=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,ee=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,de=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0,fe=this.w;h.length<9&&h.indexOf("#")===0&&(h=F.hexToRgba(h,_)),S.length<9&&S.indexOf("#")===0&&(S=F.hexToRgba(S,k));var xe=0,we=1,ke=1,Me=null;W!==null&&(xe=W[0]!==void 0?W[0]/100:0,we=W[1]!==void 0?W[1]/100:1,ke=W[2]!==void 0?W[2]/100:1,Me=W[3]!==void 0?W[3]/100:null);var Ye=!(fe.config.chart.type!=="donut"&&fe.config.chart.type!=="pie"&&fe.config.chart.type!=="polarArea"&&fe.config.chart.type!=="bubble");if(T=ee===null||ee.length===0?fe.globals.dom.Paper.gradient(Ye?"radial":"linear",function(se){se.at(xe,h,_),se.at(we,S,k),se.at(ke,S,k),Me!==null&&se.at(Me,h,_)}):fe.globals.dom.Paper.gradient(Ye?"radial":"linear",function(se){(Array.isArray(ee[de])?ee[de]:ee).forEach(function(Se){se.at(Se.offset/100,Se.color,Se.opacity)})}),Ye){var Fe=fe.globals.gridWidth/2,st=fe.globals.gridHeight/2;fe.config.chart.type!=="bubble"?T.attr({gradientUnits:"userSpaceOnUse",cx:Fe,cy:st,r:B}):T.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else p==="vertical"?T.from(0,0).to(0,1):p==="diagonal"?T.from(0,0).to(1,1):p==="horizontal"?T.from(0,1).to(1,1):p==="diagonal2"&&T.from(1,0).to(0,1);return T}},{key:"getTextBasedOnMaxWidth",value:function(p){var h=p.text,S=p.maxWidth,_=p.fontSize,k=p.fontFamily,T=this.getTextRects(h,_,k),B=T.width/h.length,W=Math.floor(S/B);return S<T.width?h.slice(0,W-3)+"...":h}},{key:"drawText",value:function(p){var h=this,S=p.x,_=p.y,k=p.text,T=p.textAnchor,B=p.fontSize,W=p.fontFamily,ee=p.fontWeight,de=p.foreColor,fe=p.opacity,xe=p.maxWidth,we=p.cssClass,ke=we===void 0?"":we,Me=p.isPlainText,Ye=Me===void 0||Me,Fe=p.dominantBaseline,st=Fe===void 0?"auto":Fe,se=this.w;k===void 0&&(k="");var Se=k;T||(T="start"),de&&de.length||(de=se.config.chart.foreColor),W=W||se.config.chart.fontFamily,ee=ee||"regular";var De,Le={maxWidth:xe,fontSize:B=B||"11px",fontFamily:W};return Array.isArray(k)?De=se.globals.dom.Paper.text(function(_e){for(var nt=0;nt<k.length;nt++)Se=k[nt],xe&&(Se=h.getTextBasedOnMaxWidth(v({text:k[nt]},Le))),nt===0?_e.tspan(Se):_e.tspan(Se).newLine()}):(xe&&(Se=this.getTextBasedOnMaxWidth(v({text:k},Le))),De=Ye?se.globals.dom.Paper.plain(k):se.globals.dom.Paper.text(function(_e){return _e.tspan(Se)})),De.attr({x:S,y:_,"text-anchor":T,"dominant-baseline":st,"font-size":B,"font-family":W,"font-weight":ee,fill:de,class:"apexcharts-text "+ke}),De.node.style.fontFamily=W,De.node.style.opacity=fe,De}},{key:"getMarkerPath",value:function(p,h,S,_){var k="";switch(S){case"cross":k="M ".concat(p-(_/=1.4)," ").concat(h-_," L ").concat(p+_," ").concat(h+_," M ").concat(p-_," ").concat(h+_," L ").concat(p+_," ").concat(h-_);break;case"plus":k="M ".concat(p-(_/=1.12)," ").concat(h," L ").concat(p+_," ").concat(h," M ").concat(p," ").concat(h-_," L ").concat(p," ").concat(h+_);break;case"star":case"sparkle":var T=5;_*=1.15,S==="sparkle"&&(_/=1.1,T=4);for(var B=Math.PI/T,W=0;W<=2*T;W++){var ee=W*B,de=W%2==0?_:_/2;k+=(W===0?"M":"L")+(p+de*Math.sin(ee))+","+(h-de*Math.cos(ee))}k+="Z";break;case"triangle":k="M ".concat(p," ").concat(h-_,`
L `).concat(p+_," ").concat(h+_,`
L `).concat(p-_," ").concat(h+_,`
Z`);break;case"square":case"rect":k="M ".concat(p-(_/=1.125)," ").concat(h-_,`
L `).concat(p+_," ").concat(h-_,`
L `).concat(p+_," ").concat(h+_,`
L `).concat(p-_," ").concat(h+_,`
Z`);break;case"diamond":_*=1.05,k="M ".concat(p," ").concat(h-_,`
L `).concat(p+_," ").concat(h,`
L `).concat(p," ").concat(h+_,`
L `).concat(p-_," ").concat(h,`
Z`);break;case"line":k="M ".concat(p-(_/=1.1)," ").concat(h,`
L `).concat(p+_," ").concat(h);break;default:_*=2,k="M ".concat(p,", ").concat(h,`
m -`).concat(_/2,`, 0
a `).concat(_/2,",").concat(_/2," 0 1,0 ").concat(_,`,0
a `).concat(_/2,",").concat(_/2," 0 1,0 -").concat(_,",0")}return k}},{key:"drawMarkerShape",value:function(p,h,S,_,k){var T=this.drawPath({d:this.getMarkerPath(p,h,S,_,k),stroke:k.pointStrokeColor,strokeDashArray:k.pointStrokeDashArray,strokeWidth:k.pointStrokeWidth,fill:k.pointFillColor,fillOpacity:k.pointFillOpacity,strokeOpacity:k.pointStrokeOpacity});return T.attr({cx:p,cy:h,shape:k.shape,class:k.class?k.class:""}),T}},{key:"drawMarker",value:function(p,h,S){p=p||0;var _=S.pSize||0;return F.isNumber(h)||(_=0,h=0),this.drawMarkerShape(p,h,S==null?void 0:S.shape,_,v(v({},S),S.shape==="line"||S.shape==="plus"||S.shape==="cross"?{pointStrokeColor:S.pointFillColor,pointStrokeOpacity:S.pointFillOpacity}:{}))}},{key:"pathMouseEnter",value:function(p,h){var S=this.w,_=new L(this.ctx),k=parseInt(p.node.getAttribute("index"),10),T=parseInt(p.node.getAttribute("j"),10);if(typeof S.config.chart.events.dataPointMouseEnter=="function"&&S.config.chart.events.dataPointMouseEnter(h,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}),this.ctx.events.fireEvent("dataPointMouseEnter",[h,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}]),(S.config.states.active.filter.type==="none"||p.node.getAttribute("selected")!=="true")&&S.config.states.hover.filter.type!=="none"&&!S.globals.isTouchDevice){var B=S.config.states.hover.filter;_.applyFilter(p,k,B.type,B.value)}}},{key:"pathMouseLeave",value:function(p,h){var S=this.w,_=new L(this.ctx),k=parseInt(p.node.getAttribute("index"),10),T=parseInt(p.node.getAttribute("j"),10);typeof S.config.chart.events.dataPointMouseLeave=="function"&&S.config.chart.events.dataPointMouseLeave(h,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}),this.ctx.events.fireEvent("dataPointMouseLeave",[h,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}]),S.config.states.active.filter.type!=="none"&&p.node.getAttribute("selected")==="true"||S.config.states.hover.filter.type!=="none"&&_.getDefaultFilter(p,k)}},{key:"pathMouseDown",value:function(p,h){var S=this.w,_=new L(this.ctx),k=parseInt(p.node.getAttribute("index"),10),T=parseInt(p.node.getAttribute("j"),10),B="false";if(p.node.getAttribute("selected")==="true"){if(p.node.setAttribute("selected","false"),S.globals.selectedDataPoints[k].indexOf(T)>-1){var W=S.globals.selectedDataPoints[k].indexOf(T);S.globals.selectedDataPoints[k].splice(W,1)}}else{if(!S.config.states.active.allowMultipleDataPointsSelection&&S.globals.selectedDataPoints.length>0){S.globals.selectedDataPoints=[];var ee=S.globals.dom.Paper.select(".apexcharts-series path").members,de=S.globals.dom.Paper.select(".apexcharts-series circle, .apexcharts-series rect").members,fe=function(ke){Array.prototype.forEach.call(ke,function(Me){Me.node.setAttribute("selected","false"),_.getDefaultFilter(Me,k)})};fe(ee),fe(de)}p.node.setAttribute("selected","true"),B="true",S.globals.selectedDataPoints[k]===void 0&&(S.globals.selectedDataPoints[k]=[]),S.globals.selectedDataPoints[k].push(T)}if(B==="true"){var xe=S.config.states.active.filter;if(xe!=="none")_.applyFilter(p,k,xe.type,xe.value);else if(S.config.states.hover.filter!=="none"&&!S.globals.isTouchDevice){var we=S.config.states.hover.filter;_.applyFilter(p,k,we.type,we.value)}}else S.config.states.active.filter.type!=="none"&&(S.config.states.hover.filter.type==="none"||S.globals.isTouchDevice?_.getDefaultFilter(p,k):(we=S.config.states.hover.filter,_.applyFilter(p,k,we.type,we.value)));typeof S.config.chart.events.dataPointSelection=="function"&&S.config.chart.events.dataPointSelection(h,this.ctx,{selectedDataPoints:S.globals.selectedDataPoints,seriesIndex:k,dataPointIndex:T,w:S}),h&&this.ctx.events.fireEvent("dataPointSelection",[h,this.ctx,{selectedDataPoints:S.globals.selectedDataPoints,seriesIndex:k,dataPointIndex:T,w:S}])}},{key:"rotateAroundCenter",value:function(p){var h={};return p&&typeof p.getBBox=="function"&&(h=p.getBBox()),{x:h.x+h.width/2,y:h.y+h.height/2}}},{key:"getTextRects",value:function(p,h,S,_){var k=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],T=this.w,B=this.drawText({x:-200,y:-200,text:p,textAnchor:"start",fontSize:h,fontFamily:S,foreColor:"#fff",opacity:0});_&&B.attr("transform",_),T.globals.dom.Paper.add(B);var W=B.bbox();return k||(W=B.node.getBoundingClientRect()),B.remove(),{width:W.width,height:W.height}}},{key:"placeTextWithEllipsis",value:function(p,h,S){if(typeof p.getComputedTextLength=="function"&&(p.textContent=h,h.length>0&&p.getComputedTextLength()>=S/1.1)){for(var _=h.length-3;_>0;_-=3)if(p.getSubStringLength(0,_)<=S/1.1)return void(p.textContent=h.substring(0,_)+"...");p.textContent="."}}}],[{key:"setAttrs",value:function(p,h){for(var S in h)h.hasOwnProperty(S)&&p.setAttribute(S,h[S])}}]),Ee}(),Q=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"getStackedSeriesTotals",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=this.w,S=[];if(h.globals.series.length===0)return S;for(var _=0;_<h.globals.series[h.globals.maxValsInArrayIndex].length;_++){for(var k=0,T=0;T<h.globals.series.length;T++)h.globals.series[T][_]!==void 0&&p.indexOf(T)===-1&&(k+=h.globals.series[T][_]);S.push(k)}return S}},{key:"getSeriesTotalByIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return p===null?this.w.config.series.reduce(function(h,S){return h+S},0):this.w.globals.series[p].reduce(function(h,S){return h+S},0)}},{key:"getStackedSeriesTotalsByGroups",value:function(){var p=this,h=this.w,S=[];return h.globals.seriesGroups.forEach(function(_){var k=[];h.config.series.forEach(function(B,W){_.indexOf(h.globals.seriesNames[W])>-1&&k.push(W)});var T=h.globals.series.map(function(B,W){return k.indexOf(W)===-1?W:-1}).filter(function(B){return B!==-1});S.push(p.getStackedSeriesTotals(T))}),S}},{key:"setSeriesYAxisMappings",value:function(){var p=this.w.globals,h=this.w.config,S=[],_=[],k=[],T=p.series.length>h.yaxis.length||h.yaxis.some(function(fe){return Array.isArray(fe.seriesName)});h.series.forEach(function(fe,xe){k.push(xe),_.push(null)}),h.yaxis.forEach(function(fe,xe){S[xe]=[]});var B=[];h.yaxis.forEach(function(fe,xe){var we=!1;if(fe.seriesName){var ke=[];Array.isArray(fe.seriesName)?ke=fe.seriesName:ke.push(fe.seriesName),ke.forEach(function(Me){h.series.forEach(function(Ye,Fe){if(Ye.name===Me){var st=Fe;xe===Fe||T?!T||k.indexOf(Fe)>-1?S[xe].push([xe,Fe]):console.warn("Series '"+Ye.name+"' referenced more than once in what looks like the new style. That is, when using either seriesName: [], or when there are more series than yaxes."):(S[Fe].push([Fe,xe]),st=xe),we=!0,(st=k.indexOf(st))!==-1&&k.splice(st,1)}})})}we||B.push(xe)}),S=S.map(function(fe,xe){var we=[];return fe.forEach(function(ke){_[ke[1]]=ke[0],we.push(ke[1])}),we});for(var W=h.yaxis.length-1,ee=0;ee<B.length&&(W=B[ee],S[W]=[],k);ee++){var de=k[0];k.shift(),S[W].push(de),_[de]=W}k.forEach(function(fe){S[W].push(fe),_[fe]=W}),p.seriesYAxisMap=S.map(function(fe){return fe}),p.seriesYAxisReverseMap=_.map(function(fe){return fe}),p.seriesYAxisMap.forEach(function(fe,xe){fe.forEach(function(we){h.series[we]&&h.series[we].group===void 0&&(h.series[we].group="apexcharts-axis-".concat(xe.toString()))})})}},{key:"isSeriesNull",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return(p===null?this.w.config.series.filter(function(h){return h!==null}):this.w.config.series[p].data.filter(function(h){return h!==null})).length===0}},{key:"seriesHaveSameValues",value:function(p){return this.w.globals.series[p].every(function(h,S,_){return h===_[0]})}},{key:"getCategoryLabels",value:function(p){var h=this.w,S=p.slice();return h.config.xaxis.convertedCatToNumeric&&(S=p.map(function(_,k){return h.config.xaxis.labels.formatter(_-h.globals.minX+1)})),S}},{key:"getLargestSeries",value:function(){var p=this.w;p.globals.maxValsInArrayIndex=p.globals.series.map(function(h){return h.length}).indexOf(Math.max.apply(Math,p.globals.series.map(function(h){return h.length})))}},{key:"getLargestMarkerSize",value:function(){var p=this.w,h=0;return p.globals.markers.size.forEach(function(S){h=Math.max(h,S)}),p.config.markers.discrete&&p.config.markers.discrete.length&&p.config.markers.discrete.forEach(function(S){h=Math.max(h,S.size)}),h>0&&(p.config.markers.hover.size>0?h=p.config.markers.hover.size:h+=p.config.markers.hover.sizeOffset),p.globals.markers.largestSize=h,h}},{key:"getSeriesTotals",value:function(){var p=this.w;p.globals.seriesTotals=p.globals.series.map(function(h,S){var _=0;if(Array.isArray(h))for(var k=0;k<h.length;k++)_+=h[k];else _+=h;return _})}},{key:"getSeriesTotalsXRange",value:function(p,h){var S=this.w;return S.globals.series.map(function(_,k){for(var T=0,B=0;B<_.length;B++)S.globals.seriesX[k][B]>p&&S.globals.seriesX[k][B]<h&&(T+=_[B]);return T})}},{key:"getPercentSeries",value:function(){var p=this.w;p.globals.seriesPercent=p.globals.series.map(function(h,S){var _=[];if(Array.isArray(h))for(var k=0;k<h.length;k++){var T=p.globals.stackedSeriesTotals[k],B=0;T&&(B=100*h[k]/T),_.push(B)}else{var W=100*h/p.globals.seriesTotals.reduce(function(ee,de){return ee+de},0);_.push(W)}return _})}},{key:"getCalculatedRatios",value:function(){var p,h,S,_=this,k=this.w,T=k.globals,B=[],W=0,ee=[],de=.1,fe=0;if(T.yRange=[],T.isMultipleYAxis)for(var xe=0;xe<T.minYArr.length;xe++)T.yRange.push(Math.abs(T.minYArr[xe]-T.maxYArr[xe])),ee.push(0);else T.yRange.push(Math.abs(T.minY-T.maxY));T.xRange=Math.abs(T.maxX-T.minX),T.zRange=Math.abs(T.maxZ-T.minZ);for(var we=0;we<T.yRange.length;we++)B.push(T.yRange[we]/T.gridHeight);if(h=T.xRange/T.gridWidth,p=T.yRange/T.gridWidth,S=T.xRange/T.gridHeight,(W=T.zRange/T.gridHeight*16)||(W=1),T.minY!==Number.MIN_VALUE&&Math.abs(T.minY)!==0&&(T.hasNegs=!0),k.globals.seriesYAxisReverseMap.length>0){var ke=function(Ye,Fe){var st=k.config.yaxis[k.globals.seriesYAxisReverseMap[Fe]],se=Ye<0?-1:1;return Ye=Math.abs(Ye),st.logarithmic&&(Ye=_.getBaseLog(st.logBase,Ye)),-se*Ye/B[Fe]};if(T.isMultipleYAxis){ee=[];for(var Me=0;Me<B.length;Me++)ee.push(ke(T.minYArr[Me],Me))}else(ee=[]).push(ke(T.minY,0)),T.minY!==Number.MIN_VALUE&&Math.abs(T.minY)!==0&&(de=-T.minY/p,fe=T.minX/h)}else(ee=[]).push(0),de=0,fe=0;return{yRatio:B,invertedYRatio:p,zRatio:W,xRatio:h,invertedXRatio:S,baseLineInvertedY:de,baseLineY:ee,baseLineX:fe}}},{key:"getLogSeries",value:function(p){var h=this,S=this.w;return S.globals.seriesLog=p.map(function(_,k){var T=S.globals.seriesYAxisReverseMap[k];return S.config.yaxis[T]&&S.config.yaxis[T].logarithmic?_.map(function(B){return B===null?null:h.getLogVal(S.config.yaxis[T].logBase,B,k)}):_}),S.globals.invalidLogScale?p:S.globals.seriesLog}},{key:"getBaseLog",value:function(p,h){return Math.log(h)/Math.log(p)}},{key:"getLogVal",value:function(p,h,S){if(h<=0)return 0;var _=this.w,k=_.globals.minYArr[S]===0?-1:this.getBaseLog(p,_.globals.minYArr[S]),T=(_.globals.maxYArr[S]===0?0:this.getBaseLog(p,_.globals.maxYArr[S]))-k;return h<1?h/T:(this.getBaseLog(p,h)-k)/T}},{key:"getLogYRatios",value:function(p){var h=this,S=this.w,_=this.w.globals;return _.yLogRatio=p.slice(),_.logYRange=_.yRange.map(function(k,T){var B=S.globals.seriesYAxisReverseMap[T];if(S.config.yaxis[B]&&h.w.config.yaxis[B].logarithmic){var W,ee=-Number.MAX_VALUE,de=Number.MIN_VALUE;return _.seriesLog.forEach(function(fe,xe){fe.forEach(function(we){S.config.yaxis[xe]&&S.config.yaxis[xe].logarithmic&&(ee=Math.max(we,ee),de=Math.min(we,de))})}),W=Math.pow(_.yRange[T],Math.abs(de-ee)/_.yRange[T]),_.yLogRatio[T]=W/_.gridHeight,W}}),_.invalidLogScale?p.slice():_.yLogRatio}},{key:"drawSeriesByGroup",value:function(p,h,S,_){var k=this.w,T=[];return p.series.length>0&&h.forEach(function(B){var W=[],ee=[];p.i.forEach(function(de,fe){k.config.series[de].group===B&&(W.push(p.series[fe]),ee.push(de))}),W.length>0&&T.push(_.draw(W,S,ee))}),T}}],[{key:"checkComboSeries",value:function(p,h){var S=!1,_=0,k=0;return h===void 0&&(h="line"),p.length&&p[0].type!==void 0&&p.forEach(function(T){T.type!=="bar"&&T.type!=="column"&&T.type!=="candlestick"&&T.type!=="boxPlot"||_++,T.type!==void 0&&T.type!==h&&k++}),k>0&&(S=!0),{comboBarCount:_,comboCharts:S}}},{key:"extendArrayProps",value:function(p,h,S){var _,k,T,B,W,ee;return(_=h)!==null&&_!==void 0&&_.yaxis&&(h=p.extendYAxis(h,S)),(k=h)!==null&&k!==void 0&&k.annotations&&(h.annotations.yaxis&&(h=p.extendYAxisAnnotations(h)),(T=h)!==null&&T!==void 0&&(B=T.annotations)!==null&&B!==void 0&&B.xaxis&&(h=p.extendXAxisAnnotations(h)),(W=h)!==null&&W!==void 0&&(ee=W.annotations)!==null&&ee!==void 0&&ee.points&&(h=p.extendPointAnnotations(h))),h}}]),Ee}(),ne=function(){function Ee(p){s(this,Ee),this.w=p.w,this.annoCtx=p}return o(Ee,[{key:"setOrientations",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,S=this.w;if(p.label.orientation==="vertical"){var _=h!==null?h:0,k=S.globals.dom.baseEl.querySelector(".apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='".concat(_,"']"));if(k!==null){var T=k.getBoundingClientRect();k.setAttribute("x",parseFloat(k.getAttribute("x"))-T.height+4);var B=p.label.position==="top"?T.width:-T.width;k.setAttribute("y",parseFloat(k.getAttribute("y"))+B);var W=this.annoCtx.graphics.rotateAroundCenter(k),ee=W.x,de=W.y;k.setAttribute("transform","rotate(-90 ".concat(ee," ").concat(de,")"))}}}},{key:"addBackgroundToAnno",value:function(p,h){var S=this.w;if(!p||!h.label.text||!String(h.label.text).trim())return null;var _=S.globals.dom.baseEl.querySelector(".apexcharts-grid").getBoundingClientRect(),k=p.getBoundingClientRect(),T=h.label.style.padding,B=T.left,W=T.right,ee=T.top,de=T.bottom;if(h.label.orientation==="vertical"){var fe=[B,W,ee,de];ee=fe[0],de=fe[1],B=fe[2],W=fe[3]}var xe=k.left-_.left-B,we=k.top-_.top-ee,ke=this.annoCtx.graphics.drawRect(xe-S.globals.barPadForNumericAxis,we,k.width+B+W,k.height+ee+de,h.label.borderRadius,h.label.style.background,1,h.label.borderWidth,h.label.borderColor,0);return h.id&&ke.node.classList.add(h.id),ke}},{key:"annotationsBackground",value:function(){var p=this,h=this.w,S=function(_,k,T){var B=h.globals.dom.baseEl.querySelector(".apexcharts-".concat(T,"-annotations .apexcharts-").concat(T,"-annotation-label[rel='").concat(k,"']"));if(B){var W=B.parentNode,ee=p.addBackgroundToAnno(B,_);ee&&(W.insertBefore(ee.node,B),_.label.mouseEnter&&ee.node.addEventListener("mouseenter",_.label.mouseEnter.bind(p,_)),_.label.mouseLeave&&ee.node.addEventListener("mouseleave",_.label.mouseLeave.bind(p,_)),_.label.click&&ee.node.addEventListener("click",_.label.click.bind(p,_)))}};h.config.annotations.xaxis.forEach(function(_,k){return S(_,k,"xaxis")}),h.config.annotations.yaxis.forEach(function(_,k){return S(_,k,"yaxis")}),h.config.annotations.points.forEach(function(_,k){return S(_,k,"point")})}},{key:"getY1Y2",value:function(p,h){var S,_=this.w,k=p==="y1"?h.y:h.y2,T=!1;if(this.annoCtx.invertAxis){var B=_.config.xaxis.convertedCatToNumeric?_.globals.categoryLabels:_.globals.labels,W=B.indexOf(k),ee=_.globals.dom.baseEl.querySelector(".apexcharts-yaxis-texts-g text:nth-child(".concat(W+1,")"));S=ee?parseFloat(ee.getAttribute("y")):(_.globals.gridHeight/B.length-1)*(W+1)-_.globals.barHeight,h.seriesIndex!==void 0&&_.globals.barHeight&&(S-=_.globals.barHeight/2*(_.globals.series.length-1)-_.globals.barHeight*h.seriesIndex)}else{var de,fe=_.globals.seriesYAxisMap[h.yAxisIndex][0],xe=_.config.yaxis[h.yAxisIndex].logarithmic?new Q(this.annoCtx.ctx).getLogVal(_.config.yaxis[h.yAxisIndex].logBase,k,fe)/_.globals.yLogRatio[fe]:(k-_.globals.minYArr[fe])/(_.globals.yRange[fe]/_.globals.gridHeight);S=_.globals.gridHeight-Math.min(Math.max(xe,0),_.globals.gridHeight),T=xe>_.globals.gridHeight||xe<0,!h.marker||h.y!==void 0&&h.y!==null||(S=0),(de=_.config.yaxis[h.yAxisIndex])!==null&&de!==void 0&&de.reversed&&(S=xe)}return typeof k=="string"&&k.includes("px")&&(S=parseFloat(k)),{yP:S,clipped:T}}},{key:"getX1X2",value:function(p,h){var S=this.w,_=p==="x1"?h.x:h.x2,k=this.annoCtx.invertAxis?S.globals.minY:S.globals.minX,T=this.annoCtx.invertAxis?S.globals.maxY:S.globals.maxX,B=this.annoCtx.invertAxis?S.globals.yRange[0]:S.globals.xRange,W=!1,ee=this.annoCtx.inversedReversedAxis?(T-_)/(B/S.globals.gridWidth):(_-k)/(B/S.globals.gridWidth);return S.config.xaxis.type!=="category"&&!S.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||S.globals.dataFormatXNumeric||S.config.chart.sparkline.enabled||(ee=this.getStringX(_)),typeof _=="string"&&_.includes("px")&&(ee=parseFloat(_)),_==null&&h.marker&&(ee=S.globals.gridWidth),h.seriesIndex!==void 0&&S.globals.barWidth&&!this.annoCtx.invertAxis&&(ee-=S.globals.barWidth/2*(S.globals.series.length-1)-S.globals.barWidth*h.seriesIndex),ee>S.globals.gridWidth?(ee=S.globals.gridWidth,W=!0):ee<0&&(ee=0,W=!0),{x:ee,clipped:W}}},{key:"getStringX",value:function(p){var h=this.w,S=p;h.config.xaxis.convertedCatToNumeric&&h.globals.categoryLabels.length&&(p=h.globals.categoryLabels.indexOf(p)+1);var _=h.globals.labels.map(function(T){return Array.isArray(T)?T.join(" "):T}).indexOf(p),k=h.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g text:nth-child(".concat(_+1,")"));return k&&(S=parseFloat(k.getAttribute("x"))),S}}]),Ee}(),J=function(){function Ee(p){s(this,Ee),this.w=p.w,this.annoCtx=p,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new ne(this.annoCtx)}return o(Ee,[{key:"addXaxisAnnotation",value:function(p,h,S){var _,k=this.w,T=this.helpers.getX1X2("x1",p),B=T.x,W=T.clipped,ee=!0,de=p.label.text,fe=p.strokeDashArray;if(F.isNumber(B)){if(p.x2===null||p.x2===void 0){if(!W){var xe=this.annoCtx.graphics.drawLine(B+p.offsetX,0+p.offsetY,B+p.offsetX,k.globals.gridHeight+p.offsetY,p.borderColor,fe,p.borderWidth);h.appendChild(xe.node),p.id&&xe.node.classList.add(p.id)}}else{var we=this.helpers.getX1X2("x2",p);if(_=we.x,ee=we.clipped,!W||!ee){if(_<B){var ke=B;B=_,_=ke}var Me=this.annoCtx.graphics.drawRect(B+p.offsetX,0+p.offsetY,_-B,k.globals.gridHeight+p.offsetY,0,p.fillColor,p.opacity,1,p.borderColor,fe);Me.node.classList.add("apexcharts-annotation-rect"),Me.attr("clip-path","url(#gridRectMask".concat(k.globals.cuid,")")),h.appendChild(Me.node),p.id&&Me.node.classList.add(p.id)}}if(!W||!ee){var Ye=this.annoCtx.graphics.getTextRects(de,parseFloat(p.label.style.fontSize)),Fe=p.label.position==="top"?4:p.label.position==="center"?k.globals.gridHeight/2+(p.label.orientation==="vertical"?Ye.width/2:0):k.globals.gridHeight,st=this.annoCtx.graphics.drawText({x:B+p.label.offsetX,y:Fe+p.label.offsetY-(p.label.orientation==="vertical"?p.label.position==="top"?Ye.width/2-12:-Ye.width/2:0),text:de,textAnchor:p.label.textAnchor,fontSize:p.label.style.fontSize,fontFamily:p.label.style.fontFamily,fontWeight:p.label.style.fontWeight,foreColor:p.label.style.color,cssClass:"apexcharts-xaxis-annotation-label ".concat(p.label.style.cssClass," ").concat(p.id?p.id:"")});st.attr({rel:S}),h.appendChild(st.node),this.annoCtx.helpers.setOrientations(p,S)}}}},{key:"drawXAxisAnnotations",value:function(){var p=this,h=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return h.config.annotations.xaxis.map(function(_,k){p.addXaxisAnnotation(_,S.node,k)}),S}}]),Ee}(),X=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}return o(Ee,[{key:"isValidDate",value:function(p){return typeof p!="number"&&!isNaN(this.parseDate(p))}},{key:"getTimeStamp",value:function(p){return Date.parse(p)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(p).toISOString().substr(0,25)).getTime():new Date(p).getTime():p}},{key:"getDate",value:function(p){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(p).toUTCString()):new Date(p)}},{key:"parseDate",value:function(p){var h=Date.parse(p);if(!isNaN(h))return this.getTimeStamp(p);var S=Date.parse(p.replace(/-/g,"/").replace(/[a-z]+/gi," "));return S=this.getTimeStamp(S)}},{key:"parseDateWithTimezone",value:function(p){return Date.parse(p.replace(/-/g,"/").replace(/[a-z]+/gi," "))}},{key:"formatDate",value:function(p,h){var S=this.w.globals.locale,_=this.w.config.xaxis.labels.datetimeUTC,k=["\0"].concat(N(S.months)),T=[""].concat(N(S.shortMonths)),B=[""].concat(N(S.days)),W=[""].concat(N(S.shortDays));function ee(nt,lt){var bt=nt+"";for(lt=lt||2;bt.length<lt;)bt="0"+bt;return bt}var de=_?p.getUTCFullYear():p.getFullYear();h=(h=(h=h.replace(/(^|[^\\])yyyy+/g,"$1"+de)).replace(/(^|[^\\])yy/g,"$1"+de.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+de);var fe=(_?p.getUTCMonth():p.getMonth())+1;h=(h=(h=(h=h.replace(/(^|[^\\])MMMM+/g,"$1"+k[0])).replace(/(^|[^\\])MMM/g,"$1"+T[0])).replace(/(^|[^\\])MM/g,"$1"+ee(fe))).replace(/(^|[^\\])M/g,"$1"+fe);var xe=_?p.getUTCDate():p.getDate();h=(h=(h=(h=h.replace(/(^|[^\\])dddd+/g,"$1"+B[0])).replace(/(^|[^\\])ddd/g,"$1"+W[0])).replace(/(^|[^\\])dd/g,"$1"+ee(xe))).replace(/(^|[^\\])d/g,"$1"+xe);var we=_?p.getUTCHours():p.getHours(),ke=we>12?we-12:we===0?12:we;h=(h=(h=(h=h.replace(/(^|[^\\])HH+/g,"$1"+ee(we))).replace(/(^|[^\\])H/g,"$1"+we)).replace(/(^|[^\\])hh+/g,"$1"+ee(ke))).replace(/(^|[^\\])h/g,"$1"+ke);var Me=_?p.getUTCMinutes():p.getMinutes();h=(h=h.replace(/(^|[^\\])mm+/g,"$1"+ee(Me))).replace(/(^|[^\\])m/g,"$1"+Me);var Ye=_?p.getUTCSeconds():p.getSeconds();h=(h=h.replace(/(^|[^\\])ss+/g,"$1"+ee(Ye))).replace(/(^|[^\\])s/g,"$1"+Ye);var Fe=_?p.getUTCMilliseconds():p.getMilliseconds();h=h.replace(/(^|[^\\])fff+/g,"$1"+ee(Fe,3)),Fe=Math.round(Fe/10),h=h.replace(/(^|[^\\])ff/g,"$1"+ee(Fe)),Fe=Math.round(Fe/10);var st=we<12?"AM":"PM";h=(h=(h=h.replace(/(^|[^\\])f/g,"$1"+Fe)).replace(/(^|[^\\])TT+/g,"$1"+st)).replace(/(^|[^\\])T/g,"$1"+st.charAt(0));var se=st.toLowerCase();h=(h=h.replace(/(^|[^\\])tt+/g,"$1"+se)).replace(/(^|[^\\])t/g,"$1"+se.charAt(0));var Se=-p.getTimezoneOffset(),De=_||!Se?"Z":Se>0?"+":"-";if(!_){var Le=(Se=Math.abs(Se))%60;De+=ee(Math.floor(Se/60))+":"+ee(Le)}h=h.replace(/(^|[^\\])K/g,"$1"+De);var _e=(_?p.getUTCDay():p.getDay())+1;return h=(h=(h=(h=(h=h.replace(new RegExp(B[0],"g"),B[_e])).replace(new RegExp(W[0],"g"),W[_e])).replace(new RegExp(k[0],"g"),k[fe])).replace(new RegExp(T[0],"g"),T[fe])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(p,h,S){var _=this.w;_.config.xaxis.min!==void 0&&(p=_.config.xaxis.min),_.config.xaxis.max!==void 0&&(h=_.config.xaxis.max);var k=this.getDate(p),T=this.getDate(h),B=this.formatDate(k,"yyyy MM dd HH mm ss fff").split(" "),W=this.formatDate(T,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(B[6],10),maxMillisecond:parseInt(W[6],10),minSecond:parseInt(B[5],10),maxSecond:parseInt(W[5],10),minMinute:parseInt(B[4],10),maxMinute:parseInt(W[4],10),minHour:parseInt(B[3],10),maxHour:parseInt(W[3],10),minDate:parseInt(B[2],10),maxDate:parseInt(W[2],10),minMonth:parseInt(B[1],10)-1,maxMonth:parseInt(W[1],10)-1,minYear:parseInt(B[0],10),maxYear:parseInt(W[0],10)}}},{key:"isLeapYear",value:function(p){return p%4==0&&p%100!=0||p%400==0}},{key:"calculcateLastDaysOfMonth",value:function(p,h,S){return this.determineDaysOfMonths(p,h)-S}},{key:"determineDaysOfYear",value:function(p){var h=365;return this.isLeapYear(p)&&(h=366),h}},{key:"determineRemainingDaysOfYear",value:function(p,h,S){var _=this.daysCntOfYear[h]+S;return h>1&&this.isLeapYear()&&_++,_}},{key:"determineDaysOfMonths",value:function(p,h){var S=30;switch(p=F.monthMod(p),!0){case this.months30.indexOf(p)>-1:p===2&&(S=this.isLeapYear(h)?29:28);break;case this.months31.indexOf(p)>-1:default:S=31}return S}}]),Ee}(),re=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.tooltipKeyFormat="dd MMM"}return o(Ee,[{key:"xLabelFormat",value:function(p,h,S,_){var k=this.w;if(k.config.xaxis.type==="datetime"&&k.config.xaxis.labels.formatter===void 0&&k.config.tooltip.x.formatter===void 0){var T=new X(this.ctx);return T.formatDate(T.getDate(h),k.config.tooltip.x.format)}return p(h,S,_)}},{key:"defaultGeneralFormatter",value:function(p){return Array.isArray(p)?p.map(function(h){return h}):p}},{key:"defaultYFormatter",value:function(p,h,S){var _=this.w;if(F.isNumber(p))if(_.globals.yValueDecimal!==0)p=p.toFixed(h.decimalsInFloat!==void 0?h.decimalsInFloat:_.globals.yValueDecimal);else{var k=p.toFixed(0);p=p==k?k:p.toFixed(1)}return p}},{key:"setLabelFormatters",value:function(){var p=this,h=this.w;return h.globals.xaxisTooltipFormatter=function(S){return p.defaultGeneralFormatter(S)},h.globals.ttKeyFormatter=function(S){return p.defaultGeneralFormatter(S)},h.globals.ttZFormatter=function(S){return S},h.globals.legendFormatter=function(S){return p.defaultGeneralFormatter(S)},h.config.xaxis.labels.formatter!==void 0?h.globals.xLabelFormatter=h.config.xaxis.labels.formatter:h.globals.xLabelFormatter=function(S){if(F.isNumber(S)){if(!h.config.xaxis.convertedCatToNumeric&&h.config.xaxis.type==="numeric"){if(F.isNumber(h.config.xaxis.decimalsInFloat))return S.toFixed(h.config.xaxis.decimalsInFloat);var _=h.globals.maxX-h.globals.minX;return _>0&&_<100?S.toFixed(1):S.toFixed(0)}return h.globals.isBarHorizontal&&h.globals.maxY-h.globals.minYArr<4?S.toFixed(1):S.toFixed(0)}return S},typeof h.config.tooltip.x.formatter=="function"?h.globals.ttKeyFormatter=h.config.tooltip.x.formatter:h.globals.ttKeyFormatter=h.globals.xLabelFormatter,typeof h.config.xaxis.tooltip.formatter=="function"&&(h.globals.xaxisTooltipFormatter=h.config.xaxis.tooltip.formatter),(Array.isArray(h.config.tooltip.y)||h.config.tooltip.y.formatter!==void 0)&&(h.globals.ttVal=h.config.tooltip.y),h.config.tooltip.z.formatter!==void 0&&(h.globals.ttZFormatter=h.config.tooltip.z.formatter),h.config.legend.formatter!==void 0&&(h.globals.legendFormatter=h.config.legend.formatter),h.config.yaxis.forEach(function(S,_){S.labels.formatter!==void 0?h.globals.yLabelFormatters[_]=S.labels.formatter:h.globals.yLabelFormatters[_]=function(k){return h.globals.xyCharts?Array.isArray(k)?k.map(function(T){return p.defaultYFormatter(T,S,_)}):p.defaultYFormatter(k,S,_):k}}),h.globals}},{key:"heatmapLabelFormatters",value:function(){var p=this.w;if(p.config.chart.type==="heatmap"){p.globals.yAxisScale[0].result=p.globals.seriesNames.slice();var h=p.globals.seriesNames.reduce(function(S,_){return S.length>_.length?S:_},0);p.globals.yAxisScale[0].niceMax=h,p.globals.yAxisScale[0].niceMin=h}}}]),Ee}(),pe=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"getLabel",value:function(p,h,S,_){var k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"12px",B=!(arguments.length>6&&arguments[6]!==void 0)||arguments[6],W=this.w,ee=p[_]===void 0?"":p[_],de=ee,fe=W.globals.xLabelFormatter,xe=W.config.xaxis.labels.formatter,we=!1,ke=new re(this.ctx),Me=ee;B&&(de=ke.xLabelFormat(fe,ee,Me,{i:_,dateFormatter:new X(this.ctx).formatDate,w:W}),xe!==void 0&&(de=xe(ee,p[_],{i:_,dateFormatter:new X(this.ctx).formatDate,w:W})));var Ye,Fe;h.length>0?(Ye=h[_].unit,Fe=null,h.forEach(function(De){De.unit==="month"?Fe="year":De.unit==="day"?Fe="month":De.unit==="hour"?Fe="day":De.unit==="minute"&&(Fe="hour")}),we=Fe===Ye,S=h[_].position,de=h[_].value):W.config.xaxis.type==="datetime"&&xe===void 0&&(de=""),de===void 0&&(de=""),de=Array.isArray(de)?de:de.toString();var st=new z(this.ctx),se={};se=W.globals.rotateXLabels&&B?st.getTextRects(de,parseInt(T,10),null,"rotate(".concat(W.config.xaxis.labels.rotate," 0 0)"),!1):st.getTextRects(de,parseInt(T,10));var Se=!W.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(de)&&(String(de)==="NaN"||k.indexOf(de)>=0&&Se)&&(de=""),{x:S,text:de,textRect:se,isBold:we}}},{key:"checkLabelBasedOnTickamount",value:function(p,h,S){var _=this.w,k=_.config.xaxis.tickAmount;return k==="dataPoints"&&(k=Math.round(_.globals.gridWidth/120)),k>S||p%Math.round(S/(k+1))==0||(h.text=""),h}},{key:"checkForOverflowingLabels",value:function(p,h,S,_,k){var T=this.w;if(p===0&&T.globals.skipFirstTimelinelabel&&(h.text=""),p===S-1&&T.globals.skipLastTimelinelabel&&(h.text=""),T.config.xaxis.labels.hideOverlappingLabels&&_.length>0){var B=k[k.length-1];h.x<B.textRect.width/(T.globals.rotateXLabels?Math.abs(T.config.xaxis.labels.rotate)/12:1.01)+B.x&&(h.text="")}return h}},{key:"checkForReversedLabels",value:function(p,h){var S=this.w;return S.config.yaxis[p]&&S.config.yaxis[p].reversed&&h.reverse(),h}},{key:"yAxisAllSeriesCollapsed",value:function(p){var h=this.w.globals;return!h.seriesYAxisMap[p].some(function(S){return h.collapsedSeriesIndices.indexOf(S)===-1})}},{key:"translateYAxisIndex",value:function(p){var h=this.w,S=h.globals,_=h.config.yaxis;return S.series.length>_.length||_.some(function(k){return Array.isArray(k.seriesName)})?p:S.seriesYAxisReverseMap[p]}},{key:"isYAxisHidden",value:function(p){var h=this.w,S=h.config.yaxis[p];if(!S.show||this.yAxisAllSeriesCollapsed(p))return!0;if(!S.showForNullSeries){var _=h.globals.seriesYAxisMap[p],k=new Q(this.ctx);return _.every(function(T){return k.isSeriesNull(T)})}return!1}},{key:"getYAxisForeColor",value:function(p,h){var S=this.w;return Array.isArray(p)&&S.globals.yAxisScale[h]&&this.ctx.theme.pushExtraColors(p,S.globals.yAxisScale[h].result.length,!1),p}},{key:"drawYAxisTicks",value:function(p,h,S,_,k,T,B){var W=this.w,ee=new z(this.ctx),de=W.globals.translateY+W.config.yaxis[k].labels.offsetY;if(W.globals.isBarHorizontal?de=0:W.config.chart.type==="heatmap"&&(de+=T/2),_.show&&h>0){W.config.yaxis[k].opposite===!0&&(p+=_.width);for(var fe=h;fe>=0;fe--){var xe=ee.drawLine(p+S.offsetX-_.width+_.offsetX,de+_.offsetY,p+S.offsetX+_.offsetX,de+_.offsetY,_.color);B.add(xe),de+=T}}}}]),Ee}(),Y=function(){function Ee(p){s(this,Ee),this.w=p.w,this.annoCtx=p,this.helpers=new ne(this.annoCtx),this.axesUtils=new pe(this.annoCtx)}return o(Ee,[{key:"addYaxisAnnotation",value:function(p,h,S){var _,k=this.w,T=p.strokeDashArray,B=this.helpers.getY1Y2("y1",p),W=B.yP,ee=B.clipped,de=!0,fe=!1,xe=p.label.text;if(p.y2===null||p.y2===void 0){if(!ee){fe=!0;var we=this.annoCtx.graphics.drawLine(0+p.offsetX,W+p.offsetY,this._getYAxisAnnotationWidth(p),W+p.offsetY,p.borderColor,T,p.borderWidth);h.appendChild(we.node),p.id&&we.node.classList.add(p.id)}}else{if(_=(B=this.helpers.getY1Y2("y2",p)).yP,de=B.clipped,_>W){var ke=W;W=_,_=ke}if(!ee||!de){fe=!0;var Me=this.annoCtx.graphics.drawRect(0+p.offsetX,_+p.offsetY,this._getYAxisAnnotationWidth(p),W-_,0,p.fillColor,p.opacity,1,p.borderColor,T);Me.node.classList.add("apexcharts-annotation-rect"),Me.attr("clip-path","url(#gridRectMask".concat(k.globals.cuid,")")),h.appendChild(Me.node),p.id&&Me.node.classList.add(p.id)}}if(fe){var Ye=p.label.position==="right"?k.globals.gridWidth:p.label.position==="center"?k.globals.gridWidth/2:0,Fe=this.annoCtx.graphics.drawText({x:Ye+p.label.offsetX,y:(_??W)+p.label.offsetY-3,text:xe,textAnchor:p.label.textAnchor,fontSize:p.label.style.fontSize,fontFamily:p.label.style.fontFamily,fontWeight:p.label.style.fontWeight,foreColor:p.label.style.color,cssClass:"apexcharts-yaxis-annotation-label ".concat(p.label.style.cssClass," ").concat(p.id?p.id:"")});Fe.attr({rel:S}),h.appendChild(Fe.node)}}},{key:"_getYAxisAnnotationWidth",value:function(p){var h=this.w;return h.globals.gridWidth,(p.width.indexOf("%")>-1?h.globals.gridWidth*parseInt(p.width,10)/100:parseInt(p.width,10))+p.offsetX}},{key:"drawYAxisAnnotations",value:function(){var p=this,h=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return h.config.annotations.yaxis.forEach(function(_,k){_.yAxisIndex=p.axesUtils.translateYAxisIndex(_.yAxisIndex),p.axesUtils.isYAxisHidden(_.yAxisIndex)&&p.axesUtils.yAxisAllSeriesCollapsed(_.yAxisIndex)||p.addYaxisAnnotation(_,S.node,k)}),S}}]),Ee}(),ie=function(){function Ee(p){s(this,Ee),this.w=p.w,this.annoCtx=p,this.helpers=new ne(this.annoCtx)}return o(Ee,[{key:"addPointAnnotation",value:function(p,h,S){if(!(this.w.globals.collapsedSeriesIndices.indexOf(p.seriesIndex)>-1)){var _=this.helpers.getX1X2("x1",p),k=_.x,T=_.clipped,B=(_=this.helpers.getY1Y2("y1",p)).yP,W=_.clipped;if(F.isNumber(k)&&!W&&!T){var ee={pSize:p.marker.size,pointStrokeWidth:p.marker.strokeWidth,pointFillColor:p.marker.fillColor,pointStrokeColor:p.marker.strokeColor,shape:p.marker.shape,pRadius:p.marker.radius,class:"apexcharts-point-annotation-marker ".concat(p.marker.cssClass," ").concat(p.id?p.id:"")},de=this.annoCtx.graphics.drawMarker(k+p.marker.offsetX,B+p.marker.offsetY,ee);h.appendChild(de.node);var fe=p.label.text?p.label.text:"",xe=this.annoCtx.graphics.drawText({x:k+p.label.offsetX,y:B+p.label.offsetY-p.marker.size-parseFloat(p.label.style.fontSize)/1.6,text:fe,textAnchor:p.label.textAnchor,fontSize:p.label.style.fontSize,fontFamily:p.label.style.fontFamily,fontWeight:p.label.style.fontWeight,foreColor:p.label.style.color,cssClass:"apexcharts-point-annotation-label ".concat(p.label.style.cssClass," ").concat(p.id?p.id:"")});if(xe.attr({rel:S}),h.appendChild(xe.node),p.customSVG.SVG){var we=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+p.customSVG.cssClass});we.attr({transform:"translate(".concat(k+p.customSVG.offsetX,", ").concat(B+p.customSVG.offsetY,")")}),we.node.innerHTML=p.customSVG.SVG,h.appendChild(we.node)}if(p.image.path){var ke=p.image.width?p.image.width:20,Me=p.image.height?p.image.height:20;de=this.annoCtx.addImage({x:k+p.image.offsetX-ke/2,y:B+p.image.offsetY-Me/2,width:ke,height:Me,path:p.image.path,appendTo:".apexcharts-point-annotations"})}p.mouseEnter&&de.node.addEventListener("mouseenter",p.mouseEnter.bind(this,p)),p.mouseLeave&&de.node.addEventListener("mouseleave",p.mouseLeave.bind(this,p)),p.click&&de.node.addEventListener("click",p.click.bind(this,p))}}}},{key:"drawPointAnnotations",value:function(){var p=this,h=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return h.config.annotations.points.map(function(_,k){p.addPointAnnotation(_,S.node,k)}),S}}]),Ee}(),oe={name:"en",options:{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"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}},G=function(){function Ee(){s(this,Ee),this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}return o(Ee,[{key:"init",value:function(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,easing:"easeinout",speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"",locales:[oe],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.35},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},stacked:!1,stackOnlyBar:!0,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}}},plotOptions:{line:{isSlopeChart:!1},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:function(p){return p}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(p){return p+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(p){return p.globals.seriesTotals.reduce(function(h,S){return h+S},0)/p.globals.series.length+"%"}}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:function(p){return p},onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:function(p){return p}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(p){return p}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(p){return p.globals.seriesTotals.reduce(function(h,S){return h+S},0)}}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:function(p){return p!==null?p:""},textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{normal:{filter:{type:"none",value:0}},hover:{filter:{type:"lighten",value:.1}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken",value:.5}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:function(p){return p?p+": ":""}}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.4}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}]),Ee}(),V=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.graphics=new z(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new ne(this),this.xAxisAnnotations=new J(this),this.yAxisAnnotations=new Y(this),this.pointsAnnotations=new ie(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}return o(Ee,[{key:"drawAxesAnnotations",value:function(){var p=this.w;if(p.globals.axisCharts&&p.globals.dataPoints){for(var h=this.yAxisAnnotations.drawYAxisAnnotations(),S=this.xAxisAnnotations.drawXAxisAnnotations(),_=this.pointsAnnotations.drawPointAnnotations(),k=p.config.chart.animations.enabled,T=[h,S,_],B=[S.node,h.node,_.node],W=0;W<3;W++)p.globals.dom.elGraphical.add(T[W]),!k||p.globals.resized||p.globals.dataChanged||p.config.chart.type!=="scatter"&&p.config.chart.type!=="bubble"&&p.globals.dataPoints>1&&B[W].classList.add("apexcharts-element-hidden"),p.globals.delayedElements.push({el:B[W],index:0});this.helpers.annotationsBackground()}}},{key:"drawImageAnnos",value:function(){var p=this;this.w.config.annotations.images.map(function(h,S){p.addImage(h,S)})}},{key:"drawTextAnnos",value:function(){var p=this;this.w.config.annotations.texts.map(function(h,S){p.addText(h,S)})}},{key:"addXaxisAnnotation",value:function(p,h,S){this.xAxisAnnotations.addXaxisAnnotation(p,h,S)}},{key:"addYaxisAnnotation",value:function(p,h,S){this.yAxisAnnotations.addYaxisAnnotation(p,h,S)}},{key:"addPointAnnotation",value:function(p,h,S){this.pointsAnnotations.addPointAnnotation(p,h,S)}},{key:"addText",value:function(p,h){var S=p.x,_=p.y,k=p.text,T=p.textAnchor,B=p.foreColor,W=p.fontSize,ee=p.fontFamily,de=p.fontWeight,fe=p.cssClass,xe=p.backgroundColor,we=p.borderWidth,ke=p.strokeDashArray,Me=p.borderRadius,Ye=p.borderColor,Fe=p.appendTo,st=Fe===void 0?".apexcharts-svg":Fe,se=p.paddingLeft,Se=se===void 0?4:se,De=p.paddingRight,Le=De===void 0?4:De,_e=p.paddingBottom,nt=_e===void 0?2:_e,lt=p.paddingTop,bt=lt===void 0?2:lt,Zt=this.w,Ge=this.graphics.drawText({x:S,y:_,text:k,textAnchor:T||"start",fontSize:W||"12px",fontWeight:de||"regular",fontFamily:ee||Zt.config.chart.fontFamily,foreColor:B||Zt.config.chart.foreColor,cssClass:fe}),Je=Zt.globals.dom.baseEl.querySelector(st);Je&&Je.appendChild(Ge.node);var We=Ge.bbox();if(k){var wt=this.graphics.drawRect(We.x-Se,We.y-bt,We.width+Se+Le,We.height+nt+bt,Me,xe||"transparent",1,we,Ye,ke);Je.insertBefore(wt.node,Ge.node)}}},{key:"addImage",value:function(p,h){var S=this.w,_=p.path,k=p.x,T=k===void 0?0:k,B=p.y,W=B===void 0?0:B,ee=p.width,de=ee===void 0?20:ee,fe=p.height,xe=fe===void 0?20:fe,we=p.appendTo,ke=we===void 0?".apexcharts-svg":we,Me=S.globals.dom.Paper.image(_);Me.size(de,xe).move(T,W);var Ye=S.globals.dom.baseEl.querySelector(ke);return Ye&&Ye.appendChild(Me.node),Me}},{key:"addXaxisAnnotationExternal",value:function(p,h,S){return this.addAnnotationExternal({params:p,pushToMemory:h,context:S,type:"xaxis",contextMethod:S.addXaxisAnnotation}),S}},{key:"addYaxisAnnotationExternal",value:function(p,h,S){return this.addAnnotationExternal({params:p,pushToMemory:h,context:S,type:"yaxis",contextMethod:S.addYaxisAnnotation}),S}},{key:"addPointAnnotationExternal",value:function(p,h,S){return this.invertAxis===void 0&&(this.invertAxis=S.w.globals.isBarHorizontal),this.addAnnotationExternal({params:p,pushToMemory:h,context:S,type:"point",contextMethod:S.addPointAnnotation}),S}},{key:"addAnnotationExternal",value:function(p){var h=p.params,S=p.pushToMemory,_=p.context,k=p.type,T=p.contextMethod,B=_,W=B.w,ee=W.globals.dom.baseEl.querySelector(".apexcharts-".concat(k,"-annotations")),de=ee.childNodes.length+1,fe=new G,xe=Object.assign({},k==="xaxis"?fe.xAxisAnnotation:k==="yaxis"?fe.yAxisAnnotation:fe.pointAnnotation),we=F.extend(xe,h);switch(k){case"xaxis":this.addXaxisAnnotation(we,ee,de);break;case"yaxis":this.addYaxisAnnotation(we,ee,de);break;case"point":this.addPointAnnotation(we,ee,de)}var ke=W.globals.dom.baseEl.querySelector(".apexcharts-".concat(k,"-annotations .apexcharts-").concat(k,"-annotation-label[rel='").concat(de,"']")),Me=this.helpers.addBackgroundToAnno(ke,we);return Me&&ee.insertBefore(Me.node,ke),S&&W.globals.memory.methodsToExec.push({context:B,id:we.id?we.id:F.randomId(),method:T,label:"addAnnotation",params:h}),_}},{key:"clearAnnotations",value:function(p){for(var h=p.w,S=h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations"),_=h.globals.memory.methodsToExec.length-1;_>=0;_--)h.globals.memory.methodsToExec[_].label!=="addText"&&h.globals.memory.methodsToExec[_].label!=="addAnnotation"||h.globals.memory.methodsToExec.splice(_,1);S=F.listToArray(S),Array.prototype.forEach.call(S,function(k){for(;k.firstChild;)k.removeChild(k.firstChild)})}},{key:"removeAnnotation",value:function(p,h){var S=p.w,_=S.globals.dom.baseEl.querySelectorAll(".".concat(h));_&&(S.globals.memory.methodsToExec.map(function(k,T){k.id===h&&S.globals.memory.methodsToExec.splice(T,1)}),Array.prototype.forEach.call(_,function(k){k.parentElement.removeChild(k)}))}}]),Ee}(),te=function(Ee){var p,h=Ee.isTimeline,S=Ee.ctx,_=Ee.seriesIndex,k=Ee.dataPointIndex,T=Ee.y1,B=Ee.y2,W=Ee.w,ee=W.globals.seriesRangeStart[_][k],de=W.globals.seriesRangeEnd[_][k],fe=W.globals.labels[k],xe=W.config.series[_].name?W.config.series[_].name:"",we=W.globals.ttKeyFormatter,ke=W.config.tooltip.y.title.formatter,Me={w:W,seriesIndex:_,dataPointIndex:k,start:ee,end:de};typeof ke=="function"&&(xe=ke(xe,Me)),(p=W.config.series[_].data[k])!==null&&p!==void 0&&p.x&&(fe=W.config.series[_].data[k].x),h||W.config.xaxis.type==="datetime"&&(fe=new re(S).xLabelFormat(W.globals.ttKeyFormatter,fe,fe,{i:void 0,dateFormatter:new X(S).formatDate,w:W})),typeof we=="function"&&(fe=we(fe,Me)),Number.isFinite(T)&&Number.isFinite(B)&&(ee=T,de=B);var Ye="",Fe="",st=W.globals.colors[_];if(W.config.tooltip.x.formatter===void 0)if(W.config.xaxis.type==="datetime"){var se=new X(S);Ye=se.formatDate(se.getDate(ee),W.config.tooltip.x.format),Fe=se.formatDate(se.getDate(de),W.config.tooltip.x.format)}else Ye=ee,Fe=de;else Ye=W.config.tooltip.x.formatter(ee),Fe=W.config.tooltip.x.formatter(de);return{start:ee,end:de,startVal:Ye,endVal:Fe,ylabel:fe,color:st,seriesName:xe}},ae=function(Ee){var p=Ee.color,h=Ee.seriesName,S=Ee.ylabel,_=Ee.start,k=Ee.end,T=Ee.seriesIndex,B=Ee.dataPointIndex,W=Ee.ctx.tooltip.tooltipLabels.getFormatters(T);_=W.yLbFormatter(_),k=W.yLbFormatter(k);var ee=W.yLbFormatter(Ee.w.globals.series[T][B]),de=`<span class="value start-value">
`.concat(_,`
</span> <span class="separator">-</span> <span class="value end-value">
`).concat(k,`
</span>`);return'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+p+'">'+(h||"")+'</span></div><div> <span class="category">'+S+": </span> "+(Ee.w.globals.comboCharts?Ee.w.config.series[T].type==="rangeArea"||Ee.w.config.series[T].type==="rangeBar"?de:"<span>".concat(ee,"</span>"):de)+" </div></div>"},he=function(){function Ee(p){s(this,Ee),this.opts=p}return o(Ee,[{key:"hideYAxis",value:function(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}},{key:"line",value:function(){return{chart:{animations:{easing:"swing"}},dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}},{key:"sparkline",value:function(p){return this.hideYAxis(),F.extend(p,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}},{key:"slope",value:function(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter:function(p,h){var S=h.w.config.series[h.seriesIndex].name;return p!==null?S+": "+p:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}},{key:"bar",value:function(){return{chart:{stacked:!1,animations:{easing:"swing"}},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"round"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}},{key:"funnel",value:function(){return this.hideYAxis(),v(v({},this.bar()),{},{chart:{animations:{easing:"linear",speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}},{key:"candlestick",value:function(){var p=this;return{stroke:{width:1,colors:["#333"]},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(h){var S=h.seriesIndex,_=h.dataPointIndex,k=h.w;return p._getBoxTooltip(k,S,_,["Open","High","","Low","Close"],"candlestick")}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"boxPlot",value:function(){var p=this;return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(h){var S=h.seriesIndex,_=h.dataPointIndex,k=h.w;return p._getBoxTooltip(k,S,_,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")}},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}},{key:"rangeBar",value:function(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter:function(p,h){h.ctx;var S=h.seriesIndex,_=h.dataPointIndex,k=h.w,T=function(){var B=k.globals.seriesRangeStart[S][_];return k.globals.seriesRangeEnd[S][_]-B};return k.globals.comboCharts?k.config.series[S].type==="rangeBar"||k.config.series[S].type==="rangeArea"?T():p:T()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:function(p){return p.w.config.plotOptions&&p.w.config.plotOptions.bar&&p.w.config.plotOptions.bar.horizontal?function(h){var S=te(v(v({},h),{},{isTimeline:!0})),_=S.color,k=S.seriesName,T=S.ylabel,B=S.startVal,W=S.endVal;return ae(v(v({},h),{},{color:_,seriesName:k,ylabel:T,start:B,end:W}))}(p):function(h){var S=te(h),_=S.color,k=S.seriesName,T=S.ylabel,B=S.start,W=S.end;return ae(v(v({},h),{},{color:_,seriesName:k,ylabel:T,start:B,end:W}))}(p)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"dumbbell",value:function(p){var h,S;return(h=p.plotOptions.bar)!==null&&h!==void 0&&h.barHeight||(p.plotOptions.bar.barHeight=2),(S=p.plotOptions.bar)!==null&&S!==void 0&&S.columnWidth||(p.plotOptions.bar.columnWidth=2),p}},{key:"area",value:function(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}},{key:"rangeArea",value:function(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:function(p){return function(h){var S=te(h),_=S.color,k=S.seriesName,T=S.ylabel,B=S.start,W=S.end;return ae(v(v({},h),{},{color:_,seriesName:k,ylabel:T,start:B,end:W}))}(p)}}}}},{key:"brush",value:function(p){return F.extend(p,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:"stacked100",value:function(p){p.dataLabels=p.dataLabels||{},p.dataLabels.formatter=p.dataLabels.formatter||void 0;var h=p.dataLabels.formatter;return p.yaxis.forEach(function(S,_){p.yaxis[_].min=0,p.yaxis[_].max=100}),p.chart.type==="bar"&&(p.dataLabels.formatter=h||function(S){return typeof S=="number"&&S?S.toFixed(0)+"%":S}),p}},{key:"stackedBars",value:function(){var p=this.bar();return v(v({},p),{},{plotOptions:v(v({},p.plotOptions),{},{bar:v(v({},p.plotOptions.bar),{},{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}},{key:"convertCatToNumeric",value:function(p){return p.xaxis.convertedCatToNumeric=!0,p}},{key:"convertCatToNumericXaxis",value:function(p,h,S){p.xaxis.type="numeric",p.xaxis.labels=p.xaxis.labels||{},p.xaxis.labels.formatter=p.xaxis.labels.formatter||function(T){return F.isNumber(T)?Math.floor(T):T};var _=p.xaxis.labels.formatter,k=p.xaxis.categories&&p.xaxis.categories.length?p.xaxis.categories:p.labels;return S&&S.length&&(k=S.map(function(T){return Array.isArray(T)?T:String(T)})),k&&k.length&&(p.xaxis.labels.formatter=function(T){return F.isNumber(T)?_(k[Math.floor(T)-1]):_(T)}),p.xaxis.categories=[],p.labels=[],p.xaxis.tickAmount=p.xaxis.tickAmount||"dataPoints",p}},{key:"bubble",value:function(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}},{key:"scatter",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}},{key:"heatmap",value:function(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}},{key:"treemap",value:function(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}},{key:"pie",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(p){return p.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(p){return p.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"polarArea",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(p){return p.toFixed(1)+"%"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"radar",value:function(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:function(p){return p},style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:"radialBar",value:function(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"_getBoxTooltip",value:function(p,h,S,_,k){var T=p.globals.seriesCandleO[h][S],B=p.globals.seriesCandleH[h][S],W=p.globals.seriesCandleM[h][S],ee=p.globals.seriesCandleL[h][S],de=p.globals.seriesCandleC[h][S];return p.config.series[h].type&&p.config.series[h].type!==k?`<div class="apexcharts-custom-tooltip">
`.concat(p.config.series[h].name?p.config.series[h].name:"series-"+(h+1),": <strong>").concat(p.globals.series[h][S],`</strong>
</div>`):'<div class="apexcharts-tooltip-box apexcharts-tooltip-'.concat(p.config.chart.type,'">')+"<div>".concat(_[0],': <span class="value">')+T+"</span></div>"+"<div>".concat(_[1],': <span class="value">')+B+"</span></div>"+(W?"<div>".concat(_[2],': <span class="value">')+W+"</span></div>":"")+"<div>".concat(_[3],': <span class="value">')+ee+"</span></div>"+"<div>".concat(_[4],': <span class="value">')+de+"</span></div></div>"}}]),Ee}(),Ce=function(){function Ee(p){s(this,Ee),this.opts=p}return o(Ee,[{key:"init",value:function(p){var h=p.responsiveOverride,S=this.opts,_=new G,k=new he(S);this.chartType=S.chart.type,S=this.extendYAxis(S),S=this.extendAnnotations(S);var T=_.init(),B={};if(S&&P(S)==="object"){var W,ee,de,fe,xe,we,ke,Me,Ye,Fe,st={};st=["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(S.chart.type)!==-1?k[S.chart.type]():k.line(),(W=S.plotOptions)!==null&&W!==void 0&&(ee=W.bar)!==null&&ee!==void 0&&ee.isFunnel&&(st=k.funnel()),S.chart.stacked&&S.chart.type==="bar"&&(st=k.stackedBars()),(de=S.chart.brush)!==null&&de!==void 0&&de.enabled&&(st=k.brush(st)),(fe=S.plotOptions)!==null&&fe!==void 0&&(xe=fe.line)!==null&&xe!==void 0&&xe.isSlopeChart&&(st=k.slope()),S.chart.stacked&&S.chart.stackType==="100%"&&(S=k.stacked100(S)),(we=S.plotOptions)!==null&&we!==void 0&&(ke=we.bar)!==null&&ke!==void 0&&ke.isDumbbell&&(S=k.dumbbell(S)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(S),S.xaxis=S.xaxis||window.Apex.xaxis||{},h||(S.xaxis.convertedCatToNumeric=!1),((Me=(S=this.checkForCatToNumericXAxis(this.chartType,st,S)).chart.sparkline)!==null&&Me!==void 0&&Me.enabled||(Ye=window.Apex.chart)!==null&&Ye!==void 0&&(Fe=Ye.sparkline)!==null&&Fe!==void 0&&Fe.enabled)&&(st=k.sparkline(st)),B=F.extend(T,st)}var se=F.extend(B,window.Apex);return T=F.extend(se,S),T=this.handleUserInputErrors(T)}},{key:"checkForCatToNumericXAxis",value:function(p,h,S){var _,k,T=new he(S),B=(p==="bar"||p==="boxPlot")&&((_=S.plotOptions)===null||_===void 0||(k=_.bar)===null||k===void 0?void 0:k.horizontal),W=p==="pie"||p==="polarArea"||p==="donut"||p==="radar"||p==="radialBar"||p==="heatmap",ee=S.xaxis.type!=="datetime"&&S.xaxis.type!=="numeric",de=S.xaxis.tickPlacement?S.xaxis.tickPlacement:h.xaxis&&h.xaxis.tickPlacement;return B||W||!ee||de==="between"||(S=T.convertCatToNumeric(S)),S}},{key:"extendYAxis",value:function(p,h){var S=new G;(p.yaxis===void 0||!p.yaxis||Array.isArray(p.yaxis)&&p.yaxis.length===0)&&(p.yaxis={}),p.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(p.yaxis=F.extend(p.yaxis,window.Apex.yaxis)),p.yaxis.constructor!==Array?p.yaxis=[F.extend(S.yAxis,p.yaxis)]:p.yaxis=F.extendArray(p.yaxis,S.yAxis);var _=!1;p.yaxis.forEach(function(T){T.logarithmic&&(_=!0)});var k=p.series;return h&&!k&&(k=h.config.series),_&&k.length!==p.yaxis.length&&k.length&&(p.yaxis=k.map(function(T,B){if(T.name||(k[B].name="series-".concat(B+1)),p.yaxis[B])return p.yaxis[B].seriesName=k[B].name,p.yaxis[B];var W=F.extend(S.yAxis,p.yaxis[0]);return W.show=!1,W})),_&&k.length>1&&k.length!==p.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes"),p}},{key:"extendAnnotations",value:function(p){return p.annotations===void 0&&(p.annotations={},p.annotations.yaxis=[],p.annotations.xaxis=[],p.annotations.points=[]),p=this.extendYAxisAnnotations(p),p=this.extendXAxisAnnotations(p),p=this.extendPointAnnotations(p)}},{key:"extendYAxisAnnotations",value:function(p){var h=new G;return p.annotations.yaxis=F.extendArray(p.annotations.yaxis!==void 0?p.annotations.yaxis:[],h.yAxisAnnotation),p}},{key:"extendXAxisAnnotations",value:function(p){var h=new G;return p.annotations.xaxis=F.extendArray(p.annotations.xaxis!==void 0?p.annotations.xaxis:[],h.xAxisAnnotation),p}},{key:"extendPointAnnotations",value:function(p){var h=new G;return p.annotations.points=F.extendArray(p.annotations.points!==void 0?p.annotations.points:[],h.pointAnnotation),p}},{key:"checkForDarkTheme",value:function(p){p.theme&&p.theme.mode==="dark"&&(p.tooltip||(p.tooltip={}),p.tooltip.theme!=="light"&&(p.tooltip.theme="dark"),p.chart.foreColor||(p.chart.foreColor="#f6f7f8"),p.theme.palette||(p.theme.palette="palette4"))}},{key:"handleUserInputErrors",value:function(p){var h=p;if(h.tooltip.shared&&h.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if(h.chart.type==="bar"&&h.plotOptions.bar.horizontal){if(h.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");h.yaxis[0].reversed&&(h.yaxis[0].opposite=!0),h.xaxis.tooltip.enabled=!1,h.yaxis[0].tooltip.enabled=!1,h.chart.zoom.enabled=!1}return h.chart.type!=="bar"&&h.chart.type!=="rangeBar"||h.tooltip.shared&&h.xaxis.crosshairs.width==="barWidth"&&h.series.length>1&&(h.xaxis.crosshairs.width="tickWidth"),h.chart.type!=="candlestick"&&h.chart.type!=="boxPlot"||h.yaxis[0].reversed&&(console.warn("Reversed y-axis in ".concat(h.chart.type," chart is not supported.")),h.yaxis[0].reversed=!1),h}}]),Ee}(),ce=function(){function Ee(){s(this,Ee)}return o(Ee,[{key:"initGlobalVars",value:function(p){p.series=[],p.seriesCandleO=[],p.seriesCandleH=[],p.seriesCandleM=[],p.seriesCandleL=[],p.seriesCandleC=[],p.seriesRangeStart=[],p.seriesRangeEnd=[],p.seriesRange=[],p.seriesPercent=[],p.seriesGoals=[],p.seriesX=[],p.seriesZ=[],p.seriesNames=[],p.seriesTotals=[],p.seriesLog=[],p.seriesColors=[],p.stackedSeriesTotals=[],p.seriesXvalues=[],p.seriesYvalues=[],p.labels=[],p.hasXaxisGroups=!1,p.groups=[],p.barGroups=[],p.lineGroups=[],p.areaGroups=[],p.hasSeriesGroups=!1,p.seriesGroups=[],p.categoryLabels=[],p.timescaleLabels=[],p.noLabelsProvided=!1,p.resizeTimer=null,p.selectionResizeTimer=null,p.lastWheelExecution=0,p.delayedElements=[],p.pointsArray=[],p.dataLabelsRects=[],p.isXNumeric=!1,p.skipLastTimelinelabel=!1,p.skipFirstTimelinelabel=!1,p.isDataXYZ=!1,p.isMultiLineX=!1,p.isMultipleYAxis=!1,p.maxY=-Number.MAX_VALUE,p.minY=Number.MIN_VALUE,p.minYArr=[],p.maxYArr=[],p.maxX=-Number.MAX_VALUE,p.minX=Number.MAX_VALUE,p.initialMaxX=-Number.MAX_VALUE,p.initialMinX=Number.MAX_VALUE,p.maxDate=0,p.minDate=Number.MAX_VALUE,p.minZ=Number.MAX_VALUE,p.maxZ=-Number.MAX_VALUE,p.minXDiff=Number.MAX_VALUE,p.yAxisScale=[],p.xAxisScale=null,p.xAxisTicksPositions=[],p.yLabelsCoords=[],p.yTitleCoords=[],p.barPadForNumericAxis=0,p.padHorizontal=0,p.xRange=0,p.yRange=[],p.zRange=0,p.dataPoints=0,p.xTickAmount=0,p.multiAxisTickAmount=0}},{key:"globalVars",value:function(p){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:p.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],invalidLogScale:!1,ignoreYAxisIndexes:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,zoomEnabled:p.chart.toolbar.autoSelected==="zoom"&&p.chart.toolbar.tools.zoom&&p.chart.zoom.enabled,panEnabled:p.chart.toolbar.autoSelected==="pan"&&p.chart.toolbar.tools.pan,selectionEnabled:p.chart.toolbar.autoSelected==="selection"&&p.chart.toolbar.tools.selection,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,isSlopeChart:p.plotOptions.line.isSlopeChart,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,easing:null,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null,niceScaleAllowedMagMsd:[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],niceScaleDefaultTicks:[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24],seriesYAxisMap:[],seriesYAxisReverseMap:[]}}},{key:"init",value:function(p){var h=this.globalVars(p);return this.initGlobalVars(h),h.initialConfig=F.extend({},p),h.initialSeries=F.clone(p.series),h.lastXAxis=F.clone(h.initialConfig.xaxis),h.lastYAxis=F.clone(h.initialConfig.yaxis),h}}]),Ee}(),ge=function(){function Ee(p){s(this,Ee),this.opts=p}return o(Ee,[{key:"init",value:function(){var p=new Ce(this.opts).init({responsiveOverride:!1});return{config:p,globals:new ce().init(p)}}}]),Ee}(),Ae=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}return o(Ee,[{key:"clippedImgArea",value:function(p){var h=this.w,S=h.config,_=parseInt(h.globals.gridWidth,10),k=parseInt(h.globals.gridHeight,10),T=_>k?_:k,B=p.image,W=0,ee=0;p.width===void 0&&p.height===void 0?S.fill.image.width!==void 0&&S.fill.image.height!==void 0?(W=S.fill.image.width+1,ee=S.fill.image.height):(W=T+1,ee=T):(W=p.width,ee=p.height);var de=document.createElementNS(h.globals.SVGNS,"pattern");z.setAttrs(de,{id:p.patternID,patternUnits:p.patternUnits?p.patternUnits:"userSpaceOnUse",width:W+"px",height:ee+"px"});var fe=document.createElementNS(h.globals.SVGNS,"image");de.appendChild(fe),fe.setAttributeNS(window.SVG.xlink,"href",B),z.setAttrs(fe,{x:0,y:0,preserveAspectRatio:"none",width:W+"px",height:ee+"px"}),fe.style.opacity=p.opacity,h.globals.dom.elDefs.node.appendChild(de)}},{key:"getSeriesIndex",value:function(p){var h=this.w,S=h.config.chart.type;return(S==="bar"||S==="rangeBar")&&h.config.plotOptions.bar.distributed||S==="heatmap"||S==="treemap"?this.seriesIndex=p.seriesNumber:this.seriesIndex=p.seriesNumber%h.globals.series.length,this.seriesIndex}},{key:"fillPath",value:function(p){var h=this.w;this.opts=p;var S,_,k,T=this.w.config;this.seriesIndex=this.getSeriesIndex(p);var B=this.getFillColors()[this.seriesIndex];h.globals.seriesColors[this.seriesIndex]!==void 0&&(B=h.globals.seriesColors[this.seriesIndex]),typeof B=="function"&&(B=B({seriesIndex:this.seriesIndex,dataPointIndex:p.dataPointIndex,value:p.value,w:h}));var W=p.fillType?p.fillType:this.getFillType(this.seriesIndex),ee=Array.isArray(T.fill.opacity)?T.fill.opacity[this.seriesIndex]:T.fill.opacity;p.color&&(B=p.color),B||(B="#fff",console.warn("undefined color - ApexCharts"));var de=B;if(B.indexOf("rgb")===-1?B.length<9&&(de=F.hexToRgba(B,ee)):B.indexOf("rgba")>-1&&(ee=F.getOpacityFromRGBA(B)),p.opacity&&(ee=p.opacity),W==="pattern"&&(_=this.handlePatternFill({fillConfig:p.fillConfig,patternFill:_,fillColor:B,fillOpacity:ee,defaultColor:de})),W==="gradient"&&(k=this.handleGradientFill({fillConfig:p.fillConfig,fillColor:B,fillOpacity:ee,i:this.seriesIndex})),W==="image"){var fe=T.fill.image.src,xe=p.patternID?p.patternID:"",we="pattern".concat(h.globals.cuid).concat(p.seriesNumber+1).concat(xe);this.patternIDs.indexOf(we)===-1&&(this.clippedImgArea({opacity:ee,image:Array.isArray(fe)?p.seriesNumber<fe.length?fe[p.seriesNumber]:fe[0]:fe,width:p.width?p.width:void 0,height:p.height?p.height:void 0,patternUnits:p.patternUnits,patternID:we}),this.patternIDs.push(we)),S="url(#".concat(we,")")}else S=W==="gradient"?k:W==="pattern"?_:de;return p.solid&&(S=de),S}},{key:"getFillType",value:function(p){var h=this.w;return Array.isArray(h.config.fill.type)?h.config.fill.type[p]:h.config.fill.type}},{key:"getFillColors",value:function(){var p=this.w,h=p.config,S=this.opts,_=[];return p.globals.comboCharts?p.config.series[this.seriesIndex].type==="line"?Array.isArray(p.globals.stroke.colors)?_=p.globals.stroke.colors:_.push(p.globals.stroke.colors):Array.isArray(p.globals.fill.colors)?_=p.globals.fill.colors:_.push(p.globals.fill.colors):h.chart.type==="line"?Array.isArray(p.globals.stroke.colors)?_=p.globals.stroke.colors:_.push(p.globals.stroke.colors):Array.isArray(p.globals.fill.colors)?_=p.globals.fill.colors:_.push(p.globals.fill.colors),S.fillColors!==void 0&&(_=[],Array.isArray(S.fillColors)?_=S.fillColors.slice():_.push(S.fillColors)),_}},{key:"handlePatternFill",value:function(p){var h=p.fillConfig,S=p.patternFill,_=p.fillColor,k=p.fillOpacity,T=p.defaultColor,B=this.w.config.fill;h&&(B=h);var W=this.opts,ee=new z(this.ctx),de=Array.isArray(B.pattern.strokeWidth)?B.pattern.strokeWidth[this.seriesIndex]:B.pattern.strokeWidth,fe=_;return Array.isArray(B.pattern.style)?S=B.pattern.style[W.seriesNumber]!==void 0?ee.drawPattern(B.pattern.style[W.seriesNumber],B.pattern.width,B.pattern.height,fe,de,k):T:S=ee.drawPattern(B.pattern.style,B.pattern.width,B.pattern.height,fe,de,k),S}},{key:"handleGradientFill",value:function(p){var h=p.fillColor,S=p.fillOpacity,_=p.fillConfig,k=p.i,T=this.w.config.fill;_&&(T=v(v({},T),_));var B,W=this.opts,ee=new z(this.ctx),de=new F,fe=T.gradient.type,xe=h,we=T.gradient.opacityFrom===void 0?S:Array.isArray(T.gradient.opacityFrom)?T.gradient.opacityFrom[k]:T.gradient.opacityFrom;xe.indexOf("rgba")>-1&&(we=F.getOpacityFromRGBA(xe));var ke=T.gradient.opacityTo===void 0?S:Array.isArray(T.gradient.opacityTo)?T.gradient.opacityTo[k]:T.gradient.opacityTo;if(T.gradient.gradientToColors===void 0||T.gradient.gradientToColors.length===0)B=T.gradient.shade==="dark"?de.shadeColor(-1*parseFloat(T.gradient.shadeIntensity),h.indexOf("rgb")>-1?F.rgb2hex(h):h):de.shadeColor(parseFloat(T.gradient.shadeIntensity),h.indexOf("rgb")>-1?F.rgb2hex(h):h);else if(T.gradient.gradientToColors[W.seriesNumber]){var Me=T.gradient.gradientToColors[W.seriesNumber];B=Me,Me.indexOf("rgba")>-1&&(ke=F.getOpacityFromRGBA(Me))}else B=h;if(T.gradient.gradientFrom&&(xe=T.gradient.gradientFrom),T.gradient.gradientTo&&(B=T.gradient.gradientTo),T.gradient.inverseColors){var Ye=xe;xe=B,B=Ye}return xe.indexOf("rgb")>-1&&(xe=F.rgb2hex(xe)),B.indexOf("rgb")>-1&&(B=F.rgb2hex(B)),ee.drawGradient(fe,xe,B,we,ke,W.size,T.gradient.stops,T.gradient.colorStops,k)}}]),Ee}(),ye=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"setGlobalMarkerSize",value:function(){var p=this.w;if(p.globals.markers.size=Array.isArray(p.config.markers.size)?p.config.markers.size:[p.config.markers.size],p.globals.markers.size.length>0){if(p.globals.markers.size.length<p.globals.series.length+1)for(var h=0;h<=p.globals.series.length;h++)p.globals.markers.size[h]===void 0&&p.globals.markers.size.push(p.globals.markers.size[0])}else p.globals.markers.size=p.config.series.map(function(S){return p.config.markers.size})}},{key:"plotChartMarkers",value:function(p,h,S,_){var k,T=arguments.length>4&&arguments[4]!==void 0&&arguments[4],B=this.w,W=h,ee=p,de=null,fe=new z(this.ctx),xe=B.config.markers.discrete&&B.config.markers.discrete.length;if((B.globals.markers.size[h]>0||T||xe)&&(de=fe.group({class:T||xe?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(B.globals.cuid,")")),Array.isArray(ee.x))for(var we=0;we<ee.x.length;we++){var ke=S;S===1&&we===0&&(ke=0),S===1&&we===1&&(ke=1);var Me="apexcharts-marker";if(B.config.chart.type!=="line"&&B.config.chart.type!=="area"||B.globals.comboCharts||B.config.tooltip.intersect||(Me+=" no-pointer-events"),(Array.isArray(B.config.markers.size)?B.globals.markers.size[h]>0:B.config.markers.size>0)||T||xe){F.isNumber(ee.y[we])?Me+=" w".concat(F.randomId()):Me="apexcharts-nullpoint";var Ye=this.getMarkerConfig({cssClass:Me,seriesIndex:h,dataPointIndex:ke});B.config.series[W].data[ke]&&(B.config.series[W].data[ke].fillColor&&(Ye.pointFillColor=B.config.series[W].data[ke].fillColor),B.config.series[W].data[ke].strokeColor&&(Ye.pointStrokeColor=B.config.series[W].data[ke].strokeColor)),_!==void 0&&(Ye.pSize=_),(ee.x[we]<-B.globals.markers.largestSize||ee.x[we]>B.globals.gridWidth+B.globals.markers.largestSize||ee.y[we]<-B.globals.markers.largestSize||ee.y[we]>B.globals.gridHeight+B.globals.markers.largestSize)&&(Ye.pSize=0),(k=fe.drawMarker(ee.x[we],ee.y[we],Ye)).attr("rel",ke),k.attr("j",ke),k.attr("index",h),k.node.setAttribute("default-marker-size",Ye.pSize),new L(this.ctx).setSelectionFilter(k,h,ke),this.addEvents(k),de&&de.add(k)}else B.globals.pointsArray[h]===void 0&&(B.globals.pointsArray[h]=[]),B.globals.pointsArray[h].push([ee.x[we],ee.y[we]])}return de}},{key:"getMarkerConfig",value:function(p){var h=p.cssClass,S=p.seriesIndex,_=p.dataPointIndex,k=_===void 0?null:_,T=p.radius,B=T===void 0?null:T,W=p.size,ee=W===void 0?null:W,de=p.strokeWidth,fe=de===void 0?null:de,xe=this.w,we=this.getMarkerStyle(S),ke=ee===null?xe.globals.markers.size[S]:ee,Me=xe.config.markers;return k!==null&&Me.discrete.length&&Me.discrete.map(function(Ye){Ye.seriesIndex===S&&Ye.dataPointIndex===k&&(we.pointStrokeColor=Ye.strokeColor,we.pointFillColor=Ye.fillColor,ke=Ye.size,we.pointShape=Ye.shape)}),{pSize:B===null?ke:B,pRadius:B!==null?B:Me.radius,pointStrokeWidth:fe!==null?fe:Array.isArray(Me.strokeWidth)?Me.strokeWidth[S]:Me.strokeWidth,pointStrokeColor:we.pointStrokeColor,pointFillColor:we.pointFillColor,shape:we.pointShape||(Array.isArray(Me.shape)?Me.shape[S]:Me.shape),class:h,pointStrokeOpacity:Array.isArray(Me.strokeOpacity)?Me.strokeOpacity[S]:Me.strokeOpacity,pointStrokeDashArray:Array.isArray(Me.strokeDashArray)?Me.strokeDashArray[S]:Me.strokeDashArray,pointFillOpacity:Array.isArray(Me.fillOpacity)?Me.fillOpacity[S]:Me.fillOpacity,seriesIndex:S}}},{key:"addEvents",value:function(p){var h=this.w,S=new z(this.ctx);p.node.addEventListener("mouseenter",S.pathMouseEnter.bind(this.ctx,p)),p.node.addEventListener("mouseleave",S.pathMouseLeave.bind(this.ctx,p)),p.node.addEventListener("mousedown",S.pathMouseDown.bind(this.ctx,p)),p.node.addEventListener("click",h.config.markers.onClick),p.node.addEventListener("dblclick",h.config.markers.onDblClick),p.node.addEventListener("touchstart",S.pathMouseDown.bind(this.ctx,p),{passive:!0})}},{key:"getMarkerStyle",value:function(p){var h=this.w,S=h.globals.markers.colors,_=h.config.markers.strokeColor||h.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(_)?_[p]:_,pointFillColor:Array.isArray(S)?S[p]:S}}}]),Ee}(),je=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.initialAnim=this.w.config.chart.animations.enabled}return o(Ee,[{key:"draw",value:function(p,h,S){var _=this.w,k=new z(this.ctx),T=S.realIndex,B=S.pointsPos,W=S.zRatio,ee=S.elParent,de=k.group({class:"apexcharts-series-markers apexcharts-series-".concat(_.config.chart.type)});if(de.attr("clip-path","url(#gridRectMarkerMask".concat(_.globals.cuid,")")),Array.isArray(B.x))for(var fe=0;fe<B.x.length;fe++){var xe=h+1,we=!0;h===0&&fe===0&&(xe=0),h===0&&fe===1&&(xe=1);var ke=_.globals.markers.size[T];if(W!==1/0){var Me=_.config.plotOptions.bubble;ke=_.globals.seriesZ[T][xe],Me.zScaling&&(ke/=W),Me.minBubbleRadius&&ke<Me.minBubbleRadius&&(ke=Me.minBubbleRadius),Me.maxBubbleRadius&&ke>Me.maxBubbleRadius&&(ke=Me.maxBubbleRadius)}var Ye=B.x[fe],Fe=B.y[fe];if(ke=ke||0,Fe!==null&&_.globals.series[T][xe]!==void 0||(we=!1),we){var st=this.drawPoint(Ye,Fe,ke,T,xe,h);de.add(st)}ee.add(de)}}},{key:"drawPoint",value:function(p,h,S,_,k,T){var B=this.w,W=_,ee=new U(this.ctx),de=new L(this.ctx),fe=new Ae(this.ctx),xe=new ye(this.ctx),we=new z(this.ctx),ke=xe.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:W,dataPointIndex:k,radius:B.config.chart.type==="bubble"||B.globals.comboCharts&&B.config.series[_]&&B.config.series[_].type==="bubble"?S:null}),Me=fe.fillPath({seriesNumber:_,dataPointIndex:k,color:ke.pointFillColor,patternUnits:"objectBoundingBox",value:B.globals.series[_][T]}),Ye=we.drawMarker(p,h,ke);if(B.config.series[W].data[k]&&B.config.series[W].data[k].fillColor&&(Me=B.config.series[W].data[k].fillColor),Ye.attr({fill:Me}),B.config.chart.dropShadow.enabled){var Fe=B.config.chart.dropShadow;de.dropShadow(Ye,Fe,_)}if(!this.initialAnim||B.globals.dataChanged||B.globals.resized)B.globals.animationEnded=!0;else{var st=B.config.chart.animations.speed;ee.animateMarker(Ye,st,B.globals.easing,function(){window.setTimeout(function(){ee.animationCompleted(Ye)},100)})}return Ye.attr({rel:k,j:k,index:_,"default-marker-size":ke.pSize}),de.setSelectionFilter(Ye,_,k),xe.addEvents(Ye),Ye.node.classList.add("apexcharts-marker"),Ye}},{key:"centerTextInBubble",value:function(p){var h=this.w;return{y:p+=parseInt(h.config.dataLabels.style.fontSize,10)/4}}}]),Ee}(),Ie=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"dataLabelsCorrection",value:function(p,h,S,_,k,T,B){var W=this.w,ee=!1,de=new z(this.ctx).getTextRects(S,B),fe=de.width,xe=de.height;h<0&&(h=0),h>W.globals.gridHeight+xe&&(h=W.globals.gridHeight+xe/2),W.globals.dataLabelsRects[_]===void 0&&(W.globals.dataLabelsRects[_]=[]),W.globals.dataLabelsRects[_].push({x:p,y:h,width:fe,height:xe});var we=W.globals.dataLabelsRects[_].length-2,ke=W.globals.lastDrawnDataLabelsIndexes[_]!==void 0?W.globals.lastDrawnDataLabelsIndexes[_][W.globals.lastDrawnDataLabelsIndexes[_].length-1]:0;if(W.globals.dataLabelsRects[_][we]!==void 0){var Me=W.globals.dataLabelsRects[_][ke];(p>Me.x+Me.width||h>Me.y+Me.height||h+xe<Me.y||p+fe<Me.x)&&(ee=!0)}return(k===0||T)&&(ee=!0),{x:p,y:h,textRects:de,drawnextLabel:ee}}},{key:"drawDataLabel",value:function(p){var h=this,S=p.type,_=p.pos,k=p.i,T=p.j,B=p.isRangeStart,W=p.strokeWidth,ee=W===void 0?2:W,de=this.w,fe=new z(this.ctx),xe=de.config.dataLabels,we=0,ke=0,Me=T,Ye=null;if(de.globals.collapsedSeriesIndices.indexOf(k)!==-1||!xe.enabled||!Array.isArray(_.x))return Ye;Ye=fe.group({class:"apexcharts-data-labels"});for(var Fe=0;Fe<_.x.length;Fe++)if(we=_.x[Fe]+xe.offsetX,ke=_.y[Fe]+xe.offsetY+ee,!isNaN(we)){T===1&&Fe===0&&(Me=0),T===1&&Fe===1&&(Me=1);var st=de.globals.series[k][Me];S==="rangeArea"&&(st=B?de.globals.seriesRangeStart[k][Me]:de.globals.seriesRangeEnd[k][Me]);var se="",Se=function(Le){return de.config.dataLabels.formatter(Le,{ctx:h.ctx,seriesIndex:k,dataPointIndex:Me,w:de})};de.config.chart.type==="bubble"?(se=Se(st=de.globals.seriesZ[k][Me]),ke=_.y[Fe],ke=new je(this.ctx).centerTextInBubble(ke,k,Me).y):st!==void 0&&(se=Se(st));var De=de.config.dataLabels.textAnchor;de.globals.isSlopeChart&&(De=Me===0?"end":Me===de.config.series[k].data.length-1?"start":"middle"),this.plotDataLabelsText({x:we,y:ke,text:se,i:k,j:Me,parent:Ye,offsetCorrection:!0,dataLabelsConfig:de.config.dataLabels,textAnchor:De})}return Ye}},{key:"plotDataLabelsText",value:function(p){var h=this.w,S=new z(this.ctx),_=p.x,k=p.y,T=p.i,B=p.j,W=p.text,ee=p.textAnchor,de=p.fontSize,fe=p.parent,xe=p.dataLabelsConfig,we=p.color,ke=p.alwaysDrawDataLabel,Me=p.offsetCorrection,Ye=p.className,Fe=null;if(Array.isArray(h.config.dataLabels.enabledOnSeries)&&h.config.dataLabels.enabledOnSeries.indexOf(T)<0)return Fe;var st={x:_,y:k,drawnextLabel:!0,textRects:null};Me&&(st=this.dataLabelsCorrection(_,k,W,T,B,ke,parseInt(xe.style.fontSize,10))),h.globals.zoomed||(_=st.x,k=st.y),st.textRects&&(_<-20-st.textRects.width||_>h.globals.gridWidth+st.textRects.width+30)&&(W="");var se=h.globals.dataLabels.style.colors[T];((h.config.chart.type==="bar"||h.config.chart.type==="rangeBar")&&h.config.plotOptions.bar.distributed||h.config.dataLabels.distributed)&&(se=h.globals.dataLabels.style.colors[B]),typeof se=="function"&&(se=se({series:h.globals.series,seriesIndex:T,dataPointIndex:B,w:h})),we&&(se=we);var Se=xe.offsetX,De=xe.offsetY;if(h.config.chart.type!=="bar"&&h.config.chart.type!=="rangeBar"||(Se=0,De=0),h.globals.isSlopeChart&&(B!==0&&(Se=-2*xe.offsetX+5),B!==0&&B!==h.config.series[T].data.length-1&&(Se=0)),st.drawnextLabel){if((Fe=S.drawText({width:100,height:parseInt(xe.style.fontSize,10),x:_+Se,y:k+De,foreColor:se,textAnchor:ee||xe.textAnchor,text:W,fontSize:de||xe.style.fontSize,fontFamily:xe.style.fontFamily,fontWeight:xe.style.fontWeight||"normal"})).attr({class:Ye||"apexcharts-datalabel",cx:_,cy:k}),xe.dropShadow.enabled){var Le=xe.dropShadow;new L(this.ctx).dropShadow(Fe,Le)}fe.add(Fe),h.globals.lastDrawnDataLabelsIndexes[T]===void 0&&(h.globals.lastDrawnDataLabelsIndexes[T]=[]),h.globals.lastDrawnDataLabelsIndexes[T].push(B)}return Fe}},{key:"addBackgroundToDataLabel",value:function(p,h){var S=this.w,_=S.config.dataLabels.background,k=_.padding,T=_.padding/2,B=h.width,W=h.height,ee=new z(this.ctx).drawRect(h.x-k,h.y-T/2,B+2*k,W+T,_.borderRadius,S.config.chart.background!=="transparent"&&S.config.chart.background?S.config.chart.background:"#fff",_.opacity,_.borderWidth,_.borderColor);return _.dropShadow.enabled&&new L(this.ctx).dropShadow(ee,_.dropShadow),ee}},{key:"dataLabelsBackground",value:function(){var p=this.w;if(p.config.chart.type!=="bubble")for(var h=p.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),S=0;S<h.length;S++){var _=h[S],k=_.getBBox(),T=null;if(k.width&&k.height&&(T=this.addBackgroundToDataLabel(_,k)),T){_.parentNode.insertBefore(T.node,_);var B=_.getAttribute("fill");p.config.chart.animations.enabled&&!p.globals.resized&&!p.globals.dataChanged?T.animate().attr({fill:B}):T.attr({fill:B}),_.setAttribute("fill",p.config.dataLabels.background.foreColor)}}}},{key:"bringForward",value:function(){for(var p=this.w,h=p.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),S=p.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child"),_=0;_<h.length;_++)S&&S.insertBefore(h[_],S.nextSibling)}}]),Ee}(),Re=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.legendInactiveClass="legend-mouseover-inactive"}return o(Ee,[{key:"getAllSeriesEls",value:function(){return this.w.globals.dom.baseEl.getElementsByClassName("apexcharts-series")}},{key:"getSeriesByName",value:function(p){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner .apexcharts-series[seriesName='".concat(F.escapeString(p),"']"))}},{key:"isSeriesHidden",value:function(p){var h=this.getSeriesByName(p),S=parseInt(h.getAttribute("data:realIndex"),10);return{isHidden:h.classList.contains("apexcharts-series-collapsed"),realIndex:S}}},{key:"addCollapsedClassToSeries",value:function(p,h){var S=this.w;function _(k){for(var T=0;T<k.length;T++)k[T].index===h&&p.node.classList.add("apexcharts-series-collapsed")}_(S.globals.collapsedSeries),_(S.globals.ancillaryCollapsedSeries)}},{key:"toggleSeries",value:function(p){var h=this.isSeriesHidden(p);return this.ctx.legend.legendHelpers.toggleDataSeries(h.realIndex,h.isHidden),h.isHidden}},{key:"showSeries",value:function(p){var h=this.isSeriesHidden(p);h.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(h.realIndex,!0)}},{key:"hideSeries",value:function(p){var h=this.isSeriesHidden(p);h.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(h.realIndex,!1)}},{key:"resetSeries",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=this.w,k=F.clone(_.globals.initialSeries);_.globals.previousPaths=[],S?(_.globals.collapsedSeries=[],_.globals.ancillaryCollapsedSeries=[],_.globals.collapsedSeriesIndices=[],_.globals.ancillaryCollapsedSeriesIndices=[]):k=this.emptyCollapsedSeries(k),_.config.series=k,p&&(h&&(_.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(p){for(var h=this.w,S=0;S<p.length;S++)h.globals.collapsedSeriesIndices.indexOf(S)>-1&&(p[S].data=[]);return p}},{key:"highlightSeries",value:function(p){var h=this.w,S=this.getSeriesByName(p),_=parseInt(S==null?void 0:S.getAttribute("data:realIndex"),10),k=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),T=null,B=null,W=null;if(h.globals.axisCharts||h.config.chart.type==="radialBar")if(h.globals.axisCharts){T=h.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(_,"']")),B=h.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(_,"']"));var ee=h.globals.seriesYAxisReverseMap[_];W=h.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(ee,"']"))}else T=h.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(_+1,"']"));else T=h.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(_+1,"'] path"));for(var de=0;de<k.length;de++)k[de].classList.add(this.legendInactiveClass);if(T)h.globals.axisCharts||T.parentNode.classList.remove(this.legendInactiveClass),T.classList.remove(this.legendInactiveClass),B!==null&&B.classList.remove(this.legendInactiveClass),W!==null&&W.classList.remove(this.legendInactiveClass);else for(var fe=0;fe<k.length;fe++)k[fe].classList.remove(this.legendInactiveClass)}},{key:"toggleSeriesOnHover",value:function(p,h){var S=this.w;h||(h=p.target);var _=S.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if(p.type==="mousemove"){var k=parseInt(h.getAttribute("rel"),10)-1;this.highlightSeries(S.globals.seriesNames[k])}else if(p.type==="mouseout")for(var T=0;T<_.length;T++)_[T].classList.remove(this.legendInactiveClass)}},{key:"highlightRangeInSeries",value:function(p,h){var S=this,_=this.w,k=_.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),T=function(ee){for(var de=0;de<k.length;de++)k[de].classList[ee](S.legendInactiveClass)};if(p.type==="mousemove"){var B=parseInt(h.getAttribute("rel"),10)-1;T("add");var W=_.config.plotOptions.heatmap.colorScale.ranges;(function(ee,de){for(var fe=0;fe<k.length;fe++){var xe=Number(k[fe].getAttribute("val"));xe>=ee.from&&(xe<ee.to||ee.to===de&&xe===de)&&k[fe].classList.remove(S.legendInactiveClass)}})(W[B],W.reduce(function(ee,de){return Math.max(ee,de.to)},0))}else p.type==="mouseout"&&T("remove")}},{key:"getActiveConfigSeriesIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"asc",h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],S=this.w,_=0;if(S.config.series.length>1){for(var k=S.config.series.map(function(B,W){return B.data&&B.data.length>0&&S.globals.collapsedSeriesIndices.indexOf(W)===-1&&(!S.globals.comboCharts||h.length===0||h.length&&h.indexOf(S.config.series[W].type)>-1)?W:-1}),T=p==="asc"?0:k.length-1;p==="asc"?T<k.length:T>=0;p==="asc"?T++:T--)if(k[T]!==-1){_=k[T];break}}return _}},{key:"getBarSeriesIndices",value:function(){return this.w.globals.comboCharts?this.w.config.series.map(function(p,h){return p.type==="bar"||p.type==="column"?h:-1}).filter(function(p){return p!==-1}):this.w.config.series.map(function(p,h){return h})}},{key:"getPreviousPaths",value:function(){var p=this.w;function h(T,B,W){for(var ee=T[B].childNodes,de={type:W,paths:[],realIndex:T[B].getAttribute("data:realIndex")},fe=0;fe<ee.length;fe++)if(ee[fe].hasAttribute("pathTo")){var xe=ee[fe].getAttribute("pathTo");de.paths.push({d:xe})}p.globals.previousPaths.push(de)}p.globals.previousPaths=[],["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(function(T){for(var B,W=(B=T,p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(B,"-series .apexcharts-series"))),ee=0;ee<W.length;ee++)h(W,ee,T)}),this.handlePrevBubbleScatterPaths("bubble"),this.handlePrevBubbleScatterPaths("scatter");var S=p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(p.config.chart.type," .apexcharts-series"));if(S.length>0)for(var _=function(T){for(var B=p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(p.config.chart.type," .apexcharts-series[data\\:realIndex='").concat(T,"'] rect")),W=[],ee=function(fe){var xe=function(ke){return B[fe].getAttribute(ke)},we={x:parseFloat(xe("x")),y:parseFloat(xe("y")),width:parseFloat(xe("width")),height:parseFloat(xe("height"))};W.push({rect:we,color:B[fe].getAttribute("color")})},de=0;de<B.length;de++)ee(de);p.globals.previousPaths.push(W)},k=0;k<S.length;k++)_(k);p.globals.axisCharts||(p.globals.previousPaths=p.globals.series)}},{key:"handlePrevBubbleScatterPaths",value:function(p){var h=this.w,S=h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(p,"-series .apexcharts-series"));if(S.length>0)for(var _=0;_<S.length;_++){for(var k=h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(p,"-series .apexcharts-series[data\\:realIndex='").concat(_,"'] circle")),T=[],B=0;B<k.length;B++)T.push({x:k[B].getAttribute("cx"),y:k[B].getAttribute("cy"),r:k[B].getAttribute("r")});h.globals.previousPaths.push(T)}}},{key:"clearPreviousPaths",value:function(){var p=this.w;p.globals.previousPaths=[],p.globals.allSeriesCollapsed=!1}},{key:"handleNoData",value:function(){var p=this.w,h=p.config.noData,S=new z(this.ctx),_=p.globals.svgWidth/2,k=p.globals.svgHeight/2,T="middle";if(p.globals.noData=!0,p.globals.animationEnded=!0,h.align==="left"?(_=10,T="start"):h.align==="right"&&(_=p.globals.svgWidth-10,T="end"),h.verticalAlign==="top"?k=50:h.verticalAlign==="bottom"&&(k=p.globals.svgHeight-50),_+=h.offsetX,k=k+parseInt(h.style.fontSize,10)+2+h.offsetY,h.text!==void 0&&h.text!==""){var B=S.drawText({x:_,y:k,text:h.text,textAnchor:T,fontSize:h.style.fontSize,fontFamily:h.style.fontFamily,foreColor:h.style.color,opacity:1,class:"apexcharts-text-nodata"});p.globals.dom.Paper.add(B)}}},{key:"setNullSeriesToZeroValues",value:function(p){for(var h=this.w,S=0;S<p.length;S++)if(p[S].length===0)for(var _=0;_<p[h.globals.maxValsInArrayIndex].length;_++)p[S].push(0);return p}},{key:"hasAllSeriesEqualX",value:function(){for(var p=!0,h=this.w,S=this.filteredSeriesX(),_=0;_<S.length-1;_++)if(S[_][0]!==S[_+1][0]){p=!1;break}return h.globals.allSeriesHasEqualX=p,p}},{key:"filteredSeriesX",value:function(){var p=this.w.globals.seriesX.map(function(h){return h.length>0?h:[]});return p}}]),Ee}(),Qe=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new Q(this.ctx)}return o(Ee,[{key:"isMultiFormat",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:"isFormatXY",value:function(){var p=this.w.config.series.slice(),h=new Re(this.ctx);if(this.activeSeriesIndex=h.getActiveConfigSeriesIndex(),p[this.activeSeriesIndex].data!==void 0&&p[this.activeSeriesIndex].data.length>0&&p[this.activeSeriesIndex].data[0]!==null&&p[this.activeSeriesIndex].data[0].x!==void 0&&p[this.activeSeriesIndex].data[0]!==null)return!0}},{key:"isFormat2DArray",value:function(){var p=this.w.config.series.slice(),h=new Re(this.ctx);if(this.activeSeriesIndex=h.getActiveConfigSeriesIndex(),p[this.activeSeriesIndex].data!==void 0&&p[this.activeSeriesIndex].data.length>0&&p[this.activeSeriesIndex].data[0]!==void 0&&p[this.activeSeriesIndex].data[0]!==null&&p[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(p,h){for(var S=this.w.config,_=this.w.globals,k=S.chart.type==="boxPlot"||S.series[h].type==="boxPlot",T=0;T<p[h].data.length;T++)if(p[h].data[T][1]!==void 0&&(Array.isArray(p[h].data[T][1])&&p[h].data[T][1].length===4&&!k?this.twoDSeries.push(F.parseNumber(p[h].data[T][1][3])):p[h].data[T].length>=5?this.twoDSeries.push(F.parseNumber(p[h].data[T][4])):this.twoDSeries.push(F.parseNumber(p[h].data[T][1])),_.dataFormatXNumeric=!0),S.xaxis.type==="datetime"){var B=new Date(p[h].data[T][0]);B=new Date(B).getTime(),this.twoDSeriesX.push(B)}else this.twoDSeriesX.push(p[h].data[T][0]);for(var W=0;W<p[h].data.length;W++)p[h].data[W][2]!==void 0&&(this.threeDSeries.push(p[h].data[W][2]),_.isDataXYZ=!0)}},{key:"handleFormatXY",value:function(p,h){var S=this.w.config,_=this.w.globals,k=new X(this.ctx),T=h;_.collapsedSeriesIndices.indexOf(h)>-1&&(T=this.activeSeriesIndex);for(var B=0;B<p[h].data.length;B++)p[h].data[B].y!==void 0&&(Array.isArray(p[h].data[B].y)?this.twoDSeries.push(F.parseNumber(p[h].data[B].y[p[h].data[B].y.length-1])):this.twoDSeries.push(F.parseNumber(p[h].data[B].y))),p[h].data[B].goals!==void 0&&Array.isArray(p[h].data[B].goals)?(this.seriesGoals[h]===void 0&&(this.seriesGoals[h]=[]),this.seriesGoals[h].push(p[h].data[B].goals)):(this.seriesGoals[h]===void 0&&(this.seriesGoals[h]=[]),this.seriesGoals[h].push(null));for(var W=0;W<p[T].data.length;W++){var ee=typeof p[T].data[W].x=="string",de=Array.isArray(p[T].data[W].x),fe=!de&&!!k.isValidDate(p[T].data[W].x);if(ee||fe)if(ee||S.xaxis.convertedCatToNumeric){var xe=_.isBarHorizontal&&_.isRangeData;S.xaxis.type!=="datetime"||xe?(this.fallbackToCategory=!0,this.twoDSeriesX.push(p[T].data[W].x),isNaN(p[T].data[W].x)||this.w.config.xaxis.type==="category"||typeof p[T].data[W].x=="string"||(_.isXNumeric=!0)):this.twoDSeriesX.push(k.parseDate(p[T].data[W].x))}else S.xaxis.type==="datetime"?this.twoDSeriesX.push(k.parseDate(p[T].data[W].x.toString())):(_.dataFormatXNumeric=!0,_.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(p[T].data[W].x)));else de?(this.fallbackToCategory=!0,this.twoDSeriesX.push(p[T].data[W].x)):(_.isXNumeric=!0,_.dataFormatXNumeric=!0,this.twoDSeriesX.push(p[T].data[W].x))}if(p[h].data[0]&&p[h].data[0].z!==void 0){for(var we=0;we<p[h].data.length;we++)this.threeDSeries.push(p[h].data[we].z);_.isDataXYZ=!0}}},{key:"handleRangeData",value:function(p,h){var S=this.w.globals,_={};return this.isFormat2DArray()?_=this.handleRangeDataFormat("array",p,h):this.isFormatXY()&&(_=this.handleRangeDataFormat("xy",p,h)),S.seriesRangeStart.push(_.start===void 0?[]:_.start),S.seriesRangeEnd.push(_.end===void 0?[]:_.end),S.seriesRange.push(_.rangeUniques),S.seriesRange.forEach(function(k,T){k&&k.forEach(function(B,W){B.y.forEach(function(ee,de){for(var fe=0;fe<B.y.length;fe++)if(de!==fe){var xe=ee.y1,we=ee.y2,ke=B.y[fe].y1;xe<=B.y[fe].y2&&ke<=we&&(B.overlaps.indexOf(ee.rangeName)<0&&B.overlaps.push(ee.rangeName),B.overlaps.indexOf(B.y[fe].rangeName)<0&&B.overlaps.push(B.y[fe].rangeName))}})})}),_}},{key:"handleCandleStickBoxData",value:function(p,h){var S=this.w.globals,_={};return this.isFormat2DArray()?_=this.handleCandleStickBoxDataFormat("array",p,h):this.isFormatXY()&&(_=this.handleCandleStickBoxDataFormat("xy",p,h)),S.seriesCandleO[h]=_.o,S.seriesCandleH[h]=_.h,S.seriesCandleM[h]=_.m,S.seriesCandleL[h]=_.l,S.seriesCandleC[h]=_.c,_}},{key:"handleRangeDataFormat",value:function(p,h,S){var _=[],k=[],T=h[S].data.filter(function(de,fe,xe){return fe===xe.findIndex(function(we){return we.x===de.x})}).map(function(de,fe){return{x:de.x,overlaps:[],y:[]}});if(p==="array")for(var B=0;B<h[S].data.length;B++)Array.isArray(h[S].data[B])?(_.push(h[S].data[B][1][0]),k.push(h[S].data[B][1][1])):(_.push(h[S].data[B]),k.push(h[S].data[B]));else if(p==="xy")for(var W=function(de){var fe=Array.isArray(h[S].data[de].y),xe=F.randomId(),we=h[S].data[de].x,ke={y1:fe?h[S].data[de].y[0]:h[S].data[de].y,y2:fe?h[S].data[de].y[1]:h[S].data[de].y,rangeName:xe};h[S].data[de].rangeName=xe;var Me=T.findIndex(function(Ye){return Ye.x===we});T[Me].y.push(ke),_.push(ke.y1),k.push(ke.y2)},ee=0;ee<h[S].data.length;ee++)W(ee);return{start:_,end:k,rangeUniques:T}}},{key:"handleCandleStickBoxDataFormat",value:function(p,h,S){var _=this.w,k=_.config.chart.type==="boxPlot"||_.config.series[S].type==="boxPlot",T=[],B=[],W=[],ee=[],de=[];if(p==="array")if(k&&h[S].data[0].length===6||!k&&h[S].data[0].length===5)for(var fe=0;fe<h[S].data.length;fe++)T.push(h[S].data[fe][1]),B.push(h[S].data[fe][2]),k?(W.push(h[S].data[fe][3]),ee.push(h[S].data[fe][4]),de.push(h[S].data[fe][5])):(ee.push(h[S].data[fe][3]),de.push(h[S].data[fe][4]));else for(var xe=0;xe<h[S].data.length;xe++)Array.isArray(h[S].data[xe][1])&&(T.push(h[S].data[xe][1][0]),B.push(h[S].data[xe][1][1]),k?(W.push(h[S].data[xe][1][2]),ee.push(h[S].data[xe][1][3]),de.push(h[S].data[xe][1][4])):(ee.push(h[S].data[xe][1][2]),de.push(h[S].data[xe][1][3])));else if(p==="xy")for(var we=0;we<h[S].data.length;we++)Array.isArray(h[S].data[we].y)&&(T.push(h[S].data[we].y[0]),B.push(h[S].data[we].y[1]),k?(W.push(h[S].data[we].y[2]),ee.push(h[S].data[we].y[3]),de.push(h[S].data[we].y[4])):(ee.push(h[S].data[we].y[2]),de.push(h[S].data[we].y[3])));return{o:T,h:B,m:W,l:ee,c:de}}},{key:"parseDataAxisCharts",value:function(p){var h=this,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.ctx,_=this.w.config,k=this.w.globals,T=new X(S),B=_.labels.length>0?_.labels.slice():_.xaxis.categories.slice();k.isRangeBar=_.chart.type==="rangeBar"&&k.isBarHorizontal,k.hasXaxisGroups=_.xaxis.type==="category"&&_.xaxis.group.groups.length>0,k.hasXaxisGroups&&(k.groups=_.xaxis.group.groups),p.forEach(function(we,ke){we.name!==void 0?k.seriesNames.push(we.name):k.seriesNames.push("series-"+parseInt(ke+1,10))}),this.coreUtils.setSeriesYAxisMappings();var W=[],ee=N(new Set(_.series.map(function(we){return we.group})));_.series.forEach(function(we,ke){var Me=ee.indexOf(we.group);W[Me]||(W[Me]=[]),W[Me].push(k.seriesNames[ke])}),k.seriesGroups=W;for(var de=function(){for(var we=0;we<B.length;we++)if(typeof B[we]=="string"){if(!T.isValidDate(B[we]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");h.twoDSeriesX.push(T.parseDate(B[we]))}else h.twoDSeriesX.push(B[we])},fe=0;fe<p.length;fe++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],p[fe].data===void 0)return void console.error("It is a possibility that you may have not included 'data' property in series.");if(_.chart.type!=="rangeBar"&&_.chart.type!=="rangeArea"&&p[fe].type!=="rangeBar"&&p[fe].type!=="rangeArea"||(k.isRangeData=!0,_.chart.type!=="rangeBar"&&_.chart.type!=="rangeArea"||this.handleRangeData(p,fe)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(p,fe):this.isFormatXY()&&this.handleFormatXY(p,fe),_.chart.type!=="candlestick"&&p[fe].type!=="candlestick"&&_.chart.type!=="boxPlot"&&p[fe].type!=="boxPlot"||this.handleCandleStickBoxData(p,fe),k.series.push(this.twoDSeries),k.labels.push(this.twoDSeriesX),k.seriesX.push(this.twoDSeriesX),k.seriesGoals=this.seriesGoals,fe!==this.activeSeriesIndex||this.fallbackToCategory||(k.isXNumeric=!0);else{_.xaxis.type==="datetime"?(k.isXNumeric=!0,de(),k.seriesX.push(this.twoDSeriesX)):_.xaxis.type==="numeric"&&(k.isXNumeric=!0,B.length>0&&(this.twoDSeriesX=B,k.seriesX.push(this.twoDSeriesX))),k.labels.push(this.twoDSeriesX);var xe=p[fe].data.map(function(we){return F.parseNumber(we)});k.series.push(xe)}k.seriesZ.push(this.threeDSeries),p[fe].color!==void 0?k.seriesColors.push(p[fe].color):k.seriesColors.push(void 0)}return this.w}},{key:"parseDataNonAxisCharts",value:function(p){var h=this.w.globals,S=this.w.config;h.series=p.slice(),h.seriesNames=S.labels.slice();for(var _=0;_<h.series.length;_++)h.seriesNames[_]===void 0&&h.seriesNames.push("series-"+(_+1));return this.w}},{key:"handleExternalLabelsData",value:function(p){var h=this.w.config,S=this.w.globals;h.xaxis.categories.length>0?S.labels=h.xaxis.categories:h.labels.length>0?S.labels=h.labels.slice():this.fallbackToCategory?(S.labels=S.labels[0],S.seriesRange.length&&(S.seriesRange.map(function(_){_.forEach(function(k){S.labels.indexOf(k.x)<0&&k.x&&S.labels.push(k.x)})}),S.labels=Array.from(new Set(S.labels.map(JSON.stringify)),JSON.parse)),h.xaxis.convertedCatToNumeric&&(new he(h).convertCatToNumericXaxis(h,this.ctx,S.seriesX[0]),this._generateExternalLabels(p))):this._generateExternalLabels(p)}},{key:"_generateExternalLabels",value:function(p){var h=this.w.globals,S=this.w.config,_=[];if(h.axisCharts){if(h.series.length>0)if(this.isFormatXY())for(var k=S.series.map(function(fe,xe){return fe.data.filter(function(we,ke,Me){return Me.findIndex(function(Ye){return Ye.x===we.x})===ke})}),T=k.reduce(function(fe,xe,we,ke){return ke[fe].length>xe.length?fe:we},0),B=0;B<k[T].length;B++)_.push(B+1);else for(var W=0;W<h.series[h.maxValsInArrayIndex].length;W++)_.push(W+1);h.seriesX=[];for(var ee=0;ee<p.length;ee++)h.seriesX.push(_);this.w.globals.isBarHorizontal||(h.isXNumeric=!0)}if(_.length===0){_=h.axisCharts?[]:h.series.map(function(fe,xe){return xe+1});for(var de=0;de<p.length;de++)h.seriesX.push(_)}h.labels=_,S.xaxis.convertedCatToNumeric&&(h.categoryLabels=_.map(function(fe){return S.xaxis.labels.formatter(fe)})),h.noLabelsProvided=!0}},{key:"parseData",value:function(p){var h=this.w,S=h.config,_=h.globals;if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),_.axisCharts?(this.parseDataAxisCharts(p),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(p),S.chart.stacked){var k=new Re(this.ctx);_.series=k.setNullSeriesToZeroValues(_.series)}this.coreUtils.getSeriesTotals(),_.axisCharts&&(_.stackedSeriesTotals=this.coreUtils.getStackedSeriesTotals(),_.stackedSeriesTotalsByGroups=this.coreUtils.getStackedSeriesTotalsByGroups()),this.coreUtils.getPercentSeries(),_.dataFormatXNumeric||_.isXNumeric&&(S.xaxis.type!=="numeric"||S.labels.length!==0||S.xaxis.categories.length!==0)||this.handleExternalLabelsData(p);for(var T=this.coreUtils.getCategoryLabels(_.labels),B=0;B<T.length;B++)if(Array.isArray(T[B])){_.isMultiLineX=!0;break}}},{key:"excludeCollapsedSeriesInYAxis",value:function(){var p=this.w,h=[];p.globals.seriesYAxisMap.forEach(function(S,_){var k=0;S.forEach(function(T){p.globals.collapsedSeriesIndices.indexOf(T)!==-1&&k++}),k>0&&k==S.length&&h.push(_)}),p.globals.ignoreYAxisIndexes=h.map(function(S){return S})}}]),Ee}(),$e=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"scaleSvgNode",value:function(p,h){var S=parseFloat(p.getAttributeNS(null,"width")),_=parseFloat(p.getAttributeNS(null,"height"));p.setAttributeNS(null,"width",S*h),p.setAttributeNS(null,"height",_*h),p.setAttributeNS(null,"viewBox","0 0 "+S+" "+_)}},{key:"getSvgString",value:function(){var p=this;return new Promise(function(h){var S=p.w,_=S.config.chart.toolbar.export.width,k=S.config.chart.toolbar.export.scale||_/S.globals.svgWidth;k||(k=1);var T=p.w.globals.dom.Paper.svg(),B=p.w.globals.dom.Paper.node.cloneNode(!0);k!==1&&p.scaleSvgNode(B,k),p.convertImagesToBase64(B).then(function(){T=new XMLSerializer().serializeToString(B),h(T.replace(/ /g," "))})})}},{key:"convertImagesToBase64",value:function(p){var h=this,S=p.getElementsByTagName("image"),_=Array.from(S).map(function(k){var T=k.getAttributeNS("http://www.w3.org/1999/xlink","href");return T&&!T.startsWith("data:")?h.getBase64FromUrl(T).then(function(B){k.setAttributeNS("http://www.w3.org/1999/xlink","href",B)}).catch(function(B){console.error("Error converting image to base64:",B)}):Promise.resolve()});return Promise.all(_)}},{key:"getBase64FromUrl",value:function(p){return new Promise(function(h,S){var _=new Image;_.crossOrigin="Anonymous",_.onload=function(){var k=document.createElement("canvas");k.width=_.width,k.height=_.height,k.getContext("2d").drawImage(_,0,0),h(k.toDataURL())},_.onerror=S,_.src=p})}},{key:"cleanup",value:function(){var p=this.w,h=p.globals.dom.baseEl.getElementsByClassName("apexcharts-xcrosshairs"),S=p.globals.dom.baseEl.getElementsByClassName("apexcharts-ycrosshairs"),_=p.globals.dom.baseEl.querySelectorAll(".apexcharts-zoom-rect, .apexcharts-selection-rect");Array.prototype.forEach.call(_,function(k){k.setAttribute("width",0)}),h&&h[0]&&(h[0].setAttribute("x",-500),h[0].setAttribute("x1",-500),h[0].setAttribute("x2",-500)),S&&S[0]&&(S[0].setAttribute("y",-100),S[0].setAttribute("y1",-100),S[0].setAttribute("y2",-100))}},{key:"svgUrl",value:function(){var p=this;return new Promise(function(h){p.cleanup(),p.getSvgString().then(function(S){var _=new Blob([S],{type:"image/svg+xml;charset=utf-8"});h(URL.createObjectURL(_))})})}},{key:"dataURI",value:function(p){var h=this;return new Promise(function(S){var _=h.w,k=p?p.scale||p.width/_.globals.svgWidth:1;h.cleanup();var T=document.createElement("canvas");T.width=_.globals.svgWidth*k,T.height=parseInt(_.globals.dom.elWrap.style.height,10)*k;var B=_.config.chart.background!=="transparent"&&_.config.chart.background?_.config.chart.background:"#fff",W=T.getContext("2d");W.fillStyle=B,W.fillRect(0,0,T.width*k,T.height*k),h.getSvgString().then(function(ee){var de="data:image/svg+xml,"+encodeURIComponent(ee),fe=new Image;fe.crossOrigin="anonymous",fe.onload=function(){if(W.drawImage(fe,0,0),T.msToBlob){var xe=T.msToBlob();S({blob:xe})}else{var we=T.toDataURL("image/png");S({imgURI:we})}},fe.src=de})})}},{key:"exportToSVG",value:function(){var p=this;this.svgUrl().then(function(h){p.triggerDownload(h,p.w.config.chart.toolbar.export.svg.filename,".svg")})}},{key:"exportToPng",value:function(){var p=this,h=this.w.config.chart.toolbar.export.scale,S=this.w.config.chart.toolbar.export.width,_=h?{scale:h}:S?{width:S}:void 0;this.dataURI(_).then(function(k){var T=k.imgURI,B=k.blob;B?navigator.msSaveOrOpenBlob(B,p.w.globals.chartID+".png"):p.triggerDownload(T,p.w.config.chart.toolbar.export.png.filename,".png")})}},{key:"exportToCSV",value:function(p){var h=this,S=p.series,_=p.fileName,k=p.columnDelimiter,T=k===void 0?",":k,B=p.lineDelimiter,W=B===void 0?`
`:B,ee=this.w;S||(S=ee.config.series);var de,fe,xe=[],we=[],ke="",Me=ee.globals.series.map(function(_e,nt){return ee.globals.collapsedSeriesIndices.indexOf(nt)===-1?_e:[]}),Ye=function(_e){return typeof ee.config.chart.toolbar.export.csv.categoryFormatter=="function"?ee.config.chart.toolbar.export.csv.categoryFormatter(_e):ee.config.xaxis.type==="datetime"&&String(_e).length>=10?new Date(_e).toDateString():F.isNumber(_e)?_e:_e.split(T).join("")},Fe=function(_e){return typeof ee.config.chart.toolbar.export.csv.valueFormatter=="function"?ee.config.chart.toolbar.export.csv.valueFormatter(_e):_e},st=Math.max.apply(Math,N(S.map(function(_e){return _e.data?_e.data.length:0}))),se=new Qe(this.ctx),Se=new pe(this.ctx),De=function(_e){var nt="";if(ee.globals.axisCharts){if(ee.config.xaxis.type==="category"||ee.config.xaxis.convertedCatToNumeric)if(ee.globals.isBarHorizontal){var lt=ee.globals.yLabelFormatters[0],bt=new Re(h.ctx).getActiveConfigSeriesIndex();nt=lt(ee.globals.labels[_e],{seriesIndex:bt,dataPointIndex:_e,w:ee})}else nt=Se.getLabel(ee.globals.labels,ee.globals.timescaleLabels,0,_e).text;ee.config.xaxis.type==="datetime"&&(ee.config.xaxis.categories.length?nt=ee.config.xaxis.categories[_e]:ee.config.labels.length&&(nt=ee.config.labels[_e]))}else nt=ee.config.labels[_e];return nt===null?"nullvalue":(Array.isArray(nt)&&(nt=nt.join(" ")),F.isNumber(nt)?nt:nt.split(T).join(""))},Le=function(_e,nt){if(xe.length&&nt===0&&we.push(xe.join(T)),_e.data){_e.data=_e.data.length&&_e.data||N(Array(st)).map(function(){return""});for(var lt=0;lt<_e.data.length;lt++){xe=[];var bt=De(lt);if(bt!=="nullvalue"){if(bt||(se.isFormatXY()?bt=S[nt].data[lt].x:se.isFormat2DArray()&&(bt=S[nt].data[lt]?S[nt].data[lt][0]:"")),nt===0){xe.push(Ye(bt));for(var Zt=0;Zt<ee.globals.series.length;Zt++){var Ge,Je=se.isFormatXY()?(Ge=S[Zt].data[lt])===null||Ge===void 0?void 0:Ge.y:Me[Zt][lt];xe.push(Fe(Je))}}(ee.config.chart.type==="candlestick"||_e.type&&_e.type==="candlestick")&&(xe.pop(),xe.push(ee.globals.seriesCandleO[nt][lt]),xe.push(ee.globals.seriesCandleH[nt][lt]),xe.push(ee.globals.seriesCandleL[nt][lt]),xe.push(ee.globals.seriesCandleC[nt][lt])),(ee.config.chart.type==="boxPlot"||_e.type&&_e.type==="boxPlot")&&(xe.pop(),xe.push(ee.globals.seriesCandleO[nt][lt]),xe.push(ee.globals.seriesCandleH[nt][lt]),xe.push(ee.globals.seriesCandleM[nt][lt]),xe.push(ee.globals.seriesCandleL[nt][lt]),xe.push(ee.globals.seriesCandleC[nt][lt])),ee.config.chart.type==="rangeBar"&&(xe.pop(),xe.push(ee.globals.seriesRangeStart[nt][lt]),xe.push(ee.globals.seriesRangeEnd[nt][lt])),xe.length&&we.push(xe.join(T))}}}};xe.push(ee.config.chart.toolbar.export.csv.headerCategory),ee.config.chart.type==="boxPlot"?(xe.push("minimum"),xe.push("q1"),xe.push("median"),xe.push("q3"),xe.push("maximum")):ee.config.chart.type==="candlestick"?(xe.push("open"),xe.push("high"),xe.push("low"),xe.push("close")):ee.config.chart.type==="rangeBar"?(xe.push("minimum"),xe.push("maximum")):S.map(function(_e,nt){var lt=(_e.name?_e.name:"series-".concat(nt))+"";ee.globals.axisCharts&&xe.push(lt.split(T).join("")?lt.split(T).join(""):"series-".concat(nt))}),ee.globals.axisCharts||(xe.push(ee.config.chart.toolbar.export.csv.headerValue),we.push(xe.join(T))),ee.globals.allSeriesHasEqualX||!ee.globals.axisCharts||ee.config.xaxis.categories.length||ee.config.labels.length?S.map(function(_e,nt){ee.globals.axisCharts?Le(_e,nt):((xe=[]).push(Ye(ee.globals.labels[nt])),xe.push(Fe(Me[nt])),we.push(xe.join(T)))}):(de=new Set,fe={},S.forEach(function(_e,nt){_e==null||_e.data.forEach(function(lt){var bt,Zt;if(se.isFormatXY())bt=lt.x,Zt=lt.y;else{if(!se.isFormat2DArray())return;bt=lt[0],Zt=lt[1]}fe[bt]||(fe[bt]=Array(S.length).fill("")),fe[bt][nt]=Fe(Zt),de.add(bt)})}),xe.length&&we.push(xe.join(T)),Array.from(de).sort().forEach(function(_e){we.push([Ye(_e),fe[_e].join(T)])})),ke+=we.join(W),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\uFEFF"+ke),_||ee.config.chart.toolbar.export.csv.filename,".csv")}},{key:"triggerDownload",value:function(p,h,S){var _=document.createElement("a");_.href=p,_.download=(h||this.w.globals.chartID)+S,document.body.appendChild(_),_.click(),document.body.removeChild(_)}}]),Ee}(),it=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.elgrid=h,this.w=p.w;var S=this.w;this.axesUtils=new pe(p),this.xaxisLabels=S.globals.labels.slice(),S.globals.timescaleLabels.length>0&&!S.globals.isBarHorizontal&&(this.xaxisLabels=S.globals.timescaleLabels.slice()),S.config.xaxis.overwriteCategories&&(this.xaxisLabels=S.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],S.config.xaxis.position==="top"?this.offY=0:this.offY=S.globals.gridHeight,this.offY=this.offY+S.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal=S.config.chart.type==="bar"&&S.config.plotOptions.bar.horizontal,this.xaxisFontSize=S.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=S.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=S.config.xaxis.labels.style.colors,this.xaxisBorderWidth=S.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=S.config.yaxis[0].axisBorder.width.toString()),this.xaxisBorderWidth.indexOf("%")>-1?this.xaxisBorderWidth=S.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=S.config.xaxis.axisBorder.height,this.yaxis=S.config.yaxis[0]}return o(Ee,[{key:"drawXaxis",value:function(){var p=this.w,h=new z(this.ctx),S=h.group({class:"apexcharts-xaxis",transform:"translate(".concat(p.config.xaxis.offsetX,", ").concat(p.config.xaxis.offsetY,")")}),_=h.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(p.globals.translateXAxisX,", ").concat(p.globals.translateXAxisY,")")});S.add(_);for(var k=[],T=0;T<this.xaxisLabels.length;T++)k.push(this.xaxisLabels[T]);if(this.drawXAxisLabelAndGroup(!0,h,_,k,p.globals.isXNumeric,function(ke,Me){return Me}),p.globals.hasXaxisGroups){var B=p.globals.groups;k=[];for(var W=0;W<B.length;W++)k.push(B[W].title);var ee={};p.config.xaxis.group.style&&(ee.xaxisFontSize=p.config.xaxis.group.style.fontSize,ee.xaxisFontFamily=p.config.xaxis.group.style.fontFamily,ee.xaxisForeColors=p.config.xaxis.group.style.colors,ee.fontWeight=p.config.xaxis.group.style.fontWeight,ee.cssClass=p.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,h,_,k,!1,function(ke,Me){return B[ke].cols*Me},ee)}if(p.config.xaxis.title.text!==void 0){var de=h.group({class:"apexcharts-xaxis-title"}),fe=h.drawText({x:p.globals.gridWidth/2+p.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+(p.config.xaxis.position==="bottom"?p.globals.xAxisLabelsHeight:-p.globals.xAxisLabelsHeight-10)+p.config.xaxis.title.offsetY,text:p.config.xaxis.title.text,textAnchor:"middle",fontSize:p.config.xaxis.title.style.fontSize,fontFamily:p.config.xaxis.title.style.fontFamily,fontWeight:p.config.xaxis.title.style.fontWeight,foreColor:p.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+p.config.xaxis.title.style.cssClass});de.add(fe),S.add(de)}if(p.config.xaxis.axisBorder.show){var xe=p.globals.barPadForNumericAxis,we=h.drawLine(p.globals.padHorizontal+p.config.xaxis.axisBorder.offsetX-xe,this.offY,this.xaxisBorderWidth+xe,this.offY,p.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&p.config.grid.show?this.elgrid.elGridBorders.add(we):S.add(we)}return S}},{key:"drawXAxisLabelAndGroup",value:function(p,h,S,_,k,T){var B,W=this,ee=arguments.length>6&&arguments[6]!==void 0?arguments[6]:{},de=[],fe=[],xe=this.w,we=ee.xaxisFontSize||this.xaxisFontSize,ke=ee.xaxisFontFamily||this.xaxisFontFamily,Me=ee.xaxisForeColors||this.xaxisForeColors,Ye=ee.fontWeight||xe.config.xaxis.labels.style.fontWeight,Fe=ee.cssClass||xe.config.xaxis.labels.style.cssClass,st=xe.globals.padHorizontal,se=_.length,Se=xe.config.xaxis.type==="category"?xe.globals.dataPoints:se;if(Se===0&&se>Se&&(Se=se),k){var De=Se>1?Se-1:Se;B=xe.globals.gridWidth/Math.min(De,se-1),st=st+T(0,B)/2+xe.config.xaxis.labels.offsetX}else B=xe.globals.gridWidth/Se,st=st+T(0,B)+xe.config.xaxis.labels.offsetX;for(var Le=function(nt){var lt=st-T(nt,B)/2+xe.config.xaxis.labels.offsetX;nt===0&&se===1&&B/2===st&&Se===1&&(lt=xe.globals.gridWidth/2);var bt=W.axesUtils.getLabel(_,xe.globals.timescaleLabels,lt,nt,de,we,p),Zt=28;if(xe.globals.rotateXLabels&&p&&(Zt=22),xe.config.xaxis.title.text&&xe.config.xaxis.position==="top"&&(Zt+=parseFloat(xe.config.xaxis.title.style.fontSize)+2),p||(Zt=Zt+parseFloat(we)+(xe.globals.xAxisLabelsHeight-xe.globals.xAxisGroupLabelsHeight)+(xe.globals.rotateXLabels?10:0)),bt=xe.config.xaxis.tickAmount!==void 0&&xe.config.xaxis.tickAmount!=="dataPoints"&&xe.config.xaxis.type!=="datetime"?W.axesUtils.checkLabelBasedOnTickamount(nt,bt,se):W.axesUtils.checkForOverflowingLabels(nt,bt,se,de,fe),xe.config.xaxis.labels.show){var Ge=h.drawText({x:bt.x,y:W.offY+xe.config.xaxis.labels.offsetY+Zt-(xe.config.xaxis.position==="top"?xe.globals.xAxisHeight+xe.config.xaxis.axisTicks.height-2:0),text:bt.text,textAnchor:"middle",fontWeight:bt.isBold?600:Ye,fontSize:we,fontFamily:ke,foreColor:Array.isArray(Me)?p&&xe.config.xaxis.convertedCatToNumeric?Me[xe.globals.minX+nt-1]:Me[nt]:Me,isPlainText:!1,cssClass:(p?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+Fe});if(S.add(Ge),Ge.on("click",function(We){if(typeof xe.config.chart.events.xAxisLabelClick=="function"){var wt=Object.assign({},xe,{labelIndex:nt});xe.config.chart.events.xAxisLabelClick(We,W.ctx,wt)}}),p){var Je=document.createElementNS(xe.globals.SVGNS,"title");Je.textContent=Array.isArray(bt.text)?bt.text.join(" "):bt.text,Ge.node.appendChild(Je),bt.text!==""&&(de.push(bt.text),fe.push(bt))}}nt<se-1&&(st+=T(nt+1,B))},_e=0;_e<=se-1;_e++)Le(_e)}},{key:"drawXaxisInversed",value:function(p){var h,S,_=this,k=this.w,T=new z(this.ctx),B=k.config.yaxis[0].opposite?k.globals.translateYAxisX[p]:0,W=T.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:p}),ee=T.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+B+", 0)"});W.add(ee);var de=[];if(k.config.yaxis[p].show)for(var fe=0;fe<this.xaxisLabels.length;fe++)de.push(this.xaxisLabels[fe]);h=k.globals.gridHeight/de.length,S=-h/2.2;var xe=k.globals.yLabelFormatters[0],we=k.config.yaxis[0].labels;if(we.show)for(var ke=function(De){var Le=de[De]===void 0?"":de[De];Le=xe(Le,{seriesIndex:p,dataPointIndex:De,w:k});var _e=_.axesUtils.getYAxisForeColor(we.style.colors,p),nt=0;Array.isArray(Le)&&(nt=Le.length/2*parseInt(we.style.fontSize,10));var lt=we.offsetX-15,bt="end";_.yaxis.opposite&&(bt="start"),k.config.yaxis[0].labels.align==="left"?(lt=we.offsetX,bt="start"):k.config.yaxis[0].labels.align==="center"?(lt=we.offsetX,bt="middle"):k.config.yaxis[0].labels.align==="right"&&(bt="end");var Zt=T.drawText({x:lt,y:S+h+we.offsetY-nt,text:Le,textAnchor:bt,foreColor:Array.isArray(_e)?_e[De]:_e,fontSize:we.style.fontSize,fontFamily:we.style.fontFamily,fontWeight:we.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+we.style.cssClass,maxWidth:we.maxWidth});ee.add(Zt),Zt.on("click",function(We){if(typeof k.config.chart.events.xAxisLabelClick=="function"){var wt=Object.assign({},k,{labelIndex:De});k.config.chart.events.xAxisLabelClick(We,_.ctx,wt)}});var Ge=document.createElementNS(k.globals.SVGNS,"title");if(Ge.textContent=Array.isArray(Le)?Le.join(" "):Le,Zt.node.appendChild(Ge),k.config.yaxis[p].labels.rotate!==0){var Je=T.rotateAroundCenter(Zt.node);Zt.node.setAttribute("transform","rotate(".concat(k.config.yaxis[p].labels.rotate," 0 ").concat(Je.y,")"))}S+=h},Me=0;Me<=de.length-1;Me++)ke(Me);if(k.config.yaxis[0].title.text!==void 0){var Ye=T.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+B+", 0)"}),Fe=T.drawText({x:k.config.yaxis[0].title.offsetX,y:k.globals.gridHeight/2+k.config.yaxis[0].title.offsetY,text:k.config.yaxis[0].title.text,textAnchor:"middle",foreColor:k.config.yaxis[0].title.style.color,fontSize:k.config.yaxis[0].title.style.fontSize,fontWeight:k.config.yaxis[0].title.style.fontWeight,fontFamily:k.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+k.config.yaxis[0].title.style.cssClass});Ye.add(Fe),W.add(Ye)}var st=0;this.isCategoryBarHorizontal&&k.config.yaxis[0].opposite&&(st=k.globals.gridWidth);var se=k.config.xaxis.axisBorder;if(se.show){var Se=T.drawLine(k.globals.padHorizontal+se.offsetX+st,1+se.offsetY,k.globals.padHorizontal+se.offsetX+st,k.globals.gridHeight+se.offsetY,se.color,0);this.elgrid&&this.elgrid.elGridBorders&&k.config.grid.show?this.elgrid.elGridBorders.add(Se):W.add(Se)}return k.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(st,de.length,k.config.yaxis[0].axisBorder,k.config.yaxis[0].axisTicks,0,h,W),W}},{key:"drawXaxisTicks",value:function(p,h,S){var _=this.w,k=p;if(!(p<0||p-2>_.globals.gridWidth)){var T=this.offY+_.config.xaxis.axisTicks.offsetY;if(h=h+T+_.config.xaxis.axisTicks.height,_.config.xaxis.position==="top"&&(h=T-_.config.xaxis.axisTicks.height),_.config.xaxis.axisTicks.show){var B=new z(this.ctx).drawLine(p+_.config.xaxis.axisTicks.offsetX,T+_.config.xaxis.offsetY,k+_.config.xaxis.axisTicks.offsetX,h+_.config.xaxis.offsetY,_.config.xaxis.axisTicks.color);S.add(B),B.node.classList.add("apexcharts-xaxis-tick")}}}},{key:"getXAxisTicksPositions",value:function(){var p=this.w,h=[],S=this.xaxisLabels.length,_=p.globals.padHorizontal;if(p.globals.timescaleLabels.length>0)for(var k=0;k<S;k++)_=this.xaxisLabels[k].position,h.push(_);else for(var T=S,B=0;B<T;B++){var W=T;p.globals.isXNumeric&&p.config.chart.type!=="bar"&&(W-=1),_+=p.globals.gridWidth/W,h.push(_)}return h}},{key:"xAxisLabelCorrections",value:function(){var p=this.w,h=new z(this.ctx),S=p.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),_=p.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),k=p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),T=p.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(p.globals.rotateXLabels||p.config.xaxis.labels.rotateAlways)for(var B=0;B<_.length;B++){var W=h.rotateAroundCenter(_[B]);W.y=W.y-1,W.x=W.x+1,_[B].setAttribute("transform","rotate(".concat(p.config.xaxis.labels.rotate," ").concat(W.x," ").concat(W.y,")")),_[B].setAttribute("text-anchor","end"),S.setAttribute("transform","translate(0, ".concat(-10,")"));var ee=_[B].childNodes;p.config.xaxis.labels.trim&&Array.prototype.forEach.call(ee,function(we){h.placeTextWithEllipsis(we,we.textContent,p.globals.xAxisLabelsHeight-(p.config.legend.position==="bottom"?20:10))})}else(function(){for(var we=p.globals.gridWidth/(p.globals.labels.length+1),ke=0;ke<_.length;ke++){var Me=_[ke].childNodes;p.config.xaxis.labels.trim&&p.config.xaxis.type!=="datetime"&&Array.prototype.forEach.call(Me,function(Ye){h.placeTextWithEllipsis(Ye,Ye.textContent,we)})}})();if(k.length>0){var de=k[k.length-1].getBBox(),fe=k[0].getBBox();de.x<-20&&k[k.length-1].parentNode.removeChild(k[k.length-1]),fe.x+fe.width>p.globals.gridWidth&&!p.globals.isBarHorizontal&&k[0].parentNode.removeChild(k[0]);for(var xe=0;xe<T.length;xe++)h.placeTextWithEllipsis(T[xe],T[xe].textContent,p.config.yaxis[0].labels.maxWidth-(p.config.yaxis[0].title.text?2*parseFloat(p.config.yaxis[0].title.style.fontSize):0)-15)}}}]),Ee}(),tt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w;var h=this.w;this.xaxisLabels=h.globals.labels.slice(),this.axesUtils=new pe(p),this.isRangeBar=h.globals.seriesRange.length&&h.globals.isBarHorizontal,h.globals.timescaleLabels.length>0&&(this.xaxisLabels=h.globals.timescaleLabels.slice())}return o(Ee,[{key:"drawGridArea",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,h=this.w,S=new z(this.ctx);p||(p=S.group({class:"apexcharts-grid"}));var _=S.drawLine(h.globals.padHorizontal,1,h.globals.padHorizontal,h.globals.gridHeight,"transparent"),k=S.drawLine(h.globals.padHorizontal,h.globals.gridHeight,h.globals.gridWidth,h.globals.gridHeight,"transparent");return p.add(k),p.add(_),p}},{key:"drawGrid",value:function(){if(this.w.globals.axisCharts){var p=this.renderGrid();return this.drawGridArea(p.el),p}return null}},{key:"createGridMask",value:function(){var p=this.w,h=p.globals,S=new z(this.ctx),_=Array.isArray(p.config.stroke.width)?Math.max.apply(Math,N(p.config.stroke.width)):p.config.stroke.width,k=function(de){var fe=document.createElementNS(h.SVGNS,"clipPath");return fe.setAttribute("id",de),fe};h.dom.elGridRectMask=k("gridRectMask".concat(h.cuid)),h.dom.elGridRectBarMask=k("gridRectBarMask".concat(h.cuid)),h.dom.elGridRectMarkerMask=k("gridRectMarkerMask".concat(h.cuid)),h.dom.elForecastMask=k("forecastMask".concat(h.cuid)),h.dom.elNonForecastMask=k("nonForecastMask".concat(h.cuid));var T=0,B=0;(["bar","rangeBar","candlestick","boxPlot"].includes(p.config.chart.type)||p.globals.comboBarCount>0)&&p.globals.isXNumeric&&!p.globals.isBarHorizontal&&(T=Math.max(p.config.grid.padding.left,h.barPadForNumericAxis),B=Math.max(p.config.grid.padding.right,h.barPadForNumericAxis)),h.dom.elGridRect=S.drawRect(0,0,h.gridWidth,h.gridHeight,0,"#fff"),h.dom.elGridRectBar=S.drawRect(-_/2-T-2,-_/2-2,h.gridWidth+_+B+T+4,h.gridHeight+_+4,0,"#fff");var W=p.globals.markers.largestSize;h.dom.elGridRectMarker=S.drawRect(-W,-W,h.gridWidth+2*W,h.gridHeight+2*W,0,"#fff"),h.dom.elGridRectMask.appendChild(h.dom.elGridRect.node),h.dom.elGridRectBarMask.appendChild(h.dom.elGridRectBar.node),h.dom.elGridRectMarkerMask.appendChild(h.dom.elGridRectMarker.node);var ee=h.dom.baseEl.querySelector("defs");ee.appendChild(h.dom.elGridRectMask),ee.appendChild(h.dom.elGridRectBarMask),ee.appendChild(h.dom.elGridRectMarkerMask),ee.appendChild(h.dom.elForecastMask),ee.appendChild(h.dom.elNonForecastMask)}},{key:"_drawGridLines",value:function(p){var h=p.i,S=p.x1,_=p.y1,k=p.x2,T=p.y2,B=p.xCount,W=p.parent,ee=this.w;if(!(h===0&&ee.globals.skipFirstTimelinelabel||h===B-1&&ee.globals.skipLastTimelinelabel&&!ee.config.xaxis.labels.formatter||ee.config.chart.type==="radar")){ee.config.grid.xaxis.lines.show&&this._drawGridLine({i:h,x1:S,y1:_,x2:k,y2:T,xCount:B,parent:W});var de=0;if(ee.globals.hasXaxisGroups&&ee.config.xaxis.tickPlacement==="between"){var fe=ee.globals.groups;if(fe){for(var xe=0,we=0;xe<h&&we<fe.length;we++)xe+=fe[we].cols;xe===h&&(de=.6*ee.globals.xAxisLabelsHeight)}}new it(this.ctx).drawXaxisTicks(S,de,ee.globals.dom.elGraphical)}}},{key:"_drawGridLine",value:function(p){var h=p.i,S=p.x1,_=p.y1,k=p.x2,T=p.y2,B=p.xCount,W=p.parent,ee=this.w,de=W.node.classList.contains("apexcharts-gridlines-horizontal"),fe=ee.globals.barPadForNumericAxis,xe=_===0&&T===0||S===0&&k===0||_===ee.globals.gridHeight&&T===ee.globals.gridHeight||ee.globals.isBarHorizontal&&(h===0||h===B-1),we=new z(this).drawLine(S-(de?fe:0),_,k+(de?fe:0),T,ee.config.grid.borderColor,ee.config.grid.strokeDashArray);we.node.classList.add("apexcharts-gridline"),xe&&ee.config.grid.show?this.elGridBorders.add(we):W.add(we)}},{key:"_drawGridBandRect",value:function(p){var h=p.c,S=p.x1,_=p.y1,k=p.x2,T=p.y2,B=p.type,W=this.w,ee=new z(this.ctx),de=W.globals.barPadForNumericAxis,fe=W.config.grid[B].colors[h],xe=ee.drawRect(S-(B==="row"?de:0),_,k+(B==="row"?2*de:0),T,0,fe,W.config.grid[B].opacity);this.elg.add(xe),xe.attr("clip-path","url(#gridRectMask".concat(W.globals.cuid,")")),xe.node.classList.add("apexcharts-grid-".concat(B))}},{key:"_drawXYLines",value:function(p){var h=this,S=p.xCount,_=p.tickAmount,k=this.w;if(k.config.grid.xaxis.lines.show||k.config.xaxis.axisTicks.show){var T,B=k.globals.padHorizontal,W=k.globals.gridHeight;k.globals.timescaleLabels.length?function(ke){for(var Me=ke.xC,Ye=ke.x1,Fe=ke.y1,st=ke.x2,se=ke.y2,Se=0;Se<Me;Se++)Ye=h.xaxisLabels[Se].position,st=h.xaxisLabels[Se].position,h._drawGridLines({i:Se,x1:Ye,y1:Fe,x2:st,y2:se,xCount:S,parent:h.elgridLinesV})}({xC:S,x1:B,y1:0,x2:T,y2:W}):(k.globals.isXNumeric&&(S=k.globals.xAxisScale.result.length),function(ke){for(var Me=ke.xC,Ye=ke.x1,Fe=ke.y1,st=ke.x2,se=ke.y2,Se=0;Se<Me+(k.globals.isXNumeric?0:1);Se++)Se===0&&Me===1&&k.globals.dataPoints===1&&(st=Ye=k.globals.gridWidth/2),h._drawGridLines({i:Se,x1:Ye,y1:Fe,x2:st,y2:se,xCount:S,parent:h.elgridLinesV}),st=Ye+=k.globals.gridWidth/(k.globals.isXNumeric?Me-1:Me)}({xC:S,x1:B,y1:0,x2:T,y2:W}))}if(k.config.grid.yaxis.lines.show){var ee=0,de=0,fe=k.globals.gridWidth,xe=_+1;this.isRangeBar&&(xe=k.globals.labels.length);for(var we=0;we<xe+(this.isRangeBar?1:0);we++)this._drawGridLine({i:we,xCount:xe+(this.isRangeBar?1:0),x1:0,y1:ee,x2:fe,y2:de,parent:this.elgridLinesH}),de=ee+=k.globals.gridHeight/(this.isRangeBar?xe:_)}}},{key:"_drawInvertedXYLines",value:function(p){var h=p.xCount,S=this.w;if(S.config.grid.xaxis.lines.show||S.config.xaxis.axisTicks.show)for(var _,k=S.globals.padHorizontal,T=S.globals.gridHeight,B=0;B<h+1;B++)S.config.grid.xaxis.lines.show&&this._drawGridLine({i:B,xCount:h+1,x1:k,y1:0,x2:_,y2:T,parent:this.elgridLinesV}),new it(this.ctx).drawXaxisTicks(k,0,S.globals.dom.elGraphical),_=k+=S.globals.gridWidth/h;if(S.config.grid.yaxis.lines.show)for(var W=0,ee=0,de=S.globals.gridWidth,fe=0;fe<S.globals.dataPoints+1;fe++)this._drawGridLine({i:fe,xCount:S.globals.dataPoints+1,x1:0,y1:W,x2:de,y2:ee,parent:this.elgridLinesH}),ee=W+=S.globals.gridHeight/S.globals.dataPoints}},{key:"renderGrid",value:function(){var p=this.w,h=p.globals,S=new z(this.ctx);this.elg=S.group({class:"apexcharts-grid"}),this.elgridLinesH=S.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=S.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=S.group({class:"apexcharts-grid-borders"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),p.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide(),this.elGridBorders.hide());for(var _=0;_<h.seriesYAxisMap.length&&h.ignoreYAxisIndexes.includes(_);)_++;_===h.seriesYAxisMap.length&&(_=0);var k,T=h.yAxisScale[_].result.length-1;if(!h.isBarHorizontal||this.isRangeBar){var B,W,ee;k=this.xaxisLabels.length,this.isRangeBar&&(T=h.labels.length,p.config.xaxis.tickAmount&&p.config.xaxis.labels.formatter&&(k=p.config.xaxis.tickAmount),((B=h.yAxisScale)===null||B===void 0||(W=B[_])===null||W===void 0||(ee=W.result)===null||ee===void 0?void 0:ee.length)>0&&p.config.xaxis.type!=="datetime"&&(k=h.yAxisScale[_].result.length-1)),this._drawXYLines({xCount:k,tickAmount:T})}else k=T,T=h.xTickAmount,this._drawInvertedXYLines({xCount:k,tickAmount:T});return this.drawGridBands(k,T),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:h.gridWidth/k}}},{key:"drawGridBands",value:function(p,h){var S,_,k=this,T=this.w;if(((S=T.config.grid.row.colors)===null||S===void 0?void 0:S.length)>0&&function(ke,Me,Ye,Fe,st,se){for(var Se=0,De=0;Se<Me;Se++,De++)De>=T.config.grid[ke].colors.length&&(De=0),k._drawGridBandRect({c:De,x1:Ye,y1:Fe,x2:st,y2:se,type:ke}),Fe+=T.globals.gridHeight/h}("row",h,0,0,T.globals.gridWidth,T.globals.gridHeight/h),((_=T.config.grid.column.colors)===null||_===void 0?void 0:_.length)>0){var B=T.globals.isBarHorizontal||T.config.xaxis.tickPlacement!=="on"||T.config.xaxis.type!=="category"&&!T.config.xaxis.convertedCatToNumeric?p:p-1;T.globals.isXNumeric&&(B=T.globals.xAxisScale.result.length-1);for(var W=T.globals.padHorizontal,ee=T.globals.padHorizontal+T.globals.gridWidth/B,de=T.globals.gridHeight,fe=0,xe=0;fe<p;fe++,xe++){var we;xe>=T.config.grid.column.colors.length&&(xe=0),T.config.xaxis.type==="datetime"&&(W=this.xaxisLabels[fe].position,ee=(((we=this.xaxisLabels[fe+1])===null||we===void 0?void 0:we.position)||T.globals.gridWidth)-this.xaxisLabels[fe].position),this._drawGridBandRect({c:xe,x1:W,y1:0,x2:ee,y2:de,type:"column"}),W+=T.globals.gridWidth/B}}}}]),Ee}(),ot=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.coreUtils=new Q(this.ctx)}return o(Ee,[{key:"niceScale",value:function(p,h){var S,_,k,T,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,W=1e-11,ee=this.w,de=ee.globals;de.isBarHorizontal?(S=ee.config.xaxis,_=Math.max((de.svgWidth-100)/25,2)):(S=ee.config.yaxis[B],_=Math.max((de.svgHeight-100)/15,2)),F.isNumber(_)||(_=10),k=S.min!==void 0&&S.min!==null,T=S.max!==void 0&&S.min!==null;var fe=S.stepSize!==void 0&&S.stepSize!==null,xe=S.tickAmount!==void 0&&S.tickAmount!==null,we=xe?S.tickAmount:de.niceScaleDefaultTicks[Math.min(Math.round(_/2),de.niceScaleDefaultTicks.length-1)];if(de.isMultipleYAxis&&!xe&&de.multiAxisTickAmount>0&&(we=de.multiAxisTickAmount,xe=!0),we=we==="dataPoints"?de.dataPoints-1:Math.abs(Math.round(we)),(p===Number.MIN_VALUE&&h===0||!F.isNumber(p)&&!F.isNumber(h)||p===Number.MIN_VALUE&&h===-Number.MAX_VALUE)&&(p=F.isNumber(S.min)?S.min:0,h=F.isNumber(S.max)?S.max:p+we,de.allSeriesCollapsed=!1),p>h){console.warn("axis.min cannot be greater than axis.max: swapping min and max");var ke=h;h=p,p=ke}else p===h&&(p=p===0?0:p-1,h=h===0?2:h+1);var Me=[];we<1&&(we=1);var Ye=we,Fe=Math.abs(h-p);!k&&p>0&&p/Fe<.15&&(p=0,k=!0),!T&&h<0&&-h/Fe<.15&&(h=0,T=!0);var st=(Fe=Math.abs(h-p))/Ye,se=st,Se=Math.floor(Math.log10(se)),De=Math.pow(10,Se),Le=Math.ceil(se/De);if(st=se=(Le=de.niceScaleAllowedMagMsd[de.yValueDecimal===0?0:1][Le])*De,de.isBarHorizontal&&S.stepSize&&S.type!=="datetime"?(st=S.stepSize,fe=!0):fe&&(st=S.stepSize),fe&&S.forceNiceScale){var _e=Math.floor(Math.log10(st));st*=Math.pow(10,Se-_e)}if(k&&T){var nt=Fe/Ye;if(xe)if(fe)if(F.mod(Fe,st)!=0){var lt=F.getGCD(st,nt);st=nt/lt<10?lt:nt}else F.mod(st,nt)==0?st=nt:(nt=st,xe=!1);else st=nt;else if(fe)F.mod(Fe,st)==0?nt=st:st=nt;else if(F.mod(Fe,st)==0)nt=st;else{nt=Fe/(Ye=Math.ceil(Fe/st));var bt=F.getGCD(Fe,st);Fe/bt<_&&(nt=bt),st=nt}Ye=Math.round(Fe/st)}else{if(k||T){if(T)if(xe)p=h-st*Ye;else{var Zt=p;p=st*Math.floor(p/st),Math.abs(h-p)/F.getGCD(Fe,st)>_&&(p=h-st*we,p+=st*Math.floor((Zt-p)/st))}else if(k)if(xe)h=p+st*Ye;else{var Ge=h;h=st*Math.ceil(h/st),Math.abs(h-p)/F.getGCD(Fe,st)>_&&(h=p+st*we,h+=st*Math.ceil((Ge-h)/st))}}else if(de.isMultipleYAxis&&xe){var Je=st*Math.floor(p/st),We=Je+st*Ye;We<h&&(st*=2),We=h,h=(p=Je)+st*Ye,Fe=Math.abs(h-p),p>0&&p<Math.abs(We-h)&&(p=0,h=st*Ye),h<0&&-h<Math.abs(Je-p)&&(h=0,p=-st*Ye)}else p=st*Math.floor(p/st),h=st*Math.ceil(h/st);Fe=Math.abs(h-p),st=F.getGCD(Fe,st),Ye=Math.round(Fe/st)}if(xe||k||T||(Ye=Math.ceil((Fe-W)/(st+W)))>16&&F.getPrimeFactors(Ye).length<2&&Ye++,!xe&&S.forceNiceScale&&de.yValueDecimal===0&&Ye>Fe&&(Ye=Fe,st=Math.round(Fe/Ye)),Ye>_&&(!xe&&!fe||S.forceNiceScale)){var wt=F.getPrimeFactors(Ye),At=wt.length-1,Gt=Ye;e:for(var fn=0;fn<At;fn++)for(var Rn=0;Rn<=At-fn;Rn++){for(var An=Math.min(Rn+fn,At),pr=Gt,mt=1,qt=Rn;qt<=An;qt++)mt*=wt[qt];if((pr/=mt)<_){Gt=pr;break e}}st=Gt===Ye?Fe:Fe/Gt,Ye=Math.round(Fe/st)}de.isMultipleYAxis&&de.multiAxisTickAmount==0&&de.ignoreYAxisIndexes.indexOf(B)<0&&(de.multiAxisTickAmount=Ye);var Qt=p-st,In=st*W;do Qt+=st,Me.push(F.stripNumber(Qt,7));while(h-Qt>In);return{result:Me,niceMin:Me[0],niceMax:Me[Me.length-1]}}},{key:"linearScale",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:void 0,T=Math.abs(h-p),B=[];if(p===h)return{result:B=[p],niceMin:B[0],niceMax:B[B.length-1]};(S=this._adjustTicksForSmallRange(S,_,T))==="dataPoints"&&(S=this.w.globals.dataPoints-1),k||(k=T/S),k=Math.round(10*(k+Number.EPSILON))/10,S===Number.MAX_VALUE&&(S=5,k=1);for(var W=p;S>=0;)B.push(W),W=F.preciseAddition(W,k),S-=1;return{result:B,niceMin:B[0],niceMax:B[B.length-1]}}},{key:"logarithmicScaleNice",value:function(p,h,S){h<=0&&(h=Math.max(p,S)),p<=0&&(p=Math.min(h,S));for(var _=[],k=Math.ceil(Math.log(h)/Math.log(S)+1),T=Math.floor(Math.log(p)/Math.log(S));T<k;T++)_.push(Math.pow(S,T));return{result:_,niceMin:_[0],niceMax:_[_.length-1]}}},{key:"logarithmicScale",value:function(p,h,S){h<=0&&(h=Math.max(p,S)),p<=0&&(p=Math.min(h,S));for(var _=[],k=Math.log(h)/Math.log(S),T=Math.log(p)/Math.log(S),B=k-T,W=Math.round(B),ee=B/W,de=0,fe=T;de<W;de++,fe+=ee)_.push(Math.pow(S,fe));return _.push(Math.pow(S,k)),{result:_,niceMin:p,niceMax:h}}},{key:"_adjustTicksForSmallRange",value:function(p,h,S){var _=p;if(h!==void 0&&this.w.config.yaxis[h].labels.formatter&&this.w.config.yaxis[h].tickAmount===void 0){var k=Number(this.w.config.yaxis[h].labels.formatter(1));F.isNumber(k)&&this.w.globals.yValueDecimal===0&&(_=Math.ceil(S))}return _<p?_:p}},{key:"setYScaleForIndex",value:function(p,h,S){var _=this.w.globals,k=this.w.config,T=_.isBarHorizontal?k.xaxis:k.yaxis[p];_.yAxisScale[p]===void 0&&(_.yAxisScale[p]=[]);var B=Math.abs(S-h);T.logarithmic&&B<=5&&(_.invalidLogScale=!0),T.logarithmic&&B>5?(_.allSeriesCollapsed=!1,_.yAxisScale[p]=T.forceNiceScale?this.logarithmicScaleNice(h,S,T.logBase):this.logarithmicScale(h,S,T.logBase)):S!==-Number.MAX_VALUE&&F.isNumber(S)&&h!==Number.MAX_VALUE&&F.isNumber(h)?(_.allSeriesCollapsed=!1,_.yAxisScale[p]=this.niceScale(h,S,p)):_.yAxisScale[p]=this.niceScale(Number.MIN_VALUE,0,p)}},{key:"setXScale",value:function(p,h){var S=this.w,_=S.globals,k=Math.abs(h-p);if(h!==-Number.MAX_VALUE&&F.isNumber(h)){var T=_.xTickAmount+1;k<10&&k>1&&(T=k),_.xAxisScale=this.linearScale(p,h,T,0,S.config.xaxis.stepSize)}else _.xAxisScale=this.linearScale(0,10,10);return _.xAxisScale}},{key:"scaleMultipleYAxes",value:function(){var p=this,h=this.w.config,S=this.w.globals;this.coreUtils.setSeriesYAxisMappings();var _=S.seriesYAxisMap,k=S.minYArr,T=S.maxYArr;S.allSeriesCollapsed=!0,S.barGroups=[],_.forEach(function(B,W){var ee=[];B.forEach(function(de){var fe=h.series[de].group;ee.indexOf(fe)<0&&ee.push(fe)}),B.length>0?function(){var de,fe,xe=Number.MAX_VALUE,we=-Number.MAX_VALUE,ke=xe,Me=we;if(h.chart.stacked)(function(){var st=new Array(S.dataPoints).fill(0),se=[],Se=[],De=[];ee.forEach(function(){se.push(st.map(function(){return Number.MIN_VALUE})),Se.push(st.map(function(){return Number.MIN_VALUE})),De.push(st.map(function(){return Number.MIN_VALUE}))});for(var Le=function(nt){!de&&h.series[B[nt]].type&&(de=h.series[B[nt]].type);var lt=B[nt];fe=h.series[lt].group?h.series[lt].group:"axis-".concat(W),!(S.collapsedSeriesIndices.indexOf(lt)<0&&S.ancillaryCollapsedSeriesIndices.indexOf(lt)<0)||(S.allSeriesCollapsed=!1,ee.forEach(function(bt,Zt){if(h.series[lt].group===bt)for(var Ge=0;Ge<S.series[lt].length;Ge++){var Je=S.series[lt][Ge];Je>=0?Se[Zt][Ge]+=Je:De[Zt][Ge]+=Je,se[Zt][Ge]+=Je,ke=Math.min(ke,Je),Me=Math.max(Me,Je)}})),de!=="bar"&&de!=="column"||S.barGroups.push(fe)},_e=0;_e<B.length;_e++)Le(_e);de||(de=h.chart.type),de==="bar"||de==="column"?ee.forEach(function(nt,lt){xe=Math.min(xe,Math.min.apply(null,De[lt])),we=Math.max(we,Math.max.apply(null,Se[lt]))}):(ee.forEach(function(nt,lt){ke=Math.min(ke,Math.min.apply(null,se[lt])),Me=Math.max(Me,Math.max.apply(null,se[lt]))}),xe=ke,we=Me),xe===Number.MIN_VALUE&&we===Number.MIN_VALUE&&(we=-Number.MAX_VALUE)})();else for(var Ye=0;Ye<B.length;Ye++){var Fe=B[Ye];xe=Math.min(xe,k[Fe]),we=Math.max(we,T[Fe]),!(S.collapsedSeriesIndices.indexOf(Fe)<0&&S.ancillaryCollapsedSeriesIndices.indexOf(Fe)<0)||(S.allSeriesCollapsed=!1)}h.yaxis[W].min!==void 0&&(xe=typeof h.yaxis[W].min=="function"?h.yaxis[W].min(xe):h.yaxis[W].min),h.yaxis[W].max!==void 0&&(we=typeof h.yaxis[W].max=="function"?h.yaxis[W].max(we):h.yaxis[W].max),S.barGroups=S.barGroups.filter(function(st,se,Se){return Se.indexOf(st)===se}),p.setYScaleForIndex(W,xe,we),B.forEach(function(st){k[st]=S.yAxisScale[W].niceMin,T[st]=S.yAxisScale[W].niceMax})}():p.setYScaleForIndex(W,0,-Number.MAX_VALUE)})}}]),Ee}(),ft=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.scales=new ot(p)}return o(Ee,[{key:"init",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:"getMinYMaxY",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-Number.MAX_VALUE,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,k=this.w.config,T=this.w.globals,B=-Number.MAX_VALUE,W=Number.MIN_VALUE;_===null&&(_=p+1);var ee=T.series,de=ee,fe=ee;k.chart.type==="candlestick"?(de=T.seriesCandleL,fe=T.seriesCandleH):k.chart.type==="boxPlot"?(de=T.seriesCandleO,fe=T.seriesCandleC):T.isRangeData&&(de=T.seriesRangeStart,fe=T.seriesRangeEnd);var xe=!1;if(T.seriesX.length>=_){var we,ke=(we=T.brushSource)===null||we===void 0?void 0:we.w.config.chart.brush;(k.chart.zoom.enabled&&k.chart.zoom.autoScaleYaxis||ke!=null&&ke.enabled&&ke!=null&&ke.autoScaleYaxis)&&(xe=!0)}for(var Me=p;Me<_;Me++){T.dataPoints=Math.max(T.dataPoints,ee[Me].length);var Ye=k.series[Me].type;T.categoryLabels.length&&(T.dataPoints=T.categoryLabels.filter(function(De){return De!==void 0}).length),T.labels.length&&k.xaxis.type!=="datetime"&&T.series.reduce(function(De,Le){return De+Le.length},0)!==0&&(T.dataPoints=Math.max(T.dataPoints,T.labels.length));var Fe=0,st=ee[Me].length-1;if(xe){if(k.xaxis.min)for(;Fe<st&&T.seriesX[Me][Fe]<k.xaxis.min;Fe++);if(k.xaxis.max)for(;st>Fe&&T.seriesX[Me][st]>k.xaxis.max;st--);}for(var se=Fe;se<=st&&se<T.series[Me].length;se++){var Se=ee[Me][se];if(Se!==null&&F.isNumber(Se)){switch(fe[Me][se]!==void 0&&(B=Math.max(B,fe[Me][se]),h=Math.min(h,fe[Me][se])),de[Me][se]!==void 0&&(h=Math.min(h,de[Me][se]),S=Math.max(S,de[Me][se])),Ye){case"candlestick":T.seriesCandleC[Me][se]!==void 0&&(B=Math.max(B,T.seriesCandleH[Me][se]),h=Math.min(h,T.seriesCandleL[Me][se]));break;case"boxPlot":T.seriesCandleC[Me][se]!==void 0&&(B=Math.max(B,T.seriesCandleC[Me][se]),h=Math.min(h,T.seriesCandleO[Me][se]))}Ye&&Ye!=="candlestick"&&Ye!=="boxPlot"&&Ye!=="rangeArea"&&Ye!=="rangeBar"&&(B=Math.max(B,T.series[Me][se]),h=Math.min(h,T.series[Me][se])),S=B,T.seriesGoals[Me]&&T.seriesGoals[Me][se]&&Array.isArray(T.seriesGoals[Me][se])&&T.seriesGoals[Me][se].forEach(function(De){W!==Number.MIN_VALUE&&(W=Math.min(W,De.value),h=W),B=Math.max(B,De.value),S=B}),F.isFloat(Se)&&(Se=F.noExponents(Se),T.yValueDecimal=Math.max(T.yValueDecimal,Se.toString().split(".")[1].length)),W>de[Me][se]&&de[Me][se]<0&&(W=de[Me][se])}else T.hasNullValues=!0}Ye!=="bar"&&Ye!=="column"||(W<0&&B<0&&(B=0,S=Math.max(S,0)),W===Number.MIN_VALUE&&(W=0,h=Math.min(h,0)))}return k.chart.type==="rangeBar"&&T.seriesRangeStart.length&&T.isBarHorizontal&&(W=h),k.chart.type==="bar"&&(W<0&&B<0&&(B=0),W===Number.MIN_VALUE&&(W=0)),{minY:W,maxY:B,lowestY:h,highestY:S}}},{key:"setYRange",value:function(){var p=this.w.globals,h=this.w.config;p.maxY=-Number.MAX_VALUE,p.minY=Number.MIN_VALUE;var S,_=Number.MAX_VALUE;if(p.isMultipleYAxis){_=Number.MAX_VALUE;for(var k=0;k<p.series.length;k++)S=this.getMinYMaxY(k),p.minYArr[k]=S.lowestY,p.maxYArr[k]=S.highestY,_=Math.min(_,S.lowestY)}return S=this.getMinYMaxY(0,_,null,p.series.length),h.chart.type==="bar"?(p.minY=S.minY,p.maxY=S.maxY):(p.minY=S.lowestY,p.maxY=S.highestY),_=S.lowestY,h.chart.stacked&&this._setStackedMinMax(),h.chart.type==="line"||h.chart.type==="area"||h.chart.type==="scatter"||h.chart.type==="candlestick"||h.chart.type==="boxPlot"||h.chart.type==="rangeBar"&&!p.isBarHorizontal?p.minY===Number.MIN_VALUE&&_!==-Number.MAX_VALUE&&_!==p.maxY&&(p.minY=_):p.minY=p.minY!==Number.MIN_VALUE?Math.min(S.minY,p.minY):S.minY,h.yaxis.forEach(function(T,B){T.max!==void 0&&(typeof T.max=="number"?p.maxYArr[B]=T.max:typeof T.max=="function"&&(p.maxYArr[B]=T.max(p.isMultipleYAxis?p.maxYArr[B]:p.maxY)),p.maxY=p.maxYArr[B]),T.min!==void 0&&(typeof T.min=="number"?p.minYArr[B]=T.min:typeof T.min=="function"&&(p.minYArr[B]=T.min(p.isMultipleYAxis?p.minYArr[B]===Number.MIN_VALUE?0:p.minYArr[B]:p.minY)),p.minY=p.minYArr[B])}),p.isBarHorizontal&&["min","max"].forEach(function(T){h.xaxis[T]!==void 0&&typeof h.xaxis[T]=="number"&&(T==="min"?p.minY=h.xaxis[T]:p.maxY=h.xaxis[T])}),p.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),p.minY=_):(this.scales.setYScaleForIndex(0,p.minY,p.maxY),p.minY=p.yAxisScale[0].niceMin,p.maxY=p.yAxisScale[0].niceMax,p.minYArr[0]=p.minY,p.maxYArr[0]=p.maxY),p.barGroups=[],p.lineGroups=[],p.areaGroups=[],h.series.forEach(function(T){switch(T.type||h.chart.type){case"bar":case"column":p.barGroups.push(T.group);break;case"line":p.lineGroups.push(T.group);break;case"area":p.areaGroups.push(T.group)}}),p.barGroups=p.barGroups.filter(function(T,B,W){return W.indexOf(T)===B}),p.lineGroups=p.lineGroups.filter(function(T,B,W){return W.indexOf(T)===B}),p.areaGroups=p.areaGroups.filter(function(T,B,W){return W.indexOf(T)===B}),{minY:p.minY,maxY:p.maxY,minYArr:p.minYArr,maxYArr:p.maxYArr,yAxisScale:p.yAxisScale}}},{key:"setXRange",value:function(){var p=this.w.globals,h=this.w.config,S=h.xaxis.type==="numeric"||h.xaxis.type==="datetime"||h.xaxis.type==="category"&&!p.noLabelsProvided||p.noLabelsProvided||p.isXNumeric;if(p.isXNumeric&&function(){for(var W=0;W<p.series.length;W++)if(p.labels[W])for(var ee=0;ee<p.labels[W].length;ee++)p.labels[W][ee]!==null&&F.isNumber(p.labels[W][ee])&&(p.maxX=Math.max(p.maxX,p.labels[W][ee]),p.initialMaxX=Math.max(p.maxX,p.labels[W][ee]),p.minX=Math.min(p.minX,p.labels[W][ee]),p.initialMinX=Math.min(p.minX,p.labels[W][ee]))}(),p.noLabelsProvided&&h.xaxis.categories.length===0&&(p.maxX=p.labels[p.labels.length-1],p.initialMaxX=p.labels[p.labels.length-1],p.minX=1,p.initialMinX=1),p.isXNumeric||p.noLabelsProvided||p.dataFormatXNumeric){var _=10;if(h.xaxis.tickAmount===void 0)_=Math.round(p.svgWidth/150),h.xaxis.type==="numeric"&&p.dataPoints<30&&(_=p.dataPoints-1),_>p.dataPoints&&p.dataPoints!==0&&(_=p.dataPoints-1);else if(h.xaxis.tickAmount==="dataPoints"){if(p.series.length>1&&(_=p.series[p.maxValsInArrayIndex].length-1),p.isXNumeric){var k=p.maxX-p.minX;k<30&&(_=k-1)}}else _=h.xaxis.tickAmount;if(p.xTickAmount=_,h.xaxis.max!==void 0&&typeof h.xaxis.max=="number"&&(p.maxX=h.xaxis.max),h.xaxis.min!==void 0&&typeof h.xaxis.min=="number"&&(p.minX=h.xaxis.min),h.xaxis.range!==void 0&&(p.minX=p.maxX-h.xaxis.range),p.minX!==Number.MAX_VALUE&&p.maxX!==-Number.MAX_VALUE)if(h.xaxis.convertedCatToNumeric&&!p.dataFormatXNumeric){for(var T=[],B=p.minX-1;B<p.maxX;B++)T.push(B+1);p.xAxisScale={result:T,niceMin:T[0],niceMax:T[T.length-1]}}else p.xAxisScale=this.scales.setXScale(p.minX,p.maxX);else p.xAxisScale=this.scales.linearScale(0,_,_,0,h.xaxis.stepSize),p.noLabelsProvided&&p.labels.length>0&&(p.xAxisScale=this.scales.linearScale(1,p.labels.length,_-1,0,h.xaxis.stepSize),p.seriesX=p.labels.slice());S&&(p.labels=p.xAxisScale.result.slice())}return p.isBarHorizontal&&p.labels.length&&(p.xTickAmount=p.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:p.minX,maxX:p.maxX}}},{key:"setZRange",value:function(){var p=this.w.globals;if(p.isDataXYZ){for(var h=0;h<p.series.length;h++)if(p.seriesZ[h]!==void 0)for(var S=0;S<p.seriesZ[h].length;S++)p.seriesZ[h][S]!==null&&F.isNumber(p.seriesZ[h][S])&&(p.maxZ=Math.max(p.maxZ,p.seriesZ[h][S]),p.minZ=Math.min(p.minZ,p.seriesZ[h][S]))}}},{key:"_handleSingleDataPoint",value:function(){var p=this.w.globals,h=this.w.config;if(p.minX===p.maxX){var S=new X(this.ctx);if(h.xaxis.type==="datetime"){var _=S.getDate(p.minX);h.xaxis.labels.datetimeUTC?_.setUTCDate(_.getUTCDate()-2):_.setDate(_.getDate()-2),p.minX=new Date(_).getTime();var k=S.getDate(p.maxX);h.xaxis.labels.datetimeUTC?k.setUTCDate(k.getUTCDate()+2):k.setDate(k.getDate()+2),p.maxX=new Date(k).getTime()}else(h.xaxis.type==="numeric"||h.xaxis.type==="category"&&!p.noLabelsProvided)&&(p.minX=p.minX-2,p.initialMinX=p.minX,p.maxX=p.maxX+2,p.initialMaxX=p.maxX)}}},{key:"_getMinXDiff",value:function(){var p=this.w.globals;p.isXNumeric&&p.seriesX.forEach(function(h,S){h.length===1&&h.push(p.seriesX[p.maxValsInArrayIndex][p.seriesX[p.maxValsInArrayIndex].length-1]);var _=h.slice();_.sort(function(k,T){return k-T}),_.forEach(function(k,T){if(T>0){var B=k-_[T-1];B>0&&(p.minXDiff=Math.min(B,p.minXDiff))}}),p.dataPoints!==1&&p.minXDiff!==Number.MAX_VALUE||(p.minXDiff=.5)})}},{key:"_setStackedMinMax",value:function(){var p=this,h=this.w.globals;if(h.series.length){var S=h.seriesGroups;S.length||(S=[this.w.globals.seriesNames.map(function(T){return T})]);var _={},k={};S.forEach(function(T){_[T]=[],k[T]=[],p.w.config.series.map(function(B,W){return T.indexOf(h.seriesNames[W])>-1?W:null}).filter(function(B){return B!==null}).forEach(function(B){for(var W=0;W<h.series[h.maxValsInArrayIndex].length;W++){var ee,de,fe,xe;_[T][W]===void 0&&(_[T][W]=0,k[T][W]=0),(p.w.config.chart.stacked&&!h.comboCharts||p.w.config.chart.stacked&&h.comboCharts&&(!p.w.config.chart.stackOnlyBar||((ee=p.w.config.series)===null||ee===void 0||(de=ee[B])===null||de===void 0?void 0:de.type)==="bar"||((fe=p.w.config.series)===null||fe===void 0||(xe=fe[B])===null||xe===void 0?void 0:xe.type)==="column"))&&h.series[B][W]!==null&&F.isNumber(h.series[B][W])&&(h.series[B][W]>0?_[T][W]+=parseFloat(h.series[B][W])+1e-4:k[T][W]+=parseFloat(h.series[B][W]))}})}),Object.entries(_).forEach(function(T){var B=C(T,1)[0];_[B].forEach(function(W,ee){h.maxY=Math.max(h.maxY,_[B][ee]),h.minY=Math.min(h.minY,k[B][ee])})})}}}]),Ee}(),ct=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.elgrid=h,this.w=p.w;var S=this.w;this.xaxisFontSize=S.config.xaxis.labels.style.fontSize,this.axisFontFamily=S.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=S.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal=S.config.chart.type==="bar"&&S.config.plotOptions.bar.horizontal,this.xAxisoffX=S.config.xaxis.position==="bottom"?S.globals.gridHeight:0,this.drawnLabels=[],this.axesUtils=new pe(p)}return o(Ee,[{key:"drawYaxis",value:function(p){var h=this.w,S=new z(this.ctx),_=h.config.yaxis[p].labels.style,k=_.fontSize,T=_.fontFamily,B=_.fontWeight,W=S.group({class:"apexcharts-yaxis",rel:p,transform:"translate(".concat(h.globals.translateYAxisX[p],", 0)")});if(this.axesUtils.isYAxisHidden(p))return W;var ee=S.group({class:"apexcharts-yaxis-texts-g"});W.add(ee);var de=h.globals.yAxisScale[p].result.length-1,fe=h.globals.gridHeight/de,xe=h.globals.yLabelFormatters[p],we=this.axesUtils.checkForReversedLabels(p,h.globals.yAxisScale[p].result.slice());if(h.config.yaxis[p].labels.show){var ke=h.globals.translateY+h.config.yaxis[p].labels.offsetY;h.globals.isBarHorizontal?ke=0:h.config.chart.type==="heatmap"&&(ke-=fe/2),ke+=parseInt(k,10)/3;for(var Me=de;Me>=0;Me--){var Ye=xe(we[Me],Me,h),Fe=h.config.yaxis[p].labels.padding;h.config.yaxis[p].opposite&&h.config.yaxis.length!==0&&(Fe*=-1);var st=this.getTextAnchor(h.config.yaxis[p].labels.align,h.config.yaxis[p].opposite),se=this.axesUtils.getYAxisForeColor(_.colors,p),Se=Array.isArray(se)?se[Me]:se,De=F.listToArray(h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(p,"'] .apexcharts-yaxis-label tspan"))).map(function(_e){return _e.textContent}),Le=S.drawText({x:Fe,y:ke,text:De.includes(Ye)&&!h.config.yaxis[p].labels.showDuplicates?"":Ye,textAnchor:st,fontSize:k,fontFamily:T,fontWeight:B,maxWidth:h.config.yaxis[p].labels.maxWidth,foreColor:Se,isPlainText:!1,cssClass:"apexcharts-yaxis-label ".concat(_.cssClass)});ee.add(Le),this.addTooltip(Le,Ye),h.config.yaxis[p].labels.rotate!==0&&this.rotateLabel(S,Le,firstLabel,h.config.yaxis[p].labels.rotate),ke+=fe}}return this.addYAxisTitle(S,W,p),this.addAxisBorder(S,W,p,de,fe),W}},{key:"getTextAnchor",value:function(p,h){return p==="left"?"start":p==="center"?"middle":p==="right"?"end":h?"start":"end"}},{key:"addTooltip",value:function(p,h){var S=document.createElementNS(this.w.globals.SVGNS,"title");S.textContent=Array.isArray(h)?h.join(" "):h,p.node.appendChild(S)}},{key:"rotateLabel",value:function(p,h,S,_){var k=p.rotateAroundCenter(S.node),T=p.rotateAroundCenter(h.node);h.node.setAttribute("transform","rotate(".concat(_," ").concat(k.x," ").concat(T.y,")"))}},{key:"addYAxisTitle",value:function(p,h,S){var _=this.w;if(_.config.yaxis[S].title.text!==void 0){var k=p.group({class:"apexcharts-yaxis-title"}),T=_.config.yaxis[S].opposite?_.globals.translateYAxisX[S]:0,B=p.drawText({x:T,y:_.globals.gridHeight/2+_.globals.translateY+_.config.yaxis[S].title.offsetY,text:_.config.yaxis[S].title.text,textAnchor:"end",foreColor:_.config.yaxis[S].title.style.color,fontSize:_.config.yaxis[S].title.style.fontSize,fontWeight:_.config.yaxis[S].title.style.fontWeight,fontFamily:_.config.yaxis[S].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text ".concat(_.config.yaxis[S].title.style.cssClass)});k.add(B),h.add(k)}}},{key:"addAxisBorder",value:function(p,h,S,_,k){var T=this.w,B=T.config.yaxis[S].axisBorder,W=31+B.offsetX;if(T.config.yaxis[S].opposite&&(W=-31-B.offsetX),B.show){var ee=p.drawLine(W,T.globals.translateY+B.offsetY-2,W,T.globals.gridHeight+T.globals.translateY+B.offsetY+2,B.color,0,B.width);h.add(ee)}T.config.yaxis[S].axisTicks.show&&this.axesUtils.drawYAxisTicks(W,_,B,T.config.yaxis[S].axisTicks,S,k,h)}},{key:"drawYaxisInversed",value:function(p){var h=this.w,S=new z(this.ctx),_=S.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),k=S.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(h.globals.translateXAxisX,", ").concat(h.globals.translateXAxisY,")")});_.add(k);var T=h.globals.yAxisScale[p].result.length-1,B=h.globals.gridWidth/T+.1,W=B+h.config.xaxis.labels.offsetX,ee=h.globals.xLabelFormatter,de=this.axesUtils.checkForReversedLabels(p,h.globals.yAxisScale[p].result.slice()),fe=h.globals.timescaleLabels;if(fe.length>0&&(this.xaxisLabels=fe.slice(),T=(de=fe.slice()).length),h.config.xaxis.labels.show)for(var xe=fe.length?0:T;fe.length?xe<fe.length:xe>=0;fe.length?xe++:xe--){var we=ee(de[xe],xe,h),ke=h.globals.gridWidth+h.globals.padHorizontal-(W-B+h.config.xaxis.labels.offsetX);if(fe.length){var Me=this.axesUtils.getLabel(de,fe,ke,xe,this.drawnLabels,this.xaxisFontSize);ke=Me.x,we=Me.text,this.drawnLabels.push(Me.text),xe===0&&h.globals.skipFirstTimelinelabel&&(we=""),xe===de.length-1&&h.globals.skipLastTimelinelabel&&(we="")}var Ye=S.drawText({x:ke,y:this.xAxisoffX+h.config.xaxis.labels.offsetY+30-(h.config.xaxis.position==="top"?h.globals.xAxisHeight+h.config.xaxis.axisTicks.height-2:0),text:we,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[p]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:h.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-xaxis-label ".concat(h.config.xaxis.labels.style.cssClass)});k.add(Ye),Ye.tspan(we),this.addTooltip(Ye,we),W+=B}return this.inversedYAxisTitleText(_),this.inversedYAxisBorder(_),_}},{key:"inversedYAxisBorder",value:function(p){var h=this.w,S=new z(this.ctx),_=h.config.xaxis.axisBorder;if(_.show){var k=0;h.config.chart.type==="bar"&&h.globals.isXNumeric&&(k-=15);var T=S.drawLine(h.globals.padHorizontal+k+_.offsetX,this.xAxisoffX,h.globals.gridWidth,this.xAxisoffX,_.color,0,_.height);this.elgrid&&this.elgrid.elGridBorders&&h.config.grid.show?this.elgrid.elGridBorders.add(T):p.add(T)}}},{key:"inversedYAxisTitleText",value:function(p){var h=this.w,S=new z(this.ctx);if(h.config.xaxis.title.text!==void 0){var _=S.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),k=S.drawText({x:h.globals.gridWidth/2+h.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(h.config.xaxis.title.style.fontSize)+h.config.xaxis.title.offsetY+20,text:h.config.xaxis.title.text,textAnchor:"middle",fontSize:h.config.xaxis.title.style.fontSize,fontFamily:h.config.xaxis.title.style.fontFamily,fontWeight:h.config.xaxis.title.style.fontWeight,foreColor:h.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text ".concat(h.config.xaxis.title.style.cssClass)});_.add(k),p.add(_)}}},{key:"yAxisTitleRotate",value:function(p,h){var S=this.w,_=new z(this.ctx),k=S.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(p,"'] .apexcharts-yaxis-texts-g")),T=k?k.getBoundingClientRect():{width:0,height:0},B=S.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(p,"'] .apexcharts-yaxis-title text")),W=B?B.getBoundingClientRect():{width:0,height:0};if(B){var ee=this.xPaddingForYAxisTitle(p,T,W,h);B.setAttribute("x",ee.xPos-(h?10:0));var de=_.rotateAroundCenter(B);B.setAttribute("transform","rotate(".concat(h?-1*S.config.yaxis[p].title.rotate:S.config.yaxis[p].title.rotate," ").concat(de.x," ").concat(de.y,")"))}}},{key:"xPaddingForYAxisTitle",value:function(p,h,S,_){var k=this.w,T=0,B=10;return k.config.yaxis[p].title.text===void 0||p<0?{xPos:T,padd:0}:(_?T=h.width+k.config.yaxis[p].title.offsetX+S.width/2+B/2:(T=-1*h.width+k.config.yaxis[p].title.offsetX+B/2+S.width/2,k.globals.isBarHorizontal&&(B=25,T=-1*h.width-k.config.yaxis[p].title.offsetX-B)),{xPos:T,padd:B})}},{key:"setYAxisXPosition",value:function(p,h){var S=this.w,_=0,k=0,T=18,B=1;S.config.yaxis.length>1&&(this.multipleYs=!0),S.config.yaxis.forEach(function(W,ee){var de=S.globals.ignoreYAxisIndexes.includes(ee)||!W.show||W.floating||p[ee].width===0,fe=p[ee].width+h[ee].width;W.opposite?S.globals.isBarHorizontal?(k=S.globals.gridWidth+S.globals.translateX-1,S.globals.translateYAxisX[ee]=k-W.labels.offsetX):(k=S.globals.gridWidth+S.globals.translateX+B,de||(B+=fe+20),S.globals.translateYAxisX[ee]=k-W.labels.offsetX+20):(_=S.globals.translateX-T,de||(T+=fe+20),S.globals.translateYAxisX[ee]=_+W.labels.offsetX)})}},{key:"setYAxisTextAlignments",value:function(){var p=this.w;F.listToArray(p.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach(function(h,S){var _=p.config.yaxis[S];if(_&&!_.floating&&_.labels.align!==void 0){var k=p.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(S,"'] .apexcharts-yaxis-texts-g")),T=F.listToArray(p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(S,"'] .apexcharts-yaxis-label"))),B=k.getBoundingClientRect();T.forEach(function(W){W.setAttribute("text-anchor",_.labels.align)}),_.labels.align!=="left"||_.opposite?_.labels.align==="center"?k.setAttribute("transform","translate(".concat(B.width/2*(_.opposite?1:-1),", 0)")):_.labels.align==="right"&&_.opposite&&k.setAttribute("transform","translate(".concat(B.width,", 0)")):k.setAttribute("transform","translate(-".concat(B.width,", 0)"))}})}}]),Ee}(),Vt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.documentEvent=F.bind(this.documentEvent,this)}return o(Ee,[{key:"addEventListener",value:function(p,h){var S=this.w;S.globals.events.hasOwnProperty(p)?S.globals.events[p].push(h):S.globals.events[p]=[h]}},{key:"removeEventListener",value:function(p,h){var S=this.w;if(S.globals.events.hasOwnProperty(p)){var _=S.globals.events[p].indexOf(h);_!==-1&&S.globals.events[p].splice(_,1)}}},{key:"fireEvent",value:function(p,h){var S=this.w;if(S.globals.events.hasOwnProperty(p)){h&&h.length||(h=[]);for(var _=S.globals.events[p],k=_.length,T=0;T<k;T++)_[T].apply(null,h)}}},{key:"setupEventHandlers",value:function(){var p=this,h=this.w,S=this.ctx,_=h.globals.dom.baseEl.querySelector(h.globals.chartClass);this.ctx.eventList.forEach(function(k){_.addEventListener(k,function(T){var B=Object.assign({},h,{seriesIndex:h.globals.axisCharts?h.globals.capturedSeriesIndex:0,dataPointIndex:h.globals.capturedDataPointIndex});T.type==="mousemove"||T.type==="touchmove"?typeof h.config.chart.events.mouseMove=="function"&&h.config.chart.events.mouseMove(T,S,B):T.type==="mouseleave"||T.type==="touchleave"?typeof h.config.chart.events.mouseLeave=="function"&&h.config.chart.events.mouseLeave(T,S,B):(T.type==="mouseup"&&T.which===1||T.type==="touchend")&&(typeof h.config.chart.events.click=="function"&&h.config.chart.events.click(T,S,B),S.ctx.events.fireEvent("click",[T,S,B]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(function(k){h.globals.dom.baseEl.addEventListener(k,p.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}},{key:"documentEvent",value:function(p){var h=this.w,S=p.target.className;if(p.type==="click"){var _=h.globals.dom.baseEl.querySelector(".apexcharts-menu");_&&_.classList.contains("apexcharts-menu-open")&&S!=="apexcharts-menu-icon"&&_.classList.remove("apexcharts-menu-open")}h.globals.clientX=p.type==="touchmove"?p.touches[0].clientX:p.clientX,h.globals.clientY=p.type==="touchmove"?p.touches[0].clientY:p.clientY}}]),Ee}(),It=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"setCurrentLocaleValues",value:function(p){var h=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(h=this.w.config.chart.locales.concat(window.Apex.chart.locales));var S=h.filter(function(k){return k.name===p})[0];if(!S)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var _=F.extend(oe,S);this.w.globals.locale=_.options}}]),Ee}(),an=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"drawAxis",value:function(p,h){var S,_,k=this,T=this.w.globals,B=this.w.config,W=new it(this.ctx,h),ee=new ct(this.ctx,h);T.axisCharts&&p!=="radar"&&(T.isBarHorizontal?(_=ee.drawYaxisInversed(0),S=W.drawXaxisInversed(0),T.dom.elGraphical.add(S),T.dom.elGraphical.add(_)):(S=W.drawXaxis(),T.dom.elGraphical.add(S),B.yaxis.map(function(de,fe){if(T.ignoreYAxisIndexes.indexOf(fe)===-1&&(_=ee.drawYaxis(fe),T.dom.Paper.add(_),k.w.config.grid.position==="back")){var xe=T.dom.Paper.children()[1];xe.remove(),T.dom.Paper.add(xe)}})))}}]),Ee}(),Nt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"drawXCrosshairs",value:function(){var p=this.w,h=new z(this.ctx),S=new L(this.ctx),_=p.config.xaxis.crosshairs.fill.gradient,k=p.config.xaxis.crosshairs.dropShadow,T=p.config.xaxis.crosshairs.fill.type,B=_.colorFrom,W=_.colorTo,ee=_.opacityFrom,de=_.opacityTo,fe=_.stops,xe=k.enabled,we=k.left,ke=k.top,Me=k.blur,Ye=k.color,Fe=k.opacity,st=p.config.xaxis.crosshairs.fill.color;if(p.config.xaxis.crosshairs.show){T==="gradient"&&(st=h.drawGradient("vertical",B,W,ee,de,null,fe,null));var se=h.drawRect();p.config.xaxis.crosshairs.width===1&&(se=h.drawLine());var Se=p.globals.gridHeight;(!F.isNumber(Se)||Se<0)&&(Se=0);var De=p.config.xaxis.crosshairs.width;(!F.isNumber(De)||De<0)&&(De=0),se.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:Se,width:De,height:Se,fill:st,filter:"none","fill-opacity":p.config.xaxis.crosshairs.opacity,stroke:p.config.xaxis.crosshairs.stroke.color,"stroke-width":p.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":p.config.xaxis.crosshairs.stroke.dashArray}),xe&&(se=S.dropShadow(se,{left:we,top:ke,blur:Me,color:Ye,opacity:Fe})),p.globals.dom.elGraphical.add(se)}}},{key:"drawYCrosshairs",value:function(){var p=this.w,h=new z(this.ctx),S=p.config.yaxis[0].crosshairs,_=p.globals.barPadForNumericAxis;if(p.config.yaxis[0].crosshairs.show){var k=h.drawLine(-_,0,p.globals.gridWidth+_,0,S.stroke.color,S.stroke.dashArray,S.stroke.width);k.attr({class:"apexcharts-ycrosshairs"}),p.globals.dom.elGraphical.add(k)}var T=h.drawLine(-_,0,p.globals.gridWidth+_,0,S.stroke.color,0,0);T.attr({class:"apexcharts-ycrosshairs-hidden"}),p.globals.dom.elGraphical.add(T)}}]),Ee}(),mn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"checkResponsiveConfig",value:function(p){var h=this,S=this.w,_=S.config;if(_.responsive.length!==0){var k=_.responsive.slice();k.sort(function(ee,de){return ee.breakpoint>de.breakpoint?1:de.breakpoint>ee.breakpoint?-1:0}).reverse();var T=new Ce({}),B=function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},de=k[0].breakpoint,fe=window.innerWidth>0?window.innerWidth:screen.width;if(fe>de){var xe=F.clone(S.globals.initialConfig);xe.series=F.clone(S.config.series);var we=Q.extendArrayProps(T,xe,S);ee=F.extend(we,ee),ee=F.extend(S.config,ee),h.overrideResponsiveOptions(ee)}else for(var ke=0;ke<k.length;ke++)fe<k[ke].breakpoint&&(ee=Q.extendArrayProps(T,k[ke].options,S),ee=F.extend(S.config,ee),h.overrideResponsiveOptions(ee))};if(p){var W=Q.extendArrayProps(T,p,S);W=F.extend(S.config,W),B(W=F.extend(W,p))}else B({})}}},{key:"overrideResponsiveOptions",value:function(p){var h=new Ce(p).init({responsiveOverride:!0});this.w.config=h}}]),Ee}(),dn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}return o(Ee,[{key:"checkHeatmapDistributed",value:function(){var p=this.w.config,h=p.chart,S=p.plotOptions;return h.type==="treemap"&&S.treemap&&S.treemap.distributed||h.type==="heatmap"&&S.heatmap&&S.heatmap.distributed}},{key:"checkBarDistributed",value:function(){var p=this.w.config,h=p.chart,S=p.plotOptions;return S.bar&&S.bar.distributed&&(h.type==="bar"||h.type==="rangeBar")}},{key:"init",value:function(){this.setDefaultColors()}},{key:"setDefaultColors",value:function(){var p=this.w,h=new F;p.globals.dom.elWrap.classList.add("apexcharts-theme-".concat(p.config.theme.mode));var S=N(p.config.colors||p.config.fill.colors||[]);p.globals.colors=this.getColors(S),this.applySeriesColors(p.globals.seriesColors,p.globals.colors),p.config.theme.monochrome.enabled&&(p.globals.colors=this.getMonochromeColors(p.config.theme.monochrome,p.globals.series,h));var _=p.globals.colors.slice();this.pushExtraColors(p.globals.colors),this.applyColorTypes(["fill","stroke"],_),this.applyDataLabelsColors(_),this.applyRadarPolygonsColors(),this.applyMarkersColors(_)}},{key:"getColors",value:function(p){var h=this,S=this.w;return p&&p.length!==0?Array.isArray(p)&&p.length>0&&typeof p[0]=="function"?(this.isColorFn=!0,S.config.series.map(function(_,k){var T=p[k]||p[0];return typeof T=="function"?T({value:S.globals.axisCharts?S.globals.series[k][0]||0:S.globals.series[k],seriesIndex:k,dataPointIndex:k,w:h.w}):T})):p:this.predefined()}},{key:"applySeriesColors",value:function(p,h){p.forEach(function(S,_){S&&(h[_]=S)})}},{key:"getMonochromeColors",value:function(p,h,S){var _=p.color,k=p.shadeIntensity,T=p.shadeTo,B=this.isBarDistributed||this.isHeatmapDistributed?h[0].length*h.length:h.length,W=1/(B/k),ee=0;return Array.from({length:B},function(){var de=T==="dark"?S.shadeColor(-1*ee,_):S.shadeColor(ee,_);return ee+=W,de})}},{key:"applyColorTypes",value:function(p,h){var S=this,_=this.w;p.forEach(function(k){_.globals[k].colors=_.config[k].colors===void 0?S.isColorFn?_.config.colors:h:_.config[k].colors.slice(),S.pushExtraColors(_.globals[k].colors)})}},{key:"applyDataLabelsColors",value:function(p){var h=this.w;h.globals.dataLabels.style.colors=h.config.dataLabels.style.colors===void 0?p:h.config.dataLabels.style.colors.slice(),this.pushExtraColors(h.globals.dataLabels.style.colors,50)}},{key:"applyRadarPolygonsColors",value:function(){var p=this.w;p.globals.radarPolygons.fill.colors=p.config.plotOptions.radar.polygons.fill.colors===void 0?[p.config.theme.mode==="dark"?"#424242":"none"]:p.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(p.globals.radarPolygons.fill.colors,20)}},{key:"applyMarkersColors",value:function(p){var h=this.w;h.globals.markers.colors=h.config.markers.colors===void 0?p:h.config.markers.colors.slice(),this.pushExtraColors(h.globals.markers.colors)}},{key:"pushExtraColors",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=this.w,k=h||_.globals.series.length;if(S===null&&(S=this.isBarDistributed||this.isHeatmapDistributed||_.config.chart.type==="heatmap"&&_.config.plotOptions.heatmap&&_.config.plotOptions.heatmap.colorScale.inverse),S&&_.globals.series.length&&(k=_.globals.series[_.globals.maxValsInArrayIndex].length*_.globals.series.length),p.length<k)for(var T=k-p.length,B=0;B<T;B++)p.push(p[B])}},{key:"updateThemeOptions",value:function(p){p.chart=p.chart||{},p.tooltip=p.tooltip||{};var h=p.theme.mode,S=h==="dark"?"palette4":h==="light"?"palette1":p.theme.palette||"palette1",_=h==="dark"?"#f6f7f8":h==="light"?"#373d3f":p.chart.foreColor||"#373d3f";return p.tooltip.theme=h||"light",p.chart.foreColor=_,p.theme.palette=S,p}},{key:"predefined",value:function(){var p={palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#FF9800"],palette3:["#33b2df","#546E7A","#d4526e","#13d8aa","#A5978B"],palette4:["#4ecdc4","#c7f464","#81D4FA","#fd6a6a","#546E7A"],palette5:["#2b908f","#f9a3a4","#90ee7e","#fa4443","#69d2e7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"],default:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"]};return p[this.w.config.theme.palette]||p.default}}]),Ee}(),Pt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"draw",value:function(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}},{key:"drawTitleSubtitle",value:function(p){var h=this.w,S=p==="title"?h.config.title:h.config.subtitle,_=h.globals.svgWidth/2,k=S.offsetY,T="middle";if(S.align==="left"?(_=10,T="start"):S.align==="right"&&(_=h.globals.svgWidth-10,T="end"),_+=S.offsetX,k=k+parseInt(S.style.fontSize,10)+S.margin/2,S.text!==void 0){var B=new z(this.ctx).drawText({x:_,y:k,text:S.text,textAnchor:T,fontSize:S.style.fontSize,fontFamily:S.style.fontFamily,fontWeight:S.style.fontWeight,foreColor:S.style.color,opacity:1});B.node.setAttribute("class","apexcharts-".concat(p,"-text")),h.globals.dom.Paper.add(B)}}}]),Ee}(),Xe=function(){function Ee(p){s(this,Ee),this.w=p.w,this.dCtx=p}return o(Ee,[{key:"getTitleSubtitleCoords",value:function(p){var h=this.w,S=0,_=0,k=p==="title"?h.config.title.floating:h.config.subtitle.floating,T=h.globals.dom.baseEl.querySelector(".apexcharts-".concat(p,"-text"));if(T!==null&&!k){var B=T.getBoundingClientRect();S=B.width,_=h.globals.axisCharts?B.height+5:B.height}return{width:S,height:_}}},{key:"getLegendsRect",value:function(){var p=this.w,h=p.globals.dom.elLegendWrap;p.config.legend.height||p.config.legend.position!=="top"&&p.config.legend.position!=="bottom"||(h.style.maxHeight=p.globals.svgHeight/2+"px");var S=Object.assign({},F.getBoundingClientRect(h));return h!==null&&!p.config.legend.floating&&p.config.legend.show?this.dCtx.lgRect={x:S.x,y:S.y,height:S.height,width:S.height===0?0:S.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},p.config.legend.position!=="left"&&p.config.legend.position!=="right"||1.5*this.dCtx.lgRect.width>p.globals.svgWidth&&(this.dCtx.lgRect.width=p.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getDatalabelsRect",value:function(){var p=this,h=this.w,S=[];h.config.series.forEach(function(W,ee){W.data.forEach(function(de,fe){var xe;xe=h.globals.series[ee][fe],_=h.config.dataLabels.formatter(xe,{ctx:p.dCtx.ctx,seriesIndex:ee,dataPointIndex:fe,w:h}),S.push(_)})});var _=F.getLargestStringFromArr(S),k=new z(this.dCtx.ctx),T=h.config.dataLabels.style,B=k.getTextRects(_,parseInt(T.fontSize),T.fontFamily);return{width:1.05*B.width,height:B.height}}},{key:"getLargestStringFromMultiArr",value:function(p,h){var S=p;if(this.w.globals.isMultiLineX){var _=h.map(function(T,B){return Array.isArray(T)?T.length:1}),k=Math.max.apply(Math,N(_));S=h[_.indexOf(k)]}return S}}]),Ee}(),Ut=function(){function Ee(p){s(this,Ee),this.w=p.w,this.dCtx=p}return o(Ee,[{key:"getxAxisLabelsCoords",value:function(){var p,h=this.w,S=h.globals.labels.slice();if(h.config.xaxis.convertedCatToNumeric&&S.length===0&&(S=h.globals.categoryLabels),h.globals.timescaleLabels.length>0){var _=this.getxAxisTimeScaleLabelsCoords();p={width:_.width,height:_.height},h.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends=h.config.legend.position!=="left"&&h.config.legend.position!=="right"||h.config.legend.floating?0:this.dCtx.lgRect.width;var k=h.globals.xLabelFormatter,T=F.getLargestStringFromArr(S),B=this.dCtx.dimHelpers.getLargestStringFromMultiArr(T,S);h.globals.isBarHorizontal&&(B=T=h.globals.yAxisScale[0].result.reduce(function(ke,Me){return ke.length>Me.length?ke:Me},0));var W=new re(this.dCtx.ctx),ee=T;T=W.xLabelFormat(k,T,ee,{i:void 0,dateFormatter:new X(this.dCtx.ctx).formatDate,w:h}),B=W.xLabelFormat(k,B,ee,{i:void 0,dateFormatter:new X(this.dCtx.ctx).formatDate,w:h}),(h.config.xaxis.convertedCatToNumeric&&T===void 0||String(T).trim()==="")&&(B=T="1");var de=new z(this.dCtx.ctx),fe=de.getTextRects(T,h.config.xaxis.labels.style.fontSize),xe=fe;if(T!==B&&(xe=de.getTextRects(B,h.config.xaxis.labels.style.fontSize)),(p={width:fe.width>=xe.width?fe.width:xe.width,height:fe.height>=xe.height?fe.height:xe.height}).width*S.length>h.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&h.config.xaxis.labels.rotate!==0||h.config.xaxis.labels.rotateAlways){if(!h.globals.isBarHorizontal){h.globals.rotateXLabels=!0;var we=function(ke){return de.getTextRects(ke,h.config.xaxis.labels.style.fontSize,h.config.xaxis.labels.style.fontFamily,"rotate(".concat(h.config.xaxis.labels.rotate," 0 0)"),!1)};fe=we(T),T!==B&&(xe=we(B)),p.height=(fe.height>xe.height?fe.height:xe.height)/1.5,p.width=fe.width>xe.width?fe.width:xe.width}}else h.globals.rotateXLabels=!1}return h.config.xaxis.labels.show||(p={width:0,height:0}),{width:p.width,height:p.height}}},{key:"getxAxisGroupLabelsCoords",value:function(){var p,h=this.w;if(!h.globals.hasXaxisGroups)return{width:0,height:0};var S,_=((p=h.config.xaxis.group.style)===null||p===void 0?void 0:p.fontSize)||h.config.xaxis.labels.style.fontSize,k=h.globals.groups.map(function(fe){return fe.title}),T=F.getLargestStringFromArr(k),B=this.dCtx.dimHelpers.getLargestStringFromMultiArr(T,k),W=new z(this.dCtx.ctx),ee=W.getTextRects(T,_),de=ee;return T!==B&&(de=W.getTextRects(B,_)),S={width:ee.width>=de.width?ee.width:de.width,height:ee.height>=de.height?ee.height:de.height},h.config.xaxis.labels.show||(S={width:0,height:0}),{width:S.width,height:S.height}}},{key:"getxAxisTitleCoords",value:function(){var p=this.w,h=0,S=0;if(p.config.xaxis.title.text!==void 0){var _=new z(this.dCtx.ctx).getTextRects(p.config.xaxis.title.text,p.config.xaxis.title.style.fontSize);h=_.width,S=_.height}return{width:h,height:S}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var p,h=this.w;this.dCtx.timescaleLabels=h.globals.timescaleLabels.slice();var S=this.dCtx.timescaleLabels.map(function(k){return k.value}),_=S.reduce(function(k,T){return k===void 0?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):k.length>T.length?k:T},0);return 1.05*(p=new z(this.dCtx.ctx).getTextRects(_,h.config.xaxis.labels.style.fontSize)).width*S.length>h.globals.gridWidth&&h.config.xaxis.labels.rotate!==0&&(h.globals.overlappingXLabels=!0),p}},{key:"additionalPaddingXLabels",value:function(p){var h=this,S=this.w,_=S.globals,k=S.config,T=k.xaxis.type,B=p.width;_.skipLastTimelinelabel=!1,_.skipFirstTimelinelabel=!1;var W=S.config.yaxis[0].opposite&&S.globals.isBarHorizontal,ee=function(de,fe){k.yaxis.length>1&&function(xe){return _.collapsedSeriesIndices.indexOf(xe)!==-1}(fe)||function(xe){if(h.dCtx.timescaleLabels&&h.dCtx.timescaleLabels.length){var we=h.dCtx.timescaleLabels[0],ke=h.dCtx.timescaleLabels[h.dCtx.timescaleLabels.length-1].position+B/1.75-h.dCtx.yAxisWidthRight,Me=we.position-B/1.75+h.dCtx.yAxisWidthLeft,Ye=S.config.legend.position==="right"&&h.dCtx.lgRect.width>0?h.dCtx.lgRect.width:0;ke>_.svgWidth-_.translateX-Ye&&(_.skipLastTimelinelabel=!0),Me<-(xe.show&&!xe.floating||k.chart.type!=="bar"&&k.chart.type!=="candlestick"&&k.chart.type!=="rangeBar"&&k.chart.type!=="boxPlot"?10:B/1.75)&&(_.skipFirstTimelinelabel=!0)}else T==="datetime"?h.dCtx.gridPad.right<B&&!_.rotateXLabels&&(_.skipLastTimelinelabel=!0):T!=="datetime"&&h.dCtx.gridPad.right<B/2-h.dCtx.yAxisWidthRight&&!_.rotateXLabels&&!S.config.xaxis.labels.trim&&(h.dCtx.xPadRight=B/2+1)}(de)};k.yaxis.forEach(function(de,fe){W?(h.dCtx.gridPad.left<B&&(h.dCtx.xPadLeft=B/2+1),h.dCtx.xPadRight=B/2+1):ee(de,fe)})}}]),Ee}(),Lt=function(){function Ee(p){s(this,Ee),this.w=p.w,this.dCtx=p}return o(Ee,[{key:"getyAxisLabelsCoords",value:function(){var p=this,h=this.w,S=[],_=10,k=new pe(this.dCtx.ctx);return h.config.yaxis.map(function(T,B){var W={seriesIndex:B,dataPointIndex:-1,w:h},ee=h.globals.yAxisScale[B],de=0;if(!k.isYAxisHidden(B)&&T.labels.show&&T.labels.minWidth!==void 0&&(de=T.labels.minWidth),!k.isYAxisHidden(B)&&T.labels.show&&ee.result.length){var fe=h.globals.yLabelFormatters[B],xe=ee.niceMin===Number.MIN_VALUE?0:ee.niceMin,we=ee.result.reduce(function(Se,De){var Le,_e;return((Le=String(fe(Se,W)))===null||Le===void 0?void 0:Le.length)>((_e=String(fe(De,W)))===null||_e===void 0?void 0:_e.length)?Se:De},xe),ke=we=fe(we,W);if(we!==void 0&&we.length!==0||(we=ee.niceMax),h.globals.isBarHorizontal){_=0;var Me=h.globals.labels.slice();we=F.getLargestStringFromArr(Me),we=fe(we,{seriesIndex:B,dataPointIndex:-1,w:h}),ke=p.dCtx.dimHelpers.getLargestStringFromMultiArr(we,Me)}var Ye=new z(p.dCtx.ctx),Fe="rotate(".concat(T.labels.rotate," 0 0)"),st=Ye.getTextRects(we,T.labels.style.fontSize,T.labels.style.fontFamily,Fe,!1),se=st;we!==ke&&(se=Ye.getTextRects(ke,T.labels.style.fontSize,T.labels.style.fontFamily,Fe,!1)),S.push({width:(de>se.width||de>st.width?de:se.width>st.width?se.width:st.width)+_,height:se.height>st.height?se.height:st.height})}else S.push({width:0,height:0})}),S}},{key:"getyAxisTitleCoords",value:function(){var p=this,h=this.w,S=[];return h.config.yaxis.map(function(_,k){if(_.show&&_.title.text!==void 0){var T=new z(p.dCtx.ctx),B="rotate(".concat(_.title.rotate," 0 0)"),W=T.getTextRects(_.title.text,_.title.style.fontSize,_.title.style.fontFamily,B,!1);S.push({width:W.width,height:W.height})}else S.push({width:0,height:0})}),S}},{key:"getTotalYAxisWidth",value:function(){var p=this.w,h=0,S=0,_=0,k=p.globals.yAxisScale.length>1?10:0,T=new pe(this.dCtx.ctx),B=function(W,ee){var de=p.config.yaxis[ee].floating,fe=0;W.width>0&&!de?(fe=W.width+k,function(xe){return p.globals.ignoreYAxisIndexes.indexOf(xe)>-1}(ee)&&(fe=fe-W.width-k)):fe=de||T.isYAxisHidden(ee)?0:5,p.config.yaxis[ee].opposite?_+=fe:S+=fe,h+=fe};return p.globals.yLabelsCoords.map(function(W,ee){B(W,ee)}),p.globals.yTitleCoords.map(function(W,ee){B(W,ee)}),p.globals.isBarHorizontal&&!p.config.yaxis[0].floating&&(h=p.globals.yLabelsCoords[0].width+p.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=S,this.dCtx.yAxisWidthRight=_,h}}]),Ee}(),qe=function(){function Ee(p){s(this,Ee),this.w=p.w,this.dCtx=p}return o(Ee,[{key:"gridPadForColumnsInNumericAxis",value:function(p){var h=this.w,S=h.config,_=h.globals;if(_.noData||_.collapsedSeries.length+_.ancillaryCollapsedSeries.length===S.series.length)return 0;var k=function(we){return["bar","rangeBar","candlestick","boxPlot"].includes(we)},T=S.chart.type,B=0,W=k(T)?S.series.length:1;_.comboBarCount>0&&(W=_.comboBarCount),_.collapsedSeries.forEach(function(we){k(we.type)&&(W-=1)}),S.chart.stacked&&(W=1);var ee=k(T)||_.comboBarCount>0,de=Math.abs(_.initialMaxX-_.initialMinX);if(ee&&_.isXNumeric&&!_.isBarHorizontal&&W>0&&de!==0){de<=3&&(de=_.dataPoints);var fe=de/p,xe=_.minXDiff&&_.minXDiff/fe>0?_.minXDiff/fe:0;xe>p/2&&(xe/=2),(B=xe*parseInt(S.plotOptions.bar.columnWidth,10)/100)<1&&(B=1),_.barPadForNumericAxis=B}return B}},{key:"gridPadFortitleSubtitle",value:function(){var p=this,h=this.w,S=h.globals,_=this.dCtx.isSparkline||!S.axisCharts?0:10;["title","subtitle"].forEach(function(B){h.config[B].text!==void 0?_+=h.config[B].margin:_+=p.dCtx.isSparkline||!S.axisCharts?0:5}),!h.config.legend.show||h.config.legend.position!=="bottom"||h.config.legend.floating||S.axisCharts||(_+=10);var k=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),T=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");S.gridHeight-=k.height+T.height+_,S.translateY+=k.height+T.height+_}},{key:"setGridXPosForDualYAxis",value:function(p,h){var S=this.w,_=new pe(this.dCtx.ctx);S.config.yaxis.forEach(function(k,T){S.globals.ignoreYAxisIndexes.indexOf(T)!==-1||k.floating||_.isYAxisHidden(T)||(k.opposite&&(S.globals.translateX-=h[T].width+p[T].width+parseInt(k.labels.style.fontSize,10)/1.2+12),S.globals.translateX<2&&(S.globals.translateX=2))})}}]),Ee}(),Ke=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new Xe(this),this.dimYAxis=new Lt(this),this.dimXAxis=new Ut(this),this.dimGrid=new qe(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}return o(Ee,[{key:"plotCoords",value:function(){var p=this,h=this.w,S=h.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};var _=Array.isArray(h.config.stroke.width)?Math.max.apply(Math,N(h.config.stroke.width)):h.config.stroke.width;this.isSparkline&&((h.config.markers.discrete.length>0||h.config.markers.size>0)&&Object.entries(this.gridPad).forEach(function(T){var B=C(T,2),W=B[0],ee=B[1];p.gridPad[W]=Math.max(ee,p.w.globals.markers.largestSize/1.5)}),this.gridPad.top=Math.max(_/2,this.gridPad.top),this.gridPad.bottom=Math.max(_/2,this.gridPad.bottom)),S.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),S.gridHeight=S.gridHeight-this.gridPad.top-this.gridPad.bottom,S.gridWidth=S.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var k=this.dimGrid.gridPadForColumnsInNumericAxis(S.gridWidth);S.gridWidth=S.gridWidth-2*k,S.translateX=S.translateX+this.gridPad.left+this.xPadLeft+(k>0?k:0),S.translateY=S.translateY+this.gridPad.top}},{key:"setDimensionsForAxisCharts",value:function(){var p=this,h=this.w,S=h.globals,_=this.dimYAxis.getyAxisLabelsCoords(),k=this.dimYAxis.getyAxisTitleCoords();S.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),h.globals.yLabelsCoords=[],h.globals.yTitleCoords=[],h.config.yaxis.map(function(we,ke){h.globals.yLabelsCoords.push({width:_[ke].width,index:ke}),h.globals.yTitleCoords.push({width:k[ke].width,index:ke})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var T=this.dimXAxis.getxAxisLabelsCoords(),B=this.dimXAxis.getxAxisGroupLabelsCoords(),W=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(T,W,B),S.translateXAxisY=h.globals.rotateXLabels?this.xAxisHeight/8:-4,S.translateXAxisX=h.globals.rotateXLabels&&h.globals.isXNumeric&&h.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,h.globals.isBarHorizontal&&(S.rotateXLabels=!1,S.translateXAxisY=parseInt(h.config.xaxis.labels.style.fontSize,10)/1.5*-1),S.translateXAxisY=S.translateXAxisY+h.config.xaxis.labels.offsetY,S.translateXAxisX=S.translateXAxisX+h.config.xaxis.labels.offsetX;var ee=this.yAxisWidth,de=this.xAxisHeight;S.xAxisLabelsHeight=this.xAxisHeight-W.height,S.xAxisGroupLabelsHeight=S.xAxisLabelsHeight-T.height,S.xAxisLabelsWidth=this.xAxisWidth,S.xAxisHeight=this.xAxisHeight;var fe=10;(h.config.chart.type==="radar"||this.isSparkline)&&(ee=0,de=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||h.config.chart.type==="treemap")&&(ee=0,de=0,fe=0),this.isSparkline||h.config.chart.type==="treemap"||this.dimXAxis.additionalPaddingXLabels(T);var xe=function(){S.translateX=ee+p.datalabelsCoords.width,S.gridHeight=S.svgHeight-p.lgRect.height-de-(p.isSparkline||h.config.chart.type==="treemap"?0:h.globals.rotateXLabels?10:15),S.gridWidth=S.svgWidth-ee-2*p.datalabelsCoords.width};switch(h.config.xaxis.position==="top"&&(fe=S.xAxisHeight-h.config.xaxis.axisTicks.height-5),h.config.legend.position){case"bottom":S.translateY=fe,xe();break;case"top":S.translateY=this.lgRect.height+fe,xe();break;case"left":S.translateY=fe,S.translateX=this.lgRect.width+ee+this.datalabelsCoords.width,S.gridHeight=S.svgHeight-de-12,S.gridWidth=S.svgWidth-this.lgRect.width-ee-2*this.datalabelsCoords.width;break;case"right":S.translateY=fe,S.translateX=ee+this.datalabelsCoords.width,S.gridHeight=S.svgHeight-de-12,S.gridWidth=S.svgWidth-this.lgRect.width-ee-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(k,_),new ct(this.ctx).setYAxisXPosition(_,k)}},{key:"setDimensionsForNonAxisCharts",value:function(){var p=this.w,h=p.globals,S=p.config,_=0;p.config.legend.show&&!p.config.legend.floating&&(_=20);var k=S.chart.type==="pie"||S.chart.type==="polarArea"||S.chart.type==="donut"?"pie":"radialBar",T=S.plotOptions[k].offsetY,B=S.plotOptions[k].offsetX;if(!S.legend.show||S.legend.floating){h.gridHeight=h.svgHeight;var W=h.dom.elWrap.getBoundingClientRect().width;return h.gridWidth=Math.min(W,h.gridHeight),h.translateY=T,void(h.translateX=B+(h.svgWidth-h.gridWidth)/2)}switch(S.legend.position){case"bottom":h.gridHeight=h.svgHeight-this.lgRect.height,h.gridWidth=h.svgWidth,h.translateY=T-10,h.translateX=B+(h.svgWidth-h.gridWidth)/2;break;case"top":h.gridHeight=h.svgHeight-this.lgRect.height,h.gridWidth=h.svgWidth,h.translateY=this.lgRect.height+T+10,h.translateX=B+(h.svgWidth-h.gridWidth)/2;break;case"left":h.gridWidth=h.svgWidth-this.lgRect.width-_,h.gridHeight=S.chart.height!=="auto"?h.svgHeight:h.gridWidth,h.translateY=T,h.translateX=B+this.lgRect.width+_;break;case"right":h.gridWidth=h.svgWidth-this.lgRect.width-_-5,h.gridHeight=S.chart.height!=="auto"?h.svgHeight:h.gridWidth,h.translateY=T,h.translateX=B+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(p,h,S){var _=this.w,k=_.globals.hasXaxisGroups?2:1,T=S.height+p.height+h.height,B=_.globals.isMultiLineX?1.2:_.globals.LINE_HEIGHT_RATIO,W=_.globals.rotateXLabels?22:10,ee=_.globals.rotateXLabels&&_.config.legend.position==="bottom"?10:0;this.xAxisHeight=T*B+k*W+ee,this.xAxisWidth=p.width,this.xAxisHeight-h.height>_.config.xaxis.labels.maxHeight&&(this.xAxisHeight=_.config.xaxis.labels.maxHeight),_.config.xaxis.labels.minHeight&&this.xAxisHeight<_.config.xaxis.labels.minHeight&&(this.xAxisHeight=_.config.xaxis.labels.minHeight),_.config.xaxis.floating&&(this.xAxisHeight=0);var de=0,fe=0;_.config.yaxis.forEach(function(xe){de+=xe.labels.minWidth,fe+=xe.labels.maxWidth}),this.yAxisWidth<de&&(this.yAxisWidth=de),this.yAxisWidth>fe&&(this.yAxisWidth=fe)}}]),Ee}(),pt=function(){function Ee(p){s(this,Ee),this.w=p.w,this.lgCtx=p}return o(Ee,[{key:"getLegendStyles",value:function(){var p,h,S,_=document.createElement("style");_.setAttribute("type","text/css");var k=((p=this.lgCtx.ctx)===null||p===void 0||(h=p.opts)===null||h===void 0||(S=h.chart)===null||S===void 0?void 0:S.nonce)||this.w.config.chart.nonce;k&&_.setAttribute("nonce",k);var T=document.createTextNode(`
.apexcharts-flip-y {
transform: scaleY(-1) translateY(-100%);
transform-origin: top;
transform-box: fill-box;
}
.apexcharts-flip-x {
transform: scaleX(-1);
transform-origin: center;
transform-box: fill-box;
}
.apexcharts-legend {
display: flex;
overflow: auto;
padding: 0 10px;
}
.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {
flex-wrap: wrap
}
.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {
flex-direction: column;
bottom: 0;
}
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {
justify-content: flex-start;
}
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {
justify-content: center;
}
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {
justify-content: flex-end;
}
.apexcharts-legend-series {
cursor: pointer;
line-height: normal;
display: flex;
align-items: center;
}
.apexcharts-legend-text {
position: relative;
font-size: 14px;
}
.apexcharts-legend-text *, .apexcharts-legend-marker * {
pointer-events: none;
}
.apexcharts-legend-marker {
position: relative;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
margin-right: 1px;
}
.apexcharts-legend-series.apexcharts-no-click {
cursor: auto;
}
.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {
display: none !important;
}
.apexcharts-inactive-legend {
opacity: 0.45;
}`);return _.appendChild(T),_}},{key:"getLegendDimensions",value:function(){var p=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(),h=p.width;return{clwh:p.height,clww:h}}},{key:"appendToForeignObject",value:function(){this.w.globals.dom.elLegendForeign.appendChild(this.getLegendStyles())}},{key:"toggleDataSeries",value:function(p,h){var S=this,_=this.w;if(_.globals.axisCharts||_.config.chart.type==="radialBar"){_.globals.resized=!0;var k=null,T=null;_.globals.risingSeries=[],_.globals.axisCharts?(k=_.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(p,"']")),T=parseInt(k.getAttribute("data:realIndex"),10)):(k=_.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(p+1,"']")),T=parseInt(k.getAttribute("rel"),10)-1),h?[{cs:_.globals.collapsedSeries,csi:_.globals.collapsedSeriesIndices},{cs:_.globals.ancillaryCollapsedSeries,csi:_.globals.ancillaryCollapsedSeriesIndices}].forEach(function(de){S.riseCollapsedSeries(de.cs,de.csi,T)}):this.hideSeries({seriesEl:k,realIndex:T})}else{var B=_.globals.dom.Paper.select(" .apexcharts-series[rel='".concat(p+1,"'] path")),W=_.config.chart.type;if(W==="pie"||W==="polarArea"||W==="donut"){var ee=_.config.plotOptions.pie.donut.labels;new z(this.lgCtx.ctx).pathMouseDown(B.members[0],null),this.lgCtx.ctx.pie.printDataLabelsInner(B.members[0].node,ee)}B.fire("click")}}},{key:"getSeriesAfterCollapsing",value:function(p){var h=p.realIndex,S=this.w,_=S.globals,k=F.clone(S.config.series);if(_.axisCharts){var T=S.config.yaxis[_.seriesYAxisReverseMap[h]],B={index:h,data:k[h].data.slice(),type:k[h].type||S.config.chart.type};if(T&&T.show&&T.showAlways)_.ancillaryCollapsedSeriesIndices.indexOf(h)<0&&(_.ancillaryCollapsedSeries.push(B),_.ancillaryCollapsedSeriesIndices.push(h));else if(_.collapsedSeriesIndices.indexOf(h)<0){_.collapsedSeries.push(B),_.collapsedSeriesIndices.push(h);var W=_.risingSeries.indexOf(h);_.risingSeries.splice(W,1)}}else _.collapsedSeries.push({index:h,data:k[h]}),_.collapsedSeriesIndices.push(h);return _.allSeriesCollapsed=_.collapsedSeries.length+_.ancillaryCollapsedSeries.length===S.config.series.length,this._getSeriesBasedOnCollapsedState(k)}},{key:"hideSeries",value:function(p){for(var h=p.seriesEl,S=p.realIndex,_=this.w,k=this.getSeriesAfterCollapsing({realIndex:S}),T=h.childNodes,B=0;B<T.length;B++)T[B].classList.contains("apexcharts-series-markers-wrap")&&(T[B].classList.contains("apexcharts-hide")?T[B].classList.remove("apexcharts-hide"):T[B].classList.add("apexcharts-hide"));this.lgCtx.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled)}},{key:"riseCollapsedSeries",value:function(p,h,S){var _=this.w,k=F.clone(_.config.series);if(p.length>0){for(var T=0;T<p.length;T++)p[T].index===S&&(_.globals.axisCharts?k[S].data=p[T].data.slice():k[S]=p[T].data,k[S].hidden=!1,p.splice(T,1),h.splice(T,1),_.globals.risingSeries.push(S));k=this._getSeriesBasedOnCollapsedState(k),this.lgCtx.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled)}}},{key:"_getSeriesBasedOnCollapsedState",value:function(p){var h=this.w,S=0;return h.globals.axisCharts?p.forEach(function(_,k){h.globals.collapsedSeriesIndices.indexOf(k)<0&&h.globals.ancillaryCollapsedSeriesIndices.indexOf(k)<0||(p[k].data=[],S++)}):p.forEach(function(_,k){!h.globals.collapsedSeriesIndices.indexOf(k)<0&&(p[k]=0,S++)}),h.globals.allSeriesCollapsed=S===p.length,p}}]),Ee}(),en=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed=this.w.config.chart.type==="bar"&&this.w.config.plotOptions.bar.distributed&&this.w.config.series.length===1,this.legendHelpers=new pt(this)}return o(Ee,[{key:"init",value:function(){var p=this.w,h=p.globals,S=p.config,_=S.legend.showForSingleSeries&&h.series.length===1||this.isBarsDistributed||h.series.length>1;if(this.legendHelpers.appendToForeignObject(),(_||!h.axisCharts)&&S.legend.show){for(;h.dom.elLegendWrap.firstChild;)h.dom.elLegendWrap.removeChild(h.dom.elLegendWrap.firstChild);this.drawLegends(),S.legend.position==="bottom"||S.legend.position==="top"?this.legendAlignHorizontal():S.legend.position!=="right"&&S.legend.position!=="left"||this.legendAlignVertical()}}},{key:"createLegendMarker",value:function(p){var h=p.i,S=p.fillcolor,_=this.w,k=document.createElement("span");k.classList.add("apexcharts-legend-marker");var T=_.config.legend.markers.shape||_.config.markers.shape,B=T;Array.isArray(T)&&(B=T[h]);var W=Array.isArray(_.config.legend.markers.size)?parseFloat(_.config.legend.markers.size[h]):parseFloat(_.config.legend.markers.size),ee=Array.isArray(_.config.legend.markers.offsetX)?parseFloat(_.config.legend.markers.offsetX[h]):parseFloat(_.config.legend.markers.offsetX),de=Array.isArray(_.config.legend.markers.offsetY)?parseFloat(_.config.legend.markers.offsetY[h]):parseFloat(_.config.legend.markers.offsetY),fe=Array.isArray(_.config.legend.markers.strokeWidth)?parseFloat(_.config.legend.markers.strokeWidth[h]):parseFloat(_.config.legend.markers.strokeWidth),xe=k.style;if(xe.height=2*(W+fe)+"px",xe.width=2*(W+fe)+"px",xe.left=ee+"px",xe.top=de+"px",_.config.legend.markers.customHTML)xe.background="transparent",xe.color=S[h],Array.isArray(_.config.legend.markers.customHTML)?_.config.legend.markers.customHTML[h]&&(k.innerHTML=_.config.legend.markers.customHTML[h]()):k.innerHTML=_.config.legend.markers.customHTML();else{var we=new ye(this.ctx).getMarkerConfig({cssClass:"apexcharts-legend-marker apexcharts-marker apexcharts-marker-".concat(B),seriesIndex:h,strokeWidth:fe,size:W}),ke=SVG(k).size("100%","100%"),Me=new z(this.ctx).drawMarker(0,0,v(v({},we),{},{pointFillColor:Array.isArray(S)?S[h]:we.pointFillColor,shape:B}));SVG.select(".apexcharts-legend-marker.apexcharts-marker").members.forEach(function(Ye){Ye.node.classList.contains("apexcharts-marker-triangle")?Ye.node.style.transform="translate(50%, 45%)":Ye.node.style.transform="translate(50%, 50%)"}),ke.add(Me)}return k}},{key:"drawLegends",value:function(){var p=this,h=this.w,S=h.config.legend.fontFamily,_=h.globals.seriesNames,k=h.config.legend.markers.fillColors?h.config.legend.markers.fillColors.slice():h.globals.colors.slice();if(h.config.chart.type==="heatmap"){var T=h.config.plotOptions.heatmap.colorScale.ranges;_=T.map(function(De){return De.name?De.name:De.from+" - "+De.to}),k=T.map(function(De){return De.color})}else this.isBarsDistributed&&(_=h.globals.labels.slice());h.config.legend.customLegendItems.length&&(_=h.config.legend.customLegendItems);for(var B=h.globals.legendFormatter,W=h.config.legend.inverseOrder,ee=W?_.length-1:0;W?ee>=0:ee<=_.length-1;W?ee--:ee++){var de,fe=B(_[ee],{seriesIndex:ee,w:h}),xe=!1,we=!1;if(h.globals.collapsedSeries.length>0)for(var ke=0;ke<h.globals.collapsedSeries.length;ke++)h.globals.collapsedSeries[ke].index===ee&&(xe=!0);if(h.globals.ancillaryCollapsedSeriesIndices.length>0)for(var Me=0;Me<h.globals.ancillaryCollapsedSeriesIndices.length;Me++)h.globals.ancillaryCollapsedSeriesIndices[Me]===ee&&(we=!0);var Ye=this.createLegendMarker({i:ee,fillcolor:k});z.setAttrs(Ye,{rel:ee+1,"data:collapsed":xe||we}),(xe||we)&&Ye.classList.add("apexcharts-inactive-legend");var Fe=document.createElement("div"),st=document.createElement("span");st.classList.add("apexcharts-legend-text"),st.innerHTML=Array.isArray(fe)?fe.join(" "):fe;var se=h.config.legend.labels.useSeriesColors?h.globals.colors[ee]:Array.isArray(h.config.legend.labels.colors)?(de=h.config.legend.labels.colors)===null||de===void 0?void 0:de[ee]:h.config.legend.labels.colors;se||(se=h.config.chart.foreColor),st.style.color=se,st.style.fontSize=parseFloat(h.config.legend.fontSize)+"px",st.style.fontWeight=h.config.legend.fontWeight,st.style.fontFamily=S||h.config.chart.fontFamily,z.setAttrs(st,{rel:ee+1,i:ee,"data:default-text":encodeURIComponent(fe),"data:collapsed":xe||we}),Fe.appendChild(Ye),Fe.appendChild(st);var Se=new Q(this.ctx);h.config.legend.showForZeroSeries||Se.getSeriesTotalByIndex(ee)===0&&Se.seriesHaveSameValues(ee)&&!Se.isSeriesNull(ee)&&h.globals.collapsedSeriesIndices.indexOf(ee)===-1&&h.globals.ancillaryCollapsedSeriesIndices.indexOf(ee)===-1&&Fe.classList.add("apexcharts-hidden-zero-series"),h.config.legend.showForNullSeries||Se.isSeriesNull(ee)&&h.globals.collapsedSeriesIndices.indexOf(ee)===-1&&h.globals.ancillaryCollapsedSeriesIndices.indexOf(ee)===-1&&Fe.classList.add("apexcharts-hidden-null-series"),h.globals.dom.elLegendWrap.appendChild(Fe),h.globals.dom.elLegendWrap.classList.add("apexcharts-align-".concat(h.config.legend.horizontalAlign)),h.globals.dom.elLegendWrap.classList.add("apx-legend-position-"+h.config.legend.position),Fe.classList.add("apexcharts-legend-series"),Fe.style.margin="".concat(h.config.legend.itemMargin.vertical,"px ").concat(h.config.legend.itemMargin.horizontal,"px"),h.globals.dom.elLegendWrap.style.width=h.config.legend.width?h.config.legend.width+"px":"",h.globals.dom.elLegendWrap.style.height=h.config.legend.height?h.config.legend.height+"px":"",z.setAttrs(Fe,{rel:ee+1,seriesName:F.escapeString(_[ee]),"data:collapsed":xe||we}),(xe||we)&&Fe.classList.add("apexcharts-inactive-legend"),h.config.legend.onItemClick.toggleDataSeries||Fe.classList.add("apexcharts-no-click")}h.globals.dom.elWrap.addEventListener("click",p.onLegendClick,!0),h.config.legend.onItemHover.highlightDataSeries&&h.config.legend.customLegendItems.length===0&&(h.globals.dom.elWrap.addEventListener("mousemove",p.onLegendHovered,!0),h.globals.dom.elWrap.addEventListener("mouseout",p.onLegendHovered,!0))}},{key:"setLegendWrapXY",value:function(p,h){var S=this.w,_=S.globals.dom.elLegendWrap,k=_.clientHeight,T=0,B=0;if(S.config.legend.position==="bottom")B=S.globals.svgHeight-Math.min(k,S.globals.svgHeight/2)-5;else if(S.config.legend.position==="top"){var W=new Ke(this.ctx),ee=W.dimHelpers.getTitleSubtitleCoords("title").height,de=W.dimHelpers.getTitleSubtitleCoords("subtitle").height;B=(ee>0?ee-10:0)+(de>0?de-10:0)}_.style.position="absolute",T=T+p+S.config.legend.offsetX,B=B+h+S.config.legend.offsetY,_.style.left=T+"px",_.style.top=B+"px",S.config.legend.position==="right"&&(_.style.left="auto",_.style.right=25+S.config.legend.offsetX+"px"),["width","height"].forEach(function(fe){_.style[fe]&&(_.style[fe]=parseInt(S.config.legend[fe],10)+"px")})}},{key:"legendAlignHorizontal",value:function(){var p=this.w;p.globals.dom.elLegendWrap.style.right=0;var h=new Ke(this.ctx),S=h.dimHelpers.getTitleSubtitleCoords("title"),_=h.dimHelpers.getTitleSubtitleCoords("subtitle"),k=0;p.config.legend.position==="top"&&(k=S.height+_.height+p.config.title.margin+p.config.subtitle.margin-10),this.setLegendWrapXY(20,k)}},{key:"legendAlignVertical",value:function(){var p=this.w,h=this.legendHelpers.getLegendDimensions(),S=0;p.config.legend.position==="left"&&(S=20),p.config.legend.position==="right"&&(S=p.globals.svgWidth-h.clww-10),this.setLegendWrapXY(S,20)}},{key:"onLegendHovered",value:function(p){var h=this.w,S=p.target.classList.contains("apexcharts-legend-series")||p.target.classList.contains("apexcharts-legend-text")||p.target.classList.contains("apexcharts-legend-marker");if(h.config.chart.type==="heatmap"||this.isBarsDistributed){if(S){var _=parseInt(p.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,_,this.w]),new Re(this.ctx).highlightRangeInSeries(p,p.target)}}else!p.target.classList.contains("apexcharts-inactive-legend")&&S&&new Re(this.ctx).toggleSeriesOnHover(p,p.target)}},{key:"onLegendClick",value:function(p){var h=this.w;if(!h.config.legend.customLegendItems.length&&(p.target.classList.contains("apexcharts-legend-series")||p.target.classList.contains("apexcharts-legend-text")||p.target.classList.contains("apexcharts-legend-marker"))){var S=parseInt(p.target.getAttribute("rel"),10)-1,_=p.target.getAttribute("data:collapsed")==="true",k=this.w.config.chart.events.legendClick;typeof k=="function"&&k(this.ctx,S,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,S,this.w]);var T=this.w.config.legend.markers.onClick;typeof T=="function"&&p.target.classList.contains("apexcharts-legend-marker")&&(T(this.ctx,S,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,S,this.w])),h.config.chart.type!=="treemap"&&h.config.chart.type!=="heatmap"&&!this.isBarsDistributed&&h.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(S,_)}}}]),Ee}(),Bt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w;var h=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=h.globals.minX,this.maxX=h.globals.maxX}return o(Ee,[{key:"createToolbar",value:function(){var p=this,h=this.w,S=function(){return document.createElement("div")},_=S();if(_.setAttribute("class","apexcharts-toolbar"),_.style.top=h.config.chart.toolbar.offsetY+"px",_.style.right=3-h.config.chart.toolbar.offsetX+"px",h.globals.dom.elWrap.appendChild(_),this.elZoom=S(),this.elZoomIn=S(),this.elZoomOut=S(),this.elPan=S(),this.elSelection=S(),this.elZoomReset=S(),this.elMenuIcon=S(),this.elMenu=S(),this.elCustomIcons=[],this.t=h.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var k=0;k<this.t.customIcons.length;k++)this.elCustomIcons.push(S());var T=[],B=function(fe,xe,we){var ke=fe.toLowerCase();p.t[ke]&&h.config.chart.zoom.enabled&&T.push({el:xe,icon:typeof p.t[ke]=="string"?p.t[ke]:we,title:p.localeValues[fe],class:"apexcharts-".concat(ke,"-icon")})};B("zoomIn",this.elZoomIn,`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
</svg>
`),B("zoomOut",this.elZoomOut,`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
</svg>
`);var W=function(fe){p.t[fe]&&h.config.chart[fe].enabled&&T.push({el:fe==="zoom"?p.elZoom:p.elSelection,icon:typeof p.t[fe]=="string"?p.t[fe]:fe==="zoom"?`<svg xmlns="http://www.w3.org/2000/svg" fill="#000000" height="24" viewBox="0 0 24 24" width="24">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
<path d="M0 0h24v24H0V0z" fill="none"/>
<path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>
</svg>`:`<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>
</svg>`,title:p.localeValues[fe==="zoom"?"selectionZoom":"selection"],class:h.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-".concat(fe,"-icon")})};W("zoom"),W("selection"),this.t.pan&&h.config.chart.zoom.enabled&&T.push({el:this.elPan,icon:typeof this.t.pan=="string"?this.t.pan:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">
<defs>
<path d="M0 0h24v24H0z" id="a"/>
</defs>
<clipPath id="b">
<use overflow="visible" xlink:href="#a"/>
</clipPath>
<path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>
</svg>`,title:this.localeValues.pan,class:h.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-pan-icon"}),B("reset",this.elZoomReset,`<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>`),this.t.download&&T.push({el:this.elMenuIcon,icon:typeof this.t.download=="string"?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var ee=0;ee<this.elCustomIcons.length;ee++)T.push({el:this.elCustomIcons[ee],icon:this.t.customIcons[ee].icon,title:this.t.customIcons[ee].title,index:this.t.customIcons[ee].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[ee].class});T.forEach(function(fe,xe){fe.index&&F.moveIndexInArray(T,xe,fe.index)});for(var de=0;de<T.length;de++)z.setAttrs(T[de].el,{class:T[de].class,title:T[de].title}),T[de].el.innerHTML=T[de].icon,_.appendChild(T[de].el);this._createHamburgerMenu(_),h.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):h.globals.panEnabled?this.elPan.classList.add(this.selectedClass):h.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}},{key:"_createHamburgerMenu",value:function(p){this.elMenuItems=[],p.appendChild(this.elMenu),z.setAttrs(this.elMenu,{class:"apexcharts-menu"});for(var h=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}],S=0;S<h.length;S++)this.elMenuItems.push(document.createElement("div")),this.elMenuItems[S].innerHTML=h[S].title,z.setAttrs(this.elMenuItems[S],{class:"apexcharts-menu-item ".concat(h[S].name),title:h[S].title}),this.elMenu.appendChild(this.elMenuItems[S])}},{key:"addToolbarEventListeners",value:function(){var p=this;this.elZoomReset.addEventListener("click",this.handleZoomReset.bind(this)),this.elSelection.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),this.elZoom.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),this.elZoomIn.addEventListener("click",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener("click",this.handleZoomOut.bind(this)),this.elPan.addEventListener("click",this.togglePanning.bind(this)),this.elMenuIcon.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(function(S){S.classList.contains("exportSVG")?S.addEventListener("click",p.handleDownload.bind(p,"svg")):S.classList.contains("exportPNG")?S.addEventListener("click",p.handleDownload.bind(p,"png")):S.classList.contains("exportCSV")&&S.addEventListener("click",p.handleDownload.bind(p,"csv"))});for(var h=0;h<this.t.customIcons.length;h++)this.elCustomIcons[h].addEventListener("click",this.t.customIcons[h].click.bind(this,this.ctx,this.ctx.w))}},{key:"toggleZoomSelection",value:function(p){this.ctx.getSyncedCharts().forEach(function(h){h.ctx.toolbar.toggleOtherControls();var S=p==="selection"?h.ctx.toolbar.elSelection:h.ctx.toolbar.elZoom,_=p==="selection"?"selectionEnabled":"zoomEnabled";h.w.globals[_]=!h.w.globals[_],S.classList.contains(h.ctx.toolbar.selectedClass)?S.classList.remove(h.ctx.toolbar.selectedClass):S.classList.add(h.ctx.toolbar.selectedClass)})}},{key:"getToolbarIconsReference",value:function(){var p=this.w;this.elZoom||(this.elZoom=p.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=p.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=p.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}},{key:"enableZoomPanFromToolbar",value:function(p){this.toggleOtherControls(),p==="pan"?this.w.globals.panEnabled=!0:this.w.globals.zoomEnabled=!0;var h=p==="pan"?this.elPan:this.elZoom,S=p==="pan"?this.elZoom:this.elPan;h&&h.classList.add(this.selectedClass),S&&S.classList.remove(this.selectedClass)}},{key:"togglePanning",value:function(){this.ctx.getSyncedCharts().forEach(function(p){p.ctx.toolbar.toggleOtherControls(),p.w.globals.panEnabled=!p.w.globals.panEnabled,p.ctx.toolbar.elPan.classList.contains(p.ctx.toolbar.selectedClass)?p.ctx.toolbar.elPan.classList.remove(p.ctx.toolbar.selectedClass):p.ctx.toolbar.elPan.classList.add(p.ctx.toolbar.selectedClass)})}},{key:"toggleOtherControls",value:function(){var p=this,h=this.w;h.globals.panEnabled=!1,h.globals.zoomEnabled=!1,h.globals.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach(function(S){S&&S.classList.remove(p.selectedClass)})}},{key:"handleZoomIn",value:function(){var p=this.w;p.globals.isRangeBar&&(this.minX=p.globals.minY,this.maxX=p.globals.maxY);var h=(this.minX+this.maxX)/2,S=(this.minX+h)/2,_=(this.maxX+h)/2,k=this._getNewMinXMaxX(S,_);p.globals.disableZoomIn||this.zoomUpdateOptions(k.minX,k.maxX)}},{key:"handleZoomOut",value:function(){var p=this.w;if(p.globals.isRangeBar&&(this.minX=p.globals.minY,this.maxX=p.globals.maxY),!(p.config.xaxis.type==="datetime"&&new Date(this.minX).getUTCFullYear()<1e3)){var h=(this.minX+this.maxX)/2,S=this.minX-(h-this.minX),_=this.maxX-(h-this.maxX),k=this._getNewMinXMaxX(S,_);p.globals.disableZoomOut||this.zoomUpdateOptions(k.minX,k.maxX)}}},{key:"_getNewMinXMaxX",value:function(p,h){var S=this.w.config.xaxis.convertedCatToNumeric;return{minX:S?Math.floor(p):p,maxX:S?Math.floor(h):h}}},{key:"zoomUpdateOptions",value:function(p,h){var S=this.w;if(p!==void 0||h!==void 0){if(!(S.config.xaxis.convertedCatToNumeric&&(p<1&&(p=1,h=S.globals.dataPoints),h-p<2))){var _={min:p,max:h},k=this.getBeforeZoomRange(_);k&&(_=k.xaxis);var T={xaxis:_},B=F.clone(S.globals.initialConfig.yaxis);S.config.chart.group||(T.yaxis=B),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(T,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(_,B)}}else this.handleZoomReset()}},{key:"zoomCallback",value:function(p,h){typeof this.ev.zoomed=="function"&&this.ev.zoomed(this.ctx,{xaxis:p,yaxis:h})}},{key:"getBeforeZoomRange",value:function(p,h){var S=null;return typeof this.ev.beforeZoom=="function"&&(S=this.ev.beforeZoom(this,{xaxis:p,yaxis:h})),S}},{key:"toggleMenu",value:function(){var p=this;window.setTimeout(function(){p.elMenu.classList.contains("apexcharts-menu-open")?p.elMenu.classList.remove("apexcharts-menu-open"):p.elMenu.classList.add("apexcharts-menu-open")},0)}},{key:"handleDownload",value:function(p){var h=this.w,S=new $e(this.ctx);switch(p){case"svg":S.exportToSVG(this.ctx);break;case"png":S.exportToPng(this.ctx);break;case"csv":S.exportToCSV({series:h.config.series,columnDelimiter:h.config.chart.toolbar.export.csv.columnDelimiter})}}},{key:"handleZoomReset",value:function(p){this.ctx.getSyncedCharts().forEach(function(h){var S=h.w;if(S.globals.lastXAxis.min=S.globals.initialConfig.xaxis.min,S.globals.lastXAxis.max=S.globals.initialConfig.xaxis.max,h.updateHelpers.revertDefaultAxisMinMax(),typeof S.config.chart.events.beforeResetZoom=="function"){var _=S.config.chart.events.beforeResetZoom(h,S);_&&h.updateHelpers.revertDefaultAxisMinMax(_)}typeof S.config.chart.events.zoomed=="function"&&h.ctx.toolbar.zoomCallback({min:S.config.xaxis.min,max:S.config.xaxis.max}),S.globals.zoomed=!1;var k=h.ctx.series.emptyCollapsedSeries(F.clone(S.globals.initialSeries));h.updateHelpers._updateSeries(k,S.config.chart.animations.dynamicAnimation.enabled)})}},{key:"destroy",value:function(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}]),Ee}(),Et=function(Ee){f(h,Bt);var p=c(h);function h(S){var _;return s(this,h),(_=p.call(this,S)).ctx=S,_.w=S.w,_.dragged=!1,_.graphics=new z(_.ctx),_.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],_.clientX=0,_.clientY=0,_.startX=0,_.endX=0,_.dragX=0,_.startY=0,_.endY=0,_.dragY=0,_.moveDirection="none",_.debounceTimer=null,_.debounceDelay=100,_.wheelDelay=400,_}return o(h,[{key:"init",value:function(S){var _=this,k=S.xyRatios,T=this.w,B=this;this.xyRatios=k,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=T.globals.dom.baseEl.querySelector(".apexcharts-grid"),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),T.globals.dom.elGraphical.add(this.zoomRect),T.globals.dom.elGraphical.add(this.selectionRect),T.config.chart.selection.type==="x"?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:T.globals.gridWidth,maxY:T.globals.gridHeight}).on("dragmove",this.selectionDragging.bind(this,"dragging")):T.config.chart.selection.type==="y"?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:T.globals.gridWidth}).on("dragmove",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=T.globals.dom.baseEl.querySelector("".concat(T.globals.chartClass," .apexcharts-svg")),this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(function(W){_.hoverArea.addEventListener(W,B.svgMouseEvents.bind(B,k),{capture:!1,passive:!0})}),T.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",B.mouseWheelEvent.bind(B),{capture:!1,passive:!1})}},{key:"destroy",value:function(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}},{key:"svgMouseEvents",value:function(S,_){var k=this.w,T=this,B=this.ctx.toolbar,W=k.globals.zoomEnabled?k.config.chart.zoom.type:k.config.chart.selection.type,ee=k.config.chart.toolbar.autoSelected;if(_.shiftKey?(this.shiftWasPressed=!0,B.enableZoomPanFromToolbar(ee==="pan"?"zoom":"pan")):this.shiftWasPressed&&(B.enableZoomPanFromToolbar(ee),this.shiftWasPressed=!1),_.target){var de,fe=_.target.classList;if(_.target.parentNode&&_.target.parentNode!==null&&(de=_.target.parentNode.classList),!(fe.contains("apexcharts-selection-rect")||fe.contains("apexcharts-legend-marker")||fe.contains("apexcharts-legend-text")||de&&de.contains("apexcharts-toolbar"))){if(T.clientX=_.type==="touchmove"||_.type==="touchstart"?_.touches[0].clientX:_.type==="touchend"?_.changedTouches[0].clientX:_.clientX,T.clientY=_.type==="touchmove"||_.type==="touchstart"?_.touches[0].clientY:_.type==="touchend"?_.changedTouches[0].clientY:_.clientY,_.type==="mousedown"&&_.which===1){var xe=T.gridRect.getBoundingClientRect();T.startX=T.clientX-xe.left,T.startY=T.clientY-xe.top,T.dragged=!1,T.w.globals.mousedown=!0}if((_.type==="mousemove"&&_.which===1||_.type==="touchmove")&&(T.dragged=!0,k.globals.panEnabled?(k.globals.selection=null,T.w.globals.mousedown&&T.panDragging({context:T,zoomtype:W,xyRatios:S})):(T.w.globals.mousedown&&k.globals.zoomEnabled||T.w.globals.mousedown&&k.globals.selectionEnabled)&&(T.selection=T.selectionDrawing({context:T,zoomtype:W}))),_.type==="mouseup"||_.type==="touchend"||_.type==="mouseleave"){var we,ke=(we=T.gridRect)===null||we===void 0?void 0:we.getBoundingClientRect();ke&&T.w.globals.mousedown&&(T.endX=T.clientX-ke.left,T.endY=T.clientY-ke.top,T.dragX=Math.abs(T.endX-T.startX),T.dragY=Math.abs(T.endY-T.startY),(k.globals.zoomEnabled||k.globals.selectionEnabled)&&T.selectionDrawn({context:T,zoomtype:W}),k.globals.panEnabled&&k.config.xaxis.convertedCatToNumeric&&T.delayedPanScrolled()),k.globals.zoomEnabled&&T.hideSelectionRect(this.selectionRect),T.dragged=!1,T.w.globals.mousedown=!1}this.makeSelectionRectDraggable()}}}},{key:"mouseWheelEvent",value:function(S){var _=this,k=this.w;S.preventDefault();var T=Date.now();T-k.globals.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(S),k.globals.lastWheelExecution=T),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(function(){T-k.globals.lastWheelExecution>_.wheelDelay&&(_.executeMouseWheelZoom(S),k.globals.lastWheelExecution=T)},this.debounceDelay)}},{key:"executeMouseWheelZoom",value:function(S){var _,k=this.w;this.minX=k.globals.isRangeBar?k.globals.minY:k.globals.minX,this.maxX=k.globals.isRangeBar?k.globals.maxY:k.globals.maxX;var T=(_=this.gridRect)===null||_===void 0?void 0:_.getBoundingClientRect();if(T){var B,W,ee,de=(S.clientX-T.left)/T.width,fe=this.minX,xe=this.maxX,we=xe-fe;if(S.deltaY<0){var ke=fe+de*we;W=ke-(B=.5*we)/2,ee=ke+B/2}else W=fe-(B=1.5*we)/2,ee=xe+B/2;if(!k.globals.isRangeBar){W=Math.max(W,k.globals.initialMinX),ee=Math.min(ee,k.globals.initialMaxX);var Me=.01*(k.globals.initialMaxX-k.globals.initialMinX);if(ee-W<Me){var Ye=(W+ee)/2;W=Ye-Me/2,ee=Ye+Me/2}}var Fe=this._getNewMinXMaxX(W,ee);isNaN(Fe.minX)||isNaN(Fe.maxX)||this.zoomUpdateOptions(Fe.minX,Fe.maxX)}}},{key:"makeSelectionRectDraggable",value:function(){var S=this.w;if(this.selectionRect){var _=this.selectionRect.node.getBoundingClientRect();_.width>0&&_.height>0&&this.slDraggableRect.selectize({points:"l, r",pointSize:8,pointType:"rect"}).resize({constraint:{minX:0,minY:0,maxX:S.globals.gridWidth,maxY:S.globals.gridHeight}}).on("resizing",this.selectionDragging.bind(this,"resizing"))}}},{key:"preselectedSelection",value:function(){var S=this.w,_=this.xyRatios;if(!S.globals.zoomEnabled){if(S.globals.selection!==void 0&&S.globals.selection!==null)this.drawSelectionRect(S.globals.selection);else if(S.config.chart.selection.xaxis.min!==void 0&&S.config.chart.selection.xaxis.max!==void 0){var k=(S.config.chart.selection.xaxis.min-S.globals.minX)/_.xRatio,T=S.globals.gridWidth-(S.globals.maxX-S.config.chart.selection.xaxis.max)/_.xRatio-k;S.globals.isRangeBar&&(k=(S.config.chart.selection.xaxis.min-S.globals.yAxisScale[0].niceMin)/_.invertedYRatio,T=(S.config.chart.selection.xaxis.max-S.config.chart.selection.xaxis.min)/_.invertedYRatio);var B={x:k,y:0,width:T,height:S.globals.gridHeight,translateX:0,translateY:0,selectionEnabled:!0};this.drawSelectionRect(B),this.makeSelectionRectDraggable(),typeof S.config.chart.events.selection=="function"&&S.config.chart.events.selection(this.ctx,{xaxis:{min:S.config.chart.selection.xaxis.min,max:S.config.chart.selection.xaxis.max},yaxis:{}})}}}},{key:"drawSelectionRect",value:function(S){var _=S.x,k=S.y,T=S.width,B=S.height,W=S.translateX,ee=W===void 0?0:W,de=S.translateY,fe=de===void 0?0:de,xe=this.w,we=this.zoomRect,ke=this.selectionRect;if(this.dragged||xe.globals.selection!==null){var Me={transform:"translate("+ee+", "+fe+")"};xe.globals.zoomEnabled&&this.dragged&&(T<0&&(T=1),we.attr({x:_,y:k,width:T,height:B,fill:xe.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":xe.config.chart.zoom.zoomedArea.fill.opacity,stroke:xe.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":xe.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":xe.config.chart.zoom.zoomedArea.stroke.opacity}),z.setAttrs(we.node,Me)),xe.globals.selectionEnabled&&(ke.attr({x:_,y:k,width:T>0?T:0,height:B>0?B:0,fill:xe.config.chart.selection.fill.color,"fill-opacity":xe.config.chart.selection.fill.opacity,stroke:xe.config.chart.selection.stroke.color,"stroke-width":xe.config.chart.selection.stroke.width,"stroke-dasharray":xe.config.chart.selection.stroke.dashArray,"stroke-opacity":xe.config.chart.selection.stroke.opacity}),z.setAttrs(ke.node,Me))}}},{key:"hideSelectionRect",value:function(S){S&&S.attr({x:0,y:0,width:0,height:0})}},{key:"selectionDrawing",value:function(S){var _=S.context,k=S.zoomtype,T=this.w,B=_,W=this.gridRect.getBoundingClientRect(),ee=B.startX-1,de=B.startY,fe=!1,xe=!1,we=B.clientX-W.left-ee,ke=B.clientY-W.top-de,Me={};return Math.abs(we+ee)>T.globals.gridWidth?we=T.globals.gridWidth-ee:B.clientX-W.left<0&&(we=ee),ee>B.clientX-W.left&&(fe=!0,we=Math.abs(we)),de>B.clientY-W.top&&(xe=!0,ke=Math.abs(ke)),Me=k==="x"?{x:fe?ee-we:ee,y:0,width:we,height:T.globals.gridHeight}:k==="y"?{x:0,y:xe?de-ke:de,width:T.globals.gridWidth,height:ke}:{x:fe?ee-we:ee,y:xe?de-ke:de,width:we,height:ke},B.drawSelectionRect(Me),B.selectionDragging("resizing"),Me}},{key:"selectionDragging",value:function(S,_){var k=this,T=this.w,B=this.xyRatios,W=this.selectionRect,ee=0;S==="resizing"&&(ee=30);var de=function(xe){return parseFloat(W.node.getAttribute(xe))},fe={x:de("x"),y:de("y"),width:de("width"),height:de("height")};T.globals.selection=fe,typeof T.config.chart.events.selection=="function"&&T.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(function(){var xe,we,ke,Me,Ye=k.gridRect.getBoundingClientRect(),Fe=W.node.getBoundingClientRect();T.globals.isRangeBar?(xe=T.globals.yAxisScale[0].niceMin+(Fe.left-Ye.left)*B.invertedYRatio,we=T.globals.yAxisScale[0].niceMin+(Fe.right-Ye.left)*B.invertedYRatio,ke=0,Me=1):(xe=T.globals.xAxisScale.niceMin+(Fe.left-Ye.left)*B.xRatio,we=T.globals.xAxisScale.niceMin+(Fe.right-Ye.left)*B.xRatio,ke=T.globals.yAxisScale[0].niceMin+(Ye.bottom-Fe.bottom)*B.yRatio[0],Me=T.globals.yAxisScale[0].niceMax-(Fe.top-Ye.top)*B.yRatio[0]);var st={xaxis:{min:xe,max:we},yaxis:{min:ke,max:Me}};T.config.chart.events.selection(k.ctx,st),T.config.chart.brush.enabled&&T.config.chart.events.brushScrolled!==void 0&&T.config.chart.events.brushScrolled(k.ctx,st)},ee))}},{key:"selectionDrawn",value:function(S){var _=S.context,k=S.zoomtype,T=this.w,B=_,W=this.xyRatios,ee=this.ctx.toolbar;if(B.startX>B.endX){var de=B.startX;B.startX=B.endX,B.endX=de}if(B.startY>B.endY){var fe=B.startY;B.startY=B.endY,B.endY=fe}var xe=void 0,we=void 0;T.globals.isRangeBar?(xe=T.globals.yAxisScale[0].niceMin+B.startX*W.invertedYRatio,we=T.globals.yAxisScale[0].niceMin+B.endX*W.invertedYRatio):(xe=T.globals.xAxisScale.niceMin+B.startX*W.xRatio,we=T.globals.xAxisScale.niceMin+B.endX*W.xRatio);var ke=[],Me=[];if(T.config.yaxis.forEach(function(Le,_e){var nt=T.globals.seriesYAxisMap[_e][0];ke.push(T.globals.yAxisScale[_e].niceMax-W.yRatio[nt]*B.startY),Me.push(T.globals.yAxisScale[_e].niceMax-W.yRatio[nt]*B.endY)}),B.dragged&&(B.dragX>10||B.dragY>10)&&xe!==we){if(T.globals.zoomEnabled){var Ye=F.clone(T.globals.initialConfig.yaxis),Fe=F.clone(T.globals.initialConfig.xaxis);if(T.globals.zoomed=!0,T.config.xaxis.convertedCatToNumeric&&(xe=Math.floor(xe),we=Math.floor(we),xe<1&&(xe=1,we=T.globals.dataPoints),we-xe<2&&(we=xe+1)),k!=="xy"&&k!=="x"||(Fe={min:xe,max:we}),k!=="xy"&&k!=="y"||Ye.forEach(function(Le,_e){Ye[_e].min=Me[_e],Ye[_e].max=ke[_e]}),ee){var st=ee.getBeforeZoomRange(Fe,Ye);st&&(Fe=st.xaxis?st.xaxis:Fe,Ye=st.yaxis?st.yaxis:Ye)}var se={xaxis:Fe};T.config.chart.group||(se.yaxis=Ye),B.ctx.updateHelpers._updateOptions(se,!1,B.w.config.chart.animations.dynamicAnimation.enabled),typeof T.config.chart.events.zoomed=="function"&&ee.zoomCallback(Fe,Ye)}else if(T.globals.selectionEnabled){var Se,De=null;Se={min:xe,max:we},k!=="xy"&&k!=="y"||(De=F.clone(T.config.yaxis)).forEach(function(Le,_e){De[_e].min=Me[_e],De[_e].max=ke[_e]}),T.globals.selection=B.selection,typeof T.config.chart.events.selection=="function"&&T.config.chart.events.selection(B.ctx,{xaxis:Se,yaxis:De})}}}},{key:"panDragging",value:function(S){var _=S.context,k=this.w,T=_;if(k.globals.lastClientPosition.x!==void 0){var B=k.globals.lastClientPosition.x-T.clientX,W=k.globals.lastClientPosition.y-T.clientY;Math.abs(B)>Math.abs(W)&&B>0?this.moveDirection="left":Math.abs(B)>Math.abs(W)&&B<0?this.moveDirection="right":Math.abs(W)>Math.abs(B)&&W>0?this.moveDirection="up":Math.abs(W)>Math.abs(B)&&W<0&&(this.moveDirection="down")}k.globals.lastClientPosition={x:T.clientX,y:T.clientY};var ee=k.globals.isRangeBar?k.globals.minY:k.globals.minX,de=k.globals.isRangeBar?k.globals.maxY:k.globals.maxX;k.config.xaxis.convertedCatToNumeric||T.panScrolled(ee,de)}},{key:"delayedPanScrolled",value:function(){var S=this.w,_=S.globals.minX,k=S.globals.maxX,T=(S.globals.maxX-S.globals.minX)/2;this.moveDirection==="left"?(_=S.globals.minX+T,k=S.globals.maxX+T):this.moveDirection==="right"&&(_=S.globals.minX-T,k=S.globals.maxX-T),_=Math.floor(_),k=Math.floor(k),this.updateScrolledChart({xaxis:{min:_,max:k}},_,k)}},{key:"panScrolled",value:function(S,_){var k=this.w,T=this.xyRatios,B=F.clone(k.globals.initialConfig.yaxis),W=T.xRatio,ee=k.globals.minX,de=k.globals.maxX;k.globals.isRangeBar&&(W=T.invertedYRatio,ee=k.globals.minY,de=k.globals.maxY),this.moveDirection==="left"?(S=ee+k.globals.gridWidth/15*W,_=de+k.globals.gridWidth/15*W):this.moveDirection==="right"&&(S=ee-k.globals.gridWidth/15*W,_=de-k.globals.gridWidth/15*W),k.globals.isRangeBar||(S<k.globals.initialMinX||_>k.globals.initialMaxX)&&(S=ee,_=de);var fe={xaxis:{min:S,max:_}};k.config.chart.group||(fe.yaxis=B),this.updateScrolledChart(fe,S,_)}},{key:"updateScrolledChart",value:function(S,_,k){var T=this.w;this.ctx.updateHelpers._updateOptions(S,!1,!1),typeof T.config.chart.events.scrolled=="function"&&T.config.chart.events.scrolled(this.ctx,{xaxis:{min:_,max:k}})}}]),h}(),et=function(){function Ee(p){s(this,Ee),this.w=p.w,this.ttCtx=p,this.ctx=p.ctx}return o(Ee,[{key:"getNearestValues",value:function(p){var h=p.hoverArea,S=p.elGrid,_=p.clientX,k=p.clientY,T=this.w,B=S.getBoundingClientRect(),W=B.width,ee=B.height,de=W/(T.globals.dataPoints-1),fe=ee/T.globals.dataPoints,xe=this.hasBars();!T.globals.comboCharts&&!xe||T.config.xaxis.convertedCatToNumeric||(de=W/T.globals.dataPoints);var we=_-B.left-T.globals.barPadForNumericAxis,ke=k-B.top;we<0||ke<0||we>W||ke>ee?(h.classList.remove("hovering-zoom"),h.classList.remove("hovering-pan")):T.globals.zoomEnabled?(h.classList.remove("hovering-pan"),h.classList.add("hovering-zoom")):T.globals.panEnabled&&(h.classList.remove("hovering-zoom"),h.classList.add("hovering-pan"));var Me=Math.round(we/de),Ye=Math.floor(ke/fe);xe&&!T.config.xaxis.convertedCatToNumeric&&(Me=Math.ceil(we/de),Me-=1);var Fe=null,st=null,se=T.globals.seriesXvalues.map(function(nt){return nt.filter(function(lt){return F.isNumber(lt)})}),Se=T.globals.seriesYvalues.map(function(nt){return nt.filter(function(lt){return F.isNumber(lt)})});if(T.globals.isXNumeric){var De=this.ttCtx.getElGrid().getBoundingClientRect(),Le=we*(De.width/W),_e=ke*(De.height/ee);Fe=(st=this.closestInMultiArray(Le,_e,se,Se)).index,Me=st.j,Fe!==null&&(se=T.globals.seriesXvalues[Fe],Me=(st=this.closestInArray(Le,se)).index)}return T.globals.capturedSeriesIndex=Fe===null?-1:Fe,(!Me||Me<1)&&(Me=0),T.globals.isBarHorizontal?T.globals.capturedDataPointIndex=Ye:T.globals.capturedDataPointIndex=Me,{capturedSeries:Fe,j:T.globals.isBarHorizontal?Ye:Me,hoverX:we,hoverY:ke}}},{key:"closestInMultiArray",value:function(p,h,S,_){var k=this.w,T=0,B=null,W=-1;k.globals.series.length>1?T=this.getFirstActiveXArray(S):B=0;var ee=S[T][0],de=Math.abs(p-ee);if(S.forEach(function(we){we.forEach(function(ke,Me){var Ye=Math.abs(p-ke);Ye<=de&&(de=Ye,W=Me)})}),W!==-1){var fe=_[T][W],xe=Math.abs(h-fe);B=T,_.forEach(function(we,ke){var Me=Math.abs(h-we[W]);Me<=xe&&(xe=Me,B=ke)})}return{index:B,j:W}}},{key:"getFirstActiveXArray",value:function(p){for(var h=this.w,S=0,_=p.map(function(T,B){return T.length>0?B:-1}),k=0;k<_.length;k++)if(_[k]!==-1&&h.globals.collapsedSeriesIndices.indexOf(k)===-1&&h.globals.ancillaryCollapsedSeriesIndices.indexOf(k)===-1){S=_[k];break}return S}},{key:"closestInArray",value:function(p,h){for(var S=h[0],_=null,k=Math.abs(p-S),T=0;T<h.length;T++){var B=Math.abs(p-h[T]);B<k&&(k=B,_=T)}return{index:_}}},{key:"isXoverlap",value:function(p){var h=[],S=this.w.globals.seriesX.filter(function(k){return k[0]!==void 0});if(S.length>0)for(var _=0;_<S.length-1;_++)S[_][p]!==void 0&&S[_+1][p]!==void 0&&S[_][p]!==S[_+1][p]&&h.push("unEqual");return h.length===0}},{key:"isInitialSeriesSameLen",value:function(){for(var p=!0,h=this.w.globals.initialSeries,S=0;S<h.length-1;S++)if(h[S].data.length!==h[S+1].data.length){p=!1;break}return p}},{key:"getBarsHeight",value:function(p){return N(p).reduce(function(h,S){return h+S.getBBox().height},0)}},{key:"getElMarkers",value:function(p){return typeof p=="number"?this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:realIndex='".concat(p,"'] .apexcharts-series-markers-wrap > *")):this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}},{key:"getAllMarkers",value:function(){var p=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");(p=N(p)).sort(function(S,_){var k=Number(S.getAttribute("data:realIndex")),T=Number(_.getAttribute("data:realIndex"));return T<k?1:T>k?-1:0});var h=[];return p.forEach(function(S){h.push(S.querySelector(".apexcharts-marker"))}),h}},{key:"hasMarkers",value:function(p){return this.getElMarkers(p).length>0}},{key:"getPathFromPoint",value:function(p,h){var S=Number(p.getAttribute("cx")),_=Number(p.getAttribute("cy")),k=p.getAttribute("shape");return new z(this.ctx).getMarkerPath(S,_,k,h)}},{key:"getElBars",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-rangebar-series")}},{key:"hasBars",value:function(){return this.getElBars().length>0}},{key:"getHoverMarkerSize",value:function(p){var h=this.w,S=h.config.markers.hover.size;return S===void 0&&(S=h.globals.markers.size[p]+h.config.markers.hover.sizeOffset),S}},{key:"toggleAllTooltipSeriesGroups",value:function(p){var h=this.w,S=this.ttCtx;S.allTooltipSeriesGroups.length===0&&(S.allTooltipSeriesGroups=h.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var _=S.allTooltipSeriesGroups,k=0;k<_.length;k++)p==="enable"?(_[k].classList.add("apexcharts-active"),_[k].style.display=h.config.tooltip.items.display):(_[k].classList.remove("apexcharts-active"),_[k].style.display="none")}}]),Ee}(),Be=function(){function Ee(p){s(this,Ee),this.w=p.w,this.ctx=p.ctx,this.ttCtx=p,this.tooltipUtil=new et(p)}return o(Ee,[{key:"drawSeriesTexts",value:function(p){var h=p.shared,S=h===void 0||h,_=p.ttItems,k=p.i,T=k===void 0?0:k,B=p.j,W=B===void 0?null:B,ee=p.y1,de=p.y2,fe=p.e,xe=this.w;xe.config.tooltip.custom!==void 0?this.handleCustomTooltip({i:T,j:W,y1:ee,y2:de,w:xe}):this.toggleActiveInactiveSeries(S,T);var we=this.getValuesToPrint({i:T,j:W});this.printLabels({i:T,j:W,values:we,ttItems:_,shared:S,e:fe});var ke=this.ttCtx.getElTooltip();this.ttCtx.tooltipRect.ttWidth=ke.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=ke.getBoundingClientRect().height}},{key:"printLabels",value:function(p){var h,S=this,_=p.i,k=p.j,T=p.values,B=p.ttItems,W=p.shared,ee=p.e,de=this.w,fe=[],xe=function(De){return de.globals.seriesGoals[De]&&de.globals.seriesGoals[De][k]&&Array.isArray(de.globals.seriesGoals[De][k])},we=T.xVal,ke=T.zVal,Me=T.xAxisTTVal,Ye="",Fe=de.globals.colors[_];k!==null&&de.config.plotOptions.bar.distributed&&(Fe=de.globals.colors[k]);for(var st=function(De,Le){var _e=S.getFormatters(_);Ye=S.getSeriesName({fn:_e.yLbTitleFormatter,index:_,seriesIndex:_,j:k}),de.config.chart.type==="treemap"&&(Ye=_e.yLbTitleFormatter(String(de.config.series[_].data[k].x),{series:de.globals.series,seriesIndex:_,dataPointIndex:k,w:de}));var nt=de.config.tooltip.inverseOrder?Le:De;if(de.globals.axisCharts){var lt=function(Ge){var Je,We,wt,At;return de.globals.isRangeData?_e.yLbFormatter((Je=de.globals.seriesRangeStart)===null||Je===void 0||(We=Je[Ge])===null||We===void 0?void 0:We[k],{series:de.globals.seriesRangeStart,seriesIndex:Ge,dataPointIndex:k,w:de})+" - "+_e.yLbFormatter((wt=de.globals.seriesRangeEnd)===null||wt===void 0||(At=wt[Ge])===null||At===void 0?void 0:At[k],{series:de.globals.seriesRangeEnd,seriesIndex:Ge,dataPointIndex:k,w:de}):_e.yLbFormatter(de.globals.series[Ge][k],{series:de.globals.series,seriesIndex:Ge,dataPointIndex:k,w:de})};if(W)_e=S.getFormatters(nt),Ye=S.getSeriesName({fn:_e.yLbTitleFormatter,index:nt,seriesIndex:_,j:k}),Fe=de.globals.colors[nt],h=lt(nt),xe(nt)&&(fe=de.globals.seriesGoals[nt][k].map(function(Ge){return{attrs:Ge,val:_e.yLbFormatter(Ge.value,{seriesIndex:nt,dataPointIndex:k,w:de})}}));else{var bt,Zt=ee==null||(bt=ee.target)===null||bt===void 0?void 0:bt.getAttribute("fill");Zt&&(Zt.indexOf("url")!==-1?Zt.indexOf("Pattern")!==-1&&(Fe=de.globals.dom.baseEl.querySelector(Zt.substr(4).slice(0,-1)).childNodes[0].getAttribute("stroke")):Fe=Zt),h=lt(_),xe(_)&&Array.isArray(de.globals.seriesGoals[_][k])&&(fe=de.globals.seriesGoals[_][k].map(function(Ge){return{attrs:Ge,val:_e.yLbFormatter(Ge.value,{seriesIndex:_,dataPointIndex:k,w:de})}}))}}k===null&&(h=_e.yLbFormatter(de.globals.series[_],v(v({},de),{},{seriesIndex:_,dataPointIndex:_}))),S.DOMHandling({i:_,t:nt,j:k,ttItems:B,values:{val:h,goalVals:fe,xVal:we,xAxisTTVal:Me,zVal:ke},seriesName:Ye,shared:W,pColor:Fe})},se=0,Se=de.globals.series.length-1;se<de.globals.series.length;se++,Se--)st(se,Se)}},{key:"getFormatters",value:function(p){var h,S=this.w,_=S.globals.yLabelFormatters[p];return S.globals.ttVal!==void 0?Array.isArray(S.globals.ttVal)?(_=S.globals.ttVal[p]&&S.globals.ttVal[p].formatter,h=S.globals.ttVal[p]&&S.globals.ttVal[p].title&&S.globals.ttVal[p].title.formatter):(_=S.globals.ttVal.formatter,typeof S.globals.ttVal.title.formatter=="function"&&(h=S.globals.ttVal.title.formatter)):h=S.config.tooltip.y.title.formatter,typeof _!="function"&&(_=S.globals.yLabelFormatters[0]?S.globals.yLabelFormatters[0]:function(k){return k}),typeof h!="function"&&(h=function(k){return k}),{yLbFormatter:_,yLbTitleFormatter:h}}},{key:"getSeriesName",value:function(p){var h=p.fn,S=p.index,_=p.seriesIndex,k=p.j,T=this.w;return h(String(T.globals.seriesNames[S]),{series:T.globals.series,seriesIndex:_,dataPointIndex:k,w:T})}},{key:"DOMHandling",value:function(p){p.i;var h=p.t,S=p.j,_=p.ttItems,k=p.values,T=p.seriesName,B=p.shared,W=p.pColor,ee=this.w,de=this.ttCtx,fe=k.val,xe=k.goalVals,we=k.xVal,ke=k.xAxisTTVal,Me=k.zVal,Ye=null;Ye=_[h].children,ee.config.tooltip.fillSeriesColor&&(_[h].style.backgroundColor=W,Ye[0].style.display="none"),de.showTooltipTitle&&(de.tooltipTitle===null&&(de.tooltipTitle=ee.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),de.tooltipTitle.innerHTML=we),de.isXAxisTooltipEnabled&&(de.xaxisTooltipText.innerHTML=ke!==""?ke:we);var Fe=_[h].querySelector(".apexcharts-tooltip-text-y-label");Fe&&(Fe.innerHTML=T||"");var st=_[h].querySelector(".apexcharts-tooltip-text-y-value");st&&(st.innerHTML=fe!==void 0?fe:""),Ye[0]&&Ye[0].classList.contains("apexcharts-tooltip-marker")&&(ee.config.tooltip.marker.fillColors&&Array.isArray(ee.config.tooltip.marker.fillColors)&&(W=ee.config.tooltip.marker.fillColors[h]),Ye[0].style.backgroundColor=W),ee.config.tooltip.marker.show||(Ye[0].style.display="none");var se=_[h].querySelector(".apexcharts-tooltip-text-goals-label"),Se=_[h].querySelector(".apexcharts-tooltip-text-goals-value");if(xe.length&&ee.globals.seriesGoals[h]){var De=function(){var nt="<div >",lt="<div>";xe.forEach(function(bt,Zt){nt+=' <div style="display: flex"><span class="apexcharts-tooltip-marker" style="background-color: '.concat(bt.attrs.strokeColor,'; height: 3px; border-radius: 0; top: 5px;"></span> ').concat(bt.attrs.name,"</div>"),lt+="<div>".concat(bt.val,"</div>")}),se.innerHTML=nt+"</div>",Se.innerHTML=lt+"</div>"};B?ee.globals.seriesGoals[h][S]&&Array.isArray(ee.globals.seriesGoals[h][S])?De():(se.innerHTML="",Se.innerHTML=""):De()}else se.innerHTML="",Se.innerHTML="";if(Me!==null&&(_[h].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=ee.config.tooltip.z.title,_[h].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=Me!==void 0?Me:""),B&&Ye[0]){if(ee.config.tooltip.hideEmptySeries){var Le=_[h].querySelector(".apexcharts-tooltip-marker"),_e=_[h].querySelector(".apexcharts-tooltip-text");parseFloat(fe)==0?(Le.style.display="none",_e.style.display="none"):(Le.style.display="block",_e.style.display="block")}fe==null||ee.globals.ancillaryCollapsedSeriesIndices.indexOf(h)>-1||ee.globals.collapsedSeriesIndices.indexOf(h)>-1||Array.isArray(de.tConfig.enabledOnSeries)&&de.tConfig.enabledOnSeries.indexOf(h)===-1?Ye[0].parentNode.style.display="none":Ye[0].parentNode.style.display=ee.config.tooltip.items.display}else Array.isArray(de.tConfig.enabledOnSeries)&&de.tConfig.enabledOnSeries.indexOf(h)===-1&&(Ye[0].parentNode.style.display="none")}},{key:"toggleActiveInactiveSeries",value:function(p,h){var S=this.w;if(p)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");var _=S.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group-".concat(h));_&&(_.classList.add("apexcharts-active"),_.style.display=S.config.tooltip.items.display)}}},{key:"getValuesToPrint",value:function(p){var h=p.i,S=p.j,_=this.w,k=this.ctx.series.filteredSeriesX(),T="",B="",W=null,ee=null,de={series:_.globals.series,seriesIndex:h,dataPointIndex:S,w:_},fe=_.globals.ttZFormatter;S===null?ee=_.globals.series[h]:_.globals.isXNumeric&&_.config.chart.type!=="treemap"?(T=k[h][S],k[h].length===0&&(T=k[this.tooltipUtil.getFirstActiveXArray(k)][S])):T=new Qe(this.ctx).isFormatXY()?_.config.series[h].data[S]!==void 0?_.config.series[h].data[S].x:"":_.globals.labels[S]!==void 0?_.globals.labels[S]:"";var xe=T;return _.globals.isXNumeric&&_.config.xaxis.type==="datetime"?T=new re(this.ctx).xLabelFormat(_.globals.ttKeyFormatter,xe,xe,{i:void 0,dateFormatter:new X(this.ctx).formatDate,w:this.w}):T=_.globals.isBarHorizontal?_.globals.yLabelFormatters[0](xe,de):_.globals.xLabelFormatter(xe,de),_.config.tooltip.x.formatter!==void 0&&(T=_.globals.ttKeyFormatter(xe,de)),_.globals.seriesZ.length>0&&_.globals.seriesZ[h].length>0&&(W=fe(_.globals.seriesZ[h][S],_)),B=typeof _.config.xaxis.tooltip.formatter=="function"?_.globals.xaxisTooltipFormatter(xe,de):T,{val:Array.isArray(ee)?ee.join(" "):ee,xVal:Array.isArray(T)?T.join(" "):T,xAxisTTVal:Array.isArray(B)?B.join(" "):B,zVal:W}}},{key:"handleCustomTooltip",value:function(p){var h=p.i,S=p.j,_=p.y1,k=p.y2,T=p.w,B=this.ttCtx.getElTooltip(),W=T.config.tooltip.custom;Array.isArray(W)&&W[h]&&(W=W[h]),B.innerHTML=W({ctx:this.ctx,series:T.globals.series,seriesIndex:h,dataPointIndex:S,y1:_,y2:k,w:T})}}]),Ee}(),Mt=function(){function Ee(p){s(this,Ee),this.ttCtx=p,this.ctx=p.ctx,this.w=p.w}return o(Ee,[{key:"moveXCrosshairs",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,S=this.ttCtx,_=this.w,k=S.getElXCrosshairs(),T=p-S.xcrosshairsWidth/2,B=_.globals.labels.slice().length;if(h!==null&&(T=_.globals.gridWidth/B*h),k===null||_.globals.isBarHorizontal||(k.setAttribute("x",T),k.setAttribute("x1",T),k.setAttribute("x2",T),k.setAttribute("y2",_.globals.gridHeight),k.classList.add("apexcharts-active")),T<0&&(T=0),T>_.globals.gridWidth&&(T=_.globals.gridWidth),S.isXAxisTooltipEnabled){var W=T;_.config.xaxis.crosshairs.width!=="tickWidth"&&_.config.xaxis.crosshairs.width!=="barWidth"||(W=T+S.xcrosshairsWidth/2),this.moveXAxisTooltip(W)}}},{key:"moveYCrosshairs",value:function(p){var h=this.ttCtx;h.ycrosshairs!==null&&z.setAttrs(h.ycrosshairs,{y1:p,y2:p}),h.ycrosshairsHidden!==null&&z.setAttrs(h.ycrosshairsHidden,{y1:p,y2:p})}},{key:"moveXAxisTooltip",value:function(p){var h=this.w,S=this.ttCtx;if(S.xaxisTooltip!==null&&S.xcrosshairsWidth!==0){S.xaxisTooltip.classList.add("apexcharts-active");var _=S.xaxisOffY+h.config.xaxis.tooltip.offsetY+h.globals.translateY+1+h.config.xaxis.offsetY;if(p-=S.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(p)){p+=h.globals.translateX;var k;k=new z(this.ctx).getTextRects(S.xaxisTooltipText.innerHTML),S.xaxisTooltipText.style.minWidth=k.width+"px",S.xaxisTooltip.style.left=p+"px",S.xaxisTooltip.style.top=_+"px"}}}},{key:"moveYAxisTooltip",value:function(p){var h=this.w,S=this.ttCtx;S.yaxisTTEls===null&&(S.yaxisTTEls=h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var _=parseInt(S.ycrosshairsHidden.getAttribute("y1"),10),k=h.globals.translateY+_,T=S.yaxisTTEls[p].getBoundingClientRect().height,B=h.globals.translateYAxisX[p]-2;h.config.yaxis[p].opposite&&(B-=26),k-=T/2,h.globals.ignoreYAxisIndexes.indexOf(p)===-1?(S.yaxisTTEls[p].classList.add("apexcharts-active"),S.yaxisTTEls[p].style.top=k+"px",S.yaxisTTEls[p].style.left=B+h.config.yaxis[p].tooltip.offsetX+"px"):S.yaxisTTEls[p].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=this.w,k=this.ttCtx,T=k.getElTooltip(),B=k.tooltipRect,W=S!==null?parseFloat(S):1,ee=parseFloat(p)+W+5,de=parseFloat(h)+W/2;if(ee>_.globals.gridWidth/2&&(ee=ee-B.ttWidth-W-10),ee>_.globals.gridWidth-B.ttWidth-10&&(ee=_.globals.gridWidth-B.ttWidth),ee<-20&&(ee=-20),_.config.tooltip.followCursor){var fe=k.getElGrid().getBoundingClientRect();(ee=k.e.clientX-fe.left)>_.globals.gridWidth/2&&(ee-=k.tooltipRect.ttWidth),(de=k.e.clientY+_.globals.translateY-fe.top)>_.globals.gridHeight/2&&(de-=k.tooltipRect.ttHeight)}else _.globals.isBarHorizontal||B.ttHeight/2+de>_.globals.gridHeight&&(de=_.globals.gridHeight-B.ttHeight+_.globals.translateY);isNaN(ee)||(ee+=_.globals.translateX,T.style.left=ee+"px",T.style.top=de+"px")}},{key:"moveMarkers",value:function(p,h){var S=this.w,_=this.ttCtx;if(S.globals.markers.size[p]>0)for(var k=S.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(p,"'] .apexcharts-marker")),T=0;T<k.length;T++)parseInt(k[T].getAttribute("rel"),10)===h&&(_.marker.resetPointsSize(),_.marker.enlargeCurrentPoint(h,k[T]));else _.marker.resetPointsSize(),this.moveDynamicPointOnHover(h,p)}},{key:"moveDynamicPointOnHover",value:function(p,h){var S,_,k,T,B=this.w,W=this.ttCtx,ee=new z(this.ctx),de=B.globals.pointsArray,fe=W.tooltipUtil.getHoverMarkerSize(h),xe=B.config.series[h].type;if(!xe||xe!=="column"&&xe!=="candlestick"&&xe!=="boxPlot"){k=(S=de[h][p])===null||S===void 0?void 0:S[0],T=((_=de[h][p])===null||_===void 0?void 0:_[1])||0;var we=B.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(h,"'] .apexcharts-series-markers path"));if(we&&T<B.globals.gridHeight&&T>0){var ke=we.getAttribute("shape"),Me=ee.getMarkerPath(k,T,ke,1.5*fe);we.setAttribute("d",Me)}this.moveXCrosshairs(k),W.fixedTooltip||this.moveTooltip(k,T,fe)}}},{key:"moveDynamicPointsOnHover",value:function(p){var h,S=this.ttCtx,_=S.w,k=0,T=0,B=_.globals.pointsArray,W=new Re(this.ctx),ee=new z(this.ctx);h=W.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);var de=S.tooltipUtil.getHoverMarkerSize(h);B[h]&&(k=B[h][p][0],T=B[h][p][1]);var fe=S.tooltipUtil.getAllMarkers();if(fe!==null)for(var xe=0;xe<_.globals.series.length;xe++){var we=B[xe];if(_.globals.comboCharts&&we===void 0&&fe.splice(xe,0,null),we&&we.length){var ke=B[xe][p][1],Me=void 0;fe[xe].setAttribute("cx",k);var Ye=fe[xe].getAttribute("shape");if(_.config.chart.type==="rangeArea"&&!_.globals.comboCharts){var Fe=p+_.globals.series[xe].length;Me=B[xe][Fe][1],ke-=Math.abs(ke-Me)/2}if(ke!==null&&!isNaN(ke)&&ke<_.globals.gridHeight+de&&ke+de>0){var st=ee.getMarkerPath(k,ke,Ye,de);fe[xe].setAttribute("d",st)}else fe[xe].setAttribute("d","")}}this.moveXCrosshairs(k),S.fixedTooltip||this.moveTooltip(k,T||_.globals.gridHeight,de)}},{key:"moveStickyTooltipOverBars",value:function(p,h){var S=this.w,_=this.ttCtx,k=S.globals.columnSeries?S.globals.columnSeries.length:S.globals.series.length,T=k>=2&&k%2==0?Math.floor(k/2):Math.floor(k/2)+1;S.globals.isBarHorizontal&&(T=new Re(this.ctx).getActiveConfigSeriesIndex("desc")+1);var B=S.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(T,"'] path[j='").concat(p,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(p,"'], .apexcharts-boxPlot-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(p,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(p,"']"));B||typeof h!="number"||(B=S.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[data\\:realIndex='".concat(h,"'] path[j='").concat(p,`'],
.apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='`).concat(h,"'] path[j='").concat(p,`'],
.apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='`).concat(h,"'] path[j='").concat(p,`'],
.apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='`).concat(h,"'] path[j='").concat(p,"']")));var W=B?parseFloat(B.getAttribute("cx")):0,ee=B?parseFloat(B.getAttribute("cy")):0,de=B?parseFloat(B.getAttribute("barWidth")):0,fe=_.getElGrid().getBoundingClientRect(),xe=B&&(B.classList.contains("apexcharts-candlestick-area")||B.classList.contains("apexcharts-boxPlot-area"));S.globals.isXNumeric?(B&&!xe&&(W-=k%2!=0?de/2:0),B&&xe&&S.globals.comboCharts&&(W-=de/2)):S.globals.isBarHorizontal||(W=_.xAxisTicksPositions[p-1]+_.dataPointsDividedWidth/2,isNaN(W)&&(W=_.xAxisTicksPositions[p]-_.dataPointsDividedWidth/2)),S.globals.isBarHorizontal?ee-=_.tooltipRect.ttHeight:S.config.tooltip.followCursor?ee=_.e.clientY-fe.top-_.tooltipRect.ttHeight/2:ee+_.tooltipRect.ttHeight+15>S.globals.gridHeight&&(ee=S.globals.gridHeight),S.globals.isBarHorizontal||this.moveXCrosshairs(W),_.fixedTooltip||this.moveTooltip(W,ee||S.globals.gridHeight)}}]),Ee}(),Ve=function(){function Ee(p){s(this,Ee),this.w=p.w,this.ttCtx=p,this.ctx=p.ctx,this.tooltipPosition=new Mt(p)}return o(Ee,[{key:"drawDynamicPoints",value:function(){var p=this.w,h=new z(this.ctx),S=new ye(this.ctx),_=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series");_=N(_),p.config.chart.stacked&&_.sort(function(fe,xe){return parseFloat(fe.getAttribute("data:realIndex"))-parseFloat(xe.getAttribute("data:realIndex"))});for(var k=0;k<_.length;k++){var T=_[k].querySelector(".apexcharts-series-markers-wrap");if(T!==null){var B=void 0,W="apexcharts-marker w".concat((Math.random()+1).toString(36).substring(4));p.config.chart.type!=="line"&&p.config.chart.type!=="area"||p.globals.comboCharts||p.config.tooltip.intersect||(W+=" no-pointer-events");var ee=S.getMarkerConfig({cssClass:W,seriesIndex:Number(T.getAttribute("data:realIndex"))});(B=h.drawMarker(0,0,ee)).node.setAttribute("default-marker-size",0);var de=document.createElementNS(p.globals.SVGNS,"g");de.classList.add("apexcharts-series-markers"),de.appendChild(B.node),T.appendChild(de)}}}},{key:"enlargeCurrentPoint",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,k=this.w;k.config.chart.type!=="bubble"&&this.newPointSize(p,h);var T=h.getAttribute("cx"),B=h.getAttribute("cy");if(S!==null&&_!==null&&(T=S,B=_),this.tooltipPosition.moveXCrosshairs(T),!this.fixedTooltip){if(k.config.chart.type==="radar"){var W=this.ttCtx.getElGrid().getBoundingClientRect();T=this.ttCtx.e.clientX-W.left}this.tooltipPosition.moveTooltip(T,B,k.config.markers.hover.size)}}},{key:"enlargePoints",value:function(p){for(var h=this.w,S=this,_=this.ttCtx,k=p,T=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),B=h.config.markers.hover.size,W=0;W<T.length;W++){var ee=T[W].getAttribute("rel"),de=T[W].getAttribute("index");if(B===void 0&&(B=h.globals.markers.size[de]+h.config.markers.hover.sizeOffset),k===parseInt(ee,10)){S.newPointSize(k,T[W]);var fe=T[W].getAttribute("cx"),xe=T[W].getAttribute("cy");S.tooltipPosition.moveXCrosshairs(fe),_.fixedTooltip||S.tooltipPosition.moveTooltip(fe,xe,B)}else S.oldPointSize(T[W])}}},{key:"newPointSize",value:function(p,h){var S=this.w,_=S.config.markers.hover.size,k=p===0?h.parentNode.firstChild:h.parentNode.lastChild;if(k.getAttribute("default-marker-size")!=="0"){var T=parseInt(k.getAttribute("index"),10);_===void 0&&(_=S.globals.markers.size[T]+S.config.markers.hover.sizeOffset),_<0&&(_=0);var B=this.ttCtx.tooltipUtil.getPathFromPoint(h,_);h.setAttribute("d",B)}}},{key:"oldPointSize",value:function(p){var h=parseFloat(p.getAttribute("default-marker-size")),S=this.ttCtx.tooltipUtil.getPathFromPoint(p,h);p.setAttribute("d",S)}},{key:"resetPointsSize",value:function(){for(var p=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),h=0;h<p.length;h++){var S=parseFloat(p[h].getAttribute("default-marker-size"));if(F.isNumber(S)&&S>=0){var _=this.ttCtx.tooltipUtil.getPathFromPoint(p[h],S);p[h].setAttribute("d",_)}else p[h].setAttribute("d","M0,0")}}}]),Ee}(),ut=function(){function Ee(p){s(this,Ee),this.w=p.w;var h=this.w;this.ttCtx=p,this.isVerticalGroupedRangeBar=!h.globals.isBarHorizontal&&h.config.chart.type==="rangeBar"&&h.config.plotOptions.bar.rangeBarGroupRows}return o(Ee,[{key:"getAttr",value:function(p,h){return parseFloat(p.target.getAttribute(h))}},{key:"handleHeatTreeTooltip",value:function(p){var h=p.e,S=p.opt,_=p.x,k=p.y,T=p.type,B=this.ttCtx,W=this.w;if(h.target.classList.contains("apexcharts-".concat(T,"-rect"))){var ee=this.getAttr(h,"i"),de=this.getAttr(h,"j"),fe=this.getAttr(h,"cx"),xe=this.getAttr(h,"cy"),we=this.getAttr(h,"width"),ke=this.getAttr(h,"height");if(B.tooltipLabels.drawSeriesTexts({ttItems:S.ttItems,i:ee,j:de,shared:!1,e:h}),W.globals.capturedSeriesIndex=ee,W.globals.capturedDataPointIndex=de,_=fe+B.tooltipRect.ttWidth/2+we,k=xe+B.tooltipRect.ttHeight/2-ke/2,B.tooltipPosition.moveXCrosshairs(fe+we/2),_>W.globals.gridWidth/2&&(_=fe-B.tooltipRect.ttWidth/2+we),B.w.config.tooltip.followCursor){var Me=W.globals.dom.elWrap.getBoundingClientRect();_=W.globals.clientX-Me.left-(_>W.globals.gridWidth/2?B.tooltipRect.ttWidth:0),k=W.globals.clientY-Me.top-(k>W.globals.gridHeight/2?B.tooltipRect.ttHeight:0)}}return{x:_,y:k}}},{key:"handleMarkerTooltip",value:function(p){var h,S,_=p.e,k=p.opt,T=p.x,B=p.y,W=this.w,ee=this.ttCtx;if(_.target.classList.contains("apexcharts-marker")){var de=parseInt(k.paths.getAttribute("cx"),10),fe=parseInt(k.paths.getAttribute("cy"),10),xe=parseFloat(k.paths.getAttribute("val"));if(S=parseInt(k.paths.getAttribute("rel"),10),h=parseInt(k.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,ee.intersect){var we=F.findAncestor(k.paths,"apexcharts-series");we&&(h=parseInt(we.getAttribute("data:realIndex"),10))}if(ee.tooltipLabels.drawSeriesTexts({ttItems:k.ttItems,i:h,j:S,shared:!ee.showOnIntersect&&W.config.tooltip.shared,e:_}),_.type==="mouseup"&&ee.markerClick(_,h,S),W.globals.capturedSeriesIndex=h,W.globals.capturedDataPointIndex=S,T=de,B=fe+W.globals.translateY-1.4*ee.tooltipRect.ttHeight,ee.w.config.tooltip.followCursor){var ke=ee.getElGrid().getBoundingClientRect();B=ee.e.clientY+W.globals.translateY-ke.top}xe<0&&(B=fe),ee.marker.enlargeCurrentPoint(S,k.paths,T,B)}return{x:T,y:B}}},{key:"handleBarTooltip",value:function(p){var h,S,_=p.e,k=p.opt,T=this.w,B=this.ttCtx,W=B.getElTooltip(),ee=0,de=0,fe=0,xe=this.getBarTooltipXY({e:_,opt:k});h=xe.i;var we=xe.j;T.globals.capturedSeriesIndex=h,T.globals.capturedDataPointIndex=we,T.globals.isBarHorizontal&&B.tooltipUtil.hasBars()||!T.config.tooltip.shared?(de=xe.x,fe=xe.y,S=Array.isArray(T.config.stroke.width)?T.config.stroke.width[h]:T.config.stroke.width,ee=de):T.globals.comboCharts||T.config.tooltip.shared||(ee/=2),isNaN(fe)&&(fe=T.globals.svgHeight-B.tooltipRect.ttHeight);var ke=parseInt(k.paths.parentNode.getAttribute("data:realIndex"),10);if(T.globals.isMultipleYAxis?T.config.yaxis[ke]&&T.config.yaxis[ke].reversed:T.config.yaxis[0].reversed,de+B.tooltipRect.ttWidth>T.globals.gridWidth?de-=B.tooltipRect.ttWidth:de<0&&(de=0),B.w.config.tooltip.followCursor){var Me=B.getElGrid().getBoundingClientRect();fe=B.e.clientY-Me.top}B.tooltip===null&&(B.tooltip=T.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),T.config.tooltip.shared||(T.globals.comboBarCount>0?B.tooltipPosition.moveXCrosshairs(ee+S/2):B.tooltipPosition.moveXCrosshairs(ee)),!B.fixedTooltip&&(!T.config.tooltip.shared||T.globals.isBarHorizontal&&B.tooltipUtil.hasBars())&&(fe=fe+T.globals.translateY-B.tooltipRect.ttHeight/2,W.style.left=de+T.globals.translateX+"px",W.style.top=fe+"px")}},{key:"getBarTooltipXY",value:function(p){var h=this,S=p.e,_=p.opt,k=this.w,T=null,B=this.ttCtx,W=0,ee=0,de=0,fe=0,xe=0,we=S.target.classList;if(we.contains("apexcharts-bar-area")||we.contains("apexcharts-candlestick-area")||we.contains("apexcharts-boxPlot-area")||we.contains("apexcharts-rangebar-area")){var ke=S.target,Me=ke.getBoundingClientRect(),Ye=_.elGrid.getBoundingClientRect(),Fe=Me.height;xe=Me.height;var st=Me.width,se=parseInt(ke.getAttribute("cx"),10),Se=parseInt(ke.getAttribute("cy"),10);fe=parseFloat(ke.getAttribute("barWidth"));var De=S.type==="touchmove"?S.touches[0].clientX:S.clientX;T=parseInt(ke.getAttribute("j"),10),W=parseInt(ke.parentNode.getAttribute("rel"),10)-1;var Le=ke.getAttribute("data-range-y1"),_e=ke.getAttribute("data-range-y2");k.globals.comboCharts&&(W=parseInt(ke.parentNode.getAttribute("data:realIndex"),10));var nt=function(bt){return k.globals.isXNumeric?se-st/2:h.isVerticalGroupedRangeBar?se+st/2:se-B.dataPointsDividedWidth+st/2},lt=function(){return Se-B.dataPointsDividedHeight+Fe/2-B.tooltipRect.ttHeight/2};B.tooltipLabels.drawSeriesTexts({ttItems:_.ttItems,i:W,j:T,y1:Le?parseInt(Le,10):null,y2:_e?parseInt(_e,10):null,shared:!B.showOnIntersect&&k.config.tooltip.shared,e:S}),k.config.tooltip.followCursor?k.globals.isBarHorizontal?(ee=De-Ye.left+15,de=lt()):(ee=nt(),de=S.clientY-Ye.top-B.tooltipRect.ttHeight/2-15):k.globals.isBarHorizontal?((ee=se)<B.xyRatios.baseLineInvertedY&&(ee=se-B.tooltipRect.ttWidth),de=lt()):(ee=nt(),de=Se)}return{x:ee,y:de,barHeight:xe,barWidth:fe,i:W,j:T}}}]),Ee}(),xt=function(){function Ee(p){s(this,Ee),this.w=p.w,this.ttCtx=p}return o(Ee,[{key:"drawXaxisTooltip",value:function(){var p=this.w,h=this.ttCtx,S=p.config.xaxis.position==="bottom";h.xaxisOffY=S?p.globals.gridHeight+1:-p.globals.xAxisHeight-p.config.xaxis.axisTicks.height+3;var _=S?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",k=p.globals.dom.elWrap;h.isXAxisTooltipEnabled&&p.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")===null&&(h.xaxisTooltip=document.createElement("div"),h.xaxisTooltip.setAttribute("class",_+" apexcharts-theme-"+p.config.tooltip.theme),k.appendChild(h.xaxisTooltip),h.xaxisTooltipText=document.createElement("div"),h.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),h.xaxisTooltipText.style.fontFamily=p.config.xaxis.tooltip.style.fontFamily||p.config.chart.fontFamily,h.xaxisTooltipText.style.fontSize=p.config.xaxis.tooltip.style.fontSize,h.xaxisTooltip.appendChild(h.xaxisTooltipText))}},{key:"drawYaxisTooltip",value:function(){for(var p=this.w,h=this.ttCtx,S=0;S<p.config.yaxis.length;S++){var _=p.config.yaxis[S].opposite||p.config.yaxis[S].crosshairs.opposite;h.yaxisOffX=_?p.globals.gridWidth+1:1;var k="apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(S,_?" apexcharts-yaxistooltip-right":" apexcharts-yaxistooltip-left"),T=p.globals.dom.elWrap;p.globals.dom.baseEl.querySelector(".apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(S))===null&&(h.yaxisTooltip=document.createElement("div"),h.yaxisTooltip.setAttribute("class",k+" apexcharts-theme-"+p.config.tooltip.theme),T.appendChild(h.yaxisTooltip),S===0&&(h.yaxisTooltipText=[]),h.yaxisTooltipText[S]=document.createElement("div"),h.yaxisTooltipText[S].classList.add("apexcharts-yaxistooltip-text"),h.yaxisTooltip.appendChild(h.yaxisTooltipText[S]))}}},{key:"setXCrosshairWidth",value:function(){var p=this.w,h=this.ttCtx,S=h.getElXCrosshairs();if(h.xcrosshairsWidth=parseInt(p.config.xaxis.crosshairs.width,10),p.globals.comboCharts){var _=p.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(_!==null&&p.config.xaxis.crosshairs.width==="barWidth"){var k=parseFloat(_.getAttribute("barWidth"));h.xcrosshairsWidth=k}else if(p.config.xaxis.crosshairs.width==="tickWidth"){var T=p.globals.labels.length;h.xcrosshairsWidth=p.globals.gridWidth/T}}else if(p.config.xaxis.crosshairs.width==="tickWidth"){var B=p.globals.labels.length;h.xcrosshairsWidth=p.globals.gridWidth/B}else if(p.config.xaxis.crosshairs.width==="barWidth"){var W=p.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(W!==null){var ee=parseFloat(W.getAttribute("barWidth"));h.xcrosshairsWidth=ee}else h.xcrosshairsWidth=1}p.globals.isBarHorizontal&&(h.xcrosshairsWidth=0),S!==null&&h.xcrosshairsWidth>0&&S.setAttribute("width",h.xcrosshairsWidth)}},{key:"handleYCrosshair",value:function(){var p=this.w,h=this.ttCtx;h.ycrosshairs=p.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),h.ycrosshairsHidden=p.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}},{key:"drawYaxisTooltipText",value:function(p,h,S){var _=this.ttCtx,k=this.w,T=k.globals,B=T.seriesYAxisMap[p];if(_.yaxisTooltips[p]&&B.length>0){var W=T.yLabelFormatters[p],ee=_.getElGrid().getBoundingClientRect(),de=B[0],fe=0;S.yRatio.length>1&&(fe=de);var xe=(h-ee.top)*S.yRatio[fe],we=T.maxYArr[de]-T.minYArr[de],ke=T.minYArr[de]+(we-xe);k.config.yaxis[p].reversed&&(ke=T.maxYArr[de]-(we-xe)),_.tooltipPosition.moveYCrosshairs(h-ee.top),_.yaxisTooltipText[p].innerHTML=W(ke),_.tooltipPosition.moveYAxisTooltip(p)}}}]),Ee}(),jt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w;var h=this.w;this.tConfig=h.config.tooltip,this.tooltipUtil=new et(this),this.tooltipLabels=new Be(this),this.tooltipPosition=new Mt(this),this.marker=new Ve(this),this.intersect=new ut(this),this.axesTooltip=new xt(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!h.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now()}return o(Ee,[{key:"getElTooltip",value:function(p){return p||(p=this),p.w.globals.dom.baseEl?p.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip"):null}},{key:"getElXCrosshairs",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}},{key:"getElGrid",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}},{key:"drawTooltip",value:function(p){var h=this.w;this.xyRatios=p,this.isXAxisTooltipEnabled=h.config.xaxis.tooltip.enabled&&h.globals.axisCharts,this.yaxisTooltips=h.config.yaxis.map(function(T,B){return!!(T.show&&T.tooltip.enabled&&h.globals.axisCharts)}),this.allTooltipSeriesGroups=[],h.globals.axisCharts||(this.showTooltipTitle=!1);var S=document.createElement("div");if(S.classList.add("apexcharts-tooltip"),h.config.tooltip.cssClass&&S.classList.add(h.config.tooltip.cssClass),S.classList.add("apexcharts-theme-".concat(this.tConfig.theme)),h.globals.dom.elWrap.appendChild(S),h.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var _=new it(this.ctx);this.xAxisTicksPositions=_.getXAxisTicksPositions()}if(!h.globals.comboCharts&&!this.tConfig.intersect&&h.config.chart.type!=="rangeBar"||this.tConfig.shared||(this.showOnIntersect=!0),h.config.markers.size!==0&&h.globals.markers.largestSize!==0||this.marker.drawDynamicPoints(this),h.globals.collapsedSeries.length!==h.globals.series.length){this.dataPointsDividedHeight=h.globals.gridHeight/h.globals.dataPoints,this.dataPointsDividedWidth=h.globals.gridWidth/h.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||h.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,S.appendChild(this.tooltipTitle));var k=h.globals.series.length;(h.globals.xyCharts||h.globals.comboCharts)&&this.tConfig.shared&&(k=this.showOnIntersect?1:h.globals.series.length),this.legendLabels=h.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(k),this.addSVGEvents()}}},{key:"createTTElements",value:function(p){for(var h=this,S=this.w,_=[],k=this.getElTooltip(),T=function(W){var ee=document.createElement("div");ee.classList.add("apexcharts-tooltip-series-group","apexcharts-tooltip-series-group-".concat(W)),ee.style.order=S.config.tooltip.inverseOrder?p-W:W+1;var de=document.createElement("span");de.classList.add("apexcharts-tooltip-marker"),de.style.backgroundColor=S.globals.colors[W],ee.appendChild(de);var fe=document.createElement("div");fe.classList.add("apexcharts-tooltip-text"),fe.style.fontFamily=h.tConfig.style.fontFamily||S.config.chart.fontFamily,fe.style.fontSize=h.tConfig.style.fontSize,["y","goals","z"].forEach(function(xe){var we=document.createElement("div");we.classList.add("apexcharts-tooltip-".concat(xe,"-group"));var ke=document.createElement("span");ke.classList.add("apexcharts-tooltip-text-".concat(xe,"-label")),we.appendChild(ke);var Me=document.createElement("span");Me.classList.add("apexcharts-tooltip-text-".concat(xe,"-value")),we.appendChild(Me),fe.appendChild(we)}),ee.appendChild(fe),k.appendChild(ee),_.push(ee)},B=0;B<p;B++)T(B);return _}},{key:"addSVGEvents",value:function(){var p=this.w,h=p.config.chart.type,S=this.getElTooltip(),_=!(h!=="bar"&&h!=="candlestick"&&h!=="boxPlot"&&h!=="rangeBar"),k=h==="area"||h==="line"||h==="scatter"||h==="bubble"||h==="radar",T=p.globals.dom.Paper.node,B=this.getElGrid();B&&(this.seriesBound=B.getBoundingClientRect());var W,ee=[],de=[],fe={hoverArea:T,elGrid:B,tooltipEl:S,tooltipY:ee,tooltipX:de,ttItems:this.ttItems};if(p.globals.axisCharts&&(k?W=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):_?W=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area"):h!=="heatmap"&&h!=="treemap"||(W=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),W&&W.length))for(var xe=0;xe<W.length;xe++)ee.push(W[xe].getAttribute("cy")),de.push(W[xe].getAttribute("cx"));if(p.globals.xyCharts&&!this.showOnIntersect||p.globals.comboCharts&&!this.showOnIntersect||_&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([T],fe);else if(_&&!p.globals.comboCharts||k&&this.showOnIntersect)this.addDatapointEventsListeners(fe);else if(!p.globals.axisCharts||h==="heatmap"||h==="treemap"){var we=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(we,fe)}if(this.showOnIntersect){var ke=p.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");ke.length>0&&this.addPathsEventListeners(ke,fe),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(fe)}}},{key:"drawFixedTooltipRect",value:function(){var p=this.w,h=this.getElTooltip(),S=h.getBoundingClientRect(),_=S.width+10,k=S.height+10,T=this.tConfig.fixed.offsetX,B=this.tConfig.fixed.offsetY,W=this.tConfig.fixed.position.toLowerCase();return W.indexOf("right")>-1&&(T=T+p.globals.svgWidth-_+10),W.indexOf("bottom")>-1&&(B=B+p.globals.svgHeight-k-10),h.style.left=T+"px",h.style.top=B+"px",{x:T,y:B,ttWidth:_,ttHeight:k}}},{key:"addDatapointEventsListeners",value:function(p){var h=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(h,p)}},{key:"addPathsEventListeners",value:function(p,h){for(var S=this,_=function(T){var B={paths:p[T],tooltipEl:h.tooltipEl,tooltipY:h.tooltipY,tooltipX:h.tooltipX,elGrid:h.elGrid,hoverArea:h.hoverArea,ttItems:h.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map(function(W){return p[T].addEventListener(W,S.onSeriesHover.bind(S,B),{capture:!1,passive:!0})})},k=0;k<p.length;k++)_(k)}},{key:"onSeriesHover",value:function(p,h){var S=this,_=Date.now()-this.lastHoverTime;_>=100?this.seriesHover(p,h):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(function(){S.seriesHover(p,h)},100-_))}},{key:"seriesHover",value:function(p,h){var S=this;this.lastHoverTime=Date.now();var _=[],k=this.w;k.config.chart.group&&(_=this.ctx.getGroupedCharts()),k.globals.axisCharts&&(k.globals.minX===-1/0&&k.globals.maxX===1/0||k.globals.dataPoints===0)||(_.length?_.forEach(function(T){var B=S.getElTooltip(T),W={paths:p.paths,tooltipEl:B,tooltipY:p.tooltipY,tooltipX:p.tooltipX,elGrid:p.elGrid,hoverArea:p.hoverArea,ttItems:T.w.globals.tooltip.ttItems};T.w.globals.minX===S.w.globals.minX&&T.w.globals.maxX===S.w.globals.maxX&&T.w.globals.tooltip.seriesHoverByContext({chartCtx:T,ttCtx:T.w.globals.tooltip,opt:W,e:h})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:p,e:h}))}},{key:"seriesHoverByContext",value:function(p){var h=p.chartCtx,S=p.ttCtx,_=p.opt,k=p.e,T=h.w,B=this.getElTooltip(h);B&&(S.tooltipRect={x:0,y:0,ttWidth:B.getBoundingClientRect().width,ttHeight:B.getBoundingClientRect().height},S.e=k,S.tooltipUtil.hasBars()&&!T.globals.comboCharts&&!S.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries&&new Re(h).toggleSeriesOnHover(k,k.target.parentNode),S.fixedTooltip&&S.drawFixedTooltipRect(),T.globals.axisCharts?S.axisChartsTooltips({e:k,opt:_,tooltipRect:S.tooltipRect}):S.nonAxisChartsTooltips({e:k,opt:_,tooltipRect:S.tooltipRect}))}},{key:"axisChartsTooltips",value:function(p){var h,S,_=p.e,k=p.opt,T=this.w,B=k.elGrid.getBoundingClientRect(),W=_.type==="touchmove"?_.touches[0].clientX:_.clientX,ee=_.type==="touchmove"?_.touches[0].clientY:_.clientY;if(this.clientY=ee,this.clientX=W,T.globals.capturedSeriesIndex=-1,T.globals.capturedDataPointIndex=-1,ee<B.top||ee>B.top+B.height)this.handleMouseOut(k);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!T.config.tooltip.shared){var de=parseInt(k.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(de)<0)return void this.handleMouseOut(k)}var fe=this.getElTooltip(),xe=this.getElXCrosshairs(),we=[];T.config.chart.group&&(we=this.ctx.getSyncedCharts());var ke=T.globals.xyCharts||T.config.chart.type==="bar"&&!T.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||T.globals.comboCharts&&this.tooltipUtil.hasBars();if(_.type==="mousemove"||_.type==="touchmove"||_.type==="mouseup"){if(T.globals.collapsedSeries.length+T.globals.ancillaryCollapsedSeries.length===T.globals.series.length)return;xe!==null&&xe.classList.add("apexcharts-active");var Me=this.yaxisTooltips.filter(function(st){return st===!0});if(this.ycrosshairs!==null&&Me.length&&this.ycrosshairs.classList.add("apexcharts-active"),ke&&!this.showOnIntersect||we.length>1)this.handleStickyTooltip(_,W,ee,k);else if(T.config.chart.type==="heatmap"||T.config.chart.type==="treemap"){var Ye=this.intersect.handleHeatTreeTooltip({e:_,opt:k,x:h,y:S,type:T.config.chart.type});h=Ye.x,S=Ye.y,fe.style.left=h+"px",fe.style.top=S+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:_,opt:k}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:_,opt:k,x:h,y:S});if(this.yaxisTooltips.length)for(var Fe=0;Fe<T.config.yaxis.length;Fe++)this.axesTooltip.drawYaxisTooltipText(Fe,ee,this.xyRatios);T.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),k.tooltipEl.classList.add("apexcharts-active")}else _.type!=="mouseout"&&_.type!=="touchend"||this.handleMouseOut(k)}}},{key:"nonAxisChartsTooltips",value:function(p){var h=p.e,S=p.opt,_=p.tooltipRect,k=this.w,T=S.paths.getAttribute("rel"),B=this.getElTooltip(),W=k.globals.dom.elWrap.getBoundingClientRect();if(h.type==="mousemove"||h.type==="touchmove"){k.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),B.classList.add("apexcharts-active"),this.tooltipLabels.drawSeriesTexts({ttItems:S.ttItems,i:parseInt(T,10)-1,shared:!1});var ee=k.globals.clientX-W.left-_.ttWidth/2,de=k.globals.clientY-W.top-_.ttHeight-10;if(B.style.left=ee+"px",B.style.top=de+"px",k.config.legend.tooltipHoverFormatter){var fe=T-1,xe=(0,k.config.legend.tooltipHoverFormatter)(this.legendLabels[fe].getAttribute("data:default-text"),{seriesIndex:fe,dataPointIndex:fe,w:k});this.legendLabels[fe].innerHTML=xe}}else h.type!=="mouseout"&&h.type!=="touchend"||(B.classList.remove("apexcharts-active"),k.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),k.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(we){var ke=we.getAttribute("data:default-text");we.innerHTML=decodeURIComponent(ke)}))}},{key:"handleStickyTooltip",value:function(p,h,S,_){var k=this.w,T=this.tooltipUtil.getNearestValues({context:this,hoverArea:_.hoverArea,elGrid:_.elGrid,clientX:h,clientY:S}),B=T.j,W=T.capturedSeries;k.globals.collapsedSeriesIndices.includes(W)&&(W=null);var ee=_.elGrid.getBoundingClientRect();if(T.hoverX<0||T.hoverX>ee.width)this.handleMouseOut(_);else if(W!==null)this.handleStickyCapturedSeries(p,W,_,B);else if(this.tooltipUtil.isXoverlap(B)||k.globals.isBarHorizontal){var de=k.globals.series.findIndex(function(fe,xe){return!k.globals.collapsedSeriesIndices.includes(xe)});this.create(p,this,de,B,_.ttItems)}}},{key:"handleStickyCapturedSeries",value:function(p,h,S,_){var k=this.w;if(!this.tConfig.shared&&k.globals.series[h][_]===null)return void this.handleMouseOut(S);if(k.globals.series[h][_]!==void 0)this.tConfig.shared&&this.tooltipUtil.isXoverlap(_)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(p,this,h,_,S.ttItems):this.create(p,this,h,_,S.ttItems,!1);else if(this.tooltipUtil.isXoverlap(_)){var T=k.globals.series.findIndex(function(B,W){return!k.globals.collapsedSeriesIndices.includes(W)});this.create(p,this,T,_,S.ttItems)}}},{key:"deactivateHoverFilter",value:function(){for(var p=this.w,h=new z(this.ctx),S=p.globals.dom.Paper.select(".apexcharts-bar-area"),_=0;_<S.length;_++)h.pathMouseLeave(S[_])}},{key:"handleMouseOut",value:function(p){var h=this.w,S=this.getElXCrosshairs();if(h.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),p.tooltipEl.classList.remove("apexcharts-active"),this.deactivateHoverFilter(),h.config.chart.type!=="bubble"&&this.marker.resetPointsSize(),S!==null&&S.classList.remove("apexcharts-active"),this.ycrosshairs!==null&&this.ycrosshairs.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&this.xaxisTooltip.classList.remove("apexcharts-active"),this.yaxisTooltips.length){this.yaxisTTEls===null&&(this.yaxisTTEls=h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(var _=0;_<this.yaxisTTEls.length;_++)this.yaxisTTEls[_].classList.remove("apexcharts-active")}h.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(k){var T=k.getAttribute("data:default-text");k.innerHTML=decodeURIComponent(T)})}},{key:"markerClick",value:function(p,h,S){var _=this.w;typeof _.config.chart.events.markerClick=="function"&&_.config.chart.events.markerClick(p,this.ctx,{seriesIndex:h,dataPointIndex:S,w:_}),this.ctx.events.fireEvent("markerClick",[p,this.ctx,{seriesIndex:h,dataPointIndex:S,w:_}])}},{key:"create",value:function(p,h,S,_,k){var T,B,W,ee,de,fe,xe,we,ke,Me,Ye,Fe,st,se,Se,De,Le=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,_e=this.w,nt=h;p.type==="mouseup"&&this.markerClick(p,S,_),Le===null&&(Le=this.tConfig.shared);var lt=this.tooltipUtil.hasMarkers(S),bt=this.tooltipUtil.getElBars();if(_e.config.legend.tooltipHoverFormatter){var Zt=_e.config.legend.tooltipHoverFormatter,Ge=Array.from(this.legendLabels);Ge.forEach(function(mt){var qt=mt.getAttribute("data:default-text");mt.innerHTML=decodeURIComponent(qt)});for(var Je=0;Je<Ge.length;Je++){var We=Ge[Je],wt=parseInt(We.getAttribute("i"),10),At=decodeURIComponent(We.getAttribute("data:default-text")),Gt=Zt(At,{seriesIndex:Le?wt:S,dataPointIndex:_,w:_e});if(Le)We.innerHTML=_e.globals.collapsedSeriesIndices.indexOf(wt)<0?Gt:At;else if(We.innerHTML=wt===S?Gt:At,S===wt)break}}var fn=v(v({ttItems:k,i:S,j:_},((T=_e.globals.seriesRange)===null||T===void 0||(B=T[S])===null||B===void 0||(W=B[_])===null||W===void 0||(ee=W.y[0])===null||ee===void 0?void 0:ee.y1)!==void 0&&{y1:(de=_e.globals.seriesRange)===null||de===void 0||(fe=de[S])===null||fe===void 0||(xe=fe[_])===null||xe===void 0||(we=xe.y[0])===null||we===void 0?void 0:we.y1}),((ke=_e.globals.seriesRange)===null||ke===void 0||(Me=ke[S])===null||Me===void 0||(Ye=Me[_])===null||Ye===void 0||(Fe=Ye.y[0])===null||Fe===void 0?void 0:Fe.y2)!==void 0&&{y2:(st=_e.globals.seriesRange)===null||st===void 0||(se=st[S])===null||se===void 0||(Se=se[_])===null||Se===void 0||(De=Se.y[0])===null||De===void 0?void 0:De.y2});if(Le){if(nt.tooltipLabels.drawSeriesTexts(v(v({},fn),{},{shared:!this.showOnIntersect&&this.tConfig.shared})),lt)_e.globals.markers.largestSize>0?nt.marker.enlargePoints(_):nt.tooltipPosition.moveDynamicPointsOnHover(_);else if(this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(bt),this.barSeriesHeight>0)){var Rn=new z(this.ctx),An=_e.globals.dom.Paper.select(".apexcharts-bar-area[j='".concat(_,"']"));this.deactivateHoverFilter(),this.tooltipPosition.moveStickyTooltipOverBars(_,S);for(var pr=0;pr<An.length;pr++)Rn.pathMouseEnter(An[pr])}}else nt.tooltipLabels.drawSeriesTexts(v({shared:!1},fn)),this.tooltipUtil.hasBars()&&nt.tooltipPosition.moveStickyTooltipOverBars(_,S),lt&&nt.tooltipPosition.moveMarkers(S,_)}}]),Ee}(),kt=function(){function Ee(p){s(this,Ee),this.w=p.w,this.barCtx=p,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}return o(Ee,[{key:"handleBarDataLabels",value:function(p){var h,S,_=p.x,k=p.y,T=p.y1,B=p.y2,W=p.i,ee=p.j,de=p.realIndex,fe=p.columnGroupIndex,xe=p.series,we=p.barHeight,ke=p.barWidth,Me=p.barXPosition,Ye=p.barYPosition,Fe=p.visibleSeries,st=p.renderedPath,se=this.w,Se=new z(this.barCtx.ctx),De=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[de]:this.barCtx.strokeWidth;se.globals.isXNumeric&&!se.globals.isBarHorizontal?(h=_+parseFloat(ke*(Fe+1)),S=k+parseFloat(we*(Fe+1))-De):(h=_+parseFloat(ke*Fe),S=k+parseFloat(we*Fe));var Le,_e=null,nt=_,lt=k,bt={},Zt=se.config.dataLabels,Ge=this.barCtx.barOptions.dataLabels,Je=this.barCtx.barOptions.dataLabels.total;Ye!==void 0&&this.barCtx.isRangeBar&&(S=Ye,lt=Ye),Me!==void 0&&this.barCtx.isVerticalGroupedRangeBar&&(h=Me,nt=Me);var We=Zt.offsetX,wt=Zt.offsetY,At={width:0,height:0};if(se.config.dataLabels.enabled){var Gt=se.globals.series[W][ee];At=Se.getTextRects(se.config.dataLabels.formatter?se.config.dataLabels.formatter(Gt,v(v({},se),{},{seriesIndex:W,dataPointIndex:ee,w:se})):se.globals.yLabelFormatters[0](Gt),parseFloat(Zt.style.fontSize))}var fn={x:_,y:k,i:W,j:ee,realIndex:de,columnGroupIndex:fe,renderedPath:st,bcx:h,bcy:S,barHeight:we,barWidth:ke,textRects:At,strokeWidth:De,dataLabelsX:nt,dataLabelsY:lt,dataLabelsConfig:Zt,barDataLabelsConfig:Ge,barTotalDataLabelsConfig:Je,offX:We,offY:wt};return bt=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(fn):this.calculateColumnsDataLabelsPosition(fn),st.attr({cy:bt.bcy,cx:bt.bcx,j:ee,val:se.globals.series[W][ee],barHeight:we,barWidth:ke}),Le=this.drawCalculatedDataLabels({x:bt.dataLabelsX,y:bt.dataLabelsY,val:this.barCtx.isRangeBar?[T,B]:se.config.chart.stackType==="100%"?xe[de][ee]:se.globals.series[de][ee],i:de,j:ee,barWidth:ke,barHeight:we,textRects:At,dataLabelsConfig:Zt}),se.config.chart.stacked&&Je.enabled&&(_e=this.drawTotalDataLabels({x:bt.totalDataLabelsX,y:bt.totalDataLabelsY,barWidth:ke,barHeight:we,realIndex:de,textAnchor:bt.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:de,j:ee}),dataLabelsConfig:Zt,barTotalDataLabelsConfig:Je})),{dataLabels:Le,totalDataLabels:_e}}},{key:"getStackedTotalDataLabel",value:function(p){var h=p.realIndex,S=p.j,_=this.w,k=this.barCtx.stackedSeriesTotals[S];return this.totalFormatter&&(k=this.totalFormatter(k,v(v({},_),{},{seriesIndex:h,dataPointIndex:S,w:_}))),k}},{key:"calculateColumnsDataLabelsPosition",value:function(p){var h=this.w,S=p.i,_=p.j,k=p.realIndex;p.columnGroupIndex;var T,B,W=p.y,ee=p.bcx,de=p.barWidth,fe=p.barHeight,xe=p.textRects,we=p.dataLabelsX,ke=p.dataLabelsY,Me=p.dataLabelsConfig,Ye=p.barDataLabelsConfig,Fe=p.barTotalDataLabelsConfig,st=p.strokeWidth,se=p.offX,Se=p.offY,De=ee;fe=Math.abs(fe);var Le=h.config.plotOptions.bar.dataLabels.orientation==="vertical",_e=this.barCtx.barHelpers.getZeroValueEncounters({i:S,j:_}).zeroEncounters;ee-=st/2;var nt=h.globals.gridWidth/h.globals.dataPoints;this.barCtx.isVerticalGroupedRangeBar?we+=de/2:(we=h.globals.isXNumeric?ee-de/2+se:ee-nt+de/2+se,_e>0&&h.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(we-=de*_e)),Le&&(we=we+xe.height/2-st/2-2);var lt=h.globals.series[S][_]<0,bt=W;switch(this.barCtx.isReversed&&(bt=W+(lt?fe:-fe)),Ye.position){case"center":ke=Le?lt?bt-fe/2+Se:bt+fe/2-Se:lt?bt-fe/2+xe.height/2+Se:bt+fe/2+xe.height/2-Se;break;case"bottom":ke=Le?lt?bt-fe+Se:bt+fe-Se:lt?bt-fe+xe.height+st+Se:bt+fe-xe.height/2+st-Se;break;case"top":ke=Le?lt?bt+Se:bt-Se:lt?bt-xe.height/2-Se:bt+xe.height+Se}if(this.barCtx.lastActiveBarSerieIndex===k&&Fe.enabled){var Zt=new z(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:k,j:_}),Me.fontSize);T=lt?bt-Zt.height/2-Se-Fe.offsetY+18:bt+Zt.height+Se+Fe.offsetY-18;var Ge=nt;B=De+(h.globals.isXNumeric?-de*h.globals.barGroups.length/2:h.globals.barGroups.length*de/2-(h.globals.barGroups.length-1)*de-Ge)+Fe.offsetX}return h.config.chart.stacked||(ke<0?ke=0+st:ke+xe.height/3>h.globals.gridHeight&&(ke=h.globals.gridHeight-st)),{bcx:ee,bcy:W,dataLabelsX:we,dataLabelsY:ke,totalDataLabelsX:B,totalDataLabelsY:T,totalDataLabelsAnchor:"middle"}}},{key:"calculateBarsDataLabelsPosition",value:function(p){var h=this.w,S=p.x,_=p.i,k=p.j,T=p.realIndex,B=p.bcy,W=p.barHeight,ee=p.barWidth,de=p.textRects,fe=p.dataLabelsX,xe=p.strokeWidth,we=p.dataLabelsConfig,ke=p.barDataLabelsConfig,Me=p.barTotalDataLabelsConfig,Ye=p.offX,Fe=p.offY,st=h.globals.gridHeight/h.globals.dataPoints;ee=Math.abs(ee);var se,Se,De=B-(this.barCtx.isRangeBar?0:st)+W/2+de.height/2+Fe-3,Le="start",_e=h.globals.series[_][k]<0,nt=S;switch(this.barCtx.isReversed&&(nt=S+(_e?-ee:ee),Le=_e?"start":"end"),ke.position){case"center":fe=_e?nt+ee/2-Ye:Math.max(de.width/2,nt-ee/2)+Ye;break;case"bottom":fe=_e?nt+ee-xe-Ye:nt-ee+xe+Ye;break;case"top":fe=_e?nt-xe-Ye:nt-xe+Ye}if(this.barCtx.lastActiveBarSerieIndex===T&&Me.enabled){var lt=new z(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:T,j:k}),we.fontSize);_e?(se=nt-xe-Ye-Me.offsetX,Le="end"):se=nt+Ye+Me.offsetX+(this.barCtx.isReversed?-(ee+xe):xe),Se=De-de.height/2+lt.height/2+Me.offsetY+xe}return h.config.chart.stacked||(we.textAnchor==="start"?fe-de.width<0?fe=_e?de.width+xe:xe:fe+de.width>h.globals.gridWidth&&(fe=_e?h.globals.gridWidth-xe:h.globals.gridWidth-de.width-xe):we.textAnchor==="middle"?fe-de.width/2<0?fe=de.width/2+xe:fe+de.width/2>h.globals.gridWidth&&(fe=h.globals.gridWidth-de.width/2-xe):we.textAnchor==="end"&&(fe<1?fe=de.width+xe:fe+1>h.globals.gridWidth&&(fe=h.globals.gridWidth-de.width-xe))),{bcx:S,bcy:B,dataLabelsX:fe,dataLabelsY:De,totalDataLabelsX:se,totalDataLabelsY:Se,totalDataLabelsAnchor:Le}}},{key:"drawCalculatedDataLabels",value:function(p){var h=p.x,S=p.y,_=p.val,k=p.i,T=p.j,B=p.textRects,W=p.barHeight,ee=p.barWidth,de=p.dataLabelsConfig,fe=this.w,xe="rotate(0)";fe.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(xe="rotate(-90, ".concat(h,", ").concat(S,")"));var we=new Ie(this.barCtx.ctx),ke=new z(this.barCtx.ctx),Me=de.formatter,Ye=null,Fe=fe.globals.collapsedSeriesIndices.indexOf(k)>-1;if(de.enabled&&!Fe){Ye=ke.group({class:"apexcharts-data-labels",transform:xe});var st="";_!==void 0&&(st=Me(_,v(v({},fe),{},{seriesIndex:k,dataPointIndex:T,w:fe}))),!_&&fe.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(st="");var se=fe.globals.series[k][T]<0,Se=fe.config.plotOptions.bar.dataLabels.position;fe.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(Se==="top"&&(de.textAnchor=se?"end":"start"),Se==="center"&&(de.textAnchor="middle"),Se==="bottom"&&(de.textAnchor=se?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&ee<ke.getTextRects(st,parseFloat(de.style.fontSize)).width&&(st=""),fe.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?B.width/1.6>Math.abs(ee)&&(st=""):B.height/1.6>Math.abs(W)&&(st=""));var De=v({},de);this.barCtx.isHorizontal&&_<0&&(de.textAnchor==="start"?De.textAnchor="end":de.textAnchor==="end"&&(De.textAnchor="start")),we.plotDataLabelsText({x:h,y:S,text:st,i:k,j:T,parent:Ye,dataLabelsConfig:De,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return Ye}},{key:"drawTotalDataLabels",value:function(p){var h=p.x,S=p.y,_=p.val,k=p.realIndex,T=p.textAnchor,B=p.barTotalDataLabelsConfig;this.w;var W,ee=new z(this.barCtx.ctx);return B.enabled&&h!==void 0&&S!==void 0&&this.barCtx.lastActiveBarSerieIndex===k&&(W=ee.drawText({x:h,y:S,foreColor:B.style.color,text:_,textAnchor:T,fontFamily:B.style.fontFamily,fontSize:B.style.fontSize,fontWeight:B.style.fontWeight})),W}}]),Ee}(),xn=function(){function Ee(p){s(this,Ee),this.w=p.w,this.barCtx=p}return o(Ee,[{key:"initVariables",value:function(p){var h=this.w;this.barCtx.series=p,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var S=0;S<p.length;S++)if(p[S].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=p[S].length),h.globals.isXNumeric)for(var _=0;_<p[S].length;_++)h.globals.seriesX[S][_]>h.globals.minX&&h.globals.seriesX[S][_]<h.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=h.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(h.globals.series),this.barCtx.seriesLen===0&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],h.globals.comboCharts||this.checkZeroSeries({series:p})}},{key:"initialPositions",value:function(){var p,h,S,_,k,T,B,W,ee=this.w,de=ee.globals.dataPoints;this.barCtx.isRangeBar&&(de=ee.globals.labels.length);var fe=this.barCtx.seriesLen;if(ee.config.plotOptions.bar.rangeBarGroupRows&&(fe=1),this.barCtx.isHorizontal)k=(S=ee.globals.gridHeight/de)/fe,ee.globals.isXNumeric&&(k=(S=ee.globals.gridHeight/this.barCtx.totalItems)/this.barCtx.seriesLen),k=k*parseInt(this.barCtx.barOptions.barHeight,10)/100,String(this.barCtx.barOptions.barHeight).indexOf("%")===-1&&(k=parseInt(this.barCtx.barOptions.barHeight,10)),W=this.barCtx.baseLineInvertedY+ee.globals.padHorizontal+(this.barCtx.isReversed?ee.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(W=ee.globals.gridWidth/2),h=(S-k*this.barCtx.seriesLen)/2;else{if(_=ee.globals.gridWidth/this.barCtx.visibleItems,ee.config.xaxis.convertedCatToNumeric&&(_=ee.globals.gridWidth/ee.globals.dataPoints),T=_/fe*parseInt(this.barCtx.barOptions.columnWidth,10)/100,ee.globals.isXNumeric){var xe=this.barCtx.xRatio;ee.globals.minXDiff&&ee.globals.minXDiff!==.5&&ee.globals.minXDiff/xe>0&&(_=ee.globals.minXDiff/xe),(T=_/fe*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(T=1)}String(this.barCtx.barOptions.columnWidth).indexOf("%")===-1&&(T=parseInt(this.barCtx.barOptions.columnWidth,10)),B=ee.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?ee.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),p=ee.globals.padHorizontal+(_-T*this.barCtx.seriesLen)/2}return ee.globals.barHeight=k,ee.globals.barWidth=T,{x:p,y:h,yDivision:S,xDivision:_,barHeight:k,barWidth:T,zeroH:B,zeroW:W}}},{key:"initializeStackedPrevVars",value:function(p){p.w.globals.seriesGroups.forEach(function(h){p[h]||(p[h]={}),p[h].prevY=[],p[h].prevX=[],p[h].prevYF=[],p[h].prevXF=[],p[h].prevYVal=[],p[h].prevXVal=[]})}},{key:"initializeStackedXYVars",value:function(p){p.w.globals.seriesGroups.forEach(function(h){p[h]||(p[h]={}),p[h].xArrj=[],p[h].xArrjF=[],p[h].xArrjVal=[],p[h].yArrj=[],p[h].yArrjF=[],p[h].yArrjVal=[]})}},{key:"getPathFillColor",value:function(p,h,S,_){var k,T,B,W,ee,de=this.w,fe=this.barCtx.ctx.fill,xe=null,we=this.barCtx.barOptions.distributed?S:h;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map(function(ke){p[h][S]>=ke.from&&p[h][S]<=ke.to&&(xe=ke.color)}),(k=de.config.series[h].data[S])!==null&&k!==void 0&&k.fillColor&&(xe=de.config.series[h].data[S].fillColor),fe.fillPath({seriesNumber:this.barCtx.barOptions.distributed?we:_,dataPointIndex:S,color:xe,value:p[h][S],fillConfig:(T=de.config.series[h].data[S])===null||T===void 0?void 0:T.fill,fillType:(B=de.config.series[h].data[S])!==null&&B!==void 0&&(W=B.fill)!==null&&W!==void 0&&W.type?(ee=de.config.series[h].data[S])===null||ee===void 0?void 0:ee.fill.type:Array.isArray(de.config.fill.type)?de.config.fill.type[_]:de.config.fill.type})}},{key:"getStrokeWidth",value:function(p,h,S){var _=0,k=this.w;return this.barCtx.series[p][h]?this.barCtx.isNullValue=!1:this.barCtx.isNullValue=!0,k.config.stroke.show&&(this.barCtx.isNullValue||(_=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[S]:this.barCtx.strokeWidth)),_}},{key:"createBorderRadiusArr",value:function(p){var h=this.w,S=!this.w.config.chart.stacked||h.config.plotOptions.bar.borderRadiusWhenStacked!=="last"||h.config.plotOptions.bar.borderRadius<=0,_=p.length,k=p[0].length,T=Array.from({length:_},function(){return Array(k).fill(S?"top":"none")});if(S)return T;for(var B=0;B<k;B++){for(var W=[],ee=[],de=0,fe=0;fe<_;fe++){var xe=p[fe][B];xe>0?(W.push(fe),de++):xe<0&&(ee.push(fe),de++)}if(W.length>0&&ee.length===0)if(W.length===1)T[W[0]][B]="both";else{var we,ke=W[0],Me=W[W.length-1],Ye=l(W);try{for(Ye.s();!(we=Ye.n()).done;){var Fe=we.value;T[Fe][B]=Fe===ke?"bottom":Fe===Me?"top":"none"}}catch(wt){Ye.e(wt)}finally{Ye.f()}}else if(ee.length>0&&W.length===0)if(ee.length===1)T[ee[0]][B]="both";else{var st,se=ee[0],Se=ee[ee.length-1],De=l(ee);try{for(De.s();!(st=De.n()).done;){var Le=st.value;T[Le][B]=Le===se?"bottom":Le===Se?"top":"none"}}catch(wt){De.e(wt)}finally{De.f()}}else if(W.length>0&&ee.length>0){var _e,nt=W[W.length-1],lt=l(W);try{for(lt.s();!(_e=lt.n()).done;){var bt=_e.value;T[bt][B]=bt===nt?"top":"none"}}catch(wt){lt.e(wt)}finally{lt.f()}var Zt,Ge=ee[ee.length-1],Je=l(ee);try{for(Je.s();!(Zt=Je.n()).done;){var We=Zt.value;T[We][B]=We===Ge?"bottom":"none"}}catch(wt){Je.e(wt)}finally{Je.f()}}else de===1&&(T[W[0]||ee[0]][B]="both")}return T}},{key:"barBackground",value:function(p){var h=p.j,S=p.i,_=p.x1,k=p.x2,T=p.y1,B=p.y2,W=p.elSeries,ee=this.w,de=new z(this.barCtx.ctx),fe=new Re(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&fe===S){h>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(h%=this.barCtx.barOptions.colors.backgroundBarColors.length);var xe=this.barCtx.barOptions.colors.backgroundBarColors[h],we=de.drawRect(_!==void 0?_:0,T!==void 0?T:0,k!==void 0?k:ee.globals.gridWidth,B!==void 0?B:ee.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,xe,this.barCtx.barOptions.colors.backgroundBarOpacity);W.add(we),we.node.classList.add("apexcharts-backgroundBar")}}},{key:"getColumnPaths",value:function(p){var h,S=p.barWidth,_=p.barXPosition,k=p.y1,T=p.y2,B=p.strokeWidth,W=p.isReversed,ee=p.series,de=p.seriesGroup,fe=p.realIndex,xe=p.i,we=p.j,ke=p.w,Me=new z(this.barCtx.ctx);(B=Array.isArray(B)?B[fe]:B)||(B=0);var Ye=S,Fe=_;(h=ke.config.series[fe].data[we])!==null&&h!==void 0&&h.columnWidthOffset&&(Fe=_-ke.config.series[fe].data[we].columnWidthOffset/2,Ye=S+ke.config.series[fe].data[we].columnWidthOffset);var st=B/2,se=Fe+st,Se=Fe+Ye-st,De=(ee[xe][we]>=0?1:-1)*(W?-1:1);k+=.001-st*De,T+=.001+st*De;var Le=Me.move(se,k),_e=Me.move(se,k),nt=Me.line(Se,k);if(ke.globals.previousPaths.length>0&&(_e=this.barCtx.getPreviousPath(fe,we,!1)),Le=Le+Me.line(se,T)+Me.line(Se,T)+nt+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[fe][we]==="both"?" Z":" z"),_e=_e+Me.line(se,k)+nt+nt+nt+nt+nt+Me.line(se,k)+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[fe][we]==="both"?" Z":" z"),this.arrBorderRadius[fe][we]!=="none"&&(Le=Me.roundPathCorners(Le,ke.config.plotOptions.bar.borderRadius)),ke.config.chart.stacked){var lt=this.barCtx;(lt=this.barCtx[de]).yArrj.push(T-st*De),lt.yArrjF.push(Math.abs(k-T+B*De)),lt.yArrjVal.push(this.barCtx.series[xe][we])}return{pathTo:Le,pathFrom:_e}}},{key:"getBarpaths",value:function(p){var h,S=p.barYPosition,_=p.barHeight,k=p.x1,T=p.x2,B=p.strokeWidth,W=p.isReversed,ee=p.series,de=p.seriesGroup,fe=p.realIndex,xe=p.i,we=p.j,ke=p.w,Me=new z(this.barCtx.ctx);(B=Array.isArray(B)?B[fe]:B)||(B=0);var Ye=S,Fe=_;(h=ke.config.series[fe].data[we])!==null&&h!==void 0&&h.barHeightOffset&&(Ye=S-ke.config.series[fe].data[we].barHeightOffset/2,Fe=_+ke.config.series[fe].data[we].barHeightOffset);var st=B/2,se=Ye+st,Se=Ye+Fe-st,De=(ee[xe][we]>=0?1:-1)*(W?-1:1);k+=.001+st*De,T+=.001-st*De;var Le=Me.move(k,se),_e=Me.move(k,se);ke.globals.previousPaths.length>0&&(_e=this.barCtx.getPreviousPath(fe,we,!1));var nt=Me.line(k,Se);if(Le=Le+Me.line(T,se)+Me.line(T,Se)+nt+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[fe][we]==="both"?" Z":" z"),_e=_e+Me.line(k,se)+nt+nt+nt+nt+nt+Me.line(k,se)+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[fe][we]==="both"?" Z":" z"),this.arrBorderRadius[fe][we]!=="none"&&(Le=Me.roundPathCorners(Le,ke.config.plotOptions.bar.borderRadius)),ke.config.chart.stacked){var lt=this.barCtx;(lt=this.barCtx[de]).xArrj.push(T+st*De),lt.xArrjF.push(Math.abs(k-T-B*De)),lt.xArrjVal.push(this.barCtx.series[xe][we])}return{pathTo:Le,pathFrom:_e}}},{key:"checkZeroSeries",value:function(p){for(var h=p.series,S=this.w,_=0;_<h.length;_++){for(var k=0,T=0;T<h[S.globals.maxValsInArrayIndex].length;T++)k+=h[_][T];k===0&&this.barCtx.zeroSerieses.push(_)}}},{key:"getXForValue",value:function(p,h){var S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]?h:null;return p!=null&&(S=h+p/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?p/this.barCtx.invertedYRatio:0)),S}},{key:"getYForValue",value:function(p,h,S){var _=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3]?h:null;return p!=null&&(_=h-p/this.barCtx.yRatio[S]+2*(this.barCtx.isReversed?p/this.barCtx.yRatio[S]:0)),_}},{key:"getGoalValues",value:function(p,h,S,_,k,T){var B=this,W=this.w,ee=[],de=function(we,ke){var Me;ee.push((u(Me={},p,p==="x"?B.getXForValue(we,h,!1):B.getYForValue(we,S,T,!1)),u(Me,"attrs",ke),Me))};if(W.globals.seriesGoals[_]&&W.globals.seriesGoals[_][k]&&Array.isArray(W.globals.seriesGoals[_][k])&&W.globals.seriesGoals[_][k].forEach(function(we){de(we.value,we)}),this.barCtx.barOptions.isDumbbell&&W.globals.seriesRange.length){var fe=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:W.globals.colors,xe={strokeHeight:p==="x"?0:W.globals.markers.size[_],strokeWidth:p==="x"?W.globals.markers.size[_]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(fe[_])?fe[_][0]:fe[_]};de(W.globals.seriesRangeStart[_][k],xe),de(W.globals.seriesRangeEnd[_][k],v(v({},xe),{},{strokeColor:Array.isArray(fe[_])?fe[_][1]:fe[_]}))}return ee}},{key:"drawGoalLine",value:function(p){var h=p.barXPosition,S=p.barYPosition,_=p.goalX,k=p.goalY,T=p.barWidth,B=p.barHeight,W=new z(this.barCtx.ctx),ee=W.group({className:"apexcharts-bar-goals-groups"});ee.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:ee.node}),ee.attr("clip-path","url(#gridRectMarkerMask".concat(this.barCtx.w.globals.cuid,")"));var de=null;return this.barCtx.isHorizontal?Array.isArray(_)&&_.forEach(function(fe){if(fe.x>=-1&&fe.x<=W.w.globals.gridWidth+1){var xe=fe.attrs.strokeHeight!==void 0?fe.attrs.strokeHeight:B/2,we=S+xe+B/2;de=W.drawLine(fe.x,we-2*xe,fe.x,we,fe.attrs.strokeColor?fe.attrs.strokeColor:void 0,fe.attrs.strokeDashArray,fe.attrs.strokeWidth?fe.attrs.strokeWidth:2,fe.attrs.strokeLineCap),ee.add(de)}}):Array.isArray(k)&&k.forEach(function(fe){if(fe.y>=-1&&fe.y<=W.w.globals.gridHeight+1){var xe=fe.attrs.strokeWidth!==void 0?fe.attrs.strokeWidth:T/2,we=h+xe+T/2;de=W.drawLine(we-2*xe,fe.y,we,fe.y,fe.attrs.strokeColor?fe.attrs.strokeColor:void 0,fe.attrs.strokeDashArray,fe.attrs.strokeHeight?fe.attrs.strokeHeight:2,fe.attrs.strokeLineCap),ee.add(de)}}),ee}},{key:"drawBarShadow",value:function(p){var h=p.prevPaths,S=p.currPaths,_=p.color,k=this.w,T=h.x,B=h.x1,W=h.barYPosition,ee=S.x,de=S.x1,fe=S.barYPosition,xe=W+S.barHeight,we=new z(this.barCtx.ctx),ke=new F,Me=we.move(B,xe)+we.line(T,xe)+we.line(ee,fe)+we.line(de,fe)+we.line(B,xe)+(k.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[realIndex][j]==="both"?" Z":" z");return we.drawPath({d:Me,fill:ke.shadeColor(.5,F.rgb2hex(_)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadows"})}},{key:"getZeroValueEncounters",value:function(p){var h,S=p.i,_=p.j,k=this.w,T=0,B=0;return(k.config.plotOptions.bar.horizontal?k.globals.series.map(function(W,ee){return ee}):((h=k.globals.columnSeries)===null||h===void 0?void 0:h.i.map(function(W){return W}))||[]).forEach(function(W){var ee=k.globals.seriesPercent[W][_];ee&&T++,W<S&&ee===0&&B++}),{nonZeroColumns:T,zeroEncounters:B}}},{key:"getGroupIndex",value:function(p){var h=this.w,S=h.globals.seriesGroups.findIndex(function(T){return T.indexOf(h.globals.seriesNames[p])>-1}),_=this.barCtx.columnGroupIndices,k=_.indexOf(S);return k<0&&(_.push(S),k=_.length-1),{groupIndex:S,columnGroupIndex:k}}}]),Ee}(),un=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.w=p.w;var S=this.w;this.barOptions=S.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=S.config.stroke.width,this.isNullValue=!1,this.isRangeBar=S.globals.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!S.globals.isBarHorizontal&&S.globals.seriesRange.length&&S.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=h,this.xyRatios!==null&&(this.xRatio=h.xRatio,this.yRatio=h.yRatio,this.invertedXRatio=h.invertedXRatio,this.invertedYRatio=h.invertedYRatio,this.baseLineY=h.baseLineY,this.baseLineInvertedY=h.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[];var _=new Re(this.ctx);this.lastActiveBarSerieIndex=_.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];var k=_.getBarSeriesIndices(),T=new Q(this.ctx);this.stackedSeriesTotals=T.getStackedSeriesTotals(this.w.config.series.map(function(B,W){return k.indexOf(W)===-1?W:-1}).filter(function(B){return B!==-1})),this.barHelpers=new xn(this)}return o(Ee,[{key:"draw",value:function(p,h){var S=this.w,_=new z(this.ctx),k=new Q(this.ctx,S);p=k.getLogSeries(p),this.series=p,this.yRatio=k.getLogYRatios(this.yRatio),this.barHelpers.initVariables(p);var T=_.group({class:"apexcharts-bar-series apexcharts-plot-series"});S.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(var B=0,W=0;B<p.length;B++,W++){var ee,de,fe,xe,we=void 0,ke=void 0,Me=[],Ye=[],Fe=S.globals.comboCharts?h[B]:B,st=this.barHelpers.getGroupIndex(Fe).columnGroupIndex,se=_.group({class:"apexcharts-series",rel:B+1,seriesName:F.escapeString(S.globals.seriesNames[Fe]),"data:realIndex":Fe});this.ctx.series.addCollapsedClassToSeries(se,Fe),p[B].length>0&&(this.visibleI=this.visibleI+1);var Se=0,De=0;this.yRatio.length>1&&(this.yaxisIndex=S.globals.seriesYAxisReverseMap[Fe],this.translationsIndex=Fe);var Le=this.translationsIndex;this.isReversed=S.config.yaxis[this.yaxisIndex]&&S.config.yaxis[this.yaxisIndex].reversed;var _e=this.barHelpers.initialPositions();ke=_e.y,Se=_e.barHeight,de=_e.yDivision,xe=_e.zeroW,we=_e.x,De=_e.barWidth,ee=_e.xDivision,fe=_e.zeroH,this.horizontal||Ye.push(we+De/2);var nt=_.group({class:"apexcharts-datalabels","data:realIndex":Fe});S.globals.delayedElements.push({el:nt.node}),nt.node.classList.add("apexcharts-element-hidden");var lt=_.group({class:"apexcharts-bar-goals-markers"}),bt=_.group({class:"apexcharts-bar-shadows"});S.globals.delayedElements.push({el:bt.node}),bt.node.classList.add("apexcharts-element-hidden");for(var Zt=0;Zt<p[B].length;Zt++){var Ge=this.barHelpers.getStrokeWidth(B,Zt,Fe),Je=null,We={indexes:{i:B,j:Zt,realIndex:Fe,translationsIndex:Le,bc:W},x:we,y:ke,strokeWidth:Ge,elSeries:se};this.isHorizontal?(Je=this.drawBarPaths(v(v({},We),{},{barHeight:Se,zeroW:xe,yDivision:de})),De=this.series[B][Zt]/this.invertedYRatio):(Je=this.drawColumnPaths(v(v({},We),{},{xDivision:ee,barWidth:De,zeroH:fe})),Se=this.series[B][Zt]/this.yRatio[Le]);var wt=this.barHelpers.getPathFillColor(p,B,Zt,Fe);if(this.isFunnel&&this.barOptions.isFunnel3d&&this.pathArr.length&&Zt>0){var At=this.barHelpers.drawBarShadow({color:typeof wt=="string"&&(wt==null?void 0:wt.indexOf("url"))===-1?wt:F.hexToRgba(S.globals.colors[B]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:Je});At&&bt.add(At)}this.pathArr.push(Je);var Gt=this.barHelpers.drawGoalLine({barXPosition:Je.barXPosition,barYPosition:Je.barYPosition,goalX:Je.goalX,goalY:Je.goalY,barHeight:Se,barWidth:De});Gt&<.add(Gt),ke=Je.y,we=Je.x,Zt>0&&Ye.push(we+De/2),Me.push(ke),this.renderSeries({realIndex:Fe,pathFill:wt,j:Zt,i:B,columnGroupIndex:st,pathFrom:Je.pathFrom,pathTo:Je.pathTo,strokeWidth:Ge,elSeries:se,x:we,y:ke,series:p,barHeight:Math.abs(Je.barHeight?Je.barHeight:Se),barWidth:Math.abs(Je.barWidth?Je.barWidth:De),elDataLabelsWrap:nt,elGoalsMarkers:lt,elBarShadows:bt,visibleSeries:this.visibleI,type:"bar"})}S.globals.seriesXvalues[Fe]=Ye,S.globals.seriesYvalues[Fe]=Me,T.add(se)}return T}},{key:"renderSeries",value:function(p){var h=p.realIndex,S=p.pathFill,_=p.lineFill,k=p.j,T=p.i,B=p.columnGroupIndex,W=p.pathFrom,ee=p.pathTo,de=p.strokeWidth,fe=p.elSeries,xe=p.x,we=p.y,ke=p.y1,Me=p.y2,Ye=p.series,Fe=p.barHeight,st=p.barWidth,se=p.barXPosition,Se=p.barYPosition,De=p.elDataLabelsWrap,Le=p.elGoalsMarkers,_e=p.elBarShadows,nt=p.visibleSeries,lt=p.type,bt=p.classes,Zt=this.w,Ge=new z(this.ctx);if(!_){var Je=typeof Zt.globals.stroke.colors[h]=="function"?function(fn){var Rn,An=Zt.config.stroke.colors;return Array.isArray(An)&&An.length>0&&((Rn=An[fn])||(Rn=""),typeof Rn=="function")?Rn({value:Zt.globals.series[fn][k],dataPointIndex:k,w:Zt}):Rn}(h):Zt.globals.stroke.colors[h];_=this.barOptions.distributed?Zt.globals.stroke.colors[k]:Je}Zt.config.series[T].data[k]&&Zt.config.series[T].data[k].strokeColor&&(_=Zt.config.series[T].data[k].strokeColor),this.isNullValue&&(S="none");var We=k/Zt.config.chart.animations.animateGradually.delay*(Zt.config.chart.animations.speed/Zt.globals.dataPoints)/2.4,wt=Ge.renderPaths({i:T,j:k,realIndex:h,pathFrom:W,pathTo:ee,stroke:_,strokeWidth:de,strokeLineCap:Zt.config.stroke.lineCap,fill:S,animationDelay:We,initialSpeed:Zt.config.chart.animations.speed,dataChangeSpeed:Zt.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(lt,"-area ").concat(bt),chartType:lt});wt.attr("clip-path","url(#gridRectBarMask".concat(Zt.globals.cuid,")"));var At=Zt.config.forecastDataPoints;At.count>0&&k>=Zt.globals.dataPoints-At.count&&(wt.node.setAttribute("stroke-dasharray",At.dashArray),wt.node.setAttribute("stroke-width",At.strokeWidth),wt.node.setAttribute("fill-opacity",At.fillOpacity)),ke!==void 0&&Me!==void 0&&(wt.attr("data-range-y1",ke),wt.attr("data-range-y2",Me)),new L(this.ctx).setSelectionFilter(wt,h,k),fe.add(wt);var Gt=new kt(this).handleBarDataLabels({x:xe,y:we,y1:ke,y2:Me,i:T,j:k,series:Ye,realIndex:h,columnGroupIndex:B,barHeight:Fe,barWidth:st,barXPosition:se,barYPosition:Se,renderedPath:wt,visibleSeries:nt});return Gt.dataLabels!==null&&De.add(Gt.dataLabels),Gt.totalDataLabels&&De.add(Gt.totalDataLabels),fe.add(De),Le&&fe.add(Le),_e&&fe.add(_e),fe}},{key:"drawBarPaths",value:function(p){var h,S=p.indexes,_=p.barHeight,k=p.strokeWidth,T=p.zeroW,B=p.x,W=p.y,ee=p.yDivision,de=p.elSeries,fe=this.w,xe=S.i,we=S.j;if(fe.globals.isXNumeric)h=(W=(fe.globals.seriesX[xe][we]-fe.globals.minX)/this.invertedXRatio-_)+_*this.visibleI;else if(fe.config.plotOptions.bar.hideZeroBarsWhenGrouped){var ke=0,Me=0;fe.globals.seriesPercent.forEach(function(Fe,st){Fe[we]&&ke++,st<xe&&Fe[we]===0&&Me++}),ke>0&&(_=this.seriesLen*_/ke),h=W+_*this.visibleI,h-=_*Me}else h=W+_*this.visibleI;this.isFunnel&&(T-=(this.barHelpers.getXForValue(this.series[xe][we],T)-T)/2),B=this.barHelpers.getXForValue(this.series[xe][we],T);var Ye=this.barHelpers.getBarpaths({barYPosition:h,barHeight:_,x1:T,x2:B,strokeWidth:k,isReversed:this.isReversed,series:this.series,realIndex:S.realIndex,i:xe,j:we,w:fe});return fe.globals.isXNumeric||(W+=ee),this.barHelpers.barBackground({j:we,i:xe,y1:h-_*this.visibleI,y2:_*this.seriesLen,elSeries:de}),{pathTo:Ye.pathTo,pathFrom:Ye.pathFrom,x1:T,x:B,y:W,goalX:this.barHelpers.getGoalValues("x",T,null,xe,we),barYPosition:h,barHeight:_}}},{key:"drawColumnPaths",value:function(p){var h,S=p.indexes,_=p.x,k=p.y,T=p.xDivision,B=p.barWidth,W=p.zeroH,ee=p.strokeWidth,de=p.elSeries,fe=this.w,xe=S.realIndex,we=S.translationsIndex,ke=S.i,Me=S.j,Ye=S.bc;if(fe.globals.isXNumeric){var Fe=this.getBarXForNumericXAxis({x:_,j:Me,realIndex:xe,barWidth:B});_=Fe.x,h=Fe.barXPosition}else if(fe.config.plotOptions.bar.hideZeroBarsWhenGrouped){var st=this.barHelpers.getZeroValueEncounters({i:ke,j:Me}),se=st.nonZeroColumns,Se=st.zeroEncounters;se>0&&(B=this.seriesLen*B/se),h=_+B*this.visibleI,h-=B*Se}else h=_+B*this.visibleI;k=this.barHelpers.getYForValue(this.series[ke][Me],W,we);var De=this.barHelpers.getColumnPaths({barXPosition:h,barWidth:B,y1:W,y2:k,strokeWidth:ee,isReversed:this.isReversed,series:this.series,realIndex:xe,i:ke,j:Me,w:fe});return fe.globals.isXNumeric||(_+=T),this.barHelpers.barBackground({bc:Ye,j:Me,i:ke,x1:h-ee/2-B*this.visibleI,x2:B*this.seriesLen+ee/2,elSeries:de}),{pathTo:De.pathTo,pathFrom:De.pathFrom,x:_,y:k,goalY:this.barHelpers.getGoalValues("y",null,W,ke,Me,we),barXPosition:h,barWidth:B}}},{key:"getBarXForNumericXAxis",value:function(p){var h=p.x,S=p.barWidth,_=p.realIndex,k=p.j,T=this.w,B=_;return T.globals.seriesX[_].length||(B=T.globals.maxValsInArrayIndex),T.globals.seriesX[B][k]&&(h=(T.globals.seriesX[B][k]-T.globals.minX)/this.xRatio-S*this.seriesLen/2),{barXPosition:h+S*this.visibleI,x:h}}},{key:"getPreviousPath",value:function(p,h){for(var S,_=this.w,k=0;k<_.globals.previousPaths.length;k++){var T=_.globals.previousPaths[k];T.paths&&T.paths.length>0&&parseInt(T.realIndex,10)===parseInt(p,10)&&_.globals.previousPaths[k].paths[h]!==void 0&&(S=_.globals.previousPaths[k].paths[h].d)}return S}}]),Ee}(),On=function(Ee){f(h,un);var p=c(h);function h(){return s(this,h),p.apply(this,arguments)}return o(h,[{key:"draw",value:function(S,_){var k=this,T=this.w;this.graphics=new z(this.ctx),this.bar=new un(this.ctx,this.xyRatios);var B=new Q(this.ctx,T);S=B.getLogSeries(S),this.yRatio=B.getLogYRatios(this.yRatio),this.barHelpers.initVariables(S),T.config.chart.stackType==="100%"&&(S=T.globals.comboCharts?_.map(function(ke){return T.globals.seriesPercent[ke]}):T.globals.seriesPercent.slice()),this.series=S,this.barHelpers.initializeStackedPrevVars(this);for(var W=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),ee=0,de=0,fe=function(ke,Me){var Ye=void 0,Fe=void 0,st=void 0,se=void 0,Se=T.globals.comboCharts?_[ke]:ke,De=k.barHelpers.getGroupIndex(Se),Le=De.groupIndex,_e=De.columnGroupIndex;k.groupCtx=k[T.globals.seriesGroups[Le]];var nt=[],lt=[],bt=0;k.yRatio.length>1&&(k.yaxisIndex=T.globals.seriesYAxisReverseMap[Se][0],bt=Se),k.isReversed=T.config.yaxis[k.yaxisIndex]&&T.config.yaxis[k.yaxisIndex].reversed;var Zt=k.graphics.group({class:"apexcharts-series",seriesName:F.escapeString(T.globals.seriesNames[Se]),rel:ke+1,"data:realIndex":Se});k.ctx.series.addCollapsedClassToSeries(Zt,Se);var Ge=k.graphics.group({class:"apexcharts-datalabels","data:realIndex":Se}),Je=k.graphics.group({class:"apexcharts-bar-goals-markers"}),We=0,wt=0,At=k.initialPositions(ee,de,Ye,Fe,st,se,bt);de=At.y,We=At.barHeight,Fe=At.yDivision,se=At.zeroW,ee=At.x,wt=At.barWidth,Ye=At.xDivision,st=At.zeroH,T.globals.barHeight=We,T.globals.barWidth=wt,k.barHelpers.initializeStackedXYVars(k),k.groupCtx.prevY.length===1&&k.groupCtx.prevY[0].every(function(Qt){return isNaN(Qt)})&&(k.groupCtx.prevY[0]=k.groupCtx.prevY[0].map(function(){return st}),k.groupCtx.prevYF[0]=k.groupCtx.prevYF[0].map(function(){return 0}));for(var Gt=0;Gt<T.globals.dataPoints;Gt++){var fn=k.barHelpers.getStrokeWidth(ke,Gt,Se),Rn={indexes:{i:ke,j:Gt,realIndex:Se,translationsIndex:bt,bc:Me},strokeWidth:fn,x:ee,y:de,elSeries:Zt,columnGroupIndex:_e,seriesGroup:T.globals.seriesGroups[Le]},An=null;k.isHorizontal?(An=k.drawStackedBarPaths(v(v({},Rn),{},{zeroW:se,barHeight:We,yDivision:Fe})),wt=k.series[ke][Gt]/k.invertedYRatio):(An=k.drawStackedColumnPaths(v(v({},Rn),{},{xDivision:Ye,barWidth:wt,zeroH:st})),We=k.series[ke][Gt]/k.yRatio[bt]);var pr=k.barHelpers.drawGoalLine({barXPosition:An.barXPosition,barYPosition:An.barYPosition,goalX:An.goalX,goalY:An.goalY,barHeight:We,barWidth:wt});pr&&Je.add(pr),de=An.y,ee=An.x,nt.push(ee),lt.push(de);var mt=k.barHelpers.getPathFillColor(S,ke,Gt,Se),qt="";T.globals.isBarHorizontal?k.barHelpers.arrBorderRadius[Se][Gt]==="bottom"&&T.globals.series[Se][Gt]>0&&(qt="apexcharts-flip-x"):k.barHelpers.arrBorderRadius[Se][Gt]==="bottom"&&T.globals.series[Se][Gt]>0&&(qt="apexcharts-flip-y"),Zt=k.renderSeries({realIndex:Se,pathFill:mt,j:Gt,i:ke,columnGroupIndex:_e,pathFrom:An.pathFrom,pathTo:An.pathTo,strokeWidth:fn,elSeries:Zt,x:ee,y:de,series:S,barHeight:We,barWidth:wt,elDataLabelsWrap:Ge,elGoalsMarkers:Je,type:"bar",visibleSeries:_e,classes:qt})}T.globals.seriesXvalues[Se]=nt,T.globals.seriesYvalues[Se]=lt,k.groupCtx.prevY.push(k.groupCtx.yArrj),k.groupCtx.prevYF.push(k.groupCtx.yArrjF),k.groupCtx.prevYVal.push(k.groupCtx.yArrjVal),k.groupCtx.prevX.push(k.groupCtx.xArrj),k.groupCtx.prevXF.push(k.groupCtx.xArrjF),k.groupCtx.prevXVal.push(k.groupCtx.xArrjVal),W.add(Zt)},xe=0,we=0;xe<S.length;xe++,we++)fe(xe,we);return W}},{key:"initialPositions",value:function(S,_,k,T,B,W,ee){var de,fe,xe=this.w;if(this.isHorizontal){T=xe.globals.gridHeight/xe.globals.dataPoints;var we=xe.config.plotOptions.bar.barHeight;de=String(we).indexOf("%")===-1?parseInt(we,10):T*parseInt(we,10)/100,W=xe.globals.padHorizontal+(this.isReversed?xe.globals.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),_=(T-de)/2}else{fe=k=xe.globals.gridWidth/xe.globals.dataPoints;var ke=xe.config.plotOptions.bar.columnWidth;xe.globals.isXNumeric&&xe.globals.dataPoints>1?fe=(k=xe.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:String(ke).indexOf("%")===-1?fe=parseInt(ke,10):fe*=parseInt(ke,10)/100,B=this.isReversed?this.baseLineY[ee]:xe.globals.gridHeight-this.baseLineY[ee],S=xe.globals.padHorizontal+(k-fe)/2}var Me=xe.globals.barGroups.length||1;return{x:S,y:_,yDivision:T,xDivision:k,barHeight:de/Me,barWidth:fe/Me,zeroH:B,zeroW:W}}},{key:"drawStackedBarPaths",value:function(S){for(var _,k=S.indexes,T=S.barHeight,B=S.strokeWidth,W=S.zeroW,ee=S.x,de=S.y,fe=S.columnGroupIndex,xe=S.seriesGroup,we=S.yDivision,ke=S.elSeries,Me=this.w,Ye=de+fe*T,Fe=k.i,st=k.j,se=k.realIndex,Se=k.translationsIndex,De=0,Le=0;Le<this.groupCtx.prevXF.length;Le++)De+=this.groupCtx.prevXF[Le][st];var _e;if((_e=xe.indexOf(Me.config.series[se].name))>0){var nt=W;this.groupCtx.prevXVal[_e-1][st]<0?nt=this.series[Fe][st]>=0?this.groupCtx.prevX[_e-1][st]+De-2*(this.isReversed?De:0):this.groupCtx.prevX[_e-1][st]:this.groupCtx.prevXVal[_e-1][st]>=0&&(nt=this.series[Fe][st]>=0?this.groupCtx.prevX[_e-1][st]:this.groupCtx.prevX[_e-1][st]-De+2*(this.isReversed?De:0)),_=nt}else _=W;ee=this.series[Fe][st]===null?_:_+this.series[Fe][st]/this.invertedYRatio-2*(this.isReversed?this.series[Fe][st]/this.invertedYRatio:0);var lt=this.barHelpers.getBarpaths({barYPosition:Ye,barHeight:T,x1:_,x2:ee,strokeWidth:B,isReversed:this.isReversed,series:this.series,realIndex:k.realIndex,seriesGroup:xe,i:Fe,j:st,w:Me});return this.barHelpers.barBackground({j:st,i:Fe,y1:Ye,y2:T,elSeries:ke}),de+=we,{pathTo:lt.pathTo,pathFrom:lt.pathFrom,goalX:this.barHelpers.getGoalValues("x",W,null,Fe,st,Se),barXPosition:_,barYPosition:Ye,x:ee,y:de}}},{key:"drawStackedColumnPaths",value:function(S){var _=S.indexes,k=S.x,T=S.y,B=S.xDivision,W=S.barWidth,ee=S.zeroH,de=S.columnGroupIndex,fe=S.seriesGroup,xe=S.elSeries,we=this.w,ke=_.i,Me=_.j,Ye=_.bc,Fe=_.realIndex,st=_.translationsIndex;if(we.globals.isXNumeric){var se=we.globals.seriesX[Fe][Me];se||(se=0),k=(se-we.globals.minX)/this.xRatio-W/2*we.globals.barGroups.length}for(var Se,De=k+de*W,Le=0,_e=0;_e<this.groupCtx.prevYF.length;_e++)Le+=isNaN(this.groupCtx.prevYF[_e][Me])?0:this.groupCtx.prevYF[_e][Me];var nt=ke;if(fe&&(nt=fe.indexOf(we.globals.seriesNames[Fe])),nt>0&&!we.globals.isXNumeric||nt>0&&we.globals.isXNumeric&&we.globals.seriesX[Fe-1][Me]===we.globals.seriesX[Fe][Me]){var lt,bt,Zt,Ge=Math.min(this.yRatio.length+1,Fe+1);if(this.groupCtx.prevY[nt-1]!==void 0&&this.groupCtx.prevY[nt-1].length)for(var Je=1;Je<Ge;Je++){var We;if(!isNaN((We=this.groupCtx.prevY[nt-Je])===null||We===void 0?void 0:We[Me])){Zt=this.groupCtx.prevY[nt-Je][Me];break}}for(var wt=1;wt<Ge;wt++){var At,Gt;if(((At=this.groupCtx.prevYVal[nt-wt])===null||At===void 0?void 0:At[Me])<0){bt=this.series[ke][Me]>=0?Zt-Le+2*(this.isReversed?Le:0):Zt;break}if(((Gt=this.groupCtx.prevYVal[nt-wt])===null||Gt===void 0?void 0:Gt[Me])>=0){bt=this.series[ke][Me]>=0?Zt:Zt+Le-2*(this.isReversed?Le:0);break}}bt===void 0&&(bt=we.globals.gridHeight),Se=(lt=this.groupCtx.prevYF[0])!==null&<!==void 0&<.every(function(Rn){return Rn===0})&&this.groupCtx.prevYF.slice(1,nt).every(function(Rn){return Rn.every(function(An){return isNaN(An)})})?ee:bt}else Se=ee;T=this.series[ke][Me]?Se-this.series[ke][Me]/this.yRatio[st]+2*(this.isReversed?this.series[ke][Me]/this.yRatio[st]:0):Se;var fn=this.barHelpers.getColumnPaths({barXPosition:De,barWidth:W,y1:Se,y2:T,yRatio:this.yRatio[st],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:fe,realIndex:_.realIndex,i:ke,j:Me,w:we});return this.barHelpers.barBackground({bc:Ye,j:Me,i:ke,x1:De,x2:W,elSeries:xe}),{pathTo:fn.pathTo,pathFrom:fn.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,ee,ke,Me),barXPosition:De,x:we.globals.isXNumeric?k:k+B,y:T}}}]),h}(),En=function(Ee){f(h,un);var p=c(h);function h(){return s(this,h),p.apply(this,arguments)}return o(h,[{key:"draw",value:function(S,_,k){var T=this,B=this.w,W=new z(this.ctx),ee=B.globals.comboCharts?_:B.config.chart.type,de=new Ae(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=B.config.plotOptions.bar.horizontal;var fe=new Q(this.ctx,B);S=fe.getLogSeries(S),this.series=S,this.yRatio=fe.getLogYRatios(this.yRatio),this.barHelpers.initVariables(S);for(var xe=W.group({class:"apexcharts-".concat(ee,"-series apexcharts-plot-series")}),we=function(Me){T.isBoxPlot=B.config.chart.type==="boxPlot"||B.config.series[Me].type==="boxPlot";var Ye,Fe,st,se,Se=void 0,De=void 0,Le=[],_e=[],nt=B.globals.comboCharts?k[Me]:Me,lt=T.barHelpers.getGroupIndex(nt).columnGroupIndex,bt=W.group({class:"apexcharts-series",seriesName:F.escapeString(B.globals.seriesNames[nt]),rel:Me+1,"data:realIndex":nt});T.ctx.series.addCollapsedClassToSeries(bt,nt),S[Me].length>0&&(T.visibleI=T.visibleI+1);var Zt,Ge,Je=0;T.yRatio.length>1&&(T.yaxisIndex=B.globals.seriesYAxisReverseMap[nt][0],Je=nt);var We=T.barHelpers.initialPositions();De=We.y,Zt=We.barHeight,Fe=We.yDivision,se=We.zeroW,Se=We.x,Ge=We.barWidth,Ye=We.xDivision,st=We.zeroH,_e.push(Se+Ge/2);for(var wt=W.group({class:"apexcharts-datalabels","data:realIndex":nt}),At=function(fn){var Rn=T.barHelpers.getStrokeWidth(Me,fn,nt),An=null,pr={indexes:{i:Me,j:fn,realIndex:nt,translationsIndex:Je},x:Se,y:De,strokeWidth:Rn,elSeries:bt};An=T.isHorizontal?T.drawHorizontalBoxPaths(v(v({},pr),{},{yDivision:Fe,barHeight:Zt,zeroW:se})):T.drawVerticalBoxPaths(v(v({},pr),{},{xDivision:Ye,barWidth:Ge,zeroH:st})),De=An.y,Se=An.x,fn>0&&_e.push(Se+Ge/2),Le.push(De),An.pathTo.forEach(function(mt,qt){var Qt=!T.isBoxPlot&&T.candlestickOptions.wick.useFillColor?An.color[qt]:B.globals.stroke.colors[Me],In=de.fillPath({seriesNumber:nt,dataPointIndex:fn,color:An.color[qt],value:S[Me][fn]});T.renderSeries({realIndex:nt,pathFill:In,lineFill:Qt,j:fn,i:Me,pathFrom:An.pathFrom,pathTo:mt,strokeWidth:Rn,elSeries:bt,x:Se,y:De,series:S,columnGroupIndex:lt,barHeight:Zt,barWidth:Ge,elDataLabelsWrap:wt,visibleSeries:T.visibleI,type:B.config.chart.type})})},Gt=0;Gt<B.globals.dataPoints;Gt++)At(Gt);B.globals.seriesXvalues[nt]=_e,B.globals.seriesYvalues[nt]=Le,xe.add(bt)},ke=0;ke<S.length;ke++)we(ke);return xe}},{key:"drawVerticalBoxPaths",value:function(S){var _=S.indexes,k=S.x;S.y;var T=S.xDivision,B=S.barWidth,W=S.zeroH,ee=S.strokeWidth,de=this.w,fe=new z(this.ctx),xe=_.i,we=_.j,ke=!0,Me=de.config.plotOptions.candlestick.colors.upward,Ye=de.config.plotOptions.candlestick.colors.downward,Fe="";this.isBoxPlot&&(Fe=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var st=this.yRatio[_.translationsIndex],se=_.realIndex,Se=this.getOHLCValue(se,we),De=W,Le=W;Se.o>Se.c&&(ke=!1);var _e=Math.min(Se.o,Se.c),nt=Math.max(Se.o,Se.c),lt=Se.m;de.globals.isXNumeric&&(k=(de.globals.seriesX[se][we]-de.globals.minX)/this.xRatio-B/2);var bt=k+B*this.visibleI;this.series[xe][we]===void 0||this.series[xe][we]===null?(_e=W,nt=W):(_e=W-_e/st,nt=W-nt/st,De=W-Se.h/st,Le=W-Se.l/st,lt=W-Se.m/st);var Zt=fe.move(bt,W),Ge=fe.move(bt+B/2,_e);return de.globals.previousPaths.length>0&&(Ge=this.getPreviousPath(se,we,!0)),Zt=this.isBoxPlot?[fe.move(bt,_e)+fe.line(bt+B/2,_e)+fe.line(bt+B/2,De)+fe.line(bt+B/4,De)+fe.line(bt+B-B/4,De)+fe.line(bt+B/2,De)+fe.line(bt+B/2,_e)+fe.line(bt+B,_e)+fe.line(bt+B,lt)+fe.line(bt,lt)+fe.line(bt,_e+ee/2),fe.move(bt,lt)+fe.line(bt+B,lt)+fe.line(bt+B,nt)+fe.line(bt+B/2,nt)+fe.line(bt+B/2,Le)+fe.line(bt+B-B/4,Le)+fe.line(bt+B/4,Le)+fe.line(bt+B/2,Le)+fe.line(bt+B/2,nt)+fe.line(bt,nt)+fe.line(bt,lt)+"z"]:[fe.move(bt,nt)+fe.line(bt+B/2,nt)+fe.line(bt+B/2,De)+fe.line(bt+B/2,nt)+fe.line(bt+B,nt)+fe.line(bt+B,_e)+fe.line(bt+B/2,_e)+fe.line(bt+B/2,Le)+fe.line(bt+B/2,_e)+fe.line(bt,_e)+fe.line(bt,nt-ee/2)],Ge+=fe.move(bt,_e),de.globals.isXNumeric||(k+=T),{pathTo:Zt,pathFrom:Ge,x:k,y:nt,barXPosition:bt,color:this.isBoxPlot?Fe:ke?[Me]:[Ye]}}},{key:"drawHorizontalBoxPaths",value:function(S){var _=S.indexes;S.x;var k=S.y,T=S.yDivision,B=S.barHeight,W=S.zeroW,ee=S.strokeWidth,de=this.w,fe=new z(this.ctx),xe=_.i,we=_.j,ke=this.boxOptions.colors.lower;this.isBoxPlot&&(ke=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var Me=this.invertedYRatio,Ye=_.realIndex,Fe=this.getOHLCValue(Ye,we),st=W,se=W,Se=Math.min(Fe.o,Fe.c),De=Math.max(Fe.o,Fe.c),Le=Fe.m;de.globals.isXNumeric&&(k=(de.globals.seriesX[Ye][we]-de.globals.minX)/this.invertedXRatio-B/2);var _e=k+B*this.visibleI;this.series[xe][we]===void 0||this.series[xe][we]===null?(Se=W,De=W):(Se=W+Se/Me,De=W+De/Me,st=W+Fe.h/Me,se=W+Fe.l/Me,Le=W+Fe.m/Me);var nt=fe.move(W,_e),lt=fe.move(Se,_e+B/2);return de.globals.previousPaths.length>0&&(lt=this.getPreviousPath(Ye,we,!0)),nt=[fe.move(Se,_e)+fe.line(Se,_e+B/2)+fe.line(st,_e+B/2)+fe.line(st,_e+B/2-B/4)+fe.line(st,_e+B/2+B/4)+fe.line(st,_e+B/2)+fe.line(Se,_e+B/2)+fe.line(Se,_e+B)+fe.line(Le,_e+B)+fe.line(Le,_e)+fe.line(Se+ee/2,_e),fe.move(Le,_e)+fe.line(Le,_e+B)+fe.line(De,_e+B)+fe.line(De,_e+B/2)+fe.line(se,_e+B/2)+fe.line(se,_e+B-B/4)+fe.line(se,_e+B/4)+fe.line(se,_e+B/2)+fe.line(De,_e+B/2)+fe.line(De,_e)+fe.line(Le,_e)+"z"],lt+=fe.move(Se,_e),de.globals.isXNumeric||(k+=T),{pathTo:nt,pathFrom:lt,x:De,y:k,barYPosition:_e,color:ke}}},{key:"getOHLCValue",value:function(S,_){var k=this.w;return{o:this.isBoxPlot?k.globals.seriesCandleH[S][_]:k.globals.seriesCandleO[S][_],h:this.isBoxPlot?k.globals.seriesCandleO[S][_]:k.globals.seriesCandleH[S][_],m:k.globals.seriesCandleM[S][_],l:this.isBoxPlot?k.globals.seriesCandleC[S][_]:k.globals.seriesCandleL[S][_],c:this.isBoxPlot?k.globals.seriesCandleL[S][_]:k.globals.seriesCandleC[S][_]}}}]),h}(),jn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"checkColorRange",value:function(){var p=this.w,h=!1,S=p.config.plotOptions[p.config.chart.type];return S.colorScale.ranges.length>0&&S.colorScale.ranges.map(function(_,k){_.from<=0&&(h=!0)}),h}},{key:"getShadeColor",value:function(p,h,S,_){var k=this.w,T=1,B=k.config.plotOptions[p].shadeIntensity,W=this.determineColor(p,h,S);k.globals.hasNegs||_?T=k.config.plotOptions[p].reverseNegativeShade?W.percent<0?W.percent/100*(1.25*B):(1-W.percent/100)*(1.25*B):W.percent<=0?1-(1+W.percent/100)*B:(1-W.percent/100)*B:(T=1-W.percent/100,p==="treemap"&&(T=(1-W.percent/100)*(1.25*B)));var ee=W.color,de=new F;if(k.config.plotOptions[p].enableShades)if(this.w.config.theme.mode==="dark"){var fe=de.shadeColor(-1*T,W.color);ee=F.hexToRgba(F.isColorHex(fe)?fe:F.rgb2hex(fe),k.config.fill.opacity)}else{var xe=de.shadeColor(T,W.color);ee=F.hexToRgba(F.isColorHex(xe)?xe:F.rgb2hex(xe),k.config.fill.opacity)}return{color:ee,colorProps:W}}},{key:"determineColor",value:function(p,h,S){var _=this.w,k=_.globals.series[h][S],T=_.config.plotOptions[p],B=T.colorScale.inverse?S:h;T.distributed&&_.config.chart.type==="treemap"&&(B=S);var W=_.globals.colors[B],ee=null,de=Math.min.apply(Math,N(_.globals.series[h])),fe=Math.max.apply(Math,N(_.globals.series[h]));T.distributed||p!=="heatmap"||(de=_.globals.minY,fe=_.globals.maxY),T.colorScale.min!==void 0&&(de=T.colorScale.min<_.globals.minY?T.colorScale.min:_.globals.minY,fe=T.colorScale.max>_.globals.maxY?T.colorScale.max:_.globals.maxY);var xe=Math.abs(fe)+Math.abs(de),we=100*k/(xe===0?xe-1e-6:xe);return T.colorScale.ranges.length>0&&T.colorScale.ranges.map(function(ke,Me){if(k>=ke.from&&k<=ke.to){W=ke.color,ee=ke.foreColor?ke.foreColor:null,de=ke.from,fe=ke.to;var Ye=Math.abs(fe)+Math.abs(de);we=100*k/(Ye===0?Ye-1e-6:Ye)}}),{color:W,foreColor:ee,percent:we}}},{key:"calculateDataLabels",value:function(p){var h=p.text,S=p.x,_=p.y,k=p.i,T=p.j,B=p.colorProps,W=p.fontSize,ee=this.w.config.dataLabels,de=new z(this.ctx),fe=new Ie(this.ctx),xe=null;if(ee.enabled){xe=de.group({class:"apexcharts-data-labels"});var we=ee.offsetX,ke=ee.offsetY,Me=S+we,Ye=_+parseFloat(ee.style.fontSize)/3+ke;fe.plotDataLabelsText({x:Me,y:Ye,text:h,i:k,j:T,color:B.foreColor,parent:xe,fontSize:W,dataLabelsConfig:ee})}return xe}},{key:"addListeners",value:function(p){var h=new z(this.ctx);p.node.addEventListener("mouseenter",h.pathMouseEnter.bind(this,p)),p.node.addEventListener("mouseleave",h.pathMouseLeave.bind(this,p)),p.node.addEventListener("mousedown",h.pathMouseDown.bind(this,p))}}]),Ee}(),bn=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.w=p.w,this.xRatio=h.xRatio,this.yRatio=h.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new jn(p),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}return o(Ee,[{key:"draw",value:function(p){var h=this.w,S=new z(this.ctx),_=S.group({class:"apexcharts-heatmap"});_.attr("clip-path","url(#gridRectMask".concat(h.globals.cuid,")"));var k=h.globals.gridWidth/h.globals.dataPoints,T=h.globals.gridHeight/h.globals.series.length,B=0,W=!1;this.negRange=this.helpers.checkColorRange();var ee=p.slice();h.config.yaxis[0].reversed&&(W=!0,ee.reverse());for(var de=W?0:ee.length-1;W?de<ee.length:de>=0;W?de++:de--){var fe=S.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:F.escapeString(h.globals.seriesNames[de]),rel:de+1,"data:realIndex":de});if(this.ctx.series.addCollapsedClassToSeries(fe,de),h.config.chart.dropShadow.enabled){var xe=h.config.chart.dropShadow;new L(this.ctx).dropShadow(fe,xe,de)}for(var we=0,ke=h.config.plotOptions.heatmap.shadeIntensity,Me=0;Me<ee[de].length;Me++){var Ye=this.helpers.getShadeColor(h.config.chart.type,de,Me,this.negRange),Fe=Ye.color,st=Ye.colorProps;h.config.fill.type==="image"&&(Fe=new Ae(this.ctx).fillPath({seriesNumber:de,dataPointIndex:Me,opacity:h.globals.hasNegs?st.percent<0?1-(1+st.percent/100):ke+st.percent/100:st.percent/100,patternID:F.randomId(),width:h.config.fill.image.width?h.config.fill.image.width:k,height:h.config.fill.image.height?h.config.fill.image.height:T}));var se=this.rectRadius,Se=S.drawRect(we,B,k,T,se);if(Se.attr({cx:we,cy:B}),Se.node.classList.add("apexcharts-heatmap-rect"),fe.add(Se),Se.attr({fill:Fe,i:de,index:de,j:Me,val:p[de][Me],"stroke-width":this.strokeWidth,stroke:h.config.plotOptions.heatmap.useFillColorAsStroke?Fe:h.globals.stroke.colors[0],color:Fe}),this.helpers.addListeners(Se),h.config.chart.animations.enabled&&!h.globals.dataChanged){var De=1;h.globals.resized||(De=h.config.chart.animations.speed),this.animateHeatMap(Se,we,B,k,T,De)}if(h.globals.dataChanged){var Le=1;if(this.dynamicAnim.enabled&&h.globals.shouldAnimate){Le=this.dynamicAnim.speed;var _e=h.globals.previousPaths[de]&&h.globals.previousPaths[de][Me]&&h.globals.previousPaths[de][Me].color;_e||(_e="rgba(255, 255, 255, 0)"),this.animateHeatColor(Se,F.isColorHex(_e)?_e:F.rgb2hex(_e),F.isColorHex(Fe)?Fe:F.rgb2hex(Fe),Le)}}var nt=(0,h.config.dataLabels.formatter)(h.globals.series[de][Me],{value:h.globals.series[de][Me],seriesIndex:de,dataPointIndex:Me,w:h}),lt=this.helpers.calculateDataLabels({text:nt,x:we+k/2,y:B+T/2,i:de,j:Me,colorProps:st,series:ee});lt!==null&&fe.add(lt),we+=k}B+=T,_.add(fe)}var bt=h.globals.yAxisScale[0].result.slice();return h.config.yaxis[0].reversed?bt.unshift(""):bt.push(""),h.globals.yAxisScale[0].result=bt,_}},{key:"animateHeatMap",value:function(p,h,S,_,k,T){var B=new U(this.ctx);B.animateRect(p,{x:h+_/2,y:S+k/2,width:0,height:0},{x:h,y:S,width:_,height:k},T,function(){B.animationCompleted(p)})}},{key:"animateHeatColor",value:function(p,h,S,_){p.attr({fill:h}).animate(_).attr({fill:S})}}]),Ee}(),Zn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"drawYAxisTexts",value:function(p,h,S,_){var k=this.w,T=k.config.yaxis[0],B=k.globals.yLabelFormatters[0];return new z(this.ctx).drawText({x:p+T.labels.offsetX,y:h+T.labels.offsetY,text:B(_,S),textAnchor:"middle",fontSize:T.labels.style.fontSize,fontFamily:T.labels.style.fontFamily,foreColor:Array.isArray(T.labels.style.colors)?T.labels.style.colors[S]:T.labels.style.colors})}}]),Ee}(),zn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w;var h=this.w;this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=h.globals.stroke.colors!==void 0?h.globals.stroke.colors:h.globals.colors,this.defaultSize=Math.min(h.globals.gridWidth,h.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=h.globals.gridWidth/2,h.config.chart.type==="radialBar"?this.fullAngle=360:this.fullAngle=Math.abs(h.config.plotOptions.pie.endAngle-h.config.plotOptions.pie.startAngle),this.initialAngle=h.config.plotOptions.pie.startAngle%this.fullAngle,h.globals.radialSize=this.defaultSize/2.05-h.config.stroke.width-(h.config.chart.sparkline.enabled?0:h.config.chart.dropShadow.blur),this.donutSize=h.globals.radialSize*parseInt(h.config.plotOptions.pie.donut.size,10)/100;var S=h.config.plotOptions.pie.customScale,_=h.globals.gridWidth/2,k=h.globals.gridHeight/2;this.translateX=_-_*S,this.translateY=k-k*S,this.dataLabelsGroup=new z(this.ctx).group({class:"apexcharts-datalabels-group",transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(S,")")}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}return o(Ee,[{key:"draw",value:function(p){var h=this,S=this.w,_=new z(this.ctx),k=_.group({class:"apexcharts-pie"});if(S.globals.noData)return k;for(var T=0,B=0;B<p.length;B++)T+=F.negToZero(p[B]);var W=[],ee=_.group();T===0&&(T=1e-5),p.forEach(function(se){h.maxY=Math.max(h.maxY,se)}),S.config.yaxis[0].max&&(this.maxY=S.config.yaxis[0].max),S.config.grid.position==="back"&&this.chartType==="polarArea"&&this.drawPolarElements(k);for(var de=0;de<p.length;de++){var fe=this.fullAngle*F.negToZero(p[de])/T;W.push(fe),this.chartType==="polarArea"?(W[de]=this.fullAngle/p.length,this.sliceSizes.push(S.globals.radialSize*p[de]/this.maxY)):this.sliceSizes.push(S.globals.radialSize)}if(S.globals.dataChanged){for(var xe,we=0,ke=0;ke<S.globals.previousPaths.length;ke++)we+=F.negToZero(S.globals.previousPaths[ke]);for(var Me=0;Me<S.globals.previousPaths.length;Me++)xe=this.fullAngle*F.negToZero(S.globals.previousPaths[Me])/we,this.prevSectorAngleArr.push(xe)}if(this.donutSize<0&&(this.donutSize=0),this.chartType==="donut"){var Ye=_.drawCircle(this.donutSize);Ye.attr({cx:this.centerX,cy:this.centerY,fill:S.config.plotOptions.pie.donut.background?S.config.plotOptions.pie.donut.background:"transparent"}),ee.add(Ye)}var Fe=this.drawArcs(W,p);if(this.sliceLabels.forEach(function(se){Fe.add(se)}),ee.attr({transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(S.config.plotOptions.pie.customScale,")")}),ee.add(Fe),k.add(ee),this.donutDataLabels.show){var st=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});k.add(st)}return S.config.grid.position==="front"&&this.chartType==="polarArea"&&this.drawPolarElements(k),k}},{key:"drawArcs",value:function(p,h){var S=this.w,_=new L(this.ctx),k=new z(this.ctx),T=new Ae(this.ctx),B=k.group({class:"apexcharts-slices"}),W=this.initialAngle,ee=this.initialAngle,de=this.initialAngle,fe=this.initialAngle;this.strokeWidth=S.config.stroke.show?S.config.stroke.width:0;for(var xe=0;xe<p.length;xe++){var we=k.group({class:"apexcharts-series apexcharts-pie-series",seriesName:F.escapeString(S.globals.seriesNames[xe]),rel:xe+1,"data:realIndex":xe});B.add(we),ee=fe,de=(W=de)+p[xe],fe=ee+this.prevSectorAngleArr[xe];var ke=de<W?this.fullAngle+de-W:de-W,Me=T.fillPath({seriesNumber:xe,size:this.sliceSizes[xe],value:h[xe]}),Ye=this.getChangedPath(ee,fe),Fe=k.drawPath({d:Ye,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[xe]:this.lineColorArr,strokeWidth:0,fill:Me,fillOpacity:S.config.fill.opacity,classes:"apexcharts-pie-area apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(xe)});if(Fe.attr({index:0,j:xe}),_.setSelectionFilter(Fe,0,xe),S.config.chart.dropShadow.enabled){var st=S.config.chart.dropShadow;_.dropShadow(Fe,st,xe)}this.addListeners(Fe,this.donutDataLabels),z.setAttrs(Fe.node,{"data:angle":ke,"data:startAngle":W,"data:strokeWidth":this.strokeWidth,"data:value":h[xe]});var se={x:0,y:0};this.chartType==="pie"||this.chartType==="polarArea"?se=F.polarToCartesian(this.centerX,this.centerY,S.globals.radialSize/1.25+S.config.plotOptions.pie.dataLabels.offset,(W+ke/2)%this.fullAngle):this.chartType==="donut"&&(se=F.polarToCartesian(this.centerX,this.centerY,(S.globals.radialSize+this.donutSize)/2+S.config.plotOptions.pie.dataLabels.offset,(W+ke/2)%this.fullAngle)),we.add(Fe);var Se=0;if(!this.initialAnim||S.globals.resized||S.globals.dataChanged?this.animBeginArr.push(0):((Se=ke/this.fullAngle*S.config.chart.animations.speed)===0&&(Se=1),this.animDur=Se+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&S.globals.dataChanged?this.animatePaths(Fe,{size:this.sliceSizes[xe],endAngle:de,startAngle:W,prevStartAngle:ee,prevEndAngle:fe,animateStartingPos:!0,i:xe,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:S.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(Fe,{size:this.sliceSizes[xe],endAngle:de,startAngle:W,i:xe,totalItems:p.length-1,animBeginArr:this.animBeginArr,dur:Se}),S.config.plotOptions.pie.expandOnClick&&this.chartType!=="polarArea"&&Fe.node.addEventListener("mouseup",this.pieClicked.bind(this,xe)),S.globals.selectedDataPoints[0]!==void 0&&S.globals.selectedDataPoints[0].indexOf(xe)>-1&&this.pieClicked(xe),S.config.dataLabels.enabled){var De=se.x,Le=se.y,_e=100*ke/this.fullAngle+"%";if(ke!==0&&S.config.plotOptions.pie.dataLabels.minAngleToShowLabel<p[xe]){var nt=S.config.dataLabels.formatter;nt!==void 0&&(_e=nt(S.globals.seriesPercent[xe][0],{seriesIndex:xe,w:S}));var lt=S.globals.dataLabels.style.colors[xe],bt=k.group({class:"apexcharts-datalabels"}),Zt=k.drawText({x:De,y:Le,text:_e,textAnchor:"middle",fontSize:S.config.dataLabels.style.fontSize,fontFamily:S.config.dataLabels.style.fontFamily,fontWeight:S.config.dataLabels.style.fontWeight,foreColor:lt});if(bt.add(Zt),S.config.dataLabels.dropShadow.enabled){var Ge=S.config.dataLabels.dropShadow;_.dropShadow(Zt,Ge)}Zt.node.classList.add("apexcharts-pie-label"),S.config.chart.animations.animate&&S.globals.resized===!1&&(Zt.node.classList.add("apexcharts-pie-label-delay"),Zt.node.style.animationDelay=S.config.chart.animations.speed/940+"s"),this.sliceLabels.push(bt)}}}return B}},{key:"addListeners",value:function(p,h){var S=new z(this.ctx);p.node.addEventListener("mouseenter",S.pathMouseEnter.bind(this,p)),p.node.addEventListener("mouseleave",S.pathMouseLeave.bind(this,p)),p.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this,p.node,h)),p.node.addEventListener("mousedown",S.pathMouseDown.bind(this,p)),this.donutDataLabels.total.showAlways||(p.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,p.node,h)),p.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,p.node,h)))}},{key:"animatePaths",value:function(p,h){var S=this.w,_=h.endAngle<h.startAngle?this.fullAngle+h.endAngle-h.startAngle:h.endAngle-h.startAngle,k=_,T=h.startAngle,B=h.startAngle;h.prevStartAngle!==void 0&&h.prevEndAngle!==void 0&&(T=h.prevEndAngle,k=h.prevEndAngle<h.prevStartAngle?this.fullAngle+h.prevEndAngle-h.prevStartAngle:h.prevEndAngle-h.prevStartAngle),h.i===S.config.series.length-1&&(_+B>this.fullAngle?h.endAngle=h.endAngle-(_+B):_+B<this.fullAngle&&(h.endAngle=h.endAngle+(this.fullAngle-(_+B)))),_===this.fullAngle&&(_=this.fullAngle-.01),this.animateArc(p,T,B,_,k,h)}},{key:"animateArc",value:function(p,h,S,_,k,T){var B,W=this,ee=this.w,de=new U(this.ctx),fe=T.size;(isNaN(h)||isNaN(k))&&(h=S,k=_,T.dur=0);var xe=_,we=S,ke=h<S?this.fullAngle+h-S:h-S;ee.globals.dataChanged&&T.shouldSetPrevPaths&&T.prevEndAngle&&(B=W.getPiePath({me:W,startAngle:T.prevStartAngle,angle:T.prevEndAngle<T.prevStartAngle?this.fullAngle+T.prevEndAngle-T.prevStartAngle:T.prevEndAngle-T.prevStartAngle,size:fe}),p.attr({d:B})),T.dur!==0?p.animate(T.dur,ee.globals.easing,T.animBeginArr[T.i]).afterAll(function(){W.chartType!=="pie"&&W.chartType!=="donut"&&W.chartType!=="polarArea"||this.animate(ee.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":W.strokeWidth}),T.i===ee.config.series.length-1&&de.animationCompleted(p)}).during(function(Me){xe=ke+(_-ke)*Me,T.animateStartingPos&&(xe=k+(_-k)*Me,we=h-k+(S-(h-k))*Me),B=W.getPiePath({me:W,startAngle:we,angle:xe,size:fe}),p.node.setAttribute("data:pathOrig",B),p.attr({d:B})}):(B=W.getPiePath({me:W,startAngle:we,angle:_,size:fe}),T.isTrack||(ee.globals.animationEnded=!0),p.node.setAttribute("data:pathOrig",B),p.attr({d:B,"stroke-width":W.strokeWidth}))}},{key:"pieClicked",value:function(p){var h,S=this.w,_=this,k=_.sliceSizes[p]+(S.config.plotOptions.pie.expandOnClick?4:0),T=S.globals.dom.Paper.select(".apexcharts-".concat(_.chartType.toLowerCase(),"-slice-").concat(p)).members[0];if(T.attr("data:pieClicked")!=="true"){var B=S.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(B,function(fe){fe.setAttribute("data:pieClicked","false");var xe=fe.getAttribute("data:pathOrig");xe&&fe.setAttribute("d",xe)}),S.globals.capturedDataPointIndex=p,T.attr("data:pieClicked","true");var W=parseInt(T.attr("data:startAngle"),10),ee=parseInt(T.attr("data:angle"),10);h=_.getPiePath({me:_,startAngle:W,angle:ee,size:k}),ee!==360&&T.plot(h)}else{T.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(T.node,this.donutDataLabels);var de=T.attr("data:pathOrig");T.attr({d:de})}}},{key:"getChangedPath",value:function(p,h){var S="";return this.dynamicAnim&&this.w.globals.dataChanged&&(S=this.getPiePath({me:this,startAngle:p,angle:h-p,size:this.size})),S}},{key:"getPiePath",value:function(p){var h,S=p.me,_=p.startAngle,k=p.angle,T=p.size,B=new z(this.ctx),W=_,ee=Math.PI*(W-90)/180,de=k+_;Math.ceil(de)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(de=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(de)>this.fullAngle&&(de-=this.fullAngle);var fe=Math.PI*(de-90)/180,xe=S.centerX+T*Math.cos(ee),we=S.centerY+T*Math.sin(ee),ke=S.centerX+T*Math.cos(fe),Me=S.centerY+T*Math.sin(fe),Ye=F.polarToCartesian(S.centerX,S.centerY,S.donutSize,de),Fe=F.polarToCartesian(S.centerX,S.centerY,S.donutSize,W),st=k>180?1:0,se=["M",xe,we,"A",T,T,0,st,1,ke,Me];return h=S.chartType==="donut"?[].concat(se,["L",Ye.x,Ye.y,"A",S.donutSize,S.donutSize,0,st,0,Fe.x,Fe.y,"L",xe,we,"z"]).join(" "):S.chartType==="pie"||S.chartType==="polarArea"?[].concat(se,["L",S.centerX,S.centerY,"L",xe,we]).join(" "):[].concat(se).join(" "),B.roundPathCorners(h,2*this.strokeWidth)}},{key:"drawPolarElements",value:function(p){var h=this.w,S=new ot(this.ctx),_=new z(this.ctx),k=new Zn(this.ctx),T=_.group(),B=_.group(),W=S.niceScale(0,Math.ceil(this.maxY),0),ee=W.result.reverse(),de=W.result.length;this.maxY=W.niceMax;for(var fe=h.globals.radialSize,xe=fe/(de-1),we=0;we<de-1;we++){var ke=_.drawCircle(fe);if(ke.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":h.config.plotOptions.polarArea.rings.strokeWidth,stroke:h.config.plotOptions.polarArea.rings.strokeColor}),h.config.yaxis[0].show){var Me=k.drawYAxisTexts(this.centerX,this.centerY-fe+parseInt(h.config.yaxis[0].labels.style.fontSize,10)/2,we,ee[we]);B.add(Me)}T.add(ke),fe-=xe}this.drawSpokes(p),p.add(T),p.add(B)}},{key:"renderInnerDataLabels",value:function(p,h,S){var _=this.w,k=new z(this.ctx),T=h.total.show;p.node.innerHTML="",p.node.style.opacity=S.opacity;var B,W,ee=S.centerX,de=this.donutDataLabels.total.label?S.centerY:S.centerY-S.centerY/6;B=h.name.color===void 0?_.globals.colors[0]:h.name.color;var fe=h.name.fontSize,xe=h.name.fontFamily,we=h.name.fontWeight;W=h.value.color===void 0?_.config.chart.foreColor:h.value.color;var ke=h.value.formatter,Me="",Ye="";if(T?(B=h.total.color,fe=h.total.fontSize,xe=h.total.fontFamily,we=h.total.fontWeight,Ye=this.donutDataLabels.total.label?h.total.label:"",Me=h.total.formatter(_)):_.globals.series.length===1&&(Me=ke(_.globals.series[0],_),Ye=_.globals.seriesNames[0]),Ye&&(Ye=h.name.formatter(Ye,h.total.show,_)),h.name.show){var Fe=k.drawText({x:ee,y:de+parseFloat(h.name.offsetY),text:Ye,textAnchor:"middle",foreColor:B,fontSize:fe,fontWeight:we,fontFamily:xe});Fe.node.classList.add("apexcharts-datalabel-label"),p.add(Fe)}if(h.value.show){var st=h.name.show?parseFloat(h.value.offsetY)+16:h.value.offsetY,se=k.drawText({x:ee,y:de+st,text:Me,textAnchor:"middle",foreColor:W,fontWeight:h.value.fontWeight,fontSize:h.value.fontSize,fontFamily:h.value.fontFamily});se.node.classList.add("apexcharts-datalabel-value"),p.add(se)}return p}},{key:"printInnerLabels",value:function(p,h,S,_){var k,T=this.w;_?k=p.name.color===void 0?T.globals.colors[parseInt(_.parentNode.getAttribute("rel"),10)-1]:p.name.color:T.globals.series.length>1&&p.total.show&&(k=p.total.color);var B=T.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),W=T.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");S=(0,p.value.formatter)(S,T),_||typeof p.total.formatter!="function"||(S=p.total.formatter(T));var ee=h===p.total.label;h=this.donutDataLabels.total.label?p.name.formatter(h,ee,T):"",B!==null&&(B.textContent=h),W!==null&&(W.textContent=S),B!==null&&(B.style.fill=k)}},{key:"printDataLabelsInner",value:function(p,h){var S=this.w,_=p.getAttribute("data:value"),k=S.globals.seriesNames[parseInt(p.parentNode.getAttribute("rel"),10)-1];S.globals.series.length>1&&this.printInnerLabels(h,k,_,p);var T=S.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");T!==null&&(T.style.opacity=1)}},{key:"drawSpokes",value:function(p){var h=this,S=this.w,_=new z(this.ctx),k=S.config.plotOptions.polarArea.spokes;if(k.strokeWidth!==0){for(var T=[],B=360/S.globals.series.length,W=0;W<S.globals.series.length;W++)T.push(F.polarToCartesian(this.centerX,this.centerY,S.globals.radialSize,S.config.plotOptions.pie.startAngle+B*W));T.forEach(function(ee,de){var fe=_.drawLine(ee.x,ee.y,h.centerX,h.centerY,Array.isArray(k.connectorColors)?k.connectorColors[de]:k.connectorColors);p.add(fe)})}}},{key:"revertDataLabelsInner",value:function(){var p=this.w;if(this.donutDataLabels.show){var h=p.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0],S=this.renderInnerDataLabels(h,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});p.globals.dom.Paper.select(".apexcharts-radialbar, .apexcharts-pie").members[0].add(S)}}}]),Ee}(),$n=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0;var h=this.w;this.graphics=new z(this.ctx),this.lineColorArr=h.globals.stroke.colors!==void 0?h.globals.stroke.colors:h.globals.colors,this.defaultSize=h.globals.svgHeight<h.globals.svgWidth?h.globals.gridHeight:h.globals.gridWidth,this.isLog=h.config.yaxis[0].logarithmic,this.logBase=h.config.yaxis[0].logBase,this.coreUtils=new Q(this.ctx),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,h.globals.maxY,0):h.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):h.globals.minY,this.polygons=h.config.plotOptions.radar.polygons,this.strokeWidth=h.config.stroke.show?h.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-h.config.chart.dropShadow.blur,h.config.xaxis.labels.show&&(this.size=this.size-h.globals.xAxisLabelsWidth/1.75),h.config.plotOptions.radar.size!==void 0&&(this.size=h.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}return o(Ee,[{key:"draw",value:function(p){var h=this,S=this.w,_=new Ae(this.ctx),k=[],T=new Ie(this.ctx);p.length&&(this.dataPointsLen=p[S.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;var B=S.globals.gridWidth/2,W=S.globals.gridHeight/2,ee=B+S.config.plotOptions.radar.offsetX,de=W+S.config.plotOptions.radar.offsetY,fe=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:"translate(".concat(ee||0,", ").concat(de||0,")")}),xe=[],we=null,ke=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),p.forEach(function(Ye,Fe){var st=Ye.length===S.globals.dataPoints,se=h.graphics.group().attr({class:"apexcharts-series","data:longestSeries":st,seriesName:F.escapeString(S.globals.seriesNames[Fe]),rel:Fe+1,"data:realIndex":Fe});h.dataRadiusOfPercent[Fe]=[],h.dataRadius[Fe]=[],h.angleArr[Fe]=[],Ye.forEach(function(Je,We){var wt=Math.abs(h.maxValue-h.minValue);Je-=h.minValue,h.isLog&&(Je=h.coreUtils.getLogVal(h.logBase,Je,0)),h.dataRadiusOfPercent[Fe][We]=Je/wt,h.dataRadius[Fe][We]=h.dataRadiusOfPercent[Fe][We]*h.size,h.angleArr[Fe][We]=We*h.disAngle}),xe=h.getDataPointsPos(h.dataRadius[Fe],h.angleArr[Fe]);var Se=h.createPaths(xe,{x:0,y:0});we=h.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),ke=h.graphics.group({class:"apexcharts-datalabels","data:realIndex":Fe}),S.globals.delayedElements.push({el:we.node,index:Fe});var De={i:Fe,realIndex:Fe,animationDelay:Fe,initialSpeed:S.config.chart.animations.speed,dataChangeSpeed:S.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:S.globals.stroke.colors[Fe],strokeLineCap:S.config.stroke.lineCap},Le=null;S.globals.previousPaths.length>0&&(Le=h.getPreviousPath(Fe));for(var _e=0;_e<Se.linePathsTo.length;_e++){var nt=h.graphics.renderPaths(v(v({},De),{},{pathFrom:Le===null?Se.linePathsFrom[_e]:Le,pathTo:Se.linePathsTo[_e],strokeWidth:Array.isArray(h.strokeWidth)?h.strokeWidth[Fe]:h.strokeWidth,fill:"none",drawShadow:!1}));se.add(nt);var lt=_.fillPath({seriesNumber:Fe}),bt=h.graphics.renderPaths(v(v({},De),{},{pathFrom:Le===null?Se.areaPathsFrom[_e]:Le,pathTo:Se.areaPathsTo[_e],strokeWidth:0,fill:lt,drawShadow:!1}));if(S.config.chart.dropShadow.enabled){var Zt=new L(h.ctx),Ge=S.config.chart.dropShadow;Zt.dropShadow(bt,Object.assign({},Ge,{noUserSpaceOnUse:!0}),Fe)}se.add(bt)}Ye.forEach(function(Je,We){var wt=new ye(h.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:Fe,dataPointIndex:We}),At=h.graphics.drawMarker(xe[We].x,xe[We].y,wt);At.attr("rel",We),At.attr("j",We),At.attr("index",Fe),At.node.setAttribute("default-marker-size",wt.pSize);var Gt=h.graphics.group({class:"apexcharts-series-markers"});Gt&&Gt.add(At),we.add(Gt),se.add(we);var fn=S.config.dataLabels;if(fn.enabled){var Rn=fn.formatter(S.globals.series[Fe][We],{seriesIndex:Fe,dataPointIndex:We,w:S});T.plotDataLabelsText({x:xe[We].x,y:xe[We].y,text:Rn,textAnchor:"middle",i:Fe,j:Fe,parent:ke,offsetCorrection:!1,dataLabelsConfig:v({},fn)})}se.add(ke)}),k.push(se)}),this.drawPolygons({parent:fe}),S.config.xaxis.labels.show){var Me=this.drawXAxisTexts();fe.add(Me)}return k.forEach(function(Ye){fe.add(Ye)}),fe.add(this.yaxisLabels),fe}},{key:"drawPolygons",value:function(p){for(var h=this,S=this.w,_=p.parent,k=new Zn(this.ctx),T=S.globals.yAxisScale[0].result.reverse(),B=T.length,W=[],ee=this.size/(B-1),de=0;de<B;de++)W[de]=ee*de;W.reverse();var fe=[],xe=[];W.forEach(function(we,ke){var Me=F.getPolygonPos(we,h.dataPointsLen),Ye="";Me.forEach(function(Fe,st){if(ke===0){var se=h.graphics.drawLine(Fe.x,Fe.y,0,0,Array.isArray(h.polygons.connectorColors)?h.polygons.connectorColors[st]:h.polygons.connectorColors);xe.push(se)}st===0&&h.yaxisLabelsTextsPos.push({x:Fe.x,y:Fe.y}),Ye+=Fe.x+","+Fe.y+" "}),fe.push(Ye)}),fe.forEach(function(we,ke){var Me=h.polygons.strokeColors,Ye=h.polygons.strokeWidth,Fe=h.graphics.drawPolygon(we,Array.isArray(Me)?Me[ke]:Me,Array.isArray(Ye)?Ye[ke]:Ye,S.globals.radarPolygons.fill.colors[ke]);_.add(Fe)}),xe.forEach(function(we){_.add(we)}),S.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach(function(we,ke){var Me=k.drawYAxisTexts(we.x,we.y,ke,T[ke]);h.yaxisLabels.add(Me)})}},{key:"drawXAxisTexts",value:function(){var p=this,h=this.w,S=h.config.xaxis.labels,_=this.graphics.group({class:"apexcharts-xaxis"}),k=F.getPolygonPos(this.size,this.dataPointsLen);return h.globals.labels.forEach(function(T,B){var W=h.config.xaxis.labels.formatter,ee=new Ie(p.ctx);if(k[B]){var de=p.getTextPos(k[B],p.size),fe=W(T,{seriesIndex:-1,dataPointIndex:B,w:h});ee.plotDataLabelsText({x:de.newX,y:de.newY,text:fe,textAnchor:de.textAnchor,i:B,j:B,parent:_,className:"apexcharts-xaxis-label",color:Array.isArray(S.style.colors)&&S.style.colors[B]?S.style.colors[B]:"#a8a8a8",dataLabelsConfig:v({textAnchor:de.textAnchor,dropShadow:{enabled:!1}},S),offsetCorrection:!1}).on("click",function(xe){if(typeof h.config.chart.events.xAxisLabelClick=="function"){var we=Object.assign({},h,{labelIndex:B});h.config.chart.events.xAxisLabelClick(xe,p.ctx,we)}})}}),_}},{key:"createPaths",value:function(p,h){var S=this,_=[],k=[],T=[],B=[];if(p.length){k=[this.graphics.move(h.x,h.y)],B=[this.graphics.move(h.x,h.y)];var W=this.graphics.move(p[0].x,p[0].y),ee=this.graphics.move(p[0].x,p[0].y);p.forEach(function(de,fe){W+=S.graphics.line(de.x,de.y),ee+=S.graphics.line(de.x,de.y),fe===p.length-1&&(W+="Z",ee+="Z")}),_.push(W),T.push(ee)}return{linePathsFrom:k,linePathsTo:_,areaPathsFrom:B,areaPathsTo:T}}},{key:"getTextPos",value:function(p,h){var S="middle",_=p.x,k=p.y;return Math.abs(p.x)>=10?p.x>0?(S="start",_+=10):p.x<0&&(S="end",_-=10):S="middle",Math.abs(p.y)>=h-10&&(p.y<0?k-=10:p.y>0&&(k+=10)),{textAnchor:S,newX:_,newY:k}}},{key:"getPreviousPath",value:function(p){for(var h=this.w,S=null,_=0;_<h.globals.previousPaths.length;_++){var k=h.globals.previousPaths[_];k.paths.length>0&&parseInt(k.realIndex,10)===parseInt(p,10)&&h.globals.previousPaths[_].paths[0]!==void 0&&(S=h.globals.previousPaths[_].paths[0].d)}return S}},{key:"getDataPointsPos",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.dataPointsLen;p=p||[],h=h||[];for(var _=[],k=0;k<S;k++){var T={};T.x=p[k]*Math.sin(h[k]),T.y=-p[k]*Math.cos(h[k]),_.push(T)}return _}}]),Ee}(),nr=function(Ee){f(h,zn);var p=c(h);function h(S){var _;s(this,h),(_=p.call(this,S)).ctx=S,_.w=S.w,_.animBeginArr=[0],_.animDur=0;var k=_.w;return _.startAngle=k.config.plotOptions.radialBar.startAngle,_.endAngle=k.config.plotOptions.radialBar.endAngle,_.totalAngle=Math.abs(k.config.plotOptions.radialBar.endAngle-k.config.plotOptions.radialBar.startAngle),_.trackStartAngle=k.config.plotOptions.radialBar.track.startAngle,_.trackEndAngle=k.config.plotOptions.radialBar.track.endAngle,_.barLabels=_.w.config.plotOptions.radialBar.barLabels,_.donutDataLabels=_.w.config.plotOptions.radialBar.dataLabels,_.radialDataLabels=_.donutDataLabels,_.trackStartAngle||(_.trackStartAngle=_.startAngle),_.trackEndAngle||(_.trackEndAngle=_.endAngle),_.endAngle===360&&(_.endAngle=359.99),_.margin=parseInt(k.config.plotOptions.radialBar.track.margin,10),_.onBarLabelClick=_.onBarLabelClick.bind(r(_)),_}return o(h,[{key:"draw",value:function(S){var _=this.w,k=new z(this.ctx),T=k.group({class:"apexcharts-radialbar"});if(_.globals.noData)return T;var B=k.group(),W=this.defaultSize/2,ee=_.globals.gridWidth/2,de=this.defaultSize/2.05;_.config.chart.sparkline.enabled||(de=de-_.config.stroke.width-_.config.chart.dropShadow.blur);var fe=_.globals.fill.colors;if(_.config.plotOptions.radialBar.track.show){var xe=this.drawTracks({size:de,centerX:ee,centerY:W,colorArr:fe,series:S});B.add(xe)}var we=this.drawArcs({size:de,centerX:ee,centerY:W,colorArr:fe,series:S}),ke=360;_.config.plotOptions.radialBar.startAngle<0&&(ke=this.totalAngle);var Me=(360-ke)/360;if(_.globals.radialSize=de-de*Me,this.radialDataLabels.value.show){var Ye=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);_.globals.radialSize+=Ye*Me}return B.add(we.g),_.config.plotOptions.radialBar.hollow.position==="front"&&(we.g.add(we.elHollow),we.dataLabels&&we.g.add(we.dataLabels)),T.add(B),T}},{key:"drawTracks",value:function(S){var _=this.w,k=new z(this.ctx),T=k.group({class:"apexcharts-tracks"}),B=new L(this.ctx),W=new Ae(this.ctx),ee=this.getStrokeWidth(S);S.size=S.size-ee/2;for(var de=0;de<S.series.length;de++){var fe=k.group({class:"apexcharts-radialbar-track apexcharts-track"});T.add(fe),fe.attr({rel:de+1}),S.size=S.size-ee-this.margin;var xe=_.config.plotOptions.radialBar.track,we=W.fillPath({seriesNumber:0,size:S.size,fillColors:Array.isArray(xe.background)?xe.background[de]:xe.background,solid:!0}),ke=this.trackStartAngle,Me=this.trackEndAngle;Math.abs(Me)+Math.abs(ke)>=360&&(Me=360-Math.abs(this.startAngle)-.1);var Ye=k.drawPath({d:"",stroke:we,strokeWidth:ee*parseInt(xe.strokeWidth,10)/100,fill:"none",strokeOpacity:xe.opacity,classes:"apexcharts-radialbar-area"});if(xe.dropShadow.enabled){var Fe=xe.dropShadow;B.dropShadow(Ye,Fe)}fe.add(Ye),Ye.attr("id","apexcharts-radialbarTrack-"+de),this.animatePaths(Ye,{centerX:S.centerX,centerY:S.centerY,endAngle:Me,startAngle:ke,size:S.size,i:de,totalItems:2,animBeginArr:0,dur:0,isTrack:!0,easing:_.globals.easing})}return T}},{key:"drawArcs",value:function(S){var _=this.w,k=new z(this.ctx),T=new Ae(this.ctx),B=new L(this.ctx),W=k.group(),ee=this.getStrokeWidth(S);S.size=S.size-ee/2;var de=_.config.plotOptions.radialBar.hollow.background,fe=S.size-ee*S.series.length-this.margin*S.series.length-ee*parseInt(_.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,xe=fe-_.config.plotOptions.radialBar.hollow.margin;_.config.plotOptions.radialBar.hollow.image!==void 0&&(de=this.drawHollowImage(S,W,fe,de));var we=this.drawHollow({size:xe,centerX:S.centerX,centerY:S.centerY,fill:de||"transparent"});if(_.config.plotOptions.radialBar.hollow.dropShadow.enabled){var ke=_.config.plotOptions.radialBar.hollow.dropShadow;B.dropShadow(we,ke)}var Me=1;!this.radialDataLabels.total.show&&_.globals.series.length>1&&(Me=0);var Ye=null;if(this.radialDataLabels.show){var Fe=_.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0];Ye=this.renderInnerDataLabels(Fe,this.radialDataLabels,{hollowSize:fe,centerX:S.centerX,centerY:S.centerY,opacity:Me})}_.config.plotOptions.radialBar.hollow.position==="back"&&(W.add(we),Ye&&W.add(Ye));var st=!1;_.config.plotOptions.radialBar.inverseOrder&&(st=!0);for(var se=st?S.series.length-1:0;st?se>=0:se<S.series.length;st?se--:se++){var Se=k.group({class:"apexcharts-series apexcharts-radial-series",seriesName:F.escapeString(_.globals.seriesNames[se])});W.add(Se),Se.attr({rel:se+1,"data:realIndex":se}),this.ctx.series.addCollapsedClassToSeries(Se,se),S.size=S.size-ee-this.margin;var De=T.fillPath({seriesNumber:se,size:S.size,value:S.series[se]}),Le=this.startAngle,_e=void 0,nt=F.negToZero(S.series[se]>100?100:S.series[se])/100,lt=Math.round(this.totalAngle*nt)+this.startAngle,bt=void 0;_.globals.dataChanged&&(_e=this.startAngle,bt=Math.round(this.totalAngle*F.negToZero(_.globals.previousPaths[se])/100)+_e),Math.abs(lt)+Math.abs(Le)>360&&(lt-=.01),Math.abs(bt)+Math.abs(_e)>360&&(bt-=.01);var Zt=lt-Le,Ge=Array.isArray(_.config.stroke.dashArray)?_.config.stroke.dashArray[se]:_.config.stroke.dashArray,Je=k.drawPath({d:"",stroke:De,strokeWidth:ee,fill:"none",fillOpacity:_.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+se,strokeDashArray:Ge});if(z.setAttrs(Je.node,{"data:angle":Zt,"data:value":S.series[se]}),_.config.chart.dropShadow.enabled){var We=_.config.chart.dropShadow;B.dropShadow(Je,We,se)}if(B.setSelectionFilter(Je,0,se),this.addListeners(Je,this.radialDataLabels),Se.add(Je),Je.attr({index:0,j:se}),this.barLabels.enabled){var wt=F.polarToCartesian(S.centerX,S.centerY,S.size,Le),At=this.barLabels.formatter(_.globals.seriesNames[se],{seriesIndex:se,w:_}),Gt=["apexcharts-radialbar-label"];this.barLabels.onClick||Gt.push("apexcharts-no-click");var fn=this.barLabels.useSeriesColors?_.globals.colors[se]:_.config.chart.foreColor;fn||(fn=_.config.chart.foreColor);var Rn=wt.x+this.barLabels.offsetX,An=wt.y+this.barLabels.offsetY,pr=k.drawText({x:Rn,y:An,text:At,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:fn,cssClass:Gt.join(" ")});pr.on("click",this.onBarLabelClick),pr.attr({rel:se+1}),Le!==0&&pr.attr({"transform-origin":"".concat(Rn," ").concat(An),transform:"rotate(".concat(Le," 0 0)")}),Se.add(pr)}var mt=0;!this.initialAnim||_.globals.resized||_.globals.dataChanged||(mt=_.config.chart.animations.speed),_.globals.dataChanged&&(mt=_.config.chart.animations.dynamicAnimation.speed),this.animDur=mt/(1.2*S.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(Je,{centerX:S.centerX,centerY:S.centerY,endAngle:lt,startAngle:Le,prevEndAngle:bt,prevStartAngle:_e,size:S.size,i:se,totalItems:2,animBeginArr:this.animBeginArr,dur:mt,shouldSetPrevPaths:!0,easing:_.globals.easing})}return{g:W,elHollow:we,dataLabels:Ye}}},{key:"drawHollow",value:function(S){var _=new z(this.ctx).drawCircle(2*S.size);return _.attr({class:"apexcharts-radialbar-hollow",cx:S.centerX,cy:S.centerY,r:S.size,fill:S.fill}),_}},{key:"drawHollowImage",value:function(S,_,k,T){var B=this.w,W=new Ae(this.ctx),ee=F.randomId(),de=B.config.plotOptions.radialBar.hollow.image;if(B.config.plotOptions.radialBar.hollow.imageClipped)W.clippedImgArea({width:k,height:k,image:de,patternID:"pattern".concat(B.globals.cuid).concat(ee)}),T="url(#pattern".concat(B.globals.cuid).concat(ee,")");else{var fe=B.config.plotOptions.radialBar.hollow.imageWidth,xe=B.config.plotOptions.radialBar.hollow.imageHeight;if(fe===void 0&&xe===void 0){var we=B.globals.dom.Paper.image(de).loaded(function(Me){this.move(S.centerX-Me.width/2+B.config.plotOptions.radialBar.hollow.imageOffsetX,S.centerY-Me.height/2+B.config.plotOptions.radialBar.hollow.imageOffsetY)});_.add(we)}else{var ke=B.globals.dom.Paper.image(de).loaded(function(Me){this.move(S.centerX-fe/2+B.config.plotOptions.radialBar.hollow.imageOffsetX,S.centerY-xe/2+B.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(fe,xe)});_.add(ke)}}return T}},{key:"getStrokeWidth",value:function(S){var _=this.w;return S.size*(100-parseInt(_.config.plotOptions.radialBar.hollow.size,10))/100/(S.series.length+1)-this.margin}},{key:"onBarLabelClick",value:function(S){var _=parseInt(S.target.getAttribute("rel"),10)-1,k=this.barLabels.onClick,T=this.w;k&&k(T.globals.seriesNames[_],{w:T,seriesIndex:_})}}]),h}(),wn=function(Ee){f(h,un);var p=c(h);function h(){return s(this,h),p.apply(this,arguments)}return o(h,[{key:"draw",value:function(S,_){var k=this.w,T=new z(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=S,this.seriesRangeStart=k.globals.seriesRangeStart,this.seriesRangeEnd=k.globals.seriesRangeEnd,this.barHelpers.initVariables(S);for(var B=T.group({class:"apexcharts-rangebar-series apexcharts-plot-series"}),W=0;W<S.length;W++){var ee,de,fe,xe,we=void 0,ke=void 0,Me=k.globals.comboCharts?_[W]:W,Ye=this.barHelpers.getGroupIndex(Me).columnGroupIndex,Fe=T.group({class:"apexcharts-series",seriesName:F.escapeString(k.globals.seriesNames[Me]),rel:W+1,"data:realIndex":Me});this.ctx.series.addCollapsedClassToSeries(Fe,Me),S[W].length>0&&(this.visibleI=this.visibleI+1);var st=0,se=0,Se=0;this.yRatio.length>1&&(this.yaxisIndex=k.globals.seriesYAxisReverseMap[Me][0],Se=Me);var De=this.barHelpers.initialPositions();ke=De.y,xe=De.zeroW,we=De.x,se=De.barWidth,st=De.barHeight,ee=De.xDivision,de=De.yDivision,fe=De.zeroH;for(var Le=T.group({class:"apexcharts-datalabels","data:realIndex":Me}),_e=T.group({class:"apexcharts-rangebar-goals-markers"}),nt=0;nt<k.globals.dataPoints;nt++){var lt=this.barHelpers.getStrokeWidth(W,nt,Me),bt=this.seriesRangeStart[W][nt],Zt=this.seriesRangeEnd[W][nt],Ge=null,Je=null,We=null,wt={x:we,y:ke,strokeWidth:lt,elSeries:Fe},At=this.seriesLen;if(k.config.plotOptions.bar.rangeBarGroupRows&&(At=1),k.config.series[W].data[nt]===void 0)break;if(this.isHorizontal){We=ke+st*this.visibleI;var Gt=(de-st*At)/2;if(k.config.series[W].data[nt].x){var fn=this.detectOverlappingBars({i:W,j:nt,barYPosition:We,srty:Gt,barHeight:st,yDivision:de,initPositions:De});st=fn.barHeight,We=fn.barYPosition}se=(Ge=this.drawRangeBarPaths(v({indexes:{i:W,j:nt,realIndex:Me},barHeight:st,barYPosition:We,zeroW:xe,yDivision:de,y1:bt,y2:Zt},wt))).barWidth}else{k.globals.isXNumeric&&(we=(k.globals.seriesX[W][nt]-k.globals.minX)/this.xRatio-se/2),Je=we+se*this.visibleI;var Rn=(ee-se*At)/2;if(k.config.series[W].data[nt].x){var An=this.detectOverlappingBars({i:W,j:nt,barXPosition:Je,srtx:Rn,barWidth:se,xDivision:ee,initPositions:De});se=An.barWidth,Je=An.barXPosition}st=(Ge=this.drawRangeColumnPaths(v({indexes:{i:W,j:nt,realIndex:Me,translationsIndex:Se},barWidth:se,barXPosition:Je,zeroH:fe,xDivision:ee},wt))).barHeight}var pr=this.barHelpers.drawGoalLine({barXPosition:Ge.barXPosition,barYPosition:We,goalX:Ge.goalX,goalY:Ge.goalY,barHeight:st,barWidth:se});pr&&_e.add(pr),ke=Ge.y,we=Ge.x;var mt=this.barHelpers.getPathFillColor(S,W,nt,Me),qt=k.globals.stroke.colors[Me];this.renderSeries({realIndex:Me,pathFill:mt,lineFill:qt,j:nt,i:W,x:we,y:ke,y1:bt,y2:Zt,pathFrom:Ge.pathFrom,pathTo:Ge.pathTo,strokeWidth:lt,elSeries:Fe,series:S,barHeight:st,barWidth:se,barXPosition:Je,barYPosition:We,columnGroupIndex:Ye,elDataLabelsWrap:Le,elGoalsMarkers:_e,visibleSeries:this.visibleI,type:"rangebar"})}B.add(Fe)}return B}},{key:"detectOverlappingBars",value:function(S){var _=S.i,k=S.j,T=S.barYPosition,B=S.barXPosition,W=S.srty,ee=S.srtx,de=S.barHeight,fe=S.barWidth,xe=S.yDivision,we=S.xDivision,ke=S.initPositions,Me=this.w,Ye=[],Fe=Me.config.series[_].data[k].rangeName,st=Me.config.series[_].data[k].x,se=Array.isArray(st)?st.join(" "):st,Se=Me.globals.labels.map(function(Le){return Array.isArray(Le)?Le.join(" "):Le}).indexOf(se),De=Me.globals.seriesRange[_].findIndex(function(Le){return Le.x===se&&Le.overlaps.length>0});return this.isHorizontal?(T=Me.config.plotOptions.bar.rangeBarGroupRows?W+xe*Se:W+de*this.visibleI+xe*Se,De>-1&&!Me.config.plotOptions.bar.rangeBarOverlap&&(Ye=Me.globals.seriesRange[_][De].overlaps).indexOf(Fe)>-1&&(T=(de=ke.barHeight/Ye.length)*this.visibleI+xe*(100-parseInt(this.barOptions.barHeight,10))/100/2+de*(this.visibleI+Ye.indexOf(Fe))+xe*Se)):(Se>-1&&!Me.globals.timescaleLabels.length&&(B=Me.config.plotOptions.bar.rangeBarGroupRows?ee+we*Se:ee+fe*this.visibleI+we*Se),De>-1&&!Me.config.plotOptions.bar.rangeBarOverlap&&(Ye=Me.globals.seriesRange[_][De].overlaps).indexOf(Fe)>-1&&(B=(fe=ke.barWidth/Ye.length)*this.visibleI+we*(100-parseInt(this.barOptions.barWidth,10))/100/2+fe*(this.visibleI+Ye.indexOf(Fe))+we*Se)),{barYPosition:T,barXPosition:B,barHeight:de,barWidth:fe}}},{key:"drawRangeColumnPaths",value:function(S){var _=S.indexes,k=S.x,T=S.xDivision,B=S.barWidth,W=S.barXPosition,ee=S.zeroH,de=this.w,fe=_.i,xe=_.j,we=_.realIndex,ke=_.translationsIndex,Me=this.yRatio[ke],Ye=this.getRangeValue(we,xe),Fe=Math.min(Ye.start,Ye.end),st=Math.max(Ye.start,Ye.end);this.series[fe][xe]===void 0||this.series[fe][xe]===null?Fe=ee:(Fe=ee-Fe/Me,st=ee-st/Me);var se=Math.abs(st-Fe),Se=this.barHelpers.getColumnPaths({barXPosition:W,barWidth:B,y1:Fe,y2:st,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:we,i:we,j:xe,w:de});if(de.globals.isXNumeric){var De=this.getBarXForNumericXAxis({x:k,j:xe,realIndex:we,barWidth:B});k=De.x,W=De.barXPosition}else k+=T;return{pathTo:Se.pathTo,pathFrom:Se.pathFrom,barHeight:se,x:k,y:Ye.start<0&&Ye.end<0?Fe:st,goalY:this.barHelpers.getGoalValues("y",null,ee,fe,xe,ke),barXPosition:W}}},{key:"preventBarOverflow",value:function(S){var _=this.w;return S<0&&(S=0),S>_.globals.gridWidth&&(S=_.globals.gridWidth),S}},{key:"drawRangeBarPaths",value:function(S){var _=S.indexes,k=S.y,T=S.y1,B=S.y2,W=S.yDivision,ee=S.barHeight,de=S.barYPosition,fe=S.zeroW,xe=this.w,we=_.realIndex,ke=_.j,Me=this.preventBarOverflow(fe+T/this.invertedYRatio),Ye=this.preventBarOverflow(fe+B/this.invertedYRatio),Fe=this.getRangeValue(we,ke),st=Math.abs(Ye-Me),se=this.barHelpers.getBarpaths({barYPosition:de,barHeight:ee,x1:Me,x2:Ye,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:we,realIndex:we,j:ke,w:xe});return xe.globals.isXNumeric||(k+=W),{pathTo:se.pathTo,pathFrom:se.pathFrom,barWidth:st,x:Fe.start<0&&Fe.end<0?Me:Ye,goalX:this.barHelpers.getGoalValues("x",fe,null,we,ke),y:k}}},{key:"getRangeValue",value:function(S,_){var k=this.w;return{start:k.globals.seriesRangeStart[S][_],end:k.globals.seriesRangeEnd[S][_]}}}]),h}(),on=function(){function Ee(p){s(this,Ee),this.w=p.w,this.lineCtx=p}return o(Ee,[{key:"sameValueSeriesFix",value:function(p,h){var S=this.w;if((S.config.fill.type==="gradient"||S.config.fill.type[p]==="gradient")&&new Q(this.lineCtx.ctx,S).seriesHaveSameValues(p)){var _=h[p].slice();_[_.length-1]=_[_.length-1]+1e-6,h[p]=_}return h}},{key:"calculatePoints",value:function(p){var h=p.series,S=p.realIndex,_=p.x,k=p.y,T=p.i,B=p.j,W=p.prevY,ee=this.w,de=[],fe=[];if(B===0){var xe=this.lineCtx.categoryAxisCorrection+ee.config.markers.offsetX;ee.globals.isXNumeric&&(xe=(ee.globals.seriesX[S][0]-ee.globals.minX)/this.lineCtx.xRatio+ee.config.markers.offsetX),de.push(xe),fe.push(F.isNumber(h[T][0])?W+ee.config.markers.offsetY:null),de.push(_+ee.config.markers.offsetX),fe.push(F.isNumber(h[T][B+1])?k+ee.config.markers.offsetY:null)}else de.push(_+ee.config.markers.offsetX),fe.push(F.isNumber(h[T][B+1])?k+ee.config.markers.offsetY:null);return{x:de,y:fe}}},{key:"checkPreviousPaths",value:function(p){for(var h=p.pathFromLine,S=p.pathFromArea,_=p.realIndex,k=this.w,T=0;T<k.globals.previousPaths.length;T++){var B=k.globals.previousPaths[T];(B.type==="line"||B.type==="area")&&B.paths.length>0&&parseInt(B.realIndex,10)===parseInt(_,10)&&(B.type==="line"?(this.lineCtx.appendPathFrom=!1,h=k.globals.previousPaths[T].paths[0].d):B.type==="area"&&(this.lineCtx.appendPathFrom=!1,S=k.globals.previousPaths[T].paths[0].d,k.config.stroke.show&&k.globals.previousPaths[T].paths[1]&&(h=k.globals.previousPaths[T].paths[1].d)))}return{pathFromLine:h,pathFromArea:S}}},{key:"determineFirstPrevY",value:function(p){var h,S,_,k=p.i,T=p.realIndex,B=p.series,W=p.prevY,ee=p.lineYPosition,de=p.translationsIndex,fe=this.w,xe=fe.config.chart.stacked&&!fe.globals.comboCharts||fe.config.chart.stacked&&fe.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((h=this.w.config.series[T])===null||h===void 0?void 0:h.type)==="bar"||((S=this.w.config.series[T])===null||S===void 0?void 0:S.type)==="column");if(((_=B[k])===null||_===void 0?void 0:_[0])!==void 0)W=(ee=xe&&k>0?this.lineCtx.prevSeriesY[k-1][0]:this.lineCtx.zeroY)-B[k][0]/this.lineCtx.yRatio[de]+2*(this.lineCtx.isReversed?B[k][0]/this.lineCtx.yRatio[de]:0);else if(xe&&k>0&&B[k][0]===void 0){for(var we=k-1;we>=0;we--)if(B[we][0]!==null&&B[we][0]!==void 0){W=ee=this.lineCtx.prevSeriesY[we][0];break}}return{prevY:W,lineYPosition:ee}}}]),Ee}(),Oe=function(Ee){for(var p,h,S,_,k=function(de){for(var fe=[],xe=de[0],we=de[1],ke=fe[0]=_t(xe,we),Me=1,Ye=de.length-1;Me<Ye;Me++)xe=we,we=de[Me+1],fe[Me]=.5*(ke+(ke=_t(xe,we)));return fe[Me]=ke,fe}(Ee),T=Ee.length-1,B=[],W=0;W<T;W++)S=_t(Ee[W],Ee[W+1]),Math.abs(S)<1e-6?k[W]=k[W+1]=0:(_=(p=k[W]/S)*p+(h=k[W+1]/S)*h)>9&&(_=3*S/Math.sqrt(_),k[W]=_*p,k[W+1]=_*h);for(var ee=0;ee<=T;ee++)_=(Ee[Math.min(T,ee+1)][0]-Ee[Math.max(0,ee-1)][0])/(6*(1+k[ee]*k[ee])),B.push([_||0,k[ee]*_||0]);return B},rn=function(Ee){var p=Oe(Ee),h=Ee[1],S=Ee[0],_=[],k=p[1],T=p[0];_.push(S,[S[0]+T[0],S[1]+T[1],h[0]-k[0],h[1]-k[1],h[0],h[1]]);for(var B=2,W=p.length;B<W;B++){var ee=Ee[B],de=p[B];_.push([ee[0]-de[0],ee[1]-de[1],ee[0],ee[1]])}return _},cn=function(Ee,p,h){var S=Ee.slice(p,h);if(p){if(h-p>1&&S[1].length<6){var _=S[0].length;S[1]=[2*S[0][_-2]-S[0][_-4],2*S[0][_-1]-S[0][_-3]].concat(S[1])}S[0]=S[0].slice(-2)}return S};function _t(Ee,p){return(p[1]-Ee[1])/(p[0]-Ee[0])}var Yn=function(){function Ee(p,h,S){s(this,Ee),this.ctx=p,this.w=p.w,this.xyRatios=h,this.pointsChart=!(this.w.config.chart.type!=="bubble"&&this.w.config.chart.type!=="scatter")||S,this.scatter=new je(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new on(this),this.markers=new ye(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return o(Ee,[{key:"draw",value:function(p,h,S,_){var k,T=this.w,B=new z(this.ctx),W=T.globals.comboCharts?h:T.config.chart.type,ee=B.group({class:"apexcharts-".concat(W,"-series apexcharts-plot-series")}),de=new Q(this.ctx,T);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,p=de.getLogSeries(p),this.yRatio=de.getLogYRatios(this.yRatio),this.prevSeriesY=[];for(var fe=[],xe=0;xe<p.length;xe++){p=this.lineHelpers.sameValueSeriesFix(xe,p);var we=T.globals.comboCharts?S[xe]:xe,ke=this.yRatio.length>1?we:0;this._initSerieVariables(p,xe,we);var Me=[],Ye=[],Fe=[],st=T.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,we),T.globals.isXNumeric&&T.globals.seriesX.length>0&&(st=(T.globals.seriesX[we][0]-T.globals.minX)/this.xRatio),Fe.push(st);var se,Se=st,De=void 0,Le=Se,_e=this.zeroY,nt=this.zeroY;_e=this.lineHelpers.determineFirstPrevY({i:xe,realIndex:we,series:p,prevY:_e,lineYPosition:0,translationsIndex:ke}).prevY,T.config.stroke.curve==="monotoneCubic"&&p[xe][0]===null?Me.push(null):Me.push(_e),se=_e,W==="rangeArea"&&(De=nt=this.lineHelpers.determineFirstPrevY({i:xe,realIndex:we,series:_,prevY:nt,lineYPosition:0,translationsIndex:ke}).prevY,Ye.push(Me[0]!==null?nt:null));var lt=this._calculatePathsFrom({type:W,series:p,i:xe,realIndex:we,translationsIndex:ke,prevX:Le,prevY:_e,prevY2:nt}),bt=[Me[0]],Zt=[Ye[0]],Ge={type:W,series:p,realIndex:we,translationsIndex:ke,i:xe,x:st,y:1,pX:Se,pY:se,pathsFrom:lt,linePaths:[],areaPaths:[],seriesIndex:S,lineYPosition:0,xArrj:Fe,yArrj:Me,y2Arrj:Ye,seriesRangeEnd:_},Je=this._iterateOverDataPoints(v(v({},Ge),{},{iterations:W==="rangeArea"?p[xe].length-1:void 0,isRangeStart:!0}));if(W==="rangeArea"){for(var We=this._calculatePathsFrom({series:_,i:xe,realIndex:we,prevX:Le,prevY:nt}),wt=this._iterateOverDataPoints(v(v({},Ge),{},{series:_,xArrj:[st],yArrj:bt,y2Arrj:Zt,pY:De,areaPaths:Je.areaPaths,pathsFrom:We,iterations:_[xe].length-1,isRangeStart:!1})),At=Je.linePaths.length/2,Gt=0;Gt<At;Gt++)Je.linePaths[Gt]=wt.linePaths[Gt+At]+Je.linePaths[Gt];Je.linePaths.splice(At),Je.pathFromLine=wt.pathFromLine+Je.pathFromLine}else Je.pathFromArea+="z";this._handlePaths({type:W,realIndex:we,i:xe,paths:Je}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),fe.push(this.elSeries)}if(((k=T.config.series[0])===null||k===void 0?void 0:k.zIndex)!==void 0&&fe.sort(function(An,pr){return Number(An.node.getAttribute("zIndex"))-Number(pr.node.getAttribute("zIndex"))}),T.config.chart.stacked)for(var fn=fe.length-1;fn>=0;fn--)ee.add(fe[fn]);else for(var Rn=0;Rn<fe.length;Rn++)ee.add(fe[Rn]);return ee}},{key:"_initSerieVariables",value:function(p,h,S){var _=this.w,k=new z(this.ctx);this.xDivision=_.globals.gridWidth/(_.globals.dataPoints-(_.config.xaxis.tickPlacement==="on"?1:0)),this.strokeWidth=Array.isArray(_.config.stroke.width)?_.config.stroke.width[S]:_.config.stroke.width;var T=0;this.yRatio.length>1&&(this.yaxisIndex=_.globals.seriesYAxisReverseMap[S],T=S),this.isReversed=_.config.yaxis[this.yaxisIndex]&&_.config.yaxis[this.yaxisIndex].reversed,this.zeroY=_.globals.gridHeight-this.baseLineY[T]-(this.isReversed?_.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[T]:0),this.areaBottomY=this.zeroY,(this.zeroY>_.globals.gridHeight||_.config.plotOptions.area.fillTo==="end")&&(this.areaBottomY=_.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=k.group({class:"apexcharts-series",zIndex:_.config.series[S].zIndex!==void 0?_.config.series[S].zIndex:S,seriesName:F.escapeString(_.globals.seriesNames[S])}),this.elPointsMain=k.group({class:"apexcharts-series-markers-wrap","data:realIndex":S}),this.elDataLabelsWrap=k.group({class:"apexcharts-datalabels","data:realIndex":S});var B=p[h].length===_.globals.dataPoints;this.elSeries.attr({"data:longestSeries":B,rel:h+1,"data:realIndex":S}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(p){var h,S,_,k,T=p.type,B=p.series,W=p.i,ee=p.realIndex,de=p.translationsIndex,fe=p.prevX,xe=p.prevY,we=p.prevY2,ke=this.w,Me=new z(this.ctx);if(B[W][0]===null){for(var Ye=0;Ye<B[W].length;Ye++)if(B[W][Ye]!==null){fe=this.xDivision*Ye,xe=this.zeroY-B[W][Ye]/this.yRatio[de],h=Me.move(fe,xe),S=Me.move(fe,this.areaBottomY);break}}else h=Me.move(fe,xe),T==="rangeArea"&&(h=Me.move(fe,we)+Me.line(fe,xe)),S=Me.move(fe,this.areaBottomY)+Me.line(fe,xe);if(_=Me.move(0,this.zeroY)+Me.line(0,this.zeroY),k=Me.move(0,this.zeroY)+Me.line(0,this.zeroY),ke.globals.previousPaths.length>0){var Fe=this.lineHelpers.checkPreviousPaths({pathFromLine:_,pathFromArea:k,realIndex:ee});_=Fe.pathFromLine,k=Fe.pathFromArea}return{prevX:fe,prevY:xe,linePath:h,areaPath:S,pathFromLine:_,pathFromArea:k}}},{key:"_handlePaths",value:function(p){var h=p.type,S=p.realIndex,_=p.i,k=p.paths,T=this.w,B=new z(this.ctx),W=new Ae(this.ctx);this.prevSeriesY.push(k.yArrj),T.globals.seriesXvalues[S]=k.xArrj,T.globals.seriesYvalues[S]=k.yArrj;var ee=T.config.forecastDataPoints;if(ee.count>0&&h!=="rangeArea"){var de=T.globals.seriesXvalues[S][T.globals.seriesXvalues[S].length-ee.count-1],fe=B.drawRect(de,0,T.globals.gridWidth,T.globals.gridHeight,0);T.globals.dom.elForecastMask.appendChild(fe.node);var xe=B.drawRect(0,0,de,T.globals.gridHeight,0);T.globals.dom.elNonForecastMask.appendChild(xe.node)}this.pointsChart||T.globals.delayedElements.push({el:this.elPointsMain.node,index:S});var we={i:_,realIndex:S,animationDelay:_,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:T.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(h)};if(h==="area")for(var ke=W.fillPath({seriesNumber:S}),Me=0;Me<k.areaPaths.length;Me++){var Ye=B.renderPaths(v(v({},we),{},{pathFrom:k.pathFromArea,pathTo:k.areaPaths[Me],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:ke}));this.elSeries.add(Ye)}if(T.config.stroke.show&&!this.pointsChart){var Fe=null;if(h==="line")Fe=W.fillPath({seriesNumber:S,i:_});else if(T.config.stroke.fill.type==="solid")Fe=T.globals.stroke.colors[S];else{var st=T.config.fill;T.config.fill=T.config.stroke.fill,Fe=W.fillPath({seriesNumber:S,i:_}),T.config.fill=st}for(var se=0;se<k.linePaths.length;se++){var Se=Fe;h==="rangeArea"&&(Se=W.fillPath({seriesNumber:S}));var De=v(v({},we),{},{pathFrom:k.pathFromLine,pathTo:k.linePaths[se],stroke:Fe,strokeWidth:this.strokeWidth,strokeLineCap:T.config.stroke.lineCap,fill:h==="rangeArea"?Se:"none"}),Le=B.renderPaths(De);if(this.elSeries.add(Le),Le.attr("fill-rule","evenodd"),ee.count>0&&h!=="rangeArea"){var _e=B.renderPaths(De);_e.node.setAttribute("stroke-dasharray",ee.dashArray),ee.strokeWidth&&_e.node.setAttribute("stroke-width",ee.strokeWidth),this.elSeries.add(_e),_e.attr("clip-path","url(#forecastMask".concat(T.globals.cuid,")")),Le.attr("clip-path","url(#nonForecastMask".concat(T.globals.cuid,")"))}}}}},{key:"_iterateOverDataPoints",value:function(p){var h,S,_=this,k=p.type,T=p.series,B=p.iterations,W=p.realIndex,ee=p.translationsIndex,de=p.i,fe=p.x,xe=p.y,we=p.pX,ke=p.pY,Me=p.pathsFrom,Ye=p.linePaths,Fe=p.areaPaths,st=p.seriesIndex,se=p.lineYPosition,Se=p.xArrj,De=p.yArrj,Le=p.y2Arrj,_e=p.isRangeStart,nt=p.seriesRangeEnd,lt=this.w,bt=new z(this.ctx),Zt=this.yRatio,Ge=Me.prevY,Je=Me.linePath,We=Me.areaPath,wt=Me.pathFromLine,At=Me.pathFromArea,Gt=F.isNumber(lt.globals.minYArr[W])?lt.globals.minYArr[W]:lt.globals.minY;B||(B=lt.globals.dataPoints>1?lt.globals.dataPoints-1:lt.globals.dataPoints);var fn=function(gr,Ir){return Ir-gr/Zt[ee]+2*(_.isReversed?gr/Zt[ee]:0)},Rn=xe,An=lt.config.chart.stacked&&!lt.globals.comboCharts||lt.config.chart.stacked&<.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((h=this.w.config.series[W])===null||h===void 0?void 0:h.type)==="bar"||((S=this.w.config.series[W])===null||S===void 0?void 0:S.type)==="column"),pr=lt.config.stroke.curve;Array.isArray(pr)&&(pr=Array.isArray(st)?pr[st[de]]:pr[de]);for(var mt,qt=0,Qt=0;Qt<B;Qt++){var In=T[de][Qt+1]===void 0||T[de][Qt+1]===null;if(lt.globals.isXNumeric){var or=lt.globals.seriesX[W][Qt+1];lt.globals.seriesX[W][Qt+1]===void 0&&(or=lt.globals.seriesX[W][B-1]),fe=(or-lt.globals.minX)/this.xRatio}else fe+=this.xDivision;An?de>0&<.globals.collapsedSeries.length<lt.config.series.length-1?se=this.prevSeriesY[function(gr){for(var Ir=gr;Ir>0;Ir--){if(!(lt.globals.collapsedSeriesIndices.indexOf((st==null?void 0:st[Ir])||Ir)>-1))return Ir;Ir--}return 0}(de-1)][Qt+1]:se=this.zeroY:se=this.zeroY,In?xe=fn(Gt,se):(xe=fn(T[de][Qt+1],se),k==="rangeArea"&&(Rn=fn(nt[de][Qt+1],se))),Se.push(fe),!In||lt.config.stroke.curve!=="smooth"&<.config.stroke.curve!=="monotoneCubic"?(De.push(xe),Le.push(Rn)):(De.push(null),Le.push(null));var Wn=this.lineHelpers.calculatePoints({series:T,x:fe,y:xe,realIndex:W,i:de,j:Qt,prevY:Ge}),Vn=this._createPaths({type:k,series:T,i:de,realIndex:W,j:Qt,x:fe,y:xe,y2:Rn,xArrj:Se,yArrj:De,y2Arrj:Le,pX:we,pY:ke,pathState:qt,segmentStartX:mt,linePath:Je,areaPath:We,linePaths:Ye,areaPaths:Fe,curve:pr,isRangeStart:_e});Fe=Vn.areaPaths,Ye=Vn.linePaths,we=Vn.pX,ke=Vn.pY,qt=Vn.pathState,mt=Vn.segmentStartX,We=Vn.areaPath,Je=Vn.linePath,!this.appendPathFrom||pr==="monotoneCubic"&&k==="rangeArea"||(wt+=bt.line(fe,this.zeroY),At+=bt.line(fe,this.zeroY)),this.handleNullDataPoints(T,Wn,de,Qt,W),this._handleMarkersAndLabels({type:k,pointsPos:Wn,i:de,j:Qt,realIndex:W,isRangeStart:_e})}return{yArrj:De,xArrj:Se,pathFromArea:At,areaPaths:Fe,pathFromLine:wt,linePaths:Ye,linePath:Je,areaPath:We}}},{key:"_handleMarkersAndLabels",value:function(p){var h=p.type,S=p.pointsPos,_=p.isRangeStart,k=p.i,T=p.j,B=p.realIndex,W=this.w,ee=new Ie(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,T,{realIndex:B,pointsPos:S,zRatio:this.zRatio,elParent:this.elPointsMain});else{W.globals.series[k].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");var de=this.markers.plotChartMarkers(S,B,T+1);de!==null&&this.elPointsMain.add(de)}var fe=ee.drawDataLabel({type:h,isRangeStart:_,pos:S,i:B,j:T+1});fe!==null&&this.elDataLabelsWrap.add(fe)}},{key:"_createPaths",value:function(p){var h=p.type,S=p.series,_=p.i;p.realIndex;var k,T=p.j,B=p.x,W=p.y,ee=p.xArrj,de=p.yArrj,fe=p.y2,xe=p.y2Arrj,we=p.pX,ke=p.pY,Me=p.pathState,Ye=p.segmentStartX,Fe=p.linePath,st=p.areaPath,se=p.linePaths,Se=p.areaPaths,De=p.curve,Le=p.isRangeStart,_e=new z(this.ctx),nt=this.areaBottomY,lt=h==="rangeArea",bt=h==="rangeArea"&&Le;switch(De){case"monotoneCubic":var Zt=Le?de:xe;switch(Me){case 0:if(Zt[T+1]===null)break;Me=1;case 1:if(!(lt?ee.length===S[_].length:T===S[_].length-2))break;case 2:var Ge=Le?ee:ee.slice().reverse(),Je=Le?Zt:Zt.slice().reverse(),We=(k=Je,Ge.map(function(or,Wn){return[or,k[Wn]]}).filter(function(or){return or[1]!==null})),wt=We.length>1?rn(We):We,At=[];lt&&(bt?Se=We:At=Se.reverse());var Gt=0,fn=0;if(function(or,Wn){for(var Vn=function(Lr){var Ht=[],nn=0;return Lr.forEach(function(Sr){Sr!==null?nn++:nn>0&&(Ht.push(nn),nn=0)}),nn>0&&Ht.push(nn),Ht}(or),gr=[],Ir=0,Fr=0;Ir<Vn.length;Fr+=Vn[Ir++])gr[Ir]=cn(Wn,Fr,Fr+Vn[Ir]);return gr}(Je,wt).forEach(function(or){Gt++;var Wn=function(Ir){for(var Fr="",Lr=0;Lr<Ir.length;Lr++){var Ht=Ir[Lr],nn=Ht.length;nn>4?(Fr+="C".concat(Ht[0],", ").concat(Ht[1]),Fr+=", ".concat(Ht[2],", ").concat(Ht[3]),Fr+=", ".concat(Ht[4],", ").concat(Ht[5])):nn>2&&(Fr+="S".concat(Ht[0],", ").concat(Ht[1]),Fr+=", ".concat(Ht[2],", ").concat(Ht[3]))}return Fr}(or),Vn=fn,gr=(fn+=or.length)-1;bt?Fe=_e.move(We[Vn][0],We[Vn][1])+Wn:lt?Fe=_e.move(At[Vn][0],At[Vn][1])+_e.line(We[Vn][0],We[Vn][1])+Wn+_e.line(At[gr][0],At[gr][1]):(Fe=_e.move(We[Vn][0],We[Vn][1])+Wn,st=Fe+_e.line(We[gr][0],nt)+_e.line(We[Vn][0],nt)+"z",Se.push(st)),se.push(Fe)}),lt&&Gt>1&&!bt){var Rn=se.slice(Gt).reverse();se.splice(Gt),Rn.forEach(function(or){return se.push(or)})}Me=0}break;case"smooth":var An=.35*(B-we);if(S[_][T]===null)Me=0;else switch(Me){case 0:if(Ye=we,Fe=bt?_e.move(we,xe[T])+_e.line(we,ke):_e.move(we,ke),st=_e.move(we,ke),S[_][T+1]===null){se.push(Fe),Se.push(st);break}if(Me=1,T<S[_].length-2){var pr=_e.curve(we+An,ke,B-An,W,B,W);Fe+=pr,st+=pr;break}case 1:if(S[_][T+1]===null)Fe+=bt?_e.line(we,fe):_e.move(we,ke),st+=_e.line(we,nt)+_e.line(Ye,nt)+"z",se.push(Fe),Se.push(st),Me=-1;else{var mt=_e.curve(we+An,ke,B-An,W,B,W);Fe+=mt,st+=mt,T>=S[_].length-2&&(bt&&(Fe+=_e.curve(B,W,B,W,B,fe)+_e.move(B,fe)),st+=_e.curve(B,W,B,W,B,nt)+_e.line(Ye,nt)+"z",se.push(Fe),Se.push(st),Me=-1)}}we=B,ke=W;break;default:var qt=function(or,Wn,Vn){var gr=[];switch(or){case"stepline":gr=_e.line(Wn,null,"H")+_e.line(null,Vn,"V");break;case"linestep":gr=_e.line(null,Vn,"V")+_e.line(Wn,null,"H");break;case"straight":gr=_e.line(Wn,Vn)}return gr};if(S[_][T]===null)Me=0;else switch(Me){case 0:if(Ye=we,Fe=bt?_e.move(we,xe[T])+_e.line(we,ke):_e.move(we,ke),st=_e.move(we,ke),S[_][T+1]===null){se.push(Fe),Se.push(st);break}if(Me=1,T<S[_].length-2){var Qt=qt(De,B,W);Fe+=Qt,st+=Qt;break}case 1:if(S[_][T+1]===null)Fe+=bt?_e.line(we,fe):_e.move(we,ke),st+=_e.line(we,nt)+_e.line(Ye,nt)+"z",se.push(Fe),Se.push(st),Me=-1;else{var In=qt(De,B,W);Fe+=In,st+=In,T>=S[_].length-2&&(bt&&(Fe+=_e.line(B,fe)),st+=_e.line(B,nt)+_e.line(Ye,nt)+"z",se.push(Fe),Se.push(st),Me=-1)}}we=B,ke=W}return{linePaths:se,areaPaths:Se,pX:we,pY:ke,pathState:Me,segmentStartX:Ye,linePath:Fe,areaPath:st}}},{key:"handleNullDataPoints",value:function(p,h,S,_,k){var T=this.w;if(p[S][_]===null&&T.config.markers.showNullDataPoints||p[S].length===1){var B=this.strokeWidth-T.config.markers.strokeWidth/2;B>0||(B=0);var W=this.markers.plotChartMarkers(h,k,_+1,B,!0);W!==null&&this.elPointsMain.add(W)}}}]),Ee}();window.TreemapSquared={},window.TreemapSquared.generate=function(){function Ee(B,W,ee,de){this.xoffset=B,this.yoffset=W,this.height=de,this.width=ee,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(fe){var xe,we=[],ke=this.xoffset,Me=this.yoffset,Ye=k(fe)/this.height,Fe=k(fe)/this.width;if(this.width>=this.height)for(xe=0;xe<fe.length;xe++)we.push([ke,Me,ke+Ye,Me+fe[xe]/Ye]),Me+=fe[xe]/Ye;else for(xe=0;xe<fe.length;xe++)we.push([ke,Me,ke+fe[xe]/Fe,Me+Fe]),ke+=fe[xe]/Fe;return we},this.cutArea=function(fe){var xe;if(this.width>=this.height){var we=fe/this.height,ke=this.width-we;xe=new Ee(this.xoffset+we,this.yoffset,ke,this.height)}else{var Me=fe/this.width,Ye=this.height-Me;xe=new Ee(this.xoffset,this.yoffset+Me,this.width,Ye)}return xe}}function p(B,W,ee,de,fe){de=de===void 0?0:de,fe=fe===void 0?0:fe;var xe=h(function(we,ke){var Me,Ye=[],Fe=ke/k(we);for(Me=0;Me<we.length;Me++)Ye[Me]=we[Me]*Fe;return Ye}(B,W*ee),[],new Ee(de,fe,W,ee),[]);return function(we){var ke,Me,Ye=[];for(ke=0;ke<we.length;ke++)for(Me=0;Me<we[ke].length;Me++)Ye.push(we[ke][Me]);return Ye}(xe)}function h(B,W,ee,de){var fe,xe,we;if(B.length!==0)return fe=ee.shortestEdge(),function(ke,Me,Ye){var Fe;if(ke.length===0)return!0;(Fe=ke.slice()).push(Me);var st=S(ke,Ye),se=S(Fe,Ye);return st>=se}(W,xe=B[0],fe)?(W.push(xe),h(B.slice(1),W,ee,de)):(we=ee.cutArea(k(W),de),de.push(ee.getCoordinates(W)),h(B,[],we,de)),de;de.push(ee.getCoordinates(W))}function S(B,W){var ee=Math.min.apply(Math,B),de=Math.max.apply(Math,B),fe=k(B);return Math.max(Math.pow(W,2)*de/Math.pow(fe,2),Math.pow(fe,2)/(Math.pow(W,2)*ee))}function _(B){return B&&B.constructor===Array}function k(B){var W,ee=0;for(W=0;W<B.length;W++)ee+=B[W];return ee}function T(B){var W,ee=0;if(_(B[0]))for(W=0;W<B.length;W++)ee+=T(B[W]);else ee=k(B);return ee}return function B(W,ee,de,fe,xe){fe=fe===void 0?0:fe,xe=xe===void 0?0:xe;var we,ke,Me=[],Ye=[];if(_(W[0])){for(ke=0;ke<W.length;ke++)Me[ke]=T(W[ke]);for(we=p(Me,ee,de,fe,xe),ke=0;ke<W.length;ke++)Ye.push(B(W[ke],we[ke][2]-we[ke][0],we[ke][3]-we[ke][1],we[ke][0],we[ke][1]))}else Ye=p(W,ee,de,fe,xe);return Ye}}();var yn,Dt,sn=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.w=p.w,this.strokeWidth=this.w.config.stroke.width,this.helpers=new jn(p),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}return o(Ee,[{key:"draw",value:function(p){var h=this,S=this.w,_=new z(this.ctx),k=new Ae(this.ctx),T=_.group({class:"apexcharts-treemap"});if(S.globals.noData)return T;var B=[];return p.forEach(function(W){var ee=W.map(function(de){return Math.abs(de)});B.push(ee)}),this.negRange=this.helpers.checkColorRange(),S.config.series.forEach(function(W,ee){W.data.forEach(function(de){Array.isArray(h.labels[ee])||(h.labels[ee]=[]),h.labels[ee].push(de.x)})}),window.TreemapSquared.generate(B,S.globals.gridWidth,S.globals.gridHeight).forEach(function(W,ee){var de=_.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:F.escapeString(S.globals.seriesNames[ee]),rel:ee+1,"data:realIndex":ee});if(S.config.chart.dropShadow.enabled){var fe=S.config.chart.dropShadow;new L(h.ctx).dropShadow(T,fe,ee)}var xe=_.group({class:"apexcharts-data-labels"});W.forEach(function(we,ke){var Me=we[0],Ye=we[1],Fe=we[2],st=we[3],se=_.drawRect(Me,Ye,Fe-Me,st-Ye,S.config.plotOptions.treemap.borderRadius,"#fff",1,h.strokeWidth,S.config.plotOptions.treemap.useFillColorAsStroke?De:S.globals.stroke.colors[ee]);se.attr({cx:Me,cy:Ye,index:ee,i:ee,j:ke,width:Fe-Me,height:st-Ye});var Se=h.helpers.getShadeColor(S.config.chart.type,ee,ke,h.negRange),De=Se.color;S.config.series[ee].data[ke]!==void 0&&S.config.series[ee].data[ke].fillColor&&(De=S.config.series[ee].data[ke].fillColor);var Le=k.fillPath({color:De,seriesNumber:ee,dataPointIndex:ke});se.node.classList.add("apexcharts-treemap-rect"),se.attr({fill:Le}),h.helpers.addListeners(se);var _e={x:Me+(Fe-Me)/2,y:Ye+(st-Ye)/2,width:0,height:0},nt={x:Me,y:Ye,width:Fe-Me,height:st-Ye};if(S.config.chart.animations.enabled&&!S.globals.dataChanged){var lt=1;S.globals.resized||(lt=S.config.chart.animations.speed),h.animateTreemap(se,_e,nt,lt)}if(S.globals.dataChanged){var bt=1;h.dynamicAnim.enabled&&S.globals.shouldAnimate&&(bt=h.dynamicAnim.speed,S.globals.previousPaths[ee]&&S.globals.previousPaths[ee][ke]&&S.globals.previousPaths[ee][ke].rect&&(_e=S.globals.previousPaths[ee][ke].rect),h.animateTreemap(se,_e,nt,bt))}var Zt=h.getFontSize(we),Ge=S.config.dataLabels.formatter(h.labels[ee][ke],{value:S.globals.series[ee][ke],seriesIndex:ee,dataPointIndex:ke,w:S});S.config.plotOptions.treemap.dataLabels.format==="truncate"&&(Zt=parseInt(S.config.dataLabels.style.fontSize,10),Ge=h.truncateLabels(Ge,Zt,Me,Ye,Fe,st));var Je=null;S.globals.series[ee][ke]&&(Je=h.helpers.calculateDataLabels({text:Ge,x:(Me+Fe)/2,y:(Ye+st)/2+h.strokeWidth/2+Zt/3,i:ee,j:ke,colorProps:Se,fontSize:Zt,series:p})),S.config.dataLabels.enabled&&Je&&h.rotateToFitLabel(Je,Zt,Ge,Me,Ye,Fe,st),de.add(se),Je!==null&&de.add(Je)}),de.add(xe),T.add(de)}),T}},{key:"getFontSize",value:function(p){var h=this.w,S,_,k,T,B=function W(ee){var de,fe=0;if(Array.isArray(ee[0]))for(de=0;de<ee.length;de++)fe+=W(ee[de]);else for(de=0;de<ee.length;de++)fe+=ee[de].length;return fe}(this.labels)/function W(ee){var de,fe=0;if(Array.isArray(ee[0]))for(de=0;de<ee.length;de++)fe+=W(ee[de]);else for(de=0;de<ee.length;de++)fe+=1;return fe}(this.labels);return S=p[2]-p[0],_=p[3]-p[1],k=S*_,T=Math.pow(k,.5),Math.min(T/B,parseInt(h.config.dataLabels.style.fontSize,10))}},{key:"rotateToFitLabel",value:function(p,h,S,_,k,T,B){var W=new z(this.ctx),ee=W.getTextRects(S,h);if(ee.width+this.w.config.stroke.width+5>T-_&&ee.width<=B-k){var de=W.rotateAroundCenter(p.node);p.node.setAttribute("transform","rotate(-90 ".concat(de.x," ").concat(de.y,") translate(").concat(ee.height/3,")"))}}},{key:"truncateLabels",value:function(p,h,S,_,k,T){var B=new z(this.ctx),W=B.getTextRects(p,h).width+this.w.config.stroke.width+5>k-S&&T-_>k-S?T-_:k-S,ee=B.getTextBasedOnMaxWidth({text:p,maxWidth:W,fontSize:h});return p.length!==ee.length&&W/h<5?"":ee}},{key:"animateTreemap",value:function(p,h,S,_){var k=new U(this.ctx);k.animateRect(p,{x:h.x,y:h.y,width:h.width,height:h.height},{x:S.x,y:S.y,width:S.width,height:S.height},_,function(){k.animationCompleted(p)})}}]),Ee}(),Tn=86400,Kn=10/Tn,ir=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return o(Ee,[{key:"calculateTimeScaleTicks",value:function(p,h){var S=this,_=this.w;if(_.globals.allSeriesCollapsed)return _.globals.labels=[],_.globals.timescaleLabels=[],[];var k=new X(this.ctx),T=(h-p)/864e5;this.determineInterval(T),_.globals.disableZoomIn=!1,_.globals.disableZoomOut=!1,T<Kn?_.globals.disableZoomIn=!0:T>5e4&&(_.globals.disableZoomOut=!0);var B=k.getTimeUnitsfromTimestamp(p,h,this.utc),W=_.globals.gridWidth/T,ee=W/24,de=ee/60,fe=de/60,xe=Math.floor(24*T),we=Math.floor(1440*T),ke=Math.floor(T*Tn),Me=Math.floor(T),Ye=Math.floor(T/30),Fe=Math.floor(T/365),st={minMillisecond:B.minMillisecond,minSecond:B.minSecond,minMinute:B.minMinute,minHour:B.minHour,minDate:B.minDate,minMonth:B.minMonth,minYear:B.minYear},se={firstVal:st,currentMillisecond:st.minMillisecond,currentSecond:st.minSecond,currentMinute:st.minMinute,currentHour:st.minHour,currentMonthDate:st.minDate,currentDate:st.minDate,currentMonth:st.minMonth,currentYear:st.minYear,daysWidthOnXAxis:W,hoursWidthOnXAxis:ee,minutesWidthOnXAxis:de,secondsWidthOnXAxis:fe,numberOfSeconds:ke,numberOfMinutes:we,numberOfHours:xe,numberOfDays:Me,numberOfMonths:Ye,numberOfYears:Fe};switch(this.tickInterval){case"years":this.generateYearScale(se);break;case"months":case"half_year":this.generateMonthScale(se);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(se);break;case"hours":this.generateHourScale(se);break;case"minutes_fives":case"minutes":this.generateMinuteScale(se);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(se)}var Se=this.timeScaleArray.map(function(De){var Le={position:De.position,unit:De.unit,year:De.year,day:De.day?De.day:1,hour:De.hour?De.hour:0,month:De.month+1};return De.unit==="month"?v(v({},Le),{},{day:1,value:De.value+1}):De.unit==="day"||De.unit==="hour"?v(v({},Le),{},{value:De.value}):De.unit==="minute"?v(v({},Le),{},{value:De.value,minute:De.value}):De.unit==="second"?v(v({},Le),{},{value:De.value,minute:De.minute,second:De.second}):De});return Se.filter(function(De){var Le=1,_e=Math.ceil(_.globals.gridWidth/120),nt=De.value;_.config.xaxis.tickAmount!==void 0&&(_e=_.config.xaxis.tickAmount),Se.length>_e&&(Le=Math.floor(Se.length/_e));var lt=!1,bt=!1;switch(S.tickInterval){case"years":De.unit==="year"&&(lt=!0);break;case"half_year":Le=7,De.unit==="year"&&(lt=!0);break;case"months":Le=1,De.unit==="year"&&(lt=!0);break;case"months_fortnight":Le=15,De.unit!=="year"&&De.unit!=="month"||(lt=!0),nt===30&&(bt=!0);break;case"months_days":Le=10,De.unit==="month"&&(lt=!0),nt===30&&(bt=!0);break;case"week_days":Le=8,De.unit==="month"&&(lt=!0);break;case"days":Le=1,De.unit==="month"&&(lt=!0);break;case"hours":De.unit==="day"&&(lt=!0);break;case"minutes_fives":case"seconds_fives":nt%5!=0&&(bt=!0);break;case"seconds_tens":nt%10!=0&&(bt=!0)}if(S.tickInterval==="hours"||S.tickInterval==="minutes_fives"||S.tickInterval==="seconds_tens"||S.tickInterval==="seconds_fives"){if(!bt)return!0}else if((nt%Le==0||lt)&&!bt)return!0})}},{key:"recalcDimensionsBasedOnFormat",value:function(p,h){var S=this.w,_=this.formatDates(p),k=this.removeOverlappingTS(_);S.globals.timescaleLabels=k.slice(),new Ke(this.ctx).plotCoords()}},{key:"determineInterval",value:function(p){var h=24*p,S=60*h;switch(!0){case p/365>5:this.tickInterval="years";break;case p>800:this.tickInterval="half_year";break;case p>180:this.tickInterval="months";break;case p>90:this.tickInterval="months_fortnight";break;case p>60:this.tickInterval="months_days";break;case p>30:this.tickInterval="week_days";break;case p>2:this.tickInterval="days";break;case h>2.4:this.tickInterval="hours";break;case S>15:this.tickInterval="minutes_fives";break;case S>5:this.tickInterval="minutes";break;case S>1:this.tickInterval="seconds_tens";break;case 60*S>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}},{key:"generateYearScale",value:function(p){var h=p.firstVal,S=p.currentMonth,_=p.currentYear,k=p.daysWidthOnXAxis,T=p.numberOfYears,B=h.minYear,W=0,ee=new X(this.ctx),de="year";if(h.minDate>1||h.minMonth>0){var fe=ee.determineRemainingDaysOfYear(h.minYear,h.minMonth,h.minDate);W=(ee.determineDaysOfYear(h.minYear)-fe+1)*k,B=h.minYear+1,this.timeScaleArray.push({position:W,value:B,unit:de,year:B,month:F.monthMod(S+1)})}else h.minDate===1&&h.minMonth===0&&this.timeScaleArray.push({position:W,value:B,unit:de,year:_,month:F.monthMod(S+1)});for(var xe=B,we=W,ke=0;ke<T;ke++)xe++,we=ee.determineDaysOfYear(xe-1)*k+we,this.timeScaleArray.push({position:we,value:xe,unit:de,year:xe,month:1})}},{key:"generateMonthScale",value:function(p){var h=p.firstVal,S=p.currentMonthDate,_=p.currentMonth,k=p.currentYear,T=p.daysWidthOnXAxis,B=p.numberOfMonths,W=_,ee=0,de=new X(this.ctx),fe="month",xe=0;if(h.minDate>1){ee=(de.determineDaysOfMonths(_+1,h.minYear)-S+1)*T,W=F.monthMod(_+1);var we=k+xe,ke=F.monthMod(W),Me=W;W===0&&(fe="year",Me=we,ke=1,we+=xe+=1),this.timeScaleArray.push({position:ee,value:Me,unit:fe,year:we,month:ke})}else this.timeScaleArray.push({position:ee,value:W,unit:fe,year:k,month:F.monthMod(_)});for(var Ye=W+1,Fe=ee,st=0,se=1;st<B;st++,se++){(Ye=F.monthMod(Ye))===0?(fe="year",xe+=1):fe="month";var Se=this._getYear(k,Ye,xe);Fe=de.determineDaysOfMonths(Ye,Se)*T+Fe;var De=Ye===0?Se:Ye;this.timeScaleArray.push({position:Fe,value:De,unit:fe,year:Se,month:Ye===0?1:Ye}),Ye++}}},{key:"generateDayScale",value:function(p){var h=p.firstVal,S=p.currentMonth,_=p.currentYear,k=p.hoursWidthOnXAxis,T=p.numberOfDays,B=new X(this.ctx),W="day",ee=h.minDate+1,de=ee,fe=function(se,Se,De){return se>B.determineDaysOfMonths(Se+1,De)&&(de=1,W="month",we=Se+=1),Se},xe=(24-h.minHour)*k,we=ee,ke=fe(de,S,_);h.minHour===0&&h.minDate===1?(xe=0,we=F.monthMod(h.minMonth),W="month",de=h.minDate):h.minDate!==1&&h.minHour===0&&h.minMinute===0&&(xe=0,ee=h.minDate,we=ee,ke=fe(de=ee,S,_)),this.timeScaleArray.push({position:xe,value:we,unit:W,year:this._getYear(_,ke,0),month:F.monthMod(ke),day:de});for(var Me=xe,Ye=0;Ye<T;Ye++){W="day",ke=fe(de+=1,ke,this._getYear(_,ke,0));var Fe=this._getYear(_,ke,0);Me=24*k+Me;var st=de===1?F.monthMod(ke):de;this.timeScaleArray.push({position:Me,value:st,unit:W,year:Fe,month:F.monthMod(ke),day:st})}}},{key:"generateHourScale",value:function(p){var h=p.firstVal,S=p.currentDate,_=p.currentMonth,k=p.currentYear,T=p.minutesWidthOnXAxis,B=p.numberOfHours,W=new X(this.ctx),ee="hour",de=function(Le,_e){return Le>W.determineDaysOfMonths(_e+1,k)&&(Ye=1,_e+=1),{month:_e,date:Ye}},fe=function(Le,_e){return Le>W.determineDaysOfMonths(_e+1,k)?_e+=1:_e},xe=60-(h.minMinute+h.minSecond/60),we=xe*T,ke=h.minHour+1,Me=ke;xe===60&&(we=0,Me=ke=h.minHour);var Ye=S;Me>=24&&(Me=0,Ye+=1,ee="day");var Fe=de(Ye,_).month;Fe=fe(Ye,Fe),this.timeScaleArray.push({position:we,value:ke,unit:ee,day:Ye,hour:Me,year:k,month:F.monthMod(Fe)}),Me++;for(var st=we,se=0;se<B;se++){ee="hour",Me>=24&&(Me=0,ee="day",Fe=de(Ye+=1,Fe).month,Fe=fe(Ye,Fe));var Se=this._getYear(k,Fe,0);st=60*T+st;var De=Me===0?Ye:Me;this.timeScaleArray.push({position:st,value:De,unit:ee,hour:Me,day:Ye,year:Se,month:F.monthMod(Fe)}),Me++}}},{key:"generateMinuteScale",value:function(p){for(var h=p.currentMillisecond,S=p.currentSecond,_=p.currentMinute,k=p.currentHour,T=p.currentDate,B=p.currentMonth,W=p.currentYear,ee=p.minutesWidthOnXAxis,de=p.secondsWidthOnXAxis,fe=p.numberOfMinutes,xe=_+1,we=T,ke=B,Me=W,Ye=k,Fe=(60-S-h/1e3)*de,st=0;st<fe;st++)xe>=60&&(xe=0,(Ye+=1)===24&&(Ye=0)),this.timeScaleArray.push({position:Fe,value:xe,unit:"minute",hour:Ye,minute:xe,day:we,year:this._getYear(Me,ke,0),month:F.monthMod(ke)}),Fe+=ee,xe++}},{key:"generateSecondScale",value:function(p){for(var h=p.currentMillisecond,S=p.currentSecond,_=p.currentMinute,k=p.currentHour,T=p.currentDate,B=p.currentMonth,W=p.currentYear,ee=p.secondsWidthOnXAxis,de=p.numberOfSeconds,fe=S+1,xe=_,we=T,ke=B,Me=W,Ye=k,Fe=(1e3-h)/1e3*ee,st=0;st<de;st++)fe>=60&&(fe=0,++xe>=60&&(xe=0,++Ye===24&&(Ye=0))),this.timeScaleArray.push({position:Fe,value:fe,unit:"second",hour:Ye,minute:xe,second:fe,day:we,year:this._getYear(Me,ke,0),month:F.monthMod(ke)}),Fe+=ee,fe++}},{key:"createRawDateString",value:function(p,h){var S=p.year;return p.month===0&&(p.month=1),S+="-"+("0"+p.month.toString()).slice(-2),p.unit==="day"?S+=p.unit==="day"?"-"+("0"+h).slice(-2):"-01":S+="-"+("0"+(p.day?p.day:"1")).slice(-2),p.unit==="hour"?S+=p.unit==="hour"?"T"+("0"+h).slice(-2):"T00":S+="T"+("0"+(p.hour?p.hour:"0")).slice(-2),p.unit==="minute"?S+=":"+("0"+h).slice(-2):S+=":"+(p.minute?("0"+p.minute).slice(-2):"00"),p.unit==="second"?S+=":"+("0"+h).slice(-2):S+=":00",this.utc&&(S+=".000Z"),S}},{key:"formatDates",value:function(p){var h=this,S=this.w;return p.map(function(_){var k=_.value.toString(),T=new X(h.ctx),B=h.createRawDateString(_,k),W=T.getDate(T.parseDate(B));if(h.utc||(W=T.getDate(T.parseDateWithTimezone(B))),S.config.xaxis.labels.format===void 0){var ee="dd MMM",de=S.config.xaxis.labels.datetimeFormatter;_.unit==="year"&&(ee=de.year),_.unit==="month"&&(ee=de.month),_.unit==="day"&&(ee=de.day),_.unit==="hour"&&(ee=de.hour),_.unit==="minute"&&(ee=de.minute),_.unit==="second"&&(ee=de.second),k=T.formatDate(W,ee)}else k=T.formatDate(W,S.config.xaxis.labels.format);return{dateString:B,position:_.position,value:k,unit:_.unit,year:_.year,month:_.month}})}},{key:"removeOverlappingTS",value:function(p){var h,S=this,_=new z(this.ctx),k=!1;p.length>0&&p[0].value&&p.every(function(W){return W.value.length===p[0].value.length})&&(k=!0,h=_.getTextRects(p[0].value).width);var T=0,B=p.map(function(W,ee){if(ee>0&&S.w.config.xaxis.labels.hideOverlappingLabels){var de=k?h:_.getTextRects(p[T].value).width,fe=p[T].position;return W.position>fe+de+10?(T=ee,W):null}return W});return B=B.filter(function(W){return W!==null})}},{key:"_getYear",value:function(p,h,S){return p+Math.floor(h/12)+S}}]),Ee}(),rr=function(){function Ee(p,h){s(this,Ee),this.ctx=h,this.w=h.w,this.el=p}return o(Ee,[{key:"setupElements",value:function(){var p=this.w,h=p.globals,S=p.config,_=S.chart.type;h.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].includes(_),h.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].includes(_),h.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(_)&&S.plotOptions.bar.horizontal,h.chartClass=".apexcharts".concat(h.chartID),h.dom.baseEl=this.el,h.dom.elWrap=document.createElement("div"),z.setAttrs(h.dom.elWrap,{id:h.chartClass.substring(1),class:"apexcharts-canvas ".concat(h.chartClass.substring(1))}),this.el.appendChild(h.dom.elWrap),h.dom.Paper=new window.SVG.Doc(h.dom.elWrap),h.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(S.chart.offsetX,", ").concat(S.chart.offsetY,")")}),h.dom.Paper.node.style.background=S.theme.mode!=="dark"||S.chart.background?S.theme.mode!=="light"||S.chart.background?S.chart.background:"#fff":"#424242",this.setSVGDimensions(),h.dom.elLegendForeign=document.createElementNS(h.SVGNS,"foreignObject"),z.setAttrs(h.dom.elLegendForeign,{x:0,y:0,width:h.svgWidth,height:h.svgHeight}),h.dom.elLegendWrap=document.createElement("div"),h.dom.elLegendWrap.classList.add("apexcharts-legend"),h.dom.elLegendWrap.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),h.dom.elLegendForeign.appendChild(h.dom.elLegendWrap),h.dom.Paper.node.appendChild(h.dom.elLegendForeign),h.dom.elGraphical=h.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),h.dom.elDefs=h.dom.Paper.defs(),h.dom.Paper.add(h.dom.elGraphical),h.dom.elGraphical.add(h.dom.elDefs)}},{key:"plotChartType",value:function(p,h){var S=this.w,_=this.ctx,k=S.config,T=S.globals,B={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},column:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},W=k.chart.type||"line",ee=null,de=0;T.series.forEach(function(Le,_e){var nt=p[_e].type||W;B[nt]?(nt==="rangeArea"?(B[nt].series.push(T.seriesRangeStart[_e]),B[nt].seriesRangeEnd.push(T.seriesRangeEnd[_e])):B[nt].series.push(Le),B[nt].i.push(_e),nt!=="column"&&nt!=="bar"||(S.globals.columnSeries=B.column)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(nt)?ee=nt:nt==="bar"?(B.column.series.push(Le),B.column.i.push(_e)):console.warn("You have specified an unrecognized series type (".concat(nt,").")),W!==nt&&nt!=="scatter"&&de++}),de>0&&(ee&&console.warn("Chart or series type ".concat(ee," cannot appear with other chart or series types.")),B.column.series.length>0&&k.plotOptions.bar.horizontal&&(de-=B.column.series.length,B.column={series:[],i:[]},S.globals.columnSeries={series:[],i:[]},console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"))),T.comboCharts||(T.comboCharts=de>0);var fe=new Yn(_,h),xe=new En(_,h);_.pie=new zn(_);var we=new nr(_);_.rangeBar=new wn(_,h);var ke=new $n(_),Me=[];if(T.comboCharts){var Ye,Fe,st=new Q(_);if(B.area.series.length>0&&(Ye=Me).push.apply(Ye,N(st.drawSeriesByGroup(B.area,T.areaGroups,"area",fe))),B.column.series.length>0)if(k.chart.stacked){var se=new On(_,h);Me.push(se.draw(B.column.series,B.column.i))}else _.bar=new un(_,h),Me.push(_.bar.draw(B.column.series,B.column.i));if(B.rangeArea.series.length>0&&Me.push(fe.draw(B.rangeArea.series,"rangeArea",B.rangeArea.i,B.rangeArea.seriesRangeEnd)),B.line.series.length>0&&(Fe=Me).push.apply(Fe,N(st.drawSeriesByGroup(B.line,T.lineGroups,"line",fe))),B.candlestick.series.length>0&&Me.push(xe.draw(B.candlestick.series,"candlestick",B.candlestick.i)),B.boxPlot.series.length>0&&Me.push(xe.draw(B.boxPlot.series,"boxPlot",B.boxPlot.i)),B.rangeBar.series.length>0&&Me.push(_.rangeBar.draw(B.rangeBar.series,B.rangeBar.i)),B.scatter.series.length>0){var Se=new Yn(_,h,!0);Me.push(Se.draw(B.scatter.series,"scatter",B.scatter.i))}if(B.bubble.series.length>0){var De=new Yn(_,h,!0);Me.push(De.draw(B.bubble.series,"bubble",B.bubble.i))}}else switch(k.chart.type){case"line":Me=fe.draw(T.series,"line");break;case"area":Me=fe.draw(T.series,"area");break;case"bar":k.chart.stacked?Me=new On(_,h).draw(T.series):(_.bar=new un(_,h),Me=_.bar.draw(T.series));break;case"candlestick":Me=new En(_,h).draw(T.series,"candlestick");break;case"boxPlot":Me=new En(_,h).draw(T.series,k.chart.type);break;case"rangeBar":Me=_.rangeBar.draw(T.series);break;case"rangeArea":Me=fe.draw(T.seriesRangeStart,"rangeArea",void 0,T.seriesRangeEnd);break;case"heatmap":Me=new bn(_,h).draw(T.series);break;case"treemap":Me=new sn(_,h).draw(T.series);break;case"pie":case"donut":case"polarArea":Me=_.pie.draw(T.series);break;case"radialBar":Me=we.draw(T.series);break;case"radar":Me=ke.draw(T.series);break;default:Me=fe.draw(T.series)}return Me}},{key:"setSVGDimensions",value:function(){var p=this.w,h=p.globals,S=p.config;S.chart.width=S.chart.width||"100%",S.chart.height=S.chart.height||"auto",h.svgWidth=S.chart.width,h.svgHeight=S.chart.height;var _=F.getDimensions(this.el),k=S.chart.width.toString().split(/[0-9]+/g).pop();k==="%"?F.isNumber(_[0])&&(_[0].width===0&&(_=F.getDimensions(this.el.parentNode)),h.svgWidth=_[0]*parseInt(S.chart.width,10)/100):k!=="px"&&k!==""||(h.svgWidth=parseInt(S.chart.width,10));var T=String(S.chart.height).toString().split(/[0-9]+/g).pop();if(h.svgHeight!=="auto"&&h.svgHeight!=="")if(T==="%"){var B=F.getDimensions(this.el.parentNode);h.svgHeight=B[1]*parseInt(S.chart.height,10)/100}else h.svgHeight=parseInt(S.chart.height,10);else h.svgHeight=h.axisCharts?h.svgWidth/1.61:h.svgWidth/1.2;if(h.svgWidth=Math.max(h.svgWidth,0),h.svgHeight=Math.max(h.svgHeight,0),z.setAttrs(h.dom.Paper.node,{width:h.svgWidth,height:h.svgHeight}),T!=="%"){var W=S.chart.sparkline.enabled?0:h.axisCharts?S.chart.parentHeightOffset:0;h.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(h.svgHeight+W,"px")}h.dom.elWrap.style.width="".concat(h.svgWidth,"px"),h.dom.elWrap.style.height="".concat(h.svgHeight,"px")}},{key:"shiftGraphPosition",value:function(){var p=this.w.globals,h=p.translateY,S=p.translateX;z.setAttrs(p.dom.elGraphical.node,{transform:"translate(".concat(S,", ").concat(h,")")})}},{key:"resizeNonAxisCharts",value:function(){var p=this.w,h=p.globals,S=0,_=p.config.chart.sparkline.enabled?1:15;_+=p.config.grid.padding.bottom,["top","bottom"].includes(p.config.legend.position)&&p.config.legend.show&&!p.config.legend.floating&&(S=new en(this.ctx).legendHelpers.getLegendDimensions().clwh+7);var k=p.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),T=2.05*p.globals.radialSize;if(k&&!p.config.chart.sparkline.enabled&&p.config.plotOptions.radialBar.startAngle!==0){var B=F.getBoundingClientRect(k);T=B.bottom;var W=B.bottom-B.top;T=Math.max(2.05*p.globals.radialSize,W)}var ee=Math.ceil(T+h.translateY+S+_);h.dom.elLegendForeign&&h.dom.elLegendForeign.setAttribute("height",ee),p.config.chart.height&&String(p.config.chart.height).includes("%")||(h.dom.elWrap.style.height="".concat(ee,"px"),z.setAttrs(h.dom.Paper.node,{height:ee}),h.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(ee,"px"))}},{key:"coreCalculations",value:function(){new ft(this.ctx).init()}},{key:"resetGlobals",value:function(){var p=this,h=function(){return p.w.config.series.map(function(){return[]})},S=new ce,_=this.w.globals;S.initGlobalVars(_),_.seriesXvalues=h(),_.seriesYvalues=h()}},{key:"isMultipleY",value:function(){return!!(Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1)&&(this.w.globals.isMultipleYAxis=!0,!0)}},{key:"xySettings",value:function(){var p=this.w,h=null;if(p.globals.axisCharts){if(p.config.xaxis.crosshairs.position==="back"&&new Nt(this.ctx).drawXCrosshairs(),p.config.yaxis[0].crosshairs.position==="back"&&new Nt(this.ctx).drawYCrosshairs(),p.config.xaxis.type==="datetime"&&p.config.xaxis.labels.formatter===void 0){this.ctx.timeScale=new ir(this.ctx);var S=[];isFinite(p.globals.minX)&&isFinite(p.globals.maxX)&&!p.globals.isBarHorizontal?S=this.ctx.timeScale.calculateTimeScaleTicks(p.globals.minX,p.globals.maxX):p.globals.isBarHorizontal&&(S=this.ctx.timeScale.calculateTimeScaleTicks(p.globals.minY,p.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(S)}h=new Q(this.ctx).getCalculatedRatios()}return h}},{key:"updateSourceChart",value:function(p){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:p.w.globals.minX,max:p.w.globals.maxX}}}},!1,!1)}},{key:"setupBrushHandler",value:function(){var p=this,h=this.w;if(h.config.chart.brush.enabled&&typeof h.config.chart.events.selection!="function"){var S=Array.isArray(h.config.chart.brush.targets)?h.config.chart.brush.targets:[h.config.chart.brush.target];S.forEach(function(_){var k=ApexCharts.getChartByID(_);k.w.globals.brushSource=p.ctx,typeof k.w.config.chart.events.zoomed!="function"&&(k.w.config.chart.events.zoomed=function(){return p.updateSourceChart(k)}),typeof k.w.config.chart.events.scrolled!="function"&&(k.w.config.chart.events.scrolled=function(){return p.updateSourceChart(k)})}),h.config.chart.events.selection=function(_,k){S.forEach(function(T){ApexCharts.getChartByID(T).ctx.updateHelpers._updateOptions({xaxis:{min:k.xaxis.min,max:k.xaxis.max}},!1,!1,!1,!1)})}}}}]),Ee}(),Jt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"_updateOptions",value:function(p){var h=this,S=arguments.length>1&&arguments[1]!==void 0&&arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],k=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],T=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return new Promise(function(B){var W=[h.ctx];k&&(W=h.ctx.getSyncedCharts()),h.ctx.w.globals.isExecCalled&&(W=[h.ctx],h.ctx.w.globals.isExecCalled=!1),W.forEach(function(ee,de){var fe=ee.w;if(fe.globals.shouldAnimate=_,S||(fe.globals.resized=!0,fe.globals.dataChanged=!0,_&&ee.series.getPreviousPaths()),p&&P(p)==="object"&&(ee.config=new Ce(p),p=Q.extendArrayProps(ee.config,p,fe),ee.w.globals.chartID!==h.ctx.w.globals.chartID&&delete p.series,fe.config=F.extend(fe.config,p),T&&(fe.globals.lastXAxis=p.xaxis?F.clone(p.xaxis):[],fe.globals.lastYAxis=p.yaxis?F.clone(p.yaxis):[],fe.globals.initialConfig=F.extend({},fe.config),fe.globals.initialSeries=F.clone(fe.config.series),p.series))){for(var xe=0;xe<fe.globals.collapsedSeriesIndices.length;xe++){var we=fe.config.series[fe.globals.collapsedSeriesIndices[xe]];fe.globals.collapsedSeries[xe].data=fe.globals.axisCharts?we.data.slice():we}for(var ke=0;ke<fe.globals.ancillaryCollapsedSeriesIndices.length;ke++){var Me=fe.config.series[fe.globals.ancillaryCollapsedSeriesIndices[ke]];fe.globals.ancillaryCollapsedSeries[ke].data=fe.globals.axisCharts?Me.data.slice():Me}ee.series.emptyCollapsedSeries(fe.config.series)}return ee.update(p).then(function(){de===W.length-1&&B(ee)})})})}},{key:"_updateSeries",value:function(p,h){var S=this,_=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return new Promise(function(k){var T,B=S.w;return B.globals.shouldAnimate=h,B.globals.dataChanged=!0,h&&S.ctx.series.getPreviousPaths(),B.globals.axisCharts?((T=p.map(function(W,ee){return S._extendSeries(W,ee)})).length===0&&(T=[{data:[]}]),B.config.series=T):B.config.series=p.slice(),_&&(B.globals.initialConfig.series=F.clone(B.config.series),B.globals.initialSeries=F.clone(B.config.series)),S.ctx.update().then(function(){k(S.ctx)})})}},{key:"_extendSeries",value:function(p,h){var S=this.w,_=S.config.series[h];return v(v({},S.config.series[h]),{},{name:p.name?p.name:_==null?void 0:_.name,color:p.color?p.color:_==null?void 0:_.color,type:p.type?p.type:_==null?void 0:_.type,group:p.group?p.group:_==null?void 0:_.group,hidden:p.hidden!==void 0?p.hidden:_==null?void 0:_.hidden,data:p.data?p.data:_==null?void 0:_.data,zIndex:p.zIndex!==void 0?p.zIndex:h})}},{key:"toggleDataPointSelection",value:function(p,h){var S=this.w,_=null,k=".apexcharts-series[data\\:realIndex='".concat(p,"']");return S.globals.axisCharts?_=S.globals.dom.Paper.select("".concat(k," path[j='").concat(h,"'], ").concat(k," circle[j='").concat(h,"'], ").concat(k," rect[j='").concat(h,"']")).members[0]:h===void 0&&(_=S.globals.dom.Paper.select("".concat(k," path[j='").concat(p,"']")).members[0],S.config.chart.type!=="pie"&&S.config.chart.type!=="polarArea"&&S.config.chart.type!=="donut"||this.ctx.pie.pieClicked(p)),_?(new z(this.ctx).pathMouseDown(_,null),_.node?_.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(p){var h=this.w;if(["min","max"].forEach(function(_){p.xaxis[_]!==void 0&&(h.config.xaxis[_]=p.xaxis[_],h.globals.lastXAxis[_]=p.xaxis[_])}),p.xaxis.categories&&p.xaxis.categories.length&&(h.config.xaxis.categories=p.xaxis.categories),h.config.xaxis.convertedCatToNumeric){var S=new he(p);p=S.convertCatToNumericXaxis(p,this.ctx)}return p}},{key:"forceYAxisUpdate",value:function(p){return p.chart&&p.chart.stacked&&p.chart.stackType==="100%"&&(Array.isArray(p.yaxis)?p.yaxis.forEach(function(h,S){p.yaxis[S].min=0,p.yaxis[S].max=100}):(p.yaxis.min=0,p.yaxis.max=100)),p}},{key:"revertDefaultAxisMinMax",value:function(p){var h=this,S=this.w,_=S.globals.lastXAxis,k=S.globals.lastYAxis;p&&p.xaxis&&(_=p.xaxis),p&&p.yaxis&&(k=p.yaxis),S.config.xaxis.min=_.min,S.config.xaxis.max=_.max;var T=function(B){k[B]!==void 0&&(S.config.yaxis[B].min=k[B].min,S.config.yaxis[B].max=k[B].max)};S.config.yaxis.map(function(B,W){S.globals.zoomed||k[W]!==void 0?T(W):h.ctx.opts.yaxis[W]!==void 0&&(B.min=h.ctx.opts.yaxis[W].min,B.max=h.ctx.opts.yaxis[W].max)})}}]),Ee}();yn=typeof window<"u"?window:void 0,Dt=function(Ee,p){var h=(this!==void 0?this:Ee).SVG=function(se){if(h.supported)return se=new h.Doc(se),h.parser.draw||h.prepare(),se};if(h.ns="http://www.w3.org/2000/svg",h.xmlns="http://www.w3.org/2000/xmlns/",h.xlink="http://www.w3.org/1999/xlink",h.svgjs="http://svgjs.dev",h.supported=!0,!h.supported)return!1;h.did=1e3,h.eid=function(se){return"Svgjs"+de(se)+h.did++},h.create=function(se){var Se=p.createElementNS(this.ns,se);return Se.setAttribute("id",this.eid(se)),Se},h.extend=function(){var se,Se;Se=(se=[].slice.call(arguments)).pop();for(var De=se.length-1;De>=0;De--)if(se[De])for(var Le in Se)se[De].prototype[Le]=Se[Le];h.Set&&h.Set.inherit&&h.Set.inherit()},h.invent=function(se){var Se=typeof se.create=="function"?se.create:function(){this.constructor.call(this,h.create(se.create))};return se.inherit&&(Se.prototype=new se.inherit),se.extend&&h.extend(Se,se.extend),se.construct&&h.extend(se.parent||h.Container,se.construct),Se},h.adopt=function(se){return se?se.instance?se.instance:((Se=se.nodeName=="svg"?se.parentNode instanceof Ee.SVGElement?new h.Nested:new h.Doc:se.nodeName=="linearGradient"?new h.Gradient("linear"):se.nodeName=="radialGradient"?new h.Gradient("radial"):h[de(se.nodeName)]?new h[de(se.nodeName)]:new h.Element(se)).type=se.nodeName,Se.node=se,se.instance=Se,Se instanceof h.Doc&&Se.namespace().defs(),Se.setData(JSON.parse(se.getAttribute("svgjs:data"))||{}),Se):null;var Se},h.prepare=function(){var se=p.getElementsByTagName("body")[0],Se=(se?new h.Doc(se):h.adopt(p.documentElement).nested()).size(2,0);h.parser={body:se||p.documentElement,draw:Se.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").node,poly:Se.polyline().node,path:Se.path().node,native:h.create("svg")}},h.parser={native:h.create("svg")},p.addEventListener("DOMContentLoaded",function(){h.parser.draw||h.prepare()},!1),h.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},h.utils={map:function(se,Se){for(var De=se.length,Le=[],_e=0;_e<De;_e++)Le.push(Se(se[_e]));return Le},filter:function(se,Se){for(var De=se.length,Le=[],_e=0;_e<De;_e++)Se(se[_e])&&Le.push(se[_e]);return Le},filterSVGElements:function(se){return this.filter(se,function(Se){return Se instanceof Ee.SVGElement})}},h.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},h.Color=function(se){var Se,De;this.r=0,this.g=0,this.b=0,se&&(typeof se=="string"?h.regex.isRgb.test(se)?(Se=h.regex.rgb.exec(se.replace(h.regex.whitespace,"")),this.r=parseInt(Se[1]),this.g=parseInt(Se[2]),this.b=parseInt(Se[3])):h.regex.isHex.test(se)&&(Se=h.regex.hex.exec((De=se).length==4?["#",De.substring(1,2),De.substring(1,2),De.substring(2,3),De.substring(2,3),De.substring(3,4),De.substring(3,4)].join(""):De),this.r=parseInt(Se[1],16),this.g=parseInt(Se[2],16),this.b=parseInt(Se[3],16)):P(se)==="object"&&(this.r=se.r,this.g=se.g,this.b=se.b))},h.extend(h.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+fe(this.r)+fe(this.g)+fe(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(se){return this.destination=new h.Color(se),this},at:function(se){return this.destination?(se=se<0?0:se>1?1:se,new h.Color({r:~~(this.r+(this.destination.r-this.r)*se),g:~~(this.g+(this.destination.g-this.g)*se),b:~~(this.b+(this.destination.b-this.b)*se)})):this}}),h.Color.test=function(se){return se+="",h.regex.isHex.test(se)||h.regex.isRgb.test(se)},h.Color.isRgb=function(se){return se&&typeof se.r=="number"&&typeof se.g=="number"&&typeof se.b=="number"},h.Color.isColor=function(se){return h.Color.isRgb(se)||h.Color.test(se)},h.Array=function(se,Se){(se=(se||[]).valueOf()).length==0&&Se&&(se=Se.valueOf()),this.value=this.parse(se)},h.extend(h.Array,{toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(se){return se=se.valueOf(),Array.isArray(se)?se:this.split(se)}}),h.PointArray=function(se,Se){h.Array.call(this,se,Se||[[0,0]])},h.PointArray.prototype=new h.Array,h.PointArray.prototype.constructor=h.PointArray;for(var S={M:function(se,Se,De){return Se.x=De.x=se[0],Se.y=De.y=se[1],["M",Se.x,Se.y]},L:function(se,Se){return Se.x=se[0],Se.y=se[1],["L",se[0],se[1]]},H:function(se,Se){return Se.x=se[0],["H",se[0]]},V:function(se,Se){return Se.y=se[0],["V",se[0]]},C:function(se,Se){return Se.x=se[4],Se.y=se[5],["C",se[0],se[1],se[2],se[3],se[4],se[5]]},Q:function(se,Se){return Se.x=se[2],Se.y=se[3],["Q",se[0],se[1],se[2],se[3]]},S:function(se,Se){return Se.x=se[2],Se.y=se[3],["S",se[0],se[1],se[2],se[3]]},Z:function(se,Se,De){return Se.x=De.x,Se.y=De.y,["Z"]}},_="mlhvqtcsaz".split(""),k=0,T=_.length;k<T;++k)S[_[k]]=function(se){return function(Se,De,Le){if(se=="H")Se[0]=Se[0]+De.x;else if(se=="V")Se[0]=Se[0]+De.y;else if(se=="A")Se[5]=Se[5]+De.x,Se[6]=Se[6]+De.y;else for(var _e=0,nt=Se.length;_e<nt;++_e)Se[_e]=Se[_e]+(_e%2?De.y:De.x);if(S&&typeof S[se]=="function")return S[se](Se,De,Le)}}(_[k].toUpperCase());h.PathArray=function(se,Se){h.Array.call(this,se,Se||[["M",0,0]])},h.PathArray.prototype=new h.Array,h.PathArray.prototype.constructor=h.PathArray,h.extend(h.PathArray,{toString:function(){return function(se){for(var Se=0,De=se.length,Le="";Se<De;Se++)Le+=se[Se][0],se[Se][1]!=null&&(Le+=se[Se][1],se[Se][2]!=null&&(Le+=" ",Le+=se[Se][2],se[Se][3]!=null&&(Le+=" ",Le+=se[Se][3],Le+=" ",Le+=se[Se][4],se[Se][5]!=null&&(Le+=" ",Le+=se[Se][5],Le+=" ",Le+=se[Se][6],se[Se][7]!=null&&(Le+=" ",Le+=se[Se][7])))));return Le+" "}(this.value)},move:function(se,Se){var De=this.bbox();return De.x,De.y,this},at:function(se){if(!this.destination)return this;for(var Se=this.value,De=this.destination.value,Le=[],_e=new h.PathArray,nt=0,lt=Se.length;nt<lt;nt++){Le[nt]=[Se[nt][0]];for(var bt=1,Zt=Se[nt].length;bt<Zt;bt++)Le[nt][bt]=Se[nt][bt]+(De[nt][bt]-Se[nt][bt])*se;Le[nt][0]==="A"&&(Le[nt][4]=+(Le[nt][4]!=0),Le[nt][5]=+(Le[nt][5]!=0))}return _e.value=Le,_e},parse:function(se){if(se instanceof h.PathArray)return se.valueOf();var Se,De={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};se=typeof se=="string"?se.replace(h.regex.numbersWithDots,W).replace(h.regex.pathLetters," $& ").replace(h.regex.hyphen,"$1 -").trim().split(h.regex.delimiter):se.reduce(function(Zt,Ge){return[].concat.call(Zt,Ge)},[]);var Le=[],_e=new h.Point,nt=new h.Point,lt=0,bt=se.length;do h.regex.isPathLetter.test(se[lt])?(Se=se[lt],++lt):Se=="M"?Se="L":Se=="m"&&(Se="l"),Le.push(S[Se].call(null,se.slice(lt,lt+=De[Se.toUpperCase()]).map(parseFloat),_e,nt));while(bt>lt);return Le},bbox:function(){return h.parser.draw||h.prepare(),h.parser.path.setAttribute("d",this.toString()),h.parser.path.getBBox()}}),h.Number=h.invent({create:function(se,Se){this.value=0,this.unit=Se||"",typeof se=="number"?this.value=isNaN(se)?0:isFinite(se)?se:se<0?-34e37:34e37:typeof se=="string"?(Se=se.match(h.regex.numberAndUnit))&&(this.value=parseFloat(Se[1]),Se[5]=="%"?this.value/=100:Se[5]=="s"&&(this.value*=1e3),this.unit=Se[5]):se instanceof h.Number&&(this.value=se.valueOf(),this.unit=se.unit)},extend:{toString:function(){return(this.unit=="%"?~~(1e8*this.value)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(se){return se=new h.Number(se),new h.Number(this+se,this.unit||se.unit)},minus:function(se){return se=new h.Number(se),new h.Number(this-se,this.unit||se.unit)},times:function(se){return se=new h.Number(se),new h.Number(this*se,this.unit||se.unit)},divide:function(se){return se=new h.Number(se),new h.Number(this/se,this.unit||se.unit)},to:function(se){var Se=new h.Number(this);return typeof se=="string"&&(Se.unit=se),Se},morph:function(se){return this.destination=new h.Number(se),se.relative&&(this.destination.value+=this.value),this},at:function(se){return this.destination?new h.Number(this.destination).minus(this).times(se).plus(this):this}}}),h.Element=h.invent({create:function(se){this._stroke=h.defaults.attrs.stroke,this._event=null,this.dom={},(this.node=se)&&(this.type=se.nodeName,this.node.instance=this,this._stroke=se.getAttribute("stroke")||this._stroke)},extend:{x:function(se){return this.attr("x",se)},y:function(se){return this.attr("y",se)},cx:function(se){return se==null?this.x()+this.width()/2:this.x(se-this.width()/2)},cy:function(se){return se==null?this.y()+this.height()/2:this.y(se-this.height()/2)},move:function(se,Se){return this.x(se).y(Se)},center:function(se,Se){return this.cx(se).cy(Se)},width:function(se){return this.attr("width",se)},height:function(se){return this.attr("height",se)},size:function(se,Se){var De=xe(this,se,Se);return this.width(new h.Number(De.width)).height(new h.Number(De.height))},clone:function(se){this.writeDataToDom();var Se=Me(this.node.cloneNode(!0));return se?se.add(Se):this.after(Se),Se},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(se){return this.after(se).remove(),se},addTo:function(se){return se.put(this)},putIn:function(se){return se.add(this)},id:function(se){return this.attr("id",se)},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return this.style("display")!="none"},toString:function(){return this.attr("id")},classes:function(){var se=this.attr("class");return se==null?[]:se.trim().split(h.regex.delimiter)},hasClass:function(se){return this.classes().indexOf(se)!=-1},addClass:function(se){if(!this.hasClass(se)){var Se=this.classes();Se.push(se),this.attr("class",Se.join(" "))}return this},removeClass:function(se){return this.hasClass(se)&&this.attr("class",this.classes().filter(function(Se){return Se!=se}).join(" ")),this},toggleClass:function(se){return this.hasClass(se)?this.removeClass(se):this.addClass(se)},reference:function(se){return h.get(this.attr(se))},parent:function(se){var Se=this;if(!Se.node.parentNode)return null;if(Se=h.adopt(Se.node.parentNode),!se)return Se;for(;Se&&Se.node instanceof Ee.SVGElement;){if(typeof se=="string"?Se.matches(se):Se instanceof se)return Se;if(!Se.node.parentNode||Se.node.parentNode.nodeName=="#document")return null;Se=h.adopt(Se.node.parentNode)}},doc:function(){return this instanceof h.Doc?this:this.parent(h.Doc)},parents:function(se){var Se=[],De=this;do{if(!(De=De.parent(se))||!De.node)break;Se.push(De)}while(De.parent);return Se},matches:function(se){return function(Se,De){return(Se.matches||Se.matchesSelector||Se.msMatchesSelector||Se.mozMatchesSelector||Se.webkitMatchesSelector||Se.oMatchesSelector).call(Se,De)}(this.node,se)},native:function(){return this.node},svg:function(se){var Se=p.createElementNS("http://www.w3.org/2000/svg","svg");if(!(se&&this instanceof h.Parent))return Se.appendChild(se=p.createElementNS("http://www.w3.org/2000/svg","svg")),this.writeDataToDom(),se.appendChild(this.node.cloneNode(!0)),Se.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");Se.innerHTML="<svg>"+se.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var De=0,Le=Se.firstChild.childNodes.length;De<Le;De++)this.node.appendChild(Se.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(se){return this.dom=se,this},is:function(se){return function(Se,De){return Se instanceof De}(this,se)}}}),h.easing={"-":function(se){return se},"<>":function(se){return-Math.cos(se*Math.PI)/2+.5},">":function(se){return Math.sin(se*Math.PI/2)},"<":function(se){return 1-Math.cos(se*Math.PI/2)}},h.morph=function(se){return function(Se,De){return new h.MorphObj(Se,De).at(se)}},h.Situation=h.invent({create:function(se){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new h.Number(se.duration).valueOf(),this.delay=new h.Number(se.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=se.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),h.FX=h.invent({create:function(se){this._target=se,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(se,Se,De){P(se)==="object"&&(Se=se.ease,De=se.delay,se=se.duration);var Le=new h.Situation({duration:se||1e3,delay:De||0,ease:h.easing[Se||"-"]||Se});return this.queue(Le),this},target:function(se){return se&&se instanceof h.Element?(this._target=se,this):this._target},timeToAbsPos:function(se){return(se-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(se){return this.situation.duration/this._speed*se+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=Ee.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){Ee.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(se){return(typeof se=="function"||se instanceof h.Situation)&&this.situations.push(se),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof h.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var se,Se=this.situation;if(Se.init)return this;for(var De in Se.animations){se=this.target()[De](),Array.isArray(se)||(se=[se]),Array.isArray(Se.animations[De])||(Se.animations[De]=[Se.animations[De]]);for(var Le=se.length;Le--;)Se.animations[De][Le]instanceof h.Number&&(se[Le]=new h.Number(se[Le])),Se.animations[De][Le]=se[Le].morph(Se.animations[De][Le])}for(var De in Se.attrs)Se.attrs[De]=new h.MorphObj(this.target().attr(De),Se.attrs[De]);for(var De in Se.styles)Se.styles[De]=new h.MorphObj(this.target().style(De),Se.styles[De]);return Se.initialTransformation=this.target().matrixify(),Se.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(se,Se){var De=this.active;return this.active=!1,Se&&this.clearQueue(),se&&this.situation&&(!De&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},after:function(se){var Se=this.last();return this.target().on("finished.fx",function De(Le){Le.detail.situation==Se&&(se.call(this,Se),this.off("finished.fx",De))}),this._callStart()},during:function(se){var Se=this.last(),De=function(Le){Le.detail.situation==Se&&se.call(this,Le.detail.pos,h.morph(Le.detail.pos),Le.detail.eased,Se)};return this.target().off("during.fx",De).on("during.fx",De),this.after(function(){this.off("during.fx",De)}),this._callStart()},afterAll:function(se){var Se=function De(Le){se.call(this),this.off("allfinished.fx",De)};return this.target().off("allfinished.fx",Se).on("allfinished.fx",Se),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(se,Se,De){return this.last()[De||"animations"][se]=Se,this._callStart()},step:function(se){var Se,De,Le;se||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(Se=Math.max(this.absPos,0),De=Math.floor(Se),this.situation.loops===!0||De<this.situation.loops?(this.pos=Se-De,Le=this.situation.loop,this.situation.loop=De):(this.absPos=this.situation.loops,this.pos=1,Le=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=!!((this.situation.loop-Le)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var _e=this.situation.ease(this.pos);for(var nt in this.situation.once)nt>this.lastPos&&nt<=_e&&(this.situation.once[nt].call(this.target(),this.pos,_e),delete this.situation.once[nt]);return this.active&&this.target().fire("during",{pos:this.pos,eased:_e,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=_e,this):this},eachAt:function(){var se,Se=this,De=this.target(),Le=this.situation;for(var _e in Le.animations)se=[].concat(Le.animations[_e]).map(function(bt){return typeof bt!="string"&&bt.at?bt.at(Le.ease(Se.pos),Se.pos):bt}),De[_e].apply(De,se);for(var _e in Le.attrs)se=[_e].concat(Le.attrs[_e]).map(function(Zt){return typeof Zt!="string"&&Zt.at?Zt.at(Le.ease(Se.pos),Se.pos):Zt}),De.attr.apply(De,se);for(var _e in Le.styles)se=[_e].concat(Le.styles[_e]).map(function(Zt){return typeof Zt!="string"&&Zt.at?Zt.at(Le.ease(Se.pos),Se.pos):Zt}),De.style.apply(De,se);if(Le.transforms.length){se=Le.initialTransformation,_e=0;for(var nt=Le.transforms.length;_e<nt;_e++){var lt=Le.transforms[_e];lt instanceof h.Matrix?se=lt.relative?se.multiply(new h.Matrix().morph(lt).at(Le.ease(this.pos))):se.morph(lt).at(Le.ease(this.pos)):(lt.relative||lt.undo(se.extract()),se=se.multiply(lt.at(Le.ease(this.pos))))}De.matrix(se)}return this},once:function(se,Se,De){var Le=this.last();return De||(se=Le.ease(se)),Le.once[se]=Se,this},_callStart:function(){return setTimeout((function(){this.start()}).bind(this),0),this}},parent:h.Element,construct:{animate:function(se,Se,De){return(this.fx||(this.fx=new h.FX(this))).animate(se,Se,De)},delay:function(se){return(this.fx||(this.fx=new h.FX(this))).delay(se)},stop:function(se,Se){return this.fx&&this.fx.stop(se,Se),this},finish:function(){return this.fx&&this.fx.finish(),this}}}),h.MorphObj=h.invent({create:function(se,Se){return h.Color.isColor(Se)?new h.Color(se).morph(Se):h.regex.delimiter.test(se)?h.regex.pathLetters.test(se)?new h.PathArray(se).morph(Se):new h.Array(se).morph(Se):h.regex.numberAndUnit.test(Se)?new h.Number(se).morph(Se):(this.value=se,void(this.destination=Se))},extend:{at:function(se,Se){return Se<1?this.value:this.destination},valueOf:function(){return this.value}}}),h.extend(h.FX,{attr:function(se,Se,De){if(P(se)==="object")for(var Le in se)this.attr(Le,se[Le]);else this.add(se,Se,"attrs");return this},plot:function(se,Se,De,Le){return arguments.length==4?this.plot([se,Se,De,Le]):this.add("plot",new(this.target()).morphArray(se))}}),h.Box=h.invent({create:function(se,Se,De,Le){if(!(P(se)!=="object"||se instanceof h.Element))return h.Box.call(this,se.left!=null?se.left:se.x,se.top!=null?se.top:se.y,se.width,se.height);var _e;arguments.length==4&&(this.x=se,this.y=Se,this.width=De,this.height=Le),(_e=this).x==null&&(_e.x=0,_e.y=0,_e.width=0,_e.height=0),_e.w=_e.width,_e.h=_e.height,_e.x2=_e.x+_e.width,_e.y2=_e.y+_e.height,_e.cx=_e.x+_e.width/2,_e.cy=_e.y+_e.height/2}}),h.BBox=h.invent({create:function(se){if(h.Box.apply(this,[].slice.call(arguments)),se instanceof h.Element){var Se;try{if(!p.documentElement.contains){for(var De=se.node;De.parentNode;)De=De.parentNode;if(De!=p)throw new Error("Element not in the dom")}Se=se.node.getBBox()}catch{if(se instanceof h.Shape){h.parser.draw||h.prepare();var Le=se.clone(h.parser.draw.instance).show();Le&&Le.node&&typeof Le.node.getBBox=="function"&&(Se=Le.node.getBBox()),Le&&typeof Le.remove=="function"&&Le.remove()}else Se={x:se.node.clientLeft,y:se.node.clientTop,width:se.node.clientWidth,height:se.node.clientHeight}}h.Box.call(this,Se)}},inherit:h.Box,parent:h.Element,construct:{bbox:function(){return new h.BBox(this)}}}),h.BBox.prototype.constructor=h.BBox,h.Matrix=h.invent({create:function(se){var Se=ke([1,0,0,1,0,0]);se=se===null?Se:se instanceof h.Element?se.matrixify():typeof se=="string"?ke(se.split(h.regex.delimiter).map(parseFloat)):arguments.length==6?ke([].slice.call(arguments)):Array.isArray(se)?ke(se):se&&P(se)==="object"?se:Se;for(var De=Fe.length-1;De>=0;--De)this[Fe[De]]=se[Fe[De]]!=null?se[Fe[De]]:Se[Fe[De]]},extend:{extract:function(){var se=we(this,0,1);we(this,1,0);var Se=180/Math.PI*Math.atan2(se.y,se.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(Se*Math.PI/180)+this.f*Math.sin(Se*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(Se*Math.PI/180)+this.e*Math.sin(-Se*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),rotation:Se,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new h.Matrix(this)}},clone:function(){return new h.Matrix(this)},morph:function(se){return this.destination=new h.Matrix(se),this},multiply:function(se){return new h.Matrix(this.native().multiply(function(Se){return Se instanceof h.Matrix||(Se=new h.Matrix(Se)),Se}(se).native()))},inverse:function(){return new h.Matrix(this.native().inverse())},translate:function(se,Se){return new h.Matrix(this.native().translate(se||0,Se||0))},native:function(){for(var se=h.parser.native.createSVGMatrix(),Se=Fe.length-1;Se>=0;Se--)se[Fe[Se]]=this[Fe[Se]];return se},toString:function(){return"matrix("+Ye(this.a)+","+Ye(this.b)+","+Ye(this.c)+","+Ye(this.d)+","+Ye(this.e)+","+Ye(this.f)+")"}},parent:h.Element,construct:{ctm:function(){return new h.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof h.Nested){var se=this.rect(1,1),Se=se.node.getScreenCTM();return se.remove(),new h.Matrix(Se)}return new h.Matrix(this.node.getScreenCTM())}}}),h.Point=h.invent({create:function(se,Se){var De;De=Array.isArray(se)?{x:se[0],y:se[1]}:P(se)==="object"?{x:se.x,y:se.y}:se!=null?{x:se,y:Se??se}:{x:0,y:0},this.x=De.x,this.y=De.y},extend:{clone:function(){return new h.Point(this)},morph:function(se,Se){return this.destination=new h.Point(se,Se),this}}}),h.extend(h.Element,{point:function(se,Se){return new h.Point(se,Se).transform(this.screenCTM().inverse())}}),h.extend(h.Element,{attr:function(se,Se,De){if(se==null){for(se={},De=(Se=this.node.attributes).length-1;De>=0;De--)se[Se[De].nodeName]=h.regex.isNumber.test(Se[De].nodeValue)?parseFloat(Se[De].nodeValue):Se[De].nodeValue;return se}if(P(se)==="object")for(var Le in se)this.attr(Le,se[Le]);else if(Se===null)this.node.removeAttribute(se);else{if(Se==null)return(Se=this.node.getAttribute(se))==null?h.defaults.attrs[se]:h.regex.isNumber.test(Se)?parseFloat(Se):Se;se=="stroke-width"?this.attr("stroke",parseFloat(Se)>0?this._stroke:null):se=="stroke"&&(this._stroke=Se),se!="fill"&&se!="stroke"||(h.regex.isImage.test(Se)&&(Se=this.doc().defs().image(Se,0,0)),Se instanceof h.Image&&(Se=this.doc().defs().pattern(0,0,function(){this.add(Se)}))),typeof Se=="number"?Se=new h.Number(Se):h.Color.isColor(Se)?Se=new h.Color(Se):Array.isArray(Se)&&(Se=new h.Array(Se)),se=="leading"?this.leading&&this.leading(Se):typeof De=="string"?this.node.setAttributeNS(De,se,Se.toString()):this.node.setAttribute(se,Se.toString()),!this.rebuild||se!="font-size"&&se!="x"||this.rebuild(se,Se)}return this}}),h.extend(h.Element,{transform:function(se,Se){var De;return P(se)!=="object"?(De=new h.Matrix(this).extract(),typeof se=="string"?De[se]:De):(De=new h.Matrix(this),Se=!!Se||!!se.relative,se.a!=null&&(De=Se?De.multiply(new h.Matrix(se)):new h.Matrix(se)),this.attr("transform",De))}}),h.extend(h.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(h.regex.transforms).slice(0,-1).map(function(se){var Se=se.trim().split("(");return[Se[0],Se[1].split(h.regex.delimiter).map(function(De){return parseFloat(De)})]}).reduce(function(se,Se){return Se[0]=="matrix"?se.multiply(ke(Se[1])):se[Se[0]].apply(se,Se[1])},new h.Matrix)},toParent:function(se){if(this==se)return this;var Se=this.screenCTM(),De=se.screenCTM().inverse();return this.addTo(se).untransform().transform(De.multiply(Se)),this},toDoc:function(){return this.toParent(this.doc())}}),h.Transformation=h.invent({create:function(se,Se){if(arguments.length>1&&typeof Se!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(se))for(var De=0,Le=this.arguments.length;De<Le;++De)this[this.arguments[De]]=se[De];else if(se&&P(se)==="object")for(De=0,Le=this.arguments.length;De<Le;++De)this[this.arguments[De]]=se[this.arguments[De]];this.inversed=!1,Se===!0&&(this.inversed=!0)}}),h.Translate=h.invent({parent:h.Matrix,inherit:h.Transformation,create:function(se,Se){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),h.extend(h.Element,{style:function(se,Se){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(P(se)==="object")for(var De in se)this.style(De,se[De]);else{if(!h.regex.isCss.test(se))return this.node.style[ee(se)];for(se=se.split(/\s*;\s*/).filter(function(Le){return!!Le}).map(function(Le){return Le.split(/\s*:\s*/)});Se=se.pop();)this.style(Se[0],Se[1])}else this.node.style[ee(se)]=Se===null||h.regex.isBlank.test(Se)?"":Se;return this}}),h.Parent=h.invent({create:function(se){this.constructor.call(this,se)},inherit:h.Element,extend:{children:function(){return h.utils.map(h.utils.filterSVGElements(this.node.childNodes),function(se){return h.adopt(se)})},add:function(se,Se){return Se==null?this.node.appendChild(se.node):se.node!=this.node.childNodes[Se]&&this.node.insertBefore(se.node,this.node.childNodes[Se]),this},put:function(se,Se){return this.add(se,Se),se},has:function(se){return this.index(se)>=0},index:function(se){return[].slice.call(this.node.childNodes).indexOf(se.node)},get:function(se){return h.adopt(this.node.childNodes[se])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(se,Se){for(var De=this.children(),Le=0,_e=De.length;Le<_e;Le++)De[Le]instanceof h.Element&&se.apply(De[Le],[Le,De]),Se&&De[Le]instanceof h.Container&&De[Le].each(se,Se);return this},removeElement:function(se){return this.node.removeChild(se.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),h.extend(h.Parent,{ungroup:function(se,Se){return Se===0||this instanceof h.Defs||this.node==h.parser.draw||(se=se||(this instanceof h.Doc?this:this.parent(h.Parent)),Se=Se||1/0,this.each(function(){return this instanceof h.Defs?this:this instanceof h.Parent?this.ungroup(se,Se-1):this.toParent(se)}),this.node.firstChild||this.remove()),this},flatten:function(se,Se){return this.ungroup(se,Se)}}),h.Container=h.invent({create:function(se){this.constructor.call(this,se)},inherit:h.Parent}),h.ViewBox=h.invent({parent:h.Container,construct:{}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(se){h.Element.prototype[se]=function(Se){return h.on(this.node,se,Se),this}}),h.listeners=[],h.handlerMap=[],h.listenerId=0,h.on=function(se,Se,De,Le,_e){var nt=De.bind(Le||se.instance||se),lt=(h.handlerMap.indexOf(se)+1||h.handlerMap.push(se))-1,bt=Se.split(".")[0],Zt=Se.split(".")[1]||"*";h.listeners[lt]=h.listeners[lt]||{},h.listeners[lt][bt]=h.listeners[lt][bt]||{},h.listeners[lt][bt][Zt]=h.listeners[lt][bt][Zt]||{},De._svgjsListenerId||(De._svgjsListenerId=++h.listenerId),h.listeners[lt][bt][Zt][De._svgjsListenerId]=nt,se.addEventListener(bt,nt,_e||{passive:!1})},h.off=function(se,Se,De){var Le=h.handlerMap.indexOf(se),_e=Se&&Se.split(".")[0],nt=Se&&Se.split(".")[1],lt="";if(Le!=-1)if(De){if(typeof De=="function"&&(De=De._svgjsListenerId),!De)return;h.listeners[Le][_e]&&h.listeners[Le][_e][nt||"*"]&&(se.removeEventListener(_e,h.listeners[Le][_e][nt||"*"][De],!1),delete h.listeners[Le][_e][nt||"*"][De])}else if(nt&&_e){if(h.listeners[Le][_e]&&h.listeners[Le][_e][nt]){for(var bt in h.listeners[Le][_e][nt])h.off(se,[_e,nt].join("."),bt);delete h.listeners[Le][_e][nt]}}else if(nt)for(var Zt in h.listeners[Le])for(var lt in h.listeners[Le][Zt])nt===lt&&h.off(se,[Zt,nt].join("."));else if(_e){if(h.listeners[Le][_e]){for(var lt in h.listeners[Le][_e])h.off(se,[_e,lt].join("."));delete h.listeners[Le][_e]}}else{for(var Zt in h.listeners[Le])h.off(se,Zt);delete h.listeners[Le],delete h.handlerMap[Le]}},h.extend(h.Element,{on:function(se,Se,De,Le){return h.on(this.node,se,Se,De,Le),this},off:function(se,Se){return h.off(this.node,se,Se),this},fire:function(se,Se){return se instanceof Ee.Event?this.node.dispatchEvent(se):this.node.dispatchEvent(se=new h.CustomEvent(se,{detail:Se,cancelable:!0})),this._event=se,this},event:function(){return this._event}}),h.Defs=h.invent({create:"defs",inherit:h.Container}),h.G=h.invent({create:"g",inherit:h.Container,extend:{x:function(se){return se==null?this.transform("x"):this.transform({x:se-this.x()},!0)}},construct:{group:function(){return this.put(new h.G)}}}),h.Doc=h.invent({create:function(se){se&&((se=typeof se=="string"?p.getElementById(se):se).nodeName=="svg"?this.constructor.call(this,se):(this.constructor.call(this,h.create("svg")),se.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:h.Container,extend:{namespace:function(){return this.attr({xmlns:h.ns,version:"1.1"}).attr("xmlns:xlink",h.xlink,h.xmlns).attr("xmlns:svgjs",h.svgjs,h.xmlns)},defs:function(){var se;return this._defs||((se=this.node.getElementsByTagName("defs")[0])?this._defs=h.adopt(se):this._defs=new h.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&this.node.parentNode.nodeName!="#document"?this.node.parentNode:null},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,h.parser.draw&&!h.parser.draw.parentNode&&this.node.appendChild(h.parser.draw),this},clone:function(se){this.writeDataToDom();var Se=this.node,De=Me(Se.cloneNode(!0));return se?(se.node||se).appendChild(De.node):Se.parentNode.insertBefore(De.node,Se.nextSibling),De}}}),h.extend(h.Element,{}),h.Gradient=h.invent({create:function(se){this.constructor.call(this,h.create(se+"Gradient")),this.type=se},inherit:h.Container,extend:{at:function(se,Se,De){return this.put(new h.Stop).update(se,Se,De)},update:function(se){return this.clear(),typeof se=="function"&&se.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(se,Se,De){return se=="transform"&&(se="gradientTransform"),h.Container.prototype.attr.call(this,se,Se,De)}},construct:{gradient:function(se,Se){return this.defs().gradient(se,Se)}}}),h.extend(h.Gradient,h.FX,{from:function(se,Se){return(this._target||this).type=="radial"?this.attr({fx:new h.Number(se),fy:new h.Number(Se)}):this.attr({x1:new h.Number(se),y1:new h.Number(Se)})},to:function(se,Se){return(this._target||this).type=="radial"?this.attr({cx:new h.Number(se),cy:new h.Number(Se)}):this.attr({x2:new h.Number(se),y2:new h.Number(Se)})}}),h.extend(h.Defs,{gradient:function(se,Se){return this.put(new h.Gradient(se)).update(Se)}}),h.Stop=h.invent({create:"stop",inherit:h.Element,extend:{update:function(se){return(typeof se=="number"||se instanceof h.Number)&&(se={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),se.opacity!=null&&this.attr("stop-opacity",se.opacity),se.color!=null&&this.attr("stop-color",se.color),se.offset!=null&&this.attr("offset",new h.Number(se.offset)),this}}}),h.Pattern=h.invent({create:"pattern",inherit:h.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(se){return this.clear(),typeof se=="function"&&se.call(this,this),this},toString:function(){return this.fill()},attr:function(se,Se,De){return se=="transform"&&(se="patternTransform"),h.Container.prototype.attr.call(this,se,Se,De)}},construct:{pattern:function(se,Se,De){return this.defs().pattern(se,Se,De)}}}),h.extend(h.Defs,{pattern:function(se,Se,De){return this.put(new h.Pattern).update(De).attr({x:0,y:0,width:se,height:Se,patternUnits:"userSpaceOnUse"})}}),h.Shape=h.invent({create:function(se){this.constructor.call(this,se)},inherit:h.Element}),h.Symbol=h.invent({create:"symbol",inherit:h.Container,construct:{symbol:function(){return this.put(new h.Symbol)}}}),h.Use=h.invent({create:"use",inherit:h.Shape,extend:{element:function(se,Se){return this.attr("href",(Se||"")+"#"+se,h.xlink)}},construct:{use:function(se,Se){return this.put(new h.Use).element(se,Se)}}}),h.Rect=h.invent({create:"rect",inherit:h.Shape,construct:{rect:function(se,Se){return this.put(new h.Rect).size(se,Se)}}}),h.Circle=h.invent({create:"circle",inherit:h.Shape,construct:{circle:function(se){return this.put(new h.Circle).rx(new h.Number(se).divide(2)).move(0,0)}}}),h.extend(h.Circle,h.FX,{rx:function(se){return this.attr("r",se)},ry:function(se){return this.rx(se)}}),h.Ellipse=h.invent({create:"ellipse",inherit:h.Shape,construct:{ellipse:function(se,Se){return this.put(new h.Ellipse).size(se,Se).move(0,0)}}}),h.extend(h.Ellipse,h.Rect,h.FX,{rx:function(se){return this.attr("rx",se)},ry:function(se){return this.attr("ry",se)}}),h.extend(h.Circle,h.Ellipse,{x:function(se){return se==null?this.cx()-this.rx():this.cx(se+this.rx())},y:function(se){return se==null?this.cy()-this.ry():this.cy(se+this.ry())},cx:function(se){return se==null?this.attr("cx"):this.attr("cx",se)},cy:function(se){return se==null?this.attr("cy"):this.attr("cy",se)},width:function(se){return se==null?2*this.rx():this.rx(new h.Number(se).divide(2))},height:function(se){return se==null?2*this.ry():this.ry(new h.Number(se).divide(2))},size:function(se,Se){var De=xe(this,se,Se);return this.rx(new h.Number(De.width).divide(2)).ry(new h.Number(De.height).divide(2))}}),h.Line=h.invent({create:"line",inherit:h.Shape,extend:{array:function(){return new h.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(se,Se,De,Le){return se==null?this.array():(se=Se!==void 0?{x1:se,y1:Se,x2:De,y2:Le}:new h.PointArray(se).toLine(),this.attr(se))},move:function(se,Se){return this.attr(this.array().move(se,Se).toLine())},size:function(se,Se){var De=xe(this,se,Se);return this.attr(this.array().size(De.width,De.height).toLine())}},construct:{line:function(se,Se,De,Le){return h.Line.prototype.plot.apply(this.put(new h.Line),se!=null?[se,Se,De,Le]:[0,0,0,0])}}}),h.Polyline=h.invent({create:"polyline",inherit:h.Shape,construct:{polyline:function(se){return this.put(new h.Polyline).plot(se||new h.PointArray)}}}),h.Polygon=h.invent({create:"polygon",inherit:h.Shape,construct:{polygon:function(se){return this.put(new h.Polygon).plot(se||new h.PointArray)}}}),h.extend(h.Polyline,h.Polygon,{array:function(){return this._array||(this._array=new h.PointArray(this.attr("points")))},plot:function(se){return se==null?this.array():this.clear().attr("points",typeof se=="string"?se:this._array=new h.PointArray(se))},clear:function(){return delete this._array,this},move:function(se,Se){return this.attr("points",this.array().move(se,Se))},size:function(se,Se){var De=xe(this,se,Se);return this.attr("points",this.array().size(De.width,De.height))}}),h.extend(h.Line,h.Polyline,h.Polygon,{morphArray:h.PointArray,x:function(se){return se==null?this.bbox().x:this.move(se,this.bbox().y)},y:function(se){return se==null?this.bbox().y:this.move(this.bbox().x,se)},width:function(se){var Se=this.bbox();return se==null?Se.width:this.size(se,Se.height)},height:function(se){var Se=this.bbox();return se==null?Se.height:this.size(Se.width,se)}}),h.Path=h.invent({create:"path",inherit:h.Shape,extend:{morphArray:h.PathArray,array:function(){return this._array||(this._array=new h.PathArray(this.attr("d")))},plot:function(se){return se==null?this.array():this.clear().attr("d",typeof se=="string"?se:this._array=new h.PathArray(se))},clear:function(){return delete this._array,this}},construct:{path:function(se){return this.put(new h.Path).plot(se||new h.PathArray)}}}),h.Image=h.invent({create:"image",inherit:h.Shape,extend:{load:function(se){if(!se)return this;var Se=this,De=new Ee.Image;return h.on(De,"load",function(){h.off(De);var Le=Se.parent(h.Pattern);Le!==null&&(Se.width()==0&&Se.height()==0&&Se.size(De.width,De.height),Le&&Le.width()==0&&Le.height()==0&&Le.size(Se.width(),Se.height()),typeof Se._loaded=="function"&&Se._loaded.call(Se,{width:De.width,height:De.height,ratio:De.width/De.height,url:se}))}),h.on(De,"error",function(Le){h.off(De),typeof Se._error=="function"&&Se._error.call(Se,Le)}),this.attr("href",De.src=this.src=se,h.xlink)},loaded:function(se){return this._loaded=se,this},error:function(se){return this._error=se,this}},construct:{image:function(se,Se,De){return this.put(new h.Image).load(se).size(Se||0,De||Se||0)}}}),h.Text=h.invent({create:function(){this.constructor.call(this,h.create("text")),this.dom.leading=new h.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",h.defaults.attrs["font-family"])},inherit:h.Shape,extend:{x:function(se){return se==null?this.attr("x"):this.attr("x",se)},text:function(se){if(se===void 0){se="";for(var Se=this.node.childNodes,De=0,Le=Se.length;De<Le;++De)De!=0&&Se[De].nodeType!=3&&h.adopt(Se[De]).dom.newLined==1&&(se+=`
`),se+=Se[De].textContent;return se}if(this.clear().build(!0),typeof se=="function")se.call(this,this);else{De=0;for(var _e=(se=se.split(`
`)).length;De<_e;De++)this.tspan(se[De]).newLine()}return this.build(!1).rebuild()},size:function(se){return this.attr("font-size",se).rebuild()},leading:function(se){return se==null?this.dom.leading:(this.dom.leading=new h.Number(se),this.rebuild())},lines:function(){var se=(this.textPath&&this.textPath()||this).node,Se=h.utils.map(h.utils.filterSVGElements(se.childNodes),function(De){return h.adopt(De)});return new h.Set(Se)},rebuild:function(se){if(typeof se=="boolean"&&(this._rebuild=se),this._rebuild){var Se=this,De=0,Le=this.dom.leading*new h.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(Se.textPath()||this.attr("x",Se.attr("x")),this.text()==`
`?De+=Le:(this.attr("dy",Le+De),De=0))}),this.fire("rebuild")}return this},build:function(se){return this._build=!!se,this},setData:function(se){return this.dom=se,this.dom.leading=new h.Number(se.leading||1.3),this}},construct:{text:function(se){return this.put(new h.Text).text(se)},plain:function(se){return this.put(new h.Text).plain(se)}}}),h.Tspan=h.invent({create:"tspan",inherit:h.Shape,extend:{text:function(se){return se==null?this.node.textContent+(this.dom.newLined?`
`:""):(typeof se=="function"?se.call(this,this):this.plain(se),this)},dx:function(se){return this.attr("dx",se)},dy:function(se){return this.attr("dy",se)},newLine:function(){var se=this.parent(h.Text);return this.dom.newLined=!0,this.dy(se.dom.leading*se.attr("font-size")).attr("x",se.x())}}}),h.extend(h.Text,h.Tspan,{plain:function(se){return this._build===!1&&this.clear(),this.node.appendChild(p.createTextNode(se)),this},tspan:function(se){var Se=(this.textPath&&this.textPath()||this).node,De=new h.Tspan;return this._build===!1&&this.clear(),Se.appendChild(De.node),De.text(se)},clear:function(){for(var se=(this.textPath&&this.textPath()||this).node;se.hasChildNodes();)se.removeChild(se.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),h.TextPath=h.invent({create:"textPath",inherit:h.Parent,parent:h.Text,construct:{morphArray:h.PathArray,array:function(){var se=this.track();return se?se.array():null},plot:function(se){var Se=this.track(),De=null;return Se&&(De=Se.plot(se)),se==null?De:this},track:function(){var se=this.textPath();if(se)return se.reference("href")},textPath:function(){if(this.node.firstChild&&this.node.firstChild.nodeName=="textPath")return h.adopt(this.node.firstChild)}}}),h.Nested=h.invent({create:function(){this.constructor.call(this,h.create("svg")),this.style("overflow","visible")},inherit:h.Container,construct:{nested:function(){return this.put(new h.Nested)}}});var B={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(se,Se){return Se=="color"?se:se+"-"+Se}};function W(se,Se,De,Le){return De+Le.replace(h.regex.dots," .")}function ee(se){return se.toLowerCase().replace(/-(.)/g,function(Se,De){return De.toUpperCase()})}function de(se){return se.charAt(0).toUpperCase()+se.slice(1)}function fe(se){var Se=se.toString(16);return Se.length==1?"0"+Se:Se}function xe(se,Se,De){if(Se==null||De==null){var Le=se.bbox();Se==null?Se=Le.width/Le.height*De:De==null&&(De=Le.height/Le.width*Se)}return{width:Se,height:De}}function we(se,Se,De){return{x:Se*se.a+De*se.c+0,y:Se*se.b+De*se.d+0}}function ke(se){return{a:se[0],b:se[1],c:se[2],d:se[3],e:se[4],f:se[5]}}function Me(se){for(var Se=se.childNodes.length-1;Se>=0;Se--)se.childNodes[Se]instanceof Ee.SVGElement&&Me(se.childNodes[Se]);return h.adopt(se).id(h.eid(se.nodeName))}function Ye(se){return Math.abs(se)>1e-37?se:0}["fill","stroke"].forEach(function(se){var Se={};Se[se]=function(De){if(De===void 0)return this;if(typeof De=="string"||h.Color.isRgb(De)||De&&typeof De.fill=="function")this.attr(se,De);else for(var Le=B[se].length-1;Le>=0;Le--)De[B[se][Le]]!=null&&this.attr(B.prefix(se,B[se][Le]),De[B[se][Le]]);return this},h.extend(h.Element,h.FX,Se)}),h.extend(h.Element,h.FX,{translate:function(se,Se){return this.transform({x:se,y:Se})},matrix:function(se){return this.attr("transform",new h.Matrix(arguments.length==6?[].slice.call(arguments):se))},opacity:function(se){return this.attr("opacity",se)},dx:function(se){return this.x(new h.Number(se).plus(this instanceof h.FX?0:this.x()),!0)},dy:function(se){return this.y(new h.Number(se).plus(this instanceof h.FX?0:this.y()),!0)}}),h.extend(h.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(se){return this.node.getPointAtLength(se)}}),h.Set=h.invent({create:function(se){Array.isArray(se)?this.members=se:this.clear()},extend:{add:function(){for(var se=[].slice.call(arguments),Se=0,De=se.length;Se<De;Se++)this.members.push(se[Se]);return this},remove:function(se){var Se=this.index(se);return Se>-1&&this.members.splice(Se,1),this},each:function(se){for(var Se=0,De=this.members.length;Se<De;Se++)se.apply(this.members[Se],[Se,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(se){return this.index(se)>=0},index:function(se){return this.members.indexOf(se)},get:function(se){return this.members[se]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members}},construct:{set:function(se){return new h.Set(se)}}}),h.FX.Set=h.invent({create:function(se){this.set=se}}),h.Set.inherit=function(){var se=[];for(var Se in h.Shape.prototype)typeof h.Shape.prototype[Se]=="function"&&typeof h.Set.prototype[Se]!="function"&&se.push(Se);for(var Se in se.forEach(function(Le){h.Set.prototype[Le]=function(){for(var _e=0,nt=this.members.length;_e<nt;_e++)this.members[_e]&&typeof this.members[_e][Le]=="function"&&this.members[_e][Le].apply(this.members[_e],arguments);return Le=="animate"?this.fx||(this.fx=new h.FX.Set(this)):this}}),se=[],h.FX.prototype)typeof h.FX.prototype[Se]=="function"&&typeof h.FX.Set.prototype[Se]!="function"&&se.push(Se);se.forEach(function(De){h.FX.Set.prototype[De]=function(){for(var Le=0,_e=this.set.members.length;Le<_e;Le++)this.set.members[Le].fx[De].apply(this.set.members[Le].fx,arguments);return this}})},h.extend(h.Element,{}),h.extend(h.Element,{remember:function(se,Se){if(P(arguments[0])==="object")for(var De in se)this.remember(De,se[De]);else{if(arguments.length==1)return this.memory()[se];this.memory()[se]=Se}return this},forget:function(){if(arguments.length==0)this._memory={};else for(var se=arguments.length-1;se>=0;se--)delete this.memory()[arguments[se]];return this},memory:function(){return this._memory||(this._memory={})}}),h.get=function(se){var Se=p.getElementById(function(De){var Le=(De||"").toString().match(h.regex.reference);if(Le)return Le[1]}(se)||se);return h.adopt(Se)},h.select=function(se,Se){return new h.Set(h.utils.map((Se||p).querySelectorAll(se),function(De){return h.adopt(De)}))},h.extend(h.Parent,{select:function(se){return h.select(se,this.node)}});var Fe="abcdef".split("");if(typeof Ee.CustomEvent!="function"){var st=function(se,Se){Se=Se||{bubbles:!1,cancelable:!1,detail:void 0};var De=p.createEvent("CustomEvent");return De.initCustomEvent(se,Se.bubbles,Se.cancelable,Se.detail),De};st.prototype=Ee.Event.prototype,h.CustomEvent=st}else h.CustomEvent=Ee.CustomEvent;return h},P(t)==="object"?e.exports=yn.document?Dt(yn,yn.document):function(Ee){return Dt(Ee,Ee.document)}:yn.SVG=Dt(yn,yn.document),(function(){SVG.Filter=SVG.invent({create:"filter",inherit:SVG.Parent,extend:{source:"SourceGraphic",sourceAlpha:"SourceAlpha",background:"BackgroundImage",backgroundAlpha:"BackgroundAlpha",fill:"FillPaint",stroke:"StrokePaint",autoSetIn:!0,put:function(T,B){return this.add(T,B),!T.attr("in")&&this.autoSetIn&&T.attr("in",this.source),T.attr("result")||T.attr("result",T),T},blend:function(T,B,W){return this.put(new SVG.BlendEffect(T,B,W))},colorMatrix:function(T,B){return this.put(new SVG.ColorMatrixEffect(T,B))},convolveMatrix:function(T){return this.put(new SVG.ConvolveMatrixEffect(T))},componentTransfer:function(T){return this.put(new SVG.ComponentTransferEffect(T))},composite:function(T,B,W){return this.put(new SVG.CompositeEffect(T,B,W))},flood:function(T,B){return this.put(new SVG.FloodEffect(T,B))},offset:function(T,B){return this.put(new SVG.OffsetEffect(T,B))},image:function(T){return this.put(new SVG.ImageEffect(T))},merge:function(){var T=[void 0];for(var B in arguments)T.push(arguments[B]);return this.put(new(SVG.MergeEffect.bind.apply(SVG.MergeEffect,T)))},gaussianBlur:function(T,B){return this.put(new SVG.GaussianBlurEffect(T,B))},morphology:function(T,B){return this.put(new SVG.MorphologyEffect(T,B))},diffuseLighting:function(T,B,W){return this.put(new SVG.DiffuseLightingEffect(T,B,W))},displacementMap:function(T,B,W,ee,de){return this.put(new SVG.DisplacementMapEffect(T,B,W,ee,de))},specularLighting:function(T,B,W,ee){return this.put(new SVG.SpecularLightingEffect(T,B,W,ee))},tile:function(){return this.put(new SVG.TileEffect)},turbulence:function(T,B,W,ee,de){return this.put(new SVG.TurbulenceEffect(T,B,W,ee,de))},toString:function(){return"url(#"+this.attr("id")+")"}}}),SVG.extend(SVG.Defs,{filter:function(T){var B=this.put(new SVG.Filter);return typeof T=="function"&&T.call(B,B),B}}),SVG.extend(SVG.Container,{filter:function(T){return this.defs().filter(T)}}),SVG.extend(SVG.Element,SVG.G,SVG.Nested,{filter:function(T){return this.filterer=T instanceof SVG.Element?T:this.doc().filter(T),this.doc()&&this.filterer.doc()!==this.doc()&&this.doc().defs().add(this.filterer),this.attr("filter",this.filterer),this.filterer},unfilter:function(T){return this.filterer&&T===!0&&this.filterer.remove(),delete this.filterer,this.attr("filter",null)}}),SVG.Effect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(T){return T==null?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",T)},result:function(T){return T==null?this.attr("result"):this.attr("result",T)},toString:function(){return this.result()}}}),SVG.ParentEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Parent,extend:{in:function(T){return T==null?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",T)},result:function(T){return T==null?this.attr("result"):this.attr("result",T)},toString:function(){return this.result()}}});var Ee={blend:function(T,B){return this.parent()&&this.parent().blend(this,T,B)},colorMatrix:function(T,B){return this.parent()&&this.parent().colorMatrix(T,B).in(this)},convolveMatrix:function(T){return this.parent()&&this.parent().convolveMatrix(T).in(this)},componentTransfer:function(T){return this.parent()&&this.parent().componentTransfer(T).in(this)},composite:function(T,B){return this.parent()&&this.parent().composite(this,T,B)},flood:function(T,B){return this.parent()&&this.parent().flood(T,B)},offset:function(T,B){return this.parent()&&this.parent().offset(T,B).in(this)},image:function(T){return this.parent()&&this.parent().image(T)},merge:function(){return this.parent()&&this.parent().merge.apply(this.parent(),[this].concat(arguments))},gaussianBlur:function(T,B){return this.parent()&&this.parent().gaussianBlur(T,B).in(this)},morphology:function(T,B){return this.parent()&&this.parent().morphology(T,B).in(this)},diffuseLighting:function(T,B,W){return this.parent()&&this.parent().diffuseLighting(T,B,W).in(this)},displacementMap:function(T,B,W,ee){return this.parent()&&this.parent().displacementMap(this,T,B,W,ee)},specularLighting:function(T,B,W,ee){return this.parent()&&this.parent().specularLighting(T,B,W,ee).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(T,B,W,ee,de){return this.parent()&&this.parent().turbulence(T,B,W,ee,de).in(this)}};SVG.extend(SVG.Effect,Ee),SVG.extend(SVG.ParentEffect,Ee),SVG.ChildEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(T){this.attr("in",T)}}});var p={blend:function(T,B,W){this.attr({in:T,in2:B,mode:W||"normal"})},colorMatrix:function(T,B){T=="matrix"&&(B=_(B)),this.attr({type:T,values:B===void 0?null:B})},convolveMatrix:function(T){T=_(T),this.attr({order:Math.sqrt(T.split(" ").length),kernelMatrix:T})},composite:function(T,B,W){this.attr({in:T,in2:B,operator:W})},flood:function(T,B){this.attr("flood-color",T),B!=null&&this.attr("flood-opacity",B)},offset:function(T,B){this.attr({dx:T,dy:B})},image:function(T){this.attr("href",T,SVG.xlink)},displacementMap:function(T,B,W,ee,de){this.attr({in:T,in2:B,scale:W,xChannelSelector:ee,yChannelSelector:de})},gaussianBlur:function(T,B){T!=null||B!=null?this.attr("stdDeviation",function(W){if(!Array.isArray(W))return W;for(var ee=0,de=W.length,fe=[];ee<de;ee++)fe.push(W[ee]);return fe.join(" ")}(Array.prototype.slice.call(arguments))):this.attr("stdDeviation","0 0")},morphology:function(T,B){this.attr({operator:T,radius:B})},tile:function(){},turbulence:function(T,B,W,ee,de){this.attr({numOctaves:B,seed:W,stitchTiles:ee,baseFrequency:T,type:de})}},h={merge:function(){var T;if(arguments[0]instanceof SVG.Set){var B=this;arguments[0].each(function(ee){this instanceof SVG.MergeNode?B.put(this):(this instanceof SVG.Effect||this instanceof SVG.ParentEffect)&&B.put(new SVG.MergeNode(this))})}else{T=Array.isArray(arguments[0])?arguments[0]:arguments;for(var W=0;W<T.length;W++)T[W]instanceof SVG.MergeNode?this.put(T[W]):this.put(new SVG.MergeNode(T[W]))}},componentTransfer:function(T){if(this.rgb=new SVG.Set,["r","g","b","a"].forEach((function(W){this[W]=new SVG["Func"+W.toUpperCase()]("identity"),this.rgb.add(this[W]),this.node.appendChild(this[W].node)}).bind(this)),T)for(var B in T.rgb&&(["r","g","b"].forEach((function(W){this[W].attr(T.rgb)}).bind(this)),delete T.rgb),T)this[B].attr(T[B])},diffuseLighting:function(T,B,W){this.attr({surfaceScale:T,diffuseConstant:B,kernelUnitLength:W})},specularLighting:function(T,B,W,ee){this.attr({surfaceScale:T,diffuseConstant:B,specularExponent:W,kernelUnitLength:ee})}},S={distantLight:function(T,B){this.attr({azimuth:T,elevation:B})},pointLight:function(T,B,W){this.attr({x:T,y:B,z:W})},spotLight:function(T,B,W,ee,de,fe){this.attr({x:T,y:B,z:W,pointsAtX:ee,pointsAtY:de,pointsAtZ:fe})},mergeNode:function(T){this.attr("in",T)}};function _(T){return Array.isArray(T)&&(T=new SVG.Array(T)),T.toString().replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ")}function k(){var T=function(){};for(var B in typeof arguments[arguments.length-1]=="function"&&(T=arguments[arguments.length-1],Array.prototype.splice.call(arguments,arguments.length-1,1)),arguments)for(var W in arguments[B])T(arguments[B][W],W,arguments[B])}["r","g","b","a"].forEach(function(T){S["Func"+T.toUpperCase()]=function(B){switch(this.attr("type",B),B){case"table":this.attr("tableValues",arguments[1]);break;case"linear":this.attr("slope",arguments[1]),this.attr("intercept",arguments[2]);break;case"gamma":this.attr("amplitude",arguments[1]),this.attr("exponent",arguments[2]),this.attr("offset",arguments[2])}}}),k(p,function(T,B){var W=B.charAt(0).toUpperCase()+B.slice(1);SVG[W+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+W)),T.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.Effect,extend:{}})}),k(h,function(T,B){var W=B.charAt(0).toUpperCase()+B.slice(1);SVG[W+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+W)),T.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.ParentEffect,extend:{}})}),k(S,function(T,B){var W=B.charAt(0).toUpperCase()+B.slice(1);SVG[W]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+W)),T.apply(this,arguments)},inherit:SVG.ChildEffect,extend:{}})}),SVG.extend(SVG.MergeEffect,{in:function(T){return T instanceof SVG.MergeNode?this.add(T,0):this.add(new SVG.MergeNode(T),0),this}}),SVG.extend(SVG.CompositeEffect,SVG.BlendEffect,SVG.DisplacementMapEffect,{in2:function(T){return T==null?this.parent()&&this.parent().select('[result="'+this.attr("in2")+'"]').get(0)||this.attr("in2"):this.attr("in2",T)}}),SVG.filter={sepiatone:[.343,.669,.119,0,0,.249,.626,.13,0,0,.172,.334,.111,0,0,0,0,0,1,0]}}).call(void 0),function(){function Ee(k,T,B,W,ee,de,fe){for(var xe=k.slice(T,B||fe),we=W.slice(ee,de||fe),ke=0,Me={pos:[0,0],start:[0,0]},Ye={pos:[0,0],start:[0,0]};xe[ke]=p.call(Me,xe[ke]),we[ke]=p.call(Ye,we[ke]),xe[ke][0]!=we[ke][0]||xe[ke][0]=="M"||xe[ke][0]=="A"&&(xe[ke][4]!=we[ke][4]||xe[ke][5]!=we[ke][5])?(Array.prototype.splice.apply(xe,[ke,1].concat(S.call(Me,xe[ke]))),Array.prototype.splice.apply(we,[ke,1].concat(S.call(Ye,we[ke])))):(xe[ke]=h.call(Me,xe[ke]),we[ke]=h.call(Ye,we[ke])),!(++ke==xe.length&&ke==we.length);)ke==xe.length&&xe.push(["C",Me.pos[0],Me.pos[1],Me.pos[0],Me.pos[1],Me.pos[0],Me.pos[1]]),ke==we.length&&we.push(["C",Ye.pos[0],Ye.pos[1],Ye.pos[0],Ye.pos[1],Ye.pos[0],Ye.pos[1]]);return{start:xe,dest:we}}function p(k){switch(k[0]){case"z":case"Z":k[0]="L",k[1]=this.start[0],k[2]=this.start[1];break;case"H":k[0]="L",k[2]=this.pos[1];break;case"V":k[0]="L",k[2]=k[1],k[1]=this.pos[0];break;case"T":k[0]="Q",k[3]=k[1],k[4]=k[2],k[1]=this.reflection[1],k[2]=this.reflection[0];break;case"S":k[0]="C",k[6]=k[4],k[5]=k[3],k[4]=k[2],k[3]=k[1],k[2]=this.reflection[1],k[1]=this.reflection[0]}return k}function h(k){var T=k.length;return this.pos=[k[T-2],k[T-1]],"SCQT".indexOf(k[0])!=-1&&(this.reflection=[2*this.pos[0]-k[T-4],2*this.pos[1]-k[T-3]]),k}function S(k){var T=[k];switch(k[0]){case"M":return this.pos=this.start=[k[1],k[2]],T;case"L":k[5]=k[3]=k[1],k[6]=k[4]=k[2],k[1]=this.pos[0],k[2]=this.pos[1];break;case"Q":k[6]=k[4],k[5]=k[3],k[4]=1*k[4]/3+2*k[2]/3,k[3]=1*k[3]/3+2*k[1]/3,k[2]=1*this.pos[1]/3+2*k[2]/3,k[1]=1*this.pos[0]/3+2*k[1]/3;break;case"A":T=function(B,W){var ee,de,fe,xe,we,ke,Me,Ye,Fe,st,se,Se,De,Le,_e,nt,lt,bt,Zt,Ge,Je,We,wt,At,Gt,fn,Rn=Math.abs(W[1]),An=Math.abs(W[2]),pr=W[3]%360,mt=W[4],qt=W[5],Qt=W[6],In=W[7],or=new SVG.Point(B),Wn=new SVG.Point(Qt,In),Vn=[];if(Rn===0||An===0||or.x===Wn.x&&or.y===Wn.y)return[["C",or.x,or.y,Wn.x,Wn.y,Wn.x,Wn.y]];for(ee=new SVG.Point((or.x-Wn.x)/2,(or.y-Wn.y)/2).transform(new SVG.Matrix().rotate(pr)),(de=ee.x*ee.x/(Rn*Rn)+ee.y*ee.y/(An*An))>1&&(Rn*=de=Math.sqrt(de),An*=de),fe=new SVG.Matrix().rotate(pr).scale(1/Rn,1/An).rotate(-pr),or=or.transform(fe),Wn=Wn.transform(fe),xe=[Wn.x-or.x,Wn.y-or.y],ke=xe[0]*xe[0]+xe[1]*xe[1],we=Math.sqrt(ke),xe[0]/=we,xe[1]/=we,Me=ke<4?Math.sqrt(1-ke/4):0,mt===qt&&(Me*=-1),Ye=new SVG.Point((Wn.x+or.x)/2+Me*-xe[1],(Wn.y+or.y)/2+Me*xe[0]),Fe=new SVG.Point(or.x-Ye.x,or.y-Ye.y),st=new SVG.Point(Wn.x-Ye.x,Wn.y-Ye.y),se=Math.acos(Fe.x/Math.sqrt(Fe.x*Fe.x+Fe.y*Fe.y)),Fe.y<0&&(se*=-1),Se=Math.acos(st.x/Math.sqrt(st.x*st.x+st.y*st.y)),st.y<0&&(Se*=-1),qt&&se>Se&&(Se+=2*Math.PI),!qt&&se<Se&&(Se-=2*Math.PI),Le=Math.ceil(2*Math.abs(se-Se)/Math.PI),nt=[],lt=se,De=(Se-se)/Le,_e=4*Math.tan(De/4)/3,Je=0;Je<=Le;Je++)Zt=Math.cos(lt),bt=Math.sin(lt),Ge=new SVG.Point(Ye.x+Zt,Ye.y+bt),nt[Je]=[new SVG.Point(Ge.x+_e*bt,Ge.y-_e*Zt),Ge,new SVG.Point(Ge.x-_e*bt,Ge.y+_e*Zt)],lt+=De;for(nt[0][0]=nt[0][1].clone(),nt[nt.length-1][2]=nt[nt.length-1][1].clone(),fe=new SVG.Matrix().rotate(pr).scale(Rn,An).rotate(-pr),Je=0,We=nt.length;Je<We;Je++)nt[Je][0]=nt[Je][0].transform(fe),nt[Je][1]=nt[Je][1].transform(fe),nt[Je][2]=nt[Je][2].transform(fe);for(Je=1,We=nt.length;Je<We;Je++)wt=(Ge=nt[Je-1][2]).x,At=Ge.y,Gt=(Ge=nt[Je][0]).x,fn=Ge.y,Qt=(Ge=nt[Je][1]).x,In=Ge.y,Vn.push(["C",wt,At,Gt,fn,Qt,In]);return Vn}(this.pos,k),k=T[0]}return k[0]="C",this.pos=[k[5],k[6]],this.reflection=[2*k[5]-k[3],2*k[6]-k[4]],T}function _(k,T){if(T===!1)return!1;for(var B=T,W=k.length;B<W;++B)if(k[B][0]=="M")return B;return!1}SVG.extend(SVG.PathArray,{morph:function(k){for(var T=this.value,B=this.parse(k),W=0,ee=0,de=!1,fe=!1;W!==!1||ee!==!1;){var xe;de=_(T,W!==!1&&W+1),fe=_(B,ee!==!1&&ee+1),W===!1&&(W=(xe=new SVG.PathArray(we.start).bbox()).height==0||xe.width==0?T.push(T[0])-1:T.push(["M",xe.x+xe.width/2,xe.y+xe.height/2])-1),ee===!1&&(ee=(xe=new SVG.PathArray(we.dest).bbox()).height==0||xe.width==0?B.push(B[0])-1:B.push(["M",xe.x+xe.width/2,xe.y+xe.height/2])-1);var we=Ee(T,W,de,B,ee,fe);T=T.slice(0,W).concat(we.start,de===!1?[]:T.slice(de)),B=B.slice(0,ee).concat(we.dest,fe===!1?[]:B.slice(fe)),W=de!==!1&&W+we.start.length,ee=fe!==!1&&ee+we.dest.length}return this.value=T,this.destination=new SVG.PathArray,this.destination.value=B,this}})}(),(function(){function Ee(p){p.remember("_draggable",this),this.el=p}Ee.prototype.init=function(p,h){var S=this;this.constraint=p,this.value=h,this.el.on("mousedown.drag",function(_){S.start(_)}),this.el.on("touchstart.drag",function(_){S.start(_)})},Ee.prototype.transformPoint=function(p,h){var S=(p=p||window.event).changedTouches&&p.changedTouches[0]||p;return this.p.x=S.clientX-(h||0),this.p.y=S.clientY,this.p.matrixTransform(this.m)},Ee.prototype.getBBox=function(){var p=this.el.bbox();return this.el instanceof SVG.Nested&&(p=this.el.rbox()),(this.el instanceof SVG.G||this.el instanceof SVG.Use||this.el instanceof SVG.Nested)&&(p.x=this.el.x(),p.y=this.el.y()),p},Ee.prototype.start=function(p){if(p.type!="click"&&p.type!="mousedown"&&p.type!="mousemove"||(p.which||p.buttons)==1){var h=this;if(this.el.fire("beforedrag",{event:p,handler:this}),!this.el.event().defaultPrevented){p.preventDefault(),p.stopPropagation(),this.parent=this.parent||this.el.parent(SVG.Nested)||this.el.parent(SVG.Doc),this.p=this.parent.node.createSVGPoint(),this.m=this.el.node.getScreenCTM().inverse();var S,_=this.getBBox();if(this.el instanceof SVG.Text)switch(S=this.el.node.getComputedTextLength(),this.el.attr("text-anchor")){case"middle":S/=2;break;case"start":S=0}this.startPoints={point:this.transformPoint(p,S),box:_,transform:this.el.transform()},SVG.on(window,"mousemove.drag",function(k){h.drag(k)}),SVG.on(window,"touchmove.drag",function(k){h.drag(k)}),SVG.on(window,"mouseup.drag",function(k){h.end(k)}),SVG.on(window,"touchend.drag",function(k){h.end(k)}),this.el.fire("dragstart",{event:p,p:this.startPoints.point,m:this.m,handler:this})}}},Ee.prototype.drag=function(p){var h=this.getBBox(),S=this.transformPoint(p),_=this.startPoints.box.x+S.x-this.startPoints.point.x,k=this.startPoints.box.y+S.y-this.startPoints.point.y,T=this.constraint,B=S.x-this.startPoints.point.x,W=S.y-this.startPoints.point.y;if(this.el.fire("dragmove",{event:p,p:S,m:this.m,handler:this}),this.el.event().defaultPrevented)return S;if(typeof T=="function"){var ee=T.call(this.el,_,k,this.m);typeof ee=="boolean"&&(ee={x:ee,y:ee}),ee.x===!0?this.el.x(_):ee.x!==!1&&this.el.x(ee.x),ee.y===!0?this.el.y(k):ee.y!==!1&&this.el.y(ee.y)}else typeof T=="object"&&(T.minX!=null&&_<T.minX?B=(_=T.minX)-this.startPoints.box.x:T.maxX!=null&&_>T.maxX-h.width&&(B=(_=T.maxX-h.width)-this.startPoints.box.x),T.minY!=null&&k<T.minY?W=(k=T.minY)-this.startPoints.box.y:T.maxY!=null&&k>T.maxY-h.height&&(W=(k=T.maxY-h.height)-this.startPoints.box.y),T.snapToGrid!=null&&(_-=_%T.snapToGrid,k-=k%T.snapToGrid,B-=B%T.snapToGrid,W-=W%T.snapToGrid),this.el instanceof SVG.G?this.el.matrix(this.startPoints.transform).transform({x:B,y:W},!0):this.el.move(_,k));return S},Ee.prototype.end=function(p){var h=this.drag(p);this.el.fire("dragend",{event:p,p:h,m:this.m,handler:this}),SVG.off(window,"mousemove.drag"),SVG.off(window,"touchmove.drag"),SVG.off(window,"mouseup.drag"),SVG.off(window,"touchend.drag")},SVG.extend(SVG.Element,{draggable:function(p,h){typeof p!="function"&&typeof p!="object"||(h=p,p=!0);var S=this.remember("_draggable")||new Ee(this);return(p=p===void 0||p)?S.init(h||{},p):(this.off("mousedown.drag"),this.off("touchstart.drag")),this}})}).call(void 0),function(){function Ee(p){this.el=p,p.remember("_selectHandler",this),this.pointSelection={isSelected:!1},this.rectSelection={isSelected:!1},this.pointsList={lt:[0,0],rt:["width",0],rb:["width","height"],lb:[0,"height"],t:["width",0],r:["width","height"],b:["width","height"],l:[0,"height"]},this.pointCoord=function(h,S,_){var k=typeof h!="string"?h:S[h];return _?k/2:k},this.pointCoords=function(h,S){var _=this.pointsList[h];return{x:this.pointCoord(_[0],S,h==="t"||h==="b"),y:this.pointCoord(_[1],S,h==="r"||h==="l")}}}Ee.prototype.init=function(p,h){var S=this.el.bbox();this.options={};var _=this.el.selectize.defaults.points;for(var k in this.el.selectize.defaults)this.options[k]=this.el.selectize.defaults[k],h[k]!==void 0&&(this.options[k]=h[k]);var T=["points","pointsExclude"];for(var k in T){var B=this.options[T[k]];typeof B=="string"?B=B.length>0?B.split(/\s*,\s*/i):[]:typeof B=="boolean"&&T[k]==="points"&&(B=B?_:[]),this.options[T[k]]=B}this.options.points=[_,this.options.points].reduce(function(W,ee){return W.filter(function(de){return ee.indexOf(de)>-1})}),this.options.points=[this.options.points,this.options.pointsExclude].reduce(function(W,ee){return W.filter(function(de){return ee.indexOf(de)<0})}),this.parent=this.el.parent(),this.nested=this.nested||this.parent.group(),this.nested.matrix(new SVG.Matrix(this.el).translate(S.x,S.y)),this.options.deepSelect&&["line","polyline","polygon"].indexOf(this.el.type)!==-1?this.selectPoints(p):this.selectRect(p),this.observe(),this.cleanup()},Ee.prototype.selectPoints=function(p){return this.pointSelection.isSelected=p,this.pointSelection.set||(this.pointSelection.set=this.parent.set(),this.drawPoints()),this},Ee.prototype.getPointArray=function(){var p=this.el.bbox();return this.el.array().valueOf().map(function(h){return[h[0]-p.x,h[1]-p.y]})},Ee.prototype.drawPoints=function(){for(var p=this,h=this.getPointArray(),S=0,_=h.length;S<_;++S){var k=function(B){return function(W){(W=W||window.event).preventDefault?W.preventDefault():W.returnValue=!1,W.stopPropagation();var ee=W.pageX||W.touches[0].pageX,de=W.pageY||W.touches[0].pageY;p.el.fire("point",{x:ee,y:de,i:B,event:W})}}(S),T=this.drawPoint(h[S][0],h[S][1]).addClass(this.options.classPoints).addClass(this.options.classPoints+"_point").on("touchstart",k).on("mousedown",k);this.pointSelection.set.add(T)}},Ee.prototype.drawPoint=function(p,h){var S=this.options.pointType;switch(S){case"circle":return this.drawCircle(p,h);case"rect":return this.drawRect(p,h);default:if(typeof S=="function")return S.call(this,p,h);throw new Error("Unknown "+S+" point type!")}},Ee.prototype.drawCircle=function(p,h){return this.nested.circle(this.options.pointSize).center(p,h)},Ee.prototype.drawRect=function(p,h){return this.nested.rect(this.options.pointSize,this.options.pointSize).center(p,h)},Ee.prototype.updatePointSelection=function(){var p=this.getPointArray();this.pointSelection.set.each(function(h){this.cx()===p[h][0]&&this.cy()===p[h][1]||this.center(p[h][0],p[h][1])})},Ee.prototype.updateRectSelection=function(){var p=this,h=this.el.bbox();if(this.rectSelection.set.get(0).attr({width:h.width,height:h.height}),this.options.points.length&&this.options.points.map(function(_,k){var T=p.pointCoords(_,h);p.rectSelection.set.get(k+1).center(T.x,T.y)}),this.options.rotationPoint){var S=this.rectSelection.set.length();this.rectSelection.set.get(S-1).center(h.width/2,20)}},Ee.prototype.selectRect=function(p){var h=this,S=this.el.bbox();function _(B){return function(W){(W=W||window.event).preventDefault?W.preventDefault():W.returnValue=!1,W.stopPropagation();var ee=W.pageX||W.touches[0].pageX,de=W.pageY||W.touches[0].pageY;h.el.fire(B,{x:ee,y:de,event:W})}}if(this.rectSelection.isSelected=p,this.rectSelection.set=this.rectSelection.set||this.parent.set(),this.rectSelection.set.get(0)||this.rectSelection.set.add(this.nested.rect(S.width,S.height).addClass(this.options.classRect)),this.options.points.length&&this.rectSelection.set.length()<2&&(this.options.points.map(function(B,W){var ee=h.pointCoords(B,S),de=h.drawPoint(ee.x,ee.y).attr("class",h.options.classPoints+"_"+B).on("mousedown",_(B)).on("touchstart",_(B));h.rectSelection.set.add(de)}),this.rectSelection.set.each(function(){this.addClass(h.options.classPoints)})),this.options.rotationPoint&&(this.options.points&&!this.rectSelection.set.get(9)||!this.options.points&&!this.rectSelection.set.get(1))){var k=function(B){(B=B||window.event).preventDefault?B.preventDefault():B.returnValue=!1,B.stopPropagation();var W=B.pageX||B.touches[0].pageX,ee=B.pageY||B.touches[0].pageY;h.el.fire("rot",{x:W,y:ee,event:B})},T=this.drawPoint(S.width/2,20).attr("class",this.options.classPoints+"_rot").on("touchstart",k).on("mousedown",k);this.rectSelection.set.add(T)}},Ee.prototype.handler=function(){var p=this.el.bbox();this.nested.matrix(new SVG.Matrix(this.el).translate(p.x,p.y)),this.rectSelection.isSelected&&this.updateRectSelection(),this.pointSelection.isSelected&&this.updatePointSelection()},Ee.prototype.observe=function(){var p=this;if(MutationObserver)if(this.rectSelection.isSelected||this.pointSelection.isSelected)this.observerInst=this.observerInst||new MutationObserver(function(){p.handler()}),this.observerInst.observe(this.el.node,{attributes:!0});else try{this.observerInst.disconnect(),delete this.observerInst}catch{}else this.el.off("DOMAttrModified.select"),(this.rectSelection.isSelected||this.pointSelection.isSelected)&&this.el.on("DOMAttrModified.select",function(){p.handler()})},Ee.prototype.cleanup=function(){!this.rectSelection.isSelected&&this.rectSelection.set&&(this.rectSelection.set.each(function(){this.remove()}),this.rectSelection.set.clear(),delete this.rectSelection.set),!this.pointSelection.isSelected&&this.pointSelection.set&&(this.pointSelection.set.each(function(){this.remove()}),this.pointSelection.set.clear(),delete this.pointSelection.set),this.pointSelection.isSelected||this.rectSelection.isSelected||(this.nested.remove(),delete this.nested)},SVG.extend(SVG.Element,{selectize:function(p,h){return typeof p=="object"&&(h=p,p=!0),(this.remember("_selectHandler")||new Ee(this)).init(p===void 0||p,h||{}),this}}),SVG.Element.prototype.selectize.defaults={points:["lt","rt","rb","lb","t","r","b","l"],pointsExclude:[],classRect:"svg_select_boundingRect",classPoints:"svg_select_points",pointSize:7,rotationPoint:!0,deepSelect:!1,pointType:"circle"}}(),function(){(function(){function Ee(p){p.remember("_resizeHandler",this),this.el=p,this.parameters={},this.lastUpdateCall=null,this.p=p.doc().node.createSVGPoint()}Ee.prototype.transformPoint=function(p,h,S){return this.p.x=p-(this.offset.x-window.pageXOffset),this.p.y=h-(this.offset.y-window.pageYOffset),this.p.matrixTransform(S||this.m)},Ee.prototype._extractPosition=function(p){return{x:p.clientX!=null?p.clientX:p.touches[0].clientX,y:p.clientY!=null?p.clientY:p.touches[0].clientY}},Ee.prototype.init=function(p){var h=this;if(this.stop(),p!=="stop"){for(var S in this.options={},this.el.resize.defaults)this.options[S]=this.el.resize.defaults[S],p[S]!==void 0&&(this.options[S]=p[S]);this.el.on("lt.resize",function(_){h.resize(_||window.event)}),this.el.on("rt.resize",function(_){h.resize(_||window.event)}),this.el.on("rb.resize",function(_){h.resize(_||window.event)}),this.el.on("lb.resize",function(_){h.resize(_||window.event)}),this.el.on("t.resize",function(_){h.resize(_||window.event)}),this.el.on("r.resize",function(_){h.resize(_||window.event)}),this.el.on("b.resize",function(_){h.resize(_||window.event)}),this.el.on("l.resize",function(_){h.resize(_||window.event)}),this.el.on("rot.resize",function(_){h.resize(_||window.event)}),this.el.on("point.resize",function(_){h.resize(_||window.event)}),this.update()}},Ee.prototype.stop=function(){return this.el.off("lt.resize"),this.el.off("rt.resize"),this.el.off("rb.resize"),this.el.off("lb.resize"),this.el.off("t.resize"),this.el.off("r.resize"),this.el.off("b.resize"),this.el.off("l.resize"),this.el.off("rot.resize"),this.el.off("point.resize"),this},Ee.prototype.resize=function(p){var h=this;this.m=this.el.node.getScreenCTM().inverse(),this.offset={x:window.pageXOffset,y:window.pageYOffset};var S=this._extractPosition(p.detail.event);if(this.parameters={type:this.el.type,p:this.transformPoint(S.x,S.y),x:p.detail.x,y:p.detail.y,box:this.el.bbox(),rotation:this.el.transform().rotation},this.el.type==="text"&&(this.parameters.fontSize=this.el.attr()["font-size"]),p.detail.i!==void 0){var _=this.el.array().valueOf();this.parameters.i=p.detail.i,this.parameters.pointCoords=[_[p.detail.i][0],_[p.detail.i][1]]}switch(p.type){case"lt":this.calc=function(k,T){var B=this.snapToGrid(k,T);if(this.parameters.box.width-B[0]>0&&this.parameters.box.height-B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x+B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-B[0]);B=this.checkAspectRatio(B),this.el.move(this.parameters.box.x+B[0],this.parameters.box.y+B[1]).size(this.parameters.box.width-B[0],this.parameters.box.height-B[1])}};break;case"rt":this.calc=function(k,T){var B=this.snapToGrid(k,T,2);if(this.parameters.box.width+B[0]>0&&this.parameters.box.height-B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x-B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+B[0]);B=this.checkAspectRatio(B,!0),this.el.move(this.parameters.box.x,this.parameters.box.y+B[1]).size(this.parameters.box.width+B[0],this.parameters.box.height-B[1])}};break;case"rb":this.calc=function(k,T){var B=this.snapToGrid(k,T,0);if(this.parameters.box.width+B[0]>0&&this.parameters.box.height+B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x-B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+B[0]);B=this.checkAspectRatio(B),this.el.move(this.parameters.box.x,this.parameters.box.y).size(this.parameters.box.width+B[0],this.parameters.box.height+B[1])}};break;case"lb":this.calc=function(k,T){var B=this.snapToGrid(k,T,1);if(this.parameters.box.width-B[0]>0&&this.parameters.box.height+B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x+B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-B[0]);B=this.checkAspectRatio(B,!0),this.el.move(this.parameters.box.x+B[0],this.parameters.box.y).size(this.parameters.box.width-B[0],this.parameters.box.height+B[1])}};break;case"t":this.calc=function(k,T){var B=this.snapToGrid(k,T,2);if(this.parameters.box.height-B[1]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x,this.parameters.box.y+B[1]).height(this.parameters.box.height-B[1])}};break;case"r":this.calc=function(k,T){var B=this.snapToGrid(k,T,0);if(this.parameters.box.width+B[0]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x,this.parameters.box.y).width(this.parameters.box.width+B[0])}};break;case"b":this.calc=function(k,T){var B=this.snapToGrid(k,T,0);if(this.parameters.box.height+B[1]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x,this.parameters.box.y).height(this.parameters.box.height+B[1])}};break;case"l":this.calc=function(k,T){var B=this.snapToGrid(k,T,1);if(this.parameters.box.width-B[0]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x+B[0],this.parameters.box.y).width(this.parameters.box.width-B[0])}};break;case"rot":this.calc=function(k,T){var B=k+this.parameters.p.x,W=T+this.parameters.p.y,ee=Math.atan2(this.parameters.p.y-this.parameters.box.y-this.parameters.box.height/2,this.parameters.p.x-this.parameters.box.x-this.parameters.box.width/2),de=Math.atan2(W-this.parameters.box.y-this.parameters.box.height/2,B-this.parameters.box.x-this.parameters.box.width/2),fe=this.parameters.rotation+180*(de-ee)/Math.PI+this.options.snapToAngle/2;this.el.center(this.parameters.box.cx,this.parameters.box.cy).rotate(fe-fe%this.options.snapToAngle,this.parameters.box.cx,this.parameters.box.cy)};break;case"point":this.calc=function(k,T){var B=this.snapToGrid(k,T,this.parameters.pointCoords[0],this.parameters.pointCoords[1]),W=this.el.array().valueOf();W[this.parameters.i][0]=this.parameters.pointCoords[0]+B[0],W[this.parameters.i][1]=this.parameters.pointCoords[1]+B[1],this.el.plot(W)}}this.el.fire("resizestart",{dx:this.parameters.x,dy:this.parameters.y,event:p}),SVG.on(window,"touchmove.resize",function(k){h.update(k||window.event)}),SVG.on(window,"touchend.resize",function(){h.done()}),SVG.on(window,"mousemove.resize",function(k){h.update(k||window.event)}),SVG.on(window,"mouseup.resize",function(){h.done()})},Ee.prototype.update=function(p){if(p){var h=this._extractPosition(p),S=this.transformPoint(h.x,h.y),_=S.x-this.parameters.p.x,k=S.y-this.parameters.p.y;this.lastUpdateCall=[_,k],this.calc(_,k),this.el.fire("resizing",{dx:_,dy:k,event:p})}else this.lastUpdateCall&&this.calc(this.lastUpdateCall[0],this.lastUpdateCall[1])},Ee.prototype.done=function(){this.lastUpdateCall=null,SVG.off(window,"mousemove.resize"),SVG.off(window,"mouseup.resize"),SVG.off(window,"touchmove.resize"),SVG.off(window,"touchend.resize"),this.el.fire("resizedone")},Ee.prototype.snapToGrid=function(p,h,S,_){var k;return _!==void 0?k=[(S+p)%this.options.snapToGrid,(_+h)%this.options.snapToGrid]:(S=S??3,k=[(this.parameters.box.x+p+(1&S?0:this.parameters.box.width))%this.options.snapToGrid,(this.parameters.box.y+h+(2&S?0:this.parameters.box.height))%this.options.snapToGrid]),p<0&&(k[0]-=this.options.snapToGrid),h<0&&(k[1]-=this.options.snapToGrid),p-=Math.abs(k[0])<this.options.snapToGrid/2?k[0]:k[0]-(p<0?-this.options.snapToGrid:this.options.snapToGrid),h-=Math.abs(k[1])<this.options.snapToGrid/2?k[1]:k[1]-(h<0?-this.options.snapToGrid:this.options.snapToGrid),this.constraintToBox(p,h,S,_)},Ee.prototype.constraintToBox=function(p,h,S,_){var k,T,B=this.options.constraint||{};return _!==void 0?(k=S,T=_):(k=this.parameters.box.x+(1&S?0:this.parameters.box.width),T=this.parameters.box.y+(2&S?0:this.parameters.box.height)),B.minX!==void 0&&k+p<B.minX&&(p=B.minX-k),B.maxX!==void 0&&k+p>B.maxX&&(p=B.maxX-k),B.minY!==void 0&&T+h<B.minY&&(h=B.minY-T),B.maxY!==void 0&&T+h>B.maxY&&(h=B.maxY-T),[p,h]},Ee.prototype.checkAspectRatio=function(p,h){if(!this.options.saveAspectRatio)return p;var S=p.slice(),_=this.parameters.box.width/this.parameters.box.height,k=this.parameters.box.width+p[0],T=this.parameters.box.height-p[1],B=k/T;return B<_?(S[1]=k/_-this.parameters.box.height,h&&(S[1]=-S[1])):B>_&&(S[0]=this.parameters.box.width-T*_,h&&(S[0]=-S[0])),S},SVG.extend(SVG.Element,{resize:function(p){return(this.remember("_resizeHandler")||new Ee(this)).init(p||{}),this}}),SVG.Element.prototype.resize.defaults={snapToAngle:.1,snapToGrid:1,constraint:{},saveAspectRatio:!1}}).call(this)}(),window.Apex===void 0&&(window.Apex={});var Un=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"initModules",value:function(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend"],this.ctx.animations=new U(this.ctx),this.ctx.axes=new an(this.ctx),this.ctx.core=new rr(this.ctx.el,this.ctx),this.ctx.config=new Ce({}),this.ctx.data=new Qe(this.ctx),this.ctx.grid=new tt(this.ctx),this.ctx.graphics=new z(this.ctx),this.ctx.coreUtils=new Q(this.ctx),this.ctx.crosshairs=new Nt(this.ctx),this.ctx.events=new Vt(this.ctx),this.ctx.exports=new $e(this.ctx),this.ctx.fill=new Ae(this.ctx),this.ctx.localization=new It(this.ctx),this.ctx.options=new G,this.ctx.responsive=new mn(this.ctx),this.ctx.series=new Re(this.ctx),this.ctx.theme=new dn(this.ctx),this.ctx.formatters=new re(this.ctx),this.ctx.titleSubtitle=new Pt(this.ctx),this.ctx.legend=new en(this.ctx),this.ctx.toolbar=new Bt(this.ctx),this.ctx.tooltip=new jt(this.ctx),this.ctx.dimensions=new Ke(this.ctx),this.ctx.updateHelpers=new Jt(this.ctx),this.ctx.zoomPanSelection=new Et(this.ctx),this.ctx.w.globals.tooltip=new jt(this.ctx)}}]),Ee}(),Qn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"clear",value:function(p){var h=p.isUpdating;this.ctx.zoomPanSelection&&this.ctx.zoomPanSelection.destroy(),this.ctx.toolbar&&this.ctx.toolbar.destroy(),this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx.zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx.toolbar=null,this.ctx.localization=null,this.ctx.w.globals.tooltip=null,this.clearDomElements({isUpdating:h})}},{key:"killSVG",value:function(p){p.each(function(){this.removeClass("*"),this.off(),this.stop()},!0),p.ungroup(),p.clear()}},{key:"clearDomElements",value:function(p){var h=this,S=p.isUpdating,_=this.w.globals.dom.Paper.node;_.parentNode&&_.parentNode.parentNode&&!S&&(_.parentNode.parentNode.style.minHeight="unset");var k=this.w.globals.dom.baseEl;k&&this.ctx.eventList.forEach(function(B){k.removeEventListener(B,h.ctx.events.documentEvent)});var T=this.w.globals.dom;if(this.ctx.el!==null)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(T.Paper),T.Paper.remove(),T.elWrap=null,T.elGraphical=null,T.elLegendWrap=null,T.elLegendForeign=null,T.baseEl=null,T.elGridRect=null,T.elGridRectMask=null,T.elGridRectBarMask=null,T.elGridRectMarkerMask=null,T.elForecastMask=null,T.elNonForecastMask=null,T.elDefs=null}}]),Ee}(),Rt=new WeakMap,Pn=function(){function Ee(p,h){s(this,Ee),this.opts=h,this.ctx=this,this.w=new ge(h).init(),this.el=p,this.w.globals.cuid=F.randomId(),this.w.globals.chartID=this.w.config.chart.id?F.escapeString(this.w.config.chart.id):this.w.globals.cuid,new Un(this).initModules(),this.create=F.bind(this.create,this),this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this)}return o(Ee,[{key:"render",value:function(){var p=this;return new Promise(function(h,S){if(p.el!==null){Apex._chartInstances===void 0&&(Apex._chartInstances=[]),p.w.config.chart.id&&Apex._chartInstances.push({id:p.w.globals.chartID,group:p.w.config.chart.group,chart:p}),p.setLocale(p.w.config.chart.defaultLocale);var _=p.w.config.chart.events.beforeMount;typeof _=="function"&&_(p,p.w),p.events.fireEvent("beforeMount",[p,p.w]),window.addEventListener("resize",p.windowResizeHandler),function(xe,we){var ke=!1;if(xe.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var Me=xe.getBoundingClientRect();xe.style.display!=="none"&&Me.width!==0||(ke=!0)}var Ye=new ResizeObserver(function(Fe){ke&&we.call(xe,Fe),ke=!0});xe.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(xe.children).forEach(function(Fe){return Ye.observe(Fe)}):Ye.observe(xe),Rt.set(we,Ye)}(p.el.parentNode,p.parentResizeHandler);var k=p.el.getRootNode&&p.el.getRootNode(),T=F.is("ShadowRoot",k),B=p.el.ownerDocument,W=T?k.getElementById("apexcharts-css"):B.getElementById("apexcharts-css");if(!W){var ee;(W=document.createElement("style")).id="apexcharts-css",W.textContent=`@keyframes opaque {
0% {
opacity: 0
}
to {
opacity: 1
}
}
@keyframes resizeanim {
0%,
to {
opacity: 0
}
}
.apexcharts-canvas {
position: relative;
direction: ltr !important;
user-select: none
}
.apexcharts-canvas ::-webkit-scrollbar {
-webkit-appearance: none;
width: 6px
}
.apexcharts-canvas ::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0, 0, 0, .5);
box-shadow: 0 0 1px rgba(255, 255, 255, .5);
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)
}
.apexcharts-inner {
position: relative
}
.apexcharts-text tspan {
font-family: inherit
}
rect.legend-mouseover-inactive,
.legend-mouseover-inactive rect,
.legend-mouseover-inactive path,
.legend-mouseover-inactive circle,
.legend-mouseover-inactive line,
.legend-mouseover-inactive text.apexcharts-yaxis-title-text,
.legend-mouseover-inactive text.apexcharts-yaxis-label {
transition: .15s ease all;
opacity: .2
}
.apexcharts-legend-text {
padding-left: 15px;
margin-left: -15px;
}
.apexcharts-series-collapsed {
opacity: 0
}
.apexcharts-tooltip {
border-radius: 5px;
box-shadow: 2px 2px 6px -4px #999;
cursor: default;
font-size: 14px;
left: 62px;
opacity: 0;
pointer-events: none;
position: absolute;
top: 20px;
display: flex;
flex-direction: column;
overflow: hidden;
white-space: nowrap;
z-index: 12;
transition: .15s ease all
}
.apexcharts-tooltip.apexcharts-active {
opacity: 1;
transition: .15s ease all
}
.apexcharts-tooltip.apexcharts-theme-light {
border: 1px solid #e3e3e3;
background: rgba(255, 255, 255, .96)
}
.apexcharts-tooltip.apexcharts-theme-dark {
color: #fff;
background: rgba(30, 30, 30, .8)
}
.apexcharts-tooltip * {
font-family: inherit
}
.apexcharts-tooltip-title {
padding: 6px;
font-size: 15px;
margin-bottom: 4px
}
.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {
background: #eceff1;
border-bottom: 1px solid #ddd
}
.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {
background: rgba(0, 0, 0, .7);
border-bottom: 1px solid #333
}
.apexcharts-tooltip-text-goals-value,
.apexcharts-tooltip-text-y-value,
.apexcharts-tooltip-text-z-value {
display: inline-block;
margin-left: 5px;
font-weight: 600
}
.apexcharts-tooltip-text-goals-label:empty,
.apexcharts-tooltip-text-goals-value:empty,
.apexcharts-tooltip-text-y-label:empty,
.apexcharts-tooltip-text-y-value:empty,
.apexcharts-tooltip-text-z-value:empty,
.apexcharts-tooltip-title:empty {
display: none
}
.apexcharts-tooltip-text-goals-label,
.apexcharts-tooltip-text-goals-value {
padding: 6px 0 5px
}
.apexcharts-tooltip-goals-group,
.apexcharts-tooltip-text-goals-label,
.apexcharts-tooltip-text-goals-value {
display: flex
}
.apexcharts-tooltip-text-goals-label:not(:empty),
.apexcharts-tooltip-text-goals-value:not(:empty) {
margin-top: -6px
}
.apexcharts-tooltip-marker {
width: 12px;
height: 12px;
position: relative;
top: 0;
margin-right: 10px;
border-radius: 50%
}
.apexcharts-tooltip-series-group {
padding: 0 10px;
display: none;
text-align: left;
justify-content: left;
align-items: center
}
.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {
opacity: 1
}
.apexcharts-tooltip-series-group.apexcharts-active,
.apexcharts-tooltip-series-group:last-child {
padding-bottom: 4px
}
.apexcharts-tooltip-y-group {
padding: 6px 0 5px
}
.apexcharts-custom-tooltip,
.apexcharts-tooltip-box {
padding: 4px 8px
}
.apexcharts-tooltip-boxPlot {
display: flex;
flex-direction: column-reverse
}
.apexcharts-tooltip-box>div {
margin: 4px 0
}
.apexcharts-tooltip-box span.value {
font-weight: 700
}
.apexcharts-tooltip-rangebar {
padding: 5px 8px
}
.apexcharts-tooltip-rangebar .category {
font-weight: 600;
color: #777
}
.apexcharts-tooltip-rangebar .series-name {
font-weight: 700;
display: block;
margin-bottom: 5px
}
.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
opacity: 0;
pointer-events: none;
color: #373d3f;
font-size: 13px;
text-align: center;
border-radius: 2px;
position: absolute;
z-index: 10;
background: #eceff1;
border: 1px solid #90a4ae
}
.apexcharts-xaxistooltip {
padding: 9px 10px;
transition: .15s ease all
}
.apexcharts-xaxistooltip.apexcharts-theme-dark {
background: rgba(0, 0, 0, .7);
border: 1px solid rgba(0, 0, 0, .5);
color: #fff
}
.apexcharts-xaxistooltip:after,
.apexcharts-xaxistooltip:before {
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none
}
.apexcharts-xaxistooltip:after {
border-color: transparent;
border-width: 6px;
margin-left: -6px
}
.apexcharts-xaxistooltip:before {
border-color: transparent;
border-width: 7px;
margin-left: -7px
}
.apexcharts-xaxistooltip-bottom:after,
.apexcharts-xaxistooltip-bottom:before {
bottom: 100%
}
.apexcharts-xaxistooltip-top:after,
.apexcharts-xaxistooltip-top:before {
top: 100%
}
.apexcharts-xaxistooltip-bottom:after {
border-bottom-color: #eceff1
}
.apexcharts-xaxistooltip-bottom:before {
border-bottom-color: #90a4ae
}
.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after,
.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {
border-bottom-color: rgba(0, 0, 0, .5)
}
.apexcharts-xaxistooltip-top:after {
border-top-color: #eceff1
}
.apexcharts-xaxistooltip-top:before {
border-top-color: #90a4ae
}
.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after,
.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {
border-top-color: rgba(0, 0, 0, .5)
}
.apexcharts-xaxistooltip.apexcharts-active {
opacity: 1;
transition: .15s ease all
}
.apexcharts-yaxistooltip {
padding: 4px 10px
}
.apexcharts-yaxistooltip.apexcharts-theme-dark {
background: rgba(0, 0, 0, .7);
border: 1px solid rgba(0, 0, 0, .5);
color: #fff
}
.apexcharts-yaxistooltip:after,
.apexcharts-yaxistooltip:before {
top: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none
}
.apexcharts-yaxistooltip:after {
border-color: transparent;
border-width: 6px;
margin-top: -6px
}
.apexcharts-yaxistooltip:before {
border-color: transparent;
border-width: 7px;
margin-top: -7px
}
.apexcharts-yaxistooltip-left:after,
.apexcharts-yaxistooltip-left:before {
left: 100%
}
.apexcharts-yaxistooltip-right:after,
.apexcharts-yaxistooltip-right:before {
right: 100%
}
.apexcharts-yaxistooltip-left:after {
border-left-color: #eceff1
}
.apexcharts-yaxistooltip-left:before {
border-left-color: #90a4ae
}
.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after,
.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {
border-left-color: rgba(0, 0, 0, .5)
}
.apexcharts-yaxistooltip-right:after {
border-right-color: #eceff1
}
.apexcharts-yaxistooltip-right:before {
border-right-color: #90a4ae
}
.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after,
.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {
border-right-color: rgba(0, 0, 0, .5)
}
.apexcharts-yaxistooltip.apexcharts-active {
opacity: 1
}
.apexcharts-yaxistooltip-hidden {
display: none
}
.apexcharts-xcrosshairs,
.apexcharts-ycrosshairs {
pointer-events: none;
opacity: 0;
transition: .15s ease all
}
.apexcharts-xcrosshairs.apexcharts-active,
.apexcharts-ycrosshairs.apexcharts-active {
opacity: 1;
transition: .15s ease all
}
.apexcharts-ycrosshairs-hidden {
opacity: 0
}
.apexcharts-selection-rect {
cursor: move
}
.svg_select_boundingRect,
.svg_select_points_rot {
pointer-events: none;
opacity: 0;
visibility: hidden
}
.apexcharts-selection-rect+g .svg_select_boundingRect,
.apexcharts-selection-rect+g .svg_select_points_rot {
opacity: 0;
visibility: hidden
}
.apexcharts-selection-rect+g .svg_select_points_l,
.apexcharts-selection-rect+g .svg_select_points_r {
cursor: ew-resize;
opacity: 1;
visibility: visible
}
.svg_select_points {
fill: #efefef;
stroke: #333;
rx: 2
}
.apexcharts-svg.apexcharts-zoomable.hovering-zoom {
cursor: crosshair
}
.apexcharts-svg.apexcharts-zoomable.hovering-pan {
cursor: move
}
.apexcharts-menu-icon,
.apexcharts-pan-icon,
.apexcharts-reset-icon,
.apexcharts-selection-icon,
.apexcharts-toolbar-custom-icon,
.apexcharts-zoom-icon,
.apexcharts-zoomin-icon,
.apexcharts-zoomout-icon {
cursor: pointer;
width: 20px;
height: 20px;
line-height: 24px;
color: #6e8192;
text-align: center
}
.apexcharts-menu-icon svg,
.apexcharts-reset-icon svg,
.apexcharts-zoom-icon svg,
.apexcharts-zoomin-icon svg,
.apexcharts-zoomout-icon svg {
fill: #6e8192
}
.apexcharts-selection-icon svg {
fill: #444;
transform: scale(.76)
}
.apexcharts-theme-dark .apexcharts-menu-icon svg,
.apexcharts-theme-dark .apexcharts-pan-icon svg,
.apexcharts-theme-dark .apexcharts-reset-icon svg,
.apexcharts-theme-dark .apexcharts-selection-icon svg,
.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg,
.apexcharts-theme-dark .apexcharts-zoom-icon svg,
.apexcharts-theme-dark .apexcharts-zoomin-icon svg,
.apexcharts-theme-dark .apexcharts-zoomout-icon svg {
fill: #f3f4f5
}
.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg,
.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,
.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {
fill: #008ffb
}
.apexcharts-theme-light .apexcharts-menu-icon:hover svg,
.apexcharts-theme-light .apexcharts-reset-icon:hover svg,
.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,
.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,
.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,
.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg {
fill: #333
}
.apexcharts-menu-icon,
.apexcharts-selection-icon {
position: relative
}
.apexcharts-reset-icon {
margin-left: 5px
}
.apexcharts-menu-icon,
.apexcharts-reset-icon,
.apexcharts-zoom-icon {
transform: scale(.85)
}
.apexcharts-zoomin-icon,
.apexcharts-zoomout-icon {
transform: scale(.7)
}
.apexcharts-zoomout-icon {
margin-right: 3px
}
.apexcharts-pan-icon {
transform: scale(.62);
position: relative;
left: 1px;
top: 0
}
.apexcharts-pan-icon svg {
fill: #fff;
stroke: #6e8192;
stroke-width: 2
}
.apexcharts-pan-icon.apexcharts-selected svg {
stroke: #008ffb
}
.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {
stroke: #333
}
.apexcharts-toolbar {
position: absolute;
z-index: 11;
max-width: 176px;
text-align: right;
border-radius: 3px;
padding: 0 6px 2px;
display: flex;
justify-content: space-between;
align-items: center
}
.apexcharts-menu {
background: #fff;
position: absolute;
top: 100%;
border: 1px solid #ddd;
border-radius: 3px;
padding: 3px;
right: 10px;
opacity: 0;
min-width: 110px;
transition: .15s ease all;
pointer-events: none
}
.apexcharts-menu.apexcharts-menu-open {
opacity: 1;
pointer-events: all;
transition: .15s ease all
}
.apexcharts-menu-item {
padding: 6px 7px;
font-size: 12px;
cursor: pointer
}
.apexcharts-theme-light .apexcharts-menu-item:hover {
background: #eee
}
.apexcharts-theme-dark .apexcharts-menu {
background: rgba(0, 0, 0, .7);
color: #fff
}
@media screen and (min-width:768px) {
.apexcharts-canvas:hover .apexcharts-toolbar {
opacity: 1
}
}
.apexcharts-canvas .apexcharts-element-hidden,
.apexcharts-datalabel.apexcharts-element-hidden,
.apexcharts-hide .apexcharts-series-points {
opacity: 0;
}
.apexcharts-hidden-element-shown {
opacity: 1;
transition: 0.25s ease all;
}
.apexcharts-datalabel,
.apexcharts-datalabel-label,
.apexcharts-datalabel-value,
.apexcharts-datalabels,
.apexcharts-pie-label {
cursor: default;
pointer-events: none
}
.apexcharts-pie-label-delay {
opacity: 0;
animation-name: opaque;
animation-duration: .3s;
animation-fill-mode: forwards;
animation-timing-function: ease
}
.apexcharts-radialbar-label {
cursor: pointer;
}
.apexcharts-annotation-rect,
.apexcharts-area-series .apexcharts-area,
.apexcharts-area-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,
.apexcharts-gridline,
.apexcharts-line,
.apexcharts-line-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,
.apexcharts-point-annotation-label,
.apexcharts-radar-series path:not(.apexcharts-marker),
.apexcharts-radar-series polygon,
.apexcharts-toolbar svg,
.apexcharts-tooltip .apexcharts-marker,
.apexcharts-xaxis-annotation-label,
.apexcharts-yaxis-annotation-label,
.apexcharts-zoom-rect {
pointer-events: none
}
.apexcharts-tooltip-active .apexcharts-marker {
transition: .15s ease all
}
.resize-triggers {
animation: 1ms resizeanim;
visibility: hidden;
opacity: 0;
height: 100%;
width: 100%;
overflow: hidden
}
.contract-trigger:before,
.resize-triggers,
.resize-triggers>div {
content: " ";
display: block;
position: absolute;
top: 0;
left: 0
}
.resize-triggers>div {
height: 100%;
width: 100%;
background: #eee;
overflow: auto
}
.contract-trigger:before {
overflow: hidden;
width: 200%;
height: 200%
}
.apexcharts-bar-goals-markers {
pointer-events: none
}
.apexcharts-bar-shadows {
pointer-events: none
}
.apexcharts-rangebar-goals-markers {
pointer-events: none
}
`;var de=((ee=p.opts.chart)===null||ee===void 0?void 0:ee.nonce)||p.w.config.chart.nonce;de&&W.setAttribute("nonce",de),T?k.prepend(W):B.head.appendChild(W)}var fe=p.create(p.w.config.series,{});if(!fe)return h(p);p.mount(fe).then(function(){typeof p.w.config.chart.events.mounted=="function"&&p.w.config.chart.events.mounted(p,p.w),p.events.fireEvent("mounted",[p,p.w]),h(fe)}).catch(function(xe){S(xe)})}else S(new Error("Element not found"))})}},{key:"create",value:function(p,h){var S=this,_=this.w;new Un(this).initModules();var k=this.w.globals;if(k.noData=!1,k.animationEnded=!1,this.responsive.checkResponsiveConfig(h),_.config.xaxis.convertedCatToNumeric&&new he(_.config).convertCatToNumericXaxis(_.config,this.ctx),this.el===null||(this.core.setupElements(),_.config.chart.type==="treemap"&&(_.config.grid.show=!1,_.config.yaxis[0].show=!1),k.svgWidth===0))return k.animationEnded=!0,null;var T=p;p.forEach(function(xe,we){xe.hidden&&(T=S.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:we}))});var B=Q.checkComboSeries(T,_.config.chart.type);k.comboCharts=B.comboCharts,k.comboBarCount=B.comboBarCount;var W=T.every(function(xe){return xe.data&&xe.data.length===0});(T.length===0||W&&k.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(T),this.theme.init(),new ye(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),k.noData&&k.collapsedSeries.length!==k.series.length&&!_.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),k.axisCharts&&(this.core.coreCalculations(),_.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=_.globals.minX,this.ctx.toolbar.maxX=_.globals.maxX),this.formatters.heatmapLabelFormatters(),new Q(this).getLargestMarkerSize(),this.dimensions.plotCoords();var ee=this.core.xySettings();this.grid.createGridMask();var de=this.core.plotChartType(T,ee),fe=new Ie(this);return fe.bringForward(),_.config.dataLabels.background.enabled&&fe.dataLabelsBackground(),this.core.shiftGraphPosition(),{elGraph:de,xyRatios:ee,dimensions:{plot:{left:_.globals.translateX,top:_.globals.translateY,width:_.globals.gridWidth,height:_.globals.gridHeight}}}}},{key:"mount",value:function(){var p=this,h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,S=this,_=S.w;return new Promise(function(k,T){if(S.el===null)return T(new Error("Not enough data to display or target element not found"));(h===null||_.globals.allSeriesCollapsed)&&S.series.handleNoData(),S.grid=new tt(S);var B,W,ee=S.grid.drawGrid();if(S.annotations=new V(S),S.annotations.drawImageAnnos(),S.annotations.drawTextAnnos(),_.config.grid.position==="back"&&(ee&&_.globals.dom.elGraphical.add(ee.el),ee!=null&&(B=ee.elGridBorders)!==null&&B!==void 0&&B.node&&_.globals.dom.elGraphical.add(ee.elGridBorders)),Array.isArray(h.elGraph))for(var de=0;de<h.elGraph.length;de++)_.globals.dom.elGraphical.add(h.elGraph[de]);else _.globals.dom.elGraphical.add(h.elGraph);_.config.grid.position==="front"&&(ee&&_.globals.dom.elGraphical.add(ee.el),ee!=null&&(W=ee.elGridBorders)!==null&&W!==void 0&&W.node&&_.globals.dom.elGraphical.add(ee.elGridBorders)),_.config.xaxis.crosshairs.position==="front"&&S.crosshairs.drawXCrosshairs(),_.config.yaxis[0].crosshairs.position==="front"&&S.crosshairs.drawYCrosshairs(),_.config.chart.type!=="treemap"&&S.axes.drawAxis(_.config.chart.type,ee);var fe=new it(p.ctx,ee),xe=new ct(p.ctx,ee);if(ee!==null&&(fe.xAxisLabelCorrections(ee.xAxisTickWidth),xe.setYAxisTextAlignments(),_.config.yaxis.map(function(ke,Me){_.globals.ignoreYAxisIndexes.indexOf(Me)===-1&&xe.yAxisTitleRotate(Me,ke.opposite)})),S.annotations.drawAxesAnnotations(),!_.globals.noData){if(_.config.tooltip.enabled&&!_.globals.noData&&S.w.globals.tooltip.drawTooltip(h.xyRatios),_.globals.axisCharts&&(_.globals.isXNumeric||_.config.xaxis.convertedCatToNumeric||_.globals.isRangeBar))(_.config.chart.zoom.enabled||_.config.chart.selection&&_.config.chart.selection.enabled||_.config.chart.pan&&_.config.chart.pan.enabled)&&S.zoomPanSelection.init({xyRatios:h.xyRatios});else{var we=_.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(function(ke){we[ke]=!1})}_.config.chart.toolbar.show&&!_.globals.allSeriesCollapsed&&S.toolbar.createToolbar()}_.globals.memory.methodsToExec.length>0&&_.globals.memory.methodsToExec.forEach(function(ke){ke.method(ke.params,!1,ke.context)}),_.globals.axisCharts||_.globals.noData||S.core.resizeNonAxisCharts(),k(S)})}},{key:"destroy",value:function(){var p,h;window.removeEventListener("resize",this.windowResizeHandler),this.el.parentNode,p=this.parentResizeHandler,(h=Rt.get(p))&&(h.disconnect(),Rt.delete(p));var S=this.w.config.chart.id;S&&Apex._chartInstances.forEach(function(_,k){_.id===F.escapeString(S)&&Apex._chartInstances.splice(k,1)}),new Qn(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(p){var h=this,S=arguments.length>1&&arguments[1]!==void 0&&arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],k=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],T=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],B=this.w;return B.globals.selection=void 0,p.series&&(this.series.resetSeries(!1,!0,!1),p.series.length&&p.series[0].data&&(p.series=p.series.map(function(W,ee){return h.updateHelpers._extendSeries(W,ee)})),this.updateHelpers.revertDefaultAxisMinMax()),p.xaxis&&(p=this.updateHelpers.forceXAxisUpdate(p)),p.yaxis&&(p=this.updateHelpers.forceYAxisUpdate(p)),B.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),p.theme&&(p=this.theme.updateThemeOptions(p)),this.updateHelpers._updateOptions(p,S,_,k,T)}},{key:"updateSeries",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(p,h,S)}},{key:"appendSeries",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=this.w.config.series.slice();return _.push(p),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(_,h,S)}},{key:"appendData",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=this;S.w.globals.dataChanged=!0,S.series.getPreviousPaths();for(var _=S.w.config.series.slice(),k=0;k<_.length;k++)if(p[k]!==null&&p[k]!==void 0)for(var T=0;T<p[k].data.length;T++)_[k].data.push(p[k].data[T]);return S.w.config.series=_,h&&(S.w.globals.initialSeries=F.clone(S.w.config.series)),this.update()}},{key:"update",value:function(p){var h=this;return new Promise(function(S,_){new Qn(h.ctx).clear({isUpdating:!0});var k=h.create(h.w.config.series,p);if(!k)return S(h);h.mount(k).then(function(){typeof h.w.config.chart.events.updated=="function"&&h.w.config.chart.events.updated(h,h.w),h.events.fireEvent("updated",[h,h.w]),h.w.globals.isDirty=!0,S(h)}).catch(function(T){_(T)})})}},{key:"getSyncedCharts",value:function(){var p=this.getGroupedCharts(),h=[this];return p.length&&(h=[],p.forEach(function(S){h.push(S)})),h}},{key:"getGroupedCharts",value:function(){var p=this;return Apex._chartInstances.filter(function(h){if(h.group)return!0}).map(function(h){return p.w.config.chart.group===h.group?h.chart:p})}},{key:"toggleSeries",value:function(p){return this.series.toggleSeries(p)}},{key:"highlightSeriesOnLegendHover",value:function(p,h){return this.series.toggleSeriesOnHover(p,h)}},{key:"showSeries",value:function(p){this.series.showSeries(p)}},{key:"hideSeries",value:function(p){this.series.hideSeries(p)}},{key:"highlightSeries",value:function(p){this.series.highlightSeries(p)}},{key:"isSeriesHidden",value:function(p){this.series.isSeriesHidden(p)}},{key:"resetSeries",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(p,h)}},{key:"addEventListener",value:function(p,h){this.events.addEventListener(p,h)}},{key:"removeEventListener",value:function(p,h){this.events.removeEventListener(p,h)}},{key:"addXaxisAnnotation",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,_=this;S&&(_=S),_.annotations.addXaxisAnnotationExternal(p,h,_)}},{key:"addYaxisAnnotation",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,_=this;S&&(_=S),_.annotations.addYaxisAnnotationExternal(p,h,_)}},{key:"addPointAnnotation",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,_=this;S&&(_=S),_.annotations.addPointAnnotationExternal(p,h,_)}},{key:"clearAnnotations",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,h=this;p&&(h=p),h.annotations.clearAnnotations(h)}},{key:"removeAnnotation",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,S=this;h&&(S=h),S.annotations.removeAnnotation(S,p)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(p,h){return this.coreUtils.getSeriesTotalsXRange(p,h)}},{key:"getHighestValueInSeries",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new ft(this.ctx).getMinYMaxY(p).highestY}},{key:"getLowestValueInSeries",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new ft(this.ctx).getMinYMaxY(p).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(p,h){return this.updateHelpers.toggleDataPointSelection(p,h)}},{key:"zoomX",value:function(p,h){this.ctx.toolbar.zoomUpdateOptions(p,h)}},{key:"setLocale",value:function(p){this.localization.setCurrentLocaleValues(p)}},{key:"dataURI",value:function(p){return new $e(this.ctx).dataURI(p)}},{key:"exportToCSV",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new $e(this.ctx).exportToCSV(p)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var p=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){p.w.globals.resized=!0,p.w.globals.dataChanged=!1,p.ctx.update()},150)}},{key:"_windowResizeHandler",value:function(){var p=this.w.config.chart.redrawOnWindowResize;typeof p=="function"&&(p=p()),p&&this._windowResize()}}],[{key:"getChartByID",value:function(p){var h=F.escapeString(p);if(Apex._chartInstances){var S=Apex._chartInstances.filter(function(_){return _.id===h})[0];return S&&S.chart}}},{key:"initOnLoad",value:function(){for(var p=document.querySelectorAll("[data-apexcharts]"),h=0;h<p.length;h++)new Ee(p[h],JSON.parse(p[h].getAttribute("data-options"))).render()}},{key:"exec",value:function(p,h){var S=this.getChartByID(p);if(S){S.w.globals.isExecCalled=!0;var _=null;if(S.publicMethods.indexOf(h)!==-1){for(var k=arguments.length,T=new Array(k>2?k-2:0),B=2;B<k;B++)T[B-2]=arguments[B];_=S[h].apply(S,T)}return _}}},{key:"merge",value:function(p,h){return F.extend(p,h)}}]),Ee}();e.exports=Pn}(DP,DP.exports)),DP.exports}var uCe;function Gsn(){if(uCe)return LP;uCe=1,Object.defineProperty(LP,"__esModule",{value:!0});var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t=Object.assign||function(C){for(var N=1;N<arguments.length;N++){var I,P=arguments[N];for(I in P)Object.prototype.hasOwnProperty.call(P,I)&&(C[I]=P[I])}return C},n=function(){function C(N,I){for(var P=0;P<I.length;P++){var R=I[P];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(N,R.key,R)}}return function(N,I,P){return I&&C(N.prototype,I),P&&C(N,P),N}}(),r=qsn(),s=u(r),a=ax(),o=u(a),l=E$(),c=u(l);function u(C){return C&&C.__esModule?C:{default:C}}function d(C,N,I){return N in C?Object.defineProperty(C,N,{value:I,enumerable:!0,configurable:!0,writable:!0}):C[N]=I,C}function f(C,N){var I,P={};for(I in C)0<=N.indexOf(I)||Object.prototype.hasOwnProperty.call(C,I)&&(P[I]=C[I]);return P}function x(C,N){if(!(C instanceof N))throw new TypeError("Cannot call a class as a function")}function g(C,N){if(C)return!N||typeof N!="object"&&typeof N!="function"?C:N;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function v(C,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);C.prototype=Object.create(N&&N.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(C,N):C.__proto__=N)}window.ApexCharts=s.default;var w=function(){function C(N){x(this,C);var I=g(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N));return o.default.createRef?I.chartRef=o.default.createRef():I.setRef=function(P){return I.chartRef=P},I.chart=null,I}return v(C,a.Component),n(C,[{key:"render",value:function(){var N=f(this.props,[]);return o.default.createElement("div",t({ref:o.default.createRef?this.chartRef:this.setRef},N))}},{key:"componentDidMount",value:function(){var N=o.default.createRef?this.chartRef.current:this.chartRef;this.chart=new s.default(N,this.getConfig()),this.chart.render()}},{key:"getConfig",value:function(){var F=this.props,N=F.type,I=F.height,P=F.width,R=F.series,F=F.options;return this.extend(F,{chart:{type:N,height:I,width:P},series:R})}},{key:"isObject",value:function(N){return N&&(N===void 0?"undefined":e(N))==="object"&&!Array.isArray(N)&&N!=null}},{key:"extend",value:function(N,I){var P=this,R=(typeof Object.assign!="function"&&(Object.assign=function(F){if(F==null)throw new TypeError("Cannot convert undefined or null to object");for(var U=Object(F),L=1;L<arguments.length;L++){var z=arguments[L];if(z!=null)for(var Q in z)z.hasOwnProperty(Q)&&(U[Q]=z[Q])}return U}),Object.assign({},N));return this.isObject(N)&&this.isObject(I)&&Object.keys(I).forEach(function(F){P.isObject(I[F])&&F in N?R[F]=P.extend(N[F],I[F]):Object.assign(R,d({},F,I[F]))}),R}},{key:"componentDidUpdate",value:function(N){if(!this.chart)return null;var R=this.props,L=R.options,I=R.series,P=R.height,R=R.width,F=JSON.stringify(N.options),U=JSON.stringify(N.series),L=JSON.stringify(L),z=JSON.stringify(I);F===L&&U===z&&P===N.height&&R===N.width||(U!==z&&F===L&&P===N.height&&R===N.width?this.chart.updateSeries(I):this.chart.updateOptions(this.getConfig()))}},{key:"componentWillUnmount",value:function(){this.chart&&typeof this.chart.destroy=="function"&&this.chart.destroy()}}]),C}();return(LP.default=w).propTypes={type:c.default.string.isRequired,width:c.default.oneOfType([c.default.string,c.default.number]),height:c.default.oneOfType([c.default.string,c.default.number]),series:c.default.array.isRequired,options:c.default.object.isRequired},w.defaultProps={type:"line",width:"100%",height:"auto"},LP}var Ksn=Gsn();const HL=ki(Ksn),Ysn=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(localStorage.getItem("discover_period")==0?"day":localStorage.getItem("discover_period")==1?"week":localStorage.getItem("discover_period")==2?"month":localStorage.getItem("discover_period")==3?"threeMonth":"allTime"),[s,a]=m.useState("pnlHistory"),[o,l]=m.useState("perp only"),c=e5(),u=(c==null?void 0:c.walletAddress)||"",d=n==="day",{setLatestPnL:f}=m.useContext(Qr);m.useEffect(()=>{const v=async()=>{var N,I,P,R,F,U,L,z,Q,ne,J,X,re,pe,Y,ie,oe,G,V,te,ae,he,Ce;const C=o==="combined"?n:`perp${n.charAt(0).toUpperCase()+n.slice(1)}`;try{const ge=(await ds.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:u},{headers:{Accept:"*/*","Content-Type":"application/json"}})).data,ye=Date.now()-90*24*60*60*1e3,je=(pt,en=!1)=>{const Bt=(pt==null?void 0:pt.filter(([Et])=>Number(Et)>=ye))||[];if(en&&Bt.length>0){const Et=parseFloat(Bt[0][1]);return Bt.map(([et,Be])=>[et,(parseFloat(Be)-Et).toString()])}return Bt},Ie=ge.find(pt=>pt[0]==="allTime"),Re=ge.find(pt=>pt[0]==="perpAllTime"),Qe={accountValueHistory:je((N=Ie==null?void 0:Ie[1])==null?void 0:N.accountValueHistory,!1),pnlHistory:je((I=Ie==null?void 0:Ie[1])==null?void 0:I.pnlHistory,!0),vlm:(P=Ie==null?void 0:Ie[1])==null?void 0:P.vlm},$e={accountValueHistory:je((R=Re==null?void 0:Re[1])==null?void 0:R.accountValueHistory,!1),pnlHistory:je((F=Re==null?void 0:Re[1])==null?void 0:F.pnlHistory,!0),vlm:(U=Re==null?void 0:Re[1])==null?void 0:U.vlm},it=[...ge,["threeMonth",Qe],["perpThreeMonth",$e]],tt=((z=(L=it.find(pt=>pt[0]===C))==null?void 0:L[1])==null?void 0:z[s])||[];t(tt);const ot=o==="combined"?"day":"perpDay",ft=o==="combined"?"week":"perpWeek",ct=o==="combined"?"month":"perpMonth",Vt=o==="combined"?"allTime":"perpAllTime",It=o==="combined"?"threeMonth":"perpThreeMonth",an=((ne=(Q=it.find(pt=>pt[0]===ot))==null?void 0:Q[1])==null?void 0:ne.pnlHistory)||[],Nt=((X=(J=it.find(pt=>pt[0]===ft))==null?void 0:J[1])==null?void 0:X.pnlHistory)||[],mn=((pe=(re=it.find(pt=>pt[0]===ct))==null?void 0:re[1])==null?void 0:pe.pnlHistory)||[],dn=((ie=(Y=it.find(pt=>pt[0]===Vt))==null?void 0:Y[1])==null?void 0:ie.pnlHistory)||[],Pt=((G=(oe=it.find(pt=>pt[0]===It))==null?void 0:oe[1])==null?void 0:G.pnlHistory)||[],Xe=((V=an[an.length-1])==null?void 0:V[1])??0,Ut=((te=Nt[Nt.length-1])==null?void 0:te[1])??0,Lt=((ae=mn[mn.length-1])==null?void 0:ae[1])??0,qe=((he=Pt[Pt.length-1])==null?void 0:he[1])??0,Ke=((Ce=dn[dn.length-1])==null?void 0:Ce[1])??0;f({activeRange:n,day:Xe,week:Ut,month:Lt,threeMonth:qe,all:Ke})}catch(ce){console.error("Error fetching data:",ce)}};v();const w=setInterval(v,3e4);return()=>clearInterval(w)},[n,s,o,u]);const x=m.useMemo(()=>({colors:["#67FFBD"],stroke:{width:3,curve:"smooth"},chart:{type:"area",stacked:!1,background:"transparent",foreColor:"#ffffff",height:"100%",zoom:{type:"x",enabled:!0,autoScaleYaxis:!0},toolbar:{autoSelected:"zoom",show:!1}},theme:{mode:"dark"},grid:{borderColor:"#2E2E2E",strokeDashArray:5,xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},dataLabels:{enabled:!1},markers:{size:0,colors:["#3CAD7C"]},fill:{type:"gradient",gradient:{shadeIntensity:1,inverseColors:!1,opacityFrom:.5,opacityTo:0,stops:[0,90,100],gradientToColors:["#67FFBD52"]}},yaxis:{labels:{formatter:v=>`$${Cr(v)}.00`,style:{colors:"#909090",fontSize:"14px",fontWeight:500,fontFamily:"Manrope",letterSpacing:"0.72px"}}},xaxis:{type:"datetime",labels:{style:{colors:"#FFFFFF",fontSize:"12px",fontWeight:500,fontFamily:"Manrope",letterSpacing:"0.72px"},formatter:function(v,w){const C=new Date(w);if(d)return C.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"});const N=`'${C.getFullYear().toString().slice(-2)}`;return`${C.toLocaleDateString("en-US",{month:"short",day:"2-digit"}).toUpperCase()} ${N}`}}},tooltip:{custom:function({series:v,seriesIndex:w,dataPointIndex:C,w:N}){var U,L;const I=v[w][C],P=(L=(U=N.globals.seriesX)==null?void 0:U[w])==null?void 0:L[C],R=N.globals.seriesNames[w];return`
<div class="p-2 rounded-2xl">
<p class="text-[12px] font-medium text-[#909090]">${P?new Date(P).toLocaleDateString("en-GB",{month:"short",day:"2-digit"}).toUpperCase():"-"}</p>
<div class="text-[14px] font-semibold flex items-center">
<span class="inline-block w-[10px] h-[10px] bg-[#67FFBD] rounded-full mr-1"></span>
<span class="text-[#67FFBD] mr-2">${R}</span>
<span>$${Cr(I)}</span>
</div>
</div>`},followCursor:!0,intersect:!1,shared:!0}}),[n]),g=[{name:s==="pnlHistory"?"PnL":"Account Value",data:e.map(([v,w])=>[parseInt(v),parseFloat(w)])}];return i.jsxs("div",{className:"p-0 lg:p-[16px] pb-0 bg-[#1B1B1B] rounded-2xl ml-0 lg:ml-2 mt-2 lg:mt-0 mb-2 lg:mb-0",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row justify-start items-center px-2 lg:px-0",children:[i.jsx("div",{className:"flex justify-center w-full lg:flex-none lg:w-auto bg-[#202020] rounded-2xl p-1 text-[12px] font-semibold mt-2 lg:mt-0",children:["24H","1W","1M","3M","All"].map(v=>i.jsx("button",{className:`flex-1 rounded-2xl hover:border-[#67FFBD] hover:rounded-2xl ${n==={"24H":"day","1W":"week","1M":"month","3M":"threeMonth",All:"allTime"}[v]?"text-white bg-[#353535] rounded-2xl":"text-white bg-transparent"}`,onClick:()=>{r({"24H":"day","1W":"week","1M":"month","3M":"threeMonth",All:"allTime"}[v]),localStorage.setItem("discover_period",{"24H":0,"1W":1,"1M":2,"3M":3,All:4}[v])},children:v},v))}),i.jsx("div",{className:"flex justify-center w-full lg:flex-none lg:w-auto ml-0 lg:ml-auto bg-[#202020] rounded-2xl p-1 text-[12px] font-semibold mr-0 lg:mr-8 mt-2 lg:mt-0",children:["Combined","Perp Only"].map(v=>i.jsx("button",{className:`rounded-2xl hover:border-[#67FFBD] hover:rounded-2xl ${o===v.toLowerCase()?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] rounded-2xl":"text-white bg-transparent"}`,onClick:()=>l(v.toLowerCase()),children:v},v))}),i.jsx("div",{className:"flex justify-center w-full lg:flex-none lg:w-auto bg-[#202020] rounded-2xl p-1 text-[12px] font-semibold mt-2 lg:mt-0",children:["PnL","Account Value"].map(v=>i.jsx("button",{className:`rounded-2xl hover:border-[#67FFBD] hover:rounded-2xl ${s===(v==="PnL"?"pnlHistory":"accountValueHistory")?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] rounded-2xl":"text-white bg-transparent"}`,onClick:()=>a(v==="PnL"?"pnlHistory":"accountValueHistory"),children:v},v))})]}),i.jsxs("div",{className:" text-white relative",children:[i.jsxs("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none ",children:[i.jsx("h1",{className:"sr-only",children:"Hyperliquid Wallet Overview & Trade History"}),i.jsx("span",{className:"text-[70px] sm:text-[100px] md:text-[140px] lg:text-[100px] xl:text-[140px] text-gray-600 opacity-20 font-bold font-manrope",children:"dextrabot"})]}),i.jsx(HL,{options:x,series:g,type:"area",height:410})]})]})};var Yx={},V7={},dCe;function $Ue(){if(dCe)return V7;dCe=1,Object.defineProperty(V7,"__esModule",{value:!0}),V7.parseLengthAndUnit=t,V7.cssValue=n;var e={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function t(r){if(typeof r=="number")return{value:r,unit:"px"};var s,a=(r.match(/^[0-9.]*/)||"").toString();a.includes(".")?s=parseFloat(a):s=parseInt(a,10);var o=(r.match(/[^0-9]*$/)||"").toString();return e[o]?{value:s,unit:o}:(console.warn("React Spinners: ".concat(r," is not a valid css value. Defaulting to ").concat(s,"px.")),{value:s,unit:"px"})}function n(r){var s=t(r);return"".concat(s.value).concat(s.unit)}return V7}var W7={},fCe;function UUe(){if(fCe)return W7;fCe=1,Object.defineProperty(W7,"__esModule",{value:!0}),W7.createAnimation=void 0;var e=function(t,n,r){var s="react-spinners-".concat(t,"-").concat(r);if(typeof window>"u"||!window.document)return s;var a=document.createElement("style");document.head.appendChild(a);var o=a.sheet,l=`
@keyframes `.concat(s,` {
`).concat(n,`
}
`);return o&&o.insertRule(l,0),s};return W7.createAnimation=e,W7}var hCe;function Xsn(){if(hCe)return Yx;hCe=1;var e=Yx.__assign||function(){return e=Object.assign||function(d){for(var f,x=1,g=arguments.length;x<g;x++){f=arguments[x];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(d[v]=f[v])}return d},e.apply(this,arguments)},t=Yx.__createBinding||(Object.create?function(d,f,x,g){g===void 0&&(g=x);var v=Object.getOwnPropertyDescriptor(f,x);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[x]}}),Object.defineProperty(d,g,v)}:function(d,f,x,g){g===void 0&&(g=x),d[g]=f[x]}),n=Yx.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Yx.__importStar||function(){var d=function(f){return d=Object.getOwnPropertyNames||function(x){var g=[];for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(g[g.length]=v);return g},d(f)};return function(f){if(f&&f.__esModule)return f;var x={};if(f!=null)for(var g=d(f),v=0;v<g.length;v++)g[v]!=="default"&&t(x,f,g[v]);return n(x,f),x}}(),s=Yx.__rest||function(d,f){var x={};for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&f.indexOf(g)<0&&(x[g]=d[g]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,g=Object.getOwnPropertySymbols(d);v<g.length;v++)f.indexOf(g[v])<0&&Object.prototype.propertyIsEnumerable.call(d,g[v])&&(x[g[v]]=d[g[v]]);return x};Object.defineProperty(Yx,"__esModule",{value:!0});var a=r(ax()),o=$Ue(),l=UUe(),c=(0,l.createAnimation)("ClipLoader","0% {transform: rotate(0deg) scale(1)} 50% {transform: rotate(180deg) scale(0.8)} 100% {transform: rotate(360deg) scale(1)}","clip");function u(d){var f=d.loading,x=f===void 0?!0:f,g=d.color,v=g===void 0?"#000000":g,w=d.speedMultiplier,C=w===void 0?1:w,N=d.cssOverride,I=N===void 0?{}:N,P=d.size,R=P===void 0?35:P,F=s(d,["loading","color","speedMultiplier","cssOverride","size"]),U=e({background:"transparent !important",width:(0,o.cssValue)(R),height:(0,o.cssValue)(R),borderRadius:"100%",border:"2px solid",borderTopColor:v,borderBottomColor:"transparent",borderLeftColor:v,borderRightColor:v,display:"inline-block",animation:"".concat(c," ").concat(.75/C,"s 0s infinite linear"),animationFillMode:"both"},I);return x?a.createElement("span",e({style:U},F)):null}return Yx.default=u,Yx}var Qsn=Xsn();const Yy=ki(Qsn),Pg=e=>Number(e).toLocaleString("en-US",{maximumFractionDigits:2}),kj=e=>!isFinite(e)||isNaN(e)?"-":`${Math.floor(e)}h ${Math.round((e-Math.floor(e))*60)}m`,Fce=({className:e="h-5"})=>i.jsx("div",{className:`w-full bg-gray-700/40 rounded animate-pulse ${e}`}),Zsn=e=>{var n;const t={totalTrades:e.length,totalPnL:0,totalFees:0,longPnL:0,shortPnL:0,wins:0,durSum:0,minDur:1/0,maxDur:-1/0,medianDur:0,perfByAsset:{},bestTrades:[],liquidations:{}};for(const r of e){t.totalPnL+=r.total_pnl||0,t.totalFees+=Math.abs(r.total_fee),r.position_side==="Long"?t.longPnL+=r.total_pnl||0:t.shortPnL+=r.total_pnl||0,r.total_pnl>0&&t.wins++,t.durSum+=r.duration_hours||0,t.minDur=Math.min(t.minDur,r.duration_hours||0),t.maxDur=Math.max(t.maxDur,r.duration_hours||0);const s=t.perfByAsset[r.coin]??(t.perfByAsset[r.coin]={coin:r.coin,pnl:0,fee:0,count:0});if(s.pnl+=r.total_pnl,s.fee+=r.total_fee,s.count++,r.isLiquidated){const a=r.coin,o=((n=t.liquidations)==null?void 0:n[a])??{coin:a,count:0,totalPrice:0,totalPnL:0};o.count+=r.liquidationCount||1,o.totalPrice+=r.isLiqudationPrice||0,o.totalPnL+=r.total_pnl||0,t.liquidations[a]=o}t.bestTrades.length<6?(t.bestTrades.push(r),t.bestTrades.sort((a,o)=>o.total_pnl-a.total_pnl)):r.total_pnl>t.bestTrades[5].total_pnl&&(t.bestTrades[5]=r,t.bestTrades.sort((a,o)=>o.total_pnl-a.total_pnl))}return t.grossPnL=t.totalPnL-t.totalFees,t.longPct=t.longPnL/(t.longPnL+t.shortPnL||1)*100,t.shortPct=100-t.longPct,t.winRate=t.totalTrades?t.wins/t.totalTrades*100:0,t.avgDur=t.totalTrades?t.durSum/t.totalTrades:0,t.medianDur=(t.minDur+t.maxDur)/2,t.perfByAsset=Object.values(t.perfByAsset).sort((r,s)=>s.pnl-r.pnl),t.liquidations=Object.values(t.liquidations).sort((r,s)=>s.count-r.count),t};function Jsn({trades:e}){const[t,n]=m.useState(!1),r=m.useMemo(()=>e?Zsn(e):null,[e]),s=m.useMemo(()=>{var c;return(c=r==null?void 0:r.perfByAsset)!=null&&c.length?Math.max(...r.perfByAsset.map(u=>Math.abs(u.pnl))):1},[r]),a=!r,o=r?new Date(Math.min(...e.map(c=>c.open_time))).toLocaleDateString():"-",l=r?new Date(Math.max(...e.map(c=>c.close_time??Date.now()))).toLocaleDateString():"-";return i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>n(!0),className:"bg-[rgba(255,255,255,0.16)] text-[#ffffff] h-6 sm:h-8 px-1 sm:px-3 py-[1px] sm:py-[5px] rounded-[256px] inline-flex items-center gap-2 text-[14px] font-semibold",children:"Trade Details"}),i.jsxs(up,{isOpen:t,onClose:()=>n(!1),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h1",{className:"text-lg font-semibold text-white",children:"Trade Details"}),a&&i.jsx(Yy,{color:"#fff",size:20})]}),i.jsxs("div",{className:"mb-4 text-xs text-white",children:[o," – ",l]}),!a&&(!r||r.totalTrades===0)?i.jsx(ein,{}):i.jsx(tin,{stats:r,maxCoinPnl:s,loading:a})]})]})}function ein(){return i.jsxs("div",{className:"w-full h-[60vh] flex flex-col items-center justify-center text-white text-sm",children:[i.jsx(C6t,{className:"w-14 h-14 mb-4"}),i.jsx("p",{children:"No Trade Details"}),i.jsx("p",{className:"opacity-70",children:"Not enough trading activity detected to generate statistics."})]})}function tin({stats:e,maxCoinPnl:t,loading:n}){return i.jsxs("div",{className:"flex flex-col sm:flex-row w-[90vw] gap-6 max-h-[80vh] h-[80vh] font-manrope",children:[i.jsxs("div",{className:"space-y-6 w-full sm:w-3/2 overflow-y-auto",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[i.jsx(q7,{title:"Total PnL",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:`text-xl font-semibold ${e.totalPnL-e.totalFees>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:["$",Pg(e.totalPnL-e.totalFees)]}),i.jsx(mb,{label:"Gross:",value:`$${Pg(e.grossPnL+e.totalFees)}`}),i.jsx(mb,{label:"Fees:",value:`$${Pg(e.totalFees)}`,red:!0})]})}),i.jsx(q7,{title:"Position Split",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsx(mb,{label:"Long PnL",value:`$${Pg(Math.abs(e.longPnL))}`,green:!0}),i.jsx(mb,{label:"Short PnL",value:`$${Pg(Math.abs(e.shortPnL))}`,green:!0}),i.jsx("div",{className:"h-2 bg-gray-700 rounded mt-2 overflow-hidden",children:i.jsx("div",{className:"h-2 bg-[#67FFBD]",style:{width:`${e.longPct}%`}})})]})}),i.jsx(q7,{title:"Performance",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-xl font-semibold text-white",children:[e.winRate.toFixed(2),"%"]}),i.jsx(mb,{label:"Winning:",value:e.wins}),i.jsx(mb,{label:"Total:",value:e.totalTrades})]})}),i.jsx(q7,{title:"Trade Duration",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xl font-semibold text-white",children:kj(e.avgDur)}),i.jsx(mb,{label:"Range:",value:`${kj(e.minDur)} – ${kj(e.maxDur)}`}),i.jsx(mb,{label:"Median:",value:kj(e.medianDur)})]})})]}),i.jsx(rin,{stats:e,loading:n})]}),i.jsxs("div",{className:"rounded-2xl w-full sm:w-1/3 h-full flex flex-col gap-4",children:[i.jsx(sin,{stats:e,loading:n,maxCoinPnl:t}),i.jsx(q7,{title:"Liquidations",loading:n,children:e&&e.liquidations.length>0?i.jsx(nin,{data:e.liquidations}):i.jsx("p",{className:"text-white text-lg text-center font-bold",children:"No liquidations"})})]})]})}function q7({title:e,loading:t,children:n}){return i.jsxs("div",{className:"bg-[#161616] p-4 rounded-2xl flex flex-col justify-between min-h-[140px]",children:[i.jsx("h2",{className:"text-sm uppercase tracking-wider text-white font-bold mb-3",children:e}),t?i.jsx(Fce,{className:"h-10"}):n]})}function nin({data:e}){return i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-sm font-bold text-white",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-gray-600 text-sm font-bold",children:[i.jsx("th",{className:"py-1 text-left",children:"Coin"}),i.jsx("th",{className:"py-1 text-right",children:"Total Loss"}),i.jsx("th",{className:"py-1 text-right",children:"Total Liqs"})]})}),i.jsx("tbody",{children:e.map(t=>i.jsxs("tr",{className:"border-b border-gray-700 last:border-0",children:[i.jsx("td",{className:"py-1",children:i.jsxs("a",{href:`/terminal/${t.coin}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-white hover:text-gray-400",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${t.coin}.svg`,alt:t.coin,className:"w-5 h-5 mr-2",loading:"lazy",onError:n=>replaceBrokenImgSrc(n)}),t.coin]})}),i.jsxs("td",{className:"py-1 text-right text-[#FF7173]",children:["$",Pg(Math.abs(t.totalPnL))]}),i.jsx("td",{className:"py-1 text-right",children:t.count})]},t.coin))})]})})}function mb({label:e,value:t,red:n,green:r}){return i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-white font-semibold",children:e}),i.jsx("span",{className:n?"text-[#FF7173] font-semibold":r?"text-[#67FFBD] font-semibold":"font-semibold text-white",children:t})]})}function rin({stats:e,loading:t}){return i.jsxs("div",{className:"bg-[#161616] p-4 rounded-2xl",children:[i.jsx("h2",{className:"text-sm uppercase tracking-wider text-white mb-4 font-bold",children:"Best Trades"}),t?i.jsx("div",{className:"grid grid-cols-2 gap-4",children:Array.from({length:6}).map((n,r)=>i.jsx(Fce,{className:"h-20"},r))}):i.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.bestTrades.map(n=>i.jsxs("div",{className:"bg-[#111] p-3 rounded-2xl space-y-1 text-sm",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"font-semibold text-white",children:n.coin}),i.jsx("span",{className:n.position_side==="Long"?"text-[#67FFBD]":"text-[#FF7173]",children:i.jsxs("span",{className:"text-lg font-bold",children:["$",Pg(Math.abs(n.total_pnl))]})})]}),i.jsx("span",{className:`px-2 py-[1px] rounded text-[11px] font-semibold ${n.position_side==="Long"?"bg-[#67FFBD]/20 text-[#67FFBD]":"bg-[#FF7173]/30 text-[#FF7173]"}`,children:n.position_side}),i.jsxs("div",{className:"text-white font-semibold",children:["Duration: ",kj(n.duration_hours)]}),i.jsx("div",{className:"text-white text-xs font-semibold",children:new Date(n.close_time).toLocaleDateString()})]},n.id??`${n.coin}-${n.close_time}`))})]})}function sin({stats:e,loading:t,maxCoinPnl:n}){return i.jsxs("div",{className:"bg-[#161616] p-4 overflow-y-auto",children:[i.jsx("h2",{className:"text-sm uppercase tracking-wider text-white mb-4 font-bold",children:"Performance by Asset"}),t?i.jsx("div",{className:"space-y-3",children:Array.from({length:10}).map((r,s)=>i.jsx(Fce,{className:"h-6"},s))}):e.perfByAsset.map(r=>{const s=`${Math.abs(r.pnl)/n*100}%`;return i.jsxs("div",{className:"mb-4 space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-sm font-semibold",children:[i.jsxs("span",{className:"text-white",children:[r.coin,i.jsxs("span",{className:"text-white text-xs ml-2",children:[r.count," trades"]})]}),i.jsxs("span",{className:"text-[#67FFBD]",children:["$",Pg(Math.abs(r.pnl))]})]}),i.jsxs("div",{className:"text-[11px] text-white font-semibold",children:["Fees: $",Pg(Math.abs(r.fee))]}),i.jsx("div",{className:"relative h-1 bg-gray-700 rounded overflow-hidden",children:i.jsx("div",{className:"absolute h-1 left-0 top-0 bg-[#67FFBD]",style:{width:s}})})]},r.coin)})]})}const zUe="https://api.hyperliquid.xyz/info",kne=2e3,HUe=365*24*60*60*1e3*2;async function VUe(e,t){const{data:n}=await ds.post(zUe,{type:"userFillsByTime",user:e,startTime:t,aggregateByTime:!0},{headers:{"Content-Type":"application/json"},timeout:1e4});return n}async function Oce(e){let t=Date.now()-HUe;const n=[],r=new Set;for(;;){const s=await VUe(e,t);if(!(s!=null&&s.length))break;for(const a of s)r.has(a.tid)||(r.add(a.tid),n.push(a));if(s.length<kne)break;t=Math.max(...s.map(a=>a.time))+1}return n.sort((s,a)=>s.time-a.time)}async function Mce(e){const{data:t}=await ds.post(zUe,{type:"userTwapSliceFills",user:e},{headers:{"Content-Type":"application/json"},timeout:1e4});return t}async function iin(e,t){let n=Date.now()-HUe;const r=[],s=new Set;let a=0;for(;;){const c=await VUe(e,n);if(!(c!=null&&c.length))break;for(const f of c)s.has(f.tid)||(s.add(f.tid),r.push(f));a++;let u=0,d=0;if(r.forEach(f=>{f.fee&&(u+=parseFloat(f.fee)),f.builderFee&&(d+=parseFloat(f.builderFee))}),t({totalFee:u,totalBuilderFee:d,totalFills:r.length,requestCount:a,hasMoreData:c.length>=kne,fills:r.slice(0,10),isComplete:!1}),c.length<kne)break;n=Math.max(...c.map(f=>f.time))+1}let o=0,l=0;return r.forEach(c=>{c.fee&&(o+=parseFloat(c.fee)),c.builderFee&&(l+=parseFloat(c.builderFee))}),t({totalFee:o,totalBuilderFee:l,totalFills:r.length,requestCount:a,hasMoreData:!1,fills:r.slice(0,10),isComplete:!0}),r.sort((c,u)=>c.time-u.time)}function pCe(e,t,n=1e-9,r=0){if(n<0||r<0)throw new RangeError("tolerances must be non-negative");if(e===t)return!0;if(!Number.isFinite(e)||!Number.isFinite(t))return!1;const s=Math.abs(t-e);return s<=Math.abs(n*t)||s<=Math.abs(n*e)||s<=r}function Rce(e){const t=[],n={},r=e.slice().sort((s,a)=>s.time-a.time);for(const s of r)try{const a=s.coin,o=s.dir,l=Math.abs(+s.sz),c=+s.px,u=Math.abs(+s.startPosition),d=+s.builderFee||0,f=+s.fee||0,x=+s.closedPnl||0,g=+s.time,v=s.twapId??null,w=o.startsWith("Open"),C=o.startsWith("Close"),N=o.includes(">"),I=!!s.liquidation;if(w){if(pCe(u,0))n[a]={coin:a,open_time:g,last_fill_time:g,position_side:o.includes("Long")?"Long":"Short",total_size:l,close_size:0,entry_price_wma:c,close_px:c,total_fee:f,total_pnl:0,transaction_count:1,isClosed:!1,oids:[s.oid],has_builder_fee:d!==0,builder_fee:d,twapId:v};else{const P=n[a]??(n[a]={}),R=(P.total_size||0)+l;P.oids=(P.oids||[]).concat(s.oid),P.entry_price_wma=((P.entry_price_wma||0)*(P.total_size||0)+c*l)/R,P.total_size=R,P.last_fill_time=g,P.transaction_count=(P.transaction_count||0)+1,P.total_fee=(P.total_fee||0)+f,P.has_builder_fee=P.has_builder_fee||d!==0,P.builder_fee=(P.builder_fee||0)+d,P.twapId=v}continue}if(N){const P=n[a];P&&(P.close_size+=l,P.total_pnl+=x,P.total_fee+=f,P.last_fill_time=g,P.close_px=c,P.transaction_count++,P.oids.push(s.oid),P.has_builder_fee=P.has_builder_fee||d!==0,P.builder_fee=(P.builder_fee||0)+d,P.twapId=v,P.isClosed=!0,P.close_time=g,P.duration_hours=(g-P.open_time)/36e5,t.push(P),delete n[a]);const R=Math.max(Math.abs(l)-Math.abs(u),0);R>0&&(n[a]={coin:a,open_time:g,last_fill_time:g,position_side:o.includes("Long")?"Long":"Short",total_size:R,close_size:0,entry_price_wma:c,close_px:c,total_fee:f,total_pnl:0,transaction_count:1,isClosed:!1,isLiquidated:!1,oids:[s.oid],has_builder_fee:d!==0,builder_fee:d,twapId:v});continue}if(C||I){const P=n[a];if(!P)continue;P.close_size+=l,P.total_pnl+=x,P.total_fee+=f,P.last_fill_time=g,P.close_px=c,P.transaction_count++,P.oids.push(s.oid),P.has_builder_fee=P.has_builder_fee||d!==0,P.builder_fee=(P.builder_fee||0)+d,P.twapId=v,I&&(P.isLiquidated=!0,P.liquidation_px_sum=(P.liquidation_px_sum||0)+c,P.liquidationCount=(P.liquidationCount||0)+1),pCe(Math.abs(l),Math.abs(u),1e-6)&&(P.isClosed=!0,P.close_time=g,P.duration_hours=(g-P.open_time)/36e5,t.push(P),delete n[a])}}catch{}return{closed_positions:t,current_positions:n,min_open_time:t.length?Math.min(...t.map(s=>s.open_time)):null,end_time:Date.now()}}const $f=({className:e})=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M15.1668 11.6665C15.1668 11.9398 14.9402 12.1665 14.6668 12.1665H10.0002V12.3332C10.0002 13.3332 9.40016 13.6665 8.66683 13.6665H4.66683C3.9335 13.6665 3.3335 13.3332 3.3335 12.3332V12.1665H1.3335C1.06016 12.1665 0.833496 11.9398 0.833496 11.6665C0.833496 11.3932 1.06016 11.1665 1.3335 11.1665H3.3335V10.9998C3.3335 9.99984 3.9335 9.6665 4.66683 9.6665H8.66683C9.40016 9.6665 10.0002 9.99984 10.0002 10.9998V11.1665H14.6668C14.9402 11.1665 15.1668 11.3932 15.1668 11.6665Z",fill:"currentColor"}),i.jsx("path",{d:"M15.1668 4.3335C15.1668 4.60683 14.9402 4.8335 14.6668 4.8335H12.6668V5.00016C12.6668 6.00016 12.0668 6.3335 11.3335 6.3335H7.3335C6.60016 6.3335 6.00016 6.00016 6.00016 5.00016V4.8335H1.3335C1.06016 4.8335 0.833496 4.60683 0.833496 4.3335C0.833496 4.06016 1.06016 3.8335 1.3335 3.8335H6.00016V3.66683C6.00016 2.66683 6.60016 2.3335 7.3335 2.3335H11.3335C12.0668 2.3335 12.6668 2.66683 12.6668 3.66683V3.8335H14.6668C14.9402 3.8335 15.1668 4.06016 15.1668 4.3335Z",fill:"currentColor"})]});function hT({open:e,setOpen:t,data:n,setTradeInfo:r,pnlTitle:s="UNREALIZED PNL",showPnl:a=!0}){const o=m.useRef(null),l=async()=>{if(o.current)try{await document.fonts.ready,await new Promise(C=>setTimeout(C,500));const v=await I1(o.current,{cacheBust:!0,backgroundColor:null,useCORS:!1,style:{transform:"scale(1)",transformOrigin:"top left"}}),w=document.createElement("a");w.href=v,w.download="dextrabot.png",document.body.appendChild(w),w.click(),document.body.removeChild(w),ln.success("PNG successfully downloaded!")}catch(v){console.error("Error generating PNG:",v),ln.error("Failed to download PNG.")}},[c,u]=m.useState(),[d,f]=m.useState(!0),x=async v=>{f(!0);try{const C=await(await fetch(`https://api.cors.lol/?url=${encodeURIComponent(v)}`)).blob();return new Promise((N,I)=>{const P=new FileReader;P.onloadend=()=>N(P.result),P.onerror=I,P.readAsDataURL(C)})}catch(w){throw console.error("Image conversion failed:",w),w}finally{f(!1)}},g={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return m.useEffect(()=>{var v;n!=null&&n.coin&&x(`https://app.hyperliquid.xyz/coins/${g[n==null?void 0:n.coin]||((v=n==null?void 0:n.coin)==null?void 0:v.split("/")[0])}.svg`).then(w=>u(w)).catch(()=>u(Va))},[n==null?void 0:n.coin]),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(v=>({...v,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,positionDistribution:0,pnl:0,closePx:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:o,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[22px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start ",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-6",children:[i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:d?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:c||Va,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:v=>ra(v)})})}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope flex items-center",children:n!=null&&n.coin?n==null?void 0:n.coin.replace("xyz:",""):"--"}),i.jsx("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-20 min-w-[80px] w-auto px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"--"}),i.jsxs("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-16 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide`,children:[n!=null&&n.leverage?n==null?void 0:n.leverage:"--","x"]})]}),i.jsxs("div",{className:`${(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.roe)>=0?"+":"-",ao(Math.abs(n==null?void 0:n.roe)),"%"]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:[s&&i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:s}),i.jsx("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-[32px] font-semibold font-manrope leading-none flex`,children:n!=null&&n.pnl?`$${ao(Math.abs(n==null?void 0:n.pnl).toFixed(2))}`:ao(Math.abs(n==null?void 0:n.pnl))})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"ENTRY PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.entryPrice?`$${Cr(n==null?void 0:n.entryPrice)}`:Cr(n==null?void 0:n.entryPrice)})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"MARK PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.markPrice?`$${Cr(n==null?void 0:n.markPrice)}`:Cr(n==null?void 0:n.markPrice)})]})}),(n==null?void 0:n.referral)&&(n==null?void 0:n.referral)!="--"&&i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[20px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?"pt-[8px]":"pt-[90px]"} flex justify-start items-start`,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:(n==null?void 0:n.roe)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:v=>{v.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:v=>{v.preventDefault(),d||l()},className:`${d?"cursor-not-allowed":"cursor-pointer"} w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:d?"Hang tight! Your image is on the way... 🚀":"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}function ain({open:e,setOpen:t,data:n,setTradeInfo:r}){var o,l;const s=m.useRef(null),a=async()=>{if(s.current)try{await document.fonts.ready,await new Promise(d=>setTimeout(d,500));const c=await I1(s.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),u=document.createElement("a");u.href=c,u.download="dextrabot.png",document.body.appendChild(u),u.click(),document.body.removeChild(u),ln.success("PNG successfully downloaded!")}catch(c){console.error("Error generating PNG:",c),ln.error("Failed to download PNG.")}};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(c=>({...c,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,positionDistribution:0,pnl:0,closePx:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:s,style:{overflow:"visible",position:"relative"},className:"w-[878px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[870px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[522px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[20px] py-[30px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-[30px]",children:[i.jsx("div",{className:`${(n==null?void 0:n.type)=="LONG"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 min-w-[80px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"--"}),i.jsx("div",{className:`${(n==null?void 0:n.type)=="LONG"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide`,children:n!=null&&n.leverage?(n==null?void 0:n.leverage)==null||isNaN(parseFloat(n==null?void 0:n.leverage))?"--":parseFloat(n==null?void 0:n.leverage).toFixed(2)+"x":"--"})]}),i.jsxs("div",{className:`${n!=null&&n.roe&&(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center`,children:[n!=null&&n.roe&&(n==null?void 0:n.roe)>=0?"+":"-",(n==null?void 0:n.roe)==null||isNaN(parseFloat(n==null?void 0:n.roe))?"":Is(Math.abs(n==null?void 0:n.roe))+"%"]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[30px] pt-[18px]",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"UNREALIZED PNL"}),i.jsx("div",{className:`${(n==null?void 0:n.entryPrice)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[32px] font-semibold font-manrope leading-none flex min-w-[180px]`,children:n!=null&&n.entryPrice?`$${Cr(Math.abs(n==null?void 0:n.entryPrice))}`:"--"})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex min-w-max",children:"POSITION DISTRIBUTION"}),i.jsx("div",{className:"text-white text-[24px] font-semibold font-manrope leading-none flex min-w-max pt-1",children:n!=null&&n.positionDistribution?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#67ffbd]",children:n==null?void 0:n.positionDistribution.split("/")[0].trim()}),i.jsx("span",{className:"text-white mx-1",children:"/"}),i.jsx("span",{className:"text-[#ff6767]",children:(o=n==null?void 0:n.positionDistribution.split("/")[1])==null?void 0:o.trim()})]}):i.jsx("span",{className:"text-white",children:"--"})})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[8px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"CURRENT WIN RATE"}),i.jsx("div",{className:"text-[24px] font-semibold font-manrope leading-none flex min-w-max",children:n!=null&&n.markPrice?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#67ffbd]",children:n==null?void 0:n.markPrice.split("/")[0].trim()}),i.jsx("span",{className:"text-white mx-1",children:"/"}),i.jsx("span",{className:"text-white",children:(l=n==null?void 0:n.markPrice.split("/")[1])==null?void 0:l.trim()})]}):i.jsx("span",{className:"text-white",children:"--"})})]})}),(n==null?void 0:n.referral)&&i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[16px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral?"pt-[1px]":"pt-[90px]"} flex justify-start items-start`,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[398px] overflow-hidden",children:n!=null&&n.entryPrice&&(n==null?void 0:n.entryPrice)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:c=>{c.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:()=>{a()},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}function oin({open:e,setOpen:t,data:n,setShare:r,setTradeInfo:s}){var x;const a=m.useRef(null),o=async()=>{if(a.current)try{await document.fonts.ready,await new Promise(w=>setTimeout(w,500));const g=await I1(a.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),v=document.createElement("a");v.href=g,v.download="dextrabot.png",document.body.appendChild(v),v.click(),document.body.removeChild(v),ln.success("PNG successfully downloaded!")}catch(g){console.error("Error generating PNG:",g),ln.error("Failed to download PNG.")}},[l,c]=m.useState(),[u,d]=m.useState(!0),f=async g=>{d(!0);try{const w=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(g)}`)).blob();return new Promise((C,N)=>{const I=new FileReader;I.onloadend=()=>C(I.result),I.onerror=N,I.readAsDataURL(w)})}catch(v){throw console.error("Image conversion failed:",v),v}finally{d(!1)}};return m.useEffect(()=>{n!=null&&n.coin&&f(`https://app.hyperliquid.xyz/coins/${n==null?void 0:n.coin}.svg`).then(g=>c(g)).catch(()=>c(Va))},[n==null?void 0:n.coin]),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),r(!1),setTimeout(()=>{s(g=>({...g,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,positionDistribution:0,pnl:0,closePx:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:a,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[22px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start ",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-6",children:[i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:u?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",class:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{class:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:l||Va,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:g=>ra(g)})})}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope flex items-center",children:n!=null&&n.coin?n==null?void 0:n.coin:"--"}),i.jsx("div",{className:`${(x=n==null?void 0:n.type)!=null&&x.includes("Long")?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-auto px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"-"})]}),i.jsxs("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.pnl)>=0?"+":"-","$",ao(Math.abs((n==null?void 0:n.pnl)-(n!=null&&n.builderFee?n.builderFee:0)))]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"ENTRY PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.entryPrice?`$${fy(n==null?void 0:n.entryPrice)}`:fy(n==null?void 0:n.entryPrice)})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"MARK PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.markPrice?`$${fy(n==null?void 0:n.markPrice)}`:fy(n==null?void 0:n.markPrice)})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[20px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:"flex justify-start items-start pt-[8px]",children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:(n==null?void 0:n.roe)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:g=>{g.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:g=>{g.preventDefault(),u||o()},className:`${u?"cursor-not-allowed":"cursor-pointer"} w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:u?"Hang tight! Your image is on the way... 🚀":"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}const lin=({wallet:e,wallets:t})=>{const[n,r]=m.useState([]),[s,a]=m.useState(!0),[o,l]=m.useState("oid"),[c,u]=m.useState(""),[d,f]=m.useState(!1),x=m.useRef(null),g=m.useRef(null),[v,w]=m.useState(!1),[C,N]=m.useState(null);m.useContext(Qr);const[I,P]=m.useState({key:null,direction:null});m.useEffect(()=>{function pe(Y){g.current&&!g.current.contains(Y.target)&&setIsDropdownOpen(!1),x.current&&!x.current.contains(Y.target)&&f(!1)}return document.addEventListener("mousedown",pe),()=>document.removeEventListener("mousedown",pe)},[]);const R=pe=>`${pe.time}_${pe.coin}_${pe.dir}_${pe.px}_${pe.sz}`;m.useEffect(()=>{if(!t||t.length===0)return;const pe=t.map(ie=>ie.wallet_address.toLowerCase());if(pe.length===0)return;let Y=!0;return(async()=>{try{const ie=(await Promise.all(pe.map(G=>ds.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:G})))).flatMap(G=>G.data??[]);if(!Y)return;const oe=new Map;ie.forEach(G=>{const V=R(G);oe.has(V)||oe.set(V,G)}),r(Array.from(oe.values()).sort((G,V)=>V.time-G.time))}catch(ie){console.error("Multi-wallet trade fetch error:",ie)}finally{Y&&a(!1)}})(),()=>{Y=!1}},[t]),m.useEffect(()=>{const pe=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");return pe.onopen=()=>{pe.send(JSON.stringify({method:"subscribe",subscription:{type:"userFills",user:e,aggregateByTime:!0}}))},pe.onmessage=Y=>{const ie=JSON.parse(Y.data);ie&&ie.data&&Array.isArray(ie.data.fills)&&r(oe=>{const G=[...oe];return ie.data.fills.forEach(V=>{const te=R(V);G.some(ae=>R(ae)===te)||G.push(V)}),G.sort((V,te)=>te.time-V.time)})},()=>pe.close()},[]),m.useEffect(()=>{(async()=>{try{const Y=await ds.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:e});r(Y.data||[])}catch(Y){console.error("Error fetching trade data:",Y)}finally{a(!1)}})()},[e]);const F=pe=>{let Y="asc";I.key===pe&&(I.direction==="asc"?Y="desc":I.direction==="desc"&&(Y=null)),P({key:pe,direction:Y})};let U=[...n];c&&(U=U.filter(pe=>String(pe.oid).includes(c)));const L=U.sort((pe,Y)=>{if(!I.key||!I.direction)return 0;const ie=(V,te)=>{switch(te){case"sz":return parseFloat(V.sz);case"closedPnl":return parseFloat(V.closedPnl||0)-parseFloat(V.fee||0);case"fee":return parseFloat(V.fee);case"tradeValue":return parseFloat(V.px)*parseFloat(V.sz);default:return V[te]}},oe=ie(pe,I.key),G=ie(Y,I.key);return oe<G?I.direction==="asc"?-1:1:oe>G?I.direction==="asc"?1:-1:0}),z=pe=>{if(I.key===pe){if(I.direction==="asc")return i.jsx(I3,{className:"inline ml-2 text-white"});if(I.direction==="desc")return i.jsx(T3,{className:"inline ml-2 text-white"})}return i.jsx(P3,{className:"inline ml-2 text-white"})},ne=localStorage.getItem("isDateTradeHistoryFormat")||"date",[J,X]=m.useState(ne);m.useEffect(()=>{localStorage.setItem("isDateTradeHistoryFormat",J)},[J]);function re({date:pe}){const[Y,ie]=m.useState(Oo(pe));return m.useEffect(()=>{const oe=setInterval(()=>{ie(Oo(pe))},1e3);return()=>clearInterval(oe)},[pe]),i.jsx("span",{className:"text-white leading-[13px] tracking-[0.26px] text-[13px] font-semibold font-manrope",children:Y.dateTime})}return i.jsxs("div",{className:"relative w-full text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx(oin,{open:v,setOpen:w,data:C,setShare:()=>{},setTradeInfo:()=>{}}),i.jsx("div",{className:"w-full overflow-x-auto min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] border-collapse rounded-lg pb-24",children:i.jsxs("table",{className:"w-max sm:w-full relative border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"sticky top-0 z-[3] whitespace-nowrap bg-[#161616]",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[13px] font-manrope relative h-[32px] max-h-[32px] text-white",children:[i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("time"),children:["Time ",z("time")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("coin"),children:["Coin ",z("coin")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("dir"),children:["Direction ",z("dir")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("px"),children:["Price ",z("px")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("sz"),children:["Size ",z("sz")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("tradeValue"),children:["Trade Value ",z("tradeValue")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("fee"),children:["Fee (USDC) ",z("fee")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("closedPnl"),children:["Closed PNL ",z("closedPnl")]}),i.jsx("th",{children:i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(di,{title:"Order ID",sortKey:"oid",sortOption:o,setSortOption:l,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>f(!d),className:`${c?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${c?"text-blue-500":"text-white"}`})}),d&&i.jsxs("div",{ref:x,className:`absolute right-[30px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>u(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"number",value:c,onChange:pe=>u(pe.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Order ID"})]})]})]})})]})}),i.jsx("tbody",{children:s?i.jsx("tr",{children:i.jsx("td",{colSpan:"8",className:"text-center p-4",children:"Loading..."})}):L.map((pe,Y)=>{var ie,oe;return i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",children:[i.jsx("td",{onClick:()=>{X(J=="time"?"date":"time")},className:"text-left rounded-l-2xl cursor-pointer",children:J=="time"?i.jsx(re,{date:pe.time}):su(pe.time)}),i.jsx("td",{className:"text-left",children:i.jsx("a",{href:`/terminal/${pe.coin}`,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-gray-400",children:pe.coin})}),i.jsx("td",{className:`text-left ${pe!=null&&pe.liquidation?"text-[#ff787b]":(ie=pe.dir)!=null&&ie.includes("Short")?"text-[#ff6b6b]":(oe=pe.dir)!=null&&oe.includes("Long")?"text-[#4ae3b5]":"text-white"}`,children:pe!=null&&pe.liquidation?`Market Liquidation: ${(pe==null?void 0:pe.dir)=="Sell"?"Sell":(pe==null?void 0:pe.dir)=="Buy"?"Buy":(pe==null?void 0:pe.dir)=="Close Short"?"Close Short":(pe==null?void 0:pe.dir)=="Close Long"?"Close Long":(pe==null?void 0:pe.dir)=="Open Short"?"Close Short":(pe==null?void 0:pe.dir)=="Open Long"?"Close Long":"Close "+(pe==null?void 0:pe.dir)}`:pe==null?void 0:pe.dir}),i.jsxs("td",{className:"text-left",children:["$",parseFloat(pe.px).toFixed(2)]}),i.jsx("td",{className:"text-left",children:Cr(parseFloat(pe.sz))}),i.jsxs("td",{className:"text-left",children:["$",Cr(parseFloat(pe.px)*parseFloat(pe.sz))]}),i.jsxs("td",{className:"text-left",children:[Cr(parseFloat(pe.fee)),pe.builderFee&&i.jsxs("span",{className:"text-xs",children:["(",Cr(parseFloat(pe.builderFee))," ","builder fee)"]})]}),i.jsxs("td",{className:`text-left ${parseFloat(pe.closedPnl)-parseFloat(pe.fee)>0?"text-[#4ae3b5]":parseFloat(pe.closedPnl)-parseFloat(pe.fee)<0?"text-[#ff6b6b]":"text-white"}`,children:["$",Cr(parseFloat(pe.closedPnl)-parseFloat(pe.fee))]}),i.jsx("td",{className:"rounded-r-2xl ",children:pe.oid})]},Y)})})]})})]})};var Tj={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/var cin=Tj.exports,mCe;function uin(){return mCe||(mCe=1,function(e,t){(function(){var n,r="4.17.21",s=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",f=1,x=2,g=4,v=1,w=2,C=1,N=2,I=4,P=8,R=16,F=32,U=64,L=128,z=256,Q=512,ne=30,J="...",X=800,re=16,pe=1,Y=2,ie=3,oe=1/0,G=9007199254740991,V=17976931348623157e292,te=NaN,ae=4294967295,he=ae-1,Ce=ae>>>1,ce=[["ary",L],["bind",C],["bindKey",N],["curry",P],["curryRight",R],["flip",Q],["partial",F],["partialRight",U],["rearg",z]],ge="[object Arguments]",Ae="[object Array]",ye="[object AsyncFunction]",je="[object Boolean]",Ie="[object Date]",Re="[object DOMException]",Qe="[object Error]",$e="[object Function]",it="[object GeneratorFunction]",tt="[object Map]",ot="[object Number]",ft="[object Null]",ct="[object Object]",Vt="[object Promise]",It="[object Proxy]",an="[object RegExp]",Nt="[object Set]",mn="[object String]",dn="[object Symbol]",Pt="[object Undefined]",Xe="[object WeakMap]",Ut="[object WeakSet]",Lt="[object ArrayBuffer]",qe="[object DataView]",Ke="[object Float32Array]",pt="[object Float64Array]",en="[object Int8Array]",Bt="[object Int16Array]",Et="[object Int32Array]",et="[object Uint8Array]",Be="[object Uint8ClampedArray]",Mt="[object Uint16Array]",Ve="[object Uint32Array]",ut=/\b__p \+= '';/g,xt=/\b(__p \+=) '' \+/g,jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,kt=/&(?:amp|lt|gt|quot|#39);/g,xn=/[&<>"']/g,un=RegExp(kt.source),On=RegExp(xn.source),En=/<%-([\s\S]+?)%>/g,jn=/<%([\s\S]+?)%>/g,bn=/<%=([\s\S]+?)%>/g,Zn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zn=/^\w*$/,$n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nr=/[\\^$.*+?()[\]{}|]/g,wn=RegExp(nr.source),on=/^\s+/,Oe=/\s/,rn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,cn=/\{\n\/\* \[wrapped with (.+)\] \*/,_t=/,? & /,Yn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yn=/[()=,{}\[\]\/\s]/,Dt=/\\(\\)?/g,sn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Tn=/\w*$/,Kn=/^[-+]0x[0-9a-f]+$/i,ir=/^0b[01]+$/i,rr=/^\[object .+?Constructor\]$/,Jt=/^0o[0-7]+$/i,Un=/^(?:0|[1-9]\d*)$/,Qn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Rt=/($^)/,Pn=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",p="\\u0300-\\u036f",h="\\ufe20-\\ufe2f",S="\\u20d0-\\u20ff",_=p+h+S,k="\\u2700-\\u27bf",T="a-z\\xdf-\\xf6\\xf8-\\xff",B="\\xac\\xb1\\xd7\\xf7",W="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ee="\\u2000-\\u206f",de=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fe="A-Z\\xc0-\\xd6\\xd8-\\xde",xe="\\ufe0e\\ufe0f",we=B+W+ee+de,ke="['’]",Me="["+Ee+"]",Ye="["+we+"]",Fe="["+_+"]",st="\\d+",se="["+k+"]",Se="["+T+"]",De="[^"+Ee+we+st+k+T+fe+"]",Le="\\ud83c[\\udffb-\\udfff]",_e="(?:"+Fe+"|"+Le+")",nt="[^"+Ee+"]",lt="(?:\\ud83c[\\udde6-\\uddff]){2}",bt="[\\ud800-\\udbff][\\udc00-\\udfff]",Zt="["+fe+"]",Ge="\\u200d",Je="(?:"+Se+"|"+De+")",We="(?:"+Zt+"|"+De+")",wt="(?:"+ke+"(?:d|ll|m|re|s|t|ve))?",At="(?:"+ke+"(?:D|LL|M|RE|S|T|VE))?",Gt=_e+"?",fn="["+xe+"]?",Rn="(?:"+Ge+"(?:"+[nt,lt,bt].join("|")+")"+fn+Gt+")*",An="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mt=fn+Gt+Rn,qt="(?:"+[se,lt,bt].join("|")+")"+mt,Qt="(?:"+[nt+Fe+"?",Fe,lt,bt,Me].join("|")+")",In=RegExp(ke,"g"),or=RegExp(Fe,"g"),Wn=RegExp(Le+"(?="+Le+")|"+Qt+mt,"g"),Vn=RegExp([Zt+"?"+Se+"+"+wt+"(?="+[Ye,Zt,"$"].join("|")+")",We+"+"+At+"(?="+[Ye,Zt+Je,"$"].join("|")+")",Zt+"?"+Je+"+"+wt,Zt+"+"+At,pr,An,st,qt].join("|"),"g"),gr=RegExp("["+Ge+Ee+_+xe+"]"),Ir=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Lr=-1,Ht={};Ht[Ke]=Ht[pt]=Ht[en]=Ht[Bt]=Ht[Et]=Ht[et]=Ht[Be]=Ht[Mt]=Ht[Ve]=!0,Ht[ge]=Ht[Ae]=Ht[Lt]=Ht[je]=Ht[qe]=Ht[Ie]=Ht[Qe]=Ht[$e]=Ht[tt]=Ht[ot]=Ht[ct]=Ht[an]=Ht[Nt]=Ht[mn]=Ht[Xe]=!1;var nn={};nn[ge]=nn[Ae]=nn[Lt]=nn[qe]=nn[je]=nn[Ie]=nn[Ke]=nn[pt]=nn[en]=nn[Bt]=nn[Et]=nn[tt]=nn[ot]=nn[ct]=nn[an]=nn[Nt]=nn[mn]=nn[dn]=nn[et]=nn[Be]=nn[Mt]=nn[Ve]=!0,nn[Qe]=nn[$e]=nn[Xe]=!1;var Sr={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Br={"&":"&","<":"<",">":">",'"':""","'":"'"},Kr={"&":"&","<":"<",">":">",""":'"',"'":"'"},As={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ms=parseFloat,vr=parseInt,Yr=typeof Tu=="object"&&Tu&&Tu.Object===Object&&Tu,vi=typeof self=="object"&&self&&self.Object===Object&&self,_r=Yr||vi||Function("return this")(),os=t&&!t.nodeType&&t,Gs=os&&!0&&e&&!e.nodeType&&e,mi=Gs&&Gs.exports===os,ns=mi&&Yr.process,Xt=function(){try{var vt=Gs&&Gs.require&&Gs.require("util").types;return vt||ns&&ns.binding&&ns.binding("util")}catch{}}(),ue=Xt&&Xt.isArrayBuffer,rt=Xt&&Xt.isDate,Ft=Xt&&Xt.isMap,yt=Xt&&Xt.isRegExp,hn=Xt&&Xt.isSet,vn=Xt&&Xt.isTypedArray;function lr(vt,$t,Kt){switch(Kt.length){case 0:return vt.call($t);case 1:return vt.call($t,Kt[0]);case 2:return vt.call($t,Kt[0],Kt[1]);case 3:return vt.call($t,Kt[0],Kt[1],Kt[2])}return vt.apply($t,Kt)}function Nr(vt,$t,Kt,_n){for(var ur=-1,br=vt==null?0:vt.length;++ur<br;){var wr=vt[ur];$t(_n,wr,Kt(wr),vt)}return _n}function fr(vt,$t){for(var Kt=-1,_n=vt==null?0:vt.length;++Kt<_n&&$t(vt[Kt],Kt,vt)!==!1;);return vt}function cr(vt,$t){for(var Kt=vt==null?0:vt.length;Kt--&&$t(vt[Kt],Kt,vt)!==!1;);return vt}function ts(vt,$t){for(var Kt=-1,_n=vt==null?0:vt.length;++Kt<_n;)if(!$t(vt[Kt],Kt,vt))return!1;return!0}function is(vt,$t){for(var Kt=-1,_n=vt==null?0:vt.length,ur=0,br=[];++Kt<_n;){var wr=vt[Kt];$t(wr,Kt,vt)&&(br[ur++]=wr)}return br}function Or(vt,$t){var Kt=vt==null?0:vt.length;return!!Kt&&qn(vt,$t,0)>-1}function hr(vt,$t,Kt){for(var _n=-1,ur=vt==null?0:vt.length;++_n<ur;)if(Kt($t,vt[_n]))return!0;return!1}function Jn(vt,$t){for(var Kt=-1,_n=vt==null?0:vt.length,ur=Array(_n);++Kt<_n;)ur[Kt]=$t(vt[Kt],Kt,vt);return ur}function vs(vt,$t){for(var Kt=-1,_n=$t.length,ur=vt.length;++Kt<_n;)vt[ur+Kt]=$t[Kt];return vt}function si(vt,$t,Kt,_n){var ur=-1,br=vt==null?0:vt.length;for(_n&&br&&(Kt=vt[++ur]);++ur<br;)Kt=$t(Kt,vt[ur],ur,vt);return Kt}function ni(vt,$t,Kt,_n){var ur=vt==null?0:vt.length;for(_n&&ur&&(Kt=vt[--ur]);ur--;)Kt=$t(Kt,vt[ur],ur,vt);return Kt}function Er(vt,$t){for(var Kt=-1,_n=vt==null?0:vt.length;++Kt<_n;)if($t(vt[Kt],Kt,vt))return!0;return!1}var Sn=Fs("length");function Mn(vt){return vt.split("")}function at(vt){return vt.match(Yn)||[]}function zt(vt,$t,Kt){var _n;return Kt(vt,function(ur,br,wr){if($t(ur,br,wr))return _n=br,!1}),_n}function er(vt,$t,Kt,_n){for(var ur=vt.length,br=Kt+(_n?1:-1);_n?br--:++br<ur;)if($t(vt[br],br,vt))return br;return-1}function qn(vt,$t,Kt){return $t===$t?O(vt,$t,Kt):er(vt,Ar,Kt)}function kr(vt,$t,Kt,_n){for(var ur=Kt-1,br=vt.length;++ur<br;)if(_n(vt[ur],$t))return ur;return-1}function Ar(vt){return vt!==vt}function Zr(vt,$t){var Kt=vt==null?0:vt.length;return Kt?zr(vt,$t)/Kt:te}function Fs(vt){return function($t){return $t==null?n:$t[vt]}}function St(vt){return function($t){return vt==null?n:vt[$t]}}function sr(vt,$t,Kt,_n,ur){return ur(vt,function(br,wr,ws){Kt=_n?(_n=!1,br):$t(Kt,br,wr,ws)}),Kt}function Hn(vt,$t){var Kt=vt.length;for(vt.sort($t);Kt--;)vt[Kt]=vt[Kt].value;return vt}function zr(vt,$t){for(var Kt,_n=-1,ur=vt.length;++_n<ur;){var br=$t(vt[_n]);br!==n&&(Kt=Kt===n?br:Kt+br)}return Kt}function as(vt,$t){for(var Kt=-1,_n=Array(vt);++Kt<vt;)_n[Kt]=$t(Kt);return _n}function rs(vt,$t){return Jn($t,function(Kt){return[Kt,vt[Kt]]})}function hs(vt){return vt&&vt.slice(0,le(vt)+1).replace(on,"")}function ps(vt){return function($t){return vt($t)}}function Bi(vt,$t){return Jn($t,function(Kt){return vt[Kt]})}function Ls(vt,$t){return vt.has($t)}function xs(vt,$t){for(var Kt=-1,_n=vt.length;++Kt<_n&&qn($t,vt[Kt],0)>-1;);return Kt}function jr(vt,$t){for(var Kt=vt.length;Kt--&&qn($t,vt[Kt],0)>-1;);return Kt}function ga(vt,$t){for(var Kt=vt.length,_n=0;Kt--;)vt[Kt]===$t&&++_n;return _n}var El=St(Sr),_l=St(Br);function Bu(vt){return"\\"+As[vt]}function ba(vt,$t){return vt==null?n:vt[$t]}function kl(vt){return gr.test(vt)}function px(vt){return Ir.test(vt)}function $u(vt){for(var $t,Kt=[];!($t=vt.next()).done;)Kt.push($t.value);return Kt}function xi(vt){var $t=-1,Kt=Array(vt.size);return vt.forEach(function(_n,ur){Kt[++$t]=[ur,_n]}),Kt}function yd(vt,$t){return function(Kt){return vt($t(Kt))}}function dt(vt,$t){for(var Kt=-1,_n=vt.length,ur=0,br=[];++Kt<_n;){var wr=vt[Kt];(wr===$t||wr===d)&&(vt[Kt]=d,br[ur++]=Kt)}return br}function y(vt){var $t=-1,Kt=Array(vt.size);return vt.forEach(function(_n){Kt[++$t]=_n}),Kt}function E(vt){var $t=-1,Kt=Array(vt.size);return vt.forEach(function(_n){Kt[++$t]=[_n,_n]}),Kt}function O(vt,$t,Kt){for(var _n=Kt-1,ur=vt.length;++_n<ur;)if(vt[_n]===$t)return _n;return-1}function $(vt,$t,Kt){for(var _n=Kt+1;_n--;)if(vt[_n]===$t)return _n;return _n}function H(vt){return kl(vt)?Te(vt):Sn(vt)}function K(vt){return kl(vt)?Ze(vt):Mn(vt)}function le(vt){for(var $t=vt.length;$t--&&Oe.test(vt.charAt($t)););return $t}var ve=St(Kr);function Te(vt){for(var $t=Wn.lastIndex=0;Wn.test(vt);)++$t;return $t}function Ze(vt){return vt.match(Wn)||[]}function ht(vt){return vt.match(Vn)||[]}var Tt=function vt($t){$t=$t==null?_r:tn.defaults(_r.Object(),$t,tn.pick(_r,Fr));var Kt=$t.Array,_n=$t.Date,ur=$t.Error,br=$t.Function,wr=$t.Math,ws=$t.Object,Ks=$t.RegExp,uc=$t.String,Za=$t.TypeError,Ja=Kt.prototype,da=br.prototype,_a=ws.prototype,Vo=$t["__core-js_shared__"],vd=da.toString,Ii=_a.hasOwnProperty,Em=0,P1=function(){var D=/[^.]+$/.exec(Vo&&Vo.keys&&Vo.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""}(),S2=_a.toString,k5=vd.call(ws),NT=_r._,AT=Ks("^"+vd.call(Ii).replace(nr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N2=mi?$t.Buffer:n,mp=$t.Symbol,A2=$t.Uint8Array,u8=N2?N2.allocUnsafe:n,hf=yd(ws.getPrototypeOf,ws),T5=ws.create,I5=_a.propertyIsEnumerable,P5=Ja.splice,jT=mp?mp.isConcatSpreadable:n,xp=mp?mp.iterator:n,mx=mp?mp.toStringTag:n,j2=function(){try{var D=Dm(ws,"defineProperty");return D({},"",{}),D}catch{}}(),ET=$t.clearTimeout!==_r.clearTimeout&&$t.clearTimeout,Wa=_n&&_n.now!==_r.Date.now&&_n.now,d8=$t.setTimeout!==_r.setTimeout&&$t.setTimeout,xx=wr.ceil,_m=wr.floor,F5=ws.getOwnPropertySymbols,f8=N2?N2.isBuffer:n,F1=$t.isFinite,O5=Ja.join,O1=yd(ws.keys,ws),Wo=wr.max,dc=wr.min,kU=_n.now,_T=$t.parseInt,E2=wr.random,M5=Ja.reverse,_2=Dm($t,"DataView"),gx=Dm($t,"Map"),k2=Dm($t,"Promise"),km=Dm($t,"Set"),T2=Dm($t,"WeakMap"),M1=Dm(ws,"create"),R5=T2&&new T2,R1={},h8=Bm(_2),Tm=Bm(gx),kT=Bm(k2),L1=Bm(km),eh=Bm(T2),Im=mp?mp.prototype:n,Uu=Im?Im.valueOf:n,L5=Im?Im.toString:n;function Ot(D){if(Go(D)&&!Ci(D)&&!(D instanceof wi)){if(D instanceof fc)return D;if(Ii.call(D,"__wrapped__"))return rI(D)}return new fc(D)}var D1=function(){function D(){}return function(q){if(!Lo(q))return{};if(T5)return T5(q);D.prototype=q;var be=new D;return D.prototype=n,be}}();function th(){}function fc(D,q){this.__wrapped__=D,this.__actions__=[],this.__chain__=!!q,this.__index__=0,this.__values__=n}Ot.templateSettings={escape:En,evaluate:jn,interpolate:bn,variable:"",imports:{_:Ot}},Ot.prototype=th.prototype,Ot.prototype.constructor=Ot,fc.prototype=D1(th.prototype),fc.prototype.constructor=fc;function wi(D){this.__wrapped__=D,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ae,this.__views__=[]}function D5(){var D=new wi(this.__wrapped__);return D.__actions__=Bc(this.__actions__),D.__dir__=this.__dir__,D.__filtered__=this.__filtered__,D.__iteratees__=Bc(this.__iteratees__),D.__takeCount__=this.__takeCount__,D.__views__=Bc(this.__views__),D}function p8(){if(this.__filtered__){var D=new wi(this);D.__dir__=-1,D.__filtered__=!0}else D=this.clone(),D.__dir__*=-1;return D}function B1(){var D=this.__wrapped__.value(),q=this.__dir__,be=Ci(D),He=q<0,gt=be?D.length:0,Yt=z8(0,gt,this.__views__),gn=Yt.start,Fn=Yt.end,Gn=Fn-gn,Tr=He?Fn:gn-1,Pr=this.__iteratees__,Ur=Pr.length,ls=0,Os=dc(Gn,this.__takeCount__);if(!be||!He&>==Gn&&Os==Gn)return G1(D,this.__actions__);var Ys=[];e:for(;Gn--&&ls<Os;){Tr+=q;for(var Oi=-1,Xs=D[Tr];++Oi<Ur;){var Wi=Pr[Oi],Xi=Wi.iteratee,Sf=Wi.type,qu=Xi(Xs);if(Sf==Y)Xs=qu;else if(!qu){if(Sf==pe)continue e;break e}}Ys[ls++]=Xs}return Ys}wi.prototype=D1(th.prototype),wi.prototype.constructor=wi;function lu(D){var q=-1,be=D==null?0:D.length;for(this.clear();++q<be;){var He=D[q];this.set(He[0],He[1])}}function qa(){this.__data__=M1?M1(null):{},this.size=0}function $a(D){var q=this.has(D)&&delete this.__data__[D];return this.size-=q?1:0,q}function Pm(D){var q=this.__data__;if(M1){var be=q[D];return be===c?n:be}return Ii.call(q,D)?q[D]:n}function hc(D){var q=this.__data__;return M1?q[D]!==n:Ii.call(q,D)}function cu(D,q){var be=this.__data__;return this.size+=this.has(D)?0:1,be[D]=M1&&q===n?c:q,this}lu.prototype.clear=qa,lu.prototype.delete=$a,lu.prototype.get=Pm,lu.prototype.has=hc,lu.prototype.set=cu;function Dc(D){var q=-1,be=D==null?0:D.length;for(this.clear();++q<be;){var He=D[q];this.set(He[0],He[1])}}function $1(){this.__data__=[],this.size=0}function uu(D){var q=this.__data__,be=mc(q,D);if(be<0)return!1;var He=q.length-1;return be==He?q.pop():P5.call(q,be,1),--this.size,!0}function B5(D){var q=this.__data__,be=mc(q,D);return be<0?n:q[be][1]}function TT(D){return mc(this.__data__,D)>-1}function IT(D,q){var be=this.__data__,He=mc(be,D);return He<0?(++this.size,be.push([D,q])):be[He][1]=q,this}Dc.prototype.clear=$1,Dc.prototype.delete=uu,Dc.prototype.get=B5,Dc.prototype.has=TT,Dc.prototype.set=IT;function wd(D){var q=-1,be=D==null?0:D.length;for(this.clear();++q<be;){var He=D[q];this.set(He[0],He[1])}}function PT(){this.size=0,this.__data__={hash:new lu,map:new(gx||Dc),string:new lu}}function gp(D){var q=q2(this,D).delete(D);return this.size-=q?1:0,q}function $5(D){return q2(this,D).get(D)}function m8(D){return q2(this,D).has(D)}function FT(D,q){var be=q2(this,D),He=be.size;return be.set(D,q),this.size+=be.size==He?0:1,this}wd.prototype.clear=PT,wd.prototype.delete=gp,wd.prototype.get=$5,wd.prototype.has=m8,wd.prototype.set=FT;function bx(D){var q=-1,be=D==null?0:D.length;for(this.__data__=new wd;++q<be;)this.add(D[q])}function Fm(D){return this.__data__.set(D,c),this}function U1(D){return this.__data__.has(D)}bx.prototype.add=bx.prototype.push=Fm,bx.prototype.has=U1;function pc(D){var q=this.__data__=new Dc(D);this.size=q.size}function U5(){this.__data__=new Dc,this.size=0}function z5(D){var q=this.__data__,be=q.delete(D);return this.size=q.size,be}function Cd(D){return this.__data__.get(D)}function Sd(D){return this.__data__.has(D)}function yx(D,q){var be=this.__data__;if(be instanceof Dc){var He=be.__data__;if(!gx||He.length<s-1)return He.push([D,q]),this.size=++be.size,this;be=this.__data__=new wd(He)}return be.set(D,q),this.size=be.size,this}pc.prototype.clear=U5,pc.prototype.delete=z5,pc.prototype.get=Cd,pc.prototype.has=Sd,pc.prototype.set=yx;function nh(D,q){var be=Ci(D),He=!be&&sv(D),gt=!be&&!He&&rb(D),Yt=!be&&!He&&!gt&&F6(D),gn=be||He||gt||Yt,Fn=gn?as(D.length,uc):[],Gn=Fn.length;for(var Tr in D)(q||Ii.call(D,Tr))&&!(gn&&(Tr=="length"||gt&&(Tr=="offset"||Tr=="parent")||Yt&&(Tr=="buffer"||Tr=="byteLength"||Tr=="byteOffset")||to(Tr,Gn)))&&Fn.push(Tr);return Fn}function rh(D){var q=D.length;return q?D[W1(0,q-1)]:n}function vx(D,q){return p6(Bc(D),bp(q,0,D.length))}function OT(D){return p6(Bc(D))}function I2(D,q,be){(be!==n&&!_p(D[q],be)||be===n&&!(q in D))&&sh(D,q,be)}function wx(D,q,be){var He=D[q];(!(Ii.call(D,q)&&_p(He,be))||be===n&&!(q in D))&&sh(D,q,be)}function mc(D,q){for(var be=D.length;be--;)if(_p(D[be][0],q))return be;return-1}function zu(D,q,be,He){return ah(D,function(gt,Yt,gn){q(He,gt,be(gt),gn)}),He}function Ga(D,q){return D&&mf(q,bc(q),D)}function pf(D,q){return D&&mf(q,Pd(q),D)}function sh(D,q,be){q=="__proto__"&&j2?j2(D,q,{configurable:!0,enumerable:!0,value:be,writable:!0}):D[q]=be}function H5(D,q){for(var be=-1,He=q.length,gt=Kt(He),Yt=D==null;++be<He;)gt[be]=Yt?n:QU(D,q[be]);return gt}function bp(D,q,be){return D===D&&(be!==n&&(D=D<=be?D:be),q!==n&&(D=D>=q?D:q)),D}function du(D,q,be,He,gt,Yt){var gn,Fn=q&f,Gn=q&x,Tr=q&g;if(be&&(gn=gt?be(D,He,gt,Yt):be(D)),gn!==n)return gn;if(!Lo(D))return D;var Pr=Ci(D);if(Pr){if(gn=K2(D),!Fn)return Bc(D,gn)}else{var Ur=Kl(D),ls=Ur==$e||Ur==it;if(rb(D))return T8(D,Fn);if(Ur==ct||Ur==ge||ls&&!gt){if(gn=Gn||ls?{}:Yl(D),!Fn)return Gn?IU(D,pf(gn,D)):n6(D,Ga(gn,D))}else{if(!nn[Ur])return gt?D:{};gn=PU(D,Ur,Fn)}}Yt||(Yt=new pc);var Os=Yt.get(D);if(Os)return Os;Yt.set(D,gn),Zue(D)?D.forEach(function(Xs){gn.add(du(Xs,q,be,Xs,D,Yt))}):Xue(D)&&D.forEach(function(Xs,Wi){gn.set(Wi,du(Xs,q,be,Wi,D,Yt))});var Ys=Tr?Gn?W2:V2:Gn?Pd:bc,Oi=Pr?n:Ys(D);return fr(Oi||D,function(Xs,Wi){Oi&&(Wi=Xs,Xs=D[Wi]),wx(gn,Wi,du(Xs,q,be,Wi,D,Yt))}),gn}function MT(D){var q=bc(D);return function(be){return P2(be,D,q)}}function P2(D,q,be){var He=be.length;if(D==null)return!He;for(D=ws(D);He--;){var gt=be[He],Yt=q[gt],gn=D[gt];if(gn===n&&!(gt in D)||!Yt(gn))return!1}return!0}function x8(D,q,be){if(typeof D!="function")throw new Za(o);return eb(function(){D.apply(n,be)},q)}function ih(D,q,be,He){var gt=-1,Yt=Or,gn=!0,Fn=D.length,Gn=[],Tr=q.length;if(!Fn)return Gn;be&&(q=Jn(q,ps(be))),He?(Yt=hr,gn=!1):q.length>=s&&(Yt=Ls,gn=!1,q=new bx(q));e:for(;++gt<Fn;){var Pr=D[gt],Ur=be==null?Pr:be(Pr);if(Pr=He||Pr!==0?Pr:0,gn&&Ur===Ur){for(var ls=Tr;ls--;)if(q[ls]===Ur)continue e;Gn.push(Pr)}else Yt(q,Ur,He)||Gn.push(Pr)}return Gn}var ah=_d(Hu),RT=_d(Om,!0);function F2(D,q){var be=!0;return ah(D,function(He,gt,Yt){return be=!!q(He,gt,Yt),be}),be}function Cx(D,q,be){for(var He=-1,gt=D.length;++He<gt;){var Yt=D[He],gn=q(Yt);if(gn!=null&&(Fn===n?gn===gn&&!Cf(gn):be(gn,Fn)))var Fn=gn,Gn=Yt}return Gn}function LT(D,q,be,He){var gt=D.length;for(be=Fi(be),be<0&&(be=-be>gt?0:gt+be),He=He===n||He>gt?gt:Fi(He),He<0&&(He+=gt),He=be>He?0:ede(He);be<He;)D[be++]=q;return D}function g8(D,q){var be=[];return ah(D,function(He,gt,Yt){q(He,gt,Yt)&&be.push(He)}),be}function So(D,q,be,He,gt){var Yt=-1,gn=D.length;for(be||(be=d6),gt||(gt=[]);++Yt<gn;){var Fn=D[Yt];q>0&&be(Fn)?q>1?So(Fn,q-1,be,He,gt):vs(gt,Fn):He||(gt[gt.length]=Fn)}return gt}var V5=s6(),O2=s6(!0);function Hu(D,q){return D&&V5(D,q,bc)}function Om(D,q){return D&&O2(D,q,bc)}function z1(D,q){return is(q,function(be){return Ox(D[be])})}function yp(D,q){q=ch(q,D);for(var be=0,He=q.length;D!=null&&be<He;)D=D[yf(q[be++])];return be&&be==He?D:n}function W5(D,q,be){var He=q(D);return Ci(D)?He:vs(He,be(D))}function ql(D){return D==null?D===n?Pt:ft:mx&&mx in ws(D)?u6(D):V8(D)}function Mm(D,q){return D>q}function Nd(D,q){return D!=null&&Ii.call(D,q)}function Sx(D,q){return D!=null&&q in ws(D)}function b8(D,q,be){return D>=dc(q,be)&&D<Wo(q,be)}function q5(D,q,be){for(var He=be?hr:Or,gt=D[0].length,Yt=D.length,gn=Yt,Fn=Kt(Yt),Gn=1/0,Tr=[];gn--;){var Pr=D[gn];gn&&q&&(Pr=Jn(Pr,ps(q))),Gn=dc(Pr.length,Gn),Fn[gn]=!be&&(q||gt>=120&&Pr.length>=120)?new bx(gn&&Pr):n}Pr=D[0];var Ur=-1,ls=Fn[0];e:for(;++Ur<gt&&Tr.length<Gn;){var Os=Pr[Ur],Ys=q?q(Os):Os;if(Os=be||Os!==0?Os:0,!(ls?Ls(ls,Ys):He(Tr,Ys,be))){for(gn=Yt;--gn;){var Oi=Fn[gn];if(!(Oi?Ls(Oi,Ys):He(D[gn],Ys,be)))continue e}ls&&ls.push(Ys),Tr.push(Os)}}return Tr}function vp(D,q,be,He){return Hu(D,function(gt,Yt,gn){q(He,be(gt),Yt,gn)}),He}function Ad(D,q,be){q=ch(q,D),D=Tl(D,q);var He=D==null?D:D[yf(zc(q))];return He==null?n:lr(He,D,be)}function G5(D){return Go(D)&&ql(D)==ge}function DT(D){return Go(D)&&ql(D)==Lt}function wp(D){return Go(D)&&ql(D)==Ie}function jd(D,q,be,He,gt){return D===q?!0:D==null||q==null||!Go(D)&&!Go(q)?D!==D&&q!==q:K5(D,q,be,He,jd,gt)}function K5(D,q,be,He,gt,Yt){var gn=Ci(D),Fn=Ci(q),Gn=gn?Ae:Kl(D),Tr=Fn?Ae:Kl(q);Gn=Gn==ge?ct:Gn,Tr=Tr==ge?ct:Tr;var Pr=Gn==ct,Ur=Tr==ct,ls=Gn==Tr;if(ls&&rb(D)){if(!rb(q))return!1;gn=!0,Pr=!1}if(ls&&!Pr)return Yt||(Yt=new pc),gn||F6(D)?$8(D,q,be,He,gt,Yt):U8(D,q,Gn,be,He,gt,Yt);if(!(be&v)){var Os=Pr&&Ii.call(D,"__wrapped__"),Ys=Ur&&Ii.call(q,"__wrapped__");if(Os||Ys){var Oi=Os?D.value():D,Xs=Ys?q.value():q;return Yt||(Yt=new pc),gt(Oi,Xs,be,He,Yt)}}return ls?(Yt||(Yt=new pc),YT(D,q,be,He,gt,Yt)):!1}function BT(D){return Go(D)&&Kl(D)==tt}function H1(D,q,be,He){var gt=be.length,Yt=gt,gn=!He;if(D==null)return!Yt;for(D=ws(D);gt--;){var Fn=be[gt];if(gn&&Fn[2]?Fn[1]!==D[Fn[0]]:!(Fn[0]in D))return!1}for(;++gt<Yt;){Fn=be[gt];var Gn=Fn[0],Tr=D[Gn],Pr=Fn[1];if(gn&&Fn[2]){if(Tr===n&&!(Gn in D))return!1}else{var Ur=new pc;if(He)var ls=He(Tr,Pr,Gn,D,q,Ur);if(!(ls===n?jd(Pr,Tr,v|w,He,Ur):ls))return!1}}return!0}function y8(D){if(!Lo(D)||ZT(D))return!1;var q=Ox(D)?AT:rr;return q.test(Bm(D))}function M2(D){return Go(D)&&ql(D)==an}function oh(D){return Go(D)&&Kl(D)==Nt}function R2(D){return Go(D)&&gI(D.length)&&!!Ht[ql(D)]}function V1(D){return typeof D=="function"?D:D==null?Fd:typeof D=="object"?Ci(D)?eo(D[0],D[1]):Y5(D):dde(D)}function Cp(D){if(!jp(D))return O1(D);var q=[];for(var be in ws(D))Ii.call(D,be)&&be!="constructor"&&q.push(be);return q}function v8(D){if(!Lo(D))return tI(D);var q=jp(D),be=[];for(var He in D)He=="constructor"&&(q||!Ii.call(D,He))||be.push(He);return be}function Rm(D,q){return D<q}function w8(D,q){var be=-1,He=Id(D)?Kt(D.length):[];return ah(D,function(gt,Yt,gn){He[++be]=q(gt,Yt,gn)}),He}function Y5(D){var q=G2(D);return q.length==1&&q[0][2]?f6(q[0][0],q[0][1]):function(be){return be===D||H1(be,D,q)}}function eo(D,q){return gs(D)&&X2(q)?f6(yf(D),q):function(be){var He=QU(be,D);return He===n&&He===q?ZU(be,D):jd(q,He,v|w)}}function Nx(D,q,be,He,gt){D!==q&&V5(q,function(Yt,gn){if(gt||(gt=new pc),Lo(Yt))C8(D,q,gn,be,Nx,He,gt);else{var Fn=He?He(fh(D,gn),Yt,gn+"",D,q,gt):n;Fn===n&&(Fn=Yt),I2(D,gn,Fn)}},Pd)}function C8(D,q,be,He,gt,Yt,gn){var Fn=fh(D,be),Gn=fh(q,be),Tr=gn.get(Gn);if(Tr){I2(D,be,Tr);return}var Pr=Yt?Yt(Fn,Gn,be+"",D,q,gn):n,Ur=Pr===n;if(Ur){var ls=Ci(Gn),Os=!ls&&rb(Gn),Ys=!ls&&!Os&&F6(Gn);Pr=Gn,ls||Os||Ys?Ci(Fn)?Pr=Fn:dl(Fn)?Pr=Bc(Fn):Os?(Ur=!1,Pr=T8(Gn,!0)):Ys?(Ur=!1,Pr=VT(Gn,!0)):Pr=[]:l7(Gn)||sv(Gn)?(Pr=Fn,sv(Fn)?Pr=tde(Fn):(!Lo(Fn)||Ox(Fn))&&(Pr=Yl(Gn))):Ur=!1}Ur&&(gn.set(Gn,Pr),gt(Pr,Gn,He,Yt,gn),gn.delete(Gn)),I2(D,be,Pr)}function X5(D,q){var be=D.length;if(be)return q+=q<0?be:0,to(q,be)?D[q]:n}function L2(D,q,be){q.length?q=Jn(q,function(Yt){return Ci(Yt)?function(gn){return yp(gn,Yt.length===1?Yt[0]:Yt)}:Yt}):q=[Fd];var He=-1;q=Jn(q,ps(Hs()));var gt=w8(D,function(Yt,gn,Fn){var Gn=Jn(q,function(Tr){return Tr(Yt)});return{criteria:Gn,index:++He,value:Yt}});return Hn(gt,function(Yt,gn){return TU(Yt,gn,be)})}function S8(D,q){return Lm(D,q,function(be,He){return ZU(D,He)})}function Lm(D,q,be){for(var He=-1,gt=q.length,Yt={};++He<gt;){var gn=q[He],Fn=yp(D,gn);be(Fn,gn)&&jx(Yt,ch(gn,D),Fn)}return Yt}function fo(D){return function(q){return yp(q,D)}}function Ro(D,q,be,He){var gt=He?kr:qn,Yt=-1,gn=q.length,Fn=D;for(D===q&&(q=Bc(q)),be&&(Fn=Jn(D,ps(be)));++Yt<gn;)for(var Gn=0,Tr=q[Yt],Pr=be?be(Tr):Tr;(Gn=gt(Fn,Pr,Gn,He))>-1;)Fn!==D&&P5.call(Fn,Gn,1),P5.call(D,Gn,1);return D}function ll(D,q){for(var be=D?q.length:0,He=be-1;be--;){var gt=q[be];if(be==He||gt!==Yt){var Yt=gt;to(gt)?P5.call(D,gt,1):J5(D,gt)}}return D}function W1(D,q){return D+_m(E2()*(q-D+1))}function D2(D,q,be,He){for(var gt=-1,Yt=Wo(xx((q-D)/(be||1)),0),gn=Kt(Yt);Yt--;)gn[He?Yt:++gt]=D,D+=be;return gn}function Ax(D,q){var be="";if(!D||q<1||q>G)return be;do q%2&&(be+=D),q=_m(q/2),q&&(D+=D);while(q);return be}function Pi(D,q){return Vu(h6(D,q,Fd),D+"")}function xc(D){return rh(O6(D))}function N8(D,q){var be=O6(D);return p6(be,bp(q,0,be.length))}function jx(D,q,be,He){if(!Lo(D))return D;q=ch(q,D);for(var gt=-1,Yt=q.length,gn=Yt-1,Fn=D;Fn!=null&&++gt<Yt;){var Gn=yf(q[gt]),Tr=be;if(Gn==="__proto__"||Gn==="constructor"||Gn==="prototype")return D;if(gt!=gn){var Pr=Fn[Gn];Tr=He?He(Pr,Gn,Fn):n,Tr===n&&(Tr=Lo(Pr)?Pr:to(q[gt+1])?[]:{})}wx(Fn,Gn,Tr),Fn=Fn[Gn]}return D}var Q5=R5?function(D,q){return R5.set(D,q),D}:Fd,lh=j2?function(D,q){return j2(D,"toString",{configurable:!0,enumerable:!1,value:ez(q),writable:!0})}:Fd;function Ed(D){return p6(O6(D))}function gc(D,q,be){var He=-1,gt=D.length;q<0&&(q=-q>gt?0:gt+q),be=be>gt?gt:be,be<0&&(be+=gt),gt=q>be?0:be-q>>>0,q>>>=0;for(var Yt=Kt(gt);++He<gt;)Yt[He]=D[He+q];return Yt}function A8(D,q){var be;return ah(D,function(He,gt,Yt){return be=q(He,gt,Yt),!be}),!!be}function q1(D,q,be){var He=0,gt=D==null?He:D.length;if(typeof q=="number"&&q===q&><=Ce){for(;He<gt;){var Yt=He+gt>>>1,gn=D[Yt];gn!==null&&!Cf(gn)&&(be?gn<=q:gn<q)?He=Yt+1:gt=Yt}return gt}return Z5(D,q,Fd,be)}function Z5(D,q,be,He){var gt=0,Yt=D==null?0:D.length;if(Yt===0)return 0;q=be(q);for(var gn=q!==q,Fn=q===null,Gn=Cf(q),Tr=q===n;gt<Yt;){var Pr=_m((gt+Yt)/2),Ur=be(D[Pr]),ls=Ur!==n,Os=Ur===null,Ys=Ur===Ur,Oi=Cf(Ur);if(gn)var Xs=He||Ys;else Tr?Xs=Ys&&(He||ls):Fn?Xs=Ys&&ls&&(He||!Os):Gn?Xs=Ys&&ls&&!Os&&(He||!Oi):Os||Oi?Xs=!1:Xs=He?Ur<=q:Ur<q;Xs?gt=Pr+1:Yt=Pr}return dc(Yt,he)}function j8(D,q){for(var be=-1,He=D.length,gt=0,Yt=[];++be<He;){var gn=D[be],Fn=q?q(gn):gn;if(!be||!_p(Fn,Gn)){var Gn=Fn;Yt[gt++]=gn===0?0:gn}}return Yt}function E8(D){return typeof D=="number"?D:Cf(D)?te:+D}function fu(D){if(typeof D=="string")return D;if(Ci(D))return Jn(D,fu)+"";if(Cf(D))return L5?L5.call(D):"";var q=D+"";return q=="0"&&1/D==-1/0?"-0":q}function Sp(D,q,be){var He=-1,gt=Or,Yt=D.length,gn=!0,Fn=[],Gn=Fn;if(be)gn=!1,gt=hr;else if(Yt>=s){var Tr=q?null:KT(D);if(Tr)return y(Tr);gn=!1,gt=Ls,Gn=new bx}else Gn=q?[]:Fn;e:for(;++He<Yt;){var Pr=D[He],Ur=q?q(Pr):Pr;if(Pr=be||Pr!==0?Pr:0,gn&&Ur===Ur){for(var ls=Gn.length;ls--;)if(Gn[ls]===Ur)continue e;q&&Gn.push(Ur),Fn.push(Pr)}else gt(Gn,Ur,be)||(Gn!==Fn&&Gn.push(Ur),Fn.push(Pr))}return Fn}function J5(D,q){return q=ch(q,D),D=Tl(D,q),D==null||delete D[yf(zc(q))]}function _8(D,q,be,He){return jx(D,q,be(yp(D,q)),He)}function B2(D,q,be,He){for(var gt=D.length,Yt=He?gt:-1;(He?Yt--:++Yt<gt)&&q(D[Yt],Yt,D););return be?gc(D,He?0:Yt,He?Yt+1:gt):gc(D,He?Yt+1:0,He?gt:Yt)}function G1(D,q){var be=D;return be instanceof wi&&(be=be.value()),si(q,function(He,gt){return gt.func.apply(gt.thisArg,vs([He],gt.args))},be)}function e6(D,q,be){var He=D.length;if(He<2)return He?Sp(D[0]):[];for(var gt=-1,Yt=Kt(He);++gt<He;)for(var gn=D[gt],Fn=-1;++Fn<He;)Fn!=gt&&(Yt[gt]=ih(Yt[gt]||gn,D[Fn],q,be));return Sp(So(Yt,1),q,be)}function $2(D,q,be){for(var He=-1,gt=D.length,Yt=q.length,gn={};++He<gt;){var Fn=He<Yt?q[He]:n;be(gn,D[He],Fn)}return gn}function K1(D){return dl(D)?D:[]}function t6(D){return typeof D=="function"?D:Fd}function ch(D,q){return Ci(D)?D:gs(D,q)?[D]:G8(ka(D))}var $T=Pi;function Np(D,q,be){var He=D.length;return be=be===n?He:be,!q&&be>=He?D:gc(D,q,be)}var k8=ET||function(D){return _r.clearTimeout(D)};function T8(D,q){if(q)return D.slice();var be=D.length,He=u8?u8(be):new D.constructor(be);return D.copy(He),He}function U2(D){var q=new D.constructor(D.byteLength);return new A2(q).set(new A2(D)),q}function UT(D,q){var be=q?U2(D.buffer):D.buffer;return new D.constructor(be,D.byteOffset,D.byteLength)}function zT(D){var q=new D.constructor(D.source,Tn.exec(D));return q.lastIndex=D.lastIndex,q}function HT(D){return Uu?ws(Uu.call(D)):{}}function VT(D,q){var be=q?U2(D.buffer):D.buffer;return new D.constructor(be,D.byteOffset,D.length)}function I8(D,q){if(D!==q){var be=D!==n,He=D===null,gt=D===D,Yt=Cf(D),gn=q!==n,Fn=q===null,Gn=q===q,Tr=Cf(q);if(!Fn&&!Tr&&!Yt&&D>q||Yt&&gn&&Gn&&!Fn&&!Tr||He&&gn&&Gn||!be&&Gn||!gt)return 1;if(!He&&!Yt&&!Tr&&D<q||Tr&&be&>&&!He&&!Yt||Fn&&be&>||!gn&>||!Gn)return-1}return 0}function TU(D,q,be){for(var He=-1,gt=D.criteria,Yt=q.criteria,gn=gt.length,Fn=be.length;++He<gn;){var Gn=I8(gt[He],Yt[He]);if(Gn){if(He>=Fn)return Gn;var Tr=be[He];return Gn*(Tr=="desc"?-1:1)}}return D.index-q.index}function WT(D,q,be,He){for(var gt=-1,Yt=D.length,gn=be.length,Fn=-1,Gn=q.length,Tr=Wo(Yt-gn,0),Pr=Kt(Gn+Tr),Ur=!He;++Fn<Gn;)Pr[Fn]=q[Fn];for(;++gt<gn;)(Ur||gt<Yt)&&(Pr[be[gt]]=D[gt]);for(;Tr--;)Pr[Fn++]=D[gt++];return Pr}function P8(D,q,be,He){for(var gt=-1,Yt=D.length,gn=-1,Fn=be.length,Gn=-1,Tr=q.length,Pr=Wo(Yt-Fn,0),Ur=Kt(Pr+Tr),ls=!He;++gt<Pr;)Ur[gt]=D[gt];for(var Os=gt;++Gn<Tr;)Ur[Os+Gn]=q[Gn];for(;++gn<Fn;)(ls||gt<Yt)&&(Ur[Os+be[gn]]=D[gt++]);return Ur}function Bc(D,q){var be=-1,He=D.length;for(q||(q=Kt(He));++be<He;)q[be]=D[be];return q}function mf(D,q,be,He){var gt=!be;be||(be={});for(var Yt=-1,gn=q.length;++Yt<gn;){var Fn=q[Yt],Gn=He?He(be[Fn],D[Fn],Fn,be,D):n;Gn===n&&(Gn=D[Fn]),gt?sh(be,Fn,Gn):wx(be,Fn,Gn)}return be}function n6(D,q){return mf(D,xf(D),q)}function IU(D,q){return mf(D,XT(D),q)}function r6(D,q){return function(be,He){var gt=Ci(be)?Nr:zu,Yt=q?q():{};return gt(be,D,Hs(He,2),Yt)}}function Y1(D){return Pi(function(q,be){var He=-1,gt=be.length,Yt=gt>1?be[gt-1]:n,gn=gt>2?be[2]:n;for(Yt=D.length>3&&typeof Yt=="function"?(gt--,Yt):n,gn&&Uc(be[0],be[1],gn)&&(Yt=gt<3?n:Yt,gt=1),q=ws(q);++He<gt;){var Fn=be[He];Fn&&D(q,Fn,He,Yt)}return q})}function _d(D,q){return function(be,He){if(be==null)return be;if(!Id(be))return D(be,He);for(var gt=be.length,Yt=q?gt:-1,gn=ws(be);(q?Yt--:++Yt<gt)&&He(gn[Yt],Yt,gn)!==!1;);return be}}function s6(D){return function(q,be,He){for(var gt=-1,Yt=ws(q),gn=He(q),Fn=gn.length;Fn--;){var Gn=gn[D?Fn:++gt];if(be(Yt[Gn],Gn,Yt)===!1)break}return q}}function i6(D,q,be){var He=q&C,gt=X1(D);function Yt(){var gn=this&&this!==_r&&this instanceof Yt?gt:D;return gn.apply(He?be:this,arguments)}return Yt}function F8(D){return function(q){q=ka(q);var be=kl(q)?K(q):n,He=be?be[0]:q.charAt(0),gt=be?Np(be,1).join(""):q.slice(1);return He[D]()+gt}}function Ex(D){return function(q){return si(cde(lde(q).replace(In,"")),D,"")}}function X1(D){return function(){var q=arguments;switch(q.length){case 0:return new D;case 1:return new D(q[0]);case 2:return new D(q[0],q[1]);case 3:return new D(q[0],q[1],q[2]);case 4:return new D(q[0],q[1],q[2],q[3]);case 5:return new D(q[0],q[1],q[2],q[3],q[4]);case 6:return new D(q[0],q[1],q[2],q[3],q[4],q[5]);case 7:return new D(q[0],q[1],q[2],q[3],q[4],q[5],q[6])}var be=D1(D.prototype),He=D.apply(be,q);return Lo(He)?He:be}}function O8(D,q,be){var He=X1(D);function gt(){for(var Yt=arguments.length,gn=Kt(Yt),Fn=Yt,Gn=Ap(gt);Fn--;)gn[Fn]=arguments[Fn];var Tr=Yt<3&&gn[0]!==Gn&&gn[Yt-1]!==Gn?[]:dt(gn,Gn);if(Yt-=Tr.length,Yt<be)return $c(D,q,Q1,gt.placeholder,n,gn,Tr,n,n,be-Yt);var Pr=this&&this!==_r&&this instanceof gt?He:D;return lr(Pr,this,gn)}return gt}function _x(D){return function(q,be,He){var gt=ws(q);if(!Id(q)){var Yt=Hs(be,3);q=bc(q),be=function(Fn){return Yt(gt[Fn],Fn,gt)}}var gn=D(q,be,He);return gn>-1?gt[Yt?q[gn]:gn]:n}}function a6(D){return dh(function(q){var be=q.length,He=be,gt=fc.prototype.thru;for(D&&q.reverse();He--;){var Yt=q[He];if(typeof Yt!="function")throw new Za(o);if(gt&&!gn&&Z1(Yt)=="wrapper")var gn=new fc([],!0)}for(He=gn?He:be;++He<be;){Yt=q[He];var Fn=Z1(Yt),Gn=Fn=="wrapper"?c6(Yt):n;Gn&&Y2(Gn[0])&&Gn[1]==(L|P|F|z)&&!Gn[4].length&&Gn[9]==1?gn=gn[Z1(Gn[0])].apply(gn,Gn[3]):gn=Yt.length==1&&Y2(Yt)?gn[Fn]():gn.thru(Yt)}return function(){var Tr=arguments,Pr=Tr[0];if(gn&&Tr.length==1&&Ci(Pr))return gn.plant(Pr).value();for(var Ur=0,ls=be?q[Ur].apply(this,Tr):Pr;++Ur<be;)ls=q[Ur].call(this,ls);return ls}})}function Q1(D,q,be,He,gt,Yt,gn,Fn,Gn,Tr){var Pr=q&L,Ur=q&C,ls=q&N,Os=q&(P|R),Ys=q&Q,Oi=ls?n:X1(D);function Xs(){for(var Wi=arguments.length,Xi=Kt(Wi),Sf=Wi;Sf--;)Xi[Sf]=arguments[Sf];if(Os)var qu=Ap(Xs),Nf=ga(Xi,qu);if(He&&(Xi=WT(Xi,He,gt,Os)),Yt&&(Xi=P8(Xi,Yt,gn,Os)),Wi-=Nf,Os&&Wi<Tr){var fl=dt(Xi,qu);return $c(D,q,Q1,Xs.placeholder,be,Xi,fl,Fn,Gn,Tr-Wi)}var kp=Ur?be:this,Rx=ls?kp[D]:D;return Wi=Xi.length,Fn?Xi=gf(Xi,Fn):Ys&&Wi>1&&Xi.reverse(),Pr&&Gn<Wi&&(Xi.length=Gn),this&&this!==_r&&this instanceof Xs&&(Rx=Oi||X1(Rx)),Rx.apply(kp,Xi)}return Xs}function qT(D,q){return function(be,He){return vp(be,D,q(He),{})}}function z2(D,q){return function(be,He){var gt;if(be===n&&He===n)return q;if(be!==n&&(gt=be),He!==n){if(gt===n)return He;typeof be=="string"||typeof He=="string"?(be=fu(be),He=fu(He)):(be=E8(be),He=E8(He)),gt=D(be,He)}return gt}}function o6(D){return dh(function(q){return q=Jn(q,ps(Hs())),Pi(function(be){var He=this;return D(q,function(gt){return lr(gt,He,be)})})})}function H2(D,q){q=q===n?" ":fu(q);var be=q.length;if(be<2)return be?Ax(q,D):q;var He=Ax(q,xx(D/H(q)));return kl(q)?Np(K(He),0,D).join(""):He.slice(0,D)}function GT(D,q,be,He){var gt=q&C,Yt=X1(D);function gn(){for(var Fn=-1,Gn=arguments.length,Tr=-1,Pr=He.length,Ur=Kt(Pr+Gn),ls=this&&this!==_r&&this instanceof gn?Yt:D;++Tr<Pr;)Ur[Tr]=He[Tr];for(;Gn--;)Ur[Tr++]=arguments[++Fn];return lr(ls,gt?be:this,Ur)}return gn}function M8(D){return function(q,be,He){return He&&typeof He!="number"&&Uc(q,be,He)&&(be=He=n),q=Mx(q),be===n?(be=q,q=0):be=Mx(be),He=He===n?q<be?1:-1:Mx(He),D2(q,be,He,D)}}function l6(D){return function(q,be){return typeof q=="string"&&typeof be=="string"||(q=hh(q),be=hh(be)),D(q,be)}}function $c(D,q,be,He,gt,Yt,gn,Fn,Gn,Tr){var Pr=q&P,Ur=Pr?gn:n,ls=Pr?n:gn,Os=Pr?Yt:n,Ys=Pr?n:Yt;q|=Pr?F:U,q&=~(Pr?U:F),q&I||(q&=-4);var Oi=[D,q,gt,Os,Ur,Ys,ls,Fn,Gn,Tr],Xs=be.apply(n,Oi);return Y2(D)&&W8(Xs,Oi),Xs.placeholder=He,q8(Xs,D,q)}function Gl(D){var q=wr[D];return function(be,He){if(be=hh(be),He=He==null?0:dc(Fi(He),292),He&&F1(be)){var gt=(ka(be)+"e").split("e"),Yt=q(gt[0]+"e"+(+gt[1]+He));return gt=(ka(Yt)+"e").split("e"),+(gt[0]+"e"+(+gt[1]-He))}return q(be)}}var KT=km&&1/y(new km([,-0]))[1]==oe?function(D){return new km(D)}:rz;function R8(D){return function(q){var be=Kl(q);return be==tt?xi(q):be==Nt?E(q):rs(q,D(q))}}function uh(D,q,be,He,gt,Yt,gn,Fn){var Gn=q&N;if(!Gn&&typeof D!="function")throw new Za(o);var Tr=He?He.length:0;if(Tr||(q&=-97,He=gt=n),gn=gn===n?gn:Wo(Fi(gn),0),Fn=Fn===n?Fn:Fi(Fn),Tr-=gt?gt.length:0,q&U){var Pr=He,Ur=gt;He=gt=n}var ls=Gn?n:c6(D),Os=[D,q,be,He,gt,Pr,Ur,Yt,gn,Fn];if(ls&&eI(Os,ls),D=Os[0],q=Os[1],be=Os[2],He=Os[3],gt=Os[4],Fn=Os[9]=Os[9]===n?Gn?0:D.length:Wo(Os[9]-Tr,0),!Fn&&q&(P|R)&&(q&=-25),!q||q==C)var Ys=i6(D,q,be);else q==P||q==R?Ys=O8(D,q,Fn):(q==F||q==(C|F))&&!gt.length?Ys=GT(D,q,be,He):Ys=Q1.apply(n,Os);var Oi=ls?Q5:W8;return q8(Oi(Ys,Os),D,q)}function L8(D,q,be,He){return D===n||_p(D,_a[be])&&!Ii.call(He,be)?q:D}function D8(D,q,be,He,gt,Yt){return Lo(D)&&Lo(q)&&(Yt.set(q,D),Nx(D,q,n,D8,Yt),Yt.delete(q)),D}function B8(D){return l7(D)?n:D}function $8(D,q,be,He,gt,Yt){var gn=be&v,Fn=D.length,Gn=q.length;if(Fn!=Gn&&!(gn&&Gn>Fn))return!1;var Tr=Yt.get(D),Pr=Yt.get(q);if(Tr&&Pr)return Tr==q&&Pr==D;var Ur=-1,ls=!0,Os=be&w?new bx:n;for(Yt.set(D,q),Yt.set(q,D);++Ur<Fn;){var Ys=D[Ur],Oi=q[Ur];if(He)var Xs=gn?He(Oi,Ys,Ur,q,D,Yt):He(Ys,Oi,Ur,D,q,Yt);if(Xs!==n){if(Xs)continue;ls=!1;break}if(Os){if(!Er(q,function(Wi,Xi){if(!Ls(Os,Xi)&&(Ys===Wi||gt(Ys,Wi,be,He,Yt)))return Os.push(Xi)})){ls=!1;break}}else if(!(Ys===Oi||gt(Ys,Oi,be,He,Yt))){ls=!1;break}}return Yt.delete(D),Yt.delete(q),ls}function U8(D,q,be,He,gt,Yt,gn){switch(be){case qe:if(D.byteLength!=q.byteLength||D.byteOffset!=q.byteOffset)return!1;D=D.buffer,q=q.buffer;case Lt:return!(D.byteLength!=q.byteLength||!Yt(new A2(D),new A2(q)));case je:case Ie:case ot:return _p(+D,+q);case Qe:return D.name==q.name&&D.message==q.message;case an:case mn:return D==q+"";case tt:var Fn=xi;case Nt:var Gn=He&v;if(Fn||(Fn=y),D.size!=q.size&&!Gn)return!1;var Tr=gn.get(D);if(Tr)return Tr==q;He|=w,gn.set(D,q);var Pr=$8(Fn(D),Fn(q),He,gt,Yt,gn);return gn.delete(D),Pr;case dn:if(Uu)return Uu.call(D)==Uu.call(q)}return!1}function YT(D,q,be,He,gt,Yt){var gn=be&v,Fn=V2(D),Gn=Fn.length,Tr=V2(q),Pr=Tr.length;if(Gn!=Pr&&!gn)return!1;for(var Ur=Gn;Ur--;){var ls=Fn[Ur];if(!(gn?ls in q:Ii.call(q,ls)))return!1}var Os=Yt.get(D),Ys=Yt.get(q);if(Os&&Ys)return Os==q&&Ys==D;var Oi=!0;Yt.set(D,q),Yt.set(q,D);for(var Xs=gn;++Ur<Gn;){ls=Fn[Ur];var Wi=D[ls],Xi=q[ls];if(He)var Sf=gn?He(Xi,Wi,ls,q,D,Yt):He(Wi,Xi,ls,D,q,Yt);if(!(Sf===n?Wi===Xi||gt(Wi,Xi,be,He,Yt):Sf)){Oi=!1;break}Xs||(Xs=ls=="constructor")}if(Oi&&!Xs){var qu=D.constructor,Nf=q.constructor;qu!=Nf&&"constructor"in D&&"constructor"in q&&!(typeof qu=="function"&&qu instanceof qu&&typeof Nf=="function"&&Nf instanceof Nf)&&(Oi=!1)}return Yt.delete(D),Yt.delete(q),Oi}function dh(D){return Vu(h6(D,n,x6),D+"")}function V2(D){return W5(D,bc,xf)}function W2(D){return W5(D,Pd,XT)}var c6=R5?function(D){return R5.get(D)}:rz;function Z1(D){for(var q=D.name+"",be=R1[q],He=Ii.call(R1,q)?be.length:0;He--;){var gt=be[He],Yt=gt.func;if(Yt==null||Yt==D)return gt.name}return q}function Ap(D){var q=Ii.call(Ot,"placeholder")?Ot:D;return q.placeholder}function Hs(){var D=Ot.iteratee||tz;return D=D===tz?V1:D,arguments.length?D(arguments[0],arguments[1]):D}function q2(D,q){var be=D.__data__;return J1(q)?be[typeof q=="string"?"string":"hash"]:be.map}function G2(D){for(var q=bc(D),be=q.length;be--;){var He=q[be],gt=D[He];q[be]=[He,gt,X2(gt)]}return q}function Dm(D,q){var be=ba(D,q);return y8(be)?be:n}function u6(D){var q=Ii.call(D,mx),be=D[mx];try{D[mx]=n;var He=!0}catch{}var gt=S2.call(D);return He&&(q?D[mx]=be:delete D[mx]),gt}var xf=F5?function(D){return D==null?[]:(D=ws(D),is(F5(D),function(q){return I5.call(D,q)}))}:sz,XT=F5?function(D){for(var q=[];D;)vs(q,xf(D)),D=hf(D);return q}:sz,Kl=ql;(_2&&Kl(new _2(new ArrayBuffer(1)))!=qe||gx&&Kl(new gx)!=tt||k2&&Kl(k2.resolve())!=Vt||km&&Kl(new km)!=Nt||T2&&Kl(new T2)!=Xe)&&(Kl=function(D){var q=ql(D),be=q==ct?D.constructor:n,He=be?Bm(be):"";if(He)switch(He){case h8:return qe;case Tm:return tt;case kT:return Vt;case L1:return Nt;case eh:return Xe}return q});function z8(D,q,be){for(var He=-1,gt=be.length;++He<gt;){var Yt=be[He],gn=Yt.size;switch(Yt.type){case"drop":D+=gn;break;case"dropRight":q-=gn;break;case"take":q=dc(q,D+gn);break;case"takeRight":D=Wo(D,q-gn);break}}return{start:D,end:q}}function QT(D){var q=D.match(cn);return q?q[1].split(_t):[]}function H8(D,q,be){q=ch(q,D);for(var He=-1,gt=q.length,Yt=!1;++He<gt;){var gn=yf(q[He]);if(!(Yt=D!=null&&be(D,gn)))break;D=D[gn]}return Yt||++He!=gt?Yt:(gt=D==null?0:D.length,!!gt&&gI(gt)&&to(gn,gt)&&(Ci(D)||sv(D)))}function K2(D){var q=D.length,be=new D.constructor(q);return q&&typeof D[0]=="string"&&Ii.call(D,"index")&&(be.index=D.index,be.input=D.input),be}function Yl(D){return typeof D.constructor=="function"&&!jp(D)?D1(hf(D)):{}}function PU(D,q,be){var He=D.constructor;switch(q){case Lt:return U2(D);case je:case Ie:return new He(+D);case qe:return UT(D,be);case Ke:case pt:case en:case Bt:case Et:case et:case Be:case Mt:case Ve:return VT(D,be);case tt:return new He;case ot:case mn:return new He(D);case an:return zT(D);case Nt:return new He;case dn:return HT(D)}}function FU(D,q){var be=q.length;if(!be)return D;var He=be-1;return q[He]=(be>1?"& ":"")+q[He],q=q.join(be>2?", ":" "),D.replace(rn,`{
/* [wrapped with `+q+`] */
`)}function d6(D){return Ci(D)||sv(D)||!!(jT&&D&&D[jT])}function to(D,q){var be=typeof D;return q=q??G,!!q&&(be=="number"||be!="symbol"&&Un.test(D))&&D>-1&&D%1==0&&D<q}function Uc(D,q,be){if(!Lo(be))return!1;var He=typeof q;return(He=="number"?Id(be)&&to(q,be.length):He=="string"&&q in be)?_p(be[q],D):!1}function gs(D,q){if(Ci(D))return!1;var be=typeof D;return be=="number"||be=="symbol"||be=="boolean"||D==null||Cf(D)?!0:zn.test(D)||!Zn.test(D)||q!=null&&D in ws(q)}function J1(D){var q=typeof D;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?D!=="__proto__":D===null}function Y2(D){var q=Z1(D),be=Ot[q];if(typeof be!="function"||!(q in wi.prototype))return!1;if(D===be)return!0;var He=c6(be);return!!He&&D===He[0]}function ZT(D){return!!P1&&P1 in D}var OU=Vo?Ox:iz;function jp(D){var q=D&&D.constructor,be=typeof q=="function"&&q.prototype||_a;return D===be}function X2(D){return D===D&&!Lo(D)}function f6(D,q){return function(be){return be==null?!1:be[D]===q&&(q!==n||D in ws(be))}}function JT(D){var q=Gr(D,function(He){return be.size===u&&be.clear(),He}),be=q.cache;return q}function eI(D,q){var be=D[1],He=q[1],gt=be|He,Yt=gt<(C|N|L),gn=He==L&&be==P||He==L&&be==z&&D[7].length<=q[8]||He==(L|z)&&q[7].length<=q[8]&&be==P;if(!(Yt||gn))return D;He&C&&(D[2]=q[2],gt|=be&C?0:I);var Fn=q[3];if(Fn){var Gn=D[3];D[3]=Gn?WT(Gn,Fn,q[4]):Fn,D[4]=Gn?dt(D[3],d):q[4]}return Fn=q[5],Fn&&(Gn=D[5],D[5]=Gn?P8(Gn,Fn,q[6]):Fn,D[6]=Gn?dt(D[5],d):q[6]),Fn=q[7],Fn&&(D[7]=Fn),He&L&&(D[8]=D[8]==null?q[8]:dc(D[8],q[8])),D[9]==null&&(D[9]=q[9]),D[0]=q[0],D[1]=gt,D}function tI(D){var q=[];if(D!=null)for(var be in ws(D))q.push(be);return q}function V8(D){return S2.call(D)}function h6(D,q,be){return q=Wo(q===n?D.length-1:q,0),function(){for(var He=arguments,gt=-1,Yt=Wo(He.length-q,0),gn=Kt(Yt);++gt<Yt;)gn[gt]=He[q+gt];gt=-1;for(var Fn=Kt(q+1);++gt<q;)Fn[gt]=He[gt];return Fn[q]=be(gn),lr(D,this,Fn)}}function Tl(D,q){return q.length<2?D:yp(D,gc(q,0,-1))}function gf(D,q){for(var be=D.length,He=dc(q.length,be),gt=Bc(D);He--;){var Yt=q[He];D[He]=to(Yt,be)?gt[Yt]:n}return D}function fh(D,q){if(!(q==="constructor"&&typeof D[q]=="function")&&q!="__proto__")return D[q]}var W8=bf(Q5),eb=d8||function(D,q){return _r.setTimeout(D,q)},Vu=bf(lh);function q8(D,q,be){var He=q+"";return Vu(D,FU(He,nI(QT(He),be)))}function bf(D){var q=0,be=0;return function(){var He=kU(),gt=re-(He-be);if(be=He,gt>0){if(++q>=X)return arguments[0]}else q=0;return D.apply(n,arguments)}}function p6(D,q){var be=-1,He=D.length,gt=He-1;for(q=q===n?He:q;++be<q;){var Yt=W1(be,gt),gn=D[Yt];D[Yt]=D[be],D[be]=gn}return D.length=q,D}var G8=JT(function(D){var q=[];return D.charCodeAt(0)===46&&q.push(""),D.replace($n,function(be,He,gt,Yt){q.push(gt?Yt.replace(Dt,"$1"):He||be)}),q});function yf(D){if(typeof D=="string"||Cf(D))return D;var q=D+"";return q=="0"&&1/D==-1/0?"-0":q}function Bm(D){if(D!=null){try{return vd.call(D)}catch{}try{return D+""}catch{}}return""}function nI(D,q){return fr(ce,function(be){var He="_."+be[0];q&be[1]&&!Or(D,He)&&D.push(He)}),D.sort()}function rI(D){if(D instanceof wi)return D.clone();var q=new fc(D.__wrapped__,D.__chain__);return q.__actions__=Bc(D.__actions__),q.__index__=D.__index__,q.__values__=D.__values__,q}function m6(D,q,be){(be?Uc(D,q,be):q===n)?q=1:q=Wo(Fi(q),0);var He=D==null?0:D.length;if(!He||q<1)return[];for(var gt=0,Yt=0,gn=Kt(xx(He/q));gt<He;)gn[Yt++]=gc(D,gt,gt+=q);return gn}function K8(D){for(var q=-1,be=D==null?0:D.length,He=0,gt=[];++q<be;){var Yt=D[q];Yt&&(gt[He++]=Yt)}return gt}function kd(){var D=arguments.length;if(!D)return[];for(var q=Kt(D-1),be=arguments[0],He=D;He--;)q[He-1]=arguments[He];return vs(Ci(be)?Bc(be):[be],So(q,1))}var Yi=Pi(function(D,q){return dl(D)?ih(D,So(q,1,dl,!0)):[]}),Il=Pi(function(D,q){var be=zc(q);return dl(be)&&(be=n),dl(D)?ih(D,So(q,1,dl,!0),Hs(be,2)):[]}),qo=Pi(function(D,q){var be=zc(q);return dl(be)&&(be=n),dl(D)?ih(D,So(q,1,dl,!0),n,be):[]});function Xl(D,q,be){var He=D==null?0:D.length;return He?(q=be||q===n?1:Fi(q),gc(D,q<0?0:q,He)):[]}function Wu(D,q,be){var He=D==null?0:D.length;return He?(q=be||q===n?1:Fi(q),q=He-q,gc(D,0,q<0?0:q)):[]}function tb(D,q){return D&&D.length?B2(D,Hs(q,3),!0,!0):[]}function cl(D,q){return D&&D.length?B2(D,Hs(q,3),!0):[]}function Q2(D,q,be,He){var gt=D==null?0:D.length;return gt?(be&&typeof be!="number"&&Uc(D,q,be)&&(be=0,He=gt),LT(D,q,be,He)):[]}function $m(D,q,be){var He=D==null?0:D.length;if(!He)return-1;var gt=be==null?0:Fi(be);return gt<0&&(gt=Wo(He+gt,0)),er(D,Hs(q,3),gt)}function Z2(D,q,be){var He=D==null?0:D.length;if(!He)return-1;var gt=He-1;return be!==n&&(gt=Fi(be),gt=be<0?Wo(He+gt,0):dc(gt,He-1)),er(D,Hs(q,3),gt,!0)}function x6(D){var q=D==null?0:D.length;return q?So(D,1):[]}function J2(D){var q=D==null?0:D.length;return q?So(D,oe):[]}function hu(D,q){var be=D==null?0:D.length;return be?(q=q===n?1:Fi(q),So(D,q)):[]}function Y8(D){for(var q=-1,be=D==null?0:D.length,He={};++q<be;){var gt=D[q];He[gt[0]]=gt[1]}return He}function kx(D){return D&&D.length?D[0]:n}function Ep(D,q,be){var He=D==null?0:D.length;if(!He)return-1;var gt=be==null?0:Fi(be);return gt<0&&(gt=Wo(He+gt,0)),qn(D,q,gt)}function g6(D){var q=D==null?0:D.length;return q?gc(D,0,-1):[]}var X8=Pi(function(D){var q=Jn(D,K1);return q.length&&q[0]===D[0]?q5(q):[]}),Um=Pi(function(D){var q=zc(D),be=Jn(D,K1);return q===zc(be)?q=n:be.pop(),be.length&&be[0]===D[0]?q5(be,Hs(q,2)):[]}),b6=Pi(function(D){var q=zc(D),be=Jn(D,K1);return q=typeof q=="function"?q:n,q&&be.pop(),be.length&&be[0]===D[0]?q5(be,n,q):[]});function zm(D,q){return D==null?"":O5.call(D,q)}function zc(D){var q=D==null?0:D.length;return q?D[q-1]:n}function ev(D,q,be){var He=D==null?0:D.length;if(!He)return-1;var gt=He;return be!==n&&(gt=Fi(be),gt=gt<0?Wo(He+gt,0):dc(gt,He-1)),q===q?$(D,q,gt):er(D,Ar,gt,!0)}function Q8(D,q){return D&&D.length?X5(D,Fi(q)):n}var y6=Pi(tv);function tv(D,q){return D&&D.length&&q&&q.length?Ro(D,q):D}function Hc(D,q,be){return D&&D.length&&q&&q.length?Ro(D,q,Hs(be,2)):D}function Hm(D,q,be){return D&&D.length&&q&&q.length?Ro(D,q,n,be):D}var vf=dh(function(D,q){var be=D==null?0:D.length,He=H5(D,q);return ll(D,Jn(q,function(gt){return to(gt,be)?+gt:gt}).sort(I8)),He});function pu(D,q){var be=[];if(!(D&&D.length))return be;var He=-1,gt=[],Yt=D.length;for(q=Hs(q,3);++He<Yt;){var gn=D[He];q(gn,He,D)&&(be.push(gn),gt.push(He))}return ll(D,gt),be}function v6(D){return D==null?D:M5.call(D)}function Z8(D,q,be){var He=D==null?0:D.length;return He?(be&&typeof be!="number"&&Uc(D,q,be)?(q=0,be=He):(q=q==null?0:Fi(q),be=be===n?He:Fi(be)),gc(D,q,be)):[]}function J8(D,q){return q1(D,q)}function MU(D,q,be){return Z5(D,q,Hs(be,2))}function Vm(D,q){var be=D==null?0:D.length;if(be){var He=q1(D,q);if(He<be&&_p(D[He],q))return He}return-1}function sI(D,q){return q1(D,q,!0)}function e7(D,q,be){return Z5(D,q,Hs(be,2),!0)}function Tx(D,q){var be=D==null?0:D.length;if(be){var He=q1(D,q,!0)-1;if(_p(D[He],q))return He}return-1}function t7(D){return D&&D.length?j8(D):[]}function Ix(D,q){return D&&D.length?j8(D,Hs(q,2)):[]}function iI(D){var q=D==null?0:D.length;return q?gc(D,1,q):[]}function aI(D,q,be){return D&&D.length?(q=be||q===n?1:Fi(q),gc(D,0,q<0?0:q)):[]}function n7(D,q,be){var He=D==null?0:D.length;return He?(q=be||q===n?1:Fi(q),q=He-q,gc(D,q<0?0:q,He)):[]}function w6(D,q){return D&&D.length?B2(D,Hs(q,3),!1,!0):[]}function RU(D,q){return D&&D.length?B2(D,Hs(q,3)):[]}var LU=Pi(function(D){return Sp(So(D,1,dl,!0))}),oI=Pi(function(D){var q=zc(D);return dl(q)&&(q=n),Sp(So(D,1,dl,!0),Hs(q,2))}),lI=Pi(function(D){var q=zc(D);return q=typeof q=="function"?q:n,Sp(So(D,1,dl,!0),n,q)});function Px(D){return D&&D.length?Sp(D):[]}function DU(D,q){return D&&D.length?Sp(D,Hs(q,2)):[]}function nb(D,q){return q=typeof q=="function"?q:n,D&&D.length?Sp(D,n,q):[]}function C6(D){if(!(D&&D.length))return[];var q=0;return D=is(D,function(be){if(dl(be))return q=Wo(be.length,q),!0}),as(q,function(be){return Jn(D,Fs(be))})}function ho(D,q){if(!(D&&D.length))return[];var be=C6(D);return q==null?be:Jn(be,function(He){return lr(q,n,He)})}var BU=Pi(function(D,q){return dl(D)?ih(D,q):[]}),cI=Pi(function(D){return e6(is(D,dl))}),$U=Pi(function(D){var q=zc(D);return dl(q)&&(q=n),e6(is(D,dl),Hs(q,2))}),UU=Pi(function(D){var q=zc(D);return q=typeof q=="function"?q:n,e6(is(D,dl),n,q)}),uI=Pi(C6);function dI(D,q){return $2(D||[],q||[],wx)}function zU(D,q){return $2(D||[],q||[],jx)}var Td=Pi(function(D){var q=D.length,be=q>1?D[q-1]:n;return be=typeof be=="function"?(D.pop(),be):n,ho(D,be)});function S6(D){var q=Ot(D);return q.__chain__=!0,q}function HU(D,q){return q(D),D}function wf(D,q){return q(D)}var N6=dh(function(D){var q=D.length,be=q?D[0]:0,He=this.__wrapped__,gt=function(Yt){return H5(Yt,D)};return q>1||this.__actions__.length||!(He instanceof wi)||!to(be)?this.thru(gt):(He=He.slice(be,+be+(q?1:0)),He.__actions__.push({func:wf,args:[gt],thisArg:n}),new fc(He,this.__chain__).thru(function(Yt){return q&&!Yt.length&&Yt.push(n),Yt}))});function Fx(){return S6(this)}function A6(){return new fc(this.value(),this.__chain__)}function r7(){this.__values__===n&&(this.__values__=Jue(this.value()));var D=this.__index__>=this.__values__.length,q=D?n:this.__values__[this.__index__++];return{done:D,value:q}}function s7(){return this}function VU(D){for(var q,be=this;be instanceof th;){var He=rI(be);He.__index__=0,He.__values__=n,q?gt.__wrapped__=He:q=He;var gt=He;be=be.__wrapped__}return gt.__wrapped__=D,q}function i7(){var D=this.__wrapped__;if(D instanceof wi){var q=D;return this.__actions__.length&&(q=new wi(this)),q=q.reverse(),q.__actions__.push({func:wf,args:[v6],thisArg:n}),new fc(q,this.__chain__)}return this.thru(v6)}function WU(){return G1(this.__wrapped__,this.__actions__)}var fI=r6(function(D,q,be){Ii.call(D,be)?++D[be]:sh(D,be,1)});function hI(D,q,be){var He=Ci(D)?ts:F2;return be&&Uc(D,q,be)&&(q=n),He(D,Hs(q,3))}function j6(D,q){var be=Ci(D)?is:g8;return be(D,Hs(q,3))}var E6=_x($m),pI=_x(Z2);function a7(D,q){return So(I6(D,q),1)}function mI(D,q){return So(I6(D,q),oe)}function o7(D,q,be){return be=be===n?1:Fi(be),So(I6(D,q),be)}function nv(D,q){var be=Ci(D)?fr:ah;return be(D,Hs(q,3))}function _6(D,q){var be=Ci(D)?cr:RT;return be(D,Hs(q,3))}var k6=r6(function(D,q,be){Ii.call(D,be)?D[be].push(q):sh(D,be,[q])});function xI(D,q,be,He){D=Id(D)?D:O6(D),be=be&&!He?Fi(be):0;var gt=D.length;return be<0&&(be=Wo(gt+be,0)),bI(D)?be<=gt&&D.indexOf(q,be)>-1:!!gt&&qn(D,q,be)>-1}var qU=Pi(function(D,q,be){var He=-1,gt=typeof q=="function",Yt=Id(D)?Kt(D.length):[];return ah(D,function(gn){Yt[++He]=gt?lr(q,gn,be):Ad(gn,q,be)}),Yt}),T6=r6(function(D,q,be){sh(D,be,q)});function I6(D,q){var be=Ci(D)?Jn:w8;return be(D,Hs(q,3))}function rv(D,q,be,He){return D==null?[]:(Ci(q)||(q=q==null?[]:[q]),be=He?n:be,Ci(be)||(be=be==null?[]:[be]),L2(D,q,be))}var GU=r6(function(D,q,be){D[be?0:1].push(q)},function(){return[[],[]]});function P6(D,q,be){var He=Ci(D)?si:sr,gt=arguments.length<3;return He(D,Hs(q,4),be,gt,ah)}function A(D,q,be){var He=Ci(D)?ni:sr,gt=arguments.length<3;return He(D,Hs(q,4),be,gt,RT)}function M(D,q){var be=Ci(D)?is:g8;return be(D,ks(Hs(q,3)))}function Z(D){var q=Ci(D)?rh:xc;return q(D)}function me(D,q,be){(be?Uc(D,q,be):q===n)?q=1:q=Fi(q);var He=Ci(D)?vx:N8;return He(D,q)}function Pe(D){var q=Ci(D)?OT:Ed;return q(D)}function ze(D){if(D==null)return 0;if(Id(D))return bI(D)?H(D):D.length;var q=Kl(D);return q==tt||q==Nt?D.size:Cp(D).length}function Ct(D,q,be){var He=Ci(D)?Er:A8;return be&&Uc(D,q,be)&&(q=n),He(D,Hs(q,3))}var pn=Pi(function(D,q){if(D==null)return[];var be=q.length;return be>1&&Uc(D,q[0],q[1])?q=[]:be>2&&Uc(q[0],q[1],q[2])&&(q=[q[0]]),L2(D,So(q,1),[])}),kn=Wa||function(){return _r.Date.now()};function ar(D,q){if(typeof q!="function")throw new Za(o);return D=Fi(D),function(){if(--D<1)return q.apply(this,arguments)}}function $r(D,q,be){return q=be?n:q,q=D&&q==null?D.length:q,uh(D,L,n,n,n,n,q)}function Hr(D,q){var be;if(typeof q!="function")throw new Za(o);return D=Fi(D),function(){return--D>0&&(be=q.apply(this,arguments)),D<=1&&(q=n),be}}var Dr=Pi(function(D,q,be){var He=C;if(be.length){var gt=dt(be,Ap(Dr));He|=F}return uh(D,He,q,be,gt)}),us=Pi(function(D,q,be){var He=C|N;if(be.length){var gt=dt(be,Ap(us));He|=F}return uh(q,He,D,be,gt)});function Cs(D,q,be){q=be?n:q;var He=uh(D,P,n,n,n,n,n,q);return He.placeholder=Cs.placeholder,He}function _s(D,q,be){q=be?n:q;var He=uh(D,R,n,n,n,n,n,q);return He.placeholder=_s.placeholder,He}function No(D,q,be){var He,gt,Yt,gn,Fn,Gn,Tr=0,Pr=!1,Ur=!1,ls=!0;if(typeof D!="function")throw new Za(o);q=hh(q)||0,Lo(be)&&(Pr=!!be.leading,Ur="maxWait"in be,Yt=Ur?Wo(hh(be.maxWait)||0,q):Yt,ls="trailing"in be?!!be.trailing:ls);function Os(fl){var kp=He,Rx=gt;return He=gt=n,Tr=fl,gn=D.apply(Rx,kp),gn}function Ys(fl){return Tr=fl,Fn=eb(Wi,q),Pr?Os(fl):gn}function Oi(fl){var kp=fl-Gn,Rx=fl-Tr,fde=q-kp;return Ur?dc(fde,Yt-Rx):fde}function Xs(fl){var kp=fl-Gn,Rx=fl-Tr;return Gn===n||kp>=q||kp<0||Ur&&Rx>=Yt}function Wi(){var fl=kn();if(Xs(fl))return Xi(fl);Fn=eb(Wi,Oi(fl))}function Xi(fl){return Fn=n,ls&&He?Os(fl):(He=gt=n,gn)}function Sf(){Fn!==n&&k8(Fn),Tr=0,He=Gn=gt=Fn=n}function qu(){return Fn===n?gn:Xi(kn())}function Nf(){var fl=kn(),kp=Xs(fl);if(He=arguments,gt=this,Gn=fl,kp){if(Fn===n)return Ys(Gn);if(Ur)return k8(Fn),Fn=eb(Wi,q),Os(Gn)}return Fn===n&&(Fn=eb(Wi,q)),gn}return Nf.cancel=Sf,Nf.flush=qu,Nf}var Xn=Pi(function(D,q){return x8(D,1,q)}),Dn=Pi(function(D,q,be){return x8(D,hh(q)||0,be)});function tr(D){return uh(D,Q)}function Gr(D,q){if(typeof D!="function"||q!=null&&typeof q!="function")throw new Za(o);var be=function(){var He=arguments,gt=q?q.apply(this,He):He[0],Yt=be.cache;if(Yt.has(gt))return Yt.get(gt);var gn=D.apply(this,He);return be.cache=Yt.set(gt,gn)||Yt,gn};return be.cache=new(Gr.Cache||wd),be}Gr.Cache=wd;function ks(D){if(typeof D!="function")throw new Za(o);return function(){var q=arguments;switch(q.length){case 0:return!D.call(this);case 1:return!D.call(this,q[0]);case 2:return!D.call(this,q[0],q[1]);case 3:return!D.call(this,q[0],q[1],q[2])}return!D.apply(this,q)}}function $s(D){return Hr(2,D)}var Us=$T(function(D,q){q=q.length==1&&Ci(q[0])?Jn(q[0],ps(Hs())):Jn(So(q,1),ps(Hs()));var be=q.length;return Pi(function(He){for(var gt=-1,Yt=dc(He.length,be);++gt<Yt;)He[gt]=q[gt].call(this,He[gt]);return lr(D,this,He)})}),qs=Pi(function(D,q){var be=dt(q,Ap(qs));return uh(D,F,n,q,be)}),ul=Pi(function(D,q){var be=dt(q,Ap(ul));return uh(D,U,n,q,be)}),ia=dh(function(D,q){return uh(D,z,n,n,n,q)});function Wm(D,q){if(typeof D!="function")throw new Za(o);return q=q===n?q:Fi(q),Pi(D,q)}function KU(D,q){if(typeof D!="function")throw new Za(o);return q=q==null?0:Wo(Fi(q),0),Pi(function(be){var He=be[q],gt=Np(be,0,q);return He&&vs(gt,He),lr(D,this,gt)})}function vWe(D,q,be){var He=!0,gt=!0;if(typeof D!="function")throw new Za(o);return Lo(be)&&(He="leading"in be?!!be.leading:He,gt="trailing"in be?!!be.trailing:gt),No(D,q,{leading:He,maxWait:q,trailing:gt})}function wWe(D){return $r(D,1)}function CWe(D,q){return qs(t6(q),D)}function SWe(){if(!arguments.length)return[];var D=arguments[0];return Ci(D)?D:[D]}function NWe(D){return du(D,g)}function AWe(D,q){return q=typeof q=="function"?q:n,du(D,g,q)}function jWe(D){return du(D,f|g)}function EWe(D,q){return q=typeof q=="function"?q:n,du(D,f|g,q)}function _We(D,q){return q==null||P2(D,q,bc(q))}function _p(D,q){return D===q||D!==D&&q!==q}var kWe=l6(Mm),TWe=l6(function(D,q){return D>=q}),sv=G5(function(){return arguments}())?G5:function(D){return Go(D)&&Ii.call(D,"callee")&&!I5.call(D,"callee")},Ci=Kt.isArray,IWe=ue?ps(ue):DT;function Id(D){return D!=null&&gI(D.length)&&!Ox(D)}function dl(D){return Go(D)&&Id(D)}function PWe(D){return D===!0||D===!1||Go(D)&&ql(D)==je}var rb=f8||iz,FWe=rt?ps(rt):wp;function OWe(D){return Go(D)&&D.nodeType===1&&!l7(D)}function MWe(D){if(D==null)return!0;if(Id(D)&&(Ci(D)||typeof D=="string"||typeof D.splice=="function"||rb(D)||F6(D)||sv(D)))return!D.length;var q=Kl(D);if(q==tt||q==Nt)return!D.size;if(jp(D))return!Cp(D).length;for(var be in D)if(Ii.call(D,be))return!1;return!0}function RWe(D,q){return jd(D,q)}function LWe(D,q,be){be=typeof be=="function"?be:n;var He=be?be(D,q):n;return He===n?jd(D,q,n,be):!!He}function YU(D){if(!Go(D))return!1;var q=ql(D);return q==Qe||q==Re||typeof D.message=="string"&&typeof D.name=="string"&&!l7(D)}function DWe(D){return typeof D=="number"&&F1(D)}function Ox(D){if(!Lo(D))return!1;var q=ql(D);return q==$e||q==it||q==ye||q==It}function Yue(D){return typeof D=="number"&&D==Fi(D)}function gI(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=G}function Lo(D){var q=typeof D;return D!=null&&(q=="object"||q=="function")}function Go(D){return D!=null&&typeof D=="object"}var Xue=Ft?ps(Ft):BT;function BWe(D,q){return D===q||H1(D,q,G2(q))}function $We(D,q,be){return be=typeof be=="function"?be:n,H1(D,q,G2(q),be)}function UWe(D){return Que(D)&&D!=+D}function zWe(D){if(OU(D))throw new ur(a);return y8(D)}function HWe(D){return D===null}function VWe(D){return D==null}function Que(D){return typeof D=="number"||Go(D)&&ql(D)==ot}function l7(D){if(!Go(D)||ql(D)!=ct)return!1;var q=hf(D);if(q===null)return!0;var be=Ii.call(q,"constructor")&&q.constructor;return typeof be=="function"&&be instanceof be&&vd.call(be)==k5}var XU=yt?ps(yt):M2;function WWe(D){return Yue(D)&&D>=-9007199254740991&&D<=G}var Zue=hn?ps(hn):oh;function bI(D){return typeof D=="string"||!Ci(D)&&Go(D)&&ql(D)==mn}function Cf(D){return typeof D=="symbol"||Go(D)&&ql(D)==dn}var F6=vn?ps(vn):R2;function qWe(D){return D===n}function GWe(D){return Go(D)&&Kl(D)==Xe}function KWe(D){return Go(D)&&ql(D)==Ut}var YWe=l6(Rm),XWe=l6(function(D,q){return D<=q});function Jue(D){if(!D)return[];if(Id(D))return bI(D)?K(D):Bc(D);if(xp&&D[xp])return $u(D[xp]());var q=Kl(D),be=q==tt?xi:q==Nt?y:O6;return be(D)}function Mx(D){if(!D)return D===0?D:0;if(D=hh(D),D===oe||D===-1/0){var q=D<0?-1:1;return q*V}return D===D?D:0}function Fi(D){var q=Mx(D),be=q%1;return q===q?be?q-be:q:0}function ede(D){return D?bp(Fi(D),0,ae):0}function hh(D){if(typeof D=="number")return D;if(Cf(D))return te;if(Lo(D)){var q=typeof D.valueOf=="function"?D.valueOf():D;D=Lo(q)?q+"":q}if(typeof D!="string")return D===0?D:+D;D=hs(D);var be=ir.test(D);return be||Jt.test(D)?vr(D.slice(2),be?2:8):Kn.test(D)?te:+D}function tde(D){return mf(D,Pd(D))}function QWe(D){return D?bp(Fi(D),-9007199254740991,G):D===0?D:0}function ka(D){return D==null?"":fu(D)}var ZWe=Y1(function(D,q){if(jp(q)||Id(q)){mf(q,bc(q),D);return}for(var be in q)Ii.call(q,be)&&wx(D,be,q[be])}),nde=Y1(function(D,q){mf(q,Pd(q),D)}),yI=Y1(function(D,q,be,He){mf(q,Pd(q),D,He)}),JWe=Y1(function(D,q,be,He){mf(q,bc(q),D,He)}),eqe=dh(H5);function tqe(D,q){var be=D1(D);return q==null?be:Ga(be,q)}var nqe=Pi(function(D,q){D=ws(D);var be=-1,He=q.length,gt=He>2?q[2]:n;for(gt&&Uc(q[0],q[1],gt)&&(He=1);++be<He;)for(var Yt=q[be],gn=Pd(Yt),Fn=-1,Gn=gn.length;++Fn<Gn;){var Tr=gn[Fn],Pr=D[Tr];(Pr===n||_p(Pr,_a[Tr])&&!Ii.call(D,Tr))&&(D[Tr]=Yt[Tr])}return D}),rqe=Pi(function(D){return D.push(n,D8),lr(rde,n,D)});function sqe(D,q){return zt(D,Hs(q,3),Hu)}function iqe(D,q){return zt(D,Hs(q,3),Om)}function aqe(D,q){return D==null?D:V5(D,Hs(q,3),Pd)}function oqe(D,q){return D==null?D:O2(D,Hs(q,3),Pd)}function lqe(D,q){return D&&Hu(D,Hs(q,3))}function cqe(D,q){return D&&Om(D,Hs(q,3))}function uqe(D){return D==null?[]:z1(D,bc(D))}function dqe(D){return D==null?[]:z1(D,Pd(D))}function QU(D,q,be){var He=D==null?n:yp(D,q);return He===n?be:He}function fqe(D,q){return D!=null&&H8(D,q,Nd)}function ZU(D,q){return D!=null&&H8(D,q,Sx)}var hqe=qT(function(D,q,be){q!=null&&typeof q.toString!="function"&&(q=S2.call(q)),D[q]=be},ez(Fd)),pqe=qT(function(D,q,be){q!=null&&typeof q.toString!="function"&&(q=S2.call(q)),Ii.call(D,q)?D[q].push(be):D[q]=[be]},Hs),mqe=Pi(Ad);function bc(D){return Id(D)?nh(D):Cp(D)}function Pd(D){return Id(D)?nh(D,!0):v8(D)}function xqe(D,q){var be={};return q=Hs(q,3),Hu(D,function(He,gt,Yt){sh(be,q(He,gt,Yt),He)}),be}function gqe(D,q){var be={};return q=Hs(q,3),Hu(D,function(He,gt,Yt){sh(be,gt,q(He,gt,Yt))}),be}var bqe=Y1(function(D,q,be){Nx(D,q,be)}),rde=Y1(function(D,q,be,He){Nx(D,q,be,He)}),yqe=dh(function(D,q){var be={};if(D==null)return be;var He=!1;q=Jn(q,function(Yt){return Yt=ch(Yt,D),He||(He=Yt.length>1),Yt}),mf(D,W2(D),be),He&&(be=du(be,f|x|g,B8));for(var gt=q.length;gt--;)J5(be,q[gt]);return be});function vqe(D,q){return sde(D,ks(Hs(q)))}var wqe=dh(function(D,q){return D==null?{}:S8(D,q)});function sde(D,q){if(D==null)return{};var be=Jn(W2(D),function(He){return[He]});return q=Hs(q),Lm(D,be,function(He,gt){return q(He,gt[0])})}function Cqe(D,q,be){q=ch(q,D);var He=-1,gt=q.length;for(gt||(gt=1,D=n);++He<gt;){var Yt=D==null?n:D[yf(q[He])];Yt===n&&(He=gt,Yt=be),D=Ox(Yt)?Yt.call(D):Yt}return D}function Sqe(D,q,be){return D==null?D:jx(D,q,be)}function Nqe(D,q,be,He){return He=typeof He=="function"?He:n,D==null?D:jx(D,q,be,He)}var ide=R8(bc),ade=R8(Pd);function Aqe(D,q,be){var He=Ci(D),gt=He||rb(D)||F6(D);if(q=Hs(q,4),be==null){var Yt=D&&D.constructor;gt?be=He?new Yt:[]:Lo(D)?be=Ox(Yt)?D1(hf(D)):{}:be={}}return(gt?fr:Hu)(D,function(gn,Fn,Gn){return q(be,gn,Fn,Gn)}),be}function jqe(D,q){return D==null?!0:J5(D,q)}function Eqe(D,q,be){return D==null?D:_8(D,q,t6(be))}function _qe(D,q,be,He){return He=typeof He=="function"?He:n,D==null?D:_8(D,q,t6(be),He)}function O6(D){return D==null?[]:Bi(D,bc(D))}function kqe(D){return D==null?[]:Bi(D,Pd(D))}function Tqe(D,q,be){return be===n&&(be=q,q=n),be!==n&&(be=hh(be),be=be===be?be:0),q!==n&&(q=hh(q),q=q===q?q:0),bp(hh(D),q,be)}function Iqe(D,q,be){return q=Mx(q),be===n?(be=q,q=0):be=Mx(be),D=hh(D),b8(D,q,be)}function Pqe(D,q,be){if(be&&typeof be!="boolean"&&Uc(D,q,be)&&(q=be=n),be===n&&(typeof q=="boolean"?(be=q,q=n):typeof D=="boolean"&&(be=D,D=n)),D===n&&q===n?(D=0,q=1):(D=Mx(D),q===n?(q=D,D=0):q=Mx(q)),D>q){var He=D;D=q,q=He}if(be||D%1||q%1){var gt=E2();return dc(D+gt*(q-D+ms("1e-"+((gt+"").length-1))),q)}return W1(D,q)}var Fqe=Ex(function(D,q,be){return q=q.toLowerCase(),D+(be?ode(q):q)});function ode(D){return JU(ka(D).toLowerCase())}function lde(D){return D=ka(D),D&&D.replace(Qn,El).replace(or,"")}function Oqe(D,q,be){D=ka(D),q=fu(q);var He=D.length;be=be===n?He:bp(Fi(be),0,He);var gt=be;return be-=q.length,be>=0&&D.slice(be,gt)==q}function Mqe(D){return D=ka(D),D&&On.test(D)?D.replace(xn,_l):D}function Rqe(D){return D=ka(D),D&&wn.test(D)?D.replace(nr,"\\$&"):D}var Lqe=Ex(function(D,q,be){return D+(be?"-":"")+q.toLowerCase()}),Dqe=Ex(function(D,q,be){return D+(be?" ":"")+q.toLowerCase()}),Bqe=F8("toLowerCase");function $qe(D,q,be){D=ka(D),q=Fi(q);var He=q?H(D):0;if(!q||He>=q)return D;var gt=(q-He)/2;return H2(_m(gt),be)+D+H2(xx(gt),be)}function Uqe(D,q,be){D=ka(D),q=Fi(q);var He=q?H(D):0;return q&&He<q?D+H2(q-He,be):D}function zqe(D,q,be){D=ka(D),q=Fi(q);var He=q?H(D):0;return q&&He<q?H2(q-He,be)+D:D}function Hqe(D,q,be){return be||q==null?q=0:q&&(q=+q),_T(ka(D).replace(on,""),q||0)}function Vqe(D,q,be){return(be?Uc(D,q,be):q===n)?q=1:q=Fi(q),Ax(ka(D),q)}function Wqe(){var D=arguments,q=ka(D[0]);return D.length<3?q:q.replace(D[1],D[2])}var qqe=Ex(function(D,q,be){return D+(be?"_":"")+q.toLowerCase()});function Gqe(D,q,be){return be&&typeof be!="number"&&Uc(D,q,be)&&(q=be=n),be=be===n?ae:be>>>0,be?(D=ka(D),D&&(typeof q=="string"||q!=null&&!XU(q))&&(q=fu(q),!q&&kl(D))?Np(K(D),0,be):D.split(q,be)):[]}var Kqe=Ex(function(D,q,be){return D+(be?" ":"")+JU(q)});function Yqe(D,q,be){return D=ka(D),be=be==null?0:bp(Fi(be),0,D.length),q=fu(q),D.slice(be,be+q.length)==q}function Xqe(D,q,be){var He=Ot.templateSettings;be&&Uc(D,q,be)&&(q=n),D=ka(D),q=yI({},q,He,L8);var gt=yI({},q.imports,He.imports,L8),Yt=bc(gt),gn=Bi(gt,Yt),Fn,Gn,Tr=0,Pr=q.interpolate||Rt,Ur="__p += '",ls=Ks((q.escape||Rt).source+"|"+Pr.source+"|"+(Pr===bn?sn:Rt).source+"|"+(q.evaluate||Rt).source+"|$","g"),Os="//# sourceURL="+(Ii.call(q,"sourceURL")?(q.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Lr+"]")+`
`;D.replace(ls,function(Xs,Wi,Xi,Sf,qu,Nf){return Xi||(Xi=Sf),Ur+=D.slice(Tr,Nf).replace(Pn,Bu),Wi&&(Fn=!0,Ur+=`' +
__e(`+Wi+`) +
'`),qu&&(Gn=!0,Ur+=`';
`+qu+`;
__p += '`),Xi&&(Ur+=`' +
((__t = (`+Xi+`)) == null ? '' : __t) +
'`),Tr=Nf+Xs.length,Xs}),Ur+=`';
`;var Ys=Ii.call(q,"variable")&&q.variable;if(!Ys)Ur=`with (obj) {
`+Ur+`
}
`;else if(yn.test(Ys))throw new ur(l);Ur=(Gn?Ur.replace(ut,""):Ur).replace(xt,"$1").replace(jt,"$1;"),Ur="function("+(Ys||"obj")+`) {
`+(Ys?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Fn?", __e = _.escape":"")+(Gn?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Ur+`return __p
}`;var Oi=ude(function(){return br(Yt,Os+"return "+Ur).apply(n,gn)});if(Oi.source=Ur,YU(Oi))throw Oi;return Oi}function Qqe(D){return ka(D).toLowerCase()}function Zqe(D){return ka(D).toUpperCase()}function Jqe(D,q,be){if(D=ka(D),D&&(be||q===n))return hs(D);if(!D||!(q=fu(q)))return D;var He=K(D),gt=K(q),Yt=xs(He,gt),gn=jr(He,gt)+1;return Np(He,Yt,gn).join("")}function eGe(D,q,be){if(D=ka(D),D&&(be||q===n))return D.slice(0,le(D)+1);if(!D||!(q=fu(q)))return D;var He=K(D),gt=jr(He,K(q))+1;return Np(He,0,gt).join("")}function tGe(D,q,be){if(D=ka(D),D&&(be||q===n))return D.replace(on,"");if(!D||!(q=fu(q)))return D;var He=K(D),gt=xs(He,K(q));return Np(He,gt).join("")}function nGe(D,q){var be=ne,He=J;if(Lo(q)){var gt="separator"in q?q.separator:gt;be="length"in q?Fi(q.length):be,He="omission"in q?fu(q.omission):He}D=ka(D);var Yt=D.length;if(kl(D)){var gn=K(D);Yt=gn.length}if(be>=Yt)return D;var Fn=be-H(He);if(Fn<1)return He;var Gn=gn?Np(gn,0,Fn).join(""):D.slice(0,Fn);if(gt===n)return Gn+He;if(gn&&(Fn+=Gn.length-Fn),XU(gt)){if(D.slice(Fn).search(gt)){var Tr,Pr=Gn;for(gt.global||(gt=Ks(gt.source,ka(Tn.exec(gt))+"g")),gt.lastIndex=0;Tr=gt.exec(Pr);)var Ur=Tr.index;Gn=Gn.slice(0,Ur===n?Fn:Ur)}}else if(D.indexOf(fu(gt),Fn)!=Fn){var ls=Gn.lastIndexOf(gt);ls>-1&&(Gn=Gn.slice(0,ls))}return Gn+He}function rGe(D){return D=ka(D),D&&un.test(D)?D.replace(kt,ve):D}var sGe=Ex(function(D,q,be){return D+(be?" ":"")+q.toUpperCase()}),JU=F8("toUpperCase");function cde(D,q,be){return D=ka(D),q=be?n:q,q===n?px(D)?ht(D):at(D):D.match(q)||[]}var ude=Pi(function(D,q){try{return lr(D,n,q)}catch(be){return YU(be)?be:new ur(be)}}),iGe=dh(function(D,q){return fr(q,function(be){be=yf(be),sh(D,be,Dr(D[be],D))}),D});function aGe(D){var q=D==null?0:D.length,be=Hs();return D=q?Jn(D,function(He){if(typeof He[1]!="function")throw new Za(o);return[be(He[0]),He[1]]}):[],Pi(function(He){for(var gt=-1;++gt<q;){var Yt=D[gt];if(lr(Yt[0],this,He))return lr(Yt[1],this,He)}})}function oGe(D){return MT(du(D,f))}function ez(D){return function(){return D}}function lGe(D,q){return D==null||D!==D?q:D}var cGe=a6(),uGe=a6(!0);function Fd(D){return D}function tz(D){return V1(typeof D=="function"?D:du(D,f))}function dGe(D){return Y5(du(D,f))}function fGe(D,q){return eo(D,du(q,f))}var hGe=Pi(function(D,q){return function(be){return Ad(be,D,q)}}),pGe=Pi(function(D,q){return function(be){return Ad(D,be,q)}});function nz(D,q,be){var He=bc(q),gt=z1(q,He);be==null&&!(Lo(q)&&(gt.length||!He.length))&&(be=q,q=D,D=this,gt=z1(q,bc(q)));var Yt=!(Lo(be)&&"chain"in be)||!!be.chain,gn=Ox(D);return fr(gt,function(Fn){var Gn=q[Fn];D[Fn]=Gn,gn&&(D.prototype[Fn]=function(){var Tr=this.__chain__;if(Yt||Tr){var Pr=D(this.__wrapped__),Ur=Pr.__actions__=Bc(this.__actions__);return Ur.push({func:Gn,args:arguments,thisArg:D}),Pr.__chain__=Tr,Pr}return Gn.apply(D,vs([this.value()],arguments))})}),D}function mGe(){return _r._===this&&(_r._=NT),this}function rz(){}function xGe(D){return D=Fi(D),Pi(function(q){return X5(q,D)})}var gGe=o6(Jn),bGe=o6(ts),yGe=o6(Er);function dde(D){return gs(D)?Fs(yf(D)):fo(D)}function vGe(D){return function(q){return D==null?n:yp(D,q)}}var wGe=M8(),CGe=M8(!0);function sz(){return[]}function iz(){return!1}function SGe(){return{}}function NGe(){return""}function AGe(){return!0}function jGe(D,q){if(D=Fi(D),D<1||D>G)return[];var be=ae,He=dc(D,ae);q=Hs(q),D-=ae;for(var gt=as(He,q);++be<D;)q(be);return gt}function EGe(D){return Ci(D)?Jn(D,yf):Cf(D)?[D]:Bc(G8(ka(D)))}function _Ge(D){var q=++Em;return ka(D)+q}var kGe=z2(function(D,q){return D+q},0),TGe=Gl("ceil"),IGe=z2(function(D,q){return D/q},1),PGe=Gl("floor");function FGe(D){return D&&D.length?Cx(D,Fd,Mm):n}function OGe(D,q){return D&&D.length?Cx(D,Hs(q,2),Mm):n}function MGe(D){return Zr(D,Fd)}function RGe(D,q){return Zr(D,Hs(q,2))}function LGe(D){return D&&D.length?Cx(D,Fd,Rm):n}function DGe(D,q){return D&&D.length?Cx(D,Hs(q,2),Rm):n}var BGe=z2(function(D,q){return D*q},1),$Ge=Gl("round"),UGe=z2(function(D,q){return D-q},0);function zGe(D){return D&&D.length?zr(D,Fd):0}function HGe(D,q){return D&&D.length?zr(D,Hs(q,2)):0}return Ot.after=ar,Ot.ary=$r,Ot.assign=ZWe,Ot.assignIn=nde,Ot.assignInWith=yI,Ot.assignWith=JWe,Ot.at=eqe,Ot.before=Hr,Ot.bind=Dr,Ot.bindAll=iGe,Ot.bindKey=us,Ot.castArray=SWe,Ot.chain=S6,Ot.chunk=m6,Ot.compact=K8,Ot.concat=kd,Ot.cond=aGe,Ot.conforms=oGe,Ot.constant=ez,Ot.countBy=fI,Ot.create=tqe,Ot.curry=Cs,Ot.curryRight=_s,Ot.debounce=No,Ot.defaults=nqe,Ot.defaultsDeep=rqe,Ot.defer=Xn,Ot.delay=Dn,Ot.difference=Yi,Ot.differenceBy=Il,Ot.differenceWith=qo,Ot.drop=Xl,Ot.dropRight=Wu,Ot.dropRightWhile=tb,Ot.dropWhile=cl,Ot.fill=Q2,Ot.filter=j6,Ot.flatMap=a7,Ot.flatMapDeep=mI,Ot.flatMapDepth=o7,Ot.flatten=x6,Ot.flattenDeep=J2,Ot.flattenDepth=hu,Ot.flip=tr,Ot.flow=cGe,Ot.flowRight=uGe,Ot.fromPairs=Y8,Ot.functions=uqe,Ot.functionsIn=dqe,Ot.groupBy=k6,Ot.initial=g6,Ot.intersection=X8,Ot.intersectionBy=Um,Ot.intersectionWith=b6,Ot.invert=hqe,Ot.invertBy=pqe,Ot.invokeMap=qU,Ot.iteratee=tz,Ot.keyBy=T6,Ot.keys=bc,Ot.keysIn=Pd,Ot.map=I6,Ot.mapKeys=xqe,Ot.mapValues=gqe,Ot.matches=dGe,Ot.matchesProperty=fGe,Ot.memoize=Gr,Ot.merge=bqe,Ot.mergeWith=rde,Ot.method=hGe,Ot.methodOf=pGe,Ot.mixin=nz,Ot.negate=ks,Ot.nthArg=xGe,Ot.omit=yqe,Ot.omitBy=vqe,Ot.once=$s,Ot.orderBy=rv,Ot.over=gGe,Ot.overArgs=Us,Ot.overEvery=bGe,Ot.overSome=yGe,Ot.partial=qs,Ot.partialRight=ul,Ot.partition=GU,Ot.pick=wqe,Ot.pickBy=sde,Ot.property=dde,Ot.propertyOf=vGe,Ot.pull=y6,Ot.pullAll=tv,Ot.pullAllBy=Hc,Ot.pullAllWith=Hm,Ot.pullAt=vf,Ot.range=wGe,Ot.rangeRight=CGe,Ot.rearg=ia,Ot.reject=M,Ot.remove=pu,Ot.rest=Wm,Ot.reverse=v6,Ot.sampleSize=me,Ot.set=Sqe,Ot.setWith=Nqe,Ot.shuffle=Pe,Ot.slice=Z8,Ot.sortBy=pn,Ot.sortedUniq=t7,Ot.sortedUniqBy=Ix,Ot.split=Gqe,Ot.spread=KU,Ot.tail=iI,Ot.take=aI,Ot.takeRight=n7,Ot.takeRightWhile=w6,Ot.takeWhile=RU,Ot.tap=HU,Ot.throttle=vWe,Ot.thru=wf,Ot.toArray=Jue,Ot.toPairs=ide,Ot.toPairsIn=ade,Ot.toPath=EGe,Ot.toPlainObject=tde,Ot.transform=Aqe,Ot.unary=wWe,Ot.union=LU,Ot.unionBy=oI,Ot.unionWith=lI,Ot.uniq=Px,Ot.uniqBy=DU,Ot.uniqWith=nb,Ot.unset=jqe,Ot.unzip=C6,Ot.unzipWith=ho,Ot.update=Eqe,Ot.updateWith=_qe,Ot.values=O6,Ot.valuesIn=kqe,Ot.without=BU,Ot.words=cde,Ot.wrap=CWe,Ot.xor=cI,Ot.xorBy=$U,Ot.xorWith=UU,Ot.zip=uI,Ot.zipObject=dI,Ot.zipObjectDeep=zU,Ot.zipWith=Td,Ot.entries=ide,Ot.entriesIn=ade,Ot.extend=nde,Ot.extendWith=yI,nz(Ot,Ot),Ot.add=kGe,Ot.attempt=ude,Ot.camelCase=Fqe,Ot.capitalize=ode,Ot.ceil=TGe,Ot.clamp=Tqe,Ot.clone=NWe,Ot.cloneDeep=jWe,Ot.cloneDeepWith=EWe,Ot.cloneWith=AWe,Ot.conformsTo=_We,Ot.deburr=lde,Ot.defaultTo=lGe,Ot.divide=IGe,Ot.endsWith=Oqe,Ot.eq=_p,Ot.escape=Mqe,Ot.escapeRegExp=Rqe,Ot.every=hI,Ot.find=E6,Ot.findIndex=$m,Ot.findKey=sqe,Ot.findLast=pI,Ot.findLastIndex=Z2,Ot.findLastKey=iqe,Ot.floor=PGe,Ot.forEach=nv,Ot.forEachRight=_6,Ot.forIn=aqe,Ot.forInRight=oqe,Ot.forOwn=lqe,Ot.forOwnRight=cqe,Ot.get=QU,Ot.gt=kWe,Ot.gte=TWe,Ot.has=fqe,Ot.hasIn=ZU,Ot.head=kx,Ot.identity=Fd,Ot.includes=xI,Ot.indexOf=Ep,Ot.inRange=Iqe,Ot.invoke=mqe,Ot.isArguments=sv,Ot.isArray=Ci,Ot.isArrayBuffer=IWe,Ot.isArrayLike=Id,Ot.isArrayLikeObject=dl,Ot.isBoolean=PWe,Ot.isBuffer=rb,Ot.isDate=FWe,Ot.isElement=OWe,Ot.isEmpty=MWe,Ot.isEqual=RWe,Ot.isEqualWith=LWe,Ot.isError=YU,Ot.isFinite=DWe,Ot.isFunction=Ox,Ot.isInteger=Yue,Ot.isLength=gI,Ot.isMap=Xue,Ot.isMatch=BWe,Ot.isMatchWith=$We,Ot.isNaN=UWe,Ot.isNative=zWe,Ot.isNil=VWe,Ot.isNull=HWe,Ot.isNumber=Que,Ot.isObject=Lo,Ot.isObjectLike=Go,Ot.isPlainObject=l7,Ot.isRegExp=XU,Ot.isSafeInteger=WWe,Ot.isSet=Zue,Ot.isString=bI,Ot.isSymbol=Cf,Ot.isTypedArray=F6,Ot.isUndefined=qWe,Ot.isWeakMap=GWe,Ot.isWeakSet=KWe,Ot.join=zm,Ot.kebabCase=Lqe,Ot.last=zc,Ot.lastIndexOf=ev,Ot.lowerCase=Dqe,Ot.lowerFirst=Bqe,Ot.lt=YWe,Ot.lte=XWe,Ot.max=FGe,Ot.maxBy=OGe,Ot.mean=MGe,Ot.meanBy=RGe,Ot.min=LGe,Ot.minBy=DGe,Ot.stubArray=sz,Ot.stubFalse=iz,Ot.stubObject=SGe,Ot.stubString=NGe,Ot.stubTrue=AGe,Ot.multiply=BGe,Ot.nth=Q8,Ot.noConflict=mGe,Ot.noop=rz,Ot.now=kn,Ot.pad=$qe,Ot.padEnd=Uqe,Ot.padStart=zqe,Ot.parseInt=Hqe,Ot.random=Pqe,Ot.reduce=P6,Ot.reduceRight=A,Ot.repeat=Vqe,Ot.replace=Wqe,Ot.result=Cqe,Ot.round=$Ge,Ot.runInContext=vt,Ot.sample=Z,Ot.size=ze,Ot.snakeCase=qqe,Ot.some=Ct,Ot.sortedIndex=J8,Ot.sortedIndexBy=MU,Ot.sortedIndexOf=Vm,Ot.sortedLastIndex=sI,Ot.sortedLastIndexBy=e7,Ot.sortedLastIndexOf=Tx,Ot.startCase=Kqe,Ot.startsWith=Yqe,Ot.subtract=UGe,Ot.sum=zGe,Ot.sumBy=HGe,Ot.template=Xqe,Ot.times=jGe,Ot.toFinite=Mx,Ot.toInteger=Fi,Ot.toLength=ede,Ot.toLower=Qqe,Ot.toNumber=hh,Ot.toSafeInteger=QWe,Ot.toString=ka,Ot.toUpper=Zqe,Ot.trim=Jqe,Ot.trimEnd=eGe,Ot.trimStart=tGe,Ot.truncate=nGe,Ot.unescape=rGe,Ot.uniqueId=_Ge,Ot.upperCase=sGe,Ot.upperFirst=JU,Ot.each=nv,Ot.eachRight=_6,Ot.first=kx,nz(Ot,function(){var D={};return Hu(Ot,function(q,be){Ii.call(Ot.prototype,be)||(D[be]=q)}),D}(),{chain:!1}),Ot.VERSION=r,fr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(D){Ot[D].placeholder=Ot}),fr(["drop","take"],function(D,q){wi.prototype[D]=function(be){be=be===n?1:Wo(Fi(be),0);var He=this.__filtered__&&!q?new wi(this):this.clone();return He.__filtered__?He.__takeCount__=dc(be,He.__takeCount__):He.__views__.push({size:dc(be,ae),type:D+(He.__dir__<0?"Right":"")}),He},wi.prototype[D+"Right"]=function(be){return this.reverse()[D](be).reverse()}}),fr(["filter","map","takeWhile"],function(D,q){var be=q+1,He=be==pe||be==ie;wi.prototype[D]=function(gt){var Yt=this.clone();return Yt.__iteratees__.push({iteratee:Hs(gt,3),type:be}),Yt.__filtered__=Yt.__filtered__||He,Yt}}),fr(["head","last"],function(D,q){var be="take"+(q?"Right":"");wi.prototype[D]=function(){return this[be](1).value()[0]}}),fr(["initial","tail"],function(D,q){var be="drop"+(q?"":"Right");wi.prototype[D]=function(){return this.__filtered__?new wi(this):this[be](1)}}),wi.prototype.compact=function(){return this.filter(Fd)},wi.prototype.find=function(D){return this.filter(D).head()},wi.prototype.findLast=function(D){return this.reverse().find(D)},wi.prototype.invokeMap=Pi(function(D,q){return typeof D=="function"?new wi(this):this.map(function(be){return Ad(be,D,q)})}),wi.prototype.reject=function(D){return this.filter(ks(Hs(D)))},wi.prototype.slice=function(D,q){D=Fi(D);var be=this;return be.__filtered__&&(D>0||q<0)?new wi(be):(D<0?be=be.takeRight(-D):D&&(be=be.drop(D)),q!==n&&(q=Fi(q),be=q<0?be.dropRight(-q):be.take(q-D)),be)},wi.prototype.takeRightWhile=function(D){return this.reverse().takeWhile(D).reverse()},wi.prototype.toArray=function(){return this.take(ae)},Hu(wi.prototype,function(D,q){var be=/^(?:filter|find|map|reject)|While$/.test(q),He=/^(?:head|last)$/.test(q),gt=Ot[He?"take"+(q=="last"?"Right":""):q],Yt=He||/^find/.test(q);gt&&(Ot.prototype[q]=function(){var gn=this.__wrapped__,Fn=He?[1]:arguments,Gn=gn instanceof wi,Tr=Fn[0],Pr=Gn||Ci(gn),Ur=function(Wi){var Xi=gt.apply(Ot,vs([Wi],Fn));return He&&ls?Xi[0]:Xi};Pr&&be&&typeof Tr=="function"&&Tr.length!=1&&(Gn=Pr=!1);var ls=this.__chain__,Os=!!this.__actions__.length,Ys=Yt&&!ls,Oi=Gn&&!Os;if(!Yt&&Pr){gn=Oi?gn:new wi(this);var Xs=D.apply(gn,Fn);return Xs.__actions__.push({func:wf,args:[Ur],thisArg:n}),new fc(Xs,ls)}return Ys&&Oi?D.apply(this,Fn):(Xs=this.thru(Ur),Ys?He?Xs.value()[0]:Xs.value():Xs)})}),fr(["pop","push","shift","sort","splice","unshift"],function(D){var q=Ja[D],be=/^(?:push|sort|unshift)$/.test(D)?"tap":"thru",He=/^(?:pop|shift)$/.test(D);Ot.prototype[D]=function(){var gt=arguments;if(He&&!this.__chain__){var Yt=this.value();return q.apply(Ci(Yt)?Yt:[],gt)}return this[be](function(gn){return q.apply(Ci(gn)?gn:[],gt)})}}),Hu(wi.prototype,function(D,q){var be=Ot[q];if(be){var He=be.name+"";Ii.call(R1,He)||(R1[He]=[]),R1[He].push({name:q,func:be})}}),R1[Q1(n,N).name]=[{name:"wrapper",func:n}],wi.prototype.clone=D5,wi.prototype.reverse=p8,wi.prototype.value=B1,Ot.prototype.at=N6,Ot.prototype.chain=Fx,Ot.prototype.commit=A6,Ot.prototype.next=r7,Ot.prototype.plant=VU,Ot.prototype.reverse=i7,Ot.prototype.toJSON=Ot.prototype.valueOf=Ot.prototype.value=WU,Ot.prototype.first=Ot.prototype.head,xp&&(Ot.prototype[xp]=s7),Ot},tn=Tt();Gs?((Gs.exports=tn)._=tn,os._=tn):_r._=tn}).call(cin)}(Tj,Tj.exports)),Tj.exports}var din=uin();const xCe=ki(din),fin=({wallet:e="",wallets:t=[]})=>{const[n,r]=m.useState([]),[s,a]=m.useState(!0),[o,l]=m.useState({key:null,direction:null}),c=C=>C.filter(Boolean).map(N=>{var I,P;return typeof N=="string"?N.toLowerCase():((P=(I=N==null?void 0:N.wallet_address)==null?void 0:I.toLowerCase)==null?void 0:P.call(I))||""}).filter(Boolean);m.useEffect(()=>{(async()=>{a(!0);const N=t&&t.length?c(t):[e];if(!N[0]){r([]),a(!1);return}const I=Date.now()-30*24*60*60*1e3;try{const R=(await Promise.all(N.map(F=>ds.post("https://api-ui.hyperliquid.xyz/info",{type:"userNonFundingLedgerUpdates",user:F,startTime:I})))).flatMap(F=>F.data||[]).sort((F,U)=>U.time-F.time);r(R)}catch(P){console.error("Error fetching transaction data:",P)}finally{a(!1)}})()},[e,JSON.stringify(t)]);const u=C=>{let N="asc";o.key===C&&(o.direction==="asc"?N="desc":o.direction==="desc"&&(N=null)),l({key:C,direction:N})},d=[...n].sort((C,N)=>{if(!o.key||!o.direction)return 0;const I=xCe.get(C,o.key),P=xCe.get(N,o.key);return I<P?o.direction==="asc"?-1:1:I>P?o.direction==="asc"?1:-1:0}),f=C=>{if(o.key===C){if(o.direction==="asc")return i.jsx(I3,{className:"inline ml-2 text-white"});if(o.direction==="desc")return i.jsx(T3,{className:"inline ml-2 text-white"})}return i.jsx(P3,{className:"inline ml-2 text-white"})},x=localStorage.getItem("isDateDepositWithdrawFormat")||"date",[g,v]=m.useState(x);m.useEffect(()=>{localStorage.setItem("isDateDepositWithdrawFormat",g)},[g]);const w=({date:C})=>{const[N,I]=m.useState(Oo(C));return m.useEffect(()=>{const P=setInterval(()=>I(Oo(C)),1e3);return()=>clearInterval(P)},[C]),i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:N.dateTime})};return i.jsx("div",{className:"relative w-full text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:i.jsx("div",{className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full mt-1 mb-3 bg-[#161616] rounded-lg pb-24",children:i.jsxs("table",{className:"w-full table-auto relative border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"sticky top-0 bg-[#161616]",children:i.jsxs("tr",{className:"text-[#9b9b9b] text-left",children:[i.jsxs("th",{onClick:()=>u("time"),className:"cursor-pointer",children:["Time ",f("time")]}),i.jsxs("th",{onClick:()=>u("delta.type"),className:"cursor-pointer",children:["Type ",f("delta.type")]}),i.jsxs("th",{onClick:()=>u("asset"),className:"cursor-pointer",children:["Asset ",f("asset")]}),i.jsxs("th",{onClick:()=>u("delta.usdc"),className:"cursor-pointer",children:["Amount ",f("delta.usdc")]}),i.jsx("th",{children:"Transaction"})]})}),i.jsx("tbody",{children:s?i.jsx("tr",{children:i.jsx("td",{colSpan:5,className:"text-center p-4",children:"Loading…"})}):d.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:5,className:"text-center p-4",children:"No transactions available"})}):d.map((C,N)=>i.jsxs("tr",{className:"bg-[#1b1b1b] hover:bg-[#222222] h-[32px] text-white",children:[i.jsx("td",{className:"cursor-pointer",onClick:()=>v(g==="time"?"date":"time"),children:g==="time"?i.jsx(w,{date:C.time}):su(C.time)}),i.jsx("td",{className:C.delta.type==="deposit"?"text-[#4ae3b5]":C.delta.type==="withdraw"?"text-[#ff6b6b]":"",children:C.delta.type?C.delta.type[0].toUpperCase()+C.delta.type.slice(1):"Unknown"}),i.jsx("td",{children:"-"}),i.jsxs("td",{children:["$",Cr(+C.delta.usdc)]}),i.jsx("td",{className:"break-all",children:GD(C.hash)})]},N))})]})})})};function Tne(){return Tne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tne.apply(null,arguments)}function gCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ine(e,t){return Ine=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ine(e,t)}function hin(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ine(e,t)}var bCe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function pin(e,t){return!!(e===t||bCe(e)&&bCe(t))}function min(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!pin(e[n],t[n]))return!1;return!0}function zY(e,t){t===void 0&&(t=min);var n,r=[],s,a=!1;function o(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return a&&n===this&&t(l,r)||(s=e.apply(this,l),a=!0,n=this,r=l),s}return o}var xin=typeof performance=="object"&&typeof performance.now=="function",yCe=xin?function(){return performance.now()}:function(){return Date.now()};function vCe(e){cancelAnimationFrame(e.id)}function gin(e,t){var n=yCe();function r(){yCe()-n>=t?e.call(null):s.id=requestAnimationFrame(r)}var s={id:requestAnimationFrame(r)};return s}var HY=-1;function wCe(e){if(e===void 0&&(e=!1),HY===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),HY=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return HY}var aC=null;function CCe(e){if(e===void 0&&(e=!1),aC===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),s=r.style;return s.width="100px",s.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?aC="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?aC="negative":aC="positive-ascending"),document.body.removeChild(t),aC}return aC}var bin=150,yin=function(t,n){return t};function vin(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,s=e.getItemSize,a=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(f){hin(x,f);function x(v){var w;return w=f.call(this,v)||this,w._instanceProps=c(w.props,gCe(w)),w._outerRef=void 0,w._resetIsScrollingTimeoutId=null,w.state={instance:gCe(w),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof w.props.initialScrollOffset=="number"?w.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},w._callOnItemsRendered=void 0,w._callOnItemsRendered=zY(function(C,N,I,P){return w.props.onItemsRendered({overscanStartIndex:C,overscanStopIndex:N,visibleStartIndex:I,visibleStopIndex:P})}),w._callOnScroll=void 0,w._callOnScroll=zY(function(C,N,I){return w.props.onScroll({scrollDirection:C,scrollOffset:N,scrollUpdateWasRequested:I})}),w._getItemStyle=void 0,w._getItemStyle=function(C){var N=w.props,I=N.direction,P=N.itemSize,R=N.layout,F=w._getItemStyleCache(u&&P,u&&R,u&&I),U;if(F.hasOwnProperty(C))U=F[C];else{var L=n(w.props,C,w._instanceProps),z=s(w.props,C,w._instanceProps),Q=I==="horizontal"||R==="horizontal",ne=I==="rtl",J=Q?L:0;F[C]=U={position:"absolute",left:ne?void 0:J,right:ne?J:void 0,top:Q?0:L,height:Q?"100%":z,width:Q?z:"100%"}}return U},w._getItemStyleCache=void 0,w._getItemStyleCache=zY(function(C,N,I){return{}}),w._onScrollHorizontal=function(C){var N=C.currentTarget,I=N.clientWidth,P=N.scrollLeft,R=N.scrollWidth;w.setState(function(F){if(F.scrollOffset===P)return null;var U=w.props.direction,L=P;if(U==="rtl")switch(CCe()){case"negative":L=-P;break;case"positive-descending":L=R-I-P;break}return L=Math.max(0,Math.min(L,R-I)),{isScrolling:!0,scrollDirection:F.scrollOffset<L?"forward":"backward",scrollOffset:L,scrollUpdateWasRequested:!1}},w._resetIsScrollingDebounced)},w._onScrollVertical=function(C){var N=C.currentTarget,I=N.clientHeight,P=N.scrollHeight,R=N.scrollTop;w.setState(function(F){if(F.scrollOffset===R)return null;var U=Math.max(0,Math.min(R,P-I));return{isScrolling:!0,scrollDirection:F.scrollOffset<U?"forward":"backward",scrollOffset:U,scrollUpdateWasRequested:!1}},w._resetIsScrollingDebounced)},w._outerRefSetter=function(C){var N=w.props.outerRef;w._outerRef=C,typeof N=="function"?N(C):N!=null&&typeof N=="object"&&N.hasOwnProperty("current")&&(N.current=C)},w._resetIsScrollingDebounced=function(){w._resetIsScrollingTimeoutId!==null&&vCe(w._resetIsScrollingTimeoutId),w._resetIsScrollingTimeoutId=gin(w._resetIsScrolling,bin)},w._resetIsScrolling=function(){w._resetIsScrollingTimeoutId=null,w.setState({isScrolling:!1},function(){w._getItemStyleCache(-1,null)})},w}x.getDerivedStateFromProps=function(w,C){return win(w,C),d(w),null};var g=x.prototype;return g.scrollTo=function(w){w=Math.max(0,w),this.setState(function(C){return C.scrollOffset===w?null:{scrollDirection:C.scrollOffset<w?"forward":"backward",scrollOffset:w,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(w,C){C===void 0&&(C="auto");var N=this.props,I=N.itemCount,P=N.layout,R=this.state.scrollOffset;w=Math.max(0,Math.min(w,I-1));var F=0;if(this._outerRef){var U=this._outerRef;P==="vertical"?F=U.scrollWidth>U.clientWidth?wCe():0:F=U.scrollHeight>U.clientHeight?wCe():0}this.scrollTo(a(this.props,w,C,R,this._instanceProps,F))},g.componentDidMount=function(){var w=this.props,C=w.direction,N=w.initialScrollOffset,I=w.layout;if(typeof N=="number"&&this._outerRef!=null){var P=this._outerRef;C==="horizontal"||I==="horizontal"?P.scrollLeft=N:P.scrollTop=N}this._callPropsCallbacks()},g.componentDidUpdate=function(){var w=this.props,C=w.direction,N=w.layout,I=this.state,P=I.scrollOffset,R=I.scrollUpdateWasRequested;if(R&&this._outerRef!=null){var F=this._outerRef;if(C==="horizontal"||N==="horizontal")if(C==="rtl")switch(CCe()){case"negative":F.scrollLeft=-P;break;case"positive-ascending":F.scrollLeft=P;break;default:var U=F.clientWidth,L=F.scrollWidth;F.scrollLeft=L-U-P;break}else F.scrollLeft=P;else F.scrollTop=P}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&vCe(this._resetIsScrollingTimeoutId)},g.render=function(){var w=this.props,C=w.children,N=w.className,I=w.direction,P=w.height,R=w.innerRef,F=w.innerElementType,U=w.innerTagName,L=w.itemCount,z=w.itemData,Q=w.itemKey,ne=Q===void 0?yin:Q,J=w.layout,X=w.outerElementType,re=w.outerTagName,pe=w.style,Y=w.useIsScrolling,ie=w.width,oe=this.state.isScrolling,G=I==="horizontal"||J==="horizontal",V=G?this._onScrollHorizontal:this._onScrollVertical,te=this._getRangeToRender(),ae=te[0],he=te[1],Ce=[];if(L>0)for(var ce=ae;ce<=he;ce++)Ce.push(m.createElement(C,{data:z,key:ne(ce,z),index:ce,isScrolling:Y?oe:void 0,style:this._getItemStyle(ce)}));var ge=r(this.props,this._instanceProps);return m.createElement(X||re||"div",{className:N,onScroll:V,ref:this._outerRefSetter,style:Tne({position:"relative",height:P,width:ie,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:I},pe)},m.createElement(F||U||"div",{children:Ce,ref:R,style:{height:G?"100%":ge,pointerEvents:oe?"none":void 0,width:G?ge:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var w=this.props.itemCount;if(w>0){var C=this._getRangeToRender(),N=C[0],I=C[1],P=C[2],R=C[3];this._callOnItemsRendered(N,I,P,R)}}if(typeof this.props.onScroll=="function"){var F=this.state,U=F.scrollDirection,L=F.scrollOffset,z=F.scrollUpdateWasRequested;this._callOnScroll(U,L,z)}},g._getRangeToRender=function(){var w=this.props,C=w.itemCount,N=w.overscanCount,I=this.state,P=I.isScrolling,R=I.scrollDirection,F=I.scrollOffset;if(C===0)return[0,0,0,0];var U=o(this.props,F,this._instanceProps),L=l(this.props,U,F,this._instanceProps),z=!P||R==="backward"?Math.max(1,N):1,Q=!P||R==="forward"?Math.max(1,N):1;return[Math.max(0,U-z),Math.max(0,Math.min(C-1,L+Q)),U,L]},x}(m.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var win=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Cin=vin({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,s,a,o){var l=t.direction,c=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,x=t.width,g=l==="horizontal"||f==="horizontal",v=g?x:c,w=Math.max(0,u*d-v),C=Math.min(w,n*d),N=Math.max(0,n*d-v+d+o);switch(r==="smart"&&(s>=N-v&&s<=C+v?r="auto":r="center"),r){case"start":return C;case"end":return N;case"center":{var I=Math.round(N+(C-N)/2);return I<Math.ceil(v/2)?0:I>w+Math.floor(v/2)?w:I}case"auto":default:return s>=N&&s<=C?s:s<N?N:C}},getStartIndexForOffset:function(t,n){var r=t.itemCount,s=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/s)))},getStopIndexForStartIndex:function(t,n,r){var s=t.direction,a=t.height,o=t.itemCount,l=t.itemSize,c=t.layout,u=t.width,d=s==="horizontal"||c==="horizontal",f=n*l,x=d?u:a,g=Math.ceil((x+r-f)/l);return Math.max(0,Math.min(o-1,n+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}}),vO={exports:{}},Sin=vO.exports,SCe;function Nin(){return SCe||(SCe=1,function(e,t){(function(n,r){e.exports=r()})(Sin,function(){var n=1e3,r=6e4,s=36e5,a="millisecond",o="second",l="minute",c="hour",u="day",d="week",f="month",x="quarter",g="year",v="date",w="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(pe){var Y=["th","st","nd","rd"],ie=pe%100;return"["+pe+(Y[(ie-20)%10]||Y[ie]||Y[0])+"]"}},P=function(pe,Y,ie){var oe=String(pe);return!oe||oe.length>=Y?pe:""+Array(Y+1-oe.length).join(ie)+pe},R={s:P,z:function(pe){var Y=-pe.utcOffset(),ie=Math.abs(Y),oe=Math.floor(ie/60),G=ie%60;return(Y<=0?"+":"-")+P(oe,2,"0")+":"+P(G,2,"0")},m:function pe(Y,ie){if(Y.date()<ie.date())return-pe(ie,Y);var oe=12*(ie.year()-Y.year())+(ie.month()-Y.month()),G=Y.clone().add(oe,f),V=ie-G<0,te=Y.clone().add(oe+(V?-1:1),f);return+(-(oe+(ie-G)/(V?G-te:te-G))||0)},a:function(pe){return pe<0?Math.ceil(pe)||0:Math.floor(pe)},p:function(pe){return{M:f,y:g,w:d,d:u,D:v,h:c,m:l,s:o,ms:a,Q:x}[pe]||String(pe||"").toLowerCase().replace(/s$/,"")},u:function(pe){return pe===void 0}},F="en",U={};U[F]=I;var L="$isDayjsObject",z=function(pe){return pe instanceof X||!(!pe||!pe[L])},Q=function pe(Y,ie,oe){var G;if(!Y)return F;if(typeof Y=="string"){var V=Y.toLowerCase();U[V]&&(G=V),ie&&(U[V]=ie,G=V);var te=Y.split("-");if(!G&&te.length>1)return pe(te[0])}else{var ae=Y.name;U[ae]=Y,G=ae}return!oe&&G&&(F=G),G||!oe&&F},ne=function(pe,Y){if(z(pe))return pe.clone();var ie=typeof Y=="object"?Y:{};return ie.date=pe,ie.args=arguments,new X(ie)},J=R;J.l=Q,J.i=z,J.w=function(pe,Y){return ne(pe,{locale:Y.$L,utc:Y.$u,x:Y.$x,$offset:Y.$offset})};var X=function(){function pe(ie){this.$L=Q(ie.locale,null,!0),this.parse(ie),this.$x=this.$x||ie.x||{},this[L]=!0}var Y=pe.prototype;return Y.parse=function(ie){this.$d=function(oe){var G=oe.date,V=oe.utc;if(G===null)return new Date(NaN);if(J.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var te=G.match(C);if(te){var ae=te[2]-1||0,he=(te[7]||"0").substring(0,3);return V?new Date(Date.UTC(te[1],ae,te[3]||1,te[4]||0,te[5]||0,te[6]||0,he)):new Date(te[1],ae,te[3]||1,te[4]||0,te[5]||0,te[6]||0,he)}}return new Date(G)}(ie),this.init()},Y.init=function(){var ie=this.$d;this.$y=ie.getFullYear(),this.$M=ie.getMonth(),this.$D=ie.getDate(),this.$W=ie.getDay(),this.$H=ie.getHours(),this.$m=ie.getMinutes(),this.$s=ie.getSeconds(),this.$ms=ie.getMilliseconds()},Y.$utils=function(){return J},Y.isValid=function(){return this.$d.toString()!==w},Y.isSame=function(ie,oe){var G=ne(ie);return this.startOf(oe)<=G&&G<=this.endOf(oe)},Y.isAfter=function(ie,oe){return ne(ie)<this.startOf(oe)},Y.isBefore=function(ie,oe){return this.endOf(oe)<ne(ie)},Y.$g=function(ie,oe,G){return J.u(ie)?this[oe]:this.set(G,ie)},Y.unix=function(){return Math.floor(this.valueOf()/1e3)},Y.valueOf=function(){return this.$d.getTime()},Y.startOf=function(ie,oe){var G=this,V=!!J.u(oe)||oe,te=J.p(ie),ae=function(Ie,Re){var Qe=J.w(G.$u?Date.UTC(G.$y,Re,Ie):new Date(G.$y,Re,Ie),G);return V?Qe:Qe.endOf(u)},he=function(Ie,Re){return J.w(G.toDate()[Ie].apply(G.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(Re)),G)},Ce=this.$W,ce=this.$M,ge=this.$D,Ae="set"+(this.$u?"UTC":"");switch(te){case g:return V?ae(1,0):ae(31,11);case f:return V?ae(1,ce):ae(0,ce+1);case d:var ye=this.$locale().weekStart||0,je=(Ce<ye?Ce+7:Ce)-ye;return ae(V?ge-je:ge+(6-je),ce);case u:case v:return he(Ae+"Hours",0);case c:return he(Ae+"Minutes",1);case l:return he(Ae+"Seconds",2);case o:return he(Ae+"Milliseconds",3);default:return this.clone()}},Y.endOf=function(ie){return this.startOf(ie,!1)},Y.$set=function(ie,oe){var G,V=J.p(ie),te="set"+(this.$u?"UTC":""),ae=(G={},G[u]=te+"Date",G[v]=te+"Date",G[f]=te+"Month",G[g]=te+"FullYear",G[c]=te+"Hours",G[l]=te+"Minutes",G[o]=te+"Seconds",G[a]=te+"Milliseconds",G)[V],he=V===u?this.$D+(oe-this.$W):oe;if(V===f||V===g){var Ce=this.clone().set(v,1);Ce.$d[ae](he),Ce.init(),this.$d=Ce.set(v,Math.min(this.$D,Ce.daysInMonth())).$d}else ae&&this.$d[ae](he);return this.init(),this},Y.set=function(ie,oe){return this.clone().$set(ie,oe)},Y.get=function(ie){return this[J.p(ie)]()},Y.add=function(ie,oe){var G,V=this;ie=Number(ie);var te=J.p(oe),ae=function(ce){var ge=ne(V);return J.w(ge.date(ge.date()+Math.round(ce*ie)),V)};if(te===f)return this.set(f,this.$M+ie);if(te===g)return this.set(g,this.$y+ie);if(te===u)return ae(1);if(te===d)return ae(7);var he=(G={},G[l]=r,G[c]=s,G[o]=n,G)[te]||1,Ce=this.$d.getTime()+ie*he;return J.w(Ce,this)},Y.subtract=function(ie,oe){return this.add(-1*ie,oe)},Y.format=function(ie){var oe=this,G=this.$locale();if(!this.isValid())return G.invalidDate||w;var V=ie||"YYYY-MM-DDTHH:mm:ssZ",te=J.z(this),ae=this.$H,he=this.$m,Ce=this.$M,ce=G.weekdays,ge=G.months,Ae=G.meridiem,ye=function(Re,Qe,$e,it){return Re&&(Re[Qe]||Re(oe,V))||$e[Qe].slice(0,it)},je=function(Re){return J.s(ae%12||12,Re,"0")},Ie=Ae||function(Re,Qe,$e){var it=Re<12?"AM":"PM";return $e?it.toLowerCase():it};return V.replace(N,function(Re,Qe){return Qe||function($e){switch($e){case"YY":return String(oe.$y).slice(-2);case"YYYY":return J.s(oe.$y,4,"0");case"M":return Ce+1;case"MM":return J.s(Ce+1,2,"0");case"MMM":return ye(G.monthsShort,Ce,ge,3);case"MMMM":return ye(ge,Ce);case"D":return oe.$D;case"DD":return J.s(oe.$D,2,"0");case"d":return String(oe.$W);case"dd":return ye(G.weekdaysMin,oe.$W,ce,2);case"ddd":return ye(G.weekdaysShort,oe.$W,ce,3);case"dddd":return ce[oe.$W];case"H":return String(ae);case"HH":return J.s(ae,2,"0");case"h":return je(1);case"hh":return je(2);case"a":return Ie(ae,he,!0);case"A":return Ie(ae,he,!1);case"m":return String(he);case"mm":return J.s(he,2,"0");case"s":return String(oe.$s);case"ss":return J.s(oe.$s,2,"0");case"SSS":return J.s(oe.$ms,3,"0");case"Z":return te}return null}(Re)||te.replace(":","")})},Y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Y.diff=function(ie,oe,G){var V,te=this,ae=J.p(oe),he=ne(ie),Ce=(he.utcOffset()-this.utcOffset())*r,ce=this-he,ge=function(){return J.m(te,he)};switch(ae){case g:V=ge()/12;break;case f:V=ge();break;case x:V=ge()/3;break;case d:V=(ce-Ce)/6048e5;break;case u:V=(ce-Ce)/864e5;break;case c:V=ce/s;break;case l:V=ce/r;break;case o:V=ce/n;break;default:V=ce}return G?V:J.a(V)},Y.daysInMonth=function(){return this.endOf(f).$D},Y.$locale=function(){return U[this.$L]},Y.locale=function(ie,oe){if(!ie)return this.$L;var G=this.clone(),V=Q(ie,oe,!0);return V&&(G.$L=V),G},Y.clone=function(){return J.w(this.$d,this)},Y.toDate=function(){return new Date(this.valueOf())},Y.toJSON=function(){return this.isValid()?this.toISOString():null},Y.toISOString=function(){return this.$d.toISOString()},Y.toString=function(){return this.$d.toUTCString()},pe}(),re=X.prototype;return ne.prototype=re,[["$ms",a],["$s",o],["$m",l],["$H",c],["$W",u],["$M",f],["$y",g],["$D",v]].forEach(function(pe){re[pe[1]]=function(Y){return this.$g(Y,pe[0],pe[1])}}),ne.extend=function(pe,Y){return pe.$i||(pe(Y,X,ne),pe.$i=!0),ne},ne.locale=Q,ne.isDayjs=z,ne.unix=function(pe){return ne(1e3*pe)},ne.en=U[F],ne.Ls=U,ne.p={},ne})}(vO)),vO.exports}var Ain=Nin();const VY=ki(Ain),jin=Ne.forwardRef(function({style:t,...n},r){const s=t&&t.pointerEvents==="none"?{...t,pointerEvents:"auto"}:t;return i.jsx("div",{ref:r,style:s,...n})}),Ru=({data:e,columns:t,tableClassName:n,theadClassName:r,tbodyClassName:s,rowClassName:a,cellClassName:o,rowHeight:l=36,listHeight:c=500,rowKey:u,onVisibleRows:d,onRowClick:f,loading:x=!1,skeletonRowCount:g=10,skeletonRenderer:v,emptyState:w=null,loadingState:C=null})=>{const[N,I]=m.useState({key:null,direction:null}),[P,R]=m.useState({}),[F,U]=m.useState(null),[L,z]=m.useState(null),[Q,ne]=m.useState({top:0,left:0}),J=m.useRef(null),X=m.useRef(null);m.useEffect(()=>{function tt(ot){J.current&&!J.current.contains(ot.target)&&(U(null),z(null))}return document.addEventListener("mousedown",tt),()=>document.removeEventListener("mousedown",tt)},[]),m.useEffect(()=>{F&&(L==null?void 0:L.filterType)==="text"&&setTimeout(()=>{var tt;return(tt=X.current)==null?void 0:tt.focus()},0)},[F,L]);function re(tt,ot,ft){return tt.filter(ct=>ot.every(Vt=>{const It=ft[Vt.key];if(!Vt.filterType||!It)return!0;const an=ct[Vt.key];if(It.filterType==="text"){const Nt=It.value||"";return an==null?void 0:an.toString().toLowerCase().includes(Nt.toLowerCase())}if(It.filterType==="select")return!It.values||It.values.length===0?!0:It.values.includes(an);if(It.filterType==="dateRange"){if(!an)return!1;const Nt=VY(an);return!(It.start&&Nt.isBefore(VY(It.start))||It.end&&Nt.isAfter(VY(It.end)))}if(It.filterType==="numberRange"){const Nt=parseFloat(It.min),mn=parseFloat(It.max),dn=parseFloat(an);return!(!isNaN(Nt)&&dn<Nt||!isNaN(mn)&&dn>mn)}return!0}))}function pe(tt,ot){if(!ot.key||!ot.direction)return tt;const ft=t.find(ct=>ct.key===ot.key);return ft?[...tt].sort((ct,Vt)=>{const It=ft.sortValue?ft.sortValue(ct):ct[ot.key],an=ft.sortValue?ft.sortValue(Vt):Vt[ot.key],Nt=It==null||It==="-",mn=an==null||an==="-";return Nt&&mn?0:Nt?1:mn?-1:typeof It=="number"&&typeof an=="number"?ot.direction==="asc"?It-an:an-It:typeof It=="string"&&typeof an=="string"?ot.direction==="asc"?It.localeCompare(an):an.localeCompare(It):It<an?ot.direction==="asc"?-1:1:It>an?ot.direction==="asc"?1:-1:0}):tt}function Y(tt){I(ot=>ot.key===tt?ot.direction==="asc"?{key:tt,direction:"desc"}:ot.direction==="desc"?{key:null,direction:null}:{key:tt,direction:"asc"}:{key:tt,direction:"asc"})}function ie(tt){if(N.key===tt){if(N.direction==="asc")return i.jsx(I3,{className:"inline ml-1"});if(N.direction==="desc")return i.jsx(T3,{className:"inline ml-1"})}return i.jsx(P3,{className:"inline ml-1"})}function oe(tt,ot){R(ft=>{const ct=ft[tt]||{};return{...ft,[tt]:{...ct,...ot}}})}function G(tt){R(ot=>{const ft={...ot};return delete ft[tt],ft})}function V(tt,ot){const ft=tt.currentTarget.getBoundingClientRect(),ct=ft.left+ft.width/2-192/2+window.scrollX,Vt=ft.bottom+window.scrollY;if(ne({top:Vt,left:ct}),F===ot.key)U(null),z(null);else{U(ot.key);const It=P[ot.key]||{};z({filterType:ot.filterType,value:It.value||"",values:It.values||[],start:It.start||"",end:It.end||"",min:It.min||"",max:It.max||""})}}function te(tt){L&&oe(tt,L),U(null),z(null)}function ae(tt){if(!L)return null;const ot=L.filterType;return yre.createPortal(i.jsxs("div",{ref:J,style:{position:"absolute",top:Q.top,left:Q.left,zIndex:9999},children:[ot==="text"&&i.jsxs("div",{className:"bg-black/10 border border-gray-400 text-white p-2 font-inter font-semibold shadow-xl w-48 rounded-2xl backdrop-blur-lg",children:[i.jsx("input",{ref:X,type:"text",value:L.value,onChange:ft=>z(ct=>({...ct,value:ft.target.value})),className:"p-1 mb-2 border border-gray-600 bg-gray-600 text-white rounded w-full h-6"}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>te(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),ot==="select"&&i.jsxs("div",{className:"bg-black/10 border border-gray-400 text-white p-2 font-inter font-semibold shadow-xl w-48 max-h-48 overflow-y-auto rounded-2xl backdrop-blur-lg",children:[(tt.options||[]).map(ft=>{const ct=L.values,Vt=ct.includes(ft);return i.jsxs("label",{className:"block cursor-pointer hover:bg-gray-700 p-1 rounded",children:[i.jsx("input",{type:"checkbox",className:"mr-2",checked:Vt,onChange:()=>{z(Vt?It=>({...It,values:ct.filter(an=>an!==ft)}):It=>({...It,values:[...ct,ft]}))}}),ft]},ft)}),i.jsxs("div",{className:"flex justify-between mt-2",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>te(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),ot==="dateRange"&&i.jsxs("div",{className:"bg-black/10 border border-gray-400 text-white p-2 font-inter font-semibold shadow-xl w-52 rounded-2xl backdrop-blur-lg",children:[i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"Start"}),i.jsx("input",{type:"date",className:"p-1 mb-2 border border-gray-600 bg-gray-700 text-white rounded w-full h-6 text-xs",value:L.start,onChange:ft=>z(ct=>({...ct,start:ft.target.value}))})]}),i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"End"}),i.jsx("input",{type:"date",className:"p-1 border border-gray-600 bg-gray-700 text-white rounded w-full h-6 text-xs",value:L.end,onChange:ft=>z(ct=>({...ct,end:ft.target.value}))})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>te(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),ot==="numberRange"&&i.jsxs("div",{className:"bg-black/10 border-2 border-gray-700 text-white p-2 font-inter font-semibold shadow-xl w-48 rounded-2xl backdrop-blur-lg",children:[i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"Min"}),i.jsx("input",{type:"number",step:"any",className:"p-1 mb-2 border border-gray-600 bg-gray-700 text-white rounded w-full h-6",value:L.min,onChange:ft=>z(ct=>({...ct,min:ft.target.value}))})]}),i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"Max"}),i.jsx("input",{type:"number",step:"any",className:"p-1 border border-gray-600 bg-gray-700 text-white rounded w-full h-6",value:L.max,onChange:ft=>z(ct=>({...ct,max:ft.target.value}))})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>te(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]})]}),document.body)}const he=Array.isArray(e)?e:[],Ce=x?[]:pe(re(he,t,P),N),ce=t.map(tt=>tt.width||"minmax(0, 100%)").join(" "),ge=t.map((tt,ot)=>typeof tt.skeletonWidth=="number"?tt.skeletonWidth:60+ot*23%80),Ae=Object.keys(P).length>0,ye=!x&&Ce.length===0;function je({w:tt}){return i.jsx("span",{className:"block h-[14px] rounded bg-[#242424] animate-pulse",style:{width:tt}})}function Ie({index:tt,style:ot}){return i.jsx("div",{style:{...ot,display:"grid",gridTemplateColumns:ce,alignItems:"center"},className:`relative bg-[#1b1b1b] text-white rounded-xl my-[1px] h-[32px] max-h-[32px] leading-[32px] font-inter text-sm font-semibold ${typeof a=="function"?a({},tt)||"":a||""}`,children:t.map((ft,ct)=>i.jsx("div",{className:`px-4 ${typeof o=="function"?o(ft,{},tt)||"":o||""}`,children:v?v({column:ft,index:tt,width:ge[ct]}):i.jsx(je,{w:ge[ct]})},`sk-${ft.key}-${ct}`))})}function Re({index:tt,style:ot}){if(tt<0||tt>=Ce.length)return null;const ft=Ce[tt];return i.jsx("div",{onClick:()=>f&&f(ft),style:{...ot,display:"grid",gridTemplateColumns:ce,alignItems:"center"},className:`relative group bg-[#1b1b1b] hover:bg-[#222222] text-white rounded-xl my-[1px] h-[32px] max-h-[32px] leading-[32px] font-inter text-sm font-semibold ${typeof a=="function"?a(ft,tt)||"":a||""}`,children:t.map(ct=>{const Vt=ct.render?ct.render(ft[ct.key],ft,tt):ft[ct.key];return i.jsx("div",{className:`px-4 overflow-hidden whitespace-nowrap ${typeof o=="function"?o(ct,ft,tt)||"":o||""}`,children:Vt},ct.key)})})}const Qe=x?g:Ce.length,$e=x?void 0:u?tt=>u(Ce[tt]):void 0,it=tt=>tt.headerTooltip?i.jsx(pi,{content:tt.headerTooltip,align:tt.headerTooltipAlign||"center",children:i.jsx("span",{className:"inline-flex underline decoration-dotted underline-offset-2 cursor-help pointer-events-auto",children:tt.label})}):tt.label;return i.jsx("div",{className:`w-full relative ${n||""}`,children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("div",{className:"min-w-max",children:[i.jsx("div",{className:`sticky top-0 z-10 bg-[#161616] font-inter text-sm font-bold text-white ${r||""}`,style:{display:"grid",gridTemplateColumns:ce},children:t.map(tt=>i.jsxs("div",{className:"px-3 py-1 text-left inline-flex items-center w-fit hover:bg-[#262626] hover:rounded-[6px] hover:text-white cursor-pointer transition-all",onClick:()=>!x&&tt.sortable&&Y(tt.key),children:[it(tt),tt.sortable&&i.jsx("span",{className:"ml-1",children:ie(tt.key)}),tt.filterType&&i.jsx("span",{className:"ml-2 cursor-pointer",onClick:ot=>{ot.stopPropagation(),x||V(ot,tt)},children:i.jsx(S6t,{className:"w-3 h-3"})}),F===tt.key&&ae(tt)]},tt.key))}),x&&C?i.jsx("div",{className:`${s||""} min-w-max`,children:typeof C=="function"?C({hasFilters:Ae}):C}):ye?i.jsx("div",{className:`${s||""} min-w-max text-xs text-center text-[#9B9B9B]`,children:typeof w=="function"?w({hasFilters:Ae}):w}):i.jsx(Cin,{className:`${s||""} min-w-max`,height:c,itemCount:Qe,itemSize:l,itemKey:$e,innerElementType:jin,width:"100%",onItemsRendered:({visibleStartIndex:tt,visibleStopIndex:ot})=>!x&&d&&d(Ce.slice(tt,ot+1)),children:x?Ie:Re})]})})})},BP=e=>Number(e).toLocaleString("en-US",{maximumFractionDigits:2}),Ein=e=>!isFinite(e)||isNaN(e)?"-":`${Math.floor(e)}h ${Math.round((e-Math.floor(e))*60)}m`,_in=(e,t,n,r)=>{const s=e*t/n;return r/s*100};function kin({trades:e,generatedWallets:t,wallet:n,wallets:r}){const[s,a]=m.useState(!1),[o,l]=m.useState(null),[c,u]=m.useState(()=>new Map),[d,f]=m.useState(new Map),[x,g]=m.useState(new Map),[v,w]=m.useState([]),[C,N]=m.useState(!0),I=m.useRef(new Set),P=m.useRef(new Set),{isReferralCodeName:R}=m.useContext(Qr),F=m.useCallback(G=>{const V=G==null?void 0:G.toLowerCase();return V?(r==null?void 0:r.length)>0?r.some(te=>{var ae;return((ae=te.wallet_address)==null?void 0:ae.toLowerCase())===V}):(n==null?void 0:n.toLowerCase())===V:!1},[r,n]),U=m.useMemo(()=>r&&r.length?v:Array.isArray(e)?e:[],[r,v,e]),L=m.useCallback(async G=>{const V=localStorage.getItem("hyperAddress"),te=localStorage.getItem("hyperToken");if(!(!V||!te||G.length===0))try{const{data:ae}=await ds.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:V,token:te,position_oids:G},{headers:{"Content-Type":"application/json"}});if(ae&&ae.success){const he=parseFloat(ae.leverage);f(Ce=>{const ce=new Map(Ce);return G.forEach(ge=>ce.set(String(ge),he)),ce})}}catch(ae){console.error("leverage fetch error:",ae)}},[]),z=m.useCallback(async G=>{const V=localStorage.getItem("hyperAddress"),te=localStorage.getItem("hyperToken");if(!(!V||!te||G.length===0))try{const{data:ae}=await ds.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_position_details_with_oids/",{address:V,token:te,position_oids:G},{headers:{"Content-Type":"application/json"}});ae&&ae.success&&g(he=>{const Ce=new Map(he);return ae.data.forEach(ce=>Ce.set(String(ce.oid),ce)),Ce})}catch(ae){console.error("source details fetch error:",ae)}},[]),Q=m.useMemo(()=>(r??[]).map(G=>{var V;return(V=G.wallet_address)==null?void 0:V.toLowerCase()}).sort().join(","),[r]);m.useEffect(()=>{if(Q===""){N(!1),w([]);return}let G=!1;return N(!0),a(!1),I.current.clear(),P.current.clear(),f(new Map),g(new Map),u(new Map),(async()=>{try{const V=Q.split(","),te=(await Promise.all(V.map(async he=>{const[Ce,ce]=await Promise.all([Oce(he),Mce(he)]),ge=[...Ce,...ce.map(({fill:Ae,twapId:ye})=>({...Ae,twapId:ye}))];return Rce(ge).closed_positions||[]}))).flat();if(G)return;const ae=te.sort((he,Ce)=>(Ce.close_time||0)-(he.close_time||0));w(ae),l(null)}catch(V){console.error("multi-wallet completed-trades fetch:",V)}finally{G||N(!1)}})(),()=>{G=!0}},[Q]);const ne=m.useCallback(G=>{const V=new Set,te=new Set;G.forEach(ae=>{((t==null?void 0:t.some(Ce=>F(Ce.wallet_address)))||!1)&&ae.has_builder_fee&&(ae.oids||[]).forEach(Ce=>{I.current.has(Ce)||V.add(Ce),P.current.has(Ce)||te.add(Ce)})}),V.size>0&&(V.forEach(ae=>I.current.add(ae)),L([...V])),te.size>0&&(te.forEach(ae=>P.current.add(ae)),z([...te]))},[t,F,L,z]);function J({date:G}){const[V,te]=m.useState(Oo(G));return m.useEffect(()=>{const ae=setInterval(()=>{te(Oo(G))},1e3);return()=>clearInterval(ae)},[G]),i.jsx("span",{className:"text-white text-sm font-bold font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:V.dateTime})}const X=G=>u(V=>new Map(V).set(G,!V.get(G))),re=(G,V)=>c.get(V)?i.jsx(J,{date:G}):su(G),pe=m.useMemo(()=>[...new Set(U.map(G=>G.coin))],[U]),Y=m.useMemo(()=>U.map(G=>({...G,uid:G.trade_id||G.oid||`${G.open_time}_${G.close_time}`,liqStatus:G.isLiquidated?"Liquidated":"Not Liquidated"})).sort((G,V)=>(V.close_time||0)-(G.close_time||0)),[U]),ie=async G=>{var ge;const V=localStorage.getItem("hyperAddress"),te=localStorage.getItem("hyperToken"),ae=G.oids??[];let he=G.leverage??G.positionDistribution??0;if(V&&te&&ae.length>0)try{he=((ge=(await ds.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:V,token:te,position_oids:ae},{headers:{"Content-Type":"application/json"}})).data)==null?void 0:ge.leverage)??he}catch(Ae){console.error("Leverage fetch failed:",Ae)}const Ce=_in(G.entry_price_wma,G.total_size,he,G.total_pnl),ce=Ae=>Math.abs(Ae)<1?Ae.toFixed(4):Ae.toFixed(2);l({coin:G.coin,type:G.position_side,leverage:he,roe:ce(Ce),entryPrice:G.entry_price_wma,markPrice:G.close_px,positionDistribution:G.total_size,pnl:G.total_pnl-G.total_fee,closePx:G.close_px,referral:R??"--"}),a(!0)},oe=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,filterType:"text",render:(G,V)=>i.jsxs("a",{href:`/terminal/${V.coin}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-white hover:text-gray-400",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${V.coin}.svg`,alt:V.coin,className:"w-5 h-5 mr-2",loading:"lazy",onError:ra}),V.coin]})},{key:"source_tag",label:"Source Tag",sortable:!0,filterType:"text",render:(G,V)=>{const te=x.get(V.oids&&String(V.oids[0]));return te?i.jsx("a",{href:`/wallet-details/${te.copy_trader_wallet}`,className:"text-white hover:text-white",children:te.source_tag||"--"}):"--"}},{key:"position_side",label:"Direction",sortable:!0,filterType:"text",render:(G,V)=>{const ae={Sell:"Sell",Buy:"Buy","Close Short":"Short","Close Long":"Long","Open Short":"Short","Open Long":"Long"}[G]??G??"--",he=["buy","long"].includes(ae.toLowerCase()),Ce=["sell","short"].includes(ae.toLowerCase()),ce=(()=>{if(!(((t==null?void 0:t.some(ye=>F(ye.wallet_address)))||!1)&&V.has_builder_fee))return"";const Ae=d.get(V.oids&&String(V.oids[0]));return Ae?` - ${Ae}x`:""})();return i.jsxs("div",{className:`h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-0.5 ${he?"text-[#67ffbd] bg-[#67ffbd]/20":Ce?"text-[#ff787b] bg-[#ff797c]/20":"text-white"}`,children:[i.jsx(Ts,{className:`w-3 h-3 ${he?"fill-[#67ffbd] rotate-180":Ce?"fill-[#ff787b]":""}`}),i.jsxs("span",{className:"text-[11px] font-semibold uppercase",children:[ae,ce," "]})]})}},{key:"total_size",label:"Size",sortable:!0,filterType:"numberRange",render:BP},{key:"entry_price_wma",label:"Entry Price",sortable:!0,filterType:"numberRange",render:BP},{key:"close_px",label:"Close Price",sortable:!0,filterType:"numberRange",render:BP},{key:"total_pnl",label:"PnL",sortable:!0,filterType:"numberRange",sortValue:G=>G.total_pnl-G.total_fee,render:(G,V)=>{const te=(t==null?void 0:t.some(ae=>F(ae.wallet_address)))||!1;return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:V.total_pnl-V.total_fee>0?"text-[#4ae3b5]":V.total_pnl-V.total_fee<0?"text-[#ff6b6b]":"text-white",children:["$",BP(Math.abs(V.total_pnl-V.total_fee))]}),te&&V.has_builder_fee&&i.jsx("img",{src:xm,alt:"share",className:"w-4 h-4 cursor-pointer",onClick:ae=>{ae.stopPropagation(),ie(V)}})]})}},{key:"total_fee",label:"Fee (USDC)",sortable:!0,filterType:"numberRange",width:"240px",render:(G,V)=>i.jsxs("span",{children:[Cr(parseFloat(V.total_fee))," ",V.builder_fee?i.jsxs("span",{className:"text-xs",children:["(",Cr(parseFloat(V.builder_fee))," builder fee)"]}):""]})},{key:"duration_hours",label:"Duration",sortable:!0,filterType:"numberRange",render:Ein},{key:"open_time",label:"Opened",sortable:!0,filterType:"dateRange",render:(G,V)=>i.jsx("div",{onClick:()=>X(V.uid),className:"cursor-pointer",children:re(V.open_time,V.uid)}),width:"200px"},{key:"close_time",label:"Closed",sortable:!0,filterType:"dateRange",render:(G,V)=>i.jsx("div",{onClick:()=>X(V.uid),className:"cursor-pointer",children:re(V.close_time,V.uid)}),width:"200px"}],[pe,c,d,x,t,F]);return i.jsxs(i.Fragment,{children:[C?i.jsx("div",{className:"py-4 text-center text-white font-bold",children:"Loading…"}):U.length===0?i.jsx("div",{className:"py-4 text-center text-white font-bold",children:"No completed trades"}):i.jsx(Ru,{data:Y,columns:oe,tableClassName:"min-w-full border-separate border-spacing-y-1",theadClassName:"sticky top-0 bg-[#161616]",rowClassName:"bg-[#1b1b1b] hover:bg-[#222222] text-white",rowKey:G=>G.uid,onVisibleRows:ne}),s&&i.jsx(hT,{open:s,setOpen:a,data:o,setShare:()=>{},setTradeInfo:()=>{},pnlTitle:"REALIZED PNL"})]})}const Tin=({data:e,setData:t,wallet:n,coinNameData:r})=>{var G;const[s,a]=m.useState(!1),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(""),[x,g]=m.useState(""),v=m.useRef(null),w=m.useRef(null),N=localStorage.getItem("isDateTwapFillsFormat")||"date",[I,P]=m.useState(N);m.useEffect(()=>{localStorage.setItem("isDateTwapFillsFormat",I)},[I]);const R="-time",[F,U]=m.useState(R),L=V=>{const te=r.find(ae=>ae.label===V);return te?te.value.toUpperCase():V==null?void 0:V.toUpperCase()},z=e==null?void 0:e.filter(V=>d?L(V.coin).includes(d.toUpperCase()):!0).filter(V=>{var te,ae;return x?(ae=(te=V==null?void 0:V.oid)==null?void 0:te.toString())==null?void 0:ae.includes(x):!0}),Q=V=>z==null?void 0:z.sort((te,ae)=>{const he=te.coin?te.coin.toUpperCase():"",Ce=ae.coin?ae.coin.toUpperCase():"",ce=je=>parseFloat(je.closedPnl||0)-parseFloat(je.fee||0),ge=(je="")=>{const Ie=je.toLowerCase(),Re=Ie.includes("long")||Ie==="buy",Qe=Ie.includes("short")||Ie==="sell";return Re&&!Qe?3:Re&&Qe?2:Qe&&!Re?1:0},Ae=parseFloat(te.sz)*parseFloat(te.px),ye=parseFloat(ae.sz)*parseFloat(ae.px);return V==="-price"?ae.px-te.px:V==="price"?te.px-ae.px:V==="-size"?ae.sz-te.sz:V==="size"?te.sz-ae.sz:V==="-fee"?ae.fee-te.fee:V==="fee"?te.fee-ae.fee:V==="-closedPnl"?ce(ae)-ce(te):V==="closedPnl"?ce(te)-ce(ae):V==="-oid"?ae.oid-te.oid:V==="oid"?te.oid-ae.oid:V==="-coin"?he<Ce?-1:he>Ce?1:0:V==="coin"?he>Ce?-1:he<Ce?1:0:V==="-time"?new Date(ae.time)-new Date(te.time):V==="time"?new Date(te.time)-new Date(ae.time):V==="-dir"?ge(ae.dir)-ge(te.dir):V==="dir"?ge(te.dir)-ge(ae.dir):V==="-tradeValue"?ye-Ae:V==="tradeValue"?Ae-ye:0});m.useEffect(()=>{(async()=>{try{a(!0);const te=await ds.post("https://api-ui.hyperliquid.xyz/info",{type:"userTwapSliceFills",user:n}),he=((te==null?void 0:te.data)||[]).map(Ce=>({...Ce.fill,twapId:Ce.twapId||null}));t(he==null?void 0:he.sort((Ce,ce)=>ce.time-Ce.time))}catch(te){console.error("Error fetching twap data:",te)}finally{a(!1)}})()},[n]),m.useEffect(()=>{function V(te){v.current&&!v.current.contains(te.target)&&l(!1),w.current&&!w.current.contains(te.target)&&u(!1)}return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[]);const ne=m.useRef(null),J=()=>{ne.current&&(ne.current.scrollLeft-=200)},X=()=>{ne.current&&(ne.current.scrollLeft+=200)},re=()=>{ne.current&&(ne.current.scrollTop+=200)},pe=()=>{ne.current&&(ne.current.scrollTop-=200)},Y=V=>V>=640&&V<1024?5:V>=1024&&V<1240?8:V>=1240&&V<1540||V>=1540?9:4;function ie({date:V}){const[te,ae]=m.useState(Oo(V));return m.useEffect(()=>{const he=setInterval(()=>{ae(Oo(V))},1e3);return()=>clearInterval(he)},[V]),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:te.dateTime})}const oe={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 justify-start items-center gap-2 hidden lg:flex",children:[i.jsx("button",{onClick:J,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:X,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:pe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:re,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:ne,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx(NCe,{className:"bg-[#161616] h-10 pl-2 sm:pl-6 min-w-[180px] sm:min-w-[220px] z-[8]",title:"Time",sortKey:"time",sortOption:F,setSortOption:U}),i.jsx("th",{scope:"col",className:"pl-4 min-w-[120px] max-w-[120px] sm:min-w-[150px] sm:max-w-[150px] px-1",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(di,{title:"Coin",sortKey:"coin",sortOption:F,setSortOption:U,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>l(!o),className:`${d?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${d?"text-blue-500":"text-white"}`})}),o&&i.jsxs("div",{ref:v,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>f(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:d,onChange:V=>f(V.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx(NCe,{className:"pl-4 min-w-[120px] max-w-[120px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Direction",sortKey:"dir",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[70px] max-w-[70px] sm:min-w-[100px] sm:max-w-[100px] px-1",title:"Price",sortKey:"price",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[90px] max-w-[90px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Size",sortKey:"size",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[130px] max-w-[130px] sm:min-w-[150px] sm:max-w-[150px] px-1",title:"Trade Value",sortKey:"tradeValue",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[90px] max-w-[90px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"Fee",sortKey:"fee",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[120px] max-w-[120px] sm:min-w-[150px] sm:max-w-[150px] px-1",title:"Closed PnL",sortKey:"closedPnl",sortOption:F,setSortOption:U}),i.jsx("th",{scope:"col",className:"min-w-[160px] max-w-[160px] sm:min-w-[200px] sm:max-w-[200px] pl-1 pr-8",children:i.jsxs("div",{className:"flex justify-end items-center gap-2",children:[i.jsx(di,{title:"Order ID",sortKey:"oid",sortOption:F,setSortOption:U,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>u(!c),className:`${x?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${x?"text-blue-500":"text-white"}`})}),c&&i.jsxs("div",{ref:w,className:`absolute right-[30px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>g(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"number",value:x,onChange:V=>g(V.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Order ID"})]})]})]})})]})}),i.jsx("tbody",{children:s||Q(F).length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Y(window.innerWidth),className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:s?i.jsx(Da,{}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No TWAP fills available at the moment."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Your TWAP orders will appear here once they start executing."})})]})]})})})})}):(G=Q(F))==null?void 0:G.map((V,te)=>{var ae,he,Ce,ce,ge,Ae;return i.jsxs(Ne.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",onClick:()=>{P(I=="time"?"date":"time")},className:"bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl cursor-pointer",children:i.jsx("div",{className:"pl-2 sm:pl-5 flex flex-col items-start gap-2 font-manrope min-w-max text-white text-sm font-normal leading-[13px] tracking-[0.18px]",children:I=="time"?i.jsx(ie,{date:V.time}):su(V.time)})}),i.jsx("td",{className:"text-left cursor-pointer",children:i.jsx("div",{onClick:()=>{var ye;window.open(`/terminal/${((ye=r==null?void 0:r.find(je=>je.label===V.coin))==null?void 0:ye.value)||V.coin}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-4 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${((ae=r==null?void 0:r.find(ye=>ye.label===V.coin))==null?void 0:ae.value)||oe[V.coin]||((he=V.coin)==null?void 0:he.split("/")[0])}.svg`||Va,alt:V==null?void 0:V.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:ye=>ra(ye)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:(()=>{const ye=r.find(je=>je.label===V.coin);return ye?ye.value:V.coin})()})]})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-3 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsx("div",{className:"text-white h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex",children:i.jsx("div",{className:`text-left ${V!=null&&V.liquidation?"text-white":(Ce=V.dir)!=null&&Ce.includes("Short")||(ce=V.dir)!=null&&ce.includes("Sell")?"text-[#ff6b6b]":(ge=V.dir)!=null&&ge.includes("Long")||(Ae=V.dir)!=null&&Ae.includes("Buy")?"text-[#4ae3b5]":"text-white"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:V!=null&&V.liquidation?"Liquidation":V.dir?V.dir:"--"})})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-4 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-end items-center gap-2 h-8 max-h-8",children:i.jsx("div",{className:"text-white h-5 pl-1 pr-1.5 py-1 rounded-md justify-end items-center gap-0.5 inline-flex",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.px!=null&&!isNaN(parseFloat(V.px))?`$${parseFloat(V.px).toFixed(2)}`:"--"})})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.sz!=null&&!isNaN(parseFloat(V.sz))?Cr(parseFloat(V.sz)):"--"})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.px!=null&&V.sz!=null&&!isNaN(parseFloat(V.px))&&!isNaN(parseFloat(V.sz))?i.jsxs(i.Fragment,{children:["$",Cr(parseFloat(V.px)*parseFloat(V.sz))]}):"--"})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.fee!=null&&!isNaN(parseFloat(V.fee))?Cr(parseFloat(V.fee)):"--"})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:`text-left ${parseFloat(V.closedPnl)-parseFloat(V.fee)>0?"text-[#4ae3b5]":parseFloat(V.closedPnl)-parseFloat(V.fee)<0?"text-[#ff6b6b]":"text-white"} text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]`,children:V.closedPnl!=null&&V.fee!=null&&!isNaN(parseFloat(V.closedPnl))&&!isNaN(parseFloat(V.fee))?i.jsxs(i.Fragment,{children:["$",Cr(Math.abs(parseFloat(V.closedPnl)-parseFloat(V.fee)))]}):"--"})})}),i.jsx("td",{className:"sm:rounded-r-2xl mr-3",children:i.jsx("div",{className:"pl-1 pr-8 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-left text-[#979797] text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]",children:V!=null&&V.oid?V==null?void 0:V.oid:"--"})})})]},te),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},te)})})]})})]})},G7=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(di,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),NCe=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(di,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})}),oC="https://api-ui.hyperliquid.xyz/info",Iin="wss://api.hyperliquid.xyz/ws",WUe=({initialAddress:e="",wallets:t})=>{var mi,ns,Xt;m.useState(e);const[n,r]=m.useState([]),[s,a]=m.useState([]),o=m.useRef({}),[l,c]=m.useState(!1),[u,d]=m.useState(!0),[f,x]=m.useState(1),[g,v]=m.useState(null),[w,C]=m.useState(!1),[N,I]=m.useState("positions"),P=m.useRef(null),R=il(),F=m.useRef(e),U=m.useRef(null),L=m.useRef(null),[z,Q]=m.useState({});m.useState(!1),m.useState("");const[ne,J]=m.useState(null),{getTrackedWatchList:X,hyperToken:re,copyTradeWatchList:pe,getCopyTradeWatchList:Y,setTelegramChatId:ie,setSubscriberRole:oe,setSubsExpireDay:G,setMushboomerETH:V,setMushboomerSOL:te,setIsReferralCode:ae,isReferralCodeName:he,setIsReferralCodeName:Ce,setIsWhitelist:ce,setHyperToken:ge,setHyperAddress:Ae,setSignModalOpen:ye,latestPnL:je}=m.useContext(Qr),{isConnected:Ie,address:Re}=Jr();m.useState(!1),m.useState(!1),m.useState(null),m.useState("");const[Qe,$e]=m.useState(!1);m.useState(!1);const[it,tt]=m.useState({}),[ot,ft]=m.useState(!1),[ct,Vt]=m.useState([]),[It,an]=m.useState(null);It||je.activeRange;const Nt=Mc(),mn=Nt.pathname.includes("/wallet-management");m.useEffect(()=>{an(null)},[je.activeRange]);const dn=[{label:"@10",value:"GMEOW"},{label:"@112",value:"MEOW"},{label:"@115",value:"HOLD"},{label:"@117",value:"BERA"},{label:"@12",value:"XULIAN"},{label:"@123",value:"FARM"},{label:"@131",value:"ORA"},{label:"@132",value:"LIQD"},{label:"@134",value:"STAR"},{label:"@135",value:"SENT"},{label:"@136",value:"SOLV"},{label:"@16",value:"CZ"},{label:"@18",value:"ANSEM"},{label:"@21",value:"KOBE"},{label:"@22",value:"HAPPY"},{label:"@25",value:"BIGBEN"},{label:"@3",value:"MANLET"},{label:"@30",value:"FARMED"},{label:"@31",value:"GPT"},{label:"@32",value:"PURRPS"},{label:"@33",value:"BID"},{label:"@34",value:"HODL"},{label:"@1",value:"HFUN"},{label:"@100",value:"UP"},{label:"@101",value:"NIGGO"},{label:"@102",value:"HOP"},{label:"@103",value:"LUCKY"},{label:"@104",value:"COPE"},{label:"@105",value:"HPYH"},{label:"@106",value:"YAP"},{label:"@107",value:"HYPE"},{label:"@108",value:"CHEF"},{label:"@109",value:"WOW"},{label:"@11",value:"PEPE"},{label:"@110",value:"STEEL"},{label:"@111",value:"RETARD"},{label:"@113",value:"NEIRO"},{label:"@114",value:"PEAR"},{label:"@116",value:"MUNCH"},{label:"@118",value:"GENESY"},{label:"@119",value:"BUBZ"},{label:"@120",value:"PICKL"},{label:"@121",value:"SHEEP"},{label:"@122",value:"LAUNCH"},{label:"@124",value:"FLASK"},{label:"@125",value:"VAULT"},{label:"@126",value:"CAT"},{label:"@127",value:"HYENA"},{label:"@128",value:"DEPIN"},{label:"@129",value:"MON"},{label:"@13",value:"RUG"},{label:"@130",value:"BEATS"},{label:"@133",value:"H"},{label:"@137",value:"FLY"},{label:"@138",value:"TIME"},{label:"@139",value:"SOVRN"},{label:"@14",value:"ILIENS"},{label:"@15",value:"FUCKY"},{label:"@17",value:"BAGS"},{label:"@19",value:"TATE"},{label:"@2",value:"LICK"},{label:"@20",value:"PUMP"},{label:"@23",value:"SCHIZO"},{label:"@24",value:"SELL"},{label:"@26",value:"CATNIP"},{label:"@27",value:"HBOOST"},{label:"@28",value:"SUCKY"},{label:"@29",value:"GUP"},{label:"@35",value:"VEGAS"},{label:"@37",value:"VAPOR"},{label:"@38",value:"PANDA"},{label:"@39",value:"PILL"},{label:"@40",value:"ADHD"},{label:"@41",value:"FUN"},{label:"@42",value:"LADY"},{label:"@46",value:"DROP"},{label:"@47",value:"MBAPPE"},{label:"@48",value:"TEST"},{label:"@49",value:"RAGE"},{label:"@5",value:"SIX"},{label:"@50",value:"FRAC"},{label:"@51",value:"ATEHUN"},{label:"@52",value:"COZY"},{label:"@53",value:"ARI"},{label:"@54",value:"WASH"},{label:"@55",value:"ANT"},{label:"@59",value:"CATBAL"},{label:"@60",value:"TJIF"},{label:"@61",value:"GUESS"},{label:"@62",value:"MAXI"},{label:"@63",value:"NMTD"},{label:"@66",value:"RISE"},{label:"@67",value:"CINDY"},{label:"@70",value:"FRIED"},{label:"@73",value:"RANK"},{label:"@74",value:"OMNIX"},{label:"@75",value:"RIP"},{label:"@76",value:"G"},{label:"@77",value:"BOZO"},{label:"@78",value:"SPH"},{label:"@82",value:"BUSSY"},{label:"@83",value:"FATCAT"},{label:"@84",value:"SHREK"},{label:"@85",value:"PIP"},{label:"@86",value:"LQNA"},{label:"@87",value:"NASDAQ"},{label:"@88",value:"YEETI"},{label:"@9",value:"TRUMP"},{label:"@90",value:"FEIT"},{label:"@92",value:"VIZN"},{label:"@93",value:"STRICT"},{label:"@94",value:"AUTIST"},{label:"@96",value:"HGOD"},{label:"@97",value:"LIQUID"},{label:"@36",value:"ASI"},{label:"@4",value:"JEFF"},{label:"@43",value:"MOG"},{label:"@44",value:"HPEPE"},{label:"@45",value:"JEET"},{label:"@57",value:"RICH"},{label:"@58",value:"LORA"},{label:"@6",value:"WAGMI"},{label:"@65",value:"PIGEON"},{label:"@64",value:"HPUMP"},{label:"@69",value:"STACK"},{label:"@7",value:"CAPPY"},{label:"@72",value:"NOCEX"},{label:"@79",value:"SHOE"},{label:"@80",value:"MONAD"},{label:"@81",value:"HOPE"},{label:"@89",value:"SYLVI"},{label:"@91",value:"FRUDO"},{label:"@95",value:"MAGA"},{label:"@99",value:"EARTH"},{label:"@56",value:"NFT"},{label:"@8",value:"POINTS"},{label:"@68",value:"CHINA"},{label:"@141",value:"GOD"}];function Pt(ue,rt){const Ft=rt.map(({fill:yt,twapId:hn})=>({...yt,twapId:hn}));return[...ue,...Ft]}const Xe=(ue,rt)=>{const Ft=Et(rt,ue);o.current={...o.current,[ue]:Ft},a(Object.values(o.current).flat()),d(!1)};m.useEffect(()=>{e&&(async()=>{const ue=await Oce(e),rt=await Mce(e),Ft=Pt(ue,rt),{closed_positions:yt}=Rce(Ft);J(yt)})()},[e]);const Ut=(t??[]).map(ue=>{var rt;return(rt=ue.wallet_address)==null?void 0:rt.toLowerCase()}).filter(Boolean),Lt=m.useMemo(()=>[...new Set(Ut)].sort().join("|"),[Ut.join("|")]);m.useEffect(()=>{if(!t||t.length===0)return;const ue=t.map(Ft=>Ft.wallet_address.toLowerCase());if(ue.length===0)return;let rt=!0;return c(!0),d(!0),(async()=>{try{const Ft=await Promise.all(ue.map(async Nr=>{const[fr,cr]=await Promise.all([ds.post(oC,{aggregateByTime:!0,type:"userFills",user:Nr}),ds.post(oC,{type:"clearinghouseState",user:Nr})]);return{addr:Nr,fills:fr.data??[],state:cr.data}}));if(!rt)return;const yt=Ft.flatMap(Nr=>Nr.fills),hn=pt(yt);r(hn);const vn=Ft.flatMap(Nr=>{var fr;return(fr=Nr.state)!=null&&fr.assetPositions?Nr.state.assetPositions.map(cr=>({...cr,_wallet:Nr.addr})):[]}),lr=Et({assetPositions:vn});a(lr),qe(ue)}catch(Ft){console.error("Multi-wallet fetch error:",Ft)}finally{rt&&c(!1)}})(),()=>{rt=!1}},[Lt]),m.useEffect(()=>(e&&(F.current=e,Ke(e)),()=>{P.current&&(P.current.close(),P.current=null),U.current&&(clearTimeout(U.current),U.current=null),L.current&&(clearInterval(L.current),L.current=null)}),[e]),m.useEffect(()=>{const ue=async()=>{var rt;document.visibilityState==="visible"&&(((rt=P.current)==null?void 0:rt.readyState)!==WebSocket.OPEN&&qe(F.current.split("|")),F.current.split("|").forEach(Ft=>{ds.post(oC,{type:"clearinghouseState",user:Ft}).then(yt=>Xe(Ft,yt.data))}))};return document.addEventListener("visibilitychange",ue),()=>document.removeEventListener("visibilitychange",ue)},[]),m.useEffect(()=>{const ue=localStorage.getItem("favoriteAddresses");ue&&Q(JSON.parse(ue))},[]);const qe=ue=>{var Ft;const rt=Array.isArray(ue)?ue:[ue];o.current={},a([]),!(((Ft=P.current)==null?void 0:Ft.readyState)===WebSocket.OPEN&&F.current===Re)&&(L.current&&(clearInterval(L.current),L.current=null),U.current&&(clearTimeout(U.current),U.current=null),P.current&&(P.current.close(),P.current=null),F.current=rt.join("|"),P.current=new WebSocket(Iin),P.current.onopen=()=>{console.log("WebSocket Connected"),C(!0);const yt=[];rt.forEach(hn=>{yt.push({method:"subscribe",subscription:{aggregateByTime:!0,type:"userFills",user:hn}},{method:"subscribe",subscription:{type:"user",user:hn}},{method:"subscribe",subscription:{type:"webData2",user:hn}},{method:"subscribe",subscription:{type:"userTwapSliceFills",user:hn}})}),yt.forEach(hn=>{P.current.send(JSON.stringify(hn))}),L.current=setInterval(()=>{var hn;if(((hn=P.current)==null?void 0:hn.readyState)===WebSocket.OPEN){const vn={id:99,method:"ping"};P.current.send(JSON.stringify(vn))}},3e4)},P.current.onclose=yt=>{C(!1),L.current&&(clearInterval(L.current),L.current=null),yt.code!==1e3&&(U.current||(U.current=setTimeout(()=>{U.current=null,F.current===Re&&qe([Re])},5e3)))},P.current.onerror=yt=>{console.error("WebSocket Error:",yt),C(!1)},P.current.onmessage=yt=>{var hn,vn,lr,Nr;try{const fr=JSON.parse(yt.data);if(fr.method==="pong"||fr.result==="success")return;if(fr.channel==="userFills"&&((hn=fr.data)!=null&&hn.fills)&&F.current.toLowerCase()===fr.data.user.toLowerCase()&&r(cr=>{const ts=cr.flatMap(Jn=>Jn.fills),is=new Map;ts.forEach(Jn=>{is.set(Jn.hash,!0)});const Or=fr.data.fills.filter(Jn=>!is.has(Jn.hash));if(Or.length===0)return cr;const hr=[...Or,...ts];return pt(hr)}),fr.channel==="webData2"&&((vn=fr.data)!=null&&vn.clearinghouseState)&&(v(fr.data.clearinghouseState),Xe(fr.data.user.toLowerCase(),fr.data.clearinghouseState)),fr.channel==="user"&&((lr=fr.data)!=null&&lr.fills&&r(cr=>{const ts=cr.flatMap(Jn=>Jn.fills),is=new Map;ts.forEach(Jn=>{is.set(Jn.hash,!0)});const Or=fr.data.fills.filter(Jn=>!is.has(Jn.hash));if(Or.length===0)return cr;const hr=[...Or,...ts];return pt(hr)}),(Nr=fr.data)!=null&&Nr.state)){v(fr.data.state);const cr=Et(fr.data.state);a(cr)}if(fr.channel==="userTwapSliceFills"){const cr=fr==null?void 0:fr.data;if(!ct||ct.length===0||!cr||cr.length===0)return;const ts=cr==null?void 0:cr.map(Or=>({...Or.fill,twapId:Or.twapId||null})),is=[...ct];ts.forEach(Or=>{const hr=is==null?void 0:is.findIndex(Jn=>Jn.oid===Or.oid);hr!==-1?is[hr]={...is[hr],...Or}:is.unshift(Or)}),Vt(is)}}catch(fr){console.error("Error processing WebSocket message:",fr),console.error("Raw message that caused error:",yt.data)}})},Ke=async ue=>{const[rt,Ft]=await Promise.all([ds.post(oC,{aggregateByTime:!0,type:"userFills",user:ue}),ds.post(oC,{type:"clearinghouseState",user:ue})]);if(Ft.data&&Xe(ue.toLowerCase(),Ft.data),!ue){ln.error("Please enter a wallet address");return}if(!ue.match(/^0x[a-fA-F0-9]{40}$/)){ln.error("Please enter a valid Ethereum address");return}c(!0),d(!0);try{ue!==e&&R(`/wallet-details/${ue}`),qe(ue);const yt=await ds.post(oC,{aggregateByTime:!0,type:"userFills",user:ue});if(yt.data&&Array.isArray(yt.data)){const hn=pt(yt.data);r(hn),x(1)}else console.error("Invalid response format:",yt.data)}catch(yt){console.error("Error fetching data:",yt)}finally{c(!1)}},pt=ue=>{const rt=[...ue].sort((yt,hn)=>hn.time-yt.time),Ft=new Map;return rt.forEach(yt=>{var vn;const hn=yt.oid;if(!Ft.has(hn)){const lr=rt.filter(hr=>hr.oid===yt.oid),Nr=lr.reduce((hr,Jn)=>hr+parseFloat(Jn.sz),0),fr=lr.map(hr=>parseFloat(hr.startPosition));let cr;fr.includes(0)?cr=0:fr.every(hr=>hr>0)?cr=Math.max(...fr):fr.every(hr=>hr<0)?cr=Math.min(...fr):cr=lr.reduce((hr,Jn)=>hr+parseFloat(Jn.startPosition),0);const ts=lr.reduce((hr,Jn)=>hr+parseFloat(Jn.sz)*parseFloat(Jn.px),0),is=lr.reduce((hr,Jn)=>hr+parseFloat(Jn.closedPnl||0),0),Or=((vn=lr.find(hr=>hr.dir==="Long > Short"||hr.dir==="Short > Long"))==null?void 0:vn.dir)||"";Ft.set(hn,{oid:yt.oid,asset:yt.coin,direction:Or==""?yt.dir:Or,fills:lr,totalSize:Nr,totalStartPositions:cr,totalValue:ts,pnl:is,latestFill:yt.time,isLiquidation:!!yt.liquidation})}}),Array.from(Ft.values()).sort((yt,hn)=>hn.latestFill-yt.latestFill)},en=ue=>{const rt=new Date(ue),Ft=rt.toLocaleString("en-US",{month:"short"}),yt=rt.getDate(),hn=rt.getFullYear(),vn=rt.getHours().toString().padStart(2,"0"),lr=rt.getMinutes().toString().padStart(2,"0"),Nr=rt.getHours()>=12?" PM":" AM";return`${Ft} ${yt}, ${hn}, ${vn}:${lr} ${Nr}`},Bt=n,Et=(ue,rt="")=>{if(!(ue!=null&&ue.assetPositions))return[];const Ft=new Map;return n.forEach(yt=>{yt.fills.forEach(hn=>{let vn="";hn.dir.includes("Open")?vn=hn.dir.includes("Long")?"Long":"Short":hn.side==="B"?vn="Long":hn.side==="S"&&(vn="Short");const lr=`${hn.coin}-${vn}`;(!Ft.has(lr)||hn.time<Ft.get(lr))&&Ft.set(lr,hn.time)})}),ue.assetPositions.filter(yt=>{if(!yt.position||!yt.position.szi)return!1;const hn=parseFloat(yt.position.szi);return!isNaN(hn)&&hn!==0}).map(yt=>{const hn=yt._wallet||rt||(e==null?void 0:e.toLowerCase()),vn=yt.position,lr=parseFloat(vn.szi),Nr=parseFloat(vn.entryPx),fr=parseFloat(vn.positionValue),cr=parseFloat(vn.unrealizedPnl),ts=parseFloat(vn.returnOnEquity)*100,is=parseFloat(vn.marginUsed),Or=vn.leverage.value,hr=vn.leverage.type,Jn=parseFloat(vn.cumFunding.sinceOpen),vs=lr>0?"Long":"Short",si=Ft.get(`${vn.coin}-${vs}`);return{wallet:hn,asset:vn.coin,type:vs,size:lr,entryPrice:Nr.toFixed(4),currentPrice:(fr/Math.abs(lr)).toFixed(4),leverage:Or,marginMode:hr,positionValue:fr.toFixed(2),marginUsed:is.toFixed(2),unrealizedPnl:cr.toFixed(2),roe:ts.toFixed(2),funding:Jn.toFixed(4),startTime:si?en(si):"N/A",liquidationPrice:vn.liquidationPx?parseFloat(vn.liquidationPx).toFixed(2):"N/A"}})};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(X(),Y())},[]);const et=m.useRef(null),Be=()=>{et.current&&(et.current.scrollLeft-=200)},Mt=()=>{et.current&&(et.current.scrollLeft+=200)},Ve=()=>{et.current&&(et.current.scrollTop+=200)},ut=()=>{et.current&&(et.current.scrollTop-=200)};m.useRef(null);const xt=m.useRef(null),jt=()=>{xt.current&&(xt.current.scrollLeft-=200)},kt=()=>{xt.current&&(xt.current.scrollLeft+=200)},xn=()=>{xt.current&&(xt.current.scrollTop+=200)},un=()=>{xt.current&&(xt.current.scrollTop-=200)};m.useRef(null),m.useEffect(()=>{(async()=>{var yt,hn;const rt=window.localStorage.getItem("hyperToken"),Ft=window.localStorage.getItem("hyperAddress");if(!(!rt||!Ft))try{const vn=await ji(Ft.toLowerCase(),rt);vn!=null&&vn.success?(ie(vn==null?void 0:vn.telegram_chat_id),oe(vn==null?void 0:vn.subscriber_role),G(vn==null?void 0:vn.subs_expire_day),V((yt=vn==null?void 0:vn.mushboomer_counts)==null?void 0:yt.eth),te((hn=vn==null?void 0:vn.mushboomer_counts)==null?void 0:hn.sol),ae(vn==null?void 0:vn.referral_code),Ce(vn==null?void 0:vn.refcode),ce(vn==null?void 0:vn.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ge(""),Ae(""))}catch(vn){console.error("Token verification error:",vn),console.error(vn.message||"An unknown error occurred.")}})()},[]);const On=["Open Position","Increase","Decrease","Changed Position","Position Closed","Spot","Liquidation"],En="-latestFill",[jn,bn]=m.useState(En),[Zn,zn]=m.useState([]),[$n,nr]=m.useState(""),[wn,on]=m.useState(""),[Oe,rn]=m.useState(""),[cn,_t]=m.useState(!1),[Yn,yn]=m.useState(!1),[Dt,sn]=m.useState(!1),[Tn,Kn]=m.useState(!1),ir=m.useRef(null),rr=m.useRef(null),Jt=m.useRef(null),Un=m.useRef(null),Qn=ue=>{zn(rt=>rt.includes(ue)?rt.filter(Ft=>Ft!==ue):[...rt,ue])};m.useEffect(()=>{function ue(rt){ir.current&&!ir.current.contains(rt.target)&&_t(!1),rr.current&&!rr.current.contains(rt.target)&&yn(!1),Jt.current&&!Jt.current.contains(rt.target)&&sn(!1),Un.current&&!Un.current.contains(rt.target)&&Kn(!1)}return document.addEventListener("mousedown",ue),()=>document.removeEventListener("mousedown",ue)},[]);const Rt=Bt.map(ue=>{let rt=ue.isLiquidation?"Liquidation":ue.totalStartPositions==0?"Open Position":ue.direction!="Short > Long"&&ue.direction!="Long > Short"?(ue==null?void 0:ue.totalSize)-Math.abs(ue==null?void 0:ue.totalStartPositions)==0&&(ue.direction=="Close Long"||ue.direction=="Close Short")?"Position Closed":ue.direction=="Open Short"||ue.direction=="Open Long"?"Increase":ue.direction=="Close Long"||ue.direction=="Close Short"?"Decrease":ue.direction=="Sell"||ue.direction=="Buy"?"Spot":"Changed Position":ue.direction=="Short > Long"||ue.direction=="Long > Short"?"Changed Position":"Open Position";return{...ue,computedType:rt}}),Pn=ue=>{const rt=dn.find(Ft=>Ft.label===ue);return rt?rt.value.toUpperCase():ue==null?void 0:ue.toUpperCase()},Ee=Rt.filter(ue=>Zn.length?Zn.includes(ue.computedType):!0).filter(ue=>{var rt,Ft;return $n?(Ft=(rt=ue==null?void 0:ue.oid)==null?void 0:rt.toString())==null?void 0:Ft.includes($n):!0}).filter(ue=>wn?Pn(ue.asset).includes(wn.toUpperCase()):!0),p=ue=>Ee==null?void 0:Ee.sort((rt,Ft)=>{var is,Or,hr,Jn;const yt=rt.totalSize?rt.totalValue/rt.totalSize:0,hn=Ft.totalSize?Ft.totalValue/Ft.totalSize:0,vn=vs=>{const si=dn.find(ni=>ni.label===vs);return si?si.value.toUpperCase():vs==null?void 0:vs.toUpperCase()},lr=vn(rt.asset),Nr=vn(Ft.asset),fr=vs=>{if(!vs)return"";const si=vs.toLowerCase();return si.includes("short")?"Short":si.includes("long")?"Long":si==="buy"?"Buy":si==="sell"?"Sell":vs},cr=fr(rt.direction),ts=fr(Ft.direction);if(ue==="-totalSize")return Ft.totalSize-rt.totalSize;if(ue==="totalSize")return rt.totalSize-Ft.totalSize;if(ue==="-pnl")return Ft.pnl-rt.pnl;if(ue==="pnl")return rt.pnl-Ft.pnl;if(ue==="-fills")return(((is=Ft.fills)==null?void 0:is.length)||0)-(((Or=rt.fills)==null?void 0:Or.length)||0);if(ue==="fills")return(((hr=rt.fills)==null?void 0:hr.length)||0)-(((Jn=Ft.fills)==null?void 0:Jn.length)||0);if(ue==="-latestFill")return new Date(Ft.latestFill)-new Date(rt.latestFill);if(ue==="latestFill")return new Date(rt.latestFill)-new Date(Ft.latestFill);if(ue==="-avgPrice")return hn-yt;if(ue==="avgPrice")return yt-hn;if(ue==="-oid")return Ft.oid-rt.oid;if(ue==="oid")return rt.oid-Ft.oid;if(ue==="direction"){const vs={Short:1,Sell:2,Long:3,Buy:4};return(vs[cr]||99)-(vs[ts]||99)}else if(ue==="-direction"){const vs={Long:1,Buy:2,Short:3,Sell:4};return(vs[cr]||99)-(vs[ts]||99)}else{if(ue==="-coin")return lr<Nr?-1:lr>Nr?1:0;if(ue==="coin")return lr>Nr?-1:lr<Nr?1:0}return 0}),h=p(jn).filter(ue=>(ue.totalStartPositions==0?"Open Position":ue.direction!="Short > Long"&&ue.direction!="Long > Short"?(ue==null?void 0:ue.totalSize)-Math.abs(ue==null?void 0:ue.totalStartPositions)==0&&(ue.direction=="Close Long"||ue.direction=="Close Short")?"Position Closed":ue.direction=="Open Short"||ue.direction=="Open Long"?"Increase":ue.direction=="Close Long"||ue.direction=="Close Short"?"Decrease":ue.direction=="Sell"||ue.direction=="Buy"?"Spot":"Changed Position":ue.direction=="Short > Long"||ue.direction=="Long > Short"?"Changed Position":"Open Position")==="Open Position"),S={};h.forEach(ue=>{var yt;const rt=ue==null?void 0:ue.asset,Ft=new Date(ue==null?void 0:ue.latestFill).getTime();if(!S[rt])S[rt]=ue;else{const hn=new Date((yt=S[rt])==null?void 0:yt.latestFill).getTime();Ft>hn&&(S[rt]=ue)}});const _=Object.values(S),[k,T]=m.useState([]),B=s==null?void 0:s.filter(ue=>{var rt;return Oe?(rt=ue.asset)==null?void 0:rt.toLowerCase().includes(Oe.toLowerCase()):!0}).map(ue=>{const rt=_.find(yt=>(yt==null?void 0:yt.asset)===(ue==null?void 0:ue.asset)),Ft=k.find(yt=>yt.coin===ue.asset&&(yt.wallet||"").toLowerCase()===(ue.wallet||"").toLowerCase());return{...ue,latestFill:(rt==null?void 0:rt.latestFill)||null,tagName:(Ft==null?void 0:Ft.tag)||null,tagWallet:(Ft==null?void 0:Ft.cp_wallet)||null}}),W="-unrealizedPnl",[ee,de]=m.useState(W),fe=ue=>B==null?void 0:B.sort((rt,Ft)=>{const yt=rt.tagName?rt.tagName.toUpperCase():"",hn=Ft.tagName?Ft.tagName.toUpperCase():"",vn=rt.asset?rt.asset.toUpperCase():"",lr=Ft.asset?Ft.asset.toUpperCase():"",Nr=rt.type==="Long"?1:0,fr=Ft.type==="Long"?1:0,cr=rt.type==="Short"?1:0,ts=Ft.type==="Short"?1:0;return ue==="-unrealizedPnl"?Ft.unrealizedPnl-rt.unrealizedPnl:ue==="unrealizedPnl"?rt.unrealizedPnl-Ft.unrealizedPnl:ue==="-roe"?Ft.roe-rt.roe:ue==="roe"?rt.roe-Ft.roe:ue==="-size"?Ft.size-rt.size:ue==="size"?rt.size-Ft.size:ue==="-entryPrice"?Ft.entryPrice-rt.entryPrice:ue==="entryPrice"?rt.entryPrice-Ft.entryPrice:ue==="-currentPrice"?Ft.currentPrice-rt.currentPrice:ue==="currentPrice"?rt.currentPrice-Ft.currentPrice:ue==="-leverage"?Ft.leverage-rt.leverage:ue==="leverage"?rt.leverage-Ft.leverage:ue==="-positionValue"?Ft.positionValue-rt.positionValue:ue==="positionValue"?rt.positionValue-Ft.positionValue:ue==="-marginUsed"?Ft.marginUsed-rt.marginUsed:ue==="marginUsed"?rt.marginUsed-Ft.marginUsed:ue==="funding"?Ft.funding-rt.funding:ue==="-funding"?rt.funding-Ft.funding:ue==="-liquidationPrice"?Ft.liquidationPrice-rt.liquidationPrice:ue==="liquidationPrice"?rt.liquidationPrice-Ft.liquidationPrice:ue==="-entryTime"?new Date(Ft.latestFill)-new Date(rt.latestFill):ue==="entryTime"?new Date(rt.latestFill)-new Date(Ft.latestFill):ue==="-source_tag"?yt<hn?-1:yt>hn?1:0:ue==="source_tag"?yt>hn?-1:yt<hn?1:0:ue==="-type_leverage"?Nr!==fr?fr-Nr:Ft.leverage-rt.leverage:ue==="type_leverage"?cr!==ts?ts-cr:Ft.leverage-rt.leverage:ue==="-asset"?vn<lr?-1:vn>lr?1:0:ue==="asset"?vn>lr?-1:vn<lr?1:0:0}),[xe,we]=m.useState([]),[ke,Me]=m.useState(!0),[Ye,Fe]=m.useState(null),[st,se]=m.useState([]),[Se,De]=m.useState(!0),[Le,_e]=m.useState(null),[nt,lt]=m.useState([]),[bt,Zt]=m.useState(!0),[Ge,Je]=m.useState(null);async function We(){try{Me(!0);const ue=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=1&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ue.ok)throw new Error(`HTTP error! status: ${ue.status}`);const rt=await ue.json();we(rt.results)}catch(ue){console.error("Error resetting filters:",ue),Fe(ue.message)}finally{Me(!1)}}async function wt(){try{De(!0);const ue=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=7&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ue.ok)throw new Error(`HTTP error! status: ${ue.status}`);const rt=await ue.json();se(rt.results)}catch(ue){console.error("Error resetting filters:",ue),_e(ue.message)}finally{De(!1)}}async function At(){try{Zt(!0);const ue=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=30&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ue.ok)throw new Error(`HTTP error! status: ${ue.status}`);const rt=await ue.json();lt(rt.results)}catch(ue){console.error("Error resetting filters:",ue),Je(ue.message)}finally{Zt(!1)}}m.useEffect(()=>{We(),wt(),At()},[]),m.useState("7D"),m.useState("7D"),s.length,s.filter(ue=>ue.unrealizedPnl>=0).length;const[Gt,fn]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0});((mi=fe(ee))==null?void 0:mi.reduce((ue,rt)=>ue+((rt==null?void 0:rt.leverage)||0),0))/(((ns=fe(ee))==null?void 0:ns.length)||1),(Xt=fe(ee))==null||Xt.reduce((ue,rt)=>{const Ft=parseFloat(rt==null?void 0:rt.funding)||0;return ue+Ft},0);const pr=localStorage.getItem("isDateOpenPositionsFormat")||"date",[mt,qt]=m.useState(pr);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsFormat",mt)},[mt]);const In=localStorage.getItem("isDateFillsFormat")||"date",[or,Wn]=m.useState(In);m.useEffect(()=>{localStorage.setItem("isDateFillsFormat",or)},[or]);function Vn({date:ue}){const[rt,Ft]=m.useState(Oo(ue));return m.useEffect(()=>{const yt=setInterval(()=>{Ft(Oo(ue))},1e3);return()=>clearInterval(yt)},[ue]),i.jsx("span",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:rt.dateTime})}const[gr,Ir]=m.useState([]),Fr=async()=>{try{const ue=window.localStorage.getItem("hyperToken");if(!ue){ye(!0);return}const rt="https://dextrabothypev2.nftinit.io/api/wallet/list",Ft=window.localStorage.getItem("hyperAddress"),hn=await(await fetch(rt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():Ft,token:ue,balance:"false"})})).json();hn!=null&&hn.success?(Ir(hn.data||[]),As(hn.data)):console.log(hn.error_message)}catch(ue){console.error("Error fetching generate wallet list:",ue)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&Fr()},[re]);const[Lr,Ht]=m.useState([]),[nn,Sr]=m.useState(!0),[Br,Kr]=m.useState(!1);m.useEffect(()=>{B&&B.length>0&&(ms(),gr.length>0&&nn&&As())},[B]);const As=()=>{Lr.length!==0&&(vr(Lr),nn&&Sr(!1))};m.useEffect(()=>{const ue=window.localStorage.getItem("hyperToken");Lr.length&&ue&&vr(Lr)},[Lr]);const ms=()=>{const ue=window.localStorage.getItem("hyperToken");let rt=!1;const Ft=[...Lr];B.forEach(yt=>{var Nr;const hn=yt.asset,vn=(Nr=yt.wallet||e)==null?void 0:Nr.toLowerCase();Ft.some(fr=>fr.coin===hn&&(fr.wallet||"").toLowerCase()===vn)||(Ft.push({coin:hn,wallet:vn}),rt=!0)}),rt&&(Ht(Ft),gr.some(hn=>hn.wallet_address===(e==null?void 0:e.toLowerCase()))&&ue&&vr(Ft))},vr=async ue=>{if(!Br)try{Kr(!0);const rt=window.localStorage.getItem("hyperToken"),Ft="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!rt||!ue){Kr(!1);return}rt||ye(!0);const yt=window.localStorage.getItem("hyperAddress"),vn=await(await fetch(Ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():yt,token:rt,positions:ue})})).json();vn.success?T(vn==null?void 0:vn.data):(console.log(vn.error_message),ln.error(vn.error_message))}catch(rt){console.error("Error tag request",rt),ln.error(rt.message)}finally{Kr(!1)}},Yr=(t==null?void 0:t.length)>1||gr.some(ue=>ue.wallet_address===(e==null?void 0:e.toLowerCase())),vi=async(ue,rt,Ft,yt,hn)=>{if(!ue||!Ft||!yt||!hn){console.error("Close order called with invalid parameters"),ln.error("Close order called with invalid parameters");return}const vn=`${yt}_${Ft}_${hn}`;try{tt(is=>({...is,[vn]:!0}));const lr=window.localStorage.getItem("hyperToken"),Nr="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_new/";if(!lr){ye(!0),tt(is=>({...is,[vn]:!1}));return}const fr=window.localStorage.getItem("hyperAddress"),cr=await fetch(Nr,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():fr,token:lr,coin:Ft,wallet_id:ue.toString(),leverage:yt,size:hn})});if(!cr.ok)throw new Error(`Server responded with status ${cr.status}`);const ts=await cr.json();ts.success?(tt(is=>({...is,[vn]:!1})),ln.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):ts.status=="ok"?(tt(is=>({...is,[vn]:!1})),ln.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(console.error("Something went wrong!"),ln.error("Something went wrong!"),tt(is=>({...is,[vn]:!1})))}catch{console.error("Something went wrong!"),ln.error("Something went wrong!"),tt(Nr=>({...Nr,[vn]:!1}))}},_r=async(ue=[])=>{if(ue.length!==0){ft(!0);try{await Promise.all(ue.map(rt=>os(rt)))}finally{ft(!1)}}},os=async ue=>{if((B==null?void 0:B.length)===0){ln.success("There are no open positions to closes.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(!ue){console.error("Close order called with invalid parameters"),ln.error("Close order called with invalid parameters");return}try{ft(!0);const rt=window.localStorage.getItem("hyperToken"),Ft="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!rt){ye(!0),ft(!1);return}const yt=window.localStorage.getItem("hyperAddress"),hn=await fetch(Ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():yt,token:rt,wallet_id:ue.toString()})});if(!hn.ok)throw new Error(`Server responded with status ${hn.status}`);const vn=await hn.json();vn.status=="ok"?(ft(!1),ln.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"400px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):vn.success?(ft(!1),ln.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log("Close order operation failed."),ln.error("Close order operation failed."),ft(!1))}catch(rt){throw console.error("Something went wrong!"),ln.error("Something went wrong!"),ft(!1),rt}},Gs={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"w-full",children:[i.jsx(hT,{open:Qe,setOpen:$e,data:Gt,setTradeInfo:fn}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 mb-2 mx-4 mt-4 relative overflow-x-auto whitespace-nowrap scrollbar-hide [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[i.jsx("div",{className:"absolute bottom-0 left-0 w-[80%] h-[1px] bg-[#2A2A2A]"}),i.jsx("div",{onClick:()=>I("positions"),className:`${N==="positions"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsxs("div",{className:"flex items-center text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none min-w-max",children:[i.jsx("span",{className:"mr-2",children:"Open Positions"}),i.jsx("span",{className:"flex w-[22px] h-[22px] px-3 justify-center items-center gap-[2px] flex-shrink-0 rounded-md bg-[rgba(103,255,189,0.16)] text-[14px] font-semibold font-manrope",children:s.length})]})}),i.jsx("div",{onClick:()=>I("fills"),className:`${N==="fills"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:"text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Fills"})}),i.jsx("div",{onClick:()=>I("trade-history"),className:`${N==="trade-history"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Trade History"})}),i.jsx("div",{onClick:()=>I("twap-history"),className:`${N==="twap-history"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} ${Nt.pathname.startsWith("/wallet-details")?"":"hidden"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Twap History"})}),i.jsx("div",{onClick:()=>I("completed-trades"),className:`${N==="completed-trades"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Completed Trades"})}),i.jsx("div",{onClick:()=>I("deposit-withdraw"),className:`${N==="deposit-withdraw"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Deposits & Withdrawals"})}),!mn&&i.jsxs("div",{onClick:()=>window.open(`https://hypurrscan.io/address/${e}`,"_blank"),className:"h-6 px-2 py-3 justify-center items-center gap-2.5 inline-flex cursor-pointer",children:[i.jsx("img",{src:Ybt,className:"w-[19px] h-[18px]"}),i.jsx("div",{className:"text-[#C1C1C1] text-[13px] font-semibold font-manrope leading-[8px] hover:text-[#67FFBD]",children:"HypurrScan"})]})]}),N==="fills"?i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 justify-start items-center gap-2 hidden lg:flex",children:[i.jsx("button",{onClick:jt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:kt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:un,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:xn,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:xt,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky bg-[#161616] left-0 h-10 pl-2 sm:pl-6 min-w-[130px] max-w-[130px] sm:min-w-[150px] sm:max-w-[150px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(di,{title:"Coin",sortKey:"coin",sortOption:jn,setSortOption:bn,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>sn(!Dt),className:`${wn?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${wn?"text-blue-500":"text-white"}`})}),Dt&&i.jsxs("div",{ref:Jt,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>on(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:wn,onChange:ue=>on(ue.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx(WY,{className:"pl-4 min-w-[120px] max-w-[120px] sm:min-w-[144px] sm:max-w-[144px] px-1",title:"Direction",sortKey:"direction",sortOption:jn,setSortOption:bn}),i.jsx("th",{scope:"col",className:"pl-4 min-w-[150px] max-w-[150px] px-1 relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max",children:[i.jsx("div",{className:"flex items-center justify-start group",children:"Type"}),i.jsx("button",{onClick:()=>_t(!cn),className:`${Zn.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${Zn.length>0?"text-blue-500":"text-white"}`})}),cn&&i.jsxs("div",{ref:ir,className:"absolute left-[60px] mt-60 w-48 bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10",children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>zn([]),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),On.map(ue=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",checked:Zn.includes(ue),onChange:()=>Qn(ue),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${Zn.includes(ue)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:Zn.includes(ue)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),ue]},ue))]})]})}),i.jsx(Md,{className:"min-w-[80px] max-w-[80px] px-1",title:"Size",sortKey:"totalSize",sortOption:jn,setSortOption:bn}),i.jsx(Md,{className:"min-w-[110px] max-w-[110px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Avg. Price",sortKey:"avgPrice",sortOption:jn,setSortOption:bn}),i.jsx(Md,{className:"min-w-[100px] max-w-[100px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"PnL",sortKey:"pnl",sortOption:jn,setSortOption:bn}),i.jsx(Md,{className:"min-w-[100px] max-w-[100px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"Fill Count",sortKey:"fills",sortOption:jn,setSortOption:bn}),i.jsx(Md,{className:"min-w-[200px] max-w-[200px] px-1",title:"Latest Fill",sortKey:"latestFill",sortOption:jn,setSortOption:bn}),i.jsx("th",{scope:"col",className:"min-w-[160px] max-w-[160px] pl-1 pr-8 relative",children:i.jsxs("div",{className:"flex justify-end items-center gap-2",children:[i.jsx(di,{title:"Order ID",sortKey:"oid",sortOption:jn,setSortOption:bn,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>yn(!Yn),className:`${$n?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${$n?"text-blue-500":"text-white"}`})}),Yn&&i.jsxs("div",{ref:rr,className:`absolute right-[30px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>nr(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"number",value:$n,onChange:ue=>nr(ue.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Order ID"})]})]})]})})]})}),i.jsx("tbody",{children:p(jn).length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No fills are currently available"}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"To view completed trades, please check your order history"})})]})]})})})})}):p(jn).map((ue,rt)=>{var yt,hn,vn,lr,Nr,fr;const Ft=ue.totalValue/ue.totalSize;return(yt=ue==null?void 0:ue.direction)==null||yt.includes("Long"),i.jsxs(Ne.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl",children:i.jsx("div",{onClick:()=>{var cr;window.open(`/terminal/${((cr=dn.find(ts=>ts.label===ue.asset))==null?void 0:cr.value)||ue.asset}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${((hn=dn.find(cr=>cr.label===ue.asset))==null?void 0:hn.value)||Gs[ue.asset]||((vn=ue.asset)==null?void 0:vn.split("/")[0])}.svg`||Va,alt:ue==null?void 0:ue.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:cr=>ra(cr)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:(()=>{const cr=dn.find(ts=>ts.label===ue.asset);return cr?cr.value:ue.asset})()})]})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-4 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${(lr=ue.direction)!=null&&lr.includes("Long")?ue.direction==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":ue.direction==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":ue.direction=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:(Nr=ue.direction)!=null&&Nr.includes("Long")?ue.direction==="Short > Long"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):ue.direction==="Long > Short"?i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):ue.direction=="Buy"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:ue.direction=="Sell"?"Sell":ue.direction=="Buy"?"Buy":ue.direction=="Close Short"?"Short":ue.direction=="Close Long"?"Long":ue.direction=="Open Short"?"Short":ue.direction=="Open Long"?"Long":ue.direction})]})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-4 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsx("div",{className:"text-white h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex",children:i.jsx("div",{className:`${ue!=null&&ue.isLiquidation?"text-[#ff787b]":"text-white"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max`,children:ue!=null&&ue.isLiquidation?`Market Liquidation: ${ue.direction=="Sell"?"Sell":ue.direction=="Buy"?"Buy":ue.direction=="Close Short"?"Close Short":ue.direction=="Close Long"?"Close Long":ue.direction=="Open Short"?"Close Short":ue.direction=="Open Long"?"Close Long":"Close "+ue.direction} `:ue.totalStartPositions==0?"Open Position":ue.direction!="Short > Long"&&ue.direction!="Long > Short"?(ue==null?void 0:ue.totalSize)-Math.abs(ue==null?void 0:ue.totalStartPositions)==0&&(ue.direction=="Close Long"||ue.direction=="Close Short")?"Position Closed":ue.direction=="Open Short"||ue.direction=="Open Long"?"Increase":ue.direction=="Close Long"||ue.direction=="Close Short"?"Decrease":ue.direction=="Sell"||ue.direction=="Buy"?"Spot":"Changed Position":ue.direction=="Short > Long"||ue.direction=="Long > Short"?"Changed Position":"Open Position"})})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ao(ue.totalSize)})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ft?`$${Cv(Ft)}`:Cv(Ft)})})}),i.jsx("td",{children:i.jsx("div",{className:`${ue.pnl,""} px-1 flex justify-end gap-2 font-manrope min-w-max`,children:i.jsx("div",{className:`${ue.pnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:ue.pnl?`$${Cv(Math.abs(ue.pnl))}`:Cv(Math.abs(ue.pnl))})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:[(fr=ue==null?void 0:ue.fills)==null?void 0:fr.length," Fills"]})})}),i.jsx("td",{children:i.jsx("div",{onClick:()=>{Wn(or=="time"?"date":"time")},className:"px-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx("div",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]",children:or=="time"?i.jsx(Vn,{date:ue.latestFill}):su(ue.latestFill)})})}),i.jsx("td",{className:"sm:rounded-r-2xl mr-3",children:i.jsx("div",{className:"pl-1 pr-8 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-[#979797] text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]",children:ue==null?void 0:ue.oid})})})]},rt),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},rt)})})]})})]}):N==="positions"?i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 hidden lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:Be,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Mt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:ut,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:Ve,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:et,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] border-collapse rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky bg-[#161616] left-0 h-10 pl-2 sm:pl-6 min-w-[130px] sm:min-w-[145px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(di,{title:"Coin",sortKey:"asset",sortOption:ee,setSortOption:de,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>Kn(!Tn),className:`${Oe?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${Oe?"text-blue-500":"text-white"}`})}),Tn&&i.jsxs("div",{ref:Un,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>rn(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:Oe,onChange:ue=>rn(ue.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),Yr&&i.jsx(WY,{className:"min-w-[130px] sm:min-w-[130px] px-1",title:"Source Tag",sortKey:"source_tag",sortOption:ee,setSortOption:de}),i.jsx(WY,{className:"min-w-[100px] sm:min-w-[120px] px-1",title:"Type",sortKey:"type_leverage",sortOption:ee,setSortOption:de}),i.jsx(Md,{className:"min-w-[80px] sm:min-w-[80px] px-1",title:"Size",sortKey:"size",sortOption:ee,setSortOption:de}),i.jsx(Md,{className:"min-w-[130px] sm:min-w-[145px] px-1",title:"Position Value",sortKey:"positionValue",sortOption:ee,setSortOption:de}),i.jsx(Md,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Entry Price",sortKey:"entryPrice",sortOption:ee,setSortOption:de}),i.jsx(Md,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Mark Price",sortKey:"currentPrice",sortOption:ee,setSortOption:de}),i.jsx(Md,{className:"min-w-[100px] sm:min-w-[160px] px-1",title:"PnL(ROE%)",sortKey:"unrealizedPnl",sortOption:ee,setSortOption:de}),i.jsx(Md,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Liq. Price",sortKey:"liquidationPrice",sortOption:ee,setSortOption:de}),i.jsx(Md,{className:"min-w-[120px] sm:min-w-[130px] px-1",title:"Margin",sortKey:"marginUsed",sortOption:ee,setSortOption:de}),i.jsx(Md,{className:"min-w-[110px] sm:min-w-[130px] px-1",title:"Funding",sortKey:"funding",sortOption:ee,setSortOption:de}),i.jsx(Md,{className:`${Yr?"pr-0":"pr-8"} min-w-[185px] sm:min-w-[185px] pl-1`,title:"Entry Time",sortKey:"entryTime",sortOption:ee,setSortOption:de}),Yr&&i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[150px] pl-1 pr-5",children:i.jsx("div",{className:"flex items-center justify-end w-full gap-1 min-w-max",children:i.jsx("div",{className:"flex items-center justify-end group",children:i.jsxs("div",{onClick:ue=>{if(ue.preventDefault(),ot)return;const Ft=(t!=null&&t.length?t.map(yt=>yt.wallet_address.toLowerCase()):[e==null?void 0:e.toLowerCase()]).map(yt=>{var hn;return(hn=gr.find(vn=>vn.wallet_address===yt))==null?void 0:hn.wallet_id}).filter(Boolean);_r(Ft)},className:"h-[26px] pl-1 pr-2 py-1.5 bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30 rounded-md inline-flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("div",{className:"",children:i.jsx("img",{src:tae,alt:"",className:"w-4 h-4"})}),ot?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[66px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Fast Close All"})]})})})})]})}),i.jsx("tbody",{children:!s||s.length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:u?i.jsx(Da,{}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No open positions are currently available"}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["To discover a different wallet, you can use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","tab above."]})]})]})]})})})})}):B==null?void 0:B.map((ue,rt)=>{var Ft,yt,hn,vn,lr;return i.jsxs(Ne.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${ue==null?void 0:ue.asset}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Gs[ue.asset]||((Ft=ue.asset)==null?void 0:Ft.split("/")[0])}.svg`||Va,alt:ue==null?void 0:ue.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Nr=>ra(Nr)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ue.asset})]})})}),Yr&&i.jsx("td",{children:i.jsx("div",{onClick:Nr=>{Nr.preventDefault(),ue!=null&&ue.tagWallet&&(ue==null?void 0:ue.tagWallet)!=null&&window.open(`/wallet-details/${ue==null?void 0:ue.tagWallet}`,"_blank")},className:`${ue!=null&&ue.tagWallet&&(ue==null?void 0:ue.tagWallet)!=null?"cursor-pointer":""} pl-1 pr-2 flex flex-col items-start gap-2 font-manrope`,children:i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] has-tooltip relative",children:[(ue==null?void 0:ue.tagName)==null||(ue==null?void 0:ue.tagName)==""?"--":((yt=ue==null?void 0:ue.tagName)==null?void 0:yt.length)>10?((hn=ue==null?void 0:ue.tagName)==null?void 0:hn.slice(0,10))+"...":ue==null?void 0:ue.tagName,(ue==null?void 0:ue.tagName)&&(ue==null?void 0:ue.tagName.length)>10&&i.jsx("span",{children:i.jsx(Fa,{content:`${ue==null?void 0:ue.tagName}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:"z-[2] bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${ue.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:ue.type==="Long"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:[ue.type," - ",ue==null?void 0:ue.leverage,"x"]})]})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:ao(Math.abs(ue.size))})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ue.positionValue?`$${ao(ue.positionValue)}`:ao(ue.positionValue)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ue.entryPrice?`$${Cr(ue.entryPrice)}`:Cr(ue.entryPrice)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ue.currentPrice?`$${Cr(ue.currentPrice)}`:Cr(ue.currentPrice)})})}),i.jsx("td",{children:i.jsxs("div",{onClick:()=>{fn(Nr=>({...Nr,coin:ue.asset,type:ue.type,leverage:ue.leverage,roe:ue.roe,entryPrice:ue.entryPrice,markPrice:ue.currentPrice,pnl:ue.unrealizedPnl,referral:window.localStorage.getItem("hyperToken")?he:null})),$e(!0)},className:"pl-1 pr-2 flex justify-end gap-2 font-manrope cursor-pointer min-w-max",children:[i.jsxs("div",{className:`${ue.unrealizedPnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:[ue.unrealizedPnl?`$${ao(Math.abs(ue.unrealizedPnl))}`:ao(Math.abs(ue.unrealizedPnl)),` (${ao(Math.abs(ue==null?void 0:ue.roe))}%)`]}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:xm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ue.liquidationPrice!=null&&ue.liquidationPrice!==""&&!isNaN(ue.liquidationPrice)?`$${ao(ue.liquidationPrice)}`:ao(ue.liquidationPrice)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:[ue.marginUsed?`$${ao(ue.marginUsed)}`:ao(ue.marginUsed)," (",((vn=ue==null?void 0:ue.marginMode)==null?void 0:vn.charAt(0).toUpperCase())+((lr=ue==null?void 0:ue.marginMode)==null?void 0:lr.slice(1)),")"]})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:`${ue.funding<=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:ue.funding?`$${Cv(Math.abs(ue.funding))}`:Cv(Math.abs(ue.funding))})})}),i.jsx("td",{className:`${Yr?"":"pr-8 sm:rounded-r-2xl"}`,children:i.jsx("div",{onClick:()=>{qt(mt=="time"?"date":"time")},className:"pl-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx("div",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:ue!=null&&ue.latestFill?mt=="time"?i.jsx(Vn,{date:ue==null?void 0:ue.latestFill}):su(ue==null?void 0:ue.latestFill):i.jsx("span",{className:"text-[#979797]",children:"--"})})})}),Yr&&i.jsx("td",{className:"pr-5 sm:rounded-r-2xl",children:i.jsx("div",{className:"pl-1 flex flex-col items-end gap-2 font-manrope",children:it[`${ue==null?void 0:ue.leverage}_${ue==null?void 0:ue.asset}_${ue==null?void 0:ue.size}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{const Nr=gr.find(ts=>{var is;return ts.wallet_address===((is=ue.wallet||e)==null?void 0:is.toLowerCase())}),fr=Nr==null?void 0:Nr.wallet_id,cr=Nr==null?void 0:Nr.wallet_address;fr&&vi(fr,cr,ue==null?void 0:ue.asset,ue==null?void 0:ue.leverage,ue==null?void 0:ue.size)},className:"h-5 px-2 py-1.5 rounded-md border border-white justify-start items-center gap-2 inline-flex",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight cursor-pointer",children:"Market"})})})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},rt)})})]})})]}):N==="twap-history"&&Nt.pathname.startsWith("/wallet-details")?i.jsx(Tin,{data:ct,setData:Vt,wallet:e,coinNameData:dn}):N==="trade-history"?i.jsx(lin,{wallet:e,wallets:t}):N==="completed-trades"?i.jsx(kin,{trades:ne,generatedWallets:gr,wallet:e,wallets:t}):N==="deposit-withdraw"?i.jsx(fin,{wallet:e,wallets:t}):""]})},Md=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(di,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),WY=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(di,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})});function qY({walletAddress:e}){const[t,n]=m.useState(!1),[r,s]=m.useState(0),[a,o]=m.useState([]),[l,c]=m.useState({}),[u,d]=m.useState(null),[f,x]=m.useState(""),[g,v]=m.useState(""),w=()=>{ds.post("https://dextrabothypev2.nftinit.io/api/hyper/wallet/getwalletreportsdetail/",{wallet_address:e}).then(I=>{s(I.data.report_count||0);const P=I.data.report_detail.reduce((R,F)=>(R[F.report_type_id]=(R[F.report_type_id]||0)+1,R),{});c(P)})};m.useEffect(()=>{w()},[e]),m.useEffect(()=>{const I=P=>{P.key==="Escape"&&n(!1)};return t&&window.addEventListener("keydown",I),()=>{window.removeEventListener("keydown",I)}},[t]);const C=()=>{a.length||ds.get("https://dextrabothypev2.nftinit.io/api/hyper/wallet/getreporttypes/").then(I=>{var P;return o(((P=I.data)==null?void 0:P.data)||[])})},N=()=>{if(!u){v("Please select a report type");return}const I=localStorage.getItem("hyperAddress"),P=localStorage.getItem("hyperToken");ds.post("https://dextrabothypev2.nftinit.io/api/hyper/wallet/walletreport/",{address:I,token:P,reported_wallet_address:e,report_type_id:u,message:f}).then(()=>{n(!1),d(null),x(""),w()})};return i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>{n(!0),C()},className:"relative flex items-center gap-2 px-5 py-2 rounded-full bg-[#2d2d2d] hover:bg-[#3b3b3b] text-sm font-semibold text-white font-manrope",children:["Report",r>0&&i.jsx("span",{className:"bg-red-600 text-white text-xs font-bold rounded-full px-1 font-manrope w-5 h-5 flex justify-center items-center",children:r})]}),t&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:()=>n(!1),children:i.jsxs("div",{className:"w-full max-w-md rounded-2xl bg-[#1b1b1b] p-6 text-white shadow-lg relative border border-[#3B3B3B]",onClick:I=>I.stopPropagation(),children:[i.jsx("div",{className:"absolute top-4 right-4 w-7 h-7 rounded-[8px] bg-[#3D3D3D] flex items-center justify-center text-sm cursor-pointer hover:bg-[#565656]",onClick:()=>n(!1),children:i.jsx(DIe,{className:"text-[#CECECE] mt-[1px]"})}),i.jsx("h2",{className:"text-lg font-bold mb-1 font-manrope",children:"Report Trader"}),i.jsx("p",{className:"text-xs mb-6 text-[#a1a1a1] font-manrope",children:"You can report this wallet to help determine if it is Delta Neutral or Bot."}),i.jsx("div",{className:"flex justify-center w-full gap-4 mb-6",children:a.map(I=>i.jsxs("button",{onClick:()=>{d(I.id),v("")},className:`flex items-center gap-2 px-3 py-3 rounded-full text-[13px] font-semibold transition-all hover:bg-white hover:text-[#161616] ${u===I.id?"bg-white text-[#161616]":"bg-[#1f1f1f] border border-[#353535]"}`,children:[I.name,i.jsx("span",{className:"bg-[#FFC940] text-[#30260E] text-13px font-bold rounded-[6px] px-2",children:l[I.id]||0})]},I.id))}),i.jsx("label",{className:"block text-xs mb-1",children:"Comment (Optional)"}),i.jsx("textarea",{value:f,onChange:I=>x(I.target.value),placeholder:"Describe the behavior or issue you're reporting...",className:"w-full h-24 rounded-lg bg-[#111] border border-[#2d2d2d] p-3 text-sm outline-none placeholder-[#555] resize-none mb-6"}),g&&i.jsx("p",{className:"text-red-500 text-xs font-semibold mb-4 text-center",children:g}),i.jsx("div",{className:"w-full flex justify-center",children:i.jsx("button",{onClick:N,className:"flex bg-[#1f1f1f] w-[128px] h-[32px] px-[16px] py-[12px] justify-center items-center gap-[10px] shrink-0 rounded-[12px] border border-[#353535] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-white hover:text-[#161616]",disabled:!localStorage.getItem("hyperAddress"),children:"Report"})})]})})]})}const ACe="https://api-ui.hyperliquid.xyz/info",Pin="wss://api.hyperliquid.xyz/ws",Fin=({initialAddress:e=""})=>{var mi,ns,Xt;const[t,n]=m.useState(e),[r,s]=m.useState([]),[a,o]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(1),[f,x]=m.useState(null),[g,v]=m.useState(!1),w=m.useRef(null),C=il(),N=m.useRef(e),I=m.useRef(null),P=m.useRef(null),R=m.useRef(null),[F,U]=m.useState({}),[L,z]=m.useState(!1),[Q,ne]=m.useState(""),[J,X]=m.useState(null),{trackedWatchList:re,getTrackedWatchList:pe,hyperToken:Y,copyTradeWatchList:ie,getCopyTradeWatchList:oe,setTelegramChatId:G,setSubscriberRole:V,setSubsExpireDay:te,setMushboomerETH:ae,setMushboomerSOL:he,setIsReferralCode:Ce,isReferralCodeName:ce,setIsReferralCodeName:ge,setIsWhitelist:Ae,setHyperToken:ye,setHyperAddress:je,setSignModalOpen:Ie,latestPnL:Re}=m.useContext(Qr),{isConnected:Qe,address:$e}=Jr(),[it,tt]=m.useState(!1),[ot,ft]=m.useState(!1),[ct,Vt]=m.useState(null),[It,an]=m.useState(null),[Nt,mn]=m.useState(""),[dn,Pt]=m.useState(!1),[Xe,Ut]=m.useState(localStorage.getItem("discover_period")==0?"day":localStorage.getItem("discover_period")==1?"week":localStorage.getItem("discover_period")==2?"month":localStorage.getItem("discover_period")==3?"threeMonth":null),Lt=Xe||Re.activeRange;m.useEffect(()=>{Ut(null)},[Re.activeRange]);const qe=[{label:"@10",value:"GMEOW"},{label:"@112",value:"MEOW"},{label:"@115",value:"HOLD"},{label:"@117",value:"BERA"},{label:"@12",value:"XULIAN"},{label:"@123",value:"FARM"},{label:"@131",value:"ORA"},{label:"@132",value:"LIQD"},{label:"@134",value:"STAR"},{label:"@135",value:"SENT"},{label:"@136",value:"SOLV"},{label:"@16",value:"CZ"},{label:"@18",value:"ANSEM"},{label:"@21",value:"KOBE"},{label:"@22",value:"HAPPY"},{label:"@25",value:"BIGBEN"},{label:"@3",value:"MANLET"},{label:"@30",value:"FARMED"},{label:"@31",value:"GPT"},{label:"@32",value:"PURRPS"},{label:"@33",value:"BID"},{label:"@34",value:"HODL"},{label:"@1",value:"HFUN"},{label:"@100",value:"UP"},{label:"@101",value:"NIGGO"},{label:"@102",value:"HOP"},{label:"@103",value:"LUCKY"},{label:"@104",value:"COPE"},{label:"@105",value:"HPYH"},{label:"@106",value:"YAP"},{label:"@107",value:"HYPE"},{label:"@108",value:"CHEF"},{label:"@109",value:"WOW"},{label:"@11",value:"PEPE"},{label:"@110",value:"STEEL"},{label:"@111",value:"RETARD"},{label:"@113",value:"NEIRO"},{label:"@114",value:"PEAR"},{label:"@116",value:"MUNCH"},{label:"@118",value:"GENESY"},{label:"@119",value:"BUBZ"},{label:"@120",value:"PICKL"},{label:"@121",value:"SHEEP"},{label:"@122",value:"LAUNCH"},{label:"@124",value:"FLASK"},{label:"@125",value:"VAULT"},{label:"@126",value:"CAT"},{label:"@127",value:"HYENA"},{label:"@128",value:"DEPIN"},{label:"@129",value:"MON"},{label:"@13",value:"RUG"},{label:"@130",value:"BEATS"},{label:"@133",value:"H"},{label:"@137",value:"FLY"},{label:"@138",value:"TIME"},{label:"@139",value:"SOVRN"},{label:"@14",value:"ILIENS"},{label:"@15",value:"FUCKY"},{label:"@17",value:"BAGS"},{label:"@19",value:"TATE"},{label:"@2",value:"LICK"},{label:"@20",value:"PUMP"},{label:"@23",value:"SCHIZO"},{label:"@24",value:"SELL"},{label:"@26",value:"CATNIP"},{label:"@27",value:"HBOOST"},{label:"@28",value:"SUCKY"},{label:"@29",value:"GUP"},{label:"@35",value:"VEGAS"},{label:"@37",value:"VAPOR"},{label:"@38",value:"PANDA"},{label:"@39",value:"PILL"},{label:"@40",value:"ADHD"},{label:"@41",value:"FUN"},{label:"@42",value:"LADY"},{label:"@46",value:"DROP"},{label:"@47",value:"MBAPPE"},{label:"@48",value:"TEST"},{label:"@49",value:"RAGE"},{label:"@5",value:"SIX"},{label:"@50",value:"FRAC"},{label:"@51",value:"ATEHUN"},{label:"@52",value:"COZY"},{label:"@53",value:"ARI"},{label:"@54",value:"WASH"},{label:"@55",value:"ANT"},{label:"@59",value:"CATBAL"},{label:"@60",value:"TJIF"},{label:"@61",value:"GUESS"},{label:"@62",value:"MAXI"},{label:"@63",value:"NMTD"},{label:"@66",value:"RISE"},{label:"@67",value:"CINDY"},{label:"@70",value:"FRIED"},{label:"@73",value:"RANK"},{label:"@74",value:"OMNIX"},{label:"@75",value:"RIP"},{label:"@76",value:"G"},{label:"@77",value:"BOZO"},{label:"@78",value:"SPH"},{label:"@82",value:"BUSSY"},{label:"@83",value:"FATCAT"},{label:"@84",value:"SHREK"},{label:"@85",value:"PIP"},{label:"@86",value:"LQNA"},{label:"@87",value:"NASDAQ"},{label:"@88",value:"YEETI"},{label:"@9",value:"TRUMP"},{label:"@90",value:"FEIT"},{label:"@92",value:"VIZN"},{label:"@93",value:"STRICT"},{label:"@94",value:"AUTIST"},{label:"@96",value:"HGOD"},{label:"@97",value:"LIQUID"},{label:"@36",value:"ASI"},{label:"@4",value:"JEFF"},{label:"@43",value:"MOG"},{label:"@44",value:"HPEPE"},{label:"@45",value:"JEET"},{label:"@57",value:"RICH"},{label:"@58",value:"LORA"},{label:"@6",value:"WAGMI"},{label:"@65",value:"PIGEON"},{label:"@64",value:"HPUMP"},{label:"@69",value:"STACK"},{label:"@7",value:"CAPPY"},{label:"@72",value:"NOCEX"},{label:"@79",value:"SHOE"},{label:"@80",value:"MONAD"},{label:"@81",value:"HOPE"},{label:"@89",value:"SYLVI"},{label:"@91",value:"FRUDO"},{label:"@95",value:"MAGA"},{label:"@99",value:"EARTH"},{label:"@56",value:"NFT"},{label:"@8",value:"POINTS"},{label:"@68",value:"CHINA"},{label:"@141",value:"GOD"}];function Ke(ue,rt){const Ft=rt.map(({fill:yt,twapId:hn})=>({...yt,twapId:hn}));return[...ue,...Ft]}m.useEffect(()=>{e&&(async()=>{const ue=await Oce(e),rt=await Mce(e),Ft=Ke(ue,rt),{closed_positions:yt}=Rce(Ft);X(yt)})()},[e]),m.useEffect(()=>(e&&(N.current=e,Bt(e),Ve(e)),()=>{w.current&&(w.current.close(),w.current=null),I.current&&(clearTimeout(I.current),I.current=null),P.current&&(clearInterval(P.current),P.current=null),R.current&&(clearInterval(R.current),R.current=null)}),[e]),m.useEffect(()=>{const ue=localStorage.getItem("favoriteAddresses");ue&&U(JSON.parse(ue))},[]),m.useCallback(()=>{if(F[t]){const ue={...F};delete ue[t],U(ue),localStorage.setItem("favoriteAddresses",JSON.stringify(ue))}else z(!0),ne("")},[t,F]),m.useCallback(()=>{if(!Q.trim())return;const ue={...F,[t]:{name:Q,address:t}};U(ue),localStorage.setItem("favoriteAddresses",JSON.stringify(ue)),z(!1)},[Q,t,F]),m.useCallback(ue=>{ue&&(n(ue),Bt(ue),C(`/wallet-details/${ue}`))},[]);const pt=ue=>{var rt;((rt=w.current)==null?void 0:rt.readyState)===WebSocket.OPEN&&N.current===ue||(P.current&&(clearInterval(P.current),P.current=null),I.current&&(clearTimeout(I.current),I.current=null),w.current&&(w.current.close(),w.current=null),N.current=ue,w.current=new WebSocket(Pin),w.current.onopen=()=>{console.log("WebSocket Connected"),v(!0),[{method:"subscribe",subscription:{aggregateByTime:!0,type:"userFills",user:ue}},{method:"subscribe",subscription:{type:"user",user:ue}}].forEach(yt=>{w.current.send(JSON.stringify(yt))}),P.current=setInterval(()=>{var yt;if(((yt=w.current)==null?void 0:yt.readyState)===WebSocket.OPEN){const hn={id:99,method:"ping"};w.current.send(JSON.stringify(hn))}},3e4)},w.current.onclose=Ft=>{v(!1),P.current&&(clearInterval(P.current),P.current=null),Ft.code!==1e3&&(I.current||(I.current=setTimeout(()=>{I.current=null,N.current===ue&&pt(ue)},5e3)))},w.current.onerror=Ft=>{console.error("WebSocket Error:",Ft),v(!1)},w.current.onmessage=Ft=>{var yt,hn,vn;try{const lr=JSON.parse(Ft.data);if(lr.method==="pong"||lr.result==="success")return;if(lr.channel==="userFills"&&((yt=lr.data)!=null&&yt.fills)&&N.current.toLowerCase()===lr.data.user.toLowerCase()&&(s(Nr=>{const fr=Nr.flatMap(Or=>Or.fills),cr=new Map;fr.forEach(Or=>{cr.set(Or.hash,!0)});const ts=lr.data.fills.filter(Or=>!cr.has(Or.hash));if(ts.length===0)return Nr;const is=[...ts,...fr];return Et(is)}),R.current||Ve(N.current)),lr.channel==="user"&&((hn=lr.data)!=null&&hn.fills&&s(Nr=>{const fr=Nr.flatMap(Or=>Or.fills),cr=new Map;fr.forEach(Or=>{cr.set(Or.hash,!0)});const ts=lr.data.fills.filter(Or=>!cr.has(Or.hash));if(ts.length===0)return Nr;const is=[...ts,...fr];return Et(is)}),(vn=lr.data)!=null&&vn.state)){x(lr.data.state);const Nr=Mt(lr.data.state);o(Nr)}}catch(lr){console.error("Error processing WebSocket message:",lr),console.error("Raw message that caused error:",Ft.data)}})},en=async ue=>{try{tt(!0);const rt=await ds.post(ACe,{type:"clearinghouseState",user:ue});if(rt.data){x(rt.data);const Ft=Mt(rt.data);o(Ft),tt(!1),Ft.length>0&&!R.current?Ve(ue):Ft.length===0&&R.current&&(clearInterval(R.current),R.current=null)}}catch(rt){console.error("Error fetching user state:",rt),tt(!1)}},Bt=async ue=>{if(!ue){ln.error("Please enter a wallet address");return}if(!ue.match(/^0x[a-fA-F0-9]{40}$/)){ln.error("Please enter a valid Ethereum address");return}c(!0);try{ue!==e&&C(`/wallet-details/${ue}`),pt(ue);const[rt]=await Promise.all([ds.post(ACe,{aggregateByTime:!0,type:"userFills",user:ue}),en(ue)]);if(rt.data&&Array.isArray(rt.data)){const Ft=Et(rt.data);s(Ft),d(1)}else console.error("Invalid response format:",rt.data)}catch(rt){console.error("Error fetching data:",rt)}finally{c(!1)}},Et=ue=>{const rt=[...ue].sort((yt,hn)=>hn.time-yt.time),Ft=new Map;return rt.forEach(yt=>{var vn;const hn=yt.oid;if(!Ft.has(hn)){const lr=rt.filter(hr=>hr.oid===yt.oid),Nr=lr.reduce((hr,Jn)=>hr+parseFloat(Jn.sz),0),fr=lr.map(hr=>parseFloat(hr.startPosition));let cr;fr.includes(0)?cr=0:fr.every(hr=>hr>0)?cr=Math.max(...fr):fr.every(hr=>hr<0)?cr=Math.min(...fr):cr=lr.reduce((hr,Jn)=>hr+parseFloat(Jn.startPosition),0);const ts=lr.reduce((hr,Jn)=>hr+parseFloat(Jn.sz)*parseFloat(Jn.px),0),is=lr.reduce((hr,Jn)=>hr+parseFloat(Jn.closedPnl||0),0),Or=((vn=lr.find(hr=>hr.dir==="Long > Short"||hr.dir==="Short > Long"))==null?void 0:vn.dir)||"";Ft.set(hn,{oid:yt.oid,asset:yt.coin,direction:Or==""?yt.dir:Or,fills:lr,totalSize:Nr,totalStartPositions:cr,totalValue:ts,pnl:is,latestFill:yt.time})}}),Array.from(Ft.values()).sort((yt,hn)=>hn.latestFill-yt.latestFill)},et=ue=>{const rt=new Date(ue),Ft=rt.toLocaleString("en-US",{month:"short"}),yt=rt.getDate(),hn=rt.getFullYear(),vn=rt.getHours().toString().padStart(2,"0"),lr=rt.getMinutes().toString().padStart(2,"0"),Nr=rt.getHours()>=12?" PM":" AM";return`${Ft} ${yt}, ${hn}, ${vn}:${lr} ${Nr}`},Be=r,Mt=ue=>{if(!(ue!=null&&ue.assetPositions))return[];const rt=new Map;return r.forEach(Ft=>{Ft.fills.forEach(yt=>{let hn="";yt.dir.includes("Open")?hn=yt.dir.includes("Long")?"Long":"Short":yt.side==="B"?hn="Long":yt.side==="S"&&(hn="Short");const vn=`${yt.coin}-${hn}`;(!rt.has(vn)||yt.time<rt.get(vn))&&rt.set(vn,yt.time)})}),ue.assetPositions.filter(Ft=>{if(!Ft.position||!Ft.position.szi)return!1;const yt=parseFloat(Ft.position.szi);return!isNaN(yt)&&yt!==0}).map(Ft=>{const yt=Ft.position,hn=parseFloat(yt.szi),vn=parseFloat(yt.entryPx),lr=parseFloat(yt.positionValue),Nr=parseFloat(yt.unrealizedPnl),fr=parseFloat(yt.returnOnEquity)*100,cr=parseFloat(yt.marginUsed),ts=yt.leverage.value,is=yt.leverage.type,Or=parseFloat(yt.cumFunding.sinceOpen),hr=hn>0?"Long":"Short",Jn=rt.get(`${yt.coin}-${hr}`);return{asset:yt.coin,type:hr,size:hn,entryPrice:vn.toFixed(4),currentPrice:(lr/Math.abs(hn)).toFixed(4),leverage:ts,marginMode:is,positionValue:lr.toFixed(2),marginUsed:cr.toFixed(2),unrealizedPnl:Nr.toFixed(2),roe:fr.toFixed(2),funding:Or.toFixed(4),startTime:Jn?et(Jn):"N/A",liquidationPrice:yt.liquidationPx?parseFloat(yt.liquidationPx).toFixed(2):"N/A"}})},Ve=ue=>{R.current&&(clearInterval(R.current),R.current=null),R.current=setInterval(()=>{en(ue)},7e3)},ut=ue=>ue>=1e6?`${(ue/1e6).toFixed(2)}M`:ue>=1e3?`${(ue/1e3).toFixed(2)}K`:ue.toFixed(2);m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(pe(),oe())},[]);const xt=m.useRef(null),jt=()=>{xt.current&&(xt.current.scrollLeft-=200)},kt=()=>{xt.current&&(xt.current.scrollLeft+=200)};m.useEffect(()=>{(async()=>{var yt,hn;const rt=window.localStorage.getItem("hyperToken"),Ft=window.localStorage.getItem("hyperAddress");if(!(!rt||!Ft))try{const vn=await ji(Ft.toLowerCase(),rt);vn!=null&&vn.success?(G(vn==null?void 0:vn.telegram_chat_id),V(vn==null?void 0:vn.subscriber_role),te(vn==null?void 0:vn.subs_expire_day),ae((yt=vn==null?void 0:vn.mushboomer_counts)==null?void 0:yt.eth),he((hn=vn==null?void 0:vn.mushboomer_counts)==null?void 0:hn.sol),Ce(vn==null?void 0:vn.referral_code),ge(vn==null?void 0:vn.refcode),Ae(vn==null?void 0:vn.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ye(""),je(""))}catch(vn){console.error("Token verification error:",vn),console.error(vn.message||"An unknown error occurred.")}})()},[]);const xn=async({walletAddress:ue,isFollow:rt,isScalper:Ft})=>{try{mn(ue);const yt=window.localStorage.getItem("hyperToken"),hn=window.localStorage.getItem("hyperAddress");if(!yt){Ie(!0);return}const vn=rt?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",lr=rt?{address:$e?$e.toLowerCase():hn,token:yt,follow_address:ue.toLowerCase()}:{address:$e?$e.toLowerCase():hn,token:yt},Nr=await fetch(vn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(lr)});if(!Nr.ok)throw new Error(`Server responded with status ${Nr.status}`);const fr=await Nr.json();fr.success?(Vt(Array.isArray(fr==null?void 0:fr.data)?[...fr.data].sort((cr,ts)=>new Date(ts.created_at||0)-new Date(cr.created_at||0)):fr==null?void 0:fr.data),an(Ft),ft(!0)):(console.log(fr.error_message),ln.error(fr.error_message))}catch(yt){console.error("Error in like function:",yt),ln.error(yt.message||"Something went wrong!")}},un="-latestFill",[On,En]=m.useState(un),[jn,bn]=m.useState([]),[Zn,zn]=m.useState(""),[$n,nr]=m.useState(""),[wn,on]=m.useState(""),[Oe,rn]=m.useState(!1),[cn,_t]=m.useState(!1),[Yn,yn]=m.useState(!1),[Dt,sn]=m.useState(!1),Tn=m.useRef(null),Kn=m.useRef(null),ir=m.useRef(null),rr=m.useRef(null);m.useEffect(()=>{function ue(rt){Tn.current&&!Tn.current.contains(rt.target)&&rn(!1),Kn.current&&!Kn.current.contains(rt.target)&&_t(!1),ir.current&&!ir.current.contains(rt.target)&&yn(!1),rr.current&&!rr.current.contains(rt.target)&&sn(!1)}return document.addEventListener("mousedown",ue),()=>document.removeEventListener("mousedown",ue)},[]);const Jt=Be.map(ue=>{let rt=ue.totalStartPositions==0?"Open Position":ue.direction!="Short > Long"&&ue.direction!="Long > Short"?(ue==null?void 0:ue.totalSize)-Math.abs(ue==null?void 0:ue.totalStartPositions)==0&&(ue.direction=="Close Long"||ue.direction=="Close Short")?"Position Closed":ue.direction=="Open Short"||ue.direction=="Open Long"?"Increase":ue.direction=="Close Long"||ue.direction=="Close Short"?"Decrease":ue.direction=="Sell"||ue.direction=="Buy"?"Spot":"Changed Position":ue.direction=="Short > Long"||ue.direction=="Long > Short"?"Changed Position":"Open Position";return{...ue,computedType:rt}}),Un=ue=>{const rt=qe.find(Ft=>Ft.label===ue);return rt?rt.value.toUpperCase():ue==null?void 0:ue.toUpperCase()},Qn=Jt.filter(ue=>jn.length?jn.includes(ue.computedType):!0).filter(ue=>{var rt,Ft;return Zn?(Ft=(rt=ue==null?void 0:ue.oid)==null?void 0:rt.toString())==null?void 0:Ft.includes(Zn):!0}).filter(ue=>$n?Un(ue.asset).includes($n.toUpperCase()):!0),Pn=(ue=>Qn==null?void 0:Qn.sort((rt,Ft)=>{var is,Or,hr,Jn;const yt=rt.totalSize?rt.totalValue/rt.totalSize:0,hn=Ft.totalSize?Ft.totalValue/Ft.totalSize:0,vn=vs=>{const si=qe.find(ni=>ni.label===vs);return si?si.value.toUpperCase():vs==null?void 0:vs.toUpperCase()},lr=vn(rt.asset),Nr=vn(Ft.asset),fr=vs=>{if(!vs)return"";const si=vs.toLowerCase();return si.includes("short")?"Short":si.includes("long")?"Long":si==="buy"?"Buy":si==="sell"?"Sell":vs},cr=fr(rt.direction),ts=fr(Ft.direction);if(ue==="-totalSize")return Ft.totalSize-rt.totalSize;if(ue==="totalSize")return rt.totalSize-Ft.totalSize;if(ue==="-pnl")return Ft.pnl-rt.pnl;if(ue==="pnl")return rt.pnl-Ft.pnl;if(ue==="-fills")return(((is=Ft.fills)==null?void 0:is.length)||0)-(((Or=rt.fills)==null?void 0:Or.length)||0);if(ue==="fills")return(((hr=rt.fills)==null?void 0:hr.length)||0)-(((Jn=Ft.fills)==null?void 0:Jn.length)||0);if(ue==="-latestFill")return new Date(Ft.latestFill)-new Date(rt.latestFill);if(ue==="latestFill")return new Date(rt.latestFill)-new Date(Ft.latestFill);if(ue==="-avgPrice")return hn-yt;if(ue==="avgPrice")return yt-hn;if(ue==="-oid")return Ft.oid-rt.oid;if(ue==="oid")return rt.oid-Ft.oid;if(ue==="direction"){const vs={Short:1,Sell:2,Long:3,Buy:4};return(vs[cr]||99)-(vs[ts]||99)}else if(ue==="-direction"){const vs={Long:1,Buy:2,Short:3,Sell:4};return(vs[cr]||99)-(vs[ts]||99)}else{if(ue==="-coin")return lr<Nr?-1:lr>Nr?1:0;if(ue==="coin")return lr>Nr?-1:lr<Nr?1:0}return 0}))(On).filter(ue=>(ue.totalStartPositions==0?"Open Position":ue.direction!="Short > Long"&&ue.direction!="Long > Short"?(ue==null?void 0:ue.totalSize)-Math.abs(ue==null?void 0:ue.totalStartPositions)==0&&(ue.direction=="Close Long"||ue.direction=="Close Short")?"Position Closed":ue.direction=="Open Short"||ue.direction=="Open Long"?"Increase":ue.direction=="Close Long"||ue.direction=="Close Short"?"Decrease":ue.direction=="Sell"||ue.direction=="Buy"?"Spot":"Changed Position":ue.direction=="Short > Long"||ue.direction=="Long > Short"?"Changed Position":"Open Position")==="Open Position"),Ee={};Pn.forEach(ue=>{var yt;const rt=ue==null?void 0:ue.asset,Ft=new Date(ue==null?void 0:ue.latestFill).getTime();if(!Ee[rt])Ee[rt]=ue;else{const hn=new Date((yt=Ee[rt])==null?void 0:yt.latestFill).getTime();Ft>hn&&(Ee[rt]=ue)}});const p=Object.values(Ee),[h,S]=m.useState([]),_=a==null?void 0:a.filter(ue=>{var rt;return wn?(rt=ue.asset)==null?void 0:rt.toLowerCase().includes(wn.toLowerCase()):!0}).map(ue=>{const rt=p.find(yt=>(yt==null?void 0:yt.asset)===(ue==null?void 0:ue.asset)),Ft=h.find(yt=>(yt==null?void 0:yt.coin)===(ue==null?void 0:ue.asset));return{...ue,latestFill:(rt==null?void 0:rt.latestFill)||null,tagName:(Ft==null?void 0:Ft.tag)||null,tagWallet:(Ft==null?void 0:Ft.cp_wallet)||null}}),k="-unrealizedPnl",[T,B]=m.useState(k),W=ue=>_==null?void 0:_.sort((rt,Ft)=>{const yt=rt.tagName?rt.tagName.toUpperCase():"",hn=Ft.tagName?Ft.tagName.toUpperCase():"",vn=rt.asset?rt.asset.toUpperCase():"",lr=Ft.asset?Ft.asset.toUpperCase():"",Nr=rt.type==="Long"?1:0,fr=Ft.type==="Long"?1:0,cr=rt.type==="Short"?1:0,ts=Ft.type==="Short"?1:0;return ue==="-unrealizedPnl"?Ft.unrealizedPnl-rt.unrealizedPnl:ue==="unrealizedPnl"?rt.unrealizedPnl-Ft.unrealizedPnl:ue==="-roe"?Ft.roe-rt.roe:ue==="roe"?rt.roe-Ft.roe:ue==="-size"?Ft.size-rt.size:ue==="size"?rt.size-Ft.size:ue==="-entryPrice"?Ft.entryPrice-rt.entryPrice:ue==="entryPrice"?rt.entryPrice-Ft.entryPrice:ue==="-currentPrice"?Ft.currentPrice-rt.currentPrice:ue==="currentPrice"?rt.currentPrice-Ft.currentPrice:ue==="-leverage"?Ft.leverage-rt.leverage:ue==="leverage"?rt.leverage-Ft.leverage:ue==="-positionValue"?Ft.positionValue-rt.positionValue:ue==="positionValue"?rt.positionValue-Ft.positionValue:ue==="-marginUsed"?Ft.marginUsed-rt.marginUsed:ue==="marginUsed"?rt.marginUsed-Ft.marginUsed:ue==="funding"?Ft.funding-rt.funding:ue==="-funding"?rt.funding-Ft.funding:ue==="-liquidationPrice"?Ft.liquidationPrice-rt.liquidationPrice:ue==="liquidationPrice"?rt.liquidationPrice-Ft.liquidationPrice:ue==="-entryTime"?new Date(Ft.latestFill)-new Date(rt.latestFill):ue==="entryTime"?new Date(rt.latestFill)-new Date(Ft.latestFill):ue==="-source_tag"?yt<hn?-1:yt>hn?1:0:ue==="source_tag"?yt>hn?-1:yt<hn?1:0:ue==="-type_leverage"?Nr!==fr?fr-Nr:Ft.leverage-rt.leverage:ue==="type_leverage"?cr!==ts?ts-cr:Ft.leverage-rt.leverage:ue==="-asset"?vn<lr?-1:vn>lr?1:0:ue==="asset"?vn>lr?-1:vn<lr?1:0:0}),[ee,de]=m.useState([]),[fe,xe]=m.useState([]),[we,ke]=m.useState([]),[Me,Ye]=m.useState([]),[Fe,st]=m.useState([]);async function se(){try{const ue=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=1&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ue.ok)throw new Error(`HTTP error! status: ${ue.status}`);const rt=await ue.json();de(rt.results)}catch(ue){console.error("Error resetting filters:",ue)}}async function Se(){try{const ue=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=7&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ue.ok)throw new Error(`HTTP error! status: ${ue.status}`);const rt=await ue.json();xe(rt.results)}catch(ue){console.error("Error resetting filters:",ue)}}async function De(){try{const ue=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=30&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ue.ok)throw new Error(`HTTP error! status: ${ue.status}`);const rt=await ue.json();ke(rt.results)}catch(ue){console.error("Error resetting filters:",ue)}}async function Le(){try{const ue=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=90&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!ue.ok)throw new Error(`HTTP error! status: ${ue.status}`);const rt=await ue.json();Ye(rt.results)}catch(ue){console.error("Error resetting filters:",ue)}}async function _e(){try{const ue=await fetch(`https://dextradata.nftinit.io/api/hyper/wallet/details/?user_token=${e}`);if(!ue.ok)throw new Error(`HTTP error! status: ${ue.status}`);const rt=await ue.json();st(rt)}catch(ue){console.error("Error pnlSharpeRateData:",ue)}}m.useEffect(()=>{se(),Se(),De(),Le(),_e()},[]);const[nt,lt]=m.useState(localStorage.getItem("discover_period")==0?"1D":localStorage.getItem("discover_period")==1?"7D":localStorage.getItem("discover_period")==2?"30D":localStorage.getItem("discover_period")==3||localStorage.getItem("discover_period")==4?"90D":"7D"),[bt,Zt]=m.useState(localStorage.getItem("discover_period")==0?"1D":localStorage.getItem("discover_period")==1?"7D":localStorage.getItem("discover_period")==2?"30D":localStorage.getItem("discover_period")==3||localStorage.getItem("discover_period")==4?"90D":"7D"),[Ge,Je]=m.useState(localStorage.getItem("discover_period")==1?"7D":localStorage.getItem("discover_period")==2?"30D":localStorage.getItem("discover_period")==3||localStorage.getItem("discover_period")==4?"90D":"7D"),We=nt==="1D"?ee:nt==="7D"?fe:nt==="30D"?we:Me,wt=bt==="1D"?ee:bt==="7D"?fe:bt==="30D"?we:Me,At=a.length,Gt=a.filter(ue=>ue.unrealizedPnl>=0).length,fn=At>0?Gt/At*100:0,[Rn,An]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),mt=((mi=W(T))==null?void 0:mi.reduce((ue,rt)=>ue+((rt==null?void 0:rt.leverage)||0),0))/(((ns=W(T))==null?void 0:ns.length)||1),qt=(Xt=W(T))==null?void 0:Xt.reduce((ue,rt)=>{const Ft=parseFloat(rt==null?void 0:rt.funding)||0;return ue+Ft},0),In=localStorage.getItem("isDateOpenPositionsFormat")||"date",[or,Wn]=m.useState(In);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsFormat",or)},[or]);const gr=localStorage.getItem("isDateFillsFormat")||"date",[Ir,Fr]=m.useState(gr);m.useEffect(()=>{localStorage.setItem("isDateFillsFormat",Ir)},[Ir]);const[Lr,Ht]=m.useState([]),nn=async()=>{try{const ue=window.localStorage.getItem("hyperToken");if(!ue){Ie(!0);return}const rt="https://dextrabothypev2.nftinit.io/api/wallet/list",Ft=window.localStorage.getItem("hyperAddress"),hn=await(await fetch(rt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:$e?$e.toLowerCase():Ft,token:ue,balance:"false"})})).json();hn!=null&&hn.success?(Ht(hn.data||[]),_r(hn.data)):console.log(hn.error_message)}catch(ue){console.error("Error fetching generate wallet list:",ue)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&nn()},[Y]);const Sr=Lr==null?void 0:Lr.find(ue=>(ue==null?void 0:ue.wallet_address)===(e==null?void 0:e.toLowerCase())),Br=ie==null?void 0:ie.find(ue=>(ue==null?void 0:ue.wallet_address)===(e==null?void 0:e.toLowerCase())),[Kr,As]=m.useState([]),[ms,vr]=m.useState(!0),[Yr,vi]=m.useState(!1);m.useEffect(()=>{_&&_.length>0&&(os(),Lr.length>0&&ms&&_r())},[_]);const _r=ue=>{const rt=[...Kr];rt.length>0&&((ue==null?void 0:ue.some(yt=>(yt==null?void 0:yt.wallet_address)===(e==null?void 0:e.toLowerCase())))?Gs(rt):ms&&(Gs(rt),vr(!1)))},os=()=>{const ue=window.localStorage.getItem("hyperToken");let rt=!1;const Ft=[...Kr];_==null||_.forEach(yt=>{const hn=yt.asset;(Ft==null?void 0:Ft.some(lr=>lr.coin===hn))||(Ft==null||Ft.push({coin:hn,wallet:e}),rt=!0)}),rt&&(As(Ft),Lr!=null&&Lr.some(hn=>(hn==null?void 0:hn.wallet_address)===(e==null?void 0:e.toLowerCase()))&&ue&&Gs(Ft))},Gs=async ue=>{if(!Yr)try{vi(!0);const rt=window.localStorage.getItem("hyperToken"),Ft="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!rt||!ue){vi(!1);return}rt||Ie(!0);const yt=window.localStorage.getItem("hyperAddress"),vn=await(await fetch(Ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:$e?$e.toLowerCase():yt,token:rt,positions:ue})})).json();vn.success?S(vn==null?void 0:vn.data):(console.log(vn.error_message),ln.error(vn.error_message))}catch(rt){console.error("Error tag request",rt),ln.error(rt.message)}finally{vi(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(PUe,{}),i.jsx(v5,{open:ot,setOpen:ft,copyTradeData:ct,copyTradeWallet:Nt,setCopyTradeWallet:mn,isScalper:It,setCopyTradeData:Vt}),i.jsx(ain,{open:dn,setOpen:Pt,data:Rn,setTradeInfo:An}),i.jsxs("div",{className:"min-h-max flex flex-col items-center justify-start text-white bg-[#161616] dark:bg-inherit w-full gap-1 overflow-hidden font-manrope",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-4 w-full mt-1 sm-mt-0",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1 h-max min-h-[45px] sm:min-h-max relative w-full",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row items-start justify-start sm:items-center gap-1",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx(eDe,{wallet:e,className:"w-10 h-10 rounded-full"}),i.jsxs("div",{className:`${Lr.some(ue=>(ue==null?void 0:ue.wallet_address)==(e==null?void 0:e.toLowerCase()))?"bg-[#67ffbd]/20 rounded-xl p-[7px]":""} flex justify-start items-center gap-1 ml-1`,children:[i.jsx("div",{className:"flex flex-col items-start justify-center gap-1",children:i.jsx("div",{className:`${Lr.some(ue=>(ue==null?void 0:ue.wallet_address)==(e==null?void 0:e.toLowerCase()))?"text-[#67ffbd]":"text-white"} text-base sm:text-[24px] font-semibold font-manrope leading-none tracking-wide`,children:e&&e.slice(0,6)+"..."+e.slice(-4)})}),i.jsxs("svg",{onClick:ue=>{ue.stopPropagation(),navigator.clipboard.writeText(e),ln.success("Successfully copied.")},className:"cursor-pointer",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M12 9.675V12.825C12 15.45 10.95 16.5 8.325 16.5H5.175C2.55 16.5 1.5 15.45 1.5 12.825V9.675C1.5 7.05 2.55 6 5.175 6H8.325C10.95 6 12 7.05 12 9.675Z",stroke:`${Lr.some(ue=>(ue==null?void 0:ue.wallet_address)==(e==null?void 0:e.toLowerCase()))?"#67FFBD":"#909090"}`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M16.5 5.175V8.325C16.5 10.95 15.45 12 12.825 12H12V9.675C12 7.05 10.95 6 8.325 6H6V5.175C6 2.55 7.05 1.5 9.675 1.5H12.825C15.45 1.5 16.5 2.55 16.5 5.175Z",stroke:`${Lr.some(ue=>(ue==null?void 0:ue.wallet_address)==(e==null?void 0:e.toLowerCase()))?"#67FFBD":"#909090"}`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsxs("div",{className:`${Lr.some(ue=>(ue==null?void 0:ue.wallet_address)==(e==null?void 0:e.toLowerCase()))?"ml-1 p-1":""} flex justify-start items-center h-6 bg-[#67ffbd]/20 rounded-md gap-0.5 has-tooltip relative min-w-max`,children:[Sr&&i.jsx("div",{className:"text-[#67ffbd] text-sm font-semibold font-manrope leading-[8px]",children:Sr.wallet_name.length>13?Sr.wallet_name.slice(0,13)+"...":Sr.wallet_name}),Sr&&Sr.wallet_name.length>13&&i.jsx("span",{className:"",children:i.jsx(Fa,{content:`${Sr==null?void 0:Sr.wallet_name}`,positionTop:!1,alignRight:!1})})]}),i.jsxs("div",{className:`${ie.some(ue=>ue.wallet_address===e)?Sr?"ml-1 p-1":"ml-0.5 mr-2 p-1":""} flex justify-start items-center h-6 bg-[#67ffbd]/20 rounded-md gap-0.5 has-tooltip relative min-w-max`,children:[Br&&i.jsx("div",{className:"text-[#67ffbd] text-sm font-semibold font-manrope leading-[8px]",children:(Br==null?void 0:Br.tag.length)>13?(Br==null?void 0:Br.tag.slice(0,13))+"...":Br==null?void 0:Br.tag}),Br&&Br.tag.length>13&&i.jsx("span",{className:"",children:i.jsx(Fa,{content:`${Br==null?void 0:Br.tag}`,positionTop:!1,alignRight:!1})})]})]}),i.jsx(y5,{walletAddress:e,children:i.jsx("div",{className:`${re.some(ue=>ue.wallet_address===e),"bg-[rgba(255,217,121,0.16)]"} w-6 h-6sm:w-8 sm:h-8 px-2 sm:px-4 py-1 rounded-full justify-center items-center inline-flex cursor-pointer`,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex",children:re.some(ue=>ue.wallet_address===e)?i.jsx("img",{src:a5,alt:"",className:"w-4 h-4 min-w-4 min-h-4"}):i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",children:i.jsx("path",{d:"M10.2967 2.6325L11.6167 5.2725C11.7967 5.64 12.2767 5.9925 12.6817 6.06L15.0742 6.4575C16.6042 6.7125 16.9642 7.8225 15.8617 8.9175L14.0017 10.7775C13.6867 11.0925 13.5142 11.7 13.6117 12.135L14.1442 14.4375C14.5642 16.26 13.5967 16.965 11.9842 16.0125L9.7417 14.685C9.3367 14.445 8.6692 14.445 8.2567 14.685L6.0142 16.0125C4.4092 16.965 3.4342 16.2525 3.8542 14.4375L4.3867 12.135C4.4842 11.7 4.3117 11.0925 3.9967 10.7775L2.1367 8.9175C1.0417 7.8225 1.3942 6.7125 2.9242 6.4575L5.3167 6.06C5.7142 5.9925 6.1942 5.64 6.3742 5.2725L7.6942 2.6325C8.4142 1.2 9.5842 1.2 10.2967 2.6325Z",stroke:"#FFD979",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})})})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("div",{onClick:ue=>{var yt;ue.preventDefault();const rt=ie==null?void 0:ie.some(hn=>hn.wallet_address===e),Ft=(fe==null?void 0:fe.length)>0?(yt=fe[0])==null?void 0:yt.is_scalper:!1;xn({walletAddress:e,isFollow:rt,isScalper:Ft})},className:`${ie.some(ue=>ue.wallet_address===e)?"bg-[#ffd979]/60 text-white/80":"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]"} h-6 sm:h-8 px-2 sm:px-3 py-[1px] sm:py-[5px] rounded-[256px] justify-start items-center gap-2 inline-flex cursor-pointer min-w-max has-tooltip relative ml-8 sm:ml-2`,children:i.jsx("div",{className:"text-[14px] font-semibold font-manrope leading-[8px]min-w-max",children:ie.some(ue=>ue.wallet_address===e)?"Edit Copy Trade":"Copy Trade"})}),i.jsx("div",{className:"sm:hidden h-6 flex justify-end",children:Y&&i.jsx(qY,{walletAddress:e})})]}),i.jsx(Jsn,{traderWallet:e,trades:J})]}),i.jsxs("div",{className:"absolute right-0 flex justify-end",children:[Y&&i.jsx(qY,{walletAddress:e}),i.jsx("div",{className:"absolute right-0 hidden sm:flex",children:Y&&i.jsx(qY,{walletAddress:e})})]})]}),i.jsxs("div",{className:"flex w-full flex-wrap",children:[i.jsxs("div",{className:"w-full lg:w-4/12 order-2 lg:order-1",children:[i.jsx("div",{ref:xt,className:"flex w-full justify-start items-center",children:i.jsxs("div",{className:"grid grid-cols-2 gap-2 w-full",children:[i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Perp Equity"}),i.jsxs("div",{className:"text-white font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]",children:["$",f?Cr(f==null?void 0:f.marginSummary.accountValue):"-"]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-3 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between gap-1 w-full",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:"Margin Usage"}),i.jsxs("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:[f?(parseFloat(f.marginSummary.totalMarginUsed)/parseFloat(f.marginSummary.accountValue)*100).toFixed(2):"-","%"]})]}),i.jsx("div",{className:"w-full h-1 bg-[#414141] rounded-[256px]",children:i.jsx("div",{style:f?{width:`${parseFloat(f.marginSummary.totalMarginUsed)/parseFloat(f.marginSummary.accountValue)*100}%`}:{width:"0%"},className:"h-1 bg-white rounded-[256px]"})})]})]}),i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsxs("div",{onClick:()=>{An(ue=>({...ue,coin:"--",type:f?parseFloat(f.marginSummary.totalNtlPos)===0?"NEUTRAL":a.reduce((rt,Ft)=>rt+(Ft.type==="Long"?parseFloat(Ft.positionValue):-parseFloat(Ft.positionValue)),0)>0?"LONG":"SHORT":"--",leverage:mt&&mt!=0?`${parseFloat(mt).toFixed(2)}x`:"--",roe:wt.length>0?wt.map(rt=>rt==null?void 0:rt.margin_roi).join(", "):"--",entryPrice:f?a.reduce((rt,Ft)=>rt+parseFloat(Ft.unrealizedPnl||0),0):"-",markPrice:At>0?`${Gt} / ${At} (${Gt/At*100===0||Gt/At*100===100?Gt/At*100:(Gt/At*100).toFixed(2)}%)`:"--",positionDistribution:f?`${isNaN(a.reduce((rt,Ft)=>Ft.type==="Long"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:a.reduce((rt,Ft)=>Ft.type==="Long"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100===0||a.reduce((rt,Ft)=>Ft.type==="Long"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100===100?a.reduce((rt,Ft)=>Ft.type==="Long"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100:(a.reduce((rt,Ft)=>Ft.type==="Long"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2)}% / ${isNaN(a.reduce((rt,Ft)=>Ft.type==="Short"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:a.reduce((rt,Ft)=>Ft.type==="Short"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100===0||a.reduce((rt,Ft)=>Ft.type==="Short"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100===100?a.reduce((rt,Ft)=>Ft.type==="Short"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100:(a.reduce((rt,Ft)=>Ft.type==="Short"?rt+parseFloat(Ft.positionValue):rt,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2)}%`:"-",referral:window.localStorage.getItem("hyperToken")?ce:null})),Pt(!0)},className:"flex justify-start items-center gap-2.5 cursor-pointer",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"uPnL"}),i.jsxs("div",{className:"flex justify-center items-center rounded-[8px] bg-[rgba(103,255,189,0.16)] gap-1 py-1 px-2",children:[i.jsx("span",{children:i.jsx("img",{src:nyt,alt:"Dextrabot"})}),i.jsx("span",{className:"text-[#67FFBD] font-manrope text-[11px] not-italic font-semibold leading-[8px] tracking-[0.11px]",children:"Share"})]})]}),i.jsxs("div",{className:`${f&&a.reduce((ue,rt)=>ue+parseFloat(rt.unrealizedPnl),0)>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]`,children:["$",f?Cr(Math.abs(a.reduce((ue,rt)=>ue+parseFloat(rt.unrealizedPnl||0),0))):"-"]})]}),i.jsx("div",{className:"flex flex-col justify-start items-start",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Current Win Rate"}),i.jsxs("div",{className:"text-white font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px] min-w-max",children:[i.jsx("span",{className:"text-[#67FFBD]",children:Gt})," ","/ ",At," (",fn==0?"0":fn!=0&&fn!=100?fn.toFixed(2):fn,"%)"]})]})})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4 relative",children:[i.jsxs("div",{className:"flex justify-end items-center gap-1 w-auto absolute right-1.5 top-1.5 bg-[#272727] rounded-2xl",children:[i.jsx("div",{onClick:()=>{lt("1D"),localStorage.setItem("discover_period",0)},className:`${nt==="1D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"1D"})}),i.jsx("div",{onClick:()=>{lt("7D"),localStorage.setItem("discover_period",1)},className:`${nt==="7D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"7D"})}),i.jsx("div",{onClick:()=>{lt("30D"),localStorage.setItem("discover_period",2)},className:`${nt==="30D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})}),i.jsx("div",{onClick:()=>{lt("90D"),localStorage.setItem("discover_period",3)},className:`${nt==="90D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"90D"})})]}),(We==null?void 0:We.length)>0?We==null?void 0:We.map((ue,rt)=>i.jsxs("div",{className:"flex flex-col space-y-4 sm:space-y-6 mt-4 sm:mt-0 lg:space-y-4 lg:mt-4 xl:space-y-6 xl:mt-0 justify-center items-start",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Win Rate"}),i.jsx("div",{className:"text-white text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:(ue==null?void 0:ue.win_complated_rate)==null||isNaN(parseFloat(ue==null?void 0:ue.win_complated_rate))?"--":(ue==null?void 0:ue.win_complated_rate)+"%"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Tx Count"}),i.jsx("div",{className:"text-white text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:(ue==null?void 0:ue.rtx_count)==null||isNaN(parseFloat(ue==null?void 0:ue.rtx_count))?"--":Is(ue==null?void 0:ue.rtx_count)})]})]},rt)):i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center mt-4 sm:mt-0 lg:mt-4 xl:mt-0 gap-1 sm:gap-2 lg:gap-1 xl:gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Win Rate"}),i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"}),i.jsx("div",{className:"w-36 h-px mt-2 sm:mt-[6px] xl:mt-[8px] mb-[8px] sm:mb-[14px] lg:mb-[8px] xl:mb-[14px] bg-[#353535]"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Trade Count"}),i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4 relative",children:[i.jsxs("div",{className:"flex justify-end items-center gap-0.5 absolute right-1.5 top-1.5 bg-[#272727] w-auto rounded-2xl",children:[i.jsx("div",{onClick:()=>{Ut("day"),Zt("1D"),localStorage.setItem("discover_period",0)},className:`${Lt==="day"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"1D"})}),i.jsx("div",{onClick:()=>{Ut("week"),Zt("7D"),localStorage.setItem("discover_period",1)},className:`${Lt==="week"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"7D"})}),i.jsx("div",{onClick:()=>{Ut("month"),Zt("30D"),localStorage.setItem("discover_period",2)},className:`${Lt==="month"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})}),i.jsx("div",{onClick:()=>{Ut("threeMonth"),Zt("90D"),localStorage.setItem("discover_period",3)},className:`${Lt==="threeMonth"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"90D"})}),i.jsx("div",{onClick:()=>{Ut("allTime"),Zt("90D"),localStorage.setItem("discover_period",4)},className:`${Lt==="allTime"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"All"})})]}),i.jsxs("div",{className:`${!(wt!=null&&wt.length)>0?"space-y-1.5 sm:space-y-3.5 lg:space-y-1.5 xl:space-y-3.5":"space-y-4 sm:space-y-6 lg:space-y-4 xl:space-y-6"} flex flex-col justify-center items-start mt-4 sm:mt-0 lg:mt-4 xl:mt-0`,children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"PnL"}),Re?i.jsx("div",{className:`${Re.day===0||Re.week===0||Re.month===0||Re.threeMonth===0||Re.all===0?"text-white":Lt==="day"?Re.day>0?"text-[#67FFBD]":Re.day<0?"text-[#FF7173]":"text-white":Lt==="week"?Re.week>0?"text-[#67FFBD]":Re.week<0?"text-[#FF7173]":"text-white":Lt==="month"?Re.month>0?"text-[#67FFBD]":Re.month<0?"text-[#FF7173]":"text-white":Lt==="threeMonth"?Re.threeMonth>0?"text-[#67FFBD]":Re.threeMonth<0?"text-[#FF7173]":"text-white":Lt==="allTime"?Re.all>0?"text-[#67FFBD]":Re.all<0?"text-[#FF7173]":"text-white":"text-white"} text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:(()=>{const ue={day:Re.day,week:Re.week,month:Re.month,threeMonth:Re.threeMonth,allTime:Re.all}[Lt];return`$${Is(Math.abs(ue))}`})()}):i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]}),!(wt!=null&&wt.length)>0&&i.jsx("div",{className:"w-36 h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"ROE"}),(wt==null?void 0:wt.length)>0?wt==null?void 0:wt.map((ue,rt)=>i.jsx("div",{className:`${(ue==null?void 0:ue.margin_roi)==null||isNaN(parseFloat(ue==null?void 0:ue.margin_roi))||(ue==null?void 0:ue.margin_roi)==0?"text-white":(ue==null?void 0:ue.margin_roi)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:(ue==null?void 0:ue.margin_roi)==null||isNaN(parseFloat(ue==null?void 0:ue.margin_roi))?"--":Is(Math.abs(ue==null?void 0:ue.margin_roi))+"%"})):i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Direction Bias"}),i.jsx("div",{className:"text-white font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]",children:f?parseFloat(f.marginSummary.totalNtlPos)===0?i.jsx("span",{children:"NEUTRAL"}):a.reduce((ue,rt)=>ue+(rt.type==="Long"?parseFloat(rt.positionValue):-parseFloat(rt.positionValue)),0)>0?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"direction-icon text-[#67FFBD]",children:"↗"}),i.jsx("span",{className:"text-[#67FFBD]",children:"LONG"})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"direction-icon text-[#FF7173]",children:"↘"}),i.jsx("span",{className:"text-[#FF7173]",children:"SHORT"})]}):"-"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-3 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between gap-1 w-full",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:"Long Exposure"}),i.jsxs("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:[f?(a.reduce((ue,rt)=>rt.type==="Long"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]})]}),i.jsx("div",{className:"w-full h-1 bg-[#414141] rounded-[256px]",children:i.jsx("div",{style:f?{width:`${a.reduce((ue,rt)=>rt.type==="Long"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100}%`}:{width:"0%"},className:"h-1 bg-white rounded-[256px]"})})]})]}),i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Position Distribution"}),i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]",children:i.jsxs("span",{className:"float-right flex gap-3",children:[i.jsxs("span",{className:"text-[#67FFBD]",children:[f?isNaN(a.reduce((ue,rt)=>rt.type==="Long"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:(a.reduce((ue,rt)=>rt.type==="Long"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]}),i.jsxs("span",{className:"text-[#FF7173]",children:[f?isNaN(a.reduce((ue,rt)=>rt.type==="Short"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:(a.reduce((ue,rt)=>rt.type==="Short"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]})]})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 w-full",children:[i.jsx("div",{className:"text-white bg-transparent text-xs font-medium font-inter leading-[8px] tracking-[0.18px] w-full",children:i.jsxs("span",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-[#67ffbd]",children:f?ut(a.reduce((ue,rt)=>rt.type==="Long"?ue+parseFloat(rt.positionValue):ue,0)):"-"}),i.jsx("span",{className:"text-[#ff787b]",children:f?ut(a.reduce((ue,rt)=>rt.type==="Short"?ue+parseFloat(rt.positionValue):ue,0)):"-"})]})}),i.jsxs("div",{className:"h-1 w-full bg-[#161616] rounded-[256px] flex gap-[2px] overflow-hidden",children:[i.jsx("div",{style:f?isNaN(a.reduce((ue,rt)=>rt.type==="Long"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?{width:"0%"}:{width:`${a.reduce((ue,rt)=>rt.type==="Long"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100}%`}:{width:"0%"},className:"flex justify-center items-center h-1 bg-[#67FFBD] rounded-[256px] text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"}),i.jsx("div",{style:f?isNaN(a.reduce((ue,rt)=>rt.type==="Short"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?{width:"0%"}:{width:`${a.reduce((ue,rt)=>rt.type==="Short"?ue+parseFloat(rt.positionValue):ue,0)/parseFloat(f.marginSummary.totalNtlPos)*100}%`}:{width:"0%"},className:"bg-[#FF797C] h-1 rounded-[256px] flex justify-center items-center text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"})]})]})]}),i.jsxs("div",{className:"col-span-2 flex gap-2 w-full",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start flex-[0.7] h-[92px] bg-[#1c1c1c] rounded-2xl p-[11px] relative gap-[14px]",children:[i.jsx("div",{className:"flex flex-col justify-start items-start",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase",children:"Avg Leverage"}),i.jsx("div",{className:"text-white text-sm font-semibold font-['Manrope'] leading-[13px] tracking-tight",children:mt&&mt!=0?`${parseFloat(mt).toFixed(2)}x`:"--"})]})}),i.jsx("div",{className:"flex flex-col justify-start items-start",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase",children:"Funding"}),i.jsx("div",{className:`${qt<=0?"text-[#67FFBD]":"text-[#FF7173]"} text-sm font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:qt&&qt!=0?`$${Cv(Math.abs(qt))}`:"--"})]})})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start flex-[2] h-[92px] bg-[#1c1c1c] rounded-2xl p-1 relative w-full",children:[i.jsx("div",{className:"absolute left-2.5 top-[11px] text-[#9b9b9b] text-[13px] font-medium font-['Manrope'] leading-none tracking-tight",children:"Performance"}),i.jsxs("div",{className:"flex justify-end items-center gap-1 w-auto absolute right-[9px] top-[9px] bg-[#272727] rounded-2xl",children:[i.jsx("div",{onClick:()=>{Je("7D"),localStorage.setItem("discover_period",1)},className:`${Ge==="7D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"7D"})}),i.jsx("div",{onClick:()=>{Je("30D"),localStorage.setItem("discover_period",2)},className:`${Ge==="30D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})}),i.jsx("div",{onClick:()=>{Je("90D"),localStorage.setItem("discover_period",3)},className:`${Ge==="90D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"90D"})})]}),Fe?i.jsxs("div",{className:"flex justify-between items-start gap-1 w-full mt-[43px]",children:[i.jsxs("div",{className:"flex-[0.6] p-1.5 h-[41px] bg-[#2e2e2e] rounded-[10px] flex flex-col items-start justify-center gap-[2px]",children:[i.jsxs("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase flex justify-start items-center gap-0.5",children:["Sharpe",i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-3 min-w-3 min-h-3 h-3"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Sharpe_tooltip",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[80px] min-w-[80px] leading-[16px] -mb-12"})})]})})]}),i.jsx("div",{className:`${(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharpe:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)>=1&&(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharpe:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)<=2?"text-[#E5BB18]":(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharp:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)>2?"text-[#1DE6A3]":"text-[#FF7173]"} text-base font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:Ge==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_sharpe)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_sharpe))?"--":Cr(Fe==null?void 0:Fe.portfolio_perp_week_sharpe):Ge==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_sharpe)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_sharpe))?"--":Cr(Fe==null?void 0:Fe.portfolio_perp_month_sharpe):(Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_3month_sharpe))?"--":Cr(Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)})]}),i.jsxs("div",{className:"flex-1 p-1.5 h-[41px] bg-[#2e2e2e] rounded-[10px] flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide min-w-max uppercase",children:"Growth Rate"}),i.jsx("div",{className:`${(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_growth_rate:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_growth_rate:Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)==0?"text-white":(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_growth_rate:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_growth_rate:Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-base font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:Ge==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate))?"--":Is(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate)+"%":Ge==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate))?"--":Is(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate)+"%":(Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate))?"--":Is(Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)+"%"})]}),i.jsxs("div",{className:"flex-[0.9] p-1.5 h-[41px] bg-[#2e2e2e] rounded-[10px] flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase",children:"Drawdown"}),i.jsx("div",{className:`${(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_dd:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_dd:Fe==null?void 0:Fe.portfolio_perp_3month_dd)==0?"text-white":(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_dd:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_dd:Fe==null?void 0:Fe.portfolio_perp_3month_dd)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-base font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:Ge==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_dd))?"--":Is(Math.abs(Fe==null?void 0:Fe.portfolio_perp_week_dd))+"%":Ge==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_dd))?"--":Is(Math.abs(Fe==null?void 0:Fe.portfolio_perp_month_dd))+"%":(Fe==null?void 0:Fe.portfolio_perp_3month_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_3month_dd))?"--":Is(Math.abs(Fe==null?void 0:Fe.portfolio_perp_3month_dd))+"%"})]})]}):i.jsx("div",{className:"flex flex-col justify-start items-start mt-[43px] mx-auto",children:i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})})]})]})]})}),i.jsxs("div",{className:"absolute sm:hidden -bottom-8 right-2 z-10 flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:jt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:kt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})})]})]}),i.jsx("div",{className:"w-full lg:w-8/12 h-full order-1 lg:order-2",children:i.jsx(Ysn,{})})]})]}),i.jsx(WUe,{initialAddress:e})]})]})},Oin=()=>{const e=e5(),t=(e==null?void 0:e.walletAddress.toLowerCase())||"";return i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsxs("title",{children:["Explore ",`${t}`," - Hyperliquid Wallet Overview & History - Dextrabot"]}),i.jsx("meta",{name:"description",content:`Explore real-time transactions, holdings, and insights for ${t} on HyperLiquid. Track wallet activity and make data-driven trading decisions.`}),i.jsx("meta",{name:"og:title",content:`Explore ${t} - Hyperliquid Wallet Overview & History - Dextrabot`}),i.jsx("meta",{name:"og:description",content:`Explore real-time transactions, holdings, and insights for ${t} on HyperLiquid. Track wallet activity and make data-driven trading decisions.`}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:`https://app.dextrabot.com/wallet-details/${t}`})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-screen min-h-max px-2 pt-3 sm:px-6 sm:pt-4 bg-[#161616]",children:i.jsx(Fin,{initialAddress:t})})]})},Min=({isOpen:e,onClose:t,children:n,zIndex:r=9999,closeOnBackdropClick:s=!0})=>(m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),e?yre.createPortal(i.jsxs("div",{className:"fixed inset-0 flex justify-center items-center pointer-events-auto",style:{zIndex:r},children:[i.jsx("div",{onClick:s?t:void 0,className:"absolute inset-0 bg-black bg-opacity-50 backdrop-blur-sm transition-opacity duration-300"}),i.jsx("div",{className:"relative bg-[#252525] rounded-3xl shadow-lg w-[400px] max-w-full pointer-events-auto",children:n})]}),document.body):null);function Rin(){const{signModalOpen:e,setSignModalOpen:t,signIn:n,hyperToken:r,walletLogin:s}=m.useContext(Qr),{isConnected:a}=Jr(),{openConnectModal:o}=b5(),l=typeof window<"u"&&window.matchMedia("(max-width:640px)").matches,c=()=>{window.localStorage.getItem("hyperToken")&&r?s():(n(1),t(!1))};return i.jsx(Min,{isOpen:e,onClose:()=>t(!1),children:i.jsxs("div",{className:"flex flex-col items-center gap-8 w-[400px] bg-[#252525] rounded-3xl py-4 relative pointer-events-auto",children:[i.jsx("span",{onClick:()=>t(!1),className:"absolute top-2 right-2 w-9 h-9 rounded-full flex items-center justify-center hover:bg-[#7535FE] cursor-pointer",children:i.jsx("img",{src:Ba,alt:"close",className:"p-1"})}),i.jsx("img",{src:qi,alt:"dextrabot",className:"w-[86px] h-[86px] mt-4"}),i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsx("div",{className:"text-white text-[32px] leading-none",children:"Welcome Dextrabot"}),i.jsx("div",{className:"text-white/60 text-sm leading-none",children:l?"Scan the QR code to continue":"Connect your wallet to continue"})]}),i.jsx("div",{className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer text-center",children:a?l?i.jsx(e_,{}):i.jsx("div",{onClick:c,className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("span",{className:"text-white text-sm leading-none",children:"Wallet Sign‑in"})}):l?i.jsx("div",{className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl",children:i.jsx("span",{className:"text-white text-sm leading-none",children:i.jsx(e_,{})})}):i.jsx("div",{onClick:o,className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("div",{className:"text-center text-white text-sm font-manrope leading-none",children:"Connect Wallet"})})}),i.jsxs("div",{className:"text-center pt-2",children:[i.jsx("span",{className:"text-white/60 text-xs",children:"Do you need support? "}),i.jsx("span",{onClick:()=>window.open("https://discord.gg/dextrabot","_blank"),className:"text-[#b593ff] text-xs cursor-pointer",children:"Join Discord"})]})]})})}const zl=()=>i.jsxs("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:[i.jsx("div",{className:"p-4 bg-[#ff356629] rounded-full",children:i.jsx("img",{src:Bbt,alt:"",className:"w-8 h-8"})}),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx("div",{className:"text-[#FF3566]",children:"Error"}),i.jsxs("div",{className:"text-[#767676]",children:["We encountered a problem"," ",i.jsxs("span",{children:["wait a",i.jsx("br",{})," moment before try again"]})]})]})]}),Lin=({data:e,loading:t,error:n,trackerData:r,isRequest:s,setIsRequest:a})=>{var Ae;const{trackedWatchList:o,getTrackedWatchList:l,setSignModalOpen:c}=m.useContext(Qr),{isConnected:u,address:d}=Jr(),[f,x]=m.useState(!1),[g,v]=m.useState(null),[w,C]=m.useState(null),[N,I]=m.useState(""),[P,R]=m.useState([]),[F,U]=m.useState(!1),[L,z]=m.useState({}),Q="-tag",[ne,J]=m.useState(Q),X=ye=>r.sort((je,Ie)=>{const Re=P.find(Vt=>Vt.wallet_address===je.wallet_address)||{},Qe=P.find(Vt=>Vt.wallet_address===Ie.wallet_address)||{},$e=Re.data?Re.data.reduce((Vt,It)=>Vt+parseFloat(It.unrealizedPnl||0),0):Re.unrealizedPnl||0,it=Qe.data?Qe.data.reduce((Vt,It)=>Vt+parseFloat(It.unrealizedPnl||0),0):Qe.unrealizedPnl||0,tt=je.tag?je.tag.toUpperCase():"",ot=Ie.tag?Ie.tag.toUpperCase():"",ft=je.wallet_address?je.wallet_address.toLowerCase():"",ct=Ie.wallet_address?Ie.wallet_address.toLowerCase():"";return ye==="tag"?tt<ot?-1:tt>ot?1:0:ye==="-tag"?tt>ot?-1:tt<ot?1:0:ye==="-wallet_address"?ft<ct?-1:ft>ct?1:0:ye==="wallet_address"?ft>ct?-1:ft<ct?1:0:ye==="perp_equity"?(Re.perp_equity||0)-(Qe.perp_equity||0):ye==="-perp_equity"?(Qe.perp_equity||0)-(Re.perp_equity||0):ye==="margin_usage"?(Re.margin_usage||0)-(Qe.margin_usage||0):ye==="-margin_usage"?(Qe.margin_usage||0)-(Re.margin_usage||0):ye==="unrealizedPnl"?$e-it:ye==="-unrealizedPnl"?it-$e:ye==="-expire_date"?new Date(Ie.expire_date)-new Date(je.expire_date):ye==="expire_date"?new Date(je.expire_date)-new Date(Ie.expire_date):0}),re=async({walletAddress:ye,isFollow:je,isScalper:Ie})=>{try{I(ye);const Re=window.localStorage.getItem("hyperToken"),Qe=window.localStorage.getItem("hyperAddress");if(!Re){c(!0);return}const $e=je?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",it=je?{address:d?d.toLowerCase():Qe,token:Re,follow_address:ye.toLowerCase()}:{address:d?d.toLowerCase():Qe,token:Re},tt=await fetch($e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(it)});if(!tt.ok)throw new zl(`Server responded with status ${tt.status}`);const ot=await tt.json();ot.success?(v(Array.isArray(ot==null?void 0:ot.data)?[...ot.data].sort((ft,ct)=>new Date(ct.created_at||0)-new Date(ft.created_at||0)):ot==null?void 0:ot.data),C(Ie),x(!0)):(console.log(ot.error_message),ln.error(ot.error_message))}catch(Re){console.error("Error in like function:",Re),ln.error(Re.message||"Something went wrong!")}},pe=ye=>ye!=null&&ye.assetPositions?ye.assetPositions.filter(je=>{if(!je.position||!je.position.szi)return!1;const Ie=parseFloat(je.position.szi);return!isNaN(Ie)&&Ie!==0}).map(je=>{const Ie=je.position,Re=parseFloat(Ie.szi),Qe=parseFloat(Ie.entryPx),$e=parseFloat(Ie.positionValue),it=parseFloat(Ie.unrealizedPnl),tt=parseFloat(Ie.returnOnEquity)*100,ot=parseFloat(Ie.marginUsed),ft=Ie.leverage.value,ct=parseFloat(Ie.cumFunding.sinceOpen),Vt=Re>0?"Long":"Short";return{asset:Ie.coin,type:Vt,size:Math.abs(Re),entryPrice:Qe.toFixed(2),currentPrice:($e/Math.abs(Re)).toFixed(2),leverage:ft,positionValue:$e.toFixed(2),marginUsed:ot.toFixed(2),unrealizedPnl:it.toFixed(2),roe:tt.toFixed(2),funding:ct.toFixed(4),liquidationPrice:Ie.liquidationPx?parseFloat(Ie.liquidationPx).toFixed(2):"N/A"}}):[],Y=async ye=>{try{const Ie=await ds.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:ye});if(Ie.data){const Re=pe(Ie.data);R(Qe=>{var $e,it,tt,ot;return[...Qe,{wallet_address:ye,perp_equity:(it=($e=Ie==null?void 0:Ie.data)==null?void 0:$e.marginSummary)==null?void 0:it.accountValue,margin_usage:parseFloat((tt=Ie==null?void 0:Ie.data)==null?void 0:tt.marginSummary.totalMarginUsed)/parseFloat((ot=Ie==null?void 0:Ie.data)==null?void 0:ot.marginSummary.accountValue),data:Re}]})}}catch(je){console.error("Error fetching user state from HyperState:",je)}},ie=async ye=>{try{const je=window.localStorage.getItem("hyperToken"),Ie="https://dextrabothypev2.nftinit.io/api/hyper/tracker/getclearinghousestate/",Re=window.localStorage.getItem("hyperAddress"),Qe=await fetch(Ie,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d.toLowerCase():Re,token:je,follow_address:ye})});if(Qe.ok){const $e=await Qe.json();if($e.success){const it=pe($e==null?void 0:$e.data);R(tt=>{var ot;return[...tt,{wallet_address:ye,perp_equity:(ot=$e==null?void 0:$e.data.marginSummary)==null?void 0:ot.accountValue,margin_usage:parseFloat($e==null?void 0:$e.data.marginSummary.totalMarginUsed)/parseFloat($e==null?void 0:$e.data.marginSummary.accountValue),data:it}]})}}else if(Qe.status===500)console.warn(`Received 500 error for ${ye}, retrying with getUserHyperState`),await Y(ye);else throw new zl(`Request failed with status ${Qe.status}`)}catch(je){console.error("Error fetching user state:",je)}},oe=m.useRef(!1);m.useEffect(()=>{!t&&s&&!oe.current&&(oe.current=!0,(async()=>{for(let je=0;je<r.length;je++){const Ie=r[je];ie(Ie==null?void 0:Ie.wallet_address.toLowerCase()).catch(Re=>{console.error(`Error fetching user state for wallet ${Ie.wallet_address}:`,Re)}),await new Promise(Re=>setTimeout(Re,500))}})())},[s,t,r]);const G=async(ye,je)=>{try{const Ie=window.localStorage.getItem("hyperToken"),Re="https://dextrabothypev2.nftinit.io/api/hyper/tracker/extend_tracker_expiry/";if(!Ie||!ye||!je)return;z(tt=>({...tt,[je]:!0}));const Qe=window.localStorage.getItem("hyperAddress"),$e=await fetch(Re,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d==null?void 0:d.toLowerCase():Qe,token:Ie,tracker_id:ye})});if(!$e.ok)throw new zl(`Failed to unlike: ${$e.status} ${$e.statusText}`);const it=await $e.json();it.success?(z(tt=>({...tt,[je]:!1})),l(),ln.success(`${je.slice(0,5)}...${je.slice(-3)} Tracker successfully renewed`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(ln.error(it.error_message),z(tt=>({...tt,[je]:!1})))}catch(Ie){ln.error(Ie.message||"Something went wrong!"),z(Re=>({...Re,[je]:!1}))}},V=m.useRef(null),te=()=>{V.current&&(V.current.scrollLeft-=100)},ae=()=>{V.current&&(V.current.scrollLeft+=100)},he=()=>{V.current&&(V.current.scrollTop+=200)},Ce=()=>{V.current&&(V.current.scrollTop-=200)},ce=ye=>{const je=new Date(ye),Ie=new Date,Re=new Date(je.getFullYear(),je.getMonth(),je.getDate()),Qe=new Date(Ie.getFullYear(),Ie.getMonth(),Ie.getDate());return(Re-Qe)/(1e3*60*60*24)<=3},ge=ye=>ye>=640&&ye<1024?5:ye>=1024&&ye<1240?6:ye>=1240&&ye<1540||ye>=1540?7:3;return i.jsxs(i.Fragment,{children:[i.jsx(v5,{open:f,setOpen:x,copyTradeData:g,copyTradeWallet:N,setCopyTradeWallet:I,isScalper:w,setCopyTradeData:v}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full font-manrope",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] pl-2 sm:pl-0 pt-4",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Tracked Wallets"})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute hidden -top-6 right-4 z-10 lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:te,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:ae,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:Ce,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:he,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full max-w-[1260px] h-full overflow-x-scroll relative overflow-y-scroll flex-grow",ref:V,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[130px] sm:min-w-[130px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Actions"})})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[130px] h-10 px-1 min-w-[130px] sm:min-w-[150px] z-[8]",children:i.jsx(di,{title:"Tag",sortKey:"tag",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] left-[260px] sm:left-[280px] h-10 px-1 min-w-[135px] sm:min-w-[195px] z-[8]",children:i.jsx(di,{title:"Wallet",sortKey:"wallet_address",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[140px] sm:min-w-[130px] px-1",children:i.jsx(di,{title:"Perp Equity",sortKey:"perp_equity",sortOption:ne,setSortOption:J,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[144px] px-1",children:i.jsx(di,{title:"Margin Usage",sortKey:"margin_usage",sortOption:ne,setSortOption:J,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[150px] px-1",children:i.jsx(di,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:ne,setSortOption:J,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-max pl-6 sm:pl-12 pr-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:"Trackers stay active for 15 days. If not renewed, they will automatically stop after that period.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[200px] min-w-[200px] leading-[16px] -mb-[52px]"})})]})}),i.jsx(di,{title:"Expire Date",sortKey:"expire_date",sortOption:ne,setSortOption:J,isFilterIcon:!0})]})}),i.jsx("th",{scope:"col",className:"min-w-max pl-1 pr-4",children:i.jsx("div",{className:"flex justify-end items-center w-full gap-1"})})]})}),i.jsx("tbody",{children:!r||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ge(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Da,{})})})}):n&&!r?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ge(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center ml-[33%] w-max",children:i.jsx(zl,{})})})}):(r==null?void 0:r.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ge(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[44vh] h-66 flex-col justify-center items-center ml-[33%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not yet added a wallet to your follow list."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please visit the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","page to follow wallets."]})]})]})]})})})})}):(Ae=X(ne))==null?void 0:Ae.map((ye,je)=>{var Re,Qe;const Ie=P.find($e=>$e.wallet_address===ye.wallet_address);return i.jsxs("tr",{className:`${je%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${je%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{onClick:$e=>{$e.preventDefault();const it=e==null?void 0:e.some(tt=>tt.wallet_address===(ye==null?void 0:ye.wallet_address));re({walletAddress:ye==null?void 0:ye.wallet_address,isFollow:it,isScalper:ye==null?void 0:ye.is_scalper})},className:`${e!=null&&e.some($e=>$e.wallet_address===(ye==null?void 0:ye.wallet_address))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} h-[22px] rounded-[256px] justify-center items-center gap-1 inline-flex cursor-pointer text-xs font-['Manrope'] leading-[8px] tracking-tight px-2 min-w-max`,children:"Copy Trade"}),i.jsx(y5,{walletAddress:ye==null?void 0:ye.wallet_address,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:o.some($e=>$e.wallet_address===(ye==null?void 0:ye.wallet_address))?i.jsx("img",{src:a5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${je%2===0,"bg-[#161616]"} sm:sticky sm:left-[130px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:[i.jsx(aa,{info1:ye!=null&&ye.tag?(ye==null?void 0:ye.tag.length)>=13?(ye==null?void 0:ye.tag).slice(0,13)+"...":ye==null?void 0:ye.tag:"--",info1_Color:"text-white",rowTwo:!1}),(ye==null?void 0:ye.tag)&&(ye==null?void 0:ye.tag.length)>=13&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(Fa,{content:`${ye==null?void 0:ye.tag}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${je%2===0,"bg-[#161616]"} sm:sticky sm:left-[280px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${ye==null?void 0:ye.wallet_address}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-8 sm:h-8 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:qi,alt:"dextra",className:"w-4 h-4 sm:w-8 sm:h-8",loading:"lazy",onError:$e=>{$e.target.onerror=null,$e.target.src="https://app.dextrabot.com/dextrabotIcon.png"}})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(ye==null?void 0:ye.wallet_address).slice(0,5)+"..."+(ye==null?void 0:ye.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:$e=>{$e.stopPropagation(),navigator.clipboard.writeText(ye==null?void 0:ye.wallet_address),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"pr-1",children:F?i.jsx(Zm,{info:"Loading...",textColor:"text-white"}):Ie?i.jsx(Zm,{info:(Ie==null?void 0:Ie.perp_equity)!=0?`$${Cr(Ie==null?void 0:Ie.perp_equity)}`:"$0",textColor:"text-white"}):i.jsx(Zm,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1",children:F?i.jsx(Zm,{info:"Loading...",textColor:"text-white"}):Ie?i.jsx(Zm,{info:isNaN(Ie==null?void 0:Ie.margin_usage)?"0%":`${((Ie==null?void 0:Ie.margin_usage)*100).toFixed(2)}%`,textColor:"text-white"}):i.jsx(Zm,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1",children:F?i.jsx(Zm,{info:"Loading...",textColor:"text-white"}):Ie?i.jsx(Zm,{info:(Ie==null?void 0:Ie.data)!=0?`$${Cr(Math.abs((Re=Ie==null?void 0:Ie.data)==null?void 0:Re.reduce(($e,it)=>$e+parseFloat(it.unrealizedPnl||0),0)))}`:"$0",textColor:`${((Qe=Ie==null?void 0:Ie.data)==null?void 0:Qe.reduce(($e,it)=>$e+parseFloat(it.unrealizedPnl),0))>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`}):i.jsx(Zm,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1 min-w-max pl-6 sm:pl-12",children:i.jsxs("div",{className:"flex justify-end items-center gap-0.5 min-w-max",children:[ce(ye==null?void 0:ye.expire_date)&&i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative min-w-max",children:[i.jsx("img",{src:Nyt,alt:"",className:"w-[14px] min-w-[14px] min-h-[14px] h-[14px]"}),i.jsx("span",{className:"",children:i.jsx(ro,{content:`This tracker will expire on ${h3(ye==null?void 0:ye.expire_date)}. Click ‘Renew’ to keep it active.`,positionTop:!1,alignRight:!1,tooltipCss:"max-w-[210px] min-w-[210px] leading-[16px] -mb-[36px]"})})]}),i.jsx(Zm,{info:ye!=null&&ye.expire_date?h3(ye==null?void 0:ye.expire_date):"--",textColor:"text-white"})]})}),i.jsx("td",{className:"pr-4 min-w-max pl-1",children:i.jsx("div",{className:"flex justify-end items-center gap-0.5 min-w-max",children:ce(ye==null?void 0:ye.expire_date)&&(L[ye==null?void 0:ye.wallet_address]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[67px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-[14px] h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsxs("div",{onClick:()=>{G(ye==null?void 0:ye.id,ye==null?void 0:ye.wallet_address)},className:"h-[21px] px-1 py-1.5 bg-[#ffaa47]/20 hover:bg-[#ffaa47]/30 rounded-md flex justify-start items-center gap-1 cursor-pointer ml-[6px]",children:[i.jsx("img",{src:Ayt,alt:""}),i.jsx("div",{className:"justify-start text-[#ffaa46] text-[11px] font-semibold font-['Manrope'] leading-[8px]",children:"Renew"})]}))})})]},je)})})]})})]})]})]})},Zm=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:e})}),dU=()=>{const{isConnected:e}=Jr(),{openConnectModal:t}=b5(),{walletLogin:n,signIn:r}=m.useContext(Qr),s=typeof window<"u"&&window.matchMedia("(max-width: 640px)").matches,a=()=>{window.localStorage.getItem("hyperToken")?n():r(1)};return i.jsxs("div",{className:"flex flex-col justify-center items-center gap-8 w-[400px] h-max bg-[#252525] rounded-3xl py-4 font-manrope",children:[i.jsx("img",{src:qi,alt:"",className:"w-[86px] h-[86px] mt-4"}),i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsx("div",{className:"text-white text-[32px] leading-none",children:"Welcome Dextrabot"}),i.jsx("div",{className:"text-white/60 text-sm leading-none",children:s?"Scan the QR code to continue":"Connect your wallet to continue"})]}),i.jsx("div",{className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer my-10 text-center",children:e?s?i.jsx(e_,{}):i.jsx("div",{onClick:a,className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("span",{className:"text-white text-sm leading-none",children:"Wallet Sign‑in"})}):i.jsx("div",{onClick:()=>s?null:t(),className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("span",{className:"text-white text-sm leading-none",children:s?i.jsx(e_,{}):"Connect Wallet"})})}),i.jsxs("div",{className:"text-center pt-2",children:[i.jsx("span",{className:"text-white/60 text-xs",children:"Do you need support? "}),i.jsx("span",{className:"text-[#b593ff] text-xs cursor-not-allowed",children:"Join Discord"})]})]})},Din=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1);Jr();const{hyperToken:s,copyTradeWatchList:a,getCopyTradeWatchList:o,trackedWatchList:l,setTrackedWatchList:c,getTrackedWatchList:u,trackedWatchListLoading:d,trackedWatchListError:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setMushboomerSOL:C,setIsReferralCode:N,setIsReferralCodeName:I,setIsWhitelist:P,setHyperToken:R,setHyperAddress:F}=m.useContext(Qr);return m.useEffect(()=>{!n&&window.localStorage.getItem("hyperToken")&&(o(),u(),t(!0),r(!0))},[n,s]),m.useEffect(()=>{(async()=>{var Q,ne;const L=window.localStorage.getItem("hyperToken"),z=window.localStorage.getItem("hyperAddress");if(!(!L||!z))try{const J=await ji(z,L);J!=null&&J.success?(x(J==null?void 0:J.telegram_chat_id),g(J==null?void 0:J.subscriber_role),v(J==null?void 0:J.subs_expire_day),w((Q=J==null?void 0:J.mushboomer_counts)==null?void 0:Q.eth),C((ne=J==null?void 0:J.mushboomer_counts)==null?void 0:ne.sol),N(J==null?void 0:J.referral_code),I(J==null?void 0:J.refcode),P(J==null?void 0:J.whitelist),R(L),F(z)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),R(""),F(""))}catch(J){console.error("Token verification error:",J),console.error(J.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Track & Follow Your Favorite Hyperliquids Wallets - Dextrabot"}),i.jsx("meta",{name:"description",content:"Track and follow your favorite HyperLiquid wallets with DextraBot. Get real-time updates on their transactions and trading activity to make smarter moves."}),i.jsx("meta",{name:"og:title",content:"Track & Follow Your Favorite Hyperliquids Wallets - Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Track and follow your favorite HyperLiquid wallets with DextraBot. Get real-time updates on their transactions and trading activity to make smarter moves."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/tracked-wallets"})]})}),i.jsx("div",{style:{height:"calc(100vh - 5rem)"},className:"flex justify-center items-center w-full h-full px-1 pt-1 sm:px-6 sm:pt-6 bg-[#161616] overflow-hidden",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full xl:w-max flex-grow xl:flex-grow-0",children:window.localStorage.getItem("hyperToken")?i.jsx(Lin,{data:a,loading:d,error:f,trackerData:l,isRequest:e,setIsRequest:t}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(dU,{})})})})]})},Bin=()=>{m.useRef([]);const e=m.useRef(null),{isConnected:t,address:n}=Jr(),{setSignModalOpen:r,trackedWatchList:s,hyperToken:a}=m.useContext(Qr),o=m.useRef(a),[l,c]=m.useState(!1),d=localStorage.getItem("isDateTrackedWalletsFormat")||"date",[f,x]=m.useState(d);m.useEffect(()=>{localStorage.setItem("isDateTrackedWalletsFormat",f)},[f]);const[g,v]=m.useState([]);function w(L){const z={};return L.forEach(ne=>{const{oid:J,px:X,dir:re,side:pe,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:te,sz:ae,closedPnl:he,fee:Ce,time:ce,startPosition:ge,insert_date:Ae,hash:ye}=ne;z[J]||(z[J]={oid:J,px:X,dir:re,side:pe,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:te,totalSize:0,totalStartPositions:0,totalClosedPnl:0,totalFee:0,closestTime:ce,earliestStartPosition:ge,insertDate:Ae,hashes:[],hasZeroStartPosition:!1}),parseFloat(ge)===0&&(z[J].hasZeroStartPosition=!0),z[J].hasZeroStartPosition?z[J].totalStartPositions=0:z[J].totalStartPositions+=parseFloat(ge),z[J].totalSize+=parseFloat(ae),z[J].totalClosedPnl+=parseFloat(he),z[J].totalFee+=parseFloat(Ce),new Date(ce)>new Date(z[J].closestTime)&&(z[J].closestTime=ce),new Date(ce)>new Date(z[J].insertDate)&&(z[J].insertDate=Ae),new Date(ce)<new Date(z[J].closestTime)&&(z[J].earliestStartPosition=ge),z[J].hashes.push(ye)}),Object.keys(z).map(ne=>({oid:ne,...z[ne]}))}async function C(){const L=window.localStorage.getItem("hyperToken");try{c(!0);const z="https://dextrabothypev2.nftinit.io/api/hyper/feed/",Q=window.localStorage.getItem("hyperAddress");L||r(!0);const ne=await fetch(z,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Q,token:L,offset:0})});if(!ne.ok)throw new Error(`Server responded with status ${ne.status}`);const J=await ne.json();if(J.success){const X=w(J==null?void 0:J.data);v(X)}else console.log(J.error_message)}catch(z){console.log("Error :>> ",z),c(!1)}finally{c(!1)}}m.useEffect(()=>{C()},[window.localStorage.getItem("hyperToken")]);function N(L,z){const Q={};return L.forEach(ne=>{Q[ne.oid]={...ne}}),z.forEach(ne=>{const{oid:J,px:X,dir:re,side:pe,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:te,sz:ae,closedPnl:he,fee:Ce,time:ce,startPosition:ge,insert_date:Ae,hash:ye}=ne;Q[J]||(Q[J]={oid:J,px:X,dir:re,side:pe,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:te,totalSize:0,totalStartPositions:0,totalClosedPnl:0,totalFee:0,closestTime:ce,earliestStartPosition:ge,insertDate:Ae,hashes:[],hasZeroStartPosition:!1}),parseFloat(ge)===0&&(Q[J].hasZeroStartPosition=!0),Q[J].hasZeroStartPosition?Q[J].totalStartPositions=0:Q[J].totalStartPositions+=parseFloat(ge),Q[J].totalSize+=parseFloat(ae),Q[J].totalClosedPnl+=parseFloat(he),Q[J].totalFee+=parseFloat(Ce),new Date(ce)>new Date(Q[J].closestTime)&&(Q[J].closestTime=ce),new Date(ce)>new Date(Q[J].insertDate)&&(Q[J].insertDate=Ae),new Date(ce)<new Date(Q[J].closestTime)&&(Q[J].earliestStartPosition=ge),Q[J].hashes.push(ye)}),Object.values(Q).sort((ne,J)=>new Date(J.closestTime)-new Date(ne.closestTime))}const I=m.useRef(!1),P=m.useRef(n),R=m.useRef(s);m.useEffect(()=>{P.current=n},[n]),m.useEffect(()=>{o.current=a},[a]),m.useEffect(()=>{R.current=s},[s]);const F="hyper_get_message";m.useEffect(()=>{if(!a||I.current)return;const L=Ny("https://dextrabothypesocketv2.nftinit.io/");return e.current=L,I.current=!0,e.current.on("connect",()=>{console.log("Socket connected");const z=()=>{var J;const Q=(J=P.current)==null?void 0:J.toLowerCase(),ne=o.current;Q&&ne?L.emit("subscribe",{login:Q,token:ne}):setTimeout(z,300)};z()}),e.current.on(F,function(z){if(z){const Q=Array.isArray(z)?z:[z];v(ne=>{const J=N([],Q);let X=ne.filter(Y=>Q.some(ie=>ie.oid===Y.oid)),re=[];X.length>0?re=N(J,X):re=J;const pe=ne.filter(Y=>!Q.some(ie=>ie.oid===Y.oid));return[...re,...pe]})}}),e.current.io.on("reconnect_attempt",z=>{console.log("reconnect_attempt",z)}),e.current.io.on("reconnect",z=>{console.log("reconnect",z),e.current.emit("room",F)}),e.current.io.on("reconnect_failed",()=>{console.log("reconnect_failed")}),e.current.io.on("reconnect_error",z=>{console.log("reconnect_error",z)}),e.current.io.on("error",z=>{console.log("error",z)}),e.current.on("disconnect",()=>{console.log("Socket disconnected"),I.current=!1}),()=>{e.current.disconnect(),console.log("Socket cleanup on unmount")}},[a]);function U({date:L}){const[z,Q]=m.useState(Oo(L));return m.useEffect(()=>{const ne=setInterval(()=>{Q(Oo(L))},1e3);return()=>clearInterval(ne)},[L]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:z.dateTime})}return i.jsx("div",{className:"flex flex-col items-start justify-start mt-4 overflow-scroll max-h-full",children:!g||g.length==0?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] min-w-[880px] max-w-[700px] justify-center items-center text-center mt-44",children:l?i.jsx(Da,{}):i.jsx("div",{className:"flex justify-center items-center min-w-[480px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 min-w-max overflow-x-hidden",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"The activities of the favorited wallets will be displayed on this page."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Feed page includes the activities occur after a wallet is favorited."," "]})})]})]})})})}):i.jsx("ul",{className:"flex flex-col items-start justify-start gap-1",children:Array.isArray(g)&&g.slice(0,250).map(L=>{var z,Q,ne,J,X,re,pe;return i.jsx("li",{children:i.jsxs("div",{className:"flex justify-start items-start gap-[11px]",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start h-full",children:[i.jsx("div",{className:`${(z=L==null?void 0:L.dir)!=null&&z.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?"bg-[#67ffbd]/20":(L==null?void 0:L.dir)==="Long > Short"?"bg-[#ff797c]/20":"bg-[#67ffbd]/20":(L==null?void 0:L.dir)=="Buy"?"bg-[#67ffbd]/20":"bg-[#ff797c]/20"} flex justify-center items-center w-6 h-6 rounded-full`,children:i.jsx("div",{className:"w-3 h-3 relative",children:(Q=L==null?void 0:L.dir)!=null&&Q.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)==="Long > Short"?i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)=="Buy"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:"flex justify-center w-6",children:i.jsx("div",{className:"w-[1px] min-h-[123px] h-full border border-[#242424]"})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[6px] min-w-[640px] w-full h-[138px] min-h-[138px] rounded-[18px] border border-[#232323] p-2",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full px-1",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full",children:i.jsx("img",{src:qi,alt:"",className:"w-8 h-8"})}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] ",children:[i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${L==null?void 0:L.listen_user}`,"_blank")},className:"flex justify-start items-center gap-1.5 cursor-pointer",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-none",children:(L==null?void 0:L.listen_user)&&((ne=L==null?void 0:L.listen_user)==null?void 0:ne.slice(0,5))+"..."+((J=L==null?void 0:L.listen_user)==null?void 0:J.slice(-4))}),i.jsx("img",{onClick:Y=>{Y.stopPropagation(),navigator.clipboard.writeText(L==null?void 0:L.listen_user),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:[i.jsxs("span",{className:"text-white text-[11px] font-normal font-['Manrope'] leading-[13px] tracking-tight min-w-max ml-[1px]",children:["Order ID:"," ",i.jsx("span",{className:"text-[#a5a5a5]",children:(L==null?void 0:L.oid)&&(L==null?void 0:L.oid)})]}),i.jsx("span",{onClick:Y=>{Y.stopPropagation(),navigator.clipboard.writeText(L==null?void 0:L.oid),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"cursor-pointer pr-0.5",children:i.jsx("img",{src:wo,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})]})]})]}),i.jsxs("div",{className:"flex flex-col items-end justify-start gap-[2px] w-full pl-2 pt-2",children:[i.jsx("div",{onClick:()=>{x(f=="time"?"date":"time")},className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight cursor-pointer",children:f=="time"?i.jsx(U,{date:L==null?void 0:L.closestTime}):su(L==null?void 0:L.closestTime)}),i.jsxs("div",{className:"flex justify-start items-center gap-2 -m-[2px]",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"text-[#9b9b9b] text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:["opened a new"," ",(L==null?void 0:L.dir)=="Sell"?"spot sell":(L==null?void 0:L.dir)=="Buy"?"spot buy":(X=L==null?void 0:L.dir)==null?void 0:X.toLowerCase()," ","position for"," "]}),i.jsxs("span",{className:"pl-1 text-white text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:[L==null?void 0:L.coin,"/",L==null?void 0:L.feeToken]})]}),i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${L==null?void 0:L.coin}.svg`||Va,alt:L==null?void 0:L.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Y=>ra(Y)})})]})]})]}),i.jsx("div",{className:"w-full min-w-[850px] h-[72px] min-h-[72px] bg-[#232323] rounded-xl border border-[#353535] pt-4 pl-4",children:i.jsxs("div",{className:"flex justify-start items-center gap-4 overflow-x-scroll scroll-smooth",children:[i.jsxs("div",{className:"sticky left-0 z-[8] bg-[#232323] flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Asset"}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${L==null?void 0:L.coin}.svg`||Va,alt:L==null?void 0:L.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Y=>ra(Y)})}),i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[L==null?void 0:L.coin,"/",L==null?void 0:L.feeToken]})]})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Direction"}),i.jsx("div",{className:"flex justify-start items-center",children:i.jsxs("div",{className:`${(re=L==null?void 0:L.dir)!=null&&re.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":(L==null?void 0:L.dir)==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":(L==null?void 0:L.dir)=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex min-w-max`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:(pe=L==null?void 0:L.dir)!=null&&pe.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)==="Long > Short"?i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)=="Buy"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:(L==null?void 0:L.dir)=="Sell"?"Sell":(L==null?void 0:L.dir)=="Buy"?"Buy":(L==null?void 0:L.dir)=="Close Short"?"Short":(L==null?void 0:L.dir)=="Close Long"?"Long":(L==null?void 0:L.dir)=="Open Short"?"Short":(L==null?void 0:L.dir)=="Open Long"?"Long":L==null?void 0:L.dir})]})})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(lC,{title:"Type",value:(L==null?void 0:L.totalStartPositions)==0?"Open Position":(L==null?void 0:L.dir)!="Short > Long"&&(L==null?void 0:L.dir)!="Long > Short"?(L==null?void 0:L.totalSize)-Math.abs(L==null?void 0:L.totalStartPositions)==0&&((L==null?void 0:L.dir)=="Close Long"||(L==null?void 0:L.dir)=="Close Short")?"Position Closed":(L==null?void 0:L.dir)=="Open Short"||(L==null?void 0:L.dir)=="Open Long"?"Increase":(L==null?void 0:L.dir)=="Close Long"||(L==null?void 0:L.dir)=="Close Short"?"Decrease":(L==null?void 0:L.dir)=="Sell"||(L==null?void 0:L.dir)=="Buy"?"Spot":"Changed Position":(L==null?void 0:L.dir)=="Short > Long"||(L==null?void 0:L.dir)=="Long > Short"?"Changed Position":"Open Position",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(lC,{title:"Price",value:Cr(L==null?void 0:L.px),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(lC,{title:"Size",value:Cr(L==null?void 0:L.totalSize),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(lC,{title:"PnL",value:L!=null&&L.totalClosedPnl?`$${Cr(Math.abs(L==null?void 0:L.totalClosedPnl))}`:Cr(Math.abs(L==null?void 0:L.totalClosedPnl)),color:`${(L==null?void 0:L.totalClosedPnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"}`}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(lC,{title:"Fee",value:L!=null&&L.totalFee?`$${Cr(Math.abs(L==null?void 0:L.totalFee))}`:Cr(Math.abs(L==null?void 0:L.totalFee)),color:`${(L==null?void 0:L.totalFee)>=0?"text-[#67ffbd]":"text-[#ff787b]"}`}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(lC,{title:"Margin Mode",value:L!=null&&L.crossed?"Cross":"Isolated",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-transparent"})]})]})})]})]})},L.oid)})})})},lC=({title:e,value:t,color:n})=>i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1 min-w-max",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide min-w-max",children:e}),i.jsx("div",{className:"flex justify-start items-center min-w-max",children:i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-[13px] tracking-tight min-w-max`,children:t})})]}),$in="https://dextrabothypesocketv2.nftinit.io/";function Uin(){var Q,ne;const{isConnected:e,address:t}=Jr(),{setSignModalOpen:n,trackedWatchList:r,hyperToken:s}=m.useContext(Qr),a=m.useRef(null),[o,l]=m.useState([]),[c,u]=m.useState(!1),f=localStorage.getItem("isDateTrackedWalletsFormat")||"date",[x,g]=m.useState(f),[v,w]=m.useState(null);function C({date:J}){const[X,re]=m.useState(Oo(J));return m.useEffect(()=>{const pe=setInterval(()=>re(Oo(J)),1e3);return()=>clearInterval(pe)},[J]),i.jsx("span",{className:"text-[11px] text-[#a5a5a5] font-normal",children:X.dateTime})}m.useEffect(()=>{localStorage.setItem("isDateTrackedWalletsFormat",x)},[x]);function N(J){const X={};return J.forEach(re=>{const{oid:pe,px:Y,dir:ie,side:oe,crossed:G,feeToken:V,listen_user:te,cloid:ae,coin:he,subs_address:Ce,sz:ce,closedPnl:ge,fee:Ae,time:ye,startPosition:je,insert_date:Ie,hash:Re}=re;X[pe]||(X[pe]={oid:pe,px:Y,dir:ie,side:oe,crossed:G,feeToken:V,listen_user:te,cloid:ae,coin:he,subs_address:Ce,totalSize:0,totalClosedPnl:0,totalFee:0,earliestStartPosition:je,hasZeroStartPosition:!1,closestTime:ye,insertDate:Ie,hashes:[]}),parseFloat(je)===0&&(X[pe].hasZeroStartPosition=!0),X[pe].totalSize+=parseFloat(ce),X[pe].totalClosedPnl+=parseFloat(ge),X[pe].totalFee+=parseFloat(Ae),new Date(ye)>new Date(X[pe].closestTime)&&(X[pe].closestTime=ye),new Date(ye)>new Date(X[pe].insertDate)&&(X[pe].insertDate=Ie),X[pe].hashes.push(Re)}),Object.keys(X).map(re=>({oid:re,...X[re]}))}async function I(){const J=window.localStorage.getItem("hyperToken");try{u(!0),J||n(!0);const X=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/feed/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t.toLowerCase(),token:J,offset:0})});if(!X.ok)throw new Error(`Server responded with status ${X.status}`);const re=await X.json();if(re.success){const pe=N(re==null?void 0:re.data);l(pe)}}catch(X){console.log("Error :>> ",X)}finally{u(!1)}}function P(J,X){const re={};return J.forEach(pe=>{re[pe.oid]={...pe}}),X.forEach(pe=>{const{oid:Y,px:ie,dir:oe,side:G,crossed:V,feeToken:te,listen_user:ae,cloid:he,coin:Ce,subs_address:ce,sz:ge,closedPnl:Ae,fee:ye,time:je,startPosition:Ie,insert_date:Re,hash:Qe}=pe;re[Y]||(re[Y]={oid:Y,px:ie,dir:oe,side:G,crossed:V,feeToken:te,listen_user:ae,cloid:he,coin:Ce,subs_address:ce,totalSize:0,totalClosedPnl:0,totalFee:0,hasZeroStartPosition:!1,earliestStartPosition:Ie,closestTime:je,insertDate:Re,hashes:[]}),parseFloat(Ie)===0&&(re[Y].hasZeroStartPosition=!0),re[Y].totalSize+=parseFloat(ge),re[Y].totalClosedPnl+=parseFloat(Ae),re[Y].totalFee+=parseFloat(ye),new Date(je)>new Date(re[Y].closestTime)&&(re[Y].closestTime=je),new Date(je)>new Date(re[Y].insertDate)&&(re[Y].insertDate=Re),re[Y].hashes.push(Qe)}),Object.values(re).sort((pe,Y)=>new Date(Y.closestTime)-new Date(pe.closestTime))}m.useEffect(()=>{I()},[window.localStorage.getItem("hyperToken")]),m.useEffect(()=>{a.current=Ny($in);const J=window.localStorage.getItem("hyperToken");return a.current.on("connect",()=>{r==null||r.map(X=>X.wallet_address),a.current.emit("subscribe",{login:t.toLowerCase(),token:J})}),a.current.on("hyper_get_message",X=>{if(X){const re=Array.isArray(X)?X:[X];l(pe=>{const Y=P([],re);let ie=pe.filter(V=>re.some(te=>te.oid===V.oid)),oe=[];ie.length>0?oe=P(Y,ie):oe=Y;const G=pe.filter(V=>!re.some(te=>te.oid===V.oid));return[...oe,...G]})}}),()=>{a.current.disconnect()}},[s]);const R=J=>J?J.includes("Long")?J==="Short > Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":J==="Long > Short"?"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#67ffbd]/20 text-[#67ffbd]":J==="Buy"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#767676]/20 text-[#cccccc]",F=J=>J?J.includes("Long")?J==="Short > Long"?i.jsx(Ts,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):J==="Long > Short"?i.jsx(Ts,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):J==="Buy"?i.jsx(Ts,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Ts,{className:"text-[#767676] w-3 h-3"}),U=J=>{const X=J==null?void 0:J.hasZeroStartPosition,re=J.dir==="Close Short"||J.dir==="Close Long"||J.dir==="Short > Long"||J.dir==="Long > Short";return X||re?{text:"Closed",icon:hM}:{text:"Open",icon:pM}},L=J=>w(J),z=()=>w(null);return i.jsxs("div",{className:"flex flex-col w-full pb-2",children:[!o||o.length===0?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-full sm:w-[75%] max-w-[700px] justify-center items-center text-center mt-44",children:c?i.jsx(Da,{}):i.jsx("div",{className:"flex justify-center items-center min-w-[320px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 min-w-max overflow-x-hidden",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"The activities of the favorited wallets will be displayed on this page."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Feed page includes the activities occur after a wallet is favorited."})})]})]})})})}):i.jsx("div",{className:"flex flex-col gap-3 w-full mt-3",children:o.slice(0,250).map(J=>(U(J),i.jsxs("div",{className:"border-2 border-[#232323] rounded-xl p-3 flex items-start gap-3 cursor-pointer",onClick:()=>L(J),children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center",children:i.jsx("img",{src:qi,alt:"",className:"w-6 h-6"})}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-white text-sm font-semibold",children:[J!=null&&J.listen_user?J.listen_user.slice(0,5)+"..."+J.listen_user.slice(-4):"-",i.jsx("img",{src:wo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:X=>{X.stopPropagation(),navigator.clipboard.writeText((J==null?void 0:J.listen_user)||""),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})}})]}),i.jsxs("div",{className:"flex flex-col text-xs text-[#a5a5a5]",children:[i.jsx("span",{children:su(J==null?void 0:J.closestTime)}),i.jsx(C,{date:J==null?void 0:J.closestTime})]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",J!=null&&J.totalSize?Cr(J==null?void 0:J.totalSize):"-"]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Price:"})," ",J!=null&&J.px?"$"+Cr(J==null?void 0:J.px):"-"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${J==null?void 0:J.coin}.svg`||Va,alt:J==null?void 0:J.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:X=>ra(X)})}),i.jsxs("div",{className:"text-[13px] text-white font-bold font-manrope leading-[13px] tracking-tight",children:[J==null?void 0:J.coin,"/",J==null?void 0:J.feeToken]})]}),i.jsxs("div",{className:`${R(J==null?void 0:J.dir)} h-5 pl-2 pr-2 py-1 rounded-md flex items-center gap-1 w-max mt-1`,children:[i.jsx("div",{className:"w-3 h-3",children:F(J==null?void 0:J.dir)}),i.jsx("div",{className:"text-[11px] font-semibold",children:(J==null?void 0:J.dir)||"-"})]})]})]})]},J.oid)))}),v&&i.jsx(up,{isOpen:!!v,onClose:()=>z(),children:i.jsxs("div",{className:"flex flex-col gap-4 p-2",children:[i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center",children:i.jsx("img",{src:qi,alt:"",className:"w-6 h-6"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx("div",{className:"text-white text-sm font-semibold",children:v!=null&&v.listen_user?v.listen_user.slice(0,5)+"..."+v.listen_user.slice(-4):"-"}),i.jsx("img",{src:wo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:J=>{J.stopPropagation(),navigator.clipboard.writeText((v==null?void 0:v.listen_user)||"")}})]}),i.jsx("div",{className:"flex flex-col text-[11px] text-[#a5a5a5]",children:x==="time"?i.jsx(C,{date:v==null?void 0:v.closestTime}):su(v==null?void 0:v.closestTime)})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 text-sm text-[#9b9b9b]",children:[i.jsxs("div",{className:"text-white flex items-center gap-2",children:[i.jsx("img",{src:U(v).icon,alt:"",className:"w-4 h-4"}),"Status: ",U(v).text]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Order ID:"})," ",(v==null?void 0:v.oid)||"-"]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-white",children:"Direction:"}),i.jsxs("div",{className:`${R(v==null?void 0:v.dir)} h-5 pl-2 pr-2 py-1 rounded-md flex items-center gap-1`,children:[i.jsx("div",{className:"w-3 h-3",children:F(v==null?void 0:v.dir)}),i.jsx("div",{className:"text-[11px] font-semibold",children:(v==null?void 0:v.dir)||"-"})]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Price:"})," ",v!=null&&v.px?"$"+Cr(v==null?void 0:v.px):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",v!=null&&v.totalSize?Cr(v==null?void 0:v.totalSize):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"PnL:"})," ",v!=null&&v.totalClosedPnl?"$"+Cr(Math.abs(v==null?void 0:v.totalClosedPnl)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Fee:"})," ",v!=null&&v.totalFee?"$"+Cr(Math.abs(v==null?void 0:v.totalFee)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Margin Mode:"})," ",v!=null&&v.crossed?"Cross":"Isolated"]}),i.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${v==null?void 0:v.coin}.svg`||Va,onError:J=>ra(J),alt:"",className:"w-5 h-5"}),i.jsxs("span",{className:"font-bold text-white",children:[v==null?void 0:v.coin,"/",(v==null?void 0:v.feeToken)||"USDC"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Fills:"})," ",(Q=v==null?void 0:v.hashes)!=null&&Q.length?((ne=v==null?void 0:v.hashes)==null?void 0:ne.length)+" fill(s)":"0"]})]})]})})]})}const zin=({open:e,setOpen:t,handleTelegramClick:n})=>(m.useContext(Qr),Jr(),b5(),i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-8",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"text-center text-white text-[32px] font-manrope leading-none",children:"Welcome Dextrabot"}),i.jsx("div",{className:"text-center text-white/60 text-sm font-manrope leading-none",children:"You can connect to Telegram here."})]}),i.jsx("div",{onClick:()=>{n(),t(!1)},className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("div",{className:"text-center font-semibold text-white text-sm font-manrope leading-3",children:"Join Telegram"})})]})})})})})]})),Hin=({open:e,setOpen:t,setIsfilterModal:n,handleTelegramClick:r})=>{const[s,a]=m.useState(!1),o=()=>{a(!1),n(!1),t(!1)};return i.jsxs(Ea,{open:e,onClose:o,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[310px] sm:w-[400px] h-max relative bg-white rounded-3xl pt-4 pb-8",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:l=>{l.preventDefault(),s?(t(!1),n(!1),a(!1)):t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:`${s?"bg-[#1DE674] hover:bg-[#16c765]":"bg-[#e3e3e3] hover:bg-[#d4d4d4]"} absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center `,children:i.jsx(SLe,{className:"w-4 h-4 text-black"})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:_yt,alt:"",className:""})}),i.jsx("div",{className:"flex flex-col justify-start items-center gap-2 -mt-5",children:i.jsx("div",{className:"text-[#232323] text-[21px] font-semibold font-['Manrope']",children:"Telegram Setup"})}),i.jsx("div",{onClick:l=>{l.preventDefault(),s||r(),setTimeout(()=>{a(!0)},500)},className:`${s?"bg-[#1DE674] cursor-text":"bg-[#e3e3e3] hover:bg-[#d4d4d4] cursor-pointer"} w-60 h-8 px-6 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 mb-2 select-none`,children:i.jsx("div",{className:"justify-start text-[#0a321c] text-[13px] font-semibold font-['Inter'] leading-[8px] min-w-max",children:s?"Successful":"Join Telegram"})})]})})})})})]})},Vin=({open:e,setOpen:t,handleTelegramClick:n})=>{const{setSignModalOpen:r}=m.useContext(Qr),{address:s}=Jr(),[a,o]=m.useState([]),[l,c]=m.useState([]),[u,d]=m.useState(null),[f,x]=m.useState(!1),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(""),[P,R]=m.useState(!1),[F]=m.useState(["Open Position","Increase","Decrease","Changed Position","Position Closed","Twaps"]),[U,L]=m.useState([]),[z,Q]=m.useState(!1),ne=async()=>{var Ae;const ce=window.localStorage.getItem("hyperToken"),ge=window.localStorage.getItem("hyperAddress");if(!ce){r(!0);return}try{x(!0);const je=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:s?s==null?void 0:s.toLowerCase():ge,token:ce})})).json();if(je.success){const Ie=(je==null?void 0:je.data)||[],Re=u?((Ae=u==null?void 0:u.message_filters)==null?void 0:Ae.source)||[]:[],Qe=[...Ie].sort(($e,it)=>{const tt=Re==null?void 0:Re.includes($e.wallet_address),ot=Re==null?void 0:Re.includes(it.wallet_address);return Number(ot)-Number(tt)});o(Qe),await J(Qe)}else I((je==null?void 0:je.error_message)||"Failed to fetch source wallets"),console.error("API Error:",je==null?void 0:je.error_message)}catch(ye){console.error("Fetch Error:",ye),I("Failed to fetch source wallets")}finally{setTimeout(()=>{x(!1)},200)}},J=async ce=>{var ye;const ge=window.localStorage.getItem("hyperToken"),Ae=window.localStorage.getItem("hyperAddress");if(!ge){r(!0);return}try{v(!0);const Ie=await(await fetch("https://dextrabothypev2.nftinit.io/api/subscriber/get_telegram_filter/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:s?s==null?void 0:s.toLowerCase():Ae,token:ge})})).json();if(Ie.success){const Re=Ie==null?void 0:Ie.filters;if(d(Re),Re===null){const Qe=ce==null?void 0:ce.map($e=>`${$e.wallet_address}::${$e.tag}`);c(Qe),L([...F])}else{const Qe=((ye=Re==null?void 0:Re.message_filters)==null?void 0:ye.source)||[],$e=[...ce].sort((it,tt)=>{const ot=Qe==null?void 0:Qe.includes(it.wallet_address),ft=Qe==null?void 0:Qe.includes(tt.wallet_address);return Number(ft)-Number(ot)});o($e)}}else I((Ie==null?void 0:Ie.error_message)||"Failed to fetch filter info"),console.error("API telegram filter info error:",Ie==null?void 0:Ie.error_message)}catch(je){console.error("Fetch Error:",je),I("Failed to fetch filter info")}finally{v(!1)}},X=async()=>{const ce=window.localStorage.getItem("hyperToken"),ge=window.localStorage.getItem("hyperAddress");if(!ce){r(!0);return}const Ae=[...new Set(l==null?void 0:l.map(Re=>Re.split("::")[0]))];let ye={};Ae.length>0&&(ye.source=Ae);const je=U.filter(Re=>!Re.includes("Spot"));je.length>0&&(ye.type=je),Ae.length===0&&U.length===0&&(ye={});const Ie={address:s?s==null?void 0:s.toLowerCase():ge,token:ce,filters:ye};try{C(!0);const Re=await fetch("https://dextrabothypev2.nftinit.io/api/subscriber/telegram_filter_save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Ie)}),Qe=await Re.json();Re.ok&&Qe.success?(d(Qe.filters),he(Qe.filters),R(!0),ln.success("Filter saved successfully",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"40px",width:"340px",minWidth:"340px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(I((Qe==null?void 0:Qe.error_message)||"Failed to save filter"),console.error("API telegram filter save error:",Qe==null?void 0:Qe.error_message))}catch(Re){console.error("Fetch Error:",Re),I("Failed to save filter")}finally{C(!1)}};m.useEffect(()=>{a.length>0&&u&&he(u)},[a,u]),m.useEffect(()=>{e&&ne()},[e]);const re=ce=>{const{value:ge,checked:Ae}=ce.target;if(ge==="all"){const ye=a.map(je=>`${je.wallet_address}::${je.tag}`);c(Ae?ye:[])}else c(ye=>Ae?[...ye,ge]:ye.filter(je=>je!==ge))},pe=a==null?void 0:a.map(ce=>`${ce.wallet_address}::${ce.tag}`),Y=a.length>0&&(pe==null?void 0:pe.every(ce=>l==null?void 0:l.includes(ce))),ie=ce=>{const{value:ge,checked:Ae}=ce.target;if(ge==="all")if(Ae){const ye=F==null?void 0:F.filter(je=>!(je!=null&&je.includes("Spot")));L(ye)}else L([]);else L(ye=>Ae?[...ye,ge]:ye.filter(je=>je!==ge))},G=(F==null?void 0:F.filter(ce=>!ce.includes("Spot"))).length,te=U.filter(ce=>!ce.includes("Spot")).length,ae=te===G&&G>0,he=ce=>{const ge=ce==null?void 0:ce.message_filters;if(ge&&(Array.isArray(ge.type)&&L(ge.type.filter(Ae=>!Ae.includes("Spot"))),Array.isArray(ge.source))){const Ae=a.filter(ye=>{var je;return(je=ge.source)==null?void 0:je.includes(ye.wallet_address)}).map(ye=>`${ye.wallet_address}::${ye.tag}`);c(Ae)}},Ce=()=>{t(!1),Q(!1),o([]),L([]),c([])};return i.jsxs(i.Fragment,{children:[i.jsx(Hin,{open:P,setOpen:R,handleTelegramClick:n,setIsfilterModal:t}),i.jsxs(Ea,{open:e,onClose:Ce,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#242424] text-left shadow-xl transition-all rounded-3xl",children:i.jsxs("div",{style:{boxShadow:"0px 4px 24px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"},className:"flex flex-col items-center gap-6 w-[300px] sm:w-[411px] bg-[#242424] rounded-3xl pt-[33px] pb-8",children:[i.jsx("div",{onClick:()=>Ce(),className:`${l.length===0&&U.length===0?"hover:bg-[rgba(103,255,189,0.16)]":"hover:bg-[#787070]"} cursor-pointer absolute top-2 right-2 sm:top-8 sm:right-6 w-9 h-9 rounded-full flex justify-center items-center `,children:i.jsx("img",{className:"p-1",src:Ba,alt:"close"})}),i.jsx("div",{className:"flex justify-start items-center gap-3 w-full px-6 sm:px-10",children:i.jsx("div",{className:"text-white text-[21px] font-semibold font-['Manrope']",children:"Telegram Notifications"})}),i.jsxs("div",{className:"w-full pl-6 sm:pl-8 pr-2",children:[i.jsx("div",{className:"flex justify-between items-center mb-2 pr-6 max-w-[244px] sm:max-w-full",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 pl-2",children:[i.jsx("span",{className:"text-white text-xs sm:text-sm font-manrope font-semibold leading-[8px]",children:"Source Wallet"}),i.jsx("span",{className:"text-[10px] sm:text-sm text-white font-semibold",children:(l==null?void 0:l.length)>0?`(${l==null?void 0:l.length} of ${a==null?void 0:a.length} selected)`:""})]})}),i.jsx("div",{className:"relative max-w-[244px] sm:max-w-full",children:i.jsx("div",{className:"w-full bg-transparent rounded-md mt-[2px] transition-all duration-200",children:i.jsx("div",{className:"max-h-[186px] overflow-y-auto scrollbar-custom-scrollbar-dark pr-0 sm:pr-[17px]",children:f?i.jsx("div",{className:"flex w-full h-full justify-center items-center min-h-[160px]",children:i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 w-[32px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-10 h-10 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]})}):i.jsxs(i.Fragment,{children:[(a==null?void 0:a.length)>0?i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"flex sticky top-0 z-10 bg-[#242424] justify-between items-center gap-2 cursor-pointer text-white font-semibold pt-1 pb-2 px-2 text-[13px] font-manrope leading-[8px]",children:[i.jsx("span",{className:`${Y?"text-white":"text-[#7C7C7C]"}`,children:"All"}),i.jsx("input",{type:"checkbox",value:"all",checked:Y,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${Y?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${Y?"translate-x-[14px]":"translate-x-0"}`})})]}),i.jsx("div",{className:"h-[1px] w-full bg-[#353535]"})]}):i.jsx("div",{className:"py-2 text-center text-[#7c7c7c] text-sm font-semibold",children:"No source wallet"}),a==null?void 0:a.map((ce,ge)=>{var je,Ie,Re,Qe,$e;const Ae=`${ce==null?void 0:ce.wallet_address}::${ce==null?void 0:ce.tag}`,ye=l==null?void 0:l.includes(Ae);return i.jsxs("label",{className:"flex justify-between items-center gap-2 h-8 px-2 cursor-pointer text-white text-sm font-semibold rounded-md bg-[#353535] my-1 hover:bg-[#464646]",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("div",{className:`${ye?"text-white":"text-[#7C7C7C]"} text-[13px] font-semibold min-w-[88px]`,children:((je=ce.wallet_address)==null?void 0:je.slice(0,5))+"..."+((Ie=ce.wallet_address)==null?void 0:Ie.slice(-4))}),i.jsx("span",{className:`${ye?"text-white":"text-[#7C7C7C]"} sm:hidden h-[18px] bg-[#424242] rounded-[256px] px-1.5 text-[13px] font-medium font-['Manrope'] leading-[8px] tracking-tight flex justify-center items-center`,children:((Re=ce.tag)==null?void 0:Re.length)>10?`${(Qe=ce==null?void 0:ce.tag)==null?void 0:Qe.slice(0,10)}...`:`${ce==null?void 0:ce.tag}`}),i.jsx("span",{className:`${ye?"text-white":"text-[#7C7C7C]"} hidden sm:flex h-[18px] bg-[#424242] rounded-[256px] px-1.5 text-[13px] font-medium font-['Manrope'] leading-[8px] tracking-tight justify-center items-center`,children:(($e=ce.tag)==null?void 0:$e.length)>24?`${ce==null?void 0:ce.tag.slice(0,24)}...`:`${ce==null?void 0:ce.tag}`})]}),i.jsx("input",{type:"checkbox",value:`${ce==null?void 0:ce.wallet_address}::${ce==null?void 0:ce.tag}`,checked:ye,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${ye?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${ye?"translate-x-[14px]":"translate-x-0"}`})})]},ge)})]})})})})]}),i.jsxs("div",{className:`${(a==null?void 0:a.length)>4?"pr-[36px] sm:pr-[30px]":"pr-6"} w-full pl-6 sm:pl-8`,children:[i.jsx("div",{className:"flex justify-between items-center mb-2 mt-4 max-w-[244px] sm:max-w-full",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 pl-2",children:[i.jsx("span",{className:"text-white text-xs sm:text-sm font-manrope font-semibold leading-[8px]",children:"Source Wallet Type"}),i.jsx("span",{className:"text-[10px] sm:text-sm text-white font-semibold",children:te>0?`(${te} of ${G} selected)`:""})]})}),i.jsx("div",{className:"relative max-w-[244px] sm:max-w-full",children:i.jsx("div",{className:"w-full rounded-md mt-[2px] transition-all duration-200",children:i.jsxs("div",{className:"max-h-[296px] overflow-y-auto scrollbar-custom-scrollbar-dark",children:[i.jsxs("label",{className:"flex sticky top-0 z-10 justify-between items-center gap-2 cursor-pointer text-white font-semibold py-1 px-2 text-[13px] font-manrope leading-[8px]",children:[i.jsx("span",{className:`${ae?"text-white":"text-[#7C7C7C]"}`,children:"All"}),i.jsx("input",{type:"checkbox",value:"all",checked:ae,onChange:ie,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${ae?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${ae?"translate-x-[14px]":"translate-x-0"}`})})]}),i.jsx("div",{className:"h-[1px] w-full bg-[#353535] my-1"}),F==null?void 0:F.map((ce,ge)=>{const Ae=U==null?void 0:U.includes(ce);return i.jsxs("label",{className:"flex justify-between items-center gap-2 h-8 hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold rounded-md px-2 leading-[8px] bg-[#353535] my-1",children:[i.jsx("span",{className:`${Ae?"text-white":"text-[#7C7C7C]"}`,children:ce}),i.jsx("input",{type:"checkbox",value:ce,checked:Ae,onChange:ie,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${Ae?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${Ae?"translate-x-[14px]":"translate-x-0"}`})})]},ge)})]})})})]}),i.jsx("div",{onClick:ce=>{if(ce.preventDefault(),!f&&!g&&!w)if((l==null?void 0:l.length)===0||(U==null?void 0:U.length)===0){ln.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Select at least one wallet or type."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"350px",minWidth:"350px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}else X()},className:`${!f&&!g&&!w&&(l==null?void 0:l.length)>0&&(U==null?void 0:U.length)>0?"cursor-pointer bg-[rgba(103,255,189,0.16)] text-[#67FFBD] hover:bg-[rgba(103,255,189,0.26)]":"cursor-pointer bg-[#787070] text-[#A6A6A6] border border-[#787070]"} w-full max-w-[230px] sm:max-w-[341px] mr-2 sm:mr-0 sm:ml-2 h-8 px-6 py-3 rounded-[10px] flex justify-center items-center gap-2.5`,children:i.jsx("div",{className:"pointer-events-none text-[13px] font-semibold font-['Inter'] leading-[8px]",children:f||g||w?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[32px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):"Next"})}),N&&i.jsx("p",{className:"mt-2 text-sm text-red-500",children:N})]})})})})]})]})},Win=({isMenu:e})=>{const[t,n]=m.useState(!1),[r,s]=m.useState(!1),{setSignModalOpen:a,setTelegramChatId:o,setSubscriberRole:l,setIsReferralCode:c,setIsReferralCodeName:u,setMushboomerETH:d,setIsWhitelist:f,setMushboomerSOL:x,telegramChatId:g}=m.useContext(Qr);Jr();const v=async()=>{var C,N;let w="";try{const I=window.localStorage.getItem("hyperToken"),P=window.localStorage.getItem("hyperAddress");if(!I){a(!0);return}if(P&&I){const R=await ji(P,I);if(!R.success){console.error("Account check failed:",R.message);return}if(o(R==null?void 0:R.telegram_chat_id),l(R==null?void 0:R.subscriber_role),d((C=R==null?void 0:R.mushboomer_counts)==null?void 0:C.eth),x((N=R==null?void 0:R.mushboomer_counts)==null?void 0:N.sol),c(R==null?void 0:R.referral_code),u(R==null?void 0:R.refcode),f(R==null?void 0:R.whitelist),R.telegram_chat_id==null||R.telegram_chat_id==""||R.telegram_chat_id=="0"){const F=await Ibt(P,I);if(!F.success){console.error("Telegram-ID kunne ikke hentes:",R.message),ln.error(F.message);return}F.success&&(w=e=="My Activities"?`https://t.me/DextraCopyTraderBot?start=${F.telegram_temp_password}`:`https://t.me/DextraTraderBot?start=${F.telegram_temp_password}`)}else w=e=="My Activities"?"https://t.me/DextraCopyTraderBot":"https://t.me/DextraTraderBot"}w?window.open(w,"_blank"):(console.error("Failed to generate Telegram URL"),ln.error("Failed to generate Telegram URL"))}catch(I){console.error("Error during Telegram handling:",I),ln.error(I.message)}};return i.jsxs(i.Fragment,{children:[i.jsx(zin,{open:t,setOpen:n,handleTelegramClick:v}),i.jsx(Vin,{open:r,setOpen:s,handleTelegramClick:v}),i.jsx("div",{className:"flex justify-center items-center",children:g==null||g==""||g=="0"?i.jsx("div",{onClick:w=>{w.preventDefault(),window.localStorage.getItem("hyperToken")?e=="My Activities"?s(!0):n(!0):a(!0)},className:`${e=="My Activities"?"bg-[#7445ff] hover:bg-[#7445ff]/80":"bg-white/40 hover:bg-white/50"} h-8 min-h-8 px-3 py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer`,children:i.jsx("div",{className:"min-w-max text-white text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:e=="My Activities"?"My Activities - Telegram":"Tracked Wallets - Telegram"})}):i.jsx("div",{onClick:w=>{w.preventDefault(),e=="My Activities"?s(!0):v()},className:`${e=="My Activities"?"bg-[#7445ff] hover:bg-[#7445ff]/80":"bg-white/40 hover:bg-white/50"} h-8 min-h-8 px-3 py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer`,children:i.jsx("div",{className:"min-w-max text-white text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:e=="My Activities"?"My Activities - Telegram":"Tracked Wallets - Telegram"})})})]})};function qin(e){var Pt,Xe,Ut,Lt,qe,Ke,pt,en,Bt,Et,et,Be,Mt,Ve,ut,xt,jt,kt,xn,un,On,En,jn,bn,Zn,zn,$n,nr,wn,on,Oe,rn,cn,_t,Yn,yn,Dt,sn,Tn,Kn,ir,rr;const[t,n]=m.useState(!1),r=m.useRef(null),{isConnected:s,address:a}=Jr(),[o,l]=m.useState([]);m.useEffect(()=>{var Un,Qn;const Jt=(Un=e.advancedFilters)==null?void 0:Un.coinFeed;if(Jt&&((Qn=e.dataCoin)==null?void 0:Qn.length)>0){const Rt=Jt.map(Pn=>e.dataCoin.find(Ee=>Ee.value===Pn)).filter(Boolean);e.setSelectedCoins(Rt)}},[e.dataCoin]);const c=Jt=>{if(!Jt)return;const Qn=Array.isArray(Jt)?Jt:[Jt],Rt=e.selectedCoins||[],Pn=[...Rt,...Qn.filter(p=>!Rt.some(h=>h.value===p.value))],Ee=Pn.map(p=>p.value);Ee.join(","),e.setSelectedCoins(Pn),e.setAdvancedFilters(p=>({...p,coinFeed:Ee}))},[u,d]=m.useState(!1),[f,x]=m.useState(!1),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(!1),[P,R]=m.useState(!1),F=()=>{d(Jt=>!Jt)},U=()=>{x(Jt=>!Jt)},L=()=>{v(Jt=>!Jt)},z=()=>{C(Jt=>!Jt)},Q=()=>{I(Jt=>!Jt)},ne=()=>{R(Jt=>!Jt)},J=Jt=>{const{value:Un,checked:Qn}=Jt.target;e.setAdvancedFilters(Rt=>{let Pn=[...Rt.positionFeed];return Un==="all"?Pn=Qn?[...je]:[]:Qn?Pn.push(Un):Pn=Pn.filter(Ee=>Ee!==Un),localStorage.setItem("positionFeed",JSON.stringify(Pn)),{...Rt,positionFeed:Pn}})},X=()=>{localStorage.setItem("positionFeed",JSON.stringify([])),e.setAdvancedFilters(Jt=>({...Jt,positionFeed:[]}))},re=Jt=>{const{value:Un,checked:Qn}=Jt.target;e.setAdvancedFilters(Rt=>{let Pn=[...Rt.typeFeed];return Un==="all"?Pn=Qn?[...Qe]:[]:Qn?Pn.push(Un):Pn=Pn.filter(Ee=>Ee!==Un),{...Rt,typeFeed:Pn}})},pe=()=>{e.setAdvancedFilters(Jt=>({...Jt,typeFeed:[]}))},Y=Jt=>{const{value:Un,checked:Qn}=Jt.target;e.setAdvancedFilters(Rt=>{let Pn=[...Rt.dexMarket];return Un==="all"?Pn=Qn?[...$e]:[]:Qn?Pn.push(Un):Pn=Pn.filter(Ee=>Ee!==Un),{...Rt,dexMarket:Pn}})},ie=()=>{e.setAdvancedFilters(Jt=>({...Jt,dexMarket:[]}))},oe=()=>{e.setSearchTagSellect([])},G=((Pt=e.selectTradeWalletData)==null?void 0:Pt.length)>0?o:e.walletTags,V=Jt=>{const{value:Un,checked:Qn}=Jt.target;e.setSearchTagSellect(Rt=>{let Pn=[...Rt];return Un==="all"?Pn=Qn?G==null?void 0:G.map(Ee=>Ee.tag):[]:Qn?Pn==null||Pn.push(Un):Pn=Pn==null?void 0:Pn.filter(Ee=>Ee!==Un),Pn})},te=Jt=>{e.setAdvancedFilters(Un=>({...Un,directionFeed:Jt})),R(!1)},ae=()=>{e.setAdvancedFilters(Jt=>({...Jt,directionFeed:""})),R(!1)},he=()=>{e.setSelectTradeWalletData([])},[Ce,ce]=m.useState(!1),ge=async Jt=>{const{value:Un,checked:Qn}=Jt.target;let Rt;e.setSelectTradeWalletData(Pn=>{var Ee;return Un==="all"?Rt=Qn?(Ee=e.tradeWalletData)==null?void 0:Ee.map(p=>p.wallet):[]:(Rt=Qn?[...Pn,Un]:Pn==null?void 0:Pn.filter(p=>p!==Un),!Qn&&Pn.includes("all")&&(Rt=Rt==null?void 0:Rt.filter(p=>p!=="all"))),Rt}),e.setSearchTagSellect([]),setTimeout(async()=>{var Pn;if((Rt==null?void 0:Rt.length)!==0)try{ce(!0);const Ee=window.localStorage.getItem("hyperToken");if(!Ee){setSignModalOpen(!0);return}const h=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a,token:Ee,trader_wallets:Rt})});if(!h.ok)throw new Error(`Server responded with status ${h.status}`);const S=await h.json();if(S.success){const _=(Pn=S==null?void 0:S.data)==null?void 0:Pn.map(k=>({tag:k==null?void 0:k.tag,wallet:k==null?void 0:k.wallet_address}));l(_),ce(!1)}else console.log(S.error_message),ce(!1)}catch(Ee){console.log("Error :>> ",Ee),ce(!1)}},0)},Ae={control:(Jt,{isFocused:Un})=>{var Qn,Rt,Pn,Ee;return{...Jt,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",minWidth:"244px",maxWidth:"244px",border:((Rt=(Qn=e.advancedFilters)==null?void 0:Qn.coinFeed)==null?void 0:Rt.length)>0?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:((Ee=(Pn=e.advancedFilters)==null?void 0:Pn.coinFeed)==null?void 0:Ee.length)>0?"1px solid #8d67ff":"none"}}},menu:Jt=>({...Jt,backgroundColor:"#353535",maxWidth:"244px"}),menuList:Jt=>({...Jt,backgroundColor:"#353535",maxHeight:"180px",zIndex:4}),clearIndicator:Jt=>({...Jt,color:"#b3b3b3",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",padding:"0px",paddingRight:"5px",":hover":{color:"white"}}),dropdownIndicator:Jt=>({...Jt,color:"#b3b3b3",cursor:"pointer",alignItems:"center",justifyContent:"center",width:"25px",height:"25px",minWidth:"25px",minHeight:"25px",padding:"0px",paddingRight:"5px",paddingLeft:"5px",display:"none",":hover":{color:"white"}}),indicatorSeparator:()=>({display:"none"}),option:(Jt,{data:Un,isDisabled:Qn,isFocused:Rt,isSelected:Pn})=>{const Ee=hi(Un.color);return{...Jt,fontSize:"14px",fontWeight:"600",backgroundColor:Qn?void 0:Pn?Un.color:Rt?Ee.alpha(.1).css():void 0,color:"white",cursor:Qn?"not-allowed":"pointer",":active":{...Jt[":active"],backgroundColor:Qn?void 0:Pn?Un.color:Ee.alpha(.9).css()}}},multiValue:(Jt,{data:Un})=>{const Qn=hi(Un.color);return{...Jt,backgroundColor:Qn.alpha(.4).css()}},multiValueLabel:(Jt,{data:Un})=>({...Jt,color:"white"}),multiValueRemove:(Jt,{data:Un})=>({...Jt,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:Jt=>({...Jt,color:"white"}),valueContainer:Jt=>({...Jt,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},ye=(Jt,Un)=>{var Rt;const Qn=(Rt=Un.selectedCoins)==null?void 0:Rt.filter(Pn=>Pn.value!==Jt.value);Qn.map(Pn=>Pn.value).join(","),Un.setSelectedCoins(Qn),Un.setAdvancedFilters(Pn=>({...Pn,coinFeed:Qn==null?void 0:Qn.map(Ee=>Ee.value)}))};m.useEffect(()=>{const Jt=Un=>{r.current&&!r.current.contains(Un.target)&&n(!1)};return document.addEventListener("mousedown",Jt),()=>{document.removeEventListener("mousedown",Jt)}},[]);const je=["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"],Ie=(Xe=e.advancedFilters.positionFeed)==null?void 0:Xe.length,Re=je.length,Qe=["Open Position","Increase","Decrease","Changed Position","Position Closed","Spot","Twaps"],$e=["HyperLiquid","Lighter"],it=(Ut=e.advancedFilters.typeFeed)==null?void 0:Ut.length,tt=Qe.length,ot=(Lt=e.advancedFilters.dexMarket)==null?void 0:Lt.length,ft=$e.length,ct=(qe=e.searchTagSellect)==null?void 0:qe.length,Vt=G==null?void 0:G.length,It=(Ke=e.selectTradeWalletData)==null?void 0:Ke.length,an=(pt=e.tradeWalletData)==null?void 0:pt.length,Nt=["Long","Short"],mn=({src:Jt,alt:Un})=>{const[Qn,Rt]=Ne.useState(!1);return Qn?i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 mr-1 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}):i.jsx("img",{src:Jt,alt:Un,className:"rounded-full w-4 h-4 min-w-4 min-h-4 mr-1",loading:"lazy",onError:()=>Rt(!0)})},dn=Jt=>{const{data:Un,innerRef:Qn,innerProps:Rt,selectProps:Pn}=Jt,Ee=Pn.styles.option({},Jt);return i.jsxs("div",{ref:Qn,...Rt,style:Ee,className:"flex items-center p-2",children:[i.jsx(mn,{src:Un.icon,alt:Un.label}),Un.label]})};return i.jsxs("div",{className:"text-white flex flex-wrap justify-center font-manrope gap-4 pt-2",children:[i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"DEX"}),i.jsx("div",{onClick:ie,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${ot>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:L,children:[i.jsx("span",{className:`${ot>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:ot>0?`${ot} of ${ft} selected`:"Select Dex"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${g?"rotate-180":""}`})]}),g&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-[260px] overflow-y-auto",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((Bt=(en=e.advancedFilters)==null?void 0:en.dexMarket)==null?void 0:Bt.length)===$e.length,onChange:Y,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((et=(Et=e.advancedFilters)==null?void 0:Et.dexMarket)==null?void 0:et.length)===$e.length?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Mt=(Be=e.advancedFilters)==null?void 0:Be.dexMarket)==null?void 0:Mt.length)===($e==null?void 0:$e.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),$e==null?void 0:$e.map((Jt,Un)=>{var Qn,Rt,Pn,Ee,p,h;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Jt,checked:(Rt=(Qn=e.advancedFilters)==null?void 0:Qn.dexMarket)==null?void 0:Rt.includes(Jt),onChange:Y,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(Pn=e.advancedFilters)==null?void 0:Pn.dexMarket)!=null&&Ee.includes(Jt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((h=(p=e.advancedFilters)==null?void 0:p.dexMarket)==null?void 0:h.includes(Jt))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Jt==="HyperLiquid"?i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}):Jt==="Lighter"?i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}):null,Jt]},Un)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Follower Wallet"}),i.jsx("div",{onClick:he,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${It>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:Q,children:[i.jsx("span",{className:`${It>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:It>0?`${It} of ${an} selected`:"Select Wallet"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${N?"rotate-180":""}`})]}),N&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-40 overflow-y-auto scrollbar-custom-scrollbar-dark",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((Ve=e.selectTradeWalletData)==null?void 0:Ve.length)===((ut=e.tradeWalletData)==null?void 0:ut.length),onChange:ge,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((xt=e.selectTradeWalletData)==null?void 0:xt.length)===((jt=e.tradeWalletData)==null?void 0:jt.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((kt=e.selectTradeWalletData)==null?void 0:kt.length)===((xn=e.tradeWalletData)==null?void 0:xn.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),e.isWalletLoading?i.jsx("span",{className:"text-[#7c7c7c] text-center py-2 text-sm font-semibold font-manrope leading-[8px]",children:'"Loading..."'}):(un=e.tradeWalletData)==null?void 0:un.map((Jt,Un)=>{var Qn,Rt,Pn,Ee,p,h,S;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Jt==null?void 0:Jt.wallet,checked:(Qn=e.selectTradeWalletData)==null?void 0:Qn.includes(Jt==null?void 0:Jt.wallet),onChange:ge,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Rt=e.selectTradeWalletData)!=null&&Rt.includes(Jt==null?void 0:Jt.wallet)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Pn=e.selectTradeWalletData)==null?void 0:Pn.includes(Jt==null?void 0:Jt.wallet))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),((Ee=Jt==null?void 0:Jt.wallet)==null?void 0:Ee.slice(0,5))+"..."+((p=Jt==null?void 0:Jt.wallet)==null?void 0:p.slice(-4)),` (${((h=Jt==null?void 0:Jt.name)==null?void 0:h.length)>10?((S=Jt==null?void 0:Jt.name)==null?void 0:S.slice(0,10))+"...":Jt==null?void 0:Jt.name})`]},Un)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Source Wallet"}),i.jsx("div",{onClick:oe,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${ct>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:z,children:[i.jsx("span",{className:`${ct>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:ct>0?`${ct} of ${Vt} selected`:"Select Wallet"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${w?"rotate-180":""}`})]}),w&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:Ce?i.jsx("p",{className:"text-[#7c7c7c] text-center py-2 text-sm font-semibold font-manrope leading-[8px]",children:"Loading..."}):i.jsxs("div",{className:"max-h-40 overflow-y-auto scrollbar-custom-scrollbar-dark",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((On=e.searchTagSellect)==null?void 0:On.length)===(G==null?void 0:G.length),onChange:V,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((En=e.searchTagSellect)==null?void 0:En.length)===(G==null?void 0:G.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((jn=e.searchTagSellect)==null?void 0:jn.length)===(G==null?void 0:G.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),G==null?void 0:G.map((Jt,Un)=>{var Qn,Rt,Pn,Ee,p,h;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope",children:[i.jsx("input",{type:"checkbox",value:Jt==null?void 0:Jt.tag,checked:(Qn=e.searchTagSellect)==null?void 0:Qn.includes(Jt==null?void 0:Jt.tag),onChange:V,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Rt=e.searchTagSellect)!=null&&Rt.includes(Jt==null?void 0:Jt.tag)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Pn=e.searchTagSellect)==null?void 0:Pn.includes(Jt==null?void 0:Jt.tag))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),(Jt==null?void 0:Jt.wallet)&&((Ee=Jt==null?void 0:Jt.wallet)==null?void 0:Ee.slice(0,5))+"..."+((p=Jt==null?void 0:Jt.wallet)==null?void 0:p.slice(-4))," ",Jt!=null&&Jt.tag&&(Jt==null?void 0:Jt.tag.length)>10?`(${(h=Jt==null?void 0:Jt.tag)==null?void 0:h.slice(0,10)}...)`:`(${Jt==null?void 0:Jt.tag})`]},Un)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[7px] justify-start max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Search Coin"}),i.jsx("div",{onClick:()=>{e.setSelectedCoins([]),e.setAdvancedFilters(Jt=>({...Jt,coinFeed:""}))},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear Coins"})})]}),i.jsx("div",{className:"float-left w-full",ref:r,children:i.jsxs("div",{className:"min-w-full relative",children:[i.jsx(_y,{className:"text-[#646464] absolute left-[6px] top-[6px] z-10"}),i.jsx(Cl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataCoin.filter(Jt=>Array.isArray(e.selectedCoins)&&!e.selectedCoins.some(Un=>Un.value===Jt.value)),components:{Option:dn},styles:Ae,onChange:c,menuIsOpen:t,onMenuOpen:()=>n(!0),placeholder:e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Search Coin"}),noOptionsMessage:()=>e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"No data available"})}),i.jsx("div",{className:`absolute top-[220px] z-[4] left-0 w-full max-w-[244px] bg-[#303030] flex flex-wrap gap-1 p-1 border border-[#3a3a3a] mt-1 ${t?"block":"hidden"} ${t&&((bn=e.selectedCoins)==null?void 0:bn.length)>0?"block":"hidden"}`,children:e.selectedCoins&&((Zn=e.selectedCoins)==null?void 0:Zn.map(Jt=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex",children:[i.jsx(mn,{src:Jt==null?void 0:Jt.icon,alt:Jt==null?void 0:Jt.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:Jt.label}),i.jsx("div",{onClick:Un=>{Un.stopPropagation(),ye(Jt,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(tw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},Jt.value)))}),i.jsx("div",{className:`${((zn=e.selectedCoins)==null?void 0:zn.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[244px]`,children:e.selectedCoins&&(($n=e.selectedCoins)==null?void 0:$n.map(Jt=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex ",children:[i.jsx(mn,{src:Jt==null?void 0:Jt.icon,alt:Jt==null?void 0:Jt.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:Jt.label}),i.jsx("div",{onClick:()=>ye(Jt,e),className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(tw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},Jt.value)))})]})})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Source Wallet Type"}),i.jsx("div",{onClick:pe,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${it>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:U,children:[i.jsx("span",{className:`${it>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:it>0?`${it} of ${tt} selected`:"Select Type"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${f?"rotate-180":""}`})]}),f&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-[260px] overflow-y-auto",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((wn=(nr=e.advancedFilters)==null?void 0:nr.typeFeed)==null?void 0:wn.length)===Qe.length,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((Oe=(on=e.advancedFilters)==null?void 0:on.typeFeed)==null?void 0:Oe.length)===Qe.length?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((cn=(rn=e.advancedFilters)==null?void 0:rn.typeFeed)==null?void 0:cn.length)===(Qe==null?void 0:Qe.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),Qe==null?void 0:Qe.map((Jt,Un)=>{var Qn,Rt,Pn,Ee,p,h;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Jt,checked:(Rt=(Qn=e.advancedFilters)==null?void 0:Qn.typeFeed)==null?void 0:Rt.includes(Jt),onChange:re,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(Pn=e.advancedFilters)==null?void 0:Pn.typeFeed)!=null&&Ee.includes(Jt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((h=(p=e.advancedFilters)==null?void 0:p.typeFeed)==null?void 0:h.includes(Jt))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Jt]},Un)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Follower Wallet Status"}),i.jsx("div",{onClick:X,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${Ie>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:F,children:[i.jsx("span",{className:`${Ie>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:Ie>0?`${Ie} of ${Re} selected`:"Select Status"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${u?"rotate-180":""}`})]}),u&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-[228px] overflow-y-auto",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((Yn=(_t=e.advancedFilters)==null?void 0:_t.positionFeed)==null?void 0:Yn.length)===(je==null?void 0:je.length),onChange:J,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((Dt=(yn=e.advancedFilters)==null?void 0:yn.positionFeed)==null?void 0:Dt.length)===(je==null?void 0:je.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Tn=(sn=e.advancedFilters)==null?void 0:sn.positionFeed)==null?void 0:Tn.length)===(je==null?void 0:je.length)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),je==null?void 0:je.map((Jt,Un)=>{var Qn,Rt,Pn,Ee,p,h;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Jt,checked:(Rt=(Qn=e.advancedFilters)==null?void 0:Qn.positionFeed)==null?void 0:Rt.includes(Jt),onChange:J,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(Pn=e.advancedFilters)==null?void 0:Pn.positionFeed)!=null&&Ee.includes(Jt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((h=(p=e.advancedFilters)==null?void 0:p.positionFeed)==null?void 0:h.includes(Jt))&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Jt==="Other"?"System Message":Jt]},Un)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Direction"}),i.jsx("div",{onClick:ae,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${(Kn=e.advancedFilters)!=null&&Kn.directionFeed?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:ne,children:[i.jsx("span",{className:`${(ir=e.advancedFilters)!=null&&ir.directionFeed?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:((rr=e.advancedFilters)==null?void 0:rr.directionFeed)||"Select Direction"}),i.jsx(Yh,{className:`w-3.5 h-3.5 transition ${P?"rotate-180":""}`})]}),P&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsx("div",{className:"max-h-40 overflow-y-auto",children:Nt==null?void 0:Nt.map((Jt,Un)=>i.jsx("div",{onClick:()=>te(Jt),className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope",children:Jt},Un))})})]})]})]})}const Gin=({advancedFilters:e,setAdvancedFilters:t,getFeedClearData:n,getFeedData:r,dataCoin:s,selectedCoins:a,setSelectedCoins:o,isLoadingCoin:l,setIsLoadingCoin:c,walletTagData:u,walletTags:d,searchWalletSellect:f,setSearchWalletSellect:x,walletTagLoading:g,tradeWalletData:v,selectTradeWalletData:w,setSelectTradeWalletData:C,searchTagSellect:N,setSearchTagSellect:I,isWalletLoading:P})=>i.jsxs("div",{className:"bg-[#232323] rounded-2xl min-h-[380px] min-w-max lg:min-w-[286px] max-w-[286px] p-1 py-3 font-manrope overflow-hidden relative h-[calc(100vh-236px)] mt-4",children:[i.jsxs("div",{className:"w-full flex justify-between items-center pt-[2px] pl-4 pr-1 pb-[10px]",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[8px]",children:"Filters"}),i.jsx("div",{onClick:()=>{n()},className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex mr-3 cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("div",{className:"h-full w-full overflow-y-scroll font-manrope py-1 pl-4 pr-3",children:i.jsx("div",{className:"font-manrope font-normal pb-[120px] sm:pb-[80px] max-w-[256px]",children:i.jsx(qin,{advancedFilters:e,setAdvancedFilters:t,dataCoin:s,selectedCoins:a,setSelectedCoins:o,isLoadingCoin:l,setIsLoadingCoin:c,walletTagData:u,searchWalletSellect:f,setSearchWalletSellect:x,walletTagLoading:g,tradeWalletData:v,selectTradeWalletData:w,setSelectTradeWalletData:C,searchTagSellect:N,setSearchTagSellect:I,walletTags:d,isWalletLoading:P})})}),i.jsx("div",{className:"absolute bottom-0 w-full",children:i.jsx("div",{className:"sticky h-12 bg-[#1b1b1b]/30 rounded-bl-2xl rounded-br-2xl border-t border-[#353535] backdrop-blur-[32px] min-h-14 pt-[11px] w-full z-10",children:i.jsx("div",{className:"flex justify-center -ml-3",children:i.jsx("div",{onClick:()=>r(),className:"w-[234px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] pointer-events-none",children:"Apply Filters"})})})})})]});var Kin={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function Yin(e){if(typeof e=="number")return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();n.includes(".")?t=parseFloat(n):t=parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return Kin[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function ow(e){var t=Yin(e);return"".concat(t.value).concat(t.unit)}var Pne=function(e,t,n){var r="react-spinners-".concat(e,"-").concat(n);if(typeof window>"u"||!window.document)return r;var s=document.createElement("style");document.head.appendChild(s);var a=s.sheet,o=`
@keyframes `.concat(r,` {
`).concat(t,`
}
`);return a&&a.insertRule(o,0),r},VL=function(){return VL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},VL.apply(this,arguments)},Xin=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},Qin=Pne("BeatLoader","50% {transform: scale(0.75);opacity: 0.2} 100% {transform: scale(1);opacity: 1}","beat");function qUe(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,s=r===void 0?"#000000":r,a=e.speedMultiplier,o=a===void 0?1:a,l=e.cssOverride,c=l===void 0?{}:l,u=e.size,d=u===void 0?15:u,f=e.margin,x=f===void 0?2:f,g=Xin(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),v=VL({display:"inherit"},c),w=function(C){return{display:"inline-block",backgroundColor:s,width:ow(d),height:ow(d),margin:ow(x),borderRadius:"100%",animation:"".concat(Qin," ").concat(.7/o,"s ").concat(C%2?"0s":"".concat(.35/o,"s")," infinite linear"),animationFillMode:"both"}};return n?m.createElement("span",VL({style:v},g),m.createElement("span",{style:w(1)}),m.createElement("span",{style:w(2)}),m.createElement("span",{style:w(3)})):null}var WL=function(){return WL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},WL.apply(this,arguments)},Zin=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},jCe=[Pne("PuffLoader","0% {transform: scale(0)} 100% {transform: scale(1.0)}","puff-1"),Pne("PuffLoader","0% {opacity: 1} 100% {opacity: 0}","puff-2")];function GUe(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,s=r===void 0?"#000000":r,a=e.speedMultiplier,o=a===void 0?1:a,l=e.cssOverride,c=l===void 0?{}:l,u=e.size,d=u===void 0?60:u,f=Zin(e,["loading","color","speedMultiplier","cssOverride","size"]),x=WL({display:"inherit",position:"relative",width:ow(d),height:ow(d)},c),g=function(v){return{position:"absolute",height:ow(d),width:ow(d),border:"thick solid ".concat(s),borderRadius:"50%",opacity:"1",top:"0",left:"0",animationFillMode:"both",animation:"".concat(jCe[0],", ").concat(jCe[1]),animationDuration:"".concat(2/o,"s"),animationIterationCount:"infinite",animationTimingFunction:"cubic-bezier(0.165, 0.84, 0.44, 1), cubic-bezier(0.3, 0.61, 0.355, 1)",animationDelay:v===1?"-1s":"0s"}};return n?m.createElement("span",WL({style:x},f),m.createElement("span",{style:g(1)}),m.createElement("span",{style:g(2)})):null}function Jin({feedData:e}){var l,c;const[t,n]=m.useState(null);function r({date:u}){const[d,f]=m.useState(Oo(u));return m.useEffect(()=>{const x=setInterval(()=>{f(Oo(u))},1e3);return()=>clearInterval(x)},[u]),i.jsx("span",{className:"text-xs text-[#a5a5a5] font-normal",children:d.dateTime})}const s=u=>n(u),a=()=>n(null),o=u=>u?["Sell","Close Short","Open Short"].includes(u)||u.includes("Short")?"Short":["Buy","Close Long","Open Long"].includes(u)||u.includes("Long")?"Long":u:"-";return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex lg:hidden flex-col gap-3 w-full font-manrope font-semibold pb-2",children:[(!e||e.length===0)&&i.jsx("div",{className:"flex justify-center items-center w-full py-10",children:i.jsx(GUe,{color:"#ffffff",size:40})}),e==null?void 0:e.map((u,d)=>{var f,x,g,v,w,C;return i.jsxs("div",{children:[i.jsxs("div",{className:"w-full border-2 border-[#232323] rounded-tl-xl rounded-tr-xl p-3 flex items-start gap-3 cursor-pointer",onClick:()=>s(u),children:[i.jsxs("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center relative",children:[i.jsx("img",{src:qi,alt:"",className:"w-6 h-6"}),(u==null?void 0:u.target_platform)==="hyper"?i.jsx("div",{className:"absolute top-12 flex justify-start items-center gap-2",children:i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"})}):(u==null?void 0:u.target_platform)==="lighter"?i.jsx("div",{className:"absolute top-12 flex justify-start items-center gap-2",children:i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"})}):""]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-white text-sm font-semibold",children:[u!=null&&u.listen_user?u.listen_user.slice(0,5)+"..."+u.listen_user.slice(-4):"-",i.jsx("img",{src:wo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:N=>{N.stopPropagation(),navigator.clipboard.writeText((u==null?void 0:u.listen_user)||""),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})}})]}),i.jsxs("div",{className:"flex flex-col text-xs text-[#a5a5a5]",children:[i.jsx("span",{children:su(u==null?void 0:u.time)}),i.jsx(r,{date:u==null?void 0:u.time})]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",u!=null&&u.sz?Cr(u==null?void 0:u.sz):"-"]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Entry Price:"})," ",u!=null&&u.markPrice?"$"+Cr(u==null?void 0:u.markPrice):"-"]}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${u==null?void 0:u.coin}.svg`||Va,onError:N=>ra(N),alt:"",className:"w-5 h-5"}),i.jsxs("div",{className:"text-[13px] text-white font-bold",children:[u==null?void 0:u.coin,"/",(u==null?void 0:u.feeToken)||"USDC"]}),i.jsxs("div",{className:`${o(u==null?void 0:u.dir)==="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":o(u==null?void 0:u.dir)==="Short"?"bg-[#ff797c]/20 text-[#ff797c]":(u==null?void 0:u.dir)==="Buy"?"bg-[#67ffbd]/20 text-[#67ffbd]":(u==null?void 0:u.dir)==="Sell"?"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#767676]/20 text-[#cccccc]"} h-5 pl-2 pr-2 py-1 rounded-md flex items-center gap-1 w-max`,children:[i.jsx("div",{className:"w-3 h-3",children:(f=u==null?void 0:u.dir)!=null&&f.includes("Long")?(u==null?void 0:u.dir)==="Short > Long"?i.jsx(Ts,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(u==null?void 0:u.dir)==="Long > Short"?i.jsx(Ts,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(u==null?void 0:u.dir)==="Buy"?i.jsx(Ts,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#ff797c] w-3 h-3"})}),i.jsxs("div",{className:"text-[11px] font-semibold",children:[(u==null?void 0:u.dir)||"-"," ",u!=null&&u.leverage?`${u.leverage}x`:""]})]})]})]})]}),i.jsx("div",{className:`${u!=null&&u.success?"bg-[#67ffbd]/20 border-[#67ffbd]/25":"bg-[#ff797c]/20 border-[#ff797c]/25"} flex justify-start items-center h-8 max-h-8 rounded-bl-[18px] rounded-br-[18px] border-t w-full py-1.5`,children:i.jsxs("div",{className:"text-white text-sm font-manrope leading-none flex justify-start items-center px-2 gap-2",children:[u!=null&&u.success?i.jsx("img",{src:hM,alt:""}):i.jsx("img",{src:pM,alt:""}),i.jsx("div",{className:`${u!=null&&u.success?"text-[#67ffbd]":"text-[#ff787b]"} text-xs font-bold font-manrope leading-3 tracking-tight`,children:u!=null&&u.success?"Status:":"System Message:"}),i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-1",children:u!=null&&u.success?((x=u==null?void 0:u.message)==null?void 0:x.split("-")[0])||"-":"For details, use web version"}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${u==null?void 0:u.trader_wallet}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-white rounded-[256px] justify-center items-center gap-0.5 inline-flex cursor-pointer -ml-0.5",children:i.jsx("div",{className:"w-14 text-center truncate overflow-hidden whitespace-nowrap text-[#273f35] text-xs font-semibold font-manrope leading-[13px]",children:u!=null&&u.wallet_name?u==null?void 0:u.wallet_name:u!=null&&u.trader_wallet?((g=u==null?void 0:u.trader_wallet)==null?void 0:g.slice(0,5))+"..."+((v=u==null?void 0:u.trader_wallet)==null?void 0:v.slice(-4)):"--"})}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-0.5",children:["by"," "]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${u==null?void 0:u.listen_user}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-[#a5ffd8] rounded-[256px] justify-center items-center gap-0.5 inline-flex -ml-0.5 cursor-pointer",children:i.jsx("div",{className:"w-14 text-center truncate overflow-hidden whitespace-nowrap text-[#1e563e] text-xs font-semibold font-manrope leading-[13px]",children:u!=null&&u.tag?u==null?void 0:u.tag:u!=null&&u.listen_user?((w=u==null?void 0:u.listen_user)==null?void 0:w.slice(0,5))+"..."+((C=u==null?void 0:u.listen_user)==null?void 0:C.slice(-4)):"--"})})]})})]},d)})]}),t&&i.jsx(up,{isOpen:!!t,onClose:a,children:i.jsxs("div",{className:"flex flex-col gap-4 p-2 font-manrope font-semibold",children:[i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center",children:i.jsx("img",{src:qi,alt:"",className:"w-6 h-6"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("div",{className:"inline-flex items-center gap-2",children:[i.jsx("div",{className:"text-white text-sm font-semibold",children:t!=null&&t.listen_user?t.listen_user.slice(0,5)+"..."+t.listen_user.slice(-4):"-"}),i.jsx("span",{onClick:()=>{navigator.clipboard.writeText((t==null?void 0:t.listen_user)||"")},children:i.jsx("img",{src:wo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:u=>{u.stopPropagation(),navigator.clipboard.writeText((t==null?void 0:t.listen_user)||"")}})})]}),i.jsxs("div",{className:"flex flex-col text-[11px] text-[#a5a5a5]",children:[i.jsx("span",{children:su(t==null?void 0:t.time)}),i.jsx(r,{date:t==null?void 0:t.time})]})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 text-sm text-[#9b9b9b]",children:[i.jsxs("div",{className:"text-white flex items-center gap-2",children:[i.jsx("img",{src:t!=null&&t.success?hM:pM,alt:"",className:"w-4 h-4"}),"Status: ",t!=null&&t.success?"Success":"Failed"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Order ID:"})," ",(t==null?void 0:t.oid)||"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Type:"})," ",(t==null?void 0:t.fill_direction_type)||"-"]}),i.jsxs("div",{className:"flex items-center gap-1 text-white",children:["Direction:",i.jsxs("div",{className:`${o(t==null?void 0:t.dir)==="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":o(t==null?void 0:t.dir)==="Short"?"bg-[#ff797c]/20 text-[#ff797c]":(t==null?void 0:t.dir)==="Buy"?"bg-[#67ffbd]/20 text-[#67ffbd]":(t==null?void 0:t.dir)==="Sell"?"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#767676]/20 text-[#cccccc]"} h-5 pl-1 pr-1.5 py-1 rounded-md flex items-center gap-1`,children:[i.jsx("div",{className:"w-3 h-3",children:(l=t==null?void 0:t.dir)!=null&&l.includes("Long")?(t==null?void 0:t.dir)==="Short > Long"?i.jsx(Ts,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(t==null?void 0:t.dir)==="Long > Short"?i.jsx(Ts,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(t==null?void 0:t.dir)==="Buy"?i.jsx(Ts,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#ff797c] w-3 h-3"})}),i.jsxs("div",{className:"text-[11px] font-semibold",children:[(t==null?void 0:t.dir)||"-"," ",t!=null&&t.leverage?`${t.leverage}x`:""]})]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Price:"})," ",t!=null&&t.px?"$"+Cr(t==null?void 0:t.px):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",t!=null&&t.sz?Cr(t==null?void 0:t.sz):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Entry Price:"})," ",t!=null&&t.markPrice?"$"+Cr(t==null?void 0:t.markPrice):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"PnL:"})," ",t!=null&&t.closedPnl?"$"+Cr(Math.abs(t==null?void 0:t.closedPnl)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Fee:"})," ",t!=null&&t.fee?"$"+Cr(Math.abs(t==null?void 0:t.fee)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Margin Mode:"})," ",(t==null?void 0:t.is_cross)==null||t!=null&&t.is_cross?"Cross":"Isolated"]}),i.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${t==null?void 0:t.coin}.svg`||Va,onError:u=>ra(u),alt:"",className:"w-5 h-5"}),i.jsxs("span",{className:"font-bold text-white",children:[t==null?void 0:t.coin,"/",(t==null?void 0:t.feeToken)||"USDC"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Message: "}),((c=t==null?void 0:t.message)==null?void 0:c.split("-")[0])||"-"]})]})]})})]})}const ean=()=>{var Lt;const{isConnected:e,address:t}=Jr(),{setSignModalOpen:n,copyTradeWatchList:r,hyperToken:s}=m.useContext(Qr),[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState([]),f=m.useRef(null),[x,g]=m.useState(0),[v,w]=m.useState(!1),[C,N]=m.useState(!0),[I,P]=m.useState([]),[R,F]=m.useState(!0),[U,L]=m.useState([]),[z,Q]=m.useState([]),[ne,J]=m.useState([]),[X,re]=m.useState([]),[pe,Y]=m.useState([]),[ie,oe]=m.useState(!1),[G,V]=m.useState([]),[te,ae]=m.useState([]),Ce=localStorage.getItem("isDateCopyTradeFormat")||"date",[ce,ge]=m.useState(Ce),[Ae,ye]=m.useState(!1);m.useEffect(()=>{localStorage.setItem("isDateCopyTradeFormat",ce)},[ce]),m.useEffect(()=>{(async()=>{var Ke,pt;try{const Bt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),Et=()=>hi.random().hex(),et=(pt=(Ke=Bt.coins)==null?void 0:Ke.filter(Be=>!Be.startsWith("@")&&!Be.endsWith("/USDC")))==null?void 0:pt.map(Be=>({value:Be,label:Be.endsWith("/USDC")?Be+" (Spot)":Be,icon:`https://app.hyperliquid.xyz/coins/${Be}.svg`,color:Et()}));P(et),F(!1)}catch(en){console.error("Data extraction error:",en),F(!1)}})()},[]);const[je,Ie]=m.useState({userWalletFeed:"",coinFeed:"",positionFeed:[],directionFeed:"",statusFeed:"",typeFeed:"",dexMarket:[]});m.useEffect(()=>{const qe=["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"],Ke=localStorage.getItem("positionFeed"),pt=Ke&&Array.isArray(JSON.parse(Ke))?JSON.parse(Ke):qe;Ie(en=>({...en,positionFeed:pt}))},[]);const Re=m.useRef(je);m.useEffect(()=>{Re.current=je},[je]);const Qe=async(qe=!1)=>{var pt,en,Bt;g(0),w(!0),N(!0);const Ke=window.localStorage.getItem("hyperToken");try{o(!0),c(!0);const Et=window.localStorage.getItem("hyperAddress");if(!Ke){n(!0);return}const et={};(G==null?void 0:G.length)>0&&(et.copy_trader=G),(ne==null?void 0:ne.length)>0&&(et.trader=ne),(te==null?void 0:te.length)>0&&(et.tag=te),((pt=je==null?void 0:je.coinFeed)==null?void 0:pt.length)>0&&(et.coin=je.coinFeed.includes(",")?je.coinFeed.split(",").map(En=>En.trim()):je.coinFeed);const Be=localStorage.getItem("positionFeed"),Mt=qe?Be&&JSON.parse(Be)||["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"]:je.positionFeed;(Mt==null?void 0:Mt.length)>0&&(Mt==null?void 0:Mt.length)<6&&(et.position=Mt),((en=je==null?void 0:je.typeFeed)==null?void 0:en.length)>0&&((Bt=je==null?void 0:je.typeFeed)==null?void 0:Bt.length)<7&&(et.type=je.typeFeed),je!=null&&je.directionFeed&&(et.direction=je.directionFeed),je!=null&&je.statusFeed&&(je.statusFeed==="On"?et.status=!0:je.statusFeed==="Off"?et.status=!1:je.statusFeed==="All"&&delete et.status);const Ve=((je==null?void 0:je.dexMarket)||[]).map(En=>En.toLowerCase()),ut=Ve.includes("hyperliquid"),xt=Ve.includes("lighter"),jt=[];ut&&!xt?jt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):xt&&!ut?jt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):jt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const kt=await Promise.all(jt.map(En=>fetch(En,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Et,token:Ke,offset:0,...Object.keys(et).length&&{filters:et}})}))),un=(await Promise.all(kt.map(En=>En.json()))).filter(En=>En.success&&Array.isArray(En.data)).flatMap(En=>En.data).sort((En,jn)=>new Date(jn.time)-new Date(En.time));d(un),g(En=>En+50),un.length<50&&N(!1);const On=un.map(En=>({wallet:En.trader_wallet,name:En.wallet_name}));Q(En=>{const jn=new Map(En.map(bn=>[bn.wallet,bn.name]));return On.forEach(bn=>{jn.has(bn.wallet)||jn.set(bn.wallet,bn.name)}),Array.from(jn,([bn,Zn])=>({wallet:bn,name:Zn}))})}catch(Et){console.log("Error :>> ",Et)}finally{o(!1),c(!1),w(!1)}},$e=async()=>{const qe=window.localStorage.getItem("hyperToken");try{oe(!0);const Ke="https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",pt=window.localStorage.getItem("hyperAddress");if(!qe){n(!0);return}const en=await fetch(Ke,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():pt,token:qe})});if(!en.ok)throw new Error(`Server responded with status ${en.status}`);const Bt=await en.json();if(Bt.success){re(Bt==null?void 0:Bt.data);const Et=Bt==null?void 0:Bt.data.map(et=>et.tag?{tag:et.tag,wallet:et.wallet_address}:null).filter(et=>et!==null);Y(Et)}else console.log(Bt.error_message)}catch(Ke){console.log("Error :>> ",Ke)}finally{oe(!1)}};m.useEffect(()=>{Qe(!0),$e()},[s]);const it=async()=>{g(0),w(!0),N(!0);const qe=window.localStorage.getItem("hyperToken");try{o(!0);const Ke=window.localStorage.getItem("hyperAddress");if(!qe){n(!0);return}const pt=((je==null?void 0:je.dexMarket)||[]).map(Ve=>Ve.toLowerCase()),en=pt.includes("hyperliquid"),Bt=pt.includes("lighter"),Et=[];en&&!Bt?Et.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):Bt&&!en?Et.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):Et.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const et=await Promise.all(Et.map(Ve=>fetch(Ve,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Ke,token:qe,offset:0})}))),Mt=(await Promise.all(et.map(Ve=>Ve.json()))).filter(Ve=>Ve.success&&Array.isArray(Ve.data)).flatMap(Ve=>Ve.data).sort((Ve,ut)=>new Date(ut.time)-new Date(Ve.time));d(Mt),g(Ve=>Ve+50),Mt.length<50&&N(!1),localStorage.setItem("positionFeed",JSON.stringify([])),Ie({userWalletFeed:"",coinFeed:"",positionFeed:[],directionFeed:"",statusFeed:"",typeFeed:[],dexMarket:[]}),L([]),V([]),J([]),ae([])}catch(Ke){console.log("Error :>> ",Ke)}finally{o(!1),w(!1)}},tt=async()=>{var Ke,pt,en,Bt,Et;if(v)return;w(!0);const qe=window.localStorage.getItem("hyperToken");try{const et=window.localStorage.getItem("hyperAddress");if(!qe){n(!0);return}const Be={};(G==null?void 0:G.length)>0&&(Be.copy_trader=G),(ne==null?void 0:ne.length)>0&&(Be.trader=ne),(te==null?void 0:te.length)>0&&(Be.tag=te),je!=null&&je.coinFeed&&((Ke=je==null?void 0:je.coinFeed)==null?void 0:Ke.length)>0&&(Be.coin=je.coinFeed.includes(",")?je.coinFeed.split(",").map(On=>On.trim()):je.coinFeed),((pt=je==null?void 0:je.positionFeed)==null?void 0:pt.length)>0&&((en=je==null?void 0:je.positionFeed)==null?void 0:en.length)<6&&(Be.position=je.positionFeed),((Bt=je==null?void 0:je.typeFeed)==null?void 0:Bt.length)>0&&((Et=je==null?void 0:je.typeFeed)==null?void 0:Et.length)<7&&(Be.type=je.typeFeed),je!=null&&je.directionFeed&&(Be.direction=je.directionFeed),je!=null&&je.statusFeed&&(je.statusFeed==="On"?Be.status=!0:je.statusFeed==="Off"?Be.status=!1:je.statusFeed==="All"&&delete Be.status);const Mt=((je==null?void 0:je.dexMarket)||[]).map(On=>On.toLowerCase()),Ve=Mt.includes("hyperliquid"),ut=Mt.includes("lighter"),xt=[];Ve&&!ut?xt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):ut&&!Ve?xt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):xt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const jt=await Promise.all(xt.map(On=>fetch(On,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():et,token:qe,offset:x,...Object.keys(Be).length&&{filters:Be}})}))),xn=(await Promise.all(jt.map(On=>On.json()))).filter(On=>On.success&&Array.isArray(On.data)).flatMap(On=>On.data).sort((On,En)=>new Date(En.time)-new Date(On.time));d(On=>[...On,...xn].sort((jn,bn)=>new Date(bn.time)-new Date(jn.time))),g(On=>On+50),xn.length<50&&N(!1);const un=xn.map(On=>({wallet:On.trader_wallet,name:On.wallet_name}));Q(On=>{const En=new Set(On.map(bn=>bn.wallet)),jn=[...On];return un.forEach(bn=>{En.has(bn.wallet)||(En.add(bn.wallet),jn.push(bn))}),jn})}catch(et){console.log("Error :>> ",et)}finally{w(!1)}},ot=(qe,Ke)=>{let pt;return function(...en){clearTimeout(pt),pt=setTimeout(()=>{qe.apply(this,en)},Ke)}},ft=()=>{const qe=f.current;qe.scrollTop+qe.clientHeight>=qe.scrollHeight-10&&C&&!v&&tt()};m.useEffect(()=>{const qe=ot(ft,300),Ke=f.current;return Ke.addEventListener("scroll",qe),()=>{Ke.removeEventListener("scroll",qe)}},[x,C,v]);const ct=m.useRef(null),Vt=m.useRef(!1),It=m.useRef(t),an=m.useRef(r),Nt=m.useRef(s);m.useEffect(()=>{It.current=t},[t]),m.useEffect(()=>{an.current=r},[r]),m.useEffect(()=>{Nt.current=s},[s]);const mn="hyper_get_trade_message";m.useEffect(()=>{if(!s||Vt.current)return;const qe=Ny("https://dextrabothypesocketv2.nftinit.io/");return ct.current=qe,Vt.current=!0,qe.on("connect",()=>{console.log("Socket connected");const Ke=()=>{var Bt;const pt=(Bt=It.current)==null?void 0:Bt.toLowerCase(),en=Nt.current;pt&&en?qe.emit("subscribe",{login:pt,token:en}):setTimeout(Ke,300)};Ke()}),qe.on(mn,function(Ke){var Mt;const pt=Re.current,en=(Mt=(pt==null?void 0:pt.dexMarket)||[])==null?void 0:Mt.map(Ve=>Ve.toLowerCase()),Bt=en.includes("hyperliquid"),Et=en.includes("lighter"),Be=(Array.isArray(Ke)?Ke:[Ke]).filter(Ve=>Ve!=null&&Ve.target_platform?Bt&&!Et?Ve.target_platform==="hyper":Et&&!Bt?Ve.target_platform==="lighter":!0:!1);d(Ve=>{const ut=[...Be,...Ve],xt=Re.current;return ut==null?void 0:ut.filter(kt=>{var xn,un,On,En,jn,bn,Zn,zn,$n;if(!kt||(G==null?void 0:G.length)>0&&!(G!=null&&G.includes((xn=kt==null?void 0:kt.listen_user)==null?void 0:xn.toLowerCase()))||(ne==null?void 0:ne.length)>0&&!(ne!=null&&ne.includes((un=kt==null?void 0:kt.trader_wallet)==null?void 0:un.toLowerCase()))||(te==null?void 0:te.length)>0&&!(te!=null&&te.includes(kt==null?void 0:kt.tag))||((On=xt.coinFeed)==null?void 0:On.length)>0&&!((En=xt.coinFeed)!=null&&En.includes(kt==null?void 0:kt.coin)))return!1;if(((jn=xt==null?void 0:xt.typeFeed)==null?void 0:jn.length)>0){const wn=((bn=xt==null?void 0:xt.typeFeed)==null?void 0:bn.includes("Twaps"))&&(kt==null?void 0:kt.is_twap)===!0,on=(kt==null?void 0:kt.fill_direction_type)&&((Zn=xt==null?void 0:xt.typeFeed)==null?void 0:Zn.includes(kt==null?void 0:kt.fill_direction_type));if(!(wn||on))return!1}if(((zn=xt==null?void 0:xt.positionFeed)==null?void 0:zn.length)>0){const nr=Pt(kt);if(!(($n=xt==null?void 0:xt.positionFeed)!=null&&$n.includes(nr)))return!1}else return!0;return!(xt!=null&&xt.directionFeed&&dn(kt)!==(xt==null?void 0:xt.directionFeed))})})}),qe.io.on("reconnect_attempt",Ke=>{console.log("reconnect_attempt",Ke)}),qe.io.on("reconnect",Ke=>{console.log("reconnect",Ke),qe.emit("room",mn)}),qe.io.on("reconnect_failed",()=>{console.log("reconnect_failed")}),qe.io.on("reconnect_error",Ke=>{console.log("reconnect_error",Ke)}),qe.io.on("error",Ke=>{console.log("error",Ke)}),qe.on("disconnect",()=>{console.log("Socket disconnected"),Vt.current=!1}),()=>{qe.disconnect(),console.log("Socket cleanup on unmount")}},[s]);const dn=qe=>qe!=null&&qe.dir?["Sell","Close Short","Open Short"].includes(qe==null?void 0:qe.dir)?"Short":["Buy","Close Long","Open Long"].includes(qe==null?void 0:qe.dir)?"Long":(qe==null?void 0:qe.dir)||"--":"--",Pt=qe=>{var en,Bt;const Ke=(Bt=(en=qe.message)==null?void 0:en.split("-")[0])==null?void 0:Bt.trim();if(!Ke)return"Other";const pt=/^Position Changed \(/;return Ke==="Close Position"?"Position Closed":Ke==="Position Increase"?"Increase":Ke==="Position Decreased"?"Decrease":pt.test(Ke)?"Changed Position":Ke==="Open Position"?"Open Position":"Other"};function Xe({date:qe}){const[Ke,pt]=m.useState(Oo(qe));return m.useEffect(()=>{const en=setInterval(()=>{pt(Oo(qe))},1e3);return()=>clearInterval(en)},[qe]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:Ke.dateTime})}const Ut={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"lg:hidden flex flex-col w-full p-2",children:i.jsx("button",{className:"px-2 py-2 text-xs font-medium rounded border border-gray-600 text-white hover:bg-[#1D1D1D] w-full bg-[#171717]",onClick:()=>ye(!Ae),children:Ae?"Hide Filters":"Show Filters"})}),i.jsx("div",{className:`${Ae?"block":"hidden"} lg:block mx-auto`,children:i.jsx(Gin,{advancedFilters:je,setAdvancedFilters:Ie,getFeedData:Qe,getFeedClearData:it,dataCoin:I,selectedCoins:U,setSelectedCoins:L,isLoadingCoin:R,setIsLoadingCoin:F,walletTagData:X,walletTags:pe,searchWalletSellect:G,setSearchWalletSellect:V,walletTagLoading:ie,tradeWalletData:z,selectTradeWalletData:ne,setSelectTradeWalletData:J,searchTagSellect:te,setSearchTagSellect:ae,isWalletLoading:l})}),i.jsx(Jin,{feedData:u}),i.jsx("div",{ref:f,className:"hidden lg:flex flex-col items-start justify-start mt-4 overflow-scroll xl:min-w-max max-h-[calc(100%-50px)]",children:!u||(u==null?void 0:u.length)==0||a?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[72vh] w-[100%] sm:w-[75%] min-w-[970px] justify-center items-center text-center",children:a?i.jsx(Da,{}):i.jsx("div",{className:"flex justify-center items-center min-w-[480px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 min-w-max overflow-x-hidden",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"The activities of the follower wallets will be displayed on this page."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Feed page includes the activities occur after a wallet is favorited."," "]})})]})]})})})}):i.jsx("ul",{className:"flex flex-col items-start justify-start gap-1",children:Array.isArray(u)&&u.length>0&&((Lt=u==null?void 0:u.map)==null?void 0:Lt.call(u,(qe,Ke)=>{var pt,en,Bt,Et,et,Be,Mt,Ve,ut,xt,jt,kt,xn,un,On,En;return i.jsx("li",{children:i.jsxs("div",{className:"flex justify-start items-start gap-[11px]",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start h-full",children:[i.jsx("div",{className:`${(pt=qe==null?void 0:qe.dir)!=null&&pt.includes("Long")?(qe==null?void 0:qe.dir)==="Short > Long"?"bg-[#67ffbd]/20":(qe==null?void 0:qe.dir)==="Long > Short"?"bg-[#ff797c]/20":"bg-[#67ffbd]/20":(qe==null?void 0:qe.dir)=="Buy"?"bg-[#67ffbd]/20":"bg-[#ff797c]/20"} flex justify-center items-center w-6 h-6 rounded-full`,children:i.jsx("div",{className:"w-3 h-3 relative",children:(en=qe==null?void 0:qe.dir)!=null&&en.includes("Long")?(qe==null?void 0:qe.dir)==="Short > Long"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(qe==null?void 0:qe.dir)==="Long > Short"?i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(qe==null?void 0:qe.dir)=="Buy"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:"flex justify-center w-6",children:i.jsx("div",{className:"w-[1px] min-h-[163px] h-full border border-[#242424]"})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[6px] w-full min-w-max h-[176px] min-h-[176px] rounded-[18px] border border-[#232323]",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full px-3 py-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full relative",children:i.jsx("img",{src:qi,alt:"",className:"w-8 h-8"})}),(qe==null?void 0:qe.target_platform)==="hyper"?i.jsxs("div",{className:"flex justify-start items-center gap-2 min-w-max",children:[i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}),i.jsx("span",{className:"text-white text-[13px] font-normal font-['Manrope'] leading-[13px] tracking-tight",children:"Hyperliquid"})]}):(qe==null?void 0:qe.target_platform)==="lighter"?i.jsxs("div",{className:"flex justify-start items-center gap-2 min-w-max",children:[i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}),i.jsx("span",{className:"text-white text-[13px] font-normal font-['Manrope'] leading-[13px] tracking-tight",children:"Lighter"})]}):""]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px]",children:[i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${qe==null?void 0:qe.listen_user}`,"_blank")},className:"flex justify-start items-center gap-1.5 cursor-pointer",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-none ",children:(qe==null?void 0:qe.listen_user)&&((Bt=qe==null?void 0:qe.listen_user)==null?void 0:Bt.slice(0,5))+"..."+((Et=qe==null?void 0:qe.listen_user)==null?void 0:Et.slice(-4))}),i.jsx("img",{onClick:jn=>{jn.stopPropagation(),navigator.clipboard.writeText(qe==null?void 0:qe.listen_user),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:[i.jsxs("span",{className:"text-white text-[11px] font-normal font-['Manrope'] leading-[13px] tracking-tight min-w-max ml-[1px]",children:["Order ID:"," ",i.jsx("span",{className:"text-[#a5a5a5]",children:(qe==null?void 0:qe.oid)&&(qe==null?void 0:qe.oid)})]}),i.jsx("span",{onClick:jn=>{jn.stopPropagation(),navigator.clipboard.writeText(qe==null?void 0:qe.oid),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"cursor-pointer pr-0.5",children:i.jsx("img",{src:wo,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})]})]})]}),i.jsxs("div",{className:"flex flex-col items-end justify-start gap-[2px] w-full pl-2 pt-2 relative",children:[i.jsx("div",{onClick:()=>{ge(ce=="time"?"date":"time")},className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight cursor-pointer",children:ce=="time"?i.jsx(Xe,{date:qe==null?void 0:qe.time}):su(qe==null?void 0:qe.time)}),i.jsxs("div",{className:"flex justify-start items-center gap-2 -m-[2px]",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"text-[#9b9b9b] text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:["opened a new"," ",(qe==null?void 0:qe.dir)=="Sell"?"spot sell":(qe==null?void 0:qe.dir)=="Buy"?"spot buy":(et=qe==null?void 0:qe.dir)==null?void 0:et.toLowerCase()," ","position for"," "]}),i.jsxs("span",{className:"pl-1 text-white text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:[qe==null?void 0:qe.coin,"/",(qe==null?void 0:qe.feeToken)==null?"USDC":qe==null?void 0:qe.feeToken]})]}),i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Ut[qe==null?void 0:qe.coin]||((Be=qe==null?void 0:qe.coin)==null?void 0:Be.split("/")[0])}.svg`||Va,alt:qe==null?void 0:qe.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:jn=>ra(jn)})})]})]})]}),i.jsx("div",{className:"px-2",children:i.jsx("div",{className:"w-full min-w-auto min-w-[920px] h-[72px] min-h-[72px] bg-[#232323] rounded-xl border border-[#353535] pt-4 pl-4",children:i.jsxs("div",{className:"flex justify-start items-center gap-4 overflow-x-scroll scroll-smooth",children:[i.jsxs("div",{className:"sticky left-0 z-[8] bg-[#232323] flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Asset"}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Ut[qe==null?void 0:qe.coin]||((Mt=qe==null?void 0:qe.coin)==null?void 0:Mt.split("/")[0])}.svg`||Va,alt:qe==null?void 0:qe.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:jn=>ra(jn)})}),i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[qe==null?void 0:qe.coin,"/",(qe==null?void 0:qe.feeToken)==null?"USDC":qe==null?void 0:qe.feeToken]})]})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Direction"}),i.jsx("div",{className:"flex justify-start items-center",children:i.jsxs("div",{className:`${(Ve=qe==null?void 0:qe.dir)!=null&&Ve.includes("Long")?(qe==null?void 0:qe.dir)==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":(qe==null?void 0:qe.dir)==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":(qe==null?void 0:qe.dir)=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex min-w-max`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:(ut=qe==null?void 0:qe.dir)!=null&&ut.includes("Long")?(qe==null?void 0:qe.dir)==="Short > Long"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(qe==null?void 0:qe.dir)==="Long > Short"?i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(qe==null?void 0:qe.dir)=="Buy"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:[(qe==null?void 0:qe.dir)=="Sell"?"Sell":(qe==null?void 0:qe.dir)=="Buy"?"Buy":(qe==null?void 0:qe.dir)=="Close Short"?"Short":(qe==null?void 0:qe.dir)=="Close Long"?"Long":(qe==null?void 0:qe.dir)=="Open Short"?"Short":(qe==null?void 0:qe.dir)=="Open Long"?"Long":qe!=null&&qe.dir?qe==null?void 0:qe.dir:"--",qe!=null&&qe.leverage?" - "+(qe==null?void 0:qe.leverage)+"x":""]})]})})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(dv,{title:"Type",value:qe!=null&&qe.fill_direction_type?qe!=null&&qe.is_twap?`${qe==null?void 0:qe.fill_direction_type} - Twap`:qe==null?void 0:qe.fill_direction_type:"--",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(dv,{title:"Price",value:Cr(qe==null?void 0:qe.px),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(dv,{title:"Size",value:Cr(qe==null?void 0:qe.sz),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(dv,{title:"Entry Price",value:qe!=null&&qe.markPrice?`$${Cr(qe==null?void 0:qe.markPrice)}`:Cr(qe==null?void 0:qe.markPrice),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(dv,{title:"PnL",value:qe!=null&&qe.closedPnl?`$${Cr(Math.abs(qe==null?void 0:qe.closedPnl))}`:Cr(Math.abs(qe==null?void 0:qe.closedPnl)),color:`${(qe==null?void 0:qe.closedPnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"}`}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(dv,{title:"Fee",value:qe!=null&&qe.fee?`$${Cr(Math.abs(qe==null?void 0:qe.fee))}`:Cr(Math.abs(qe==null?void 0:qe.fee)),color:"text-[#ff787b]"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(dv,{title:"Margin Mode",value:(qe==null?void 0:qe.is_cross)==null||qe!=null&&qe.is_cross?"Cross":"Isolated",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-transparent"})]})]})})}),i.jsx("div",{className:`${qe!=null&&qe.success?"bg-[#67ffbd]/20 border-[#67ffbd]/25":"bg-[#ff797c]/20 border-[#ff797c]/25"} flex justify-start items-center h-8 max-h-8 rounded-bl-[18px] rounded-br-[18px] border-t w-full py-1.5`,children:i.jsxs("div",{className:"text-white text-sm font-manrope leading-none flex justify-start items-center px-2 gap-2",children:[qe!=null&&qe.success?i.jsx("img",{src:hM,alt:""}):i.jsx("img",{src:pM,alt:""}),i.jsx("div",{className:`${qe!=null&&qe.success?"text-[#67ffbd]":"text-[#ff787b]"} text-xs font-semibold font-manrope leading-3 tracking-tight`,children:qe!=null&&qe.success?"Status:":"System Message:"}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-1",children:[qe!=null&&qe.message&&((xt=qe==null?void 0:qe.message)==null?void 0:xt.length)>100?`${(jt=qe==null?void 0:qe.message)==null?void 0:jt.slice(0,100)}...`:qe==null?void 0:qe.message," ","on"]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${qe==null?void 0:qe.trader_wallet}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-white rounded-[256px] justify-center items-center gap-0.5 inline-flex cursor-pointer -ml-0.5",children:i.jsx("div",{className:"text-[#273f35] text-xs font-semibold font-manrope leading-[13px]",children:qe!=null&&qe.wallet_name?qe==null?void 0:qe.wallet_name:qe!=null&&qe.trader_wallet?((kt=qe==null?void 0:qe.trader_wallet)==null?void 0:kt.slice(0,5))+"..."+((xn=qe==null?void 0:qe.trader_wallet)==null?void 0:xn.slice(-4)):"--"})}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-0.5",children:["by"," "]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${qe==null?void 0:qe.listen_user}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-[#a5ffd8] rounded-[256px] justify-center items-center gap-0.5 inline-flex -ml-0.5 cursor-pointer",children:i.jsx("div",{className:"text-[#1e563e] text-xs font-semibold font-manrope leading-[13px]",children:qe!=null&&qe.tag?qe==null?void 0:qe.tag:qe!=null&&qe.listen_user?((un=qe==null?void 0:qe.listen_user)==null?void 0:un.slice(0,5))+"..."+((On=qe==null?void 0:qe.listen_user)==null?void 0:On.slice(-4)):"--"})}),(qe==null?void 0:qe.message)&&((En=qe==null?void 0:qe.message)==null?void 0:En.trim())=="Reverse Direction detected: Action skipped."&&i.jsx("a",{href:"https://docs.dextrabot.com/copy-trade/copytrade/reverse-direction",target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-lg shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-center items-center gap-2.5 cursor-pointer bg-white",children:i.jsx("div",{className:"text-[#1b1b1b] text-[11px] font-medium font-['Inter'] leading-[8px]",children:"Read Details"})})]})})]})]})},Ke)}))})})]})},dv=({title:e,value:t,color:n})=>i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1 min-w-max",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide min-w-max",children:e}),i.jsx("div",{className:"flex justify-start items-center min-w-max",children:i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-[13px] tracking-tight min-w-max`,children:t})})]}),tan=({isMenu:e,setIsMenu:t,handleMenuChange:n})=>{const{trackedWatchList:r,getTrackedWatchList:s,copyTradeWatchList:a,getCopyTradeWatchList:o}=m.useContext(Qr);return m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(s(),o())},[e]),i.jsx("div",{className:"flex flex-col items-start gap-4 justify-start text-white w-full h-full font-manrope",children:i.jsxs("div",{className:"flex flex-col items-start justify-start w-full gap-[17px] bg-[#161616] max-w-full font-manrope h-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px] min-w-max",children:"My Activities"})})]}),i.jsxs("div",{className:"flex justify-center sm:justify-between items-center gap-2 flex-wrap sm:flex-nowrap max-h-max w-full sm:pr-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(ECe,{title:"My Activities",isMenu:e,setIsMenu:t,handleMenuChange:n,lengthInfo:a?a.length:0}),i.jsx(ECe,{title:"Tracked Wallets",isMenu:e,setIsMenu:t,handleMenuChange:n,lengthInfo:r?r.length:0})]}),i.jsx("div",{className:"flex justify-center w-full sm:justify-end",children:i.jsx(Win,{isMenu:e})})]}),i.jsx("div",{className:"flex items-start justify-start gap-2 w-full lg:w-auto lg:min-w-[860px] lg:max-w-max h-full",children:e==="Tracked Wallets"?i.jsxs("div",{className:"w-full",children:[i.jsx("div",{className:"hidden lg:block",children:i.jsx(Bin,{})}),i.jsx("div",{className:"block lg:hidden",children:i.jsx(Uin,{})})]}):e==="My Activities"?i.jsx("div",{className:"flex flex-col lg:flex-row items-start justify-start gap-2 w-full lg:min-w-[900px] lg:max-w-max h-full",children:i.jsx(ean,{})}):i.jsx("div",{className:"flex items-start justify-start gap-2 w-full min-w-[860px] max-w-[1180px] h-full",children:"An unexpected error occurred."})})]})})},ECe=({title:e,lengthInfo:t,isMenu:n,setIsMenu:r,handleMenuChange:s})=>i.jsxs("div",{onClick:()=>s(e),className:`${n===e?"bg-white text-[#161616]":"bg-[#1b1b1b] text-[#9b9b9b]"} h-8 px-3 py-2 rounded-[256px] justify-center items-center gap-2 inline-flex cursor-pointer`,children:[i.jsx("div",{className:"text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:e}),i.jsx("div",{className:`${n===e?"text-white bg-[#ff5a5a]":"text-[#9b9b9b] bg-[#282828]"} p-1 rounded-md justify-center items-center gap-0.5 flex`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide min-w-max",children:t})})]}),nan=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,isReferralCode:a,setIsReferralCode:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u,setSignModalOpen:d}=m.useContext(Qr),f=Mc(),[x,g]=m.useState(null);m.useEffect(()=>{const w=f.hash;w==="#tracked-wallets"?g("Tracked Wallets"):(w==="#my-activities"||window.history.replaceState(null,"",`${window.location.pathname}#my-activities`),g("My Activities"))},[f.hash]);const v=w=>{g(w),w==="Tracked Wallets"?window.history.replaceState(null,"",`${window.location.pathname}#tracked-wallets`):w==="My Activities"&&window.history.replaceState(null,"",`${window.location.pathname}#my-activities`)};return m.useEffect(()=>{(async()=>{var I,P;const C=window.localStorage.getItem("hyperToken"),N=window.localStorage.getItem("hyperAddress");if(!(!C||!N))try{const R=await ji(N.toLowerCase(),C);R!=null&&R.success?(e(R==null?void 0:R.telegram_chat_id),t(R==null?void 0:R.subscriber_role),n(R==null?void 0:R.subs_expire_day),r((I=R==null?void 0:R.mushboomer_counts)==null?void 0:I.eth),s((P=R==null?void 0:R.mushboomer_counts)==null?void 0:P.sol),o(R==null?void 0:R.referral_code),l(R==null?void 0:R.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(R){console.error("Token verification error:",R),console.error(R.message||"An unknown error occurred.")}})()},[]),x?i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Live Transaction Feed for Your Favorite Hyperliquid Wallets - Dextrabot"}),i.jsx("meta",{name:"description",content:"Stay updated with live transactions from your favorite HyperLiquid wallets. Monitor trades in real time and react instantly with DextraBot’s transaction feed."}),i.jsx("meta",{name:"og:title",content:"Live Transaction Feed for Your Favorite Hyperliquid Wallets - Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Stay updated with live transactions from your favorite HyperLiquid wallets. Monitor trades in real time and react instantly with DextraBot’s transaction feed."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/my-activities"})]})}),i.jsx("div",{className:"flex justify-center items-center w-full h-screen min-h-max px-4 pt-4 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full xl:w-max flex-grow xl:flex-grow-0",children:i.jsx(tan,{isMenu:x,setIsMenu:g,handleMenuChange:v})})})]}):null},ran=({open:e,setOpen:t,handleEnterCode:n,inputValue:r,isEnterLoading:s})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-6 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2",children:[i.jsx("div",{className:"text-center text-white text-[24px] font-manrope leading-none",children:"Join now"}),i.jsx("div",{className:"w-[300px] text-center text-white/60 text-sm font-medium font-manrope leading-[18px] tracking-[0.28px] pt-4 pb-2 px-2",children:"Using a referral code will give you a 4% discount on your fees."})]}),i.jsxs("div",{role:"status",className:`${s?"":"hidden"} flex justify-center items-center w-full max-h-8`,children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),i.jsx("div",{onClick:a=>{a.preventDefault(),s||n()},className:`${s?"cursor-not-allowed":"cursor-pointer"} w-[286px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex`,children:i.jsxs("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:["Join with code: ",r]})})]})})})})})]}),san=({handleEnterCode:e,handleChange:t,error:n,handleGenerateCode:r,handleGenerateChange:s,generateError:a,generateData:o,userReferansCode:l,setInputValue:c,inputValue:u,setGenerateValue:d,generateValue:f,setIsMenu:x,isMenu:g,setGenerateCode:v,generateCode:w,setIsGenerateLoading:C,isGenerateLoading:N,setIsEnterLoading:I,isEnterLoading:P,divRef:R,isEnterModal:F,setIsEnterModal:U})=>{const{mushboomerETH:L,mushboomerSOL:z,isReferralCode:Q,isWhitelist:ne}=m.useContext(Qr),J=w?`https://app.dextrabot.com/referral/${w}`:"";return i.jsxs(i.Fragment,{children:[!l&&i.jsx(ran,{open:F,setOpen:U,handleEnterCode:e,inputValue:u,isEnterLoading:P}),i.jsxs("div",{ref:R,className:"flex flex-col justify-start items-start gap-[30px] h-max relative bg-[#232323] rounded-2xl overflow-hidden pt-[18px] px-[18px] w-max mx-auto lg:mx-0",children:[i.jsx("div",{className:"text-white text-2xl font-semibold font-manrope leading-[8px]",children:"Referrals"}),i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsxs("div",{className:"flex justify-start items-center w-full gap-[8px] pt-[2px]",children:[i.jsx("div",{onClick:()=>x("Enter Code"),className:`${g=="Enter Code"?"text-white":"text-[#8b8b8b]"} w-[136px] h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer`,children:"Enter Code"}),i.jsx("div",{onClick:()=>x("Create Code"),className:`${g=="Create Code"?"text-white":"text-[#8b8b8b]"} w-[136px] h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer min-w-max`,children:"Create Code"})]}),i.jsxs("div",{className:"flex justify-start items-center w-full",children:[i.jsx("div",{className:`${g=="Enter Code"?"bg-white":"bg-[#8b8b8b]"} w-[143px] h-0.5 `}),i.jsx("div",{className:`${g=="Create Code"?"bg-white":"bg-[#8b8b8b]"} w-[143px] h-0.5 `})]})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-2 w-full",children:[i.jsxs("div",{className:`${l&&g=="Enter Code"||g=="Create Code"&&w||!(ne||L>0||z>0)||g=="Claim"?"hidden":""} flex justify-start items-center gap-[4px] has-tooltip relative`,children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:g=="Enter Code"?"Referral Code":"Set your Referral Code"}),i.jsx(Si,{className:"text-[#7C7C7C]"}),i.jsx("span",{className:`${g=="Enter Code"?"ml-44":"ml-32"}`,children:i.jsx(Fa,{content:"Valid characters: '_', '-', 0-9, A-Z, 4-10 length",positionTop:!0,alignRight:!1})})]}),g=="Enter Code"?i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:u,onChange:t,placeholder:"Code",className:`${u!=null&&u!=null&&u!=""?"border border-[#8d67ff]":""} ${l?"hidden":""} py-[4px] bg-[#1b1b1b] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-[286px] min-w-[286px] px-4 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[38px]`}),i.jsx("div",{className:`${!l&&n?"block":"hidden"} w-[286px] h-8 px-3 py-2 bg-[#3b2626] rounded-md justify-start items-center gap-2.5 inline-flex`,children:i.jsx("div",{className:"text-[#ff787b] text-xs font-semibold font-manrope leading-none",children:n&&n})}),P?i.jsxs("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:`${l?"block":"hidden"} w-[286px] h-8 px-3 py-2 rounded-md justify-start items-center gap-2.5 inline-flex mt-[40px] mb-[60px]`,children:i.jsxs("div",{className:"text-white text-base font-semibold font-manrope leading-[8px] flex flex-col items-center justify-center gap-[18px] w-full",children:[i.jsx("img",{src:Wbt,alt:""}),l&&`'${l}' has been applied.`]})}),i.jsx("div",{onClick:()=>{e()},className:`${l?"hidden":""} w-[286px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex mt-2 cursor-pointer`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Enter Code"})}),i.jsx("div",{className:`${l?"hidden":""} w-[286px] h-14 p-2.5 bg-[#ffd979]/20 rounded-md justify-start items-center gap-2.5 inline-flex`,children:i.jsx("div",{className:"w-[266px] text-[#ffd978] text-[13px] font-semibold font-manrope leading-none",children:"Using a referral code will give you a 4% discount on your fees"})})]}):g=="Claim"?i.jsx(i.Fragment,{children:i.jsx("div",{className:"flex justify-center items-cente w-[286px] mt-[54px] mb-[70px]",children:i.jsx("div",{className:"text-[#7c7c7c] text-[16px] font-semibold font-['Manrope'] leading-[8px] ",children:"Coming soon"})})}):ne||L>0||z>0?i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:f,onChange:s,placeholder:"Code",className:`${f!=null&&f!=null&&f!=""?"border border-[#8d67ff]":""} ${w?"hidden":""} py-[4px] bg-[#1b1b1b] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-[286px] min-w-[286px] px-4 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[38px]`,disabled:!!w}),i.jsx("div",{className:`${!w&&a?"block":"hidden"} w-[286px] h-8 px-3 py-2 bg-[#3b2626] rounded-md justify-start items-center gap-2.5 inline-flex`,children:i.jsx("div",{className:"text-[#ff787b] text-xs font-semibold font-manrope leading-none",children:a&&a})}),N?i.jsxs("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:`${w?"block":"hidden"} w-full h-8 px-3 py-2 rounded-md justify-start items-center gap-2.5 inline-flex mt-[40px] mb-[60px]`,children:i.jsxs("div",{className:"text-white text-base font-semibold font-manrope leading-[8px] flex flex-col items-center justify-center gap-[18px] w-full",children:[i.jsx("img",{src:qbt,alt:""}),w&&`'${w}' created successfully!`]})}),i.jsx("div",{onClick:()=>{r()},className:`${w?"hidden":""} w-[286px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex mt-2 cursor-pointer`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Create Code"})})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center w-[286px] gap-4 px-4 text-white",children:[i.jsx("span",{className:"text-center mb-5 font-bold underline",children:"You need to have at least 1 Mushboomer ETH or 1 Mushboomer SOL, or have entered a referral code to be able to copy trade."}),i.jsx("div",{onClick:()=>{window.open("https://blur.io/collection/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Eth"})}),i.jsx("div",{onClick:()=>{window.open("https://www.tensor.trade/trade/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Sol"})}),i.jsx("div",{onClick:()=>{x("Enter Code")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Referral Code"})})]})]}),i.jsx("div",{className:`${w&&g=="Create Code"||l&&g=="Enter Code"||g=="Claim"?"hidden":"block"} w-[286px] h-px bg-[#3e3e3e] -mt-[14px]`}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[25px] -mt-[14px] bg-[#393939] -mx-[18px] px-4 py-4 h-full w-[328px] border-t border-dashed border-neutral-500",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[10px]",children:[i.jsx("div",{className:"text-[#cfcfcf] text-[13px] font-semibold font-manrope leading-[8px]",children:"Your Referral Code"}),i.jsxs("div",{onClick:X=>{X.preventDefault(),w&&(navigator.clipboard.writeText(w||""),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}))},className:`${w?"cursor-pointer":"cursor-not-allowed"} flex justify-start items-center gap-1.5`,children:[i.jsx("img",{src:fM,alt:"",className:"text-white w-[18px] h-[18px]"}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[21px]",children:w||"You haven't created a referral code yet"})]})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[10px]",children:[i.jsx("div",{className:"text-[#cfcfcf] text-[13px] font-semibold font-manrope leading-[8px]",children:"Your Referral URL"}),i.jsxs("div",{onClick:X=>{X.preventDefault(),(w||o)&&(navigator.clipboard.writeText(w?`https://app.dextrabot.com/referral/${w}`:o&&o),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}))},className:`${w||o?"cursor-pointer":"cursor-not-allowed"} flex justify-start items-center gap-1.5`,children:[i.jsx("img",{src:fM,alt:"",className:"text-white w-[18px] h-[18px]"}),i.jsx("div",{className:`${w||o?"underline":"no-underline"} text-[#82ffc8] text-sm font-medium font-manrope leading-[21px]`,children:w?J.slice(0,36)+"...":o?o.slice(0,30)+"...":i.jsx("span",{className:"text-white",children:"-"})})]})]})]})]})]})},cC=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s})=>{const a=()=>{r(n===t?`-${t}`:t)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>a(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope`,children:[i.jsx("div",{className:`${n.includes(t)?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(cU,{sortKey:t,state:n,className:""})]})})};function ian({open:e,setOpen:t}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:eae,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2",children:[i.jsx("div",{className:"text-center text-white text-[24px] font-manrope leading-none",children:"Your claim is being processed"}),i.jsx("div",{className:"w-[300px] text-center text-white/60 text-sm font-medium font-manrope leading-[18px] tracking-[0.28px] pt-4 pb-8 px-2",children:"Referral Claim process may take 24h to verify and complete your transaction. If anything goes wrong after 24h, you can open a ticket on discord."})]})]})})})})})]})}const aan=({data:e,dataLoading:t,dataError:n,height:r,handleRefTable:s,dataUsage:a,dataUsageLoading:o,dataUsageError:l,setIsOnTableTab:c,isOnTableTab:u})=>{var pe,Y,ie,oe;const{isConnected:d,address:f}=Jr(),{setSignModalOpen:x,hyperToken:g}=m.useContext(Qr),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState(!1),R=m.useMemo(()=>{var V;const G=new Map;return(V=e==null?void 0:e.claim_lists)==null||V.forEach(te=>{var he;const ae=((he=te==null?void 0:te.subscriber_address)==null?void 0:he.toLowerCase())||"";if(!G.has(ae))G.set(ae,{...te,total_ref_claimable:parseFloat(te==null?void 0:te.total_ref_claimable)||0});else{const Ce=G.get(ae);G.set(ae,{...Ce,total_ref_claimable:(Ce==null?void 0:Ce.total_ref_claimable)+(parseFloat(te==null?void 0:te.total_ref_claimable)||0)})}}),Array.from(G.values())},[e]),F="-total_ref_claimable",[U,L]=m.useState(F),z=G=>R==null?void 0:R.sort((V,te)=>{const ae=V.subscriber_address?V.subscriber_address.toLowerCase():"",he=te.subscriber_address?te.subscriber_address.toLowerCase():"";return G==="-level"?te.level-V.level:G==="level"?V.level-te.level:G==="-subscriber_address"?ae<he?-1:ae>he?1:0:G==="subscriber_address"?ae>he?-1:ae<he?1:0:G==="-total_ref_claimable"?te.total_ref_claimable-V.total_ref_claimable:G==="total_ref_claimable"?V.total_ref_claimable-te.total_ref_claimable:G==="-last_active_date"?new Date(te.last_active_date)-new Date(V.last_active_date):G==="last_active_date"?new Date(V.last_active_date)-new Date(te.last_active_date):0}),Q="-created_at",[ne,J]=m.useState(Q),X=G=>{var V;return(V=a.claim_lists)==null?void 0:V.sort((te,ae)=>{const he=te.address?te.address.toLowerCase():"",Ce=ae.address?ae.address.toLowerCase():"";return G==="-level"?ae.level-te.level:G==="level"?te.level-ae.level:G==="-address"?he<Ce?-1:he>Ce?1:0:G==="address"?he>Ce?-1:he<Ce?1:0:G==="-created_at"?new Date(ae.created_at)-new Date(te.created_at):G==="created_at"?new Date(te.created_at)-new Date(ae.created_at):0})},re=async()=>{try{w(!0);const G=window.localStorage.getItem("hyperToken"),V="https://dextrabothypev2.nftinit.io/api/subscriber/claim/request/";if(!G){x(!0),w(!1);return}const te=window.localStorage.getItem("hyperAddress"),he=await(await fetch(V,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():te,token:G})})).json();he.success?(s(),P(!0)):(console.log(he.error_message),N(he.error_message),ln.error(he.error_message))}catch(G){console.error("Error in like function:",G),N(G.message||"An unknown error occurred.")}finally{w(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(ian,{open:I,setOpen:P}),i.jsxs("div",{style:r==0?{maxHeight:"450px"}:{maxHeight:r},className:"flex flex-col justify-start items-start text-white font-manrope rounded-2xl h-auto sm:h-full w-full lg:w-max overflow-auto gap-3",children:[i.jsx("div",{className:"flex justify-between items-center w-full px-6 bg-[#232323] p-4 roundend-[16px]",children:i.jsxs("div",{className:"flex flex-col items-start justify-end gap-2",children:[i.jsxs("div",{className:"flex justify-start items-start gap-2",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Total Earnings"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.total_claim_fee?`$${Cr(e==null?void 0:e.total_claim_fee)}`:"--"})]}),i.jsx("div",{className:"w-px h-10 bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Claimed"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.total_claimed_fee?`$${Cr(e==null?void 0:e.total_claimed_fee)}`:"--"})]}),i.jsx("div",{className:"w-px h-10 bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Pending Earnings"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.unexpired_fee?`$${Cr(e==null?void 0:e.unexpired_fee)}`:"--"})]}),i.jsx("div",{className:"w-px h-10 bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Available to Claim"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.total_claimable_fee?`$${Cr(e==null?void 0:e.total_claimable_fee)}`:"--"})]}),i.jsx("div",{onClick:G=>{G.preventDefault(),g?v||((e==null?void 0:e.total_claimable_fee)<50?ln.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Minimum claim limit is"}),i.jsx("span",{style:{color:"#ffffff",paddingLeft:"5px"},children:"$50."})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}):(e==null?void 0:e.total_claimable_fee)>=50&&re()):x(!0)},className:`${v?"cursor-not-allowed":"cursor-pointer"} claim-button-claim-button flex justify-center items-center px-4 rounded-md font-inter font-semibold text-[13px] not-italic h-8 leading-[8px] text-white min-w-[80px] ml-4`,children:v?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[40px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",class:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{class:"sr-only",children:"Loading..."})]}):i.jsx("span",{className:"min-w-max",children:"Claim"})})]}),i.jsxs("div",{className:"flex justify-between items-center w-full h-full gap-1.5",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsxs("div",{className:"flex justify-start items-center w-full gap-[8px]",children:[i.jsx("div",{onClick:()=>c("Earnings"),className:`${u=="Earnings"?"text-white":"text-[#8b8b8b]"} w-[116px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer`,children:"Earnings"}),i.jsx("div",{onClick:()=>c("Referrals"),className:`${u=="Referrals"?"text-white":"text-[#8b8b8b]"} w-[116px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer min-w-max`,children:"Referrals"})]}),i.jsxs("div",{className:"flex justify-start items-center w-full pt-1.5",children:[i.jsx("div",{className:`${u=="Earnings"?"bg-white":"bg-[#8b8b8b]"} w-[123px] h-0.5 `}),i.jsx("div",{className:`${u=="Referrals"?"bg-white":"bg-[#8b8b8b]"} w-[123px] h-0.5 `})]})]}),i.jsx("div",{className:"text-[#aaaaaa] text-xs font-semibold font-manrope leading-none max-w-max mr-2",children:"• Minimum Withdrawal Amount: $50"})]})]})}),i.jsx("div",{className:"w-full min-w-[600px] max-w-[790px] h-full overflow-x-scroll relative overflow-y-scroll flex-grow bg-[#242424]",children:u=="Earnings"?i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#242424] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sticky left-0 h-8 pl-6 min-w-[150px] sm:min-w-[170px] z-[8] bg-[#242424] rounded-tl-2xl",children:i.jsx(cC,{title:"Referred Wallet",sortKey:"subscriber_address",sortOption:U,setSortOption:L,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 px-1 min-w-[100px] sm:min-w-[120px]",children:i.jsx(cC,{title:"Level",sortKey:"level",sortOption:U,setSortOption:L,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 min-w-[110px] sm:min-w-[110px] rounded-tr-2xl pl-1 pr-4",children:i.jsx(cC,{title:"Earnings",sortKey:"total_ref_claimable",sortOption:U,setSortOption:L,isFilterIcon:!1})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[45%] w-max",children:i.jsx(Da,{})})})}):n&&!(e!=null&&e.claim_lists)?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[27%] w-max",children:i.jsx(zl,{})})})}):(e==null?void 0:e.length)==0||((pe=e==null?void 0:e.claim_lists)==null?void 0:pe.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[30%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No referral earnings yet."}),i.jsxs("div",{className:"flex flex-col items-center justify-start text-center -mt-1",children:[i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Share your referral link and watch your earnings appear"}),i.jsx("br",{}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide -mt-5",children:[" ","here as users start trading."]})]})]})]})})})})}):(Y=z(U))==null?void 0:Y.map((G,V)=>i.jsxs("tr",{className:`${V%2===0,"bg-[#242424]"} relative group hover:bg-[#353535] h-[32px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${V%2==0,"bg-[#242424]"} sticky left-0 z-[2] group-hover:bg-[#353535]`,children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 pl-4 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(aa,{info1:`${(G==null?void 0:G.subscriber_address).slice(0,5)+"..."+(G==null?void 0:G.subscriber_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:"group-hover:bg-[#353535]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] px-1",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-white text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.level?`L${G==null?void 0:G.level}`:"--"})})})}),i.jsx("td",{children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] pl-1 pr-4",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-[#1ce6a2] text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.total_ref_claimable?`$${Cr(G==null?void 0:G.total_ref_claimable)}`:"--"})})})]},V))})]}):i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#242424] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sticky left-0 h-8 pl-6 min-w-[150px] sm:min-w-[170px] z-[8] bg-[#242424] rounded-tl-2xl",children:i.jsx(cC,{title:"Referred Wallet",sortKey:"address",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 px-1 min-w-[100px] sm:min-w-[120px]",children:i.jsx(cC,{title:"Level",sortKey:"level",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 min-w-[110px] sm:min-w-[110px] rounded-tr-2xl pl-1 pr-4",children:i.jsx(cC,{title:"Join Date",sortKey:"created_at",sortOption:ne,setSortOption:J,isFilterIcon:!1})})]})}),i.jsx("tbody",{children:!a||o?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[45%] w-max",children:i.jsx(Da,{})})})}):l&&!(a!=null&&a.claim_lists)?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[27%] w-max",children:i.jsx(zl,{})})})}):(a==null?void 0:a.length)==0||((ie=a==null?void 0:a.claim_lists)==null?void 0:ie.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[30%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No referral yet."}),i.jsxs("div",{className:"flex flex-col items-center justify-start text-center -mt-1",children:[i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Share your referral link and watch your referrals appear"}),i.jsx("br",{}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide -mt-5",children:[" ","here as users start trading."]})]})]})]})})})})}):(oe=X(ne))==null?void 0:oe.map((G,V)=>i.jsxs("tr",{className:`${V%2===0,"bg-[#242424]"} relative group hover:bg-[#353535] h-[32px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${V%2==0,"bg-[#242424]"} sticky left-0 z-[2] group-hover:bg-[#353535]`,children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 pl-4 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(aa,{info1:`${(G==null?void 0:G.address).slice(0,5)+"..."+(G==null?void 0:G.address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:"group-hover:bg-[#353535]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] px-1",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-white text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.level?`L${G==null?void 0:G.level}`:"--"})})})}),i.jsx("td",{children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] pl-1 pr-4",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-white text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.created_at?Klt(G==null?void 0:G.created_at):"--"})})})]},V))})]})})]})]})},oan=({open:e,setOpen:t})=>i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:ike,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4",children:[i.jsx("div",{className:"text-center text-white text-sm font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Trial activated!"}),i.jsx("div",{className:"w-[200px] text-center text-white text-[13px] font-normal font-['Inter'] leading-4",children:"Enjoy your 2-day premium trial."}),i.jsx("div",{className:"flex flex-col items-center gap-6 mt-[33px]",children:i.jsx("div",{onClick:()=>{window.open("https://app.dextrabot.com/referral#lighter-farming","_blank")},className:"w-[345px] h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 cursor-pointer",children:i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none",children:"Try Lighter Farming"})})})]})]})})})})})]}),lan=()=>{const{isConnected:e,address:t}=Jr(),{setSignModalOpen:n,hyperToken:r,setTelegramChatId:s,setSubscriberRole:a,setSubsExpireDay:o,setMushboomerETH:l,setMushboomerSOL:c,setIsReferralCode:u,setIsReferralCodeName:d,setIsWhitelist:f,setHyperToken:x,setHyperAddress:g}=m.useContext(Qr),[v,w]=m.useState("Enter Code"),[C,N]=m.useState("Earnings"),I=e5(),P=(I==null?void 0:I.code)||"",[R,F]=m.useState(""),[U,L]=m.useState(""),[z,Q]=m.useState(null),[ne,J]=m.useState(""),[X,re]=m.useState(""),[pe,Y]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState(!1),[te,ae]=m.useState(!1),[he,Ce]=m.useState([]),[ce,ge]=m.useState(!1),[Ae,ye]=m.useState(!1),[je,Ie]=m.useState(!1),[Re,Qe]=m.useState([]),[$e,it]=m.useState(!1),[tt,ot]=m.useState(!1),[ft,ct]=m.useState(!1),Vt=m.useRef(null),[It,an]=m.useState(0);m.useEffect(()=>{P&&(F(P),Ie(!0))},[P]);const Nt=pt=>{let en=pt.target.value.toUpperCase();/^[0-9A-Z_-]{0,10}$/.test(en)&&(F(en),L(""))},mn=pt=>{let en=pt.target.value.toUpperCase();/^[0-9A-Z_-]{0,10}$/.test(en)&&(J(en),re(""))},dn=async()=>{var pt,en;try{const Bt=window.localStorage.getItem("hyperToken"),Et="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/info/";if(!Bt){n(!0);return}const et=window.localStorage.getItem("hyperAddress"),Mt=await(await fetch(Et,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():et,token:Bt})})).json();Mt.success?(Q((pt=Mt==null?void 0:Mt.data)==null?void 0:pt.referrer_code),oe((en=Mt==null?void 0:Mt.data)==null?void 0:en.my_refcode)):console.log(Mt.error_message)}catch(Bt){console.error("Error referans request:",Bt)}};m.useEffect(()=>{dn(),qe(),Ke()},[r]);const Pt=async pt=>{try{V(!0);const en=window.localStorage.getItem("hyperToken"),Bt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/set/";en||(n(!0),V(!1));const Et=window.localStorage.getItem("hyperAddress"),Be=await(await fetch(Bt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Et,token:en,refcode:pt})})).json();Be.success?(Q(pt),V(!1),Ie(!1),ln.success("Referral code add successfully",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"380px",minWidth:"380px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),Be!=null&&Be.trial_farming&&ct(!0)):(console.log(Be.error_message),L(Be.error_message),je&&ln.success(i.jsx(i.Fragment,{children:i.jsx("span",{children:Be.error_message})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"360px",minWidth:"360px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}),V(!1))}catch(en){console.error("Error in like function:",en),L(en.message),je&&ln.error(en.message),V(!1)}},Xe=async pt=>{try{ae(!0);const en=window.localStorage.getItem("hyperToken"),Bt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/generate/";en||(n(!0),ae(!1));const Et=window.localStorage.getItem("hyperAddress"),Be=await(await fetch(Bt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Et,token:en,refcode:pt})})).json();Be.success?(Y(`https://app.dextrabot.com/referral/${Be==null?void 0:Be.refcode}`),oe(Be==null?void 0:Be.refcode),ae(!1)):(console.log(Be.error_message),ae(!1),re(Be.error_message))}catch(en){console.error("Error in like function:",en),re(en.message),ae(!1)}},Ut=()=>{R.length<4?(L("You must enter at least 4 characters!"),je&&ln.error("This refcode is wrong")):(L(""),Pt(R))},Lt=()=>{ne.length<4?re(ie?"You have a generated code, you cannot generate it again.":"You must enter at least 4 characters!"):(re(""),Xe(ne))};m.useEffect(()=>{(async()=>{var Et,et;const en=window.localStorage.getItem("hyperToken"),Bt=window.localStorage.getItem("hyperAddress");if(!(!en||!Bt))try{const Be=await ji(Bt.toLowerCase(),en);Be!=null&&Be.success?(s(Be==null?void 0:Be.telegram_chat_id),a(Be==null?void 0:Be.subscriber_role),o(Be==null?void 0:Be.subs_expire_day),l((Et=Be==null?void 0:Be.mushboomer_counts)==null?void 0:Et.eth),c((et=Be==null?void 0:Be.mushboomer_counts)==null?void 0:et.sol),u(Be==null?void 0:Be.referral_code),d(Be==null?void 0:Be.refcode),f(Be==null?void 0:Be.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),x(""),g(""))}catch(Be){console.error("Token verification error:",Be),console.error(Be.message||"An unknown error occurred.")}})()},[z]);const qe=async()=>{try{ge(!0);const pt=window.localStorage.getItem("hyperToken"),en="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/claims/";if(!pt){n(!0),ge(!1);return}const Bt=window.localStorage.getItem("hyperAddress"),et=await(await fetch(en,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Bt,token:pt})})).json();et.success?(Ce(et==null?void 0:et.data),ge(!1)):(console.log(et.error_message),ye(et.error_message),ge(!1))}catch(pt){console.error("Error in like function:",pt),ye(pt.message),ge(!1)}},Ke=async()=>{try{it(!0);const pt=window.localStorage.getItem("hyperToken"),en="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/usage/";if(!pt){n(!0),it(!1);return}const Bt=window.localStorage.getItem("hyperAddress"),et=await(await fetch(en,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Bt,token:pt})})).json();et.success?(Qe(et==null?void 0:et.data),it(!1)):(console.log(et.error_message),ot(et.error_message),it(!1))}catch(pt){console.error("Error in like function:",pt),ot(pt.message),it(!1)}};return m.useEffect(()=>{const pt=()=>{Vt.current&&an(Vt.current.clientHeight)},en=new ResizeObserver(pt);return Vt.current&&en.observe(Vt.current),()=>{en.disconnect()}},[]),i.jsxs(i.Fragment,{children:[i.jsx(oan,{open:ft,setOpen:ct}),i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Invite & Earn – DextraBot Referral Program"}),i.jsx("link",{rel:"canonical",href:"https://app.dextrabot.com/referral"}),i.jsx("meta",{name:"description",content:"Earn passive income by referring friends to DextraBot! Get a share of the trading fees from every transaction they make. Invite, grow your network, and start earning today!"}),i.jsx("meta",{name:"og:title",content:"Invite & Earn – DextraBot Referral Program"}),i.jsx("meta",{name:"og:description",content:"Earn passive income by referring friends to DextraBot! Get a share of the trading fees from every transaction they make. Invite, grow your network, and start earning today!"}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/referral"})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-[calc(100vh-5rem)] min-h-max px-4 pt-4 pb-10 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start h-full gap-[26px] w-full lg:w-max flex-grow lg:flex-grow-0",children:i.jsxs("div",{className:"flex flex-col items-stretch justify-start w-full gap-8",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-start items-start gap-8 min-w-full w-full",children:[i.jsx(san,{handleEnterCode:Ut,handleChange:Nt,error:U,handleGenerateCode:Lt,handleGenerateChange:mn,generateError:X,generateData:pe,userReferansCode:z,setInputValue:F,setGenerateValue:J,inputValue:R,generateValue:ne,setIsMenu:w,isMenu:v,setGenerateCode:oe,generateCode:ie,setIsGenerateLoading:ae,isGenerateLoading:te,setIsEnterLoading:V,isEnterLoading:G,divRef:Vt,isEnterModal:je,setIsEnterModal:Ie}),i.jsx(aan,{data:he,dataLoading:ce,dataError:Ae,height:It,handleRefTable:qe,dataUsage:Re,dataUsageLoading:$e,dataUsageError:tt,setIsOnTableTab:N,isOnTableTab:C})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 bg-[#232323] rounded-2xl mb-10 p-4",children:[i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/refferal","_blank"),className:"flex justify-center items-center w-max gap-1.5 rounded-[10px] cursor-pointer",children:[i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-[18px] tracking-tight w-full sm:max-w-[500px] mb-2",children:"See the full Referral System with Bonuses Details"}),i.jsx("img",{src:xm,alt:"Dextrabot - Referral",className:"w-3 h-3 mb-2"})]}),i.jsx("img",{src:Vbt,alt:"",className:"text-center text-xs w-[900px] h-max sm:h-[450px] mb-10 lg:mb-0"})]})]})})})]})};function Lce({open:e,setOpen:t,data:n,walletData:r,withdrawableUsdc:s,setWithdrawableUsdc:a,modalWalletId:o,setModalWalletId:l}){const{setSignModalOpen:c}=m.useContext(Qr),{isConnected:u,address:d}=Jr(),[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState("");m.useEffect(()=>{const P=n.find(R=>R.wallet_address===r);P&&a(P==null?void 0:P.withdrawableUsdc)},[n]);const N=async()=>{var P,R,F,U,L,z;try{v(!0);const Q=window.localStorage.getItem("hyperToken"),ne="https://dextrabothypev2.nftinit.io/api/wallet/request-withdraw";Q||(c(!0),v(!1)),C("");const J=window.localStorage.getItem("hyperAddress"),re=await(await fetch(ne,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d.toLowerCase():J,token:Q,wallet_id:o??null,amount:f??0,destination:d?d.toLowerCase():J})})).json();re.success?(((R=(P=re==null?void 0:re.result)==null?void 0:P.result)==null?void 0:R.status)=="err"?(v(!1),C((U=(F=re==null?void 0:re.result)==null?void 0:F.result)==null?void 0:U.response)):((z=(L=re==null?void 0:re.result)==null?void 0:L.result)==null?void 0:z.status)=="ok"&&(v(!1),x(""),ln.success("The operation was successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"380px",maxWidth:"none",whiteSpace:"nowrap"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),t(!1)),v(!1)):(console.log(re.error_message),v(!1),C("The transaction failed, please try again."))}catch(Q){console.error("Error widthdraw amount:",Q),v(!1),C(Q.message)}},I=P=>{x(P.target.value)};return i.jsx(i.Fragment,{children:i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[440px] h-max relative bg-[#252525] rounded-3xl py-4 text-white",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),x(""),a(null),C("")},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2 text-white",children:[i.jsx("div",{className:"w-[365px] text-center text-white text-xl font-semibold font-manrope leading-7",children:"The withdrawal amount will be sent to your Login wallet on the Arbitrum network."}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("span",{className:"text-white/60 text-sm font-medium font-manrope leading-none tracking-tight",children:"Connected(Login) Wallet:"}),i.jsx("span",{className:"text-sm font-medium font-inter leading-none",children:d&&d.slice(0,6)+"..."+d.slice(-4)}),i.jsx("img",{onClick:P=>{P.stopPropagation(),navigator.clipboard.writeText(d),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]}),i.jsx("div",{className:"flex justify-start mt-4 relative",children:i.jsx("input",{type:"text",value:r&&`${r}`,placeholder:"wallet",disabled:!0,className:"shadow-sm py-0.5 bg-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md px-2 outline-[#404040] placeholder:text-[#7F7F7F] cursor-not-allowed text-white/50 h-8 w-[360px]"})}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex relative",children:[i.jsx("input",{value:f,onChange:P=>{let R=P.target.value;R.includes("-")?R=R.replace("-",""):(R===""||parseFloat(R)>=0)&&I({...P,target:{...P.target,value:R}})},type:"number",name:"widthdrawAmount",placeholder:"Amount",min:0,max:s,className:`shadow-sm py-0.5 bg-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md w-36 min-w-36 pl-2 pr-7 ${f!=null&&f!==""?"border border-[#C5C5C5]":""} outline-[#404040] placeholder:text-[#7F7F7F] h-8 w-[305px]`}),i.jsx("p",{className:`${f!=null&&f!==""?"text-white":"text-[#7F7F7F]"} absolute right-1.5 top-1`,children:"$"})]}),i.jsx("button",{onClick:()=>x(s),className:"bg-[#505050] text-white text-xs px-[11px] py-0.5 rounded-md cursor-pointer hover:bg-[#606060] h-8 focus:outline-none focus:ring-0 border-none",children:"Max"})]}),i.jsx("span",{className:"text-white",children:s!=0&&!isNaN(s)?`$${Cr(s)}`:"$0"})]}),g&&i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 rounded-md -my-6",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),i.jsx("div",{onClick:P=>{P.preventDefault(),f!=null&&f!==""?g||N():ln.error("Please enter amount")},className:`${g?"cursor-not-allowed":"cursor-pointer"} h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex w-44 mb-3`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Apply"})}),w&&i.jsx("div",{className:"h-6 p-2 w-[355px] bg-[#ff6f67]/20 rounded-lg justify-start items-center gap-2.5 inline-flex overflow-hidden -mt-7",children:i.jsx("span",{className:"text-[#ff6e67] text-xs font-semibold font-manrope leading-none tracking-tight",children:w})})]})})})})})]})})}const Dce=({handleListRequest:e,handlePageChange:t,isGenWalletModal:n,setIsGenWalletModal:r})=>{const{setSignModalOpen:s}=m.useContext(Qr);return i.jsxs(i.Fragment,{children:[i.jsx(d5,{open:n,setOpen:r,handleListRequest:e,handlePageChange:t}),i.jsx("div",{className:"flex justify-center items-center w-max h-max -mt-[14px] sm:-mt-0",children:i.jsxs("div",{onClick:a=>{a.preventDefault(),window.localStorage.getItem("hyperToken")?r(!0):s(!0)},className:"h-8 pl-2 pr-2 sm:pl-2 sm:pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer my-2",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Add Account"})]})})]})};function Bce({open:e,setOpen:t,walletAddress:n}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2.5",children:[i.jsx("div",{className:"pt-4",children:i.jsx(nse,{className:"text-[#848484] w-[48px] h-[48px] rotate-180"})}),i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manrope leading-7",children:"Deposit Funds"}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[18px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"1"})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[9px]",children:[i.jsxs("div",{className:"w-[283px]",children:[i.jsxs("span",{className:"text-white text-sm font-medium font-manrope leading-none",children:["Copy your"," "]}),i.jsx("span",{className:"text-white text-sm font-bold font-manrope leading-none",children:"wallet address"})]}),i.jsxs("div",{className:"w-[283px] flex justify-start items-center gap-1.5",children:[i.jsx("span",{className:"text-white/60 text-[13px] font-light font-inter leading-none",children:n&&n.slice(0,5)+"..."+n.slice(-4)}),i.jsx("img",{onClick:r=>{r.stopPropagation(),navigator.clipboard.writeText(n),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[10px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"2"})}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[9px]",children:[i.jsx("div",{className:"w-[217px] text-white text-sm font-medium font-manrope leading-none tracking-tight",children:"Deposit USDC on the Arbitrum Network."}),i.jsxs("div",{className:"w-[283px]",children:[i.jsxs("span",{className:"text-white/60 text-[13px] font-light font-inter leading-none",children:["Minimum Deposit:"," "]}),i.jsx("span",{className:"text-[#67ffbd] text-[13px] font-semibold font-manrope leading-none",children:"15 USDC"})]})]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[10px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"3"})}),i.jsx("div",{className:"w-[283px] text-white text-sm font-medium font-manrope leading-none tracking-tight",children:i.jsx("div",{className:"w-[250px]",children:"Any deposit from other networks or below the minimum amount will be lost."})})]}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[10px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"4"})}),i.jsxs("div",{className:"w-[283px] text-white text-sm font-medium font-manrope leading-none",children:["Once funds arrive, you are ready ",i.jsx("br",{}),"for Copy Trade"]})]})]})]})})})})})]})}const $ce=({open:e,setOpen:t,handleDeleteWallet:n,deleteWalleInfo:r,confirmClosePositions:s,setConfirmClosePositions:a,confirmWithdrawEquity:o,setConfirmWithdrawEquity:l})=>{const c=(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null&&!s||(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null&&!o;return i.jsx(i.Fragment,{children:i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[490px] h-max relative bg-[#252525] rounded-3xl py-4 text-white",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),a(!1),l(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:" text-center text-white text-2xl font-semibold font-manrope leading-7",children:(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null?"Cannot Delete Wallet: Open Positions":(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null?"Wallet Has Remaining Perp Equity":"Confirm Wallet Deletion"}),i.jsx("div",{className:"w-[398px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null||(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null?"":"Are you sure you want to delete this Follower Wallet? This action cannot be undone."}),i.jsxs("div",{className:`${((r==null?void 0:r.unrealizedPnL)==0||(r==null?void 0:r.unrealizedPnL)==null||(r==null?void 0:r.unrealizedPnL)==null)&&(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null?"ml-32":"ml-4"} flex flex-col gap-3 items-start w-[398px]`,children:[(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null&&i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",checked:s,onChange:u=>a(u.target.checked),className:"hidden peer"}),i.jsx("div",{className:`w-[18px] h-[18px] flex items-center justify-center rounded border transition-all duration-200 ${s?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"}`,children:s&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),i.jsx("span",{className:"text-white/60 text-[16px] font-medium font-manrope leading-5",children:"I have closed all my open positions in this wallet."})]}),(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null&&i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",checked:o,onChange:u=>l(u.target.checked),className:"hidden peer"}),i.jsx("div",{className:`w-[18px] h-[18px] flex items-center justify-center rounded border transition-all duration-200 ${o?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"}`,children:o&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),i.jsx("span",{className:"text-white/60 text-[16px] font-medium font-manrope leading-5",children:"I've withdrawn all my perp equity."})]})]})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4 mb-3",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:u=>{u.preventDefault(),c||n(r==null?void 0:r.walletId,r==null?void 0:r.walletName,r==null?void 0:r.wallet)},className:`${c?"bg-gray-500 border-gray-600 cursor-not-allowed":"bg-[#7445ff] border-[#8860ff] cursor-pointer"} h-8 px-2 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] justify-center items-center gap-1.5 inline-flex`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Delete"})})]})]})})})})})]})})},Uce=({rowData:e})=>e?i.jsxs("div",{className:"flex flex-col gap-4 p-4 bg-[#2e2e2e]/40 rounded-2xl",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Name"}),i.jsx("span",{className:"text-sm font-semibold text-white",children:e.wallet_name})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Follower Wallet"}),i.jsx("span",{className:"text-sm font-medium text-white break-all",children:e.wallet_address})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Creation Date"}),i.jsx("span",{className:"text-sm font-medium text-white",children:h3(e.wallet_created_data)})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Perp Equity"}),i.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",Cr(e.perpEquity)??0]})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"uPnL"}),i.jsxs("span",{className:`text-sm font-semibold ${e.unrealizedPnl>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`,children:["$",Cr(Math.abs(e.unrealizedPnl))]})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Margin Used"}),i.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",Cr(e.marginUsed)??0]})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Available Balance"}),i.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",Cr(e.withdrawableUsdc)??0]})]})]}):null,can=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,lighterWallet:l,extendedWallet:c,handleListRequest:u,isSelectMenu:d,setIsSelectMenu:f})=>{var dn;const[x,g]=m.useState(!1),{setSignModalOpen:v}=m.useContext(Qr),{isConnected:w,address:C}=Jr(),N=5,[I,P]=m.useState(null),[R,F]=m.useState(null),[U,L]=m.useState(!1),[z,Q]=m.useState(null),[ne,J]=m.useState(!1),[X,re]=m.useState("");m.useState({});const[pe,Y]=m.useState({}),[ie,oe]=m.useState(!1),[G,V]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[te,ae]=m.useState(!1),[he,Ce]=m.useState(!1),ce="-perpEquity",[ge,Ae]=m.useState(ce),ye=Pt=>e.sort((Xe,Ut)=>{if(Xe.version===3&&Ut.version!==3)return-1;if(Ut.version===3&&Xe.version!==3)return 1;const Lt=Xe.wallet_name?Xe.wallet_name.toUpperCase():"",qe=Ut.wallet_name?Ut.wallet_name.toUpperCase():"",Ke=Xe.wallet_address?Xe.wallet_address.toLowerCase():"",pt=Ut.wallet_address?Ut.wallet_address.toLowerCase():"";return Pt==="wallet_name"?Lt<qe?-1:Lt>qe?1:0:Pt==="-wallet_name"?Lt>qe?-1:Lt<qe?1:0:Pt==="-wallet_address"?Ke<pt?-1:Ke>pt?1:0:Pt==="wallet_address"?Ke>pt?-1:Ke<pt?1:0:Pt==="-wallet_created_data"?new Date(Ut.wallet_created_data)-new Date(Xe.wallet_created_data):Pt==="wallet_created_data"?new Date(Xe.wallet_created_data)-new Date(Ut.wallet_created_data):Pt==="-perpEquity"?Ut.perpEquity-Xe.perpEquity:Pt==="perpEquity"?Xe.perpEquity-Ut.perpEquity:Pt==="-unrealizedPnl"?Ut.unrealizedPnl-Xe.unrealizedPnl:Pt==="unrealizedPnl"?Xe.unrealizedPnl-Ut.unrealizedPnl:Pt==="-marginUsed"?Ut.marginUsed-Xe.marginUsed:Pt==="marginUsed"?Xe.marginUsed-Ut.marginUsed:Pt==="-withdrawableUsdc"?Ut.withdrawableUsdc-Xe.withdrawableUsdc:Pt==="withdrawableUsdc"?Xe.withdrawableUsdc-Ut.withdrawableUsdc:0}),je=async(Pt,Xe,Ut)=>{if(!Pt||!Xe||!Ut){console.error("Delete order called with invalid parameters"),ln.error("Delete order called with invalid parameters");return}const Lt=`${Pt}_${Xe}`;try{Y(Et=>({...Et,[Lt]:!0}));const qe=window.localStorage.getItem("hyperToken"),Ke="https://dextrabothypev2.nftinit.io/api/wallet/delete";if(!qe){v(!0),Y(Et=>({...Et,[Lt]:!1}));return}const pt=window.localStorage.getItem("hyperAddress"),en=await fetch(Ke,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:C?C.toLowerCase():pt,token:qe,wallet_id:Pt.toString()})});if(!en.ok)throw new zl(`Server responded with status ${en.status}`);const Bt=await en.json();Bt.success?(u(),V({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),ae(!1),Ce(!1),oe(!1),Y(Et=>({...Et,[Lt]:!1})),ln.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:Ut.slice(0,5)+"..."+Ut.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from generated wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"440px",minWidth:"440px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log(Bt.error_message),ln.error(Bt.error_message),Y(Et=>({...Et,[Lt]:!1})))}catch(qe){console.error("Error deleting wallet:",qe),ln.error(qe.message),Y(Ke=>({...Ke,[Lt]:!1}))}},Ie=m.useRef(null),Re=()=>{Ie.current&&(Ie.current.scrollLeft-=100)},Qe=()=>{Ie.current&&(Ie.current.scrollLeft+=100)},$e=()=>{Ie.current&&(Ie.current.scrollTop+=200)},it=()=>{Ie.current&&(Ie.current.scrollTop-=200)},tt=Pt=>Pt>=640&&Pt<1024?4:Pt>=1024&&Pt<1240?7:Pt>=1240&&Pt<1540||Pt>=1540?8:3,[ot,ft]=m.useState(null),[ct,Vt]=m.useState(!1),[It,an]=m.useState(!1);m.useEffect(()=>{const Pt=()=>{an(window.innerWidth<640)};return window.addEventListener("resize",Pt),Pt(),()=>window.removeEventListener("resize",Pt)},[]);const Nt=Pt=>{It&&(ft(Pt),Vt(!0))};m.useEffect(()=>{const Pt=window.location.hash;if(!Pt)return;const Xe=Pt.split("#").filter(Boolean);Xe.includes("add-account")&&(g(!0),Xe[0]==="hyperliquid"&&(f("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),Xe[0]==="lighter"&&(f("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),Xe[0]==="extended"&&(f("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")))},[]);const mn=Pt=>{g(!1),Pt==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),f("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):Pt==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),f("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):Pt==="EXTENDED"&&(window.history.replaceState(null,"",`${window.location.pathname}#extended`),f("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED"))};return i.jsxs(i.Fragment,{children:[i.jsx(Lce,{open:U,setOpen:L,data:e,walletData:I,withdrawableUsdc:z,setWithdrawableUsdc:Q,modalWalletId:R,setModalWalletId:F}),i.jsx(Bce,{open:ne,setOpen:J,walletAddress:X}),i.jsx($ce,{open:ie,setOpen:oe,handleDeleteWallet:je,deleteWalleInfo:G,confirmClosePositions:te,setConfirmClosePositions:ae,confirmWithdrawEquity:he,setConfirmWithdrawEquity:Ce}),i.jsx(up,{isOpen:ct,onClose:()=>Vt(!1),children:i.jsx(Uce,{rowData:ot})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[340px] max-h-max font-manrope relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-10 pl-2 sm:pl-0 pt-4",children:[i.jsxs("div",{className:"hidden sm:flex flex-col items-start justify-start gap-2 font-manrope min-w-max bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Wallet Management"})})]}),i.jsxs("div",{className:"flex flex-col items-start lg:flex-row lg:justify-start lg:items-center gap-1 lg:gap-10",children:[i.jsx(Dce,{handleListRequest:u,handlePageChange:a,isGenWalletModal:x,setIsGenWalletModal:g}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(GY,{title:"HYPER",label:"HYPERLIQUID",walletLength:o,handleSelectMenuChange:mn,isSelectMenu:d}),i.jsx(GY,{title:"LIGHTER",label:"LIGHTER",walletLength:l,handleSelectMenuChange:mn,isSelectMenu:d}),i.jsx(GY,{title:"EXTENDED",label:"EXTENDED",walletLength:c,handleSelectMenuChange:mn,isSelectMenu:d})]})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-5 right-4 z-10 hidden justify-start items-center gap-2",children:[i.jsx("button",{onClick:Re,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:it,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:$e,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-auto sm:h-max max-w-[100%] overflow-scroll relative flex-grow",ref:Ie,children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[140px] z-[8]",children:i.jsx(di,{title:"Name",sortKey:"wallet_name",sortOption:ge,setSortOption:Ae,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[140px] h-10 px-1 min-w-[160px] sm:min-w-[190px] z-[8]",children:i.jsx(di,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:ge,setSortOption:Ae,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(di,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:ge,setSortOption:Ae,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[120px] px-1",children:i.jsx(di,{title:"Perp Equity",sortKey:"perpEquity",sortOption:ge,setSortOption:Ae,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[134px] sm:min-w-[134px] px-1",children:i.jsx(di,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:ge,setSortOption:Ae,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[104px] sm:min-w-[104px] px-1 hidden sm:table-cell",children:i.jsx(di,{title:"Margin",sortKey:"marginUsed",sortOption:ge,setSortOption:Ae,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[130px] px-1 hidden sm:table-cell",children:i.jsx(di,{title:"Avail. Balance",sortKey:"withdrawableUsdc",sortOption:ge,setSortOption:Ae,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[330px] sm:min-w-[330px] pl-1 pr-4 hidden sm:table-cell",children:i.jsx("div",{className:"font-medium flex items-center justify-start w-full min-w-max",children:i.jsx("div",{className:"flex items-center justify-end w-full"})})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:tt(window.innerWidth),children:i.jsx("div",{className:"fixed top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 min-h-[30vh] flex flex-col justify-center items-center",children:i.jsx(Da,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:tt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[10%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx(zl,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:tt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[15%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 ml-1 sm:-ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not created a wallet yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Add Account'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","button to create a wallet."]})]})]})]})})})})}):(dn=ye(ge))==null?void 0:dn.map((Pt,Xe)=>{const Ut=!isNaN(Pt==null?void 0:Pt.perpEquity)&&!isNaN(Pt==null?void 0:Pt.marginUsed)?(Pt==null?void 0:Pt.perpEquity)-(Pt==null?void 0:Pt.marginUsed):0,Lt=It?{onClick:()=>Nt(Pt),className:"cursor-pointer"}:{};return i.jsxs("tr",{...Lt,className:`${Xe%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Xe%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-[44px] max-h-[44px] ",children:(Pt==null?void 0:Pt.version)==3?i.jsx(pi,{content:"This is an API wallet created from your login wallet. It enables copy trading without withdrawal permissions, keeping your funds safe.",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 min-w-max",children:(Pt==null?void 0:Pt.wallet_name.length)>=12?(Pt==null?void 0:Pt.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Pt==null?void 0:Pt.wallet_name)+"(API-AGENT) Wallet"}),(Pt==null?void 0:Pt.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Pt==null?void 0:Pt.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 ml-1"})]})}):i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Pt==null?void 0:Pt.wallet_name.length)>=12?(Pt==null?void 0:Pt.wallet_name).slice(0,12)+"...":Pt==null?void 0:Pt.wallet_name}),(Pt==null?void 0:Pt.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Pt==null?void 0:Pt.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${Xe%2===0,"bg-[#161616]"} sm:sticky sm:left-[140px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[44px] max-h-[44px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Pt==null?void 0:Pt.wallet_address}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-[44px] max-h-[44px] cursor-pointer",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-6 sm:h-6 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:qi,alt:"",className:"w-4 h-4 sm:w-6 sm:h-6"})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Pt==null?void 0:Pt.wallet_address).slice(0,5)+"..."+(Pt==null?void 0:Pt.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:qe=>{qe.stopPropagation(),navigator.clipboard.writeText(Pt==null?void 0:Pt.wallet_address),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-start gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Pt==null?void 0:Pt.wallet_created_data)&&h3(Pt==null?void 0:Pt.wallet_created_data)})})}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 text-white",children:r?"Loading...":(Pt==null?void 0:Pt.perpEquity)!=0&&!isNaN(Pt==null?void 0:Pt.perpEquity)?`$${Cr(Pt==null?void 0:Pt.perpEquity)}`:"$0"})})}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${(Pt==null?void 0:Pt.unrealizedPnl)>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:r?i.jsx("span",{className:"text-white",children:"Loading..."}):(Pt==null?void 0:Pt.unrealizedPnl)!=0&&!isNaN(Pt==null?void 0:Pt.unrealizedPnl)?`$${Cr(Math.abs(Pt==null?void 0:Pt.unrealizedPnl))}`:"$0"})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:r?i.jsx("span",{className:"text-white",children:"Loading..."}):(Pt==null?void 0:Pt.marginUsed)!=0&&!isNaN(Pt==null?void 0:Pt.marginUsed)?`$${Cr(Pt==null?void 0:Pt.marginUsed)}`:"$0"})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${!r&&Ut<0?"text-[#ff6b6b]":"text-white"} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:r?i.jsx("span",{children:"Loading..."}):isNaN(Ut)?"$0":`$${Cr(Math.abs(Ut))}`})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[(Pt==null?void 0:Pt.version)===3?i.jsx(pi,{content:"Deposits are not available for API wallets. Please fund your login wallet on Hyperliquid to start trading.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Deposit"})]})}):i.jsxs("div",{onClick:()=>{J(!0),re(Pt==null?void 0:Pt.wallet_address)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Deposit"})]}),(Pt==null?void 0:Pt.version)===3?i.jsx(pi,{content:"Withdrawals cannot be made with API wallets. Use your login wallet on Hyperliquid for withdrawals.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Withdraw"})]})}):i.jsxs("div",{onClick:()=>{Q(Pt==null?void 0:Pt.withdrawableUsdc),L(!0),P(Pt==null?void 0:Pt.wallet_address),F(Pt==null?void 0:Pt.wallet_id)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Withdraw"})]}),pe[`${Pt==null?void 0:Pt.wallet_id}_${Pt==null?void 0:Pt.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):(Pt==null?void 0:Pt.version)===3?i.jsx(pi,{content:"API wallets cannot be deleted here. To remove this wallet, please delete it from the Hyperliquid API page.",children:i.jsx("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Delete"})})}):i.jsx("div",{onClick:()=>{V({wallet:Pt==null?void 0:Pt.wallet_address,walletId:Pt==null?void 0:Pt.wallet_id,walletName:Pt==null?void 0:Pt.wallet_name.toLowerCase(),unrealizedPnL:Pt==null?void 0:Pt.unrealizedPnl,perpEquity:Pt==null?void 0:Pt.perpEquity}),oe(!0)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})})]},Xe)})})]})})]}),i.jsxs("div",{className:`flex justify-start items-center gap-2 absolute top-[10px] sm:top-6 right-1 sm:translate-x-0 sm:right-2
`,children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Previous"})}),i.jsxs("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px] w-20 sm:w-auto text-center",children:["Page ",s," / ",Math.ceil(o.length/N)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*N>=o.length,className:`${s*N>=o.length?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},GY=({title:e,label:t,handleSelectMenuChange:n,isSelectMenu:r,walletLength:s})=>i.jsxs("div",{onClick:()=>n(e),className:`${r==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} ${e==="HYPER"?"gap-1":e==="LIGHTER"?"gap-0.5":"gap-1"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:[e==="HYPER"?i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}):e==="EXTENDED"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"h-[20px] text-white -ml-0.5"}):null,`${t} (${(s==null?void 0:s.length)>0?"⚡"+(s==null?void 0:s.length)+" wallet":"🔌 Not Connected"}) `]});function KUe({open:e,setOpen:t,data:n,setShare:r,setTradeInfo:s}){const a=m.useRef(null),o=async()=>{if(a.current)try{await document.fonts.ready,await new Promise(v=>setTimeout(v,500));const x=await I1(a.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),g=document.createElement("a");g.href=x,g.download="dextrabot.png",document.body.appendChild(g),g.click(),document.body.removeChild(g),ln.success("PNG successfully downloaded!")}catch(x){console.error("Error generating PNG:",x),ln.error("Failed to download PNG.")}},[l,c]=m.useState(),[u,d]=m.useState(!0),f=async x=>{d(!0);try{const v=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(x)}`)).blob();return new Promise((w,C)=>{const N=new FileReader;N.onloadend=()=>w(N.result),N.onerror=C,N.readAsDataURL(v)})}catch(g){throw console.error("Image conversion failed:",g),g}finally{d(!1)}};return m.useEffect(()=>{n!=null&&n.coin&&f(`https://app.hyperliquid.xyz/coins/${n==null?void 0:n.coin}.svg`).then(x=>c(x)).catch(()=>c(Va))},[n==null?void 0:n.coin]),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),r(!1),setTimeout(()=>{s(x=>({...x,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,pnl:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:a,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[22px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start ",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-6",children:[i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:u?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:l||Va,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:x=>ra(x)})})}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope flex items-center",children:n!=null&&n.coin?n==null?void 0:n.coin:"--"}),i.jsx("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-20 min-w-[80px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"--"}),i.jsxs("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-16 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide`,children:[n!=null&&n.leverage?n==null?void 0:n.leverage:"--","x"]})]}),i.jsxs("div",{className:`${(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.roe)>=0?"+":"-",ao(Math.abs(n==null?void 0:n.roe)),"%"]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"UNREALIZED PNL"}),i.jsx("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-[32px] font-semibold font-manrope leading-none flex`,children:n!=null&&n.pnl?`$${ao(Math.abs(n==null?void 0:n.pnl))}`:ao(Math.abs(n==null?void 0:n.pnl))})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"ENTRY PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.entryPrice?`$${fy(n==null?void 0:n.entryPrice)}`:fy(n==null?void 0:n.entryPrice)})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"MARK PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.markPrice?`$${fy(n==null?void 0:n.markPrice)}`:fy(n==null?void 0:n.markPrice)})]})}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[26px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:"flex justify-start items-start pt-[1px]",children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:n!=null&&n.roe&&(n==null?void 0:n.roe)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:x=>{x.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:x=>{x.preventDefault(),u||o()},className:`${u?"cursor-not-allowed":"cursor-pointer"} w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:u?"Hang tight! Your image is on the way... 🚀":"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}const uan=({data:e})=>{const{isConnected:t,address:n}=Jr(),{setSignModalOpen:r,hyperToken:s,isReferralCodeName:a}=m.useContext(Qr),[o,l]=m.useState("");m.useState({});const[c,u]=m.useState(!1),[d,f]=m.useState(""),[x,g]=m.useState(!1),v=m.useRef(null),w=m.useRef(null),[C,N]=m.useState(!1),[I,P]=m.useState(!1),[R,F]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",pnl:0}),U="-unrealizedPnl",[L,z]=m.useState(U),[Q,ne]=m.useState([]),[J,X]=m.useState(!1);m.useEffect(()=>{if(e.length===0||J)return;const he=e.reduce((Ce,ce)=>parseFloat(ce.perpEquity||0)>parseFloat(Ce.perpEquity||0)?ce:Ce);he.wallet_address&&l(he.wallet_address)},[e,J]);const re=(he,Ce,ce)=>{const ge=he==null?void 0:he.filter(Ae=>Ae&&Ae.walletAddress&&Ae.asset).filter(Ae=>{var ye,je;return ce?(je=(ye=Ae==null?void 0:Ae.asset)==null?void 0:ye.toString())==null?void 0:je.toUpperCase().includes(ce.toUpperCase()):!0});return ge==null?void 0:ge.sort((Ae,ye)=>{const je=Ae.wallet_name?Ae.wallet_name.toUpperCase():"",Ie=ye.wallet_name?ye.wallet_name.toUpperCase():"",Re=Ae.tag?Ae.tag.toUpperCase():"",Qe=ye.tag?ye.tag.toUpperCase():"",$e=Ae.asset?Ae.asset.toUpperCase():"",it=ye.asset?ye.asset.toUpperCase():"",tt=Ae.type==="Long"?1:0,ot=ye.type==="Long"?1:0,ft=Ae.type==="Short"?1:0,ct=ye.type==="Short"?1:0;return Ce==="wallet_name"?je<Ie?-1:je>Ie?1:0:Ce==="-wallet_name"?je>Ie?-1:je<Ie?1:0:Ce==="-unrealizedPnl"?ye.unrealizedPnl-Ae.unrealizedPnl:Ce==="unrealizedPnl"?Ae.unrealizedPnl-ye.unrealizedPnl:Ce==="-roe"?ye.roe-Ae.roe:Ce==="roe"?Ae.roe-ye.roe:Ce==="-size"?ye.size-Ae.size:Ce==="size"?Ae.size-ye.size:Ce==="-entryPrice"?ye.entryPrice-Ae.entryPrice:Ce==="entryPrice"?Ae.entryPrice-ye.entryPrice:Ce==="-currentPrice"?ye.currentPrice-Ae.currentPrice:Ce==="currentPrice"?Ae.currentPrice-ye.currentPrice:Ce==="-leverage"?ye.leverage-Ae.leverage:Ce==="leverage"?Ae.leverage-ye.leverage:Ce==="-positionValue"?ye.positionValue-Ae.positionValue:Ce==="positionValue"?Ae.positionValue-ye.positionValue:Ce==="-marginUsed"?ye.marginUsed-Ae.marginUsed:Ce==="marginUsed"?Ae.marginUsed-ye.marginUsed:Ce==="funding"?ye.funding-Ae.funding:Ce==="-funding"?Ae.funding-ye.funding:Ce==="-liquidationPrice"?ye.liquidationPrice-Ae.liquidationPrice:Ce==="liquidationPrice"?Ae.liquidationPrice-ye.liquidationPrice:Ce==="-tag"?Re<Qe?-1:Re>Qe?1:0:Ce==="tag"?Re>Qe?-1:Re<Qe?1:0:Ce==="-coin"?$e<it?-1:$e>it?1:0:Ce==="coin"?$e>it?-1:$e<it?1:0:Ce==="-type_leverage"?tt!==ot?ot-tt:ye.leverage-Ae.leverage:Ce==="type_leverage"?ft!==ct?ct-ft:ye.leverage-Ae.leverage:0})},pe=async he=>{if(he===""&&Q.filter(Ce=>Ce!==void 0).length===0||he===""&&re(Q,L,d).length===0||re(Q,L,d).length===0){ln.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(he===""&&(e==null?void 0:e.length)>0){const Ce=re(Q,L,d),ce=[...new Set(Ce.map(ge=>ge.wallet_id))];if(ce.length===0){ln.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}try{if(u(!0),!window.localStorage.getItem("hyperToken")){r(!0),u(!1);return}await Promise.all(ce.map(Ae=>Y(Ae,!1))),ln.success("All close order operations successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",width:"400px",minWidth:"400px",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})}catch(ge){console.error("Error closing all orders:",ge)}finally{u(!1)}return}await Y(he)},Y=async(he,Ce=!0)=>{if(Q.filter(ce=>ce!==void 0).length===0){ln.success("There are no open positions to closes.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(!he){console.error("Close order called with invalid parameters"),ln.error("Close order called with invalid parameters");return}try{u(!0);const ce=window.localStorage.getItem("hyperToken"),ge="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!ce){r(!0),u(!1);return}const Ae=window.localStorage.getItem("hyperAddress"),ye=await fetch(ge,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Ae,token:ce,wallet_id:he.toString()})});if(!ye.ok)throw new Error(`Server responded with status ${ye.status}`);const je=await ye.json();je.status=="ok"?(u(!1),Ce&&ln.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"400px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):je.success?(u(!1),Ce&&ln.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log("Close order operation failed."),ln.error("Close order operation failed."),u(!1))}catch(ce){throw console.error("Something went wrong!"),ln.error("Something went wrong!"),u(!1),ce}},[ie,oe]=m.useState(!1);m.useEffect(()=>{const he=()=>{(localStorage.getItem("walletManagementInfo")!==void 0||localStorage.getItem("walletManagementInfo")!==null)&&Date.now()-Number(localStorage.getItem("walletManagementInfo"))>=864e5&&oe(!0)};he();const Ce=setInterval(()=>{he()},1e3*60*30);return()=>{clearInterval(Ce)}},[]);const G=async he=>{try{const Ce=window.localStorage.getItem("hyperToken"),ce="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!Ce){r(!0);return}const ge=he==null?void 0:he.filter(Ie=>Ie&&Ie.walletAddress&&Ie.asset).map(Ie=>({wallet:Ie.walletAddress,coin:Ie.asset})),Ae=window.localStorage.getItem("hyperAddress"),je=await(await fetch(ce,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Ae,token:Ce,positions:ge})})).json();je.success?ne(Ie=>Ie.map(Re=>{const Qe=je==null?void 0:je.data.find($e=>($e==null?void 0:$e.wallet)===(Re==null?void 0:Re.walletAddress)&&($e==null?void 0:$e.coin)===(Re==null?void 0:Re.asset));return{...Re,tag:Qe==null?void 0:Qe.tag,tagWallet:Qe==null?void 0:Qe.cp_wallet}})):(console.log(je.error_message),ln.error(je.error_message))}catch(Ce){console.error("Error tag request",Ce),ln.error(Ce.message)}},V=m.useRef(Q==null?void 0:Q.filter(he=>(he==null?void 0:he.walletAddress)&&(he==null?void 0:he.asset)).length),te=m.useRef(),ae=m.useRef(!0);return m.useEffect(()=>{const he=Q==null?void 0:Q.filter(ce=>ce!==void 0&&(ce==null?void 0:ce.walletAddress)&&(ce==null?void 0:ce.asset)),Ce=he==null?void 0:he.length;if(Ce>0&&Ce>V.current){const ce=o===""?Q:Q.filter(ge=>(ge==null?void 0:ge.wallet_id)==o);ae.current?(G(ce),ae.current=!1):(te.current&&clearTimeout(te.current),te.current=setTimeout(()=>{G(ce)},5e3))}V.current=Ce},[Q]),m.useEffect(()=>{if((Q==null?void 0:Q.filter(he=>he!==void 0&&(he==null?void 0:he.walletAddress)&&(he==null?void 0:he.asset)).length)>0){const he=o==""?Q:Q==null?void 0:Q.filter(Ce=>(Ce==null?void 0:Ce.wallet_id)==o);(he==null?void 0:he.length)>0&&G(he)}},[o]),m.useEffect(()=>{function he(Ce){v.current&&!v.current.contains(Ce.target)&&setIsDropdownOpen(!1),w.current&&!w.current.contains(Ce.target)&&g(!1)}return document.addEventListener("mousedown",he),()=>document.removeEventListener("mousedown",he)},[]),i.jsx(i.Fragment,{children:i.jsxs(i.Fragment,{children:[i.jsx(KUe,{open:C,setOpen:N,data:R,setShare:P,setTradeInfo:F}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full min-h-[500px] max-h-max font-manrope relative sm:pt-10",children:[i.jsxs("div",{className:"flex items-center justify-start gap-4",children:[i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px] w-full",children:"Manage Positions"}),i.jsx("div",{className:"flex sm:hidden items-center justify-end w-full gap-1 min-w-max",children:i.jsx("div",{className:"flex items-center justify-end group",children:i.jsxs("div",{onClick:he=>{he.preventDefault(),c||pe(o)},className:"h-[26px] pl-1 pr-2 py-1.5 bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30 rounded-md inline-flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("div",{className:"",children:i.jsx("img",{src:tae,alt:"",className:"w-4 h-4"})}),c?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[66px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Fast Close All"})]})})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("span",{className:"font-bold min-w-[200px] lg:min-w-max text-xs sm:text-[14px]",children:"Select wallet to see your current positions:"}),i.jsxs("select",{className:"rounded-md py-0.5 bg-[#303030] text-white text-md outline-none w-full h-8 min-w-[150px] px-2",onChange:he=>{l(he.target.value),X(!0)},value:o,children:[i.jsx("option",{value:"",children:"All"}),e==null?void 0:e.map(he=>i.jsx("option",{value:he==null?void 0:he.wallet_address,children:`${he==null?void 0:he.wallet_name} - (${(he==null?void 0:he.wallet_address).slice(0,5)+"..."+(he==null?void 0:he.wallet_address).slice(-4)})`},he==null?void 0:he.wallet_id))]})]}),ie&&i.jsxs("div",{className:"hidden sm:flex justify-center items-center ml-10 h-16 pl-3 py-4 pr-5 bg-[#ff9800]/20 rounded-lg gap-3 w-max min-w-max relative",children:[i.jsx("div",{onClick:he=>{he.stopPropagation(),localStorage.setItem("walletManagementInfo",`${Date.now()}`),oe(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute -top-0.5 -right-1.5 w-7 h-7 rounded-full p-0.5 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("img",{src:Kbt,alt:""}),i.jsx("div",{className:"font-semibold flex justify-start items-center text-white text-md outline-none max-w-[600px]",children:"Make sure you are performing all the actions on Dextrabot for the Copy Trade account. Don't close or open positions manually on Hyperliquid."})]})]}),i.jsx("div",{className:"w-full h-max max-w-[100%] min-h-[60vh] sm:min-h-[36vh] overflow-scroll relative flex-grow",children:i.jsx(WUe,{initialAddress:o,wallets:o===""?e:void 0})})]})]})]})})},dan=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,handleListRequest:l,isSelectMenu:c,setIsSelectMenu:u,hyperWallet:d,lighterWallet:f,extendedWallet:x})=>{var Pt;const[g,v]=m.useState(!1),{setSignModalOpen:w}=m.useContext(Qr),{isConnected:C,address:N}=Jr(),I=5,[P,R]=m.useState(null),[F,U]=m.useState(null),[L,z]=m.useState(!1),[Q,ne]=m.useState(null),[J,X]=m.useState(!1),[re,pe]=m.useState("");m.useState({});const[Y,ie]=m.useState({}),[oe,G]=m.useState(!1),[V,te]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[ae,he]=m.useState(!1),[Ce,ce]=m.useState(!1),ge="-perpEquity",[Ae,ye]=m.useState(ge),je=Xe=>e.sort((Ut,Lt)=>{if(Ut.version===3&&Lt.version!==3)return-1;if(Lt.version===3&&Ut.version!==3)return 1;const qe=Ut.wallet_name?Ut.wallet_name.toUpperCase():"",Ke=Lt.wallet_name?Lt.wallet_name.toUpperCase():"",pt=Ut.wallet_address?Ut.wallet_address.toLowerCase():"",en=Lt.wallet_address?Lt.wallet_address.toLowerCase():"";return Xe==="wallet_name"?qe<Ke?-1:qe>Ke?1:0:Xe==="-wallet_name"?qe>Ke?-1:qe<Ke?1:0:Xe==="-wallet_address"?pt<en?-1:pt>en?1:0:Xe==="wallet_address"?pt>en?-1:pt<en?1:0:Xe==="-wallet_created_data"?new Date(Lt.wallet_created_data)-new Date(Ut.wallet_created_data):Xe==="wallet_created_data"?new Date(Ut.wallet_created_data)-new Date(Lt.wallet_created_data):Xe==="-perpEquity"?Lt.perpEquity-Ut.perpEquity:Xe==="perpEquity"?Ut.perpEquity-Lt.perpEquity:Xe==="-unrealizedPnl"?Lt.unrealizedPnl-Ut.unrealizedPnl:Xe==="unrealizedPnl"?Ut.unrealizedPnl-Lt.unrealizedPnl:Xe==="-marginUsed"?Lt.marginUsed-Ut.marginUsed:Xe==="marginUsed"?Ut.marginUsed-Lt.marginUsed:Xe==="-withdrawableUsdc"?Lt.withdrawableUsdc-Ut.withdrawableUsdc:Xe==="withdrawableUsdc"?Ut.withdrawableUsdc-Lt.withdrawableUsdc:0}),Ie=async(Xe,Ut,Lt)=>{if(!Xe||!Ut||!Lt){console.error("Delete order called with invalid parameters"),ln.error("Delete order called with invalid parameters");return}const qe=`${Xe}_${Ut}`;try{ie(et=>({...et,[qe]:!0}));const Ke=window.localStorage.getItem("hyperToken"),pt="https://dextrabothypev2.nftinit.io/api/wallet/delete-lighter";if(!Ke){w(!0),ie(et=>({...et,[qe]:!1}));return}const en=window.localStorage.getItem("hyperAddress"),Bt=await fetch(pt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:N?N.toLowerCase():en,token:Ke,wallet_id:Xe})});if(!Bt.ok)throw new zl(`Server responded with status ${Bt.status}`);const Et=await Bt.json();Et.success?(l(),te({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),he(!1),ce(!1),G(!1),ie(et=>({...et,[qe]:!1})),ln.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:Lt.slice(0,5)+"..."+Lt.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from generated wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"440px",minWidth:"440px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log(Et.error_message),ln.error(Et.error_message),ie(et=>({...et,[qe]:!1})))}catch(Ke){console.error("Error deleting wallet:",Ke),ln.error(Ke.message),ie(pt=>({...pt,[qe]:!1}))}},Re=m.useRef(null),Qe=()=>{Re.current&&(Re.current.scrollLeft-=100)},$e=()=>{Re.current&&(Re.current.scrollLeft+=100)},it=()=>{Re.current&&(Re.current.scrollTop+=200)},tt=()=>{Re.current&&(Re.current.scrollTop-=200)},ot=Xe=>Xe>=640&&Xe<1024?4:Xe>=1024&&Xe<1240?7:Xe>=1240&&Xe<1540||Xe>=1540?8:3,[ft,ct]=m.useState(null),[Vt,It]=m.useState(!1),[an,Nt]=m.useState(!1);m.useEffect(()=>{const Xe=()=>{Nt(window.innerWidth<640)};return window.addEventListener("resize",Xe),Xe(),()=>window.removeEventListener("resize",Xe)},[]);const mn=Xe=>{an&&(ct(Xe),It(!0))};m.useEffect(()=>{const Xe=window.location.hash;if(!Xe)return;const Ut=Xe.split("#").filter(Boolean);Ut.includes("add-account")&&(v(!0),Ut[0]==="hyperliquid"&&(u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),Ut[0]==="lighter"&&(u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),Ut[0]==="extended"&&(u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")))},[]);const dn=Xe=>{v(!1),Xe==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):Xe==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):Xe==="EXTENDED"&&(window.history.replaceState(null,"",`${window.location.pathname}#extended`),u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED"))};return i.jsxs(i.Fragment,{children:[i.jsx(Lce,{open:L,setOpen:z,data:e,walletData:P,withdrawableUsdc:Q,setWithdrawableUsdc:ne,modalWalletId:F,setModalWalletId:U}),i.jsx(Bce,{open:J,setOpen:X,walletAddress:re}),i.jsx($ce,{open:oe,setOpen:G,handleDeleteWallet:Ie,deleteWalleInfo:V,confirmClosePositions:ae,setConfirmClosePositions:he,confirmWithdrawEquity:Ce,setConfirmWithdrawEquity:ce}),i.jsx(up,{isOpen:Vt,onClose:()=>It(!1),children:i.jsx(Uce,{rowData:ft})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[340px] max-h-max font-manrope relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-10 pl-2 sm:pl-0 pt-4",children:[i.jsxs("div",{className:"hidden sm:flex flex-col items-start justify-start gap-2 font-manrope min-w-max bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Wallet Management"})})]}),i.jsxs("div",{className:"flex flex-col items-start lg:flex-row lg:justify-start lg:items-center gap-1 lg:gap-10",children:[i.jsx(Dce,{handleListRequest:l,handlePageChange:a,isGenWalletModal:g,setIsGenWalletModal:v}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(KY,{title:"HYPER",label:"HYPERLIQUID",walletLength:d,handleSelectMenuChange:dn,isSelectMenu:c}),i.jsx(KY,{title:"LIGHTER",label:"LIGHTER",walletLength:f,handleSelectMenuChange:dn,isSelectMenu:c}),i.jsx(KY,{title:"EXTENDED",label:"EXTENDED",walletLength:x,handleSelectMenuChange:dn,isSelectMenu:c})]})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-5 right-4 z-10 hidden justify-start items-center gap-2",children:[i.jsx("button",{onClick:Qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:$e,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:tt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:it,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-auto sm:h-max max-w-[100%] overflow-scroll relative flex-grow",ref:Re,children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[140px] z-[8]",children:i.jsx(di,{title:"Name",sortKey:"wallet_name",sortOption:Ae,setSortOption:ye,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[140px] h-10 px-1 min-w-[160px] sm:min-w-[190px] z-[8]",children:i.jsx(di,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:Ae,setSortOption:ye,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(di,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:Ae,setSortOption:ye,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[330px] sm:min-w-[330px] pl-1 pr-4 hidden sm:table-cell",children:i.jsx("div",{className:"font-medium flex items-center justify-start w-full min-w-max",children:i.jsx("div",{className:"flex items-center justify-end w-full"})})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ot(window.innerWidth),children:i.jsx("div",{className:"fixed top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 min-h-[30vh] flex flex-col justify-center items-center",children:i.jsx(Da,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ot(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[10%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx(zl,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ot(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[15%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 ml-1 sm:-ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not created a wallet yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Add Account'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","button to create a wallet."]})]})]})]})})})})}):(Pt=je(Ae))==null?void 0:Pt.map((Xe,Ut)=>{!isNaN(Xe==null?void 0:Xe.perpEquity)&&!isNaN(Xe==null?void 0:Xe.marginUsed)&&(Xe==null?void 0:Xe.perpEquity)-(Xe==null?void 0:Xe.marginUsed);const Lt=an?{onClick:()=>mn(Xe),className:"cursor-pointer"}:{};return i.jsxs("tr",{...Lt,className:`${Ut%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Ut%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-[44px] max-h-[44px] ",children:(Xe==null?void 0:Xe.version)==3?i.jsx(pi,{content:"This is an API wallet created from your login wallet. It enables copy trading without withdrawal permissions, keeping your funds safe.",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 min-w-max",children:(Xe==null?void 0:Xe.wallet_name.length)>=12?(Xe==null?void 0:Xe.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Xe==null?void 0:Xe.wallet_name)+"(API-AGENT) Wallet"}),(Xe==null?void 0:Xe.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Xe==null?void 0:Xe.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 ml-1"})]})}):i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Xe==null?void 0:Xe.wallet_name.length)>=12?(Xe==null?void 0:Xe.wallet_name).slice(0,12)+"...":Xe==null?void 0:Xe.wallet_name}),(Xe==null?void 0:Xe.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Xe==null?void 0:Xe.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${Ut%2===0,"bg-[#161616]"} sm:sticky sm:left-[140px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[44px] max-h-[44px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Xe==null?void 0:Xe.wallet_address}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-[44px] max-h-[44px] cursor-pointer",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-6 sm:h-6 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:qi,alt:"",className:"w-4 h-4 sm:w-6 sm:h-6"})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Xe==null?void 0:Xe.wallet_address).slice(0,5)+"..."+(Xe==null?void 0:Xe.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:qe=>{qe.stopPropagation(),navigator.clipboard.writeText(Xe==null?void 0:Xe.wallet_address),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-start gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Xe==null?void 0:Xe.wallet_created_data)&&h3(Xe==null?void 0:Xe.wallet_created_data)})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[i.jsx(pi,{content:"Deposits are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Deposit"})]})}),i.jsx(pi,{content:"Withdrawals are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Withdraw"})]})}),Y[`${Xe==null?void 0:Xe.wallet_id}_${Xe==null?void 0:Xe.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):(Xe==null?void 0:Xe.version)===3?i.jsx(pi,{content:"API wallets cannot be deleted here. To remove this wallet, please delete it from the Hyperliquid API page.",children:i.jsx("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Delete"})})}):i.jsx("div",{onClick:()=>{te({wallet:Xe==null?void 0:Xe.wallet_address,walletId:Xe==null?void 0:Xe.wallet_id,walletName:Xe==null?void 0:Xe.wallet_name.toLowerCase(),unrealizedPnL:Xe==null?void 0:Xe.unrealizedPnl,perpEquity:Xe==null?void 0:Xe.perpEquity}),G(!0)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})})]},Ut)})})]})})]}),i.jsxs("div",{className:`flex justify-start items-center gap-2 absolute top-[10px] sm:top-6 right-1 sm:translate-x-0 sm:right-2
`,children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Previous"})}),i.jsxs("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px] w-20 sm:w-auto text-center",children:["Page ",s," / ",Math.ceil(o.length/I)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*I>=o.length,className:`${s*I>=o.length?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},KY=({title:e,label:t,handleSelectMenuChange:n,isSelectMenu:r,walletLength:s})=>i.jsxs("div",{onClick:()=>n(e),className:`${r==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} ${e==="HYPER"?"gap-1":e==="LIGHTER"?"gap-0.5":"gap-1"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:[e==="HYPER"?i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}):e==="EXTENDED"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"h-[20px] text-white -ml-0.5"}):null,`${t} (${(s==null?void 0:s.length)>0?"⚡"+(s==null?void 0:s.length)+" wallet":"🔌 Not Connected"}) `]}),fan=({initialAddress:e="",wallets:t,positions:n,setPositions:r,isWalletIndex:s,posLoading:a,setPosLoading:o,setGenerateWalletData:l})=>{var qe;const{getTrackedWatchList:c,hyperToken:u,copyTradeWatchList:d,getCopyTradeWatchList:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setMushboomerSOL:C,setIsReferralCode:N,isReferralCodeName:I,setIsReferralCodeName:P,setIsWhitelist:R,setHyperToken:F,setHyperAddress:U,setSignModalOpen:L,latestPnL:z}=m.useContext(Qr),{address:Q}=Jr(),[ne,J]=m.useState(!1);m.useState({}),m.useState(!1),m.useEffect(()=>{if(!(s!=null&&s.index))return;const Ke=new WebSocket("wss://mainnet.zklighter.elliot.ai/stream");let pt;Ke.onopen=()=>{console.log("Lighter WebSocket connected"),Ke.send(JSON.stringify({type:"subscribe",channel:`account_all/${s.index}`})),pt=setInterval(()=>{Ke.readyState===WebSocket.OPEN&&Ke.send(JSON.stringify({type:"subscribe",channel:`account_all/${s.index}`}))},5e3)},Ke.onmessage=Bt=>{const Et=JSON.parse(Bt==null?void 0:Bt.data);if(Et!=null&&Et.positions&&Object.keys(Et.positions).length>0){const et=Object.values(Et.positions).filter(ut=>Number(ut.position)!==0).map(ut=>({funding:0,leverage:ut.initial_margin_fraction?Math.round(100/Number(ut.initial_margin_fraction)):0,positionValue:Number(ut.position_value??0),unrealizedPnl:Number(ut.unrealized_pnl??0),currentPrice:ut.avg_entry_price&&ut.unrealized_pnl&&ut.position&&ut.sign?Number(ut.avg_entry_price)+Number(ut.unrealized_pnl)/(Number(ut.position)*Number(ut.sign)):Number(ut.position_value)/Math.abs(Number(ut.position)),entryPrice:Number(ut.avg_entry_price??0),size:Number(ut.position??0),type:Number(ut.sign)>0?"Long":"Short",asset:ut.symbol??"",sign:Number(ut.sign??1)})),Be=et.reduce((ut,xt)=>ut+xt.unrealizedPnl,0),Mt=et.reduce((ut,xt)=>{const jt=xt.leverage>0?xt.leverage:1,kt=xt.positionValue/jt;return ut+(isFinite(kt)?kt:0)},0),Ve=Number(Et.available_balance??0);l(ut=>ut==null?void 0:ut.map(xt=>{var jt;return((jt=xt.wallet_address)==null?void 0:jt.toLowerCase())===(e==null?void 0:e.toLowerCase())?{...xt,unrealizedPnl:Be.toFixed(6),withdrawableUsdc:Ve.toFixed(6),marginUsed:Mt.toFixed(6),positions:et}:xt})),r(et),(ce==null?void 0:ce.length)>0&&o(!1)}else r([]),a&&o(!1)},Ke.onclose=Bt=>{console.log("🔌 ZkLighter WebSocket disconnected",Bt.code,Bt.reason),clearInterval(pt)},Ke.onerror=Bt=>{console.error("❌ ZkLighter WS error:",Bt),clearInterval(pt)};const en=()=>{Ke.readyState===WebSocket.OPEN&&Ke.send(JSON.stringify({type:"unsubscribe",channel:`account_all/${s.index}`})),clearInterval(pt),Ke.close()};return window.addEventListener("beforeunload",en),()=>{en(),window.removeEventListener("beforeunload",en)}},[s]);const X=m.useRef(null),re=()=>{X.current&&(X.current.scrollLeft-=200)},pe=()=>{X.current&&(X.current.scrollLeft+=200)},Y=()=>{X.current&&(X.current.scrollTop+=200)},ie=()=>{X.current&&(X.current.scrollTop-=200)};m.useEffect(()=>{(async()=>{var Bt,Et;const pt=window.localStorage.getItem("hyperToken"),en=window.localStorage.getItem("hyperAddress");if(!(!pt||!en))try{const et=await ji(en.toLowerCase(),pt);et!=null&&et.success?(x(et==null?void 0:et.telegram_chat_id),g(et==null?void 0:et.subscriber_role),v(et==null?void 0:et.subs_expire_day),w((Bt=et==null?void 0:et.mushboomer_counts)==null?void 0:Bt.eth),C((Et=et==null?void 0:et.mushboomer_counts)==null?void 0:Et.sol),N(et==null?void 0:et.referral_code),P(et==null?void 0:et.refcode),R(et==null?void 0:et.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),F(""),U(""))}catch(et){console.error("Token verification error:",et),console.error(et.message||"An unknown error occurred.")}})()},[]);const[oe,G]=m.useState(""),[V,te]=m.useState(!1),ae=m.useRef(null);m.useEffect(()=>{function Ke(pt){ae.current&&!ae.current.contains(pt.target)&&te(!1)}return document.addEventListener("mousedown",Ke),()=>document.removeEventListener("mousedown",Ke)},[]);const[he,Ce]=m.useState([]),ce=n==null?void 0:n.filter(Ke=>{var pt;return oe?(pt=Ke.asset)==null?void 0:pt.toLowerCase().includes(oe.toLowerCase()):!0}).map(Ke=>{const pt=he.find(en=>en.coin===Ke.asset&&(en.wallet||"").toLowerCase()===(Ke.wallet||"").toLowerCase());return{...Ke,tagName:(pt==null?void 0:pt.tag)||null,tagWallet:(pt==null?void 0:pt.cp_wallet)||null}}),ge="-unrealizedPnl",[Ae,ye]=m.useState(ge),je=Ke=>{const et=ce==null?void 0:ce.map(Be=>{const Mt=Be!=null&&Be.positionValue&&(Be!=null&&Be.leverage)?Be.unrealizedPnl*Be.leverage*100/Be.positionValue:0,Ve=.004+6e-4*Be.leverage;let ut=0;(Be==null?void 0:Be.type)==="Long"?ut=Be.entryPrice*(Be.leverage/(Be.leverage+1-Be.leverage*Ve)):ut=Be.entryPrice*(Be.leverage/(Be.leverage-1+Be.leverage*Ve));const xt=ut*5.05,jt=Be.leverage?Be.positionValue/Be.leverage:0,kt=Be.positionValue*1e-4*(Be.sign??-1);return{...Be,roe:Mt,liquidationPrice:xt,marginUsed:jt,funding:kt}});return et==null?void 0:et.sort((Be,Mt)=>{const Ve=Be.tagName?Be.tagName.toUpperCase():"",ut=Mt.tagName?Mt.tagName.toUpperCase():"",xt=Be.asset?Be.asset.toUpperCase():"",jt=Mt.asset?Mt.asset.toUpperCase():"",kt=Be.type==="Long"?1:0,xn=Mt.type==="Long"?1:0,un=Be.type==="Short"?1:0,On=Mt.type==="Short"?1:0;return Ke==="-unrealizedPnl"?Mt.unrealizedPnl-Be.unrealizedPnl:Ke==="unrealizedPnl"?Be.unrealizedPnl-Mt.unrealizedPnl:Ke==="-roe"?Mt.roe-Be.roe:Ke==="roe"?Be.roe-Mt.roe:Ke==="-size"?Mt.size-Be.size:Ke==="size"?Be.size-Mt.size:Ke==="-entryPrice"?Mt.entryPrice-Be.entryPrice:Ke==="entryPrice"?Be.entryPrice-Mt.entryPrice:Ke==="-currentPrice"?Mt.currentPrice-Be.currentPrice:Ke==="currentPrice"?Be.currentPrice-Mt.currentPrice:Ke==="-leverage"?Mt.leverage-Be.leverage:Ke==="leverage"?Be.leverage-Mt.leverage:Ke==="-positionValue"?Mt.positionValue-Be.positionValue:Ke==="positionValue"?Be.positionValue-Mt.positionValue:Ke==="-marginUsed"?Mt.marginUsed-Be.marginUsed:Ke==="marginUsed"?Be.marginUsed-Mt.marginUsed:Ke==="-funding"?Mt.funding-Be.funding:Ke==="funding"?Be.funding-Mt.funding:Ke==="-liquidationPrice"?Mt.liquidationPrice-Be.liquidationPrice:Ke==="liquidationPrice"?Be.liquidationPrice-Mt.liquidationPrice:Ke==="-entryTime"?new Date(Mt.latestFill)-new Date(Be.latestFill):Ke==="entryTime"?new Date(Be.latestFill)-new Date(Mt.latestFill):Ke==="-source_tag"?Ve<ut?-1:Ve>ut?1:0:Ke==="source_tag"?Ve>ut?-1:Ve<ut?1:0:Ke==="-type_leverage"?kt!==xn?xn-kt:Mt.leverage-Be.leverage:Ke==="type_leverage"?un!==On?On-un:Mt.leverage-Be.leverage:Ke==="-asset"?xt<jt?-1:xt>jt?1:0:Ke==="asset"?xt>jt?-1:xt<jt?1:0:0})};n.length,n.filter(Ke=>Ke.unrealizedPnl>=0).length;const[Ie,Re]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),$e=localStorage.getItem("isDateOpenPositionsLighterFormat")||"date",[it,tt]=m.useState($e);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsLighterFormat",it)},[it]);const[ot,ft]=m.useState([]),ct=async()=>{try{const Ke=window.localStorage.getItem("hyperToken");if(!Ke){L(!0);return}const pt="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",en=window.localStorage.getItem("hyperAddress"),Et=await(await fetch(pt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Q?Q.toLowerCase():en,token:Ke,balance:"false"})})).json();Et!=null&&Et.success?(ft(Et.data||[]),Pt(Et.data)):console.log(Et.error_message)}catch(Ke){console.error("Error fetching generate wallet list:",Ke)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&ct()},[u]);const[Vt,It]=m.useState([]),[an,Nt]=m.useState(!0),[mn,dn]=m.useState(!1);m.useEffect(()=>{ce&&ce.length>0&&(Xe(),ot.length>0&&an&&Pt())},[ce]);const Pt=()=>{Vt.length!==0&&(Ut(Vt),an&&Nt(!1))};m.useEffect(()=>{const Ke=window.localStorage.getItem("hyperToken");Vt.length&&Ke&&Ut(Vt)},[Vt]);const Xe=()=>{const Ke=window.localStorage.getItem("hyperToken");let pt=!1;const en=[...Vt];ce.forEach(Bt=>{var Mt;const Et=Bt.asset,et=(Mt=Bt.wallet||e)==null?void 0:Mt.toLowerCase();en.some(Ve=>Ve.coin===Et&&(Ve.wallet||"").toLowerCase()===et)||(en.push({coin:Et,wallet:et}),pt=!0)}),pt&&(It(en),ot.some(Et=>Et.wallet_address===(e==null?void 0:e.toLowerCase()))&&Ke&&Ut(en))},Ut=async Ke=>{if(!mn)try{dn(!0);const pt=window.localStorage.getItem("hyperToken"),en="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!pt||!Ke){dn(!1);return}pt||L(!0);const Bt=window.localStorage.getItem("hyperAddress"),et=await(await fetch(en,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Q?Q.toLowerCase():Bt,token:pt,positions:Ke})})).json();et.success?Ce(et==null?void 0:et.data):(console.log(et.error_message),ln.error(et.error_message))}catch(pt){console.error("Error tag request",pt),ln.error(pt.message)}finally{dn(!1)}};(t==null?void 0:t.length)>1||ot.some(Ke=>Ke.wallet_address===(e==null?void 0:e.toLowerCase()));const Lt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"w-full",children:[i.jsx(hT,{open:ne,setOpen:J,data:Ie,setTradeInfo:Re}),i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 hidden lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:re,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:pe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:ie,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:Y,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Bl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:X,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] border-collapse rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky bg-[#161616] left-0 h-10 pl-2 sm:pl-6 min-w-[130px] sm:min-w-[145px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(di,{title:"Coin",sortKey:"asset",sortOption:Ae,setSortOption:ye,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>te(!V),className:`${oe?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${oe?"text-blue-500":"text-white"}`})}),V&&i.jsxs("div",{ref:ae,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>G(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:oe,onChange:Ke=>G(Ke.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx(han,{className:"min-w-[100px] sm:min-w-[120px] px-1",title:"Type",sortKey:"type_leverage",sortOption:Ae,setSortOption:ye}),i.jsx(fv,{className:"min-w-[80px] sm:min-w-[80px] px-1",title:"Size",sortKey:"size",sortOption:Ae,setSortOption:ye}),i.jsx(fv,{className:"min-w-[130px] sm:min-w-[145px] px-1",title:"Position Value",sortKey:"positionValue",sortOption:Ae,setSortOption:ye}),i.jsx(fv,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Entry Price",sortKey:"entryPrice",sortOption:Ae,setSortOption:ye}),i.jsx(fv,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Mark Price",sortKey:"currentPrice",sortOption:Ae,setSortOption:ye}),i.jsx(fv,{className:"min-w-[100px] sm:min-w-[160px] px-1",title:"PnL(ROE%)",sortKey:"unrealizedPnl",sortOption:Ae,setSortOption:ye}),i.jsx(fv,{className:"min-w-[120px] sm:min-w-[130px] px-1",title:"Margin",sortKey:"marginUsed",sortOption:Ae,setSortOption:ye}),i.jsx(fv,{className:"min-w-[110px] sm:min-w-[130px] px-1",title:"Funding",sortKey:"funding",sortOption:Ae,setSortOption:ye})]})}),i.jsx("tbody",{children:a?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsx(Da,{})})})})}):(ce==null?void 0:ce.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No open positions are currently available"}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["To discover a different wallet, you can use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","tab above."]})]})]})]})})})})}):(qe=je(Ae))==null?void 0:qe.map((Ke,pt)=>{var Mt;const en=Ke!=null&&Ke.positionValue&&(Ke!=null&&Ke.leverage)?(Ke==null?void 0:Ke.unrealizedPnl)*(Ke==null?void 0:Ke.leverage)*100/(Ke==null?void 0:Ke.positionValue):0,Bt=.004+6e-4*Ke.leverage;Ke.entryPrice*(Ke.leverage/(Ke.sign===1?Ke.leverage+1-Ke.leverage*Bt:Ke.leverage-1+Ke.leverage*Bt));const Et=Ke!=null&&Ke.leverage?(Ke==null?void 0:Ke.positionValue)/(Ke==null?void 0:Ke.leverage):0,Be=(Ke==null?void 0:Ke.positionValue)*1e-4*(Ke==null?void 0:Ke.sign);return i.jsxs(Ne.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${Ke==null?void 0:Ke.asset}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Lt[Ke.asset]||((Mt=Ke.asset)==null?void 0:Mt.split("/")[0])}.svg`||Va,alt:Ke==null?void 0:Ke.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Ve=>ra(Ve)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ke.asset})]})})}),i.jsx("td",{scope:"row",className:"z-[2] bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${Ke.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:Ke.type==="Long"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:[Ke.type," - ",Ke==null?void 0:Ke.leverage,"x"]})]})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:ao(Math.abs(Ke.size))})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ke.positionValue?`$${ao(Ke.positionValue)}`:ao(Ke.positionValue)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ke.entryPrice?`$${Cr(Ke.entryPrice)}`:Cr(Ke.entryPrice)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ke.currentPrice?`$${Cr(Ke.currentPrice)}`:Cr(Ke.currentPrice)})})}),i.jsx("td",{children:i.jsxs("div",{onClick:()=>{Re(Ve=>({...Ve,coin:Ke.asset,type:Ke.type,leverage:Ke.leverage,roe:en,entryPrice:Ke.entryPrice,markPrice:Ke.currentPrice,pnl:Ke.unrealizedPnl,referral:window.localStorage.getItem("hyperToken")?I:null})),J(!0)},className:"pl-1 pr-2 flex justify-end gap-2 font-manrope cursor-pointer min-w-max",children:[i.jsxs("div",{className:`${Ke.unrealizedPnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:[Ke.unrealizedPnl?`$${ao(Math.abs(Ke.unrealizedPnl))}`:ao(Math.abs(Ke.unrealizedPnl)),` (${ao(Math.abs(en.toFixed(2)))}%)`]}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:xm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:Et?`$${ao(Et)}`:ao(Et)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:`${!isNaN(Number(Be))&&Number(Be)<=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:isNaN(Number(Be))?"$0.00":`$${Math.abs(Number(Be)).toFixed(4)}`})})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},pt)})})]})})]})]})},fv=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(di,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),han=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(di,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})}),pan=({initialAddress:e="",wallets:t,isWalletIndex:n,posLoading:r,setPosLoading:s,setGenerateWalletData:a})=>{const[o,l]=m.useState("positions"),[c,u]=m.useState([]);return i.jsxs("div",{className:"w-full",children:[i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 mb-2 mx-4 mt-4 relative overflow-x-auto whitespace-nowrap scrollbar-hide [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[i.jsx("div",{className:"absolute bottom-0 left-0 w-[80%] h-[1px] bg-[#2A2A2A]"}),i.jsx("div",{onClick:()=>l("positions"),className:`${o==="positions"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsxs("div",{className:"flex items-center text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none min-w-max",children:[i.jsx("span",{className:"mr-2",children:"Open Positions"}),i.jsx("span",{className:"flex w-[22px] h-[22px] px-3 justify-center items-center gap-[2px] flex-shrink-0 rounded-md bg-[rgba(103,255,189,0.16)] text-[14px] font-semibold font-manrope",children:c.length})]})})]}),o==="positions"?i.jsx(fan,{initialAddress:e,wallets:t,positions:c,setPositions:u,isWalletIndex:n,posLoading:r,setPosLoading:s,setGenerateWalletData:a}):""]})},man=({data:e,isWalletIndex:t,fetchAllIndex:n,setGenerateWalletData:r})=>{const{isConnected:s,address:a}=Jr(),{setSignModalOpen:o,hyperToken:l,isReferralCodeName:c}=m.useContext(Qr),[u,d]=m.useState(""),[f,x]=m.useState(!0);m.useState({});const[g,v]=m.useState(!1),[w,C]=m.useState(""),[N,I]=m.useState(!1),P=m.useRef(null),R=m.useRef(null),[F,U]=m.useState(!1),[L,z]=m.useState(!1),[Q,ne]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",pnl:0}),J="-unrealizedPnl",[X,re]=m.useState(J),[pe,Y]=m.useState([]),[ie,oe]=m.useState(!1);m.useEffect(()=>{if(e.length===0||ie)return;const ye=e.reduce((je,Ie)=>parseFloat(Ie.perpEquity||0)>parseFloat(je.perpEquity||0)?Ie:je);ye.wallet_address&&d(ye.wallet_address)},[e,ie]);const G=(ye,je,Ie)=>{const Re=ye==null?void 0:ye.filter(Qe=>Qe&&Qe.walletAddress&&Qe.asset).filter(Qe=>{var $e,it;return Ie?(it=($e=Qe==null?void 0:Qe.asset)==null?void 0:$e.toString())==null?void 0:it.toUpperCase().includes(Ie.toUpperCase()):!0});return Re==null?void 0:Re.sort((Qe,$e)=>{const it=Qe.wallet_name?Qe.wallet_name.toUpperCase():"",tt=$e.wallet_name?$e.wallet_name.toUpperCase():"",ot=Qe.tag?Qe.tag.toUpperCase():"",ft=$e.tag?$e.tag.toUpperCase():"",ct=Qe.asset?Qe.asset.toUpperCase():"",Vt=$e.asset?$e.asset.toUpperCase():"",It=Qe.type==="Long"?1:0,an=$e.type==="Long"?1:0,Nt=Qe.type==="Short"?1:0,mn=$e.type==="Short"?1:0;return je==="wallet_name"?it<tt?-1:it>tt?1:0:je==="-wallet_name"?it>tt?-1:it<tt?1:0:je==="-unrealizedPnl"?$e.unrealizedPnl-Qe.unrealizedPnl:je==="unrealizedPnl"?Qe.unrealizedPnl-$e.unrealizedPnl:je==="-roe"?$e.roe-Qe.roe:je==="roe"?Qe.roe-$e.roe:je==="-size"?$e.size-Qe.size:je==="size"?Qe.size-$e.size:je==="-entryPrice"?$e.entryPrice-Qe.entryPrice:je==="entryPrice"?Qe.entryPrice-$e.entryPrice:je==="-currentPrice"?$e.currentPrice-Qe.currentPrice:je==="currentPrice"?Qe.currentPrice-$e.currentPrice:je==="-leverage"?$e.leverage-Qe.leverage:je==="leverage"?Qe.leverage-$e.leverage:je==="-positionValue"?$e.positionValue-Qe.positionValue:je==="positionValue"?Qe.positionValue-$e.positionValue:je==="-marginUsed"?$e.marginUsed-Qe.marginUsed:je==="marginUsed"?Qe.marginUsed-$e.marginUsed:je==="funding"?$e.funding-Qe.funding:je==="-funding"?Qe.funding-$e.funding:je==="-liquidationPrice"?$e.liquidationPrice-Qe.liquidationPrice:je==="liquidationPrice"?Qe.liquidationPrice-$e.liquidationPrice:je==="-tag"?ot<ft?-1:ot>ft?1:0:je==="tag"?ot>ft?-1:ot<ft?1:0:je==="-coin"?ct<Vt?-1:ct>Vt?1:0:je==="coin"?ct>Vt?-1:ct<Vt?1:0:je==="-type_leverage"?It!==an?an-It:$e.leverage-Qe.leverage:je==="type_leverage"?Nt!==mn?mn-Nt:$e.leverage-Qe.leverage:0})},V=async ye=>{if(ye===""&&pe.filter(je=>je!==void 0).length===0||ye===""&&G(pe,X,w).length===0||G(pe,X,w).length===0){ln.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(ye===""&&(e==null?void 0:e.length)>0){const je=G(pe,X,w),Ie=[...new Set(je.map(Re=>Re.wallet_id))];if(Ie.length===0){ln.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}try{if(v(!0),!window.localStorage.getItem("hyperToken")){o(!0),v(!1);return}await Promise.all(Ie.map(Qe=>te(Qe,!1))),ln.success("All close order operations successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",width:"400px",minWidth:"400px",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})}catch(Re){console.error("Error closing all orders:",Re)}finally{v(!1)}return}await te(ye)},te=async(ye,je=!0)=>{if(pe.filter(Ie=>Ie!==void 0).length===0){ln.success("There are no open positions to closes.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(!ye){console.error("Close order called with invalid parameters"),ln.error("Close order called with invalid parameters");return}try{v(!0);const Ie=window.localStorage.getItem("hyperToken"),Re="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!Ie){o(!0),v(!1);return}const Qe=window.localStorage.getItem("hyperAddress"),$e=await fetch(Re,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Qe,token:Ie,wallet_id:ye.toString()})});if(!$e.ok)throw new Error(`Server responded with status ${$e.status}`);const it=await $e.json();it.status=="ok"?(v(!1),je&&ln.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"400px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):it.success?(v(!1),je&&ln.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log("Close order operation failed."),ln.error("Close order operation failed."),v(!1))}catch(Ie){throw console.error("Something went wrong!"),ln.error("Something went wrong!"),v(!1),Ie}},[ae,he]=m.useState(!1);m.useEffect(()=>{const ye=()=>{(localStorage.getItem("walletManagementInfo")!==void 0||localStorage.getItem("walletManagementInfo")!==null)&&Date.now()-Number(localStorage.getItem("walletManagementInfo"))>=864e5&&he(!0)};ye();const je=setInterval(()=>{ye()},1e3*60*30);return()=>{clearInterval(je)}},[]);const Ce=async ye=>{try{const je=window.localStorage.getItem("hyperToken"),Ie="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!je){o(!0);return}const Re=ye==null?void 0:ye.filter(tt=>tt&&tt.walletAddress&&tt.asset).map(tt=>({wallet:tt.walletAddress,coin:tt.asset})),Qe=window.localStorage.getItem("hyperAddress"),it=await(await fetch(Ie,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Qe,token:je,positions:Re})})).json();it.success?Y(tt=>tt.map(ot=>{const ft=it==null?void 0:it.data.find(ct=>(ct==null?void 0:ct.wallet)===(ot==null?void 0:ot.walletAddress)&&(ct==null?void 0:ct.coin)===(ot==null?void 0:ot.asset));return{...ot,tag:ft==null?void 0:ft.tag,tagWallet:ft==null?void 0:ft.cp_wallet}})):(console.log(it.error_message),ln.error(it.error_message))}catch(je){console.error("Error tag request",je),ln.error(je.message)}},ce=m.useRef(pe==null?void 0:pe.filter(ye=>(ye==null?void 0:ye.walletAddress)&&(ye==null?void 0:ye.asset)).length),ge=m.useRef(),Ae=m.useRef(!0);return m.useEffect(()=>{const ye=pe==null?void 0:pe.filter(Ie=>Ie!==void 0&&(Ie==null?void 0:Ie.walletAddress)&&(Ie==null?void 0:Ie.asset)),je=ye==null?void 0:ye.length;if(je>0&&je>ce.current){const Ie=u===""?pe:pe.filter(Re=>(Re==null?void 0:Re.wallet_id)==u);Ae.current?(Ce(Ie),Ae.current=!1):(ge.current&&clearTimeout(ge.current),ge.current=setTimeout(()=>{Ce(Ie)},5e3))}ce.current=je},[pe]),m.useEffect(()=>{if((pe==null?void 0:pe.filter(ye=>ye!==void 0&&(ye==null?void 0:ye.walletAddress)&&(ye==null?void 0:ye.asset)).length)>0){const ye=u==""?pe:pe==null?void 0:pe.filter(je=>(je==null?void 0:je.wallet_id)==u);(ye==null?void 0:ye.length)>0&&Ce(ye)}},[u]),m.useEffect(()=>{function ye(je){P.current&&!P.current.contains(je.target)&&setIsDropdownOpen(!1),R.current&&!R.current.contains(je.target)&&I(!1)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[]),i.jsx(i.Fragment,{children:i.jsxs(i.Fragment,{children:[i.jsx(KUe,{open:F,setOpen:U,data:Q,setShare:z,setTradeInfo:ne}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full min-h-[500px] max-h-max font-manrope relative sm:pt-10",children:[i.jsxs("div",{className:"flex items-center justify-start gap-4",children:[i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px] w-full",children:"Manage Positions"}),i.jsx("div",{className:"flex sm:hidden items-center justify-end w-full gap-1 min-w-max",children:i.jsx("div",{className:"flex items-center justify-end group",children:i.jsxs("div",{onClick:ye=>{ye.preventDefault(),g||V(u)},className:"h-[26px] pl-1 pr-2 py-1.5 bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30 rounded-md inline-flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("div",{className:"",children:i.jsx("img",{src:tae,alt:"",className:"w-4 h-4"})}),g?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[66px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Fast Close All"})]})})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("span",{className:"font-bold min-w-[200px] lg:min-w-max text-xs sm:text-[14px]",children:"Select wallet to see your current positions:"}),i.jsx("select",{className:"rounded-md py-0.5 bg-[#303030] text-white text-md outline-none w-full h-8 min-w-[150px] px-2",onChange:ye=>{d(ye.target.value),oe(!0),n(ye.target.value),x(!0),r(je=>je==null?void 0:je.map(Ie=>({...Ie,unrealizedPnl:0,marginUsed:0})))},value:u,children:e==null?void 0:e.map(ye=>i.jsx("option",{value:ye==null?void 0:ye.wallet_address,children:`${ye==null?void 0:ye.wallet_name} - (${(ye==null?void 0:ye.wallet_address).slice(0,5)+"..."+(ye==null?void 0:ye.wallet_address).slice(-4)})`},ye==null?void 0:ye.wallet_id))})]}),!1]}),i.jsx("div",{className:"w-full h-max max-w-[100%] min-h-[60vh] sm:min-h-[36vh] overflow-scroll relative flex-grow",children:i.jsx(pan,{initialAddress:u,wallets:u===""?e:void 0,isWalletIndex:t,posLoading:f,setPosLoading:x,setGenerateWalletData:r})})]})]})]})})},xan=({isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s,lighterWalletList:a})=>{const{isConnected:o,address:l}=Jr(),{setSignModalOpen:c,hyperToken:u}=m.useContext(Qr),[d,f]=m.useState([]),[x,g]=m.useState(!1),[v,w]=m.useState(null),[C,N]=m.useState(!0),[I,P]=m.useState(null),[R,F]=m.useState([]),[U,L]=m.useState(()=>parseInt(localStorage.getItem("walletManagementLighterPage"))||1),z=5,[Q,ne]=m.useState(!1),[J,X]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?re():(c(!0),f([]),window.localStorage.setItem("walletManagementLighterPage",1))},[o,u]);const re=async()=>{var oe;try{g(!0);const G=window.localStorage.getItem("hyperToken");if(!G){c(!0);return}const V="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",te=window.localStorage.getItem("hyperAddress"),he=await(await fetch(V,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():te,token:G})})).json();if(he.success){a(),F(he.data||[]),ne(!0);const Ce=parseInt(localStorage.getItem("walletManagementLighterPage"))||1,ce=Math.max(Math.ceil(((he==null?void 0:he.data)||[]).length/z),1),ge=Math.min(Ce,ce);L(ge),localStorage.setItem("walletManagementLighterPage",ge),Y(ge,he.data||[]);const Ae=(ge-1)*z,ye=(oe=he.data)==null?void 0:oe[Ae];ye&&pe(ye==null?void 0:ye.wallet_address)}else console.log(he.error_message),g(!1),w(he.error_message)}catch(G){console.error("Error fetching lighter wallet list:",G),g(!1),w(G.message)}},pe=async oe=>{try{const V=`https://mainnet.zklighter.elliot.ai/api/v1/accountsByL1Address?l1_address=${Ac(oe)}`,ae=await(await fetch(V,{method:"GET",headers:{accept:"application/json"}})).json();if(ae.sub_accounts&&ae.sub_accounts.length>0){const he=ae.sub_accounts[0],Ce=(he==null?void 0:he.collateral)??he.collateral??"",ce=(he==null?void 0:he.margin_used)??"",ge=(he==null?void 0:he.available_balance)??"",Ae=(he==null?void 0:he.unrealized_pnl)??"",ye=(he==null?void 0:he.positions)??[];f(je=>je==null?void 0:je.map(Ie=>Ie.wallet_address.toLowerCase()===oe.toLowerCase()?{...Ie,perpEquity:Ce,unrealizedPnl:Ae,withdrawableUsdc:ge,marginUsed:ce,positions:ye}:Ie)),P(he),X(!0),g(!1),N(!1)}}catch(G){console.error("Error fetching lighter index:",G)}};m.useEffect(()=>{const oe=()=>{const G=parseInt(localStorage.getItem("walletManagementLighterPage"))||1;G!==U&&Q&&J&&(L(G),Y(G,R))};return window.addEventListener("storage",oe),()=>{window.removeEventListener("storage",oe)}},[U,R,Q,J]);const Y=(oe,G)=>{if(!G||G.length===0){g(!1);return}g(!0);const V=(oe-1)*z,te=V+z,ae=G.slice(V,te);f(ae)},ie=oe=>{oe<1||oe>Math.ceil(R.length/z)||(g(!0),L(oe),localStorage.setItem("walletManagementLighterPage",oe),Y(oe,R))};return i.jsxs(i.Fragment,{children:[i.jsx(dan,{data:d,loading:x,error:v,socketLoading:C,handlePageChange:ie,handleListRequest:re,currentPage:U,allWallets:R,isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s}),i.jsx(man,{data:d,setGenerateWalletData:f,isWalletIndex:I,fetchAllIndex:pe})]})},gan=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,handleListRequest:l,isSelectMenu:c,setIsSelectMenu:u,hyperWallet:d,lighterWallet:f,extendedWallet:x})=>{var Pt;const[g,v]=m.useState(!1),{setSignModalOpen:w}=m.useContext(Qr),{isConnected:C,address:N}=Jr(),I=5,[P,R]=m.useState(null),[F,U]=m.useState(null),[L,z]=m.useState(!1),[Q,ne]=m.useState(null),[J,X]=m.useState(!1),[re,pe]=m.useState("");m.useState({});const[Y,ie]=m.useState({}),[oe,G]=m.useState(!1),[V,te]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[ae,he]=m.useState(!1),[Ce,ce]=m.useState(!1),ge="-perpEquity",[Ae,ye]=m.useState(ge),je=Xe=>e.sort((Ut,Lt)=>{if(Ut.version===3&&Lt.version!==3)return-1;if(Lt.version===3&&Ut.version!==3)return 1;const qe=Ut.wallet_name?Ut.wallet_name.toUpperCase():"",Ke=Lt.wallet_name?Lt.wallet_name.toUpperCase():"",pt=Ut.wallet_address?Ut.wallet_address.toLowerCase():"",en=Lt.wallet_address?Lt.wallet_address.toLowerCase():"";return Xe==="wallet_name"?qe<Ke?-1:qe>Ke?1:0:Xe==="-wallet_name"?qe>Ke?-1:qe<Ke?1:0:Xe==="-wallet_address"?pt<en?-1:pt>en?1:0:Xe==="wallet_address"?pt>en?-1:pt<en?1:0:Xe==="-wallet_created_data"?new Date(Lt.wallet_created_data)-new Date(Ut.wallet_created_data):Xe==="wallet_created_data"?new Date(Ut.wallet_created_data)-new Date(Lt.wallet_created_data):Xe==="-perpEquity"?Lt.perpEquity-Ut.perpEquity:Xe==="perpEquity"?Ut.perpEquity-Lt.perpEquity:Xe==="-unrealizedPnl"?Lt.unrealizedPnl-Ut.unrealizedPnl:Xe==="unrealizedPnl"?Ut.unrealizedPnl-Lt.unrealizedPnl:Xe==="-marginUsed"?Lt.marginUsed-Ut.marginUsed:Xe==="marginUsed"?Ut.marginUsed-Lt.marginUsed:Xe==="-withdrawableUsdc"?Lt.withdrawableUsdc-Ut.withdrawableUsdc:Xe==="withdrawableUsdc"?Ut.withdrawableUsdc-Lt.withdrawableUsdc:0}),Ie=async(Xe,Ut,Lt)=>{if(!Xe||!Ut||!Lt){console.error("Delete order called with invalid parameters"),ln.error("Delete order called with invalid parameters");return}const qe=`${Xe}_${Ut}`;try{ie(et=>({...et,[qe]:!0}));const Ke=window.localStorage.getItem("hyperToken"),pt="https://dextrabothypev2.nftinit.io/api/wallet/delete-extended";if(!Ke){w(!0),ie(et=>({...et,[qe]:!1}));return}const en=window.localStorage.getItem("hyperAddress"),Bt=await fetch(pt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:N?N.toLowerCase():en,token:Ke,wallet_id:Xe})});if(!Bt.ok)throw new zl(`Server responded with status ${Bt.status}`);const Et=await Bt.json();Et.success?(l(),te({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),he(!1),ce(!1),G(!1),ie(et=>({...et,[qe]:!1})),ln.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:Lt.slice(0,5)+"..."+Lt.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from generated wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"440px",minWidth:"440px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log(Et.error_message),ln.error(Et.error_message),ie(et=>({...et,[qe]:!1})))}catch(Ke){console.error("Error deleting wallet:",Ke),ln.error(Ke.message),ie(pt=>({...pt,[qe]:!1}))}},Re=m.useRef(null),Qe=()=>{Re.current&&(Re.current.scrollLeft-=100)},$e=()=>{Re.current&&(Re.current.scrollLeft+=100)},it=()=>{Re.current&&(Re.current.scrollTop+=200)},tt=()=>{Re.current&&(Re.current.scrollTop-=200)},ot=Xe=>Xe>=640&&Xe<1024?4:Xe>=1024&&Xe<1240?7:Xe>=1240&&Xe<1540||Xe>=1540?8:3,[ft,ct]=m.useState(null),[Vt,It]=m.useState(!1),[an,Nt]=m.useState(!1);m.useEffect(()=>{const Xe=()=>{Nt(window.innerWidth<640)};return window.addEventListener("resize",Xe),Xe(),()=>window.removeEventListener("resize",Xe)},[]);const mn=Xe=>{an&&(ct(Xe),It(!0))};m.useEffect(()=>{const Xe=window.location.hash;if(!Xe)return;const Ut=Xe.split("#").filter(Boolean);Ut.includes("add-account")&&(v(!0),Ut[0]==="hyperliquid"&&(u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),Ut[0]==="lighter"&&(u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),Ut[0]==="extended"&&(u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")))},[]);const dn=Xe=>{v(!1),Xe==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):Xe==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):Xe==="EXTENDED"&&(window.history.replaceState(null,"",`${window.location.pathname}#extended`),u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED"))};return i.jsxs(i.Fragment,{children:[i.jsx(Lce,{open:L,setOpen:z,data:e,walletData:P,withdrawableUsdc:Q,setWithdrawableUsdc:ne,modalWalletId:F,setModalWalletId:U}),i.jsx(Bce,{open:J,setOpen:X,walletAddress:re}),i.jsx($ce,{open:oe,setOpen:G,handleDeleteWallet:Ie,deleteWalleInfo:V,confirmClosePositions:ae,setConfirmClosePositions:he,confirmWithdrawEquity:Ce,setConfirmWithdrawEquity:ce}),i.jsx(up,{isOpen:Vt,onClose:()=>It(!1),children:i.jsx(Uce,{rowData:ft})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[340px] max-h-max font-manrope relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-10 pl-2 sm:pl-0 pt-4",children:[i.jsxs("div",{className:"hidden sm:flex flex-col items-start justify-start gap-2 font-manrope min-w-max bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Wallet Management"})})]}),i.jsxs("div",{className:"flex flex-col items-start lg:flex-row lg:justify-start lg:items-center gap-1 lg:gap-10",children:[i.jsx(Dce,{handleListRequest:l,handlePageChange:a,isGenWalletModal:g,setIsGenWalletModal:v}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(YY,{title:"HYPER",label:"HYPERLIQUID",walletLength:d,handleSelectMenuChange:dn,isSelectMenu:c}),i.jsx(YY,{title:"LIGHTER",label:"LIGHTER",walletLength:f,handleSelectMenuChange:dn,isSelectMenu:c}),i.jsx(YY,{title:"EXTENDED",label:"EXTENDED",walletLength:x,handleSelectMenuChange:dn,isSelectMenu:c})]})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-5 right-4 z-10 hidden justify-start items-center gap-2",children:[i.jsx("button",{onClick:Qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:$e,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:tt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:it,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-auto sm:h-max max-w-[100%] overflow-scroll relative flex-grow",ref:Re,children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[140px] z-[8]",children:i.jsx(di,{title:"Name",sortKey:"wallet_name",sortOption:Ae,setSortOption:ye,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[140px] h-10 px-1 min-w-[160px] sm:min-w-[190px] z-[8]",children:i.jsx(di,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:Ae,setSortOption:ye,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(di,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:Ae,setSortOption:ye,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[330px] sm:min-w-[330px] pl-1 pr-4 hidden sm:table-cell",children:i.jsx("div",{className:"font-medium flex items-center justify-start w-full min-w-max",children:i.jsx("div",{className:"flex items-center justify-end w-full"})})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ot(window.innerWidth),children:i.jsx("div",{className:"fixed top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 min-h-[30vh] flex flex-col justify-center items-center",children:i.jsx(Da,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ot(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[10%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx(zl,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ot(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[15%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 ml-1 sm:-ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not created a wallet yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Add Account'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","button to create a wallet."]})]})]})]})})})})}):(Pt=je(Ae))==null?void 0:Pt.map((Xe,Ut)=>{!isNaN(Xe==null?void 0:Xe.perpEquity)&&!isNaN(Xe==null?void 0:Xe.marginUsed)&&(Xe==null?void 0:Xe.perpEquity)-(Xe==null?void 0:Xe.marginUsed);const Lt=an?{onClick:()=>mn(Xe),className:"cursor-pointer"}:{};return i.jsxs("tr",{...Lt,className:`${Ut%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Ut%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-[44px] max-h-[44px] ",children:(Xe==null?void 0:Xe.version)==3?i.jsx(pi,{content:"This is an API wallet created from your login wallet. It enables copy trading without withdrawal permissions, keeping your funds safe.",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 min-w-max",children:(Xe==null?void 0:Xe.wallet_name.length)>=12?(Xe==null?void 0:Xe.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Xe==null?void 0:Xe.wallet_name)+"(API-AGENT) Wallet"}),(Xe==null?void 0:Xe.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Xe==null?void 0:Xe.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(Si,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 ml-1"})]})}):i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Xe==null?void 0:Xe.wallet_name.length)>=12?(Xe==null?void 0:Xe.wallet_name).slice(0,12)+"...":Xe==null?void 0:Xe.wallet_name}),(Xe==null?void 0:Xe.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Fa,{content:`${Xe==null?void 0:Xe.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${Ut%2===0,"bg-[#161616]"} sm:sticky sm:left-[140px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[44px] max-h-[44px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Xe==null?void 0:Xe.wallet_address}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-[44px] max-h-[44px] cursor-pointer",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-6 sm:h-6 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:qi,alt:"",className:"w-4 h-4 sm:w-6 sm:h-6"})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Xe==null?void 0:Xe.wallet_address).slice(0,5)+"..."+(Xe==null?void 0:Xe.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:qe=>{qe.stopPropagation(),navigator.clipboard.writeText(Xe==null?void 0:Xe.wallet_address),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-start gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Xe==null?void 0:Xe.wallet_created_data)&&h3(Xe==null?void 0:Xe.wallet_created_data)})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[i.jsx(pi,{content:"Deposits are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Deposit"})]})}),i.jsx(pi,{content:"Withdrawals are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(xy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Withdraw"})]})}),Y[`${Xe==null?void 0:Xe.wallet_id}_${Xe==null?void 0:Xe.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):(Xe==null?void 0:Xe.version)===3?i.jsx(pi,{content:"API wallets cannot be deleted here. To remove this wallet, please delete it from the Hyperliquid API page.",children:i.jsx("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Delete"})})}):i.jsx("div",{onClick:()=>{te({wallet:Xe==null?void 0:Xe.wallet_address,walletId:Xe==null?void 0:Xe.wallet_id,walletName:Xe==null?void 0:Xe.wallet_name.toLowerCase(),unrealizedPnL:Xe==null?void 0:Xe.unrealizedPnl,perpEquity:Xe==null?void 0:Xe.perpEquity}),G(!0)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})})]},Ut)})})]})})]}),i.jsxs("div",{className:`flex justify-start items-center gap-2 absolute top-[10px] sm:top-6 right-1 sm:translate-x-0 sm:right-2
`,children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Previous"})}),i.jsxs("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px] w-20 sm:w-auto text-center",children:["Page ",s," / ",Math.ceil(o.length/I)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*I>=o.length,className:`${s*I>=o.length?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},YY=({title:e,label:t,handleSelectMenuChange:n,isSelectMenu:r,walletLength:s})=>i.jsxs("div",{onClick:()=>n(e),className:`${r==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} ${e==="HYPER"?"gap-1":e==="LIGHTER"?"gap-0.5":"gap-1"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:[e==="HYPER"?i.jsx("img",{src:dx,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}):e==="EXTENDED"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"h-[20px] text-white -ml-0.5"}):null,`${t} (${(s==null?void 0:s.length)>0?"⚡"+(s==null?void 0:s.length)+" wallet":"🔌 Not Connected"}) `]}),ban=({isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s,fetchAllWalletList:a})=>{const{isConnected:o,address:l}=Jr(),{setSignModalOpen:c,hyperToken:u}=m.useContext(Qr),[d,f]=m.useState([]),[x,g]=m.useState(!1),[v,w]=m.useState(null),[C,N]=m.useState(!0);m.useState(null);const[I,P]=m.useState([]),[R,F]=m.useState(()=>parseInt(localStorage.getItem("walletManagementExtendedPage"))||1),U=5,[L,z]=m.useState(!1),[Q,ne]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?J():(c(!0),f([]),window.localStorage.setItem("walletManagementExtendedPage",1))},[o,u]);const J=async()=>{var pe,Y;try{g(!0);const ie=window.localStorage.getItem("hyperToken");if(!ie){c(!0);return}const oe="https://dextrabothypev2.nftinit.io/api/wallet/list-extended",G=window.localStorage.getItem("hyperAddress"),te=await(await fetch(oe,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():G,token:ie})})).json();if(te.success&&((pe=te==null?void 0:te.data)==null?void 0:pe.length)>0){a(),P(te.data||[]),z(!0);const ae=parseInt(localStorage.getItem("walletManagementExtendedPage"))||1,he=Math.max(Math.ceil(((te==null?void 0:te.data)||[]).length/U),1),Ce=Math.min(ae,he);F(Ce),localStorage.setItem("walletManagementExtendedPage",Ce),X(Ce,te.data||[]);const ce=(Ce-1)*U,ge=(Y=te.data)==null?void 0:Y[ce];g(!1)}else console.log(te.error_message),g(!1),w(te.error_message),f([])}catch(ie){console.error("Error fetching lighter wallet list:",ie),g(!1),w(ie.message)}};m.useEffect(()=>{const pe=()=>{const Y=parseInt(localStorage.getItem("walletManagementExtendedPage"))||1;Y!==R&&L&&Q&&(F(Y),X(Y,I))};return window.addEventListener("storage",pe),()=>{window.removeEventListener("storage",pe)}},[R,I,L,Q]);const X=(pe,Y)=>{if(!Y||Y.length===0){g(!1);return}g(!0);const ie=(pe-1)*U,oe=ie+U,G=Y.slice(ie,oe);f(G)},re=pe=>{pe<1||pe>Math.ceil(I.length/U)||(g(!0),F(pe),localStorage.setItem("walletManagementExtendedPage",pe),X(pe,I))};return i.jsx(i.Fragment,{children:i.jsx(gan,{data:d,loading:x,error:v,socketLoading:C,handlePageChange:re,handleListRequest:J,currentPage:R,allWallets:I,isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s})})},yan="wss://api.hyperliquid.xyz/ws",van=()=>{const e=Mc(),{isConnected:t,address:n}=Jr(),{setSignModalOpen:r,hyperToken:s,setTelegramChatId:a,setSubscriberRole:o,setSubsExpireDay:l,setMushboomerETH:c,setMushboomerSOL:u,setIsReferralCode:d,setIsReferralCodeName:f,setIsWhitelist:x,setHyperToken:g,setHyperAddress:v}=m.useContext(Qr),w=m.useRef(null),C=m.useRef(null),N=m.useRef(null),[I,P]=m.useState([]),[R,F]=m.useState(!1),[U,L]=m.useState(null),[z,Q]=m.useState(!0),[ne,J]=m.useState("null");m.useEffect(()=>{const $e=e.hash;if($e){const it=$e.split("#").filter(Boolean);it[0]==="hyperliquid"?(J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):it[0]==="lighter"?(J("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):it[0]==="extended"?(J("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")):(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER"))}else window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")},[e.hash]);const[X,re]=m.useState([]),[pe,Y]=m.useState([]),[ie,oe]=m.useState([]),[G,V]=m.useState(()=>parseInt(localStorage.getItem("walletManagementPage"))||1),te=5,[ae,he]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?(Ce(),ce(),ge()):(r(!0),P([]),window.localStorage.setItem("walletManagementPage",1))},[t,s]);const Ce=async()=>{try{F(!0);const $e=window.localStorage.getItem("hyperToken");if(!$e){r(!0);return}const it="https://dextrabothypev2.nftinit.io/api/wallet/list",tt=window.localStorage.getItem("hyperAddress"),ft=await(await fetch(it,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():tt,token:$e,balance:"false"})})).json();if(ft.success){oe(ft.data||[]),he(!0);const ct=parseInt(localStorage.getItem("walletManagementPage"))||1,Vt=Math.max(Math.ceil(((ft==null?void 0:ft.data)||[]).length/te),1),It=Math.min(ct,Vt);V(It),localStorage.setItem("walletManagementPage",It),Re(It,ft.data||[])}else console.log(ft.error_message),F(!1),L(ft.error_message)}catch($e){console.error("Error fetching wallet list:",$e),F(!1),L($e.message)}},ce=async()=>{try{F(!0);const $e=window.localStorage.getItem("hyperToken");if(!$e){r(!0);return}const it="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",tt=window.localStorage.getItem("hyperAddress"),ft=await(await fetch(it,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():tt,token:$e})})).json();ft.success&&re(ft.data||[])}catch($e){console.error("Error fetching wallet list:",$e)}},ge=async()=>{try{F(!0);const $e=window.localStorage.getItem("hyperToken");if(!$e){r(!0);return}const it="https://dextrabothypev2.nftinit.io/api/wallet/list-extended",tt=window.localStorage.getItem("hyperAddress"),ft=await(await fetch(it,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():tt,token:$e})})).json();ft.success&&Y(ft.data||[])}catch($e){console.error("Error fetching wallet list:",$e)}},Ae=$e=>$e!=null&&$e.assetPositions?$e.assetPositions.filter(it=>{if(!it.position||!it.position.szi)return!1;const tt=parseFloat(it.position.szi);return!isNaN(tt)&&tt!==0}).map(it=>{const tt=it.position,ot=parseFloat(tt.szi),ft=parseFloat(tt.entryPx),ct=parseFloat(tt.positionValue),Vt=parseFloat(tt.unrealizedPnl),It=parseFloat(tt.returnOnEquity)*100,an=parseFloat(tt.marginUsed),Nt=tt.leverage.value,mn=tt.leverage.type,dn=parseFloat(tt.cumFunding.sinceOpen),Pt=ot>0?"Long":"Short";return{asset:tt.coin,type:Pt,size:ot,entryPrice:ft.toFixed(4),currentPrice:(ct/Math.abs(ot)).toFixed(4),leverage:Nt,leverageType:mn,positionValue:ct.toFixed(2),marginUsed:an.toFixed(2),unrealizedPnl:Vt.toFixed(2),roe:It.toFixed(2),funding:dn.toFixed(4),liquidationPrice:tt.liquidationPx?parseFloat(tt.liquidationPx).toFixed(2):"N/A"}}):[],ye=()=>{w.current&&(console.log("Closing WebSocket connection..."),w.current.readyState===WebSocket.OPEN&&w.current.send(JSON.stringify({method:"unsubscribe",subscription:{type:"webData2"}})),w.current.close(),w.current=null),N.current&&(clearInterval(N.current),N.current=null),C.current&&(clearTimeout(C.current),C.current=null)},je=$e=>{w.current=new WebSocket(yan),w.current.onopen=()=>{console.log("WebSocket Connected"),$e.forEach(it=>{let tt={method:"subscribe",subscription:{type:"webData2",user:it==null?void 0:it.wallet_address}};w.current.send(JSON.stringify(tt))}),N.current=setInterval(()=>{var it;if(((it=w.current)==null?void 0:it.readyState)===WebSocket.OPEN){const tt={id:99,method:"ping"};w.current.send(JSON.stringify(tt))}},3e4)},w.current.onclose=it=>{console.log("WebSocket Disconnected",it.code,it.reason),N.current&&(clearInterval(N.current),N.current=null),it.code!==1e3&&(C.current||(C.current=setTimeout(()=>{C.current=null,je($e)},5e3)))},w.current.onerror=it=>{console.error("WebSocket Error:",it)},w.current.onmessage=it=>{try{const tt=JSON.parse(it.data);if(tt.method==="pong")return;if(tt.result==="success"){console.log("Successfully subscribed to channel");return}tt.channel==="webData2"&&Ie(tt)}catch(tt){console.error("Error processing WebSocket message:",tt),console.error("Raw message that caused error:",it.data),Q(!1)}}},Ie=$e=>{P(it=>{let tt=!1;const ot=it.map(ft=>{var ct,Vt,It,an,Nt,mn,dn,Pt,Xe,Ut,Lt,qe,Ke;if((ft==null?void 0:ft.wallet_address.toLowerCase())===((ct=$e==null?void 0:$e.data)==null?void 0:ct.user.toLowerCase())){const pt=(an=(It=(Vt=$e==null?void 0:$e.data)==null?void 0:Vt.clearinghouseState)==null?void 0:It.assetPositions)==null?void 0:an.reduce((Et,et)=>{var Be;return Et+(parseFloat((Be=et==null?void 0:et.position)==null?void 0:Be.unrealizedPnl)||0)},0),en=Ae((Nt=$e==null?void 0:$e.data)==null?void 0:Nt.clearinghouseState),Bt={...ft,perpEquity:(Pt=(dn=(mn=$e==null?void 0:$e.data)==null?void 0:mn.clearinghouseState)==null?void 0:dn.marginSummary)==null?void 0:Pt.accountValue,unrealizedPnl:pt,withdrawableUsdc:(Ut=(Xe=$e==null?void 0:$e.data)==null?void 0:Xe.clearinghouseState)==null?void 0:Ut.withdrawable,marginUsed:(Ke=(qe=(Lt=$e==null?void 0:$e.data)==null?void 0:Lt.clearinghouseState)==null?void 0:qe.marginSummary)==null?void 0:Ke.totalMarginUsed,positions:en};if(JSON.stringify(ft)!==JSON.stringify(Bt))return tt=!0,Bt}return ft});return tt?ot:it}),setTimeout(()=>{F(!1),Q(!1)},3e3)};m.useEffect(()=>{const $e=()=>{const it=parseInt(localStorage.getItem("walletManagementPage"))||1;it!==G&&ae&&(ye(),V(it),Re(it,ie))};return window.addEventListener("storage",$e),()=>{window.removeEventListener("storage",$e)}},[G,ie,ae]);const Re=($e,it)=>{if(!it||it.length===0){F(!1);return}F(!0);const tt=($e-1)*te,ot=tt+te,ft=it.slice(tt,ot);P(ft),ye(),je(ft)},Qe=$e=>{$e<1||$e>Math.ceil(ie.length/te)||(F(!0),V($e),localStorage.setItem("walletManagementPage",$e),Re($e,ie))};return m.useEffect(()=>()=>{ye()},[e.pathname]),m.useEffect(()=>{(async()=>{var ot,ft;const it=window.localStorage.getItem("hyperToken"),tt=window.localStorage.getItem("hyperAddress");if(!(!it||!tt))try{const ct=await ji(tt.toLowerCase(),it);ct!=null&&ct.success?(a(ct==null?void 0:ct.telegram_chat_id),o(ct==null?void 0:ct.subscriber_role),l(ct==null?void 0:ct.subs_expire_day),c((ot=ct==null?void 0:ct.mushboomer_counts)==null?void 0:ot.eth),u((ft=ct==null?void 0:ct.mushboomer_counts)==null?void 0:ft.sol),d(ct==null?void 0:ct.referral_code),f(ct==null?void 0:ct.refcode),x(ct==null?void 0:ct.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""))}catch(ct){console.error("Token verification error:",ct),console.error(ct.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Wallet Management | Create & Fund Trading Wallets | Dextrabot"}),i.jsx("meta",{name:"description",content:"Create, fund, and manage your follower wallets on Dextrabot. Start copy trading today."}),i.jsx("meta",{name:"og:title",content:"Wallet Management | Create & Fund Trading Wallets | Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Create, fund, and manage your follower wallets on Dextrabot. Start copy trading today."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/wallet-management"})]})}),i.jsx("div",{style:{height:"calc(100vh - 5rem)"},className:"flex justify-center items-center w-full h-auto px-1 pt-1 sm:px-6 sm:pt-2 bg-[#161616] overflow-scroll",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:ne==="HYPER"?i.jsxs(i.Fragment,{children:[i.jsx(can,{data:I,loading:R,error:U,socketLoading:z,handlePageChange:Qe,handleListRequest:Ce,currentPage:G,allWallets:ie,lighterWallet:X,extendedWallet:pe,isSelectMenu:ne,setIsSelectMenu:J}),i.jsx(uan,{data:I,loading:R,error:U,socketLoading:z,handlePageChange:Qe,currentPage:G,allWallets:ie})]}):ne==="LIGHTER"?i.jsx(i.Fragment,{children:i.jsx(xan,{isSelectMenu:ne,setIsSelectMenu:J,hyperWallet:ie,lighterWallet:X,extendedWallet:pe,lighterWalletList:ce})}):i.jsx(i.Fragment,{children:i.jsx(ban,{isSelectMenu:ne,setIsSelectMenu:J,hyperWallet:ie,lighterWallet:X,extendedWallet:pe,fetchAllWalletList:ge})})})})]})};function wan({open:e,setOpen:t,copyTradeDelete:n,isDeleteWallet:r}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manropeleading-7",children:"Confirm Delete"}),i.jsx("div",{className:"w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:"Are you sure you want to delete this copy trade task? This action cannot be undone."})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{n(r.followerWallet,r.sourceWallet,r.platform,r.id)},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Delete"})})]})]})})})})})]})}const YUe=({open:e=!1,setOpen:t=()=>{},checkAccountCopy:n,roleType:r="farming"})=>{const{setSignModalOpen:s,setTelegramChatId:a,setSubscriberRole:o,setSubsExpireDay:l,setMushboomerETH:c,setMushboomerSOL:u,setIsReferralCode:d,setIsReferralCodeName:f,setIsWhitelist:x,setHyperToken:g,setHyperAddress:v}=m.useContext(Qr),{address:w}=Jr(),[C,N]=m.useState(!1),[I,P]=m.useState(!1),[R,F]=m.useState(""),[U,L]=m.useState(""),[z,Q]=m.useState(""),ne=async()=>{var ie,oe;const pe=window.localStorage.getItem("hyperToken"),Y=window.localStorage.getItem("hyperAddress");if(!(!pe||!Y))try{setLoadingCheckAccount(!0);const G=await ji(Y.toLowerCase(),pe);G!=null&&G.success?(a(G==null?void 0:G.telegram_chat_id),o(G==null?void 0:G.subscriber_role),l(G==null?void 0:G.subs_expire_day),c((ie=G==null?void 0:G.mushboomer_counts)==null?void 0:ie.eth),u((oe=G==null?void 0:G.mushboomer_counts)==null?void 0:oe.sol),d(G==null?void 0:G.referral_code),f(G==null?void 0:G.refcode),x(G==null?void 0:G.whitelist),g(pe),v(Y),Q(G==null?void 0:G.farming_tools),setLoadingCheckAccount(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""),setLoadingCheckAccount(!1))}catch(G){console.error("Token verification error:",G),console.error(G.message||"An unknown error occurred."),setLoadingCheckAccount(!1)}},J=async()=>new Sl(window.ethereum).eth.getAccounts(Y=>Y),X=async(pe="farming",Y=24,ie=5e3)=>{Y<=0||(await new Promise(oe=>setTimeout(oe,ie)),await ne(),pe==="farming"&&!z?X(pe,Y-1,ie):n())},re=async()=>{L("");const pe=window.localStorage.getItem("hyperToken"),Y=window.localStorage.getItem("hyperAddress");if(!pe||!w){s(!0);return}P(!0),N(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(G){console.error("Failed to switch network",G),N(!1);return}const ie=new Sl(window.ethereum);var oe=await J();if(oe.length>0?oe=oe[0]:oe=void 0,oe){const V={from:oe,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await ie.eth.sendTransaction(V).then(te=>{console.log("txHash :>> ",te),N(!1),F(te.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:w?w.toLowerCase():Y,token:pe,payment_tx:te.transactionHash,payment_role:r==="bots_extra_slot"?"bots_extra_slot":"farming_tools"})}),ne(),X(r)}).catch(te=>{console.log(te),te.code===-32003||te.message.includes("insufficient funds")?L("Insufficient funds."):te.message==="MetaMask Tx Signature: User denied transaction signature."&&P(!1)})}else await ie.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:I,setOpen:P,transactionHash:R,transactionLoading:C,paymentPresaleRole:z,errorFunds:U,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[51] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>t(!1)}),i.jsx("div",{className:"relative w-[380px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#404040] max-h-[97dvh] overflow-y-auto p-5",children:i.jsxs("div",{className:"flex flex-col w-full gap-8 py-6",children:[i.jsx("div",{className:"mx-auto",children:i.jsx("img",{src:EA,alt:""})}),i.jsx("div",{className:"flex justify-center items-center",children:i.jsx("div",{className:"text-lg font-semibold",children:"Copy Trade"})}),i.jsx("div",{className:"text-center text-[#bdbdbd] text-sm px-6 leading-5 -mt-6",children:"You don't have an active subscription yet. Subscribe now to unlock trading bots, copy trading, and farming tools across multiple DEXs."}),i.jsx("div",{onClick:()=>{re()},className:"flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Subscribe / 0.12 ETH"})]})})]})]})},Can=({loading:e,error:t,trackerData:n,isRequest:r,handleCopyDelete:s,deleteLoading:a,isDeleteModalOpen:o,setIsDeleteModalOpen:l,isDeleteWallet:c,setIsDeleteWallet:u,slotTotalCount:d,checkSlotAccount:f,slotCountWallets:x,subsRole:g,slotCount:v})=>{const{trackedWatchList:w,setSignModalOpen:C}=m.useContext(Qr),{isConnected:N,address:I}=Jr(),[P,R]=m.useState(!1),[F,U]=m.useState(null),[L,z]=m.useState(""),[Q,ne]=m.useState(""),[J,X]=m.useState([]),[re,pe]=m.useState(!1),[Y,ie]=m.useState({}),[oe,G]=m.useState({}),[V,te]=m.useState([]),[ae,he]=m.useState([]),[Ce,ce]=m.useState(null),[ge,Ae]=m.useState(!1),[ye,je]=m.useState(!1),[Ie,Re]=m.useState(!1),[Qe,$e]=m.useState([]),it=m.useRef(null),[tt,ot]=m.useState([]),ft=m.useRef(!1);m.useEffect(()=>{const Be={};n==null||n.forEach(Mt=>{const Ve=`${Mt==null?void 0:Mt.wm_address}_${Mt==null?void 0:Mt.wallet_address}_${Mt==null?void 0:Mt.wallet_id}`;Be[Ve]=Mt==null?void 0:Mt.copy_trait_mode}),ie(Be),!ft.current&&(n==null?void 0:n.length)>0&&(Vt(),ft.current=!0)},[n]),m.useEffect(()=>{if((n==null?void 0:n.length)>0){const Be=[...n];(V==null?void 0:V.length)>0&&V.forEach(Mt=>{var Ve;((Ve=Mt.openPositionCoinList)==null?void 0:Ve.length)>0&&Mt.generated_wallet_public&&!Be.some(ut=>ut.wallet_address.toLowerCase()===Mt.generated_wallet_public.toLowerCase())&&Be.push({wallet_address:Mt.generated_wallet_public})}),he(Mt=>{const Ve=Mt.map(xt=>xt.wallet_address).sort().join(","),ut=Be.map(xt=>xt.wallet_address).sort().join(",");return Ve!==ut?Be:Mt})}},[n,V]);const ct=async(Be,Mt,Ve,ut,xt)=>{const jt=`${Be}_${Mt}_${xt}`;try{const kt=window.localStorage.getItem("hyperToken"),xn="https://dextrabothypev2.nftinit.io/api/test_app/following/status/";kt||C(!0),G(jn=>({...jn,[jt]:!0}));const un=window.localStorage.getItem("hyperAddress"),En=await(await fetch(xn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():un,token:kt,follow_address:Mt==null?void 0:Mt.toLowerCase(),copy_trait_mode:Ve,target_platform:ut,wallet_id:xt})})).json();En.success?(ie(jn=>({...jn,[jt]:Ve})),f()):(console.log(En.error_message),ln.error(En.error_message))}catch(kt){console.error("Error status mode:",kt),ln.error(kt.message||"Something went wrong!")}finally{G(kt=>({...kt,[jt]:!1}))}},Vt=async()=>{try{const Be=window.localStorage.getItem("hyperToken"),Mt=window.localStorage.getItem("hyperAddress"),Ve="https://dextrabothypev2.nftinit.io/api/wallet/generated_wallet_summary";Be||C(!0);const ut=await fetch(Ve,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():Mt,token:Be})});if(!ut.ok)throw new zl(`Server responded with status ${ut.status}`);const xt=await ut.json();xt.success?te(xt.data):(console.log(xt.error_message),ln.error(xt.error_message))}catch(Be){console.error("Error in like function:",Be),ln.error(Be.message||"Something went wrong!")}},It="tag",[an,Nt]=m.useState(It),mn=(Be,Mt,Ve,ut)=>Be!=null&&Be.length?[...Be].sort((xt,jt)=>{var Kn,ir,rr,Jt;if(!Y||Object.keys(Y).length===0)return 0;const kt=`${xt.wm_address}_${xt.wallet_address}_${xt.wallet_id}`,xn=`${jt.wm_address}_${jt.wallet_address}_${jt.wallet_id}`;if(Y!=null&&Y[kt]&&!(Y!=null&&Y[xn]))return-1;if(!(Y!=null&&Y[kt])&&(Y!=null&&Y[xn]))return 1;const un=Ve.find(Un=>Un.wallet_address===xt.wallet_address)||{},On=Ve.find(Un=>Un.wallet_address===jt.wallet_address)||{},En=Ve.find(Un=>{var Qn,Rt;return((Qn=Un.wallet_address)==null?void 0:Qn.toLowerCase())===((Rt=xt==null?void 0:xt.wm_address)==null?void 0:Rt.toLowerCase())})||{},jn=Ve.find(Un=>{var Qn,Rt;return((Qn=Un.wallet_address)==null?void 0:Qn.toLowerCase())===((Rt=jt==null?void 0:jt.wm_address)==null?void 0:Rt.toLowerCase())})||{},bn=un.data?un.data.reduce((Un,Qn)=>Un+parseFloat(Qn.unrealizedPnl||0),0):0,Zn=On.data?On.data.reduce((Un,Qn)=>Un+parseFloat(Qn.unrealizedPnl||0),0):0,zn=ut==null?void 0:ut.find(Un=>{var Qn,Rt,Pn,Ee;return((Qn=Un==null?void 0:Un.generated_wallet_public)==null?void 0:Qn.toLowerCase())===((Rt=xt==null?void 0:xt.wm_address)==null?void 0:Rt.toLowerCase())&&((Pn=Un==null?void 0:Un.copy_trader_wallet)==null?void 0:Pn.toLowerCase())===((Ee=xt==null?void 0:xt.wallet_address)==null?void 0:Ee.toLowerCase())}),$n=ut==null?void 0:ut.find(Un=>{var Qn,Rt,Pn,Ee;return((Qn=Un==null?void 0:Un.generated_wallet_public)==null?void 0:Qn.toLowerCase())===((Rt=jt==null?void 0:jt.wm_address)==null?void 0:Rt.toLowerCase())&&((Pn=Un==null?void 0:Un.copy_trader_wallet)==null?void 0:Pn.toLowerCase())===((Ee=jt==null?void 0:jt.wallet_address)==null?void 0:Ee.toLowerCase())}),nr=zn?zn.total_pnl:0,wn=$n?$n.total_pnl:0,on=zn&&((Kn=zn.openPositionCoinList)==null?void 0:Kn.length)>0&&((ir=En.data)==null?void 0:ir.length)>0?zn.openPositionCoinList.reduce((Un,Qn)=>{const Rt=En.data.find(Pn=>Pn.asset===Qn);return Rt!=null&&Rt.unrealizedPnl?Un+parseFloat(Rt.unrealizedPnl):Un},0):0,Oe=$n&&((rr=$n.openPositionCoinList)==null?void 0:rr.length)>0&&((Jt=jn.data)==null?void 0:Jt.length)>0?$n.openPositionCoinList.reduce((Un,Qn)=>{const Rt=jn.data.find(Pn=>Pn.asset===Qn);return Rt!=null&&Rt.unrealizedPnl?Un+parseFloat(Rt.unrealizedPnl):Un},0):0,rn=xt.tag?xt.tag.toUpperCase():"",cn=jt.tag?jt.tag.toUpperCase():"",_t=xt.wm_name?xt.wm_name.toUpperCase():"",Yn=jt.wm_name?jt.wm_name.toUpperCase():"",yn=xt.wallet_address?xt.wallet_address.toLowerCase():"",Dt=jt.wallet_address?jt.wallet_address.toLowerCase():"",sn=xt.wm_address?xt.wm_address.toLowerCase():"",Tn=jt.wm_address?jt.wm_address.toLowerCase():"";return Mt==="tag"?rn<cn?-1:rn>cn?1:0:Mt==="-tag"?rn>cn?-1:rn<cn?1:0:Mt==="-wallet_address"?yn<Dt?-1:yn>Dt?1:0:Mt==="wallet_address"?yn>Dt?-1:yn<Dt?1:0:Mt==="-wm_address"?sn<Tn?-1:sn>Tn?1:0:Mt==="wm_address"?sn>Tn?-1:sn<Tn?1:0:Mt==="perp_equity"?(un.perp_equity||0)-(On.perp_equity||0):Mt==="-perp_equity"?(On.perp_equity||0)-(un.perp_equity||0):Mt==="margin_usage"?(un.margin_usage||0)-(On.margin_usage||0):Mt==="-margin_usage"?(On.margin_usage||0)-(un.margin_usage||0):Mt==="unrealizedPnl"?bn-Zn:Mt==="-unrealizedPnl"?Zn-bn:Mt==="-wm_name"?_t<Yn?-1:_t>Yn?1:0:Mt==="wm_name"?_t>Yn?-1:_t<Yn?1:0:Mt==="total_pnl"?nr-wn:Mt==="-total_pnl"?wn-nr:Mt==="totalUnrealizedPnl"?on-Oe:Mt==="-totalUnrealizedPnl"?Oe-on:Mt==="-created_at"?new Date(jt.created_at)-new Date(xt.created_at):Mt==="created_at"?new Date(xt.created_at)-new Date(jt.created_at):0}):[];m.useEffect(()=>{if(!(n!=null&&n.length))return;const Be=n.filter(Mt=>!!(!(Qe!=null&&Qe.length)||Qe.includes("HyperLiquid")&&Mt.target_platform==="hyper"||Qe.includes("Lighter")&&Mt.target_platform==="lighter"));ot(mn(Be,an,J,V))},[an,n,Qe]);const dn=async(Be,Mt)=>{try{z(Be),ne(Mt);const Ve=window.localStorage.getItem("hyperToken"),ut=window.localStorage.getItem("hyperAddress"),xt="https://dextrabothypev2.nftinit.io/api/test_app/following/info/";Ve||C(!0);const jt=await fetch(xt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():ut,token:Ve,follow_address:Be.toLowerCase()})});if(!jt.ok)throw new zl(`Server responded with status ${jt.status}`);const kt=await jt.json();kt.success?(U(Array.isArray(kt==null?void 0:kt.data)?[...kt.data].sort((xn,un)=>new Date(un.created_at||0)-new Date(xn.created_at||0)):kt==null?void 0:kt.data),R(!0)):(console.log(kt.error_message),ln.error(kt.error_message))}catch(Ve){console.error("Error in like function:",Ve),ln.error(Ve.message||"Something went wrong!")}},Pt=Be=>Be!=null&&Be.assetPositions?Be.assetPositions.filter(Mt=>{if(!Mt.position||!Mt.position.szi)return!1;const Ve=parseFloat(Mt.position.szi);return!isNaN(Ve)&&Ve!==0}).map(Mt=>{const Ve=Mt.position,ut=parseFloat(Ve.szi),xt=parseFloat(Ve.entryPx),jt=parseFloat(Ve.positionValue),kt=parseFloat(Ve.unrealizedPnl),xn=parseFloat(Ve.returnOnEquity)*100,un=parseFloat(Ve.marginUsed),On=Ve.leverage.value,En=parseFloat(Ve.cumFunding.sinceOpen),jn=ut>0?"Long":"Short";return{asset:Ve.coin,type:jn,size:Math.abs(ut),entryPrice:xt.toFixed(2),currentPrice:(jt/Math.abs(ut)).toFixed(2),leverage:On,positionValue:jt.toFixed(2),marginUsed:un.toFixed(2),unrealizedPnl:kt.toFixed(2),roe:xn.toFixed(2),funding:En.toFixed(4),liquidationPrice:Ve.liquidationPx?parseFloat(Ve.liquidationPx).toFixed(2):"N/A"}}):[],Xe=async Be=>{try{const Ve=await ds.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:Be});if(Ve.data){const ut=Pt(Ve.data);X(xt=>{var jt,kt,xn,un;return[...xt,{wallet_address:Be,perp_equity:(kt=(jt=Ve==null?void 0:Ve.data)==null?void 0:jt.marginSummary)==null?void 0:kt.accountValue,margin_usage:parseFloat((xn=Ve==null?void 0:Ve.data)==null?void 0:xn.marginSummary.totalMarginUsed)/parseFloat((un=Ve==null?void 0:Ve.data)==null?void 0:un.marginSummary.accountValue),data:ut}]})}}catch(Mt){console.error("Error fetching user state from HyperState:",Mt)}},Ut=async Be=>{try{const Mt=window.localStorage.getItem("hyperToken"),Ve=window.localStorage.getItem("hyperAddress"),xt=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/getclearinghousestate/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():Ve,token:Mt,follow_address:Be.toLowerCase()})});if(xt.ok){const jt=await xt.json();if(jt.success){const kt=Pt(jt==null?void 0:jt.data);X(xn=>{var un;return[...xn,{wallet_address:Be,perp_equity:(un=jt==null?void 0:jt.data.marginSummary)==null?void 0:un.accountValue,margin_usage:parseFloat(jt==null?void 0:jt.data.marginSummary.totalMarginUsed)/parseFloat(jt==null?void 0:jt.data.marginSummary.accountValue),data:kt}]})}}else if(xt.status===500)console.warn(`Received 500 error for ${Be}, retrying with getUserHyperState`),await Xe(Be);else throw new zl(`Request failed with status ${xt.status}`)}catch(Mt){console.error("Error fetching user state:",Mt)}},Lt=m.useRef(new Set);m.useEffect(()=>{!e&&r&&(ae==null?void 0:ae.length)>0&&(async()=>{var Ve;const Mt=new Set;for(let ut=0;ut<ae.length;ut++){const xt=ae[ut],jt=(Ve=xt==null?void 0:xt.wallet_address)==null?void 0:Ve.toLowerCase();if(!(!jt||Lt.current.has(jt))){Mt.add(jt),Lt.current.add(jt);try{await Ut(jt)}catch(kt){console.error(`Error fetching user state for wallet ${jt}:`,kt)}await new Promise(kt=>setTimeout(kt,500))}}})()},[r,e,ae]),m.useEffect(()=>{P||f()},[P]);const qe=m.useRef(null),Ke=()=>{qe.current&&(qe.current.scrollLeft-=100)},pt=()=>{qe.current&&(qe.current.scrollLeft+=100)},en=()=>{qe.current&&(qe.current.scrollTop+=200)},Bt=()=>{qe.current&&(qe.current.scrollTop-=200)},Et=["HyperLiquid","Lighter"],et=Be=>{$e(Mt=>Mt.includes(Be)?Mt.filter(Ve=>Ve!==Be):[...Mt,Be])};return m.useEffect(()=>{function Be(Mt){it.current&&!it.current.contains(Mt.target)&&Re(!1)}return document.addEventListener("mousedown",Be),()=>document.removeEventListener("mousedown",Be)},[]),i.jsxs(i.Fragment,{children:[i.jsx(v5,{open:P,setOpen:R,copyTradeData:F,copyTradeWallet:L,setCopyTradeWallet:z,setCopyTradeData:U,sourcePage:Q}),i.jsx(wan,{open:o,setOpen:l,copyTradeDelete:s,isDeleteWallet:c}),ge&&Na.createPortal(i.jsx(Ale,{open:ge,setOpen:Ae,oldSlotCount:Ce,checkAccountTrade:f,tradeMarket:"copyTrade"}),document.body),ye&&Na.createPortal(i.jsx(YUe,{open:ye,setOpen:je,checkAccountCopy:f}),document.body),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full font-manrope",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] pl-2 sm:pl-0 pt-4",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Copy Trade"})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute hidden -top-6 right-4 z-10 lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:Ke,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:pt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:Bt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:en,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-full overflow-x-scroll relative overflow-y-scroll flex-grow",ref:qe,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[95px] sm:min-w-[95px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Status"})})}),i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] left-[95px] h-8 px-1 min-w-[130px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Actions"})})}),i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] left-[225px] h-8 px-1 min-w-[75px] z-[8]",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:[i.jsx("div",{className:"flex items-center justify-start",children:"DEX"}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>{Re(!Ie)},className:`${Qe.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${Qe.length>0?"text-blue-500":"text-white"}`})}),Ie&&i.jsxs("div",{ref:it,className:`absolute left-[58px] mt-32 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>$e(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),Et==null?void 0:Et.map(Be=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px] mt-2",children:[i.jsx("input",{type:"checkbox",checked:Qe.includes(Be),onChange:()=>et(Be),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${Qe.includes(Be)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:Qe.includes(Be)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Be]},Be))]})]})]})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] lg:left-[300px] h-10 px-1 min-w-[130px] z-[7]",children:i.jsx(di,{title:"Follower Name",sortKey:"wm_name",sortOption:an,setSortOption:Nt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[145px] z-[8]",children:i.jsx(di,{title:"Follower Wallet",sortKey:"wm_address",sortOption:an,setSortOption:Nt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[130px]",children:i.jsx(di,{title:"Source Tag",sortKey:"tag",sortOption:an,setSortOption:Nt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[140px] z-[8]",children:i.jsx(di,{title:"Source Wallet",sortKey:"wallet_address",sortOption:an,setSortOption:Nt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] pl-1",children:i.jsx(di,{title:"Follower PnL",sortKey:"total_pnl",sortOption:an,setSortOption:Nt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] pl-1",children:i.jsx(di,{title:"Follower uPnL",sortKey:"totalUnrealizedPnl",sortOption:an,setSortOption:Nt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[115px] sm:min-w-[115px] pl-1",children:i.jsx(di,{title:"Perp Equity",sortKey:"perp_equity",sortOption:an,setSortOption:Nt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[130px] pl-1",children:i.jsx(di,{title:"Margin Usage",sortKey:"margin_usage",sortOption:an,setSortOption:Nt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[114px] sm:min-w-[114px] pl-1",children:i.jsx(di,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:an,setSortOption:Nt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[124px] sm:min-w-[124px] pl-1",children:i.jsx(di,{title:"Created Date",sortKey:"created_at",sortOption:an,setSortOption:Nt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[100px] pl-1 pr-4",children:i.jsx("div",{className:"flex items-center justify-center gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"cursor-pointer flex items-center justify-end group"})})})]})}),i.jsx("tbody",{children:!n||e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:12,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Da,{})})})}):t&&!n?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:13,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center ml-[33%] w-max",children:i.jsx(zl,{})})})}):(n==null?void 0:n.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:13,children:i.jsx("div",{className:"flex min-h-[44vh] h-66 flex-col justify-center items-center ml-[33%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You haven't added a wallet to your copied wallet list yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["To start copy trading, please visit the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","page."]})]})]})]})})})})}):tt==null?void 0:tt.map((Be,Mt)=>{var un,On,En,jn,bn;const Ve=J.find(Zn=>Zn.wallet_address===Be.wallet_address),ut=J.find(Zn=>Zn.wallet_address===(Be==null?void 0:Be.wm_address)),xt=V==null?void 0:V.find(Zn=>{var zn,$n,nr,wn;return((zn=Zn==null?void 0:Zn.generated_wallet_public)==null?void 0:zn.toLowerCase())===(($n=Be==null?void 0:Be.wm_address)==null?void 0:$n.toLowerCase())&&((nr=Zn==null?void 0:Zn.copy_trader_wallet)==null?void 0:nr.toLowerCase())===((wn=Be==null?void 0:Be.wallet_address)==null?void 0:wn.toLowerCase())}),jt=xt?xt.total_pnl:null;let kt=0;xt&&((un=xt==null?void 0:xt.openPositionCoinList)==null?void 0:un.length)>0&&((On=ut==null?void 0:ut.data)==null?void 0:On.length)>0&&((En=xt==null?void 0:xt.openPositionCoinList)==null||En.forEach(Zn=>{var $n;const zn=($n=ut==null?void 0:ut.data)==null?void 0:$n.find(nr=>{var wn;return((wn=nr==null?void 0:nr.asset)==null?void 0:wn.toLowerCase().trim())===(Zn==null?void 0:Zn.toLowerCase().trim())});zn&&(zn!=null&&zn.unrealizedPnl)&&(kt+=parseFloat(zn==null?void 0:zn.unrealizedPnl))}));const xn=`${Be.follower_wallet}_${Be.wallet_address}_${Be.wallet_id}`;return i.jsxs("tr",{className:`${Mt%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Mt%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:(()=>{const Zn=x==null?void 0:x.includes(Be.wallet_id),zn=`${Be==null?void 0:Be.wm_address}_${Be==null?void 0:Be.wallet_address}_${Be==null?void 0:Be.wallet_id}`,$n=d===0&&!Y[zn]&&!Zn,nr=g;return i.jsxs("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2.5 pl-2 h-14 max-h-14 relative",children:[i.jsxs("div",{className:"relative group/switch",children:[i.jsx(jo,{checked:!!Y[zn],onChange:()=>{if(!nr&&(Be==null?void 0:Be.target_platform)==="lighter"){je(!0);return}if($n&&(Be==null?void 0:Be.target_platform)==="lighter"){ce(v),Ae(!0);return}ct(Be==null?void 0:Be.wm_address,Be.wallet_address,!Y[zn],Be==null?void 0:Be.target_platform,Be==null?void 0:Be.wallet_id)},disabled:oe[zn],className:`${Y[zn]?"bg-[#1DE674]":"bg-[#353535]"} ${oe[zn]?"cursor-not-allowed":"cursor-pointer"} flex h-[18px] w-[28px] rounded-[256px] p-1 transition-colors`,children:i.jsx("span",{"aria-hidden":"true",className:`${Y[zn]?"translate-x-1.5 bg-white":"-translate-x-[1px] bg-[#D5D5D5]"} inline-block size-[14px] -mt-[3px] rounded-full shadow-lg transition`})}),!nr&&(Be==null?void 0:Be.target_platform)==="lighter"?i.jsx("div",{className:"absolute -left-1 translate-x-0 top-[-34px] px-2 py-1 text-xs rounded-md bg-[#353535] text-white whitespace-nowrap opacity-0 group-hover/switch:opacity-100 transition duration-200",children:"Subscribe"}):$n&&(Be==null?void 0:Be.target_platform)==="lighter"&&i.jsx("div",{className:"absolute -left-1 translate-x-0 top-[-34px] px-2 py-1 text-xs rounded-md bg-[#353535] text-white whitespace-nowrap opacity-0 group-hover/switch:opacity-100 transition duration-200",children:"Get more slots"})]}),oe[zn]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):Y[zn]?"On":"Off"]})})()}),i.jsx("td",{scope:"row",className:`${Mt%2==0,"bg-[#161616]"} sm:sticky left-[95px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-0.5 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{onClick:()=>{dn(Be==null?void 0:Be.wallet_address,Be==null?void 0:Be.wallet_id)},className:`${n!=null&&n.some(Zn=>Zn.wallet_address===(Be==null?void 0:Be.wallet_address))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} h-[22px] rounded-[256px] justify-center items-center gap-1 inline-flex cursor-pointer text-xs font-['Manrope'] leading-[8px] tracking-tight px-2 min-w-max`,children:"Copy Trade"}),i.jsx(y5,{walletAddress:Be==null?void 0:Be.wallet_address,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:w.some(Zn=>Zn.wallet_address===(Be==null?void 0:Be.wallet_address))?i.jsx("img",{src:a5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${Mt%2==0,"bg-[#161616]"} sm:sticky left-[225px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-5 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:(Be==null?void 0:Be.target_platform)==="lighter"?i.jsx(pi,{content:"Lighter",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"})})}):(Be==null?void 0:Be.target_platform)==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(pi,{content:"Hyperliquid",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("img",{src:dx,alt:"",className:"w-4 h-4 text-[#fff]"})})})}):i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(pi,{content:"Dextrabot",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("img",{src:qi,alt:"",className:"w-4 h-4 text-[#fff]"})})})})})})}),i.jsx("td",{scope:"row",className:`${Mt%2===0,"bg-[#161616]"} sm:sticky lg:left-[300px] z-[1] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:[i.jsx(aa,{info1:Be!=null&&Be.wm_name?(Be==null?void 0:Be.wm_name.length)>=13?(Be==null?void 0:Be.wm_name).slice(0,13)+"...":Be==null?void 0:Be.wm_name:"--",info1_Color:"text-white",rowTwo:!1}),(Be==null?void 0:Be.wm_name)&&(Be==null?void 0:Be.wm_name.length)>=13&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(Fa,{content:`${Be==null?void 0:Be.wm_name}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${Mt%2===0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Be==null?void 0:Be.wm_address}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Be==null?void 0:Be.wm_address).slice(0,5)+"..."+(Be==null?void 0:Be.wm_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Zn=>{Zn.stopPropagation(),navigator.clipboard.writeText(Be==null?void 0:Be.wm_address),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})})})}),i.jsx("td",{scope:"row",className:`${Mt%2===0,"bg-[#161616]"} group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:[i.jsx(aa,{info1:Be!=null&&Be.tag?(Be==null?void 0:Be.tag.length)>=10?(Be==null?void 0:Be.tag).slice(0,10)+"...":Be==null?void 0:Be.tag:"--",info1_Color:"text-white",rowTwo:!1}),(Be==null?void 0:Be.tag)&&(Be==null?void 0:Be.tag.length)>=10&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(Fa,{content:`${Be==null?void 0:Be.tag}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${Mt%2===0,"bg-[#161616]"} group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Be==null?void 0:Be.wallet_address}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(aa,{info1:`${(Be==null?void 0:Be.wallet_address).slice(0,5)+"..."+(Be==null?void 0:Be.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Zn=>{Zn.stopPropagation(),navigator.clipboard.writeText(Be==null?void 0:Be.wallet_address),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})})})}),i.jsx("td",{children:i.jsx(Sh,{info:jt!==null?`$${Cr(Math.abs(jt))}`:"--",textColor:`${jt>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`})}),i.jsx("td",{children:i.jsx(Sh,{info:xt?`$${Cr(Math.abs(kt))}`:"--",textColor:`${kt>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`})}),i.jsx("td",{children:re?i.jsx(Sh,{info:"Loading...",textColor:"text-white"}):Ve?i.jsx(Sh,{info:(Ve==null?void 0:Ve.perp_equity)!=0?`$${Cr(Ve==null?void 0:Ve.perp_equity)}`:"$0",textColor:"text-white"}):i.jsx(Sh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:re?i.jsx(Sh,{info:"Loading...",textColor:"text-white"}):Ve?i.jsx(Sh,{info:isNaN(Ve==null?void 0:Ve.margin_usage)?"0%":`${((Ve==null?void 0:Ve.margin_usage)*100).toFixed(2)}%`,textColor:"text-white"}):i.jsx(Sh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:re?i.jsx(Sh,{info:"Loading...",textColor:"text-white"}):Ve?i.jsx(Sh,{info:(Ve==null?void 0:Ve.data)!=0?`$${Cr(Math.abs((jn=Ve==null?void 0:Ve.data)==null?void 0:jn.reduce((Zn,zn)=>Zn+parseFloat(zn.unrealizedPnl||0),0)))}`:"$0",textColor:`${((bn=Ve==null?void 0:Ve.data)==null?void 0:bn.reduce((Zn,zn)=>Zn+parseFloat(zn.unrealizedPnl),0))>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`}):i.jsx(Sh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:i.jsx(Sh,{info:(Be==null?void 0:Be.created_at)&&h3(Be==null?void 0:Be.created_at),textColor:"text-white"})}),i.jsx("td",{className:"pr-4",children:i.jsx("div",{className:"pl-1 flex flex-col items-end gap-2 font-manrope",children:a[xn]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{u({followerWallet:Be==null?void 0:Be.wm_address,sourceWallet:Be==null?void 0:Be.wallet_address,platform:Be==null?void 0:Be.target_platform,id:Be==null?void 0:Be.wallet_id}),l(!0)},className:"h-5 px-2 py-1.5 rounded-md border border-white justify-start items-center gap-2 inline-flex",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight cursor-pointer",children:"Delete"})})})})]},Mt)})})]})})]})]})]})},Sh=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:e})}),San=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),{isConnected:s,address:a}=Jr(),{copyTradeWatchList:o,getCopyTradeWatchList:l,trackedWatchList:c,getTrackedWatchList:u,copyWatchListLoading:d,copyWatchListError:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setIsWhitelist:C,setMushboomerSOL:N,setIsReferralCode:I,setIsReferralCodeName:P,setHyperToken:R,setHyperAddress:F,hyperToken:U}=m.useContext(Qr),[L,z]=m.useState({}),[Q,ne]=m.useState(!1),[J,X]=m.useState({followerWallet:"",sourceWallet:"",platform:"",id:null}),[re,pe]=m.useState(0),[Y,ie]=m.useState([]),[oe,G]=m.useState(""),[V,te]=m.useState(0);m.useEffect(()=>{U&&(l(),u(),t(!0),r(!0))},[U]);const ae=async()=>{var Ae,ye,je,Ie;const ce=window.localStorage.getItem("hyperToken"),ge=window.localStorage.getItem("hyperAddress");if(!(!ce||!ge))try{const Re=await ji(ge.toLowerCase(),ce);Re!=null&&Re.success?(x(Re==null?void 0:Re.telegram_chat_id),g(Re==null?void 0:Re.subscriber_role),v(Re==null?void 0:Re.subs_expire_day),w((Ae=Re==null?void 0:Re.mushboomer_counts)==null?void 0:Ae.eth),N((ye=Re==null?void 0:Re.mushboomer_counts)==null?void 0:ye.sol),I(Re==null?void 0:Re.referral_code),P(Re==null?void 0:Re.refcode),C(Re==null?void 0:Re.whitelist),pe((je=Re==null?void 0:Re.copy_trade_slots_info)==null?void 0:je.total_slot_count),ie(Re==null?void 0:Re.copy_trade_slots_wallets),G(Re==null?void 0:Re.farming_tools),te((Ie=Re==null?void 0:Re.copy_trade_slots_info)==null?void 0:Ie.extra_slot_count)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),R(""),F(""))}catch(Re){console.error("Token verification error:",Re)}};m.useEffect(()=>{ae()},[]);const he=async(ce,ge,Ae,ye)=>{const je=`${ce}_${ge}_${ye}`;try{const Ie=window.localStorage.getItem("hyperToken"),Re="https://dextrabothypev2.nftinit.io/api/test_app/following/unfollow/";if(!Ie||!ge||!Ae||!ye||!ce)throw new Error("Required information is missing. Please log in or connect your wallet.");z(tt=>({...tt,[je]:!0}));const Qe=window.localStorage.getItem("hyperAddress"),$e=await fetch(Re,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Qe,token:Ie,follow_address:ge.toLowerCase(),target_platform:Ae,wallet_id:ye})});if(!$e.ok)throw new Error(`Failed to unlike: ${$e.status} ${$e.statusText}`);const it=await $e.json();it.success?(z(tt=>({...tt,[je]:!1})),l(),ne(!1),X({followerWallet:"",sourceWallet:"",platform:"",id:null}),ae(),ln.success(`${ge==null?void 0:ge.slice(0,5)}...${ge==null?void 0:ge.slice(-3)} removed from watchlist`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(ln.error(it.error_message),z(tt=>({...tt,[je]:!1})),ne(!1))}catch(Ie){ln.error(Ie.message||"Something went wrong!"),z(Re=>({...Re,[je]:!1})),ne(!1)}},Ce=!!window.localStorage.getItem("hyperToken");return i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsx(Ho,{children:Ce?i.jsxs(i.Fragment,{children:[i.jsx("title",{children:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{name:"description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:title",content:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/copy-trade"})]}):i.jsxs(i.Fragment,{children:[i.jsx("title",{children:"Dextrabot Copy Trading | Automate Hyperliquid Trading with Top Performers"}),i.jsx("meta",{name:"description",content:"Replicate top Hyperliquid traders automatically with Dextrabot's advanced copy trading system. Set custom risk parameters, position sizing, and selective token filtering for precise portfolio control."}),i.jsx("meta",{property:"og:title",content:"Dextrabot Copy Trading | Automate Hyperliquid Trading with Top Performers"}),i.jsx("meta",{property:"og:description",content:"Replicate top Hyperliquid traders automatically with Dextrabot's advanced copy trading system. Set custom risk parameters, position sizing, and selective token filtering for precise portfolio control."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/copy-trade"})]})})}),i.jsx("div",{style:{height:"calc(100vh - 5rem)"},className:"flex justify-center items-center w-full h-full px-1 pt-1 sm:px-6 sm:pt-6 bg-[#161616] overflow-hidden",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:Ce?i.jsx(Can,{loading:d,error:f,trackerData:o,isRequest:e,handleCopyDelete:he,deleteLoading:L,isDeleteModalOpen:Q,setIsDeleteModalOpen:ne,isDeleteWallet:J,setIsDeleteWallet:X,slotTotalCount:re,checkSlotAccount:ae,slotCountWallets:Y,subsRole:oe,slotCount:V}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(dU,{})})})})]})},Nan=({volumeLeaderboardData:e,userData:t,currentPage:n=1,rowsPerPage:r=25})=>{const[s,a]=m.useState([]),[o,l]=m.useState({key:null,direction:"asc"}),c=localStorage.getItem("hyperAddress");localStorage.getItem("hyperToken");const u=(t==null?void 0:t.refCode)||(t==null?void 0:t.refcode)||(typeof window<"u"?window.localStorage.getItem("refcode"):"")||"";m.useEffect(()=>{const x=c?c.toLowerCase():null,g=e.map(v=>{const w=v.out_subscriber_address?v.out_subscriber_address.toLowerCase():null,C=v.owner||x&&w===x;return{...v,owner:!!C,refCode:C&&u?u:v.refCode||v.refcode||null,referral_xp:v.referral_xp??v.calculated_xp??v.overall_point_result??0}});a(g)},[e,c,u]);const d=x=>{let v=["overall_point_result","referral_xp"].includes(x)?"desc":"asc";o.key===x&&(v=o.direction==="asc"?"desc":"asc");const w=[...s].sort((C,N)=>{const I=parseFloat(C[x])||0,P=parseFloat(N[x])||0;return I<P?v==="asc"?-1:1:I>P?v==="asc"?1:-1:0});a(w),l({key:x,direction:v})},f=x=>o.key!==x?i.jsx(P3,{className:"inline ml-2 text-white"}):o.direction==="asc"?i.jsx(I3,{className:"inline ml-2 text-white"}):i.jsx(T3,{className:"inline ml-2 text-white"});return i.jsx("div",{className:"overflow-x-auto mobile-scroll-indicator",children:i.jsxs("table",{className:"w-full text-white min-w-[900px]",children:[i.jsx("thead",{className:"text-left",children:i.jsxs("tr",{children:[i.jsxs("th",{className:"px-3 sm:px-6 py-3 sm:py-4 cursor-pointer flex items-center text-gray-300 font-semibold text-xs sm:text-sm",onClick:()=>d("ranking"),children:["# ",f("ranking")]}),i.jsx("th",{className:"px-3 sm:px-6 py-3 sm:py-4 text-gray-300 font-semibold text-xs sm:text-sm",children:"Wallet"}),i.jsxs("th",{className:"px-3 sm:px-6 py-3 sm:py-4 cursor-pointer text-gray-300 font-semibold text-xs sm:text-sm",onClick:()=>d("overall_point_result"),children:[i.jsx("span",{className:"hidden sm:inline",children:"XP"}),i.jsx("span",{className:"sm:hidden",children:"Points"})," ",f("overall_point_result")]}),i.jsxs("th",{className:"px-3 sm:px-6 py-3 sm:py-4 cursor-pointer text-gray-300 font-semibold text-xs sm:text-sm",onClick:()=>d("referral_xp"),children:[i.jsx("span",{className:"hidden sm:inline",children:"Referral XP"}),i.jsx("span",{className:"sm:hidden",children:"Ref XP"})," ",f("referral_xp")]})]})}),i.jsx("tbody",{children:s.slice((n-1)*r,n*r).map((x,g)=>{const v=(n-1)*r+g,w=v%2===0?"bg-[#1b1b1b]":"bg-[#1f1f1f]",C=x.owner?"bg-[#162720] ring-1 ring-emerald-400/30":"";return i.jsxs("tr",{className:`${w} ${C} group text-white transition-colors hover:bg-[#222222]`,children:[i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsx("span",{className:"text-sm sm:text-lg font-bold",children:x.ranking||"Unranked"})}),i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsxs("div",{className:"flex items-center gap-2 text-white",children:[i.jsx("span",{className:"font-mono text-xs sm:text-sm",children:GD(x.out_subscriber_address)}),x.owner&&i.jsx("span",{className:"text-[10px] uppercase tracking-wide text-[#67FFBD] bg-[#132822] border border-emerald-400/40 rounded-full px-2 py-0.5",children:"You"})]})}),i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsx("span",{className:"text-xs sm:text-sm",children:Cr(x.calculated_xp||0)})}),i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsx("span",{className:"text-xs sm:text-sm",children:Cr(x.referral_xp??x.calculated_xp??0)})})]},v)})})]})})},Aan=({pnlLeaderboardData:e,userData:t,currentPage:n=1,rowsPerPage:r=25})=>{var x,g,v,w;const[s,a]=m.useState([]),o=localStorage.getItem("hyperAddress"),l=localStorage.getItem("hyperToken"),[c,u]=m.useState({key:null,direction:"asc"});m.useEffect(()=>{a(e)},[e]);const d=C=>{let N="asc";c.key===C&&c.direction==="asc"&&(N="desc");const I=[...s].sort((P,R)=>{const F=parseFloat(P[C])||0,U=parseFloat(R[C])||0;return F<U?N==="asc"?-1:1:F>U?N==="asc"?1:-1:0});a(I),u({key:C,direction:N})},f=C=>c.key!==C?i.jsx(P3,{className:"inline ml-2 text-white"}):c.direction==="asc"?i.jsx(I3,{className:"inline ml-2 text-white"}):i.jsx(T3,{className:"inline ml-2 text-white"});return i.jsx("div",{className:"mx-auto w-full sm:w-4/6 overflow-x-auto shadow-lg mt-[24px] h-[100vh] overflow-auto rounded-xl bg-[#161616]",children:i.jsxs("table",{className:"table-fixed min-w-full text-white border-separate border-spacing-y-2 rounded-xl",children:[i.jsx("thead",{className:"text-left sticky -top-1 z-10",children:i.jsxs("tr",{className:"text-white font-manrope text-[14px] font-semibold leading-[13px] tracking-[0.26px] bg-[#161616]",children:[i.jsxs("th",{className:"px-4 py-3 cursor-pointer flex items-center",onClick:()=>d("ranked"),children:["# ",f("ranked")]}),i.jsx("th",{className:"px-4 py-3",children:"Wallet"}),i.jsxs("th",{className:"flex items-center px-4 py-3",children:[i.jsx("span",{className:"text-[#67FFBD] [text-shadow:0px_0px_8px_rgba(103,255,189,0.48)] font-manrope text-[14px] not-italic font-semibold leading-[32px] tracking-[0.56px]",children:"Booster"}),i.jsx("img",{src:Xbt,alt:"Dextrabot"})]}),i.jsxs("th",{className:"px-4 py-3 cursor-pointer relative",onClick:()=>d("daily_point_result"),children:["Points 24h",f("daily_point_result")]}),i.jsxs("th",{className:"flex justify-end items-center px-4 py-3 cursor-pointer relative",onClick:()=>d("total_pnl"),children:[i.jsx("span",{className:"text-[#D65AFF] [text-shadow:0px_0px_8px_rgba(214,90,255,0.48)] font-manrope text-[14px] not-italic font-semibold leading-[32px] tracking-[0.56px]",children:"Total Points"}),i.jsx("img",{src:Qbt,alt:"Dextrabot"}),f("total_pnl")]})]})}),i.jsxs("tbody",{className:"text-left",children:[o&&l&&t&&Object.keys(t).length>0?i.jsxs("tr",{className:"text-white font-manrope text-[14px] font-bold leading-[13px] tracking-[0.28px] bg-[#2D2D2D]",children:[i.jsx("td",{className:"h-[inherit] rounded-l-2xl p-0",children:i.jsx("div",{className:`min-w-[48px] w-fit px-2 h-12 flex items-center justify-center text-black font-bold text-[18px] first:rounded-tl-2xl first:rounded-bl-2xl ${t.ranked===1?"bg-[#67FFBD]":t.ranked===2?"bg-[#D65AFF]":t.ranked===3?"bg-[#36C9FF]":"bg-[#525252] text-white"}`,children:t.ranked||"Unranked"})}),i.jsx("td",{className:"px-4 py-3 font-semibold",children:i.jsx("div",{className:"flex justify-left items-center gap-2 cursor-pointer",children:i.jsx("span",{className:"w-[75px] text-[#67FFBD]",children:"You"})})}),i.jsx("td",{className:"px-4 py-3 font-bold flex items-center gap-2",children:i.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[((x=t.mushInfo)==null?void 0:x.eth)>0&&i.jsxs("a",{href:"https://blur.io/eth/collection/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:zme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:t.mushInfo.eth})]}),((g=t.mushInfo)==null?void 0:g.sol)>0&&i.jsxs("a",{href:"https://www.tensor.trade/trade/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:Hme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:t.mushInfo.sol})]}),((v=t.mushInfo)==null?void 0:v.eth)===0&&((w=t.mushInfo)==null?void 0:w.sol)===0&&i.jsx("div",{className:"w-[24px] h-[24px]"})]})}),i.jsx("td",{className:"px-4 py-3 font-semibold",children:Cr(t.daily_point_result)}),i.jsx("td",{className:"px-4 py-3 font-semibold rounded-br-2xl rounded-tr-2xl text-right",children:Cr(t.total_pnl)})]}):(o||l)&&(!t||Object.keys(t).length===0)?i.jsxs("tr",{className:"text-white font-manrope text-[14px] font-bold leading-[13px] tracking-[0.28px] bg-[#2D2D2D]",children:[i.jsx("td",{className:"h-[inherit] rounded-l-2xl p-0",children:i.jsx("div",{className:"bg-[#525252] min-w-[48px] w-fit px-2 h-12 flex items-center justify-center text-white font-bold text-[18px] first:rounded-tl-2xl first:rounded-bl-2xl font-manrope",children:"Unranked"})}),i.jsx("td",{className:"px-4 py-3 font-bold text-[#67FFBD]",children:"You"}),i.jsx("td",{className:"px-4 py-3 text-[#FFF] font-semibold",children:"-"}),i.jsx("td",{className:"px-4 py-3 font-bold flex items-center gap-2",children:"-"}),i.jsx("td",{className:"px-4 py-3 font-semibold rounded-br-2xl rounded-tr-2xl text-right",children:"-"})]}):null,s.slice((n-1)*r,n*r).map((C,N)=>{const I=(n-1)*r+N,P=I%2===0?"bg-[#1b1b1b]":"bg-[#1f1f1f]",R=C.owner?"bg-[#162720] ring-1 ring-emerald-400/30":"";return i.jsxs("tr",{className:`text-white h-[50px] font-manrope text-[14px] font-bold leading-[13px] tracking-[0.28px] ${P} ${R} group hover:bg-[#222222]`,children:[i.jsx("td",{className:"h-[inherit] rounded-l-2xl p-0",children:i.jsx("div",{className:`min-w-[48px] w-fit px-2 h-full flex items-center justify-center text-black font-bold text-[18px] first:rounded-tl-2xl first:rounded-bl-2xl ${C.ranked===1?"bg-[#67FFBD]":C.ranked===2?"bg-[#D65AFF]":C.ranked===3?"bg-[#36C9FF]":"bg-[#2D2D2D] text-white"}`,children:C.ranked||"Unranked"})}),i.jsx("td",{className:"px-4 py-3",children:i.jsx("div",{className:"flex justify-left items-center gap-2 cursor-pointer",children:i.jsx("span",{className:"w-[75px]",children:GD(C.subscriber_address)})})}),i.jsx("td",{className:"px-4 py-3 font-bold flex items-center gap-2",children:i.jsxs("div",{className:"flex items-center gap-2 min-h-[24px] pl-1",children:[C.mushInfo.eth>0&&i.jsxs("a",{href:"https://blur.io/eth/collection/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:zme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:C.mushInfo.eth})]}),C.mushInfo.sol>0&&i.jsxs("a",{href:"https://www.tensor.trade/trade/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:Hme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:C.mushInfo.sol})]}),C.mushInfo.eth===0&&C.mushInfo.sol===0&&i.jsx("div",{className:"w-[24px] h-[24px]"})]})}),i.jsx("td",{className:"px-4 py-3 font-semibold",children:Cr(C.daily_point_result)}),i.jsx("td",{className:"px-4 py-3 font-semibold last:rounded-tr-xl last:rounded-br-xl text-right",children:Cr(C.total_pnl)})]},I)})]})]})})},jan="/assets/bg_-D6bvhHQD.png",Ean=({className:e="w-4 h-4"})=>i.jsxs("svg",{className:e,viewBox:"0 0 9 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("g",{clipPath:"url(#paint0_angular_3845_132_clip_path)",children:i.jsx("g",{transform:"matrix(0 0.008 -0.0045 0 4.35268 6.96028)",children:i.jsx("foreignObject",{x:"-1189.48",y:"-1189.48",width:"2378.97",height:"2378.97",children:i.jsx("div",{xmlns:"http://www.w3.org/1999/xhtml",className:"h-full w-full opacity-100",style:{background:"conic-gradient(from 90deg,rgba(230, 159, 29, 1) 0deg,rgba(255, 225, 0, 1) 360deg)"}})})})}),i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z",fill:"url(#gradient)"}),i.jsx("defs",{children:i.jsx("clipPath",{id:"paint0_angular_3845_132_clip_path",children:i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z"})})})]}),_an=({className:e="w-4 h-4"})=>i.jsxs("svg",{className:e,viewBox:"0 0 9 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("g",{clipPath:"url(#paint0_angular_3845_127_clip_path)",children:i.jsx("g",{transform:"matrix(0 0.008 -0.0045 0 4.35268 6.96028)",children:i.jsx("foreignObject",{x:"-1189.48",y:"-1189.48",width:"2378.97",height:"2378.97",children:i.jsx("div",{xmlns:"http://www.w3.org/1999/xhtml",className:"h-full w-full opacity-100",style:{background:"conic-gradient(from 90deg,rgba(255, 255, 255, 1) 0deg,rgba(214, 214, 214, 1) 360deg)"}})})})}),i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z",fill:"url(#gradient)"}),i.jsx("defs",{children:i.jsx("clipPath",{id:"paint0_angular_3845_127_clip_path",children:i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z"})})})]}),kan=()=>{const[e,t]=m.useState([]),[n,r]=m.useState([]),[s,a]=m.useState(null),[o,l]=m.useState(null),[c,u]=m.useState("volume"),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(1),I=25,P=m.useRef(null),R=m.useRef(null),{isConnected:F,address:U}=Jr(),{openConnectModal:L}=b5(),{walletLogin:z,signIn:Q,hyperToken:ne,hyperAddress:J,setSignInConnectButtonOpen:X,isReferralCodeName:re}=m.useContext(Qr),pe=()=>{F?window.localStorage.getItem("hyperToken")&&ne?z():Q(1):(L(),X(!0))},Y=re||window.localStorage.getItem("refcode")||"",ie=Y?`https://app.dextrabot.com/referral/${Y}`:"",oe=()=>{if(!J||!ne){pe();return}f(!0)},G=()=>{if(!J||!ne){pe();return}g(!0)},V=ct=>{ct&&(navigator.clipboard.writeText(ct),ln.success("Copied to clipboard"))},te=async()=>{var ct;if(P.current)try{(ct=document==null?void 0:document.fonts)!=null&&ct.ready&&await document.fonts.ready;const Vt=await I1(P.current,{cacheBust:!0,backgroundColor:"#040707",pixelRatio:2}),It=document.createElement("a");It.href=Vt,It.download="dextrabot-leaderboard-rank.png",document.body.appendChild(It),It.click(),document.body.removeChild(It),ln.success("Image downloaded")}catch(Vt){console.error("Share card download error",Vt),ln.error("Failed to download image")}};m.useCallback(()=>{ds.get("https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/").then(Vt=>{const It=(Vt.data.data||[]).map(an=>({ranking:an.rank_position,out_subscriber_address:an.address,overall_pos_value:an.total_volume,calculated_xp:an.total_xp,overall_point_result:an.total_xp,referral_xp:an.ref_bf_xp,refCode:an.refCode??null,daily_pos_value:null,generated_wallets:[],owner:!!an.owner}));t(It)}).catch(Vt=>{console.error("Error fetching volume data:",Vt)})},[]),m.useEffect(()=>{const ct="https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",Vt=It=>(It||[]).map(an=>({ranking:an.rank_position,out_subscriber_address:an.address,overall_pos_value:an.total_volume,calculated_xp:an.total_xp,overall_point_result:an.total_xp,referral_xp:an.ref_bf_xp,refCode:an.refCode??null,daily_pos_value:null,generated_wallets:[],owner:!!an.owner}));ds.get(ct).then(It=>{const an=Vt(It.data.data);t(an),r(an)}).catch(It=>{console.error("Error fetching leaderboard data:",It),t([]),r([])})},[]);const ae=m.useCallback(()=>{R.current&&R.current.abort();const ct=J||typeof window<"u"&&window.localStorage.getItem("hyperAddress"),Vt=ne||typeof window<"u"&&window.localStorage.getItem("hyperToken");if(ct&&Vt){w(!0);const It="https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",an=new AbortController;R.current=an,ds.post(It,{address:ct,token:Vt},{headers:{"Content-Type":"application/json"},signal:an.signal}).then(Nt=>{if(!an.signal.aborted){if(Nt.data.ownerRank)a(Nt.data.ownerRank);else if(Nt.data.data){const mn=Nt.data.data.find(dn=>{var Pt;return((Pt=dn.address)==null?void 0:Pt.toLowerCase())===(ct==null?void 0:ct.toLowerCase())});a(mn?{ranking:mn.rank_position,rank_position:mn.rank_position,overall_pos_value:mn.total_volume,total_volume:mn.total_volume,calculated_xp:mn.total_xp,total_xp:mn.total_xp,overall_point_result:mn.total_xp,referral_xp:mn.ref_bf_xp,refCode:mn.refCode}:null)}else a(null);w(!1)}}).catch(Nt=>{Nt.name!=="CanceledError"&&!an.signal.aborted&&(console.error("API Error (Volume):",Nt),w(!1))})}else a(null),w(!1)},[J,ne]),he=m.useCallback(()=>{const ct=J||typeof window<"u"&&window.localStorage.getItem("hyperAddress"),Vt=ne||typeof window<"u"&&window.localStorage.getItem("hyperToken");ct&&Vt?ds.post("https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",{address:ct,token:Vt},{headers:{"Content-Type":"application/json"}}).then(It=>{if(It.data.ownerRanks)l(It.data.ownerRanks[0]);else if(It.data.ownerRank)l(It.data.ownerRank);else if(It.data.data){const an=It.data.data.find(Nt=>{var mn;return((mn=Nt.address)==null?void 0:mn.toLowerCase())===(ct==null?void 0:ct.toLowerCase())});l(an?{ranked:an.rank_position,rank_position:an.rank_position,subscriber_address:an.address,total_pnl:an.total_xp,daily_point_result:an.daily_point_result||0,mushInfo:an.mushInfo||{eth:0,sol:0}}:null)}else l(null)}).catch(It=>console.error("API Error (PnL):",It)):l(null)},[J,ne]);m.useEffect(()=>{ae(),c==="pnl"&&he();const ct=()=>{ae(),c==="pnl"&&he()};return window.addEventListener("localStorageUpdated",ct),()=>{window.removeEventListener("localStorageUpdated",ct),R.current&&R.current.abort()}},[J,ne,c,ae,he]);const Ce=m.useMemo(()=>c==="volume"?s:o,[c,s,o]),ce=m.useMemo(()=>(Ce==null?void 0:Ce.ranking)??"--",[Ce==null?void 0:Ce.ranking]),ge=m.useMemo(()=>(Ce==null?void 0:Ce.overall_pos_value)??(Ce==null?void 0:Ce.total_volume)??0,[Ce==null?void 0:Ce.overall_pos_value,Ce==null?void 0:Ce.total_volume]),Ae=m.useMemo(()=>(Ce==null?void 0:Ce.calculated_xp)??(Ce==null?void 0:Ce.total_xp)??0,[Ce==null?void 0:Ce.calculated_xp,Ce==null?void 0:Ce.total_xp]),ye=m.useMemo(()=>s?s.overall_point_result??s.total_xp??s.calculated_xp??(s.calculated_xp||0)+(s.referral_xp||0):0,[s]),je=m.useMemo(()=>s?s.overall_pos_value??s.total_volume??0:0,[s]),Ie=m.useMemo(()=>s?s.rank_position??s.ranking??"Unranked":"Unranked",[s]),Re=m.useMemo(()=>c==="volume"?e:n,[c,e,n]),Qe=m.useMemo(()=>Math.ceil(Re.length/I),[Re.length,I]),$e=Re.length;m.useEffect(()=>{N(1)},[c]);const it=m.useCallback(ct=>{ct>=1&&ct<=Qe&&(N(ct),window.scrollTo({top:0,behavior:"smooth"}))},[Qe]),tt=Ce?`Here’s my @Dextrabot rank #${ce}. Volume (All Time): $${Cr(ge)} · XP: ${Cr(Ae)}. Farming points and stacking profit at the same time.`:"Here’s my @Dextrabot rank. Farming points and stacking profit at the same time.",ot=ie||"https://app.dextrabot.com/leaderboard",ft=`https://x.com/intent/post?text=${encodeURIComponent(tt)}&url=${encodeURIComponent(ot)}`;return i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("meta",{name:"description",content:"See the top traders on DextraBot ranked by trading volume. Track the best-performing users and find inspiration for your next trade."}),i.jsx("meta",{name:"og:title",content:"Top Traders Leaderboard – Track the Best Performers on DextraBot"}),i.jsx("meta",{name:"og:description",content:"See the top traders on DextraBot ranked by trading volume. Track the best-performing users and find inspiration for your next trade."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/leaderboard"})]})}),i.jsxs("div",{className:"min-h-screen bg-black relative overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 right-0 w-[1200px] h-full pointer-events-none hidden lg:block bg-contain bg-right-top bg-no-repeat z-[1]",style:{backgroundImage:`url(${jan})`}}),i.jsxs("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 py-8 sm:py-16",children:[i.jsx("div",{className:"mb-6 sm:mb-10 pl-0 pr-4 sm:pr-16 py-6 sm:py-12 leaderboard-card rounded-2xl",children:i.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-6 lg:gap-12",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 sm:gap-8 lg:gap-32",children:[i.jsx("div",{className:"flex-shrink-0",children:J&&ne?i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"text-white text-xs sm:text-sm",children:"Connected"}),i.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"})]}),i.jsx("div",{className:"text-white font-mono text-sm sm:text-lg font-bold",children:GD(J)})]}):i.jsx("button",{onClick:pe,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-2xl font-semibold transition-colors text-sm h-10 w-full sm:w-auto",children:"Connect Wallet"})}),i.jsxs("div",{className:"grid grid-cols-3 sm:flex sm:items-center gap-4 sm:gap-8 lg:gap-32",children:[i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx("div",{className:"text-gray-400 text-xs sm:text-sm mb-1",children:"XP"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-white font-bold text-sm sm:text-lg",children:v&&J&&ne?"...":J&&ne&&s?Cr(ye):"0"}),i.jsx(Ean,{className:"w-4 h-4 sm:w-5 sm:h-5"})]})]}),i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx("div",{className:"text-gray-400 text-xs sm:text-sm mb-1",children:"Volume"}),i.jsxs("div",{className:"text-white font-bold text-sm sm:text-lg",children:["$",v&&J&&ne?"...":J&&ne&&s?Cr(je):"0"]})]}),i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx("div",{className:"text-gray-400 text-xs sm:text-sm mb-1",children:"#"}),i.jsx("div",{className:"text-white font-bold text-sm sm:text-lg",children:v&&J&&ne?"...":J&&ne&&s?Ie:"Unranked"})]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-4 sm:gap-6",children:[i.jsxs("button",{onClick:G,className:"flex items-center justify-center gap-2 bg-white hover:bg-gray-100 text-black px-3 py-2 rounded-2xl font-semibold transition-colors text-sm border border-gray-300 h-10 w-full sm:w-auto whitespace-nowrap",children:[i.jsx("span",{className:"text-black",children:"𝕏"}),i.jsx("span",{className:"hidden sm:inline",children:"Share your rank"}),i.jsx("span",{className:"sm:hidden",children:"Share"}),i.jsxs("span",{className:"bg-black text-white text-xs px-2 py-1 rounded-lg flex items-center gap-1",children:[i.jsx("span",{children:"200"}),i.jsx(_an,{className:"w-3 h-3"})]})]}),i.jsx("button",{onClick:oe,className:"flex items-center justify-center text-black px-4 py-2 rounded-2xl font-semibold transition-colors text-sm h-10 w-full sm:w-20 bg-[#1DE674]",children:"Invite"})]})]})}),i.jsxs("div",{className:"mb-8 sm:mb-12",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 sm:gap-6 mt-12 sm:mt-16 mb-0",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold text-white",children:"Leaderboard"}),Re.length>0&&i.jsxs("div",{className:"flex flex-col sm:flex-row items-end sm:items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[12px] font-semibold",children:[i.jsx(Si,{className:"text-white hidden sm:block"}),i.jsx("span",{className:"text-white",children:$e}),i.jsx("span",{className:"text-white",children:"wallets found"})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{onClick:()=>it(C-1),disabled:C===1,className:`${C===1?"cursor-not-allowed text-white/30":"text-white hover:bg-white/40"} relative inline-flex items-center justify-center p-1.5 rounded-md bg-[#3d3d3d] w-7 h-7`,children:i.jsx(Yh,{className:`w-3 h-3 rotate-90 ${C===1?"text-white/30":"text-white"}`})}),i.jsxs("div",{className:"px-3 py-1 rounded-md bg-[#3d3d3d]/60 text-sm font-medium text-white min-w-max h-7 flex items-center",children:[C," / ",Math.max(Qe,1)]}),i.jsx("button",{onClick:()=>it(C+1),disabled:C===Qe||Qe===0,className:`${C===Qe||Qe===0?"cursor-not-allowed text-white/30":"text-white hover:bg-white/40"} relative inline-flex items-center justify-center p-1.5 rounded-md bg-[#3d3d3d] w-7 h-7`,children:i.jsx(Yh,{className:`w-3 h-3 -rotate-90 ${C===Qe||Qe===0?"text-white/30":"text-white"}`})})]})]})]}),i.jsx("div",{className:"leaderboard-card rounded-2xl overflow-hidden mt-4 sm:mt-6",children:c==="volume"?i.jsx(Nan,{volumeLeaderboardData:e,userData:s,currentPage:C,rowsPerPage:I}):c==="pnl"?i.jsx(Aan,{pnlLeaderboardData:n,userData:o,currentPage:C,rowsPerPage:I}):i.jsx(i.Fragment,{})})]})]})]}),i.jsx(up,{isOpen:d,onClose:()=>f(!1),blurBackground:!0,children:i.jsxs("div",{className:"w-[320px] sm:w-[420px] bg-[#1c1c1c] rounded-3xl p-6 text-white",children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("p",{className:"text-sm uppercase tracking-widest text-green-300/80 mb-2",children:"Invite friends"}),i.jsx("h3",{className:"text-2xl font-semibold mb-2",children:"Share your referral"}),i.jsx("p",{className:"text-sm text-white/70",children:"You can send your code or unique link."})]}),Y?i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-[#262626] rounded-2xl p-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-white/60 mb-1",children:"Your Referral Code"}),i.jsx("p",{className:"text-lg font-semibold",children:Y})]}),i.jsx("button",{className:"p-2 rounded-xl border border-white/10 transition hover:bg-white/10",onClick:()=>V(Y),children:i.jsx("img",{src:fM,alt:"Copy referral code",className:"w-4 h-4"})})]}),i.jsxs("div",{className:"bg-[#262626] rounded-2xl p-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-xs text-white/60 mb-1",children:"Your Referral URL"}),i.jsx("p",{className:"text-sm text-green-300 truncate",children:ie})]}),i.jsx("button",{className:"p-2 rounded-xl border border-white/10 transition hover:bg-white/10",onClick:()=>V(ie),children:i.jsx("img",{src:fM,alt:"Copy referral url",className:"w-4 h-4"})})]})]}):null,!Y&&i.jsxs("div",{className:"text-xs text-white/50 mt-4",children:["You can create your referral code on the"," ",i.jsx("a",{href:"/referral",className:"text-green-300 hover:text-green-200 underline",children:"Referral page"}),"."]})]})}),i.jsx(up,{isOpen:x,onClose:()=>g(!1),blurBackground:!0,children:i.jsxs("div",{className:"w-[340px] sm:w-[460px] bg-[#101010] rounded-3xl p-6 text-white",children:[i.jsxs("div",{ref:P,className:"bg-gradient-to-b from-[#0c1414] via-[#040707] to-[#040505] rounded-[32px] border border-emerald-500/10 p-5 shadow-[0_0_60px_rgba(0,255,200,0.08)]",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsx("div",{children:i.jsx("p",{className:"text-sm uppercase tracking-[0.3em] text-white/70",children:"Leaderboard"})}),i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-white/5 border border-white/10",children:[i.jsx("img",{src:EA,alt:"Dextrabot",className:"w-5 h-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold tracking-wide",children:"DEXTRABOT"})]})]}),i.jsxs("div",{className:"mt-5 bg-[#05090a] rounded-3xl p-5 text-center border border-white/5",children:[i.jsx("p",{className:"text-xs uppercase tracking-[0.4em] text-white/50",children:"Rank"}),i.jsx("p",{className:"text-4xl font-bold text-[#67FFBD] mt-2",children:(Ce==null?void 0:Ce.ranking)??"--"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-6 text-left",children:[i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"Volume (All Time)"}),i.jsxs("p",{className:"text-lg font-semibold text-white mt-1",children:["$",Cr((Ce==null?void 0:Ce.overall_pos_value)??(Ce==null?void 0:Ce.total_volume)??0)]})]}),i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"XP"}),i.jsx("p",{className:"text-lg font-semibold text-white mt-1",children:Cr((Ce==null?void 0:Ce.calculated_xp)??(Ce==null?void 0:Ce.total_xp)??0)})]})]})]}),i.jsxs("div",{className:"mt-4 flex items-center justify-between text-[11px] text-white/50",children:[i.jsx("span",{children:"Generated by Dextrabot"}),i.jsx("span",{children:new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]}),!Ce&&i.jsx("p",{className:"text-xs text-white/60 mt-4",children:"Connect your wallet and climb the leaderboard to unlock personalized stats."}),i.jsxs("div",{className:"mt-6 space-y-3",children:[i.jsx("button",{onClick:te,className:"w-full border border-emerald-400/60 rounded-2xl py-3 text-emerald-300 font-semibold hover:bg-emerald-400/10 transition disabled:opacity-40 disabled:cursor-not-allowed",disabled:!Ce,children:"Download image"}),i.jsx("a",{href:ft,target:"_blank",rel:"noopener noreferrer",className:"w-full block text-center bg-white text-black font-semibold rounded-2xl py-3 hover:bg-gray-100 transition",children:"Share on X"})]})]})})]})};function Tan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const Ian=m.forwardRef(Tan);function Pan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const Fan=m.forwardRef(Pan);function Oan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"}))}const Man=m.forwardRef(Oan);function Ran({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const XY=m.forwardRef(Ran);function Lan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Dan=m.forwardRef(Lan);function Ban({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const $an=m.forwardRef(Ban);function Uan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const XUe=m.forwardRef(Uan),_Ce=[{name:"Blog",key:"blog",href:"https://blog.dextrabot.com/"},{name:"Features",key:"features",href:"/#features"},{name:"How it works?",key:"howItWorks",href:"/#howitworks"},{name:"FAQ",key:"faq",href:"/#faq"},{name:"Launch",key:"launchApp",href:"/hyperliquid-fee-calculator"}];function zan(...e){return e.filter(Boolean).join(" ")}const zce=({scrollToFeatures:e,scrollToHowItWorks:t,scrollToFAQ:n})=>i.jsxs(l8e,{as:"nav",className:"bg-transparent lg:pt-[24px]",children:[i.jsx("div",{className:"mx-auto max-w-7xl px-2 sm:px-0",children:i.jsxs("div",{className:"relative flex h-16 items-center justify-between",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-1 sm:pr-0",children:i.jsx(OD,{as:"div",className:"relative ml-1",children:i.jsxs("div",{onClick:()=>{window.location.href="/"},className:"flex justify-start items-center gap-4 cursor-pointer",children:[i.jsx("img",{src:hyt,alt:"Dextrabot",className:"w-12 h-12"}),i.jsx("div",{className:"justify-start text-white text-2xl font-semibold font-['Manrope'] leading-[21px]",children:"Dextrabot"})]})})}),i.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center sm:hidden",children:i.jsxs(Zre,{className:"group relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 bg-[#1e1e1e] hover:bg-[#353535] hover:text-white focus:outline-none focus:ring-0 border-none",children:[i.jsx("span",{className:"absolute -inset-0.5"}),i.jsx("span",{className:"sr-only",children:"Open main menu"}),i.jsx(Ian,{"aria-hidden":"true",className:"block size-6 group-data-[open]:hidden"}),i.jsx(XUe,{"aria-hidden":"true",className:"hidden size-6 group-data-[open]:block"})]})}),i.jsx("div",{className:"flex flex-1 items-center justify-center sm:items-stretch sm:justify-end",children:i.jsx("div",{className:"hidden sm:ml-6 sm:block mr-2",children:i.jsx("div",{className:"flex items-center space-x-6",children:_Ce.map(r=>i.jsx("a",{href:r.href||"#",onClick:s=>{r.href||s.preventDefault(),r.key==="features"&&(e==null||e()),r.key==="howItWorks"&&(t==null||t()),r.key==="faq"&&(n==null||n())},className:zan(r.current?"bg-transparent text-white":`${r.name==="Launch"?"text-[#121213] hover:text-[#121213] hover:scale-105 transition-transform duration-300":"text-white/50 hover:text-white"}`,"",r.name==="Launch"?"w-24 h-10 px-12 py-3 bg-white rounded-[256px] inline-flex justify-center items-center gap-2.5 text-[#121213] text-sm font-semibold font-manrope leading-8":"rounded-md text-sm font-semibold font-manrope leading-8 h-8"),children:r.name},r.name))})})})]})}),i.jsx(Jre,{className:"sm:hidden",children:i.jsx("div",{className:"space-y-1 px-2 pb-3 pt-2",children:_Ce.map(r=>r.key==="launchApp"?i.jsx("a",{href:r.href,className:"block rounded-md px-3 py-2 text-base font-medium text-white hover:text-white bg-[#1a1a1a] hover:bg-[#353535]",children:r.name},r.name):i.jsx("button",{onClick:async()=>{r.key==="features"&&(e==null||e()),r.key==="howItWorks"&&(t==null||t()),r.key==="faq"&&(n==null||n())},className:"w-full text-left block rounded-md px-3 py-2 text-base font-medium text-white/50 bg-transparent hover:bg-[#353535] hover:text-white focus:outline-none focus:ring-0 border-none",children:r.name},r.name))})})]}),Han=()=>{const[e,t]=m.useState("");return i.jsx("section",{className:"px-1 py-5 sm:py-[64px] text-center",children:i.jsx("div",{className:"max-w-7xl mx-auto",children:i.jsx("div",{className:"flex flex-col items-center gap-[88px]",children:i.jsxs("div",{className:"flex flex-col lg:flex-row items-center lg:items-start gap-6",children:[i.jsx("div",{className:"w-full lg:flex-[0.45] flex justify-center lg:justify-start",children:i.jsx("div",{className:"bg-transparent p-1 rounded-xl h-full",children:i.jsxs("div",{className:"flex flex-col items-start gap-4",children:[i.jsx("h1",{className:"max-w-[553px] w-full lg:w-[553px] justify-start text-white text-[36px] sm:text-[56px] font-semibold font-['Manrope'] leading-[42px] sm:leading-[64px] text-left",children:"Dextrabot - Find and Copy Trade Top Hyperliquid Wallets"}),i.jsx("div",{className:"max-w-[512px] justify-start text-[#aaaaaa] text-base font-medium font-['Manrope'] leading-[21px] tracking-tight text-left",children:"Discover profitable traders, analyze their performance, and automatically copy their strategies with customizable risk settings."}),i.jsxs("div",{className:"flex flex-col sm:flex-row justify-start items-center gap-4 sm:gap-6 pt-[22px] w-full",children:[i.jsx("div",{onClick:()=>{window.location.href="/discover-wallets"},className:"w-full sm:w-auto sm:before:max-w-[200px] h-12 px-2 sm:px-6 py-1 sm:py-3 bg-[#67ffbd] rounded-[256px] flex justify-center items-center cursor-pointer hover:scale-105 transition-transform duration-300",children:i.jsx("span",{className:"text-[#103324] text-lg font-semibold font-['Manrope'] leading-6 min-w-max",children:"Start Copy Trade"})}),i.jsx("div",{onClick:()=>{window.location.href="/discover-wallets"},className:"w-full sm:w-auto sm:max-w-[200px] h-12 px-2 sm:px-6 py-1 sm:py-3 bg-[#1e1e1e] rounded-[256px] flex justify-center items-center cursor-pointer hover:scale-105 transition-transform duration-300",children:i.jsx("span",{className:"text-white text-lg font-semibold font-['Manrope'] leading-6 min-w-max ",children:"Discover Wallets"})})]}),i.jsx("div",{className:"w-full",children:i.jsxs("div",{className:"w-full sm:w-[424px] h-12 px-4 py-3 bg-[#1e1e1e] rounded-[256px] flex items-center gap-2.5 relative mt-2",children:[i.jsx(_y,{className:"text-white"}),i.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"Track and Analyze Wallet",className:"flex bg-transparent outline-none border-none text-[#cfcfcf] placeholder-[#636363] text-lg font-normal font-['Manrope'] leading-[21px] pr-10 w-full sm:w-[424px]"}),i.jsx("div",{onClick:n=>{if(n.preventDefault(),!e)ln.error("Please enter a wallet address");else if(e.match(/^0x[a-fA-F0-9]{40}$/))window.open(`/wallet-details/${e}`,"_blank"),setTimeout(()=>{t("")},200);else{ln.error("Please enter a valid Ethereum address");return}},className:"w-10 h-10 bg-[#67ffbd]/20 rounded-[256px] inline-flex justify-center items-center absolute right-1 hover:scale-105 transition-transform duration-300 cursor-pointer",children:i.jsx("img",{src:fyt,alt:"search",className:"w-6 h-6 min-w-6 min-h-6"})})]})})]})})}),i.jsx("div",{className:"w-full lg:flex-[0.55]",children:i.jsx("div",{className:"bg-transparent rounded-xl shadow-lg h-full",children:i.jsx("div",{className:"w-full",children:i.jsx("img",{src:ryt,alt:"Copy trade Hyperliquid wallets with Dextrabot platform and customizable risk settings",className:"w-full h-auto max-w-[728px] mx-auto"})})})})]})})})})},Van=()=>i.jsx("section",{className:"py-16 bg-transparent",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsx("h2",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px] mb-10",children:"Dextrabot Features"}),i.jsxs("div",{className:"flex flex-wrap xl:flex-nowrap justify-center gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs("div",{className:"flex flex-wrap md:flex-nowrap justify-center md:justify-start gap-4",children:[i.jsx(K7,{title:"Copy Trade",description:"Automatically copy trade perpetual positions with customizable risk parameters",altInfo:"Automated copy trading perpetual positions on Hyperliquid with customizable risk parameters",icon:syt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-0 left-0"}),i.jsx(K7,{title:"Discover Wallets",description:"Find overlooked high-performers on Hyperliquid with advanced filtering",altInfo:"Find high-performing wallets on Hyperliquid with advanced filtering and wallet discovery",icon:ayt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute -bottom-2"})]}),i.jsxs("div",{className:"flex flex-wrap md:flex-nowrap justify-center md:justify-start gap-4",children:[i.jsx(K7,{title:"Real-Time Alerts",description:"Get instant Telegram notifications for all trading activities",altInfo:"Real-time Telegram notifications for all Hyperliquid trading activities and copy trades",icon:oyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-[20px] w-[294px] h-[204px]"}),i.jsx(K7,{title:"Referrals",description:"Earn up to 65% reward through our multi-level program",altInfo:"Earn up to 65% rewards through Dextrabot's multi-level referral program for crypto traders",icon:iyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-0 -left-1"})]})]}),i.jsx(K7,{title:"Analyze Wallet",description:"Track performance metrics, open positions, and trading patterns",icon:lyt,altInfo:"Track performance metrics, open positions, and trading patterns of top Hyperliquid wallets",cssInfo:"max-w-full md:w-[720px] xl:w-[552px] h-[500px] md:h-[916px] xl:h-[716px] bg-[#161616] rounded-3xl p-6 text-white flex-shrink-0 relative overflow-hidden hover:scale-105 transition-transform duration-300",imgCss:"absolute bottom-0 left-6"})]})]})}),K7=({title:e,description:t,altInfo:n,icon:r,cssInfo:s,imgCss:a})=>i.jsxs("div",{className:`${s} bg-[#161616] rounded-3xl p-6 text-white relative overflow-hidden hover:scale-105 transition-transform duration-300`,children:[i.jsx("div",{className:"text-start justify-start text-white text-[21px] font-semibold font-['Manrope'] leading-normal mb-1",children:e}),i.jsx("div",{className:"w-[290px] justify-start text-[#979797] text-sm font-medium font-['Manrope'] leading-[21px]",children:t}),i.jsx("img",{src:r,alt:n,className:a})]}),Wan=()=>i.jsx("section",{className:"py-16 bg-transparent",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsx("h2",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px] mb-10",children:"Three Simple Steps to Start Copy Trade"}),i.jsxs("div",{className:"flex flex-wrap xl:flex-nowrap justify-center gap-4",children:[i.jsx(QY,{title:"Discover",description:"Find profitable wallets using our advanced filters",icon:cyt,altInfo:"Discover profitable Hyperliquid wallets using Dextrabot's advanced filtering system"}),i.jsx(QY,{title:"Analyze",description:"Examine detailed metrics and trading patterns",icon:uyt,altInfo:"Examine detailed PnL metrics and win rate statistics for Hyperliquid trading strategies"}),i.jsx(QY,{title:"Copy Trade",description:"Set your risk parameters and start automating",icon:dyt,altInfo:"Set custom take profit and stop loss parameters for automated copy trading on Hyperliquid"})]})]})}),QY=({title:e,description:t,altInfo:n,icon:r,imgCss:s})=>i.jsxs("div",{className:"w-[348px] xl:w-[416px] h-[348px] bg-[#161616] rounded-3xl p-6 text-white relative overflow-hidden hover:scale-105 transition-transform duration-300",children:[i.jsx("div",{className:"text-start justify-start text-white text-[21px] font-semibold font-['Manrope'] leading-normal mb-1",children:e}),i.jsx("div",{className:"w-[290px] justify-start text-[#979797] text-sm font-medium font-['Manrope'] leading-[21px]",children:t}),i.jsx("img",{src:r,alt:n,className:"absolute bottom-[12px] left-1/2 transform -translate-x-1/2 w-[314px] xl:w-[382px]"})]}),kCe=({className:e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:e,children:i.jsx("path",{d:"M16.6004 7.45831L11.1671 12.8916C10.5254 13.5333 9.47539 13.5333 8.83372 12.8916L3.40039 7.45831",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})}),qan=()=>{const e=[{question:"How does copy trade work on Dextrabot?",answer:"Dextrabot monitors wallet activity and automatically executes the same perpetual positions in your account based on your risk settings."},{question:"What fees does Dextrabot charge?",answer:"Dextrabot charges 0.055% on trade size for copy trade transactions. Use a referral code for a 4% discount."},{question:"How do I set up Telegram notifications?",answer:"Connect your Telegram account through the Tracker page to receive instant alerts about wallet activities and copy trades."},{question:"What risk management options are available?",answer:"Dextrabot offers customizable stop-loss and take-profit levels, position size limits, and margin increase controls for comprehensive risk management."},{question:" How does the referral program work?",answer:"You can earn up to 65% reward on the fees generated by traders you refer to Dextrabot, with multi-tier commissions coming soon."},{question:"Can I copy multiple wallets simultaneously?",answer:"Yes, you can copy trade multiple wallets at once, each with their own customized risk parameters and position sizing."}];return i.jsx("section",{className:"py-16 bg-transparent",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsx("div",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px] mb-[18px]",children:"FAQ"}),i.jsx("h2",{className:"w-full text-center justify-center text-white/60 text-lg font-semibold font-['Manrope'] leading-normal",children:"Frequently Asked Questions"}),i.jsx("dl",{className:"mt-[41px] divide-y divide-gray-900/10 border-none outline-none w-full lg:w-[777px] mx-auto",children:e.map(t=>i.jsx(l8e,{as:"div",className:"my-4 first:pt-0 last:pb-0 rounded-2xl bg-[#161616]",children:i.jsxs("dt",{children:[i.jsxs(Zre,{className:"group flex w-full items-start justify-start text-left text-white gap-4 border-none bg-transparent focus:outline-none focus:ring-0 first:pt-4 last:pb-4",children:[i.jsxs("span",{className:"ml-1 flex h-7 items-center",children:[i.jsx(kCe,{"aria-hidden":"true",className:"size-6 group-data-[open]:hidden"}),i.jsx(kCe,{"aria-hidden":"true",className:"size-6 rotate-180 group-[&:not([data-open])]:hidden"})]}),i.jsx("span",{className:"text-start justify-start text-white text-base font-semibold font-['Manrope'] leading-normal",children:t.question})]}),i.jsx(Jre,{as:"dd",className:"pr-12 ml-[64px] pb-4 -mt-2",children:i.jsx("p",{className:"w-full lg:w-[683px] justify-start text-[#cfcfcf] text-sm font-medium font-['Manrope'] leading-normal",children:t.answer})})]})},t.question))})]})})},Gan=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",className:e,children:[i.jsx("g",{clipPath:"url(#clip0_235_3767)",children:i.jsx("path",{d:"M8.99969 0.180054C4.12852 0.180054 0.179688 4.12889 0.179688 9.00005C0.179688 13.8712 4.12852 17.8201 8.99969 17.8201C13.8709 17.8201 17.8197 13.8712 17.8197 9.00005C17.8197 4.12889 13.8709 0.180054 8.99969 0.180054ZM13.0879 6.17836C12.9552 7.57303 12.3808 10.9575 12.0885 12.5195C11.9649 13.1804 11.7214 13.4021 11.4858 13.4237C10.9737 13.4709 10.5847 13.0853 10.0886 12.7601C9.3123 12.2512 8.87375 11.9344 8.12021 11.4379C7.24942 10.8641 7.81393 10.5488 8.3102 10.0331C8.44008 9.8982 10.6968 7.84552 10.7405 7.65931C10.7459 7.63601 10.7512 7.54906 10.6995 7.50339C10.6477 7.45773 10.5718 7.4732 10.5168 7.48561C10.439 7.5033 9.19888 8.32296 6.7965 9.94461C6.44453 10.1863 6.12571 10.3041 5.84003 10.2979C5.52511 10.2911 4.91933 10.1199 4.46898 9.97345C3.91663 9.79393 3.47762 9.699 3.51585 9.39407C3.53577 9.23522 3.75449 9.07281 4.17202 8.90684C6.74324 7.7866 8.45778 7.04805 9.31564 6.69117C11.765 5.67235 12.274 5.49538 12.6058 5.48948C12.6787 5.48827 12.8419 5.50634 12.9475 5.59208C13.0178 5.65316 13.0626 5.7384 13.0731 5.83094C13.091 5.94583 13.0959 6.06236 13.0879 6.17836Z",fill:"currentColor"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_235_3767",children:i.jsx("rect",{width:"18",height:"18",fill:"currentColor"})})})]}),Kan=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:e,children:[i.jsx("g",{clipPath:"url(#clip0_235_3764)",children:i.jsx("path",{d:"M11.0256 0.672607H13.1722L8.48225 6.03344L14 13.3269H9.67983L6.2965 8.90286L2.42433 13.3269H0.2765L5.29317 7.59269L0 0.673191H4.42983L7.48825 4.71686L11.0256 0.672607ZM10.2725 12.0424H11.4619L3.7835 1.89002H2.50717L10.2725 12.0424Z",fill:"currentColor"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_235_3764",children:i.jsx("rect",{width:"14",height:"14",fill:"currentColor"})})})]}),Yan=({className:e})=>i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M16.9419 3.52317C15.6473 2.91744 14.263 2.47723 12.8157 2.22656C12.638 2.5479 12.4304 2.98012 12.2872 3.32394C10.7487 3.09258 9.22445 3.09258 7.7143 3.32394C7.57116 2.98012 7.3588 2.5479 7.17947 2.22656C5.73067 2.47723 4.3448 2.91906 3.05016 3.52638C0.438869 7.47238 -0.269009 11.3204 0.0849305 15.1137C1.81688 16.4071 3.49534 17.1928 5.14548 17.7069C5.55291 17.1462 5.91628 16.5501 6.22931 15.9219C5.63313 15.6954 5.06211 15.4158 4.52256 15.0912C4.6657 14.9852 4.80571 14.8743 4.94098 14.7603C8.23183 16.2995 11.8074 16.2995 15.0589 14.7603C15.1958 14.8743 15.3358 14.9852 15.4774 15.0912C14.9362 15.4174 14.3637 15.6969 13.7675 15.9235C14.0805 16.5501 14.4423 17.1478 14.8513 17.7085C16.503 17.1944 18.183 16.4087 19.915 15.1137C20.3303 10.7163 19.2056 6.90361 16.9419 3.52317ZM6.67765 12.7809C5.68977 12.7809 4.87963 11.8586 4.87963 10.7355C4.87963 9.61247 5.67247 8.68864 6.67765 8.68864C7.68285 8.68864 8.49297 9.61086 8.47567 10.7355C8.47723 11.8586 7.68285 12.7809 6.67765 12.7809ZM13.3223 12.7809C12.3344 12.7809 11.5243 11.8586 11.5243 10.7355C11.5243 9.61247 12.3171 8.68864 13.3223 8.68864C14.3275 8.68864 15.1376 9.61086 15.1203 10.7355C15.1203 11.8586 14.3275 12.7809 13.3223 12.7809Z",fill:"currentColor"})}),Hce=()=>i.jsxs("footer",{className:"bg-[#121213] pt-12 pb-28 sm:pt-6 sm:pb-6 text-center text-sm text-gray-400",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-[32px] relative",children:[i.jsx("div",{onClick:()=>window.location.href="https://blog.dextrabot.com/",className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Blog"}),i.jsx("div",{onClick:()=>window.location.href="/sitemap",className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Sitemap"}),i.jsx("div",{onClick:()=>window.location.href="/videos",className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Videos"}),i.jsx("div",{onClick:()=>window.open("https://docs.dextrabot.com/","_blank"),className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Documentation"}),i.jsx("div",{onClick:()=>window.open("https://docs.dextrabot.com/faq-and-official-links/risk-disclaimer","_blank"),className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Risk Disclaimer"}),i.jsxs("div",{className:"flex justify-center sm:justify-start items-center gap-4",children:[i.jsx("div",{onClick:()=>{window.open("https://x.com/dextrabot","_blank")},className:"rounded-full cursor-pointer p-[1px]",children:i.jsx(Kan,{className:"text-[#696969] hover:text-white"})}),i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank")},className:"rounded-full cursor-pointer p-[1px]",children:i.jsx(Yan,{className:"text-[#696969] hover:text-white"})}),i.jsx("div",{onClick:()=>{window.open("https://t.me/Dextrabot_Official","_blank")},className:"rounded-full cursor-pointer p-[1px]",children:i.jsx(Gan,{className:"text-[#696969] hover:text-white"})})]}),i.jsxs("div",{className:"hidden xl:flex absolute right-2 justify-end items-center text-center text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal",children:["© ",new Date().getFullYear()," Dextrabot. All rights reserved."]})]}),i.jsxs("div",{className:"block xl:hidden text-center text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal mt-6",children:["© ",new Date().getFullYear()," Dextrabot. All rights reserved."]})]}),Xan=()=>{const e=m.useRef(null),t=m.useRef(null),n=m.useRef(null);return i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("meta",{name:"description",content:"Find high-performing Hyperliquid wallets, analyze their trading patterns, and automatically copy their strategies with custom risk settings. Real-time alerts via Telegram."}),i.jsx("meta",{name:"og:title",content:"Dextrabot | Discover and Copy Trade Top Hyperliquid Wallets"}),i.jsx("meta",{name:"og:description",content:"Find high-performing Hyperliquid wallets, analyze their trading patterns, and automatically copy their strategies with custom risk settings. Real-time alerts via Telegram."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/"}),i.jsx("link",{rel:"canonical",href:"https://app.dextrabot.com/"}),i.jsx("meta",{name:"theme-color",content:"#121213"}),i.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://app.dextrabot.com/#organization",name:"Dextrabot",url:"https://app.dextrabot.com/",logo:{"@type":"ImageObject","@id":"https://app.dextrabot.com/#logo",url:"https://app.dextrabot.com/assets/dextrabotIcon-B5aLRkPC.png",width:192,height:192,caption:"Dextrabot - Copy Trade on Hyperliquid"},sameAs:["https://x.com/dextrabot","https://discord.gg/dextrabot"]},{"@type":"WebSite","@id":"https://app.dextrabot.com/#website",url:"https://app.dextrabot.com/",name:"Dextrabot",description:"Find profitable Hyperliquid traders, analyze their strategies, and automatically copy their trades. Real-time alerts and advanced analytics for Hyperliquid.",publisher:{"@id":"https://app.dextrabot.com/#organization"},potentialAction:{"@type":"SearchAction",target:"https://app.dextrabot.com/wallet-details/{search_term_string}","query-input":"required name=search_term_string"}},{"@type":"WebPage","@id":"https://app.dextrabot.com/#webpage",url:"https://app.dextrabot.com/",name:"Discover, Analyze & Copy Trade Top Traders on Hyperliquid | Dextrabot",isPartOf:{"@id":"https://app.dextrabot.com/#website"},about:{"@id":"https://app.dextrabot.com/#organization"},description:"Find profitable Hyperliquid traders, analyze their strategies, and automatically copy their trades with customizable risk parameters.",inLanguage:"en-US"},{"@type":"SoftwareApplication","@id":"https://app.dextrabot.com/#softwareapplication",name:"Dextrabot",operatingSystem:"Web",applicationCategory:"DeFiApplication",offers:{"@type":"Offer",price:"0.055",priceCurrency:"USDC",priceSpecification:{"@type":"UnitPriceSpecification",price:"0.055",priceCurrency:"USDC",unitCode:"PERCENT",description:"0.055% fee for every copy trade transaction"}},featureList:["Copy Trade","Wallet Discovery","Performance Analytics","Real-time Alerts","Telegram Notifications"]},{"@type":"FAQPage","@id":"https://app.dextrabot.com/#faqpage",mainEntity:[{"@type":"Question",name:"How does copy trade work on Dextrabot?",acceptedAnswer:{"@type":"Answer",text:"Dextrabot monitors wallet activity and automatically executes the same perpetual positions in your account based on your risk settings."}},{"@type":"Question",name:"What fees does Dextrabot charge?",acceptedAnswer:{"@type":"Answer",text:"Dextrabot charges 0.055% on trade size for copy trade transactions. Use a referral code for a 4% discount."}},{"@type":"Question",name:"How do I set up Telegram notifications?",acceptedAnswer:{"@type":"Answer",text:"Connect your Telegram account through the Tracker page to receive instant alerts about wallet activities and copy trades."}},{"@type":"Question",name:"What risk management options are available?",acceptedAnswer:{"@type":"Answer",text:"Dextrabot offers customizable stop-loss and take-profit levels, position size limits, and margin increase controls for comprehensive risk management."}},{"@type":"Question",name:"How does the referral program work?",acceptedAnswer:{"@type":"Answer",text:"You can earn up to 65% reward on the fees generated by traders you refer to Dextrabot, with multi-tier commissions coming soon."}},{"@type":"Question",name:"Can I copy multiple wallets simultaneously?",acceptedAnswer:{"@type":"Answer",text:"Yes, you can copy trade multiple wallets at once, each with their own customized risk parameters and position sizing."}}]}]})})]})}),i.jsxs("div",{className:"bg-[#121213] p-4 w-screen h-screen overflow-x-hidden overflow-y-auto relative z-50",children:[i.jsx("div",{className:"landing-green-background-landing h-full w-full absolute -z-10 top-0"}),i.jsx(zce,{scrollToFeatures:()=>{var r;return(r=e.current)==null?void 0:r.scrollIntoView({behavior:"smooth"})},scrollToHowItWorks:()=>{var r;return(r=t.current)==null?void 0:r.scrollIntoView({behavior:"smooth"})},scrollToFAQ:()=>{var r;return(r=n.current)==null?void 0:r.scrollIntoView({behavior:"smooth"})}}),i.jsx(Han,{}),i.jsx("div",{ref:e,children:i.jsx(Van,{})}),i.jsx("div",{ref:t,children:i.jsx(Wan,{})}),i.jsx("div",{ref:n,children:i.jsx(qan,{})}),i.jsx(Hce,{})]})]})};var Xx={},TCe;function Qan(){if(TCe)return Xx;TCe=1;var e=Xx.__assign||function(){return e=Object.assign||function(d){for(var f,x=1,g=arguments.length;x<g;x++){f=arguments[x];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(d[v]=f[v])}return d},e.apply(this,arguments)},t=Xx.__createBinding||(Object.create?function(d,f,x,g){g===void 0&&(g=x);var v=Object.getOwnPropertyDescriptor(f,x);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[x]}}),Object.defineProperty(d,g,v)}:function(d,f,x,g){g===void 0&&(g=x),d[g]=f[x]}),n=Xx.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Xx.__importStar||function(){var d=function(f){return d=Object.getOwnPropertyNames||function(x){var g=[];for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(g[g.length]=v);return g},d(f)};return function(f){if(f&&f.__esModule)return f;var x={};if(f!=null)for(var g=d(f),v=0;v<g.length;v++)g[v]!=="default"&&t(x,f,g[v]);return n(x,f),x}}(),s=Xx.__rest||function(d,f){var x={};for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&f.indexOf(g)<0&&(x[g]=d[g]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,g=Object.getOwnPropertySymbols(d);v<g.length;v++)f.indexOf(g[v])<0&&Object.prototype.propertyIsEnumerable.call(d,g[v])&&(x[g[v]]=d[g[v]]);return x};Object.defineProperty(Xx,"__esModule",{value:!0});var a=r(ax()),o=$Ue(),l=UUe(),c=[(0,l.createAnimation)("PacmanLoader","0% {transform: rotate(0deg)} 50% {transform: rotate(-44deg)}","pacman-1"),(0,l.createAnimation)("PacmanLoader","0% {transform: rotate(0deg)} 50% {transform: rotate(44deg)}","pacman-2")];function u(d){var f=d.loading,x=f===void 0?!0:f,g=d.color,v=g===void 0?"#000000":g,w=d.speedMultiplier,C=w===void 0?1:w,N=d.cssOverride,I=N===void 0?{}:N,P=d.size,R=P===void 0?25:P,F=d.margin,U=F===void 0?2:F,L=s(d,["loading","color","speedMultiplier","cssOverride","size","margin"]),z=(0,o.parseLengthAndUnit)(R),Q=z.value,ne=z.unit,J=e({display:"inherit",position:"relative",fontSize:0,height:"".concat(Q*2).concat(ne),width:"".concat(Q*2).concat(ne)},I),X=(0,l.createAnimation)("PacmanLoader",`75% {opacity: 0.7}
100% {transform: translate(`.concat("".concat(-4*Q).concat(ne),", ").concat("".concat(-Q/4).concat(ne),")}"),"ball"),re=function(V){return{width:"".concat(Q/3).concat(ne),height:"".concat(Q/3).concat(ne),backgroundColor:v,margin:(0,o.cssValue)(U),borderRadius:"100%",transform:"translate(0, ".concat("".concat(-Q/4).concat(ne),")"),position:"absolute",top:"".concat(Q).concat(ne),left:"".concat(Q*4).concat(ne),animation:"".concat(X," ").concat(1/C,"s ").concat(V*.25,"s infinite linear"),animationFillMode:"both"}},pe="".concat((0,o.cssValue)(R)," solid transparent"),Y="".concat((0,o.cssValue)(R)," solid ").concat(v),ie=function(V){return{width:0,height:0,borderRight:pe,borderTop:V===0?pe:Y,borderLeft:Y,borderBottom:V===0?Y:pe,borderRadius:(0,o.cssValue)(R),position:"absolute",animation:"".concat(c[V]," ").concat(.8/C,"s infinite ease-in-out"),animationFillMode:"both"}},oe=ie(0),G=ie(1);return x?a.createElement("span",e({style:J},L),a.createElement("span",{style:oe}),a.createElement("span",{style:G}),a.createElement("span",{style:re(2)}),a.createElement("span",{style:re(3)}),a.createElement("span",{style:re(4)}),a.createElement("span",{style:re(5)})):null}return Xx.default=u,Xx}var Zan=Qan();const Jan=ki(Zan),eon=()=>{const{setHyperToken:e,setHyperAddress:t}=m.useContext(Qr),[n]=VNe(),r=il(),s=n.get("temp_mobile_password");return m.useEffect(()=>{s?(async()=>{try{const o=await ds.post("https://dextrabothypev2.nftinit.io/api/subscriber/sign_mobile_complete/",{temp_mobile_password:s},{headers:{"Content-Type":"application/json"}}),{token:l,address:c}=o.data;setTimeout(()=>{window.localStorage.setItem("hyperToken",l),window.localStorage.setItem("hyperAddress",c),t(c),e(l),ln.success("Authentication successful.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),r("/discover-wallets")},1e3)}catch{ln.error("Invalid QR or request failed."),r("/")}})():r("/")},[s,e,t,r]),i.jsxs("div",{className:"w-screen text-white flex flex-col items-center justify-center min-h-screen gap-4 ",children:[i.jsx("img",{src:qi,alt:"",className:"w-24 h-24"}),i.jsx("div",{className:"font-manrope font-bold text-lg",children:"Welcome to Dextrabot"}),i.jsx("div",{className:"font-manrope font-bold text-lg",children:"Authenticating..."}),i.jsx(Jan,{color:"#46eda1",size:30})]})},ton=()=>i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("meta",{name:"description",content:"Navigate all sections of Dextrabot through our comprehensive sitemap. Find links to copy trading features, wallet management, leaderboards, and more in one convenient location."}),i.jsx("meta",{name:"og:title",content:"Complete Dextrabot Website Sitemap"}),i.jsx("meta",{name:"og:description",content:"Navigate all sections of Dextrabot through our comprehensive sitemap. Find links to copy trading features, wallet management, leaderboards, and more in one convenient location."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/sitemap"})]})}),i.jsxs("div",{className:"bg-[#121213] p-4 w-screen h-screen overflow-x-hidden overflow-y-auto relative z-50",children:[i.jsx("div",{className:"h-full w-full absolute -z-10 -mt-[138px]"}),i.jsx(zce,{scrollToFeatures:()=>{var e;return(e=featuresRef.current)==null?void 0:e.scrollIntoView({behavior:"smooth"})},scrollToHowItWorks:()=>{var e;return(e=howItWorksRef.current)==null?void 0:e.scrollIntoView({behavior:"smooth"})},scrollToFAQ:()=>{var e;return(e=faQRef.current)==null?void 0:e.scrollIntoView({behavior:"smooth"})}}),i.jsx("section",{className:"px-1 py-5 sm:py-[64px] text-center h-[calc(100vh-190px)]",children:i.jsx("div",{className:"max-w-7xl mx-auto h-full",children:i.jsx("div",{className:"flex flex-col items-start gap-[88px] h-full",children:i.jsxs("div",{className:"flex flex-col items-start justify-start gap-6 h-full",children:[i.jsx("h2",{className:"text-start justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px]",children:"Dextrabot Sitemap"}),i.jsx("div",{className:"flex flex-col items-start",children:i.jsx("nav",{"aria-label":"Sitemap",children:i.jsxs("ul",{className:"text-start text-[#c9c9c9] text-base font-semibold font-['Manrope']",children:[i.jsx("li",{children:i.jsx("a",{href:"/",className:"hover:text-white text-[#c9c9c9] underline",children:"Dextrabot Homepage"})}),i.jsx("li",{children:i.jsx("a",{href:"/discover-wallets",className:"hover:text-white text-[#c9c9c9] underline",children:"Discover Wallets"})}),i.jsx("li",{children:i.jsx("a",{href:"/copy-trade",className:"hover:text-white text-[#c9c9c9] underline",children:"Copy Trade"})}),i.jsx("li",{children:i.jsx("a",{href:"/wallet-management",className:"hover:text-white text-[#c9c9c9] underline",children:"Wallet Management"})}),i.jsx("li",{children:i.jsx("a",{href:"/tracked-wallets",className:"hover:text-white text-[#c9c9c9] underline",children:"Tracked Wallets"})}),i.jsx("li",{children:i.jsx("a",{href:"/tracker",className:"hover:text-white text-[#c9c9c9] underline",children:"My Activities"})}),i.jsx("li",{children:i.jsx("a",{href:"/referral",className:"hover:text-white text-[#c9c9c9] underline",children:"Referral"})}),i.jsx("li",{children:i.jsx("a",{href:"/leaderboard",className:"hover:text-white text-[#c9c9c9] underline",children:"Leaderboard"})})]})})})]})})})}),i.jsx(Hce,{})]})]}),non=()=>{const e=[{id:"JDdZ5yWmEXk",title:"The Best Vaults on Hyperliquid (Get your free Google Vault Analysis Sheet)"},{id:"bCJTNChKfFA",title:"Copy Trading Challenge: Day 7: Wallet Adjustments (Reduced the Number of Copy Traded Wallets to one)"},{id:"l6xkJugg1PY",title:"Copy Trading Vaults on Hyperliquid (with Dextrabot)"},{id:"Yu_V6YNw6oA",title:"Hottest Copy Traded Wallets (Hyperliquid Copy Trading)"},{id:"OwpWPDGBJUU",title:"Copy Trading Challenge: Day 6 (+1500 USD) - Hyperliquid Copy Trading"},{id:"gN11fXPPFvU",title:"Copy Trading Challenge: Day 2 (Analysing Current Situation & Some Tips / Info on Hyperliquid)"},{id:"LDEjjcR-FqE",title:"Copy Trading Challenge: Day 1 (Finding & Analysing Wallets - Starting Copy Trading on Hyperliquid)"},{id:"HVxt-rnXHfk",title:"Copy Trading Tips & Tricks - (Hyperliquid Automated Copy Trading)"},{id:"e6ePwfGaMRc",title:"Hyperliquid Copy Trading: Mirror Copy Trading (Trade At The Same Margin Usage As The Source Wallet)"},{id:"Z1QB190V9M0",title:"Hyperliquid Copy Trading: Copy Current Positions (Dextrabot)"},{id:"C_mqwSqT2mI",title:"Hyperliquid Copy Trading Software in Action!"},{id:"jJYxbdkq514",title:"Hyperliqud Free Wallet Tracker (Telegram and Webpage) - Copy Trading"},{id:"gpzB62yp-rY",title:"Hyperliqud Copy Trading & Wallet Analysis Tool (Dextra: First of its kind!)"}];return i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Hyperliquid Copy Trade Video Tutorials & Guides"}),i.jsx("meta",{name:"description",content:"Watch step-by-step Dextrabot video tutorials on Hyperliquid copy trading. Learn how to set up copy trading and discover profitable wallets."}),i.jsx("meta",{name:"og:title",content:"Hyperliquid Copy Trade Video Tutorials & Guides"}),i.jsx("meta",{name:"og:description",content:"Watch step-by-step Dextrabot video tutorials on Hyperliquid copy trading. Learn how to set up copy trading and discover profitable wallets."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/videos"})]})}),i.jsxs("div",{className:"bg-[#121213] p-4 w-screen h-screen overflow-x-hidden overflow-y-auto relative z-50",children:[i.jsx("div",{className:"h-full w-full absolute -z-10 -mt-[138px]"}),i.jsx(zce,{scrollToFeatures:()=>{var t;return(t=featuresRef.current)==null?void 0:t.scrollIntoView({behavior:"smooth"})},scrollToHowItWorks:()=>{var t;return(t=howItWorksRef.current)==null?void 0:t.scrollIntoView({behavior:"smooth"})},scrollToFAQ:()=>{var t;return(t=faQRef.current)==null?void 0:t.scrollIntoView({behavior:"smooth"})}}),i.jsx("section",{className:"px-1 py-5 sm:py-[64px] text-center",children:i.jsx("div",{className:"max-w-7xl mx-auto h-full",children:i.jsx("div",{className:"flex flex-col items-start gap-[88px] h-full",children:i.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 h-full",children:[i.jsx("h2",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px]",children:"Hyperliquid Copy Trade Video Tutorials & Guides"}),i.jsx("div",{className:"flex justify-center flex-wrap gap-6",children:e.map(t=>i.jsxs("div",{className:"w-full sm:w-1/4 bg-[#1c1c1c] rounded-xl overflow-hidden shadow-md p-4",children:[i.jsx("div",{className:"text-white font-semibold text-base p-4 h-32",children:t.title}),i.jsx("div",{className:"aspect-w-16 aspect-h-9",children:i.jsx("iframe",{src:`https://www.youtube.com/embed/${t.id}`,title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-48 rounded-xl"})})]},t.id))})]})})})}),i.jsx(Hce,{})]})]})},$P=(e,t=2)=>Number(e).toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:t}),ZY=(e,t=2)=>Number(e).toLocaleString("en-US",{maximumFractionDigits:t}),ICe=e=>`${(e*100).toFixed(2)}%`,JY=e=>Math.floor((Date.now()-e)/864e5);function ron(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(!1),[C,N]=m.useState(""),[I,P]=m.useState("tvl"),[R,F]=m.useState("desc"),[U,L]=m.useState(20),[z,Q]=m.useState(1),ne=te=>(te.summary.name||"").trim()==="Hyperliquidity Provider (HLP)",J=()=>{r(!0),ds.get("https://stats-data.hyperliquid.xyz/Mainnet/vaults").then(te=>t(Array.isArray(te.data)?te.data:[])).finally(()=>r(!1))};m.useEffect(()=>J(),[]);const X=(te,ae)=>{var Ce;const he=(Ce=te.pnls)==null?void 0:Ce.find(([ce])=>ce===ae);return he?parseFloat(he[1].slice(-1)[0]||0):0},re=m.useMemo(()=>{if(!e.length)return null;const te=e.reduce((he,Ce)=>he+ +Ce.summary.tvl,0),ae=e.reduce((he,Ce)=>he+(Ce.apr||0),0)/e.length;return{total:e.length,active:e.filter(he=>!he.summary.isClosed).length,tvl:te,avgApr:ae,profitable:e.filter(he=>X(he,"allTime")>0).length}},[e]),pe=m.useMemo(()=>e.filter(te=>{const ae=+te.summary.tvl,he=te.apr||0,Ce=X(te,"month"),ce=X(te,"allTime"),ge=JY(te.summary.createTimeMillis),Ae=(te.summary.name||"").toLowerCase()+(te.summary.vaultAddress||"").toLowerCase();return!(s&&ae<+s||o&&he*100<+o||c&&Ce<+c||d&&ce<+d||x&&ge<+x||!v&&te.summary.isClosed||C&&!Ae.includes(C.toLowerCase()))}),[e,s,o,c,d,x,v,C]),Y=(te,ae)=>{var he;switch(ae){case"name":return((he=te.summary.name)==null?void 0:he.toLowerCase())||"";case"apr":return te.apr||0;case"tvl":return+te.summary.tvl;case"p30":return X(te,"month");case"pAll":return X(te,"allTime");case"days":return JY(te.summary.createTimeMillis);default:return 0}},ie=m.useMemo(()=>[...pe].sort((te,ae)=>{const he=Y(te,I),Ce=Y(ae,I);return he===Ce?0:R==="asc"?he>Ce?1:-1:he<Ce?1:-1}),[pe,I,R]),oe=Math.max(1,Math.ceil(ie.length/U)),G=ie.slice((z-1)*U,z*U),V=(te,ae)=>i.jsx("th",{onClick:()=>P(te)||F(I===te?R==="asc"?"desc":"asc":"desc"),className:`px-3 py-2 cursor-pointer whitespace-nowrap ${I===te?"text-[#67FFBD]":""}`,children:ae},te);return n?i.jsx("div",{className:"flex justify-center items-center w-full py-10",children:i.jsx(GUe,{color:"#ffffff",size:40})}):i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Hyperliquid Vaults Dashboard | Track Performance Metrics | Dextrabot"}),i.jsx("meta",{name:"description",content:"Monitor real-time performance of 7,200+ Hyperliquid vaults with comprehensive metrics on TVL, APR, and PnL. Filter by performance criteria to find the most profitable vaults."}),i.jsx("meta",{name:"og:title",content:"Hyperliquid Vaults Dashboard | Track Performance Metrics | Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Monitor real-time performance of 7,200+ Hyperliquid vaults with comprehensive metrics on TVL, APR, and PnL. Filter by performance criteria to find the most profitable vaults."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/hyperliquid-vaults"})]})}),i.jsxs("div",{className:"max-w-7xl mx-auto p-6 font-manrope font-bold w-full",children:[i.jsx("h1",{className:"text-3xl font-bold text-center mb-8 text-white",children:"Hyperliquid Vaults Dashboard"}),i.jsx("button",{onClick:()=>{J(),Q(1)},disabled:n,className:"bg-[#1c1c1c] hover:bg-[#303030] text-white px-4 py-2 rounded disabled:opacity-40 text-sm font-bold mb-4 flex justify-end",children:n?"Refreshing…":"Refresh Data"}),re&&i.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-5 gap-4 mb-8 text-center",children:[["Total Vaults",ZY(re.total,0)],["Active Vaults",ZY(re.active,0)],["Total TVL",$P(re.tvl,0)],["Average APR",ICe(re.avgApr)],["Profitable Vaults",ZY(re.profitable,0)]].map(([te,ae])=>i.jsxs("div",{className:"bg-[#1c1c1c] rounded-lg p-4",children:[i.jsx("p",{className:"text-sm text-gray-400 mb-1",children:te}),i.jsx("p",{className:"text-xl font-semibold text-white",children:ae})]},te))}),i.jsxs("div",{className:"bg-[#1c1c1c] rounded-lg p-4 mb-8",children:[i.jsx("h2",{className:"text-xl font-semibold mb-4 text-white",children:"Filters"}),i.jsxs("div",{className:"grid md:grid-cols-6 gap-4 mb-4",children:[[["Min TVL",s,a],["Min APR (%)",o,l],["Min 30d PNL",c,u],["Min All-Time PNL",d,f],["Min Days",x,g]].map(([te,ae,he])=>i.jsxs("div",{className:"flex flex-col",children:[i.jsx("label",{className:"text-sm text-gray-300 mb-1",children:te}),i.jsx("input",{type:"number",value:ae===0?"":ae,placeholder:"0",onChange:Ce=>he(Ce.target.value===""?"":+Ce.target.value),className:"bg-[#303030] text-white rounded px-3 py-2 outline-none"})]},te)),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("label",{className:"text-sm text-gray-300 mb-1",children:"Search"}),i.jsx("input",{value:C,onChange:te=>N(te.target.value),className:"bg-[#303030] text-white rounded px-3 py-2 outline-none"})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("label",{className:"flex items-center text-sm text-gray-300",children:[i.jsx("input",{type:"checkbox",checked:v,onChange:te=>w(te.target.checked),className:"mr-2"}),"Show Closed Vaults"]}),i.jsx("button",{onClick:()=>{a(""),l(""),u(""),f(""),g(""),w(!1),N("")},className:"bg-[#303030] text-white px-3 py-1 text-sm font-bold rounded",children:"Reset"})]})]}),i.jsx("div",{className:"rounded-lg overflow-auto border border-[#303030]",children:i.jsxs("table",{className:"min-w-full text-sm text-gray-200 border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"bg-[#161616]",children:i.jsxs("tr",{children:[V("name","Vault"),V("tvl","TVL"),V("apr","APR"),V("p30","30d PNL"),V("pAll","All-Time PNL"),V("days","Days")]})}),i.jsx("tbody",{children:G.map((te,ae)=>{const he=+te.summary.tvl,Ce=te.apr||0,ce=X(te,"month"),ge=X(te,"allTime"),Ae=JY(te.summary.createTimeMillis),ye=te.summary.vaultAddress;return i.jsxs("tr",{className:"border-b border-[#1b1b1b] bg-[#1b1b1b] hover:bg-[#222222] text-center",children:[i.jsxs("td",{className:"px-3 py-2 whitespace-nowrap flex items-center gap-2",children:[i.jsx("a",{href:`https://app.hyperliquid.xyz/vaults/${ye}`,target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#67FFBD] font-bold text-white",children:te.summary.name||"Unnamed"}),i.jsx("a",{href:`/wallet-details/${ye}`,target:"_blank",rel:"noopener noreferrer",children:i.jsx("img",{src:qi,className:"w-4 h-4"})}),ne(te)&&i.jsx("span",{className:"text-[#FF7173] ml-1",children:"(Protocol Vault)"})]}),i.jsx("td",{className:"px-3 py-2",children:$P(he)}),i.jsx("td",{className:"px-3 py-2",children:ICe(Ce)}),i.jsx("td",{className:`px-3 py-2 ${ce>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:$P(ce)}),i.jsx("td",{className:`px-3 py-2 ${ge>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:$P(ge)}),i.jsx("td",{className:"px-3 py-2",children:Ae})]},ye)})})]})}),i.jsxs("div",{className:"flex items-center justify-between mt-4 text-gray-200",children:[i.jsxs("div",{className:"text-sm",children:["Rows:",i.jsx("select",{value:U,onChange:te=>{L(+te.target.value),Q(1)},className:"bg-[#303030] ml-2 px-2 py-1 rounded text-sm font-bold",children:[10,20,30,40,50,100].map(te=>i.jsx("option",{children:te},te))})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:()=>Q(te=>Math.max(1,te-1)),disabled:z===1,className:"px-2 py-1 bg-[#1c1c1c] rounded disabled:opacity-40",children:"‹"}),i.jsxs("span",{className:"text-sm",children:[z,"/",oe]}),i.jsx("button",{onClick:()=>Q(te=>Math.min(oe,te+1)),disabled:z===oe,className:"px-2 py-1 bg-[#1c1c1c] rounded disabled:opacity-40",children:"›"})]})]})]})]})}const Nh=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s})=>{const a=()=>{r(n===`-${t}`?t:`-${t}`)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>a(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope cursor-pointer`,children:[i.jsx("div",{className:`${n.includes(t)?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(cU,{sortKey:t,state:n,className:""})]})})},son=({data:e,period:t})=>i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 lg:gap-4 px-2 sm:px-0 min-w-max",children:e?e==null?void 0:e.map((n,r)=>i.jsxs(m.Fragment,{children:[i.jsx(xb,{title:"Total Notional",value:n!=null&&n.total_notional?n==null?void 0:n.total_notional:"--",info:`${n!=null&&n.ticker_count?n==null?void 0:n.ticker_count:"--"} tickers`,icon:Wme,period:t}),i.jsx(xb,{title:"Long Positions",value:n!=null&&n.long_exposure?n==null?void 0:n.long_exposure:"--",info:"Long exposure",icon:xJ,period:t}),i.jsx(xb,{title:"Short Positions",value:n!=null&&n.short_exposure?n==null?void 0:n.short_exposure:"--",info:"Short exposure",icon:gJ,period:t}),i.jsx(xb,{title:"Global Bias",value:n!=null&&n.global_bias?n==null?void 0:n.global_bias:"--",info:`L/S: ${n!=null&&n.long_ratio_percent?n==null?void 0:n.long_ratio_percent:"--"}%`,icon:4,period:t})]},r)):i.jsxs(i.Fragment,{children:[i.jsx(xb,{title:"Total Notional",value:"--",info:"--",icon:Wme,period:t}),i.jsx(xb,{title:"Long Positions",value:"--",info:"Long exposure",icon:xJ,period:t}),i.jsx(xb,{title:"Short Positions",value:"--",info:"Short exposure",icon:gJ,period:t}),i.jsx(xb,{title:"Global Bias",value:"--",info:"L/S: --",icon:4,period:t})]})}),xb=({title:e,value:t,info:n,icon:r,period:s})=>i.jsxs("div",{style:{background:"linear-gradient(180deg, #000000 0%, #1C1C1C 100%)"},className:"h-20 lg:h-28 bg-[#1c1c1c] rounded-2xl p-2 lg:p-6 min-w-max relative overflow-hidden",children:[i.jsxs("div",{className:"flex justify-start items-start w-full h-full gap-2",children:[i.jsx("div",{className:"w-8 h-11 lg:w-12 lg:h-11 bg-[#1e1e1e] rounded-md border-[0.50px] border-[#313131] flex justify-center items-center",children:r===4?i.jsx(FRt,{className:`${t=="LONG"?"text-[#34D399]":(t=="SHORT","text-[#F87171]")} w-4 h-4 lg:w-5 lg:h-5`}):i.jsx("img",{src:r,alt:"",className:"w-4 h-4 lg:w-5 lg:h-5"})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2",children:[i.jsx("div",{className:"justify-start text-[#9b9b9b] text-[13px] lg:text-[14px] font-semibold font-['Manrope'] leading-[13px] tracking-tight mt-[3px]",children:`${e}`}),i.jsx("div",{className:"justify-start text-white text-[15px] lg:text-[17px] font-semibold font-['Manrope'] leading-[13px] tracking-tight",children:e==="Global Bias"?t:`$${Xlt(t)}`}),i.jsx("div",{className:"justify-start text-[#7e7e7e] text-[11px] lg:text-[12px] font-medium font-['Inter'] leading-[8px] tracking-tight mt-2",children:n})]})]}),r===4&&i.jsx("div",{className:`${t=="LONG"?"bg-[#67ffbd]/20":t=="SHORT"?"bg-[#ff797c]/20":""} h-2 lg:h-4 w-full absolute bottom-0 right-0 rounded-t-2xl`})]}),Fne=({data_1:e,data_2:t,margin:n})=>i.jsxs("div",{className:`${n=="true"?"mt-3":""} flex flex-col items-start justify-start gap-2 w-full px-1`,children:[i.jsx("div",{className:"text-white bg-transparent text-xs font-medium font-inter leading-[8px] tracking-[0.18px] w-full",children:i.jsxs("span",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-[#67ffbd]",children:e?`${e}%`:"--"}),i.jsx("span",{className:"text-[#ff787b]",children:t?`${t}%`:"--"})]})}),i.jsxs("div",{className:"h-1 w-full bg-[#333333] rounded-[256px] flex gap-[2px] overflow-hidden",children:[i.jsx("div",{style:e?isNaN(e)?{width:"0%"}:{width:`${e}%`}:{width:"0%"},className:"flex justify-center items-center h-1 bg-[#67FFBD] rounded-[256px] text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"}),i.jsx("div",{style:t?isNaN(t)?{width:"0%"}:{width:`${t}%`}:{width:"0%"},className:"bg-[#FF797C] h-1 rounded-[256px] flex justify-center items-center text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"})]}),i.jsx("div",{className:"text-white bg-transparent text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px] w-full",children:i.jsxs("span",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-[#67ffbd]",children:"Long"}),i.jsx("span",{className:"text-[#ff787b]",children:"Short"})]})})]}),ion=({data:e,loading:t,error:n,period:r,periods:s,handlePeriodChange:a})=>{var ne,J;const o="-total_notional",[l,c]=m.useState(o),[u,d]=m.useState("All"),f=m.useRef({}),[x,g]=m.useState(""),v=m.useRef(null),w=X=>{var pe;const re=(pe=e.data)==null?void 0:pe.filter(Y=>{var oe,G,V,te,ae;if(u!=="All"&&Y.majority_side!==u)return!1;const ie=(oe=x==null?void 0:x.trim())==null?void 0:oe.toLowerCase();return!(ie!==""&&!((V=(G=Y==null?void 0:Y.asset)==null?void 0:G.toLowerCase())!=null&&V.includes(ie)||(ae=(te=Y==null?void 0:Y.coin_name)==null?void 0:te.toLowerCase())!=null&&ae.includes(ie)))});return re==null?void 0:re.sort((Y,ie)=>{const oe=Y.asset?Y.asset.toUpperCase():"",G=ie.asset?ie.asset.toUpperCase():"",V=Y.majority_side==="LONG"?1:0,te=ie.majority_side==="LONG"?1:0,ae=Y.majority_side==="SHORT"?1:0,he=ie.majority_side==="SHORT"?1:0,Ce=Y.maj_side_pnl==="Profit"?1:0,ce=ie.maj_side_pnl==="Profit"?1:0,ge=Y.maj_side_pnl==="Loss"?1:0,Ae=ie.maj_side_pnl==="Loss"?1:0,ye=$e=>{if(!$e||typeof $e!="string"||!$e.includes("/"))return 0;const[it,tt]=$e.split("/").map(ot=>Number(ot.trim()));return tt!==0?it/tt:0},je=ye(Y.traders_l_s),Ie=ye(ie.traders_l_s),Re=$e=>{var ot,ft;const it=parseFloat((ot=$e==null?void 0:$e.asset_change24h)==null?void 0:ot.markPx),tt=parseFloat((ft=$e==null?void 0:$e.asset_change24h)==null?void 0:ft.prevDayPx);return!it||!tt||isNaN(it)||isNaN(tt)||tt===0?-1/0:(it-tt)/tt*100},Qe=$e=>{var tt;const it=parseFloat((tt=$e==null?void 0:$e.asset_change24h)==null?void 0:tt.markPx);return isNaN(it)?0:it};return X==="asset"?oe<G?-1:oe>G?1:0:X==="-asset"?oe>G?-1:oe<G?1:0:X==="-total_notional"?ie.total_notional-Y.total_notional:X==="total_notional"?Y.total_notional-ie.total_notional:X==="-price"?Qe(ie)-Qe(Y):X==="price"?Qe(Y)-Qe(ie):X==="-long_notional"?ie.long_notional-Y.long_notional:X==="long_notional"?Y.long_notional-ie.long_notional:X==="-short_notional"?ie.short_notional-Y.short_notional:X==="short_notional"?Y.short_notional-ie.short_notional:X==="-total_long_pnl"?ie.total_long_pnl-Y.total_long_pnl:X==="total_long_pnl"?Y.total_long_pnl-ie.total_long_pnl:X==="-total_short_pnl"?ie.total_short_pnl-Y.total_short_pnl:X==="total_short_pnl"?Y.total_short_pnl-ie.total_short_pnl:X==="-majority_side"?te-V:X==="majority_side"?he-ae:X==="-l_s_ratio"?ie.l_s_ratio-Y.l_s_ratio:X==="l_s_ratio"?Y.l_s_ratio-ie.l_s_ratio:X==="-long_ratio"?ie.long_ratio-Y.long_ratio:X==="long_ratio"?Y.long_ratio-ie.long_ratio:X==="-short_ratio"?ie.short_ratio-Y.short_ratio:X==="short_ratio"?Y.short_ratio-ie.short_ratio:X==="-maj_side_notional"?ie.maj_side_notional-Y.maj_side_notional:X==="maj_side_notional"?Y.maj_side_notional-ie.maj_side_notional:X==="-maj_side_pnl"?ce-Ce:X==="maj_side_pnl"?Ae-ge:X==="-traders_l_s"?Ie-je:X==="traders_l_s"?je-Ie:X==="-open_interest"?ie.open_interest-Y.open_interest:X==="open_interest"?Y.open_interest-ie.open_interest:X==="-change_24h"?Re(ie)-Re(Y):X==="change_24h"?Re(Y)-Re(ie):0})},C=m.useRef(null),N=()=>{C.current&&(C.current.scrollLeft-=100)},I=()=>{C.current&&(C.current.scrollLeft+=100)},P=()=>{C.current&&(C.current.scrollTop+=200)},R=()=>{C.current&&(C.current.scrollTop-=200)},F=X=>{var re;X.key==="Escape"&&(g(""),(re=v.current)==null||re.blur())},U=({coin:X,price:re,prevPricesRef:pe})=>{const[Y,ie]=m.useState("text-white");return m.useEffect(()=>{if(!X||re==null||isNaN(re))return;const oe=parseFloat(re),G=pe.current[X]??0;oe>G?ie("text-[#1DE6A3]"):oe<G&&ie("text-[#FF7173]"),pe.current[X]=oe;const V=setTimeout(()=>{ie("text-white")},800);return()=>clearTimeout(V)},[re,X]),i.jsx(Qx,{info:re==null||isNaN(re)?i.jsx("div",{className:"flex items-center justify-end w-[96px]",children:i.jsx("div",{className:"w-[96px] max-w-[96px] h-[20px] rounded skeleton-ticker-text short"})}):`$${re>=1e3?Vw(re):re}`,textColor:Y})},L={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},z=()=>i.jsx("div",{className:"flex items-center justify-end w-[96px]",children:i.jsx("div",{className:"w-[96px] max-w-[96px] h-[20px] rounded skeleton-ticker-text short"})}),Q=X=>X>=376&&X<500?4:X>=500&&X<640?5:X>=640&&X<768?6:X>=768&&X<1024?7:X>=1024&&X<1280?9:X>=1280&&X<1540?11:X>=1540&&X<1700||X>=1700?12:3;return i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[10px] sm:gap-[13px] text-white bg-[#161616] w-full h-full font-manrope",children:[i.jsx("div",{className:"flex justify-between sm:justify-start items-center gap-6 w-full sm:w-max",children:i.jsxs("div",{className:"flex flex-row sm:flex-col justify-between items-center sm:items-start sm:justify-start gap-2 font-manrope max-w-full w-max sm:w-full bg-[#161616] pl-2 sm:pl-0 pt-1 pr-2 sm:pr-0",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-sm sm:text-lg font-medium font-manrope leading-[21px]",children:"Ticker"})})]})}),i.jsx(son,{data:e.topbox,period:r}),i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full h-max px-2 sm:px-0",children:[i.jsxs("div",{className:"flex justify-start items-center gap-0.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx("input",{ref:v,type:"text",value:x,onChange:X=>g(X.target.value),onKeyDown:F,className:"bg-[#222222] rounded text-white py-1 pl-2 pr-4 w-40 text-sm outline-none placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Search Coin"}),i.jsx("div",{onClick:()=>g(""),className:"text-[#aaa] hover:text-white outline-none focus:outline-none focus:ring-0 border-none w-4 h-[26px] bg-[#222222] hover:bg-[#333333] rounded flex justify-center items-center cursor-pointer",children:i.jsx("img",{src:Ba,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(eX,{title:"All",set_click:()=>d("All"),tableSortButton:u}),i.jsx(eX,{title:"LONG",set_click:()=>d("LONG"),tableSortButton:u}),i.jsx(eX,{title:"SHORT",set_click:()=>d("SHORT"),tableSortButton:u})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-6 right-4 z-10 hidden sm:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:N,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:I,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:R,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:P,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Xa,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-[calc(100vh-330px)] sm:h-[calc(100vh-390px)] md:h-[calc(100vh-305px)] lg:h-[calc(100vh-340px)] overflow-x-scroll relative overflow-y-scroll flex-grow",ref:C,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[160px] z-[8]",children:i.jsx(Nh,{title:"Coin",sortKey:"asset",sortOption:l,setSortOption:c,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] px-1",children:i.jsx(Nh,{title:"Majority Side",sortKey:"majority_side",sortOption:l,setSortOption:c,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] ",children:i.jsxs("div",{className:"flex justify-end items-center gap-1.5 min-w-[110px] px-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 bg-[#67FFBD] inline-block rounded-full live-dot"}),i.jsx(Nh,{title:"Mark Price",sortKey:"price",sortOption:l,setSortOption:c,isFilterIcon:!0})]})}),i.jsx("th",{scope:"col",className:"min-w-[170px] ",children:i.jsxs("div",{className:"flex justify-end items-center gap-1.5 min-w-[110px] px-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 bg-[#67FFBD] inline-block rounded-full live-dot"}),i.jsx(Nh,{title:"24h Change",sortKey:"change_24h",sortOption:l,setSortOption:c,isFilterIcon:!0})]})}),i.jsx("th",{scope:"col",className:"min-w-[120px] px-1",children:i.jsx(Nh,{title:"Long PnL",sortKey:"total_long_pnl",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[110px] px-1",children:i.jsx(Nh,{title:"Short PnL",sortKey:"total_short_pnl",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] px-1",children:i.jsx(Nh,{title:"Long Notional",sortKey:"long_notional",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[135px] px-1",children:i.jsx(Nh,{title:"Short Notional",sortKey:"short_notional",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[135px] px-1",children:i.jsx(Nh,{title:"Total Notional",sortKey:"total_notional",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[190px] px-1",children:i.jsx(Nh,{title:"Long/Short Ratio",sortKey:"long_ratio",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] px-1",children:i.jsx(Nh,{title:"Traders (L/S)",sortKey:"traders_l_s",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[140px] pl-1 pr-4",children:i.jsx(Nh,{title:"Open Interest",sortKey:"open_interest",sortOption:l,setSortOption:c,isFilterIcon:!0})})]})}),i.jsx("tbody",{children:!e.data||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Q(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Da,{})})})}):n&&!e.data?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Q(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[50vh] flex-col justify-center items-center ml-[18%] sm:ml-[25%] md:ml-[39%] w-max",children:i.jsx(zl,{})})})}):((ne=e.data)==null?void 0:ne.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Q(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[50vh] flex-col justify-center items-center ml-[18%] sm:ml-[25%] md:ml-[39%] w-max",children:i.jsx(CUe,{})})})}):(J=w(l))==null?void 0:J.map((X,re)=>{var pe,Y,ie,oe,G,V,te,ae,he,Ce,ce,ge,Ae,ye,je,Ie,Re,Qe;return i.jsx(Ne.Fragment,{children:i.jsxs("tr",{className:`${re%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",onClick:()=>{window.open(`/terminal/${X==null?void 0:X.asset}`,"_blank")},className:`${re%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222] cursor-pointer`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2.5 pl-2 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${L[X==null?void 0:X.asset]||((pe=X==null?void 0:X.asset)==null?void 0:pe.split("/")[0])}.svg`||dummyImage,alt:X==null?void 0:X.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5 bg-gray-700",loading:"lazy",onError:$e=>dm($e)}),i.jsx(Qx,{info:X!=null&&X.asset?X==null?void 0:X.asset:"--",textColor:"text-white"}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:xm,alt:"",className:"w-[12px] h-[12px] min-w-[12px] min-h-[12px]"})})]})})}),i.jsx("td",{children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${X.majority_side=="LONG"?"text-[#67ffbd] bg-[#67ffbd]/20":X.majority_side=="SHORT"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:X.majority_side=="LONG"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):X.majority_side=="SHORT"?i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"})})}),i.jsx("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:X.majority_side?X.majority_side:"--"})]})})}),i.jsx("td",{className:"px-1",children:i.jsx(U,{coin:X==null?void 0:X.asset,price:(Y=X==null?void 0:X.asset_change24h)==null?void 0:Y.markPx,prevPricesRef:f})}),i.jsx("td",{className:"px-1",children:i.jsx(aon,{info:((ie=X==null?void 0:X.asset_change24h)==null?void 0:ie.markPx)-((oe=X==null?void 0:X.asset_change24h)==null?void 0:oe.prevDayPx)?((G=X==null?void 0:X.asset_change24h)==null?void 0:G.markPx)-((V=X==null?void 0:X.asset_change24h)==null?void 0:V.prevDayPx)>0?"+"+Math.abs(parseFloat(((te=X==null?void 0:X.asset_change24h)==null?void 0:te.markPx)-((ae=X==null?void 0:X.asset_change24h)==null?void 0:ae.prevDayPx)).toFixed(5)):"-"+Math.abs(parseFloat(((he=X==null?void 0:X.asset_change24h)==null?void 0:he.markPx)-((Ce=X==null?void 0:X.asset_change24h)==null?void 0:Ce.prevDayPx)).toFixed(5)):z(),info_2:(((ce=X==null?void 0:X.asset_change24h)==null?void 0:ce.markPx)-((ge=X==null?void 0:X.asset_change24h)==null?void 0:ge.prevDayPx))/((Ae=X==null?void 0:X.asset_change24h)==null?void 0:Ae.prevDayPx)*100,color_1:`${((ye=X==null?void 0:X.asset_change24h)==null?void 0:ye.markPx)-((je=X==null?void 0:X.asset_change24h)==null?void 0:je.prevDayPx)>=0?"text-[#1DE6A3]":"text-[#FF7173]"}`,color_2:`${(((Ie=X==null?void 0:X.asset_change24h)==null?void 0:Ie.markPx)-((Re=X==null?void 0:X.asset_change24h)==null?void 0:Re.prevDayPx))/((Qe=X==null?void 0:X.asset_change24h)==null?void 0:Qe.prevDayPx)*100>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.total_long_pnl)==null||isNaN(parseFloat(X==null?void 0:X.total_long_pnl))?"--":`$${ed(Math.abs(X==null?void 0:X.total_long_pnl))}`,textColor:`${(X==null?void 0:X.total_long_pnl)==null||isNaN(parseFloat(X==null?void 0:X.total_long_pnl))||(X==null?void 0:X.total_long_pnl)==0?"text-white":(X==null?void 0:X.total_long_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.total_short_pnl)==null||isNaN(parseFloat(X==null?void 0:X.total_short_pnl))?"--":`$${ed(Math.abs(X==null?void 0:X.total_short_pnl))}`,textColor:`${(X==null?void 0:X.total_short_pnl)==null||isNaN(parseFloat(X==null?void 0:X.total_short_pnl))||(X==null?void 0:X.total_short_pnl)==0?"text-white":(X==null?void 0:X.total_short_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.long_notional)==null||isNaN(parseFloat(X==null?void 0:X.long_notional))?"--":`$${ed(X==null?void 0:X.long_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.short_notional)==null||isNaN(parseFloat(X==null?void 0:X.short_notional))?"--":`$${ed(X==null?void 0:X.short_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:(X==null?void 0:X.total_notional)==null||isNaN(parseFloat(X==null?void 0:X.total_notional))?"--":`$${ed(X==null?void 0:X.total_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"",children:i.jsx("div",{className:"flex justify-end w-full",children:i.jsx("div",{className:"flex justify-end w-full max-w-[150px]",children:i.jsx(Fne,{data_1:X!=null&&X.long_ratio?parseFloat(X==null?void 0:X.long_ratio).toFixed(2):0,data_2:X!=null&&X.short_ratio?parseFloat(X==null?void 0:X.short_ratio).toFixed(2):0,margin:"false"})})})}),i.jsx("td",{className:"px-1",children:i.jsx(Qx,{info:X!=null&&X.traders_l_s?X==null?void 0:X.traders_l_s:"--",textColor:"text-white"})}),i.jsx("td",{className:"pr-4",children:i.jsx(Qx,{info:(X==null?void 0:X.open_interest)==null||isNaN(parseFloat(X==null?void 0:X.open_interest))?"--":`$${ed(X==null?void 0:X.open_interest)}`,textColor:"text-white"})})]})},re)})})]})})]})]})})},Qx=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:e})}),aon=({info:e,info_2:t,color_1:n,color_2:r})=>i.jsx("div",{className:"flex justify-end items-center gap-0.5",children:t?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:e}),i.jsx("div",{className:`${n} flex justify-center items-center max-h-2`,children:e?"/":""}),i.jsx("div",{className:`${r} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:`${t>0?"+":"-"}${parseFloat(t).toFixed(2)}%`})]}):i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:e})}),eX=({title:e,set_click:t,tableSortButton:n})=>i.jsx("div",{onClick:t,className:`${n==e?"bg-[#3d3d3d] text-white":"bg-[#161616] text-[#9b9b9b]"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-7`,children:e}),oon=()=>{Jr();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u,hyperToken:d}=m.useContext(Qr),[f,x]=m.useState([]),[g,v]=m.useState(!1),[w,C]=m.useState(null),N=[{index:0,name:"1D",value:1},{index:1,name:"7D",value:7},{index:2,name:"30D",value:30},{index:3,name:"90D",value:90}],I=parseInt(localStorage.getItem("ticker_period")),P=!isNaN(I)&&N[I]?N[I].value:N[1].value,[R,F]=m.useState(P),U=z=>{F(Number(z)),localStorage.setItem("ticker_period",N.findIndex(Q=>Q.value===Number(z)).toFixed(0))},L=async()=>{try{v(!0);const Q=await fetch("https://dextradata.nftinit.io/api/hyper/analytics_v2/",{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!Q.ok)throw new Error("Network response was not ok");const ne=await Q.json();ne!=null&&ne.success?(x(ne),v(!1)):(v(!1),C(ne==null?void 0:ne.error_message),console.error("Error fetching analytics data:",ne==null?void 0:ne.error_message))}catch(z){setError(z.message),v(!1),console.error("Error fetching analytics data:",z)}finally{v(!1)}};return m.useEffect(()=>{L()},[]),m.useEffect(()=>{const z=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");z.onopen=()=>{z.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:"0x0000000000000000000000000000000000000000"}}))},z.onmessage=J=>{var re;const X=JSON.parse(J==null?void 0:J.data);if(X.channel==="webData2"){const pe=X.data,Y=pe.assetCtxs,ie=(re=pe.meta)==null?void 0:re.universe;if(Array.isArray(Y)&&Array.isArray(ie)){const oe=Y.map((G,V)=>{var te;return{...G,name:((te=ie[V])==null?void 0:te.name)??null}});x(G=>{if(!G||!Array.isArray(G.data))return G;const V=G.data.map(te=>{const ae=oe.find(he=>he.name===te.asset);return ae?{...te,asset_change24h:ae}:te});return{...G,data:V}})}else console.error("missing assetCtxs or universe:",{assetCtxs:Y,universe:ie})}};const Q=()=>{z.readyState===WebSocket.OPEN&&z.send(JSON.stringify({method:"unsubscribe",subscription:{type:"webData2",user:"0x0000000000000000000000000000000000000000"}})),z.close()},ne=()=>{Q(),window.removeEventListener("beforeunload",Q)};return window.addEventListener("beforeunload",Q),ne},[]),m.useEffect(()=>{(async()=>{var J,X;const Q=window.localStorage.getItem("hyperToken"),ne=window.localStorage.getItem("hyperAddress");if(!(!Q||!ne))try{const re=await ji(ne.toLowerCase(),Q);re!=null&&re.success?(e(re==null?void 0:re.telegram_chat_id),t(re==null?void 0:re.subscriber_role),n(re==null?void 0:re.subs_expire_day),r((J=re==null?void 0:re.mushboomer_counts)==null?void 0:J.eth),a((X=re==null?void 0:re.mushboomer_counts)==null?void 0:X.sol),o(re==null?void 0:re.referral_code),l(re==null?void 0:re.refcode),s(re==null?void 0:re.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(re){console.error("Token verification error:",re)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsx(Ho,{children:i.jsxs(i.Fragment,{children:[i.jsx("title",{children:"Real-time Crypto Positions Tracker | Top Hyperliquid Traders | Dextrabot"}),i.jsx("meta",{name:"description",content:"Track real-time positions of top-performing Hyperliquid traders by cryptocurrency. View live long/short exposure, trading volumes, and performance metrics for BTC, ETH, SOL and more. Copy profitable strategies instantly."}),i.jsx("meta",{property:"og:title",content:"Real-time Crypto Positions Tracker | Top Hyperliquid Traders | Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Track real-time positions of top-performing Hyperliquid traders by cryptocurrency. View live long/short exposure, trading volumes, and performance metrics for BTC, ETH, SOL and more. Copy profitable strategies instantly."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/ticker"})]})})}),i.jsx("div",{className:"flex justify-center items-center w-full h-[calc(100vh-65px)] sm:h-[calc(100vh-80px)] px-1 pt-1 sm:px-6 sm:pt-3 bg-[#161616] overflow-hidden",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(ion,{data:f,loading:g,error:w,period:R,periods:N,handlePeriodChange:U})})})]})},Vce=m.createContext({});function Wce(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const qce=typeof window<"u",QUe=qce?m.useLayoutEffect:m.useEffect,fU=m.createContext(null),UP=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function lon(e,t){let n=new Set,r=new Set,s=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),e()),d(l)}const u={schedule:(d,f=!1,x=!1)=>{const v=x&&s?n:r;return f&&o.add(d),v.has(d)||v.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(l=d,s){a=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,a&&(a=!1,u.process(d))}};return u}const con=40;function ZUe(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=UP.reduce((P,R)=>(P[R]=lon(a),P),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:x,render:g,postRender:v}=o,w=()=>{const P=Fc.useManualTiming?s.timestamp:performance.now();n=!1,Fc.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(P-s.timestamp,con),1)),s.timestamp=P,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),f.process(s),x.process(s),g.process(s),v.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(w))},C=()=>{n=!0,r=!0,s.isProcessing||e(w)};return{schedule:UP.reduce((P,R)=>{const F=o[R];return P[R]=(U,L=!1,z=!1)=>(n||C(),F.schedule(U,L,z)),P},{}),cancel:P=>{for(let R=0;R<UP.length;R++)o[UP[R]].cancel(P)},state:s,steps:o}}const{schedule:Fo,cancel:Xy,state:Kc,steps:tX}=ZUe(typeof requestAnimationFrame<"u"?requestAnimationFrame:al,!0);let wO;function uon(){wO=void 0}const Jd={now:()=>(wO===void 0&&Jd.set(Kc.isProcessing||Fc.useManualTiming?Kc.timestamp:performance.now()),wO),set:e=>{wO=e,queueMicrotask(uon)}},JUe=e=>t=>typeof t=="string"&&t.startsWith(e),Gce=JUe("--"),don=JUe("var(--"),Kce=e=>don(e)?fon.test(e.split("/*")[0].trim()):!1,fon=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,s8={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},D_={...s8,transform:e=>Pc(0,1,e)},zP={...s8,default:1},u9=e=>Math.round(e*1e5)/1e5,Yce=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function hon(e){return e==null}const pon=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xce=(e,t)=>n=>!!(typeof n=="string"&&pon.test(n)&&n.startsWith(e)||t&&!hon(n)&&Object.prototype.hasOwnProperty.call(n,t)),eze=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(Yce);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},mon=e=>Pc(0,255,e),nX={...s8,transform:e=>Math.round(mon(e))},lw={test:Xce("rgb","red"),parse:eze("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+nX.transform(e)+", "+nX.transform(t)+", "+nX.transform(n)+", "+u9(D_.transform(r))+")"};function xon(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const One={test:Xce("#"),parse:xon,transform:lw.transform},pT=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),jb=pT("deg"),V0=pT("%"),ai=pT("px"),gon=pT("vh"),bon=pT("vw"),PCe={...V0,parse:e=>V0.parse(e)/100,transform:e=>V0.transform(e*100)},UC={test:Xce("hsl","hue"),parse:eze("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+V0.transform(u9(t))+", "+V0.transform(u9(n))+", "+u9(D_.transform(r))+")"},Dl={test:e=>lw.test(e)||One.test(e)||UC.test(e),parse:e=>lw.test(e)?lw.parse(e):UC.test(e)?UC.parse(e):One.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?lw.transform(e):UC.transform(e),getAnimatableNone:e=>{const t=Dl.parse(e);return t.alpha=0,Dl.transform(t)}},yon=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function von(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Yce))==null?void 0:t.length)||0)+(((n=e.match(yon))==null?void 0:n.length)||0)>0}const tze="number",nze="color",won="var",Con="var(",FCe="${}",Son=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function B_(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(Son,c=>(Dl.test(c)?(r.color.push(a),s.push(nze),n.push(Dl.parse(c))):c.startsWith(Con)?(r.var.push(a),s.push(won),n.push(c)):(r.number.push(a),s.push(tze),n.push(parseFloat(c))),++a,FCe)).split(FCe);return{values:n,split:l,indexes:r,types:s}}function rze(e){return B_(e).values}function sze(e){const{split:t,types:n}=B_(e),r=t.length;return s=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],s[o]!==void 0){const l=n[o];l===tze?a+=u9(s[o]):l===nze?a+=Dl.transform(s[o]):a+=s[o]}return a}}const Non=e=>typeof e=="number"?0:Dl.test(e)?Dl.getAnimatableNone(e):e;function Aon(e){const t=rze(e);return sze(e)(t.map(Non))}const Qy={test:von,parse:rze,createTransformer:sze,getAnimatableNone:Aon};function rX(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function jon({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,o=0;if(!t)s=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=rX(c,l,e+1/3),a=rX(c,l,e),o=rX(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function qL(e,t){return n=>n>0?t:e}const Uo=(e,t,n)=>e+(t-e)*n,sX=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Eon=[One,lw,UC],_on=e=>Eon.find(t=>t.test(e));function OCe(e){const t=_on(e);if(!t)return!1;let n=t.parse(e);return t===UC&&(n=jon(n)),n}const MCe=(e,t)=>{const n=OCe(e),r=OCe(t);if(!n||!r)return qL(e,t);const s={...n};return a=>(s.red=sX(n.red,r.red,a),s.green=sX(n.green,r.green,a),s.blue=sX(n.blue,r.blue,a),s.alpha=Uo(n.alpha,r.alpha,a),lw.transform(s))},Mne=new Set(["none","hidden"]);function kon(e,t){return Mne.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ton(e,t){return n=>Uo(e,t,n)}function Qce(e){return typeof e=="number"?Ton:typeof e=="string"?Kce(e)?qL:Dl.test(e)?MCe:Fon:Array.isArray(e)?ize:typeof e=="object"?Dl.test(e)?MCe:Ion:qL}function ize(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>Qce(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function Ion(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Qce(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function Pon(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],o=e.indexes[a][r[a]],l=e.values[o]??0;n[s]=l,r[a]++}return n}const Fon=(e,t)=>{const n=Qy.createTransformer(t),r=B_(e),s=B_(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Mne.has(e)&&!s.values.length||Mne.has(t)&&!r.values.length?kon(e,t):ux(ize(Pon(r,s),s.values),n):qL(e,t)};function aze(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Uo(e,t,n):Qce(e)(e,t)}const Oon=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Fo.update(t,n),stop:()=>Xy(t),now:()=>Kc.isProcessing?Kc.timestamp:Jd.now()}},oze=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},GL=2e4;function Zce(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<GL;)t+=n,r=e.next(t);return t>=GL?1/0:t}function Mon(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Zce(r),GL);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:nl(s)}}const Ron=5;function lze(e,t,n){const r=Math.max(t-Ron,0);return DD(n-e(r),t-r)}const Jo={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},RCe=.001;function Lon({duration:e=Jo.duration,bounce:t=Jo.bounce,velocity:n=Jo.velocity,mass:r=Jo.mass}){let s,a,o=1-t;o=Pc(Jo.minDamping,Jo.maxDamping,o),e=Pc(Jo.minDuration,Jo.maxDuration,nl(e)),o<1?(s=u=>{const d=u*o,f=d*e,x=d-n,g=Rne(u,o),v=Math.exp(-f);return RCe-x/g*v},a=u=>{const f=u*o*e,x=f*n+n,g=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),w=Rne(Math.pow(u,2),o);return(-s(u)+RCe>0?-1:1)*((x-g)*v)/w}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},a=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=Bon(s,a,l);if(e=Hl(e),isNaN(c))return{stiffness:Jo.stiffness,damping:Jo.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const Don=12;function Bon(e,t,n){let r=n;for(let s=1;s<Don;s++)r=r-e(r)/t(r);return r}function Rne(e,t){return e*Math.sqrt(1-t*t)}const $on=["duration","bounce"],Uon=["stiffness","damping","mass"];function LCe(e,t){return t.some(n=>e[n]!==void 0)}function zon(e){let t={velocity:Jo.velocity,stiffness:Jo.stiffness,damping:Jo.damping,mass:Jo.mass,isResolvedFromDuration:!1,...e};if(!LCe(e,Uon)&&LCe(e,$on))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*Pc(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Jo.mass,stiffness:s,damping:a}}else{const n=Lon(e);t={...t,...n,mass:Jo.mass},t.isResolvedFromDuration=!0}return t}function KL(e=Jo.visualDuration,t=Jo.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:f,velocity:x,isResolvedFromDuration:g}=zon({...n,velocity:-nl(n.velocity||0)}),v=x||0,w=u/(2*Math.sqrt(c*d)),C=o-a,N=nl(Math.sqrt(c/d)),I=Math.abs(C)<5;r||(r=I?Jo.restSpeed.granular:Jo.restSpeed.default),s||(s=I?Jo.restDelta.granular:Jo.restDelta.default);let P;if(w<1){const F=Rne(N,w);P=U=>{const L=Math.exp(-w*N*U);return o-L*((v+w*N*C)/F*Math.sin(F*U)+C*Math.cos(F*U))}}else if(w===1)P=F=>o-Math.exp(-N*F)*(C+(v+N*C)*F);else{const F=N*Math.sqrt(w*w-1);P=U=>{const L=Math.exp(-w*N*U),z=Math.min(F*U,300);return o-L*((v+w*N*C)*Math.sinh(z)+F*C*Math.cosh(z))/F}}const R={calculatedDuration:g&&f||null,next:F=>{const U=P(F);if(g)l.done=F>=f;else{let L=F===0?v:0;w<1&&(L=F===0?Hl(v):lze(P,F,U));const z=Math.abs(L)<=r,Q=Math.abs(o-U)<=s;l.done=z&&Q}return l.value=l.done?o:U,l},toString:()=>{const F=Math.min(Zce(R),GL),U=oze(L=>R.next(F*L).value,F,30);return F+"ms "+U},toTransition:()=>{}};return R}KL.applyToOptions=e=>{const t=Mon(e,100,KL);return e.ease=t.ease,e.duration=Hl(t.duration),e.type="keyframes",e};function Lne({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],x={done:!1,value:f},g=z=>l!==void 0&&z<l||c!==void 0&&z>c,v=z=>l===void 0?c:c===void 0||Math.abs(l-z)<Math.abs(c-z)?l:c;let w=n*t;const C=f+w,N=o===void 0?C:o(C);N!==C&&(w=N-f);const I=z=>-w*Math.exp(-z/r),P=z=>N+I(z),R=z=>{const Q=I(z),ne=P(z);x.done=Math.abs(Q)<=u,x.value=x.done?N:ne};let F,U;const L=z=>{g(x.value)&&(F=z,U=KL({keyframes:[x.value,v(x.value)],velocity:lze(P,z,x.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return L(0),{calculatedDuration:null,next:z=>{let Q=!1;return!U&&F===void 0&&(Q=!0,R(z),L(z)),F!==void 0&&z>=F?U.next(z-F):(!Q&&R(z),x)}}}function Hon(e,t,n){const r=[],s=n||Fc.mix||aze,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||al:t;l=ux(c,l)}r.push(l)}return r}function Von(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(jS(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=Hon(t,r,s),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const x=K0(e[f],e[f+1],d);return l[f](x)};return n?d=>u(Pc(e[0],e[a-1],d)):u}function Won(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=K0(0,t,r);e.push(Uo(n,1,s))}}function qon(e){const t=[0];return Won(t,e.length-1),t}function Gon(e,t){return e.map(n=>n*t)}function Kon(e,t){return e.map(()=>t||fse).splice(0,e.length-1)}function d9({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=g8e(r)?r.map(zO):zO(r),a={done:!1,value:t[0]},o=Gon(n&&n.length===t.length?n:qon(t),e),l=Von(o,t,{ease:Array.isArray(s)?s:Kon(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const Yon=e=>e!==null;function Jce(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(Yon),l=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const Xon={decay:Lne,inertia:Lne,tween:d9,keyframes:d9,spring:KL};function cze(e){typeof e.type=="string"&&(e.type=Xon[e.type])}class eue{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Qon=e=>e/100;class tue extends eue{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Jd.now()&&this.tick(Jd.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;cze(t);const{type:n=d9,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||d9;c!==d9&&typeof l[0]!="number"&&(this.mixKeyframes=ux(Qon,aze(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Zce(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:x,repeatDelay:g,type:v,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-u*(this.playbackSpeed>=0?1:-1),I=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,R=r;if(f){const z=Math.min(this.currentTime,s)/l;let Q=Math.floor(z),ne=z%1;!ne&&z>=1&&(ne=1),ne===1&&Q--,Q=Math.min(Q,f+1),!!(Q%2)&&(x==="reverse"?(ne=1-ne,g&&(ne-=g/l)):x==="mirror"&&(R=o)),P=Pc(0,1,ne)*l}const F=I?{done:!1,value:d[0]}:R.next(P);a&&(F.value=a(F.value));let{done:U}=F;!I&&c!==null&&(U=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return L&&v!==Lne&&(F.value=Jce(d,this.options,C,this.speed)),w&&w(F.value),L&&this.finish(),F}then(t,n){return this.finished.then(t,n)}get duration(){return nl(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+nl(t)}get time(){return nl(this.currentTime)}set time(t){var n;t=Hl(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Jd.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=nl(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=Oon,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(s=this.options).onPlay)==null||a.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Jd.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Zon(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const cw=e=>e*180/Math.PI,Dne=e=>{const t=cw(Math.atan2(e[1],e[0]));return Bne(t)},Jon={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Dne,rotateZ:Dne,skewX:e=>cw(Math.atan(e[1])),skewY:e=>cw(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bne=e=>(e=e%360,e<0&&(e+=360),e),DCe=Dne,BCe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),$Ce=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),eln={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:BCe,scaleY:$Ce,scale:e=>(BCe(e)+$Ce(e))/2,rotateX:e=>Bne(cw(Math.atan2(e[6],e[5]))),rotateY:e=>Bne(cw(Math.atan2(-e[2],e[0]))),rotateZ:DCe,rotate:DCe,skewX:e=>cw(Math.atan(e[4])),skewY:e=>cw(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function $ne(e){return e.includes("scale")?1:0}function Une(e,t){if(!e||e==="none")return $ne(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=eln,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Jon,s=l}if(!s)return $ne(t);const a=r[t],o=s[1].split(",").map(nln);return typeof a=="function"?a(o):o[a]}const tln=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Une(n,t)};function nln(e){return parseFloat(e.trim())}const i8=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],a8=new Set(i8),UCe=e=>e===s8||e===ai,rln=new Set(["x","y","z"]),sln=i8.filter(e=>!rln.has(e));function iln(e){const t=[];return sln.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const l3={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Une(t,"x"),y:(e,{transform:t})=>Une(t,"y")};l3.translateX=l3.x;l3.translateY=l3.y;const c3=new Set;let zne=!1,Hne=!1,Vne=!1;function uze(){if(Hne){const e=Array.from(c3).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=iln(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))==null||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hne=!1,zne=!1,c3.forEach(e=>e.complete(Vne)),c3.clear()}function dze(){c3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hne=!0)})}function aln(){Vne=!0,dze(),uze(),Vne=!1}class nue{constructor(t,n,r,s,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(c3.add(this),zne||(zne=!0,Fo.read(dze),Fo.resolveKeyframes(uze))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const a=s==null?void 0:s.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&a===void 0&&s.set(t[0])}Zon(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),c3.delete(this)}cancel(){this.state==="scheduled"&&(c3.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const oln=e=>e.startsWith("--");function lln(e,t,n){oln(t)?e.style.setProperty(t,n):e.style[t]=n}const cln=aA(()=>window.ScrollTimeline!==void 0),uln={};function dln(e,t){const n=aA(e);return()=>uln[t]??n()}const fze=dln(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ij=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,zCe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ij([0,.65,.55,1]),circOut:Ij([.55,0,1,.45]),backIn:Ij([.31,.01,.66,-.59]),backOut:Ij([.33,1.53,.69,.99])};function hze(e,t){if(e)return typeof e=="function"?fze()?oze(e,t):"ease-out":hse(e)?Ij(e):Array.isArray(e)?e.map(n=>hze(n,t)||zCe.easeOut):zCe[e]}function fln(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=hze(l,s);Array.isArray(f)&&(d.easing=f);const x={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(x.pseudoElement=u),e.animate(d,x)}function pze(e){return typeof e=="function"&&"applyToOptions"in e}function hln({type:e,...t}){return pze(e)&&fze()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class pln extends eue{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,jS(typeof t.type!="string");const u=hln(t);this.animation=fln(n,r,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=Jce(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):lln(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return nl(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+nl(t)}get time(){return nl(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Hl(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&cln()?(this.animation.timeline=t,al):n(this)}}const mze={anticipate:lse,backInOut:ose,circInOut:dse};function mln(e){return e in mze}function xln(e){typeof e.ease=="string"&&mln(e.ease)&&(e.ease=mze[e.ease])}const HCe=10;class gln extends pln{constructor(t){xln(t),cze(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new tue({...o,autoplay:!1}),c=Hl(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-HCe).value,l.sample(c).value,HCe),l.stop()}}const VCe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Qy.test(e)||e==="0")&&!e.startsWith("url("));function bln(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function yln(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=VCe(s,t),l=VCe(a,t);return!o||!l?!1:bln(e)||(n==="spring"||pze(n))&&r}function Wne(e){e.duration=0,e.type="keyframes"}const vln=new Set(["opacity","clipPath","filter","transform"]),wln=aA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Cln(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:a,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return wln()&&n&&vln.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const Sln=40;class Nln extends eue{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...f}){var v;super(),this.stop=()=>{var w,C;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=Jd.now();const x={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:d,...f},g=(d==null?void 0:d.KeyframeResolver)||nue;this.keyframeResolver=new g(l,(w,C,N)=>this.onKeyframesResolved(w,C,x,!N),c,u,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Jd.now(),yln(t,a,o,l)||((Fc.instantAnimations||!c)&&(d==null||d(Jce(t,r,n))),t[0]=t[t.length-1],Wne(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Sln?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!u&&Cln(x)?new gln({...x,element:x.motionValue.owner.current}):new tue(x);g.finished.then(()=>this.notifyFinished()).catch(al),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),aln()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Aln=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function jln(e){const t=Aln.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function xze(e,t,n=1){const[r,s]=jln(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return MD(o)?parseFloat(o):o}return Kce(s)?xze(s,t,n+1):s}function rue(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const gze=new Set(["width","height","top","left","right","bottom",...i8]),Eln={test:e=>e==="auto",parse:e=>e},bze=e=>t=>t.test(e),yze=[s8,ai,V0,jb,bon,gon,Eln],WCe=e=>yze.find(bze(e));function _ln(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||LD(e):!0}const kln=new Set(["brightness","contrast","saturate","opacity"]);function Tln(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Yce)||[];if(!r)return e;const s=n.replace(r,"");let a=kln.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const Iln=/\b([a-z-]*)\(.*?\)/gu,qne={...Qy,getAnimatableNone:e=>{const t=e.match(Iln);return t?t.map(Tln).join(" "):e}},qCe={...s8,transform:Math.round},Pln={rotate:jb,rotateX:jb,rotateY:jb,rotateZ:jb,scale:zP,scaleX:zP,scaleY:zP,scaleZ:zP,skew:jb,skewX:jb,skewY:jb,distance:ai,translateX:ai,translateY:ai,translateZ:ai,x:ai,y:ai,z:ai,perspective:ai,transformPerspective:ai,opacity:D_,originX:PCe,originY:PCe,originZ:ai},sue={borderWidth:ai,borderTopWidth:ai,borderRightWidth:ai,borderBottomWidth:ai,borderLeftWidth:ai,borderRadius:ai,radius:ai,borderTopLeftRadius:ai,borderTopRightRadius:ai,borderBottomRightRadius:ai,borderBottomLeftRadius:ai,width:ai,maxWidth:ai,height:ai,maxHeight:ai,top:ai,right:ai,bottom:ai,left:ai,padding:ai,paddingTop:ai,paddingRight:ai,paddingBottom:ai,paddingLeft:ai,margin:ai,marginTop:ai,marginRight:ai,marginBottom:ai,marginLeft:ai,backgroundPositionX:ai,backgroundPositionY:ai,...Pln,zIndex:qCe,fillOpacity:D_,strokeOpacity:D_,numOctaves:qCe},Fln={...sue,color:Dl,backgroundColor:Dl,outlineColor:Dl,fill:Dl,stroke:Dl,borderColor:Dl,borderTopColor:Dl,borderRightColor:Dl,borderBottomColor:Dl,borderLeftColor:Dl,filter:qne,WebkitFilter:qne},vze=e=>Fln[e];function wze(e,t){let n=vze(e);return n!==qne&&(n=Qy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Oln=new Set(["auto","none","0"]);function Mln(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!Oln.has(a)&&B_(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=wze(n,s)}class Rln extends nue{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Kce(u))){const d=xze(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!gze.has(r)||t.length!==2)return;const[s,a]=t,o=WCe(s),l=WCe(a);if(o!==l)if(UCe(o)&&UCe(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else l3[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||_ln(t[s]))&&r.push(s);r.length&&Mln(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=l3[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=l3[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Lln(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const Cze=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Sze(e){return RD(e)&&"offsetHeight"in e}const GCe=30,Dln=e=>!isNaN(parseFloat(e));class Bln{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const s=Jd.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Jd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Dln(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new oA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Fo.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Jd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>GCe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,GCe);return DD(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function qN(e,t){return new Bln(e,t)}const{schedule:iue,cancel:xvn}=ZUe(queueMicrotask,!1),Mp={x:!1,y:!1};function Nze(){return Mp.x||Mp.y}function $ln(e){return e==="x"||e==="y"?Mp[e]?null:(Mp[e]=!0,()=>{Mp[e]=!1}):Mp.x||Mp.y?null:(Mp.x=Mp.y=!0,()=>{Mp.x=Mp.y=!1})}function Aze(e,t){const n=Lln(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function KCe(e){return!(e.pointerType==="touch"||Nze())}function Uln(e,t,n={}){const[r,s,a]=Aze(e,n),o=l=>{if(!KCe(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{KCe(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const jze=(e,t)=>t?e===t?!0:jze(e,t.parentElement):!1,aue=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,zln=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Hln(e){return zln.has(e.tagName)||e.tabIndex!==-1}const CO=new WeakSet;function YCe(e){return t=>{t.key==="Enter"&&e(t)}}function iX(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Vln=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=YCe(()=>{if(CO.has(n))return;iX(n,"down");const s=YCe(()=>{iX(n,"up")}),a=()=>iX(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function XCe(e){return aue(e)&&!Nze()}function Wln(e,t,n={}){const[r,s,a]=Aze(e,n),o=l=>{const c=l.currentTarget;if(!XCe(l))return;CO.add(c);const u=t(c,l),d=(g,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",x),CO.has(c)&&CO.delete(c),XCe(g)&&typeof u=="function"&&u(g,{success:v})},f=g=>{d(g,c===window||c===document||n.useGlobalTarget||jze(c,g.target))},x=g=>{d(g,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",x,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),Sze(l)&&(l.addEventListener("focus",u=>Vln(u,s)),!Hln(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function Eze(e){return RD(e)&&"ownerSVGElement"in e}function qln(e){return Eze(e)&&e.tagName==="svg"}const Ou=e=>!!(e&&e.getVelocity),Gln=[...yze,Dl,Qy],Kln=e=>Gln.find(bze(e)),oue=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function QCe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yln(...e){return t=>{let n=!1;const r=e.map(s=>{const a=QCe(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():QCe(e[s],null)}}}}function Xln(...e){return m.useCallback(Yln(...e),e)}class Qln extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=Sze(r)&&r.offsetWidth||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Zln({children:e,isPresent:t,anchorX:n,root:r}){const s=m.useId(),a=m.useRef(null),o=m.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=m.useContext(oue),c=Xln(a,e==null?void 0:e.ref);return m.useInsertionEffect(()=>{const{width:u,height:d,top:f,left:x,right:g}=o.current;if(t||!a.current||!u||!d)return;const v=n==="left"?`left: ${x}`:`right: ${g}`;a.current.dataset.motionPopId=s;const w=document.createElement("style");l&&(w.nonce=l);const C=r??document.head;return C.appendChild(w),w.sheet&&w.sheet.insertRule(`
[data-motion-pop-id="${s}"] {
position: absolute !important;
width: ${u}px !important;
height: ${d}px !important;
${v}px !important;
top: ${f}px !important;
}
`),()=>{C.contains(w)&&C.removeChild(w)}},[t]),i.jsx(Qln,{isPresent:t,childRef:a,sizeRef:o,children:m.cloneElement(e,{ref:c})})}const Jln=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:o,anchorX:l,root:c})=>{const u=Wce(ecn),d=m.useId();let f=!0,x=m.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:g=>{u.set(g,!0);for(const v of u.values())if(!v)return;r&&r()},register:g=>(u.set(g,!1),()=>u.delete(g))}),[n,u,r]);return a&&f&&(x={...x}),m.useMemo(()=>{u.forEach((g,v)=>u.set(v,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),o==="popLayout"&&(e=i.jsx(Zln,{isPresent:n,anchorX:l,root:c,children:e})),i.jsx(fU.Provider,{value:x,children:e})};function ecn(){return new Map}function _ze(e=!0){const t=m.useContext(fU);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=m.useId();m.useEffect(()=>{if(e)return s(a)},[e]);const o=m.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const HP=e=>e.key||"";function ZCe(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const mT=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:a="sync",propagate:o=!1,anchorX:l="left",root:c})=>{const[u,d]=_ze(o),f=m.useMemo(()=>ZCe(e),[e]),x=o&&!u?[]:f.map(HP),g=m.useRef(!0),v=m.useRef(f),w=Wce(()=>new Map),[C,N]=m.useState(f),[I,P]=m.useState(f);QUe(()=>{g.current=!1,v.current=f;for(let U=0;U<I.length;U++){const L=HP(I[U]);x.includes(L)?w.delete(L):w.get(L)!==!0&&w.set(L,!1)}},[I,x.length,x.join("-")]);const R=[];if(f!==C){let U=[...f];for(let L=0;L<I.length;L++){const z=I[L],Q=HP(z);x.includes(Q)||(U.splice(L,0,z),R.push(z))}return a==="wait"&&R.length&&(U=R),P(ZCe(U)),N(f),null}const{forceRender:F}=m.useContext(Vce);return i.jsx(i.Fragment,{children:I.map(U=>{const L=HP(U),z=o&&!u?!1:f===I||x.includes(L),Q=()=>{if(w.has(L))w.set(L,!0);else return;let ne=!0;w.forEach(J=>{J||(ne=!1)}),ne&&(F==null||F(),P(v.current),o&&(d==null||d()),r&&r())};return i.jsx(Jln,{isPresent:z,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:a,root:c,onExitComplete:z?void 0:Q,anchorX:l,children:U},L)})})},kze=m.createContext({strict:!1}),JCe={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},GN={};for(const e in JCe)GN[e]={isEnabled:t=>JCe[e].some(n=>!!t[n])};function tcn(e){for(const t in e)GN[t]={...GN[t],...e[t]}}const ncn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function YL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ncn.has(e)}let Tze=e=>!YL(e);function rcn(e){typeof e=="function"&&(Tze=t=>t.startsWith("on")?!YL(t):e(t))}try{rcn(require("@emotion/is-prop-valid").default)}catch{}function scn(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Tze(s)||n===!0&&YL(s)||!t&&!YL(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const hU=m.createContext({});function pU(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function $_(e){return typeof e=="string"||Array.isArray(e)}const lue=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cue=["initial",...lue];function mU(e){return pU(e.animate)||cue.some(t=>$_(e[t]))}function Ize(e){return!!(mU(e)||e.variants)}function icn(e,t){if(mU(e)){const{initial:n,animate:r}=e;return{initial:n===!1||$_(n)?n:void 0,animate:$_(r)?r:void 0}}return e.inherit!==!1?t:{}}function acn(e){const{initial:t,animate:n}=icn(e,m.useContext(hU));return m.useMemo(()=>({initial:t,animate:n}),[e4e(t),e4e(n)])}function e4e(e){return Array.isArray(e)?e.join(" "):e}const U_={};function ocn(e){for(const t in e)U_[t]=e[t],Gce(t)&&(U_[t].isCSSVariable=!0)}function Pze(e,{layout:t,layoutId:n}){return a8.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!U_[e]||e==="opacity")}const lcn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ccn=i8.length;function ucn(e,t,n){let r="",s=!0;for(let a=0;a<ccn;a++){const o=i8[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Cze(l,sue[o]);if(!c){s=!1;const d=lcn[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function uue(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(a8.has(c)){o=!0;continue}else if(Gce(c)){s[c]=u;continue}else{const d=Cze(u,sue[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=ucn(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}const due=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Fze(e,t,n){for(const r in t)!Ou(t[r])&&!Pze(r,n)&&(e[r]=t[r])}function dcn({transformTemplate:e},t){return m.useMemo(()=>{const n=due();return uue(n,t,e),Object.assign({},n.vars,n.style)},[t])}function fcn(e,t){const n=e.style||{},r={};return Fze(r,n,e),Object.assign(r,dcn(e,t)),r}function hcn(e,t){const n={},r=fcn(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const pcn={offset:"stroke-dashoffset",array:"stroke-dasharray"},mcn={offset:"strokeDashoffset",array:"strokeDasharray"};function xcn(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?pcn:mcn;e[a.offset]=ai.transform(-r);const o=ai.transform(t),l=ai.transform(n);e[a.array]=`${o} ${l}`}function Oze(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(uue(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:x}=e;f.transform&&(x.transform=f.transform,delete f.transform),(x.transform||f.transformOrigin)&&(x.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),x.transform&&(x.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&xcn(f,s,a,o,!1)}const Mze=()=>({...due(),attrs:{}}),Rze=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gcn(e,t,n,r){const s=m.useMemo(()=>{const a=Mze();return Oze(a,t,Rze(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Fze(a,e.style,e),s.style={...a,...s.style}}return s}const bcn=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function fue(e){return typeof e!="string"||e.includes("-")?!1:!!(bcn.indexOf(e)>-1||/[A-Z]/u.test(e))}function ycn(e,t,n,{latestValues:r},s,a=!1){const l=(fue(e)?gcn:hcn)(t,r,s,e),c=scn(t,typeof e=="string",a),u=e!==m.Fragment?{...c,...l,ref:n}:{},{children:d}=t,f=m.useMemo(()=>Ou(d)?d.get():d,[d]);return m.createElement(e,{...u,children:f})}function t4e(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function hue(e,t,n,r){if(typeof t=="function"){const[s,a]=t4e(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=t4e(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function SO(e){return Ou(e)?e.get():e}function vcn({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:wcn(n,r,s,e),renderState:t()}}function wcn(e,t,n,r){const s={},a=r(e,{});for(const x in a)s[x]=SO(a[x]);let{initial:o,animate:l}=e;const c=mU(e),u=Ize(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!pU(f)){const x=Array.isArray(f)?f:[f];for(let g=0;g<x.length;g++){const v=hue(e,x[g]);if(v){const{transitionEnd:w,transition:C,...N}=v;for(const I in N){let P=N[I];if(Array.isArray(P)){const R=d?P.length-1:0;P=P[R]}P!==null&&(s[I]=P)}for(const I in w)s[I]=w[I]}}}return s}const Lze=e=>(t,n)=>{const r=m.useContext(hU),s=m.useContext(fU),a=()=>vcn(e,t,r,s);return n?a():Wce(a)};function pue(e,t,n){var a;const{style:r}=e,s={};for(const o in r)(Ou(r[o])||t.style&&Ou(t.style[o])||Pze(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}const Ccn=Lze({scrapeMotionValuesFromProps:pue,createRenderState:due});function Dze(e,t,n){const r=pue(e,t,n);for(const s in e)if(Ou(e[s])||Ou(t[s])){const a=i8.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}const Scn=Lze({scrapeMotionValuesFromProps:Dze,createRenderState:Mze}),Ncn=Symbol.for("motionComponentSymbol");function zC(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Acn(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):zC(n)&&(n.current=r))},[t])}const mue=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),jcn="framerAppearId",Bze="data-"+mue(jcn),$ze=m.createContext({});function Ecn(e,t,n,r,s){var w,C;const{visualElement:a}=m.useContext(hU),o=m.useContext(kze),l=m.useContext(fU),c=m.useContext(oue).reducedMotion,u=m.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=m.useContext($ze);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&_cn(u.current,n,s,f);const x=m.useRef(!1);m.useInsertionEffect(()=>{d&&x.current&&d.update(n,l)});const g=n[Bze],v=m.useRef(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return QUe(()=>{d&&(x.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),v.current&&d.animationState&&d.animationState.animateChanges())}),m.useEffect(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var N;(N=window.MotionHandoffMarkAsComplete)==null||N.call(window,g)}),v.current=!1),d.enteringChildren=void 0)}),d}function _cn(e,t,n,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Uze(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&zC(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function Uze(e){if(e)return e.options.allowProjection!==!1?e.projection:Uze(e.parent)}function aX(e,{forwardMotionProps:t=!1}={},n,r){n&&tcn(n);const s=fue(e)?Scn:Ccn;function a(l,c){let u;const d={...m.useContext(oue),...l,layoutId:kcn(l)},{isStatic:f}=d,x=acn(l),g=s(l,f);if(!f&&qce){Tcn();const v=Icn(d);u=v.MeasureLayout,x.visualElement=Ecn(e,g,d,r,v.ProjectionNode)}return i.jsxs(hU.Provider,{value:x,children:[u&&x.visualElement?i.jsx(u,{visualElement:x.visualElement,...d}):null,ycn(e,l,Acn(g,x.visualElement,c),g,f,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=m.forwardRef(a);return o[Ncn]=e,o}function kcn({layoutId:e}){const t=m.useContext(Vce).id;return t&&e!==void 0?t+"-"+e:e}function Tcn(e,t){m.useContext(kze).strict}function Icn(e){const{drag:t,layout:n}=GN;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Pcn(e,t){if(typeof Proxy>"u")return aX;const n=new Map,r=(a,o)=>aX(a,o,e,t),s=(a,o)=>r(a,o);return new Proxy(s,{get:(a,o)=>o==="create"?r:(n.has(o)||n.set(o,aX(o,void 0,e,t)),n.get(o))})}function zze({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Fcn({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ocn(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function oX(e){return e===void 0||e===1}function Gne({scale:e,scaleX:t,scaleY:n}){return!oX(e)||!oX(t)||!oX(n)}function Tv(e){return Gne(e)||Hze(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Hze(e){return n4e(e.x)||n4e(e.y)}function n4e(e){return e&&e!=="0%"}function XL(e,t,n){const r=e-n,s=t*r;return n+s}function r4e(e,t,n,r,s){return s!==void 0&&(e=XL(e,s,r)),XL(e,n,r)+t}function Kne(e,t=0,n=1,r,s){e.min=r4e(e.min,t,n,r,s),e.max=r4e(e.max,t,n,r,s)}function Vze(e,{x:t,y:n}){Kne(e.x,t.translate,t.scale,t.originPoint),Kne(e.y,n.translate,n.scale,n.originPoint)}const s4e=.999999999999,i4e=1.0000000000001;function Mcn(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,o;for(let l=0;l<s;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&VC(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Vze(e,o)),r&&Tv(a.latestValues)&&VC(e,a.latestValues))}t.x<i4e&&t.x>s4e&&(t.x=1),t.y<i4e&&t.y>s4e&&(t.y=1)}function HC(e,t){e.min=e.min+t,e.max=e.max+t}function a4e(e,t,n,r,s=.5){const a=Uo(e.min,e.max,s);Kne(e,t,n,a,r)}function VC(e,t){a4e(e.x,t.x,t.scaleX,t.scale,t.originX),a4e(e.y,t.y,t.scaleY,t.scale,t.originY)}function Wze(e,t){return zze(Ocn(e.getBoundingClientRect(),t))}function Rcn(e,t,n){const r=Wze(e,n),{scroll:s}=t;return s&&(HC(r.x,s.offset.x),HC(r.y,s.offset.y)),r}const o4e=()=>({translate:0,scale:1,origin:0,originPoint:0}),WC=()=>({x:o4e(),y:o4e()}),l4e=()=>({min:0,max:0}),ml=()=>({x:l4e(),y:l4e()}),Yne={current:null},qze={current:!1};function Lcn(){if(qze.current=!0,!!qce)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Yne.current=e.matches;e.addEventListener("change",t),t()}else Yne.current=!1}const Dcn=new WeakMap;function Bcn(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Ou(s))e.addValue(r,s);else if(Ou(a))e.addValue(r,qN(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,qN(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const c4e=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class $cn{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=nue,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=Jd.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,Fo.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=mU(n),this.isVariantNode=Ize(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const x in f){const g=f[x];c[x]!==void 0&&Ou(g)&&g.set(c[x])}}mount(t){var n;this.current=t,Dcn.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),qze.current||Lcn(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Yne.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Xy(this.notifyUpdate),Xy(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=a8.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Fo.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in GN){const n=GN[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ml()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<c4e.length;r++){const s=c4e[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Bcn(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=qN(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(MD(r)||LD(r))?r=parseFloat(r):!Kln(r)&&Qy.test(n)&&(r=wze(t,n)),this.setBaseTarget(t,Ou(r)?r.get():r)),Ou(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=hue(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ou(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new oA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){iue.render(this.render)}}class Gze extends $cn{constructor(){super(...arguments),this.KeyframeResolver=Rln}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ou(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Kze(e,{style:t,vars:n},r,s){const a=e.style;let o;for(o in t)a[o]=t[o];s==null||s.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function Ucn(e){return window.getComputedStyle(e)}class zcn extends Gze{constructor(){super(...arguments),this.type="html",this.renderInstance=Kze}readValueFromInstance(t,n){var r;if(a8.has(n))return(r=this.projection)!=null&&r.isProjecting?$ne(n):tln(t,n);{const s=Ucn(t),a=(Gce(n)?s.getPropertyValue(n):s[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Wze(t,n)}build(t,n,r){uue(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return pue(t,n,r)}}const Yze=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Hcn(e,t,n,r){Kze(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Yze.has(s)?s:mue(s),t.attrs[s])}class Vcn extends Gze{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ml}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(a8.has(n)){const r=vze(n);return r&&r.default||0}return n=Yze.has(n)?n:mue(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Dze(t,n,r)}build(t,n,r){Oze(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Hcn(t,n,r,s)}mount(t){this.isSVGTag=Rze(t.tagName),super.mount(t)}}const Wcn=(e,t)=>fue(e)?new Vcn(t):new zcn(t,{allowProjection:e!==m.Fragment});function g4(e,t,n){const r=e.getProps();return hue(r,t,n!==void 0?n:r.custom,e)}const Xne=e=>Array.isArray(e);function qcn(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,qN(n))}function Gcn(e){return Xne(e)?e[e.length-1]||0:e}function Kcn(e,t){const n=g4(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=Gcn(a[o]);qcn(e,o,l)}}function Ycn(e){return!!(Ou(e)&&e.add)}function Qne(e,t){const n=e.getValue("willChange");if(Ycn(n))return n.add(t);if(!n&&Fc.WillChange){const r=new Fc.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Xze(e){return e.props[Bze]}const Xcn=e=>e!==null;function Qcn(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Xcn),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[a]}const Zcn={type:"spring",stiffness:500,damping:25,restSpeed:10},Jcn=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eun={type:"keyframes",duration:.8},tun={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nun=(e,{keyframes:t})=>t.length>2?eun:a8.has(e)?e.startsWith("scale")?Jcn(t[1]):Zcn:tun;function run({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const xue=(e,t,n,r={},s,a)=>o=>{const l=rue(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Hl(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:x=>{t.set(x),l.onUpdate&&l.onUpdate(x)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};run(l)||Object.assign(d,nun(e,d)),d.duration&&(d.duration=Hl(d.duration)),d.repeatDelay&&(d.repeatDelay=Hl(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Wne(d),d.delay===0&&(f=!0)),(Fc.instantAnimations||Fc.skipAnimations)&&(f=!0,Wne(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!a&&t.get()!==void 0){const x=Qcn(d.keyframes,l);if(x!==void 0){Fo.update(()=>{d.onUpdate(x),d.onComplete()});return}}return l.isSync?new tue(d):new Nln(d)};function sun({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Qze(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),x=l[d];if(x===void 0||u&&sun(u,d))continue;const g={delay:n,...rue(a||{},d)},v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(x)&&x===v&&!g.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const N=Xze(e);if(N){const I=window.MotionHandoffAnimation(N,d,Fo);I!==null&&(g.startTime=I,w=!0)}}Qne(e,d),f.start(xue(d,f,x,e.shouldReduceMotion&&gze.has(d)?{type:!1}:g,e,w));const C=f.animation;C&&c.push(C)}return o&&Promise.all(c).then(()=>{Fo.update(()=>{o&&Kcn(e,o)})}),c}function Zze(e,t,n,r=0,s=1){const a=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(a,o):s===1?a*r:l-a*r}function Zne(e,t,n={}){var c;const r=g4(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(Qze(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:x}=s;return iun(e,t,u,d,f,x,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function iun(e,t,n=0,r=0,s=0,a=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(Zne(c,t,{...o,delay:n+(typeof r=="function"?0:r)+Zze(e.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function aun(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>Zne(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=Zne(e,t,n);else{const s=typeof t=="function"?g4(e,t,n.custom):t;r=Promise.all(Qze(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Jze(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const oun=cue.length;function eHe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?eHe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<oun;n++){const r=cue[n],s=e.props[r];($_(s)||s===!1)&&(t[r]=s)}return t}const lun=[...lue].reverse(),cun=lue.length;function uun(e){return t=>Promise.all(t.map(({animation:n,options:r})=>aun(e,n,r)))}function dun(e){let t=uun(e),n=u4e(),r=!0;const s=c=>(u,d)=>{var x;const f=g4(e,d,c==="exit"?(x=e.presenceContext)==null?void 0:x.custom:void 0);if(f){const{transition:g,transitionEnd:v,...w}=f;u={...u,...w,...v}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=eHe(e.parent)||{},f=[],x=new Set;let g={},v=1/0;for(let C=0;C<cun;C++){const N=lun[C],I=n[N],P=u[N]!==void 0?u[N]:d[N],R=$_(P),F=N===c?I.isActive:null;F===!1&&(v=C);let U=P===d[N]&&P!==u[N]&&R;if(U&&r&&e.manuallyAnimateOnMount&&(U=!1),I.protectedKeys={...g},!I.isActive&&F===null||!P&&!I.prevProp||pU(P)||typeof P=="boolean")continue;const L=fun(I.prevProp,P);let z=L||N===c&&I.isActive&&!U&&R||C>v&&R,Q=!1;const ne=Array.isArray(P)?P:[P];let J=ne.reduce(s(N),{});F===!1&&(J={});const{prevResolvedValues:X={}}=I,re={...X,...J},pe=oe=>{z=!0,x.has(oe)&&(Q=!0,x.delete(oe)),I.needsAnimating[oe]=!0;const G=e.getValue(oe);G&&(G.liveStyle=!1)};for(const oe in re){const G=J[oe],V=X[oe];if(g.hasOwnProperty(oe))continue;let te=!1;Xne(G)&&Xne(V)?te=!Jze(G,V):te=G!==V,te?G!=null?pe(oe):x.add(oe):G!==void 0&&x.has(oe)?pe(oe):I.protectedKeys[oe]=!0}I.prevProp=P,I.prevResolvedValues=J,I.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(z=!1);const Y=U&&L;z&&(!Y||Q)&&f.push(...ne.map(oe=>{const G={type:N};if(typeof oe=="string"&&r&&!Y&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,te=g4(V,oe);if(V.enteringChildren&&te){const{delayChildren:ae}=te.transition||{};G.delay=Zze(V.enteringChildren,e,ae)}}return{animation:oe,options:G}}))}if(x.size){const C={};if(typeof u.initial!="boolean"){const N=g4(e,Array.isArray(u.initial)?u.initial[0]:u.initial);N&&N.transition&&(C.transition=N.transition)}x.forEach(N=>{const I=e.getBaseTarget(N),P=e.getValue(N);P&&(P.liveStyle=!0),C[N]=I??null}),f.push({animation:C})}let w=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(x=>{var g;return(g=x.animationState)==null?void 0:g.setActive(c,u)}),n[c].isActive=u;const d=o(c);for(const x in n)n[x].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=u4e()}}}function fun(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Jze(t,e):!1}function hv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function u4e(){return{animate:hv(!0),whileInView:hv(),whileHover:hv(),whileTap:hv(),whileDrag:hv(),whileFocus:hv(),exit:hv()}}class y2{constructor(t){this.isMounted=!1,this.node=t}update(){}}class hun extends y2{constructor(t){super(t),t.animationState||(t.animationState=dun(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();pU(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let pun=0;class mun extends y2{constructor(){super(...arguments),this.id=pun++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const xun={animation:{Feature:hun},exit:{Feature:mun}};function z_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function xT(e){return{point:{x:e.pageX,y:e.pageY}}}const gun=e=>t=>aue(t)&&e(t,xT(t));function f9(e,t,n,r){return z_(e,t,gun(n),r)}const tHe=1e-4,bun=1-tHe,yun=1+tHe,nHe=.01,vun=0-nHe,wun=0+nHe;function cd(e){return e.max-e.min}function Cun(e,t,n){return Math.abs(e-t)<=n}function d4e(e,t,n,r=.5){e.origin=r,e.originPoint=Uo(t.min,t.max,e.origin),e.scale=cd(n)/cd(t),e.translate=Uo(n.min,n.max,e.origin)-e.originPoint,(e.scale>=bun&&e.scale<=yun||isNaN(e.scale))&&(e.scale=1),(e.translate>=vun&&e.translate<=wun||isNaN(e.translate))&&(e.translate=0)}function h9(e,t,n,r){d4e(e.x,t.x,n.x,r?r.originX:void 0),d4e(e.y,t.y,n.y,r?r.originY:void 0)}function f4e(e,t,n){e.min=n.min+t.min,e.max=e.min+cd(t)}function Sun(e,t,n){f4e(e.x,t.x,n.x),f4e(e.y,t.y,n.y)}function h4e(e,t,n){e.min=t.min-n.min,e.max=e.min+cd(t)}function p9(e,t,n){h4e(e.x,t.x,n.x),h4e(e.y,t.y,n.y)}function Th(e){return[e("x"),e("y")]}const rHe=({current:e})=>e?e.ownerDocument.defaultView:null,p4e=(e,t)=>Math.abs(e-t);function Nun(e,t){const n=p4e(e.x,t.x),r=p4e(e.y,t.y);return Math.sqrt(n**2+r**2)}class sHe{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=cX(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=Nun(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!v)return;const{point:w}=x,{timestamp:C}=Kc;this.history.push({...w,timestamp:C});const{onStart:N,onMove:I}=this.handlers;g||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),I&&I(this.lastMoveEvent,x)},this.handlePointerMove=(x,g)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=lX(g,this.transformPagePoint),Fo.update(this.updatePoint,!0)},this.handlePointerUp=(x,g)=>{this.end();const{onEnd:v,onSessionEnd:w,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=cX(x.type==="pointercancel"?this.lastMoveEventInfo:lX(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(x,N),w&&w(x,N)},!aue(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=xT(t),c=lX(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Kc;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,cX(c,this.history)),this.removeListeners=ux(f9(this.contextWindow,"pointermove",this.handlePointerMove),f9(this.contextWindow,"pointerup",this.handlePointerUp),f9(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Xy(this.updatePoint)}}function lX(e,t){return t?{point:t(e.point)}:e}function m4e(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cX({point:e},t){return{point:e,delta:m4e(e,iHe(t)),offset:m4e(e,Aun(t)),velocity:jun(t,.1)}}function Aun(e){return e[0]}function iHe(e){return e[e.length-1]}function jun(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=iHe(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Hl(t)));)n--;if(!r)return{x:0,y:0};const a=nl(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Eun(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Uo(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Uo(n,e,r.max):Math.min(e,n)),e}function x4e(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function _un(e,{top:t,left:n,bottom:r,right:s}){return{x:x4e(e.x,n,s),y:x4e(e.y,t,r)}}function g4e(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function kun(e,t){return{x:g4e(e.x,t.x),y:g4e(e.y,t.y)}}function Tun(e,t){let n=.5;const r=cd(e),s=cd(t);return s>r?n=K0(t.min,t.max-r,e.min):r>s&&(n=K0(e.min,e.max-s,t.min)),Pc(0,1,n)}function Iun(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Jne=.35;function Pun(e=Jne){return e===!1?e=0:e===!0&&(e=Jne),{x:b4e(e,"left","right"),y:b4e(e,"top","bottom")}}function b4e(e,t,n){return{min:y4e(e,t),max:y4e(e,n)}}function y4e(e,t){return typeof e=="number"?e:e[t]||0}const Fun=new WeakMap;class Oun{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ml(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=f=>{const{dragSnapToOrigin:x}=this.getProps();x?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(xT(f).point)},o=(f,x)=>{const{drag:g,dragPropagation:v,onDragStart:w}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$ln(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Th(N=>{let I=this.getAxisMotionValue(N).get()||0;if(V0.test(I)){const{projection:P}=this.visualElement;if(P&&P.layout){const R=P.layout.layoutBox[N];R&&(I=cd(R)*(parseFloat(I)/100))}}this.originPoint[N]=I}),w&&Fo.postRender(()=>w(f,x)),Qne(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},l=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x;const{dragPropagation:g,dragDirectionLock:v,onDirectionLock:w,onDrag:C}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:N}=x;if(v&&this.currentDirection===null){this.currentDirection=Mun(N),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",x.point,N),this.updateAxis("y",x.point,N),this.visualElement.render(),C&&C(f,x)},c=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x,this.stop(f,x),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Th(f=>{var x;return this.getAnimationState(f)==="paused"&&((x=this.getAxisMotionValue(f).animation)==null?void 0:x.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new sHe(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:rHe(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Fo.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!VP(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Eun(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;t&&zC(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=_un(r.layoutBox,t):this.constraints=!1,this.elastic=Pun(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Th(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Iun(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!zC(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=Rcn(r,s.root,this.visualElement.getTransformPagePoint());let o=kun(s.layout.layoutBox,a);if(n){const l=n(Fcn(o));this.hasMutatedConstraints=!!l,l&&(o=zze(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Th(d=>{if(!VP(d,n,this.currentDirection))return;let f=c[d]||{};o&&(f={min:0,max:0});const x=s?200:1e6,g=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:x,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Qne(this.visualElement,t),r.start(xue(t,r,0,n,this.visualElement,!1))}stopAnimation(){Th(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Th(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Th(n=>{const{drag:r}=this.getProps();if(!VP(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];a.set(t[n]-Uo(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!zC(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Th(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=Tun({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Th(o=>{if(!VP(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Uo(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Fun.set(this.visualElement,this);const t=this.visualElement.current,n=f9(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();zC(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Fo.read(r);const o=z_(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Th(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=Jne,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function VP(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Mun(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Run extends y2{constructor(t){super(t),this.removeGroupControls=al,this.removeListeners=al,this.controls=new Oun(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||al}unmount(){this.removeGroupControls(),this.removeListeners()}}const v4e=e=>(t,n)=>{e&&Fo.postRender(()=>e(t,n))};class Lun extends y2{constructor(){super(...arguments),this.removePointerDownListener=al}onPointerDown(t){this.session=new sHe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rHe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:v4e(t),onStart:v4e(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&Fo.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=f9(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const NO={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function w4e(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Y7={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ai.test(e))e=parseFloat(e);else return e;const n=w4e(e,t.target.x),r=w4e(e,t.target.y);return`${n}% ${r}%`}},Dun={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Qy.parse(e);if(s.length>5)return r;const a=Qy.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=Uo(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}};let uX=!1;class Bun extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;ocn($un),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),uX&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),NO.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,uX=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Fo.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),iue.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;uX=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function aHe(e){const[t,n]=_ze(),r=m.useContext(Vce);return i.jsx(Bun,{...e,layoutGroup:r,switchLayoutGroup:m.useContext($ze),isPresent:t,safeToRemove:n})}const $un={borderRadius:{...Y7,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Y7,borderTopRightRadius:Y7,borderBottomLeftRadius:Y7,borderBottomRightRadius:Y7,boxShadow:Dun};function Uun(e,t,n){const r=Ou(e)?e:qN(e);return r.start(xue("",r,t,n)),r.animation}const zun=(e,t)=>e.depth-t.depth;class Hun{constructor(){this.children=[],this.isDirty=!1}add(t){bk(this.children,t),this.isDirty=!0}remove(t){yk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(zun),this.isDirty=!1,this.children.forEach(t)}}function Vun(e,t){const n=Jd.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(Xy(r),e(a-t))};return Fo.setup(r,!0),()=>Xy(r)}const oHe=["TopLeft","TopRight","BottomLeft","BottomRight"],Wun=oHe.length,C4e=e=>typeof e=="string"?parseFloat(e):e,S4e=e=>typeof e=="number"||ai.test(e);function qun(e,t,n,r,s,a){s?(e.opacity=Uo(0,n.opacity??1,Gun(r)),e.opacityExit=Uo(t.opacity??1,0,Kun(r))):a&&(e.opacity=Uo(t.opacity??1,n.opacity??1,r));for(let o=0;o<Wun;o++){const l=`border${oHe[o]}Radius`;let c=N4e(t,l),u=N4e(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||S4e(c)===S4e(u)?(e[l]=Math.max(Uo(C4e(c),C4e(u),r),0),(V0.test(u)||V0.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Uo(t.rotate||0,n.rotate||0,r))}function N4e(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Gun=lHe(0,.5,use),Kun=lHe(.5,.95,al);function lHe(e,t,n){return r=>r<e?0:r>t?1:n(K0(e,t,r))}function A4e(e,t){e.min=t.min,e.max=t.max}function Ah(e,t){A4e(e.x,t.x),A4e(e.y,t.y)}function j4e(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function E4e(e,t,n,r,s){return e-=t,e=XL(e,1/n,r),s!==void 0&&(e=XL(e,1/s,r)),e}function Yun(e,t=0,n=1,r=.5,s,a=e,o=e){if(V0.test(t)&&(t=parseFloat(t),t=Uo(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Uo(a.min,a.max,r);e===a&&(l-=t),e.min=E4e(e.min,t,n,l,s),e.max=E4e(e.max,t,n,l,s)}function _4e(e,t,[n,r,s],a,o){Yun(e,t[n],t[r],t[s],t.scale,a,o)}const Xun=["x","scaleX","originX"],Qun=["y","scaleY","originY"];function k4e(e,t,n,r){_4e(e.x,t,Xun,n?n.x:void 0,r?r.x:void 0),_4e(e.y,t,Qun,n?n.y:void 0,r?r.y:void 0)}function T4e(e){return e.translate===0&&e.scale===1}function cHe(e){return T4e(e.x)&&T4e(e.y)}function I4e(e,t){return e.min===t.min&&e.max===t.max}function Zun(e,t){return I4e(e.x,t.x)&&I4e(e.y,t.y)}function P4e(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uHe(e,t){return P4e(e.x,t.x)&&P4e(e.y,t.y)}function F4e(e){return cd(e.x)/cd(e.y)}function O4e(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Jun{constructor(){this.members=[]}add(t){bk(this.members,t),t.scheduleRender()}remove(t){if(yk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function edn(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:x,skewX:g,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),x&&(r+=`rotateY(${x}deg) `),g&&(r+=`skewX(${g}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const dX=["","X","Y","Z"],tdn=1e3;let ndn=0;function fX(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function dHe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xze(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Fo,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&dHe(r)}function fHe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=ndn++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(idn),this.nodes.forEach(cdn),this.nodes.forEach(udn),this.nodes.forEach(adn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Hun)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new oA),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Eze(o)&&!qln(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,f=0;const x=()=>this.root.updateBlockedByResize=!1;Fo.read(()=>{f=window.innerWidth}),e(o,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=Vun(x,250),NO.hasAnimatedSinceResize&&(NO.hasAnimatedSinceResize=!1,this.nodes.forEach(L4e)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:x,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||mdn,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=u.getProps(),N=!this.targetLayout||!uHe(this.targetLayout,g),I=!f&&x;if(this.options.layoutRoot||this.resumeFrom||I||f&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...rue(v,"layout"),onPlay:w,onComplete:C};(u.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(d,I)}else f||L4e(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Xy(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ddn),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dHe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(M4e);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(R4e);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ldn),this.nodes.forEach(rdn),this.nodes.forEach(sdn)):this.nodes.forEach(R4e),this.clearAllSnapshots();const l=Jd.now();Kc.delta=Pc(0,1e3/60,l-Kc.timestamp),Kc.timestamp=l,Kc.isProcessing=!0,tX.update.process(Kc),tX.preRender.process(Kc),tX.render.process(Kc),Kc.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,iue.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(odn),this.sharedNodes.forEach(fdn)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Fo.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Fo.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!cd(this.snapshot.measuredBox.x)&&!cd(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ml(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!cHe(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||Tv(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),xdn(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return ml();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(gdn))){const{scroll:d}=this.root;d&&(HC(l.x,d.offset.x),HC(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=ml();if(Ah(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:x}=d;d!==this.root&&f&&x.layoutScroll&&(f.wasRoot&&Ah(l,o),HC(l.x,f.offset.x),HC(l.y,f.offset.y))}return l}applyTransform(o,l=!1){const c=ml();Ah(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&VC(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Tv(d.latestValues)&&VC(c,d.latestValues)}return Tv(this.latestValues)&&VC(c,this.latestValues),c}removeTransform(o){const l=ml();Ah(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Tv(u.latestValues))continue;Gne(u.latestValues)&&u.updateSnapshot();const d=ml(),f=u.measurePageBox();Ah(d,f),k4e(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Tv(this.latestValues)&&k4e(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Kc.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var x;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Kc.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ml(),this.relativeTargetOrigin=ml(),p9(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),Ah(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ml(),this.targetWithTransforms=ml()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Sun(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ah(this.target,this.layout.layoutBox),Vze(this.target,this.targetDelta)):Ah(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ml(),this.relativeTargetOrigin=ml(),p9(this.relativeTargetOrigin,this.target,g.target),Ah(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Gne(this.parent.latestValues)||Hze(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var v;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Kc.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Ah(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,x=this.treeScale.y;Mcn(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=ml());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(j4e(this.prevProjectionDelta.x,this.projectionDelta.x),j4e(this.prevProjectionDelta.y,this.projectionDelta.y)),h9(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==x||!O4e(this.projectionDelta.x,this.prevProjectionDelta.x)||!O4e(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=WC(),this.projectionDelta=WC(),this.projectionDeltaWithTransform=WC()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=WC();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const x=ml(),g=c?c.source:void 0,v=this.layout?this.layout.source:void 0,w=g!==v,C=this.getStack(),N=!C||C.members.length<=1,I=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(pdn));this.animationProgress=0;let P;this.mixTargetDelta=R=>{const F=R/1e3;D4e(f.x,o.x,F),D4e(f.y,o.y,F),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(p9(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),hdn(this.relativeTarget,this.relativeTargetOrigin,x,F),P&&Zun(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=ml()),Ah(P,this.relativeTarget)),w&&(this.animationValues=d,qun(d,u,this.latestValues,F,I,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Xy(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Fo.update(()=>{NO.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=qN(0)),this.currentAnimation=Uun(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(tdn),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&hHe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ml();const f=cd(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const x=cd(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+x}Ah(l,c),VC(l,d),h9(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Jun),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&fX("z",o,u,this.animationValues);for(let d=0;d<dX.length;d++)fX(`rotate${dX[d]}`,o,u,this.animationValues),fX(`skew${dX[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=SO(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=SO(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Tv(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=edn(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),o.transform=f;const{x,y:g}=this.projectionDelta;o.transformOrigin=`${x.origin*100}% ${g.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in U_){if(d[v]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=U_[v],I=f==="none"?d[v]:w(d[v],u);if(C){const P=C.length;for(let R=0;R<P;R++)o[C[R]]=I}else N?this.options.visualElement.renderState.vars[v]=I:o[v]=I}this.options.layoutId&&(o.pointerEvents=u===this?SO(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(M4e),this.root.sharedNodes.clear()}}}function rdn(e){e.updateLayout()}function sdn(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?Th(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=cd(x);x.min=r[f].min,x.max=x.min+g}):hHe(a,t.layoutBox,r)&&Th(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=cd(r[f]);x.max=x.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const l=WC();h9(l,r,t.layoutBox);const c=WC();o?h9(c,e.applyTransform(s,!0),t.measuredBox):h9(c,r,t.layoutBox);const u=!cHe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:x,layout:g}=f;if(x&&g){const v=ml();p9(v,t.layoutBox,x.layoutBox);const w=ml();p9(w,r,g.layoutBox),uHe(v,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function idn(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function adn(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function odn(e){e.clearSnapshot()}function M4e(e){e.clearMeasurements()}function R4e(e){e.isLayoutDirty=!1}function ldn(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function L4e(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function cdn(e){e.resolveTargetDelta()}function udn(e){e.calcProjection()}function ddn(e){e.resetSkewAndRotation()}function fdn(e){e.removeLeadSnapshot()}function D4e(e,t,n){e.translate=Uo(t.translate,0,n),e.scale=Uo(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function B4e(e,t,n,r){e.min=Uo(t.min,n.min,r),e.max=Uo(t.max,n.max,r)}function hdn(e,t,n,r){B4e(e.x,t.x,n.x,r),B4e(e.y,t.y,n.y,r)}function pdn(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const mdn={duration:.45,ease:[.4,0,.1,1]},$4e=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),U4e=$4e("applewebkit/")&&!$4e("chrome/")?Math.round:al;function z4e(e){e.min=U4e(e.min),e.max=U4e(e.max)}function xdn(e){z4e(e.x),z4e(e.y)}function hHe(e,t,n){return e==="position"||e==="preserve-aspect"&&!Cun(F4e(t),F4e(n),.2)}function gdn(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const bdn=fHe({attachResizeListener:(e,t)=>z_(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hX={current:void 0},pHe=fHe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!hX.current){const e=new bdn({});e.mount(window),e.setOptions({layoutScroll:!0}),hX.current=e}return hX.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ydn={pan:{Feature:Lun},drag:{Feature:Run,ProjectionNode:pHe,MeasureLayout:aHe}};function H4e(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&Fo.postRender(()=>a(t,xT(t)))}class vdn extends y2{mount(){const{current:t}=this.node;t&&(this.unmount=Uln(t,(n,r)=>(H4e(this.node,r,"Start"),s=>H4e(this.node,s,"End"))))}unmount(){}}class wdn extends y2{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ux(z_(this.node.current,"focus",()=>this.onFocus()),z_(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function V4e(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&Fo.postRender(()=>a(t,xT(t)))}class Cdn extends y2{mount(){const{current:t}=this.node;t&&(this.unmount=Wln(t,(n,r)=>(V4e(this.node,r,"Start"),(s,{success:a})=>V4e(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ere=new WeakMap,pX=new WeakMap,Sdn=e=>{const t=ere.get(e.target);t&&t(e)},Ndn=e=>{e.forEach(Sdn)};function Adn({root:e,...t}){const n=e||document;pX.has(n)||pX.set(n,{});const r=pX.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Ndn,{root:e,...t})),r[s]}function jdn(e,t,n){const r=Adn(t);return ere.set(e,n),r.observe(e),()=>{ere.delete(e),r.unobserve(e)}}const Edn={some:0,all:1};class _dn extends y2{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Edn[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),x=u?d:f;x&&x(c)};return jdn(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(kdn(t,n))&&this.startObserver()}unmount(){}}function kdn({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Tdn={inView:{Feature:_dn},tap:{Feature:Cdn},focus:{Feature:wdn},hover:{Feature:vdn}},Idn={layout:{ProjectionNode:pHe,MeasureLayout:aHe}},Pdn={...xun,...Tdn,...ydn,...Idn},vo=Pcn(Pdn,Wcn);function gue({markets:e=[],value:t="",onChange:n=()=>{},loading:r=!1,iconsBaseUrl:s="https://app.hyperliquid.xyz/coins",mode:a="single",pairWhitelist:o=null,pairBase:l=[],showIcon:c=!0}){const[u,d]=m.useState(!1),[f,x]=m.useState(!1),[g,v]=m.useState(""),[w,C]=m.useState(0),[N,I]=m.useState(0),[P,R]=m.useState(320),[F,U]=m.useState("vol"),[L,z]=m.useState("desc"),[Q,ne]=m.useState("all"),[J,X]=m.useState(()=>{try{const ot=localStorage.getItem("favCoins");return ot?new Set(JSON.parse(ot)):new Set}catch{return new Set}}),re=m.useRef(null),pe=m.useRef(null),Y=150,ie={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},oe=ot=>{var ct;const ft=(ct=ot==null?void 0:ot.split("/")[0])==null?void 0:ct.replace("-USD","").replace("/USD","");return ie[ft]||ft},G=ot=>ot==null||isNaN(ot)?"--":Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:2}).format(Number(ot)),V=(ot,ft=6)=>ot==null||isNaN(ot)?"--":Number(ot).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:ft}),te=ot=>{const ft=new Set(J);ft.has(ot)?ft.delete(ot):ft.add(ot),X(ft),localStorage.setItem("favCoins",JSON.stringify([...ft]))},ae=ot=>{F===ot?z(ft=>ft==="asc"?"desc":"asc"):(U(ot),z("desc"))},he=m.useMemo(()=>((e==null?void 0:e.map(ft=>{const ct=ft.rawSymbol||ft.symbol||ft.coin||ft.ticker||"";let Vt=ft.symbol||ft.coin||ft.ticker||ct,It=ft.builder||ft.dex||"";if(ft.kind==="hip3"){const Ke=ct.indexOf(":");!It&&Ke>=0&&(It=ct.slice(0,Ke),Vt=ct.slice(Ke+1))}const an=ft.lastPrice??ft.last??ft.markPrice??null,Nt=ft.change24hPct??ft.chg24??null,mn=ft.volume??ft.vol??ft.dayNtlVlm??null,dn=ft.fundingRate??ft.funding??null,Pt=ft.openInterest??ft.oi??null,Xe=ft.openInterestUsd??ft.oiUsd??(Pt!=null&&an!=null?Number(Pt)*Number(an):null),Ut=ft.leverage!=null?ft.leverage:ft.lev!=null?ft.lev:null,Lt=ft.kind||(It?"hip3":"perp"),qe=ft.coin||Vt.replace(/-USDH$/,"").replace(/-USDC$/,"").replace(/-USD$/,"").replace(/\/USD$/,"");return{kind:Lt,builder:It,dex:ft.dex||"",symbol:Vt,rawSymbol:ct,last:an,chg24:Nt,vol:mn,funding:dn,openInterest:Xe,leverage:Ut!=null&&isFinite(Ut)?Math.floor(Ut):null,coinForChange:qe}}))??[]).filter(ft=>ft.symbol),[e]),Ce=m.useMemo(()=>{const ot=new Map;for(const ft of he){const ct=ft.symbol.replace("-USD","").replace("/USD","");ot.set(ct,ft)}return ot},[he]),ce=m.useMemo(()=>{if(a!=="pair")return[];const ot=he.filter(mn=>mn.kind!=="hip3"),ft=ot.map(mn=>mn.symbol.replace("-USD","").replace("/USD","")),ct=Array.from(new Set(ft)),Vt=Array.isArray(o)?new Set(o):null;let It=Array.isArray(l)&&l.length?l:ot.slice().sort((mn,dn)=>Number(dn.vol||0)-Number(mn.vol||0)).slice(0,30).map(mn=>mn.symbol.replace("-USD","").replace("/USD",""));It=It.filter(mn=>ct.includes(mn));const an=[],Nt=new Set;for(let mn=0;mn<It.length;mn++){const dn=It[mn];for(let Pt=0;Pt<ct.length;Pt++){const Xe=ct[Pt];if(!dn||!Xe||dn===Xe)continue;const Ut=`${dn}/${Xe}`;if(Nt.has(Ut)||Vt&&!Vt.has(Ut))continue;Nt.add(Ut);const Lt=Ce.get(dn),qe=Ce.get(Xe),Ke=Lt&&qe&&Number(Lt.last)>0&&Number(qe.last)>0?Number(Lt.last)/Number(qe.last):null,pt=Lt&&qe?Math.min(Number(Lt.vol||0),Number(qe.vol||0)):null;if(an.push({kind:"pair",builder:"",dex:"",symbol:Ut,rawSymbol:Ut,last:Ke,chg24:null,vol:pt,funding:null,openInterest:null,leverage:null,coinForChange:Ut}),an.length>=300)return an}}return an},[a,he,o,l,Ce]),ge=m.useMemo(()=>he.some(ot=>ot.kind==="hip3"),[he]);m.useEffect(()=>{a==="pair"&&(U("vol"),z("desc"),ne("perps"))},[a]),m.useEffect(()=>{!ge&&Q==="hip3"&&ne("all")},[ge,Q]),m.useEffect(()=>{a==="pair"&&(U("vol"),z("desc"),ne("perps"))},[a]);const Ae=m.useMemo(()=>{const ot=g.trim().toLowerCase();let ct=a==="pair"?ce.slice():he.slice();a!=="pair"&&(Q==="perps"?ct=ct.filter(It=>It.kind!=="hip3"):Q==="hip3"&&(ct=ct.filter(It=>It.kind==="hip3"))),ot&&(ct=ct.filter(It=>It.symbol.toLowerCase().includes(ot)));const Vt=It=>It==null||isNaN(Number(It))?NaN:Number(It);return ct.sort((It,an)=>{const Nt=J.has(It.symbol)?1:0,mn=J.has(an.symbol)?1:0;if(Nt!==mn)return mn-Nt;const dn=Vt(It[F]),Pt=Vt(an[F]),Xe=isNaN(dn),Ut=isNaN(Pt);return Xe&&Ut?It.symbol.localeCompare(an.symbol):Xe?1:Ut?-1:dn===Pt?It.symbol.localeCompare(an.symbol):L==="asc"?dn-Pt:Pt-dn}),ct},[a,he,ce,g,J,F,L,Q]),ye=()=>{const ot=pe.current;if(!ot)return;const ft=ot.getBoundingClientRect(),ct=getComputedStyle(ot),Vt=parseFloat(ct.paddingLeft)||0,It=document.documentElement.clientWidth,an=16,mn=Math.min(740,It-an*2);let dn=ft.left+Vt;dn+mn>It-an&&(dn=It-an-mn),dn<an&&(dn=an),R(mn),I(dn),C(ft.bottom+8)},je=()=>{ye(),d(!0),requestAnimationFrame(()=>x(!0))},Ie=()=>{x(!1),setTimeout(()=>d(!1),Y)};m.useEffect(()=>{const ot=ct=>ct.key==="Escape"&&u&&Ie(),ft=ct=>{var Vt;return u&&!((Vt=re.current)!=null&&Vt.contains(ct.target))&&Ie()};return document.addEventListener("keydown",ot),document.addEventListener("mousedown",ft),document.addEventListener("touchstart",ft,{passive:!0}),()=>{document.removeEventListener("keydown",ot),document.removeEventListener("mousedown",ft),document.removeEventListener("touchstart",ft)}},[u]),m.useLayoutEffect(()=>{if(!u)return;ye();const ot=()=>ye(),ft=()=>ye();return window.addEventListener("scroll",ot,!0),window.addEventListener("resize",ft),()=>{window.removeEventListener("scroll",ot,!0),window.removeEventListener("resize",ft)}},[u]);const Re=t&&t.length>8?"min-w-[120px]":t&&t.length>6?"min-w-[108px]":"min-w-[96px]",Qe=ot=>{ot.currentTarget.src="data:image/svg+xml;utf8,"+encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><rect width='100%' height='100%' fill='#2a2a2a'/></svg>")},$e=({active:ot,dir:ft})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`w-3 h-3 ml-1 ${ot?"text-white":"text-[#6a6a6a]"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ft==="asc"?i.jsx("path",{d:"M7 14l5-5 5 5"}):i.jsx("path",{d:"M7 10l5 5 5-5"})}),it=m.useMemo(()=>a!=="pair"?t||"Select":t||"Select Pair",[a,t]),tt=({children:ot})=>i.jsx("span",{className:"tabular-nums whitespace-nowrap",children:ot});return i.jsxs("div",{className:`relative ${Re} z-[30]`,ref:re,children:[i.jsx("div",{ref:pe,className:" text-white px-1 py-2 rounded cursor-pointer text-[14px] font-medium font-['Inter'] select-none leading-none",onClick:()=>u?Ie():je(),children:i.jsxs("div",{className:"flex items-center justify-start gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx("span",{className:"truncate text-white font-inter text-[14px] not-italic font-medium leading-4 tracking-[-0.28px]",children:it}),i.jsx("span",{className:"inline-flex px-1 py-[2px] justify-center items-center gap-[10px] rounded-[6px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-inter text-[11px] not-italic font-medium leading-4 w-12",children:(()=>{const ot=he.find(ft=>a==="pair"?ft.symbol===t:ft.rawSymbol===t||ft.symbol===t||ft.coinForChange===t);return ot&&ot.kind==="hip3"?"HIP-3":"PERP"})()})]}),i.jsx("span",{className:"text-[#929292] ml-auto",children:"▾"})," "]})}),u&&i.jsx("div",{className:`fixed inset-0 z-[55] bg-black/50 transition-opacity duration-[${Y}ms] ${f?"opacity-100":"opacity-0"}`,"aria-hidden":!0,onClick:Ie}),u&&i.jsx("div",{className:`fixed z-[60] transition-all duration-[${Y}ms] ease-out ${f?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-1 scale-[0.99]"}`,style:{top:w,left:N,width:P,willChange:"transform, opacity"},children:i.jsxs("div",{className:"bg-[#121212] border border-[#2a2a2a] shadow-xl rounded-md overflow-hidden",children:[i.jsxs("div",{className:"p-2",children:[a!=="pair"&&ge&&i.jsx("div",{className:"mb-2 inline-flex text-[11px] bg-[#1b1b1b] rounded-lg p-0.5",children:[["all","All Coins"],["perps","Perps"],["hip3","HIP-3"]].map(([ot,ft])=>i.jsx("button",{className:`px-2 py-1 rounded-md font-bold ${Q===ot?"bg-[#262626] text-white":"text-[#8a8a8a]"}`,onClick:()=>ne(ot),children:ft},ot))}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:g,onChange:ot=>v(ot.target.value),placeholder:a==="pair"?"Search pairs (e.g., BTC/ETH)":"Search markets...",className:"w-full pr-8 py-1.5 pl-2.5 bg-[#1b1b1b] rounded-md border border-[#303030] h-8 block text-white text-[12px] font-medium placeholder:text-[#535353] focus:outline-none leading-none",autoFocus:!0}),i.jsx("div",{className:"absolute right-2 top-1 pointer-events-none",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5 text-[#646464]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[i.jsx("circle",{cx:"11",cy:"11",r:"7",strokeWidth:"1.5"}),i.jsx("path",{d:"M20 20L17 17",strokeWidth:"1.5"})]})})]})]}),i.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:i.jsxs("table",{className:"w-full text-[12px] font-inter table-fixed",children:[i.jsxs("colgroup",{children:[i.jsx("col",{className:"w-[44px]"}),i.jsx("col",{className:"w-[220px]"}),i.jsx("col",{className:"w-[80px]"}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("col",{className:"w-[160px]"}),i.jsx("col",{}),i.jsx("col",{}),i.jsx("col",{})]})]}),i.jsx("thead",{className:"sticky top-0 bg-[#141414] border-b border-[#1f1f1f] text-[#9B9B9B]",children:i.jsxs("tr",{children:[i.jsx("th",{className:"text-left align-middle"}),i.jsx("th",{className:"text-left align-middle",children:a==="pair"?"Pair":"Symbol"}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("last"),children:["Last Price",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="last",dir:F==="last"?L:"desc"})})]})}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("chg24"),children:["24h Change",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="chg24",dir:F==="chg24"?L:"desc"})})]})}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("vol"),children:["Vol",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="vol",dir:F==="vol"?L:"desc"})})]})}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("funding"),children:["Funding",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="funding",dir:F==="funding"?L:"desc"})})]})}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("openInterest"),children:["Open Int.",i.jsx("span",{className:"ml-1",children:i.jsx($e,{active:F==="openInterest",dir:F==="openInterest"?L:"desc"})})]})})]})]})}),i.jsx("tbody",{className:"divide-y divide-[#1f1f1f]",children:r?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-4 text-[#888888]",colSpan:a==="pair"?3:7,children:"Loading..."})}):Ae.length===0?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-4 text-[#888888]",colSpan:a==="pair"?3:7,children:"No matches found"})}):Ae.map(ot=>{const ft=J.has(ot.symbol),ct=a==="pair"&&ot.symbol.includes("/"),[Vt,It]=ct?ot.symbol.split("/"):[null,null],an=`${ot.kind||"perp"}:${ot.builder||""}:${ot.rawSymbol||ot.symbol}`;return i.jsxs("tr",{className:"hover:bg-[#1b1b1b]/70 cursor-pointer",onClick:()=>{const Nt=a==="pair"?ot.symbol:ot.kind==="hip3"&&ot.rawSymbol?ot.rawSymbol:ot.coinForChange;n(Nt),Ie()},children:[i.jsx("td",{className:"align-middle",children:i.jsx("button",{onClick:Nt=>{Nt.stopPropagation(),te(ot.symbol)},className:`shrink-0 bg-transparent ${ft?"text-yellow-400":"text-[#9b9b9b]"} hover:text-yellow-400`,title:ft?"Unfavorite":"Favorite",children:ft?i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M12 .587l3.668 7.568L24 9.75l-6 5.85 1.42 8.41L12 19.77 4.58 24l1.42-8.4L0 9.75l8.332-1.595z"})}):i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:i.jsx("path",{d:"M12 17.77l-6.18 3.73 1.42-6.82L2 9.75l6.91-1.32L12 2l3.09 6.43L22 9.75l-5.24 4.93 1.42 6.82z",strokeWidth:"1.2"})})})}),i.jsx("td",{className:"align-middle",children:i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c&&i.jsx(i.Fragment,{children:ct?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:`${s}/${Vt}.svg`,alt:Vt,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Qe}),i.jsx("span",{className:"text-[#8a8a8a] text-xs",children:"/"}),i.jsx("img",{src:`${s}/${It}.svg`,alt:It,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Qe})]}):i.jsx("img",{src:ot.kind==="hip3"?`${s}/${ot.builder}:${ot.symbol.replace(/-USDC$/,"").replace(/-USDH$/,"")}.svg`:`${s}/${oe(ot.symbol)}.svg`,alt:ot.symbol,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Qe})}),i.jsx("span",{className:"font-semibold text-white",children:a==="pair"||ot.kind==="hip3"?ot.symbol:ot.symbol.replace(/-USD$/,"").replace(/\/USD$/,"")}),a!=="pair"&&i.jsxs("span",{className:"ml-1 inline-flex items-center gap-1",children:[ot.leverage&&i.jsxs("span",{className:"px-1.5 py-[2px] rounded-[6px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] text-[11px] font-semibold",children:[ot.leverage,"x"]}),ot.kind==="hip3"&&ot.builder&&i.jsx("span",{className:"px-1.5 py-[2px] rounded-[6px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] text-[11px] font-semibold uppercase",children:ot.builder})]})]})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:ot.last==null||ot.last===0?"--":V(ot.last)})}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("td",{className:"text-right font-medium align-middle",children:i.jsx(tt,{children:ot.chg24==null||isNaN(Number(ot.chg24))||ot.last==null||ot.last===0?"--":(()=>{const Nt=Number(ot.chg24),mn=Number(ot.last),dn=mn/(1+Nt/100||1),Pt=mn-dn,Xe=Math.abs(Pt);let Ut;Xe>=1e3?Ut=0:Xe>=100?Ut=2:Ut=4;const Lt=Pt>=0?"+":"-",qe=Xe.toLocaleString(void 0,{minimumFractionDigits:Ut,maximumFractionDigits:Ut}),Ke=`${Nt>0?"+":""}${Nt.toFixed(2)}%`,pt=Nt>0?"#67FFBD":"#FF7173";return i.jsx("span",{style:{color:pt},children:`${Lt}${qe} / ${Ke}`})})()})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:G(ot.vol)})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:ot.funding==null||isNaN(Number(ot.funding))?"--":(Number(ot.funding)*100).toFixed(4)+"%"})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:ot.openInterest==null||isNaN(Number(ot.openInterest))?"--":"$"+G(ot.openInterest)})})]})]},an)})})]})})]})})]})}let WP=null;function Fdn(){return typeof window>"u"?null:(WP||(WP=new Audio("/success.mp3"),WP.volume=.9),WP)}function Odn(){const e=Fdn();if(e)try{e.currentTime=0;const t=e.play();t&&typeof t.then=="function"&&t.catch(function(){})}catch{}}function Mdn(){const e=typeof window<"u"?window.ethereum:null;if(!e)return null;if(Array.isArray(e.providers)&&e.providers.length){const t=e.providers.find(r=>r&&r.isMetaMask);if(t)return t;const n=e.providers.find(r=>r&&r.isCoinbaseWallet);return n||e.providers[0]}return e}let tre=null;function Rdn(e){typeof e=="object"&&!Array.isArray(e)?tre=e:tre=null}async function Ldn(e,t){let n=await e.request({method:"eth_chainId"});if((n==null?void 0:n.toLowerCase())!==t.toLowerCase()){try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(r){if(r&&r.code===4902)await e.request({method:"wallet_addEthereumChain",params:[{chainId:t,chainName:"Arbitrum One",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:["https://arb1.arbitrum.io/rpc"],blockExplorerUrls:["https://arbiscan.io/"]}]});else throw r}if(n=await e.request({method:"eth_chainId"}),(n==null?void 0:n.toLowerCase())!==t.toLowerCase())throw new Error(`Wrong network after switch: active ${parseInt(n,16)} expected ${parseInt(t,16)}.`)}}function W4e(e,t){return fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status} on ${e}`);return n.json()})}function q4e(e){if(typeof e=="function")return e();const t=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,n=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;return{address:t,token:n}}function mX(e){if(typeof window>"u")return null;for(const t of e){const n=window.localStorage.getItem(t);if(n!=null&&n!=="")return n}return null}function bue(e){const t=e&&e.response&&e.response.data&&e.response.data.statuses,n=e&&e.statuses;return Array.isArray(t)?t:Array.isArray(n)?n:[]}function Ddn(e){return bue(e).some(t=>{const n=String(t.status||t.s||"").toLowerCase();return n.includes("placed")||n.includes("resting")})}function Bdn(e){return bue(e).some(n=>{const r=String(n.status||n.s||"").toLowerCase();return r.includes("filled")||r.includes("success")||!!n.filled})}function qP(e){const t=new Set;function n(r){if(!r||typeof r!="object"||t.has(r))return null;if(t.add(r),r.oid!=null&&!Number.isNaN(Number(r.oid)))return Number(r.oid);if(r.o!=null&&!Number.isNaN(Number(r.o)))return Number(r.o);for(const s in r){const a=n(r[s]);if(a!=null)return a}return null}return n(e)}function KN({baseUrl:e="https://api.hyperliquid.xyz",address:t,signer:n,vaultAddress:r=null,dex:s="",defaultSlippage:a=.08,isMainnet:o=!0,signatureChainIdHex:l="0xa4b1",getPK:c=()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,dextraApiBase:u="https://dextrabothypev2.nftinit.io",builderAddress:d="0x49ae63056b3a0be0b166813ee687309ab653c07c",getAuth:f,defaultFromStart:x="website",defaultAppType:g="terminal",defaultLeverage:v=null,getLeverage:w,feeTtlMs:C=12e4}={}){if(!t)throw new Error("address is required for info calls");if(!n||typeof n.sign!="function")throw new Error("signer with sign(action, nonce) is required for exchange actions");let N=null;const I={"Content-Type":"application/json"},P=6,R=o?"Mainnet":"Testnet",F=async(Ve,ut)=>{const xt=e+Ve,jt=await fetch(xt,{method:"POST",headers:I,body:JSON.stringify(ut)});if(!jt.ok)throw new Error(`HTTP ${jt.status} on ${Ve}`);return jt.json()},U=(Ve,ut)=>{if(!Ve||typeof Ve!="object")return NaN;const xt=String(ut||"").trim();if(!xt)return NaN;const jt=xt.toUpperCase();if(Ve[xt]!=null){const un=Number(Ve[xt]);if(Number.isFinite(un))return un}if(Ve[jt]!=null){const un=Number(Ve[jt]);if(Number.isFinite(un))return un}const kt=jt.indexOf("-");if(kt>0){const un=jt.slice(0,kt);if(jt.slice(kt+1)==="PERP"&&Ve[un]!=null){const En=Number(Ve[un]);if(Number.isFinite(En))return En}}const xn=Object.keys(Ve).find(un=>String(un).toUpperCase()===jt);if(xn){const un=Number(Ve[xn]);if(Number.isFinite(un))return un}return NaN},L={allMids:async()=>F("/info",{type:"allMids",dex:s}),openOrders:async(Ve=t)=>F("/info",{type:"openOrders",user:Ve,dex:s}),frontendOpenOrders:async(Ve=t)=>F("/info",{type:"frontendOpenOrders",user:Ve,dex:s}),clearinghouseState:async(Ve=t)=>F("/info",{type:"clearinghouseState",user:Ve,dex:s}),meta:async()=>{if(N)return N;const Ve=await F("/info",{type:"allPerpMetas"});return N=Ve,Ve},metaAndAssetCtxs:async()=>F("/info",{type:"metaAndAssetCtxs",dex:s}),twapHistory:async(Ve=t)=>F("/info",{type:"twapHistory",user:Ve,dex:s}),userTwapSliceFills:async(Ve=t)=>F("/info",{type:"userTwapSliceFills",user:Ve,dex:s}),userTwapSliceFillsByTime:async({user:Ve=t,startTime:ut,endTime:xt,aggregateByTime:jt}={})=>{const kt={type:"userTwapSliceFillsByTime",user:Ve,startTime:ut,dex:s};return xt!=null&&(kt.endTime=xt),jt!=null&&(kt.aggregateByTime=!!jt),F("/info",kt)}};async function z(Ve){const ut=await Q(),xt=String(Ve).toUpperCase();for(let jt=0;jt<ut.length;jt++){const kt=ut[jt];if(Array.isArray(kt.universe)){const xn=kt.universe.findIndex(un=>un.name.toUpperCase()===xt);if(xn!==-1){let un;return jt===0?un=xn:un=1e5+jt*1e4+xn,{entry:kt.universe[xn],index:un,block:kt}}}}throw new Error(`Unknown perp symbol: ${Ve}`)}const Q=async()=>{if(N)return N;const Ve=await L.meta();return N=Ve,Ve},ne=async Ve=>(await z(Ve)).index,J=async Ve=>(await z(Ve)).entry.szDecimals,X=Ve=>{const[ut,xt=""]=String(Ve).split(".");if(!xt)return ut;const jt=xt.replace(/0+$/,"");return jt.length?`${ut}.${jt}`:ut},re=async(Ve,ut)=>{const xt=await J(Ve),jt=Math.max(0,P-Number(xt)),kt=Math.abs(Number(ut));if(!(kt>0)||!Number.isFinite(kt))return jt;const xn=kt>=1?Math.floor(Math.log10(kt))+1:0,un=Math.max(0,5-xn);return Math.min(jt,un)},pe=async(Ve,ut)=>{const xt=await re(Ve,ut);return Number((1/10**xt).toFixed(xt))},Y=async(Ve,ut,xt)=>{const jt=await re(Ve,ut),kt=10**-jt,xn=Number(ut),un=xt?Math.floor(xn/kt)*kt:Math.ceil(xn/kt)*kt;return X(Number(un).toFixed(jt))},ie=async(Ve,ut)=>{if(ut==null||!Number.isFinite(Number(ut)))throw new Error("price required");const xt=await re(Ve,ut),jt=Number(ut),kt=xt===0?Math.round(jt):Math.round(jt*10**xt)/10**xt;return X(kt.toFixed(xt))},oe=async(Ve,ut)=>{if(ut==null||!Number.isFinite(Number(ut)))throw new Error("size required");const xt=await J(Ve);return X(Number(ut).toFixed(Number(xt)))},G=async(Ve,ut,xt,jt=a)=>{let kt=xt;if(kt==null){let un=U(tre,Ve);if(!Number.isFinite(un)){const On=await L.allMids();un=U(On,Ve)}if(kt=un,!Number.isFinite(kt))throw new Error(`Mid price not available for ${Ve}`)}const xn=ut?kt*(1+jt):kt*(1-jt);return Y(Ve,xn,ut)},V=new Set(["usdSend","spotSend","usdClassTransfer","withdraw3","cDeposit","cWithdraw","approveBuilderFee"]),te=()=>({name:"HyperliquidSignTransaction",version:"1",chainId:parseInt(l,16),verifyingContract:"0x0000000000000000000000000000000000000000"}),ae=(Ve,ut)=>{switch(Ve.type){case"usdSend":return{primaryType:"HyperliquidTransaction:UsdSend",types:{"HyperliquidTransaction:UsdSend":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},message:{hyperliquidChain:R,destination:String(Ve.destination).toLowerCase(),amount:String(Ve.amount),time:ut}};case"spotSend":return{primaryType:"HyperliquidTransaction:SpotSend",types:{"HyperliquidTransaction:SpotSend":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"token",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},message:{hyperliquidChain:R,destination:String(Ve.destination).toLowerCase(),token:Ve.token,amount:String(Ve.amount),time:ut}};case"usdClassTransfer":return{primaryType:"HyperliquidTransaction:UsdClassTransfer",types:{"HyperliquidTransaction:UsdClassTransfer":[{name:"hyperliquidChain",type:"string"},{name:"amount",type:"string"},{name:"toPerp",type:"bool"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,amount:String(Ve.amount),toPerp:!!Ve.toPerp,nonce:ut}};case"withdraw3":return{primaryType:"HyperliquidTransaction:Withdraw",types:{"HyperliquidTransaction:Withdraw":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},message:{hyperliquidChain:R,destination:String(Ve.destination).toLowerCase(),amount:String(Ve.amount),time:ut}};case"cDeposit":return{primaryType:"HyperliquidTransaction:CDeposit",types:{"HyperliquidTransaction:CDeposit":[{name:"hyperliquidChain",type:"string"},{name:"wei",type:"string"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,wei:String(Ve.wei),nonce:ut}};case"cWithdraw":return{primaryType:"HyperliquidTransaction:CWithdraw",types:{"HyperliquidTransaction:CWithdraw":[{name:"hyperliquidChain",type:"string"},{name:"wei",type:"string"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,wei:String(Ve.wei),nonce:ut}};case"approveBuilderFee":return{primaryType:"HyperliquidTransaction:ApproveBuilderFee",types:{"HyperliquidTransaction:ApproveBuilderFee":[{name:"hyperliquidChain",type:"string"},{name:"maxFeeRate",type:"string"},{name:"builder",type:"address"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,maxFeeRate:Ve.maxFeeRate.endsWith("%")?Ve.maxFeeRate:`${Ve.maxFeeRate}%`,builder:Ve.builder.toLowerCase(),nonce:ut}};default:return null}},he=Ve=>{const ut=nu.from(Ve),xt=ut.v>=27?ut.v:ut.v+27;return{r:ut.r,s:ut.s,v:xt}},Ce=async(Ve,ut)=>{const xt=ae(Ve,ut);if(!xt)throw new Error("Unsupported typed action");const jt=te(),kt=Object.assign({},xt.types,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]}),xn=(c()||"").trim();if(xn){const En=await new _ae(xn).signTypedData(jt,xt.types,xt.message);return he(En)}const un=Mdn();if(un){await Ldn(un,l);let On=await un.request({method:"eth_accounts"});(!On||!On.length)&&(On=await un.request({method:"eth_requestAccounts"}));const En=On[0];if(!En)throw new Error("No connected account in wallet");if(String(En).toLowerCase()!==String(t).toLowerCase())throw new Error(`Connected wallet ${En} does not match HL address ${t}.`);const jn={domain:jt,types:kt,primaryType:xt.primaryType,message:xt.message},bn=await un.request({method:"eth_signTypedData_v4",params:[En,JSON.stringify(jn)]});return he(bn)}throw new Error("No signer for typed action")};let ce={ts:0,fee:null};async function ge(Ve=!1){const ut=Date.now();if(!Ve&&ce.fee!=null&&ut-ce.ts<C)return{builder_fee:ce.fee};const{address:xt,token:jt}=q4e(f);if(!xt||!jt)return{builder_fee:null};const kt=u+"/api/subscriber/check_account/",xn=await W4e(kt,{address:xt,token:jt}),un=(xn==null?void 0:xn.builder_fee)!=null?Number(xn.builder_fee):null;return ce={ts:ut,fee:un},{builder_fee:un}}async function Ae(Ve){if(Ve.type!=="order")return Ve;const{builder_fee:ut}=await ge();return ut==null?Ve:{...Ve,builder:{b:d,f:Number(ut)}}}function ye(Ve){return Ve!=null&&Ve.fromStart?Ve.fromStart:mX(["dextra_from_start","from_start"])||x||null}function je(Ve){return Ve!=null&&Ve.appType?Ve.appType:mX(["dextra_app_type","app_type"])||g||null}async function Ie(Ve,ut){if((ut==null?void 0:ut.leverage)!=null)return Number(ut.leverage);if(typeof w=="function"){const jt=await w(Ve);if(jt!=null)return Number(jt)}const xt=mX([`leverage:${Ve}`,`${Ve}_leverage`,"dextra_leverage","hl_leverage","leverage"])||v;return xt!=null?Number(xt):null}async function Re(Ve){const ut=await L.clearinghouseState(t),xt=((ut==null?void 0:ut.assetPositions)||[]).find(kt=>{var xn,un;return((un=(xn=kt==null?void 0:kt.position)==null?void 0:xn.coin)==null?void 0:un.toUpperCase())===String(Ve).toUpperCase()});if(!xt)return null;const jt=Number(xt.position.szi||0);return{side:jt>=0?"long":"short",size:Math.abs(jt)}}async function Qe({symbol:Ve,isBuy:ut,usePosSide:xt,size:jt,price:kt,telemetry:xn,oid:un}){var wn;if(!un&&un!==0)return;const{address:On,token:En}=q4e(f);if(!On||!En)return;const jn=typeof window<"u"?window.localStorage.getItem("hl:wallet_id"):null,bn=Ve?await Ie(Ve,xn):null,Zn=xt&&((wn=await Re(Ve))==null?void 0:wn.side)||(ut?"long":"short"),{builder_fee:zn}=await ge(),$n={address:On,token:En,order_params:{coin:String(Ve),wallet_id:jn!=null?Number(jn):null,leverage:bn!=null?Number(bn):null,size:jt!=null?Number(jt):null,from_start:ye(xn),app_type:je(xn),price:kt!=null?Number(kt):null,fee_amount:zn!=null?Number(zn):null,side:String(Zn),oid:Number(un)}},nr=u+"/api/hyper/order_save/";try{await W4e(nr,$n)}catch{}}async function $e(Ve,ut){const xt=ut??Date.now(),jt=Ve.type==="order"?await Ae(Ve):Ve,kt=V.has(jt.type)?await Ce(jt,xt):await n.sign(jt,xt),xn={action:jt,nonce:xt,signature:kt,...r?{vaultAddress:r}:{}};return F("/exchange",xn)}async function it(Ve,ut){var un;const xt=await $e(Ve),jt=bue(xt),kt=Bdn(xt)||Ddn(xt)||(xt==null?void 0:xt.status)==="ok"||((un=xt==null?void 0:xt.response)==null?void 0:un.status)==="ok";let xn=null;return kt&&(Odn(),xn=qP(xt),xn==null&&jt&&jt.length&&(xn=qP(jt))),await Qe({symbol:ut.symbol,isBuy:ut.isBuy,usePosSide:!!ut.usePosSide,size:ut.size,price:ut.price,telemetry:ut.telemetry,oid:xn}),xt}const tt=async({symbol:Ve,isBuy:ut,size:xt,price:jt,tif:kt="Gtc",reduceOnly:xn=!1,cloid:un,builder:On,telemetry:En}={})=>{const jn=await ne(Ve),bn=await oe(Ve,xt),Zn=await Y(Ve,jt,!!ut),$n={type:"order",orders:[{a:jn,b:!!ut,p:Zn,s:bn,r:!!xn,t:{limit:{tif:kt}},...un?{c:un}:{}}],grouping:"na",...On?{builder:On}:{}};return it($n,{symbol:Ve,isBuy:ut,size:bn,price:Zn,telemetry:En,usePosSide:!1})},ot=async({symbol:Ve,isBuy:ut,size:xt,price:jt,tif:kt="Gtc",reduceOnly:xn=!1,tpPrice:un=null,slPrice:On=null,triggerSlippage:En=.08,cloid:jn,builder:bn,telemetry:Zn}={})=>{const zn=await ne(Ve),$n=await oe(Ve,xt),nr=[],wn=await Y(Ve,jt,!!ut);nr.push({a:zn,b:!!ut,p:wn,s:$n,r:!!xn,t:{limit:{tif:kt}},...jn?{c:jn}:{}});const on=!ut;if(On!=null&&On!==""&&Number(On)>0){const rn=await ie(Ve,On),cn=await G(Ve,on,Number(rn),En);nr.push({a:zn,b:on,p:cn,s:$n,r:!0,t:{trigger:{isMarket:!0,triggerPx:rn,tpsl:"sl"}}})}if(un!=null&&un!==""&&Number(un)>0){const rn=await ie(Ve,un),cn=await G(Ve,on,Number(rn),En);nr.push({a:zn,b:on,p:cn,s:$n,r:!0,t:{trigger:{isMarket:!0,triggerPx:rn,tpsl:"tp"}}})}const Oe={type:"order",orders:nr,grouping:nr.length>1?"normalTpsl":"na",...bn?{builder:bn}:{}};return it(Oe,{symbol:Ve,isBuy:ut,size:$n,price:wn,telemetry:Zn,usePosSide:!1})},ft=async({symbol:Ve,tpPrice:ut=null,slPrice:xt=null,size:jt=null,useLimitPx:kt=!1,triggerSlippage:xn=.1,telemetry:un}={})=>{const On=await Re(Ve);if(!On)throw new Error(`No open position for ${Ve}`);const En=await ne(Ve),jn=await oe(Ve,jt??On.size),bn=On.side==="short",Zn=[];let zn=null;if(xt!=null&&Number(xt)>0){const nr=await ie(Ve,xt),wn=kt?nr:await G(Ve,bn,Number(nr),xn);Zn.push({a:En,b:bn,p:wn,s:jn,r:!0,t:{trigger:{isMarket:!kt,triggerPx:nr,tpsl:"sl"}}}),zn=zn??nr}if(ut!=null&&Number(ut)>0){const nr=await ie(Ve,ut),wn=kt?nr:await G(Ve,bn,Number(nr),xn);Zn.push({a:En,b:bn,p:wn,s:jn,r:!0,t:{trigger:{isMarket:!kt,triggerPx:nr,tpsl:"tp"}}}),zn=zn??nr}if(!Zn.length)throw new Error("TP/SL price required");return it({type:"order",orders:Zn,grouping:"normalTpsl"},{symbol:Ve,isBuy:bn,size:jn,price:zn??0,telemetry:un,usePosSide:!0})},ct=async(Ve={})=>(await Xe({filter:"tpsl",symbol:Ve.symbol}),ft(Ve)),Vt=async(Ve,ut,xt,{price:jt,slippage:kt=a,cloid:xn,tif:un="Ioc",reduceOnly:On=!1,builder:En,telemetry:jn}={})=>{const bn=await G(Ve,ut,jt,kt);return tt({symbol:Ve,isBuy:ut,size:xt,price:bn,tif:"FrontendMarket",reduceOnly:On,cloid:xn,builder:En,telemetry:jn})},It=async(Ve,ut,{price:xt,slippage:jt=a,cloid:kt,tif:xn="Ioc",reduceOnly:un=!0,builder:On,telemetry:En}={})=>{let jn,bn=ut;if(bn==null){const on=await L.clearinghouseState(t),Oe=((on==null?void 0:on.assetPositions)||[]).find(cn=>{var _t,Yn;return((Yn=(_t=cn==null?void 0:cn.position)==null?void 0:_t.coin)==null?void 0:Yn.toUpperCase())===String(Ve).toUpperCase()});if(!Oe)throw new Error(`No position found for ${Ve}`);const rn=parseFloat(Oe.position.szi);if(!rn)throw new Error(`No open size on ${Ve}`);bn=Math.abs(rn),jn=rn<0}else try{const on=await L.clearinghouseState(t),Oe=((on==null?void 0:on.assetPositions)||[]).find(cn=>{var _t,Yn;return((Yn=(_t=cn==null?void 0:cn.position)==null?void 0:_t.coin)==null?void 0:Yn.toUpperCase())===String(Ve).toUpperCase()});jn=(Oe?parseFloat(Oe.position.szi):0)<0}catch{jn=!1}const Zn=await G(Ve,jn,xt,jt),zn=await ne(Ve),$n=await oe(Ve,bn),wn={type:"order",orders:[{a:zn,b:jn,p:Zn,s:$n,r:!0,t:{limit:{tif:"FrontendMarket"}},...kt?{c:kt}:{}}],grouping:"na",...On?{builder:On}:{}};return it(wn,{symbol:Ve,isBuy:jn,size:$n,price:Zn,telemetry:En,usePosSide:!0})},an=async Ve=>{const ut=await L.openOrders(t),xt=Ve?ut.filter(un=>un.coin.toUpperCase()===String(Ve).toUpperCase()):ut;if(!xt.length)return{status:"ok",response:{type:"cancel",data:{count:0}}};const jt=new Map;for(const un of xt)jt.has(un.coin)||jt.set(un.coin,await ne(un.coin));const xn={type:"cancel",cancels:xt.map(un=>({a:jt.get(un.coin),o:Number(un.oid)}))};return $e(xn)},Nt=async Ve=>{const ut=Ve==null?{type:"scheduleCancel"}:{type:"scheduleCancel",time:Date.now()+Math.max(5e3,Number(Ve))};return $e(ut)},mn=async({symbol:Ve,isBuy:ut,size:xt,minutes:jt,randomize:kt=!1,reduceOnly:xn=!1}={})=>{var zn,$n,nr,wn,on,Oe,rn,cn;const un=await ne(Ve),On=await oe(Ve,xt),jn={type:"twapOrder",twap:{a:un,b:!!ut,s:On,r:!!xn,m:Number(jt),t:!!kt}},bn=await $e(jn),Zn=((nr=($n=(zn=bn==null?void 0:bn.response)==null?void 0:zn.data)==null?void 0:$n.status)==null?void 0:nr.error)||((on=(wn=bn==null?void 0:bn.response)==null?void 0:wn.data)==null?void 0:on.error)||((rn=(Oe=bn==null?void 0:bn.data)==null?void 0:Oe.status)==null?void 0:rn.error)||((cn=bn==null?void 0:bn.data)==null?void 0:cn.error);if(Zn)throw new Error(Zn);return bn},dn=async({symbol:Ve,twapId:ut}={})=>{const jt={type:"twapCancel",a:await ne(Ve),t:Number(ut)};return $e(jt)},Pt=async({symbol:Ve,oid:ut,cloid:xt}={})=>{const jt=await ne(Ve);if(ut!=null&&/^\d+$/.test(String(ut)))return $e({type:"cancel",cancels:[{a:jt,o:Number(ut)}]});if(xt)return $e({type:"cancelByCloid",cancels:[{asset:jt,cloid:String(xt)}]});throw new Error("cancelOrder requires a numeric oid or a cloid")},Xe=async({filter:Ve="all",symbol:ut=null}={})=>{const xt=await L.openOrders(t),jt=Array.isArray(xt)?xt:[],kt=jn=>{const bn=String(jn.orderType||jn.type||"").toLowerCase();return Ve==="all"?!0:Ve==="limit"?bn==="limit":Ve==="tpsl"?bn.includes("take profit")||bn.includes("stop"):Ve==="reduceOnly"?!!jn.reduceOnly:Ve==="nonReduce"?!jn.reduceOnly:!1},xn=jt.filter(jn=>(!ut||String(jn.coin).toUpperCase()===String(ut).toUpperCase())&&kt(jn));if(!xn.length)return{ok:!0,count:0};const un=new Map,On=[];for(const jn of xn){let bn=un.get(jn.coin);bn||(bn=await ne(jn.coin),un.set(jn.coin,bn)),On.push({a:bn,o:Number(jn.oid)})}return $e({type:"cancel",cancels:On})},Ut=async()=>{const Ve=await L.clearinghouseState(t),xt=(Array.isArray(Ve==null?void 0:Ve.assetPositions)?Ve.assetPositions:[]).map(jt=>jt==null?void 0:jt.position).filter(jt=>Math.abs(Number((jt==null?void 0:jt.szi)||0))>0);for(const jt of xt){const kt=jt.coin,xn=Math.abs(Number(jt.szi));await It(kt,xn,{tif:"FrontendMarket",reduceOnly:!0})}return!0},Lt={usdTransfer:async(Ve,ut)=>{const xt=Date.now(),jt={type:"usdSend",hyperliquidChain:R,signatureChainId:l,destination:String(Ve).toLowerCase(),amount:String(ut),time:xt};return $e(jt)},spotTransfer:async(Ve,ut,xt)=>{const jt=Date.now(),kt={type:"spotSend",hyperliquidChain:R,signatureChainId:l,destination:String(Ve).toLowerCase(),token:ut,amount:String(xt),time:jt};return $e(kt)},usdClassTransfer:async(Ve,ut)=>{const xt=Date.now(),jt={type:"usdClassTransfer",hyperliquidChain:R,signatureChainId:l,amount:String(Ve),toPerp:!!ut,nonce:xt};return $e(jt,xt)},withdraw:async(Ve,ut)=>{const xt=Date.now(),jt={type:"withdraw3",hyperliquidChain:R,signatureChainId:l,destination:String(Ve).toLowerCase(),amount:String(ut),time:xt};return $e(jt,xt)},cDeposit:async Ve=>{const ut=Date.now(),xt={type:"cDeposit",hyperliquidChain:R,signatureChainId:l,wei:String(Ve),nonce:ut};return $e(xt,ut)},cWithdraw:async Ve=>{const ut=Date.now(),xt={type:"cWithdraw",hyperliquidChain:R,signatureChainId:l,wei:String(Ve),nonce:ut};return $e(xt,ut)},approveBuilderFee:async({builder:Ve,maxFeeRate:ut})=>{const xt=Date.now(),jt={type:"approveBuilderFee",hyperliquidChain:R,signatureChainId:l,builder:String(Ve).toLowerCase(),maxFeeRate:String(ut),nonce:xt};return $e(jt,xt)}},qe=(()=>{const Ve="hl:pairs",ut=()=>{try{return JSON.parse(localStorage.getItem(Ve)||"[]")}catch{return[]}},xt=On=>{try{localStorage.setItem(Ve,JSON.stringify(On))}catch{}};return{read:ut,write:xt,get:On=>ut().find(En=>En.id===On)||null,add:On=>{const En=ut();En.push(On),xt(En)},upsert:On=>{const En=ut().filter(jn=>jn.id!==On.id);En.push(On),xt(En)},remove:On=>xt(ut().filter(En=>En.id!==On))}})(),Ke=(Ve="PAIR")=>`${Ve}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;async function pt(Ve,ut,xt,jt,kt){const xn=[{symbol:ut.symbol,side:"long",size:Number(ut.size),oid:qP(jt)??null},{symbol:xt.symbol,side:"short",size:Number(xt.size),oid:qP(kt)??null}];return qe.add({id:Ve,createdAt:Date.now(),legs:xn}),{pairId:Ve,long:{oid:xn[0].oid},short:{oid:xn[1].oid}}}const en=async({long:Ve,short:ut,entrySlippage:xt=a,triggerSlippage:jt=.1,telemetry:kt,pairId:xn}={})=>{if(!(Ve!=null&&Ve.symbol)||!(ut!=null&&ut.symbol))throw new Error("pair requires long.symbol and short.symbol");if(!(Number(Ve.size)>0)||!(Number(ut.size)>0))throw new Error("pair sizes must be > 0");const un=xn||Ke(),[On,En]=await Promise.all([placeMarketWithTPSL({symbol:Ve.symbol,isBuy:!0,size:Number(Ve.size),entrySlippage:xt,tpPrice:Ve.tpPrice??null,slPrice:Ve.slPrice??null,triggerSlippage:jt,telemetry:kt,cloid:`${un}:L`}),placeMarketWithTPSL({symbol:ut.symbol,isBuy:!1,size:Number(ut.size),entrySlippage:xt,tpPrice:ut.tpPrice??null,slPrice:ut.slPrice??null,triggerSlippage:jt,telemetry:kt,cloid:`${un}:S`})]);return pt(un,Ve,ut,On,En)},Bt=async({long:Ve,short:ut,triggerSlippage:xt=a,telemetry:jt,pairId:kt}={})=>{if(!(Ve!=null&&Ve.symbol)||!(ut!=null&&ut.symbol))throw new Error("pair requires long.symbol and short.symbol");const xn=kt||Ke(),[un,On]=await Promise.all([Ve.tpPrice||Ve.slPrice?ot({symbol:Ve.symbol,isBuy:!0,size:Number(Ve.size),price:Number(Ve.price),tif:String(Ve.tif||"Gtc"),reduceOnly:!!Ve.reduceOnly,tpPrice:Ve.tpPrice??null,slPrice:Ve.slPrice??null,triggerSlippage:xt,telemetry:jt,cloid:`${xn}:L`}):tt({symbol:Ve.symbol,isBuy:!0,size:Number(Ve.size),price:Number(Ve.price),tif:String(Ve.tif||"Gtc"),reduceOnly:!!Ve.reduceOnly,telemetry:jt,cloid:`${xn}:L`}),ut.tpPrice||ut.slPrice?ot({symbol:ut.symbol,isBuy:!1,size:Number(ut.size),price:Number(ut.price),tif:String(ut.tif||"Gtc"),reduceOnly:!!ut.reduceOnly,tpPrice:ut.tpPrice??null,slPrice:ut.slPrice??null,triggerSlippage:xt,telemetry:jt,cloid:`${xn}:S`}):tt({symbol:ut.symbol,isBuy:!1,size:Number(ut.size),price:Number(ut.price),tif:String(ut.tif||"Gtc"),reduceOnly:!!ut.reduceOnly,telemetry:jt,cloid:`${xn}:S`})]);return pt(xn,Ve,ut,un,On)},Et=async({long:Ve,short:ut,telemetry:xt,pairId:jt}={})=>{if(!(Ve!=null&&Ve.symbol)||!(ut!=null&&ut.symbol))throw new Error("pair requires long.symbol and short.symbol");const kt=jt||Ke(),[xn,un]=await Promise.all([mn({symbol:Ve.symbol,isBuy:!0,size:Number(Ve.size),minutes:Number(Ve.minutes),randomize:!!Ve.randomize,reduceOnly:!!Ve.reduceOnly}),mn({symbol:ut.symbol,isBuy:!1,size:Number(ut.size),minutes:Number(ut.minutes),randomize:!!ut.randomize,reduceOnly:!!ut.reduceOnly})]);return pt(kt,Ve,ut,xn,un)};async function et(Ve){var kt;const ut=await L.clearinghouseState(t),xt=((ut==null?void 0:ut.assetPositions)||[]).find(xn=>{var un,On;return((On=(un=xn==null?void 0:xn.position)==null?void 0:un.coin)==null?void 0:On.toUpperCase())===String(Ve).toUpperCase()}),jt=Number(((kt=xt==null?void 0:xt.position)==null?void 0:kt.szi)||0);return{size:Math.abs(jt),side:jt>=0?"long":"short"}}return{updateLeverage:async(Ve,ut,xt)=>{var On,En,jn,bn,Zn,zn,$n,nr;const kt={type:"updateLeverage",asset:await ne(Ve),isCross:String(ut||"").toLowerCase()==="cross",leverage:Number(xt)},xn=await $e(kt),un=((jn=(En=(On=xn==null?void 0:xn.response)==null?void 0:On.data)==null?void 0:En.status)==null?void 0:jn.error)||((Zn=(bn=xn==null?void 0:xn.response)==null?void 0:bn.data)==null?void 0:Zn.error)||(($n=(zn=xn==null?void 0:xn.data)==null?void 0:zn.status)==null?void 0:$n.error)||((nr=xn==null?void 0:xn.data)==null?void 0:nr.error)||((xn==null?void 0:xn.status)==="err"?xn==null?void 0:xn.response:null);if(un)throw new Error(String(un));return xn},placeOrder:tt,placeLimitWithTPSL:ot,placeTPSLForPosition:ft,replaceTPSLForPosition:ct,cancelAllOrders:an,scheduleCancel:Nt,marketOpen:Vt,marketClose:It,placeMarketWithTPSL:async Ve=>{const ut=await G(Ve.symbol,Ve.isBuy,null,Ve.entrySlippage??a);return ot({...Ve,price:Number(ut),tif:"FrontendMarket"})},placeTwapOrder:mn,cancelTwapOrder:dn,cancelOrder:Pt,cancelOrdersFiltered:Xe,closeAllPositions:Ut,marketOpenPair:en,limitOpenPair:Bt,twapOpenPair:Et,marketClosePair:async({pairId:Ve,slippage:ut=a,fraction:xt=1,telemetry:jt}={})=>{const kt=qe.get(Ve);if(!kt)throw new Error("Unknown pairId");const[xn]=kt.legs.filter(wn=>wn.side==="long"),[un]=kt.legs.filter(wn=>wn.side==="short");if(!xn||!un)throw new Error("Pair legs corrupted");const[On,En]=await Promise.all([et(xn.symbol),et(un.symbol)]),jn=Math.max(0,Math.min(On.size,xn.size)*Number(xt||1)),bn=Math.max(0,Math.min(En.size,un.size)*Number(xt||1)),Zn=[];if(jn>0&&Zn.push(It(xn.symbol,jn,{slippage:ut,reduceOnly:!0,telemetry:jt,cloid:`${Ve}:L:CLOSE`})),bn>0&&Zn.push(It(un.symbol,bn,{slippage:ut,reduceOnly:!0,telemetry:jt,cloid:`${Ve}:S:CLOSE`})),!Zn.length)return{pairId:Ve,message:"Nothing to close"};const zn=await Promise.all(Zn),[$n,nr]=await Promise.all([et(xn.symbol),et(un.symbol)]);return $n.size===0&&nr.size===0&&qe.remove(Ve),{pairId:Ve,results:zn}},pairs:{list:()=>qe.read(),get:Ve=>qe.get(Ve),remove:Ve=>qe.remove(Ve)},info:L,transfers:Lt,utils:{getPerpAssetId:ne,getSzDecimals:J,toPxString:ie,toSzString:oe,withSlippagePx:G,trimZeros:X,getPxDecimalsAt:re,getTickSize:pe,quantizePx:Y}}}const nre="https://api.hyperliquid.xyz/info",$dn="wss://api.hyperliquid.xyz/ws";function Udn(e){const t=String(e||""),n=t.indexOf(":");if(n>=0){const r=t.slice(0,n),s=t.slice(n+1);return{builder:r,symbol:s+(r==="xyz"?"-USDC":"-USDH")}}return{builder:null,symbol:t}}const Vd={rows:[],subs:new Set,started:!1,ws:null,timer:null};function mHe(){for(const e of Vd.subs)try{e(Vd.rows)}catch{}}async function zdn(){const t=await(await fetch(nre,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs"})})).json(),n=Array.isArray(t)?t[0]:t.meta||t||{},r=Array.isArray(t)?t[1]:t.assetCtxs||[];return(n&&n.universe?n.universe:[]).map((o,l)=>{const c=r&&r[l]||{},u=o.name,d=Number(c.markPx??c.midPx??0),f=Number(c.prevDayPx??0);return{kind:"perp",dex:"",builder:"",rawSymbol:u,coin:u,symbol:`${u}-USD`,last:d,prevDayPx:f,chg24:f?(d-f)/f*100:0,vol:Number(c.dayNtlVlm??0),funding:Number(c.funding??0),leverage:o.maxLeverage??null,openInterest:Number(c.openInterest??0)}})}async function Hdn(){try{const t=await(await fetch(nre,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"perpDexs"})})).json();let n=[];Array.isArray(t)?n=t:Array.isArray(t.dexs)&&(n=t.dexs);const r=n.map(a=>a?typeof a=="string"?a:typeof a=="object"&&a.name?a.name:null:null).filter(a=>{if(!a)return!1;const o=String(a),l=o.toLowerCase();return!(o==="HL"||l==="vntl"||l==="flx")}),s=[];for(const a of r)try{const l=await(await fetch(nre,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs",dex:a})})).json(),c=Array.isArray(l)?l[0]:l.meta||l||{},u=Array.isArray(l)?l[1]:l.assetCtxs||[],d=c&&c.universe?c.universe:[];for(let f=0;f<d.length;f++){const x=d[f],g=u[f]||{},v=Udn(x.name),w=Number(g.markPx??g.midPx??0),C=Number(g.prevDayPx??0);s.push({kind:"hip3",dex:a,builder:v.builder||a,rawSymbol:x.name,coin:v.symbol,symbol:v.symbol,last:w,prevDayPx:C,chg24:C?(w-C)/C*100:0,vol:Number(g.dayNtlVlm??0),funding:Number(g.funding??0),leverage:x.maxLeverage??null,openInterest:Number(g.openInterest??0)})}}catch{}return s}catch{return[]}}async function G4e(){try{const[e,t]=await Promise.all([zdn(),Hdn()]);Vd.rows=[...e,...t],mHe()}catch{}}function Vdn(){if(!Vd.started){Vd.started=!0,G4e(),Vd.timer=setInterval(G4e,6e4);try{const e=new WebSocket($dn);Vd.ws=e,e.onopen=()=>{try{e.send(JSON.stringify({method:"subscribe",subscription:{type:"allMids",dex:"ALL_DEXS"}}))}catch{}},e.onmessage=t=>{let n;try{n=JSON.parse(t.data||"{}")}catch{return}if(n.channel!=="allMids")return;const r=n.data&&n.data.mids||{};Rdn(r);const s=Vd.rows.map(a=>{const o=a.rawSymbol||a.symbol||a.coin,c=String(o).replace(/^[a-z0-9]+:/i,""),u=a.coin,d=a.symbol,f=o,x=r[c]??r[u]??r[d]??r[f]??null;if(x==null)return a;const g=Number(x),v=a.prevDayPx?(g-a.prevDayPx)/a.prevDayPx*100:a.chg24||0;return{...a,last:g,chg24:v}});Vd.rows=s,mHe()},e.onclose=()=>{Vd.ws=null}}catch{}}}function xU(){const[e,t]=m.useState(Vd.rows);return m.useEffect(()=>{Vdn(),t(Vd.rows);const n=r=>{t(r)};return Vd.subs.add(n),()=>{Vd.subs.delete(n)}},[]),e}const xX=({children:e,text:t})=>{const[n,r]=m.useState({x:0,y:0}),[s,a]=m.useState(!1);return i.jsxs("div",{className:"relative inline-block",onMouseMove:o=>{const l=o.currentTarget.getBoundingClientRect();r({x:o.clientX-l.left,y:o.clientY-l.top})},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[i.jsx("span",{className:"underline decoration-dotted underline-offset-2 cursor-help",children:e}),i.jsx(mT,{children:s&&i.jsx(vo.div,{className:"absolute z-50 px-3 py-2 text-xs text-white bg-black rounded-md pointer-events-none shadow-lg w-72",style:{top:n.y+18,left:n.x+18},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",stiffness:300,damping:25},children:t})})]})},Wdn=({coin:e,onCoinChange:t,headerData:n,setIsDigits:r,mode:s="single",pairKey:a="BTC/ETH",onPairChange:o=()=>{},markets:l=[],market:c="hyperliquid"})=>{const u=(n==null?void 0:n.nextFundingTime)??(n==null?void 0:n.nextFundingRate),[d,f]=m.useState(L(u)),[x,g]=m.useState((n==null?void 0:n.markPx)||0),[v,w]=m.useState("text-white"),[C,N]=m.useState({last:null,mark:null,oracle:null}),I=m.useRef((n==null?void 0:n.markPx)||0),P=xU(),R=l.length?l:P,F=c==="hyperliquid"&&s==="pair",U={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{if(!F&&(n==null?void 0:n.markPx)!=null){const he=n.markPx.toString(),Ce=he.includes(".")?he.split(".")[1].length:0;r(Ce)}},[F,n==null?void 0:n.markPx]),m.useEffect(()=>{if(!F)return;let he=!1;const Ce=async()=>{var ce;try{const Ae=await(await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allMids"})})).json(),ye=((ce=Ae==null?void 0:Ae.data)==null?void 0:ce.universe)||[],[je,Ie]=String(a).split("/"),Re=ye.find(ft=>(ft==null?void 0:ft.name)===je),Qe=ye.find(ft=>(ft==null?void 0:ft.name)===Ie),$e=Number((Re==null?void 0:Re.markPx)||0),it=Number((Qe==null?void 0:Qe.markPx)||0),tt=Number((Re==null?void 0:Re.oraclePx)||0),ot=Number((Qe==null?void 0:Qe.oraclePx)||0);if($e>0&&it>0){const ft=$e/it,ct=tt>0&&ot>0?tt/ot:null;N({last:ft,mark:ft,oracle:ct});const Vt=ft.toString().includes(".")?ft.toString().split(".")[1].length:0;r(Vt)}}catch{}he||setTimeout(Ce,1500)};return Ce(),()=>{he=!0}},[F,a]);function L(he){const Ce=new Date,ce=Ce.getTime(),ge=Number(he);if(Number.isFinite(ge)&&ge>ce){const it=Math.max(0,Math.floor((ge-ce)/1e3)),tt=String(Math.floor(it/3600)).padStart(2,"0"),ot=String(Math.floor(it%3600/60)).padStart(2,"0"),ft=String(it%60).padStart(2,"0");return`${tt}:${ot}:${ft}`}Ce.setSeconds(Ce.getSeconds()+1);const Ae=Date.UTC(Ce.getUTCFullYear(),Ce.getUTCMonth(),Ce.getUTCDate(),Ce.getUTCHours(),Ce.getUTCMinutes(),Ce.getUTCSeconds()),je=new Date(Date.UTC(Ce.getUTCFullYear(),Ce.getUTCMonth(),Ce.getUTCDate(),Ce.getUTCHours()+1,0,0,0)).getTime()-Ae,Ie=Math.floor(je/1e3),Re=String(Math.floor(Ie/3600)).padStart(2,"0"),Qe=String(Math.floor(Ie%3600/60)).padStart(2,"0"),$e=String(Ie%60).padStart(2,"0");return`${Re}:${Qe}:${$e}`}m.useEffect(()=>{f(L(u));const he=setInterval(()=>f(L(u)),1e3);return()=>clearInterval(he)},[u]),m.useEffect(()=>{if(F){const he=C.mark;if(!he)return;const Ce=I.current;he>Ce?w("text-[#1DE6A3]"):he<Ce&&w("text-[#FF7173]"),g(he);const ce=setTimeout(()=>w("text-white"),800);return I.current=he,()=>clearTimeout(ce)}else{if(!(n!=null&&n.markPx))return;const he=n.markPx,Ce=I.current;he>Ce?w("text-[#1DE6A3]"):he<Ce&&w("text-[#FF7173]"),g(he);const ce=setTimeout(()=>w("text-white"),800);return I.current=he,()=>clearTimeout(ce)}},[F,C.mark,n==null?void 0:n.markPx]);const z=()=>i.jsx("div",{className:"flex items-center justify-start w-[76px]",children:i.jsx("div",{className:"w-[76px] max-w-[76px] h-[16px] rounded skeleton-ticker-text short ml-4 mt-1"})}),Q=(n==null?void 0:n.source)==="extended",ne=he=>{const Ce=Number(he);if(!Number.isFinite(Ce))return z();const ce=Math.abs(Ce);let ge=1;return ce>=1e3?ge=1:ce>=100?ge=2:ce>=1?ge=3:ce>=.1?ge=4:ge=6,Ce.toLocaleString(void 0,{maximumFractionDigits:ge})},J=he=>he==null||isNaN(he)?z():he>=1e3?Vw(he):he,X=he=>{const Ce=Number(he);if(!Number.isFinite(Ce))return z();const ce=Math.abs(Ce),ge=Ce>=0?"+":"-";if(!Q)return`${ge}${ce.toFixed(5)}`;let Ae=0;ce<.1?Ae=6:ce<1?Ae=4:ce<10?Ae=2:ce<100&&(Ae=1);const ye=ce.toFixed(Ae),je=Ae>0?ye.replace(/\.?0+$/,""):ye;return`${ge}${je}`},re=Number.isFinite(n==null?void 0:n.markPx)&&Number.isFinite(n==null?void 0:n.prevDayPx)?n.markPx-n.prevDayPx:null,pe=re!=null&&(n!=null&&n.prevDayPx)?re/n.prevDayPx*100:null,Y=re!=null?X(re):null,ie=re==null?"text-white":re>=0?"text-[#1DE6A3]":"text-[#FF7173]",oe=pe==null?"text-white":pe>=0?"text-[#1DE6A3]":"text-[#FF7173]",G=()=>{const[he,Ce]=String(a).split("/");return i.jsxs("div",{className:"flex -space-x-2 items-center",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${he||""}.svg`||Va,alt:"pair_a",className:"w-8 h-8 min-w-8 min-h-8 rounded-full bg-[#2a2a2a]",loading:"lazy",onError:ce=>dm(ce)}),i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Ce||""}.svg`||Va,alt:"pair_b",className:"w-8 h-8 min-w-8 min-h-8 rounded-full bg-[#2a2a2a] border border-[#0f0f0f]",loading:"lazy",onError:ce=>dm(ce)})]})},V=F?"pair":"single",te=F?a:e,ae=F?o:t;return i.jsx("div",{className:"flex justify-between items-center gap-2 md:gap-4 w-full relative",children:i.jsxs("div",{className:"flex justify-between xl:justify-start items-center gap-2 sm:gap-4 w-full sm:w-max",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"flex justify-center items-center",children:F?i.jsx(G,{}):i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${U[e]||(e==null?void 0:e.split("/")[0])}.svg`||Va,alt:"token_image",className:"w-8 h-8 min-w-8 min-h-8 rounded-full",loading:"lazy",onError:he=>dm(he)})}),i.jsx(gue,{markets:R,value:te,onChange:ae,loading:!R.length,showIcon:!0,mode:V})]}),i.jsx("div",{className:"hidden lg:flex bg-[#101010]",children:F?i.jsx(i.Fragment,{}):i.jsxs(i.Fragment,{children:[i.jsx(uC,{title:i.jsx(xX,{text:"Used for margining, computing unrealized PnL, liquidations and triggering TP/SL orders.",children:"Mark"}),widthValue:"70px",info:Q?ne(x):J(x),color_1:v}),i.jsx(uC,{title:i.jsx(xX,{text:"Median price from external sources reported by validators; used to calculate funding rates.",children:"Oracle"}),widthValue:"80px",info:Q?ne(n==null?void 0:n.oraclePx):J(n==null?void 0:n.oraclePx),color_1:"text-white"}),i.jsx(uC,{title:"24h Change",widthValue:"120px",info:Y??z(),info_2:pe,color_1:ie,color_2:oe}),i.jsx(uC,{title:"24h Volume",widthValue:"130px",info:n!=null&&n.dayNtlVlm?`$${Cr(parseFloat(n==null?void 0:n.dayNtlVlm))}`:z(),color_1:"text-white"}),i.jsx(uC,{title:"Open Interest",widthValue:"130px",info:n!=null&&n.oraclePx?`$${Cr(parseFloat((n==null?void 0:n.oraclePx)*(n==null?void 0:n.openInterest)))}`:z(),color_1:"text-white"}),i.jsx(uC,{title:i.jsx(xX,{text:"If the funding rate is positive, longs pay shorts. If negative, shorts pay longs.",children:"Funding"}),title_2:"Countdown",widthValue:"145px",info:(n==null?void 0:n.funding)!=null?((n==null?void 0:n.funding)*100).toFixed(4)+"%":z(),info_2:(n==null?void 0:n.funding)!=null?d:z(),color_1:"text-[#1DE6A3]",color_2:"text-white",isLast:!0})]})}),i.jsx("div",{className:"flex lg:hidden justify-start items-center gap-4",children:"All Positions"})]})})},uC=({title:e,title_2:t,widthValue:n,info:r,info_2:s,color_1:a,color_2:o,isLast:l})=>i.jsxs("div",{className:"flex items-center",children:[i.jsxs("div",{style:{minWidth:n},className:"flex flex-col items-center justify-center",children:[i.jsx("div",{className:"flex flex-col items-start",children:t?i.jsxs("div",{className:`text-[#B7B7B7] text-[12px] font-medium font-inter leading
-snug`,children:[e," / ",t]}):i.jsx("div",{className:"text-[#B7B7B7] text-[12px] font-medium font-inter leading-snug",children:e})}),s?i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:`${a} text-[12px] font-semibold font-inter leading-[16px]`,children:r}),i.jsx("div",{className:`${a} flex justify-center items-center max-h-2`,children:r?"/":""}),i.jsx("div",{className:`${o} text-[12px] font-semibold font-inter leading-[16px]`,children:t=="Countdown"?s:`${s>0?"+":""}${parseFloat(s).toFixed(2)}%`})]}):i.jsx("div",{className:`${a} text-[12px] font-semibold font-inter leading-[16px]`,children:r})]}),!l&&i.jsx("div",{className:"border-l border-[#3E3E3E]",style:{height:24}})]}),qdn="wss://api.hyperliquid.xyz/ws",gX=new Map;function K4e(e){const t=(e||"").toLowerCase();return t?(gX.has(t)||gX.set(t,{key:t,ws:null,ping:null,subs:new Set,connected:!1,connecting:!1}),gX.get(t)):null}function xHe(e){if(!e||e.connecting||e.connected)return;e.connecting=!0;const t=new WebSocket(qdn);e.ws=t,t.onopen=()=>{e.connected=!0,e.connecting=!1;try{t.send(JSON.stringify({method:"subscribe",subscription:{type:"user",user:e.key}})),t.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:e.key}})),t.send(JSON.stringify({method:"subscribe",subscription:{type:"webData3",user:e.key}}))}catch{}e.ping=setInterval(()=>{try{t.send(JSON.stringify({id:99,method:"ping"}))}catch{}},3e4)},t.onmessage=r=>{let s;try{s=JSON.parse(r.data)}catch{return}(s==null?void 0:s.method)!=="pong"&&e.subs.forEach(a=>{try{a(s)}catch{}})};const n=()=>{e.connected=!1,e.connecting=!1;try{t.close()}catch{}e.ping&&(clearInterval(e.ping),e.ping=null),e.ws=null,e.subs.size&&setTimeout(()=>xHe(e),1500)};t.onclose=n,t.onerror=n}function gHe(e,t){const n=K4e(e);return n?(n.subs.add(t),xHe(n),()=>{const r=K4e(e);if(r&&(r.subs.delete(t),!r.subs.size&&r.ws))try{r.ws.close()}catch{}}):()=>{}}const Gdn="https://api.hyperliquid.xyz/info",bX=new Map,Kdn=["xyz"];function Ydn(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(bX.has(t)||bX.set(t,{key:t,rows:[],count:void 0,loading:!0,emptyTimer:null,tpslByCoin:{},viewOrdersOnly:new Set,subs:new Set}),bX.get(t)):null}function bHe(e){e.subs.forEach(t=>{try{t({rows:e.rows,count:e.count,loading:e.loading,tpslByCoin:e.tpslByCoin,viewOrdersOnly:e.viewOrdersOnly})}catch{}})}function Xdn(e){return(Array.isArray(e)?e:[]).filter(n=>{var r;return((r=n==null?void 0:n.position)==null?void 0:r.szi)&&Number(n.position.szi)!==0}).map(n=>{var v,w,C;const r=n.position,s=Number(r.szi||0),a=Number(r.positionValue||0),o=Number(r.entryPx||0),l=Math.abs(s)>0?a/Math.abs(s):0,c=Number(r.unrealizedPnl||0),u=Number(r.returnOnEquity||0)*100,d=r.liquidationPx?Number(r.liquidationPx):null,f=Number(r.marginUsed||0),x=Number(((v=r.leverage)==null?void 0:v.value)||0),g=((w=r.leverage)==null?void 0:w.type)||null;return{id:`${r.coin}:${r.entryPx}:${r.szi}`,coin:r.coin,type:s>0?"Long":"Short",size:s,positionValue:a,entryPrice:o,markPrice:l,pnl:c,roe:u,liquidationPx:d,marginUsed:f,leverage:{value:x,type:g},funding:Number(((C=r.cumFunding)==null?void 0:C.sinceOpen)||0)}})}function Y4e(e,t){const n=Xdn(t);e.rows=n,e.count=n.length,e.loading=!1,bHe(e)}function GP(e,t){if(Array.isArray(t)&&t.length>0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),Y4e(e,t);return}e.emptyTimer||(e.emptyTimer=setTimeout(()=>{e.emptyTimer=null,Y4e(e,[])},1e3))}function KP(e,t){const n=Array.isArray(t)?t:[],r={},s=new Set,a=new Set;for(const o of n)if(o!=null&&o.coin&&(s.add(o.coin),o.isPositionTpsl)){a.add(o.coin);const l=r[o.coin]||{tp:null,sl:null},c=Number(o.triggerPx||o.limitPx||0),u=String(o.orderType||"").toLowerCase();u.includes("take profit")&&(l.tp=Number.isFinite(c)?c:l.tp),u.includes("stop")&&(l.sl=Number.isFinite(c)?c:l.sl),r[o.coin]=l}for(const o of s)a.has(o)||(r[o]={tp:null,sl:null});e.tpslByCoin=r,bHe(e)}function yHe(e){const t=[],n=new Set;function r(s){if(Array.isArray(s))for(const a of s){if(!a)continue;const o=a.oid!=null?String(a.oid):a.cloid!=null?String(a.cloid):`${a.coin||""}-${a.timestamp||""}-${a.limitPx||""}-${a.side||""}`;n.has(o)||(n.add(o),t.push(a))}}if(!e)return t;if(Array.isArray(e))return r(e),t;if(typeof e!="object")return t;if(Array.isArray(e.orders)&&r(e.orders),r(e.openOrders),e.clearinghouseState&&typeof e.clearinghouseState=="object"&&r(e.clearinghouseState.openOrders),Array.isArray(e.perpDexStates))for(const s of e.perpDexStates)!s||typeof s!="object"||(Array.isArray(s.orders)&&r(s.orders),r(s.openOrders),s.clearinghouseState&&typeof s.clearinghouseState=="object"&&r(s.clearinghouseState.openOrders));return t}function vHe(e){let t=[],n=!1;if(e&&typeof e=="object"){const a=e.clearinghouseState;if(Array.isArray(a&&a.assetPositions)?(t.push(...a.assetPositions),n=!0):Array.isArray(e.assetPositions)&&(t.push(...e.assetPositions),n=!0),Array.isArray(e.perpDexStates)){let o=!1;for(const l of e.perpDexStates){if(!l||!l.clearinghouseState)continue;const c=l.clearinghouseState.assetPositions;Array.isArray(c)&&c.length>0&&(o=!0,t.push(...c))}o&&(n=!0)}}const r=yHe(e),s=r.length>0;return{hasAssetPositions:n,assetPositions:t,hasOpenOrders:s,openOrders:r}}function Qdn(e){if(!e||typeof e!="object")return{assetPositions:[],openOrders:[]};const{hasAssetPositions:t,assetPositions:n,hasOpenOrders:r,openOrders:s}=vHe(e);return{assetPositions:t?n:[],openOrders:r?s:[]}}function yue(e){const[t,n]=m.useState({rows:[],count:void 0,loading:!0,tpslByCoin:{},viewOrdersOnly:new Set});return m.useEffect(()=>{const r=e==null?void 0:e.toLowerCase();if(!r)return;const s=Ydn(r),a=l=>n(l);s.subs.add(a),n({rows:s.rows,count:s.count,loading:s.loading,tpslByCoin:s.tpslByCoin,viewOrdersOnly:s.viewOrdersOnly});const o=gHe(r,l=>{if(!l)return;const c=l.channel;if(c==="user"){const u=l.data&&l.data.state;if(!u)return;Array.isArray(u.assetPositions)&&GP(s,u.assetPositions);const d=yHe(u);d.length&&KP(s,d);return}if(c==="webData2"||c==="webData3"){const u=l.data||{},{hasAssetPositions:d,assetPositions:f,hasOpenOrders:x,openOrders:g}=vHe(u);d&&GP(s,f),x&&KP(s,g)}});return(async()=>{try{const l=Kdn.map(f=>{const x={type:"clearinghouseState",user:r};return f&&(x.dex=f),x}),c=await Promise.all(l.map(f=>fetch(Gdn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}).then(x=>x.json()).catch(()=>null))),u=[],d=[];for(const f of c){if(!f)continue;const{assetPositions:x,openOrders:g}=Qdn(f);Array.isArray(x)&&x.length&&u.push(...x),Array.isArray(g)&&g.length&&d.push(...g)}GP(s,u),KP(s,d)}catch{GP(s,[]),KP(s,[])}})(),()=>{s.subs.delete(a),o()}},[e]),t}function wHe(e){const{count:t}=yue(e);return t}const yX=new Map;function Zdn(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(yX.has(t)||yX.set(t,{key:t,rows:[],count:void 0,loading:!0,subs:new Set,emptyTimer:null}),yX.get(t)):null}function Jdn(e){e.subs.forEach(t=>{try{t({rows:e.rows,count:e.count,loading:e.loading})}catch{}})}function efn(e){return(Array.isArray(e)?e:[]).map(n=>({id:`${n.oid}-${n.timestamp}`,coin:n.coin,side:n.side==="B"?"Buy":"Sell",sideRaw:n.side,type:n.orderType,size:Number(n.sz)>0?Number(n.sz):"--",originalSize:Number(n.origSz)>0?Number(n.origSz):"--",price:Number(n.triggerPx)>0?"Market":Number(n.limitPx),limitPx:Number(n.limitPx||0),triggerPx:Number(n.triggerPx)||"N/A",isTrigger:!!n.isTrigger,reduceOnly:!!n.reduceOnly,tif:n.tif||null,orderValue:Number(n.limitPx||0)>0&&Number(n.sz||0)!==0?Number(n.limitPx)*Math.abs(Number(n.sz)):0,timestamp:Number(n.timestamp||0),children:Array.isArray(n.children)?n.children:[],isPositionTpsl:!!n.isPositionTpsl,cloid:n.cloid||null,oid:n.oid})).sort((n,r)=>r.timestamp-n.timestamp)}function vX(e){const t=[],n=new Set;function r(s){if(Array.isArray(s))for(const a of s){if(!a)continue;const o=a.oid!=null?String(a.oid):a.cloid!=null?String(a.cloid):`${a.coin||""}-${a.timestamp||""}-${a.limitPx||""}-${a.side||""}`;n.has(o)||(n.add(o),t.push(a))}}if(!e)return t;if(Array.isArray(e)){for(const s of e)!s||typeof s!="object"||(Array.isArray(s.orders)&&r(s.orders),Array.isArray(s.openOrders)&&r(s.openOrders));return t}if(typeof e!="object")return t;if(Array.isArray(e.orders)&&r(e.orders),Array.isArray(e.openOrders)&&r(e.openOrders),e.clearinghouseState&&typeof e.clearinghouseState=="object"&&Array.isArray(e.clearinghouseState.openOrders)&&r(e.clearinghouseState.openOrders),Array.isArray(e.perpDexStates))for(const s of e.perpDexStates)!s||typeof s!="object"||(Array.isArray(s.orders)&&r(s.orders),Array.isArray(s.openOrders)&&r(s.openOrders),s.clearinghouseState&&typeof s.clearinghouseState=="object"&&Array.isArray(s.clearinghouseState.openOrders)&&r(s.clearinghouseState.openOrders));return t}function X4e(e){if(!e||typeof e!="object")return!1;if(Array.isArray(e.orders)||Array.isArray(e.openOrders)||e.clearinghouseState&&typeof e.clearinghouseState=="object"&&Array.isArray(e.clearinghouseState.openOrders))return!0;if(Array.isArray(e.perpDexStates)){for(const t of e.perpDexStates)if(!(!t||typeof t!="object")&&(Array.isArray(t.orders)||Array.isArray(t.openOrders)||t.clearinghouseState&&typeof t.clearinghouseState=="object"&&Array.isArray(t.clearinghouseState.openOrders)))return!0}return!1}function wX(e,t){const n=efn(t);e.rows=n,e.count=n.length,e.loading=!1,Jdn(e)}function CX(e,t,n){if(t.length>0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),wX(e,t);return}if(n===0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),wX(e,[]);return}e.emptyTimer||(e.emptyTimer=setTimeout(()=>{e.emptyTimer=null,!(n>0)&&wX(e,[])},2e3))}function vue(e){const t=(e==null?void 0:e.toLowerCase())||"",n=wHe(e),[r,s]=m.useState({rows:[],count:void 0,loading:!0});return m.useEffect(()=>{if(!t){s({rows:[],count:0,loading:!1});return}const a=Zdn(t);if(!a){s({rows:[],count:0,loading:!1});return}const o=c=>s(c);a.subs.add(o),s({rows:a.rows,count:a.count,loading:a.loading});const l=gHe(t,c=>{if(!c)return;const u=c.channel,d=c.data||{};if(u==="openOrders"){const f=vX(d);CX(a,f,n);return}if(u==="user"){const f=d.state;if(!f||!X4e(f))return;const x=vX(f);CX(a,x,n);return}if(u==="webData2"||u==="webData3"){if(!X4e(d))return;const f=vX(d);CX(a,f,n);return}});return()=>{a.subs.delete(o),l()}},[t,n]),r}function tfn(e){const{count:t}=vue(e);return t}const pv={"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","4h":"240","12h":"720","1d":"1D","1w":"1W","1M":"1M"},Pj={"1m":60,"5m":300,"15m":900,"30m":1800,"1h":3600,"4h":14400,"12h":43200,"1d":86400,"1w":604800,"1M":2592e3},YP={1:"1m",5:"5m",15:"15m",30:"30m",60:"1h",240:"4h",720:"12h","1D":"1d",D:"1d","1W":"1w",W:"1w","1M":"1M",M:"1M"},nfn="wss://api.starknet.extended.exchange",SX="https://api.starknet.extended.exchange/api/v1",NX="https://express-proxy-delta.vercel.app/proxy?url=",rfn={"1m":"PT1M","5m":"PT5M","15m":"PT15M","30m":"PT30M","1h":"PT1H","4h":"PT4H","12h":"PT12H","1d":"PT24H","1w":"P7D","1M":"P30D"},sfn="https://mainnet.zklighter.elliot.ai/api/v1/candles",ifn="https://mainnet.zklighter.elliot.ai/api/v1/candlesticks",afn=["tv.js","charting_library.standalone.js","charting_library.js"];let XP=null;function ofn(e="/charting_library/"){return typeof window>"u"?Promise.resolve(null):window.TradingView&&window.TradingView.widget?Promise.resolve(window.TradingView):XP||(XP=(async()=>{for(const t of afn){const n=e.replace(/\/?$/,"/")+t;if(!document.querySelector(`script[data-tv-lib="${n}"]`)){const s=document.createElement("script");s.src=n,s.async=!0,s.dataset.tvLib=n,document.body.appendChild(s),await new Promise(a=>{s.onload=a,s.onerror=a})}if(window.TradingView&&window.TradingView.widget)return window.TradingView;let r=0;for(;(!window.TradingView||!window.TradingView.widget)&&r<40;)await new Promise(s=>setTimeout(s,25)),r++;if(window.TradingView&&window.TradingView.widget)return window.TradingView}return window.TradingView||null})(),XP)}const lfn="#133024",CHe="#67FFBD",cfn="#311621",SHe="#FF79AD",ufn={background:lfn,border:CHe},dfn={background:cfn,border:SHe},ffn="#67FFBD",hfn="rgba(103,255,189,0.12)",pfn="#67FFBD",mfn="#FF797C",xfn="rgba(255,121,124,0.12)",gfn="#FF79AD",bfn="#67FFBD",yfn="rgba(103,255,189,0.08)",vfn="#67FFBD",Q4e="#FF79AD",Z4e="rgba(255,121,173,0.08)",J4e="#FF79AD",m9=e=>{const t=String(e||"").trim().toUpperCase();return t==="SELL"||t==="SHORT"||t==="S"?"S":t==="BUY"||t==="LONG"||t==="B"?"B":""},AO="",eSe="tv_chart_layout_v3",gb=e=>typeof e=="string"&&e.includes("/");function wfn(e){const t=[e.isBuy,e.b,e.buy,e.side,e.dir,e.takerSide,e.action];for(const n of t){if(n===!0||n===1)return!0;if(n===!1||n===0)return!1;if(typeof n=="string"){const r=n.toLowerCase();if(r==="buy"||r==="b"||r==="long")return!0;if(r==="sell"||r==="s"||r==="short")return!1}}return!1}function NHe(e){const t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}function Cfn(e){const t=new Date(e),n=NHe(e),r=t.getUTCDay();return n-r*864e5}function Sfn(e){const t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)}function mv(e,t){if(t==="1d")return NHe(e);if(t==="1w")return Cfn(e);if(t==="1M")return Sfn(e);const n=Pj[t]||60;return Math.floor(e/1e3/n)*n*1e3}function wue(e){return/limit/i.test(String(e.type||""))?Number(e.limitPx)||0:Number(e.triggerPx)||0}function AHe(e){return Number(e.sz??e.size??e.sizeCoin??e.coinSize??e.baseSize??e.qty??e.quantity??0)||0}function Nfn(e,t){const n=m9(e.sideRaw||e.side),r=/take\s*profit/i.test(String(e.type||"")),s=/stop/i.test(String(e.type||"")),a=wue(e),o=AHe(e),l=e.coin||t||"",c=o>0?` (${o.toLocaleString(void 0,{maximumFractionDigits:6})}${l?" "+l:""})`:"";return r?AO+`TP ${n==="S"?">":"<"} ${a}${c}`:s?AO+`SL ${n==="S"?"<":">"} ${a}${c}`:AO+`Limit ${a}${c}`}function Afn(e){const t=/take\s*profit/i.test(String(e.type||"")),n=/stop/i.test(String(e.type||"")),r=m9(e.sideRaw||e.side),s=r==="S"||r==="A";return n?{txt:mfn,bg:xfn,br:gfn}:t?s?{txt:Q4e,bg:Z4e,br:J4e}:{txt:ffn,bg:hfn,br:pfn}:s?{txt:Q4e,bg:Z4e,br:J4e}:{txt:bfn,bg:yfn,br:vfn}}function tSe(e){return!e||typeof e!="object"||!Array.isArray(e.charts)?e:{...e,charts:e.charts.map(n=>!n||!Array.isArray(n.panes)?n:{...n,panes:n.panes.map(r=>{if(!r||!Array.isArray(r.sources))return r;const s=r.sources.filter(a=>{if(!a||typeof a!="object")return!0;const o=a.state||{},l=o.text||o.title||"";return!(typeof l=="string"&&l[0]===AO)});return{...r,sources:s}})})}}function jfn(e,t){const n=e.oid??e.cloid??e.clientOrderId??e.hash??e.orderId??e.id??null,r=e.sideRaw??e.side??"";return String(n??`${e.coin||t}|${r}|${wue(e)}`)}function nSe(e,t,n){var r,s,a,o;if(n!=null){try{(r=e==null?void 0:e.removeEntity)==null||r.call(e,n)}catch{}try{(s=t==null?void 0:t.removeEntity)==null||s.call(t,n)}catch{}try{const l=(a=t==null?void 0:t.getShapeById)==null?void 0:a.call(t,n);(o=l==null?void 0:l.remove)==null||o.call(l)}catch{}}}function QP(e,t,n){e.forEach(r=>{r&&(typeof r.then=="function"?r.then(s=>{s!=null&&nSe(t,n,s)}).catch(()=>{}):nSe(t,n,r))})}const Efn=(()=>{if(typeof Intl<"u"&&Intl.DateTimeFormat)try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e&&typeof e=="string")return e}catch{}return"Etc/UTC"})();function AX({coin:e="BTC",interval:t="1h",domId:n,libPath:r="/charting_library/",walletAddress:s,gridLines:a=[],market:o="hyperliquid",lighterMarketId:l=null,extendedMarket:c=null,extendedLastPrice:u=null,extendedApiKey:d=null}){const f=m.useRef(null),x=m.useRef(null),g=m.useRef(null),v=m.useRef(new Map),[w,C]=m.useState(!1),N=m.useRef([]),I=m.useRef([]),P=vue(s||"").rows,R=m.useRef(null),F=m.useRef(t),U=m.useRef(new Map),L=m.useRef(0),[z,Q]=m.useState([]);m.useEffect(()=>{P.length>0&&(N.current=P)},[P]);let ne;P.length===0?(L.current+=1,L.current<=1?ne=N.current:ne=P):(L.current=0,ne=P);const J=m.useMemo(()=>o!=="hyperliquid"?[]:ne.filter(G=>G&&G.coin===e),[ne,e,o]);m.useEffect(()=>{if(o!=="extended"||!d){Q([]);return}let G=!1;const V=async()=>{try{const ae=`${SX}/user/orders`,he=`${NX}${encodeURIComponent(ae)}`,ce=await(await fetch(he,{headers:{"X-Api-Key":d}})).json().catch(()=>null);if(G)return;const Ae=((ce==null?void 0:ce.data)&&Array.isArray(ce.data)&&ce.data||(Array.isArray(ce)?ce:[])).map((ye,je)=>{var Ie;return{id:ye.id??je,market:(ye.market||"").toUpperCase(),type:(ye.type||"").toUpperCase(),side:m9(ye.side)||(ye.side||"").toUpperCase(),sideRaw:m9(ye.side)||"B",status:(ye.status||"").toUpperCase(),limitPx:Number(ye.price)||null,triggerPx:((Ie=ye.trigger)==null?void 0:Ie.triggerPrice)!=null?Number(ye.trigger.triggerPrice):null,qty:Number(ye.qty)||null,takeProfit:ye.takeProfit||null,stopLoss:ye.stopLoss||null,reduceOnly:!!ye.reduceOnly,createdTime:ye.createdTime||null,updatedTime:ye.updatedTime||null}}).filter(ye=>ye.status==="NEW"||ye.status==="PARTIALLY_FILLED");Q(Ae)}catch{G||Q([])}};V();const te=setInterval(V,1e4);return()=>{G=!0,clearInterval(te)}},[o,d]);const X=m.useMemo(()=>{if(o==="hyperliquid")return J;if(o==="extended"){const G=String(c||e||"").toUpperCase();return z.filter(V=>String(V.market||"").toUpperCase()===G)}return[]},[o,J,z,c,e]);let re=Efn;try{const G=typeof window<"u"?JSON.parse(window.localStorage.getItem("tradingview.chartproperties")||"null"):null;G&&G.timezone&&(re=G.timezone)}catch{}const pe=typeof window<"u"?window.localStorage.getItem("tranding_chart_interval_time"):null,Y=pe&&pv[pe]?pe:t,ie=pv[Y]||"60";m.useEffect(()=>{P.length>0&&(I.current=P)},[P]),m.useEffect(()=>{if(!w)return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V)return;const te=pv[t]?pv[t]:Object.values(pv).includes(t)?t:ie,ae=R.current!==e,he=F.current!==t;if(ae){R.current=e,F.current=t;const Ce=g.current;if(Ce&&typeof Ce.clearMarksCache=="function")try{Ce.clearMarksCache()}catch{}try{V.setSymbol(e,te,()=>{var ce;try{V.requestMarksRefresh&&V.requestMarksRefresh(),(ce=V.autoScaleAllSeries)==null||ce.call(V)}catch{}})}catch{}}else if(he){F.current=t;try{V.setResolution(te,()=>{var Ce;try{V.requestMarksRefresh&&V.requestMarksRefresh(),(Ce=V.autoScaleAllSeries)==null||Ce.call(V)}catch{}})}catch{}}},[e,t,w,ie]),m.useEffect(()=>{let G=!0;return(async()=>{const V=await ofn(r);if(!G||!V||!V.widget||!f.current)return;f.current.innerHTML="";let te=5;function ae(Ae,ye,je,Ie,Re,Qe,$e){let it=Ae||null,tt=$e||null,ot=null,ft=null,ct=null,Vt=null,It=null,an=null;const Nt={},mn={},dn={},Pt={};let Xe=!0,Ut=Qe,Lt=null,qe=0;const Ke=on=>+String(on).slice(0,13);let pt="1h",en="",Bt=[],Et=null,et=null,Be=null;const Mt=on=>rfn[on]||"PT1M",Ve=on=>{if(Re)return Re;const Oe=String(on||"");return!Oe||Oe.includes("/")?"":Oe.includes("-")?Oe:`${Oe}-USD`},ut=(on,Oe)=>{if(!Oe)return;const rn=Pt[Oe]||[],cn=rn[rn.length-1];cn&&cn.time===on.time?rn[rn.length-1]=on:rn.push(on),rn.length>2e3&&rn.splice(0,rn.length-2e3),Pt[Oe]=rn},xt=(on,Oe,rn)=>{const cn=Pt[on]||[];return cn.length?cn.filter(_t=>Number.isFinite(_t.time)&&_t.time/1e3>=Oe&&_t.time/1e3<=rn):[]},jt=(on,Oe,rn)=>{const cn=Number(Ut);if(!Number.isFinite(cn)||cn<=0)return[];const _t=mv(rn*1e3,on);return Math.floor(_t/1e3)<Oe?[]:[{time:_t,open:cn,high:cn,low:cn,close:cn,volume:0}]};function kt(){je==="hyperliquid"&&(ot||(ot=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),ot.onopen=()=>{It&&ot&&ot.send(JSON.stringify({method:"subscribe",subscription:It}))},ot.onmessage=on=>{var cn;const Oe=(cn=JSON.parse(on.data))==null?void 0:cn.data;if(!Oe||!Oe.c)return;const rn={time:Ke(Oe.t),open:+Oe.o,high:+Oe.h,low:+Oe.l,close:+Oe.c,volume:Oe.v??0};Object.values(Nt).forEach(_t=>_t(rn))},ot.onclose=()=>{ot=null}))}function xn(){je==="extended"&&(!an||ft||(ft=new WebSocket(an),ft.onmessage=on=>{let Oe;try{Oe=JSON.parse(on.data)}catch{return}const rn=Array.isArray(Oe==null?void 0:Oe.data)?Oe.data:[];rn.length&&rn.forEach(cn=>{const _t={time:Ke(cn.T),open:+cn.o,high:+cn.h,low:+cn.l,close:+cn.c,volume:cn.v!=null?Number(cn.v):0};!Number.isFinite(_t.time)||!Number.isFinite(_t.open)||(ut(_t,pt),Object.values(Nt).forEach(Yn=>Yn(_t)))})},ft.onclose=()=>{ft=null}))}function un(on,Oe,rn){if(je!=="hyperliquid")return;if(ct)try{ct.close()}catch{}if(Vt)try{Vt.close()}catch{}et=null,Be=null,ct=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),Vt=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),ct.onopen=()=>{ct&&ct.send(JSON.stringify({method:"subscribe",subscription:{type:"candle",coin:on,interval:rn}}))},Vt.onopen=()=>{Vt&&Vt.send(JSON.stringify({method:"subscribe",subscription:{type:"candle",coin:Oe,interval:rn}}))};const cn=_t=>Yn=>{var ir;const yn=(ir=JSON.parse(Yn.data))==null?void 0:ir.data;if(!yn||!yn.c)return;const Dt={time:Ke(yn.t),open:+yn.o,high:+yn.h,low:+yn.l,close:+yn.c,volume:yn.v??0};if(_t==="A"?et=Dt:Be=Dt,!et||!Be)return;const sn=mv(et.time,pt),Tn=mv(Be.time,pt);if(sn!==Tn)return;const Kn={time:Math.max(et.time,Be.time),open:et.open/Be.open,high:et.high/Be.high,low:et.low/Be.low,close:et.close/Be.close,volume:0};Object.values(Nt).forEach(rr=>rr(Kn))};ct.onmessage=cn("A"),Vt.onmessage=cn("B"),ct.onclose=()=>{ct=null},Vt.onclose=()=>{Vt=null}}function On(on){const Oe=String(on||"");return Oe==="BTC"||Oe==="ETH"?2:Oe.startsWith("1000")||Oe.includes("/")?4:3}async function En(on,Oe,rn,cn){const yn=(Pj[Oe]||60)*1e4,Dt=Math.max(rn*1e3,cn*1e3-yn*1e3),{data:sn}=await ds.post("https://api-ui.hyperliquid.xyz/info",{type:"candleSnapshot",req:{coin:on,interval:Oe,startTime:Dt,endTime:cn*1e3}});return(Array.isArray(sn)?sn:sn&&sn.data?sn.data:[]).map(Kn=>({time:Ke(Kn.t),open:+Kn.o,high:+Kn.h,low:+Kn.l,close:+Kn.c,volume:Kn.v??0})).sort((Kn,ir)=>Kn.time-ir.time)}async function jn(on,Oe,rn,cn,_t){const[Yn,yn]=await Promise.all([En(on,rn,cn,_t),En(Oe,rn,cn,_t)]),Dt=[];let sn=0,Tn=0;for(;sn<Yn.length&&Tn<yn.length;){const Kn=mv(Yn[sn].time,pt),ir=mv(yn[Tn].time,pt);Kn===ir?(Dt.push({time:Math.max(Yn[sn].time,yn[Tn].time),open:Yn[sn].open/yn[Tn].open,high:Yn[sn].high/yn[Tn].high,low:Yn[sn].low/yn[Tn].low,close:Yn[sn].close/yn[Tn].close,volume:0}),sn++,Tn++):Kn<ir?sn++:Tn++}return Dt}async function bn(on,Oe,rn,cn){if(on==null)return[];const _t=Pj[Oe]||60,Yn=Math.max(_t,cn-rn),yn=Math.max(1,Math.ceil(Yn/_t)),Dt={market_id:on,resolution:Oe,r:Oe,start_timestamp:rn*1e3,end_timestamp:cn*1e3,start:rn*1e3,end:cn*1e3,count_back:yn,limit:yn,set_timestamp_to_end:!0},sn=rr=>{if(!rr)return null;if(Array.isArray(rr)){const[p,h,S,_,k,T]=rr;return{time:Ke(p),open:+h,high:+S,low:+_,close:+k,volume:Number(T??0)||0}}const Jt=rr.t??rr.time??rr.timestamp??rr.start_timestamp??rr.startTime??rr.start_time??0,Un=rr.o??rr.open,Qn=rr.h??rr.high,Rt=rr.l??rr.low,Pn=rr.c??rr.close,Ee=rr.v??rr.volume??rr.V??0;return{time:Ke(Jt),open:+Un,high:+Qn,low:+Rt,close:+Pn,volume:Number(Ee??0)||0}},Tn=rr=>rr.map(Jt=>sn(Jt)).filter(Jt=>Jt&&Number.isFinite(Jt.time)&&Number.isFinite(Jt.open)&&Jt.time/1e3>=rn&&Jt.time/1e3<=cn).sort((Jt,Un)=>Jt.time-Un.time),Kn=async rr=>{const{data:Jt}=await ds.get(rr,{params:Dt});return Jt?Array.isArray(Jt.c)?Jt.c:Array.isArray(Jt.data)?Jt.data:Array.isArray(Jt.candlesticks)?Jt.candlesticks:Array.isArray(Jt.candles)?Jt.candles:Array.isArray(Jt)?Jt:[]:[]};let ir=[];try{ir=await Kn(sfn)}catch{}if(!ir.length)try{ir=await Kn(ifn)}catch{}return Tn(ir)}async function Zn(on,Oe,rn,cn){if(!on)return[];const _t=Pj[Oe]||60,Yn=Math.max(_t,cn-rn),yn=Math.min(1e4,Math.max(1,Math.ceil(Yn/_t))),Dt=Mt(Oe),sn=`${SX}/info/candles/${on}/trades?interval=${Dt}&limit=${yn}&endTime=${cn*1e3}`,Tn=`${NX}${encodeURIComponent(sn)}`,{data:Kn}=await ds.get(Tn);return(Array.isArray(Kn==null?void 0:Kn.data)?Kn.data:[]).map(rr=>({time:Ke(rr.T),open:+rr.o,high:+rr.h,low:+rr.l,close:+rr.c,volume:rr.v!=null?Number(rr.v):0})).filter(rr=>Number.isFinite(rr.time)&&Number.isFinite(rr.open)&&rr.time/1e3>=rn&&rr.time/1e3<=cn).sort((rr,Jt)=>rr.time-Jt.time)}async function zn(on,Oe,rn){if(!it)return[];if(gb(on))return[];const{data:cn}=await ds.post("https://api.hyperliquid.xyz/info",{type:"userFills",user:it,coin:on,startTime:Oe*1e3,endTime:rn*1e3});return(Array.isArray(cn)?cn:cn&&cn.data?cn.data:[]).filter(yn=>{const Dt=yn.coin||yn.asset||yn.symbol;return Dt?String(Dt).toUpperCase()===String(on).toUpperCase():!0}).map(yn=>({t:+String(yn.time).slice(0,13),b:wfn(yn),px:Number(yn.px||yn.price),sz:Number(yn.sz||yn.size)})).filter(yn=>yn.t/1e3>=Oe&&yn.t/1e3<=rn&&Number.isFinite(yn.px)&&yn.px>0)}async function $n(on,Oe,rn){if(!tt)return[];if(!on)return[];const cn=`${SX}/user/trades`,_t=`${NX}${encodeURIComponent(cn)}`,{data:Yn}=await ds.get(_t,{headers:{"X-Api-Key":tt}}),yn=Array.isArray(Yn==null?void 0:Yn.data)?Yn.data:Array.isArray(Yn)?Yn:[],Dt=String(on||"").toUpperCase();return yn.filter(sn=>String(sn.market||"").toUpperCase()===Dt).map(sn=>({t:+String(sn.createdTime||sn.time||sn.paidTime||0).slice(0,13),b:m9(sn.side)!=="S"})).filter(sn=>sn.t/1e3>=Oe&&sn.t/1e3<=rn&&Number.isFinite(sn.t))}function nr(on){mn[on]&&(clearInterval(mn[on]),delete mn[on])}function wn(){Object.keys(mn).forEach(on=>{nr(on)})}return{setWallet:on=>{it=on||null,en="",Bt=[],Et=null},setExtendedApiKey:on=>{tt=on||null,en="",Bt=[],Et=null},setExtendedFallbackPrice:on=>{Ut=on},clearMarksCache:()=>{en="",Bt=[],Et=null},onReady:on=>on({supported_resolutions:Object.values(pv),supports_group_request:!1,supports_marks:!0,supports_timescale_marks:!1,supports_time:!0}),resolveSymbol:(on,Oe)=>{Lt=on;const rn=dn[on]??On(on);dn[on]=rn,typeof ye=="function"&&ye(rn),Oe({name:on,ticker:on,full_name:on,description:gb(on)?on:on+"/USD",type:"crypto",session:"24x7",timezone:re,exchange:je==="lighter"?"Lighter":je==="extended"?"Extended":"Hyperliquid",pricescale:Math.pow(10,rn),minmov:1,has_intraday:!0,supported_resolutions:Object.values(pv),data_status:"streaming"})},getServerTime:on=>on(Math.floor(Date.now()/1e3)),getBars:async(on,Oe,{from:rn,to:cn},_t,Yn)=>{const yn=on.ticker||on.name,Dt=++qe;try{const sn=YP[Oe]||"1m";sn&&(pt=sn);let Tn=[];if(je==="lighter")gb(yn)||(Tn=await bn(Ie,sn,rn,cn));else if(je==="extended"){if(!gb(yn)){const Kn=Ve(yn);if(Kn&&Xe)try{Tn=await Zn(Kn,sn,rn,cn)}catch{Xe=!1}Tn.length||(Tn=xt(sn,rn,cn)),Tn.length||(Tn=jt(sn,rn,cn))}}else if(gb(yn)){const Kn=String(yn).split("/"),ir=Kn[0],rr=Kn[1];Tn=await jn(ir,rr,sn,rn,cn)}else Tn=await En(yn,sn,rn,cn);if(yn!==Lt||Dt!==qe)return;_t(Tn,{noData:Tn.length===0})}catch(sn){const Tn=sn&&sn.response&&sn.response.status;if(je==="lighter"&&Tn===400){yn===Lt&&Dt===qe&&_t([],{noData:!0});return}try{Yn(sn&&sn.message?sn.message:"Datafeed error")}catch{}}},getMarks:async(on,Oe,rn,cn,_t)=>{const Yn=on.ticker||on.name;if(gb(Yn))return cn([]);const yn=YP[_t]||null;yn&&(pt=yn);let Dt=Number(Oe),sn=Number(rn);const Tn=Math.floor(Date.now()/1e3);(!Number.isFinite(Dt)||!Number.isFinite(sn)||sn<=Dt||Dt<=0||sn<=0)&&(sn=Tn,Dt=sn-30*24*3600);const Kn=je==="extended"?Ve(Yn):Yn;if(je==="extended"&&!tt)return cn([]);const ir=[je,Kn||Yn,Dt,sn,pt];je==="extended"&&ir.push(tt||"no-key");const rr=ir.join("|");if(rr===en&&Bt.length)return cn(Bt);if(Et&&Et.key===rr){const Un=await Et.promise;return cn(Un)}Et={key:rr,promise:(async()=>{try{let Un=new Map;if(je==="hyperliquid"){const Rt=await zn(Yn,Dt,sn);Un=new Map;for(const Pn of Rt){const Ee=mv(Pn.t,pt),p=Math.floor(Ee/1e3),h=Pn.b?"B":"S",S=p+"-"+h;Un.has(S)||Un.set(S,{time:p,isBuy:Pn.b})}}else if(je==="extended"){const Rt=await $n(Kn,Dt,sn);Un=new Map;for(const Pn of Rt){const Ee=mv(Pn.t,pt),p=Math.floor(Ee/1e3),h=Pn.b?"B":"S",S=p+"-"+h;Un.has(S)||Un.set(S,{time:p,isBuy:Pn.b})}}const Qn=Array.from(Un.values()).map((Rt,Pn)=>({id:Rt.time+"-"+(Rt.isBuy?"B":"S")+"-"+Pn,time:Rt.time,color:Rt.isBuy?ufn:dfn,label:Rt.isBuy?"B":"S",labelFontColor:Rt.isBuy?CHe:SHe,text:Rt.isBuy?"Buy":"Sell",minSize:16,borderWidth:1,hoveredBorderWidth:2})).sort((Rt,Pn)=>Rt.time-Pn.time);return en=rr,Bt=Qn,Et=null,Qn}catch{return Et=null,[]}})()};const Jt=await Et.promise;cn(Jt)},getTimescaleMarks:(on,Oe,rn,cn)=>cn([]),subscribeBars:(on,Oe,rn,cn)=>{const _t=on.ticker||on.name,Yn=YP[Oe]||"1m";if(Nt[cn]=rn,pt=Yn,je==="lighter"){nr(cn);const yn=Pj[pt]||60,Dt=Math.max(2e3,Math.min(15e3,Math.floor(yn*1e3/3)));let sn=0;const Tn=async()=>{try{const Kn=Math.floor(Date.now()/1e3),ir=Kn-yn*500,rr=await bn(Ie,pt,ir,Kn);if(!Array.isArray(rr)||!rr.length)return;const Jt=rr[rr.length-1];if(!Number.isFinite(Jt.time))return;if(Jt.time>sn){sn=Jt.time;const Un=Nt[cn];Un&&Un(Jt)}}catch{}};Tn(),mn[cn]=setInterval(Tn,Dt);return}if(je==="extended"){if(gb(_t))return;const yn=Ve(_t);if(!yn)return;const Dt=Mt(Yn);if(an=`${nfn}/stream.extended.exchange/v1/candles/${encodeURIComponent(yn)}/trades?interval=${encodeURIComponent(Dt)}`,ft){try{ft.close()}catch{}ft=null}xn();return}if(je==="hyperliquid")if(gb(_t)){const yn=String(_t).split("/"),Dt=yn[0],sn=yn[1];un(Dt,sn,Yn)}else{if(It={type:"candle",coin:_t,interval:Yn},ot){try{ot.close()}catch{}ot=null}kt()}},unsubscribeBars:on=>{delete Nt[on],nr(on)},cleanup:()=>{try{ot&&ot.close()}catch{}try{ft&&ft.close()}catch{}try{ct&&ct.close()}catch{}try{Vt&&Vt.close()}catch{}wn(),en="",Bt=[],Et=null,et=null,Be=null,an=null}}}const he=ae(s||null,Ae=>{te=Ae},o,l,c,u,o==="extended"?d:null);g.current=he;let Ce=null;if(typeof window<"u"){const Ae=window.localStorage.getItem(eSe);if(Ae)try{Ce=tSe(JSON.parse(Ae))}catch{}}const ce={container:f.current.id,library_path:r,datafeed:he,autosize:!0,theme:"dark",locale:"en",timezone:re,loading_screen:{backgroundColor:"#101010"},enabled_features:["timeframes_toolbar","two_character_bar_marks_labels"],disabled_features:["header_symbol_search","symbol_search_hot_key","header_interval_dialog_button","header_settings","header_fullscreen_button","header_compare","header_undo_redo"],auto_save_delay:5,custom_formatters:{price:Ae=>Number(Ae).toLocaleString("en-US",{minimumFractionDigits:te,maximumFractionDigits:te})},custom_css_url:"/tv-custom.css",overrides:{"paneProperties.background":"#101010","paneProperties.backgroundGradientStartColor":"#101010","paneProperties.backgroundGradientEndColor":"#101010","paneProperties.vertGridProperties.color":"#202020","paneProperties.horzGridProperties.color":"#202020","scalesProperties.textColor":"#dcdada","scalesProperties.abbreviateLabel":!1,"mainSeriesProperties.candleStyle.upColor":"#67FFBD","mainSeriesProperties.candleStyle.downColor":"#FF7272","mainSeriesProperties.candleStyle.borderUpColor":"#67FFBD","mainSeriesProperties.candleStyle.borderDownColor":"#FF7272","mainSeriesProperties.candleStyle.wickUpColor":"#67FFBD","mainSeriesProperties.candleStyle.wickDownColor":"#FF7272","timeScale.rightOffset":100,"scalesProperties.allowSymbolChange":!0,"scalesProperties.backgroundColor":"#101010","scalesProperties.showLeftScale":!1,"scalesProperties.showRightScale":!0,"scalesProperties.vertTouchDrag":!0,"scalesProperties.vertScrollZoom":!0}};Ce?ce.saved_data=Ce:(ce.symbol=e,ce.interval=ie);const ge=new window.TradingView.widget(ce);x.current=ge,ge.onChartReady(()=>{const Ae=ge.activeChart(),ye=()=>{var Ie;try{(Ie=Ae.autoScaleAllSeries)==null||Ie.call(Ae)}catch{}},je=()=>{!ge||!ge.save||typeof window>"u"||ge.save(Ie=>{try{const Re=tSe(Ie||{});window.localStorage.setItem(eSe,JSON.stringify(Re||{}))}catch{}})};if(!Ce)try{const Ie=Math.floor(Date.now()/1e3);Ae.setVisibleRange({from:Ie-30*24*3600,to:Ie},{percentRightMargin:.2}),ye()}catch{}try{Ae.setEntityMarksVisible(!0)}catch{}Ae.onIntervalChanged().subscribe(null,Ie=>{try{const Re=YP[Ie]||Ie||ie;Re&&typeof window<"u"&&window.localStorage.setItem("tranding_chart_interval_time",Re)}catch{}try{Ae.requestMarksRefresh()}catch{}je()}),ge.subscribe("onAutoSaveNeeded",()=>{je()}),je(),C(!0)})})(),()=>{G=!1;const V=x.current,te=g.current;try{const ae=V&&V.activeChart&&V.activeChart();ae&&(QP(v.current,V,ae),v.current.clear(),QP(U.current,V,ae),U.current.clear())}catch{}try{te&&te.cleanup&&te.cleanup()}catch{}try{V&&V.remove&&V.remove()}catch{}x.current=null,g.current=null,C(!1)}},[r,o,l,c,e,t,s]),m.useEffect(()=>{if(!g.current)return;g.current.setWallet(s||null);const G=x.current;if(!G||!w)return;const V=G.activeChart&&G.activeChart();if(V)try{V.requestMarksRefresh&&V.requestMarksRefresh()}catch{}},[s,w]),m.useEffect(()=>{g.current&&typeof g.current.setExtendedApiKey=="function"&&g.current.setExtendedApiKey(o==="extended"&&d||null)},[d,o]),m.useEffect(()=>{if(!g.current||o!=="extended")return;const G=g.current.setExtendedFallbackPrice;typeof G=="function"&&G(u)},[u,o]),m.useEffect(()=>{if(!w||o!=="hyperliquid"&&o!=="extended")return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V||!V.createMultipointShape)return;const te=v.current;QP(te,G,V),te.clear();const ae=Array.isArray(X)?X:[];if(!ae.length)return;const he=V.getVisibleRange&&V.getVisibleRange(),Ce=Math.floor(Date.now()/1e3),ce=he&&he.to||Ce,ge=new Map;for(const Ae of ae){const ye=wue(Ae);if(!Number.isFinite(ye)||ye<=0)continue;const je=Ae.sideRaw==="S"?"S":"B",Ie=/take\s*profit/i.test(String(Ae.type||"")),Re=/stop/i.test(String(Ae.type||"")),$e=`${ye}|${je}|${Ie?"TP":Re?"SL":"L"}`,it=AHe(Ae);if(!ge.has($e))ge.set($e,{base:Ae,px:ye,sz:it});else{const tt=ge.get($e);tt.sz+=it}}ge.forEach(({base:Ae,px:ye,sz:je})=>{const Ie=Afn(Ae),Re={...Ae,sz:je},Qe=Nfn(Re,e),$e={time:ce,price:ye};try{const it=V.createMultipointShape([$e],{shape:"horizontal_line",text:Qe,lock:!0,disableSelection:!0,disableSave:!0,overrides:{linecolor:Ie.br,linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0,showLabel:!0,textcolor:Ie.txt,fillBackground:!0,backgroundColor:Ie.bg,bold:!1,fontsize:11}}),tt=jfn(Re,e);v.current.set(tt,it)}catch{}})},[X,w,e,o]),m.useEffect(()=>{if(!w||X.length>0)return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V)return;let te=null;try{const ge=V.getPanes&&V.getPanes();if(Array.isArray(ge)&&ge[0]){const Ae=ge[0].getRightPriceScales&&ge[0].getRightPriceScales();Array.isArray(Ae)&&Ae[0]?te=Ae[0]:ge[0].getMainSourcePriceScale&&(te=ge[0].getMainSourcePriceScale())}}catch{}const ae=U.current;if(QP(ae,G,V),ae.clear(),!Array.isArray(a)){try{te&&te.setAutoScale(!0)}catch{}return}const he=V.getVisibleRange&&V.getVisibleRange(),Ce=Math.floor(Date.now()/1e3),ce=he&&he.to||Ce;if(a.forEach((ge,Ae)=>{const ye=Number(typeof ge=="number"?ge:ge&&ge.price);if(!Number.isFinite(ye)||ye<=0)return;const je=typeof ge=="object"&&ge?ge.side:null,Ie=je==="buy"?"#1EC98A":je==="sell"?"#FF5C7A":"#444CFF";try{const Re=V.createMultipointShape([{time:ce,price:ye}],{shape:"horizontal_line",lock:!0,disableSelection:!0,disableSave:!0,text:"",overrides:{linecolor:Ie,linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0,showLabel:!1,fillBackground:!1}});ae.set(`grid-${e}-${Ae}-${ye}`,Re)}catch{}}),te)try{te.setAutoScale(!0)}catch{}},[a,w,e,X.length]);const oe=n||`tv_${e}_container`;return i.jsx("div",{id:oe,ref:f,className:"relative h-full min-h-[320px] w-full bg-[#101010]"})}const _fn=({headerData:e,setIsDigits:t,markets:n=[],coin:r="",onCoinChange:s=()=>{},marketsLoading:a=!1})=>{const o=(e==null?void 0:e.source)==="extended",l=(e==null?void 0:e.nextFundingTime)??(e==null?void 0:e.nextFundingRate),[c,u]=m.useState(jX(l)),[d,f]=m.useState((e==null?void 0:e.markPx)||0),[x,g]=m.useState("text-white"),v=m.useRef((e==null?void 0:e.markPx)||0);m.useEffect(()=>{var ne;if((e==null?void 0:e.markPx)!=null){const J=((ne=e.markPx.toString().split(".")[1])==null?void 0:ne.length)||0;t(J)}},[e==null?void 0:e.markPx,t]),m.useEffect(()=>{u(jX(l));const ne=setInterval(()=>u(jX(l)),1e3);return()=>clearInterval(ne)},[l]),m.useEffect(()=>{if((e==null?void 0:e.markPx)==null)return;const ne=e.markPx,J=v.current;ne>J?g("text-[#1DE6A3]"):ne<J&&g("text-[#FF7173]"),f(ne);const X=setTimeout(()=>g("text-white"),700);return v.current=ne,()=>clearTimeout(X)},[e==null?void 0:e.markPx]);const w=(e==null?void 0:e.markPx)!=null&&(e==null?void 0:e.prevDayPx)!=null?e.markPx-e.prevDayPx:null,C=w!=null?w/e.prevDayPx*100:null,N=C!=null?C>=0?"text-[#1DE6A3]":"text-[#FF7173]":"text-white",I=ne=>{const J=Number(ne);if(!Number.isFinite(J))return null;const X=Math.abs(J);let re=1;return X>=1e3?re=1:X>=100?re=2:X>=1?re=3:X>=.1?re=4:re=6,J.toLocaleString(void 0,{maximumFractionDigits:re})},P=ne=>ne==null||isNaN(ne)?null:ne>=1e3?Vw(ne):ne,R=ne=>{const J=Number(ne);if(!Number.isFinite(J))return null;const X=Math.abs(J),re=J>=0?"+":"-";if(!o)return`${re}${X.toFixed(5)}`;let pe=0;X<.1?pe=6:X<1?pe=4:X<10?pe=2:X<100&&(pe=1);const Y=X.toFixed(pe),ie=pe>0?Y.replace(/\.?0+$/,""):Y;return`${re}${ie}`},F=w!=null?R(w):null,U=d!=null?o?I(d):P(d):null,L=(e==null?void 0:e.dayNtlVlm)!=null?`$${Vw(Number(e.dayNtlVlm))}`:null,z=(e==null?void 0:e.oraclePx)!=null&&(e==null?void 0:e.openInterest)!=null?`$${Vw(Number(e.oraclePx*e.openInterest))}`:null,Q=(e==null?void 0:e.funding)!=null?`${(e.funding*100).toFixed(4)}%`:null;return i.jsxs("div",{className:"flex items-center w-full gap-2",children:[i.jsx("div",{className:"flex-none",children:i.jsx(gue,{markets:n,value:r,onChange:s,loading:a,showIcon:!0})}),i.jsx("div",{className:"flex-1 overflow-x-auto whitespace-nowrap [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:i.jsxs("div",{className:"flex items-center px-1",children:[i.jsx(X7,{label:"Mid Price",value:U,tone:x}),i.jsx(X7,{label:"24h Change",value:F,sub:C!=null?`${C>=0?"+":"-"}${Math.abs(C).toFixed(2)}%`:null,tone:N}),i.jsx(X7,{label:"Vol 24h",value:L}),i.jsx(X7,{label:"Open Interest",value:z}),i.jsx(X7,{label:"Funding",value:Q,sub:e!=null&&e.funding?c:null,tone:"text-[#50D2C1]"})]})})]})};function jX(e){const t=new Date,n=t.getTime(),r=Number(e);if(Number.isFinite(r)&&r>n){const d=Math.max(0,Math.floor((r-n)/1e3)),f=String(Math.floor(d/3600)).padStart(2,"0"),x=String(Math.floor(d%3600/60)).padStart(2,"0"),g=String(d%60).padStart(2,"0");return`${f}:${x}:${g}`}t.setSeconds(t.getSeconds()+1);const s=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()),a=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()+1,0,0,0),o=Math.floor((a-s)/1e3),l=String(Math.floor(o/3600)).padStart(2,"0"),c=String(Math.floor(o%3600/60)).padStart(2,"0"),u=String(o%60).padStart(2,"0");return`${l}:${c}:${u}`}const X7=({label:e,value:t,sub:n=null,tone:r="text-white"})=>i.jsxs("div",{className:"shrink-0 inline-flex items-baseline gap-1 pr-3 mr-3 border-r border-white/5 last:mr-0 last:pr-0 last:border-r-0",children:[i.jsx("span",{className:"text-[11px] leading-none text-[#909090]",children:e}),i.jsx("span",{className:`text-xs leading-none font-semibold font-inter tabular-nums ${r}`,children:t??i.jsx(kfn,{w:"90px"})}),n!=null&&i.jsx("span",{className:`text-[11px] leading-none ${r}`,children:n})]}),kfn=({w:e="90px"})=>i.jsx("span",{className:"inline-block align-middle h-[12px] rounded skeleton-ticker-text short",style:{width:e}}),Tfn=({coin:e,data:t,loading:n,period:r,periods:s,handlePeriodChange:a})=>i.jsx("div",{className:"flex justify-start items-start p-4 w-full",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-4 w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[12px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-0.5 xl:gap-2 w-full",children:[i.jsx("div",{className:"text-[#dcdada] text-[11px] xl:text-sm font-semibold font-inter leading-4 tracking-wider uppercase",children:"Positioning"}),n&&i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[32px] xl:w-[54px] px-0.5 xl:px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]})]}),i.jsx("div",{className:"flex xl:hidden",children:i.jsx(kce,{periods:s,selectedPeriod:r,handlePeriod:a,borderColor:"ticker"})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#333333] rounded-lg p-1.5",children:[i.jsx(Fp,{name:"Total Positions",info:t!=null&&t.total_notional?`$${ed(t==null?void 0:t.total_notional)}`:"--",color:1}),i.jsx(Fp,{name:"Traders",info:t!=null&&t.total_traders?`${ed(t==null?void 0:t.total_traders)}`:"--",color:1,info_1:"true"}),i.jsx(Fne,{data_1:t!=null&&t.long_percentage?t==null?void 0:t.long_percentage:0,data_2:t!=null&&t.long_percentage?parseFloat(100-(t==null?void 0:t.long_percentage)).toFixed(2):0,margin:"true"})]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[12px] w-full",children:[i.jsx("div",{className:"text-[#dcdada] text-[11px] xl:text-sm font-semibold font-inter leading-4 tracking-wider uppercase",children:"Breakdown"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#333333] rounded-lg p-1.5",children:[i.jsx(Fp,{name:"Long",info:t!=null&&t.long_qty?`${Cr(t==null?void 0:t.long_qty)} ${e}`:"--",color:2}),i.jsx(Fp,{name:"Total",info:t!=null&&t.total_qty?`${Cr(t==null?void 0:t.total_qty)} ${e}`:"--",color:1}),i.jsx(Fp,{name:"Short",info:t!=null&&t.short_qty?`${Cr(t==null?void 0:t.short_qty)} ${e}`:"--",color:3,info_1:"true"}),i.jsx(Fne,{data_1:t!=null&&t.long_pct?t==null?void 0:t.long_pct:0,data_2:t!=null&&t.short_pct?t==null?void 0:t.short_pct:0})]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[12px] w-full",children:[i.jsx("div",{className:"text-[#dcdada] text-[11px] xl:text-sm font-semibold font-inter leading-4 tracking-wider uppercase",children:"Position Stats"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#67FFBD] rounded-lg p-3",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 pb-2.5",children:[i.jsx("div",{className:"text-[#67FFBD] text-[10px] font-semibold font-inter leading-[10px] tracking-wide uppercase",children:"Long"}),i.jsx("img",{src:xJ,alt:""})]}),i.jsx(Fp,{name:"Total Notional",info:t!=null&&t.total_long_notional?`$${ed(t==null?void 0:t.total_long_notional)}`:"--",color:1}),i.jsx(Fp,{name:"Avg Entry",info:t!=null&&t.avg_long_entry?`$${Cr(t==null?void 0:t.avg_long_entry)}`:"--",color:1}),i.jsx(Fp,{name:"Total PnL",info:t!=null&&t.total_long_pnl?`$${ed(Math.abs(t==null?void 0:t.total_long_pnl))}`:"--",color:(t==null?void 0:t.total_long_pnl)==null||isNaN(parseFloat(t==null?void 0:t.total_long_pnl))||(t==null?void 0:t.total_long_pnl)==0?1:(t==null?void 0:t.total_long_pnl)>0?2:3,info_1:"true"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full mt-3",children:[i.jsx(rSe,{data_1:t!=null&&t.long_profit_ratio?t==null?void 0:t.long_profit_ratio:0,color:"Long"}),i.jsxs("div",{className:"text-[#7b7b7b] text-[11px] font-normal font-['Inter'] leading-none min-w-max flex justify-start items-center",children:[t!=null&&t.long_profit_ratio?t==null?void 0:t.long_profit_ratio:"--","% in profit"]})]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#FF797C] rounded-lg p-3",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 pb-2.5",children:[i.jsx("div",{className:"text-[#FF797C] text-[10px] font-semibold font-inter leading-[10px] tracking-wide uppercase",children:"Short"}),i.jsx("img",{src:gJ,alt:""})]}),i.jsx(Fp,{name:"Total Notional",info:t!=null&&t.total_short_notional?`$${ed(t==null?void 0:t.total_short_notional)}`:"--",color:1}),i.jsx(Fp,{name:"Avg Entry",info:t!=null&&t.avg_short_entry?`$${Cr(t==null?void 0:t.avg_short_entry)}`:"--",color:1}),i.jsx(Fp,{name:"Total PnL",info:t!=null&&t.total_short_pnl?`$${ed(Math.abs(t==null?void 0:t.total_short_pnl))}`:"--",info_1:"true",color:(t==null?void 0:t.total_short_pnl)==null||isNaN(parseFloat(t==null?void 0:t.total_short_pnl))||(t==null?void 0:t.total_short_pnl)==0?1:(t==null?void 0:t.total_short_pnl)>0?2:3}),i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full mt-3",children:[i.jsx(rSe,{data_1:t!=null&&t.short_profit_ratio?t==null?void 0:t.short_profit_ratio:0,color:"Short"}),i.jsxs("div",{className:"text-[#7b7b7b] text-[11px] font-normal font-['Inter'] leading-none min-w-max flex justify-start items-center",children:[t!=null&&t.short_profit_ratio?t==null?void 0:t.short_profit_ratio:"--","% in profit"]})]})]})]})]})}),Fp=({name:e,info:t,info_1:n,color:r})=>i.jsxs("div",{className:"flex flex-col items-start w-full gap-1.5",children:[i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("div",{className:"text-[#b0b0b0] text-xs font-semibold font-inter leading-none",children:e}),i.jsx("div",{className:`${r==1?"bg-[#313137] text-white":r==2?"bg-[#1de6a3]/20 text-[#67ffbd]":r==3?"bg-[#ff797c]/20 text-[#ff787b]":""} h-6 p-2 rounded-[256px] justify-start items-center gap-2 inline-flex`,children:i.jsx("div",{className:"text-[11px] font-semibold font-inter leading-none",children:t})})]}),i.jsx("div",{className:`${n==="true"?"hidden":""} w-full h-px bg-[#282d33]`})]}),rSe=({data_1:e,color:t})=>i.jsx("div",{className:"h-1 w-full bg-[#333333] rounded-[256px] flex gap-[2px] overflow-hidden",children:i.jsx("div",{style:e?isNaN(e)?{width:"0%"}:{width:`${e}%`}:{width:"0%"},className:`${t=="Long"?"bg-[#67FFBD]":t=="Short"?"bg-[#FF797C]":"bg-[#67FFBD]"} flex justify-center items-center h-1 rounded-[256px] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]`})}),Ifn="wss://api.hyperliquid.xyz/ws",Pfn="https://api.hyperliquid.xyz/info",QL=e=>e==null?0:Number(e),ZL=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),Ffn=(e,t)=>{if(isNaN(e))return"--";const n=Number(t);let r=0;return n>0&&n<1&&(r=Math.min(8,Math.max(0,-Math.floor(Math.log10(n))))),e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:r})},Ofn=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},jHe={BTC:{1:{value:1,nSigFigs:null,mantissa:null},10:{value:2,nSigFigs:5,mantissa:null},20:{value:5,nSigFigs:5,mantissa:2},50:{value:10,nSigFigs:5,mantissa:5},100:{value:100,nSigFigs:3,mantissa:null},1e3:{value:1e3,nSigFigs:2,mantissa:null}},ETH:{.1:{value:.1,nSigFigs:null,mantissa:null},.2:{value:.2,nSigFigs:5,mantissa:2},.5:{value:.5,nSigFigs:5,mantissa:5},1:{value:1,nSigFigs:4,mantissa:null},10:{value:10,nSigFigs:3,mantissa:null},100:{value:100,nSigFigs:2,mantissa:null}}},Mfn=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=jHe[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null},Rfn=(e,t)=>{if(!e)return null;const n=String(e).toUpperCase(),r=jHe[n];if(!r)return null;const s=Number(t)||0;return Object.values(r).find(l=>l.value===s)||null};function sSe(e,t,n){const r=new Map;for(const s of e||[]){const a=QL(s.px),o=QL(s.sz);if(!a||!o||!t)continue;const l=n==="bid"?Math.floor(a/t)*t:Math.ceil(a/t)*t,c=Number(l.toFixed(12));r.set(c,(r.get(c)||0)+o)}return[...r.entries()].map(([s,a])=>({price:s,size:a}))}async function Lfn(e){var o;const n=await fetch(Pfn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"l2Book",coin:e})});if(!n.ok)throw new Error("info request failed");const r=await n.json(),s=(r==null?void 0:r.levels)||((o=r==null?void 0:r.data)==null?void 0:o.levels),a=Array.isArray(s==null?void 0:s[0])&&s[0]||(s==null?void 0:s.bs)||(s==null?void 0:s.bids)||[];if(!Array.isArray(a)||!a.length)throw new Error("orderbook empty or bad format");return a}function Dfn(e){const t=e.slice(0,10).map(o=>Number(o.px??(Array.isArray(o)?o[0]:void 0))).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o<t.length-1;o++){const l=t[o]-t[o+1];l>0&&n.push(l)}if(!n.length)return 0;const s=Math.min(...n).toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),a=Number(s);return Number.isFinite(a)?a:0}function Bfn(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function $fn(e,t){if(!e||e<=0)return[];const n=Math.floor(Math.log10(e)),r=[];t>0&&r.push(t);const s=n-4,a=Math.pow(10,s);[1,2,5].forEach(g=>r.push(g*a));const o=n-3;r.push(Math.pow(10,o));const l=n-2;r.push(Math.pow(10,l));const c=n-1;r.push(Math.pow(10,c));const u=r.filter(g=>g>0&&Number.isFinite(g)).map(Bfn),d=Array.from(new Set(u)).sort((g,v)=>g-v),f=t>0?t:0;return d.filter(g=>g>=f&&g>0)}function iSe(e){const n=(e||"").toUpperCase()==="BTC"?[1,10,20,50,100,1e3,1e4]:[.001,.01,.1,10,100];return Array.from(new Set(n)).sort((r,s)=>r-s)}async function Ufn(e){if(!e)return[];const t=String(e).trim(),n=Mfn(t);if(n&&n.length)return n;const r=t.toUpperCase();try{const s=await Lfn(t),a=s[0],o=Number((a==null?void 0:a.px)??(Array.isArray(a)?a[0]:void 0));if(!Number.isFinite(o)||o<=0)throw new Error("bad bestBid");const l=Dfn(s);let c=$fn(o,l);return r!=="BTC"?c=c.filter(u=>u!==1):c.includes(1)||c.push(1),c=Array.from(new Set(c.filter(u=>Number.isFinite(u)&&u>0))).sort((u,d)=>u-d),c.length?c:iSe(t)}catch(s){return console.error("getUiStepsForCoin error",t,s),iSe(t)}}function zfn(e,t){const n=Rfn(t,e);if(n)return{nSigFigs:n.nSigFigs,mantissa:n.mantissa};const r=Number(e)||0;let s=null;r>=1e4?s=2:r>=1e3?s=3:r>=100?s=4:r>=10&&(s=5);let a;if(s===5&&r>=10){const o=Math.pow(10,Math.floor(Math.log10(r))),l=Math.floor(r/o);l<2?a=1:l<5?a=2:a=5}return{nSigFigs:s,mantissa:a}}function Hfn(e,t){return!e&&!t?!0:!e||!t?!1:e.type===t.type&&e.coin===t.coin&&(e.nSigFigs??null)===(t.nSigFigs??null)&&(e.mantissa??null)===(t.mantissa??null)}function Vfn({coin:e,rows:t=10,onSelectPrice:n,onBest:r}){const s=m.useRef(null),a=m.useRef([]),o=m.useRef(null),l=m.useRef(0),c=m.useRef(null),u=m.useRef(null),[d,f]=m.useState({bids:[],asks:[]}),[x,g]=m.useState("COIN"),[v,w]=m.useState(null),[C,N]=m.useState([]),I=(G,V)=>x==="USD"?G*V:G,P=x==="USD"?"USD":e,R=G=>{const V=s.current;V&&V.readyState===WebSocket.OPEN?V.send(JSON.stringify(G)):(a.current.push(G),F())},F=()=>{const G=s.current;if(G&&(G.readyState===WebSocket.OPEN||G.readyState===WebSocket.CONNECTING)||o.current)return;const V=new WebSocket(Ifn);s.current=V,V.onopen=()=>{l.current=0,a.current.splice(0,a.current.length).forEach(ae=>V.send(JSON.stringify(ae)))},V.onmessage=te=>{var Re;const ae=JSON.parse(te.data||"{}");if((ae==null?void 0:ae.channel)!=="l2Book")return;const he=(ae==null?void 0:ae.data)??ae,Ce=(he==null?void 0:he.coin)??(ae==null?void 0:ae.coin);if(!Ce||Ce!==c.current)return;const ce=(he==null?void 0:he.levels)??((Re=he==null?void 0:he.data)==null?void 0:Re.levels)??(ae==null?void 0:ae.levels);let ge,Ae;if(Array.isArray(ce))ge=ce[0]||[],Ae=ce[1]||[];else if(ce)ge=ce.bs||ce.bids||[],Ae=ce.as||ce.asks||[];else return;const ye=Qe=>(Qe||[]).map($e=>{const it=Number(Array.isArray($e)?$e[0]:$e.px),tt=Number(Array.isArray($e)?$e[1]:$e.sz);return{px:it,sz:tt}}).filter($e=>Number.isFinite($e.px)&&$e.px>0&&Number.isFinite($e.sz)&&$e.sz>0),je=ye(ge),Ie=ye(Ae);f({bids:je,asks:Ie})},V.onclose=()=>{l.current=Math.min(l.current+1,6),o.current=setTimeout(()=>{o.current=null,F()},500*Math.pow(2,l.current))},V.onerror=()=>{try{V.close()}catch{}}},U=G=>{G&&(Hfn(u.current,G)||(u.current&&R({method:"unsubscribe",subscription:u.current}),u.current=G,R({method:"subscribe",subscription:G})))},L=()=>{f({bids:[],asks:[]})};m.useEffect(()=>{let G=!1;try{s.current&&s.current.readyState<=1&&(s.current.onmessage=null,s.current.onopen=null,s.current.onclose=null,s.current.onerror=null,s.current.close())}catch{}if(s.current=null,u.current=null,a.current=[],l.current=0,o.current=null,L(),N([]),w(null),c.current=e||null,!!e)return F(),(async()=>{const V=await Ufn(e);G||(N(V),w(V[0]??null))})(),()=>{G=!0}},[e]),m.useEffect(()=>{if(!e)return;const G=v||1,{nSigFigs:V,mantissa:te}=zfn(G,e),ae={type:"l2Book",coin:e};V!=null&&(ae.nSigFigs=V),te!=null&&(ae.mantissa=te),U(ae)},[e,v]);const z=m.useMemo(()=>(d.bids||[]).map(G=>QL(G.px)).filter(G=>Number.isFinite(G)&&G>0),[d]),Q=m.useMemo(()=>(d.asks||[]).map(G=>QL(G.px)).filter(G=>Number.isFinite(G)&&G>0),[d]),ne=z.length?Math.max(...z):null,J=Q.length?Math.min(...Q):null;m.useEffect(()=>{ne!=null&&J!=null&&(r==null||r({bestBid:ne,bestAsk:J,mid:(ne+J)/2}))},[ne,J,r]);const X=m.useMemo(()=>{const G=Number(v)||1,V=sSe(d.bids,G,"bid").sort((ae,he)=>he.price-ae.price),te=sSe(d.asks,G,"ask").sort((ae,he)=>ae.price-he.price);return{bids:V,asksAsc:te}},[d,v]),re=m.useMemo(()=>{const G=X.asksAsc.slice(0,t);let V=0;return G.map(ae=>(V+=I(ae.size,ae.price),{...ae,total:V})).reverse()},[X,t,x]),pe=m.useMemo(()=>{const G=X.bids.slice(0,t);let V=0;return G.map(te=>(V+=I(te.size,te.price),{...te,total:V}))},[X,t,x]),Y=m.useMemo(()=>{if(ne==null||J==null)return null;const G=Math.abs(J-ne),V=(J+ne)/2;return{diff:G,pct:V?G/V*100:0}},[ne,J]),ie=Math.max(re.reduce((G,V)=>Math.max(G,V.total||0),0),1e-9),oe=Math.max(pe.reduce((G,V)=>Math.max(G,V.total||0),0),1e-9);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold font-inter",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-[#292929]",children:[i.jsx(oSe,{value:String(v??""),onChange:G=>w(Number(G)),items:(C||[]).map(G=>({key:String(G),label:Ofn(G)}))}),i.jsx(oSe,{value:x,onChange:g,items:[{key:"USD",label:"USD"},{key:"COIN",label:e}],align:"right"})]}),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] w-full",children:[i.jsx("span",{className:"uppercase",children:"Price"}),i.jsxs("span",{className:"uppercase text-center",children:["Size (",P,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",P,")"]})]}),i.jsx("div",{className:"flex-1 overflow-hidden w-full",children:i.jsxs("div",{className:"overflow-auto w-full",children:[re.map((G,V)=>i.jsx(aSe,{side:"ask",step:Number(v)||1,price:G.price,size:G.size!=null?I(G.size,G.price):null,total:G.total,widthPct:G.total?Math.min(100,G.total/ie*100):0,onClick:()=>G.price!=null&&(n==null?void 0:n(G.price)),unit:x},`ask-${V}`)),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] border-y border-[#292929] my-1 w-full",children:[i.jsx("span",{className:"uppercase",children:"Spread"}),i.jsx("span",{className:"text-right",children:Y?ZL(Y.diff,4):"--"}),i.jsx("span",{className:"text-right",children:Y?`${ZL(Y.pct,4)}%`:"--"})]}),pe.map((G,V)=>i.jsx(aSe,{side:"bid",step:Number(v)||1,price:G.price,size:G.size!=null?I(G.size,G.price):null,total:G.total,widthPct:G.total?Math.min(100,G.total/oe*100):0,onClick:()=>G.price!=null&&(n==null?void 0:n(G.price)),unit:x},`bid-${V}`))]})})]})}function aSe({side:e,price:t,size:n,total:r,widthPct:s,onClick:a,step:o,unit:l}){const c=t==null,u=e==="bid"?"from-transparent to-[#67ffbd]/30":"from-transparent to-[#FF7272]/30",d=e==="bid"?"text-[#67FFBD]":"text-[#FF797C]",f=l==="USD";return i.jsxs("div",{className:"relative w-full font-semibold",children:[!c&&i.jsx("div",{className:`absolute left-0 top-px bottom-px bg-gradient-to-r ${u} transition-all duration-300 ease-[cubic-bezier(0.42,0,0.58,1)]`,style:{width:`${Math.max(0,s-2)}%`}}),i.jsxs("div",{className:`grid grid-cols-[84px_1fr_1fr] px-3 py-1 text-xs relative w-full ${c?"":"cursor-pointer"}`,onClick:c?void 0:a,children:[i.jsx("span",{className:`${c?"text-[#555]":d} hover:text-white`,children:c?"—":Ffn(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":ZL(n,f?0:6)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":ZL(r,f?0:6)})]})]})}function oSe({value:e,onChange:t,items:n,align:r="left"}){var l,c;const[s,a]=m.useState(!1),o=m.useRef(null);return m.useEffect(()=>{if(!s)return;const u=d=>{o.current&&(o.current.contains(d.target)||a(!1))};return window.addEventListener("mousedown",u),window.addEventListener("touchstart",u),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("touchstart",u)}},[s]),i.jsxs("div",{className:"relative",ref:o,children:[i.jsxs("button",{className:"h-7 px-2 text-xs rounded-md border border-[#292929] bg-[#101010] text-[#dcdada] flex items-center gap-1",onClick:()=>a(u=>!u),children:[((l=n.find(u=>u.key===e))==null?void 0:l.label)??((c=n.find(u=>String(u.key)===String(e)))==null?void 0:c.label)??e,i.jsx("span",{className:"text-[#8b8b8b]",children:"▾"})]}),s&&i.jsx("div",{className:`absolute z-10 mt-1 min-w-[80px] rounded-md border border-[#292929] bg-[#101010] p-1 ${r==="right"?"right-0":"left-0"}`,children:n.map(u=>i.jsx("div",{className:`px-2 py-1 text-xs rounded cursor-pointer ${String(u.key)===String(e)?"bg-[#262626] text-white":"text-[#dcdada] hover:bg-[#262626]"}`,onClick:()=>{t(u.key),a(!1)},children:u.label},u.key))})]})}const Wfn="wss://api.hyperliquid.xyz/ws",qfn=e=>`https://app.hyperliquid.xyz/explorer/tx/${e}`,lSe=e=>e==null?0:Number(e),Gfn=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),Kfn=e=>isNaN(e)?"--":e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:4}),Yfn=e=>new Date(e).toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});function Xfn({coin:e,maxRows:t=300}){const n=m.useRef(null),r=m.useRef(null),s=m.useRef([]),a=m.useRef(null),[o,l]=m.useState([]);m.useEffect(()=>{var g,v;const u=w=>({method:"subscribe",subscription:{type:"trades",coin:w}}),d=w=>({method:"unsubscribe",subscription:{type:"trades",coin:w}});if(!n.current)n.current=new WebSocket(Wfn),n.current.onopen=()=>{var w;(w=n.current)==null||w.send(JSON.stringify(u(e))),a.current=setInterval(()=>{var C;try{(C=n.current)==null||C.send(JSON.stringify({method:"ping"}))}catch{}},3e4)};else{if(r.current&&r.current!==e)try{(g=n.current)==null||g.send(JSON.stringify(d(r.current)))}catch{}try{(v=n.current)==null||v.send(JSON.stringify(u(e)))}catch{}}const f=w=>{const C=JSON.parse(w.data||"{}");if((C==null?void 0:C.channel)==="trades"&&(C!=null&&C.data)){const N=Array.isArray(C.data)?C.data:[C.data];s.current.push(...N)}};n.current.addEventListener("message",f);const x=setInterval(()=>{if(!s.current.length)return;const w=s.current.splice(0,s.current.length);l(C=>{const N=[...w,...C],I=[],P=new Set;for(const R of N){const F=R.tid??`${R.hash??""}-${R.time??""}`;if(!P.has(F)&&(P.add(F),I.push(R),I.length>=t))break}return I.sort((R,F)=>(F.time||0)-(R.time||0)),I})},150);return r.current=e,()=>{var w;(w=n.current)==null||w.removeEventListener("message",f),clearInterval(x)}},[e,t]),m.useEffect(()=>()=>{var u;a.current&&clearInterval(a.current);try{(u=n.current)==null||u.close()}catch{}},[]);const c=m.useMemo(()=>o,[o]);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold",children:[i.jsxs("div",{className:"grid grid-cols-[100px_1fr_90px_28px] px-3 py-2 text-[11px] text-[#9b9b9b]",children:[i.jsx("span",{className:"uppercase whitespace-nowrap",children:"PRICE"}),i.jsxs("span",{className:"uppercase text-center whitespace-nowrap",children:["SIZE (",String(e).toUpperCase(),")"]}),i.jsx("span",{className:"uppercase text-right whitespace-nowrap",children:"TIME"}),i.jsx("span",{})]}),i.jsx("div",{className:"flex-1 overflow-auto",children:c.map(u=>{const d=lSe(u.px),f=lSe(u.sz),v=String(u.side||"").toLowerCase().startsWith("b")?"text-[#67FFBD]":"text-[#FF797C]";return i.jsxs("div",{className:"grid grid-cols-[100px_1fr_90px_28px] px-3 py-1.5 text-xs items-center font-inter",children:[i.jsx("div",{className:v,children:Kfn(d)}),i.jsx("div",{className:"text-right text-[#dcdada]",children:Gfn(f)}),i.jsx("div",{className:"text-right text-[#a8a8a8]",children:u.time?Yfn(u.time):"--:--:--"}),i.jsx("div",{className:"flex justify-end",children:u.hash?i.jsx("a",{href:qfn(u.hash),target:"_blank",rel:"noreferrer",className:"text-white hover:text-white opacity-70 hover:opacity-100",children:i.jsx(det,{className:"w-4 h-4 shrink-0"})}):null})]},(u.tid??u.hash)+String(u.time))})})]})}function Qfn({coin:e,data:t,loading:n,period:r,periods:s,handlePeriodChange:a,onBookPrice:o,onBest:l,className:c=""}){const[u,d]=m.useState("orderbook"),[f,x]=m.useState("orderbook"),g=[{k:"orderbook",t:"Order Book"},{k:"trades",t:"Trades"}],v=N=>{x(u),d(N)},w=g.findIndex(N=>N.k===u)>g.findIndex(N=>N.k===f)?"right":"left",C={enter:N=>({x:N==="right"?24:-24,opacity:0}),center:{x:0,opacity:1},exit:N=>({x:N==="right"?-24:24,opacity:0})};return i.jsx("div",{className:`flex h-full min-h-0 flex-col gap-2 ${c}`,children:i.jsxs("div",{className:"bg-[#101010] flex-1 min-h-0 overflow-hidden relative rounded-[16px] pt-2",children:[i.jsx("div",{className:"relative flex w-full px-2 gap-2",children:g.map(N=>{const I=u===N.k;return i.jsxs("button",{onClick:()=>v(N.k),className:`relative flex-1 flex items-center justify-center py-[6px] cursor-pointer font-semibold text-xs rounded-[12px] bg-transparent ${I?"text-white":"text-[#a8a8a8] hover:text-white"}`,children:[I&&i.jsx(vo.span,{layoutId:"side-pill",className:"absolute inset-0 bg-[#262626] rounded-[12px]",transition:{type:"spring",stiffness:380,damping:30}}),i.jsx("span",{className:"relative z-10",children:N.t})]},N.k)})}),i.jsx("div",{className:"relative w-full h-[calc(100%-40px)] min-h-0",children:i.jsx(mT,{mode:"wait",custom:w,children:i.jsxs(vo.div,{custom:w,variants:C,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:320,damping:28},className:"absolute inset-0",children:[u==="position"&&i.jsx("div",{className:"h-full overflow-auto",children:i.jsx(Tfn,{coin:e,data:t,loading:n,period:r,periods:s,handlePeriodChange:a})}),u==="orderbook"&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(Vfn,{coin:e,rows:9,onSelectPrice:o,onBest:l})}),u==="trades"&&i.jsx("div",{className:"h-full overflow-auto",children:i.jsx(Xfn,{coin:e})})]},u)})})]})})}const EHe="#101010",To="#101010",Oa="#2b3640",Gi="#929292",Ri="#929292",Fg="#67FFBD",Fj="#FF7272",Zfn="https://dextrabothypev2.nftinit.io",Jfn=[{key:"market",label:"Market"},{key:"limit",label:"Limit"},{key:"twap",label:"Twap"}];function ehn({mode:e,onModeChange:t,className:n=""}){const r=m.useMemo(()=>Jfn,[]),s=m.useRef(null),a=m.useRef({}),[o,l]=m.useState({w:0,x:0}),c=()=>{const u=a.current[e],d=s.current;if(!u||!d)return;const f=u.getBoundingClientRect(),x=d.getBoundingClientRect();l({w:f.width,x:f.left-x.left})};return m.useEffect(()=>{c()},[e]),m.useEffect(()=>{const u=()=>c();return window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[e]),i.jsxs("div",{ref:s,className:`relative flex items-center justify-evenly gap-8 ${n}`,style:{borderBottom:`1px solid ${Oa}`},children:[r.map(u=>{const d=e===u.key;return i.jsx("button",{ref:f=>a.current[u.key]=f,onClick:()=>t(u.key),className:"relative font-semibold bg-transparent",style:{color:d?"#FFFFFF":Ri,opacity:d?1:.85,letterSpacing:"-0.01em"},children:u.label},u.key)}),i.jsx("div",{className:"absolute bottom-[-1px] left-0 h-[2px] rounded-full transition-all duration-200",style:{width:o.w,transform:`translateX(${o.x}px)`,background:"#67FFBD"}})]})}function b4({children:e,onClick:t}){return i.jsx("button",{onClick:t,className:"w-full px-[16px] py-[6px] bg-[#262626] grid place-items-center rounded-[8px] text-white font-semibold",style:{border:`1px solid ${Oa}`},children:e})}function bb({label:e,value:t,onChange:n,right:r,clearZeroOnFocus:s=!0,restoreZeroOnBlur:a=!0}){const o=r?Ne.cloneElement(r,{onClick:c=>{Number(t)===0&&n(""),typeof r.props.onClick=="function"&&r.props.onClick(c)}}):null,l=c=>{let u=c.target.value;if(u===""||u==="."){n(u);return}if(u.includes(".")){const[d,f=""]=u.split(".");u=f?`${d}.${f.slice(0,2)}`:d}n(u)};return i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"mb-1",style:{color:Ri},children:e}),i.jsxs("div",{className:"flex items-center gap-2 h-[30px] px-2 rounded-lg",style:{background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none font-inter text-white placeholder:text-gray-500",inputMode:"decimal",type:"number",value:t,onChange:l,onFocus:()=>{s&&String(t)!==""&&Number(t)===0&&n("")},onBlur:c=>{a&&(c.target.value===""||c.target.value===".")&&n("0")},placeholder:"0.00",style:{fontFeatureSettings:'"tnum"'}}),i.jsx("div",{className:"shrink-0",children:o})]})]})}function ZP({value:e,onChange:t,items:n}){var o;const[r,s]=m.useState(!1),a=((o=n.find(l=>l.key===e))==null?void 0:o.label)??e;return i.jsxs("div",{className:"relative",children:[i.jsxs("div",{onClick:()=>s(l=>!l),className:"h-[26px] px-2 rounded-md flex justify-center items-center cursor-pointer",style:{background:To,color:Gi},children:[a," ▾"]}),r&&i.jsx("div",{className:"absolute right-0 z-40 mt-1 min-w-[140px] rounded-md p-1",style:{background:To,border:`1px solid ${Oa}`},children:n.map(l=>i.jsx("div",{className:"px-2 py-1 rounded cursor-pointer",style:{background:l.key===e?"#26313b":"transparent",color:l.key===e?"#ffffff":Gi},onClick:()=>{t(l.key),s(!1)},children:l.label},l.key))})]})}function xv({k:e,v:t,strong:n=!1,link:r=!1}){return i.jsxs("div",{className:"flex items-center justify-between text-[#929292] font-inter text-[13px] font-normal leading-4 space-y-2",children:[i.jsx("span",{children:e}),i.jsx("span",{style:{color:Gi},children:t})]})}function cSe({children:e,onClick:t,className:n=""}){return i.jsx("button",{onClick:t,className:`flex justify-center items-center h-[30px] px-4 py-2 shrink-0 rounded-lg border border-[rgba(80,80,80,0.32)] text-white font-inter text-[13px] not-italic font-normal leading-[16px] bg-transparent ${n}`,children:e})}function cm({title:e,children:t}){return i.jsxs("div",{className:"w-[520px] max-w-[92vw]",style:{background:EHe,border:`1px solid ${Oa}`,borderRadius:16,padding:16},children:[e&&i.jsx("div",{className:"mb-3 text-sm font-semibold",style:{color:Gi},children:e}),t]})}function P0({children:e,onClick:t}){return i.jsx("button",{onClick:t,className:"w-full h-[38px] rounded-xl font-semibold text-sm",style:{background:Fg,color:"#0f151a"},children:e})}function EX({active:e,onClick:t,title:n,desc:r}){return i.jsxs("button",{onClick:t,className:"w-full text-left rounded-xl p-3 mb-2",style:{background:e?"rgba(103,255,189,0.12)":To,border:`1px solid ${e?"#67FFBD":Oa}`,color:Gi},children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:e?"#67FFBD":"#555"}}),i.jsx("div",{className:"font-semibold",children:n})]}),i.jsx("div",{className:"text-[12px] leading-5",style:{color:Ri},children:r})]})}function Jh({open:e,onClose:t,children:n}){const[r,s]=m.useState(!1),[a,o]=m.useState(!1);return m.useEffect(()=>{if(e)s(!0),requestAnimationFrame(()=>o(!0)),document.body.style.overflow="hidden";else{o(!1),document.body.style.overflow="";const l=setTimeout(()=>s(!1),200);return()=>clearTimeout(l)}},[e]),m.useEffect(()=>{const l=c=>{c.key==="Escape"&&t()};return e&&window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t]),r?Na.createPortal(i.jsx("div",{className:`fixed inset-0 z-[9999] flex items-center justify-center transition-opacity ${a?"opacity-100":"opacity-0"}`,style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(6px)"},onMouseDown:t,children:i.jsx("div",{className:`transform transition-all ${a?"translate-y-0 scale-100":"translate-y-2 scale-[0.98]"} relative`,onMouseDown:l=>l.stopPropagation(),children:n})}),document.body):null}function r0({onClick:e}){return i.jsx("button",{onClick:e,className:"w-full h-[36px] rounded-xl font-bold text-[12px] transition-opacity mb-2 flex items-center justify-center bg-[#67FFBD] text-black",children:"Connect"})}function rre(e=""){return e?`${e.slice(0,6)}...${e.slice(-4)}`:""}const _X="https://api.hyperliquid.xyz/info",thn="wss://api.hyperliquid.xyz/ws",kX={accountValue:0,withdrawable:0,totalNtlPos:0,totalRawUsd:0,totalMarginUsed:0,crossMaintenanceMarginUsed:0,unrealizedPnl:0,crossAccountValue:0};function gT(e){const[t,n]=m.useState(kX),[r,s]=m.useState([]),[a,o]=m.useState({}),[l,c]=m.useState({}),[u,d]=m.useState({}),[f,x]=m.useState(!1),g=m.useRef(null),v=m.useRef(null);m.useEffect(()=>{let I=!0;return n(kX),s([]),o({}),c({}),d({}),x(!1),e?((async()=>{try{const[P,R,F]=await Promise.all([fetch(_X,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:e})}),fetch(_X,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotClearinghouseState",user:e})}),fetch(_X,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotMeta"})})]);if(!I)return;const U=await P.json(),L=await R.json(),z=await F.json(),Q=(U==null?void 0:U.marginSummary)||{},ne=(U==null?void 0:U.crossMarginSummary)||{},J=Array.isArray(U==null?void 0:U.assetPositions)?U.assetPositions.reduce((oe,G)=>{var V;return oe+Number(((V=G==null?void 0:G.position)==null?void 0:V.unrealizedPnl)||0)},0):0,X={accountValue:Number((Q==null?void 0:Q.accountValue)||0),totalNtlPos:Number((Q==null?void 0:Q.totalNtlPos)||0),totalRawUsd:Number((Q==null?void 0:Q.totalRawUsd)||0),withdrawable:Number((U==null?void 0:U.withdrawable)||0),totalMarginUsed:Number((Q==null?void 0:Q.totalMarginUsed)||0),crossMaintenanceMarginUsed:Number((U==null?void 0:U.crossMaintenanceMarginUsed)||0),unrealizedPnl:J,crossAccountValue:Number((ne==null?void 0:ne.accountValue)||0)},re=Array.isArray(L==null?void 0:L.balances)?L.balances.map(oe=>({coin:String(oe.coin),total:Number(oe.total||0),hold:Number(oe.hold||0)})):[],pe={},Y={};if((Array.isArray(z==null?void 0:z.tokens)?z.tokens:[]).forEach(oe=>{const G=oe==null?void 0:oe.name;G&&(oe.tokenId&&(pe[G]=oe.tokenId),Y[G]={tokenId:oe.tokenId||null,evmContract:oe.evmContract||null})}),!I)return;n(X),s(re),o(pe),c(Y)}catch{if(!I)return;n(kX),s([]),o({}),c({})}finally{I&&x(!0)}})(),()=>{I=!1}):(I&&x(!0),()=>{I=!1})},[e]),m.useEffect(()=>{if(!e)return;const I=new WebSocket(thn);return g.current=I,I.onopen=()=>{[{method:"subscribe",subscription:{type:"user",user:e}},{method:"subscribe",subscription:{type:"webData2",user:e}}].forEach(P=>I.send(JSON.stringify(P))),v.current=setInterval(()=>{I.readyState===WebSocket.OPEN&&I.send(JSON.stringify({id:99,method:"ping"}))},3e4)},I.onmessage=P=>{var R,F,U,L,z,Q;try{const ne=JSON.parse(P.data);if((ne==null?void 0:ne.channel)==="webData2"&&((R=ne==null?void 0:ne.data)!=null&&R.clearinghouseState)){const X=ne.data.clearinghouseState,re=(X==null?void 0:X.marginSummary)||{},pe=(X==null?void 0:X.crossMarginSummary)||{},Y=Array.isArray(X==null?void 0:X.assetPositions)?X.assetPositions.reduce((ie,oe)=>{var G;return ie+Number(((G=oe==null?void 0:oe.position)==null?void 0:G.unrealizedPnl)||0)},0):0;n(ie=>({...ie,accountValue:Number((re==null?void 0:re.accountValue)||0),totalNtlPos:Number((re==null?void 0:re.totalNtlPos)||0),totalRawUsd:Number((re==null?void 0:re.totalRawUsd)||0),withdrawable:(X==null?void 0:X.withdrawable)!=null?Number(X.withdrawable):ie.withdrawable,totalMarginUsed:Number((re==null?void 0:re.totalMarginUsed)||0),crossMaintenanceMarginUsed:Number((X==null?void 0:X.crossMaintenanceMarginUsed)||0),crossAccountValue:Number((pe==null?void 0:pe.accountValue)||0),unrealizedPnl:Y}))}if((ne==null?void 0:ne.channel)==="webData2"&&Array.isArray((F=ne==null?void 0:ne.data)==null?void 0:F.assetCtxs)){const X={};for(const re of ne.data.assetCtxs){const pe=re==null?void 0:re.coin,Y=Number((re==null?void 0:re.midPx)??(re==null?void 0:re.markPx)??(re==null?void 0:re.px));pe&&Number.isFinite(Y)&&(X[pe]=Y)}Object.keys(X).length&&d(re=>({...re,...X}))}if((ne==null?void 0:ne.channel)==="user"&&((U=ne==null?void 0:ne.data)!=null&&U.state)){const X=ne.data.state,re=(X==null?void 0:X.marginSummary)||{},pe=Array.isArray(X==null?void 0:X.assetPositions)?X.assetPositions.reduce((Y,ie)=>{var oe;return Y+Number(((oe=ie==null?void 0:ie.position)==null?void 0:oe.unrealizedPnl)||0)},0):void 0;n(Y=>({...Y,accountValue:Number((re==null?void 0:re.accountValue)||0),totalNtlPos:Number((re==null?void 0:re.totalNtlPos)||0),totalRawUsd:Number((re==null?void 0:re.totalRawUsd)||0),totalMarginUsed:Number((re==null?void 0:re.totalMarginUsed)||0),...pe!=null?{unrealizedPnl:pe}:{}}))}const J=Array.isArray((z=(L=ne==null?void 0:ne.data)==null?void 0:L.spotState)==null?void 0:z.balances)?ne.data.spotState.balances:Array.isArray((Q=ne==null?void 0:ne.data)==null?void 0:Q.balances)?ne.data.balances:null;if(Array.isArray(J)){const X=J.filter(re=>re&&re.coin).map(re=>({coin:String(re.coin),total:Number(re.total||0),hold:Number(re.hold||0)}));s(X)}}catch{}},I.onclose=()=>{v.current&&clearInterval(v.current)},I.onerror=()=>{},()=>{v.current&&clearInterval(v.current);try{I.close()}catch{}}},[e]);const w=m.useMemo(()=>({spot:r.reduce((P,R)=>{if(R.coin==="USDC")return P+Number(R.total||0);const F=u[R.coin];return P+(F?Number(R.total||0)*Number(F):0)},0),perps:t.accountValue}),[r,u,t.accountValue]),C=m.useMemo(()=>{const I=t.accountValue,P=t.unrealizedPnl,R=Number(t.crossAccountValue||0)>0?Number(t.crossAccountValue||0):Number(I||0),F=R>0?Number(t.crossMaintenanceMarginUsed||0)/R:0,U=Number(t.crossMaintenanceMarginUsed||0),L=I>0?t.totalNtlPos/I:0;return{balance:I,uPnl:P,cmr:F,maintenanceMargin:U,crossLeverage:L}},[t]);return{rows:m.useMemo(()=>{const I=[];return I.push({id:"perps",kind:"perps",coin:"USDC",unit:"USDC",totalDisplay:t.accountValue,totalSort:t.accountValue,availableDisplay:t.withdrawable,availableSort:t.withdrawable,usdcValue:t.accountValue}),r.forEach(P=>{const R=Math.max(0,Number(P.total||0)-Number(P.hold||0)),F=u[P.coin],U=P.coin==="USDC"?Number(P.total||0):Number(F)?Number(P.total||0)*Number(F):null;I.push({id:`spot-${P.coin}`,kind:"spot",coin:P.coin,unit:P.coin,totalDisplay:P.total,totalSort:P.total,availableDisplay:R,availableSort:R,usdcValue:U})}),I},[t,r,u]),perps:t,spotBalances:r,tokenIdMap:a,tokenMetaMap:l,priceMap:u,accountEquity:w,perpsOverview:C,initialLoaded:f}}const nhn="https://dextrabothypev2.nftinit.io/api/wallet/request-agent",rhn="https://express-proxy-delta.vercel.app/proxy?url=",shn="https://api.starknet.extended.exchange/api/v1",_He=e=>`${Number(e||0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})} USDC`;function ihn({w:e,active:t,onSelect:n,open:r,mode:s,balances:a}){const[o,l]=m.useState(!1),[c,u]=m.useState(!1);m.useEffect(()=>{try{l(!!localStorage.getItem("hyperToken"))}catch{}},[]);const d=(e.wallet_address||"").toLowerCase(),{perpsOverview:f}=gT(d),x=f==null?void 0:f.balance,g=a&&a[e.wallet_id!=null?String(e.wallet_id):""],v=e.available_balance??e.availableForTrade??e.available_for_trade??e.balance??e.available??null;let w=null;s==="lighter"||s==="extended"?w=g!=null?Number(g):v!=null?Number(v):NaN:w=x;const C=Number.isFinite(w);return m.useEffect(()=>{if(!r||!o)return;u(!0);const N=setTimeout(()=>u(!1),2e3);return()=>clearTimeout(N)},[r,o,d]),m.useEffect(()=>{C&&u(!1)},[C]),i.jsxs("div",{className:"px-3 py-2 rounded cursor-pointer",style:{background:t?"#26313b":"transparent",color:t?"#ffffff":Gi},onClick:n,children:[i.jsxs("div",{className:"text-xs font-semibold flex items-center gap-2",children:[i.jsx("span",{children:e.wallet_name}),c?i.jsx(qUe,{size:3,color:"#ffffff"}):C?i.jsxs("span",{className:"text-[11px]",children:["— ",_He(w)]}):""]}),i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:rre(e.wallet_address)})]})}function bT({wallets:e=[],value:t,onChange:n,selectedBalance:r,mode:s="hyper"}){const[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(0),[f,x]=m.useState(!1),[g,v]=m.useState({}),w=m.useRef(new Set),C=m.useRef(null),N=m.useRef(null),{address:I}=Jr();m.useEffect(()=>{const Q=()=>{try{c(!!localStorage.getItem("hyperToken")),d(ne=>ne+1)}catch{}};return Q(),window.addEventListener("localStorageUpdated",Q),window.addEventListener("storage",Q),()=>{window.removeEventListener("localStorageUpdated",Q),window.removeEventListener("storage",Q)}},[]),m.useEffect(()=>{if(!l||!t)return;x(!0);const Q=setTimeout(()=>x(!1),2e3);return()=>clearTimeout(Q)},[t,l]),m.useEffect(()=>{var ne;Number.isFinite(Number(r))&&x(!1);const Q=e&&e.length?String(((ne=e.find(J=>String(J.wallet_id)===String(t))||e[0])==null?void 0:ne.wallet_id)??""):null;Q&&Number.isFinite(Number(r))&&Number(r)>=0&&(C.current=Q,v(J=>J[Q]===Number(r)?J:{...J,[Q]:Number(r)}))},[r,e,t]),m.useEffect(()=>{const Q=J=>{N.current&&(N.current.contains(J.target)||o(!1))},ne=J=>{J.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",Q,!0),document.addEventListener("keydown",ne),()=>{document.removeEventListener("pointerdown",Q,!0),document.removeEventListener("keydown",ne)}},[]);const P=e&&e.length>0,R=P?e.find(Q=>String(Q.wallet_id)===String(t))||(t?null:e[0]):null,F=R&&R.wallet_address?`${R.wallet_name||`Wallet ${R.wallet_id}`} — ${rre(R.wallet_address)}`:R?R.wallet_name||`Wallet ${R.wallet_id}`:I?`MetaMask — ${rre(I)}`:"Select Wallet";let U=null;if(Number.isFinite(Number(r)))U=Number(r);else if(R){const ne=(g&&g[R.wallet_id!=null?String(R.wallet_id):""])??R.available_balance??R.availableForTrade??R.available_for_trade??R.balance??R.available??null,J=Number(ne);Number.isFinite(J)&&(U=J)}const L=R&&!f&&U!=null?`${F} — ${_He(U)}`:F,z=m.useCallback(async Q=>{var G;if(s!=="hyper")return{data:{agent_pk:null,from_cache:!1}};const ne=localStorage.getItem("hyperTradeToken")||"",J=localStorage.getItem("hyperToken")||"",X=localStorage.getItem("hyperAddress")||"",re=`hl_pk:${Q}`,pe=localStorage.getItem(re);if(pe)return localStorage.setItem("hl_pk",pe),{data:{agent_pk:pe,from_cache:!0}};const ie=await(await fetch(nhn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:X,trade_token:ne,token:J,wallet_id:String(Q)})})).json().catch(()=>({})),oe=(G=ie==null?void 0:ie.data)==null?void 0:G.agent_pk;return oe&&(localStorage.setItem(re,oe),localStorage.setItem("hl_pk",oe)),ie},[s]);return m.useEffect(()=>{if(!R||s!=="hyper"||!l)return;const ne=`hl_pk:${String(R.wallet_id)}`,J=localStorage.getItem("hyperTradeToken")||"",X=localStorage.getItem("hyperToken")||"",re=localStorage.getItem("hyperAddress")||"";if(!(!J||!X||!re)){try{const pe=localStorage.getItem(ne);if(pe){localStorage.setItem("hl_pk",pe);return}}catch{}z(R.wallet_id).catch(()=>{})}},[l,s,R,z,u]),m.useEffect(()=>{if(typeof window>"u")return;const Q=s==="lighter"?"lighter":"hl";if(e&&e.length){const ne=e.find(re=>String(re.wallet_id)===String(t))||e[0];if(!ne)return;const J=String(ne.wallet_id),X=String(ne.wallet_address||"").toLowerCase();try{window.localStorage.setItem(`${Q}_selected_wallet_id`,J),window.localStorage.setItem(`${Q}_selected_wallet_address`,X),window.dispatchEvent(new Event("localStorageUpdated")),window.dispatchEvent(new CustomEvent("hl_selected_wallet_changed",{detail:{id:J,address:X,mode:s}})),s==="hyper"&&l&&z(ne.wallet_id).catch(()=>{})}catch{}}else if(I){const ne="",J=String(I||"").toLowerCase();try{window.localStorage.setItem(`${Q}_selected_wallet_id`,ne),window.localStorage.setItem(`${Q}_selected_wallet_address`,J),window.dispatchEvent(new Event("localStorageUpdated")),window.dispatchEvent(new CustomEvent("hl_selected_wallet_changed",{detail:{id:ne,address:J,mode:s}}))}catch{}}},[e,t,s,I,l,z]),m.useEffect(()=>{if(s!=="extended")return;let Q=!1;const ne=async J=>{var ie,oe,G;const X=J.wallet_id!=null?String(J.wallet_id):"";if(!X||w.current.has(X))return;const re=g[X];if(Number.isFinite(re)&&re>0)return;const pe=J.available_balance??J.availableForTrade??J.available_for_trade??J.balance??J.available??null,Y=Number(pe);if(Number.isFinite(Y)&&Y>0){v(V=>V[X]===Y?V:{...V,[X]:Y});return}if(J.wallet_api_key){w.current.add(X);try{const V=`${rhn}${encodeURIComponent(`${shn}/user/balance`)}`,ae=await(await fetch(V,{headers:{"X-Api-Key":J.wallet_api_key}})).json().catch(()=>({}));if(Q)return;const he=((ie=ae==null?void 0:ae.data)==null?void 0:ie.availableForTrade)??(ae==null?void 0:ae.availableForTrade)??((oe=ae==null?void 0:ae.data)==null?void 0:oe.available_balance)??(ae==null?void 0:ae.available_balance)??((G=ae==null?void 0:ae.data)==null?void 0:G.available)??(ae==null?void 0:ae.available)??null,Ce=Number(he);Number.isFinite(Ce)&&v(ce=>ce[X]===Ce?ce:{...ce,[X]:Ce})}catch{}finally{w.current.delete(X)}}};return e.forEach(J=>ne(J)),()=>{Q=!0}},[e,s,g]),i.jsxs("div",{className:"relative",ref:N,children:[i.jsxs("div",{onClick:()=>o(Q=>!Q),className:"h-[32px] px-3 rounded-md flex justify-between items-center cursor-pointer",style:{background:To,border:`1px solid ${Oa}`,color:Gi},children:[i.jsxs("span",{className:"truncate text-xs flex items-center gap-1",children:[L,f&&i.jsx(qUe,{size:3,color:"#ffffff"})]}),i.jsx("span",{className:"ml-2",children:"▾"})]}),a&&i.jsxs("div",{className:"absolute z-50 mt-1 w-full max-h-[240px] overflow-auto rounded-md p-1",style:{background:To,border:`1px solid ${Oa}`},children:[i.jsxs("div",{onClick:()=>{o(!1);const Q=s==="hyper"?"hyperliquid":s==="lighter"?"lighter":"extended";window.open(`/wallet-management#${Q}#add-account#${Q}`,"_blank")},className:"px-3 py-2 text-[#1de674] font-semibold text-sm cursor-pointer flex justify-start items-center gap-1.5 border border-[#8860ff] rounded-md mb-1 bg-[#7445ff]",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Add Account"})]}),P&&e.map(Q=>{const ne=String(Q.wallet_id)===String(t);return i.jsx(ihn,{w:Q,active:ne,open:a,mode:s,balances:g,onSelect:async()=>{n(String(Q.wallet_id)),o(!1);try{await z(Q.wallet_id)}catch{}}},Q.wallet_id)}),!P&&i.jsx("div",{className:"px-3 py-2 text-xs",style:{color:Ri},children:"No wallets"})]})]})}const TX=new Map;function ahn(e,t){const n=TX.get(e);if(n)return n;const r=Promise.resolve().then(t).finally(()=>TX.delete(e));return TX.set(e,r),r}const ohn=15e3,uSe=new Map;function kHe(e,t,n=!0,{pollMs:r=0,refreshOnFocus:s=!1}={}){const[a,o]=m.useState([]),[l,c]=m.useState(!1),u=m.useCallback(async()=>{if(!e||!t){o([]);return}const d=`wallets:${e}:${n?1:0}`,f=Date.now(),x=uSe.get(d);if(x&&f-x.ts<ohn)return o(x.data),c(!1),x.data;c(!0);const g=await ahn(d,async()=>{const w=await(await fetch(`${Zfn}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})})).json();let C=Array.isArray(w==null?void 0:w.data)?w.data:Array.isArray(w)?w:w!=null&&w.wallet_id?[w]:[];return C=C.map(N=>{var I,P,R;return{...N,balances:{eth:((I=N==null?void 0:N.balances)==null?void 0:I.eth)??0,usdc:((P=N==null?void 0:N.balances)==null?void 0:P.usdc)??0,hyper_usdc:((R=N==null?void 0:N.balances)==null?void 0:R.hyper_usdc)??0}}}),C});return o(g),uSe.set(d,{ts:Date.now(),data:g}),c(!1),g},[e,t,n]);return m.useEffect(()=>{(async()=>await u())()},[u]),m.useEffect(()=>{if(!s)return;const d=()=>{document.visibilityState==="visible"&&u()};return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[u,s]),m.useEffect(()=>{if(!r)return;const d=setInterval(u,r);return()=>clearInterval(d)},[u,r]),{wallets:a,loading:l,refresh:u}}function YN({value:e,onChange:t,accent:n="#67FFBD",trackBg:r="rgba(255,255,255,0.12)",marks:s=[0,25,33,50,66,75,100],className:a="",snap:o=!1}){const[l,c]=m.useState(!1),u=(C,N,I)=>Math.max(N,Math.min(I,C)),d=Math.max(2,s.length)-1,f=C=>{const N=u(Number(C)||0,s[0],s[s.length-1]);if(N<=s[0])return 0;if(N>=s[s.length-1])return 100;let I=0;for(;I<d&&N>s[I+1];)I++;const P=s[I+1]-s[I]||1,R=(N-s[I])/P;return(I+R)/d*100},x=C=>{const I=u(Number(C)||0,0,100)/100*d,P=Math.min(d-1,Math.floor(I)),R=I-P,F=s[P]+(s[P+1]-s[P])*R;if(!o)return F;let U=s[0],L=1/0;for(const z of s){const Q=Math.abs(z-F);Q<L&&(L=Q,U=z)}return U},g=f(e),v=Math.round(u(e,0,100)),w={type:"spring",stiffness:420,damping:32,mass:.2};return i.jsxs("div",{className:`relative w-full pt-4 pb-5 ${a}`,children:[i.jsx("div",{className:"absolute inset-x-0 top-5 h-2 rounded-full",style:{background:r},children:i.jsx(sm.div,{className:"h-2 rounded-full",animate:{width:`${g}%`},transition:w,style:{background:n}})}),i.jsx("div",{className:"absolute inset-x-0 top-6",children:s.map((C,N)=>{const I=N/d*100,P=g/100*d;return N<=P?null:i.jsx("div",{className:"absolute -translate-x-1/2 -translate-y-1/2 top-1/2",style:{left:`${I}%`},children:i.jsx("div",{className:"h-[10px] w-[10px] rounded-full",style:{background:n,boxShadow:"0 0 0 2px rgba(0,0,0,0.35) inset"}})},N)})}),i.jsx(sm.div,{className:`${g>34?"-ml-2.5":"ml-2.5"} absolute top-5 -translate-y-full -translate-x-1/2 pointer-events-none z-10`,animate:{left:`${g}%`},transition:w,children:i.jsx("div",{className:"h-[18px] min-w-[24px] px-2 rounded-[6px] flex items-center justify-center text-[12px] leading-none",style:{background:n,color:"#0d0d0d",border:`1px solid ${Oa}`},children:v})}),i.jsx(sm.div,{className:"absolute top-[17px] -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none",animate:{left:`${g-2}%`,scale:l?1.12:1},transition:w,children:i.jsx("div",{className:"h-4 w-4 rounded-full",style:{background:"#0f151a",border:`2px solid ${n}`}})}),i.jsx("div",{className:"absolute inset-x-0 bottom-0",children:s.map((C,N)=>{if(N===0)return null;const I=N/d*100;return i.jsxs("div",{className:"absolute -translate-x-1/2 text-[12px] text-[#CFCFCF]",style:{left:`${I}%`},children:[C,"%"]},N)})}),i.jsx("input",{type:"range",min:0,max:100,step:.1,value:g,onMouseDown:()=>c(!0),onMouseUp:()=>c(!1),onTouchStart:()=>c(!0),onTouchEnd:()=>c(!1),onChange:C=>t(Math.round(x(C.target.value))),className:"absolute -left-2 -right-2 top-0 h-8 opacity-0 cursor-pointer z-30"})]})}const dC=42161,JP=10,IX=[{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{type:"address"},{type:"uint256"}],outputs:[{type:"bool"}]}],Jm={BTC:"bc1plaavkq4u7wj8cc8nhrm6rxkhz9ylurw2u6l42ne7gw4493hvacks8wct4q",ETH:"0xa1D7ad9f7065BeE7b0b3E2AC30C9ddAaD9A70C71",SOL:"HWzcDXaTB2mPXvQYQy2g6PCNaj4mhTPVNoJP8zVupHJs",XPL:"0xa1D7ad9f7065BeE7b0b3E2AC30C9ddAaD9A70C71",USDC_BRIDGE_2:"0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7"},gv={USDC:{kind:"usdc",chains:[{key:"Arbitrum",label:"Arbitrum"}],icon:"USDC",bridge:Jm.USDC_BRIDGE_2},BTC:{kind:"address",chains:[{key:"Bitcoin",label:"Bitcoin"}],icon:"BTC",address:Jm.BTC,eta:"~21 minutes",fee:"~$2.29",min:"0.002 BTC",networkNote:"This address can only receive BTC on the Bitcoin network. Deposits below 0.002 BTC and deposits from other networks will result in a loss of funds."},ETH:{kind:"address",chains:[{key:"Ethereum",label:"Ethereum"}],icon:"ETH",address:Jm.ETH,eta:"~3 minutes",fee:"~$1.22",min:"0.05 ETH",networkNote:"This address can only receive ETH on the Ethereum network. ETH sent from L2s (e.g. Arbitrum, Base, Optimism) will be lost. Any other asset (e.g., USDC, USDT) sent from Ethereum will be lost. Deposits below 0.05 ETH will result in a loss of funds."},SOL:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"SOL",address:Jm.SOL,eta:"~1 minute",fee:"~1.40",min:"0.2 SOL",networkNote:"This address can only receive SOL on the Solana network. Any other asset (e.g., USDC, USDT) sent from Solana will be lost. Deposits below 0.2 SOL will result in a loss of funds."},"2Z":{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"2Z",address:Jm.SOL,eta:"~1 minute",fee:"~1.21",min:"150 2Z",networkNote:"This address can only receive 2Z on the Solana network. Deposits below 150 2Z will result in a loss of funds."},BONK:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"BONK",address:Jm.SOL,eta:"~1 minute",fee:"~1.21",min:"1000000 BONK",networkNote:"This address can only receive BONK on the Solana network. Deposits below 1000000 BONK will result in a loss of funds."},FARTCOIN:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"FARTCOIN",address:Jm.SOL,eta:"~1 minute",fee:"~1.21",min:"20 FARTCOIN",networkNote:"This address can only receive FARTCOIN on the Solana network. Deposits below 20 FARTCOIN will result in a loss of funds."},PUMP:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"PUMP",address:Jm.SOL,eta:"~1 minute",fee:"~1.21",networkNote:"This address can only receive PUMP on the Solana network."},SPX:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"SPX",address:Jm.SOL,eta:"~1 minute",fee:"~1.21",networkNote:"This address can only receive SPX on the Solana network."},XPL:{kind:"address",chains:[{key:"Plasma",label:"Plasma"}],icon:"XPL",address:Jm.XPL,eta:"~1 minute",fee:"~1.20",min:"15 XPL",networkNote:"This address can only receive XPL on the Plasma network. Deposits below 15 XPL will result in a loss of funds."}};function lhn({open:e,onClose:t,initialAsset:n="USDC",initialChain:r,toWalletAddress:s,usdcTokenAddress:a="0xaf88d065e77c8cC2239327C5EDb3A432268e5831"}){const[o,l]=m.useState(n),[c,u]=m.useState(r||gv[n].chains[0].key),d=gv[o],[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState(null),[N,I]=m.useState(!1);m.useEffect(()=>{e&&(l(n),u(r||gv[n].chains[0].key),x(""),v(!1),C(null),I(!1))},[e,n,r]);const P=m.useMemo(()=>`https://app.hyperliquid.xyz/coins/${(d.icon||o).toUpperCase()}.svg`,[o,d.icon]);d.kind==="usdc"?`${c}`:`${o}${c}`;const{address:R,isConnected:F}=Jr(),U=yA(),{switchChainAsync:L}=Vie(),z=x_e(),{writeContractAsync:Q}=agt(),ne=o==="USDC",J=ne&&c==="Arbitrum",X=ne&&c!=="Arbitrum",re=J&&U!==dC,{data:pe}=Cme({address:a,abi:IX,functionName:"decimals",chainId:dC,query:{enabled:J}}),Y=Number(pe??6),{data:ie,refetch:oe}=Cme({address:a,abi:IX,functionName:"balanceOf",args:[R??"0x0000000000000000000000000000000000000000"],chainId:dC,query:{enabled:J&&!!R}}),G=m.useMemo(()=>{try{return ie?jk(ie,Y):"0.00"}catch{return"0.00"}},[ie,Y]),V=J&&Number(f||0)<JP;function te(Ae,ye="error"){C({text:Ae,type:ye})}function ae(Ae){const ye=String((Ae==null?void 0:Ae.shortMessage)||(Ae==null?void 0:Ae.message)||Ae||"");return ye.toLowerCase().includes("does not match the connection's chain")||ye.toLowerCase().includes("chain mismatch")||ye.toLowerCase().includes("connector chain")?"You're not on Arbitrum. Please switch to Arbitrum.":ye}async function he(){try{if(!F)return te("Wallet is not connected");if(X)return te("The deposit bridge supports Arbitrum only");re&&await L({chainId:dC});const Ae=String(f||"").trim();if(!Ae||Number(Ae)<=0)return te("Enter a valid amount");if(Number(Ae)<JP)return te(`Minimum is ${JP} USDC`);const ye=tmt(Ae,Y);v(!0),C({type:"info",text:"Submitting transaction..."});const je=await Q({address:a,abi:IX,functionName:"transfer",args:[gv.USDC.bridge,ye],chainId:dC});C({type:"info",text:"Waiting for confirmation..."}),await z.waitForTransactionReceipt({hash:je}),C({type:"success",text:"Deposit completed"}),x(""),oe==null||oe()}catch(Ae){te(ae(Ae),"error")}finally{v(!1)}}function Ce(Ae){var ye;Ae&&((ye=navigator.clipboard)==null||ye.writeText(Ae),I(!0),setTimeout(()=>I(!1),1500))}const ce=X?"Arbitrum Required":J?re?"Deposit":g?"Depositing...":"Deposit":"Done",ge=g||X||J&&V;return i.jsx(Jh,{open:e,onClose:t,children:i.jsxs("div",{className:"relative",children:[i.jsx("button",{onClick:t,className:"absolute -top-1 right-1 w-8 h-8 rounded-full grid place-items-center text-white/90 bg-transparent",children:"×"}),i.jsxs("div",{className:"w-[560px] max-w-[92vw] rounded-2xl shadow-xl border border-[#2a2a2a] bg-[#101010] p-5",children:[i.jsx("div",{className:"w-12 h-12 rounded-full mx-auto -mt-10 mb-2 overflow-hidden flex justify-center items-center bg-[#1B1B1B]",children:i.jsx("img",{src:P,alt:o,className:"w-10 h-10",onError:Ae=>{Ae.currentTarget.style.display="none"}})}),i.jsx("div",{className:"text-center text-[18px] font-semibold mb-4 text-white",children:d.kind==="usdc"?`Deposit USDC from ${c}`:`Deposit ${o} from ${c}`}),w&&i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{background:w.type==="error"?"#3b1f1f":w.type==="success"?"#1f3b2b":"#1b2a3b",color:w.type==="error"?"#ffb4b4":w.type==="success"?"#b7ffd8":"#c9e1ff",border:"1px solid #2a2a2a"},children:w.text}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"Asset"}),i.jsxs("div",{className:"relative",children:[i.jsx("select",{className:"appearance-none bg-transparent text-[13px] text-white outline-none",value:o,onChange:Ae=>{var je;const ye=Ae.target.value;l(ye),u((je=gv[ye].chains[0])==null?void 0:je.key),C(null)},children:Object.keys(gv).map(Ae=>i.jsx("option",{value:Ae,children:Ae},Ae))}),i.jsx("svg",{className:"pointer-events-none absolute right-0 top-1/2 -translate-y-1/2 w-4 h-4 text-[#8c8c8c]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"Deposit Chain"}),i.jsxs("div",{className:"relative",children:[i.jsx("select",{className:"appearance-none bg-transparent pr-6 text-[13px] text-white outline-none",value:c,onChange:Ae=>{u(Ae.target.value),C(null)},children:gv[o].chains.map(Ae=>i.jsx("option",{value:Ae.key,children:Ae.label},Ae.key))}),i.jsx("svg",{className:"pointer-events-none absolute right-0 top-1/2 -translate-y-1/2 w-4 h-4 text-[#8c8c8c]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),s&&d.kind!=="usdc"&&i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"To"}),i.jsxs("span",{className:"text-xs text-white",children:[s.slice(0,6),"...",s.slice(-4)]})]}),J&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] flex items-center justify-between px-3",children:[i.jsx("input",{type:"text",className:"w-full bg-transparent outline-none text-[13px] text-white placeholder:text-[#6a6a6a] font-mono pr-[55px]",placeholder:"0.00",value:f,onChange:Ae=>x(Ae.target.value.replace(",",".").replace(/[^\d.]/g,"")),inputMode:"decimal"}),i.jsxs("button",{type:"button",onClick:()=>x(String(G)),className:"absolute right-3 text-[12px] text-[#67FFBD] font-semibold",children:["MAX: ",Number(G||0).toFixed(2)]})]}),i.jsxs("div",{className:"text-[11px]",style:{color:V?"#ffb4b4":"#9BA3A7"},children:["Minimum: ",JP," USDC"]})]}),ne&&i.jsx(i.Fragment,{children:X&&i.jsxs("div",{className:"p-2 rounded-lg text-[12px] mt-1 border border-[#2a2a2a] bg-[#3b1f1f] text-[#ffb4b4]",children:["The deposit bridge supports ",i.jsx("b",{children:"Arbitrum"})," only. Please select Arbitrum as the deposit chain."]})}),d.kind==="address"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"text-[12px] leading-5 text-[#9BA3A7]",children:["Deposits should arrive after ",d.eta,". This service is provided by Unit Protocol. Estimated fee ",d.fee," depending on the ",c," network."]}),i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"Address"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs text-white truncate max-w-[240px]",children:d.address}),i.jsx("button",{onClick:()=>Ce(d.address),className:"text-[12px] text-[#67FFBD]",children:"Copy"})]})]}),N&&i.jsx("div",{className:"text-[11px] text-[#67FFBD]",children:"Copied ✓"}),d.networkNote&&i.jsxs("div",{className:"p-2 rounded-lg text-[12px] mt-1 border border-[#2a2a2a] bg-[#3b1f1f] text-[#ffb4b4]",children:["IMPORTANT: ",d.min?`Minimum ${d.min}. `:"",d.networkNote]})]}),i.jsx("button",{onClick:ne?X?void 0:re?async()=>{try{C(null),await L({chainId:dC}),C({type:"success",text:"Switched to Arbitrum"})}catch(Ae){C({type:"error",text:ae(Ae)})}}:he:t,disabled:ge,className:"w-full h-[44px] mt-2 rounded-xl font-semibold text-sm disabled:opacity-60 bg[rgba(103,255,189,0.16)] text-[#67FFBD] ",children:ce})]})]})]})})}function chn(e){const t=e.length;let n=0,r=0;for(;r<t;){let s=e.charCodeAt(r++);if(s&4294967168)if(!(s&4294965248))n+=2;else{if(s>=55296&&s<=56319&&r<t){const a=e.charCodeAt(r);(a&64512)===56320&&(++r,s=((s&1023)<<10)+(a&1023)+65536)}s&4294901760?n+=4:n+=3}else{n++;continue}}return n}function uhn(e,t,n){const r=e.length;let s=n,a=0;for(;a<r;){let o=e.charCodeAt(a++);if(o&4294967168)if(!(o&4294965248))t[s++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&a<r){const l=e.charCodeAt(a);(l&64512)===56320&&(++a,o=((o&1023)<<10)+(l&1023)+65536)}o&4294901760?(t[s++]=o>>18&7|240,t[s++]=o>>12&63|128,t[s++]=o>>6&63|128):(t[s++]=o>>12&15|224,t[s++]=o>>6&63|128)}else{t[s++]=o;continue}t[s++]=o&63|128}}const dhn=new TextEncoder,fhn=50;function hhn(e,t,n){dhn.encodeInto(e,t.subarray(n))}function phn(e,t,n){e.length>fhn?hhn(e,t,n):uhn(e,t,n)}new TextDecoder;class eF{constructor(t,n){this.type=t,this.data=n}}class JL extends Error{constructor(t){super(t);const n=Object.create(JL.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:JL.name})}}function mhn(e,t,n){const r=n/4294967296,s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function THe(e,t,n){const r=Math.floor(n/4294967296),s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function xhn(e,t){const n=e.getInt32(t),r=e.getUint32(t+4);return n*4294967296+r}const ghn=-1,bhn=4294967296-1,yhn=17179869184-1;function vhn({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=yhn)if(t===0&&e<=bhn){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e),n}else{const n=e/4294967296,r=e&4294967295,s=new Uint8Array(8),a=new DataView(s.buffer);return a.setUint32(0,t<<2|n&3),a.setUint32(4,r),s}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,t),THe(r,4,e),n}}function whn(e){const t=e.getTime(),n=Math.floor(t/1e3),r=(t-n*1e3)*1e6,s=Math.floor(r/1e9);return{sec:n+s,nsec:r-s*1e9}}function Chn(e){if(e instanceof Date){const t=whn(e);return vhn(t)}else return null}function Shn(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const n=t.getUint32(0),r=t.getUint32(4),s=(n&3)*4294967296+r,a=n>>>2;return{sec:s,nsec:a}}case 12:{const n=xhn(t,4),r=t.getUint32(0);return{sec:n,nsec:r}}default:throw new JL(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}function Nhn(e){const t=Shn(e);return new Date(t.sec*1e3+t.nsec/1e6)}const Ahn={type:ghn,encode:Chn,decode:Nhn};class sre{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Ahn)}register({type:t,encode:n,decode:r}){if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{const s=-1-t;this.builtInEncoders[s]=n,this.builtInDecoders[s]=r}}tryToEncode(t,n){for(let r=0;r<this.builtInEncoders.length;r++){const s=this.builtInEncoders[r];if(s!=null){const a=s(t,n);if(a!=null){const o=-1-r;return new eF(o,a)}}}for(let r=0;r<this.encoders.length;r++){const s=this.encoders[r];if(s!=null){const a=s(t,n);if(a!=null){const o=r;return new eF(o,a)}}}return t instanceof eF?t:null}decode(t,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(t,n,r):new eF(n,t)}}sre.defaultCodec=new sre;function jhn(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function Ehn(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):jhn(e)?new Uint8Array(e):Uint8Array.from(e)}const _hn=100,khn=2048;class Cue{constructor(t){this.entered=!1,this.extensionCodec=(t==null?void 0:t.extensionCodec)??sre.defaultCodec,this.context=t==null?void 0:t.context,this.useBigInt64=(t==null?void 0:t.useBigInt64)??!1,this.maxDepth=(t==null?void 0:t.maxDepth)??_hn,this.initialBufferSize=(t==null?void 0:t.initialBufferSize)??khn,this.sortKeys=(t==null?void 0:t.sortKeys)??!1,this.forceFloat32=(t==null?void 0:t.forceFloat32)??!1,this.ignoreUndefined=(t==null?void 0:t.ignoreUndefined)??!1,this.forceIntegerToFloat=(t==null?void 0:t.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new Cue({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(t){if(this.entered)return this.clone().encodeSharedRef(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(t){if(this.entered)return this.clone().encode(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(t,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);t==null?this.encodeNil():typeof t=="boolean"?this.encodeBoolean(t):typeof t=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(t):this.encodeNumber(t):typeof t=="string"?this.encodeString(t):this.useBigInt64&&typeof t=="bigint"?this.encodeBigInt64(t):this.encodeObject(t,n)}ensureBufferSizeToWrite(t){const n=this.pos+t;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(t){const n=new ArrayBuffer(t),r=new Uint8Array(n),s=new DataView(n);r.set(this.bytes),this.view=s,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(t){t===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(t){!this.forceIntegerToFloat&&Number.isSafeInteger(t)?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(211),this.writeI64(t)):this.encodeNumberAsFloat(t)}encodeNumberAsFloat(t){this.forceFloat32?(this.writeU8(202),this.writeF32(t)):(this.writeU8(203),this.writeF64(t))}encodeBigInt64(t){t>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(t)):(this.writeU8(211),this.writeBigInt64(t))}writeStringHeader(t){if(t<32)this.writeU8(160+t);else if(t<256)this.writeU8(217),this.writeU8(t);else if(t<65536)this.writeU8(218),this.writeU16(t);else if(t<4294967296)this.writeU8(219),this.writeU32(t);else throw new Error(`Too long string: ${t} bytes in UTF-8`)}encodeString(t){const r=chn(t);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),phn(t,this.bytes,this.pos),this.pos+=r}encodeObject(t,n){const r=this.extensionCodec.tryToEncode(t,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(t))this.encodeArray(t,n);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else if(typeof t=="object")this.encodeMap(t,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(t)}`)}encodeBinary(t){const n=t.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=Ehn(t);this.writeU8a(r)}encodeArray(t,n){const r=t.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const s of t)this.doEncode(s,n+1)}countWithoutUndefined(t,n){let r=0;for(const s of n)t[s]!==void 0&&r++;return r}encodeMap(t,n){const r=Object.keys(t);this.sortKeys&&r.sort();const s=this.ignoreUndefined?this.countWithoutUndefined(t,r):r.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(const a of r){const o=t[a];this.ignoreUndefined&&o===void 0||(this.encodeString(a),this.doEncode(o,n+1))}}encodeExtension(t){if(typeof t.data=="function"){const r=t.data(this.pos+6),s=r.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(t.type),this.writeU8a(r);return}const n=t.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(t.type),this.writeU8a(t.data)}writeU8(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++}writeU8a(t){const n=t.length;this.ensureBufferSizeToWrite(n),this.bytes.set(t,this.pos),this.pos+=n}writeI8(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++}writeU16(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2}writeI16(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2}writeU32(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4}writeI32(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4}writeF32(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4}writeF64(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8}writeU64(t){this.ensureBufferSizeToWrite(8),mhn(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),THe(this.view,this.pos,t),this.pos+=8}writeBigUint64(t){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,t),this.pos+=8}writeBigInt64(t){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,t),this.pos+=8}}function IHe(e,t){return new Cue(t).encodeSharedRef(e)}const Thn={name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"},Ihn={Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]};function Phn(e){if(typeof e!="string"||!e.includes("."))return String(e);const t=e.replace(/\.?0+$/,"");return t==="-0"?"0":t}function ire(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(ire);const t={...e};for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const r=t[n];r&&typeof r=="object"?t[n]=ire(r):(n==="p"||n==="s")&&typeof r=="string"&&(t[n]=Phn(r))}return t}function Fhn(e){return fs(e)}function Ohn(e,t,n){const r=ire(e),s=IHe(r),a=t==null?9:29,o=new Uint8Array(s.length+a);o.set(s);const l=new DataView(o.buffer);return l.setBigUint64(s.length,BigInt(n),!1),t==null?l.setUint8(s.length+8,0):(l.setUint8(s.length+8,1),o.set(Fhn(t),s.length+9)),lo(o)}function Mhn(e,t){return{source:t?"a":"b",connectionId:e}}async function Rhn(e,t){const n=await e.signTypedData(t.domain,t.types,t.message),{r,s,v:a}=nu.from(n);return{r,s,v:a}}async function Lhn(e,t,n,r,s){const a=Ohn(t,n,r),o=Mhn(a,s);return Rhn(e,{domain:Thn,types:Ihn,primaryType:"Agent",message:o})}function yT({getPK:e=()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:t=!0,vaultAddress:n=null}={}){return{sign:async(r,s)=>{const a=e();if(!a)throw new Error("Please sign in to perform this action.");const o=new _ae(a);return Lhn(o,r,n,s,t)}}}function Dhn(e){return new _ae(e).address}function Bhn({open:e,onClose:t,children:n,title:r}){return e?i.jsxs("div",{className:"fixed inset-0 z-[999] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[1px]",onClick:t}),i.jsxs("div",{className:"relative w-[560px] max-w-[92vw] rounded-2xl border border-[#2A2A2A] bg-[#161616] shadow-2xl",children:[i.jsxs("div",{className:"px-5 pt-4 pb-2 flex items-center justify-between",children:[i.jsx("div",{className:"font-inter text-[18px] leading-6 text-white",children:r}),i.jsx("button",{onClick:t,className:"w-8 h-8 flex items-center justify-center rounded-lg bg-[#222] text-[#BDBDBD]",children:"✕"})]}),i.jsx("div",{className:"px-5 pb-5",children:n})]})]}):null}const $hn=({children:e})=>i.jsx("div",{className:"text-[12px] text-[#9B9B9B] font-inter mb-1 font-semibold",children:e}),Uhn=({value:e,onChange:t,placeholder:n})=>i.jsx("input",{value:e,onChange:r=>t(r.target.value),placeholder:n,inputMode:"decimal",className:"flex-1 min-w-0 h-10 px-3 rounded-lg bg-[#101010] border border-[#2A2A2A] text-white outline-none"});function dSe(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}const PX=e=>e==="perps"?"Perps":"Spot";function PHe({open:e,onClose:t,perpsAvailable:n=0,spotUsdcAvailable:r=0,onSubmit:s,loading:a=!1,initialToPerp:o=!1}){const[l,c]=m.useState(o?"spot":"perps"),[u,d]=m.useState("");m.useEffect(()=>{e&&(c(o?"spot":"perps"),d(""))},[o,e]);const f=l==="perps"?"spot":"perps",x=Number(l==="perps"?n||0:r||0),g=()=>c(N=>N==="perps"?"spot":"perps"),v=()=>d(String(x)),w=()=>s==null?void 0:s({toPerp:l==="spot",amount:u,available:x}),C=!Number(u)||Number(u)<=0||Number(u)>x||a;return i.jsxs(Bhn,{open:e,onClose:t,title:"Transfer USDC",children:[i.jsx("p",{className:"text-[13px] text-[#9B9B9B] mb-3",children:"Transfer USDC between your Perps and Spot balances."}),i.jsx("div",{className:"flex justify-center mb-3 text-xs",children:i.jsxs("button",{onClick:g,className:"inline-flex items-center gap-2 px-3 py-1 rounded-lg border border-[#2A2A2A] bg-transparent hover:bg-[#101010] text-sm",children:[i.jsx("span",{className:`${l==="perps"?"text-[#67FFBD] font-medium":"text-[#bdbdbd]"}`,children:PX(l)}),i.jsx(kae,{className:"text-[#67FFBD]"}),i.jsx("span",{className:`${f==="perps"?"text-[#67FFBD] font-medium":"text-[#bdbdbd]"}`,children:PX(f)})]})}),i.jsxs("div",{className:"space-y-2 text-xs",children:[i.jsx($hn,{children:"Amount (USDC)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Uhn,{value:u,onChange:d,placeholder:"0.0"}),i.jsxs("button",{onClick:v,className:"shrink-0 w-28 h-10 px-2 py-0 rounded-lg bg-[#1F2A23] border border-[#2F3B33] text-[#67FFBD] hover:opacity-95 flex flex-col items-end justify-center leading-tight text-right",title:"Use maximum available",children:[i.jsx("span",{className:"text-[10px] opacity-80",children:"MAX"}),i.jsx("span",{className:"text-[12px] font-medium truncate",children:dSe(x,6)})]})]}),i.jsxs("div",{className:"text-[12px] text-[#9B9B9B]",children:["Available (",PX(l),"): ",dSe(x,6)," USDC"]})]}),i.jsx("button",{onClick:w,disabled:C,className:`w-full h-11 rounded-xl mt-5 font-medium ${C?"bg-[#2C2C2C] text-[#8A8A8A] cursor-not-allowed":"bg-[rgba(103,255,189,0.16)] text-[#67FFBD] hover:opacity-95"}`,children:a?"Processing...":"Confirm"})]})}function fSe({label:e,children:t}){return i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"mb-1 text-[12px]",style:{color:Ri},children:e}),i.jsx("div",{className:"flex items-center gap-2",children:t})]})}const FX=42161,zhn="0xa4b1",hSe="Mainnet";function Hhn(e){const t=e.startsWith("0x")?e.slice(2):e,n="0x"+t.slice(0,64),r="0x"+t.slice(64,128);let s=parseInt(t.slice(128,130),16);return s<27&&(s+=27),{r:n,s:r,v:s}}function Vhn({open:e,onClose:t,perpsBalance:n=0,defaultDest:r=""}){const{address:s}=Jr(),a=yA(),{switchChainAsync:o}=Vie(),{signTypedDataAsync:l}=igt(),[c,u]=m.useState(""),[d,f]=m.useState(r||s||""),[x,g]=m.useState(!1),[v,w]=m.useState(null);m.useEffect(()=>{e&&(u(""),f(r||s||""),g(!1),w(null))},[e,r,s]);const C=m.useMemo(()=>{const R=Math.max(0,Number(n||0)-1);return R>0?Number(R.toFixed(6)):0},[n]),N="Withdraw USDC to Arbitrum";async function I(){var R;try{const F=Number(c||0);if(!F||F<=1){w({type:"error",text:"Enter an amount greater than $1 (fee)."});return}if(F>C){w({type:"error",text:"Amount exceeds available balance (after $1 fee)."});return}const U=(d||"").trim().toLowerCase();if(!/^0x[a-f0-9]{40}$/.test(U)){w({type:"error",text:"Invalid destination address."});return}if(a!==FX)try{await o({chainId:FX})}catch{w({type:"error",text:"Switch to Arbitrum to withdraw."});return}g(!0),w({type:"info",text:"Signing request..."});const L=Date.now(),z={name:"HyperliquidSignTransaction",version:"1",chainId:FX,verifyingContract:"0x0000000000000000000000000000000000000000"},Q={"HyperliquidTransaction:Withdraw":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},ne={hyperliquidChain:hSe,destination:U,amount:String(F),time:L},J=await l({domain:z,types:Q,primaryType:"HyperliquidTransaction:Withdraw",message:ne});w({type:"info",text:"Submitting..."});const X={action:{type:"withdraw3",signatureChainId:zhn,hyperliquidChain:hSe,destination:U,amount:String(F),time:L},nonce:L,signature:Hhn(J)},re=await fetch("https://api.hyperliquid.xyz/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)}).then(pe=>pe.json());if((re==null?void 0:re.status)==="ok")w({type:"success",text:"Withdraw submitted. Funds will arrive shortly."}),setTimeout(()=>{u(""),t==null||t()},700),(R=window==null?void 0:window.dispatchEvent)==null||R.call(window,new Event("balances:refresh"));else{const pe=typeof(re==null?void 0:re.response)=="string"?re.response:JSON.stringify(re);w({type:"error",text:pe||"Withdraw failed."})}}catch(F){w({type:"error",text:String((F==null?void 0:F.message)||F)})}finally{g(!1)}}const P=v&&i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{border:`1px solid ${Oa}`,background:v.type==="error"?"#3b1f1f":v.type==="success"?"#1f3b2b":"#1b2a3b",color:v.type==="error"?"#ffb4b4":v.type==="success"?"#b7ffd8":"#c9e1ff"},children:v.text});return i.jsx(Jh,{open:e,onClose:t,children:i.jsxs(cm,{title:N,children:[P,i.jsxs(fSe,{label:"Amount",children:[i.jsxs("div",{className:"flex items-center gap-2 h-[36px] px-2 rounded-lg",style:{background:To,border:`1px solid ${Oa}`,width:"100%"},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none text-right text-sm",inputMode:"decimal",placeholder:"0.0",style:{color:Gi,fontFeatureSettings:'"tnum"'},value:c,onChange:R=>u(R.target.value)}),i.jsx("button",{className:"text-xs text-[#67FFBD] h-6 flex items-center justify-center",onClick:()=>u(C?String(C):"0"),children:"MAX"})]}),i.jsxs("div",{className:"text-[11px]",style:{color:Ri},children:["MAX: ",C.toFixed(6)," USDC"]})]}),i.jsx(fSe,{label:"Destination Address",children:i.jsxs("div",{className:"flex items-center gap-2 h-[36px] px-2 rounded-lg",style:{background:To,border:`1px solid ${Oa}`,width:"100%"},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none text-sm",placeholder:"0x...",style:{color:Gi},value:d,onChange:R=>f(R.target.value)}),i.jsx("button",{className:"text-xs h-6 flex items-center justify-center text-[#67FFBD]",onClick:async()=>{const R=await navigator.clipboard.readText().catch(()=>"");R&&f(R.trim())},children:"Paste"})]})}),i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{background:"#3b1f1f",color:"#ffb4b4",border:`1px solid ${Oa}`},children:"IMPORTANT: A $1 fee is deducted from each withdrawal."}),i.jsx("button",{onClick:I,disabled:x,className:"w-full h-[42px] mt-1 rounded-xl font-semibold text-sm disabled:opacity-60",style:{background:Fg,color:"#0f151a"},children:x?"Submitting...":"Withdraw"})]})})}function Whn({value:e,onChange:t,leftLabel:n,rightLabel:r,leftUsd:s=0,rightUsd:a=0}){const o=m.useRef(null),l=m.useRef(!1),c=g=>Math.max(0,Math.min(100,g)),u=g=>{const v=o.current;if(!v)return e;const w=v.getBoundingClientRect(),C=(g-w.left)/w.width*100;return Math.round(c(C))},d=g=>{l.current&&t(u(g.clientX))},f=()=>{l.current=!1,window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)},x=g=>{l.current=!0,t(u(g.clientX)),window.addEventListener("pointermove",d,{passive:!0}),window.addEventListener("pointerup",f,{passive:!0}),window.addEventListener("pointercancel",f,{passive:!0})};return m.useEffect(()=>f,[]),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-[12px] mb-1",children:[i.jsxs("span",{className:"font-semibold",style:{color:Fg},children:[n,": ",e,"%"]}),i.jsxs("span",{className:"font-semibold",style:{color:Fj},children:[r,": ",100-e,"%"]})]}),i.jsxs("div",{ref:o,onPointerDown:x,className:"relative h-[10px] select-none",style:{cursor:"pointer",touchAction:"none"},children:[i.jsx("div",{className:"absolute inset-0 rounded-full",style:{background:`linear-gradient(90deg, ${Fg}80 0%, ${Fg}80 ${e}%, ${Fj}80 ${e}%, ${Fj}80 100%)`,border:`1px solid ${Oa}`}}),i.jsx("div",{className:"absolute -translate-x-1/2 -translate-y-1/2 rounded-md w-4 h-4",style:{left:`${e}%`,top:"50%",background:Fg,boxShadow:"0 0 0 1px rgba(0,0,0,0.35)",pointerEvents:"none"}})]}),i.jsxs("div",{className:"flex justify-between text-[12px] mt-1",children:[i.jsx("span",{style:{color:Fg},children:s?`${s.toLocaleString(void 0,{maximumFractionDigits:2})} USDC`:""}),i.jsx("span",{style:{color:Fj},children:a?`${a.toLocaleString(void 0,{maximumFractionDigits:2})} USDC`:""})]})]})}function qhn(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}function Ghn({skipConfirm:e,setSkipConfirm:t}){const[n,r]=m.useState(!1),s=m.useRef(null);return m.useEffect(()=>{const a=o=>{!s.current||s.current.contains(o.target)||r(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]),i.jsxs("div",{className:"relative",ref:s,children:[i.jsx("button",{onClick:()=>r(a=>!a),className:"ml-2 text-[#9B9B9B] hover:text-white p-1 rounded-md",children:i.jsx(qhn,{size:14})}),n&&i.jsx("div",{className:"absolute right-0 top-6 w-[24 0px] rounded-lg bg-[#101010] border border-[#2A2A2A] shadow-xl p-3 z-50",children:i.jsxs("label",{className:"flex items-center gap-2 text-[12px] text-white cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:e,onChange:a=>t(a.target.checked)}),"Skip Close Position Confirmation"]})})]})}const OX="wss://api.hyperliquid.xyz/ws";function Q7(e,t=2){const n=Number(e||0),r={maximumFractionDigits:t,minimumFractionDigits:n===0?2:0};return n.toLocaleString(void 0,r)}function pSe(e){return Number(e||0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}const mSe=e=>{const t=String(e||"").toUpperCase();return t==="GTC"?"Gtc":t==="IOC"?"Ioc":t==="ALO"?"Alo":"Gtc"};function Khn(e,t,n){if(!e||!n||n<=0)return null;const r=t==="buy"?e.asks:e.bids;if(!(r!=null&&r.length))return null;let s=n,a=0;for(const{px:o,sz:l}of r){const c=Math.min(s,l);if(a+=c*o,s-=c,s<=0)break}return s>1e-12?null:a/n}function Yhn({book:e,side:t,sizeCoin:n,mid:r}){const s=Khn(e,t,n);if(!s||!r)return 0;const a=s/r,o=t==="buy"?a-1:1-a;return Math.max(0,o*100)}const FHe={position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12,border:"1px solid #2A2A2A"}},Xhn="dextra-global-toast";function Ua(e,t){return ln.promise(e,t,{id:Xhn,...FHe})}const Z7=e=>Number(e||0);function Qhn(e){var r,s,a;const t=[],n=((s=(r=e==null?void 0:e.response)==null?void 0:r.data)==null?void 0:s.statuses)||((a=e==null?void 0:e.data)==null?void 0:a.statuses)||[];for(const o of n){const l=o==null?void 0:o.filled;(l==null?void 0:l.oid)!=null&&t.push(Number(l.oid));const c=o==null?void 0:o.resting;(c==null?void 0:c.oid)!=null&&t.push(Number(c.oid)),(o==null?void 0:o.oid)!=null&&t.push(Number(o.oid))}return[...new Set(t)]}async function Zhn(e,t){const n=String(e||"").toLowerCase(),r=[];for(const s of t)try{const o=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"orderStatus",user:n,oid:s})})).json();r.push({oid:s,data:o})}catch(a){r.push({oid:s,error:String((a==null?void 0:a.message)||a)})}return r}function Jhn({longSymbol:e,shortSymbol:t,longSize:n,shortSize:r,orderType:s,reduceOnlyFlag:a,maxSlipVal:o,tpOnFlag:l,tpVal:c,slVal:u,userAddr:d,lev:f,coinSym:x,isPairMode:g,isBuySide:v,sizeCoinVal:w}){return{userAddress:String(d||"").toLowerCase(),order:{actionType:a?"CLOSE":"OPEN",orderType:String(s||"MARKET").toUpperCase(),long:e||(g?"":v?x:""),short:t||(g||v?"":x),leverage:Z7(f)||1,longSize:Z7(n??(g?0:v?w:0)),shortSize:Z7(r??(g||v?0:w)),slippage:Number(o||0),takeProfit:l&&Z7(c)>0?String(c):"",stopLoss:l&&Z7(u)>0?String(u):""}}}async function MX({draft:e,responses:t,user:n}){const r=[];for(const o of Array.isArray(t)?t:[t])r.push(...Qhn(o));const s=r.length?await Zhn(n,r):[];return{...e,exchangeOids:r,orderStatus:s}}function fC(e){return e.then(t=>{var r,s,a;const n=(a=(s=(r=t==null?void 0:t.response)==null?void 0:r.data)==null?void 0:s.statuses)==null?void 0:a[0];if(n!=null&&n.error)throw new Error(n.error);if(n!=null&&n.filled){const o=n.filled;return`Filled ${o.totalSz} @ ${o.avgPx}`}return n!=null&&n.resting?`Placing order (oid ${n.resting.oid})`:typeof(t==null?void 0:t.response)=="string"?t.response:"Order placed"})}function xSe({coin:e="ETH",midPrice:t,selectedPrice:n,onSubmit:r,maxLeverage:s=25,wallet:a,onWalletChange:o,uiMode:l="single",pairKey:c="BTC/ETH"}){const[u,d]=m.useState("market"),[f,x]=m.useState("buy"),[g,v]=m.useState(""),[w,C]=m.useState(""),[N,I]=m.useState("USD"),[P,R]=m.useState(0),[F,U]=m.useState(!1),[L,z]=m.useState("GTC"),[Q,ne]=m.useState(!1),[J,X]=m.useState(""),[re,pe]=m.useState(""),[Y,ie]=m.useState(""),[oe,G]=m.useState(""),[V,te]=m.useState(!1),[ae,he]=m.useState(!1),[Ce,ce]=m.useState(!1),[ge,Ae]=m.useState("Cross"),[ye,je]=m.useState("Cross"),[Ie,Re]=m.useState(s),[Qe,$e]=m.useState(!1),[it,tt]=m.useState(!1),[ot,ft]=m.useState(!1),[ct,Vt]=m.useState("One-Way"),[It,an]=m.useState(""),[Nt,mn]=m.useState("USDC"),[dn,Pt]=m.useState(0),[Xe,Ut]=m.useState(5),[Lt,qe]=m.useState(!1),[Ke,pt]=m.useState(0),[en,Bt]=m.useState(!1),[Et,et]=m.useState(null),[Be,Mt]=m.useState(null),[Ve,ut]=m.useState(null),[xt,jt]=m.useState(s),[kt,xn]=m.useState(null),[un,On]=m.useState({address:null,token:null}),[En,jn]=m.useState(null),[bn,Zn]=m.useState(null),[zn,$n]=m.useState(null),[nr,wn]=m.useState(50),[on,Oe]=m.useState(!1),[rn,cn]=m.useState({bids:[],asks:[]}),[_t,Yn]=m.useState(!1),[yn,Dt]=m.useState(String(e)),[sn,Tn]=m.useState(()=>{if(typeof window>"u")return"8";const Sn=localStorage.getItem("hl_max_slip_pct");if(Sn==null||Sn==="")return"8";const Mn=Number(Sn);return Number.isFinite(Mn)&&Mn>0?String(Mn):"8"}),[Kn,ir]=m.useState(""),[rr,Jt]=m.useState({}),[Un,Qn]=m.useState([]),[Rt,Pn]=m.useState(!1),Ee=m.useRef(null),p=m.useRef(null),[h,S]=m.useState(()=>localStorage.getItem("skipCloseConfirm")==="true"),[_,k]=m.useState([0,0]),[T,B]=m.useState({takerPct:null,makerPct:null});m.useEffect(()=>{localStorage.setItem("skipCloseConfirm",h?"true":"false")},[h]);const W=m.useMemo(()=>Math.max(0,Number(sn||0))/100,[sn]),ee=Sn=>String(Sn||"").trim().toUpperCase(),de="dextrabot.last_used_leverage",fe=()=>{try{return JSON.parse(localStorage.getItem(de)||"{}")}catch{return{}}},xe=Sn=>{const Mn=`leverage:${ee(Sn)}`,at=Number(localStorage.getItem(Mn));return Number.isFinite(at)&&at>0?at:null},we=Sn=>{const Mn=ee(Sn),at=fe(),zt=Number(at==null?void 0:at[Mn]);return Number.isFinite(zt)&&zt>0?zt:xe(Mn)},ke=(Sn,Mn)=>{var qn;const at=ee(Sn),zt=Math.max(1,Number(Mn)||1),er=fe();er[at]=zt,localStorage.setItem(de,JSON.stringify(er)),localStorage.setItem(`leverage:${at}`,String(zt)),(qn=window.dispatchEvent)==null||qn.call(window,new Event("localStorageUpdated"))},{isConnected:Me}=Jr(),{openConnectModal:Ye}=b5(),{setSignInConnectButtonOpen:Fe}=m.useContext(Qr),{address:st}=Jr(),se=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,De=!!(typeof window<"u"&&localStorage.getItem("hyperToken")&&(Me||se)),Le=m.useRef(null);m.useEffect(()=>{const Sn=st?st.toLowerCase():null;if(Le.current&&Le.current!==Sn&&typeof window<"u"){const Mn=window.localStorage;Mn.removeItem("hyperToken"),Mn.removeItem("hyperAddress"),Mn.removeItem("hyperTradeToken"),Mn.removeItem("hl_pk"),Mn.removeItem("hl:wallet_id"),Object.keys(Mn).forEach(at=>{at.startsWith("hl_pk:")&&Mn.removeItem(at)}),window.dispatchEvent(new Event("localStorageUpdated"))}Le.current=Sn,et(null)},[st]),m.useEffect(()=>{const Sn=(a==null?void 0:a.id)!=null?String(a.id):null;if(Sn==null){et(null);return}et(Mn=>Mn!=null&&String(Mn)===Sn?Mn:Sn)},[a==null?void 0:a.id]),m.useEffect(()=>{Et!=null&&localStorage.setItem("hl:wallet_id",String(Et))},[Et]);const _e=m.useRef(null);m.useEffect(()=>{l!=="pair"&&yn&&_e.current===yn&&ke(yn,Ie)},[Ie,yn,l]),m.useEffect(()=>{let Sn,Mn=!0;function at(){Sn=new WebSocket(OX),Sn.onopen=()=>{const zt={method:"subscribe",subscription:{type:"l2Book",coin:String(e).toUpperCase()}};Sn.send(JSON.stringify(zt))},Sn.onmessage=zt=>{var Fs;if(!Mn)return;const er=JSON.parse(zt.data),qn=((Fs=er==null?void 0:er.data)==null?void 0:Fs.levels)||(er==null?void 0:er.levels),kr=(qn==null?void 0:qn.bs)||(qn==null?void 0:qn.bids)||[],Ar=(qn==null?void 0:qn.as)||(qn==null?void 0:qn.asks)||[],Zr=St=>St.map(sr=>Array.isArray(sr)?{px:Number(sr[0]),sz:Number(sr[1])}:{px:Number(sr.px),sz:Number(sr.sz)}).filter(sr=>sr.px>0&&sr.sz>0);(kr.length||Ar.length)&&cn({bids:Zr(kr),asks:Zr(Ar)})}}return at(),()=>{Mn=!1;try{Sn&&Sn.close()}catch{}}},[e]),m.useEffect(()=>{const Sn=()=>{const Mn=typeof window<"u"?localStorage.getItem("hyperAddress"):null,at=typeof window<"u"?localStorage.getItem("hyperToken"):null;On({address:Mn,token:at})};return Sn(),window.addEventListener("localStorageUpdated",Sn),window.addEventListener("storage",Sn),()=>{window.removeEventListener("localStorageUpdated",Sn),window.removeEventListener("storage",Sn)}},[]);const nt=()=>{const Sn=parseFloat(String(sn).replace(",",".")),at=Math.max(.01,Math.min(50,Number.isFinite(Sn)?Sn:8)).toString();Tn(at),localStorage.setItem("hl_max_slip_pct",at),Yn(!1)},{wallets:lt}=kHe(un.address,un.token,!0,{pollMs:5e3});m.useEffect(()=>{if(!lt||!lt.length||Et&<.some(at=>String(at.wallet_id)===String(Et)))return;const Sn=lt.find(at=>at.confirmed)||lt[0];if(!Sn)return;const Mn=String(Sn.wallet_id);String(Et)!==Mn&&(et(Mn),o==null||o({id:Mn,address:Sn.wallet_address}))},[lt,Et,o]);const bt=m.useMemo(()=>(lt||[]).find(Sn=>String(Sn.wallet_id)===String(Et))||null,[lt,Et]);m.useEffect(()=>{n!=null&&n!==""&&(d("limit"),v(Number(n)))},[n]),m.useEffect(()=>{let Sn=!0;Pn(!1);async function Mn(){try{const zt=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs"})})).json(),er=Array.isArray(zt)?zt[0]:zt,qn=(er==null?void 0:er.universe)||[],kr=new Map(qn.map(Fs=>{const St=typeof Fs=="string"?Fs:(Fs==null?void 0:Fs.name)??(Fs==null?void 0:Fs[0])??"";return[ee(St),typeof Fs=="string"?{name:St}:Fs]}));if(l==="pair"){const[Fs,St]=String(c||"").split("/").map(zr=>zr.trim()),sr=kr.get(ee(Fs)),Hn=kr.get(ee(St));if(Sn){const zr=(sr==null?void 0:sr.maxLeverage)??s,as=(Hn==null?void 0:Hn.maxLeverage)??s,rs=Math.max(1,Math.min(zr,as));jt(rs),Re(hs=>Math.min(hs||1,rs)),Mt(null),ut(null),xn(null),Dt(null),Pn(!0)}return}const Ar=kr.get(ee(e));if(!Ar){Sn&&(Mt(null),ut(null),jt(s),Re(Fs=>Math.min(Fs||1,s)),xn(null),Dt(String(e)),Pn(!0));return}const Zr=(Ar==null?void 0:Ar.name)||String(e);if(Sn){Mt(0),ut((Ar==null?void 0:Ar.szDecimals)??0),jt((Ar==null?void 0:Ar.maxLeverage)??s),xn((Ar==null?void 0:Ar.maintenanceMarginFraction)??(Ar==null?void 0:Ar.mmr)??null),Dt(Zr);const Fs=we(Zr),St=Fs!=null?Math.min((Ar==null?void 0:Ar.maxLeverage)??s,Math.max(1,Fs)):Math.min((Ar==null?void 0:Ar.maxLeverage)??s,Math.max(1,Ie||1));Re(St),_e.current=Zr,Pn(!0)}}catch{Sn&&(Mt(null),ut(null),jt(s),Re(at=>Math.min(at||1,s)),xn(null),Dt(String(e)),Pn(!0))}}return Mn(),()=>{Sn=!1}},[e,s,l,c]);const Zt=f==="buy",Ge=Zt?Fg:Fj,Je=m.useMemo(()=>{var at,zt,er,qn;const Sn=(zt=(at=rn==null?void 0:rn.bids)==null?void 0:at[0])==null?void 0:zt.px,Mn=(qn=(er=rn==null?void 0:rn.asks)==null?void 0:er[0])==null?void 0:qn.px;return Number.isFinite(Sn)&&Number.isFinite(Mn)&&Sn>0&&Mn>0?(Mn+Sn)/2:null},[rn]),We=m.useMemo(()=>{if(u==="limit"&&g!=="")return Number(g);const Sn=Number(t||0);if(Sn>0)return Sn;if(Number(Je||0)>0)return Number(Je);const Mn=Number((rr||{})[e]||0);return Mn>0?Mn:0},[u,g,t,Je,rr,e]),wt=bt==null?void 0:bt.wallet_address,{accountEquity:At,perpsOverview:Gt,spotBalances:fn,perps:Rn}=gT(wt),{rows:An}=yue(wt);m.useEffect(()=>{let Sn=!1;async function Mn(){var zt,er,qn,kr;if(!wt){Sn||B({takerPct:null,makerPct:null});return}try{const Zr=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userFees",user:wt.toLowerCase()})})).json();if(Sn)return;const Fs=Number(Zr.userCrossRate??((zt=Zr.feeSchedule)==null?void 0:zt.cross)??NaN),St=Number(Zr.userAddRate??((er=Zr.feeSchedule)==null?void 0:er.add)??NaN);if(!Number.isFinite(Fs)||!Number.isFinite(St)){B({takerPct:null,makerPct:null});return}const sr=Number(Zr.activeReferralDiscount??((qn=Zr.feeSchedule)==null?void 0:qn.referralDiscount)??0)||0,Hn=Number(((kr=Zr.activeStakingDiscount)==null?void 0:kr.discount)??0)||0,zr=Math.max(0,1-sr-Hn),as=Fs*zr,rs=St*zr;B({takerPct:as*100,makerPct:rs*100})}catch{Sn||B({takerPct:null,makerPct:null})}}Mn();const at=setInterval(Mn,5*60*1e3);return()=>{Sn=!0,clearInterval(at)}},[wt]);const pr=m.useMemo(()=>{const{takerPct:Sn,makerPct:Mn}=T;if(Sn==null||Mn==null)return"—";const at=zt=>Number(zt).toLocaleString(void 0,{minimumFractionDigits:4,maximumFractionDigits:4});return`${at(Sn)}% / ${at(Mn)}%`},[T]);m.useEffect(()=>{let Sn=!1;async function Mn(){if(!(!wt||l==="pair"))try{const zt=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"activeAssetData",user:wt.toLowerCase(),coin:String(yn||e)})})).json();if(Sn)return;const er=zt==null?void 0:zt.leverage;if(!er)return;const qn=String(er.type||"").toLowerCase()==="cross"?"Cross":"Isolated",Ar=Math.max(1,Math.min(xt||s,Number(er.value||er.leverage)||1));Ae(qn),je(qn),Re(Ar)}catch{}}return Mn(),()=>{Sn=!0}},[wt,e,l,xt,s]),m.useEffect(()=>{if(!wt)return;const Sn=new WebSocket(OX);return Ee.current=Sn,Sn.onopen=()=>{Sn.send(JSON.stringify({method:"subscribe",subscription:{type:"user",user:wt}})),Sn.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:wt}})),p.current=setInterval(()=>{Sn.readyState===WebSocket.OPEN&&Sn.send(JSON.stringify({id:99,method:"ping"}))},3e4)},Sn.onmessage=Mn=>{var at,zt,er,qn;try{const kr=JSON.parse(Mn.data),Ar=(kr==null?void 0:kr.data)||{},Zr=(at=Ar==null?void 0:Ar.meta)==null?void 0:at.universe,Fs=Ar==null?void 0:Ar.allMids;if(Array.isArray(Zr)&&Array.isArray(Fs)&&Zr.length===Fs.length){const sr={};for(let Hn=0;Hn<Zr.length;Hn++){const zr=typeof Zr[Hn]=="string"?Zr[Hn]:((zt=Zr[Hn])==null?void 0:zt.name)||((er=Zr[Hn])==null?void 0:er[0]),as=Number(Fs[Hn]);zr&&Number.isFinite(as)&&(sr[zr]=as)}Jt(Hn=>({...Hn,...sr}))}const St=Array.isArray((qn=Ar==null?void 0:Ar.spotState)==null?void 0:qn.balances)?Ar.spotState.balances:Array.isArray(Ar==null?void 0:Ar.balances)?Ar.balances:null;Array.isArray(St)&&Qn(St.filter(sr=>sr&&sr.coin).map(sr=>({coin:String(sr.coin),total:Number(sr.total||0),hold:Number(sr.hold||0)})))}catch{}},Sn.onclose=()=>{p.current&&clearInterval(p.current)},()=>{p.current&&clearInterval(p.current);try{Sn.close()}catch{}}},[wt]),m.useEffect(()=>{if(!wt){k([0,0]);return}k([0,0]);let Sn=!0;const Mn=new WebSocket(OX);return Mn.onopen=()=>{Mn.send(JSON.stringify({method:"subscribe",subscription:{type:"activeAssetData",user:wt.toLowerCase(),coin:String(e)}}))},Mn.onmessage=at=>{if(Sn)try{const zt=JSON.parse(at.data);if(zt.channel==="activeAssetData"&&zt.data){const er=zt.data.availableToTrade||[];k([Number(er[0]||0),Number(er[1]||0)])}}catch{}},Mn.onclose=()=>{Sn&&k([0,0])},()=>{Sn=!1;try{Mn.close()}catch{}}},[wt,e]);const mt=m.useMemo(()=>{const Sn=(fn||[]).find(Mn=>Mn.coin==="USDC");return Sn?Math.max(0,Number(Sn.total||0)-Number(Sn.hold||0)):0},[fn]),qt=m.useMemo(()=>{if(!Un.length)return null;let Sn=0;for(const Mn of Un){const at=Number(Mn.total||0);if(at>0)if(Mn.coin==="USDC")Sn+=at;else{const zt=rr[Mn.coin];Number.isFinite(zt)&&zt>0&&(Sn+=at*zt)}}return Sn},[Un,rr]),Qt=Number((Rn==null?void 0:Rn.accountValue)??0),In=Number((Rn==null?void 0:Rn.totalMarginUsed)??0),or=Math.max(0,Qt-In),Wn=or,Vn=or<1;async function gr({toPerp:Sn,amount:Mn,available:at}){var zt;try{if(Oe(!0),!En){await Ua(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:qn=>qn.message});return}if(!Number(Mn)){await Ua(Promise.reject(new Error("Amount is invalid")),{loading:"Validating...",success:"OK",error:qn=>qn.message});return}if(Number(Mn)>Number(at||0)){await Ua(Promise.reject(new Error("Amount exceeds available")),{loading:"Validating...",success:"OK",error:qn=>qn.message});return}const er=En.transfers.usdClassTransfer(String(Mn),!!Sn).then(qn=>{if((qn==null?void 0:qn.status)==="ok")return"Transfer successful.";const kr=typeof(qn==null?void 0:qn.response)=="string"?qn.response:"Transfer failed";throw new Error(kr)});await Ua(er,{loading:`Transferring ${Mn} USDC ${Sn?"Spot → Perps":"Perps → Spot"}...`,success:qn=>qn,error:qn=>(qn==null?void 0:qn.message)||"Transfer failed"}),(zt=window==null?void 0:window.dispatchEvent)==null||zt.call(window,new Event("balances:refresh")),$e(!1)}catch{}finally{Oe(!1)}}const Ir=(()=>{const Sn=Number(w)||0;return N==="COIN"?Sn:We?Sn/We:0})(),Fr=Ir*(We||0),Lr=Ie?Fr/Ie:0;function Ht(Sn){const Mn=Math.max(1,Number(Ie)||1),at=Math.max(0,Number(kt)||0),zt=Sn/Mn+Sn*at,er=Wn>0?zt/Wn*100:0;R(Math.max(0,Math.min(100,Math.round(er))))}function nn(Sn){R(Sn);const Mn=Math.max(1,Number(Ie)||1),at=Math.max(0,Number(kt)||0),zt=Sn/100*Wn,er=1/Mn+at,qn=er>0?zt/er:0;if(l==="pair"){ir(qn?String(qn.toFixed(2)):"");return}if(N==="USD")C(qn?String(qn.toFixed(2)):"");else{const kr=We?qn/We:0,Ar=Ve??4;C(kr?String(kr.toFixed(Ar)):""),Ht(kr*We)}}function Sr(Sn){const Mn=Math.max(1,Number(Ie)||1),at=Math.max(0,Number(kt)||0),zt=Sn/Mn+Sn*at,er=Wn>0?zt/Wn*100:0;pt(Math.max(0,Math.min(100,Math.round(er))))}function Br(Sn){const Mn=Math.max(0,Math.min(100,Number(Sn)||0));pt(Mn);const at=Math.max(1,Number(Ie)||1),zt=Math.max(0,Number(kt)||0),er=Mn/100*Wn,qn=1/at+zt,kr=qn>0?er/qn:0;if(Nt==="COIN"){const Ar=We?kr/We:0,Zr=Ve??4;an(Ar?String(Ar.toFixed(Zr)):"")}else an(kr?String(kr.toFixed(2)):"")}function Kr(Sn){an(Sn);const Mn=Number(Sn)||0,zt=(Nt==="COIN"?Mn:We?Mn/We:0)*(We||0);Sr(zt)}function As(Sn){if(Sn===Nt)return;const Mn=Number(It)||0;let at="";if(Sn==="USDC")at=String(((Mn||0)*(We||0)).toFixed(2)),mn("USDC"),an(at),Sr(Number(at)||0);else if(!We)mn("COIN"),an(""),Sr(0);else{const zt=Ve??4;at=String(((Mn||0)/We).toFixed(zt)),mn("COIN"),an(at),Sr((Number(at)||0)*We)}}function ms(Sn){C(Sn);const Mn=Number(Sn)||0,zt=(N==="COIN"?Mn:We?Mn/We:0)*(We||0);Ht(zt)}function vr(Sn){const Mn=Sn==="USDC"?"USD":Sn;if(Mn===N)return;const at=Number(w)||0;let zt="";if(Mn==="USD")zt=String(((at||0)*(We||0)).toFixed(2)),I("USD"),C(zt),Ht(Number(zt)||0);else if(!We)I("COIN"),C(""),Ht(0);else{const er=Ve??4;zt=String(((at||0)/We).toFixed(er)),I("COIN"),C(zt),Ht((Number(zt)||0)*We)}}function Yr({entry:Sn,side:Mn,notionalUSD:at,maintenanceFrac:zt,marginMode:er,accountValueUSD:qn,isolatedMarginUSD:kr}){const Ar=Number(Sn)||0,Zr=Math.abs(Number(at)||0);if(!Ar||!Zr)return null;const Fs=Mn==="buy"?1:-1,St=Math.max(0,Number(zt)||0),sr=Zr/Ar,Hn=Zr*St;let zr;er==="Cross"?zr=qn-Hn:zr=kr-Hn;const as=1-St*Fs;if(!sr||!isFinite(as))return null;const rs=Ar-Fs*(zr/sr)/as;return Math.max(0,rs)}const vi=Number((Gt==null?void 0:Gt.balance)??0),_r=typeof kt=="number"?kt:.01,os=Ir>0&&We?Yr({entry:We,side:f,notionalUSD:Fr,maintenanceFrac:_r,marginMode:ge,accountValueUSD:vi}):null;m.useEffect(()=>{ms(w)},[N,We,Ie,Wn]),m.useEffect(()=>{u==="twap"&&Kr(It)},[u,Nt,It,We,Ie,Wn]);const Gs=m.useMemo(()=>Yhn({book:rn,side:f,sizeCoin:Ir,mid:t}),[rn,f,Ir,t]);m.useEffect(()=>{let Sn=!1;async function Mn(){if(!(bt!=null&&bt.wallet_address)||!Et){jn(null);return}const at=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null}),zt=KN({address:bt.wallet_address,signer:at,dex:"",defaultSlippage:W});Sn||jn(zt)}return Mn(),()=>{Sn=!0}},[Et,bt==null?void 0:bt.wallet_address,W]);const mi=Sn=>Sn||Sn===0?String(Math.trunc(Number(Sn))):"",ns=Number(We||0),Xt=Sn=>{ie(Sn),Zn("pct");const Mn=Number(Sn),at=Math.max(1,Number(Ie)||1);if(!ns||!isFinite(Mn)){X("");return}const zt=Mn/(at*100),er=Zt?ns*(1+zt):ns*(1-zt);X(mi(er))};m.useEffect(()=>{Q&&(X(""),pe(""),ie(""),G(""),Zn(null),$n(null))},[f]);const ue=Sn=>{X(Sn),Zn("price");const Mn=Number(Sn),at=Math.max(1,Number(Ie)||1);if(!ns||!Mn){ie("");return}const zt=Mn/ns,er=Zt?(zt-1)*at*100:(1-zt)*at*100;ie(String(Number(er).toFixed(2)))},rt=Sn=>{G(Sn),$n("pct");const Mn=Number(Sn),at=Math.max(1,Number(Ie)||1);if(!ns||!isFinite(Mn)){pe("");return}const zt=Mn/(at*100),er=Zt?ns*(1-zt):ns*(1+zt);pe(mi(er))},Ft=Sn=>{pe(Sn),$n("price");const Mn=Number(Sn),at=Math.max(1,Number(Ie)||1);if(!ns||!Mn){G("");return}const zt=Mn/ns,er=Zt?(1-zt)*at*100:(zt-1)*at*100;G(String(Number(er).toFixed(2)))};m.useEffect(()=>{ns&&(Q&&(bn==="pct"?Xt(Y):bn==="price"&&ue(J)),zn==="pct"?rt(oe):zn==="price"&&Ft(re))},[ns,Ie]);function yt(){var Sn;(Sn=window==null?void 0:window.dispatchEvent)==null||Sn.call(window,new Event("balances:refresh"))}async function hn(Sn){const Mn=()=>{typeof Sn=="function"&&Sn()};if(!Et){await Ua(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:qn=>qn.message}),Mn();return}if(!En){await Ua(Promise.reject(new Error("Please sign in to perform this action.")),{loading:"Validating...",success:"OK",error:qn=>qn.message}),Mn();return}const at=String(ge||"").toLowerCase().startsWith("iso")?"isolated":"cross",er=Math.max(1,Math.min(xt||s,Number(Ie)||1));if(!Or&&Math.abs(ts||0)>0){const qn=String(ye||"").toLowerCase().startsWith("iso")?"isolated":"cross";if(at!==qn){await Ua(new Promise(kr=>kr()),{loading:"Validating...",success:()=>{throw new Error("Cannot switch leverage type with open position.")},error:kr=>kr.message}),Ae(ye),Mn();return}}try{if(l==="pair"){const[qn,kr]=String(c||"").split("/").map(Zr=>Zr.trim().toUpperCase()),Ar=Promise.all([En.updateLeverage(qn,at,er),En.updateLeverage(kr,at,er)]);await Ua(Ar,{loading:`Updating for ${qn}/${kr}...`,success:()=>"Updated",error:Zr=>(Zr==null?void 0:Zr.message)||"Failed to update leverage for pair"})}else{const qn=yn||String(e).toUpperCase(),kr=En.updateLeverage(qn,at,er);await Ua(kr,{loading:`Updating for ${qn}...`,success:()=>"Updated",error:Ar=>(Ar==null?void 0:Ar.message)||"Failed to update leverage"}),je(ge)}Mn()}catch{Ae(ye),Mn()}}async function vn(){const[Sn,Mn]=String(c||"").split("/").map(at=>at.trim().toUpperCase());try{if(!Et){await Ua(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:zr=>zr.message});return}if(!En){await Ua(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:zr=>zr.message});return}const at=await En.info.allMids(),zt=Number(at[Sn]||0),er=Number(at[Mn]||0);if(!(zt>0&&er>0)){await Ua(Promise.reject(new Error("Mid price not available for pair")),{loading:"Validating...",success:"OK",error:zr=>zr.message});return}const qn=Math.max(1,Math.min(Number(Ie)||1,Number(xt)||1));qn!==Ie&&(Re(qn),ln.success(`Leverage adjusted to ${qn}x`,FHe));let kr=Number(Kn)>0?Number(Kn):P/100*Wn*qn;if(!(kr>0)){await Ua(Promise.reject(new Error("Enter a valid total notional for pair")),{loading:"Validating...",success:"OK",error:zr=>zr.message});return}const Ar=Math.max(0,Math.min(100,Number(nr)||0))/100,Zr=kr*Ar,Fs=kr-Zr,St=Zr/zt,sr=Fs/er,Hn=Jhn({longSymbol:Sn,shortSymbol:Mn,longSize:St,shortSize:sr,orderType:u,reduceOnlyFlag:!!F,maxSlipVal:W,tpOnFlag:!1,tpVal:"",slVal:"",userAddr:(bt==null?void 0:bt.wallet_address)||st,lev:qn,coinSym:"",isPairMode:!0,isBuySide:!0,sizeCoinVal:0});if(u==="market"){const zr=F?En.marketClose(Sn,void 0,{tif:"Ioc",reduceOnly:!0,slippage:W}):En.marketOpen(Sn,!0,Number(St),{tif:"Ioc",reduceOnly:!1,slippage:W}),as=F?En.marketClose(Mn,void 0,{tif:"Ioc",reduceOnly:!0,slippage:W}):En.marketOpen(Mn,!1,Number(sr),{tif:"Ioc",reduceOnly:!1,slippage:W}),rs=(async()=>{const[hs,ps]=await Promise.all([zr,as]);return await MX({draft:Hn,responses:[hs,ps],user:Hn.userAddress}),"Pair market placed"})();await Ua(rs,{loading:`Opening ${Sn} long / ${Mn} short...`,success:hs=>hs,error:hs=>(hs==null?void 0:hs.message)||"Pair order failed"}),yt(),R(0),ir("");return}if(u==="limit"){const zr=mSe(L),as=En.placeOrder({symbol:Sn,isBuy:!0,size:Number(St),price:zt,tif:zr,reduceOnly:!1}),rs=En.placeOrder({symbol:Mn,isBuy:!1,size:Number(sr),price:er,tif:zr,reduceOnly:!1}),hs=(async()=>{const[ps,Bi]=await Promise.all([as,rs]);return await MX({draft:Hn,responses:[ps,Bi],user:Hn.userAddress}),"Pair limit placed"})();await Ua(hs,{loading:`Placing ${Sn} long / ${Mn} short limits...`,success:ps=>ps,error:ps=>(ps==null?void 0:ps.message)||"Pair limit failed"}),yt(),R(0),ir("");return}if(u==="twap"){const zr=Math.max(5,Math.min(1440,Number(dn||0)*60+Number(Xe||0))),as=En.placeTwapOrder({symbol:Sn,isBuy:!0,size:Number(St),minutes:zr,randomize:!!Lt,reduceOnly:!!F}),rs=En.placeTwapOrder({symbol:Mn,isBuy:!1,size:Number(sr),minutes:zr,randomize:!!Lt,reduceOnly:!!F}),hs=(async()=>{const[ps,Bi]=await Promise.all([as,rs]);return await MX({draft:Hn,responses:[ps,Bi],user:Hn.userAddress}),"Pair TWAP started"})();await Ua(hs,{loading:"Starting pair TWAP...",success:ps=>ps,error:ps=>(ps==null?void 0:ps.message)||"Pair TWAP failed"}),yt(),R(0),ir("");return}await Ua(Promise.reject(new Error("Unsupported mode for pair")),{loading:"Validating...",success:"OK",error:zr=>zr.message})}catch{}}const lr=m.useMemo(()=>{const Sn=Number(dn||0)*60+Number(Xe||0);return Sn?Math.max(5,Math.min(1440,Sn)):0},[dn,Xe]),Nr=m.useMemo(()=>{if(!lr)return 0;const Sn=Math.floor(lr*60/30);return Math.max(1,Sn+1)},[lr]),fr=m.useMemo(()=>{const Sn=Number(It)||0;return Sn>0?Nt==="COIN"?Sn:We?Sn/We:0:0},[It,Nt,We]),cr=m.useMemo(()=>!Nr||!(fr>0)?0:fr/Nr,[fr,Nr]),ts=m.useMemo(()=>{const Sn=String(e||"").toUpperCase();if(!An||!An.length)return 0;const Mn=An.find(at=>String(at.coin||"").toUpperCase()===Sn);return Mn?Number(Mn.size||0):0},[An,e]);async function is(){try{if(!Et){await Ua(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:Mn=>Mn.message});return}if(!En){await Ua(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:Mn=>Mn.message});return}if(l==="pair"){Bt(!0),await vn(),Bt(!1);return}const Sn=Number(w)||0;if((u==="market"||u==="limit")&&Sn<=0&&!(u==="market"&&F)){await Ua(Promise.reject(new Error("Enter a valid amount")),{loading:"Validating...",success:"OK",error:Mn=>Mn.message});return}if(Bt(!0),u==="market")if(F){const Mn=Sn>0?fC(En.marketClose(e,Number(Ir),{tif:"Ioc",reduceOnly:!0,slippage:W})):fC(En.marketClose(e,void 0,{tif:"Ioc",reduceOnly:!0,slippage:W}));await Ua(Mn,{loading:`Closing ${e} position...`,success:at=>at,error:at=>(at==null?void 0:at.message)||"Close failed"}),yt()}else{const Mn=Q&&J!==""&&Number(J)>0,at=Q&&re!==""&&Number(re)>0,zt=fC(Mn||at?En.placeMarketWithTPSL({symbol:e,isBuy:Zt,size:Number(Ir),entrySlippage:W,tpPrice:Mn?Number(J):null,slPrice:at?Number(re):null,triggerSlippage:.1}):En.marketOpen(e,Zt,Number(Ir),{tif:"Ioc",reduceOnly:!1,slippage:W}));await Ua(zt,{loading:`Placing ${Zt?"Buy":"Sell"} market order...`,success:er=>er,error:er=>(er==null?void 0:er.message)||"Order failed"}),yt(),R(0),C("")}else if(u==="limit"){const Mn=mSe(L),at=Q&&J!==""&&Number(J)>0,zt=Q&&re!==""&&Number(re)>0,er=fC(at||zt?En.placeLimitWithTPSL({symbol:e,isBuy:Zt,size:Number(Ir),price:Number(g),tif:Mn,reduceOnly:F,tpPrice:at?Number(J):null,slPrice:zt?Number(re):null,triggerSlippage:W}):En.placeOrder({symbol:e,isBuy:Zt,size:Number(Ir),price:Number(g),tif:Mn,reduceOnly:F}));await Ua(er,{loading:`Placing ${Zt?"Buy":"Sell"} limit order...`,success:qn=>qn,error:qn=>(qn==null?void 0:qn.message)||"Order failed"}),yt(),R(0),C("")}else if(u==="twap"){const Mn=lr;if(!Mn){await Ua(Promise.reject(new Error("Enter a valid running time (min 5 minutes)")),{loading:"Validating...",success:"OK",error:qn=>qn.message}),Bt(!1);return}let at=0;const zt=Number(It)||0;if(Nt==="COIN")at=zt;else{if(!We){await Ua(Promise.reject(new Error("Price required to convert USD to size")),{loading:"Validating...",success:"OK",error:qn=>qn.message}),Bt(!1);return}at=zt/We}if(!(at>0)){await Ua(Promise.reject(new Error("Enter a valid TWAP size")),{loading:"Validating...",success:"OK",error:qn=>qn.message}),Bt(!1);return}const er=En.placeTwapOrder({symbol:e,isBuy:Zt,size:Number(at),minutes:Mn,randomize:!!Lt,reduceOnly:!!F});await Ua(er,{loading:`Starting TWAP for ${e}...`,success:()=>`TWAP started: ${Number(at).toLocaleString(void 0,{maximumFractionDigits:Ve??4})} ${e} over ${Mn}m`,error:qn=>(qn==null?void 0:qn.message)||"TWAP failed"}),yt()}else{await Ua(Promise.reject(new Error("This mode is not wired to HyperSDK yet")),{loading:"Validating...",success:"OK",error:Mn=>Mn.message}),Bt(!1);return}}catch{}finally{Bt(!1)}}const Or=l==="pair",[hr,Jn]=String(c||"").split("/").map(Sn=>Sn.trim().toUpperCase()),vs=m.useMemo(()=>Or?0:Number((Zt?_[0]:_[1])||0),[Or,Zt,_]),si=Number(Or?Kn||0:Fr||0),ni=u!=="twap"&&si<10,Er=ni?"Order must have minimum value of $10.":Vn?"Not Enough Margin":en?"Placing...":u==="twap"?l==="pair"?"Start Pair TWAP":"Start TWAP":u==="scale"?"Place Scale Orders":l==="pair"?"Place Pair Order":"Place Order";return i.jsxs("div",{className:"w-full text-[12px]",style:{background:EHe,borderRadius:16,padding:12},children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsxs("div",{className:"flex flex-1 gap-2",children:[i.jsx(b4,{onClick:()=>te(!0),children:ge}),i.jsx(b4,{onClick:Rt?()=>he(!0):void 0,children:Rt?`${Ie}x`:i.jsx("span",{className:"flex items-center justify-center gap-1",children:i.jsx("span",{className:"inline-block w-3 h-3 border-2 border-[#67FFBD] border-t-transparent rounded-full animate-spin"})})}),i.jsx(b4,{onClick:()=>ce(!0),children:ct})]}),i.jsx(Ghn,{skipConfirm:h,setSkipConfirm:S})]}),De&&i.jsx("div",{className:"mb-3",children:i.jsx(bT,{wallets:lt,value:Et,selectedBalance:Gt==null?void 0:Gt.balance,onChange:Sn=>{if(String(Et)===String(Sn))return;et(Sn);const Mn=(lt||[]).find(at=>String(at.wallet_id)===String(Sn));o==null||o({id:String(Sn),address:(Mn==null?void 0:Mn.wallet_address)||null})}})}),i.jsx(ehn,{mode:u,onModeChange:d,moreItems:[{key:"twap",label:"TWAP"}],className:"mb-3"}),!Or&&i.jsx("div",{className:"mb-1",children:i.jsxs("div",{className:"mb-3 grid grid-cols-2 gap-2",children:[i.jsx("button",{type:"button",onClick:()=>x("buy"),className:"h-[34px] rounded-lg font-bold transition-colors flex justify-center items-center",style:{background:f==="buy"?"rgb(103, 255, 189)":To,color:f==="buy"?"rgb(15, 21, 26)":Gi},children:"Buy / Long"}),i.jsx("button",{type:"button",onClick:()=>x("sell"),className:"h-[34px] rounded-lg font-bold transition-colors flex justify-center items-center",style:{background:f==="sell"?"rgb(255,121,124)":To,color:f==="sell"?"rgb(15, 21, 26)":Gi},children:"Sell / Short"})]})}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{style:{color:Ri},children:"Available to Trade"}),i.jsxs("div",{className:"text-white font-semibold",children:[vs.toLocaleString(void 0,{maximumFractionDigits:2})," ","USDC"]})]}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{style:{color:Ri},children:"Current Position"}),i.jsx("div",{className:"text-white font-semibold",children:ts?`${Math.abs(ts).toLocaleString(void 0,{maximumFractionDigits:Ve??5})} ${e}`:`0.00000 ${e}`})]}),!Or&&u==="limit"&&i.jsx("div",{className:"mb-3",children:i.jsx(bb,{label:"Price (USDC)",value:g,onChange:v,right:i.jsx("div",{className:"h-[22px] px-2 rounded-md flex justify-center items-center cursor-pointer",style:{background:"#1b242c",color:"#67FFBD",border:`1px solid ${Oa}`},onClick:()=>v(t??""),children:"Mid"})})}),!Or&&(u==="market"||u==="limit")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mb-3",children:i.jsx(bb,{label:"Size",value:w,onChange:ms,right:i.jsx(ZP,{value:N,onChange:vr,items:[{key:"USD",label:"USDC"},{key:"COIN",label:e}]})})}),i.jsxs("div",{className:"flex items-center gap-3 mb-6 ",children:[i.jsx(YN,{value:P,onChange:nn,accent:Ge}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:P,onChange:Sn=>nn(Math.max(0,Math.min(100,Number(Sn.target.value)||0))),style:{color:Gi,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:Ri},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:`${u==="market"?"flex-col space-y-2":"flex"} items-center justify-between mb-2`,children:[i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:F,onChange:Sn=>U(Sn.target.checked)}),"Reduce Only"]}),u==="limit"&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(pi,{align:"left",content:"Time In Force <br><br>GTC (Good Til Cancel): Order will rest until filled or canceled.<br><br>IOC (Immediate Or Cancel): Any portion that is not immediately filled will be canceled.<br><br>ALO (Add Liquidity Only): Order will exist only as a limit order on the book. Also known as post-only.",children:i.jsx("span",{style:{color:Ri},children:"TIF"})}),i.jsx(ZP,{value:L,onChange:z,items:[{key:"GTC",label:"GTC"},{key:"IOC",label:"IOC"},{key:"ALO",label:"ALO"}]})]}),u==="market"&&i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:Q,onChange:Sn=>ne(Sn.target.checked)}),"TP/SL"]})]}),u==="limit"&&i.jsxs("label",{className:"flex items-center gap-2 mb-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:Q,onChange:Sn=>ne(Sn.target.checked)}),"TP/SL"]}),Q&&i.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[i.jsx(bb,{label:"TP",value:J,onChange:ue}),i.jsx(bb,{label:"Gain %",value:Y,onChange:Xt,right:i.jsx("span",{style:{color:Ri},children:"%"})}),i.jsx(bb,{label:"SL",value:re,onChange:Ft}),i.jsx(bb,{label:"Loss %",value:oe,onChange:rt,right:i.jsx("span",{style:{color:Ri},children:"%"})})]})]}),Or&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mb-2 w-full flex justify-between gap-2",children:[i.jsxs("span",{className:"h-[34px] rounded-lg font-semibold bg-[rgba(103,255,189,0.16)] text-[#67FFBD] flex justify-center items-center w-1/2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${hr}.svg`,alt:"Dextrabot - Terminal",className:"w-4 h-4 mr-2"}),hr," Long"]}),i.jsxs("span",{className:"h-[34px] rounded-lg font-semibold bg-[rgba(255,121,124,0.12)] text-[#FF7272] flex justify-center items-center w-1/2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Jn}.svg`,alt:"Dextrabot - Terminal",className:"w-4 h-4 mr-2"}),Jn," Short"]})]}),i.jsx("div",{className:"mb-3",children:i.jsx(Whn,{value:nr,onChange:wn,leftLabel:hr,rightLabel:Jn,leftUsd:Number(Kn||0)>0?Number(Kn)*nr/100:0,rightUsd:Number(Kn||0)>0?Number(Kn)*(100-nr)/100:0})}),i.jsx("div",{className:"mb-3",children:i.jsx(bb,{label:"Size (USD)",value:Kn,onChange:Sn=>{ir(Sn)},right:i.jsx("div",{className:"h-[22px] px-2 rounded-md flex justify-center items-center cursor-pointer",style:{background:"#1b242c",color:"#67FFBD",border:`1px solid ${Oa}`},onClick:()=>{const Sn=Wn*(Number(Ie)||1);ir(String(Sn.toFixed(2)))},children:"Max"})})}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:F,onChange:Sn=>U(Sn.target.checked)}),"Reduce Only"]}),u==="limit"&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{style:{color:Ri},children:"TIF"}),i.jsx(ZP,{value:L,onChange:z,items:[{key:"GTC",label:"GTC"},{key:"IOC",label:"IOC"},{key:"ALO",label:"ALO"}]})]})]})]}),u==="twap"&&!Or&&i.jsxs(i.Fragment,{children:[i.jsx(bb,{label:"Total Size",value:It,onChange:Kr,right:i.jsx(ZP,{value:Nt,onChange:As,items:[{key:"USDC",label:"USDC"},{key:"COIN",label:e}]})}),i.jsxs("div",{className:"flex items-center gap-3 mb-8 mt-3",children:[i.jsx(YN,{value:Ke,onChange:Br,accent:Ge}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:Ke,onChange:Sn=>Br(Math.max(0,Math.min(100,Number(Sn.target.value)||0))),style:{color:Gi,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:Ri},className:"ml-1",children:"%"})]})]}),i.jsx("div",{className:"mb-2 mt-3",style:{color:Ri},children:"Running Time (5m - 24h)"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[i.jsx("div",{className:"h-[30px] px-2 rounded-lg flex items-center",style:{background:To,border:`1px solid ${Oa}`},children:i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",placeholder:"Hour(s)",value:dn===0?"":dn,onChange:Sn=>{const Mn=Sn.target.value.replace(/[^\d]/g,""),at=Math.max(0,Math.min(24,Number(Mn)||0));Pt(at)},style:{color:dn?"#FFFFFF":Ri,fontFeatureSettings:'"tnum"'}})}),i.jsx("div",{className:"h-[30px] px-2 rounded-lg flex items-center",style:{background:To,border:`1px solid ${Oa}`},children:i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",placeholder:"Minute(s)",value:Xe===0?"":Xe,onFocus:()=>{Xe===5&&Ut(0)},onChange:Sn=>{const Mn=Sn.target.value.replace(/[^\d]/g,""),at=Math.max(0,Math.min(59,Number(Mn)||0));Ut(at)},style:{color:Xe?"#FFFFFF":Ri,fontFeatureSettings:'"tnum"'}})})]}),i.jsxs("div",{className:"flex-col space-y-2 items-center gap-6 mb-3",children:[i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:Lt,onChange:Sn=>qe(Sn.target.checked)}),"Randomize"]}),i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:F,onChange:Sn=>U(Sn.target.checked)}),"Reduce Only"]})]})]}),De?i.jsx("button",{onClick:is,disabled:en||!Et||Vn||ni,className:"w-full h-[32px] rounded-xl font-bold transition-opacity mb-2 flex items-center justify-center disabled:opacity-60",style:{background:Ge,color:"#0f151a"},children:Er}):i.jsx(r0,{onClick:()=>{Ye==null||Ye(),Fe(!0)}}),u==="twap"&&!Or?i.jsxs("div",{className:"mt-4 border-t border-b border-dashed border-[#2F2F2F]",children:[i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Frequency"}),i.jsx("span",{className:"text-white",children:"30 seconds"})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Runtime"}),i.jsxs("span",{className:"text-white",children:[lr.toLocaleString(void 0,{maximumFractionDigits:0})," ","minutes"]})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Number of Orders"}),i.jsx("span",{className:"text-white",children:Nr.toLocaleString(void 0,{maximumFractionDigits:0})})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Size per Suborder"}),i.jsx("span",{className:"text-white",children:cr>0?`${cr.toLocaleString(void 0,{maximumFractionDigits:Ve??5})} ${e}`:`0.00000 ${e}`})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Fees"}),i.jsx("span",{className:"text-[#67FFBD]",children:pr})]})]}):i.jsxs("div",{className:"mt-4 border-t border-b border-dashed border-[#2F2F2F]",children:[i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Liquidation Price"}),i.jsx("span",{className:"text-white",children:Or?"-":os?`$${os.toLocaleString(void 0,{maximumFractionDigits:2})}`:"$0.00"})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Order Value"}),i.jsx("span",{className:"text-white",children:Or?`$${Number(Kn||0).toLocaleString(void 0,{maximumFractionDigits:2})}`:`$${(Fr||0).toLocaleString(void 0,{maximumFractionDigits:2})}`})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Margin Required"}),i.jsx("span",{className:"text-white",children:Or?`$${(Number(Kn||0)/(Number(Ie)||1)||0).toLocaleString(void 0,{maximumFractionDigits:2})}`:`$${(Lr||0).toLocaleString(void 0,{maximumFractionDigits:2})}`})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Slippage"}),i.jsxs("button",{type:"button",onClick:()=>Yn(!0),className:"text-[#67FFBD] hover:opacity-80 h-5 text-xs flex justify-center items-center",children:[`Est: ${Gs}% / `,`Max: ${Number(sn||0).toFixed(2)}%`]})]})]}),De&&bt&&i.jsx("button",{onClick:()=>ft(!0),className:"flex w-full h-[32px] px-4 py-2 justify-center items-center gap-[10px] shrink-0 rounded-lg bg[rgba(103,255,189,0.16)] text-[#67FFBD] font-inter text-[13px] not-italic font-medium leading-[16px] mt-3 transition-opacity",children:"Deposit"}),De&&bt&&i.jsxs("div",{className:"flex w-full gap-2 mt-2",children:[i.jsxs(cSe,{onClick:()=>$e(!0),className:"flex-1",children:["Perps ",i.jsx(kae,{className:"mx-1 text-xs"})," Spot"]}),i.jsx(cSe,{onClick:()=>tt(!0),className:"flex-1",children:"Withdraw"})]}),i.jsxs("div",{className:"mt-3 pt-2",children:[i.jsx("div",{className:"mb-2 text-white font-inter text-[13px] font-normal leading-4",children:"Account Equity"}),i.jsx(xv,{k:"Spot",v:`$${pSe(qt??Number(At.spot||0))}`}),i.jsx(xv,{k:"Perps",v:`$${pSe(Gt.balance)}`})]}),i.jsxs("div",{className:"mt-3 pt-2",children:[i.jsx("div",{className:"mb-2 text-white font-inter text-[13px] font-normal leading-4",children:"Perps Overview"}),i.jsx(xv,{k:"Balance",v:`$${Q7(Gt.balance,2)}`}),i.jsx(xv,{k:"Unrealized PNL",v:i.jsxs("span",{style:{color:Gt.uPnl<0?"#FF7173":"#67FFBD"},children:["$",Q7(Gt.uPnl,2)]})}),i.jsx(xv,{k:"Cross Margin Ratio",v:i.jsxs("span",{style:{color:Gt.cmr>=.5?"#FF7173":"#67FFBD"},children:[Q7(Gt.cmr*100,2),"%"]}),link:!0}),i.jsx(xv,{k:"Maintenance Margin",v:`$${Q7(Gt.maintenanceMargin,2)}`}),i.jsx(xv,{k:"Cross Account Leverage",v:`${Q7(Gt.crossLeverage,2)}x`})]}),i.jsx(lhn,{open:ot,onClose:()=>ft(!1),initialAsset:"USDC",initialChain:"Arbitrum",toWalletAddress:(bt==null?void 0:bt.wallet_address)||""}),i.jsx(PHe,{open:Qe,onClose:()=>$e(!1),perpsAvailable:or,spotUsdcAvailable:mt,onSubmit:gr,loading:on,initialToPerp:!1}),i.jsx(Vhn,{open:it,onClose:()=>tt(!1),perpsBalance:Number((Gt==null?void 0:Gt.balance)??0),defaultDest:st||""}),i.jsx(Jh,{open:ae,onClose:()=>he(!1),children:i.jsxs(cm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:Ri},children:["Control the leverage used for ",Or?`${hr}/${Jn}`:e," ","positions. The maximum leverage is ",xt,"x. Max position size decreases the higher your leverage."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:xt,step:1,value:Ie,onChange:Sn=>Re(Number(Sn.target.value)),className:"flex-1",style:{accentColor:Fg}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",value:Ie,onChange:Sn=>Re(Math.max(1,Math.min(xt,Number(Sn.target.value)||1))),style:{color:Gi,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:Ri},className:"ml-1",children:"x"})]})]}),i.jsx(P0,{onClick:()=>hn(()=>he(!1)),children:"Confirm"}),i.jsxs("div",{className:"mt-3 flex items-start gap-2 text-[12px]",style:{color:"#ffd27a"},children:[i.jsx("span",{children:"⚠️"}),i.jsx("span",{children:"Higher leverage increases the risk of liquidation."})]})]})}),i.jsx(Jh,{open:_t,onClose:()=>Yn(!1),children:i.jsxs(cm,{title:"Adjust Max Slippage",children:[i.jsx("div",{className:"text-[12px] leading-5 mb-3",style:{color:Ri},children:"Max slippage only affects market orders placed from the order form. Closing positions will use max slippage of 8% and market TP/SL orders will use max slippage of 10%."}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2 mb-3",style:{width:120,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right",type:"text",inputMode:"decimal",value:sn,onChange:Sn=>{const Mn=Sn.target.value.replace(",",".");if(Mn===""){Tn("");return}/^\d*\.?\d*$/.test(Mn)&&Tn(Mn)},style:{color:Gi,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:Ri},className:"ml-1",children:"%"})]}),i.jsx(P0,{onClick:nt,children:"Confirm"})]})}),i.jsx(Jh,{open:V,onClose:()=>te(!1),children:i.jsxs(cm,{title:`${Or?`${hr}/${Jn}`:e} Margin Mode`,children:[i.jsx(EX,{active:ge==="Cross",onClick:()=>Ae("Cross"),title:"Cross",desc:"All cross positions share the same cross margin as collateral. In the event of liquidation, your cross margin balance and any remaining open positions under assets in this mode may be forfeited."}),i.jsx(EX,{active:ge==="Isolated",onClick:()=>Ae("Isolated"),title:"Isolated",desc:"Manage your risk on individual positions by restricting the amount of margin allocated to each. If the margin ratio of an isolated position reaches 100%, the position will be liquidated. Margin can be added or removed to individual positions in this mode."}),i.jsx("div",{className:"mt-3",children:i.jsx(P0,{onClick:()=>hn(()=>te(!1)),children:"Confirm"})})]})}),i.jsx(Jh,{open:Ce,onClose:()=>ce(!1),children:i.jsxs(cm,{title:"Position Mode",children:[i.jsx(EX,{active:ct==="One-Way",onClick:()=>Vt("One-Way"),title:"One-Way",desc:"Open orders in the same direction merge into a single position for each market."}),i.jsx("div",{className:"mt-3",children:i.jsx(P0,{onClick:()=>ce(!1),children:"Confirm"})})]})})]})}const yb=({name:e,minFilterType:t,maxFilterType:n,handleChange:r,minInputName:s,maxInputName:a,isTooltip:o})=>{const l=f=>{f.preventDefault()},c=f=>{f.target.addEventListener("wheel",l,{passive:!1})},u=f=>{f.target.removeEventListener("wheel",l)},d=f=>{["-","+","e"].includes(f.key)&&f.preventDefault()};return i.jsxs("div",{className:`${e=="Account Value"?"mb-20":""} col-span-1 flex flex-col justify-start max-w-full z-3 font-manrope gap-[13px] mx-4`,children:[i.jsxs("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px] flex justify-start items-center gap-1",children:[e,o&&i.jsxs("span",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx(Si,{className:"text-[#c9c9c9] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Fa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!0})})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{value:t,onChange:r,type:"number",name:s,onFocus:c,onBlur:u,autoComplete:"off",onKeyDown:["Unrealized PnL","Funding Paid"].includes(e)?void 0:d,placeholder:"Min",className:`py-0.5 bg-[#1b1b1b] rounded-md border border-[#303030] h-8 block text-white text-sm font-medium font-inter leading-[8px] w-1/2 px-2 ${t!=null&&t!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`}),i.jsx("input",{value:n,onChange:r,type:"number",name:a,autoComplete:"off",onFocus:c,onBlur:u,onKeyDown:["Unrealized PnL","Funding Paid"].includes(e)?void 0:d,placeholder:"Max",className:`bg-[#1b1b1b] rounded-md border border-[#303030] py-0.5 h-8 block sm:text-sm font-semibold font-manrope leading-none w-1/2 px-2 ${n!=null&&n!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`})]})]})},epn=({walletFilter:e,setWalletFilter:t,filterTerminal:n,setFilterTerminal:r,resetFilters:s})=>{const a=m.useRef(null),o=c=>{const{name:u,value:d}=c.target;r(f=>({...f,[u]:d}))},l=c=>{var u;c.key==="Escape"&&(t(""),(u=a.current)==null||u.blur())};return i.jsxs("div",{className:"flex flex-col items-center gap-4 w-full h-full p-1 sm:p-2 mt-4 sm:px-0 overflow-y-scroll",children:[i.jsxs("div",{className:"flex flex-col items-center gap-2.5 w-[90%] sm:w-[90%]",children:[i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px] flex justify-start items-center gap-1 w-full pl-1",children:"Search Wallet"}),i.jsxs("div",{className:"flex justify-center items-center gap-0.5 h-max rounded-lg border border-[#333333] w-full overflow-hidden p-0.5",children:[i.jsx("input",{ref:a,type:"text",value:e,name:"walletFilter",onChange:c=>t(c.target.value),onKeyDown:l,className:"bg-[#353535] rounded text-white py-1 pl-2 pr-3 w-full text-sm outline-none placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c] font-manrope",placeholder:"Search Wallet"}),i.jsx("div",{onClick:()=>t(""),className:"text-[#aaa] hover:text-white outline-none focus:outline-none focus:ring-0 border-none w-4 h-[26px] bg-[#353535] hover:bg-[#333333] rounded-l rounded-r-lg flex justify-center items-center cursor-pointer",children:i.jsx("img",{src:Ba,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})]}),i.jsx(yb,{minFilterType:n==null?void 0:n.min_notional,maxFilterType:n==null?void 0:n.max_notional,handleChange:o,minInputName:"min_notional",maxInputName:"max_notional",name:"Notional",isTooltip:!1}),i.jsx(yb,{minFilterType:n==null?void 0:n.min_size,maxFilterType:n==null?void 0:n.max_size,handleChange:o,minInputName:"min_size",maxInputName:"max_size",name:"Size",isTooltip:!1}),i.jsx(yb,{minFilterType:n==null?void 0:n.min_entry,maxFilterType:n==null?void 0:n.max_entry,handleChange:o,minInputName:"min_entry",maxInputName:"max_entry",name:"Entry",isTooltip:!1}),i.jsx(yb,{minFilterType:n==null?void 0:n.min_liq_price,maxFilterType:n==null?void 0:n.max_liq_price,handleChange:o,minInputName:"min_liq_price",maxInputName:"max_liq_price",name:"Liq. Price",isTooltip:!1}),i.jsx(yb,{minFilterType:n==null?void 0:n.min_unrealized_pnL,maxFilterType:n==null?void 0:n.max_unrealized_pnL,handleChange:o,minInputName:"min_unrealized_pnL",maxInputName:"max_unrealized_pnL",name:"Unrealized PnL",isTooltip:!1}),i.jsx(yb,{minFilterType:n==null?void 0:n.min_funding_paid,maxFilterType:n==null?void 0:n.max_funding_paid,handleChange:o,minInputName:"min_funding_paid",maxInputName:"max_funding_paid",name:"Funding Paid",isTooltip:!1}),i.jsx(yb,{minFilterType:n==null?void 0:n.min_account_value,maxFilterType:n==null?void 0:n.max_account_value,handleChange:o,minInputName:"min_account_value",maxInputName:"max_account_value",name:"Margin",isTooltip:!1}),i.jsx(yb,{minFilterType:n==null?void 0:n.min_perp_equity,maxFilterType:n==null?void 0:n.max_perp_equity,handleChange:o,minInputName:"min_perp_equity",maxInputName:"max_perp_equity",name:"Account Value",isTooltip:!1})]})},OHe=m.createContext({key:"All",setKey:()=>{}});function tpn({children:e}){const t=typeof window<"u"&&localStorage.getItem("terminal_side_filter")||"All",[n,r]=m.useState(t);m.useEffect(()=>{typeof window<"u"&&localStorage.setItem("terminal_side_filter",n)},[n]);const s=m.useMemo(()=>({key:n,setKey:r}),[n]);return i.jsx(OHe.Provider,{value:s,children:e})}function v2(){return m.useContext(OHe)}function npn({className:e=""}){const{key:t,setKey:n}=v2(),r=["All","Active","Long","Short"];return i.jsxs("label",{className:`inline-flex items-center gap-2 ${e}`,children:[i.jsx("span",{className:"text-[#9B9B9B] text-[12px]",children:"Filter"}),i.jsx("select",{value:t,onChange:s=>n(s.target.value),className:"h-7 bg-[#262626] text-white text-[12px] rounded-md px-2 border border-[#2F2F2F] outline-none",children:r.map(s=>i.jsx("option",{value:s,children:s},s))})]})}function rpn(e){var a;const t=((e==null?void 0:e.direction)||(e==null?void 0:e.posSide)||(e==null?void 0:e.position_side)||"").toString().toLowerCase();if(t==="long")return"Long";if(t==="short")return"Short";const n=((e==null?void 0:e.dir)||(e==null?void 0:e.sideText)||"").toString().toLowerCase();if(n.includes("open long")||n.includes("close short")||n.includes("short > long")||n.endsWith(" long"))return"Long";if(n.includes("open short")||n.includes("close long")||n.includes("long > short")||n.endsWith(" short"))return"Short";const r=((e==null?void 0:e.side)||"").toString();if(r==="B"||r==="Buy")return"Long";if(r==="A"||r==="Sell")return"Short";if((e==null?void 0:e.isBuy)===!0||(e==null?void 0:e.b)===!0)return"Long";if((e==null?void 0:e.isBuy)===!1||(e==null?void 0:e.b)===!1)return"Short";const s=Number((e==null?void 0:e.szi)??(e==null?void 0:e.size)??((a=e==null?void 0:e.position)==null?void 0:a.szi)??0);return s>0?"Long":s<0?"Short":(e==null?void 0:e.side)==="Long"||(e==null?void 0:e.type)==="Long"?"Long":(e==null?void 0:e.side)==="Short"||(e==null?void 0:e.type)==="Short"?"Short":null}function spn(e,t){var n;if(t==="positions"){const r=Number((e==null?void 0:e.szi)??(e==null?void 0:e.size)??((n=e==null?void 0:e.position)==null?void 0:n.szi)??0);return Math.abs(r)>0}return!0}function Zg(e,t="generic",n="All"){if(!Array.isArray(e)||e.length===0)return e||[];if(n==="All")return e;if(n==="Active")return e.filter(s=>spn(s,t));const r=n;return e.filter(s=>{const a=rpn(s);return a?a===r:!1})}const ipn=({data:e,loading:t,error:n,isDigits:r,period:s,periods:a,handlePeriodChange:o})=>{const[l,c]=m.useState("All"),[u,d]=m.useState(!1),{key:f}=v2(),{copyTradeWatchList:x,trackedWatchList:g,setSignModalOpen:v}=m.useContext(Qr),{address:w}=Jr(),[C,N]=m.useState(!1),[I,P]=m.useState(null),[R,F]=m.useState(null),[U,L]=m.useState(""),[z,Q]=m.useState(""),[ne,J]=m.useState({min_notional:"",max_notional:"",min_size:"",max_size:"",min_entry:"",max_entry:"",min_mark_price:"",max_mark_price:"",min_liq_price:"",max_liq_price:"",min_unrealized_pnL:"",max_unrealized_pnL:"",min_funding_paid:"",max_funding_paid:"",min_account_value:"",max_account_value:"",min_perp_equity:"",max_perp_equity:""}),X=()=>{c("All"),Q(""),J({min_notional:"",max_notional:"",min_size:"",max_size:"",min_entry:"",max_entry:"",min_mark_price:"",max_mark_price:"",min_liq_price:"",max_liq_price:"",min_unrealized_pnL:"",max_unrealized_pnL:"",min_funding_paid:"",max_funding_paid:"",min_account_value:"",max_account_value:"",min_perp_equity:"",max_perp_equity:""})},pe=((G,V)=>V.reduce((te,ae)=>{const he=G[ae];return he!==void 0&&he!==""&&he!==null&&te++,te},0))({...ne,walletFilter:z},[...Object.keys(ne),"walletFilter"]),Y=m.useMemo(()=>Zg(e,"positions",f),[e,f]),ie=async({walletAddress:G,isFollow:V,isScalper:te})=>{try{L(G);const ae=window.localStorage.getItem("hyperToken"),he=window.localStorage.getItem("hyperAddress");if(!ae){v(!0);return}const Ce=V?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",ce=V?{address:w?w.toLowerCase():he,token:ae,follow_address:G.toLowerCase()}:{address:w?w.toLowerCase():he,token:ae},ge=await fetch(Ce,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ce)});if(!ge.ok)throw new zl(`Server responded with status ${ge.status}`);const Ae=await ge.json();Ae.success?(P(Array.isArray(Ae==null?void 0:Ae.data)?[...Ae.data].sort((ye,je)=>new Date(je.created_at||0)-new Date(ye.created_at||0)):Ae==null?void 0:Ae.data),F(te),N(!0)):ln.error(Ae.error_message)}catch(ae){ln.error(ae.message||"Something went wrong!")}},oe=[{key:"action",label:"Action",sortable:!1,width:"125px",render:(G,V)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{onClick:te=>{te.preventDefault();const ae=x==null?void 0:x.some(he=>he.wallet_address===(V==null?void 0:V.address));ie({walletAddress:V==null?void 0:V.address,isFollow:ae,isScalper:V==null?void 0:V.is_scalper})},className:`${x.some(te=>te.wallet_address===(V==null?void 0:V.address))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} h-[22px] rounded-[256px] inline-flex items-center px-2 text-[12px] leading-[8px] tracking-tight cursor-pointer`,children:"Copy Trade"}),i.jsx(y5,{walletAddress:V==null?void 0:V.address,children:i.jsx("div",{className:"w-[18px] h-[18px] flex items-center justify-center cursor-pointer",children:g.some(te=>te.wallet_address===(V==null?void 0:V.address))?i.jsx("img",{src:a5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})},{key:"address",label:"Wallet",sortable:!0,sortValue:G=>(G.address||"").toLowerCase(),render:(G,V)=>i.jsx("div",{onClick:()=>window.open(`/wallet-details/${V==null?void 0:V.address}`,"_blank"),className:"flex items-center gap-2.5 cursor-pointer",children:i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Zx,{info:V!=null&&V.address?`${V.address.slice(0,5)}...${V.address.slice(-4)}`:"--",textColor:"text-white"}),i.jsx("img",{onClick:te=>{te.stopPropagation(),navigator.clipboard.writeText((V==null?void 0:V.address)||""),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:wo,alt:"",className:"cursor-pointer"})]})})},{key:"direction",label:"Direction",sortable:!0,sortValue:G=>G.direction==="long"?1:G.direction==="short"?0:-1,render:(G,V)=>i.jsx("div",{className:"flex items-center gap-2 h-8",children:i.jsxs("div",{className:`${V.direction==="long"?"text-[#67ffbd] bg-[#67ffbd]/20":V.direction==="short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-0.5`,children:[i.jsx("div",{className:"w-3 h-3 flex items-center justify-center",children:V.direction==="long"?i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):V.direction==="short"?i.jsx(Ts,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Ts,{className:"text-[#67FFBD] rotate-180 w-3 h-3"})}),i.jsxs("div",{className:"text-[11px] font-semibold leading-[8px] tracking-wide uppercase",children:[V.direction," - ",V.leverage_value,"x"]})]})})},{key:"notional",label:"Notional",sortable:!0,sortValue:G=>Number(G.notional)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.notional)==null||isNaN(parseFloat(V==null?void 0:V.notional))?"--":`$${ed(V==null?void 0:V.notional)}`,textColor:"text-white"})},{key:"szi",label:"Size",sortable:!0,sortValue:G=>Number(G.szi)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.szi)==null||isNaN(parseFloat(V==null?void 0:V.szi))?"--":`${Cr(V==null?void 0:V.szi)}`,textColor:"text-white"})},{key:"entry_price",label:"Entry Price",sortable:!0,sortValue:G=>Number(G.entry_price)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.entry_price)==null||isNaN(parseFloat(V==null?void 0:V.entry_price))?"--":`$${Vw(parseFloat(V==null?void 0:V.entry_price).toFixed((V==null?void 0:V.entry_price)>=1e4?0:r))}`,textColor:"text-white"})},{key:"liq_price",label:"Liq. Price",sortable:!0,sortValue:G=>Number(G.liq_price)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.liq_price)==null||isNaN(parseFloat(V==null?void 0:V.liq_price))?"--":`$${Vw(parseFloat(V==null?void 0:V.liq_price).toFixed((V==null?void 0:V.liq_price)>=1e4?0:r))}`,textColor:"text-white"})},{key:"unrealized_pnl",label:"Unrealized PnL",sortable:!0,sortValue:G=>Number(G.unrealized_pnl)||0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.unrealized_pnl)==null||isNaN(parseFloat(V==null?void 0:V.unrealized_pnl))?"--":`$${Cr(Math.abs(V==null?void 0:V.unrealized_pnl))}`,textColor:`${(V==null?void 0:V.unrealized_pnl)==null||isNaN(parseFloat(V==null?void 0:V.unrealized_pnl))||(V==null?void 0:V.unrealized_pnl)===0?"text-white":(V==null?void 0:V.unrealized_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})},{key:"funding_paid",label:"Funding Paid",sortable:!0,sortValue:G=>Number(G.funding_paid)||0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.funding_paid)==null||isNaN(parseFloat(V==null?void 0:V.funding_paid))?"--":`$${Cr(Math.abs(V==null?void 0:V.funding_paid))}`,textColor:`${(V==null?void 0:V.funding_paid)==null||isNaN(parseFloat(V==null?void 0:V.funding_paid))||(V==null?void 0:V.funding_paid)===0?"text-white":(V==null?void 0:V.funding_paid)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})},{key:"account_value",label:"Margin",sortable:!0,sortValue:G=>Number(G.account_value)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.account_value)==null||isNaN(parseFloat(V==null?void 0:V.account_value))?"--":`$${ed(V==null?void 0:V.account_value)}`,textColor:"text-white"})},{key:"perp_equity",label:"Account Value",sortable:!0,sortValue:G=>Number(G.perp_equity)||-1/0,render:(G,V)=>i.jsx(Zx,{info:(V==null?void 0:V.perp_equity)==null||isNaN(parseFloat(V==null?void 0:V.perp_equity))?"--":`$${ed(V==null?void 0:V.perp_equity)}`,textColor:"text-white"})}];return i.jsxs(i.Fragment,{children:[i.jsx(v5,{open:C,setOpen:N,copyTradeData:I,copyTradeWallet:U,setCopyTradeWallet:L,isScalper:R,setCopyTradeData:P}),i.jsxs("div",{className:"flex flex-col w-full h-full mt-4",children:[i.jsx("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-0 pl-3 pr-5",children:i.jsxs("div",{className:"flex flex-row justify-start items-center gap-2 sm:gap-4 md:gap-2 lg:gap-4 flex-wrap",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 sm:gap-4 md:gap-2 lg:gap-4",children:[i.jsxs("button",{onClick:()=>d(!u),className:`${pe>0?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none border-none relative`,children:[i.jsx($f,{className:`w-4 h-4 ${pe>0?"text-blue-500":"text-white"}`}),pe>0&&i.jsx("div",{className:"absolute -top-2 -right-2 rounded-full w-4 h-4 text-[11px] bg-[#8D67FF] text-white flex justify-center items-center",children:pe})]}),pe>0&&i.jsx(apn,{title:"Reset Filter",set_click:()=>X(),tableSortButton:"Reset"})]}),i.jsx("div",{className:"flex",children:i.jsx(kce,{periods:a,selectedPeriod:s,handlePeriod:o,borderColor:"ticker"})}),t&&i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]})]})}),i.jsxs("div",{className:"flex flex-col sm:flex-row w-full h-full",children:[i.jsxs("div",{className:`${u?"":"hidden"} w-[95%] sm:w-72 sm:min-w-72 h-[calc(100%-70px)] bg-[#232323] border border-[#292929] rounded-2xl m-2 overflow-hidden`,children:[i.jsxs("div",{className:"w-full sticky top-0 bg-[#232323] flex justify-between items-center pt-[2px] pl-3 pr-1 mt-3",children:[i.jsx("div",{className:"text-white text-base font-semibold font-inter leading-[8px]",children:"Filters"}),i.jsx("div",{onClick:()=>X(),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md inline-flex items-center mr-3 cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-inter leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx(epn,{walletFilter:z,setWalletFilter:Q,filterTerminal:ne,setFilterTerminal:J,resetFilters:X})]}),i.jsx("div",{className:"w-full h-[calc(100%-60px)] relative flex-grow",children:t?i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-10",children:i.jsx(Da,{})}):n&&!e?i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[66vh] flex-col justify-center items-center",children:i.jsx(zl,{})}):(Y==null?void 0:Y.length)===0?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-inter leading-[8px] pt-3",children:"No data matched the selected filter range."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-inter leading-[14px] tracking-wide",children:"Please adjust your filters and try again."})})]})]})})}):i.jsx(Ru,{data:Y,columns:oe,rowHeight:30,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal"})})]})]})]})},Zx=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-[12px] font-semibold font-inter leading-none flex items-center justify-start px-1 gap-0.5`,children:e})}),apn=({title:e,set_click:t,tableSortButton:n})=>i.jsx("div",{onClick:t,className:`${n==e?"bg-[#3d3d3d] text-white":n=="Reset"?"bg-[#3d3d3d] text-white hover:bg-[#4d4d4d]":"bg-[#161616] text-[#9b9b9b]"} text-[12px] font-medium font-inter leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-7`,children:e});function Iv(e,t=2){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function gSe(e){return new Promise(t=>setTimeout(t,e))}function bSe(e){if(!e)return"";const t=String(e);return t.slice(0,6)+"..."+t.slice(-4)}function opn({open:e,onClose:t,children:n,title:r}){return e?i.jsxs("div",{className:"fixed inset-0 z-[999] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[1px]",onClick:t}),i.jsxs("div",{className:"relative w-[560px] max-w-[92vw] rounded-2xl border border-[#2A2A2A] bg-[#161616] shadow-2xl",children:[i.jsxs("div",{className:"px-5 pt-4 pb-2 flex items-center justify-between",children:[i.jsx("div",{className:"font-inter text-[18px] leading-6 text-white",children:r}),i.jsx("button",{onClick:t,className:"w-8 h-8 flex items-center justify-center rounded-lg bg-[#222] text-[#BDBDBD]",children:"✕"})]}),i.jsx("div",{className:"px-5 pb-5",children:n})]})]}):null}function tF({children:e}){return i.jsx("div",{className:"text-[12px] text-[#9B9B9B] font-inter mb-1",children:e})}function ySe({value:e,onChange:t,placeholder:n,invalid:r=!1}){return i.jsx("input",{value:e,onChange:s=>t(s.target.value),placeholder:n,className:`w-full h-10 px-3 rounded-lg bg-[#101010] outline-none text:white ${r?"border border-[#FF7173]":"border border-[#2A2A2A]"}`})}function vSe({value:e,onChange:t,options:n,disabled:r=!1}){return i.jsx("select",{disabled:r,value:e,onChange:s=>t(s.target.value),className:`w-full h-10 px-3 rounded-lg bg-[#101010] border text-white outline-none ${r?"border-[#2A2A2A] opacity-60 cursor-not-allowed":"border-[#2A2A2A]"}`,children:n.map(s=>i.jsx("option",{value:s.value,className:"bg-[#101010]",children:s.label},s.value))})}function lpn({children:e}){return i.jsx("div",{className:"grid grid-cols-2 gap-4",children:e})}function cpn({onMax:e}){return i.jsx("button",{onClick:e,className:"px-2 h-8 rounded-md bg-[#1F2A23] text-[#67FFBD] text-[12px] font-medium ml-2",children:"MAX"})}function upn({children:e,onClick:t,disabled:n,loading:r}){return i.jsx("button",{onClick:t,disabled:n||r,className:`${n||r?"bg-[#2C2C2C] text-[#8A8A8A] cursor-not-allowed":"bg[rgba(103,255,189,0.16)] text-[#67FFBD] hover:opacity-95"} w-full h-9 rounded-xl mt-5 font-medium`,children:r?"Processing...":e})}function dpn(){const e=typeof window<"u"?window.ethereum:null;if(!e)return null;if(Array.isArray(e.providers)&&e.providers.length){const t=e.providers.find(r=>r&&r.isMetaMask);if(t)return t;const n=e.providers.find(r=>r&&r.isCoinbaseWallet);return n||e.providers[0]}return e}async function fpn(e,t){let n=await e.request({method:"eth_chainId"});if((n==null?void 0:n.toLowerCase())!==t.toLowerCase())try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(r){if(r&&r.code===4902)await e.request({method:"wallet_addEthereumChain",params:[{chainId:t,chainName:"Arbitrum One",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:["https://arb1.arbitrum.io/rpc"],blockExplorerUrls:["https://arbiscan.io/"]}]});else throw r}}const hpn=e=>typeof e=="string"&&/^0x[0-9a-fA-F]{40}$/.test(e.trim());function ppn({open:e,onClose:t,perpsAvailable:n,spotBalances:r,onSubmit:s,loading:a}){const o=[{value:"USDC",label:"USDC"},...r.filter(U=>U.coin!=="USDC").map(U=>({value:U.coin,label:U.coin}))],[l,c]=m.useState(""),[u,d]=m.useState("perps"),[f,x]=m.useState("USDC"),[g,v]=m.useState("");m.useEffect(()=>{u==="perps"&&x("USDC")},[u]);const w=u==="perps"?Number(n||0):r.find(L=>L.coin===f)?Math.max(0,Number(b.total||0)-Number(b.hold||0)):0,C=()=>v(String(w)),N=()=>s({kind:"send",from:u,token:f,destination:l,amount:g,available:w}),I=hpn(l),P=Number(g)>0&&Number(g)<=Number(w||0),R=!I||!P,F=l.length>0&&!I;return i.jsx(opn,{open:e,onClose:t,title:"Send Tokens",children:i.jsxs("div",{className:"space-y-4 text-xs",children:[i.jsxs("div",{children:[i.jsx(tF,{children:"Destination"}),i.jsx(ySe,{value:l,onChange:c,placeholder:"Enter Hyperliquid account address (0x…)",invalid:F})]}),i.jsxs(lpn,{children:[i.jsxs("div",{children:[i.jsx(tF,{children:"From Account"}),i.jsx(vSe,{value:u,onChange:U=>d(U),options:[{value:"perps",label:"Perps Account"},{value:"spot",label:"Spot Account"}]})]}),i.jsxs("div",{children:[i.jsx(tF,{children:"Token"}),i.jsx(vSe,{value:f,onChange:x,options:o,disabled:u==="perps"})]})]}),i.jsxs("div",{children:[i.jsx(tF,{children:"Amount"}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(ySe,{value:g,onChange:v,placeholder:"0.0"}),i.jsx(cpn,{onMax:C})]}),i.jsxs("div",{className:"mt-1 text-[12px] text-[#9B9B9B]",children:["Available: ",Iv(w,6)," ",f]})]}),i.jsx(upn,{onClick:N,disabled:R,loading:a,children:"Send"})]})})}const mpn={name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"},xpn={Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]};function gpn(e){if(typeof e!="string"||!e.includes("."))return String(e);const t=e.replace(/\.?0+$/,"");return t==="-0"?"0":t}function are(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(are);const t={...e};for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const r=t[n];r&&typeof r=="object"?t[n]=are(r):(n==="p"||n==="s")&&typeof r=="string"&&(t[n]=gpn(r))}return t}function bpn(e,t,n){const r=are(e),s=IHe(r),a=t==null?9:29,o=new Uint8Array(s.length+a);o.set(s);const l=new DataView(o.buffer);return l.setBigUint64(s.length,BigInt(n),!1),t==null?l.setUint8(s.length+8,0):(l.setUint8(s.length+8,1),o.set(fs(t),s.length+9)),lo(o)}function ypn(e,t){return{source:t?"a":"b",connectionId:e}}function vpn(e){const t=e.startsWith("0x")?e.slice(2):e,n="0x"+t.slice(0,64),r="0x"+t.slice(64,128);let s=parseInt(t.slice(128,130),16);return s<27&&(s+=27),{r:n,s:r,v:s}}async function wpn(e,t){const n=dpn();if(!n)throw new Error("No injected provider");return await fpn(n,"0xa4b1"),await n.request({method:"eth_signTypedData_v4",params:[e,JSON.stringify(t)]})}function Cpn({addr:e,isMainnet:t=!0,vaultAddress:n=null}){return{sign:async(r,s)=>{const a=bpn(r,n,s),o={domain:mpn,types:xpn,primaryType:"Agent",message:ypn(a,t)},l=await wpn(e,o);return vpn(l)}}}const wSe=e=>e?`${e.slice(0,6)}...${e.slice(-4)}`:"-";function Spn({walletAddress:e,listHeight:t=560}){const{address:n}=Jr(),{latestPnL:r}=m.useContext(Qr),[s,a]=m.useState(()=>typeof window>"u"?e||null:window.localStorage.getItem("hl_selected_wallet_address")||null||e||null);m.useEffect(()=>{const ie=()=>{if(typeof window>"u")return;const oe=window.localStorage.getItem("hl_selected_wallet_address")||null;a(oe||e||null)};return ie(),window.addEventListener("hl_selected_wallet_changed",ie),window.addEventListener("storage",ie),()=>{window.removeEventListener("hl_selected_wallet_changed",ie),window.removeEventListener("storage",ie)}},[e]);const o=gT(s?s.toLowerCase():null),{perps:l={},spotBalances:c=[],tokenIdMap:u={},tokenMetaMap:d={},priceMap:f={},initialLoaded:x=!1}=o,[g,v]=m.useState({send:!1,transfer:!1,transferInitToPerp:!1}),[w,C]=m.useState(!1),N=m.useMemo(()=>{const ie=typeof window<"u"?localStorage.getItem("hl_pk"):null,oe=ie?Dhn(ie).toLowerCase():null,G=n?n.toLowerCase():null,V=s?s.toLowerCase():null,te=ie&&oe&&V&&oe===V;return{mode:te?"local":!te&&G?"metamask":"none",localAddr:oe,mmAddr:G,targetAddr:V}},[n,s]);m.useEffect(()=>{const ie=oe=>{var V;const G=!!((V=oe==null?void 0:oe.detail)!=null&&V.toPerp);v(te=>({...te,transfer:!0,transferInitToPerp:G}))};return window.addEventListener("balances:open-transfer",ie),()=>window.removeEventListener("balances:open-transfer",ie)},[]);const I=m.useMemo(()=>{try{if(!s)return null;if(N.mode==="local"){const ie=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return KN({address:s,signer:ie,isMainnet:!0,signatureChainIdHex:"0xa4b1",getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null})}if(N.mode==="metamask"&&N.mmAddr){const ie=Cpn({addr:N.mmAddr,isMainnet:!0,vaultAddress:null});return KN({address:s,signer:ie,isMainnet:!0,signatureChainIdHex:"0xa4b1",getPK:()=>null})}return null}catch{return null}},[s,N]);m.useEffect(()=>{const ie=()=>{(async()=>{try{await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:s})}).then(oe=>oe.json()),window.dispatchEvent(new CustomEvent("noop"))}catch{}})()};return window.addEventListener("balances:refresh",ie),()=>window.removeEventListener("balances:refresh",ie)},[s]);const P=m.useMemo(()=>c||[],[c]),R=m.useMemo(()=>{const ie=P.find(oe=>oe.coin==="USDC");return ie?Math.max(0,Number(ie.total||0)-Number(ie.hold||0)):0},[P]),F=()=>{const ie=N.mode==="local"?N.localAddr:N.mode==="metamask"?N.mmAddr:null;return ie?N.targetAddr?ie!==N.targetAddr?(ln.error(`Connected wallet ${bSe(ie)} does not match selected account ${bSe(N.targetAddr)}. Switch wallet or change the selected account.`,{id:"addr-mismatch",duration:6e3}),!1):!0:(ln.error("Target account is missing.",{id:"target-missing"}),!1):(ln.error("Wallet not connected or signer unavailable.",{id:"signer-missing"}),!1)},U=()=>{ln.error("No deposit found for this account. Please deposit USDC (Arbitrum) to Hyperliquid before performing this action.",{id:"err-deposit"})},L=async({from:ie,token:oe,destination:G,amount:V,available:te})=>{var ae;try{if(C(!0),!I)throw new Error("SDK not ready");if(!F())return;const he=(G||"").trim().toLowerCase();if(!he||!he.startsWith("0x")||he.length!==42)throw new Error("Destination address is invalid");if(!Number(V))throw new Error("Amount is invalid");if(Number(V)>Number(te||0))throw new Error("Amount exceeds available balance");let Ce;if(ie==="perps")Ce=await I.transfers.usdTransfer(he,V);else{const ce=u[oe];if(!ce)throw new Error(`TokenId not found for ${oe}`);const ge=`${oe}:${ce}`;Ce=await I.transfers.spotTransfer(he,ge,String(V))}if((Ce==null?void 0:Ce.status)==="ok")ln.success("Send successful.",{id:"send-success"}),await gSe(600),(ae=window==null?void 0:window.dispatchEvent)==null||ae.call(window,new Event("balances:refresh"));else{const ce=typeof(Ce==null?void 0:Ce.response)=="string"?Ce.response:JSON.stringify(Ce);ce&&ce.toLowerCase().includes("must deposit")?U():ln.error(`Send failed: ${ce||"Unknown error"}`,{id:"send-error"})}}catch(he){const Ce=(he==null?void 0:he.message)||"Send failed";Ce.toLowerCase().includes("must deposit")?U():ln.error(Ce,{id:"send-error"})}finally{C(!1),v(he=>({...he,send:!1}))}},z=async({toPerp:ie,amount:oe,available:G})=>{var V;try{if(C(!0),!I)throw new Error("SDK not ready");if(!F())return;if(!Number(oe))throw new Error("Amount is invalid");if(Number(oe)>Number(G||0))throw new Error("Amount exceeds available balance");const te=await I.transfers.usdClassTransfer(String(oe),!!ie);if((te==null?void 0:te.status)==="ok")ln.success("Transfer successful.",{id:"transfer-success"}),await gSe(600),(V=window==null?void 0:window.dispatchEvent)==null||V.call(window,new Event("balances:refresh"));else{const ae=typeof(te==null?void 0:te.response)=="string"?te.response:JSON.stringify(te);ae&&ae.toLowerCase().includes("must deposit")?U():ln.error(`Transfer failed: ${ae||"Unknown error"}`,{id:"transfer-error"})}}catch(te){const ae=(te==null?void 0:te.message)||"Transfer failed";ae.toLowerCase().includes("must deposit")?U():ln.error(ae,{id:"transfer-error"})}finally{C(!1),v(te=>({...te,transfer:!1}))}},Q=1,[ne,J]=m.useState(()=>typeof window>"u"?!1:localStorage.getItem("hide_small_balances")==="1");m.useEffect(()=>{const ie=oe=>{var G;typeof((G=oe==null?void 0:oe.detail)==null?void 0:G.value)=="boolean"?J(oe.detail.value):J(typeof window<"u"&&localStorage.getItem("hide_small_balances")==="1")};return window.addEventListener("balances:hide-small-changed",ie),()=>window.removeEventListener("balances:hide-small-changed",ie)},[]);const X=m.useMemo(()=>ie=>{if(Number.isFinite(Number(ie.usdcValue)))return Number(ie.usdcValue);const oe=f[ie.coin],G=Number(ie.totalDisplay??0);return Number.isFinite(oe)&&Number.isFinite(G)?oe*G:null},[f]),re=m.useMemo(()=>{const ie=[],oe=Number((l==null?void 0:l.accountValue)??0),G=Number((l==null?void 0:l.totalMarginUsed)??0),V=Math.max(0,oe-G);return ie.push({id:"USDC_PERPS",kind:"perps",coin:"USDC",unit:"USDC",usdcValue:oe,totalDisplay:oe,availableDisplay:V,totalSort:oe,availableSort:V}),P.forEach(te=>{const ae=String(te.coin),he=Number(te.total||0),Ce=Number(te.hold||0),ce=Math.max(0,he-Ce);let ge=null;ae==="USDC"&&(ge=he);const Ae=f[ae];ge==null&&Number.isFinite(Ae)&&(ge=Ae*he),ie.push({id:`SPOT_${ae}`,kind:"spot",coin:ae,unit:ae,usdcValue:ge,totalDisplay:he,availableDisplay:ce,totalSort:he,availableSort:ce})}),ie},[l,P,f]),pe=m.useMemo(()=>ne?re.filter(ie=>{if(ie.kind==="perps")return!0;const oe=X(ie);return oe!=null?oe>=Q:Number(ie.totalDisplay??0)>=1e-6}):re,[re,ne,X]),Y=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:ie=>ie.coin,render:(ie,oe)=>i.jsxs("span",{className:"text-white",children:[oe.coin," ",oe.kind==="perps"?i.jsx("span",{className:"text-[#9B9B9B]",children:"(Perps)"}):oe.coin==="USDC"&&oe.kind==="spot"?i.jsx("span",{className:"text-[#9B9B9B]",children:"(Spot)"}):null]})},{key:"total",label:"Total Balance",sortable:!0,sortValue:ie=>ie.totalSort,render:(ie,oe)=>i.jsxs("span",{className:"text-white",children:[Iv(oe.totalDisplay)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:oe.unit})]})},{key:"available",label:"Available Balance",sortable:!0,sortValue:ie=>ie.availableSort,render:(ie,oe)=>{const G=oe.kind==="perps"&&oe.coin==="USDC",V=Number((l==null?void 0:l.withdrawable)||0),te=G?`Available balance to open positions ignoring open orders. ${Iv(V,2)} USDC is availableto withdraw.`:void 0;return i.jsxs("span",{className:"text-white underline-offset-2",title:te,children:[Iv(oe.availableDisplay)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:oe.unit})]})}},{key:"usdcValue",label:"USDC Value",sortable:!0,sortValue:ie=>{const oe=X(ie);return oe??-1},render:(ie,oe)=>{const G=X(oe);return i.jsxs("span",{className:"text-white",children:[G!=null?Iv(G):"-"," ",G!=null?i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"}):null]})}},{key:"pnlRoe",label:"PnL (ROE %)",sortable:!1,render:(ie,oe)=>{if(oe.kind!=="perps")return i.jsx("span",{className:"text-white",children:"-"});const G=r==null?void 0:r.all,V=Number((l==null?void 0:l.accountValue)||0),te=V>0&&typeof G=="number"?G/V*100:null,ae=typeof G!="number"?"text-white":G>0?"text-[#67FFBD]":G<0?"text-[#FF7173]":"text-white";return i.jsxs("span",{className:ae,children:[typeof G!="number"?"-":`$${Iv(Math.abs(G),2)}`," ",i.jsx("span",{className:"text-[#9B9B9B]",children:te==null?"":`(${Iv(Math.abs(te),2)}%)`})]})}},{key:"send",label:"Send",sortable:!1,render:(ie,oe)=>oe.kind==="perps"||oe.coin==="USDC"?i.jsxs("button",{onClick:()=>v(G=>({...G,send:!0})),className:"p-0 inline-flex items-center gap-1 h-5 text-white bg-transparent hover:opacity-90 -ml-1",title:"Send",children:[i.jsx(j6t,{}),i.jsx("span",{children:"Send"})]}):null},{key:"transfer",label:"Transfer",sortable:!1,render:(ie,oe)=>oe.coin==="USDC"?i.jsxs("button",{onClick:()=>v(G=>({...G,transfer:!0,transferInitToPerp:oe.kind==="spot"})),className:"p-0 inline-flex items-center gap-1 h-5 text-white bg-transparent hover:opacity-90 -ml-1",title:oe.kind==="perps"?"Transfer to Spot":"Transfer to Perpetual",children:[i.jsx(kae,{}),i.jsx("span",{children:oe.kind==="perps"?"Transfer to Spot":"Transfer to Perps"})]}):null},{key:"contract",label:"Contract",sortable:!1,render:(ie,oe)=>{const G=d[oe.coin],V=(G==null?void 0:G.tokenId)||null,te=(G==null?void 0:G.evmContract)||null;if(V){const ae=`https://app.hyperliquid.xyz/explorer/token/${V}`;return i.jsx("a",{href:ae,target:"_blank",rel:"noreferrer",className:"text-white bg-transparent hover:text-white/80 -ml-2",children:wSe(V)})}if(te){const ae=`https://arbiscan.io/token/${te}`;return i.jsx("a",{href:ae,target:"_blank",rel:"noreferrer",className:"text-white bg-transparent -ml-2",children:wSe(te)})}return i.jsx("span",{className:"text-[#9B9B9B] -ml-2",children:"-"})}}],[r==null?void 0:r.all,l,X,d]);return x?i.jsxs(i.Fragment,{children:[i.jsx(Ru,{data:pe,columns:Y,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-semibold",rowKey:ie=>ie.id}),i.jsx(ppn,{open:g.send,onClose:()=>v(ie=>({...ie,send:!1})),perpsAvailable:l==null?void 0:l.withdrawable,spotBalances:P,onSubmit:L,loading:w}),i.jsx(PHe,{open:g.transfer,onClose:()=>v(ie=>({...ie,transfer:!1})),perpsAvailable:l==null?void 0:l.withdrawable,spotUsdcAvailable:R,onSubmit:z,loading:w,initialToPerp:!!g.transferInitToPerp})]}):i.jsx("div",{className:"mt-2 flex pt-12 justify-center text-[12px] text-[#9B9B9B]",style:{height:t},children:"Loading..."})}const Npn={position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12,border:"1px solid #2A2A2A"}},Apn="dextra-global-toast";function RX(e,t){return ln.promise(e,t,{id:Apn,...Npn})}async function LX(e){const t=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return KN({address:e,signer:t,dex:""})}function mo(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function jpn(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function Sue({open:e,onClose:t,title:n,width:r=720,children:s}){return e?Na.createPortal(i.jsxs("div",{className:"fixed inset-0 z-[99999] font-inter",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:t}),i.jsxs("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 max-w[95vw] rounded-2xl border border-[#2A2A2A] bg-[#161616] shadow-2xl",style:{width:r},children:[i.jsxs("div",{className:"px-5 pt-4 pb-2 flex items-center justify-between",children:[i.jsx("div",{className:"text-white text-[16px]",children:n}),i.jsx("button",{onClick:t,className:"flex justify-center items-center w-8 h-8 rounded-lg bg-[#222] text-[#BDBDBD]",title:"Close",children:"✕"})]}),i.jsx("div",{className:"px-5 pb-5",children:s})]})]}),document.body):null}const Og=({children:e})=>i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mb-1",children:e}),ore=({value:e,onChange:t,placeholder:n})=>i.jsx("input",{value:e,onChange:r=>t(r.target.value),placeholder:n,className:"w-full h-9 px-3 rounded-lg bg-[#101010] border border-[#2A2A2A] text-white outline-none font-inter text-[11px]"}),DX=({children:e,right:t})=>i.jsxs("div",{className:"h-9 rounded-lg bg-[#0E0E0E] border border-[#2A2A2A] px-3 flex items-center justify-between text-[#CFCFCF]",children:[i.jsx("span",{className:"text-[11px]",children:e}),t?i.jsx("span",{className:"text-[#9B9B9B] text-[11px]",children:t}):null]}),MHe=({children:e,onClick:t,disabled:n,loading:r})=>i.jsxs("button",{onClick:t,disabled:n||r,className:`w-full h-8 rounded-xl !mt-10 font-medium font-inter text-[12px] flex items-center justify-center gap-2 ${n||r?"bg-[#2C2C2C] text-[#8A8A8A] cursor-not-allowed":"bg-[#67FFBD] text-[#101010] hover:opacity-95"}`,children:[r?i.jsx(Yy,{size:14,color:"#FFF"}):null,i.jsx("span",{children:e})]});function Epn({open:e,onClose:t,row:n,onConfirm:r,initialTab:s="limit",busy:a=!1}){const[o,l]=Ne.useState(s),[c,u]=Ne.useState(n!=null&&n.markPrice?String(n.markPrice):""),[d,f]=Ne.useState(100),x=Ne.useRef(!1),g=Math.abs(Number((n==null?void 0:n.size)||0));Number((n==null?void 0:n.entryPrice)||0);const v=Number((n==null?void 0:n.markPrice)??(n==null?void 0:n.midPrice)??0),w=g*d/100,C=Number(c||0);Ne.useEffect(()=>{e&&!x.current&&(l(s),f(100),u(n!=null&&n.markPrice?String(n.markPrice):""),x.current=!0),!e&&x.current&&(x.current=!1)},[e,s,n==null?void 0:n.markPrice]);const N=()=>{a||(o==="market"?r==null||r({mode:"market",id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:n==null?void 0:n.type,size:w}):r==null||r({mode:"limit",id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:n==null?void 0:n.type,price:C,size:w}))},I=o==="market"?"Market Close":"Limit Close",P=o==="market"?"This will attempt to immediately close the position.":"This will send an order to close your position at the limit price.";return i.jsx(Sue,{open:e,onClose:a?()=>{}:t,title:I,width:500,children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"text-[12px] text-[#9B9B9B]",children:P}),i.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[i.jsx(Og,{children:"Size"}),i.jsxs("div",{className:"text-[#CFCFCF]",children:[mo(g)," ",n==null?void 0:n.coin]})]}),o==="market"?i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{children:[i.jsx(Og,{children:"Price"}),i.jsx(DX,{right:"",children:i.jsx("span",{className:"text-white",children:"Market"})})]}),i.jsxs("div",{children:[i.jsx(Og,{children:"Size"}),i.jsx(DX,{right:"USDC",children:mo(w*v,2)})]})]}):i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Og,{children:"Price (USD)"}),i.jsx("button",{className:"text-[11px] text-[#67FFBD] px-2 py-0.5 rounded-md hover:opacity-90",onClick:()=>u(String(v)),children:"Mid"})]}),i.jsx(ore,{value:c,onChange:u,placeholder:"0.0"})]}),i.jsxs("div",{children:[i.jsx(Og,{children:"Size"}),i.jsx(DX,{right:"USDC",children:mo(w*(C||v),2)})]})]}),i.jsx(YN,{value:d,onChange:f,accent:"#67FFBD",trackBg:"rgba(255,255,255,0.12)",marks:[0,25,50,75,100],snap:!0}),i.jsx(MHe,{onClick:N,disabled:o==="limit"&&!c,loading:a,children:o==="market"?"Market Close":"Confirm"})]})})}function _pn({open:e,onClose:t,row:n,onConfirm:r,busy:s=!1}){const a=Math.abs(Number((n==null?void 0:n.size)||0)),o=(n==null?void 0:n.type)==="Long"?"Short":"Long";return i.jsx(Sue,{open:e,onClose:s?()=>{}:t,width:640,title:`Reverse ${n==null?void 0:n.coin} Position`,children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"rounded-xl border border-[#8d6a2a] bg-[#2a2212] text-[#f1c76c] p-3 text-[12px]",children:"This will close your existing positions and open reversed positions with the same size. This action cannot be undone."}),i.jsx("div",{className:"rounded-xl border border-[#2A2A2A] bg-[#101010] p-4 text-[12px]",children:i.jsxs("div",{className:"grid grid-cols-[1fr_1fr_1fr] gap-2",children:[i.jsx("div",{className:"text-[#9B9B9B]",children:"Asset"}),i.jsx("div",{className:"text-[#9B9B9B]",children:"Current Side"}),i.jsx("div",{className:"text-[#9B9B9B]",children:"New Side"}),i.jsx("div",{className:"text-white",children:n==null?void 0:n.coin}),i.jsxs("div",{className:"text-[#67FFBD]",children:[n==null?void 0:n.type," ",mo(a)]}),i.jsxs("div",{className:"text-[#FF797C]",children:[o," ",mo(a)]})]})}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("button",{onClick:t,disabled:s,className:`flex-1 h-10 rounded-xl border border-[#2A2A2A] bg-transparent text-white hover:bg-white/5 ${s?"opacity-60 cursor-not-allowed":""}`,children:"Cancel"}),i.jsx("button",{onClick:()=>r==null?void 0:r({mode:"reverse",id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,from:n==null?void 0:n.type,to:o,size:a}),disabled:s,className:`flex-1 h-10 rounded-xl bg-[#67FFBD] text-[#101010] hover:opacity-95 ${s?"opacity-60 cursor-not-allowed":""}`,children:s?i.jsx(Yy,{size:14,color:"#FFF"}):"Reverse"})]})]})})}const CSe=({value:e,onChange:t,placeholder:n="0"})=>i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:e,onChange:r=>t(r.target.value),placeholder:n,className:"w-full h-9 px-3 pr-8 rounded-lg bg-[#101010] border border-[#2A2A2A] text-white outline-none font-inter text-[11px] text-right",inputMode:"decimal"}),i.jsx("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-[#9B9B9B] text-[11px]",children:"%"})]});function kpn({open:e,onClose:t,row:n,initialTp:r,initialSl:s,onSubmit:a}){var ie;const[o,l]=m.useState(r?String(r):""),[c,u]=m.useState(s?String(s):""),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(!1),[C,N]=m.useState(!1),I=Number((n==null?void 0:n.entryPrice)||0),P=Number((n==null?void 0:n.markPrice)??0),R=Math.abs(Number((n==null?void 0:n.size)||0)),F=n==null?void 0:n.type,U=(((ie=n==null?void 0:n.leverage)==null?void 0:ie.type)||(n==null?void 0:n.marginType)||"").toString(),L=oe=>Number.isFinite(oe)?Math.max(0,oe):0,z=(oe,G=4)=>Number.isFinite(oe)?String(Number(oe.toFixed(G))):"",Q=oe=>{var ae;if(!I)return"";const G=Number(oe);if(!Number.isFinite(G))return"";const V=Number(((ae=n==null?void 0:n.leverage)==null?void 0:ae.value)||1),te=(F==="Long"?G/I-1:1-G/I)*100*V;return z(L(te),2)},ne=oe=>{var ae;if(!I)return"";const G=Number(oe);if(!Number.isFinite(G))return"";const V=Number(((ae=n==null?void 0:n.leverage)==null?void 0:ae.value)||1),te=(F==="Long"?1-G/I:G/I-1)*100*V;return z(L(te),2)},J=oe=>{var he;const G=Number(oe);if(!Number.isFinite(G)||!I)return"";const V=Number(((he=n==null?void 0:n.leverage)==null?void 0:he.value)||1),te=G/(V*100),ae=F==="Long"?I*(1+te):I*(1-te);return z(ae,4)},X=oe=>{var he;const G=Number(oe);if(!Number.isFinite(G)||!I)return"";const V=Number(((he=n==null?void 0:n.leverage)==null?void 0:he.value)||1),te=G/(V*100),ae=F==="Long"?I*(1-te):I*(1+te);return z(ae,4)};m.useEffect(()=>{if(e){const oe=r?String(r):"",G=s?String(s):"";l(oe),u(G),f(oe?Q(oe):""),g(G?ne(G):""),w(!1),N(!1)}},[e,r,s]);const re=o&&R?Math.max(0,(F==="Long"?Number(o)-P:P-Number(o))*R):0,pe=c&&R?Math.max(0,(F==="Long"?P-Number(c):Number(c)-P)*R):0,Y=()=>{a==null||a({id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:F,tpPrice:o?Number(o):null,slPrice:c?Number(c):null,configureAmount:v,useLimitPx:C}),t()};return i.jsx(Sue,{open:e,onClose:t,title:`TP/SL for Position - ${(n==null?void 0:n.coin)||"--"} - ${U||F||"--"}`,children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rounded-xl border border-[#2A2A2A] bg-[#101010] p-4 text-[12px] space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Position"}),i.jsxs("span",{className:"text-[#1DE6A3]",children:[mo(R)," ",i.jsx("span",{className:"text-[#67FFBD]",children:n==null?void 0:n.coin})]})]}),i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Entry Price"}),i.jsx("span",{className:"text-white",children:mo(I,4)})]}),i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Mark Price"}),i.jsx("span",{className:"text-white",children:mo(P,4)})]})]}),i.jsxs("div",{className:"rounded-xl border border-[#2A2A2A] bg-[#101010] p-4 space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_220px] gap-6 items-start",children:[i.jsxs("div",{children:[i.jsx(Og,{children:"TP Price"}),i.jsx(ore,{value:o,onChange:oe=>{l(oe),f(oe?Q(oe):"")},placeholder:"0.0"}),i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mt-1",children:"Est Gain:"}),i.jsxs("div",{className:"text-[11px] text-[#67FFBD]",children:["+$",mo(re,2)]})]}),i.jsxs("div",{children:[i.jsx(Og,{children:"Gain"}),i.jsx(CSe,{value:d,onChange:oe=>{f(oe),l(oe?J(oe):"")}})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_220px] gap-6 items-start",children:[i.jsxs("div",{children:[i.jsx(Og,{children:"SL Price"}),i.jsx(ore,{value:c,onChange:oe=>{u(oe),g(oe?ne(oe):"")},placeholder:"0.0"}),i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mt-1",children:"Est Loss:"}),i.jsxs("div",{className:"text-[11px] text-[#FF7173]",children:["-$",mo(pe,2)]})]}),i.jsxs("div",{children:[i.jsx(Og,{children:"Loss"}),i.jsx(CSe,{value:x,onChange:oe=>{g(oe),u(oe?X(oe):"")}})]})]}),i.jsxs("div",{className:"flex items-center gap-6 text-[12px] text-white",children:[i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:v,onChange:oe=>w(oe.target.checked)}),i.jsx("span",{children:"Configure Amount"})]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:C,onChange:oe=>N(oe.target.checked)}),i.jsx("span",{children:"Limit Price"})]})]}),i.jsx(MHe,{onClick:Y,disabled:!o&&!c,children:"Confirm"})]})]})})}function Tpn({selectedRow:e,onOpenCloseModal:t,onOpenReverse:n,onCloseAll:r,busyCloseAll:s}){const[a,o]=m.useState(!1),l=m.useRef(null),[c,u]=m.useState({x:0,y:0});return m.useEffect(()=>{var f;if(!a)return;const d=(f=l.current)==null?void 0:f.getBoundingClientRect();d&&u({x:d.left,y:d.bottom+6})},[a]),m.useEffect(()=>{if(!a)return;const d=()=>o(!1),f=x=>{l.current&&l.current.contains(x.target)||d()};return window.addEventListener("resize",d),window.addEventListener("scroll",d),document.addEventListener("pointerdown",f),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d),document.removeEventListener("pointerdown",f)}},[a]),i.jsxs(i.Fragment,{children:[i.jsxs("button",{ref:l,className:"w-[100px] min-w-0 h-8 px-2 rounded-lg border border-[#2A2A2A] bg-[#161616] text-[#CFCFCF] text-xs flex items-center justify-between overflow-hidden",onClick:d=>{d.stopPropagation(),o(f=>!f)},title:"Close menu",children:[i.jsx("span",{className:"truncate",children:"Close"}),i.jsx("span",{className:"opacity-70 ml-2",children:"▾"})]}),a&&Na.createPortal(i.jsx("div",{className:"fixed z-[99998] w-[300px] rounded-xl border border-[#2A2A2A] bg-[#0F0F0F] shadow-2xl p-3",style:{top:c.y,left:c.x},onPointerDown:d=>d.stopPropagation(),children:i.jsxs("div",{className:"mt-2 text-[13px] text-white/90",children:[i.jsx("div",{className:`${e?"hover:bg-white/5":"opacity-40 pointer-events-none"} px-2 py-1.5 rounded cursor-pointer`,onClick:()=>e&&(t==null?void 0:t("limit")),children:"Limit Close"}),i.jsx("div",{className:`${e?"hover:bg-white/5":"opacity-40 pointer-events-none"} px-2 py-1.5 rounded cursor-pointer`,onClick:()=>e&&(t==null?void 0:t("market")),children:"Market Close"}),i.jsxs("div",{className:`px-2 py-1.5 rounded cursor-pointer ${s?"opacity-60 pointer-events-none":"hover:bg-white/5"}`,onClick:()=>!s&&(r==null?void 0:r()),children:["Close All (Market)",s?i.jsx("span",{className:"inline-flex ml-2 align-middle",children:i.jsx(Yy,{size:12,color:"#FFF"})}):null]})]})}),document.body)]})}function Ipn({walletAddress:e,listHeight:t=560}){var ce,ge,Ae,ye;const{isReferralCodeName:n}=m.useContext(Qr),{rows:r,tpslByCoin:s={},viewOrdersOnly:a}=yue(e),[o,l]=m.useState(e||"");m.useEffect(()=>{l(e||"")},[r]);const c=(o||"")===(e||""),u=m.useMemo(()=>c?r.map(je=>({...je,id:je.id})):[],[c,r]),{key:d}=v2(),[f,x]=m.useState({}),[g,v]=m.useState(null),[w,C]=m.useState(!1),[N,I]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),[P,R]=m.useState(null),F=m.useMemo(()=>u.find(je=>je.id===P)||null,[u,P]),[U,L]=m.useState(!1),[z,Q]=m.useState("limit"),[ne,J]=m.useState(!1),[X,re]=m.useState(!1),[pe,Y]=m.useState(!1),ie=()=>typeof window<"u"&&window.localStorage.getItem("skipCloseConfirm")==="true",oe={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},G=je=>oe[je]||je,V=m.useCallback(async({id:je,coin:Ie,tpPrice:Re,slPrice:Qe,configureAmount:$e,useLimitPx:it})=>{var tt;try{const ot=await LX(e);await RX(ot.replaceTPSLForPosition({symbol:Ie,tpPrice:Re??null,slPrice:Qe??null,useLimitPx:!!it,triggerSlippage:.1}),{loading:`Placing TP/SL for ${Ie}...`,success:`TP/SL placed for ${Ie}`,error:ft=>`TP/SL failed: ${(ft==null?void 0:ft.message)||ft}`}),x(ft=>({...ft,[je]:{tp:Re||null,sl:Qe||null}})),(tt=window.dispatchEvent)==null||tt.call(window,new Event("orders:refresh"))}catch{}finally{v(null)}},[e]);m.useEffect(()=>{if(w&&!N.referral){const je=n||window.localStorage.getItem("refcode")||"";je&&I(Ie=>({...Ie,referral:je}))}},[w,n,N.referral]);const te=m.useCallback(async je=>{re(!0);try{const Ie=await LX(e),Re=je.mode==="market"?Ie.marketClose(je.coin,je.size,{tif:"Ioc",reduceOnly:!0}):Ie.placeOrder({symbol:je.coin,isBuy:je.side==="Short",size:je.size,price:je.price,tif:"Gtc",reduceOnly:!0});await RX(Re,{loading:`Closing ${je.coin} ${je.mode}...`,success:`Closed ${je.coin} (${mo(je.size)} ${je.mode})`,error:Qe=>`Close failed: ${je.coin} • ${(Qe==null?void 0:Qe.message)||Qe}`}),L(!1)}finally{re(!1)}},[e]),ae=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:Ie=>Ie.coin||"",render:(Ie,Re)=>{var it;const Qe=il(),$e=()=>Qe(`/terminal/hyperliquid/${Re.coin}`);return i.jsxs("div",{onPointerDown:$e,className:"flex gap-1 items-center text-white font-medium min-w-[120px] cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${G(Re.coin)}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:Re.coin}),i.jsx("span",{children:Ie.replace("xyz:","")||"--"}),i.jsx("div",{className:"flex justify-start items-center gap-2 h-8 ml-1",children:i.jsx("div",{className:`${Re.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-1`,children:i.jsxs("div",{className:"text-[11px] font-semibold tracking-wide uppercase",children:[mo(((it=Re.leverage)==null?void 0:it.value)??0,0),"x"]})})})]})}},{key:"size",label:"Size",sortable:!0,sortValue:Ie=>Math.abs(Ie.size),render:(Ie,Re)=>i.jsxs("span",{className:`font-medium ${Re.type==="Long"?"text-[#67ffbd]":"text-[#ff787b]"}`,children:[mo(Math.abs(Ie))," ",Re.coin.replace("xyz:","")]})},{key:"positionValue",label:"Pos. Val.",sortable:!0,sortValue:Ie=>Ie.positionValue,render:Ie=>i.jsxs("span",{className:"text-white font-semibold",children:["$",mo(Ie,2)]})},{key:"entryPrice",label:"Entry Price",sortable:!0,sortValue:Ie=>Ie.entryPrice,render:Ie=>i.jsxs("span",{className:"text-white font-semibold",children:["$",mo(Ie,4)]})},{key:"markPrice",label:"Mark Price",sortable:!0,sortValue:Ie=>Ie.markPrice,render:Ie=>i.jsxs("span",{className:"text-white font-semibold",children:["$",mo(Ie,4)]})},{key:"pnl",label:"PnL (ROE%)",headerTooltip:"Mark price is used to estimate unrealized PNL. Only trade prices are used for realized PNL.",sortable:!0,sortValue:Ie=>Ie.pnl,render:(Ie,Re)=>i.jsxs("div",{className:"flex items-center justify-end gap-1",children:[i.jsxs("span",{className:Re.pnl>=0?"text-[#67FFBD]":"text-[#FF797C]",children:["$",mo(Math.abs(Re.pnl),2)," ",i.jsxs("span",{className:"text-[#9B9B9B]",children:["(",mo(Math.abs(Re.roe),1),"%)"]})]}),i.jsx("button",{onClick:Qe=>{var it;Qe.stopPropagation();const $e=n||window.localStorage.getItem("refcode")||"";I({coin:Re.coin,type:Re.type.toUpperCase(),leverage:((it=Re.leverage)==null?void 0:it.value)||0,roe:Re.roe||0,entryPrice:Number(Re.entryPrice||0),markPrice:Number(Re.markPrice||0),referral:$e,positionDistribution:0,pnl:Number(Re.pnl||0),closePx:0}),C(!0)},className:"flex items-center h-6 text-[#67FFBD] text-[11px] font-semibold bg-transparent -ml-3",title:"Share",children:i.jsx("img",{src:xm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})},{key:"liquidationPx",label:"Liq. Price",sortable:!0,sortValue:Ie=>Ie.liquidationPx??-1,render:Ie=>Ie==null?i.jsx("span",{className:"text-[#979797]",children:"--"}):i.jsx("span",{className:"text-white font-semibold",children:mo(Ie,0)})},{key:"marginUsed",label:"Margin",headerTooltip:"For isolated positions margin includes unrealized pnl.",sortable:!0,sortValue:Ie=>Ie.marginUsed,render:(Ie,Re)=>{var it;const Qe=Re.marginUsed,$e=(it=Re.leverage)!=null&&it.type?jpn(Re.leverage.type):null;return i.jsxs("span",{className:"text-white font-semibold",children:["$",mo(Qe,2)," ",$e?i.jsxs("span",{className:"text-[#9B9B9B]",children:["(",$e,")"]}):null]})}},{key:"funding",label:"Funding",headerTooltip:"Net funding payments since the position was opened. Hover for all-time and since changed.",sortable:!0,sortValue:Ie=>Ie.funding,render:Ie=>i.jsxs("span",{className:Number(Ie)<=0?"text-[#67FFBD] font-semibold":"text-[#FF797C] font-semibold",children:["$",mo(Math.abs(Ie),4)]})},{key:"close",label:i.jsx(Tpn,{selectedRow:F,onOpenCloseModal:async Ie=>{if(F){if(Q(Ie),Ie==="market"&&ie()){await te({mode:"market",id:F==null?void 0:F.id,coin:F==null?void 0:F.coin,side:F==null?void 0:F.type,size:Math.abs(Number((F==null?void 0:F.size)||0))});return}L(!0)}},onOpenReverse:()=>F&&J(!0),onCloseAll:async()=>{Y(!0);try{const Ie=await LX(e);await RX(Ie.closeAllPositions(),{loading:"Closing all positions...",success:"Closed all positions",error:Re=>`Close all failed: ${(Re==null?void 0:Re.message)||Re}`})}finally{Y(!1)}},busyCloseAll:pe}),sortable:!1,align:"start",render:(Ie,Re)=>i.jsxs("div",{className:"w-full flex items-center gap-1",children:[i.jsx("button",{onClick:()=>{R(Re.id),Q("limit"),L(!0)},className:"flex justify-center items-center h-5 px-2 rounded-md text-[11px] font-semibold text-[#0f151a] bg-[rgb(103,255,189)] -ml-2",children:"Limit"}),i.jsx("button",{onClick:async()=>{R(Re.id),Q("market"),ie()?await te({mode:"market",id:Re.id,coin:Re.coin,side:Re.type,size:Math.abs(Number(Re.size||0))}):L(!0)},className:"flex justify-center items-center h-5 px-2 rounded-md text-[11px] font-semibold text-[#0f151a] bg-[rgb(103,255,189)]",children:"Market"})]})},{key:"tpSl",label:"TP/SL",sortable:!1,render:(Ie,Re)=>{const Qe=s==null?void 0:s[Re.coin],$e=Qe&&(Qe.tp||Qe.sl),it=a instanceof Set?a.has(Re.coin):!1,tt=f[Re.id];return $e?i.jsxs("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:[i.jsxs("span",{className:"text-[#CFCFCF]",children:[Qe.tp?mo(Qe.tp,0):"--"," /"," ",Qe.sl?mo(Qe.sl,0):"--"]}),i.jsx("button",{onClick:()=>v(Re),className:"opacity-80 hover:opacity-100 bg-transparent p-0",children:"✎"})]}):it?i.jsx("div",{className:"flex items-center justify-end",children:i.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("terminal:setTab",{detail:{tab:"open"}})),className:"h-6 px-2 rounded-md text-[11px] font-semibold text-[#67ffbd] bg[rgba(103,255,189,0.16)] flex justify-center items-center",children:"View Orders"})}):tt&&(tt.tp||tt.sl)?i.jsxs("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:[i.jsxs("span",{className:"text-[#CFCFCF]",children:[tt.tp?mo(tt.tp,0):"--"," /"," ",tt.sl?mo(tt.sl,0):"--"]}),i.jsx("button",{onClick:()=>v(Re),className:"opacity-80 hover:opacity-100 bg-transparent",children:"✎"})]}):i.jsx("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:i.jsx("button",{onClick:()=>v(Re),className:"text-[#CFCFCF] underline underline-offset-4 decoration-dotted hover:text-white p-0 bg-transparent",children:"-- / -- ✎"})})}}],[F,n,f,s,a,e,pe,te]),he=g?((ce=s==null?void 0:s[g.coin])==null?void 0:ce.tp)??((ge=f[g.id])==null?void 0:ge.tp)??null:null,Ce=g?((Ae=s==null?void 0:s[g.coin])==null?void 0:Ae.sl)??((ye=f[g.id])==null?void 0:ye.sl)??null:null;return i.jsxs(i.Fragment,{children:[i.jsx(Ru,{data:Zg(u,"positions",d),columns:ae,rowHeight:30,listHeight:t,tableClassName:"mt-2 font-inter",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:je=>`border-b border-[#1E1E1E] bg-transparent !rounded-none ${P===je.id?"bg-[#0d0d0d]":""}`,cellClassName:()=>"py-1 flex min-w-0 !text-[11px] font-normal",rowKey:je=>je.id,onRowClick:je=>R(je.id),emptyRenderer:()=>i.jsx("div",{className:"flex items-center justify-center h-[200px] text-[#9B9B9B] text-sm",children:"No open positions"})}),i.jsx(kpn,{open:!!g,onClose:()=>v(null),row:g,initialTp:he,initialSl:Ce,onSubmit:V}),i.jsx(Epn,{open:U&&!!F,onClose:()=>L(!1),row:F,initialTab:z,onConfirm:te,busy:X}),i.jsx(_pn,{open:ne&&!!F,onClose:()=>J(!1),row:F,onConfirm:je=>{J(!1),console.log("REVERSE CONFIRM",je)}}),i.jsx(hT,{open:w,setOpen:C,data:N,setTradeInfo:I})]})}async function SSe(e){const t=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return KN({address:e,signer:t,dex:""})}function lre(e,t=2,n=!0){return Number(e||0).toLocaleString(void 0,{minimumFractionDigits:n?0:t,maximumFractionDigits:t})}function Ppn(e,t=2){return`${Number(e||0).toLocaleString(void 0,{minimumFractionDigits:t,maximumFractionDigits:t})} USDC`}function Fpn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function Opn(e){const t=e.side==="Buy"?"B":e.side==="Sell"?"A":e.side;return t==="B"?e.reduceOnly?"Close Short":"Open Long":t==="A"?e.reduceOnly?"Close Long":"Open Short":"-"}function Mpn({open:e,onClose:t,children:n,title:r}){return e?i.jsxs("div",{className:"fixed inset-0 z-[999] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[1px]",onClick:t}),i.jsxs("div",{className:"relative z-[1000] w-[760px] max-w-[95vw] rounded-2xl border border-[#262626] bg-[#141414] p-6 shadow-2xl",children:[i.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[i.jsx("div",{className:"text-white font-semibold",children:r}),i.jsx("button",{onClick:t,className:"rounded-md px-2 py-1 text-[#9B9B9B] hover:bg-[#1F1F1F] hover:text-white",children:"×"})]}),n]})]}):null}function Rpn(e){return typeof(e==null?void 0:e.type)=="string"&&e.type.toLowerCase()==="limit"}function Lpn(e){return typeof e=="string"&&e.toLowerCase().includes("stop")}function Dpn(e){return typeof e=="string"&&e.toLowerCase().includes("take profit")}function Bpn(e){return e==="B"?"Long":"Short"}function $pn(e){return e==="B"?"Short":"Long"}function J7({k:e,v:t,strong:n}){return i.jsxs("div",{className:"flex items-center justify-between text-[13px] leading-5",children:[i.jsx("span",{className:"text-[#9B9B9B]",children:e}),i.jsx("span",{className:n?"text-white font-semibold":"text-white",children:t})]})}function nF({title:e,order:t,parentRawSide:n}){const r=!!t,s=r?t.side?Bpn(t.side):$pn(n):"--",a=r&&typeof t.orderType=="string"&&t.orderType.toLowerCase()==="limit";return i.jsxs("div",{className:"rounded-xl border border-[#2a2a2a] bg-[#161616] px-4 py-3",children:[e?i.jsx("div",{className:"mb-2 text-[13px] text-[#9B9B9B]",children:e}):null,r?i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(J7,{k:"Order Type",v:t.orderType||"--"}),i.jsx(J7,{k:"Side",v:s}),i.jsx(J7,{k:"Amount",v:`${t.sz}`}),i.jsx(J7,{k:"Trigger",v:t.triggerCondition&&t.triggerCondition!=="N/A"?t.triggerCondition:"N/A"}),i.jsx(J7,{k:"Price",v:a?`$${lre(t.limitPx,3)}`:"Market"})]}):i.jsx("div",{className:"text-[#9B9B9B]",children:"—"})]})}function Upn({onBulkCancel:e,busy:t}){const[n,r]=m.useState(!1),s=m.useRef(null),[a,o]=m.useState({x:0,y:0});m.useEffect(()=>{var u;if(!n)return;const c=(u=s.current)==null?void 0:u.getBoundingClientRect();c&&o({x:c.left,y:c.bottom+6})},[n]),m.useEffect(()=>{if(!n)return;const c=()=>r(!1),u=d=>{s.current&&s.current.contains(d.target)||c()};return window.addEventListener("resize",c),window.addEventListener("scroll",c),document.addEventListener("pointerdown",u),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c),document.removeEventListener("pointerdown",u)}},[n]);const l=({label:c,val:u,showSpinner:d})=>i.jsx("div",{className:`px-2 py-1.5 rounded cursor-pointer ${t?"opacity-60 pointer-events-none":"hover:bg-white/5"}`,onClick:()=>{t||(e==null||e(u),r(!1))},children:i.jsxs("div",{className:"flex items-center",children:[i.jsx("span",{children:c}),d&&t?i.jsx("span",{className:"inline-flex ml-2 align-middle",children:i.jsx(Yy,{size:12,color:"#FFF"})}):null]})});return i.jsxs(i.Fragment,{children:[i.jsxs("button",{ref:s,className:"w-[120px] min-w-0 h-8 px-2 rounded-lg border border-[#2A2A2A] bg-[#161616] text-[#CFCFCF] text-xs flex items-center justify-between overflow-hidden",onClick:c=>{c.stopPropagation(),r(u=>!u)},title:"Cancel menu",children:[i.jsx("span",{className:"truncate",children:"Cancel"}),i.jsx("span",{className:"opacity-70 ml-2",children:"▾"})]}),n&&Na.createPortal(i.jsx("div",{className:"fixed z-[99998] w-[260px] rounded-xl border border-[#2A2A2A] bg-[#0F0F0F] shadow-2xl p-3",style:{top:a.y,left:a.x},onPointerDown:c=>c.stopPropagation(),children:i.jsxs("div",{className:"mt-2 text-[13px] text-white/90",children:[i.jsx(l,{label:"Cancel All",val:"all",showSpinner:!0}),i.jsx(l,{label:"Cancel Limit",val:"limit"}),i.jsx(l,{label:"Cancel TP/SL",val:"tpsl"}),i.jsx(l,{label:"Cancel ReduceOnly",val:"reduceOnly"}),i.jsx(l,{label:"Cancel Non-Reduce",val:"nonReduce"})]})}),document.body)]})}function zpn({walletAddress:e,listHeight:t=560,onCancelOrder:n,onBulkCancel:r}){const{rows:s,loading:a}=vue(e),[o,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(null),[x,g]=m.useState(null),{key:v}=v2(),[w,C]=m.useState(new Set),[N,I]=m.useState(!1),P=V=>w.has(V),R=V=>C(te=>new Set([...te,V])),F=V=>C(te=>{const ae=new Set(te);return ae.delete(V),ae}),U=m.useCallback(async V=>{await(await SSe(e)).cancelOrder({symbol:V.coin,oid:V.oid})},[e]),L=m.useCallback(async V=>{await(await SSe(e)).cancelOrdersFiltered({filter:V})},[e]),z={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},Q=V=>z[V]||V,ne=n??U,J=r??L,X=m.useCallback(async V=>{const te=V.oid;if(!P(te)){R(te);try{await ln.promise(Promise.resolve(ne(V)),{loading:`Cancelling: ${V.coin} #${te}...`,success:`Cancelled: ${V.coin} #${te}`,error:ae=>`Cancel failed: ${V.coin} #${te} • ${(ae==null?void 0:ae.message)||ae}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}})}finally{F(te)}}},[ne,w]),re=V=>V==="all"?"All orders":V==="limit"?"Limit orders":V==="tpsl"?"TP/SL orders":V==="reduceOnly"?"ReduceOnly orders":V==="nonReduce"?"Non-Reduce orders":V,pe=m.useCallback(async V=>{if(V){I(!0);try{await ln.promise(Promise.resolve(J(V)),{loading:`Bulk cancelling: ${re(V)}...`,success:`Bulk cancelled: ${re(V)}`,error:te=>`Bulk cancel failed: ${re(V)} • ${(te==null?void 0:te.message)||te}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}})}finally{I(!1)}}},[J]),Y=m.useCallback(V=>{const te=Array.isArray(V==null?void 0:V.children)?V.children:[],ae=te.find(Ce=>Dpn(Ce.orderType))||null,he=te.find(Ce=>Lpn(Ce.orderType))||null;u({orderType:V.type,coin:V.coin,side:V.sideRaw,sz:V.size,limitPx:V.limitPx,triggerCondition:V.triggerCondition,timestamp:V.timestamp}),f(he||ae||null),g(ae&&he?ae:null),l(!0)},[]),ie=m.useMemo(()=>[{key:"timestamp",label:"Time",sortable:!0,width:"140px",sortValue:V=>V.timestamp,render:V=>i.jsx("span",{className:"text-white",children:Fpn(V)})},{key:"type",label:"Type",sortable:!0,width:"120px",sortValue:V=>V.type||"",render:(V,te)=>i.jsx("span",{className:"text-white",children:te.type||"--"})},{key:"coin",label:"Coin",sortable:!0,sortValue:V=>V.coin||"",render:(V,te)=>{const ae=(te.side==="B",te.reduceOnly?"text-[#FF797C]":"text-[#67FFBD]"),he=il(),Ce=()=>he(`/terminal/hyperliquid/${te.coin}`);return i.jsxs("div",{onPointerDown:Ce,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Q(te.coin)}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:te.coin}),i.jsx("span",{className:ae,children:te.coin.replace("xyz:","")||"--"})]})}},{key:"side",label:"Direction",sortable:!0,sortValue:V=>V.side==="B"?1:0,render:(V,te)=>{const ae=Opn(te),he=te.side==="Sell";return i.jsx("span",{className:`h-5 px-1.5 py-1 rounded-md text-[11px] font-semibold flex justify-center items-center ${he?"text-[#FF797C] bg-[#FF797C]/20":"text-[#67FFBD] bg-[#67FFBD]/20"}`,children:ae})}},{key:"size",label:"Size",sortable:!0,sortValue:V=>V.size,render:V=>i.jsx("span",{className:"text-white font-semibold",children:V})},{key:"originalSize",label:"Original Size",sortable:!0,sortValue:V=>Math.abs(V.originalSize),render:V=>i.jsx("span",{className:"text-white font-semibold",children:V})},{key:"orderValue",label:"Order value",sortable:!0,sortValue:V=>Math.abs(V.orderValue),render:V=>i.jsx("span",{className:"text-white font-semibold",children:Ppn(V,2)})},{key:"price",label:"Price",sortable:!0,sortValue:V=>V.limitPx,render:(V,te)=>{if(te.price==="Market")return i.jsx("span",{className:"text-white font-semibold",children:"Market"});const ae=typeof te.pxDecimals=="number"?te.pxDecimals:3;return i.jsx("span",{className:"text-white font-semibold",children:lre(te.limitPx,ae)})}},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:V=>V.reduceOnly?1:0,render:V=>i.jsx("span",{className:"text-white font-semibold",children:V?"Yes":"No"})},{key:"triggerCondition",label:"Trigger",sortable:!0,sortValue:V=>V.triggerPx||0,width:"140px",render:(V,te)=>te.triggerPx&&te.triggerPx!=="N/A"?i.jsx("span",{className:"text-white font-semibold",children:te.type==="Stop Market"?`Price Below ${te.triggerPx}`:te.type==="Take Profit Market"?`Price Above ${te.triggerPx}`:te.triggerPx}):i.jsx("span",{children:"N/A"})},{key:"tp_sl",label:"TP/SL",sortable:!1,render:(V,te)=>{const ae=Array.isArray(te.children)&&te.children.length>0;return Rpn(te)&&ae?i.jsx("button",{onClick:he=>{he.stopPropagation(),Y(te)},className:"text-[#67FFBD] hover:opacity-80 underline underline-offset-4 p-0 -ml-2 w-full bg-transparent",children:i.jsx("span",{className:"flex justify-start",children:"View"})}):i.jsx("span",{className:"text-[#9B9B9B]",children:"--"})}},{key:"cancel",label:i.jsx(Upn,{onBulkCancel:pe,busy:N}),sortable:!1,render:(V,te)=>{const ae=P(te.oid);return i.jsx("button",{onClick:he=>{he.stopPropagation(),ae||X(te)},disabled:ae,className:`h-6 w-6 flex items-center justify-center rounded-md border text-[#FF797C] transition-all duration-200 p-1 text-[11px] ${ae?"opacity-60 cursor-not-allowed border-red-500/30 bg-red-500/10":"border-[#2A2A2A] bg-red-500/20 hover:bg-red-500/30 border-red-500/50 hover:bg-[#2A0F12]"}`,title:ae?"Cancelling...":"Cancel order",children:ae?i.jsx(Yy,{size:12,color:"#FF797C"}):"×"})}}],[Y,X,pe,N,w]),oe=(d?1:0)+(x?1:0),G=c?`${c.coin} • TP/SL for Limit @ ${lre(c.limitPx,3)}`:"Take Profit / Stop Loss";return i.jsxs(i.Fragment,{children:[i.jsx(Ru,{data:Zg(s,"openOrders",v),loading:a,columns:ie,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:V=>V.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No open orders"})}),i.jsxs(Mpn,{open:o,onClose:()=>l(!1),title:G,children:[i.jsx("div",{className:"text-center text-[14px] text-[#9B9B9B] mb-4",children:oe===2?"If order A is filled, orders B and C will be placed":"If order A is filled, order B will be placed"}),i.jsxs("div",{className:"flex flex-col items-stretch gap-6",children:[i.jsxs("div",{className:"mx-auto",children:[i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"Order A"}),i.jsx("div",{className:"w-[360px]",children:i.jsx(nF,{title:"",order:c,parentRawSide:c==null?void 0:c.side})})]}),i.jsx("div",{className:"relative mx-auto h-10 w-px bg-[#2a2a2a]"}),oe===2?i.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"If order B filled, cancel order C"}),i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"If order C filled, cancel order B"}),i.jsx(nF,{title:"Order B",order:d,parentRawSide:c==null?void 0:c.side}),i.jsx(nF,{title:"Order C",order:x,parentRawSide:c==null?void 0:c.side})]}):i.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"Order B"}),i.jsx(nF,{title:"",order:d,parentRawSide:c==null?void 0:c.side})]})]})]})]})}async function Hpn(e){const t=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return KN({address:e,signer:t,dex:""})}const Vpn="wss://api.hyperliquid.xyz/ws",RHe="https://api.hyperliquid.xyz/info";function bv(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function ej(e,t=2){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function BX(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function $X(e){return e?"Yes":"No"}function LHe(e,t){const n=Number(t||0);return n?Number(e||0)/n:null}const UX=new Map;function DHe(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(UX.has(t)||UX.set(t,{key:t,subs:new Set,ping:null,ws:null,connected:!1,booting:!1,activeRows:[],historyRows:[],fillRows:[],loadingActive:!0,loadingHistory:!0,loadingFills:!0,hydratedActive:!1}),UX.get(t)):null}function Q3(e){const t={activeRows:e.activeRows,historyRows:e.historyRows,fillRows:e.fillRows,loadingActive:e.loadingActive,loadingHistory:e.loadingHistory,loadingFills:e.loadingFills,hydratedActive:e.hydratedActive};e.subs.forEach(n=>n(t))}function jO(e){var t;try{(t=e.ws)==null||t.close()}catch{}e.ws=null,e.ping&&(clearInterval(e.ping),e.ping=null),e.connected=!1}function Wpn(e){var s;const t=((s=e==null?void 0:e.data)==null?void 0:s.clearingHouseState)??(e==null?void 0:e.data)??e;if(!t||!Object.prototype.hasOwnProperty.call(t,"twapStates"))return{has:!1,pairs:[]};const n=t.twapStates;let r=[];return Array.isArray(n)&&(n.length===1&&Array.isArray(n[0])&&Array.isArray(n[0][0])?r=n[0]:n.length&&Array.isArray(n[0])?r=n:r=[]),{has:!0,pairs:r}}function BHe(e){if(e.booting||e.connected)return;e.booting=!0,jO(e);const t=new WebSocket(Vpn);e.ws=t,t.onopen=()=>{e.connected=!0,!e.hydratedActive&&e.activeRows.length===0&&(e.loadingActive=!0,Q3(e)),t.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:e.key}})),e.ping=setInterval(()=>{try{t.send(JSON.stringify({id:1,method:"ping"}))}catch{}},3e4)},t.onmessage=n=>{try{const r=JSON.parse(n.data);if((r==null?void 0:r.method)==="pong")return;const{has:s,pairs:a}=Wpn(r);if(s){const o=[];for(const l of a){if(!Array.isArray(l)||l.length<2)continue;const[c,u]=l;if(!u||((u==null?void 0:u.user)||"").toLowerCase()!==e.key)continue;const d=LHe(u.executedNtl,u.executedSz);o.push({id:String(c),twapId:Number(c),coin:u.coin,sz:Number(u.sz||0),executedSz:Number(u.executedSz||0),avgPx:d,minutes:Number(u.minutes||0),reduceOnly:!!u.reduceOnly,randomize:!!u.randomize,timestamp:Number(u.timestamp||0),side:u.side,errors:"--"})}o.sort((l,c)=>c.timestamp-l.timestamp),e.activeRows=o,e.hydratedActive=!0,e.loadingActive=!1,Q3(e)}}catch{}},t.onclose=()=>{jO(e),setTimeout(()=>BHe(e),1500)},t.onerror=()=>{jO(e)},e.booting=!1}async function $He(e){try{e.loadingHistory=!0,Q3(e);const n=await(await fetch(RHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"twapHistory",user:e.key})})).json(),s=(Array.isArray(n)?n:[]).map((a,o)=>{var u,d;const l=(a==null?void 0:a.state)||{},c=LHe(l.executedNtl,l.executedSz);return{id:`${a.time}-${o}`,time:Number(a.time)*1e3,coin:l.coin,totalSz:Number(l.sz||0),executedSz:Number(l.executedSz||0),avgPx:c,totalMinutes:Number(l.minutes||0),reduceOnly:!!l.reduceOnly,randomize:!!l.randomize,status:(((u=a==null?void 0:a.status)==null?void 0:u.status)||"").charAt(0).toUpperCase()+(((d=a==null?void 0:a.status)==null?void 0:d.status)||"").slice(1)}});s.sort((a,o)=>o.time-a.time),e.historyRows=s}catch{e.historyRows=[]}finally{e.loadingHistory=!1,Q3(e)}}function qpn(e){const n=(Array.isArray(e)?e:[]).map(s=>{const a=(s==null?void 0:s.fill)||s,o=(s==null?void 0:s.twapId)??null;return{id:`${a==null?void 0:a.oid}-${a==null?void 0:a.time}`,coin:a==null?void 0:a.coin,dir:a==null?void 0:a.dir,px:Number((a==null?void 0:a.px)||0),sz:Number((a==null?void 0:a.sz)||0),fee:Number((a==null?void 0:a.fee)||0),closedPnl:Number((a==null?void 0:a.closedPnl)||0),oid:Number((a==null?void 0:a.oid)||0),time:Number((a==null?void 0:a.time)||0),twapId:o}}),r=new Map;return n.forEach(s=>{r.has(s.id)||r.set(s.id,s)}),[...r.values()].sort((s,a)=>a.time-s.time)}async function UHe(e){try{e.loadingFills=!0,Q3(e);const n=await(await fetch(RHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userTwapSliceFills",user:e.key})})).json();e.fillRows=qpn(n||[])}catch{e.fillRows=[]}finally{e.loadingFills=!1,Q3(e)}}function Gpn(e){const t=(e==null?void 0:e.toLowerCase())||"",[n,r]=m.useState({activeRows:[],historyRows:[],fillRows:[],loadingActive:!0,loadingHistory:!0,loadingFills:!0,hydratedActive:!1});return m.useEffect(()=>{const s=DHe(t);if(!s){r({activeRows:[],historyRows:[],fillRows:[],loadingActive:!0,loadingHistory:!1,loadingFills:!1,hydratedActive:!1});return}const a=o=>r(o);return s.subs.add(a),r({activeRows:s.activeRows,historyRows:s.historyRows,fillRows:s.fillRows,loadingActive:s.loadingActive,loadingHistory:s.loadingHistory,loadingFills:s.loadingFills,hydratedActive:s.hydratedActive}),BHe(s),$He(s),UHe(s),()=>{s.subs.delete(a),s.subs.size===0&&jO(s)}},[t]),n}function Kpn(e){const t=Math.max(0,Math.floor(e/1e3)),n=String(Math.floor(t/3600)).padStart(2,"0"),r=String(Math.floor(t%3600/60)).padStart(2,"0"),s=String(t%60).padStart(2,"0");return`${n}:${r}:${s}`}function Ypn(e=1e3){const[t,n]=m.useState(Date.now());return m.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}function EO(e=""){const t=e.toLowerCase();return t.includes("long")||t==="buy"}function _O(e=""){const t=e.toLowerCase();return t.includes("short")||t==="sell"}function Xpn(e=""){return EO(e)&&!_O(e)?3:EO(e)&&_O(e)?2:_O(e)&&!EO(e)?1:0}function Qpn({walletAddress:e}){const{activeRows:t,historyRows:n,fillRows:r,loadingActive:s,loadingHistory:a,loadingFills:o,hydratedActive:l}=Gpn(e),c=Ypn(1e3),u=m.useMemo(()=>t.map(re=>({...re,runtimeMs:Math.max(0,c-Number(re.timestamp||0))})),[t,c]),{key:d}=v2(),[f,x]=m.useState(new Set),g=re=>f.has(re),v=re=>x(pe=>new Set([...pe,re])),w=re=>x(pe=>{const Y=new Set(pe);return Y.delete(re),Y}),C=async re=>{const pe=re.twapId??Number(re.id);if(!g(pe)){v(pe);try{const Y=await Hpn(e);await ln.promise(Y.cancelTwapOrder({symbol:re.coin,twapId:pe}),{loading:`Terminating: ${re.coin} #${pe}...`,success:`Terminated: ${re.coin} #${pe}`,error:oe=>`Terminate failed: ${re.coin} #${pe} • ${(oe==null?void 0:oe.message)||oe}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}});const ie=DHe(e);if(ie){const oe=String(pe);ie.activeRows=ie.activeRows.filter(G=>String(G.twapId??G.id)!==oe),ie.hydratedActive=!0,Q3(ie),$He(ie),UHe(ie)}}finally{w(pe)}}},[N,I]=m.useState("active"),[P,R]=m.useState("active"),F=["active","history","fills"],U=F.indexOf(N)>F.indexOf(P)?"right":"left",L={enter:re=>({x:re==="right"?24:-24,opacity:0}),center:{x:0,opacity:1},exit:re=>({x:re==="right"?-24:24,opacity:0})};m.useEffect(()=>{const re=setInterval(()=>{},3e4);return()=>clearInterval(re)},[]);const z=(re,pe,Y)=>re?i.jsxs("div",{className:"px-3 py-6 flex items-center gap-2 text-[#9B9B9B]",children:[i.jsx(Yy,{size:14,color:"#9B9B9B"}),i.jsx("span",{children:Y})]}):i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:pe}),Q=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=il(),oe=()=>ie(`/terminal/hyperliquid/${pe.coin}`);return i.jsxs("div",{onPointerDown:oe,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${pe.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:pe.coin}),i.jsx("span",{className:`font-bold ${Y}`,children:re||"--"})]})}},{key:"sz",label:"Size",sortable:!0,sortValue:re=>re.sz,render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]";return i.jsxs("span",{className:Y,children:[bv(re)," ",pe.coin]})}},{key:"executedSz",label:"Executed Size",sortable:!0,sortValue:re=>re.executedSz,render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]";return re&&Number(re)!==0?i.jsxs("span",{className:Y,children:[bv(re)," ",pe.coin]}):i.jsx("span",{className:"text-[#9B9B9B]",children:"--"})}},{key:"avgPx",label:"Average Price",sortable:!0,sortValue:re=>re.avgPx||0,render:re=>re?i.jsx("span",{className:"text-white font-semibold",children:ej(re,0)}):"--"},{key:"runtime",label:"Running Time / Total",sortable:!0,sortValue:re=>re.runtimeMs??0,render:(re,pe)=>(Math.max(0,Math.floor((Date.now()-pe.timestamp)/6e4)),i.jsxs("span",{className:"text-white font-semibold",children:[Kpn(pe.runtimeMs??0)," / ",pe.minutes," minutes"]}))},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:re=>re.reduceOnly?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:$X(re)})},{key:"timestamp",label:"Creation Time",sortable:!0,sortValue:re=>re.timestamp,render:re=>i.jsx("span",{className:"text-white font-semibold",children:BX(re)})},{key:"errors",label:"Errors",sortable:!1,render:re=>i.jsx("span",{className:"text-[#9B9B9B] font-semibold",children:re||"--"})},{key:"terminate",label:"Terminate",sortable:!1,render:(re,pe)=>{const Y=pe.twapId??Number(pe.id),ie=g(Y);return i.jsx("button",{onClick:oe=>{oe.stopPropagation(),ie||C(pe)},disabled:ie,className:`h-6 w-6 flex items-center justify-center rounded-md border text-[#FF797C]
transition-colors duration-150 p-1 text-[11px]
border-red-500/50 mb-[1px] ${ie?"opacity-60 cursor-not-allowed bg-red-500/10":"bg-red-500/20"}`,title:ie?"Terminating...":"Terminate",children:ie?i.jsx(Yy,{size:12,color:"#FF797C"}):"×"})}}],[f,e]),ne=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:re=>re.time,render:re=>i.jsx("span",{className:"text-white font-semibold",children:BX(re)})},{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=il(),oe=()=>ie(`/terminal/hyperliquid/${pe.coin}`);return i.jsxs("div",{onPointerDown:oe,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${pe.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:pe.coin}),i.jsx("span",{className:`font-bold ${Y}`,children:re||"--"})]})}},{key:"totalSz",label:"Total Size",sortable:!0,sortValue:re=>re.totalSz,render:(re,pe)=>i.jsxs("span",{className:pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",children:[bv(re)," ",pe.coin]})},{key:"executedSz",label:"Executed Size",sortable:!0,sortValue:re=>re.executedSz,render:(re,pe)=>i.jsxs("span",{className:pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",children:[bv(re)," ",pe.coin]})},{key:"avgPx",label:"Average Price",sortable:!0,sortValue:re=>re.avgPx||0,render:re=>re?i.jsx("span",{className:"text-white font-semibold",children:ej(re,0)}):"--"},{key:"totalMinutes",label:"Total Runtime",sortable:!0,sortValue:re=>re.totalMinutes,render:re=>i.jsxs("span",{className:"text-white font-semibold",children:[bv(re,0)," minutes"]})},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:re=>re.reduceOnly?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:$X(re)})},{key:"randomize",label:"Randomize",sortable:!0,sortValue:re=>re.randomize?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:$X(re)})},{key:"status",label:"Status",sortable:!0,sortValue:re=>re.status||"",render:re=>i.jsx("span",{className:"text-white font-semibold",children:re||"--"})}],[]),J=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:re=>re.time,render:(re,pe)=>i.jsx("span",{className:"text-white font-semibold",children:BX(pe.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,pe)=>{const Y=pe.side==="A"||pe.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=il(),oe=()=>ie(`/terminal/hyperliquid/${pe.coin}`);return i.jsxs("div",{onPointerDown:oe,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${pe.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:pe.coin}),i.jsx("span",{className:`font-bold ${Y}`,children:re||"--"})]})}},{key:"dir",label:"Direction",sortable:!0,sortValue:re=>Xpn(re.dir),render:re=>i.jsx("span",{className:`${_O(re)?"text-[#FF6B6B]":EO(re)?"text-[#67FFBD]":"text-white"}`,children:re||"--"})},{key:"px",label:"Price",sortable:!0,sortValue:re=>re.px,render:re=>re!=null?i.jsxs("span",{className:"text-white font-semibold",children:["$",ej(re,0)]}):"--"},{key:"sz",label:"Size",sortable:!0,sortValue:re=>re.sz,render:re=>i.jsx("span",{className:"text-white font-semibold",children:bv(re)})},{key:"tradeValue",label:"Trade Value",sortable:!0,sortValue:re=>re.px*re.sz,render:(re,pe)=>pe.px&&pe.sz?i.jsxs("span",{className:"text-white font-semibold",children:["$",ej(pe.px*pe.sz)]}):"--"},{key:"fee",label:"Fee",sortable:!0,sortValue:re=>re.fee,render:re=>i.jsx("span",{className:"text-white font-semibold",children:bv(re)})},{key:"closedPnl",label:"Closed PnL",sortable:!0,sortValue:re=>re.closedPnl-re.fee,render:(re,pe)=>{const Y=Number(pe.closedPnl||0)-Number(pe.fee||0),ie=Y>0,oe=Y<0;return i.jsxs("span",{className:`${ie?"text-[#67FFBD] font-semibold":oe?"text-[#FF797C] font-semibold":"text-white font-semibold"}`,children:["$",ej(Math.abs(Y))]})}},{key:"oid",label:"Order ID",sortable:!0,sortValue:re=>re.oid,render:re=>i.jsx("span",{className:"text-[#979797] font-semibold",children:re||"--"})}],[]),X=i.jsx("div",{className:"px-3",children:i.jsx("div",{className:"relative flex gap-2 overflow-x-auto whitespace-nowrap py-2",children:[{k:"active",t:"Active"},{k:"history",t:"History"},{k:"fills",t:"Fill History"}].map(re=>{const pe=N===re.k;return i.jsxs("button",{onClick:()=>{R(N),I(re.k)},className:`relative cursor-pointer font-inter text-[12px] leading-[15px] px-4 py-[6px] flex items-center justify-center gap-[10px] rounded-lg bg-transparent ${pe?"text-white":"text-[#929292] hover:text-white"}`,children:[pe&&i.jsx(vo.span,{layoutId:"twap-pill",className:"absolute inset-0 rounded-lg bg-[#262626]",transition:{type:"spring",stiffness:380,damping:30}}),i.jsx("span",{className:"relative z-10",children:re.t})]},re.k)})})});return i.jsxs("div",{className:"flex flex-col h-full",children:[X,i.jsx("div",{className:"flex-1 min-h-0 relative",children:i.jsx(mT,{mode:"wait",custom:U,children:i.jsx(vo.div,{custom:U,variants:L,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:320,damping:28},className:"absolute inset-0",children:N==="active"?i.jsx(Ru,{data:Zg(u,"twap",d),loading:s||!l,columns:Q,rowHeight:28,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[12px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:re=>re.id,emptyState:z(s||!l,"No Active TWAP","Loading Active TWAP…")}):N==="history"?i.jsx(Ru,{data:Zg(n,"twap",d),loading:a,columns:ne,rowHeight:28,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[12px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:re=>re.id,emptyState:z(a,"No TWAP History","Loading TWAP History…")}):i.jsx(Ru,{data:Zg(r,"twap",d),loading:o,columns:J,rowHeight:28,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[12px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:re=>re.id,emptyState:z(o,"No TWAP fills available","Loading TWAP fills…")})},N)})})]})}const Zpn="wss://api.hyperliquid.xyz/ws",Jpn="https://api-ui.hyperliquid.xyz/info",emn={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},tmn=e=>emn[e]||e;function nmn(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function tj(e,t=2){return`$${Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}`}function cre(e){return e==="Open Long"||e==="Close Short"||e==="Short > Long"}function ure(e){return e==="Open Short"||e==="Close Long"||e==="Long > Short"}function rmn(e){return cre(e)?1:ure(e)?0:-1}function smn(e){const t=Date.now(),n=Math.max(0,t-Number(e||0)),r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;const s=Math.floor(r/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ${s%60}m ago`:`${Math.floor(a/24)}d ${a%24}h ago`}function imn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}const zX=new Map;function amn(e,t=!0){const n=(e==null?void 0:e.toLowerCase())||"";if(!n)return null;zX.has(n)||zX.set(n,{key:n,rows:[],loading:!0,ws:null,ping:null,subs:new Set,booting:!1,connected:!1,hydrated:!1,aggregateByTime:t});const r=zX.get(n);return r.aggregateByTime=t,r}function dre(e){e.subs.forEach(t=>t({rows:e.rows,loading:e.loading}))}function kO(e){var t;try{(t=e.ws)==null||t.close()}catch{}e.ws=null,e.ping&&(clearInterval(e.ping),e.ping=null),e.connected=!1}function zHe(e){const n=(Array.isArray(e)?e:[]).map(s=>({id:`${(s==null?void 0:s.hash)||""}`,oid:s==null?void 0:s.oid,coin:s==null?void 0:s.coin,dir:(s==null?void 0:s.dir)||((s==null?void 0:s.side)==="B"?"Buy":(s==null?void 0:s.side)==="S"?"Sell":""),px:Number((s==null?void 0:s.px)||0),sz:Number((s==null?void 0:s.sz)||0),fee:Number((s==null?void 0:s.fee)||0),feeToken:(s==null?void 0:s.feeToken)||"USDC",closedPnl:Number((s==null?void 0:s.closedPnl)||0),time:Number((s==null?void 0:s.time)||0)})),r=new Map;return n.forEach(s=>{s.id&&!r.has(s.id)&&r.set(s.id,s)}),[...r.values()].sort((s,a)=>a.time-s.time)}async function omn(e){try{e.loading=!0,dre(e);const n=await(await fetch(Jpn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({aggregateByTime:!!e.aggregateByTime,type:"userFills",user:e.key})})).json();e.rows=zHe(n||[]),e.hydrated=!0}catch{e.rows=[]}finally{e.loading=!1,dre(e)}}function NSe(e,t){const n=(t==null?void 0:t.fills)||t||[];if(!Array.isArray(n)||!n.length)return;const r=zHe(n),s=[...e.rows],a=new Set(s.map(o=>o.id));r.forEach(o=>{a.has(o.id)||(s.unshift(o),a.add(o.id))}),s.sort((o,l)=>l.time-o.time),e.rows=s,dre(e)}async function HHe(e){if(e.booting||e.connected)return;e.booting=!0,kO(e);const t=new WebSocket(Zpn);e.ws=t,t.onopen=()=>{e.connected=!0,t.send(JSON.stringify({method:"subscribe",subscription:{aggregateByTime:!!e.aggregateByTime,type:"userFills",user:e.key}})),e.ping=setInterval(()=>{try{t.send(JSON.stringify({id:99,method:"ping"}))}catch{}},3e4)},t.onmessage=n=>{var r,s;try{const a=JSON.parse(n.data);if((a==null?void 0:a.method)==="pong"||(a==null?void 0:a.result)==="success")return;(a==null?void 0:a.channel)==="userFills"&&NSe(e,a==null?void 0:a.data),(a==null?void 0:a.channel)==="user"&&((r=a==null?void 0:a.data)!=null&&r.fills)&&NSe(e,(s=a==null?void 0:a.data)==null?void 0:s.fills)}catch{}},t.onclose=()=>{kO(e),setTimeout(()=>HHe(e),1500)},t.onerror=()=>{kO(e)},e.booting=!1}function lmn(e,t){const n=(e==null?void 0:e.toLowerCase())||"",[r,s]=m.useState({rows:[],loading:!0});return m.useEffect(()=>{const a=amn(n,t);if(!a){s({rows:[],loading:!1});return}const o=l=>s(l);return a.subs.add(o),s({rows:a.rows,loading:a.loading}),omn(a),HHe(a),()=>{a.subs.delete(o),a.subs.size===0&&kO(a)}},[n,t]),r}function cmn({walletAddress:e,listHeight:t=560}){const[n,r]=m.useState(()=>typeof window>"u"?!0:window.localStorage.getItem("tradeHistoryAggregate")!=="false");m.useEffect(()=>{typeof window<"u"&&window.localStorage.setItem("tradeHistoryAggregate",n?"true":"false")},[n]);const{rows:s,loading:a}=lmn(e,n),[o,l]=m.useState(typeof window<"u"&&localStorage.getItem("isDateTradeHistoryFormat")||"date"),c=m.useRef(o);m.useEffect(()=>{typeof window<"u"&&localStorage.setItem("isDateTradeHistoryFormat",o),c.current=o},[o]);const{key:u}=v2(),{isReferralCodeName:d}=m.useContext(Qr),[f,x]=m.useState(!1),[g,v]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),[w,C]=m.useState(()=>new Map),N=m.useCallback(async R=>{const F=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,U=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;if(!F||!U||!R||R.length===0)return null;try{const{data:L}=await ds.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:F,token:U,position_oids:R},{headers:{"Content-Type":"application/json"}});if(L&&L.success){const z=parseFloat(L.leverage);return C(Q=>{const ne=new Map(Q);return R.forEach(J=>ne.set(String(J),z)),ne}),z}}catch(L){console.error("leverage fetch error:",L)}return null},[]);m.useEffect(()=>{if(f&&!g.referral){const R=d||typeof window<"u"&&window.localStorage.getItem("refcode")||"";R&&v(F=>({...F,referral:R}))}},[f,d,g.referral]);const I=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:R=>R.time,render:(R,F)=>i.jsx("button",{onClick:()=>l(U=>U==="date"?"relative":"date"),className:"text-left text-white bg-transparent font-semibold",children:c.current==="date"?imn(F.time):smn(F.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:R=>R.coin||"",render:(R,F)=>{const U=il(),L=()=>U(`/terminal/hyperliquid/${F.coin}`);return i.jsxs("div",{onPointerDown:L,className:"flex items-center text-white font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${tmn(F.coin)}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:F.coin}),i.jsx("span",{className:`font-bold ${ure(F.dir)?"text-[#FF6B6B]":cre(F.dir)?"text-[#67FFBD]":"text-white"}`,children:R||"--"})]})}},{key:"dir",label:"Direction",sortable:!0,sortValue:R=>rmn(R.dir),render:R=>i.jsx("span",{className:`font-semibold ${ure(R)?"text-[#FF6B6B]":cre(R)?"text-[#67FFBD]":"text-white"}`,children:R||"--"})},{key:"px",label:"Price",sortable:!0,sortValue:R=>R.px,render:R=>i.jsx("span",{className:"text-white font-semibold",children:tj(R)})},{key:"sz",label:"Size",sortable:!0,sortValue:R=>R.sz,render:(R,F)=>i.jsxs("span",{className:"text-white font-semibold",children:[nmn(R)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:F.coin})]})},{key:"tradeValue",label:"Trade Value",sortable:!0,sortValue:R=>R.px*R.sz,render:(R,F)=>i.jsxs("span",{className:"text-white font-semibold",children:[tj(F.px*F.sz)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"})]})},{key:"fee",label:"Fee",sortable:!0,sortValue:R=>R.fee,render:(R,F)=>i.jsxs("span",{className:"text-white font-semibold",children:[tj(R)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:F.feeToken||"USDC"})]})},{key:"netPnl",label:"Closed PnL",sortable:!0,sortValue:R=>R.closedPnl-R.fee,render:(R,F)=>{const U=Number(F.closedPnl||0),L=Number(F.fee||0),z=U-L,Q=z>0,ne=z<0,J=!!U,X=Number(F.px||0)*Number(F.sz||0),re=X>0?z/X*100:0;return i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("span",{className:`${Q?"text-[#67FFBD] font-semibold":ne?"text-[#FF797C] font-semibold":"text-white font-semibold"}`,children:[z===0?tj(0):`${z<0?"-":""}${tj(Math.abs(z))}`," ",i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"})]}),J&&i.jsx("button",{onClick:async()=>{const pe=d||typeof window<"u"&&window.localStorage.getItem("refcode")||"";let Y=0;const ie=F.oid;if(ie){const oe=w.get(String(ie));if(oe!=null)Y=oe;else{const G=await N([ie]);typeof G=="number"&&!Number.isNaN(G)&&(Y=G)}}v({coin:F.coin||"",type:(F.dir||"").toUpperCase(),leverage:Y,roe:re,entryPrice:Number(F.px||0),markPrice:Number(F.px||0),referral:pe,positionDistribution:0,pnl:Number(z||0),closePx:Number(F.px||0)}),x(!0)},className:"flex items-center h-6 text-[#67FFBD] text-[11px] font-semibold bg-transparent p-0",title:"Share",children:i.jsx("img",{src:xm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}}],[o,d,N,w]),P=m.useMemo(()=>Zg(s,"trades",u),[s,u]);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex items-center justify-end mt-2 px-1 mr-5",children:i.jsxs("label",{className:"flex items-center gap-2 text-[11px] text-[#9B9B9B]",children:[i.jsx("span",{children:"Aggregate"}),i.jsx("input",{type:"checkbox",checked:n,onChange:R=>r(R.target.checked),className:"w-3 h-3 accent-[#67FFBD]"})]})}),i.jsx(Ru,{data:P,loading:a,columns:I,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:R=>R.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No trades"})}),i.jsx(hT,{open:f,setOpen:x,data:g,setTradeInfo:v,pnlTitle:""})]})}const umn="https://api.hyperliquid.xyz/info";function dmn(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function ASe(e,t=4){return`$${Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}`}function fmn(e){return`${(Number(e||0)*100).toLocaleString(void 0,{maximumFractionDigits:6})}%`}function hmn(e){const t=Date.now(),n=Math.max(0,t-Number(e||0)),r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;const s=Math.floor(r/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ${s%60}m ago`:`${Math.floor(a/24)}d ${a%24}h ago`}function pmn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function mmn({walletAddress:e,listHeight:t=560,days:n=30}){const[r,s]=m.useState([]),[a,o]=m.useState(!0),[l,c]=m.useState(typeof window<"u"&&localStorage.getItem("isDateFundingHistoryFormat")||"date"),{key:u}=v2(),d=m.useRef(l);m.useEffect(()=>{typeof window<"u"&&localStorage.setItem("isDateFundingHistoryFormat",l),d.current=l},[l]),m.useEffect(()=>{let x=!0;async function g(){if(!e){x&&(s([]),o(!1));return}try{o(!0);const v=Date.now()-n*24*60*60*1e3,C=await(await fetch(umn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userFunding",user:e,startTime:v})})).json(),I=(Array.isArray(C)?C:Array.isArray(C==null?void 0:C.data)?C.data:[]).map((P,R)=>{const F=(P==null?void 0:P.delta)||{},U=Number((F==null?void 0:F.szi)||0),L=Number((F==null?void 0:F.fundingRate)||0),z=Number((F==null?void 0:F.usdc)||0);let Q=U>0?"Long":U<0?"Short":null;return!Q&&L!==0&&z!==0&&(Q=L>0?z<0?"Long":"Short":z<0?"Short":"Long"),Q||(Q="Flat"),{id:`${P.time||R}-${F.coin||""}-${R}`,time:Number((P==null?void 0:P.time)||0),coin:(F==null?void 0:F.coin)||"",rate:Number((F==null?void 0:F.fundingRate)||0),size:U,amount:z,token:"USDC",side:Q}}).sort((P,R)=>R.time-P.time);x&&s(I)}catch{x&&s([])}finally{x&&o(!1)}}return g(),()=>{x=!1}},[e,n]);const f=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:x=>x.time,render:(x,g)=>i.jsx("button",{onClick:()=>c(v=>v==="date"?"relative":"date"),className:"text-left text-white bg-transparent font-semibold",children:d.current==="date"?pmn(g.time):hmn(g.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:x=>x.coin||"",render:(x,g)=>{const v=g.side==="Long"?"text-[#67FFBD]":g.side==="Short"?"text-[#FF6B6B]":"text-white",w=il(),C=()=>w(`/terminal/hyperliquid/${g.coin}`);return i.jsxs("div",{onPointerDown:C,className:`flex items-center font-medium cursor-pointer hover:opacity-80 ${v}`,children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${g.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:g.coin}),i.jsx("span",{children:x||"--"})]})}},{key:"size",label:"Size",sortable:!0,sortValue:x=>x.size,render:(x,g)=>i.jsxs("span",{className:"text-white font-semibold",children:[dmn(x)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:g.coin})]})},{key:"side",label:"Position Side",sortable:!0,sortValue:x=>x.side,render:x=>{const g=x==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":x==="Short"?"text-[#ff797c] bg-[#ff797c]/20":"text-[#9B9B9B] bg-[#9B9B9B]/10";return i.jsx("span",{className:`flex justify-center items-center h-5 px-2 py-1 rounded-md text-[11px] font-semibold uppercase ${g}`,children:x})}},{key:"amount",label:"Payment",sortable:!0,sortValue:x=>x.amount,render:x=>{const g=x>0?"text-[#67FFBD]":x<0?"text-[#FF6B6B]":"text-white";return i.jsx("span",{className:g,children:x===0?ASe(0):`${x<0?"-":""}${ASe(Math.abs(x))}`})}},{key:"rate",label:"Rate",sortable:!0,sortValue:x=>x.rate,render:x=>i.jsx("span",{className:"text-white font-semibold",children:fmn(x)})}],[]);return i.jsx(Ru,{data:Zg(r,"funding",u),loading:a,columns:f,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:x=>x.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No funding records"})})}function rF(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function xmn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function gmn(e){return e.side==="B"?e.reduceOnly?"Close Short":"Open Long":e.side==="A"?e.reduceOnly?"Close Long":"Open Short":e.side||"-"}function fre(e){return e==="Open Long"||e==="Close Short"||e==="Short > Long"}function hre(e){return e==="Open Short"||e==="Close Long"||e==="Long > Short"}function bmn(e){return fre(e)?1:hre(e)?0:-1}function ymn({walletAddress:e,listHeight:t=560}){const[n,r]=m.useState([]),[s,a]=m.useState(!1),{key:o}=v2();m.useEffect(()=>{let c=!0;async function u(){if(!e){c&&r([]);return}try{a(!0);const x=(await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"historicalOrders",user:e})})).json()||[]).map(g=>{var C;const v=g.order||{},w=Math.max(0,Number(v.origSz||0)-Number(v.sz||0));return{id:`${v.oid}-${g.status}`,time:Number(g.statusTimestamp||v.timestamp||0),type:v.orderType||"-",coin:v.coin||"-",sideText:gmn(v),size:Number(v.sz||0),filled:w,orderValue:(C=v.orderType)!=null&&C.toLowerCase().includes("market")?"Market":`${(Number(v.limitPx)/1e3).toFixed(2)} USDC`,priceLabel:v.orderType==="Market"?"Market":`${rF(Number(v.limitPx||0),2)} USD`,reduceOnly:!!v.reduceOnly,trigger:v.triggerCondition&&v.triggerCondition!=="N/A"?`${v.triggerCondition} @ ${rF(Number(v.triggerPx||0),4)}`:"N/A",status:g.status?g.status[0].toUpperCase()+g.status.slice(1):"-",orderId:v.oid}});x.sort((g,v)=>v.time-g.time),c&&r(x)}catch{c&&r([])}finally{c&&a(!1)}}return u(),()=>{c=!1}},[e]);const l=m.useMemo(()=>[{key:"time",label:"Time",width:"140px",sortable:!0,sortValue:c=>c.time,render:c=>i.jsx("span",{className:"text-white font-semibold",children:xmn(c)})},{key:"type",label:"Type",sortable:!0,sortValue:c=>c.type||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"coin",label:"Coin",sortable:!0,sortValue:c=>c.coin||"",render:(c,u)=>{const d=il(),f=()=>d(`/terminal/hyperliquid/${u.coin}`);return i.jsxs("div",{onPointerDown:f,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${u.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2",alt:u.coin}),i.jsx("span",{className:`font-bold ${hre(u.sideText)?"text-[#FF6B6B]":fre(u.sideText)?"text-[#67FFBD]":"text-white"}`,children:c})]})}},{key:"sideText",label:"Side",sortable:!0,sortValue:c=>bmn(c.sideText),render:c=>i.jsx("span",{className:`font-semibold ${hre(c)?"text-[#FF6B6B]":fre(c)?"text-[#67FFBD]":"text-white"}`,children:c})},{key:"size",label:"Size",sortable:!0,sortValue:c=>c.size,render:c=>Number(c)>0?i.jsx("span",{className:"text-white font-semibold",children:rF(c)}):i.jsx("span",{className:"text-white font-semibold",children:"--"})},{key:"filled",label:"Filled",sortable:!0,sortValue:c=>c.filled,render:c=>Number(c)>0?i.jsx("span",{className:"text-white font-semibold",children:rF(c)}):i.jsx("span",{className:"text-white font-semibold",children:"--"})},{key:"orderValue",label:"Order Value",sortable:!0,sortValue:c=>c.orderValue,render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"priceLabel",label:"Price",sortable:!0,sortValue:c=>c.priceLabel==="Market"?-1:Number(String(c.priceLabel).replace(/[^0-9.]/g,"")),render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:c=>c.reduceOnly?1:0,render:c=>i.jsx("span",{className:"text-whitefont-semibold",children:c?"✓":"–"})},{key:"trigger",label:"Trigger",sortable:!0,sortValue:c=>c.trigger||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c||"N/A"})},{key:"status",label:"Status",sortable:!0,sortValue:c=>c.status||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"orderId",label:"Order ID",sortable:!0,sortValue:c=>c.trigger||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})}],[]);return i.jsx(Ru,{data:Zg(n,"orderHistory",o),columns:l,loading:s,skeletonRowCount:12,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:c=>c.id})}const vmn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/list/",wmn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/update/",Cmn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/update/",Smn="https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/update/";function jSe(e,t=4){const n=Number(e||0);return Number.isFinite(n)?n.toLocaleString(void 0,{maximumFractionDigits:t}):"--"}function Nmn(e,t=2){const n=Number(e||0);return Number.isFinite(n)?`$${n.toLocaleString(void 0,{maximumFractionDigits:t})}`:"--"}const Amn={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},nj=e=>{if(typeof e=="string"){const t=e.match(/^([A-Za-z]+:)(.*)$/);if(t){const n=t[1].toLowerCase(),r=t[2];return n+r}}return Amn[e]||e},jmn=e=>e&&e.length>10?`${e.slice(0,6)}...${e.slice(-4)}`:e||"--";function TO({walletAddress:e,sourceMarket:t="hyper"}){var U,L;const{botSlotsInfo:n,refreshBotSlots:r}=m.useContext(Qr)||{},[s,a]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(0),[x,g]=m.useState(null),v=il();m.useEffect(()=>{let z=!0;async function Q(){if(typeof window>"u")return;const ne=window.localStorage.getItem("hyperAddress"),J=window.localStorage.getItem("hyperToken");if(!ne||!J){z&&(a([]),l(!1));return}try{l(!0);const re=await(await fetch(vmn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ne,token:J})})).json(),Y=(Array.isArray(re==null?void 0:re.data)?re.data:Array.isArray(re)?re:[]).filter(ie=>t?ie.source_market===t:!0);z&&a(Y)}catch{z&&(a([]),ln.error("Failed to load bots"))}finally{z&&l(!1)}}return Q(),()=>{z=!1}},[e,t,d]),m.useEffect(()=>{const z=Q=>{const ne=Q&&Q.detail&&Q.detail.sourceMarket;ne&&ne!==t||f(J=>J+1)};return window.addEventListener("gridbotUpdated",z),()=>{window.removeEventListener("gridbotUpdated",z)}},[t]);const w=m.useMemo(()=>{const z=s.map(Q=>{const ne=Q.bot_params||{},J=ne.investment||{},X=ne.priceRange||{},re=ne.liquidationPrices||{},pe=ne.direction==="long"?"Long":ne.direction==="short"?"Short":"--";return{id:Q.id,coin:Q.coin||ne.symbol||"--",market:Q.source_market||"",status:Q.is_deleted?"Stopped":"Active",side:pe,gridType:ne.gridType||"--",gridCount:ne.gridCount??"--",lower:X.lower??null,upper:X.upper??null,currentPrice:ne.currentPrice??null,leverage:J.leverage??null,collateral:J.collateral??null,totalInvestment:J.totalInvestment??null,liqLong:re.long??null,liqShort:re.short??null,trailingUp:ne.trailing_up??null,trailingDown:ne.trailing_down??null,slUp:ne.sl_up??null,slDown:ne.sl_down??null,timestamp:ne.timestamp||null,walletName:Q.wm_name||null,walletAddress:Q.wm_address||null,walletId:Q.wallet_id??null,raw:Q}});return z.sort((Q,ne)=>{const J=Q.status==="Active",X=ne.status==="Active";if(J!==X)return J?-1:1;const re=Q.timestamp?new Date(Q.timestamp).getTime():0;return(ne.timestamp?new Date(ne.timestamp).getTime():0)-re}),z},[s]),C=async(z,Q)=>{var X,re,pe;if(!z||!z.raw||typeof window>"u")return;const ne=window.localStorage.getItem("hyperAddress"),J=window.localStorage.getItem("hyperToken");if(!ne||!J){ln.error("Please sign in to manage bots");return}try{u(z.id);const Y={is_deleted:Q,bot_params:z.raw.bot_params||{}},ie=String(((X=z.raw)==null?void 0:X.source_market)||"").toLowerCase().includes("lighter")?Cmn:String(((re=z.raw)==null?void 0:re.source_market)||"").toLowerCase().includes("extended")?Smn:wmn,G=await(await fetch(ie,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ne,token:J,bot_id:z.id,update_params:Y})})).json().catch(()=>null);if(!(G!=null&&G.success)){const V=(G==null?void 0:G.error_message)||(G==null?void 0:G.message)||(G==null?void 0:G.detail)||"Failed to update bot";throw new Error(V)}ln.success(Q?"Bot stopped":"Bot started"),a(V=>V.map(te=>te.id===z.id?{...te,is_deleted:Q}:te)),r==null||r(),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:((pe=z.raw)==null?void 0:pe.source_market)||t}})),f(V=>V+1)}catch(Y){ln.error(Y.message||"Failed to update bot")}finally{u(null)}},N=z=>{if(!z||!z.raw||typeof window>"u")return;const Q=z.status==="Active",ne=(J,X)=>{var oe,G,V,te;const re=((oe=J==null?void 0:J.raw)==null?void 0:oe.wallet_id)??(J==null?void 0:J.walletId),pe=((G=X==null?void 0:X.raw)==null?void 0:G.wallet_id)??(X==null?void 0:X.walletId);if(re&&pe&&String(re)===String(pe))return!0;const Y=((J==null?void 0:J.walletAddress)||((V=J==null?void 0:J.raw)==null?void 0:V.wm_address)||"").toLowerCase(),ie=((X==null?void 0:X.walletAddress)||((te=X==null?void 0:X.raw)==null?void 0:te.wm_address)||"").toLowerCase();return!!(Y&&ie&&Y===ie)};if(!Q){if(w.some(X=>{var re,pe;return X.id!==z.id&&X.status==="Active"&&((re=X.raw)==null?void 0:re.source_market)===((pe=z.raw)==null?void 0:pe.source_market)&&ne(X,z)})){ln.error("You already have an active bot on this wallet. Please add an account.");return}g(z);return}C(z,Q)},I=()=>g(null),P=()=>{x&&(C(x,!1),g(null))},R=z=>{var re,pe,Y;if(!z)return;const Q=z.coin;if(!Q)return;const ne=((re=z.raw)==null?void 0:re.source_market)||z.market||t,J=z.status==="Active",X={sourceMarket:ne,coin:Q,botParams:((pe=z.raw)==null?void 0:pe.bot_params)||{},walletId:(Y=z.raw)==null?void 0:Y.wallet_id,isActive:J};if(typeof window<"u"){try{window.localStorage.setItem("gridbot:pending_selection",JSON.stringify(X))}catch{}window.dispatchEvent(new CustomEvent("gridbotSelectFromTasks",{detail:X}))}v(ne==="hyper"?`/terminal/hyperliquid/${nj(Q)}#gridbot`:ne==="lighter"?`/terminal/lighter/${nj(Q)}#gridbot`:`/terminal/extended/${nj(Q)}#gridbot`)},F=m.useMemo(()=>[{key:"status",label:"Status",sortable:!0,sortValue:z=>z.status==="Active"?1:0,render:z=>{const Q=z==="Active"?"text-[#67ffbd] bg-[#67ffbd]/15":"text-[#9B9B9B] bg-[#9B9B9B]/10";return i.jsx("span",{className:`inline-flex h-6 items-center justify-center px-2 py-[2px] rounded-md text-[11px] font-semibold ${Q}`,children:z})}},{key:"coin",label:"Coin",sortable:!0,sortValue:z=>z.coin||"",render:(z,Q)=>{var re;const ne=il(),J=String(((re=Q.raw)==null?void 0:re.source_market)||Q.market||t||"").toLowerCase();J.includes("lighter")||J.includes("extended");const X=()=>ne(`/terminal/${J}/${nj(Q.coin)}${Q.status==="Active"||Q.status==="Stopped"?"#gridbot":""}`);return i.jsxs("div",{onPointerDown:X,className:"flex items-center gap-2 text-white font-medium hover:opacity-80 cursor-pointer",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${nj(z)}.svg`,onError:ra,className:"w-4 h-4",alt:z}),i.jsx("span",{children:z.replace("XYZ:","")||"--"})]})}},{key:"wallet",label:"Wallet",sortable:!0,sortValue:z=>z.walletName||z.walletAddress||"",render:(z,Q)=>{const ne=Q.walletName||"Wallet",J=Q.walletAddress?jmn(Q.walletAddress):"--";return i.jsxs("div",{className:"flex flex-col leading-[14px]",children:[i.jsx("span",{className:"text-white font-medium",children:ne}),i.jsx("span",{className:"text-[10px] text-white/60",children:J})]})}},{key:"gridCount",label:"Grids",sortable:!0},{key:"lower",label:"Lower",sortable:!0,render:z=>z==null?"--":i.jsx("span",{className:"text-[#67FFBD] font-semibold",children:jSe(z)})},{key:"upper",label:"Upper",sortable:!0,render:z=>z==null?"--":i.jsx("span",{className:"text-[#FF797C] font-semibold",children:jSe(z)})},{key:"investment",label:"Investment",sortable:!0,sortValue:z=>z.totalInvestment??z.collateral??0,render:(z,Q)=>i.jsx("div",{className:"flex flex-col leading-[14px]",children:i.jsx("span",{className:"text-white font-semibold",children:Q.collateral!=null?Nmn(Q.collateral):"--"})})},{key:"leverage",label:"Lev",sortable:!0,render:z=>z==null?"--":`${z}x`},{key:"gridType",label:"Grid Type",sortable:!0},{key:"actions",label:"Actions",render:(z,Q)=>{const ne=Q.status==="Active",J=c===Q.id;return i.jsxs("div",{className:"relative z-10 flex items-center justify-start gap-2",onClick:X=>X.stopPropagation(),onMouseDown:X=>X.stopPropagation(),children:[i.jsx("button",{type:"button",onPointerDown:X=>{X.preventDefault(),X.stopPropagation(),R(Q)},className:"h-6 flex justify-center items-center px-2 rounded-md text-[11px] font-semibold bg-[#161616] text-[#E5E7EB] hover:bg-[#1F2933]",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M12 20h9"}),i.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 1 1 3 3L7 19l-4 1 1-4Z"})]})}),i.jsx("button",{type:"button",disabled:J,onPointerDown:X=>{X.preventDefault(),X.stopPropagation(),N(Q)},className:`h-6 flex justify-center items-center px-3 rounded-md text-[11px] font-semibold ${ne?"bg-[#2a1616] text-[#ff797c] hover:bg-[#3a1c1c]":"bg-[#101613] text-[#67ffbd] hover:bg-[#19201b]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:J?"Saving...":ne?"Stop":"Start"})]})}}],[c]);return i.jsxs(i.Fragment,{children:[i.jsx(Ru,{data:w,loading:o,columns:F,rowHeight:32,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent",cellClassName:()=>"py-1 text-[11px] font-normal",rowKey:z=>z.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No bots for this market"})}),i.jsx(up,{isOpen:!!x,onClose:I,children:i.jsxs("div",{className:"w-[320px] sm:w-[380px] rounded-2xl bg-[#050505] px-6 py-5 text-[#E5E7EB]",onClick:z=>z.stopPropagation(),children:[i.jsxs("div",{className:"text-sm font-semibold text-white",children:["Start"," ",String(((U=x==null?void 0:x.raw)==null?void 0:U.source_market)||"").toLowerCase().includes("lighter")?"Lighter":String(((L=x==null?void 0:x.raw)==null?void 0:L.source_market)||"").toLowerCase().includes("extended")?"Extended":"Hyperliquid"," ","Grid Bot?"]}),i.jsxs("p",{className:"mt-3 text-[13px] text-[#9B9B9B]",children:["You are starting the"," ",i.jsx("span",{className:"text-white font-bold",children:x==null?void 0:x.coin})," ","grid bot. Make sure your parameters are correct."]}),i.jsxs("div",{className:"mt-5 flex items-center justify-end gap-3",children:[i.jsx("button",{type:"button",onClick:I,className:"h-9 rounded-xl border border-[#2c2c2c] px-4 text-[12px] font-semibold text-[#9B9B9B] transition hover:border-[#3f3f3f] hover:text-white",children:"Cancel"}),i.jsx("button",{type:"button",onClick:P,className:"h-9 rounded-xl bg-[#67FFBD] px-4 text-[12px] font-semibold text-black transition hover:brightness-105",children:"Start Bot"})]})]})})]})}function Emn(){const[e,t]=m.useState(()=>typeof window>"u"?!1:localStorage.getItem("hide_small_balances")==="1");return m.useEffect(()=>{typeof window<"u"&&(localStorage.setItem("hide_small_balances",e?"1":"0"),window.dispatchEvent(new CustomEvent("balances:hide-small-changed",{detail:{value:e}})))},[e]),i.jsxs("label",{className:"inline-flex items-center gap-2 text-[12px] text-white mr-3 mt-1.5",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD] w-[14px] h-[14px]",checked:e,onChange:n=>t(n.target.checked)}),"Hide Small Balances"]})}function _mn(e){const{data:t,loading:n,error:r,isDigits:s,period:a,periods:o,handlePeriodChange:l,className:c="",minHeight:u="min-h-[560px]",walletAddress:d,coin:f,sourceMarket:x="hyper"}=e,{setSignInConnectButtonOpen:g}=m.useContext(Qr),[v,w]=m.useState(()=>typeof window>"u"?d||null:window.localStorage.getItem("hl_selected_wallet_address")||d||null);m.useEffect(()=>{const he=()=>{if(typeof window>"u"){w(d||null);return}const Ce=window.localStorage.getItem("hl_selected_wallet_address");w(Ce||d||null)};return he(),window.addEventListener("hl_selected_wallet_changed",he),window.addEventListener("storage",he),()=>{window.removeEventListener("hl_selected_wallet_changed",he),window.removeEventListener("storage",he)}},[d]);const C=v||d||null,[N,I]=m.useState(()=>C);m.useEffect(()=>{C&&I(C)},[C]);const P=C||N||null,[R,F]=m.useState({address:null,token:null}),[U,L]=m.useState(!1);m.useEffect(()=>{const he=()=>{const Ce=typeof window<"u"?localStorage.getItem("hyperAddress"):null,ce=typeof window<"u"?localStorage.getItem("hyperToken"):null;F({address:Ce,token:ce}),L(!0)};return he(),window.addEventListener("localStorageUpdated",he),window.addEventListener("storage",he),()=>{window.removeEventListener("localStorageUpdated",he),window.removeEventListener("storage",he)}},[]);const z=!!(R.address&&R.token),Q=he=>he==="balances"?"Connect your wallet to see your balances":he==="positions"?"Connect your wallet to see your positions":he==="open"?"Connect your wallet to see your open orders":he==="twap"?"Connect your wallet to see your TWAP orders":he==="trades"?"Connect your wallet to see your trade history":he==="funding"?"Connect your wallet to see your funding history":he==="orders"?"Connect your wallet to see your order history":"Connect your wallet to continue",ne=(he,Ce)=>U?z?he:i.jsxs("div",{className:"w-full h-full flex flex-col items-center py-10 gap-3",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6]",children:Q(Ce)}),i.jsx("div",{className:"w-[220px]",children:i.jsx(r0,{onClick:()=>g(!0)})})]}):he,X=`terminalTabs:${typeof window<"u"?window.location.pathname:"tt"}`,[re,pe]=m.useState(()=>typeof window>"u"?"balances":localStorage.getItem(X)||"balances"),Y=wHe(P),ie=tfn(P),oe=[{k:"balances",t:"Balances"},{k:"positions",t:`Positions${z&&Number.isFinite(Y)?` (${Y})`:""}`},{k:"open",t:`Open Orders${z&&Number.isFinite(ie)?` (${ie})`:""}`},{k:"twap",t:"TWAP"},{k:"trades",t:"Trade History"},{k:"funding",t:"Funding History"},{k:"orders",t:"Order History"},{k:"all",t:"Top Traders"},{k:"bots",t:"Bot Tasks"}];m.useEffect(()=>{oe.map(Ce=>Ce.k).includes(re)||pe("balances")},[oe,re]),m.useEffect(()=>{typeof window<"u"&&localStorage.setItem(X,re)},[re,X]),m.useEffect(()=>{const he=Ce=>{var Ae;const ce=(Ae=Ce==null?void 0:Ce.detail)==null?void 0:Ae.tab,ge=oe.map(ye=>ye.k);ce&&ge.includes(ce)&&pe(ce)};return window.addEventListener("terminal:setTab",he),()=>window.removeEventListener("terminal:setTab",he)},[oe]);const G=he=>{pe(he)},V=(P||"no-wallet").toLowerCase();let te;re==="balances"?te=i.jsx(Spn,{walletAddress:P}):re==="positions"?te=i.jsx(Ipn,{walletAddress:P,coin:f}):re==="open"?te=i.jsx(zpn,{walletAddress:P}):re==="twap"?te=i.jsx(Qpn,{walletAddress:P}):re==="trades"?te=i.jsx(cmn,{walletAddress:P}):re==="funding"?te=i.jsx(mmn,{walletAddress:P}):re==="orders"?te=i.jsx(ymn,{walletAddress:P}):re==="bots"?te=i.jsx(TO,{walletAddress:P,sourceMarket:x}):re==="all"?te=i.jsx(ipn,{data:t,loading:n,error:r,isDigits:s,period:a,periods:o,handlePeriodChange:l}):te=i.jsx("div",{className:"h-full"});const ae=re==="all"?te:ne(te,re);return i.jsx(tpn,{children:i.jsxs("div",{className:`bg-[#101010] rounded-2xl flex flex-col h-full ${u} overflow-hidden ${c}`,children:[i.jsx("div",{className:"px-3",children:i.jsxs("div",{className:"relative flex overflow-x-auto whitespace-nowrap pt-2 -mb-3",children:[oe.map(he=>{const Ce=re===he.k;return i.jsxs("button",{onClick:()=>G(he.k),className:`relative cursor-pointer font-inter text-[13px] font-normal leading-[16px] px-2 py-[6px] flex items-center justify-center gap-[10px] text-xs rounded-lg bg-transparent ${Ce?"text-white":"text-[#929292] hover:text-white"}`,children:[Ce&&i.jsx("span",{className:"absolute inset-0 rounded-lg bg-[#262626]"}),i.jsx("span",{className:"relative z-10",children:he.t})]},he.k)}),i.jsx("div",{className:"absolute right-3 top-2 hidden md:flex items-center gap-3",children:re==="balances"?i.jsx(Emn,{}):i.jsx(npn,{})})]})}),i.jsx("div",{className:"flex-1 min-h-0 relative",children:i.jsx("div",{className:"absolute inset-0",children:ae})})]})},V)}function Nue(){const[e,t]=m.useState([]),n=["XAG","XAU","USDKRW","USDJPY","USDCAD","USDCHF","NZDUSD","AUDUSD","GBPUSD","EURUSD","HOOD"];return m.useEffect(()=>{let r=!1,s=!1;async function a(){if(!s){s=!0;try{const c=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/orderBookDetails")).json(),u=((c==null?void 0:c.order_book_details)||[]).filter(d=>!n.includes(d.symbol)).map(d=>{const f=Number(d.last_trade_price??0),x=Number(d.daily_price_low??0),g=Number(d.daily_price_high??0),v=Number(d.daily_price_change??0),w=Number(d.daily_quote_token_volume??0),C=Number(d.open_interest??0),N=f>0?C*f:null;return{symbol:d.symbol,last:f,chg24:v,vol:w,funding:null,openInterest:N,marketId:d.market_id,priceDecimals:d.supported_price_decimals??d.price_decimals??6,sizeDecimals:d.supported_size_decimals??d.size_decimals??0,minBaseAmount:Number(d.min_base_amount??0),minQuoteAmount:Number(d.min_quote_amount??0),raw:d}});r||t(u)}catch{r||t([])}s=!1}}a();const o=setInterval(a,5e3);return()=>{r=!0,clearInterval(o),s=!1}},[]),e}const kmn="https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=extended",Tmn="https://dextrabothypesocketv2.nftinit.io/",Imn='J5a5j28NeLpQbf"=h',Pmn=6e4,Fmn=e=>{if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null},Jx=(...e)=>{for(const t of e){const n=Fmn(t);if(n!=null)return n}return null},VHe=e=>String(e||"").trim().toUpperCase(),Omn=e=>VHe(e).replace(/-USD$/,"").replace(/\/USD$/,"");function Mmn(e,t){var N;if(!e||typeof e!="object")return null;const n=VHe(e.value||e.symbol||e.market||e.coin||e.label),r=Omn(e.label||e.assetName||e.uiName||n);if(!n&&!r)return null;const s=e.marketStats||{},a=Jx(s.lastPrice,s.markPrice,s.indexPrice,e.lastPrice,e.markPrice,e.last),o=Jx(s.markPrice,e.markPrice,s.lastPrice,e.lastPrice,a),l=Jx(e.volume,s.dailyVolume,e.vol),c=Jx(s.fundingRate,e.fundingRate,e.funding),u=Jx(s.openInterestBase,e.openInterestBase),d=Jx(s.openInterest,e.openInterestUsd,e.openInterest),f=Jx((N=e==null?void 0:e.tradingConfig)==null?void 0:N.maxLeverage,e.maxLeverage,e.leverage,e.max_leverage);let x=null;const g=Jx(s.dailyPriceChange,e.dailyPriceChange);if(g!=null&&a!=null){const I=a-g;I&&(x=g/I*100)}if(x==null){const I=Jx(s.dailyPriceChangePercentage,e.dailyPriceChangePercentage,e.change24hPct,e.chg24);I!=null&&(x=Math.abs(I)<=1?I*100:I)}const v=r||n,w=Number.isFinite(x)?x:null,C=e.market_index??e.marketIndex??e.marketId??e.market_id??e.idx??e.id??t??null;return{...e,symbol:v,coin:v,rawSymbol:n||v,last:a,lastPrice:a,markPrice:o,change24hPct:w,chg24:w,volume:l,vol:l,fundingRate:c,funding:c,openInterest:u??d,openInterestUsd:d??(u!=null&&a!=null?u*a:null),leverage:f,maxLeverage:f??e.maxLeverage,marketStats:s,source:"extended",market_index:C,marketIndex:C,marketId:C,market_id:C,_idx:t}}const Gd={rows:[],subs:new Set,started:!1,socket:null,timer:null};function Rmn(){for(const e of Gd.subs)try{e(Gd.rows)}catch{}}function WHe(e){var t,n,r;return e?Array.isArray(e)?e:Array.isArray(e==null?void 0:e.data)?e.data:Array.isArray((t=e==null?void 0:e.data)==null?void 0:t.data)?e.data.data:Array.isArray(e==null?void 0:e.coins)?e.coins:Array.isArray((n=e==null?void 0:e.data)==null?void 0:n.coins)?e.data.coins:Array.isArray(e==null?void 0:e.markets)?e.markets:Array.isArray((r=e==null?void 0:e.data)==null?void 0:r.markets)?e.data.markets:e!=null&&e.marketStats||e!=null&&e.tradingConfig||e!=null&&e.value||e!=null&&e.symbol||e!=null&&e.label?[e]:[]:[]}function qHe(e){const t=e.map((n,r)=>Mmn(n,r)).filter(n=>n&&n.symbol);return t.length?(Gd.rows=t,Rmn(),!0):!1}function ESe(e){const t=WHe(e);return t.length?qHe(t):!1}async function _Se(){try{const t=await(await fetch(kmn)).json(),n=WHe(t);if(!n.length)return;qHe(n)}catch{}}function Lmn(){if(!Gd.started){Gd.started=!0,_Se(),Gd.timer=setInterval(()=>{Gd.socket&&Gd.socket.connected||_Se()},Pmn);try{const e=Ny(Tmn);Gd.socket=e;const t=()=>{try{e.emit("extended_feed_subscribe",{password:Imn},r=>ESe(r))}catch{}};e.on("connect",t),e.io.on("reconnect",t);const n=new Set(["connect","disconnect","connect_error","reconnect_attempt","reconnect_error"]);e.onAny((r,...s)=>{if(!(!s.length||n.has(r))){for(const a of s)if(ESe(a))return}})}catch{}}}function Aue(){const[e,t]=m.useState(Gd.rows);return m.useEffect(()=>{Lmn();const n=r=>t(r);return Gd.subs.add(n),Gd.rows.length&&t(Gd.rows),()=>{Gd.subs.delete(n)}},[]),e}const Dmn=["arithmetic","geometric"];function Bmn(e,t,n,r){const s=Number(e),a=Number(t),o=Number(n);if(!Number.isFinite(s)||!Number.isFinite(a)||!Number.isFinite(o))return[];if(o<2||a<=s)return[];if(r==="geometric"){const c=Math.pow(a/s,1/(o-1));return Array.from({length:o},(u,d)=>s*Math.pow(c,d))}const l=(a-s)/(o-1);return Array.from({length:o},(c,u)=>s+l*u)}function kSe({entry:e,side:t,notionalUSD:n,maintenanceFrac:r,marginMode:s,accountValueUSD:a,isolatedMarginUSD:o}){const l=Number(e)||0,c=Math.abs(Number(n)||0);if(!l||!c)return null;const u=t==="buy"?1:-1,d=Math.max(0,Number(r)||0),f=c/l,x=c*d;let g;s==="Cross"?g=a-x:g=o-x;const v=1-d*u;if(!f||!isFinite(v))return null;const w=l-u*(g/f)/v;return Math.max(0,w)}function TSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onLevelsChange:s}){const a=Nue(),[o]=m.useState("short"),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,x]=m.useState(2),[g,v]=m.useState("2"),[w,C]=m.useState(""),[N,I]=m.useState("arithmetic"),[P,R]=m.useState(""),[F,U]=m.useState(0),[L,z]=m.useState(10),[Q,ne]=m.useState(!1),[J,X]=m.useState(!1),[re,pe]=m.useState(!1),[Y,ie]=m.useState(50),[oe,G]=m.useState([]),[V,te]=m.useState(!1),[ae,he]=m.useState(0),[Ce,ce]=m.useState(!1),[ge,Ae]=m.useState(!1),[ye,je]=m.useState(0),[Ie,Re]=m.useState(!1),[Qe,$e]=m.useState(0),[it,tt]=m.useState(!1),[ot,ft]=m.useState(!0),[ct,Vt]=m.useState(!1),[It,an]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address}:{id:null,address:null}),Nt=m.useRef(!1),{refreshBotSlots:mn,botSlotsInfo:dn}=m.useContext(Qr),Pt=m.useCallback(async()=>{try{const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){ft(!1),Vt(!0);return}const B=await ji(T.toLowerCase(),k);ft(!!(B!=null&&B.farming_tools))}catch{ft(!1)}finally{Vt(!0)}},[]);m.useEffect(()=>{mn==null||mn(),Pt()},[mn,Pt]);const Xe=m.useMemo(()=>{const k=Array.isArray(dn)?dn:[],T=k.find(B=>String((B==null?void 0:B.bot_type)||"").toLowerCase()==="grid_bot"&&String((B==null?void 0:B.source_market)||"").toLowerCase()==="lighter");return T||k.find(B=>String((B==null?void 0:B.bot_type)||"").toLowerCase()==="grid_bot")},[dn]),Ut=Number((Xe==null?void 0:Xe.total_slot_count)||0),Lt=Number((Xe==null?void 0:Xe.using_extra_slot_count)||0)+Number((Xe==null?void 0:Xe.using_subs_slot_count)||0),qe=Ut+Lt,Ke=Xe?Ut<=0:!1,pt=Ke;m.useEffect(()=>{r&&r.id&&r.address&&an(k=>k.id===r.id&&k.address&&k.address.toLowerCase()===r.address.toLowerCase()?k:{id:r.id,address:r.address})},[r==null?void 0:r.id,r==null?void 0:r.address]);const en=m.useMemo(()=>a.find(k=>k.symbol===e),[a,e]),Bt=en&&en.raw&&en.raw.last_trade_price!=null&&Number(en.raw.last_trade_price)||0;m.useEffect(()=>{let k=!1;async function T(){try{const W=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=lighter_fr")).json().catch(()=>null);if(!W||k)return;const ee=Array.isArray(W)&&W||Array.isArray(W.data)&&W.data||Array.isArray(W.coins)&&W.coins||[],de=String(e||"").toUpperCase(),fe=ee.find(we=>String(we.value||we.label||we.symbol||we.coin||"").toUpperCase()===de),xe=fe&&fe.maxLeverage!=null?Number(fe.maxLeverage):null;!k&&xe!=null&&Number.isFinite(xe)&&xe>0&&(ie(xe),z(we=>{const ke=Number(we)||1;return Math.min(xe,Math.max(1,ke))}))}catch{if(k)return}}return e&&T(),()=>{k=!0}},[e]),m.useEffect(()=>{let k=!1;async function T(){if(typeof window>"u")return;const B=window.localStorage.getItem("hyperAddress"),W=window.localStorage.getItem("hyperToken");if(!B||!W){k||G([]);return}te(!0);try{const de=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:B,token:W})})).json().catch(()=>null);if(!de||k)return;let fe=[];Array.isArray(de)?fe=de:Array.isArray(de.data)?fe=de.data:de&&de.wallet_id!=null&&(fe=[de]);const xe=await Promise.all(fe.map(async we=>{let ke=null;if(we.available_balance!=null){const Me=Number(we.available_balance);Number.isFinite(Me)&&(ke=Me)}else if(we.balance!=null){const Me=Number(we.balance);Number.isFinite(Me)&&(ke=Me)}try{if(we.wallet_address){const Ye=await(await fetch(`https://mainnet.zklighter.elliot.ai/api/v1/account?by=l1_address&value=${encodeURIComponent(Ac(we.wallet_address))}`)).json().catch(()=>null),Fe=Ye&&Array.isArray(Ye.accounts)&&Ye.accounts.length>0&&Ye.accounts[0];if(Fe&&Fe.available_balance!=null){const st=Number(Fe.available_balance);Number.isFinite(st)&&(ke=st)}}}catch{}return{wallet_id:we.wallet_id,wallet_address:we.wallet_address,wallet_name:we.wallet_name||`Wallet ${we.wallet_id}`,available_balance:ke}}));if(k)return;G(xe),an(we=>{if(we&&we.id)return we;const ke=xe[0];return ke?{id:ke.wallet_id,address:ke.wallet_address}:we})}catch{k||G([])}finally{k||te(!1)}}return T(),()=>{k=!0}},[]);const Et=m.useMemo(()=>{if(!It||!It.id)return null;const k=oe.find(B=>String(B.wallet_id)===String(It.id));if(!k||k.available_balance==null)return null;const T=Number(k.available_balance);return Number.isFinite(T)?T:null},[oe,It]),et=(k,T,B)=>{const W=typeof B=="boolean"?B:!0;if(k.priceRange&&k.priceRange.lower!=null&&k.priceRange.upper!=null&&Number.isFinite(Number(k.priceRange.lower))&&Number.isFinite(Number(k.priceRange.upper))&&(c(String(k.priceRange.lower)),d(String(k.priceRange.upper))),k.gridCount&&Number.isFinite(Number(k.gridCount))){const ee=Number(k.gridCount);x(ee),v(String(ee))}if((k.gridType==="geometric"||k.gridType==="arithmetic")&&I(k.gridType),k.investment&&k.investment.leverage!=null&&Number.isFinite(Number(k.investment.leverage))){const ee=Number(k.investment.leverage);z(ee)}if(k.investment&&k.investment.collateral!=null&&Number.isFinite(Number(k.investment.collateral))){const ee=Number(k.investment.collateral);if(R(String(ee)),T&&T>0&&ee>0){const de=ee/T*100;U(Math.max(0,Math.min(100,de)))}else U(0)}else R(""),U(0);ne(W)};m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(It!=null&&It.id)||!(It!=null&&It.address)){ne(!1);return}let k=!1;function T(){c(""),d(""),x(2),v("2"),I("arithmetic"),R(""),U(0),z(10),C("")}async function B(){X(!0);try{const W=window.localStorage.getItem("hyperToken");if(!W){k||(ne(!1),T(),X(!1));return}const ee={address:localStorage.getItem("hyperAddress"),token:W,wallet_id:Number(It.id),source_market:"lighter",coin:String(e||"").toUpperCase()},fe=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})).json().catch(()=>null);if(k)return;if(Nt.current){Nt.current=!1,X(!1);return}const xe=fe&&fe.data?fe.data:fe;xe&&typeof xe=="object"&&xe.is_deleted===!1&&xe.bot_params&&xe.bot_params?et(xe.bot_params,Et,!0):(ne(!1),T())}catch{if(k)return;ne(!1),c(""),d(""),x(2),v("2"),I("arithmetic"),R(""),U(0),z(10),C("")}finally{k||X(!1)}}return B(),()=>{k=!0}},[e,It==null?void 0:It.id,It==null?void 0:It.address,ye]);const Be=m.useMemo(()=>Bmn(l,u,f,N),[l,u,f,N]),Mt=m.useMemo(()=>{if(!Be.length)return[];const k=Number(l),T=Number(u),B=Number.isFinite(k)&&Number.isFinite(T)?(k+T)/2:null;return Be.map(W=>({price:W,side:B==null?null:W>=B?"sell":"buy"}))},[Be,l,u]);m.useEffect(()=>{typeof s=="function"&&s(Mt)},[Mt,s]);const Ve=k=>{const T=Number(k);if(!(T>0))return;const W=T*.01;c((T-W).toFixed(2)),d((T+W).toFixed(2))};m.useEffect(()=>{const k=T=>{const B=T&&T.detail&&T.detail.sourceMarket;B&&B!=="lighter"||je(W=>W+1)};return window.addEventListener("gridbotUpdated",k),()=>{window.removeEventListener("gridbotUpdated",k)}},[]),m.useEffect(()=>{const k=T=>{const B=T&&T.detail;if(!B)return;const W=B.sourceMarket||B.source_market;if(W&&W!=="lighter"||String(B.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const de=B.botParams||{};if(Nt.current=!0,et(de,Et,B.isActive),B.isActive===!0?ne(!0):B.isActive===!1&&ne(!1),B.walletId&&oe&&oe.length){const fe=oe.find(xe=>String(xe.wallet_id)===String(B.walletId));fe&&an({id:fe.wallet_id,address:fe.wallet_address})}};return window.addEventListener("gridbotSelectFromTasks",k),()=>{window.removeEventListener("gridbotSelectFromTasks",k)}},[e,oe]),m.useEffect(()=>{if(typeof window>"u")return;const k=window.localStorage.getItem("gridbot:pending_selection");if(!k)return;let T=null;try{T=JSON.parse(k)}catch{T=null}if(!(!T||T.sourceMarket&&T.sourceMarket!=="lighter"||String(T.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(Nt.current=!0,et(T.botParams||{},Et,T.isActive),T.isActive===!0?ne(!0):T.isActive===!1&&ne(!1),T.walletId&&oe&&oe.length){const B=oe.find(W=>String(W.wallet_id)===String(T.walletId));B&&an({id:B.wallet_id,address:B.wallet_address})}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,oe,Et]),m.useEffect(()=>{if(l||u)return;const k=Bt>0?Bt:Number(t||n||0);!Number.isFinite(k)||k<=0||Ve(k)},[Bt,t,n,l,u]);const ut=m.useMemo(()=>{if(Bt>0)return Bt;const k=Number(t||0);if(k>0)return k;const T=Number(n||0);if(T>0)return T;const B=Number(l),W=Number(u);return Number.isFinite(B)&&Number.isFinite(W)&&W>B?(B+W)/2:0},[Bt,t,n,l,u]),xt=ut,jt=m.useMemo(()=>{const k=Math.max(1,Number(L)||1);return Math.min(Y,k)},[L,Y]),kt=Number(P)||0,xn=kt*jt,un=Be.length,On=ut>0?ut:Bt,En=On>0&&un>0&&xn>0?Number((xn/un/On).toFixed(5)):0,jn=Number.isFinite(en==null?void 0:en.sizeDecimals)?en.sizeDecimals:4,bn=Number.isFinite(en==null?void 0:en.priceDecimals)?en.priceDecimals:4,Zn=bn,zn=(en==null?void 0:en.minBaseAmount)??0,$n=(en==null?void 0:en.minQuoteAmount)??0,nr=En>0?Number(En.toFixed(jn)):0,wn=nr>0&&zn>0&&nr<zn,on=nr>0&&$n>0&&Be.length>0&&Be.some(k=>k*nr<$n),Oe=ut>0&&xn>0&&kt>0?kSe({entry:ut,side:"buy",notionalUSD:xn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:kt,isolatedMarginUSD:kt}):null,rn=ut>0&&xn>0&&kt>0?kSe({entry:ut,side:"sell",notionalUSD:xn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:kt,isolatedMarginUSD:kt}):null,cn=m.useMemo(()=>{if(!l&&!u)return"";const k=Number(l),T=Number(u);if(!Number.isFinite(k)||!Number.isFinite(T))return"";if(!(T>k))return"Upper price must be greater than lower price.";if(xt>0){if(k>xt)return`Lower price cannot be above mark price (${xt.toFixed(bn)}).`;if(T<xt)return`Upper price cannot be below mark price (${xt.toFixed(bn)}).`}return""},[l,u,xt,bn]),_t=m.useMemo(()=>{const k=Number(l),T=Number(u);return!(!Number.isFinite(k)||!Number.isFinite(T)||!(T>k)||xt>0&&(k>xt||T<xt))},[l,u,xt]),Yn=un>1&&_t&&kt>0&&jt>0&&(It==null?void 0:It.id)&&(It==null?void 0:It.address),yn=ae>0,Dt=!!w,sn=wn||on,Tn=ct&&!ot,Kn=Yn&&!J&&!re&&!V&&!yn&&!Dt&&!sn&&!Ke&&!Tn,ir=re||J||V||Dt?!1:Q||Tn?!0:sn||yn||Ke?!1:Yn,rr=re||J||V?!0:Q||Tn?!1:sn||yn||Ke||Dt?!0:!Yn,Jt=Q||re||J,Un=Y&&Y>0;m.useEffect(()=>{if(!ae)return;const k=setInterval(()=>{he(T=>T>1?T-1:0)},1e3);return()=>clearInterval(k)},[ae]);const Qn=()=>{if(Jt)return;const k=Bt>0?Bt:ut>0?ut:Number(t||n||0);!Number.isFinite(k)||k<=0||Ve(k)},Rt=k=>{if(Jt)return;const T=Math.max(0,Math.min(100,Number(k)||0));if(U(T),!Et||Et<=0){T===0&&R("");return}const B=Et*T/100;R(B&&Number.isFinite(B)?String(B.toFixed(2)):"")},Pn=k=>{if(Jt)return;R(k);const T=Number(k);if(!Et||!Number.isFinite(T)||T<=0||Et<=0){U(0);return}const B=T/Et*100;U(Math.max(0,Math.min(100,B)))},Ee=async()=>{if(!Kn||typeof window>"u"||!(It!=null&&It.address)||!(It!=null&&It.id))return;const k=Be.filter(ke=>Number.isFinite(ke));if(k.length<2)return;const T=k[0],B=k[k.length-1],W=(T+B)/2,ee=k.length,de=window.localStorage.getItem("hyperToken");if(!de)return;const fe=nr,xe={symbol:String(e||"").toUpperCase(),gridType:N==="geometric"?"geometric":"arithmetic",direction:o,priceRange:{lower:Number(T.toFixed(Zn)),upper:Number(B.toFixed(Zn)),middle:Number(W.toFixed(Zn))},gridCount:ee,gridPrices:k.map(ke=>Number(ke.toFixed(Zn))),investment:{collateral:kt,leverage:jt,totalInvestment:xn,qtyPerOrder:fe},liquidationPrices:{long:Oe?Number(Oe.toFixed(2)):null,short:rn?Number(rn.toFixed(2)):null},marginMode:"Cross",currentPrice:ut||null,timestamp:new Date().toISOString()},we={address:localStorage.getItem("hyperAddress"),token:de,wallet_id:Number(It.id),source_market:"lighter",bot_params:xe,coin:String(e||"").toUpperCase()};pe(!0);try{const Me=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(we)})).json().catch(()=>null);if(!(Me&&(Me.success===!0||Me.status==="ok"||Me.status==="success"))){const Fe=Me&&(Me.error_message||Me.message||Me.detail)||"Grid bot failed to start.";ln.error(Fe);return}ne(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"lighter"}})),mn==null||mn(),ln.success("Grid bot started.")}catch{ln.error("An error occurred while starting the grid bot.")}finally{pe(!1)}},p=async()=>{if(typeof window>"u"||!(It!=null&&It.address)||!(It!=null&&It.id))return;const k=window.localStorage.getItem("hyperToken");if(!k)return;const T={address:localStorage.getItem("hyperAddress"),token:k,wallet_id:Number(It.id),source_market:"lighter",coin:String(e||"").toUpperCase()};pe(!0);try{const W=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})).json().catch(()=>null);if(!(W&&(W.success===!0||W.status==="ok"||W.status==="success"))){const de=W&&(W.error_message||W.message||W.detail)||"Grid bot could not be stopped.";ln.error(de);return}ne(!1),he(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"lighter"}})),mn==null||mn(),ln.success("Grid bot has been stopped.")}catch{ln.error("An error occurred while stopping the grid bot.")}finally{pe(!1)}},h=()=>{if(Tn){tt(!0);return}ir&&(Q?p():Ae(!0))},S=async()=>{Kn&&(Ae(!1),await Ee())},_=Tn?"Subscribe / 0.12 ETH":re?Q?"Stopping...":"Starting...":Q?"Stop":yn?`Stopping ${ae}s`:"Start";return i.jsxs(i.Fragment,{children:[it&&i.jsx(YUe,{open:it,setOpen:tt,checkAccountCopy:Pt,roleType:"farming"}),Ie&&i.jsx(p5,{open:Ie,setOpen:Re,oldSlotCount:Qe,checkAccountLighter:mn,product:"grid_bot"}),i.jsxs("div",{className:"h-full w-full flex flex-col text-[13px]",children:[i.jsx("div",{className:"px-3 pb-2 flex items-center justify-between border-b border-[#292929]"}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-4 mt-2",children:[i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Lighter Wallet"}),i.jsx(bT,{wallets:oe,value:It&&It.id?String(It.id):"",onChange:k=>{const T=oe.find(B=>String(B.wallet_id)===String(k));T&&an({id:T.wallet_id,address:T.wallet_address})},selectedBalance:Et,mode:"lighter"})]}),i.jsxs("section",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[12px] text-[#7C7C7C] font-semibold",children:[i.jsx(r5,{className:"w-4 h-4 text-[#67FFBD]"}),i.jsx("span",{children:"Slot"})]}),i.jsx("div",{className:"flex items-center gap-1 text-[#67FFBD] text-[12px] font-semibold",children:i.jsx("span",{children:qe?`${Lt}/${qe}`:Xe?"0/0":"--"})})]}),i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("div",{className:"text-[11px] text-[#7C7C7C]",children:Ke?"No slots left. Get more to start new grid bots.":""}),pt&&i.jsx("button",{type:"button",onClick:()=>{$e(Ut),Re(!0)},className:"flex items-center justify-center h-8 px-3 sm:px-5 rounded-[10px] text-[11px] sm:text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Get more slots"})]})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between mt-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Price Range"}),i.jsx("button",{type:"button",onClick:Qn,disabled:Jt,className:"text-[11px] px-2 py-0.5 rounded-md bg-[#161616] border border-[#292929] text-white/60 hover:text-white disabled:opacity-60 disabled:cursor-not-allowed",children:"Autofill"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text:white/40 text-white/40",children:"Lower"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:l,onChange:k=>{Jt||c(k.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:Jt})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Upper"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:u,onChange:k=>{Jt||d(k.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:Jt})})]})]}),xt>0&&i.jsxs("div",{className:"text-[11px] text:white/40 text-white/40",children:["Mark Price: ",xt.toFixed(bn)]}),cn&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:cn})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("span",{className:"text-xs text-white/70",children:"Number of Grids (max 36, even only)"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:i.jsx("input",{value:g,onChange:k=>{if(Jt)return;const T=k.target.value.replace(/[^\d]/g,"");if(v(T),C(""),T==="")return;const B=Number(T);if(Number.isFinite(B)){if(B<2){C("The minimum number of grids must be 2.");return}if(B>36){C("The maximum number of grids can be 36.");return}if(B%2!==0){C("The number of grids must be even.");return}x(B)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:Jt})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:N,onChange:k=>{Jt||I(k.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:Jt,children:Dmn.map(k=>i.jsx("option",{value:k,className:"bg-[#101010]",children:k[0].toUpperCase()+k.slice(1)},k))})})]}),i.jsxs("div",{className:"text-[11px] text-white/40",children:[w&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:w}),"Step:"," ",Be.length>1?(Be[1]-Be[0]).toFixed(Zn):"--"]})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Investment"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:[i.jsx("input",{value:P,onChange:k=>Pn(k.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:Jt}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"USDC"})]}),i.jsx("div",{className:"flex flex-col gap-1 w-[120px]",children:i.jsx(b4,{onClick:Un&&!Jt?()=>ce(!0):void 0,children:Un?`${jt}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 mt-3 pb-6",children:[i.jsx(YN,{value:F,onChange:k=>Rt(k),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:F,onChange:k=>Rt(Math.max(0,Math.min(100,Number(k.target.value)||0))),style:{color:Gi,fontFeatureSettings:'"tnum"'},disabled:Jt}),i.jsx("span",{style:{color:Ri},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between mt-2 border-t border-[#292929] pt-4 font-semibold",children:[i.jsxs("span",{children:["Max ",e,": ",`${Y}x`]}),i.jsxs("span",{children:["Total:"," ",xn>0?`${xn.toFixed(2)} USDC`:"--"]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between font-semibold",children:[i.jsxs("span",{children:["Qty per order:"," ",nr>0?`${nr} ${e}`:"--"]}),i.jsx("span",{children:"Margin Mode: Cross"})]})]}),i.jsxs("section",{className:"pt-2 border-t border-[#292929]",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-2",children:[i.jsx("span",{children:"Est. Liq Long"}),i.jsx("span",{children:Oe?`$${Oe.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-3",children:[i.jsx("span",{children:"Est. Liq Short"}),i.jsx("span",{children:rn?`$${rn.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:h,disabled:rr,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${rr?"bg-[#303030] text-white/40 cursor-not-allowed opacity-70":Tn?"bg-[#7446FF] text-white hover:bg-[#5834C3]":Q?"bg-[#FF7173] text:black text-black hover:opacity-90":"bg-[#67FFBD] text-black hover:opacity-90"}`,children:_}),wn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",zn," ",e,")."]}),on&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Your order size is below minimum order size of $",$n.toFixed(2),"."]})]})]})]}),i.jsx(Jh,{open:Ce,onClose:()=>ce(!1),children:i.jsxs(cm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:Ri},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",Y,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:Y||1,step:1,value:L,onChange:k=>z(Math.max(1,Math.min(Y||1,Number(k.target.value)))),className:"flex-1",style:{accentColor:"#67FFBD"}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:L,onChange:k=>{const T=Number(k.target.value)||1,B=Math.max(1,Math.min(Y||1,T));z(B)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(P0,{onClick:()=>ce(!1),children:"Confirm"})]})}),i.jsx(Jh,{open:ge,onClose:()=>Ae(!1),children:i.jsxs(cm,{title:`${e} Lighter Grid Bot`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-[10px]",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#151b23] text-[#9CA3AF]",children:"Cross"}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",jt,"x"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-y-2 gap-x-6 text-[12px] mb-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:Number.isFinite(Number(l))&&Number.isFinite(Number(u))?`${Number(l).toFixed(Zn)} - ${Number(u).toFixed(Zn)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:un||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:N==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:nr>0?`${nr} ${e}`:"--"})]})]}),i.jsx("div",{className:"mt-2 pt-3 border-t border-[#292929]",children:i.jsxs("div",{className:"flex items-center justify-between text-[12px]",children:[i.jsx("span",{className:"font-medium",style:{color:Gi},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:xn>0?`${xn.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(P0,{onClick:S,disabled:re,children:re?"Starting...":"Confirm"})})]})})]})}const $mn=["arithmetic","geometric"],Umn=6,GHe="https://api.hyperliquid.xyz/info",zmn=10,Hmn=10*60*1e3;let vb={data:null,ts:0,promise:null};async function Vmn(){const e=Date.now();if(vb.data&&e-vb.ts<Hmn)return vb.data;if(vb.promise)return vb.promise;const t=fetch(GHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allPerpMetas"})}).then(n=>n.json()).then(n=>{const r=Array.isArray(n)?n:[];return vb={data:r,ts:Date.now(),promise:null},r}).catch(n=>{throw vb.promise=null,n});return vb.promise=t,t}function Wmn(e,t,n,r){const s=Number(e),a=Number(t),o=Number(n);if(!Number.isFinite(s)||!Number.isFinite(a)||!Number.isFinite(o))return[];if(o<2||a<=s)return[];if(r==="geometric"){const c=Math.pow(a/s,1/(o-1));return Array.from({length:o},(u,d)=>s*Math.pow(c,d))}const l=(a-s)/(o-1);return Array.from({length:o},(c,u)=>s+l*u)}function ISe({entry:e,side:t,notionalUSD:n,maintenanceFrac:r,marginMode:s,accountValueUSD:a,isolatedMarginUSD:o}){const l=Number(e)||0,c=Math.abs(Number(n)||0);if(!l||!c)return null;const u=t==="buy"?1:-1,d=Math.max(0,Number(r)||0),f=c/l,x=c*d;let g;s==="Cross"?g=a-x:g=o-x;const v=1-d*u;if(!f||!isFinite(v))return null;const w=l-u*(g/f)/v;return Math.max(0,w)}function HX(e){const t=String(e||""),n=t.indexOf(":");return n>0?t.slice(0,n).toLowerCase():"hl"}function qmn(e){let t=String(e||"").toUpperCase();if(!t)return"";t.endsWith("-PERP")&&(t=t.slice(0,-5));const n=t.indexOf("-USD");return n>0&&(t=t.slice(0,n)),t}function Gmn(e,t,n=6){if(!Number.isFinite(e)||e<=0)return n-(t||0);const r=5,s=Math.max(0,n-(t||0)),a=Math.floor(Math.log10(e))+1,o=Math.max(0,r-a);return Math.min(s,o)}function PSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onWalletChange:s,onLevelsChange:a}){const o=xU(),[l]=m.useState("short"),[c,u]=m.useState(""),[d,f]=m.useState(""),[x,g]=m.useState(2),[v,w]=m.useState("2"),[C,N]=m.useState(""),[I,P]=m.useState("arithmetic"),[R,F]=m.useState(""),[U,L]=m.useState(0),[z,Q]=m.useState(10),[ne,J]=m.useState(!1),[X,re]=m.useState(!1),[pe,Y]=m.useState(!1),[ie,oe]=m.useState(50),[G,V]=m.useState(0),[te,ae]=m.useState(!1),[he,Ce]=m.useState(!1),[ce,ge]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address}:{id:null,address:null}),[Ae,ye]=m.useState({address:null,token:null}),[je,Ie]=m.useState(null),[Re,Qe]=m.useState(null),[$e,it]=m.useState(""),[tt,ot]=m.useState(""),[ft,ct]=m.useState(""),[Vt,It]=m.useState(""),[an,Nt]=m.useState(!1),[mn,dn]=m.useState(!1),[Pt,Xe]=m.useState(!1),[Ut,Lt]=m.useState(!1),[qe,Ke]=m.useState(0),pt=()=>{u(""),f(""),g(2),w("2"),P("arithmetic"),F(""),L(0),Q(10),N(""),it(""),ot(""),ct(""),It(""),Nt(!1),dn(!1),Xe(!1),Lt(!1)},{address:en,isConnected:Bt}=Jr();Bt&&(typeof window<"u"&&window.localStorage.getItem("hyperToken"));const{wallets:Et,loading:et}=kHe(Ae.address,Ae.token,!0,{pollMs:5e3}),Be=m.useRef(!1),Mt=et&&(!Et||Et.length===0);m.useEffect(()=>{r&&r.id&&r.address&&ge(lt=>lt.id===r.id&<.address&<.address.toLowerCase()===r.address.toLowerCase()?lt:{id:r.id,address:r.address})},[r==null?void 0:r.id,r==null?void 0:r.address]),m.useEffect(()=>{const lt=()=>{const bt=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,Zt=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;ye({address:bt,token:Zt})};return lt(),window.addEventListener("localStorageUpdated",lt),window.addEventListener("storage",lt),()=>{window.removeEventListener("localStorageUpdated",lt),window.removeEventListener("storage",lt)}},[]),m.useEffect(()=>{if(ce.id||!Et||!Et.length)return;const lt=Et.find(Zt=>Zt.confirmed)||Et[0];if(!lt)return;const bt={id:lt.wallet_id,address:lt.wallet_address};ge(bt),typeof s=="function"&&s({id:String(bt.id),address:bt.address})},[Et,ce.id,s]),m.useEffect(()=>{e&&(pt(),J(!1))},[e]);const Ve=m.useMemo(()=>o.find(lt=>lt.symbol===e),[o,e]),ut=Ve&&Ve.raw&&Ve.raw.last_trade_price!=null&&Number(Ve.raw.last_trade_price)||0;m.useEffect(()=>{let lt=!1;async function bt(){if(e)try{const Ge=await(await fetch(GHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allPerpMetas"})})).json().catch(()=>null);if(!Ge||lt)return;let Je=null;for(const wt of Ge)if(Array.isArray(wt==null?void 0:wt.universe)){for(const At of wt.universe)if(String(At.name||"").toUpperCase()===String(e||"").toUpperCase()){Je=At;break}}if(!Je||!Number.isFinite(Je.maxLeverage))return;const We=Number(Je.maxLeverage);oe(We),Q(wt=>Math.min(We,Math.max(1,wt)))}catch{}}return bt(),()=>{lt=!0}},[e]),m.useEffect(()=>{let lt=!1;async function bt(){try{const Ge=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=hyper_fr")).json().catch(()=>null);if(!Ge||lt)return;const Je=Array.isArray(Ge)&&Ge||Array.isArray(Ge.data)&&Ge.data||Array.isArray(Ge.coins)&&Ge.coins||[],We=String(e||"").toUpperCase(),wt=Je.find(Gt=>String(Gt.value||Gt.label||Gt.symbol||Gt.coin||"").toUpperCase()===We),At=wt&&wt.maxLeverage!=null?Number(wt.maxLeverage):null;!lt&&At!=null&&Number.isFinite(At)&&At>0&&(oe(At),Q(Gt=>Math.min(At,Math.max(1,Number(Gt)||1))))}catch{}}return e&&bt(),()=>{lt=!0}},[e]);const xt=(ce==null?void 0:ce.address)||(en?en.toLowerCase():null),{perpsOverview:jt}=gT(xt),kt=m.useMemo(()=>{if(!jt||jt.balance==null)return null;const lt=Number(jt.balance);return Number.isFinite(lt)?lt:null},[jt]),xn=(lt,bt)=>{var mt,qt,Qt,In;const Zt=lt.priceRange||{},Ge=Array.isArray(lt.gridPrices)?lt.gridPrices:[];let Je=Zt.lower,We=Zt.upper;(!Number.isFinite(Je)||!Number.isFinite(We))&&Ge.length>=2&&(Je=Ge[0],We=Ge[Ge.length-1]),Number.isFinite(Je)?u(String(Je)):u(""),Number.isFinite(We)?f(String(We)):f("");let wt=lt.gridCount;Number.isFinite(wt)||Ge.length>=2&&(wt=Ge.length),Number.isFinite(wt)?(g(wt),w(String(wt))):(g(2),w("2"));let At=lt.gridType;At!=="geometric"&&At!=="arithmetic"&&(At="arithmetic"),P(At);const Gt=lt.investment||{};if(Gt&&Gt.leverage!=null&&Number.isFinite(Number(Gt.leverage))&&Q(Number(Gt.leverage)),Gt&&Gt.collateral!=null&&Number.isFinite(Number(Gt.collateral))){const or=Number(Gt.collateral);if(F(String(or)),bt&&bt>0&&or>0){const Wn=or/bt*100;L(Math.max(0,Math.min(100,Wn)))}else L(0)}else F(""),L(0);const fn=lt.trailing_up??((mt=lt==null?void 0:lt.trailing)==null?void 0:mt.up),Rn=lt.trailing_down??((qt=lt==null?void 0:lt.trailing)==null?void 0:qt.down),An=lt.sl_up??((Qt=lt==null?void 0:lt.sl)==null?void 0:Qt.up),pr=lt.sl_down??((In=lt==null?void 0:lt.sl)==null?void 0:In.down);it(fn!=null&&Number.isFinite(Number(fn))?String(fn):""),ot(Rn!=null&&Number.isFinite(Number(Rn))?String(Rn):""),ct(An!=null&&Number.isFinite(Number(An))?String(An):""),It(pr!=null&&Number.isFinite(Number(pr))?String(pr):""),Nt(fn!=null&&Number.isFinite(Number(fn))),dn(Rn!=null&&Number.isFinite(Number(Rn))),Xe(An!=null&&Number.isFinite(Number(An))),Lt(pr!=null&&Number.isFinite(Number(pr)))};m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(ce!=null&&ce.id)||!(ce!=null&&ce.address)){J(!1),pt();return}let lt=!1;async function bt(){re(!0);try{const Zt=window.localStorage.getItem("hyperToken");if(!Zt){lt||(J(!1),pt(),re(!1));return}const Ge={address:window.localStorage.getItem("hyperAddress"),token:Zt,wallet_id:Number(ce.id),source_market:"hyper",coin:String(e||"").toUpperCase()},We=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ge)})).json().catch(()=>null);if(lt)return;if(Be.current){Be.current=!1,re(!1);return}const wt=We&&We.data?We.data:We;wt&&typeof wt=="object"&&wt.is_deleted===!1&&wt.bot_params&&wt.bot_params?(xn(wt.bot_params,kt),J(!0)):(J(!1),pt(),u(""),f(""))}catch{J(!1),pt(),u(""),f("")}finally{lt||re(!1)}}return bt(),()=>{lt=!0}},[e,ce==null?void 0:ce.id,ce==null?void 0:ce.address,qe]),m.useEffect(()=>{if(typeof window>"u")return;const lt=window.localStorage.getItem("gridbot:pending_selection");if(!lt)return;let bt=null;try{bt=JSON.parse(lt)}catch{bt=null}if(!(!bt||bt.sourceMarket&&bt.sourceMarket!=="hyper"||String(bt.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(Be.current=!0,xn(bt.botParams||{},kt),bt.isActive===!0?J(!0):bt.isActive===!1&&J(!1),bt.walletId&&Et&&Et.length){const Zt=Et.find(Ge=>String(Ge.wallet_id)===String(bt.walletId));if(Zt){const Ge={id:Zt.wallet_id,address:Zt.wallet_address};ge(Ge),typeof s=="function"&&s({id:String(Ge.id),address:Ge.address})}}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,Et,s,kt]),m.useEffect(()=>{const lt=bt=>{const Zt=bt&&bt.detail&&bt.detail.sourceMarket;Zt&&Zt!=="hyper"||Ke(Ge=>Ge+1)};return window.addEventListener("gridbotUpdated",lt),()=>{window.removeEventListener("gridbotUpdated",lt)}},[]),m.useEffect(()=>{const lt=bt=>{const Zt=bt&&bt.detail;if(!Zt)return;const Ge=Zt.sourceMarket||Zt.source_market;if(Ge&&Ge!=="hyper"||String(Zt.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const We=Zt.botParams||{};if(xn(We,kt),Be.current=!0,Zt.isActive===!0?J(!0):Zt.isActive===!1&&J(!1),Zt.walletId&&Et&&Et.length){const wt=Et.find(At=>String(At.wallet_id)===String(Zt.walletId));if(wt){const At={id:wt.wallet_id,address:wt.wallet_address};ge(At),typeof s=="function"&&s({id:String(At.id),address:At.address})}}};return window.addEventListener("gridbotSelectFromTasks",lt),()=>{window.removeEventListener("gridbotSelectFromTasks",lt)}},[e,Et,s]);const un=m.useMemo(()=>Wmn(c,d,x,I),[c,d,x,I]),On=m.useMemo(()=>{if(!un.length)return[];const lt=Number(c),bt=Number(d),Zt=Number.isFinite(lt)&&Number.isFinite(bt)?(lt+bt)/2:null;return un.map(Ge=>({price:Ge,side:Zt==null?null:Ge>=Zt?"sell":"buy"}))},[un,c,d]);m.useEffect(()=>{typeof a=="function"&&a(On)},[On,a]);const En=lt=>{const bt=Number(lt);if(!(bt>0))return;const Zt=bt*.01;u((bt-Zt).toFixed(2)),f((bt+Zt).toFixed(2))},jn=m.useMemo(()=>{if(ut>0)return ut;const lt=Number(t||0);if(lt>0)return lt;const bt=Number(n||0);if(bt>0)return bt;const Zt=Number(c),Ge=Number(d);return Number.isFinite(Zt)&&Number.isFinite(Ge)&&Ge>Zt?(Zt+Ge)/2:0},[ut,t,n,c,d]);m.useEffect(()=>{let lt=!1;async function bt(){const Zt=qmn(e);if(!Zt){Ie(null),Qe(null);return}try{const Ge=await Vmn();let Je=null;e:for(const We of Ge)if(Array.isArray(We==null?void 0:We.universe)){for(const wt of We.universe)if(String((wt==null?void 0:wt.name)||"").toUpperCase()===Zt){const Gt=Number(wt.szDecimals);Number.isFinite(Gt)&&(Je=Gt);break e}}if(lt)return;Je!=null?Ie(Je):(Ie(null),Qe(null))}catch{Ie(null),Qe(null)}}return e?bt():(Ie(null),Qe(null)),()=>{lt=!0}},[e]),m.useEffect(()=>{if(!Number.isFinite(je)){Qe(null);return}const lt=Gmn(jn,je);Qe(lt)},[jn,je]);const bn=jn,Zn=m.useMemo(()=>Math.min(ie,Math.max(1,Number(z)||1)),[z,ie]),zn=Number(R)||0,$n=zn*Zn,nr=un.length,wn=jn>0?jn:ut,on=wn>0&&nr>0&&$n>0?Number(($n/nr/wn).toFixed(5)):0,Oe=Number.isFinite(je)?je:Number.isFinite(Ve==null?void 0:Ve.sizeDecimals)?Ve.sizeDecimals:4,rn=m.useMemo(()=>{if(Number.isFinite(Re))return Re;const lt=Number.isFinite(Oe)?Number(Oe):4,bt=Math.max(0,Umn-lt),Zt=Math.abs(Number(jn||0));if(!(Zt>0)||!Number.isFinite(Zt))return bt;const Ge=Zt>=1?Math.floor(Math.log10(Zt))+1:0,Je=Math.max(0,5-Ge);return Math.min(bt,Je)},[Re,Oe,jn]),cn=rn,_t=(Ve==null?void 0:Ve.minBaseAmount)??0,Yn=(Ve==null?void 0:Ve.minQuoteAmount)??0,yn=on>0?Number(on.toFixed(Oe)):0,Dt=yn>0&&_t>0&&yn<_t,sn=yn>0&&Yn>0&&un.length>0&&un.some(lt=>lt*yn<Yn),Tn=m.useMemo(()=>{if(yn<=0||un.length===0)return 0;let lt=1/0;for(const bt of un){if(!(bt>0))continue;const Zt=bt*yn;Zt<lt&&(lt=Zt)}return lt===1/0?0:lt},[yn,un]),Kn=yn<=0||Tn<zmn,ir=jn>0&&$n>0&&zn>0?ISe({entry:jn,side:"buy",notionalUSD:$n,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:zn,isolatedMarginUSD:zn}):null,rr=jn>0&&$n>0&&zn>0?ISe({entry:jn,side:"sell",notionalUSD:$n,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:zn,isolatedMarginUSD:zn}):null,Jt=m.useMemo(()=>{if(!c&&!d)return"";const lt=Number(c),bt=Number(d);if(!Number.isFinite(lt)||!Number.isFinite(bt))return"";if(!(bt>lt))return"Upper price must be greater than lower price.";if(bn>0){if(lt>bn)return`Lower price cannot be above mark price (${bn.toFixed(rn)}).`;if(bt<bn)return`Upper price cannot be below mark price (${bn.toFixed(rn)}).`}return""},[c,d,bn,rn]),Un=m.useMemo(()=>{const lt=Number(c),bt=Number(d);return!(!Number.isFinite(lt)||!Number.isFinite(bt)||!(bt>lt)||bn>0&&(lt>bn||bt<bn))},[c,d,bn]),Qn=Number(c),Rt=Number(d),Pn=Number($e),Ee=Number(tt),p=Number(ft),h=Number(Vt),S=an&&($e===""||!Number.isFinite(Pn)||!(Pn>Rt)),_=mn&&(tt===""||!Number.isFinite(Ee)||!(Ee<Qn));m.useEffect(()=>{an||it(""),mn||ot("")},[an,mn]),m.useEffect(()=>{Pt||ct(""),Ut||It("")},[Pt,Ut]);const k=Pt&&(ft===""||!Number.isFinite(p)||!an&&Number.isFinite(Rt)&&!(p>Rt)||an&&Number.isFinite(Pn)&&!(p>Pn)),T=Ut&&(Vt===""||!Number.isFinite(h)||!mn&&Number.isFinite(Qn)&&!(h<Qn)||mn&&Number.isFinite(Ee)&&!(h<Ee)),B=nr>1&&Un&&zn>0&&Zn>0&&(ce==null?void 0:ce.id)&&(ce==null?void 0:ce.address),W=G>0,ee=!!C,de=Dt||sn,fe=S||_||k||T,xe=B&&!X&&!pe&&!Mt&&!W&&!ee&&!de&&!Kn&&!fe,we=pe||X||Mt||ee||de||Kn||W||fe?!1:ne?!0:B,ke=ne||pe||X||Mt;m.useEffect(()=>{if(!G)return;const lt=setInterval(()=>V(bt=>bt>1?bt-1:0),1e3);return()=>clearInterval(lt)},[G]);const Me=()=>{if(ke)return;const lt=ut>0?ut:jn>0?jn:Number(t||n||0);!Number.isFinite(lt)||lt<=0||En(lt)},Ye=lt=>{if(ke)return;const bt=Math.max(0,Math.min(100,Number(lt)||0));if(L(bt),!kt||kt<=0){bt===0&&F("");return}const Zt=kt*bt/100;F(Zt&&Number.isFinite(Zt)?String(Zt.toFixed(2)):"")},Fe=lt=>{if(ke)return;F(lt);const bt=Number(lt);if(!kt||!Number.isFinite(bt)||bt<=0||kt<=0){L(0);return}const Zt=bt/kt*100;L(Math.max(0,Math.min(100,Zt)))},st=async()=>{if(!xe||typeof window>"u"||!(ce!=null&&ce.address)||!(ce!=null&&ce.id))return;const lt=un.filter(Rn=>Number.isFinite(Rn));if(lt.length<2)return;const bt=lt[0],Zt=lt[lt.length-1],Ge=(bt+Zt)/2,Je=lt.length,We=window.localStorage.getItem("hyperToken");if(!We)return;if(an&&S){ln.error("Trailing Up is invalid.");return}if(mn&&_){ln.error("Trailing Down is invalid.");return}if(Pt&&k){const Rn=an?"SL Up must be greater than Trailing Up.":"SL Up must be greater than Upper price.";ln.error(Rn);return}if(Ut&&T){const Rn=mn?"SL Down must be less than Trailing Down.":"SL Down must be less than Lower price.";ln.error(Rn);return}const wt=yn,At=HX(e),Gt={symbol:String(e||"").toUpperCase(),dex:At,gridType:I==="geometric"?"geometric":"arithmetic",direction:l,priceRange:{lower:Number(bt.toFixed(cn)),upper:Number(Zt.toFixed(cn)),middle:Number(Ge.toFixed(cn))},gridCount:Je,gridPrices:lt.map(Rn=>Number(Rn.toFixed(cn))),investment:{collateral:zn,leverage:Zn,totalInvestment:$n,qtyPerOrder:wt},liquidationPrices:{long:ir?Number(ir.toFixed(2)):null,short:rr?Number(rr.toFixed(2)):null},trailing_up:an&&!S?Number(Pn.toFixed(cn)):null,trailing_down:mn&&!_?Number(Ee.toFixed(cn)):null,sl_up:Pt&&!k?Number(p.toFixed(cn)):null,sl_down:Ut&&!T?Number(h.toFixed(cn)):null,marginMode:"Cross",currentPrice:jn||null,timestamp:new Date().toISOString()},fn={address:window.localStorage.getItem("hyperAddress"),token:We,wallet_id:Number(ce.id),source_market:"hyper",...At?{dex:At}:{},bot_params:Gt,coin:String(e||"").toUpperCase()};Y(!0);try{const An=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(fn)})).json().catch(()=>null);if(!(An&&(An.success===!0||An.status==="ok"||An.status==="success"))){const mt=An&&(An.error_message||An.message||An.detail)||"Grid bot failed to start.";ln.error(mt);return}J(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"hyper"}})),ln.success("Grid bot started.")}catch{ln.error("An error occurred while starting the grid bot.")}finally{Y(!1)}},se=async()=>{if(typeof window>"u"||!(ce!=null&&ce.address)||!(ce!=null&&ce.id))return;const lt=window.localStorage.getItem("hyperToken");if(!lt)return;const bt=HX(e),Zt={address:window.localStorage.getItem("hyperAddress"),token:lt,wallet_id:Number(ce.id),source_market:"hyper",...bt?{dex:bt}:{},coin:String(e||"").toUpperCase()};Y(!0);try{const Je=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Zt)})).json().catch(()=>null);if(!(Je&&(Je.success===!0||Je.status==="ok"||Je.status==="success"))){const wt=Je&&(Je.error_message||Je.message||Je.detail)||"Grid bot could not be stopped.";ln.error(wt);return}J(!1),V(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"hyper"}})),ln.success("Grid bot has been stopped.")}catch{ln.error("An error occurred while stopping the grid bot.")}finally{Y(!1)}},Se=()=>{we&&(ne?se():Ce(!0))},De=async()=>{xe&&(Ce(!1),await st())},Le=pe?ne?"Stopping...":"Starting...":ne?"Stop":W?`Stopping ${G}s`:"Start",_e=["xyz","vntl","flx"].includes(HX(e))?"Isolated":"Cross",nt=!1;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"h-full w-full flex flex-col text-[13px]",children:[i.jsx("div",{className:"px-3 pb-2 flex items-center justify-between border-b border-[#292929]"}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-4 mt-2",children:[i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Perps Wallet"}),i.jsx(bT,{wallets:Et,value:ce&&ce.id?String(ce.id):"",onChange:lt=>{const bt=(Et||[]).find(Zt=>String(Zt.wallet_id)===String(lt))||null;if(bt){const Zt={id:bt.wallet_id,address:bt.wallet_address};ge(Zt),typeof s=="function"&&s({id:String(Zt.id),address:Zt.address})}},selectedBalance:kt})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between mt-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Price Range"}),i.jsx("button",{type:"button",onClick:Me,disabled:ke,className:"text-[11px] px-2 py-0.5 rounded-md bg-[#161616] border border-[#292929] text-white/60 hover:text-white disabled:opacity-60 disabled:cursor-not-allowed",children:"Autofill"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Lower"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:c,onChange:lt=>{ke||u(lt.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:ke})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Upper"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:d,onChange:lt=>{ke||f(lt.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:ke})})]})]}),bn>0&&i.jsxs("div",{className:"text-[11px] text-white/40",children:["Mark Price: ",bn.toFixed(rn)]}),Jt&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:Jt})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("span",{className:"text-xs text-white/70",children:"Number of Grids (Even only)"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:i.jsx("input",{value:v,onChange:lt=>{if(ke)return;const bt=lt.target.value.replace(/[^\d]/g,"");if(w(bt),N(""),bt==="")return;const Zt=Number(bt);if(Number.isFinite(Zt)){if(Zt<2){N("The minimum number of grids must be 2.");return}if(Zt>120){N("The maximum number of grids is 120.");return}if(Zt%2!==0){N("The number of grids must be even.");return}g(Zt)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:ke})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:I,onChange:lt=>{ke||P(lt.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:ke,children:$mn.map(lt=>i.jsx("option",{value:lt,className:"bg-[#101010]",children:lt[0].toUpperCase()+lt.slice(1)},lt))})})]}),i.jsx("div",{className:"text-[11px] text-white/40",children:C&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:C})})]}),nt,i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Investment"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:[i.jsx("input",{value:R,onChange:lt=>Fe(lt.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:ke}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"USDC"})]}),i.jsx("div",{className:"flex flex-col gap-1 w-[120px]",children:i.jsx(b4,{onClick:ie&&ie>0&&!ke?()=>ae(!0):void 0,children:ie&&ie>0?`${Zn}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 !mt-4 pb-6",children:[i.jsx(YN,{value:U,onChange:lt=>Ye(lt),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:U,onChange:lt=>Ye(Math.max(0,Math.min(100,Number(lt.target.value)||0))),style:{color:Gi,fontFeatureSettings:'"tnum"'},disabled:ke}),i.jsx("span",{style:{color:Ri},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between mt-2 border-t border-[#292929] pt-4 font-semibold",children:[i.jsxs("span",{children:["Max ",e,": ",`${ie}x`]}),i.jsxs("span",{children:["Total:"," ",$n>0?`${$n.toFixed(2)} USDC`:"--"]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between font-semibold",children:[i.jsxs("span",{children:["Qty per order:"," ",yn>0?`${yn} ${e}`:"--"]}),i.jsxs("span",{children:["Margin Mode: ",_e]})]})]}),i.jsxs("section",{className:"pt-2 border-t border-[#292929]",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-2",children:[i.jsx("span",{children:"Est. Liq Long"}),i.jsx("span",{children:ir?`$${ir.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-3",children:[i.jsx("span",{children:"Est. Liq Short"}),i.jsx("span",{children:rr?`$${rr.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:Se,disabled:!we,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${we?ne?"bg-[#FF7173] text-black hover:opacity-90":"bg-[#67FFBD] text-black hover:opacity-90":"bg-[#303030] text-white/40 cursor-not-allowed opacity-70"}`,children:Le}),Dt&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",_t," ",e,")."]}),sn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Your order size is below minimum order size of $",Yn.toFixed(2),"."]}),Kn&&i.jsx("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:"Each grid order must be at least $10 notional. Increase your investment, reduce the number of grids, or lower leverage."}),nt]})]})]}),i.jsx(Jh,{open:te,onClose:()=>ae(!1),children:i.jsxs(cm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:Ri},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",ie,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:ie||1,step:1,value:z,onChange:lt=>Q(Math.max(1,Math.min(ie||1,Number(lt.target.value)))),className:"flex-1",style:{accentColor:"#67FFBD"}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:z,onChange:lt=>{const bt=Number(lt.target.value)||1,Zt=Math.max(1,Math.min(ie||1,bt));Q(Zt)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(P0,{onClick:()=>ae(!1),children:"Confirm"})]})}),i.jsx(Jh,{open:he,onClose:()=>Ce(!1),children:i.jsxs(cm,{title:`${e} Grid Bot`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-[10px]",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#151b23] text-[#9CA3AF]",children:_e}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",Zn,"x"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-y-2 gap-x-6 text-[12px] mb-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:Number.isFinite(Number(c))&&Number.isFinite(Number(d))?`${Number(c).toFixed(cn)} - ${Number(d).toFixed(cn)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:nr||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:I==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:yn>0?`${yn} ${e}`:"--"})]}),nt,nt,nt,nt]}),i.jsx("div",{className:"mt-2 pt-3 border-t border-[#292929]",children:i.jsxs("div",{className:"flex items-center justify-between text-[12px]",children:[i.jsx("span",{className:"font-medium",style:{color:Gi},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:$n>0?`${$n.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(P0,{onClick:De,disabled:pe,children:pe?"Starting...":"Confirm"})})]})})]})}const Kmn=["arithmetic","geometric"],Ymn=10,Xmn="https://express-proxy-delta.vercel.app/proxy?url=",Qmn="https://api.starknet.extended.exchange/api/v1";function Zmn(e,t,n,r,s,a=1){const o=Number(e),l=Number(t),c=Number(n);if(!Number.isFinite(o)||!Number.isFinite(l)||!Number.isFinite(c))return[];if(c<2||l<=o)return[];const u=Number.isFinite(Number(r))?Number(r):0,d=Math.max(1,Number(a)||1),f=Math.max(0,u)*d,x=c>0?f/c:0;if(s==="geometric"){if(!(o>0)||!(l>0))return[];const C=Math.pow(l/o,1/(c-1));return Array.from({length:c},(N,I)=>{const P=o*Math.pow(C,I),R=P>0?x/P:0;return{index:I,price:P,qty:R,order_size_usd:x}})}const g=(l-o)/(c-1),v=(o+l)/2,w=v>0?x/v:0;return Array.from({length:c},(C,N)=>{const I=o+g*N;return{index:N,price:I,qty:w,order_size_usd:x}})}function FSe({entry:e,side:t,notionalUSD:n,maintenanceFrac:r,marginMode:s,accountValueUSD:a,isolatedMarginUSD:o}){const l=Number(e)||0,c=Math.abs(Number(n)||0);if(!l||!c)return null;const u=t==="buy"?1:-1,d=Math.max(0,Number(r)||0),f=c/l,x=c*d;let g;s==="Cross"?g=a-x:g=o-x;const v=1-d*u;if(!f||!isFinite(v))return null;const w=l-u*(g/f)/v;return Math.max(0,w)}function VX(e){const t=String(e||""),n=t.indexOf(":");return n>0?t.slice(0,n).toLowerCase():"hl"}function Jmn(e,t,n=6){if(!Number.isFinite(e)||e<=0)return n-0;const r=5,s=Math.max(0,n-0),a=Math.floor(Math.log10(e))+1,o=Math.max(0,r-a);return Math.min(s,o)}function OSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onWalletChange:s,onLevelsChange:a}){var Rn,An,pr;const o=Aue(),[l]=m.useState("neutral"),[c,u]=m.useState(""),[d,f]=m.useState(""),[x,g]=m.useState(2),[v,w]=m.useState("2"),[C,N]=m.useState(""),[I,P]=m.useState("arithmetic"),[R,F]=m.useState(""),[U,L]=m.useState(0),[z,Q]=m.useState(10),[ne,J]=m.useState(!1),[X,re]=m.useState(!1),[pe,Y]=m.useState(!1),[ie,oe]=m.useState(50),[G,V]=m.useState(0),[te,ae]=m.useState(!1),[he,Ce]=m.useState(!1),[ce,ge]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address,apiKey:r.apiKey}:{id:null,address:null,apiKey:null}),[Ae,ye]=m.useState({address:null,token:null}),[je,Ie]=m.useState(null),[Re,Qe]=m.useState(""),[$e,it]=m.useState(""),[tt,ot]=m.useState(""),[ft,ct]=m.useState(""),[Vt,It]=m.useState(!1),[an,Nt]=m.useState(!1),[mn,dn]=m.useState(!1),[Pt,Xe]=m.useState(!1),[Ut,Lt]=m.useState(0),qe=m.useRef(null),Ke=m.useRef(!1),pt=mt=>{const qt=Number(mt);if(!Number.isFinite(qt)||qt<=0)return{num:null,str:""};const Qt=qt>=3?qt*.99:qt,In=Number(Qt.toFixed(2));return{num:Number.isFinite(In)?In:null,str:Number.isFinite(In)?String(In):""}},en=()=>{u(""),f(""),g(2),w("2"),P("arithmetic"),F(""),L(0),Q(10),N(""),Qe(""),it(""),ot(""),ct(""),It(!1),Nt(!1),dn(!1),Xe(!1),qe.current=null,Ke.current=!1},{address:Bt,isConnected:Et}=Jr();Et||typeof window<"u"&&window.localStorage.getItem("hyperToken");const[et,Be]=m.useState([]),[Mt,Ve]=m.useState(!1),ut=m.useRef(!1),xt=Mt&&(!et||et.length===0);m.useEffect(()=>{r&&r.id&&r.address&&ge(mt=>mt.id===r.id&&mt.address&&mt.address.toLowerCase()===r.address.toLowerCase()?mt:{id:r.id,address:r.address,apiKey:r.apiKey})},[r==null?void 0:r.id,r==null?void 0:r.address,r==null?void 0:r.apiKey]),m.useEffect(()=>{const mt=()=>{const qt=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,Qt=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;ye({address:qt,token:Qt})};return mt(),window.addEventListener("localStorageUpdated",mt),window.addEventListener("storage",mt),()=>{window.removeEventListener("localStorageUpdated",mt),window.removeEventListener("storage",mt)}},[]),m.useEffect(()=>{if(!Ae.address||!Ae.token){Be([]);return}let mt=!1;return(async()=>{try{Ve(!0);const In=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Ae.address.toLowerCase(),token:Ae.token,balance:"true"})})).json().catch(()=>({}));if(mt)return;if(In!=null&&In.success&&Array.isArray(In.data)){const or=In.data.map((Wn,Vn)=>({...Wn,wallet_id:Wn.wallet_id??Wn.id??Vn,wallet_address:Wn.wallet_address||"",wallet_name:Wn.wallet_name||Wn.name||`Extended Wallet ${Vn+1}`,wallet_api_key:Wn.wallet_api_key||Wn.api_key||null}));Be(or)}else Be([])}catch(Qt){mt||(console.error("Extended wallet list error",Qt),Be([]))}finally{mt||Ve(!1)}})(),()=>{mt=!0}},[Ae.address,Ae.token]),m.useEffect(()=>{if(ce.id||!et||!et.length)return;const mt=et.find(Qt=>Qt.confirmed)||et[0];if(!mt)return;const qt={id:mt.wallet_id,address:mt.wallet_address,apiKey:mt.wallet_api_key};ge(qt),typeof s=="function"&&s({id:String(qt.id),address:qt.address,apiKey:qt.apiKey})},[et,ce.id,s]),m.useEffect(()=>{if(!(ce!=null&&ce.id)||!(et!=null&&et.length))return;const mt=et.find(In=>String(In.wallet_id)===String(ce.id));if(!mt||!(ce.apiKey!==mt.wallet_api_key||!ce.address&&mt.wallet_address))return;const Qt={id:mt.wallet_id,address:mt.wallet_address,apiKey:mt.wallet_api_key};ge(Qt),typeof s=="function"&&s({id:String(Qt.id),address:Qt.address,apiKey:Qt.apiKey})},[ce==null?void 0:ce.id,ce==null?void 0:ce.apiKey,ce==null?void 0:ce.address,et,s]),m.useEffect(()=>{e&&(en(),J(!1))},[e]);const jt=m.useMemo(()=>{if(!e)return null;const mt=String(e).toUpperCase(),qt=mt.replace(/-USD$/,"");return o.find(Qt=>{const In=String((Qt==null?void 0:Qt.symbol)||"").toUpperCase(),or=String((Qt==null?void 0:Qt.rawSymbol)||"").toUpperCase();return In===mt||or===mt||In===qt||or===qt})||null},[o,e]),kt=m.useMemo(()=>{const mt=jt==null?void 0:jt.marketStats,qt=(mt==null?void 0:mt.markPrice)??(mt==null?void 0:mt.lastPrice)??(mt==null?void 0:mt.indexPrice)??(jt==null?void 0:jt.lastPrice)??(jt==null?void 0:jt.markPrice)??(jt==null?void 0:jt.last)??null,Qt=Number(qt);return Number.isFinite(Qt)?Qt:0},[jt]);m.useEffect(()=>{var Qt;const mt=((Qt=jt==null?void 0:jt.tradingConfig)==null?void 0:Qt.maxLeverage)??(jt==null?void 0:jt.maxLeverage)??(jt==null?void 0:jt.leverage),qt=Number(mt);!Number.isFinite(qt)||qt<=0||(oe(qt),Q(In=>Math.min(qt,Math.max(1,Number(In)||1))))},[jt]);const xn=(ce==null?void 0:ce.address)||(Bt?Bt.toLowerCase():null),{perpsOverview:un}=gT(xn),On=m.useMemo(()=>{const mt=et.find(Wn=>String(Wn.wallet_id)===String(ce==null?void 0:ce.id)),qt=(mt==null?void 0:mt.available_balance)??(mt==null?void 0:mt.balance)??null,Qt=Number(qt);if(!(ce!=null&&ce.apiKey))return Number.isFinite(Qt)?Qt:null;const In=Number(je==null?void 0:je.availableForTrade);if(Number.isFinite(In))return In;if(Number.isFinite(Qt))return Qt;if(!un||un.balance==null)return null;const or=Number(un.balance);return Number.isFinite(or)?or:null},[je,un,ce==null?void 0:ce.apiKey,ce==null?void 0:ce.id,et]);m.useEffect(()=>{if(!(ce!=null&&ce.apiKey)){Ie(null);return}let mt=!1;const qt=async()=>{var In,or,Wn;try{const Vn=`${Xmn}${encodeURIComponent(`${Qmn}/user/balance`)}`,Ir=await(await fetch(Vn,{headers:{"X-Api-Key":ce.apiKey}})).json().catch(()=>null);if(!mt){const Fr=((In=Ir==null?void 0:Ir.data)==null?void 0:In.availableForTrade)??(Ir==null?void 0:Ir.availableForTrade)??((or=Ir==null?void 0:Ir.data)==null?void 0:or.available_balance)??(Ir==null?void 0:Ir.available_balance)??((Wn=Ir==null?void 0:Ir.data)==null?void 0:Wn.available)??(Ir==null?void 0:Ir.available),Lr=Number(Fr);Ie({availableForTrade:Number.isFinite(Lr)&&Lr>=0?Lr:null,raw:Ir})}}catch{mt||Ie(null)}};qt();const Qt=setInterval(qt,2e4);return()=>{mt=!0,clearInterval(Qt)}},[ce==null?void 0:ce.apiKey]);const En=(mt,qt)=>{var ms,vr,Yr,vi;const Qt=mt.priceRange||{},or=(Array.isArray(mt.gridPrices)?mt.gridPrices:[]).map(_r=>_r&&typeof _r=="object"&&_r.price!=null?Number(_r.price):Number(_r)).filter(_r=>Number.isFinite(_r));let Wn=Qt.lower,Vn=Qt.upper;(!Number.isFinite(Wn)||!Number.isFinite(Vn))&&or.length>=2&&(Wn=or[0],Vn=or[or.length-1]),Number.isFinite(Wn)?u(String(Wn)):u(""),Number.isFinite(Vn)?f(String(Vn)):f("");let gr=mt.gridCount;Number.isFinite(gr)||or.length>=2&&(gr=or.length),Number.isFinite(gr)?(g(gr),w(String(gr))):(g(2),w("2"));let Ir=mt.gridType;Ir!=="geometric"&&Ir!=="arithmetic"&&(Ir="arithmetic"),P(Ir);const Fr=mt.investment||{};Fr&&Fr.leverage!=null&&Number.isFinite(Number(Fr.leverage))&&Q(Number(Fr.leverage));const Lr=Fr.wallet_balance??Fr.walletBalance??Fr.balance??Fr.available_balance??Fr.availableBalance??null,Ht=(Fr==null?void 0:Fr.collateral_input)??(Fr==null?void 0:Fr.collateralInput)??(Fr==null?void 0:Fr.collateral)??(Fr==null?void 0:Fr.collateral_used)??(Fr==null?void 0:Fr.collateralUsed)??(Fr==null?void 0:Fr.collateralEffective)??null,nn=Number(Ht);if(Fr&&Number.isFinite(nn)){const{num:_r,str:os}=pt(nn);F(os),qe.current=_r;const Gs=Fr.percentChosen!=null?Number(Fr.percentChosen):Fr.percent!=null?Number(Fr.percent):null,mi=Gs!=null&&Number.isFinite(Gs),ns=Number(Lr);if(mi)L(Math.max(0,Math.min(100,Gs))),Ke.current=!1;else{const Xt=Number.isFinite(ns)&&ns>0?ns:qt;if(Xt&&Xt>0&&_r>0){const ue=_r/Xt*100;L(Math.max(0,Math.min(100,ue))),Ke.current=!1}else L(0),Ke.current=_r>0}}else F(""),L(0),qe.current=null,Ke.current=!1;const Sr=mt.trailing_up??((ms=mt==null?void 0:mt.trailing)==null?void 0:ms.up),Br=mt.trailing_down??((vr=mt==null?void 0:mt.trailing)==null?void 0:vr.down),Kr=mt.sl_up??((Yr=mt==null?void 0:mt.sl)==null?void 0:Yr.up),As=mt.sl_down??((vi=mt==null?void 0:mt.sl)==null?void 0:vi.down);Qe(Sr!=null&&Number.isFinite(Number(Sr))?String(Sr):""),it(Br!=null&&Number.isFinite(Number(Br))?String(Br):""),ot(Kr!=null&&Number.isFinite(Number(Kr))?String(Kr):""),ct(As!=null&&Number.isFinite(Number(As))?String(As):""),It(Sr!=null&&Number.isFinite(Number(Sr))),Nt(Br!=null&&Number.isFinite(Number(Br))),dn(Kr!=null&&Number.isFinite(Number(Kr))),Xe(As!=null&&Number.isFinite(Number(As)))};m.useEffect(()=>{if(!Ke.current)return;const mt=Number(qe.current),qt=Number(On);if(!Number.isFinite(mt)||mt<=0||!Number.isFinite(qt)||qt<=0)return;const Qt=mt/qt*100;L(Math.max(0,Math.min(100,Qt))),Ke.current=!1},[On]),m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(ce!=null&&ce.id)||!(ce!=null&&ce.address)){J(!1),en();return}let mt=!1;async function qt(){re(!0);try{const Qt=window.localStorage.getItem("hyperToken");if(!Qt){mt||(J(!1),en(),re(!1));return}const In={address:window.localStorage.getItem("hyperAddress"),token:Qt,wallet_id:Number(ce.id),source_market:"extended",coin:String(e||"").toUpperCase()},Wn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(In)})).json().catch(()=>null);if(mt)return;if(ut.current){ut.current=!1,re(!1);return}const Vn=Wn&&Wn.data?Wn.data:Wn,Ir=(Array.isArray(Vn)?Vn:[Vn]).filter(Boolean).filter(Lr=>Lr&&typeof Lr=="object"&&String(Lr.coin||"").toUpperCase()===String(e||"").toUpperCase()&&String(Lr.wallet_id||"")===String(ce.id||"")),Fr=Ir.find(Lr=>Lr&&typeof Lr=="object"&&Lr.is_deleted===!1&&Lr.bot_params)||Ir.find(Lr=>Lr&&typeof Lr=="object"&&Lr.is_deleted!==!0&&Lr.bot_params)||null;if(Fr){if(Fr.wallet_id&&String(Fr.wallet_id)!==String(ce.id)){const Lr=et.find(Ht=>String(Ht.wallet_id)===String(Fr.wallet_id));if(Lr){const Ht={id:Lr.wallet_id,address:Lr.wallet_address,apiKey:Lr.wallet_api_key};ge(Ht),typeof s=="function"&&s({id:String(Ht.id),address:Ht.address,apiKey:Ht.apiKey})}}En(Fr.bot_params,On),J(!0)}else J(!1),en(),u(""),f("")}catch{J(!1),en(),u(""),f("")}finally{mt||re(!1)}}return qt(),()=>{mt=!0}},[e,ce==null?void 0:ce.id,ce==null?void 0:ce.address,Ut,et,s]),m.useEffect(()=>{if(typeof window>"u")return;const mt=window.localStorage.getItem("gridbot:pending_selection");if(!mt)return;let qt=null;try{qt=JSON.parse(mt)}catch{qt=null}if(!(!qt||qt.sourceMarket&&qt.sourceMarket!=="extended"||String(qt.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(ut.current=!0,En(qt.botParams||{},On),qt.isActive===!0?J(!0):qt.isActive===!1&&J(!1),qt.walletId&&et&&et.length){const Qt=et.find(In=>String(In.wallet_id)===String(qt.walletId));if(Qt){const In={id:Qt.wallet_id,address:Qt.wallet_address,apiKey:Qt.wallet_api_key};ge(In),typeof s=="function"&&s({id:String(In.id),address:In.address,apiKey:In.apiKey})}}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,et,s,On]),m.useEffect(()=>{const mt=qt=>{const Qt=qt&&qt.detail&&qt.detail.sourceMarket;Qt&&Qt!=="extended"||Lt(In=>In+1)};return window.addEventListener("gridbotUpdated",mt),()=>{window.removeEventListener("gridbotUpdated",mt)}},[]),m.useEffect(()=>{const mt=qt=>{const Qt=qt&&qt.detail;if(!Qt)return;const In=Qt.sourceMarket||Qt.source_market;if(In&&In!=="extended"||String(Qt.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const Wn=Qt.botParams||{};if(En(Wn,On),ut.current=!0,Qt.isActive===!0?J(!0):Qt.isActive===!1&&J(!1),Qt.walletId&&et&&et.length){const Vn=et.find(gr=>String(gr.wallet_id)===String(Qt.walletId));if(Vn){const gr={id:Vn.wallet_id,address:Vn.wallet_address,apiKey:Vn.wallet_api_key};ge(gr),typeof s=="function"&&s({id:String(gr.id),address:gr.address,apiKey:gr.apiKey})}}};return window.addEventListener("gridbotSelectFromTasks",mt),()=>{window.removeEventListener("gridbotSelectFromTasks",mt)}},[e,et,s]);const jn=m.useMemo(()=>Math.min(ie,Math.max(1,Number(z)||1)),[z,ie]),bn=Number(R)||0,Zn=bn,zn=m.useMemo(()=>Zmn(c,d,x,bn,I,jn),[c,d,x,bn,I,jn]),$n=m.useMemo(()=>{if(!zn.length)return[];const mt=Number(c),qt=Number(d),Qt=Number.isFinite(mt)&&Number.isFinite(qt)?(mt+qt)/2:null;return zn.map(In=>({price:In.price,side:Qt==null?null:Number(In.price)>=Qt?"sell":"buy"}))},[zn,c,d]);m.useEffect(()=>{typeof a=="function"&&a($n)},[$n,a]);const nr=mt=>{const qt=Number(mt);if(!(qt>0))return;const Qt=qt*.01;u((qt-Qt).toFixed(2)),f((qt+Qt).toFixed(2))},wn=m.useMemo(()=>{if(kt>0)return kt;const mt=Number(t||0);if(mt>0)return mt;const qt=Number(n||0);if(qt>0)return qt;const Qt=Number(c),In=Number(d);return Number.isFinite(Qt)&&Number.isFinite(In)&&In>Qt?(Qt+In)/2:0},[kt,t,n,c,d]),on=wn,Oe=bn*jn,rn=zn.length,cn=m.useMemo(()=>{if(!zn.length)return 0;let mt=0,qt=0;for(const Qt of zn){const In=Number(Qt==null?void 0:Qt.qty);Number.isFinite(In)&&(mt+=In,qt+=1)}return qt?mt/qt:0},[zn]),_t=Number(jt==null?void 0:jt.collateralAssetPrecision),Yn=Number(jt==null?void 0:jt.assetPrecision),yn=(Rn=jt==null?void 0:jt.tradingConfig)==null?void 0:Rn.minOrderSizeChange,Dt=(()=>{const mt=Number(yn);if(!Number.isFinite(mt))return null;const[,qt=""]=String(yn).split(".");return Math.max(0,qt.length)})(),sn=Number.isFinite(_t)?_t:Number.isFinite(Yn)?Yn:4,Tn=Dt!=null&&Number.isFinite(Dt)?Dt:sn,Kn=Number((An=jt==null?void 0:jt.tradingConfig)==null?void 0:An.minPriceChange),ir=m.useMemo(()=>Number.isFinite(Kn)&&Kn>0?Kn>=1?0:Math.min(8,Math.max(0,-Math.floor(Math.log10(Kn)))):Jmn(wn),[Kn,wn]),rr=ir,Jt=Number(((pr=jt==null?void 0:jt.tradingConfig)==null?void 0:pr.minOrderSize)??0),Un=0,Qn=cn>0?Number(cn.toFixed(Tn)):0,Rt=m.useMemo(()=>zn.some(mt=>Number(mt==null?void 0:mt.qty)>0),[zn]),Pn=Rt&&Jt>0&&zn.some(mt=>{const qt=Number(mt==null?void 0:mt.qty);return Number.isFinite(qt)?qt<Jt:!1}),Ee=Rt&&Un>0,p=m.useMemo(()=>{if(!Rt||zn.length===0)return 0;let mt=1/0;for(const qt of zn){const Qt=Number(qt==null?void 0:qt.price),In=Number(qt==null?void 0:qt.qty);if(!Number.isFinite(Qt)||!Number.isFinite(In))continue;if(Qt<=0||In<=0){mt=0;break}const or=Qt*In;or<mt&&(mt=or)}return mt===1/0?0:mt},[Rt,zn]),h=!Rt||p<Ymn,S=wn>0&&Oe>0&&bn>0?FSe({entry:wn,side:"buy",notionalUSD:Oe,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:bn,isolatedMarginUSD:bn}):null,_=wn>0&&Oe>0&&bn>0?FSe({entry:wn,side:"sell",notionalUSD:Oe,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:bn,isolatedMarginUSD:bn}):null,k=m.useMemo(()=>{if(!c&&!d)return"";const mt=Number(c),qt=Number(d);if(!Number.isFinite(mt)||!Number.isFinite(qt))return"";if(!(qt>mt))return"Upper price must be greater than lower price.";if(on>0){if(mt>on)return`Lower price cannot be above mark price (${on.toFixed(ir)}).`;if(qt<on)return`Upper price cannot be below mark price (${on.toFixed(ir)}).`}return""},[c,d,on,ir]),T=m.useMemo(()=>{const mt=Number(c),qt=Number(d);return!(!Number.isFinite(mt)||!Number.isFinite(qt)||!(qt>mt)||on>0&&(mt>on||qt<on))},[c,d,on]),B=Number(c),W=Number(d),ee=Number(Re),de=Number($e),fe=Number(tt),xe=Number(ft),we=Vt&&(Re===""||!Number.isFinite(ee)||!(ee>W)),ke=an&&($e===""||!Number.isFinite(de)||!(de<B));m.useEffect(()=>{Vt||Qe(""),an||it("")},[Vt,an]),m.useEffect(()=>{mn||ot(""),Pt||ct("")},[mn,Pt]);const Me=mn&&(tt===""||!Number.isFinite(fe)||!Vt&&Number.isFinite(W)&&!(fe>W)||Vt&&Number.isFinite(ee)&&!(fe>ee)),Ye=Pt&&(ft===""||!Number.isFinite(xe)||!an&&Number.isFinite(B)&&!(xe<B)||an&&Number.isFinite(de)&&!(xe<de)),Fe=rn>1&&T&&bn>0&&jn>0&&(ce==null?void 0:ce.id)&&(ce==null?void 0:ce.address),st=G>0,se=!!C,Se=Pn||Ee,De=we||ke||Me||Ye,Le=Fe&&!X&&!pe&&!xt&&!st&&!se&&!Se&&!h&&!De,_e=pe||X||xt||se||Se||h||st||De?!1:ne?!0:Fe,nt=ne||pe||X||xt;m.useEffect(()=>{if(!G)return;const mt=setInterval(()=>V(qt=>qt>1?qt-1:0),1e3);return()=>clearInterval(mt)},[G]);const lt=()=>{if(nt)return;const mt=kt>0?kt:wn>0?wn:Number(t||n||0);!Number.isFinite(mt)||mt<=0||nr(mt)},bt=mt=>{if(nt)return;Ke.current=!1;const qt=Math.max(0,Math.min(100,Number(mt)||0));if(L(qt),!On||On<=0){qt===0&&F("");return}const Qt=On*qt/100,{str:In}=pt(Qt);F(In)},Zt=mt=>{if(nt)return;Ke.current=!1;const{num:qt,str:Qt}=pt(mt);F(Qt);const In=qt;if(!On||!Number.isFinite(In)||In<=0||On<=0){L(0);return}const or=In/On*100;L(Math.max(0,Math.min(100,or)))},Ge=async()=>{if(!Le||typeof window>"u"||!(ce!=null&&ce.address)||!(ce!=null&&ce.id))return;const mt=zn.filter(Lr=>Number.isFinite(Lr==null?void 0:Lr.price));if(mt.length<2)return;const qt=mt[0],Qt=mt[mt.length-1],In=(qt.price+Qt.price)/2,or=mt.length,Wn=window.localStorage.getItem("hyperToken");if(!Wn)return;if(Vt&&we){ln.error("Trailing Up is invalid.");return}if(an&&ke){ln.error("Trailing Down is invalid.");return}if(mn&&Me){const Lr=Vt?"SL Up must be greater than Trailing Up.":"SL Up must be greater than Upper price.";ln.error(Lr);return}if(Pt&&Ye){const Lr=an?"SL Down must be less than Trailing Down.":"SL Down must be less than Lower price.";ln.error(Lr);return}const Vn=Qn,gr=VX(e),Ir={symbol:String(e||"").toUpperCase(),dex:gr,gridType:I==="geometric"?"geometric":"arithmetic",direction:l,priceRange:{lower:Number(qt.price.toFixed(rr)),upper:Number(Qt.price.toFixed(rr)),middle:Number(In.toFixed(rr))},gridCount:or,gridPrices:mt.map(Lr=>({price:Number(Lr.price.toFixed(rr)),qty:Number(Number(Lr.qty||0).toFixed(Tn))})),investment:{collateral:Zn,collateralUsed:bn,percentChosen:U,leverage:jn,totalInvestment:Oe,qtyPerOrder:Vn},liquidationPrices:{long:S?Number(S.toFixed(2)):null,short:_?Number(_.toFixed(2)):null},trailing_up:Vt&&!we?Number(ee.toFixed(rr)):null,trailing_down:an&&!ke?Number(de.toFixed(rr)):null,sl_up:mn&&!Me?Number(fe.toFixed(rr)):null,sl_down:Pt&&!Ye?Number(xe.toFixed(rr)):null,marginMode:"Cross",currentPrice:wn||null,timestamp:new Date().toISOString()},Fr={address:window.localStorage.getItem("hyperAddress"),token:Wn,wallet_id:Number(ce.id),source_market:"extended",bot_params:Ir,coin:String(e||"").toUpperCase()};Y(!0);try{const Ht=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Fr)})).json().catch(()=>null);if(!(Ht&&(Ht.success===!0||Ht.status==="ok"||Ht.status==="success"))){const Sr=Ht&&(Ht.error_message||Ht.message||Ht.detail)||"Grid bot failed to start.";ln.error(Sr);return}J(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"extended"}})),ln.success("Grid bot started.")}catch{ln.error("An error occurred while starting the grid bot.")}finally{Y(!1)}},Je=async()=>{if(typeof window>"u"||!(ce!=null&&ce.address)||!(ce!=null&&ce.id))return;const mt=window.localStorage.getItem("hyperToken");if(!mt)return;VX(e);const qt={address:window.localStorage.getItem("hyperAddress"),token:mt,wallet_id:Number(ce.id),source_market:"extended",coin:String(e||"").toUpperCase()};Y(!0);try{const In=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qt)})).json().catch(()=>null);if(!(In&&(In.success===!0||In.status==="ok"||In.status==="success"))){const Wn=In&&(In.error_message||In.message||In.detail)||"Grid bot could not be stopped.";ln.error(Wn);return}J(!1),V(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"extended"}})),ln.success("Grid bot has been stopped.")}catch{ln.error("An error occurred while stopping the grid bot.")}finally{Y(!1)}},We=()=>{_e&&(ne?Je():Ce(!0))},wt=async()=>{Le&&(Ce(!1),await Ge())},At=pe?ne?"Stopping...":"Starting...":ne?"Stop":st?`Stopping ${G}s`:"Start",Gt=["xyz","vntl","flx"].includes(VX(e))?"Isolated":"Cross",fn=!1;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"h-full w-full flex flex-col text-[13px]",children:[i.jsx("div",{className:"px-3 pb-2 flex items-center justify-between border-b border-[#292929]"}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-4 mt-2",children:[i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Perps Wallet"}),i.jsx(bT,{wallets:et,mode:"extended",value:ce&&ce.id?String(ce.id):"",onChange:mt=>{const qt=(et||[]).find(Qt=>String(Qt.wallet_id)===String(mt))||null;if(qt){const Qt={id:qt.wallet_id,address:qt.wallet_address,apiKey:qt.wallet_api_key};ge(Qt),typeof s=="function"&&s({id:String(Qt.id),address:Qt.address,apiKey:Qt.apiKey})}},selectedBalance:On})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between mt-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Price Range"}),i.jsx("button",{type:"button",onClick:lt,disabled:nt,className:"text-[11px] px-2 py-0.5 rounded-md bg-[#161616] border border-[#292929] text-white/60 hover:text-white disabled:opacity-60 disabled:cursor-not-allowed",children:"Autofill"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Lower"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:c,onChange:mt=>{nt||u(mt.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:nt})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Upper"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:d,onChange:mt=>{nt||f(mt.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:nt})})]})]}),on>0&&i.jsxs("div",{className:"text-[11px] text-white/40",children:["Mark Price: ",on.toFixed(ir)]}),k&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:k})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("span",{className:"text-xs text-white/70",children:"Number of Grids (Even only)"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:i.jsx("input",{value:v,onChange:mt=>{if(nt)return;const qt=mt.target.value.replace(/[^\d]/g,"");if(w(qt),N(""),qt==="")return;const Qt=Number(qt);if(Number.isFinite(Qt)){if(Qt<2){N("The minimum number of grids must be 2.");return}if(Qt>200){N("The maximum number of grids is 200.");return}if(Qt%2!==0){N("The number of grids must be even.");return}g(Qt)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:nt})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:I,onChange:mt=>{nt||P(mt.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:nt,children:Kmn.map(mt=>i.jsx("option",{value:mt,className:"bg-[#101010]",children:mt[0].toUpperCase()+mt.slice(1)},mt))})})]}),i.jsx("div",{className:"text-[11px] text-white/40",children:C&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:C})})]}),fn,i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Investment"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:[i.jsx("input",{value:R,onChange:mt=>Zt(mt.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:nt}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"USDC"})]}),i.jsx("div",{className:"flex flex-col gap-1 w-[120px]",children:i.jsx(b4,{onClick:ie&&ie>0&&!nt?()=>ae(!0):void 0,children:ie&&ie>0?`${jn}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 !mt-4 pb-6",children:[i.jsx(YN,{value:U,onChange:mt=>bt(mt),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:U,onChange:mt=>bt(Math.max(0,Math.min(100,Number(mt.target.value)||0))),style:{color:Gi,fontFeatureSettings:'"tnum"'},disabled:nt}),i.jsx("span",{style:{color:Ri},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between mt-2 border-t border-[#292929] pt-4 font-semibold",children:[i.jsxs("span",{children:["Max ",e,": ",`${ie}x`]}),i.jsxs("span",{children:["Total:"," ",Oe>0?`${Oe.toFixed(2)} USDC`:"--"]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between font-semibold",children:[i.jsxs("span",{children:["Qty per order:"," ",Qn>0?`${Qn} ${e}`:"--"]}),i.jsxs("span",{children:["Margin Mode: ",Gt]})]})]}),i.jsxs("section",{className:"pt-2 border-t border-[#292929]",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-2",children:[i.jsx("span",{children:"Est. Liq Long"}),i.jsx("span",{children:S?`$${S.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-3",children:[i.jsx("span",{children:"Est. Liq Short"}),i.jsx("span",{children:_?`$${_.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:We,disabled:!_e,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${_e?ne?"bg-[#FF7173] text-black hover:opacity-90":"bg-[#67FFBD] text-black hover:opacity-90":"bg-[#303030] text-white/40 cursor-not-allowed opacity-70"}`,children:At}),Pn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",Jt," ",e,")."]}),Ee,h&&i.jsx("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:"Each grid order must be at least $10 notional. Increase your investment, reduce the number of grids, or lower leverage."}),fn]})]})]}),i.jsx(Jh,{open:te,onClose:()=>ae(!1),children:i.jsxs(cm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:Ri},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",ie,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:ie||1,step:1,value:z,onChange:mt=>Q(Math.max(1,Math.min(ie||1,Number(mt.target.value)))),className:"flex-1",style:{accentColor:"#67FFBD"}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:To,border:`1px solid ${Oa}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:z,onChange:mt=>{const qt=Number(mt.target.value)||1,Qt=Math.max(1,Math.min(ie||1,qt));Q(Qt)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(P0,{onClick:()=>ae(!1),children:"Confirm"})]})}),i.jsx(Jh,{open:he,onClose:()=>Ce(!1),children:i.jsxs(cm,{title:`${e} Grid Bot`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-[10px]",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#151b23] text-[#9CA3AF]",children:Gt}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",jn,"x"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-y-2 gap-x-6 text-[12px] mb-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:Number.isFinite(Number(c))&&Number.isFinite(Number(d))?`${Number(c).toFixed(rr)} - ${Number(d).toFixed(rr)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:rn||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:I==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Ri},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Gi},children:Qn>0?`${Qn} ${e}`:"--"})]}),fn,fn,fn,fn]}),i.jsx("div",{className:"mt-2 pt-3 border-t border-[#292929]",children:i.jsxs("div",{className:"flex items-center justify-between text-[12px]",children:[i.jsx("span",{className:"font-medium",style:{color:Gi},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:Oe>0?`${Oe.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(P0,{onClick:wt,disabled:pe,children:pe?"Starting...":"Confirm"})})]})})]})}const XN="/assets/fee-animation-Cvx53PQy.mp4",e0n="wss://mainnet.zklighter.elliot.ai/stream",t0n="https://api.hyperliquid.xyz/info",eD=e=>e==null?0:Number(e),tD=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),n0n=(e,t)=>{if(isNaN(e))return"--";const n=Number(t);let r=0;return n>0&&n<1&&(r=Math.min(8,Math.max(0,-Math.floor(Math.log10(n))))),e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:r})},r0n=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},s0n={BTC:{1:{value:1},10:{value:2},20:{value:5},50:{value:10},100:{value:100},1e3:{value:1e3}},ETH:{.1:{value:.1},.2:{value:.2},.5:{value:.5},1:{value:1},10:{value:10},100:{value:100}}},i0n=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=s0n[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null};async function a0n(e){var o;const n=await fetch(t0n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"l2Book",coin:e})});if(!n.ok)throw new Error("info request failed");const r=await n.json(),s=(r==null?void 0:r.levels)||((o=r==null?void 0:r.data)==null?void 0:o.levels),a=Array.isArray(s==null?void 0:s[0])&&s[0]||(s==null?void 0:s.bs)||(s==null?void 0:s.bids)||[];if(!Array.isArray(a)||!a.length)throw new Error("orderbook empty or bad format");return a}function o0n(e){const t=e.slice(0,10).map(o=>Number(o.px??(Array.isArray(o)?o[0]:void 0))).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o<t.length-1;o++){const l=t[o]-t[o+1];l>0&&n.push(l)}if(!n.length)return 0;const s=Math.min(...n).toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),a=Number(s);return Number.isFinite(a)?a:0}function l0n(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function c0n(e,t){if(!e||e<=0)return[];const n=Math.floor(Math.log10(e)),r=[];t>0&&r.push(t);const s=n-4,a=Math.pow(10,s);[1,2,5].forEach(g=>r.push(g*a));const o=n-3;r.push(Math.pow(10,o));const l=n-2;r.push(Math.pow(10,l));const c=n-1;r.push(Math.pow(10,c));const u=r.filter(g=>g>0&&Number.isFinite(g)).map(l0n),d=Array.from(new Set(u)).sort((g,v)=>g-v),f=t>0?t:0;return d.filter(g=>g>=f&&g>0)}function MSe(e){const n=(e||"").toUpperCase()==="BTC"?[1,10,20,50,100,1e3,1e4]:[.001,.01,.1,10,100];return Array.from(new Set(n)).sort((r,s)=>r-s)}async function u0n(e){if(!e)return[];const t=String(e).trim(),n=i0n(t);if(n&&n.length)return n;const r=t.toUpperCase();try{const s=await a0n(t),a=s[0],o=Number((a==null?void 0:a.px)??(Array.isArray(a)?a[0]:void 0));if(!Number.isFinite(o)||o<=0)throw new Error("bad bestBid");const l=o0n(s);let c=c0n(o,l);return r!=="BTC"?c=c.filter(u=>u!==1):c.includes(1)||c.push(1),c=Array.from(new Set(c.filter(u=>Number.isFinite(u)&&u>0))).sort((u,d)=>u-d),c.length?c:MSe(t)}catch(s){return console.error("getUiStepsForCoin error",t,s),MSe(t)}}function RSe(e,t,n){const r=new Map;for(const s of e||[]){const a=eD(s.px),o=eD(s.sz);if(!a||!o||!t)continue;const l=n==="bid"?Math.floor(a/t)*t:Math.ceil(a/t)*t,c=Number(l.toFixed(12));r.set(c,(r.get(c)||0)+o)}return[...r.entries()].map(([s,a])=>({price:s,size:a}))}function d0n({marketId:e,baseSymbol:t,rows:n=16,onSelectPrice:r,onBest:s}){const a=m.useRef(null),o=m.useRef(null),l=m.useRef(0),c=m.useRef({bids:new Map,asks:new Map}),u=m.useRef(!1),d=m.useRef(!0),[f,x]=m.useState({bids:[],asks:[]}),[g,v]=m.useState("COIN"),[w,C]=m.useState(null),[N,I]=m.useState([]),P=(oe,G)=>g==="USD"?oe*G:oe,R=g==="USD"?"USD":t?String(t):"COIN";m.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);const F=()=>{u.current||(u.current=!0,requestAnimationFrame(()=>{if(u.current=!1,!d.current)return;const oe=c.current;if(!((oe==null?void 0:oe.bids)instanceof Map)||!((oe==null?void 0:oe.asks)instanceof Map))return;const G=512,V=Array.from(oe.bids.entries()).map(([ae,he])=>({px:ae,sz:he})).sort((ae,he)=>he.px-ae.px).slice(0,G),te=Array.from(oe.asks.entries()).map(([ae,he])=>({px:ae,sz:he})).sort((ae,he)=>ae.px-he.px).slice(0,G);x({bids:V,asks:te})}))},U=oe=>{if(oe==null)return;const G=a.current;if(G&&(G.readyState===WebSocket.OPEN||G.readyState===WebSocket.CONNECTING))return;const V=new WebSocket(e0n);a.current=V,V.onopen=()=>{l.current=0;const te={type:"subscribe",channel:`order_book/${String(oe)}`};try{V.send(JSON.stringify(te))}catch{}},V.onmessage=te=>{let ae;try{ae=JSON.parse(te.data||"{}")}catch{return}if((ae==null?void 0:ae.type)!=="update/order_book")return;const he=`order_book:${String(oe)}`;if(ae.channel!==he)return;const Ce=ae.order_book;if(!Ce)return;let ce=c.current;(!ce||typeof ce!="object")&&(ce={bids:new Map,asks:new Map},c.current=ce),ce.bids instanceof Map||(ce.bids=new Map),ce.asks instanceof Map||(ce.asks=new Map);const ge=(Ae,ye)=>{const je=Array.isArray(Ce[Ae])?Ce[Ae]:[];if(je.length)for(const Ie of je){const Re=Number(Ie.price),Qe=Number(Ie.size);Number.isFinite(Re)&&(!Number.isFinite(Qe)||Qe<=0?ye.delete(Re):ye.set(Re,Qe))}};ge("bids",ce.bids),ge("asks",ce.asks),F()},V.onclose=()=>{l.current=Math.min(l.current+1,6),!o.current&&(o.current=setTimeout(()=>{o.current=null,U(oe)},500*Math.pow(2,l.current)))},V.onerror=()=>{try{V.close()}catch{}}};m.useEffect(()=>{if(a.current)try{a.current.onmessage=null,a.current.onopen=null,a.current.onclose=null,a.current.onerror=null,a.current.close()}catch{}if(a.current=null,o.current&&(clearTimeout(o.current),o.current=null),l.current=0,c.current={bids:new Map,asks:new Map},x({bids:[],asks:[]}),I([]),C(null),e==null)return;U(e);let oe=!1;return(async()=>{const G=await u0n(t||"");oe||(I(G),C(G[0]??null))})(),()=>{oe=!0}},[e,t]);const L=m.useMemo(()=>(f.bids||[]).map(oe=>eD(oe.px)).filter(oe=>Number.isFinite(oe)&&oe>0),[f]),z=m.useMemo(()=>(f.asks||[]).map(oe=>eD(oe.px)).filter(oe=>Number.isFinite(oe)&&oe>0),[f]),Q=L.length?Math.max(...L):null,ne=z.length?Math.min(...z):null;m.useEffect(()=>{Q!=null&&ne!=null&&(s==null||s({bestBid:Q,bestAsk:ne,mid:(Q+ne)/2}))},[Q,ne,s]);const J=m.useMemo(()=>{const oe=Number(w)||1,G=RSe(f.bids,oe,"bid").sort((te,ae)=>ae.price-te.price),V=RSe(f.asks,oe,"ask").sort((te,ae)=>te.price-ae.price);return{bids:G,asksAsc:V}},[f,w]),X=m.useMemo(()=>{const oe=J.asksAsc.slice(0,n);let G=0;return oe.map(te=>(G+=P(te.size,te.price),{...te,total:G})).reverse()},[J,n,g]),re=m.useMemo(()=>{const oe=J.bids.slice(0,n);let G=0;return oe.map(V=>(G+=P(V.size,V.price),{...V,total:G}))},[J,n,g]),pe=m.useMemo(()=>{if(Q==null||ne==null)return null;const oe=Math.abs(ne-Q),G=(ne+Q)/2;return{diff:oe,pct:G?oe/G*100:0}},[Q,ne]),Y=Math.max(X.reduce((oe,G)=>Math.max(oe,G.total||0),0),1e-9),ie=Math.max(re.reduce((oe,G)=>Math.max(oe,G.total||0),0),1e-9);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold font-inter",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-[#292929]",children:[i.jsx(DSe,{value:String(w??""),onChange:oe=>C(Number(oe)),items:(N||[]).map(oe=>({key:String(oe),label:r0n(oe)}))}),i.jsx(DSe,{value:g,onChange:v,items:[{key:"USD",label:"USD"},{key:"COIN",label:t||"COIN"}],align:"right"})]}),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] w-full",children:[i.jsx("span",{className:"uppercase",children:"Price"}),i.jsxs("span",{className:"uppercase text-center",children:["Size (",R,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",R,")"]})]}),i.jsx("div",{className:"flex-1 overflow-hidden w-full",children:i.jsxs("div",{className:"overflow-auto w-full",children:[X.map((oe,G)=>i.jsx(LSe,{side:"ask",step:Number(w)||1,price:oe.price,size:oe.size!=null?P(oe.size,oe.price):null,total:oe.total,widthPct:oe.total?Math.min(100,oe.total/Y*100):0,onClick:()=>oe.price!=null&&(r==null?void 0:r(oe.price)),unit:g},`ask-${G}`)),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] border-y border-[#292929] my-1 w-full",children:[i.jsx("span",{className:"uppercase",children:"Spread"}),i.jsx("span",{className:"text-right",children:pe?tD(pe.diff,4):"--"}),i.jsx("span",{className:"text-right",children:pe?`${tD(pe.pct,4)}%`:"--"})]}),re.map((oe,G)=>i.jsx(LSe,{side:"bid",step:Number(w)||1,price:oe.price,size:oe.size!=null?P(oe.size,oe.price):null,total:oe.total,widthPct:oe.total?Math.min(100,oe.total/ie*100):0,onClick:()=>oe.price!=null&&(r==null?void 0:r(oe.price)),unit:g},`bid-${G}`))]})})]})}function LSe({side:e,price:t,size:n,total:r,widthPct:s,onClick:a,step:o,unit:l}){const c=t==null,u=e==="bid"?"from-transparent to-[#67ffbd]/30":"from-transparent to-[#FF7272]/30",d=e==="bid"?"text-[#67FFBD]":"text-[#FF797C]",f=l==="USD";return i.jsxs("div",{className:"relative w-full font-semibold",children:[!c&&i.jsx("div",{className:`absolute left-0 top-px bottom-px bg-gradient-to-r ${u} transition-all duration-300 ease-[cubic-bezier(0.42,0,0.58,1)]`,style:{width:`${Math.max(0,s-2)}%`}}),i.jsxs("div",{className:`grid grid-cols-[84px_1fr_1fr] px-3 py-1 text-xs relative w-full ${c?"":"cursor-pointer"}`,onClick:c?void 0:a,children:[i.jsx("span",{className:`${c?"text-[#555]":d} hover:text-white`,children:c?"—":n0n(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":tD(n,f?0:6)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":tD(r,f?0:6)})]})]})}function DSe({value:e,onChange:t,items:n,align:r="left"}){var l,c;const[s,a]=m.useState(!1),o=m.useRef(null);return m.useEffect(()=>{if(!s)return;const u=d=>{o.current&&(o.current.contains(d.target)||a(!1))};return window.addEventListener("mousedown",u),window.addEventListener("touchstart",u),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("touchstart",u)}},[s]),i.jsxs("div",{className:"relative",ref:o,children:[i.jsxs("button",{className:"h-7 px-2 text-xs rounded-md border border-[#292929] bg-[#101010] text-[#dcdada] flex items-center gap-1",onClick:()=>a(u=>!u),children:[((l=n.find(u=>u.key===e))==null?void 0:l.label)??((c=n.find(u=>String(u.key)===String(e)))==null?void 0:c.label)??e,i.jsx("span",{className:"text-[#8b8b8b]",children:"▾"})]}),s&&i.jsx("div",{className:`absolute z-10 mt-1 min-w-[80px] rounded-md border border-[#292929] bg-[#101010] p-1 ${r==="right"?"right-0":"left-0"}`,children:n.map(u=>i.jsx("div",{className:`px-2 py-1 text-xs rounded cursor-pointer ${String(u.key)===String(e)?"bg-[#262626] text-white":"text-[#dcdada] hover:bg-[#262626]"}`,onClick:()=>{t(u.key),a(!1)},children:u.label},u.key))})]})}const Zu=e=>{const t=Number(e);return Number.isFinite(t)?t:0},BSe=(e,t)=>{if(!Number.isFinite(e))return"--";const n=Math.abs(e),r=Math.pow(10,-t);return n>0&&n<r?"0":e.toLocaleString(void 0,{maximumFractionDigits:t})},$Se=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),f0n=(e,t)=>{if(isNaN(e))return"--";const n=Number(t);let r=0;return n>0&&n<1&&(r=Math.min(8,Math.max(0,-Math.floor(Math.log10(n))))),e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:r})},h0n=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},p0n={BTC:{1:{value:1},10:{value:2},20:{value:5},50:{value:10},100:{value:100},1e3:{value:1e3}},ETH:{.1:{value:.1},.2:{value:.2},.5:{value:.5},1:{value:1},10:{value:10},100:{value:100}}},m0n=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=p0n[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null};function x0n(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function g0n(e,t){if(!e||e<=0)return[];const n=Math.floor(Math.log10(e)),r=[];t>0&&r.push(t);const s=n-4,a=Math.pow(10,s);[1,2,5].forEach(g=>r.push(g*a));const o=n-3;r.push(Math.pow(10,o));const l=n-2;r.push(Math.pow(10,l));const c=n-1;r.push(Math.pow(10,c));const u=n;r.push(Math.pow(10,u));const d=r.filter(g=>g>0&&Number.isFinite(g)).map(x0n),f=Array.from(new Set(d)).sort((g,v)=>g-v),x=t>0?t:0;return f.filter(g=>g>=x&&g>0)}function USe(e){const t=(e||"").toUpperCase();return t==="BTC"?[1,10,20,50,100,1e3,1e4]:t==="ETH"?[.1,.2,.5,1,5,10,50,100]:[1e-4,.001,.01,.1,1,10,100]}async function b0n(e,t){const n=`${e}/info/markets?market=${encodeURIComponent(t)}`,r=await fetch(n);if(!r.ok)throw new Error("markets info request failed");const s=await r.json();return(Array.isArray(s==null?void 0:s.data)?s.data:[])[0]||null}async function y0n(e,t){const n=`${e}/info/markets/${encodeURIComponent(t)}/orderbook`,r=await fetch(n);if(!r.ok)throw new Error("orderbook request failed");const s=await r.json(),a=s==null?void 0:s.data,o=Array.isArray(a==null?void 0:a.bid)?a.bid:[],l=Array.isArray(a==null?void 0:a.ask)?a.ask:[];return{bids:o,asks:l}}async function v0n({apiBaseUrl:e,market:t,baseSymbol:n}){var s,a,o,l;const r=m0n(n);if(r&&r.length)return r;try{const c=await b0n(e,t),u=Zu((s=c==null?void 0:c.tradingConfig)==null?void 0:s.minPriceChange),d=Zu((a=c==null?void 0:c.marketStats)==null?void 0:a.lastPrice)||Zu((o=c==null?void 0:c.marketStats)==null?void 0:o.askPrice)||Zu((l=c==null?void 0:c.marketStats)==null?void 0:l.bidPrice);let f=g0n(d,u);return f=Array.from(new Set(f.filter(x=>Number.isFinite(x)&&x>0))).sort((x,g)=>x-g),f.length?f:USe(n)}catch{return USe(n)}}function zSe(e,t,n){const r=new Map;for(const s of e||[]){const a=Zu(s.px),o=Zu(s.sz);if(!a||!o||!t)continue;const l=n==="bid"?Math.floor(a/t)*t:Math.ceil(a/t)*t,c=Number(l.toFixed(12));r.set(c,(r.get(c)||0)+o)}return[...r.entries()].map(([s,a])=>({price:s,size:a}))}function w0n({market:e,baseSymbol:t,rows:n=16,onSelectPrice:r,onBest:s,apiBaseUrl:a="https://express-proxy-delta.vercel.app/proxy?url=https://api.starknet.extended.exchange/api/v1",wsBaseUrl:o="wss://api.starknet.extended.exchange"}){var Ce;const c=m.useRef(null),u=m.useRef(null),d=m.useRef(0),f=m.useRef(null),x=m.useRef({bids:new Map,asks:new Map}),g=m.useRef(!1),v=m.useRef(!0),[w,C]=m.useState({bids:[],asks:[]}),[N,I]=m.useState("COIN"),[P,R]=m.useState(null),[F,U]=m.useState([]),L=(ce,ge)=>N==="USD"?ce*ge:ce,z=N==="USD"?"USD":t?String(t):"COIN";m.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]);const Q=()=>{g.current||(g.current=!0,requestAnimationFrame(()=>{if(g.current=!1,!v.current)return;const ce=x.current;if(!((ce==null?void 0:ce.bids)instanceof Map)||!((ce==null?void 0:ce.asks)instanceof Map))return;const ge=1024,Ae=Array.from(ce.bids.entries()).map(([je,Ie])=>({px:je,sz:Ie})).sort((je,Ie)=>Ie.px-je.px).slice(0,ge),ye=Array.from(ce.asks.entries()).map(([je,Ie])=>({px:je,sz:Ie})).sort((je,Ie)=>je.px-Ie.px).slice(0,ge);C({bids:Ae,asks:ye})}))},ne=(ce,ge)=>{const Ae=x.current||{bids:new Map,asks:new Map};Ae.bids=new Map,Ae.asks=new Map,x.current=Ae;for(const ye of ce||[]){const je=Zu((ye==null?void 0:ye.p)??(ye==null?void 0:ye.price)),Ie=Zu((ye==null?void 0:ye.q)??(ye==null?void 0:ye.qty));if(!je||!Number.isFinite(Ie)||Ie<=1e-8)continue;const Re=Number(Ie.toFixed(12));Re>1e-8&&Ae.bids.set(je,Re)}for(const ye of ge||[]){const je=Zu((ye==null?void 0:ye.p)??(ye==null?void 0:ye.price)),Ie=Zu((ye==null?void 0:ye.q)??(ye==null?void 0:ye.qty));if(!je||!Number.isFinite(Ie)||Ie<=1e-8)continue;const Re=Number(Ie.toFixed(12));Re>1e-8&&Ae.asks.set(je,Re)}},J=(ce,ge)=>{for(const Ae of ce||[]){const ye=Zu(Ae==null?void 0:Ae.p),je=Zu(Ae==null?void 0:Ae.q);if(!ye||!Number.isFinite(je)||je===0)continue;const Re=Zu(ge.get(ye)||0)+je;if(Math.abs(Re)<=1e-8)ge.delete(ye);else{const Qe=Number(Re.toFixed(12));Qe<=0?ge.delete(ye):ge.set(ye,Qe)}}},X=ce=>{if(!ce)return;const ge=c.current;if(ge&&(ge.readyState===WebSocket.OPEN||ge.readyState===WebSocket.CONNECTING))return;const Ae=`${o}/stream.extended.exchange/v1/orderbooks/${encodeURIComponent(ce)}`,ye=new WebSocket(Ae);c.current=ye,ye.onopen=()=>{d.current=0,f.current=null},ye.onmessage=je=>{let Ie;try{Ie=JSON.parse(je.data||"{}")}catch{return}const Re=Number(Ie==null?void 0:Ie.seq);if(Number.isFinite(Re)){const ct=f.current;if(ct!=null&&Re!==ct+1){try{ye.close()}catch{}return}f.current=Re}const Qe=String((Ie==null?void 0:Ie.type)||"").toUpperCase(),$e=Ie==null?void 0:Ie.data;if(!$e)return;const it=Array.isArray($e)?$e.find(ct=>String(ct==null?void 0:ct.m)===String(ce)):$e;if(!it||String(it==null?void 0:it.m)!==String(ce))return;const tt=String((it==null?void 0:it.t)||Qe).toUpperCase(),ot=(it==null?void 0:it.b)||[],ft=(it==null?void 0:it.a)||[];if(tt==="SNAPSHOT")ne(ot,ft);else if(tt==="DELTA"){const ct=x.current;ct!=null&&ct.bids||(ct.bids=new Map),ct!=null&&ct.asks||(ct.asks=new Map),J(ot,ct.bids),J(ft,ct.asks)}else return;Q()},ye.onclose=()=>{d.current=Math.min(d.current+1,6),!u.current&&(u.current=setTimeout(()=>{u.current=null,X(ce)},500*Math.pow(2,d.current)))},ye.onerror=()=>{try{ye.close()}catch{}}};m.useEffect(()=>{if(c.current)try{c.current.onmessage=null,c.current.onopen=null,c.current.onclose=null,c.current.onerror=null,c.current.close()}catch{}if(c.current=null,u.current&&(clearTimeout(u.current),u.current=null),d.current=0,f.current=null,x.current={bids:new Map,asks:new Map},C({bids:[],asks:[]}),U([]),R(null),!e)return;let ce=!1;return(async()=>{try{const ge=await y0n(a,e);if(ce)return;ne(((ge==null?void 0:ge.bids)||[]).map(Ae=>({price:Ae.price,qty:Ae.qty})),((ge==null?void 0:ge.asks)||[]).map(Ae=>({price:Ae.price,qty:Ae.qty}))),Q()}catch{}})(),X(e),(async()=>{const ge=await v0n({apiBaseUrl:a,market:e,baseSymbol:t||e.split("-")[0]});ce||(U(ge),R(ge[0]??null))})(),()=>{ce=!0}},[e,t,a,o]);const re=m.useMemo(()=>(w.bids||[]).map(ce=>Zu(ce.px)).filter(ce=>Number.isFinite(ce)&&ce>0),[w]),pe=m.useMemo(()=>(w.asks||[]).map(ce=>Zu(ce.px)).filter(ce=>Number.isFinite(ce)&&ce>0),[w]),Y=re.length?Math.max(...re):null,ie=pe.length?Math.min(...pe):null;m.useEffect(()=>{Y!=null&&ie!=null&&(s==null||s({bestBid:Y,bestAsk:ie,mid:(Y+ie)/2}))},[Y,ie,s]);const oe=m.useMemo(()=>{const ce=Number(P)||1,ge=zSe(w.bids,ce,"bid").sort((ye,je)=>je.price-ye.price),Ae=zSe(w.asks,ce,"ask").sort((ye,je)=>ye.price-je.price);return{bids:ge,asksAsc:Ae}},[w,P]),G=m.useMemo(()=>{const ce=oe.asksAsc.slice(0,n);let ge=0;return ce.map(ye=>(ge+=L(ye.size,ye.price),{...ye,total:ge})).reverse()},[oe,n,N]),V=m.useMemo(()=>{const ce=oe.bids.slice(0,n);let ge=0;return ce.map(Ae=>(ge+=L(Ae.size,Ae.price),{...Ae,total:ge}))},[oe,n,N]),te=m.useMemo(()=>{if(Y==null||ie==null)return null;const ce=Math.abs(ie-Y),ge=(ie+Y)/2;return{diff:ce,pct:ge?ce/ge*100:0}},[Y,ie]),ae=Math.max(G.reduce((ce,ge)=>Math.max(ce,ge.total||0),0),1e-9),he=Math.max(V.reduce((ce,ge)=>Math.max(ce,ge.total||0),0),1e-9);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold font-inter",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-[#292929]",children:[i.jsx(VSe,{value:String(P??""),onChange:ce=>R(Number(ce)),items:(F||[]).map(ce=>({key:String(ce),label:h0n(ce)}))}),i.jsx(VSe,{value:N,onChange:I,items:[{key:"USD",label:"USD"},{key:"COIN",label:t||((Ce=e==null?void 0:e.split("-"))==null?void 0:Ce[0])||"COIN"}],align:"right"})]}),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] w-full",children:[i.jsx("span",{className:"uppercase",children:"Price"}),i.jsxs("span",{className:"uppercase text-center",children:["Size (",z,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",z,")"]})]}),i.jsx("div",{className:"flex-1 overflow-hidden w-full",children:i.jsxs("div",{className:"overflow-auto w-full",children:[G.map((ce,ge)=>i.jsx(HSe,{side:"ask",step:Number(P)||1,price:ce.price,size:ce.size!=null?L(ce.size,ce.price):null,total:ce.total,widthPct:ce.total?Math.min(100,ce.total/ae*100):0,onClick:()=>ce.price!=null&&(r==null?void 0:r(ce.price)),unit:N},`ask-${ge}`)),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] border-y border-[#292929] my-1 w-full",children:[i.jsx("span",{className:"uppercase",children:"Spread"}),i.jsx("span",{className:"text-right",children:te?$Se(te.diff,4):"--"}),i.jsx("span",{className:"text-right",children:te?`${$Se(te.pct,4)}%`:"--"})]}),V.map((ce,ge)=>i.jsx(HSe,{side:"bid",step:Number(P)||1,price:ce.price,size:ce.size!=null?L(ce.size,ce.price):null,total:ce.total,widthPct:ce.total?Math.min(100,ce.total/he*100):0,onClick:()=>ce.price!=null&&(r==null?void 0:r(ce.price)),unit:N},`bid-${ge}`))]})})]})}function HSe({side:e,price:t,size:n,total:r,widthPct:s,onClick:a,step:o,unit:l}){const c=t==null,u=e==="bid"?"from-transparent to-[#67ffbd]/30":"from-transparent to-[#FF7272]/30",d=e==="bid"?"text-[#67FFBD]":"text-[#FF797C]",x=l==="USD"?2:8;return i.jsxs("div",{className:"relative w-full font-semibold",children:[!c&&i.jsx("div",{className:`absolute left-0 top-px bottom-px bg-gradient-to-r ${u} transition-all duration-300 ease-[cubic-bezier(0.42,0,0.58,1)]`,style:{width:`${Math.max(0,s-2)}%`}}),i.jsxs("div",{className:`grid grid-cols-[84px_1fr_1fr] px-3 py-1 text-xs relative w-full ${c?"":"cursor-pointer"}`,onClick:c?void 0:a,children:[i.jsx("span",{className:`${c?"text-[#555]":d} hover:text-white`,children:c?"—":f0n(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":BSe(n,x)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":BSe(r,x)})]})]})}function VSe({value:e,onChange:t,items:n,align:r="left"}){var l,c;const[s,a]=m.useState(!1),o=m.useRef(null);return m.useEffect(()=>{if(!s)return;const u=d=>{o.current&&(o.current.contains(d.target)||a(!1))};return window.addEventListener("mousedown",u),window.addEventListener("touchstart",u),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("touchstart",u)}},[s]),i.jsxs("div",{className:"relative",ref:o,children:[i.jsxs("button",{className:"h-7 px-2 text-xs rounded-md border border-[#292929] bg-[#101010] text-[#dcdada] flex items-center gap-1",onClick:()=>a(u=>!u),children:[((l=n.find(u=>u.key===e))==null?void 0:l.label)??((c=n.find(u=>String(u.key)===String(e)))==null?void 0:c.label)??e,i.jsx("span",{className:"text-[#8b8b8b]",children:"▾"})]}),s&&i.jsx("div",{className:`absolute z-10 mt-1 min-w-[80px] rounded-md border border-[#292929] bg-[#101010] p-1 ${r==="right"?"right-0":"left-0"}`,children:n.map(u=>i.jsx("div",{className:`px-2 py-1 text-xs rounded cursor-pointer ${String(u.key)===String(e)?"bg-[#262626] text-white":"text-[#dcdada] hover:bg-[#262626]"}`,onClick:()=>{t(u.key),a(!1)},children:u.label},u.key))})]})}const sF="#67FFBD",C0n={type:"spring",stiffness:260,damping:26,mass:1},KHe=e=>{const t=Number(e);return Number.isFinite(t)?t:null},eg=(...e)=>{for(const t of e){const n=KHe(t);if(n!=null)return n}return null},S0n=e=>{const t=KHe(e);return t==null?null:Math.abs(t)>1?t/100:t};function rj({title:e,subtitle:t}){return i.jsx("div",{className:"w-full h-full flex items-center justify-center px-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-sm text-white font-semibold mb-1",children:e}),i.jsx("div",{className:"text-xs text-white/50",children:t})]})})}function iF({code:e,onCodeChange:t,onSubmit:n,loading:r,checking:s,message:a}){const o=r||s||!e.trim();return i.jsxs("div",{className:"relative h-full w-full flex justify-center overflow-hidden rounded-[16px] bg-black",children:[i.jsx(vo.div,{className:"pointer-events-none absolute -inset-[40%] opacity-80 blur-3xl",style:{background:"radial-gradient(circle at 15% 0%, rgba(103,255,189,0.32), transparent 55%), radial-gradient(circle at 85% 100%, rgba(103,255,189,0.24), transparent 60%)"},initial:{x:"-4%",y:"-8%"},animate:{x:["-4%","4%","-2%","-4%"],y:["-8%","6%","2%","-8%"]},transition:{duration:24,repeat:1/0,ease:"easeInOut"}}),i.jsxs(vo.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,ease:[.16,1,.3,1]},className:"relative z-10 w-full max-w-[460px] rounded-2xl border border-[#17211b] bg-[#050505] shadow-[0_30px_90px_rgba(0,0,0,0.9)] overflow-hidden",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-50",children:i.jsx("div",{className:"w-full h-full",style:{background:"radial-gradient(900px 500px at 50% -10%, rgba(103,255,189,0.45), transparent 70%)"}})}),i.jsx("video",{src:XN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[260px] object-cover bg-black"},XN)]}),i.jsxs("div",{className:"px-5 pb-5 pt-4 space-y-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-[11px] font-medium tracking-[0.18em] uppercase",style:{color:sF},children:"Early Access"}),i.jsxs("div",{className:"text-lg font-semibold",children:["Enter ",i.jsx("span",{style:{color:sF},children:"Alpha Code"})]}),i.jsx("p",{className:"text-[12px] text-white/60",children:"Grid Bot is currently in private alpha. Enter your invitation code to unlock this feature in your account."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-[11px] text-white/45",children:"Alpha Code"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value.toUpperCase()),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),n())},placeholder:"DXTR-XXXXX",autoComplete:"off",spellCheck:!1,className:"flex-1 h-10 px-3 rounded-md bg-[#050505] border border-[#1e2e27] text-[13px] tracking-[0.18em] font-mono text-white placeholder:text-white/20 focus:outline-none focus:border-[#67FFBD]"}),i.jsx("button",{type:"button",onClick:n,disabled:o,className:`h-10 px-4 rounded-md text-[13px] font-semibold transition-colors ${o?"bg-[#101613] text-white/40 cursor-not-allowed":"text-black hover:opacity-90"}`,style:o?void 0:{backgroundColor:sF},children:r?"Checking…":"Access"})]})]}),(s||a)&&i.jsxs("div",{className:"text-[11px] min-h-[16px]",children:[s&&!a&&i.jsx("span",{className:"text-white/40",children:"Checking your eligibility…"}),a&&i.jsx("span",{style:{color:sF},children:a})]})]})]})]})}function N0n({data:e,loading:t,error:n,coin:r,setCoin:s,period:a,periods:o,handlePeriodChange:l}){var Kn,ir,rr,Jt,Un,Qn;const c=il(),u=Mc(),{exchange:d,coin:f}=e5(),{address:x,isConnected:g}=Jr(),{setSignInConnectButtonOpen:v}=m.useContext(Qr),[w,C]=m.useState("single"),[N,I]=m.useState("BTC/ETH"),[P,R]=m.useState([]),[F,U]=m.useState(2),[L,z]=m.useState("1m"),[Q,ne]=m.useState(null),[J,X]=m.useState(null),[re,pe]=m.useState({}),[Y,ie]=m.useState({id:null,address:null}),[oe,G]=m.useState(!1),[V,te]=m.useState(!1),[ae,he]=m.useState(()=>typeof window>"u"||window.location.hash==="#gridbot"?"grid":window.location.hash==="#trade"?"trade":"grid"),[Ce,ce]=m.useState([]),[ge,Ae]=m.useState(()=>d==="lighter"?"lighter":d==="extended"?"extended":"hyperliquid"),[ye,je]=m.useState(()=>r||f||"BTC"),[Ie,Re]=m.useState(()=>d==="lighter"&&f||"BTC"),[Qe,$e]=m.useState(()=>d==="extended"&&f||"BTC"),[it,tt]=m.useState(null),[ot,ft]=m.useState(!1),[ct,Vt]=m.useState(null),[It,an]=m.useState(!1),[Nt,mn]=m.useState(null),[dn,Pt]=m.useState(!1),[Xe,Ut]=m.useState({address:null,token:null}),[Lt,qe]=m.useState(!1),[Ke,pt]=m.useState(!1),[en,Bt]=m.useState(!1),[Et,et]=m.useState(!1),[Be,Mt]=m.useState(""),[Ve,ut]=m.useState(!1),[xt,jt]=m.useState(""),kt=m.useRef(null),xn=m.useRef(null),un=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,On=Rt=>z(Rt),En=xU(),jn=Nue(),bn=Aue(),Zn=ge==="hyperliquid"?En:ge==="lighter"?jn:bn,zn=ge==="hyperliquid"?!En.length:ge==="lighter"?!jn.length:!bn.length,$n=ge==="hyperliquid"?ye:ge==="lighter"?Ie:Qe,nr=ge==="hyperliquid"&&w==="pair"?N:$n,wn=ge==="hyperliquid"&&w==="pair"&&N.split("/")[0]||ye,on=m.useMemo(()=>ge==="lighter"&&$n?jn.find(Rt=>Rt.symbol===$n):null,[ge,jn,$n]),Oe=(on==null?void 0:on.marketIndex)??(on==null?void 0:on.market_id)??(on==null?void 0:on.id)??((Kn=on==null?void 0:on.raw)==null?void 0:Kn.marketIndex)??((ir=on==null?void 0:on.raw)==null?void 0:ir.market_id)??((rr=on==null?void 0:on.raw)==null?void 0:rr.id)??null,rn=m.useMemo(()=>{if(!$n)return null;const Rt=String($n||"").toUpperCase(),Pn=Rt.replace(/-USD$/,"");return bn.find(Ee=>{const p=String((Ee==null?void 0:Ee.symbol)||"").toUpperCase(),h=String((Ee==null?void 0:Ee.rawSymbol)||"").toUpperCase();return p===Rt||h===Rt||p===Pn||h===Pn})||null},[bn,$n]),cn=m.useMemo(()=>{if(rn!=null&&rn.rawSymbol)return rn.rawSymbol;if(!$n)return"";const Rt=String($n||"").toUpperCase();return Rt.includes("-")?Rt:`${Rt}-USD`},[rn,$n]),_t=m.useMemo(()=>rn!=null&&rn.symbol?rn.symbol:$n?String($n||"").toUpperCase().replace(/-USD$/,"").replace(/\/USD$/,""):"",[rn,$n]),Yn=m.useMemo(()=>{const Rt=(rn==null?void 0:rn.lastPrice)??(rn==null?void 0:rn.last);if(Rt!=null&&Number.isFinite(Number(Rt)))return Number(Rt);const Pn=rn==null?void 0:rn.marketStats,Ee=(Pn==null?void 0:Pn.lastPrice)??(Pn==null?void 0:Pn.markPrice)??(rn==null?void 0:rn.markPrice)??null;return Ee!=null&&Number.isFinite(Number(Ee))?Number(Ee):null},[rn]);m.useEffect(()=>{u.hash==="#gridbot"?he("grid"):u.hash==="#trade"?he("trade"):u.hash||he("grid")},[u.hash]),m.useEffect(()=>{d==="lighter"&&ge!=="lighter"?Ae("lighter"):d==="hyperliquid"&&ge!=="hyperliquid"?Ae("hyperliquid"):d==="extended"&&ge!=="extended"&&Ae("extended")},[d,ge]),m.useEffect(()=>{d==="hyperliquid"?f&&f!==ye&&(je(f),s(f)):d==="lighter"?f&&f!==Ie&&Re(f):d==="extended"&&f&&f!==Qe&&$e(f)},[d,f,ye,Ie,Qe,s]),m.useEffect(()=>{const Rt=()=>{if(typeof window>"u")return;const Pn=window.localStorage.getItem("hyperAddress"),Ee=window.localStorage.getItem("hyperToken");Ut({address:Pn,token:Ee})};return Rt(),window.addEventListener("localStorageUpdated",Rt),window.addEventListener("storage",Rt),()=>{window.removeEventListener("localStorageUpdated",Rt),window.removeEventListener("storage",Rt)}},[]);const yn=m.useMemo(()=>!Xe.address||!Xe.token?!1:un?!0:x?Xe.address.toLowerCase()===x.toLowerCase():!1,[Xe.address,Xe.token,x,un]);m.useEffect(()=>{if(!yn){qe(!1),pt(!1),Bt(!1),et(!1),Mt(""),jt("");return}if(Lt)return;let Rt=!1;return(async()=>{if(typeof window>"u")return;const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!Ee||!p){Rt||(qe(!0),pt(!1),Bt(!1));return}et(!0);try{const h=await ji(p.toLowerCase(),Ee);if(Rt)return;const S=(h==null?void 0:h.data)||h||{},_=(S==null?void 0:S.data)||S||{},k=_.grid_hyper_alpha_code??S.grid_hyper_alpha_code??!1,T=_.grid_lighter_alpha_code??S.grid_lighter_alpha_code??!1;pt(!k),Bt(!T),qe(!0)}catch{Rt||(pt(!1),Bt(!1),qe(!0))}finally{Rt||et(!1)}})(),()=>{Rt=!0}},[yn,Lt]),m.useEffect(()=>{yn&&qe(!1)},[ge,yn]),m.useEffect(()=>{(ge!=="lighter"||ae!=="grid")&&(Mt(""),jt(""))},[ge,ae]);const Dt=async()=>{var Rt,Pn,Ee,p;if(!Be.trim()){ln.error("Please enter your alpha code");return}if(!Xe.address||!Xe.token){ln.error("Please sign in again");return}ut(!0),jt("");try{const h={address:Xe.address.toLowerCase(),token:Xe.token,alpha_code:Be.trim(),source_market:ge==="hyperliquid"?"hyper":"lighter",app_type:"grid_bot"},_=(await ds.post("https://dextrabothypev2.nftinit.io/api/subscriber/alpha_code/set/",h)).data||{};if(_.success){const k=_.message||"Alpha code added successfully";ln.success(k),jt(k),ge==="hyperliquid"?pt(!1):ge==="lighter"&&Bt(!1),qe(!0)}else{const k=_.error_message||_.message||"This alpha code is invalid";ln.error(k),jt(k)}}catch(h){const S=((Pn=(Rt=h==null?void 0:h.response)==null?void 0:Rt.data)==null?void 0:Pn.error_message)||((p=(Ee=h==null?void 0:h.response)==null?void 0:Ee.data)==null?void 0:p.message)||h.message||"Failed to validate alpha code";ln.error(S),jt(S)}finally{ut(!1)}};m.useEffect(()=>{ge==="hyperliquid"?s(ye):ge==="lighter"?!Ie&&jn.length>0&&Re(jn[0].symbol):ge==="extended"&&!Qe&&bn.length>0&&$e(bn[0].symbol)},[ge,ye,Ie,Qe,jn,bn,s]),m.useEffect(()=>{if(ge!=="extended"||!bn.length)return;const Rt=bn.some(Pn=>Pn.symbol===Qe);(!Qe||!Rt)&&$e(bn[0].symbol)},[ge,Qe,bn]),m.useEffect(()=>{if(!x){if(un&&Xe.address){ie(Rt=>Rt.address&&Rt.address.toLowerCase()===Xe.address.toLowerCase()?Rt:{id:null,address:Xe.address});return}ie(Rt=>Rt.address?{id:null,address:null}:Rt);return}ie(Rt=>Rt.address&&Rt.address.toLowerCase()===x.toLowerCase()?Rt:{id:null,address:x})},[x,Xe.address,un]),m.useEffect(()=>{if(ge!=="hyperliquid"){if(kt.current){try{kt.current.close()}catch{}kt.current=null}R([]),xn.current=null;return}if(!wn)return;const Rt=(Pn,Ee)=>{if(Pn)try{Pn.readyState===WebSocket.OPEN&&Pn.send(JSON.stringify(Ee))}catch(p){console.error("activeAssetCtx ws send error",p)}};if(kt.current){const Pn=kt.current;xn.current&&xn.current!==wn&&Rt(Pn,{method:"unsubscribe",subscription:{type:"activeAssetCtx",coin:xn.current}}),Rt(Pn,{method:"subscribe",subscription:{type:"activeAssetCtx",coin:wn}})}else{const Pn=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");kt.current=Pn,Pn.onopen=()=>{Rt(Pn,{method:"subscribe",subscription:{type:"activeAssetCtx",coin:wn}})},Pn.onmessage=Ee=>{var h;let p;try{p=JSON.parse(Ee.data)}catch(S){console.error("activeAssetCtx ws parse error",S);return}(h=p==null?void 0:p.data)!=null&&h.ctx&&R({...p.data.ctx,source:"hyperliquid"})},Pn.onclose=()=>{kt.current===Pn&&(kt.current=null)},Pn.onerror=Ee=>{console.error("activeAssetCtx ws error",Ee)}}xn.current=wn},[wn,ge]),m.useEffect(()=>()=>{kt.current&&(kt.current.close(),kt.current=null)},[]),m.useEffect(()=>{if(ge!=="lighter")return;if(!$n){R([]);return}const Rt=jn.find(k=>k.symbol===$n);if(!Rt||!Rt.raw){R([]);return}const Pn=Rt.raw,Ee=Number(Pn.last_trade_price??0)||0,p=Number(Pn.daily_price_change??0)||0,h=Number(Pn.daily_quote_token_volume??0)||0,S=Number(Pn.open_interest??0)||0,_=p&&Ee?Ee/(1+p/100):Ee;R({markPx:Ee,oraclePx:Ee,prevDayPx:_,dayNtlVlm:h,openInterest:S,funding:0,source:"lighter"})},[ge,$n,jn]),m.useEffect(()=>{if(ge!=="extended")return;if(!rn){R([]);return}const Rt=rn.marketStats||{},Pn=eg(Rt.markPrice,Rt.lastPrice,Rt.indexPrice,rn.markPrice,rn.lastPrice,rn.last),Ee=eg(Rt.indexPrice,Rt.markPrice,Rt.lastPrice,rn.indexPrice,Pn),p=eg(Rt.dailyPriceChange,rn.dailyPriceChange),h=eg(Rt.dailyPriceChangePercentage,rn.dailyPriceChangePercentage,rn.change24hPct,rn.chg24),S=S0n(h);let _=null;if(Pn!=null){if(p!=null){const fe=Pn-p;Number.isFinite(fe)&&fe>0&&(_=fe)}if(_==null&&S!=null){const fe=1+S;if(Number.isFinite(fe)&&fe!==0){const xe=Pn/fe;Number.isFinite(xe)&&xe>0&&(_=xe)}}}const k=eg(Rt.dailyVolume,rn.volume,rn.vol),T=eg(Rt.openInterestBase,rn.openInterestBase),B=eg(Rt.openInterest,rn.openInterestUsd,rn.openInterest);let W=T;W==null&&B!=null&&Ee!=null&&Ee>0&&(W=B/Ee);const ee=eg(Rt.fundingRate,rn.fundingRate,rn.funding),de=eg(Rt.nextFundingRate,rn.nextFundingRate);R({markPx:Pn,oraclePx:Ee,prevDayPx:_,dayNtlVlm:k,openInterest:W,funding:ee,nextFundingTime:de,source:"extended"})},[ge,rn]),m.useEffect(()=>{ge==="hyperliquid"&&ce([])},[ge]),m.useEffect(()=>{ge==="lighter"&&(ne(null),X(null))},[ge]),m.useEffect(()=>{if(ge!=="lighter"){tt(null);return}if(!g||!x){tt(null);return}let Rt=!1;return(async()=>{if(typeof window>"u")return;const Ee=Xe.address,p=Xe.token;if(!Ee||!p){Rt||tt(null);return}if(Ee.toLowerCase()!==x.toLowerCase()){Rt||tt(null);return}ft(!0);try{const h=await ds.post("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{address:Ee,token:p});if(Rt)return;const S=h.data;let _=[];if(Array.isArray(S)?_=S:S&&Array.isArray(S.data)?_=S.data:S&&S.wallet_id!=null&&(_=[S]),!_.length)tt(null);else{const k=_[0],T={id:k.wallet_id,address:k.wallet_address,name:k.wallet_name};tt(T),ie({id:T.id,address:T.address})}}catch{Rt||tt(null)}finally{Rt||ft(!1)}})(),()=>{Rt=!0}},[ge,g,x,Xe.address,Xe.token]),m.useEffect(()=>{if(ge!=="extended"){Vt(null);return}const Rt=Xe.address,Pn=Xe.token;if(!Rt||!Pn){Vt(null);return}if(!un&&x&&Rt.toLowerCase()!==x.toLowerCase()){Vt(null);return}let Ee=!1;return(async()=>{an(!0);try{const h=await ds.post("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{address:Rt,token:Pn});if(Ee)return;const S=h.data;let _=[];if(Array.isArray(S)?_=S:S&&Array.isArray(S.data)?_=S.data:S&&S.wallet_id!=null&&(_=[S]),!_.length)Vt(null);else{const k=_[0],T={id:k.wallet_id,address:k.wallet_address,name:k.wallet_name};Vt(T),ie({id:T.id,address:T.address})}}catch{Ee||Vt(null)}finally{Ee||an(!1)}})(),()=>{Ee=!0}},[ge,Xe.address,Xe.token,x,un]),m.useEffect(()=>{if(ge!=="hyperliquid"){mn(null);return}if(!g||!x){mn(null);return}let Rt=!1;return(async()=>{if(typeof window>"u")return;const Ee=Xe.address,p=Xe.token;if(!Ee||!p){Rt||mn(null);return}if(Ee.toLowerCase()!==x.toLowerCase()){Rt||mn(null);return}Pt(!0);try{const h=await ds.post("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{address:Ee,token:p});if(Rt)return;const S=h.data;let _=!1;Array.isArray(S)?_=S.length>0:S&&Array.isArray(S.data)?_=S.data.length>0:S&&S.wallet_id!=null&&(_=!0),mn(_)}catch{Rt||mn(null)}finally{Rt||Pt(!1)}})(),()=>{Rt=!0}},[ge,g,x,Xe.address,Xe.token]);const sn=Rt=>{if(w==="pair")return;const Pn=ae==="grid"?"#gridbot":"#trade";ge==="hyperliquid"?(je(Rt),s(Rt),c(`/terminal/hyperliquid/${Rt}${Pn}`)):ge==="lighter"?(Re(Rt),c(`/terminal/lighter/${Rt}${Pn}`)):($e(Rt),c(`/terminal/extended/${Rt}${Pn}`))},Tn=()=>{typeof window>"u"||window.open("/dca-bot","_blank","noopener,noreferrer")};return i.jsxs("div",{className:"w-full min-h-screen bg-[#050505] text-white font-manrope p-2 mb-6",children:[i.jsx("div",{className:"flex items-center gap-2 mb-4",children:i.jsxs("div",{className:"inline-flex bg-[#161616] rounded-full p-1 text-[11px]",children:[i.jsxs("div",{className:"flex justify-center items-center",children:[i.jsx("img",{src:"https://i.imgflip.com/7zho2e.png",className:"w-4 h-4 mr-1 ml-2",alt:""}),i.jsx("button",{onClick:()=>{const Rt=ye||r||"BTC";he("grid"),Ae("hyperliquid"),c(`/terminal/hyperliquid/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition mr-2 ${ge==="hyperliquid"?"bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Hyperliquid"})]}),i.jsxs("div",{className:"flex justify-center items-center mr-2",children:[i.jsx(Xf,{className:"w-4 h-4 text-[#fff] mr-1"}),i.jsx("button",{onClick:()=>{const Rt=Ie||"BTC";he("grid"),Ae("lighter"),c(`/terminal/lighter/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ge==="lighter"?"bg:white bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Lighter"})]}),i.jsxs("div",{className:"flex justify-center items-center",children:[i.jsx("img",{src:"https://app.extended.exchange/assets/favicon/favicon-32x32.png",className:"w-4 h-4 mr-1",alt:""}),i.jsx("button",{onClick:()=>{const Rt=Qe||"BTC";he("grid"),Ae("extended"),c(`/terminal/extended/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ge==="extended"?"bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Extended"})]})]})}),i.jsx(vo.div,{className:"fixed inset-0 pointer-events-none z-10",initial:{opacity:.14},animate:{opacity:0},transition:{duration:.9,ease:[.16,1,.3,1]},style:{background:"radial-gradient(1200px 600px at 50% 8%, rgba(255,255,255,0.08), rgba(0,0,0,0) 60%)"}}),i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-col gap-1 xl:flex-row w-full min-w-0",children:[i.jsxs("div",{className:"flex flex-col gap-1 w-full min-w-0 xl:flex-1",children:[i.jsx(vo.div,{className:"xl:hidden bg-[#101010] border border-[#292929] px-2 rounded-[16px]",children:i.jsx("div",{className:"flex items-center justify-between w-full",children:i.jsx(_fn,{coin:$n,data:(Jt=e.position_info)==null?void 0:Jt[0],setIsDigits:U,headerData:P,active:L,onCoinChange:sn,markets:Zn,marketsLoading:zn,mode:w,pairKey:N,onPairChange:I})})}),i.jsxs("div",{className:"flex flex-col gap-1 xl:grid xl:h-[600px] rounded-[16px]",style:{gridTemplateColumns:oe?"minmax(0,1fr) 24px":"minmax(0,1fr) 300px"},children:[i.jsxs(vo.div,{className:"relative bg-[#101010] border border-[#292929] overflow-hidden min-w-0 h-[420px] sm:h-[500px] xl:h-full rounded-[16px] flex flex-col",children:[i.jsx("div",{className:"hidden xl:flex h-[56px] w-full items-center justify-between px-2 border-b border-[#292929]",children:i.jsx(Wdn,{coin:$n,data:(Un=e.position_info)==null?void 0:Un[0],setIsDigits:U,headerData:P,handleClick:On,active:L,onCoinChange:sn,mode:w,pairKey:N,onPairChange:I,markets:Zn,market:ge})}),i.jsx("div",{className:"flex-1 min-h-0",children:ge==="hyperliquid"?i.jsx(AX,{coin:nr,interval:L,walletAddress:Y==null?void 0:Y.address,gridLines:ae==="grid"?Ce:[],market:"hyperliquid"},`hl-${nr}-${L}`):ge==="lighter"?i.jsx(AX,{coin:$n,interval:"1h",walletAddress:Y==null?void 0:Y.address,gridLines:ae==="grid"?Ce:[],market:"lighter",lighterMarketId:Oe},`lighter-${$n}-${L}-${Oe||"x"}`):i.jsx(AX,{coin:$n,interval:L,walletAddress:Y==null?void 0:Y.address,gridLines:ae==="grid"?Ce:[],market:"extended",extendedMarket:cn,extendedLastPrice:Yn},`extended-${$n}-${L}-${cn||"x"}`)})]}),i.jsxs(vo.div,{className:"hidden sm:flex w-full xl:h-full xl:min-h-0 relative rounded-[16px]",children:[!oe&&i.jsxs("div",{className:"group relative w-full h-full bg-[#101010] border border-[#292929] rounded-[16px] overflow-hidden",children:[i.jsx("button",{onClick:()=>G(!0),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 z-20 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),ge==="hyperliquid"?i.jsx(Qfn,{className:"w-full xl:h-full xl:min-h-0 overflow-y-auto",coin:r,data:t?[]:(Qn=e.position_info)==null?void 0:Qn[0],loading:t,period:a,periods:o,handlePeriodChange:l,onBookPrice:Rt=>ne(Rt),onBest:({mid:Rt})=>X(Rt)}):ge==="lighter"?Oe!=null?i.jsx(d0n,{marketId:Oe,baseSymbol:$n,rows:10,onSelectPrice:Rt=>ne(Rt),onBest:({mid:Rt})=>X(Rt)}):i.jsx(rj,{title:"Lighter Order Book",subtitle:"Select a market to see the order book"}):i.jsx(w0n,{market:cn,baseSymbol:_t||$n,rows:10,onSelectPrice:Rt=>ne(Rt),onBest:({mid:Rt})=>X(Rt)})]}),oe&&i.jsxs("div",{className:"group relative w-[24px] h-full bg-[#101010] border border-[#292929] rounded-[16px] flex items-center justify-center",children:[i.jsx("button",{onClick:()=>G(!1),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 z-20 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:"rotate-180",children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i.jsx("div",{className:"-rotate-90 whitespace-nowrap text-[11px] tracking-wide text-[#BFBFBF]",children:"Position / Order Book / Trades"})]})]})]}),i.jsxs(vo.div,{className:"xl:hidden bg-[#101010] border border-[#292929] rounded-[16px]",children:[i.jsx("div",{className:"flex items-center justify-center pt-3 pb-2",children:i.jsxs("div",{className:"inline-flex bg-[#161616] rounded-full p-1 text-xs",children:[i.jsx("button",{onClick:()=>{const Rt=ge==="hyperliquid"?ye||r||"BTC":ge==="lighter"?Ie||"BTC":Qe||"BTC";ce([]),he("trade"),c(`/terminal/${ge}/${Rt}#trade`)},className:`px-3 py-1 rounded-full transition ${ae==="trade"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Trade"}),i.jsx("button",{onClick:()=>{const Rt=ge==="hyperliquid"?ye||r||"BTC":ge==="lighter"?Ie||"BTC":Qe||"BTC";he("grid"),c(`/terminal/${ge}/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ae==="grid"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:ge==="hyperliquid"?"HL Grid Bot":ge==="lighter"?"Lighter Grid Bot":"Extended Grid Bot"}),ge==="extended"&&i.jsx("button",{onClick:Tn,className:"px-3 py-1 rounded-full transition text-white/60 hover:text-white",children:"DCA Bot"})]})}),i.jsx("div",{className:"min-h-[260px]",children:ae==="trade"?ge==="hyperliquid"?i.jsx(xSe,{coin:r,midPrice:J,selectedPrice:Q,maxLeverage:re[r]||25,wallet:Y,onWalletChange:ie,uiMode:w,pairKey:N},`trade-${Y.address}`):ge==="lighter"?i.jsx("div",{className:"h-[260px]",children:i.jsx(rj,{title:"Lighter Perp Trading",subtitle:"Coming Soon"})}):i.jsx("div",{className:"h-[260px]",children:i.jsx(rj,{title:"Extended Perp Trading",subtitle:"Coming Soon"})}):ge==="hyperliquid"?dn||Et?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Hyperliquid account…"}):yn?Ke?i.jsx(iF,{code:Be,onCodeChange:Mt,onSubmit:Dt,loading:Ve,checking:Et,message:xt}):Nt===!1?i.jsx("div",{className:"w-full h-full flex items-center justify-center py-6",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#hyperliquid","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create HL Account"})}):i.jsx(PSe,{coin:$n,midPrice:J,selectedPrice:Q,wallet:Y,onWalletChange:ie,onLevelsChange:ce}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4 py-6",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Hyperliquid Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(r0,{onClick:()=>v(!0)})})]}):ge==="lighter"?ot||Et?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60 py-6",children:"Loading Lighter account…"}):yn?en?i.jsx(iF,{code:Be,onCodeChange:Mt,onSubmit:Dt,loading:Ve,checking:Et,message:xt}):it?i.jsx(TSe,{coin:$n,midPrice:J,selectedPrice:Q,wallet:Y,onLevelsChange:ce}):i.jsx("div",{className:"w-full h-full flex items-center justify-center py-6",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#lighter","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Lighter Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4 py-6",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Lighter Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(r0,{onClick:()=>v(!0)})})]}):It?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60 py-6",children:"Loading Extended account…"}):yn?ct?i.jsx(OSe,{coin:$n,midPrice:J,selectedPrice:Q,wallet:Y,onLevelsChange:ce}):i.jsx("div",{className:"w-full h-full flex items-center justify-center py-6",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#extended","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Extended Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4 py-6",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Extended Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(r0,{onClick:()=>v(!0)})})]})})]}),ge==="lighter"&&yn&&i.jsx(vo.div,{className:"xl:hidden bg-[#101010] border border-[#292929] rounded-[16px] overflow-hidden",children:i.jsx(TO,{walletAddress:Y==null?void 0:Y.address,sourceMarket:"lighter"})}),i.jsx(vo.div,{className:"h-[500px] bg-[#101010] border border-[#292929] overflow-hidden rounded-[16px]",children:ge==="hyperliquid"?i.jsx(_mn,{data:e.positions_list,loading:t,error:n,isDigits:F,period:a,periods:o,handlePeriodChange:l,className:"h-full",minHeight:"min-h-0",walletAddress:Y==null?void 0:Y.address,coin:r,sourceMarket:"hyper"},`tabs-${Y.address}`):ge==="lighter"?yn?i.jsx(TO,{walletAddress:Y==null?void 0:Y.address,sourceMarket:"lighter"}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to manage Lighter grid bots"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(r0,{onClick:()=>v(!0)})})]}):i.jsx(TO,{walletAddress:Y==null?void 0:Y.address,sourceMarket:"extended"})})]}),i.jsxs(vo.div,{animate:{width:V?28:350},transition:C0n,className:"hidden xl:flex flex-col gap-1 rounded-[16px] overflow-visible",style:{minWidth:V?28:350},children:[!V&&i.jsxs("div",{className:"group relative bg-[#101010] border border-[#292929] flex-1 rounded-[16px] flex flex-col",children:[i.jsx("button",{onClick:()=>te(!0),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 z-20 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i.jsx("div",{className:"px-3 pt-3 pb-2 items-center justify-center flex",children:i.jsxs("div",{className:"inline-flex bg-[#161616] rounded-full p-1 text-xs",children:[i.jsx("button",{onClick:()=>{const Rt=ge==="hyperliquid"?ye||r||"BTC":ge==="lighter"?Ie||"BTC":Qe||"BTC";he("trade"),ce([]),c(`/terminal/${ge}/${Rt}#trade`)},className:`px-3 py-1 rounded-full transition ${ae==="trade"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Trade"}),i.jsx("button",{onClick:()=>{const Rt=ge==="hyperliquid"?ye||r||"BTC":ge==="lighter"?Ie||"BTC":Qe||"BTC";he("grid"),c(`/terminal/${ge}/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ae==="grid"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Grid Bot"}),ge==="extended"&&i.jsx("button",{onClick:Tn,className:"px-3 py-1 rounded-full transition text-white/60 hover:text-white",children:"DCA Bot"})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:ae==="trade"?ge==="hyperliquid"?i.jsx(xSe,{coin:r,midPrice:J,selectedPrice:Q,maxLeverage:re[r]||25,wallet:Y,onWalletChange:ie,uiMode:w,pairKey:N}):ge==="lighter"?i.jsx(rj,{title:"Lighter Perp Trading",subtitle:"Coming Soon"}):i.jsx(rj,{title:"Extended Perp Trading",subtitle:"Coming Soon"}):ge==="hyperliquid"?dn||Et?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Hyperliquid account…"}):yn?Ke?i.jsx(iF,{code:Be,onCodeChange:Mt,onSubmit:Dt,loading:Ve,checking:Et,message:xt}):Nt===!1?i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#hyperliquid","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create HL Account"})}):i.jsx(PSe,{coin:$n,midPrice:J,selectedPrice:Q,wallet:Y,onWalletChange:ie,onLevelsChange:ce}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Hyperliquid Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(r0,{onClick:()=>v(!0)})})]}):ge==="lighter"?ot||Et?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Lighter account…"}):yn?en?i.jsx(iF,{code:Be,onCodeChange:Mt,onSubmit:Dt,loading:Ve,checking:Et,message:xt}):it?i.jsx(TSe,{coin:$n,midPrice:J,selectedPrice:Q,wallet:Y,onLevelsChange:ce}):i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#lighter","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Lighter Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Lighter Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(r0,{onClick:()=>v(!0)})})]}):It?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Extended account…"}):yn?ct?i.jsx(OSe,{coin:$n,midPrice:J,selectedPrice:Q,wallet:Y,onLevelsChange:ce}):i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#extended","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Extended Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Extended Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(r0,{onClick:()=>v(!0)})})]})})]}),V&&i.jsxs("div",{className:"group relative h-full min-h-[505px] bg-[#101010] border border-[#292929] rounded-[16px] flex items-center justify-center",children:[i.jsx("button",{onClick:()=>te(!1),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent z-10",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow z-10",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:i.jsx("path",{d:"M15 6L9 12l6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i.jsx("div",{className:"-rotate-90 whitespace-nowrap text-[11px] tracking-wide text-[#BFBFBF] z-0",children:ae==="trade"?"Trade Panel":"Grid Bot"})]})]})]})})]})}const A0n=()=>{Jr();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u,getCopyTradeWatchList:d,getTrackedWatchList:f}=m.useContext(Qr),{coin:x}=e5(),[g,v]=m.useState(x||"BTC"),w=xU();function C(te){return te?te.includes(":")?te.split(":")[1]:te:""}function N(te){if(!te)return"";if(te.includes(":")){const[ae,he]=te.split(":");return`${he} (${ae})`}return te}const I=C(g),P=w.find(te=>te.symbol===`${I}-USD`||te.symbol===`${I}-USDH`||te.symbol===`${I}-USDC`),R=(P==null?void 0:P.last)??(P==null?void 0:P.coin),U=`${R?(te=>{if(te==null||!isFinite(te))return"";const ae=Number(te),he=Math.abs(ae),Ce=he>=1e3?0:he>=1?2:he>=.1?6:7,ce=ae.toFixed(Ce);return Number(ce).toLocaleString(void 0,{maximumFractionDigits:Ce})})(R):""} | ${N(g)} | Dextrabot | Top Hyperliquid Wallets`;m.useEffect(()=>{U&&(document.title=U)},[U]);const[L,z]=m.useState([]),[Q,ne]=m.useState(!1),[J,X]=m.useState(null);m.useEffect(()=>{const te=document.querySelector("main > div");return te&&(te.style.background="#050505"),()=>{te&&(te.style.background="")}},[]);const re=[{index:0,name:"1D",value:1},{index:1,name:"7D",value:7},{index:2,name:"30D",value:30},{index:3,name:"90D",value:90}],pe=parseInt(localStorage.getItem("ticker_period")),Y=!isNaN(pe)&&re[pe]?re[pe].value:re[1].value,[ie,oe]=m.useState(Y),G=te=>{oe(Number(te)),localStorage.setItem("ticker_period",re.findIndex(ae=>ae.value===Number(te)).toFixed(0))},V=async({coin:te,period:ae})=>{try{ne(!0);const he=`https://dextradata.nftinit.io/api/hyper/terminal/v2/${te}/${ae}`,Ce=await fetch(he);if(!Ce.ok)throw z([]),new Error("Network response was not ok");const ce=await Ce.json();ce!=null&&ce.success?(z(ce),ne(!1),window.localStorage.getItem("hyperToken")&&(d(),f())):(z([]),ne(!1),X(ce==null?void 0:ce.error_message))}catch(he){X(he.message),ne(!1)}};return m.useEffect(()=>{g&&ie&&V({coin:g,period:ie})},[g,ie]),m.useEffect(()=>{(async()=>{var Ce,ce;const ae=window.localStorage.getItem("hyperToken"),he=window.localStorage.getItem("hyperAddress");if(!(!ae||!he))try{const ge=await ji(he.toLowerCase(),ae);ge!=null&&ge.success?(e(ge==null?void 0:ge.telegram_chat_id),t(ge==null?void 0:ge.subscriber_role),n(ge==null?void 0:ge.subs_expire_day),r((Ce=ge==null?void 0:ge.mushboomer_counts)==null?void 0:Ce.eth),a((ce=ge==null?void 0:ge.mushboomer_counts)==null?void 0:ce.sol),o(ge==null?void 0:ge.referral_code),l(ge==null?void 0:ge.refcode),s(ge==null?void 0:ge.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(ge){console.error("Token verification error:",ge)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("meta",{name:"description",content:`View real-time ${g} positions of top Hyperliquid traders wallet by wallet. Track entry prices, unrealized PnL, position sizes, and copy trade profitable Bitcoin strategies instantly.`}),i.jsx("meta",{property:"og:title",content:`${g} Terminal | Top Hyperliquid Wallets | Real-time Positions | Dextrabot`}),i.jsx("meta",{property:"og:description",content:`View real-time ${g} positions of top Hyperliquid traders wallet by wallet. Track entry prices, unrealized PnL, position sizes, and copy trade profitable Bitcoin strategies instantly.`}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:`https://app.dextrabot.com/terminal/${g}`})]})}),i.jsx("div",{className:"flex justify-center w-full min-h-screen px-1 pt-1 sm:px-3 sm:pt-3 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(N0n,{data:L,loading:Q,error:J,coin:g,setCoin:v,period:ie,periods:re,handlePeriodChange:G})})})]})},j0n="https://dextradata.nftinit.io/api/hyper/whale_stats/v2/",jh=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(2)}K`:`${n}$${r.toFixed(2)}`},tg=e=>e==null?"-":`${Number(e).toFixed(1)}%`,aF=e=>`calc(${e}%)`;function E0n({onData:e}){const[t,n]=m.useState(null);if(m.useEffect(()=>{let l=null;const c=()=>ds.get(j0n).then(d=>{var x,g,v,w;const f=(w=(v=(g=(x=d.data)==null?void 0:x.results)==null?void 0:g.other)==null?void 0:v.tracker)==null?void 0:w[0];if(f){n(f);const C=f.total_position;C!==l&&(l=C,e==null||e(f))}}).catch(d=>{console.error("fetch error",d)});c();const u=setInterval(c,3e4);return()=>clearInterval(u)},[]),!t)return i.jsx("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 space-y-6",children:[...Array(3)].map((l,c)=>i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"h-[32px] w-[160px] bg-[#202020] rounded-md animate-pulse"}),i.jsx("div",{className:"h-[24px] w-full max-w-[170px] bg-[#202020] rounded-md animate-pulse"}),i.jsx("div",{className:"h-[10px] w-[80%] bg-[#202020] rounded-md animate-pulse"}),i.jsx("div",{className:"h-[1px] w-full bg-[#262626]"})]},c))});const r=t.long.position_ratio,s=100-r,a=t.long.margin_ratio,o=100-a;return i.jsxs("div",{className:"font-inter w-full text-white space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("img",{src:kyt,alt:"Dextrabot - Whale Trades"}),i.jsx("h2",{className:"text-[16px] leading-[21px] tracking-[-0.32px] font-medium",children:"Overview"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit ml-[2px]",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#67FFBD]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#67FFBD]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]})]}),i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(pi,{content:"Total value of whale positions opened in the last 24 hours.",children:i.jsxs("div",{className:"flex items-center gap-[6px] w-fit",children:[i.jsx("span",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"Open Positions"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full",children:"LAST 24H"}),i.jsx("img",{src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:jh(t.total_position)}),i.jsxs("div",{className:"flex gap-1 h-[16px] w-full max-w-[170px]",children:[i.jsx("span",{className:"flex items-center justify-center bg-[#67FFBD] rounded-[4px] text-[#12450F] text-[10px] leading-[10px] font-semibold px-6",style:{width:aF(r)},children:tg(r)}),i.jsx("span",{className:"flex items-center justify-center bg-[#FF797C] rounded-[4px] text-[#5E2425] text-[10px] leading-[10px] font-semibold px-6",style:{width:aF(s)},children:tg(s)})]}),i.jsxs("div",{className:"flex items-center text-[10px] leading-[10px] font-medium gap-2",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"}),i.jsx("span",{children:"Long"}),i.jsx("span",{children:jh(t.long.position)}),i.jsxs("span",{className:"text-[#909090]",children:["(",tg(r),")"]})]}),i.jsx("span",{className:"h-[10px] w-px bg-[#262626]"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"}),i.jsx("span",{children:"Short"}),i.jsx("span",{children:jh(t.short.position)}),i.jsxs("span",{className:"text-[#909090]",children:["(",tg(s),")"]})]})]})]}),i.jsx("div",{className:"h-px w-full bg-[#262626]"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(pi,{content:"Total margin whales are currently using across all positions.",children:i.jsxs("div",{className:"flex items-center gap-[6px] mt-2 w-fit",children:[i.jsx("span",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"Whale Margin Usage"}),i.jsx("img",{className:"mt-[2px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsx("span",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:jh(t.total_margin)}),i.jsx(pi,{content:"(Total Margin / Total Perp. Equity) * 100",children:i.jsxs("span",{className:"text-[#929292] font-inter text-[20px] not-italic font-semibold leading-[21px] tracking-[-0.2px]",children:["(",tg(t.total_margin/t.total_perp_equity*100),")"]})}),t.long.margin>t.short.margin?i.jsx("span",{className:"bg-[rgba(103,255,189,0.16)] p-[2px] rounded-full",children:i.jsx(nse,{className:"w-4 h-4 text-[#67FFBD]"})}):i.jsx("span",{className:"bg-[rgba(255,121,124,0.16)] p-[2px] rounded-full",children:i.jsx(Bl,{className:"w-4 h-4 text-[#FF797C]"})})]}),i.jsxs("div",{className:"flex gap-1 h-[16px] w-full max-w-[170px]",children:[i.jsx("span",{className:"flex items-center justify-center bg-[#67FFBD] rounded-[4px] text-[#12450F] text-[10px] leading-[10px] font-semibold px-6",style:{width:aF(a)},children:tg(a)}),i.jsx("span",{className:"flex items-center justify-center bg-[#FF797C] rounded-[4px] text-[#5E2425] text-[10px] leading-[10px] font-semibold px-6",style:{width:aF(o)},children:tg(o)})]}),i.jsxs("div",{className:"flex items-center text-[10px] leading-[10px] font-medium gap-2",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"}),i.jsx("span",{children:"Long"}),i.jsx("span",{className:"text-[#909090]",children:jh(t.long.margin)}),i.jsxs("span",{children:["(",tg(a),")"]})]}),i.jsx("span",{className:"h-[10px] w-px bg-[#262626]"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"}),i.jsx("span",{children:"Short"}),i.jsx("span",{className:"text-[#909090]",children:jh(t.short.margin)}),i.jsxs("span",{children:["(",tg(o),")"]})]})]})]}),i.jsx("div",{className:"h-px w-full bg-[#262626]"}),i.jsxs("div",{className:"flex gap-16",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(pi,{content:"Whales’ unrealized profit and loss from open positions in the last 24 hours.",children:i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("div",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"PnL"}),i.jsx("img",{className:"mt-[2px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:jh(t.total_pnl)}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"})," Long"," ",jh(t.long.pnl)]})]}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"})," Short"," ",jh(t.short.pnl)]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(pi,{content:"Funding fees paid or received by whales based on their open positions.",children:i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("div",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"Funding"}),i.jsx("img",{className:"mt-[2px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:jh(t.total_funding)}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"})," Long"," ",jh(t.long.funding)]})]}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"})," Short"," ",jh(t.short.funding)]})]})]})]})]})}const Ju={1:{label:"Shrimp",emoji:"🦐",bg:"bg-[rgba(255,144,0,0.16)]",txt:"text-[#FF9000]"},2:{label:"Fish",emoji:"🐟",bg:"bg-[rgba(121,156,232,0.16)]",txt:"text-[#97B8FF]"},3:{label:"Dolphin",emoji:"🐬",bg:"bg-[rgba(103,255,245,0.16)]",txt:"text-[#4DDCDE]"},4:{label:"Apex Predator",emoji:"🦈",bg:"bg-[rgba(81,180,255,0.16)]",txt:"text-[#51B4FF]"},5:{label:"Small Whale",emoji:"🐋",bg:"bg-[rgba(255,121,173,0.16)]",txt:"text-[#FF79AD]"},6:{label:"Whale",emoji:"🐳",bg:"bg-[rgba(198,121,255,0.16)]",txt:"text-[#C679FF]"},7:{label:"Tidal Whale",emoji:"🌊",bg:"bg-[rgba(255,121,137,0.16)]",txt:"text-[#FF7989]"},8:{label:"Leviathan",emoji:"🐉",bg:"bg-[rgba(73,242,73,0.16)]",txt:"text-[#49F249]"}},H_=[{id:1,...Ju[1],description:"$0 – $250 — Low-value frequent trader"},{id:2,...Ju[2],description:"$250 – $10K — Small but active trader"},{id:3,...Ju[3],description:"$10K – $50K — Consistent mid-size trader"},{id:4,...Ju[4],description:"$50K – $100K — Aggressive high-leverage trader"},{id:5,...Ju[5],description:"$100K – $500K — Influential swing trader"},{id:6,...Ju[6],description:"$500K – $1M — Market-moving whale"},{id:7,...Ju[7],description:"$1M – $5M — Mega whale, highly impactful"},{id:8,...Ju[8],description:"≥ $5M — Rare leviathan with massive positions"}],jue=e=>{if(e==null)return Ju[6];const t=Number(e);if(!isNaN(t)&&Ju[t])return Ju[t];const n=Object.values(Ju).find(a=>String(a.label).toLowerCase()===String(e).toLowerCase());if(n)return n;const r=a=>String(a).replace(/[\s_]+/g,"").toLowerCase();return Object.values(Ju).find(a=>r(a.label)===r(e))||Ju[6]},_0n="https://dextradata.nftinit.io/api/hyper/trade/highVolumeTrades/",k0n=e=>{const t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`},hC=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(2)}K`:`${n}$${r.toFixed(2)}`},T0n=e=>e<250?1:e<1e4?2:e<5e4?3:e<1e5?4:e<5e5?5:e<1e6?6:e<5e6?7:8,WSe=e=>jue(T0n(e)),qSe=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(Date.now()),[o,l]=m.useState(""),c=m.useCallback(async(x=!1)=>{x&&r(!0);try{const g=await ds.post(_0n,{limit:1e3,offset:0});if(g.data.success){const v=g.data.data.filter(w=>{var C;return!((C=w==null?void 0:w.typeDetail)!=null&&C.includes("Top100Wallet"))});t(v),a(Date.now())}}finally{x&&r(!1)}},[]);m.useEffect(()=>{c(!0);const x=setInterval(c,3e4);return()=>clearInterval(x)},[c]);const u=m.useMemo(()=>o?e.filter(x=>{var v;if(!o)return!0;const g=WSe((x==null?void 0:x.global_account_value)??0);return o===((v=H_.find(w=>w.label===g.label))==null?void 0:v.id)}):e,[e,o]),d=[{key:"rank",label:"#",width:"45px",render:(x,g,v)=>i.jsx("span",{className:"text-[#9B9B9B]",children:v+1})},{key:"wallet",label:"Address",width:"235px",render:(x,g)=>{const v=(g==null?void 0:g.global_account_value)??0,w=WSe(v);return i.jsxs("div",{className:"flex items-center gap-1.5 text-[14px] tracking-[0.24px]",children:[i.jsx("span",{className:"text-[18px] leading-none",children:w.emoji}),i.jsxs("span",{className:"max-w-20 mr-2",children:[g.wallet.slice(0,5),"...",g.wallet.slice(-4)]}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ml-[10px] ${w.bg} ${w.txt}`,children:w.label})]})}},{key:"coin",label:"Symbol",sortable:!0,width:"90px",render:(x,g)=>i.jsxs("div",{className:"flex items-center gap-2 text-[14px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${g.coin}.svg`,onError:ra,className:"w-5 h-5"}),g.coin]})},{key:"activity",label:"Activity",width:"140px",render:(x,g)=>{var R,F,U,L;const v=(R=g==null?void 0:g.position_details)==null?void 0:R.direction,w=v==="Long",C=v==="Short",N=(L=(U=(F=g==null?void 0:g.position_details)==null?void 0:F.position)==null?void 0:U.leverage)==null?void 0:L.value,I=g.side==="Change Position"?w?"Short > Long":"Long > Short":v??"Position Close",P=v==="Long"||v==="Short";return i.jsxs("div",{className:"flex items-center gap-[10px]",children:[i.jsxs("div",{className:`inline-flex justify-center items-center gap-1 px-2 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${w?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":C?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[P&&i.jsx(Ts,{className:`w-3 h-3 ${w?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),I]}),N&&i.jsxs("div",{className:"inline-flex justify-center items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium text-[#67ffbd] bg-[rgba(103,255,189,0.16)]",children:[N,"X"]})]})}},{key:"current_trade_value",label:"Trade",width:"80px",sortable:!0,render:x=>hC(x)},{key:"position_value",label:"Position",width:"90px",sortable:!0,sortValue:x=>{var g,v;return Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.positionValue)},render:(x,g)=>{var v,w;return(w=(v=g==null?void 0:g.position_details)==null?void 0:v.position)!=null&&w.positionValue?hC(g.position_details.position.positionValue):"-"}},{key:"price",label:"Price",width:"80px",sortable:!0,sortValue:x=>{var g,v;return Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.entryPx)},render:(x,g)=>{var v,w;return(w=(v=g==null?void 0:g.position_details)==null?void 0:v.position)!=null&&w.entryPx?hC(g.position_details.position.entryPx):"-"}},{key:"side",label:"Side",width:"120px",sortable:!0,sortValue:x=>(x==null?void 0:x.side)||"",render:x=>i.jsx("div",{className:`h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-0.5 text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase ${x==="Increase"||x==="Change Position"?"text-[#67ffbd] bg-[#67ffbd]/20":x==="Decrease"||x==="Position Close"?"text-[#ff787b] bg-[#ff797c]/20":"text-white"}`,children:x||"-"})},{key:"position_details.position.size",label:"Size",sortable:!0,width:"110px",sortValue:x=>{var g,v;return Math.abs(Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.szi))||0},render:(x,g)=>{var N,I;const v=(I=(N=g==null?void 0:g.position_details)==null?void 0:N.position)==null?void 0:I.szi,w=v>0,C=w?"text-[#3DB380]":v<0?"text-[#FF797C]":"text-white";return i.jsxs("span",{className:`font-semibold ${C} inline-flex items-center`,children:[isNaN(v)?"-":hC(Math.abs(v)),!isNaN(v)&&i.jsx("img",{src:w?iE:aE,className:"ml-[6px] w-[9px] h-[8px]",alt:""})]})}},{key:"position_details.position.entryPx",label:"Entry",sortable:!0,sortValue:x=>{var g,v;return Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.entryPx)||0},width:"80px",render:(x,g)=>{var w,C;const v=(C=(w=g==null?void 0:g.position_details)==null?void 0:w.position)==null?void 0:C.entryPx;return v?`${hC(v)}`:"-"}},{key:"position_details.position.unrealizedPnl",label:"uPnL",sortable:!0,width:"100px",sortValue:x=>{var g,v;return Math.abs(Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.unrealizedPnl))||0},render:(x,g)=>{var N,I;const v=parseFloat((I=(N=g==null?void 0:g.position_details)==null?void 0:N.position)==null?void 0:I.unrealizedPnl),w=v>0,C=w?"text-[#3DB380]":v<0?"text-[#FF797C]":"text-white";return i.jsxs("span",{className:`font-semibold ${C} inline-flex items-center`,children:[isNaN(v)?"-":`${hC(Math.abs(v))}`,!isNaN(v)&&i.jsx("img",{src:w?iE:aE,className:"ml-[6px] w-[9px] h-[8px]",alt:""})]})}},{key:"flags",label:i.jsx(pi,{content:"Quick view of this whale’s recent trading performance.",children:i.jsx("span",{children:"Last 5 T."})}),width:"90px",render:(x,g)=>{const v=g.last5Trade??[];return i.jsx("div",{className:"inline-flex h-[18px] px-[2px] py-[4px] justify-center items-center rounded-[6px] overflow-visible",children:v.slice(0,5).map((w,C)=>{let N="",I=null;return w===null?(N="bg-[#747474]",I=u8e):w===!0?(N="bg-[#67FFBD]",I=c8e):(N="bg-[#FF9C9C]",I=d8e),i.jsx("div",{className:`relative z[${C}] w-[18px] h-[18px] flex-shrink-0 flex items-center justify-center rounded-full border-2 border-[#101010] ${N} ${C!==0?"-ml-[6px]":""}`,children:i.jsx(I,{className:"w-3 h-3 text-black"})},C)})})}},{key:"insert_date",label:"Time",width:"80px",sortable:!0,sortValue:x=>{var g;return(g=x.insert_date)==null?void 0:g.$date},render:(x,g)=>{var v;return i.jsx("div",{className:"text-gray-400",children:k0n(new Date((v=g.insert_date)==null?void 0:v.$date).getTime())})}}],f=(x,g)=>{var R;const w=((R=x==null?void 0:x.position_details)==null?void 0:R.direction)==="Long",C=x.current_trade_value>=5e6,N=C?w?"before:bg-[#67FFBD] before:shadow-[0_0_12px_#67FFBD] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-[#FF797C] before:shadow-[0_0_12px_#FF797C] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-transparent";return`
relative before:content-[''] before:absolute before:left-[8px] before:w-[2px] before:rounded-full
${C?w?"bg-[rgba(103,255,189,0.16)]":"bg-[rgba(255,131,117,0.16)]":g%2===0?"bg-[#191919]":"bg-transparent"} ${N} ${C?w?"hover:bg-[rgba(14,70,53,0.32)]":"hover:bg-[rgba(74,16,18,0.32)]":"hover:bg-[rgba(39,39,39,0.32)]"} cursor-pointer mb-4 py-5 transition-colors duration-300
`};return n?i.jsx("div",{className:"rounded-[16px] bg-[#101010] p-4 space-y-4 mt-6",children:i.jsx("div",{className:"space-y-3",children:[...Array(32)].map((x,g)=>i.jsx("div",{className:"h-[42px] w-full bg-[#202020] rounded-md animate-pulse"},g))})}):i.jsx(i.Fragment,{children:i.jsxs("div",{className:"font-manrope font-medium relative p-1 mt-4 sm:w-[1440px] sm:mx-auto",children:[i.jsxs("div",{className:"flex-col items-center space-y-2 sm:pl-[60px]",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx(pi,{content:"Displays real-time executed trades from top whales.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white text-[16px] leading-[21px] font-medium tracking-[-0.32px] pl-[5px] font-inter",children:"Hot Whale Trades"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full [#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]}),i.jsx("img",{className:"-ml-[4px]",src:E0,alt:"Dextrabot - Hyperliquid Whale Trades"})]})})}),i.jsx("div",{className:"flex items-center",children:i.jsx("div",{className:"inline-flex items-center h-8 px-1.5 py-[18px] rounded-[8px] border border-[#262626] flex-shrink-0 gap-[12px]",children:i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsx("div",{onClick:()=>l(""),className:`flex items-center justify-center h-7 w-7 px-4 rounded-[8px] text-white text-[14px] font-inter leading-[16px] cursor-pointer transition-colors ${o===""?"bg-[#262626]":"hover:bg-[#262626]"}`,children:"All"}),H_.map(({id:x,label:g,emoji:v,description:w})=>{const C=o===g;return i.jsx("div",{onClick:()=>l(C?"":x),className:`h-7 w-7 flex items-center justify-center rounded-[8px] text-[18px] transition-colors cursor-pointer ${C?"bg-[#262626]":"hover:bg-[#262626]"}`,children:i.jsx(pi,{content:w,children:v})},x)})]})})})]}),i.jsx("div",{className:"pt-2 bg-[#101010] rounded-[16px]",children:i.jsx(Ru,{data:u,columns:d,tableClassName:"text-[14px] flex justify-center",theadClassName:"text-[13px] font-inter !text-[#9B9B9B] bg-transparent font-normal",tbodyClassName:"text-[14px]",cellClassName:"text-[14px] font-medium",rowClassName:f,rowHeight:42,listHeight:window.screen.height,rowKey:x=>{var g,v;return((g=x._id)==null?void 0:g.$oid)||((v=x.insert_date)==null?void 0:v.$date)},onVisibleRows:()=>{},onRowClick:x=>window.open(`/wallet-details/${x.wallet}`,"_blank")})})]})})},o8=e=>{let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return Math.abs(t)},YHe=(e,t)=>Math.floor(e/Math.pow(10,t)%10),pre=(e,t)=>!(YHe(e,t)%2),Nu=(e,t,n)=>{const r=e%t;return n&&YHe(e,n)%2===0?-r:r},Z3=(e,t,n)=>t[e%n],I0n=e=>{e.slice(0,1)==="#"&&(e=e.slice(1));const t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2,2),16),r=parseInt(e.substr(4,2),16);return(t*299+n*587+r*114)/1e3>=128?"#000000":"#FFFFFF"},P0n=4,no=80;function F0n(e,t){const n=o8(e),r=t&&t.length;return Array.from({length:P0n},(s,a)=>({color:Z3(n+a,t,r),translateX:Nu(n*(a+1),no/2-(a+17),1),translateY:Nu(n*(a+1),no/2-(a+17),2),rotate:Nu(n*(a+1),360),isSquare:pre(n,2)}))}const GSe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=F0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+no+" "+no,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:no,height:no,children:i.jsx("rect",{width:no,height:no,rx:r?void 0:no*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:no,height:no,fill:o[0].color}),i.jsx("rect",{x:(no-60)/2,y:(no-20)/2,width:no,height:o[1].isSquare?no:no/8,fill:o[1].color,transform:"translate("+o[1].translateX+" "+o[1].translateY+") rotate("+o[1].rotate+" "+no/2+" "+no/2+")"}),i.jsx("circle",{cx:no/2,cy:no/2,fill:o[2].color,r:no/5,transform:"translate("+o[2].translateX+" "+o[2].translateY+")"}),i.jsx("line",{x1:0,y1:no/2,x2:no,y2:no/2,strokeWidth:2,stroke:o[3].color,transform:"translate("+o[3].translateX+" "+o[3].translateY+") rotate("+o[3].rotate+" "+no/2+" "+no/2+")"})]})]})},yv=90,O0n=5;function M0n(e,t){const n=o8(e),r=t&&t.length,s=Array.from({length:O0n},(o,l)=>Z3(n+l,t,r)),a=[];return a[0]=s[0],a[1]=s[1],a[2]=s[1],a[3]=s[2],a[4]=s[2],a[5]=s[3],a[6]=s[3],a[7]=s[0],a[8]=s[4],a}const R0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=M0n(e,t),l=Ne.useId();return i.jsxs("svg",{viewBox:"0 0 "+yv+" "+yv,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:yv,height:yv,children:i.jsx("rect",{width:yv,height:yv,rx:r?void 0:yv*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("path",{d:"M0 0h90v45H0z",fill:o[0]}),i.jsx("path",{d:"M0 45h90v45H0z",fill:o[1]}),i.jsx("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:o[2]}),i.jsx("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:o[3]}),i.jsx("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:o[4]}),i.jsx("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:o[5]}),i.jsx("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:o[6]}),i.jsx("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:o[7]}),i.jsx("circle",{cx:45,cy:45,r:23,fill:o[8]})]})]})},L0n=64,vv=80;function D0n(e,t){const n=o8(e),r=t&&t.length;return Array.from({length:L0n},(s,a)=>Z3(n%(a+1),t,r))}const B0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=D0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+vv+" "+vv,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,"mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:vv,height:vv,children:i.jsx("rect",{width:vv,height:vv,rx:r?void 0:vv*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:10,height:10,fill:o[0]}),i.jsx("rect",{x:20,width:10,height:10,fill:o[1]}),i.jsx("rect",{x:40,width:10,height:10,fill:o[2]}),i.jsx("rect",{x:60,width:10,height:10,fill:o[3]}),i.jsx("rect",{x:10,width:10,height:10,fill:o[4]}),i.jsx("rect",{x:30,width:10,height:10,fill:o[5]}),i.jsx("rect",{x:50,width:10,height:10,fill:o[6]}),i.jsx("rect",{x:70,width:10,height:10,fill:o[7]}),i.jsx("rect",{y:10,width:10,height:10,fill:o[8]}),i.jsx("rect",{y:20,width:10,height:10,fill:o[9]}),i.jsx("rect",{y:30,width:10,height:10,fill:o[10]}),i.jsx("rect",{y:40,width:10,height:10,fill:o[11]}),i.jsx("rect",{y:50,width:10,height:10,fill:o[12]}),i.jsx("rect",{y:60,width:10,height:10,fill:o[13]}),i.jsx("rect",{y:70,width:10,height:10,fill:o[14]}),i.jsx("rect",{x:20,y:10,width:10,height:10,fill:o[15]}),i.jsx("rect",{x:20,y:20,width:10,height:10,fill:o[16]}),i.jsx("rect",{x:20,y:30,width:10,height:10,fill:o[17]}),i.jsx("rect",{x:20,y:40,width:10,height:10,fill:o[18]}),i.jsx("rect",{x:20,y:50,width:10,height:10,fill:o[19]}),i.jsx("rect",{x:20,y:60,width:10,height:10,fill:o[20]}),i.jsx("rect",{x:20,y:70,width:10,height:10,fill:o[21]}),i.jsx("rect",{x:40,y:10,width:10,height:10,fill:o[22]}),i.jsx("rect",{x:40,y:20,width:10,height:10,fill:o[23]}),i.jsx("rect",{x:40,y:30,width:10,height:10,fill:o[24]}),i.jsx("rect",{x:40,y:40,width:10,height:10,fill:o[25]}),i.jsx("rect",{x:40,y:50,width:10,height:10,fill:o[26]}),i.jsx("rect",{x:40,y:60,width:10,height:10,fill:o[27]}),i.jsx("rect",{x:40,y:70,width:10,height:10,fill:o[28]}),i.jsx("rect",{x:60,y:10,width:10,height:10,fill:o[29]}),i.jsx("rect",{x:60,y:20,width:10,height:10,fill:o[30]}),i.jsx("rect",{x:60,y:30,width:10,height:10,fill:o[31]}),i.jsx("rect",{x:60,y:40,width:10,height:10,fill:o[32]}),i.jsx("rect",{x:60,y:50,width:10,height:10,fill:o[33]}),i.jsx("rect",{x:60,y:60,width:10,height:10,fill:o[34]}),i.jsx("rect",{x:60,y:70,width:10,height:10,fill:o[35]}),i.jsx("rect",{x:10,y:10,width:10,height:10,fill:o[36]}),i.jsx("rect",{x:10,y:20,width:10,height:10,fill:o[37]}),i.jsx("rect",{x:10,y:30,width:10,height:10,fill:o[38]}),i.jsx("rect",{x:10,y:40,width:10,height:10,fill:o[39]}),i.jsx("rect",{x:10,y:50,width:10,height:10,fill:o[40]}),i.jsx("rect",{x:10,y:60,width:10,height:10,fill:o[41]}),i.jsx("rect",{x:10,y:70,width:10,height:10,fill:o[42]}),i.jsx("rect",{x:30,y:10,width:10,height:10,fill:o[43]}),i.jsx("rect",{x:30,y:20,width:10,height:10,fill:o[44]}),i.jsx("rect",{x:30,y:30,width:10,height:10,fill:o[45]}),i.jsx("rect",{x:30,y:40,width:10,height:10,fill:o[46]}),i.jsx("rect",{x:30,y:50,width:10,height:10,fill:o[47]}),i.jsx("rect",{x:30,y:60,width:10,height:10,fill:o[48]}),i.jsx("rect",{x:30,y:70,width:10,height:10,fill:o[49]}),i.jsx("rect",{x:50,y:10,width:10,height:10,fill:o[50]}),i.jsx("rect",{x:50,y:20,width:10,height:10,fill:o[51]}),i.jsx("rect",{x:50,y:30,width:10,height:10,fill:o[52]}),i.jsx("rect",{x:50,y:40,width:10,height:10,fill:o[53]}),i.jsx("rect",{x:50,y:50,width:10,height:10,fill:o[54]}),i.jsx("rect",{x:50,y:60,width:10,height:10,fill:o[55]}),i.jsx("rect",{x:50,y:70,width:10,height:10,fill:o[56]}),i.jsx("rect",{x:70,y:10,width:10,height:10,fill:o[57]}),i.jsx("rect",{x:70,y:20,width:10,height:10,fill:o[58]}),i.jsx("rect",{x:70,y:30,width:10,height:10,fill:o[59]}),i.jsx("rect",{x:70,y:40,width:10,height:10,fill:o[60]}),i.jsx("rect",{x:70,y:50,width:10,height:10,fill:o[61]}),i.jsx("rect",{x:70,y:60,width:10,height:10,fill:o[62]}),i.jsx("rect",{x:70,y:70,width:10,height:10,fill:o[63]})]})]})},Xo=36;function $0n(e,t){const n=o8(e),r=t&&t.length,s=Z3(n,t,r),a=Nu(n,10,1),o=a<5?a+Xo/9:a,l=Nu(n,10,2),c=l<5?l+Xo/9:l;return{wrapperColor:s,faceColor:I0n(s),backgroundColor:Z3(n+13,t,r),wrapperTranslateX:o,wrapperTranslateY:c,wrapperRotate:Nu(n,360),wrapperScale:1+Nu(n,Xo/12)/10,isMouthOpen:pre(n,2),isCircle:pre(n,1),eyeSpread:Nu(n,5),mouthSpread:Nu(n,3),faceRotate:Nu(n,10,3),faceTranslateX:o>Xo/6?o/2:Nu(n,8,1),faceTranslateY:c>Xo/6?c/2:Nu(n,7,2)}}const KSe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=$0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+Xo+" "+Xo,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:Xo,height:Xo,children:i.jsx("rect",{width:Xo,height:Xo,rx:r?void 0:Xo*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:Xo,height:Xo,fill:o.backgroundColor}),i.jsx("rect",{x:"0",y:"0",width:Xo,height:Xo,transform:"translate("+o.wrapperTranslateX+" "+o.wrapperTranslateY+") rotate("+o.wrapperRotate+" "+Xo/2+" "+Xo/2+") scale("+o.wrapperScale+")",fill:o.wrapperColor,rx:o.isCircle?Xo:Xo/6}),i.jsxs("g",{transform:"translate("+o.faceTranslateX+" "+o.faceTranslateY+") rotate("+o.faceRotate+" "+Xo/2+" "+Xo/2+")",children:[o.isMouthOpen?i.jsx("path",{d:"M15 "+(19+o.mouthSpread)+"c2 1 4 1 6 0",stroke:o.faceColor,fill:"none",strokeLinecap:"round"}):i.jsx("path",{d:"M13,"+(19+o.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:o.faceColor}),i.jsx("rect",{x:14-o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:o.faceColor}),i.jsx("rect",{x:20+o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:o.faceColor})]})]})]})},U0n=4,Rd=80;function z0n(e,t){const n=o8(e),r=t&&t.length;return Array.from({length:U0n},(s,a)=>Z3(n+a,t,r))}const H0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=z0n(e,t),l=e.replace(/\s/g,""),c=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+Rd+" "+Rd,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:c,maskUnits:"userSpaceOnUse",x:0,y:0,width:Rd,height:Rd,children:i.jsx("rect",{width:Rd,height:Rd,rx:r?void 0:Rd*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${c})`,children:[i.jsx("path",{fill:"url(#gradient_paint0_linear_"+l+")",d:"M0 0h80v40H0z"}),i.jsx("path",{fill:"url(#gradient_paint1_linear_"+l+")",d:"M0 40h80v40H0z"})]}),i.jsxs("defs",{children:[i.jsxs("linearGradient",{id:"gradient_paint0_linear_"+l,x1:Rd/2,y1:0,x2:Rd/2,y2:Rd/2,gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:o[0]}),i.jsx("stop",{offset:1,stopColor:o[1]})]}),i.jsxs("linearGradient",{id:"gradient_paint1_linear_"+l,x1:Rd/2,y1:Rd/2,x2:Rd/2,y2:Rd,gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:o[2]}),i.jsx("stop",{offset:1,stopColor:o[3]})]})]})]})},V0n=3,gu=80;function W0n(e,t){const n=o8(e),r=t&&t.length;return Array.from({length:V0n},(s,a)=>({color:Z3(n+a,t,r),translateX:Nu(n*(a+1),gu/10,1),translateY:Nu(n*(a+1),gu/10,2),scale:1.2+Nu(n*(a+1),gu/20)/10,rotate:Nu(n*(a+1),360,1)}))}const XHe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=W0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+gu+" "+gu,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:gu,height:gu,children:i.jsx("rect",{width:gu,height:gu,rx:r?void 0:gu*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:gu,height:gu,fill:o[0].color}),i.jsx("path",{filter:`url(#filter_${l})`,d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:o[1].color,transform:"translate("+o[1].translateX+" "+o[1].translateY+") rotate("+o[1].rotate+" "+gu/2+" "+gu/2+") scale("+o[2].scale+")"}),i.jsx("path",{filter:`url(#filter_${l})`,style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:o[2].color,transform:"translate("+o[2].translateX+" "+o[2].translateY+") rotate("+o[2].rotate+" "+gu/2+" "+gu/2+") scale("+o[2].scale+")"})]}),i.jsx("defs",{children:i.jsxs("filter",{id:`filter_${l}`,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),i.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"})]})})]})},q0n={pixel:B0n,bauhaus:GSe,ring:R0n,beam:KSe,sunset:H0n,marble:XHe,geometric:KSe,abstract:GSe},QHe=({variant:e="marble",colors:t=["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:n="Clara Barton",title:r=!1,size:s,square:a=!1,...o})=>{const l=q0n[e]||XHe;return i.jsx(l,{colors:t,name:n,title:r,size:s,square:a,...o})},oF="rgba(155,155,155,0.16)";function G0n({row:e}){var f,x,g,v,w,C,N,I,P,R,F,U;const t=(f=e==null?void 0:e.position_details)==null?void 0:f.direction,n=(v=(g=(x=e==null?void 0:e.position_details)==null?void 0:x.position)==null?void 0:g.leverage)==null?void 0:v.value,r=t==="Long",s=t==="Short",a=(C=(w=e==null?void 0:e.position_details)==null?void 0:w.position)==null?void 0:C.szi,o=(I=(N=e==null?void 0:e.position_details)==null?void 0:N.position)==null?void 0:I.entryPx,l=parseFloat((R=(P=e==null?void 0:e.position_details)==null?void 0:P.position)==null?void 0:R.unrealizedPnl),c=e.side==="Change Position"?r?"Short > Long":"Long > Short":t??"Position Close",u=t==="Long"||t==="Short",d=({label:L,value:z,extraClass:Q=""})=>i.jsxs("div",{className:"flex flex-col flex-1 px-2",children:[i.jsx("span",{className:"text-white/64 text-[12px] font-medium leading-[13px] tracking-[0.24px]",children:L}),i.jsx("span",{className:`text-[12px] font-semibold leading-[13px] tracking-[0.24px] ${Q}`,children:z})]});return i.jsxs("div",{className:"z-[80] w-[362px] h-[204px] rounded-[16px] bg-white/10 backdrop-blur-[43px] p-3 flex flex-col gap-3",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(QHe,{size:20,name:e.wallet}),i.jsxs("span",{className:"text-white font-manrope text-[14px] font-semibold leading-[13px] tracking-[0.28px]",children:[e.wallet.slice(0,6),"...",e.wallet.slice(-4)]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${e.coin}.svg`,onError:ra,className:"w-8 h-8"}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-white text-[14px] font-semibold leading-[13px] tracking-[0.28px]",children:e.coin}),i.jsx("span",{className:"text-white/40 text-[12px] font-medium leading-[13px] tracking-[0.24px]",children:e.coin_name||""})]}),i.jsxs("div",{className:"ml-[10px] flex gap-[8px]",children:[i.jsxs("div",{className:`inline-flex items-center gap-1 px-1 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${r?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":s?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[u&&i.jsx(Ts,{className:`w-3 h-3 ${r?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),c]}),n&&i.jsxs("div",{className:"inline-flex items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium text-[#67ffbd] bg-[rgba(103,255,189,0.16)]",children:[n,"X"]})]})]}),i.jsx("div",{style:{background:oF},className:"h-px w-full"}),i.jsxs("div",{className:"flex divide-x",style:{divideColor:oF},children:[i.jsx(d,{label:"Trade Value",value:`$${Cr(e.current_trade_value)}`,extraClass:"text-[#67FFBD]"}),i.jsx(d,{label:"Side",value:e.side}),i.jsx(d,{label:"Entry",value:isNaN(o)?"-":i.jsx("span",{className:"inline-flex items-center",children:Cr(Math.abs(o))})})]}),i.jsx("div",{style:{background:oF},className:"h-px w-full"}),i.jsxs("div",{className:"flex divide-x",style:{divideColor:oF},children:[i.jsx(d,{label:"Size",value:isNaN(a)?"-":Cr(Math.abs(a))}),i.jsx(d,{label:"Entry Price",value:`$${Cr(((U=(F=e==null?void 0:e.position_details)==null?void 0:F.position)==null?void 0:U.entryPx)||0)}`}),i.jsx(d,{label:"uPnL",value:isNaN(l)?"-":i.jsxs("span",{className:`inline-flex items-center ${l>0?"text-[#67FFBD]":l<0?"text-[#FF797C]":"text-white"}`,children:[`${l<0?"-":""}$${Cr(Math.abs(l))}`,i.jsx("img",{src:l>0?iE:aE,className:"ml-[6px] w-[9px] h-[8px]"})]})})]})]})}function K0n(){const[e,t]=m.useState(!1);return m.useEffect(()=>{const n=()=>t(window.innerWidth<640);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const Y0n="https://dextradata.nftinit.io/api/hyper/trade/highVolumeTrades/",YSe=e=>{const t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`},WX=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(2)}K`:`${n}$${r.toFixed(2)}`},X0n=e=>e<250?1:e<1e4?2:e<5e4?3:e<1e5?4:e<5e5?5:e<1e6?6:e<5e6?7:8,XSe=e=>jue(X0n(e)),Q0n=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(!1),[o,l]=m.useState(Date.now()),[c,u]=m.useState(""),d=K0n(),f=m.useCallback(async(C=!1)=>{C&&r(!0);try{const N=await ds.post(Y0n,{limit:1e3,offset:0});if(N.data.success){const I=N.data.data.filter(P=>{var R;return!((R=P==null?void 0:P.typeDetail)!=null&&R.includes("Top100Wallet"))});t(I),l(Date.now())}}finally{C&&r(!1)}},[]);m.useEffect(()=>{f(!0);const C=setInterval(f,3e4);return()=>clearInterval(C)},[f]);const x=m.useMemo(()=>c?e.filter(C=>{var I;if(!c)return!0;const N=XSe((C==null?void 0:C.global_account_value)??0);return c===((I=H_.find(P=>P.label===N.label))==null?void 0:I.id)}):e,[e,c]),g=[{key:"wallet",label:"Address",width:"235px",render:(C,N)=>{const I=(N==null?void 0:N.global_account_value)??0,P=XSe(I);return i.jsx(pi,{content:i.jsx(G0n,{row:N}),children:i.jsxs("div",{className:"flex items-center gap-1.5 text-[14px] tracking-[0.24px] cursor-pointer",children:[i.jsx("span",{className:"text-[18px] leading-none",children:P.emoji}),i.jsxs("span",{className:"max-w-20 mr-2",children:[N.wallet.slice(0,5),"...",N.wallet.slice(-4)]}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ml-[10px] ${P.bg} ${P.txt}`,children:P.label})]})})}},{key:"coin",label:"Symbol",width:"114px",sortable:!0,render:(C,N)=>i.jsxs("div",{className:"flex items-center gap-2 text-[14px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${N.coin}.svg`,onError:ra,className:"w-5 h-5"}),N.coin]})},{key:"activity",label:"Activity",width:"130px",render:(C,N)=>{var z,Q,ne,J;const I=(z=N==null?void 0:N.position_details)==null?void 0:z.direction,P=I==="Long",R=I==="Short",F=(J=(ne=(Q=N==null?void 0:N.position_details)==null?void 0:Q.position)==null?void 0:ne.leverage)==null?void 0:J.value,U=N.side==="Change Position"?P?"Short > Long":"Long > Short":I??"Position Close",L=I==="Long"||I==="Short";return i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("div",{className:`inline-flex justify-center items-center gap-1 px-2 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${P?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":R?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[L&&i.jsx(Ts,{className:`w-3 h-3 ${P?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),U]}),F&&i.jsxs("div",{className:`inline-flex justify-center items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium
${P?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":R?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[F,"X"]})]})}},{key:"current_trade_value",label:"Trade",width:"70px",sortable:!0,render:C=>WX(C)},{key:"position_value",label:"Position",sortable:!0,width:"85px",sortValue:C=>{var N,I;return Number((I=(N=C==null?void 0:C.position_details)==null?void 0:N.position)==null?void 0:I.positionValue)},render:(C,N)=>{var I,P;return(P=(I=N==null?void 0:N.position_details)==null?void 0:I.position)!=null&&P.positionValue?WX(N.position_details.position.positionValue):"-"}},{key:"price",label:"Price",width:"80px",sortable:!0,sortValue:C=>{var N,I;return Number((I=(N=C==null?void 0:C.position_details)==null?void 0:N.position)==null?void 0:I.entryPx)},render:(C,N)=>{var I,P;return(P=(I=N==null?void 0:N.position_details)==null?void 0:I.position)!=null&&P.entryPx?WX(N.position_details.position.entryPx):"-"}},{key:"flags",label:i.jsx(pi,{content:"Quick view of this whale’s recent trading performance.",children:i.jsx("span",{children:"Last 5 T."})}),width:"90px",render:(C,N)=>{const I=N.last5Trade??[];return i.jsx("div",{className:"inline-flex h-[18px] px-[2px] py-[4px] justify-center items-center rounded-[6px] overflow-visible",children:I.slice(0,5).map((P,R)=>{let F="",U=null;return P===null?(F="bg-[#747474]",U=u8e):P===!0?(F="bg-[#67FFBD]",U=c8e):(F="bg-[#FF9C9C]",U=d8e),i.jsx("div",{className:`relative z[${R}] w-[18px] h-[18px] flex-shrink-0 flex items-center justify-center rounded-full border-2 border-[#101010] ${F} ${R!==0?"-ml-[6px]":""}`,children:i.jsx(U,{className:"w-3 h-3 text-black"})},R)})})}},{key:"insert_date",label:"Time",sortable:!0,width:"80px",sortValue:C=>{var N;return(N=C.insert_date)==null?void 0:N.$date},render:(C,N)=>{var I;return i.jsx("div",{className:"text-gray-400",children:YSe(new Date((I=N.insert_date)==null?void 0:I.$date).getTime())})}}],v=m.useMemo(()=>d?g.slice(1):g,[g,d]),w=(C,N)=>{var z;const P=((z=C==null?void 0:C.position_details)==null?void 0:z.direction)==="Long",R=C.current_trade_value>=5e6,F=R?P?"before:bg-[#67FFBD] before:shadow-[0_0_12px_#67FFBD] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-[#FF797C] before:shadow-[0_0_12px_#FF797C] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-transparent";return`
relative before:content-[''] before:absolute before:left-[8px] before:w-[2px] before:rounded-full
${R?P?"bg-[rgba(103,255,189,0.16)]":"bg-[rgba(255,131,117,0.16)]":N%2===0?"bg-[#191919]":"bg-transparent"} ${F} ${R?P?"hover:bg-[rgba(14,70,53,0.32)]":"hover:bg-[rgba(74,16,18,0.32)]":"hover:bg-[rgba(39,39,39,0.32)]"} cursor-pointer mb-4 py-5 transition-colors duration-300
`};return n?i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 space-y-4",children:[i.jsx("div",{className:"flex justify-end",children:i.jsx("div",{className:"h-8 w-24 bg-[#202020] rounded-[8px] animate-pulse"})}),i.jsx("div",{className:"space-y-3",children:[...Array(7)].map((C,N)=>i.jsx("div",{className:"h-[34px] w-full bg-[#202020] rounded-md animate-pulse"},N))})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"w-full font-manrope font-medium relative mt-1",children:[i.jsxs("div",{className:"flex items-center justify-between pb-2",children:[i.jsx(pi,{content:"Real-time view of whales’ largest open positions.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white text-[16px] leading-[21px] font-medium tracking-[-0.32px] pl-[5px] font-inter",children:"Hot Whale Trades"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]}),i.jsx("img",{className:"-ml-[4px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("span",{className:"text-[#929292] text-[12px] font-medium",children:["Last updated ",YSe(o)]})]}),i.jsxs("div",{className:"laser-frame",children:[i.jsx("span",{className:"laser-beam"}),i.jsxs("div",{className:"pt-3 pl-3 pr-3 border border-[#1E1E1E] bg-[#101010] rounded-[16px]",children:[i.jsxs("div",{className:"w-full flex items-center justify-between mb-3",children:[i.jsx("div",{className:"flex items-center gap-[12px]",children:i.jsx("div",{className:"sm:w-auto w-[260px] overflow-x-auto whitespace-nowrap flex items-center gap-[12px] scrollbar-thin scrollbar-thumb-[#444] scrollbar-track-transparent",children:i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsx("div",{onClick:()=>u(""),className:`flex items-center justify-center h-7 w-7 px-4 rounded-[8px] text-white text-[14px] font-inter leading-[16px] cursor-pointer transition-colors ${c===""?"bg-[#262626]":"hover:bg-[#262626]"}`,children:"All"}),H_.map(({id:C,label:N,emoji:I,description:P})=>{const R=c===C;return i.jsx("div",{onClick:()=>u(R?"":C),className:`h-7 w-7 flex items-center justify-center rounded-[8px] text-[18px] transition-colors cursor-pointer ${R?"bg-[#262626]":"hover:bg-[#262626]"}`,children:i.jsx(pi,{content:P,children:I})},C)})]})})}),i.jsxs("div",{className:"flex items-center justify-center w-12 sm:w-40 font-medium text-[#929292] text-[14px] leading-[18px] gap-2 px-4 py-2 cursor-pointer bg-[#262626] rounded-[8px] hover:scale-105 hover:bg-[#585858] hover:text-white transition-all",onClick:()=>a(!0),children:[i.jsx("span",{className:"hidden sm:inline",children:"View Full Activity"}),i.jsx("img",{src:Tyt,alt:"Expand",className:"w-5 h-5 sm:hidden"})]})]}),x.length===0?i.jsx("div",{className:"h-[312px] flex items-center justify-center text-[#9B9B9B] text-sm",children:"No data available for this filter."}):i.jsx(Ru,{data:x,columns:v,tableClassName:"text-[14px]",theadClassName:"text-[13px] font-inter !text-[#9B9B9B] bg-transparent font-normal",tbodyClassName:"text-[14px]",cellClassName:"text-[14px] text-right font-medium",rowClassName:w,rowHeight:42,listHeight:285,rowKey:C=>{var N,I;return((N=C._id)==null?void 0:N.$oid)||((I=C.insert_date)==null?void 0:I.$date)},onVisibleRows:()=>{},onRowClick:C=>window.open(`/wallet-details/${C.wallet}`,"_blank")})]})]})]}),s&&i.jsxs(up,{isOpen:s,onClose:()=>a(!1),fullscreen:d,children:[i.jsx("div",{className:"hidden sm:flex w-[95vw] max-h-[95vh] bg-[#101010] rounded-lg flex-col",children:i.jsx("div",{className:"px-4 py-2 overflow-x-auto",children:i.jsx("div",{className:"min-w-[1000px]",children:i.jsx(qSe,{})})})}),i.jsx("div",{className:" w-screen h-screen bg-[#101010] flex flex-col overflow-x-auto overflow-y-auto z-[9999]",children:i.jsx(qSe,{})})]})]})};function li(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function QSe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gU(...e){return t=>{let n=!1;const r=e.map(s=>{const a=QSe(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():QSe(e[s],null)}}}}function au(...e){return m.useCallback(gU(...e),e)}function E5(e,t=[]){let n=[];function r(a,o){const l=m.createContext(o),c=n.length;n=[...n,o];const u=f=>{var N;const{scope:x,children:g,...v}=f,w=((N=x==null?void 0:x[e])==null?void 0:N[c])||l,C=m.useMemo(()=>v,Object.values(v));return i.jsx(w.Provider,{value:C,children:g})};u.displayName=a+"Provider";function d(f,x){var w;const g=((w=x==null?void 0:x[e])==null?void 0:w[c])||l,v=m.useContext(g);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const s=()=>{const a=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,Z0n(s,...t)]}function Z0n(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Zy=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},J0n=Iy[" useInsertionEffect ".trim().toString()]||Zy;function bU({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,o]=exn({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}const u=m.useCallback(d=>{var f;if(l){const x=txn(d)?d(e):d;x!==e&&((f=o.current)==null||f.call(o,x))}else a(d)},[l,e,a,o]);return[c,u]}function exn({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),a=m.useRef(t);return J0n(()=>{a.current=t},[t]),m.useEffect(()=>{var o;s.current!==n&&((o=a.current)==null||o.call(a,n),s.current=n)},[n,s]),[n,r,a]}function txn(e){return typeof e=="function"}function V_(e){const t=nxn(e),n=m.forwardRef((r,s)=>{const{children:a,...o}=r,l=m.Children.toArray(a),c=l.find(sxn);if(c){const u=c.props.children,d=l.map(f=>f===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...o,ref:s,children:m.isValidElement(u)?m.cloneElement(u,void 0,d):null})}return i.jsx(t,{...o,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function nxn(e){const t=m.forwardRef((n,r)=>{const{children:s,...a}=n;if(m.isValidElement(s)){const o=axn(s),l=ixn(a,s.props);return s.type!==m.Fragment&&(l.ref=r?gU(r,o):o),m.cloneElement(s,l)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rxn=Symbol("radix.slottable");function sxn(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rxn}function ixn(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function axn(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oxn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lc=oxn.reduce((e,t)=>{const n=V_(`Primitive.${t}`),r=m.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ZHe(e,t){e&&Na.flushSync(()=>e.dispatchEvent(t))}function JHe(e){const t=e+"CollectionProvider",[n,r]=E5(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:C,children:N}=w,I=Ne.useRef(null),P=Ne.useRef(new Map).current;return i.jsx(s,{scope:C,itemMap:P,collectionRef:I,children:N})};o.displayName=t;const l=e+"CollectionSlot",c=V_(l),u=Ne.forwardRef((w,C)=>{const{scope:N,children:I}=w,P=a(l,N),R=au(C,P.collectionRef);return i.jsx(c,{ref:R,children:I})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",x=V_(d),g=Ne.forwardRef((w,C)=>{const{scope:N,children:I,...P}=w,R=Ne.useRef(null),F=au(C,R),U=a(d,N);return Ne.useEffect(()=>(U.itemMap.set(R,{ref:R,...P}),()=>void U.itemMap.delete(R))),i.jsx(x,{[f]:"",ref:F,children:I})});g.displayName=d;function v(w){const C=a(e+"CollectionConsumer",w);return Ne.useCallback(()=>{const I=C.collectionRef.current;if(!I)return[];const P=Array.from(I.querySelectorAll(`[${f}]`));return Array.from(C.itemMap.values()).sort((U,L)=>P.indexOf(U.ref.current)-P.indexOf(L.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},v,r]}var lxn=m.createContext(void 0);function eVe(e){const t=m.useContext(lxn);return e||t||"ltr"}function b1(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function cxn(e,t=globalThis==null?void 0:globalThis.document){const n=b1(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var uxn="DismissableLayer",mre="dismissableLayer.update",dxn="dismissableLayer.pointerDownOutside",fxn="dismissableLayer.focusOutside",ZSe,tVe=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yU=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext(tVe),[d,f]=m.useState(null),x=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=m.useState({}),v=au(t,L=>f(L)),w=Array.from(u.layers),[C]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),N=w.indexOf(C),I=d?w.indexOf(d):-1,P=u.layersWithOutsidePointerEventsDisabled.size>0,R=I>=N,F=mxn(L=>{const z=L.target,Q=[...u.branches].some(ne=>ne.contains(z));!R||Q||(s==null||s(L),o==null||o(L),L.defaultPrevented||l==null||l())},x),U=xxn(L=>{const z=L.target;[...u.branches].some(ne=>ne.contains(z))||(a==null||a(L),o==null||o(L),L.defaultPrevented||l==null||l())},x);return cxn(L=>{I===u.layers.size-1&&(r==null||r(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},x),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ZSe=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),JSe(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=ZSe)}},[d,x,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),JSe())},[d,u]),m.useEffect(()=>{const L=()=>g({});return document.addEventListener(mre,L),()=>document.removeEventListener(mre,L)},[]),i.jsx(Lc.div,{...c,ref:v,style:{pointerEvents:P?R?"auto":"none":void 0,...e.style},onFocusCapture:li(e.onFocusCapture,U.onFocusCapture),onBlurCapture:li(e.onBlurCapture,U.onBlurCapture),onPointerDownCapture:li(e.onPointerDownCapture,F.onPointerDownCapture)})});yU.displayName=uxn;var hxn="DismissableLayerBranch",pxn=m.forwardRef((e,t)=>{const n=m.useContext(tVe),r=m.useRef(null),s=au(t,r);return m.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(Lc.div,{...e,ref:s})});pxn.displayName=hxn;function mxn(e,t=globalThis==null?void 0:globalThis.document){const n=b1(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){nVe(dxn,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function xxn(e,t=globalThis==null?void 0:globalThis.document){const n=b1(e),r=m.useRef(!1);return m.useEffect(()=>{const s=a=>{a.target&&!r.current&&nVe(fxn,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function JSe(){const e=new CustomEvent(mre);document.dispatchEvent(e)}function nVe(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ZHe(s,a):s.dispatchEvent(a)}var qX=0;function rVe(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??eNe()),document.body.insertAdjacentElement("beforeend",e[1]??eNe()),qX++,()=>{qX===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qX--}},[])}function eNe(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var GX="focusScope.autoFocusOnMount",KX="focusScope.autoFocusOnUnmount",tNe={bubbles:!1,cancelable:!0},gxn="FocusScope",Eue=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=m.useState(null),u=b1(s),d=b1(a),f=m.useRef(null),x=au(t,w=>c(w)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let w=function(P){if(g.paused||!l)return;const R=P.target;l.contains(R)?f.current=R:Eb(f.current,{select:!0})},C=function(P){if(g.paused||!l)return;const R=P.relatedTarget;R!==null&&(l.contains(R)||Eb(f.current,{select:!0}))},N=function(P){if(document.activeElement===document.body)for(const F of P)F.removedNodes.length>0&&Eb(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const I=new MutationObserver(N);return l&&I.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),I.disconnect()}}},[r,l,g.paused]),m.useEffect(()=>{if(l){rNe.add(g);const w=document.activeElement;if(!l.contains(w)){const N=new CustomEvent(GX,tNe);l.addEventListener(GX,u),l.dispatchEvent(N),N.defaultPrevented||(bxn(Sxn(sVe(l)),{select:!0}),document.activeElement===w&&Eb(l))}return()=>{l.removeEventListener(GX,u),setTimeout(()=>{const N=new CustomEvent(KX,tNe);l.addEventListener(KX,d),l.dispatchEvent(N),N.defaultPrevented||Eb(w??document.body,{select:!0}),l.removeEventListener(KX,d),rNe.remove(g)},0)}}},[l,u,d,g]);const v=m.useCallback(w=>{if(!n&&!r||g.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,N=document.activeElement;if(C&&N){const I=w.currentTarget,[P,R]=yxn(I);P&&R?!w.shiftKey&&N===R?(w.preventDefault(),n&&Eb(P,{select:!0})):w.shiftKey&&N===P&&(w.preventDefault(),n&&Eb(R,{select:!0})):N===I&&w.preventDefault()}},[n,r,g.paused]);return i.jsx(Lc.div,{tabIndex:-1,...o,ref:x,onKeyDown:v})});Eue.displayName=gxn;function bxn(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Eb(r,{select:t}),document.activeElement!==n)return}function yxn(e){const t=sVe(e),n=nNe(t,e),r=nNe(t.reverse(),e);return[n,r]}function sVe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nNe(e,t){for(const n of e)if(!vxn(n,{upTo:t}))return n}function vxn(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function wxn(e){return e instanceof HTMLInputElement&&"select"in e}function Eb(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wxn(e)&&t&&e.select()}}var rNe=Cxn();function Cxn(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sNe(e,t),e.unshift(t)},remove(t){var n;e=sNe(e,t),(n=e[0])==null||n.resume()}}}function sNe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Sxn(e){return e.filter(t=>t.tagName!=="A")}var Nxn=Iy[" useId ".trim().toString()]||(()=>{}),Axn=0;function nD(e){const[t,n]=m.useState(Nxn());return Zy(()=>{e||n(r=>r??String(Axn++))},[e]),e||(t?`radix-${t}`:"")}var jxn=typeof document<"u",Exn=function(){},IO=jxn?m.useLayoutEffect:Exn;function rD(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!rD(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!rD(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function iVe(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iNe(e,t){const n=iVe(e);return Math.round(t*n)/n}function YX(e){const t=m.useRef(e);return IO(()=>{t.current=e}),t}function _xn(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=m.useState(r);rD(x,r)||g(r);const[v,w]=m.useState(null),[C,N]=m.useState(null),I=m.useCallback(G=>{G!==U.current&&(U.current=G,w(G))},[]),P=m.useCallback(G=>{G!==L.current&&(L.current=G,N(G))},[]),R=a||v,F=o||C,U=m.useRef(null),L=m.useRef(null),z=m.useRef(d),Q=c!=null,ne=YX(c),J=YX(s),X=YX(u),re=m.useCallback(()=>{if(!U.current||!L.current)return;const G={placement:t,strategy:n,middleware:x};J.current&&(G.platform=J.current),DAe(U.current,L.current,G).then(V=>{const te={...V,isPositioned:X.current!==!1};pe.current&&!rD(z.current,te)&&(z.current=te,Na.flushSync(()=>{f(te)}))})},[x,t,n,J,X]);IO(()=>{u===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[u]);const pe=m.useRef(!1);IO(()=>(pe.current=!0,()=>{pe.current=!1}),[]),IO(()=>{if(R&&(U.current=R),F&&(L.current=F),R&&F){if(ne.current)return ne.current(R,F,re);re()}},[R,F,re,ne,Q]);const Y=m.useMemo(()=>({reference:U,floating:L,setReference:I,setFloating:P}),[I,P]),ie=m.useMemo(()=>({reference:R,floating:F}),[R,F]),oe=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!ie.floating)return G;const V=iNe(ie.floating,d.x),te=iNe(ie.floating,d.y);return l?{...G,transform:"translate("+V+"px, "+te+"px)",...iVe(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:te}},[n,l,ie.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:re,refs:Y,elements:ie,floatingStyles:oe}),[d,re,Y,ie,oe])}const kxn=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qde({element:r.current,padding:s}).fn(n):{}:r?qde({element:r,padding:s}).fn(n):{}}}},Txn=(e,t)=>({...OAe(e),options:[e,t]}),Ixn=(e,t)=>({...MAe(e),options:[e,t]}),Pxn=(e,t)=>({...qQe(e),options:[e,t]}),Fxn=(e,t)=>({...RAe(e),options:[e,t]}),Oxn=(e,t)=>({...LAe(e),options:[e,t]}),Mxn=(e,t)=>({...WQe(e),options:[e,t]}),Rxn=(e,t)=>({...kxn(e),options:[e,t]});var Lxn="Arrow",aVe=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(Lc.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});aVe.displayName=Lxn;var Dxn=aVe;function Bxn(e){const[t,n]=m.useState(void 0);return Zy(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _ue="Popper",[oVe,l8]=E5(_ue),[$xn,lVe]=oVe(_ue),cVe=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return i.jsx($xn,{scope:t,anchor:r,onAnchorChange:s,children:n})};cVe.displayName=_ue;var uVe="PopperAnchor",dVe=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=lVe(uVe,n),o=m.useRef(null),l=au(t,o);return m.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:i.jsx(Lc.div,{...s,ref:l})});dVe.displayName=uVe;var kue="PopperContent",[Uxn,zxn]=oVe(kue),fVe=m.forwardRef((e,t)=>{var ye,je,Ie,Re,Qe,$e;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:v,...w}=e,C=lVe(kue,n),[N,I]=m.useState(null),P=au(t,it=>I(it)),[R,F]=m.useState(null),U=Bxn(R),L=(U==null?void 0:U.width)??0,z=(U==null?void 0:U.height)??0,Q=r+(a!=="center"?"-"+a:""),ne=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},J=Array.isArray(u)?u:[u],X=J.length>0,re={padding:ne,boundary:J.filter(Vxn),altBoundary:X},{refs:pe,floatingStyles:Y,placement:ie,isPositioned:oe,middlewareData:G}=_xn({strategy:"fixed",placement:Q,whileElementsMounted:(...it)=>FAe(...it,{animationFrame:g==="always"}),elements:{reference:C.anchor},middleware:[Txn({mainAxis:s+z,alignmentAxis:o}),c&&Ixn({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Pxn():void 0,...re}),c&&Fxn({...re}),Oxn({...re,apply:({elements:it,rects:tt,availableWidth:ot,availableHeight:ft})=>{const{width:ct,height:Vt}=tt.reference,It=it.floating.style;It.setProperty("--radix-popper-available-width",`${ot}px`),It.setProperty("--radix-popper-available-height",`${ft}px`),It.setProperty("--radix-popper-anchor-width",`${ct}px`),It.setProperty("--radix-popper-anchor-height",`${Vt}px`)}}),R&&Rxn({element:R,padding:l}),Wxn({arrowWidth:L,arrowHeight:z}),x&&Mxn({strategy:"referenceHidden",...re})]}),[V,te]=mVe(ie),ae=b1(v);Zy(()=>{oe&&(ae==null||ae())},[oe,ae]);const he=(ye=G.arrow)==null?void 0:ye.x,Ce=(je=G.arrow)==null?void 0:je.y,ce=((Ie=G.arrow)==null?void 0:Ie.centerOffset)!==0,[ge,Ae]=m.useState();return Zy(()=>{N&&Ae(window.getComputedStyle(N).zIndex)},[N]),i.jsx("div",{ref:pe.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:oe?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Re=G.transformOrigin)==null?void 0:Re.x,(Qe=G.transformOrigin)==null?void 0:Qe.y].join(" "),...(($e=G.hide)==null?void 0:$e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(Uxn,{scope:n,placedSide:V,onArrowChange:F,arrowX:he,arrowY:Ce,shouldHideArrow:ce,children:i.jsx(Lc.div,{"data-side":V,"data-align":te,...w,ref:P,style:{...w.style,animation:oe?void 0:"none"}})})})});fVe.displayName=kue;var hVe="PopperArrow",Hxn={top:"bottom",right:"left",bottom:"top",left:"right"},pVe=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=zxn(hVe,r),o=Hxn[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(Dxn,{...s,ref:n,style:{...s.style,display:"block"}})})});pVe.displayName=hVe;function Vxn(e){return e!==null}var Wxn=e=>({name:"transformOrigin",options:e,fn(t){var C,N,I;const{placement:n,rects:r,middlewareData:s}=t,o=((C=s.arrow)==null?void 0:C.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=mVe(n),f={start:"0%",center:"50%",end:"100%"}[d],x=(((N=s.arrow)==null?void 0:N.x)??0)+l/2,g=(((I=s.arrow)==null?void 0:I.y)??0)+c/2;let v="",w="";return u==="bottom"?(v=o?f:`${x}px`,w=`${-c}px`):u==="top"?(v=o?f:`${x}px`,w=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,w=o?f:`${g}px`):u==="left"&&(v=`${r.floating.width+c}px`,w=o?f:`${g}px`),{data:{x:v,y:w}}}});function mVe(e){const[t,n="center"]=e.split("-");return[t,n]}var Tue=cVe,vU=dVe,Iue=fVe,Pue=pVe,qxn="Portal",Fue=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=m.useState(!1);Zy(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?yre.createPortal(i.jsx(Lc.div,{...r,ref:t}),o):null});Fue.displayName=qxn;function Gxn(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var w2=e=>{const{present:t,children:n}=e,r=Kxn(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),a=au(r.ref,Yxn(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:a}):null};w2.displayName="Presence";function Kxn(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),a=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Gxn(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=lF(r.current);a.current=l==="mounted"?u:"none"},[l]),Zy(()=>{const u=r.current,d=s.current;if(d!==e){const x=a.current,g=lF(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&x!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Zy(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=g=>{const w=lF(r.current).includes(g.animationName);if(g.target===t&&w&&(c("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=g=>{g.target===t&&(a.current=lF(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function lF(e){return(e==null?void 0:e.animationName)||"none"}function Yxn(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XX="rovingFocusGroup.onEntryFocus",Xxn={bubbles:!1,cancelable:!0},vT="RovingFocusGroup",[xre,xVe,Qxn]=JHe(vT),[Zxn,gVe]=E5(vT,[Qxn]),[Jxn,egn]=Zxn(vT),bVe=m.forwardRef((e,t)=>i.jsx(xre.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(xre.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(tgn,{...e,ref:t})})}));bVe.displayName=vT;var tgn=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,x=m.useRef(null),g=au(t,x),v=eVe(a),[w,C]=bU({prop:o,defaultProp:l??null,onChange:c,caller:vT}),[N,I]=m.useState(!1),P=b1(u),R=xVe(n),F=m.useRef(!1),[U,L]=m.useState(0);return m.useEffect(()=>{const z=x.current;if(z)return z.addEventListener(XX,P),()=>z.removeEventListener(XX,P)},[P]),i.jsx(Jxn,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:w,onItemFocus:m.useCallback(z=>C(z),[C]),onItemShiftTab:m.useCallback(()=>I(!0),[]),onFocusableItemAdd:m.useCallback(()=>L(z=>z+1),[]),onFocusableItemRemove:m.useCallback(()=>L(z=>z-1),[]),children:i.jsx(Lc.div,{tabIndex:N||U===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:li(e.onMouseDown,()=>{F.current=!0}),onFocus:li(e.onFocus,z=>{const Q=!F.current;if(z.target===z.currentTarget&&Q&&!N){const ne=new CustomEvent(XX,Xxn);if(z.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const J=R().filter(ie=>ie.focusable),X=J.find(ie=>ie.active),re=J.find(ie=>ie.id===w),Y=[X,re,...J].filter(Boolean).map(ie=>ie.ref.current);wVe(Y,d)}}F.current=!1}),onBlur:li(e.onBlur,()=>I(!1))})})}),yVe="RovingFocusGroupItem",vVe=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:o,...l}=e,c=nD(),u=a||c,d=egn(yVe,n),f=d.currentTabStopId===u,x=xVe(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:w}=d;return m.useEffect(()=>{if(r)return g(),()=>v()},[r,g,v]),i.jsx(xre.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:i.jsx(Lc.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:li(e.onMouseDown,C=>{r?d.onItemFocus(u):C.preventDefault()}),onFocus:li(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:li(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){d.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const N=sgn(C,d.orientation,d.dir);if(N!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let P=x().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")P.reverse();else if(N==="prev"||N==="next"){N==="prev"&&P.reverse();const R=P.indexOf(C.currentTarget);P=d.loop?ign(P,R+1):P.slice(R+1)}setTimeout(()=>wVe(P))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:w!=null}):o})})});vVe.displayName=yVe;var ngn={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rgn(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function sgn(e,t,n){const r=rgn(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ngn[r]}function wVe(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ign(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var agn=bVe,ogn=vVe,lgn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pC=new WeakMap,cF=new WeakMap,uF={},QX=0,CVe=function(e){return e&&(e.host||CVe(e.parentNode))},cgn=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=CVe(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ugn=function(e,t,n,r){var s=cgn(t,Array.isArray(e)?e:[e]);uF[n]||(uF[n]=new WeakMap);var a=uF[n],o=[],l=new Set,c=new Set(s),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(x){if(l.has(x))d(x);else try{var g=x.getAttribute(r),v=g!==null&&g!=="false",w=(pC.get(x)||0)+1,C=(a.get(x)||0)+1;pC.set(x,w),a.set(x,C),o.push(x),w===1&&v&&cF.set(x,!0),C===1&&x.setAttribute(n,"true"),v||x.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",x,N)}})};return d(t),l.clear(),QX++,function(){o.forEach(function(f){var x=pC.get(f)-1,g=a.get(f)-1;pC.set(f,x),a.set(f,g),x||(cF.has(f)||f.removeAttribute(r),cF.delete(f)),g||f.removeAttribute(n)}),QX--,QX||(pC=new WeakMap,pC=new WeakMap,cF=new WeakMap,uF={})}},SVe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=lgn(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),ugn(r,s,n,"aria-hidden")):function(){return null}},Mb=function(){return Mb=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Mb.apply(this,arguments)};function dgn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function fgn(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var NVe=iRe(),ZX=function(){},wU=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:ZX,onWheelCapture:ZX,onTouchMoveCapture:ZX}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,x=e.sideCar,g=e.noRelative,v=e.noIsolation,w=e.inert,C=e.allowPinchZoom,N=e.as,I=N===void 0?"div":N,P=e.gapMode,R=dgn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=x,U=PMe([n,t]),L=Mb(Mb({},R),s);return m.createElement(m.Fragment,null,d&&m.createElement(F,{sideCar:NVe,removeScrollBar:u,shards:f,noRelative:g,noIsolation:v,inert:w,setCallbacks:a,allowPinchZoom:!!C,lockRef:n,gapMode:P}),o?m.cloneElement(m.Children.only(l),Mb(Mb({},L),{ref:U})):m.createElement(I,Mb({},L,{className:c,ref:U}),l))});wU.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wU.classNames={fullWidth:n9,zeroRight:t9};var gre=!1;if(typeof window<"u")try{var dF=Object.defineProperty({},"passive",{get:function(){return gre=!0,!0}});window.addEventListener("test",dF,dF),window.removeEventListener("test",dF,dF)}catch{gre=!1}var mC=gre?{passive:!1}:!1,hgn=function(e){return e.tagName==="TEXTAREA"},AVe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hgn(e)&&n[t]==="visible")},pgn=function(e){return AVe(e,"overflowY")},mgn=function(e){return AVe(e,"overflowX")},aNe=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=jVe(e,r);if(s){var a=EVe(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xgn=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ggn=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},jVe=function(e,t){return e==="v"?pgn(t):mgn(t)},EVe=function(e,t){return e==="v"?xgn(t):ggn(t)},bgn=function(e,t){return e==="h"&&t==="rtl"?-1:1},ygn=function(e,t,n,r,s){var a=bgn(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,x=0;do{if(!l)break;var g=EVe(e,l),v=g[0],w=g[1],C=g[2],N=w-C-a*v;(v||N)&&jVe(e,l)&&(f+=N,x+=v);var I=l.parentNode;l=I&&I.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host:I}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(x)<1)&&(u=!0),u},fF=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oNe=function(e){return[e.deltaX,e.deltaY]},lNe=function(e){return e&&"current"in e?e.current:e},vgn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wgn=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Cgn=0,xC=[];function Sgn(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(Cgn++)[0],a=m.useState(Zoe)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=fgn([e.lockRef.current],(e.shards||[]).map(lNe),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var N=fF(w),I=n.current,P="deltaX"in w?w.deltaX:I[0]-N[0],R="deltaY"in w?w.deltaY:I[1]-N[1],F,U=w.target,L=Math.abs(P)>Math.abs(R)?"h":"v";if("touches"in w&&L==="h"&&U.type==="range")return!1;var z=aNe(L,U);if(!z)return!0;if(z?F=L:(F=L==="v"?"h":"v",z=aNe(L,U)),!z)return!1;if(!r.current&&"changedTouches"in w&&(P||R)&&(r.current=F),!F)return!0;var Q=r.current||F;return ygn(Q,C,w,Q==="h"?P:R)},[]),c=m.useCallback(function(w){var C=w;if(!(!xC.length||xC[xC.length-1]!==a)){var N="deltaY"in C?oNe(C):fF(C),I=t.current.filter(function(F){return F.name===C.type&&(F.target===C.target||C.target===F.shadowParent)&&vgn(F.delta,N)})[0];if(I&&I.should){C.cancelable&&C.preventDefault();return}if(!I){var P=(o.current.shards||[]).map(lNe).filter(Boolean).filter(function(F){return F.contains(C.target)}),R=P.length>0?l(C,P[0]):!o.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),u=m.useCallback(function(w,C,N,I){var P={name:w,delta:C,target:N,should:I,shadowParent:Ngn(N)};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(R){return R!==P})},1)},[]),d=m.useCallback(function(w){n.current=fF(w),r.current=void 0},[]),f=m.useCallback(function(w){u(w.type,oNe(w),w.target,l(w,e.lockRef.current))},[]),x=m.useCallback(function(w){u(w.type,fF(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return xC.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:x}),document.addEventListener("wheel",c,mC),document.addEventListener("touchmove",c,mC),document.addEventListener("touchstart",d,mC),function(){xC=xC.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,mC),document.removeEventListener("touchmove",c,mC),document.removeEventListener("touchstart",d,mC)}},[]);var g=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(a,{styles:wgn(s)}):null,g?m.createElement(cRe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ngn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Agn=oRe(NVe,Sgn);var Oue=m.forwardRef(function(e,t){return m.createElement(wU,Mb({},e,{ref:t,sideCar:Agn}))});Oue.classNames=wU.classNames;var bre=["Enter"," "],jgn=["ArrowDown","PageUp","Home"],_Ve=["ArrowUp","PageDown","End"],Egn=[...jgn,..._Ve],_gn={ltr:[...bre,"ArrowRight"],rtl:[...bre,"ArrowLeft"]},kgn={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wT="Menu",[W_,Tgn,Ign]=JHe(wT),[_5,kVe]=E5(wT,[Ign,l8,gVe]),CU=l8(),TVe=gVe(),[Pgn,c8]=_5(wT),[Fgn,CT]=_5(wT),IVe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:o=!0}=e,l=CU(t),[c,u]=m.useState(null),d=m.useRef(!1),f=b1(a),x=eVe(s);return m.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),i.jsx(Tue,{...l,children:i.jsx(Pgn,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:i.jsx(Fgn,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:x,modal:o,children:r})})})};IVe.displayName=wT;var Ogn="MenuAnchor",Mue=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=CU(n);return i.jsx(vU,{...s,...r,ref:t})});Mue.displayName=Ogn;var Mgn="MenuPortal",[bvn,PVe]=_5(Mgn,{forceMount:void 0}),rp="MenuContent",[Rgn,Rue]=_5(rp),FVe=m.forwardRef((e,t)=>{const n=PVe(rp,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=c8(rp,e.__scopeMenu),o=CT(rp,e.__scopeMenu);return i.jsx(W_.Provider,{scope:e.__scopeMenu,children:i.jsx(w2,{present:r||a.open,children:i.jsx(W_.Slot,{scope:e.__scopeMenu,children:o.modal?i.jsx(Lgn,{...s,ref:t}):i.jsx(Dgn,{...s,ref:t})})})})}),Lgn=m.forwardRef((e,t)=>{const n=c8(rp,e.__scopeMenu),r=m.useRef(null),s=au(t,r);return m.useEffect(()=>{const a=r.current;if(a)return SVe(a)},[]),i.jsx(Lue,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:li(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Dgn=m.forwardRef((e,t)=>{const n=c8(rp,e.__scopeMenu);return i.jsx(Lue,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Bgn=V_("MenuContent.ScrollLock"),Lue=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:x,onDismiss:g,disableOutsideScroll:v,...w}=e,C=c8(rp,n),N=CT(rp,n),I=CU(n),P=TVe(n),R=Tgn(n),[F,U]=m.useState(null),L=m.useRef(null),z=au(t,L,C.onContentChange),Q=m.useRef(0),ne=m.useRef(""),J=m.useRef(0),X=m.useRef(null),re=m.useRef("right"),pe=m.useRef(0),Y=v?Oue:m.Fragment,ie=v?{as:Bgn,allowPinchZoom:!0}:void 0,oe=V=>{var ye,je;const te=ne.current+V,ae=R().filter(Ie=>!Ie.disabled),he=document.activeElement,Ce=(ye=ae.find(Ie=>Ie.ref.current===he))==null?void 0:ye.textValue,ce=ae.map(Ie=>Ie.textValue),ge=Qgn(ce,te,Ce),Ae=(je=ae.find(Ie=>Ie.textValue===ge))==null?void 0:je.ref.current;(function Ie(Re){ne.current=Re,window.clearTimeout(Q.current),Re!==""&&(Q.current=window.setTimeout(()=>Ie(""),1e3))})(te),Ae&&setTimeout(()=>Ae.focus())};m.useEffect(()=>()=>window.clearTimeout(Q.current),[]),rVe();const G=m.useCallback(V=>{var ae,he;return re.current===((ae=X.current)==null?void 0:ae.side)&&Jgn(V,(he=X.current)==null?void 0:he.area)},[]);return i.jsx(Rgn,{scope:n,searchRef:ne,onItemEnter:m.useCallback(V=>{G(V)&&V.preventDefault()},[G]),onItemLeave:m.useCallback(V=>{var te;G(V)||((te=L.current)==null||te.focus(),U(null))},[G]),onTriggerLeave:m.useCallback(V=>{G(V)&&V.preventDefault()},[G]),pointerGraceTimerRef:J,onPointerGraceIntentChange:m.useCallback(V=>{X.current=V},[]),children:i.jsx(Y,{...ie,children:i.jsx(Eue,{asChild:!0,trapped:s,onMountAutoFocus:li(a,V=>{var te;V.preventDefault(),(te=L.current)==null||te.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:i.jsx(yU,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:x,onDismiss:g,children:i.jsx(agn,{asChild:!0,...P,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:F,onCurrentTabStopIdChange:U,onEntryFocus:li(c,V=>{N.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Iue,{role:"menu","aria-orientation":"vertical","data-state":YVe(C.open),"data-radix-menu-content":"",dir:N.dir,...I,...w,ref:z,style:{outline:"none",...w.style},onKeyDown:li(w.onKeyDown,V=>{const ae=V.target.closest("[data-radix-menu-content]")===V.currentTarget,he=V.ctrlKey||V.altKey||V.metaKey,Ce=V.key.length===1;ae&&(V.key==="Tab"&&V.preventDefault(),!he&&Ce&&oe(V.key));const ce=L.current;if(V.target!==ce||!Egn.includes(V.key))return;V.preventDefault();const Ae=R().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);_Ve.includes(V.key)&&Ae.reverse(),Ygn(Ae)}),onBlur:li(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(Q.current),ne.current="")}),onPointerMove:li(e.onPointerMove,q_(V=>{const te=V.target,ae=pe.current!==V.clientX;if(V.currentTarget.contains(te)&&ae){const he=V.clientX>pe.current?"right":"left";re.current=he,pe.current=V.clientX}}))})})})})})})});FVe.displayName=rp;var $gn="MenuGroup",Due=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Lc.div,{role:"group",...r,ref:t})});Due.displayName=$gn;var Ugn="MenuLabel",OVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Lc.div,{...r,ref:t})});OVe.displayName=Ugn;var sD="MenuItem",cNe="menu.itemSelect",SU=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=m.useRef(null),o=CT(sD,e.__scopeMenu),l=Rue(sD,e.__scopeMenu),c=au(t,a),u=m.useRef(!1),d=()=>{const f=a.current;if(!n&&f){const x=new CustomEvent(cNe,{bubbles:!0,cancelable:!0});f.addEventListener(cNe,g=>r==null?void 0:r(g),{once:!0}),ZHe(f,x),x.defaultPrevented?u.current=!1:o.onClose()}};return i.jsx(MVe,{...s,ref:c,disabled:n,onClick:li(e.onClick,d),onPointerDown:f=>{var x;(x=e.onPointerDown)==null||x.call(e,f),u.current=!0},onPointerUp:li(e.onPointerUp,f=>{var x;u.current||(x=f.currentTarget)==null||x.click()}),onKeyDown:li(e.onKeyDown,f=>{const x=l.searchRef.current!=="";n||x&&f.key===" "||bre.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});SU.displayName=sD;var MVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,o=Rue(sD,n),l=TVe(n),c=m.useRef(null),u=au(t,c),[d,f]=m.useState(!1),[x,g]=m.useState("");return m.useEffect(()=>{const v=c.current;v&&g((v.textContent??"").trim())},[a.children]),i.jsx(W_.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:i.jsx(ogn,{asChild:!0,...l,focusable:!r,children:i.jsx(Lc.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:li(e.onPointerMove,q_(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:li(e.onPointerLeave,q_(v=>o.onItemLeave(v))),onFocus:li(e.onFocus,()=>f(!0)),onBlur:li(e.onBlur,()=>f(!1))})})})}),zgn="MenuCheckboxItem",RVe=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(UVe,{scope:e.__scopeMenu,checked:n,children:i.jsx(SU,{role:"menuitemcheckbox","aria-checked":iD(n)?"mixed":n,...s,ref:t,"data-state":$ue(n),onSelect:li(s.onSelect,()=>r==null?void 0:r(iD(n)?!0:!n),{checkForDefaultPrevented:!1})})})});RVe.displayName=zgn;var LVe="MenuRadioGroup",[Hgn,Vgn]=_5(LVe,{value:void 0,onValueChange:()=>{}}),DVe=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=b1(r);return i.jsx(Hgn,{scope:e.__scopeMenu,value:n,onValueChange:a,children:i.jsx(Due,{...s,ref:t})})});DVe.displayName=LVe;var BVe="MenuRadioItem",$Ve=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=Vgn(BVe,e.__scopeMenu),a=n===s.value;return i.jsx(UVe,{scope:e.__scopeMenu,checked:a,children:i.jsx(SU,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":$ue(a),onSelect:li(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});$Ve.displayName=BVe;var Bue="MenuItemIndicator",[UVe,Wgn]=_5(Bue,{checked:!1}),zVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=Wgn(Bue,n);return i.jsx(w2,{present:r||iD(a.checked)||a.checked===!0,children:i.jsx(Lc.span,{...s,ref:t,"data-state":$ue(a.checked)})})});zVe.displayName=Bue;var qgn="MenuSeparator",HVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Lc.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});HVe.displayName=qgn;var Ggn="MenuArrow",VVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=CU(n);return i.jsx(Pue,{...s,...r,ref:t})});VVe.displayName=Ggn;var Kgn="MenuSub",[yvn,WVe]=_5(Kgn),Oj="MenuSubTrigger",qVe=m.forwardRef((e,t)=>{const n=c8(Oj,e.__scopeMenu),r=CT(Oj,e.__scopeMenu),s=WVe(Oj,e.__scopeMenu),a=Rue(Oj,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),i.jsx(Mue,{asChild:!0,...u,children:i.jsx(MVe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":YVe(n.open),...e,ref:gU(t,s.onTriggerChange),onClick:f=>{var x;(x=e.onClick)==null||x.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:li(e.onPointerMove,q_(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:li(e.onPointerLeave,q_(f=>{var g,v;d();const x=(g=n.content)==null?void 0:g.getBoundingClientRect();if(x){const w=(v=n.content)==null?void 0:v.dataset.side,C=w==="right",N=C?-5:5,I=x[C?"left":"right"],P=x[C?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+N,y:f.clientY},{x:I,y:x.top},{x:P,y:x.top},{x:P,y:x.bottom},{x:I,y:x.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:li(e.onKeyDown,f=>{var g;const x=a.searchRef.current!=="";e.disabled||x&&f.key===" "||_gn[r.dir].includes(f.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),f.preventDefault())})})})});qVe.displayName=Oj;var GVe="MenuSubContent",KVe=m.forwardRef((e,t)=>{const n=PVe(rp,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=c8(rp,e.__scopeMenu),o=CT(rp,e.__scopeMenu),l=WVe(GVe,e.__scopeMenu),c=m.useRef(null),u=au(t,c);return i.jsx(W_.Provider,{scope:e.__scopeMenu,children:i.jsx(w2,{present:r||a.open,children:i.jsx(W_.Slot,{scope:e.__scopeMenu,children:i.jsx(Lue,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:li(e.onFocusOutside,d=>{d.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:li(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:li(e.onKeyDown,d=>{var g;const f=d.currentTarget.contains(d.target),x=kgn[o.dir].includes(d.key);f&&x&&(a.onOpenChange(!1),(g=l.trigger)==null||g.focus(),d.preventDefault())})})})})})});KVe.displayName=GVe;function YVe(e){return e?"open":"closed"}function iD(e){return e==="indeterminate"}function $ue(e){return iD(e)?"indeterminate":e?"checked":"unchecked"}function Ygn(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Xgn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Qgn(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=Xgn(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function Zgn(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],u=l.x,d=l.y,f=c.x,x=c.y;d>r!=x>r&&n<(f-u)*(r-d)/(x-d)+u&&(s=!s)}return s}function Jgn(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Zgn(n,t)}function q_(e){return t=>t.pointerType==="mouse"?e(t):void 0}var e1n=IVe,t1n=Mue,n1n=FVe,r1n=Due,s1n=OVe,i1n=SU,a1n=RVe,o1n=DVe,l1n=$Ve,c1n=zVe,u1n=HVe,d1n=VVe,f1n=qVe,h1n=KVe,NU="DropdownMenu",[p1n,vvn]=E5(NU,[kVe]),ff=kVe(),[m1n,XVe]=p1n(NU),QVe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=ff(t),u=m.useRef(null),[d,f]=bU({prop:s,defaultProp:a??!1,onChange:o,caller:NU});return i.jsx(m1n,{scope:t,triggerId:nD(),triggerRef:u,contentId:nD(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(x=>!x),[f]),modal:l,children:i.jsx(e1n,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};QVe.displayName=NU;var ZVe="DropdownMenuTrigger",JVe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,a=XVe(ZVe,n),o=ff(n);return i.jsx(t1n,{asChild:!0,...o,children:i.jsx(Lc.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:gU(t,a.triggerRef),onPointerDown:li(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:li(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});JVe.displayName=ZVe;var eWe="DropdownMenuContent",tWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=XVe(eWe,n),a=ff(n),o=m.useRef(!1);return i.jsx(n1n,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:t,onCloseAutoFocus:li(e.onCloseAutoFocus,l=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:li(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tWe.displayName=eWe;var x1n="DropdownMenuGroup",g1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(r1n,{...s,...r,ref:t})});g1n.displayName=x1n;var b1n="DropdownMenuLabel",y1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(s1n,{...s,...r,ref:t})});y1n.displayName=b1n;var v1n="DropdownMenuItem",nWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(i1n,{...s,...r,ref:t})});nWe.displayName=v1n;var w1n="DropdownMenuCheckboxItem",C1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(a1n,{...s,...r,ref:t})});C1n.displayName=w1n;var S1n="DropdownMenuRadioGroup",N1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(o1n,{...s,...r,ref:t})});N1n.displayName=S1n;var A1n="DropdownMenuRadioItem",j1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(l1n,{...s,...r,ref:t})});j1n.displayName=A1n;var E1n="DropdownMenuItemIndicator",_1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(c1n,{...s,...r,ref:t})});_1n.displayName=E1n;var k1n="DropdownMenuSeparator",T1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(u1n,{...s,...r,ref:t})});T1n.displayName=k1n;var I1n="DropdownMenuArrow",P1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(d1n,{...s,...r,ref:t})});P1n.displayName=I1n;var F1n="DropdownMenuSubTrigger",O1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(f1n,{...s,...r,ref:t})});O1n.displayName=F1n;var M1n="DropdownMenuSubContent",R1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ff(n);return i.jsx(h1n,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});R1n.displayName=M1n;var JX=QVe,L1n=JVe,eQ=tWe,tQ=nWe,AU="Popover",[rWe,wvn]=E5(AU,[l8]),ST=l8(),[D1n,C2]=rWe(AU),sWe=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!1}=e,l=ST(t),c=m.useRef(null),[u,d]=m.useState(!1),[f,x]=bU({prop:r,defaultProp:s??!1,onChange:a,caller:AU});return i.jsx(Tue,{...l,children:i.jsx(D1n,{scope:t,contentId:nD(),triggerRef:c,open:f,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(g=>!g),[x]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:o,children:n})})};sWe.displayName=AU;var iWe="PopoverAnchor",B1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=C2(iWe,n),a=ST(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return m.useEffect(()=>(o(),()=>l()),[o,l]),i.jsx(vU,{...a,...r,ref:t})});B1n.displayName=iWe;var aWe="PopoverTrigger",oWe=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=C2(aWe,n),a=ST(n),o=au(t,s.triggerRef),l=i.jsx(Lc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":fWe(s.open),...r,ref:o,onClick:li(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(vU,{asChild:!0,...a,children:l})});oWe.displayName=aWe;var Uue="PopoverPortal",[$1n,U1n]=rWe(Uue,{forceMount:void 0}),lWe=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=C2(Uue,t);return i.jsx($1n,{scope:t,forceMount:n,children:i.jsx(w2,{present:n||a.open,children:i.jsx(Fue,{asChild:!0,container:s,children:r})})})};lWe.displayName=Uue;var QN="PopoverContent",cWe=m.forwardRef((e,t)=>{const n=U1n(QN,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=C2(QN,e.__scopePopover);return i.jsx(w2,{present:r||a.open,children:a.modal?i.jsx(H1n,{...s,ref:t}):i.jsx(V1n,{...s,ref:t})})});cWe.displayName=QN;var z1n=V_("PopoverContent.RemoveScroll"),H1n=m.forwardRef((e,t)=>{const n=C2(QN,e.__scopePopover),r=m.useRef(null),s=au(t,r),a=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return SVe(o)},[]),i.jsx(Oue,{as:z1n,allowPinchZoom:!0,children:i.jsx(uWe,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:li(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:li(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:li(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),V1n=m.forwardRef((e,t)=>{const n=C2(QN,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return i.jsx(uWe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),uWe=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,x=C2(QN,n),g=ST(n);return rVe(),i.jsx(Eue,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(yU,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>x.onOpenChange(!1),children:i.jsx(Iue,{"data-state":fWe(x.open),role:"dialog",id:x.contentId,...g,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dWe="PopoverClose",W1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=C2(dWe,n);return i.jsx(Lc.button,{type:"button",...r,ref:t,onClick:li(e.onClick,()=>s.onOpenChange(!1))})});W1n.displayName=dWe;var q1n="PopoverArrow",G1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ST(n);return i.jsx(Pue,{...s,...r,ref:t})});G1n.displayName=q1n;function fWe(e){return e?"open":"closed"}var K1n=sWe,Y1n=oWe,X1n=lWe,Q1n=cWe;const Z1n=e=>`${e.slice(0,5)}...${e.slice(-4)}`,J1n=[{label:"$0 - $100,000",min:0,max:1e5},{label:"$100,000 - $500,000",min:1e5,max:5e5},{label:"$500,000 - $1,000,000",min:5e5,max:1e6},{label:"$1,000,000 - $5,000,000",min:1e6,max:5e6},{label:">$5,000,000",min:5e6,max:1/0},{label:"$0 - -$100,000",min:-1e5,max:0},{label:"-$100,000 - -$500,000",min:-5e5,max:-1e5},{label:"-$500,000 - -$1,000,000",min:-1e6,max:-5e5},{label:"-$1,000,000 - -$5,000,000",min:-5e6,max:-1e6},{label:"< -$5,000,000",min:-1/0,max:-5e6}];function ebn(){const[e,t]=m.useState([]),[n,r]=m.useState("All"),[s,a]=m.useState("All"),[o,l]=m.useState(null),[c,u]=m.useState("All"),[d,f]=m.useState("All"),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(null),[I,P]=m.useState(null),[R,F]=m.useState(""),{setSignModalOpen:U,copyTradeWatchList:L,getCopyTradeWatchList:z,getTrackedWatchList:Q,setIsWhitelist:ne,setMushboomerETH:J,setMushboomerSOL:X}=m.useContext(Qr);m.useEffect(()=>{const G=()=>{const te="https://dextradata.nftinit.io/api/hyper/top_whales/",ae=d==="All"?te:`${te}?user_tier=${d}`;ds.get(ae).then(he=>{var Ce;return t(((Ce=he.data)==null?void 0:Ce.positions_list)||[])})};G();const V=setInterval(G,3e4);return()=>clearInterval(V)},[d]),m.useEffect(()=>{const G=localStorage.getItem("hyperToken"),V=localStorage.getItem("hyperAddress");!G||!V||(async()=>{var te,ae;try{const he=await ji(V.toLowerCase(),G);he!=null&&he.success&&(ne(he.whitelist),J(((te=he.mushboomer_counts)==null?void 0:te.eth)||0),X(((ae=he.mushboomer_counts)==null?void 0:ae.sol)||0))}catch{}})()},[]),m.useEffect(()=>{localStorage.getItem("hyperToken")&&(z(),Q())},[]);const re=async({walletAddress:G,isFollow:V,isScalper:te})=>{try{const ae=localStorage.getItem("hyperToken"),he=localStorage.getItem("hyperAddress");if(!ae){U(!0);return}const Ce=V?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",ce=V?{address:he?he.toLowerCase():localAddress,token:ae,follow_address:G.toLowerCase()}:{address:he?he.toLowerCase():localAddress,token:ae},Ae=await(await fetch(Ce,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ce)})).json();if(!Ae.success){ln.error(Ae.error_message||"Something went wrong");return}z(),Q(),P(Array.isArray(Ae==null?void 0:Ae.data)?[...Ae.data].sort((ye,je)=>new Date(je.created_at||0)-new Date(ye.created_at||0)):Ae==null?void 0:Ae.data),F(G),N(te),w(!0)}catch(ae){ln.error(ae.message||"Something went wrong")}},pe=m.useMemo(()=>[...new Set(e.map(G=>G.coin))],[e]),Y=m.useMemo(()=>e.filter(G=>{if(n!=="All"&&G.coin!==n||s!=="All"&&G.direction!==s.toLowerCase()||d!=="All"&&![String(d),Ju[d].label].includes(String(G.user_tier)))return!1;if(o){const V=Number(G.unrealized_pnl),te=Math.min(o.min,o.max),ae=Math.max(o.min,o.max);if(V<te||V>ae)return!1}return!(c==="Profit"&&Number(G.funding_paid)<=0||c==="Loss"&&Number(G.funding_paid)>=0)}),[e,n,s,o,c,d]),ie=G=>{if(G==null)return"-";const V=Number(G),te=V<0?"-":"",ae=Math.abs(V);return ae>=1e9?`${te}$${(ae/1e9).toFixed(2)}B`:ae>=1e6?`${te}$${(ae/1e6).toFixed(2)}M`:ae>=1e3?`${te}$${(ae/1e3).toFixed(2)}K`:`${te}$${ae.toFixed(2)}`},oe=[{key:"rank",label:"#",width:"46px",render:(G,V,te)=>i.jsx("span",{className:"text-[#9B9B9B]",children:te+1})},{key:"wallet",label:"Wallet",width:"210px",render:(G,V)=>{const te=jue(V.user_tier);return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[18px] leading-none",children:te.emoji}),i.jsx("a",{href:`/wallet-details/${V.address}`,target:"_blank",onClick:ae=>ae.stopPropagation(),className:"text-white font-medium hover:text-white w-24",children:Z1n(V.address)}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ${te.bg} ${te.txt}`,children:te.label})]})}},{key:"coin",label:"Coin",sortable:!0,width:"95px",render:(G,V)=>i.jsxs("a",{href:`/terminal/${V.coin}`,target:"_blank",rel:"noreferrer",className:"flex items-center text-white hover:text-gray-400 font-medium",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${V.coin}.svg`,onError:ra,className:"w-5 h-5 mr-2"}),V.coin]})},{key:"direction",label:"Direction",width:"150px ",sortable:!0,render:(G,V)=>{const te=V.direction==="long",ae=te?"LONG":"SHORT",he=te?"#67FFBD":"#FF797C",Ce=te?"bg-[#67ffbd]/20":"bg-[#ff797c]/20";return i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("div",{className:`inline-flex items-center gap-1 px-2 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${Ce}`,style:{color:he},children:[i.jsx(Ts,{className:`w-3 h-3 ${te?"rotate-180":""}`,style:{color:he}}),ae]}),i.jsxs("div",{className:`inline-flex items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium ${Ce}`,style:{color:he},children:[V.max_leverage,"X"]})]})}},{key:"notional",label:"Position",sortable:!0,width:"130px",sortValue:G=>Number(G.notional),render:(G,V)=>ie(Number(V.notional))},{key:"szi",label:"Size",sortable:!0,sortValue:G=>Number(G.szi),render:G=>ie(G)},{key:"entry_price",label:"Entry",sortable:!0,sortValue:G=>Number(G.entry_price),render:G=>ie(G)},{key:"market_price",label:"Market",sortable:!0,sortValue:G=>Number(G.market_price),render:G=>ie(G)},{key:"unrealized_pnl",label:"PnL",sortable:!0,sortValue:G=>Math.abs(Number(G.unrealized_pnl)),render:G=>{const V=Number(G)>=0;return i.jsxs("span",{className:`flex items-center ${V?"text-[#3DB380]":"text-[#FF797C]"}`,children:[ie(Math.abs(G)),i.jsx("img",{src:V?iE:aE,className:"ml-[6px] w-[9px] h-[8px]"})]})}},{key:"liq_price",label:"Liq. Price",sortable:!0,sortValue:G=>Number(G.liq_price),render:G=>ie(G)},{key:"funding_paid",label:"Fee",sortable:!0,sortValue:G=>Number(G.funding_paid),render:G=>{const V=Number(G)>=0;return i.jsxs("span",{className:`flex items-center ${V?"text-[#3DB380]":"text-[#FF797C]"}`,children:[ie(Math.abs(G)),i.jsx("img",{src:V?iE:aE,className:"ml-[6px] w-[9px] h-[8px]"})]})}},{key:"action",label:"Action",width:"100px",render:(G,V)=>{const te=L.some(ae=>ae.wallet_address===V.address);return i.jsx("div",{onClick:ae=>{ae.preventDefault(),ae.stopPropagation(),re({walletAddress:V.address,isFollow:te})},className:"flex w-[81px] py-2 px-4 justify-center items-center gap-2 flex-shrink-0 rounded-[8px] bg-[#262626] text-[#929292] font-inter text-[12px] font-normal leading-[8px] tracking-[-0.12px] cursor-pointer hover:bg-[#585858] hover:text-white transition-all",children:"Copy Trade"})}}];return i.jsxs(i.Fragment,{children:[i.jsx(v5,{open:v,setOpen:w,copyTradeData:I,copyTradeWallet:R,setCopyTradeWallet:F,isScalper:C,setCopyTradeData:P}),i.jsx(pi,{content:"Displays real-time executed trades from top whales.",children:i.jsxs("div",{className:"flex items-center gap-2 mb-4 mt-8 w-fit",children:[i.jsx("h2",{className:"text-white text-[16px] leading-[21px] font-medium tracking-[-0.32px] pl-[5px] font-inter",children:"Whale Positions"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]}),i.jsx("img",{className:"-ml-[4px]",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("div",{className:"w-full opacity-0 animate-fadeInUp",children:[i.jsxs("div",{className:"md:hidden mt-4",children:[i.jsxs("button",{onClick:()=>g(G=>!G),className:"w-[110px] h-[32px] rounded-[8px] flex items-center justify-center px-[8px] py-[12px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-manrope text-[14px] font-medium",children:[i.jsx("img",{src:Eyt,className:"w-[21px] h-[21px] mr-2"}),"Filters"]}),i.jsx("div",{className:`overflow-hidden transition-all duration-300 ${x?"max-h-[640px] mt-4":"max-h-0"}`,children:i.jsx(uNe,{mobile:!0,symbols:pe,symbol:n,setSymbol:r,side:s,setSide:a,pnl:o,setPnl:l,fund:c,setFund:u,tier:d,setTier:f})})]}),i.jsx("div",{className:"hidden md:block",children:i.jsx(uNe,{symbols:pe,symbol:n,setSymbol:r,side:s,setSide:a,pnl:o,setPnl:l,fund:c,setFund:u,tier:d,setTier:f})}),e.length===0?i.jsx("div",{className:"space-y-2",children:Array.from({length:34}).map((G,V)=>i.jsx("div",{className:"animate-pulse bg-[#202020] h-[24px] w-full rounded-md"},V))}):i.jsx(Ru,{data:Y,columns:oe,rowKey:G=>G.id,rowHeight:42,listHeight:window.innerHeight-180,tableClassName:"text-[14px]",theadClassName:"text-[13px] font-inter !text-[#9B9B9B] bg-transparent font-normal ",tbodyClassName:"text-[14px]",cellClassName:"text-[14px] font-medium",rowClassName:"bg-transparent border-b border-[#1E1E1E] last:border-0 py-5"})]})]})}function nQ({children:e,value:t}){return i.jsx(L1n,{asChild:!0,children:i.jsxs("button",{className:"h-8 px-3 rounded-lg flex items-center gap-2 text-[13px] bg-transparent text-[#fff] border border-[#2A2A2A]",children:[e,i.jsx(N9,{className:"w-4 h-4 shrink-0"})]})})}function uNe({mobile:e=!1,symbols:t,symbol:n,setSymbol:r,side:s,setSide:a,pnl:o,setPnl:l,fund:c,setFund:u,tier:d,setTier:f}){const[x,g]=m.useState(""),[v,w]=m.useState("");m.useEffect(()=>{if(x===""&&v===""){l(null);return}const N=x===""?null:Number(x),I=v===""?null:Number(v),P=N??I??0,R=I??N??1/0;l({min:P,max:R,label:`${P<0?"-":""}$${Math.abs(P)} - ${R===1/0?"∞":`${R<0?"-":""}$${Math.abs(R)}`}`})},[x,v]);const C=e?"flex flex-wrap gap-2 px-4 py-4 bg-[#1B1B1B] rounded-[16px]":"flex items-center gap-[8px] py-3 overflow-x-auto";return i.jsxs("div",{className:C,children:[!e&&i.jsxs("div",{className:"flex items-center gap-[8px] text-white font-medium pr-[8px]",children:[i.jsx("img",{src:jyt,className:"w-[21px] h-[21px]"}),i.jsx("span",{className:"font-manrope text-[14px] font-medium",children:"Filters"})]}),i.jsxs(JX,{children:[i.jsxs(nQ,{value:n!=="All",children:["Symbol"," ",i.jsxs("span",{className:"ml-1 px-1.5 py-0.5 flex items-center gap-1 text-white",children:[n!=="All"&&i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${n}.svg`,onError:ra,className:"w-4 h-4"}),n]})]}),i.jsx(eQ,{sideOffset:6,className:"z-50 min-w-[140px] max-h-[280px] overflow-y-auto rounded-md bg-[#242424] p-2",children:["All",...t].map(N=>i.jsxs(tQ,{onSelect:()=>r(N),className:`h-8 px-2 flex items-center gap-2 rounded cursor-pointer text-[#A8A8A8] font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-[#353535] hover:text-white ${n===N?"bg-[#2F2F2F]":""}`,children:[N!=="All"&&i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${N}.svg`,onError:ra,className:"w-4 h-4"}),N]},N))})]}),i.jsxs(JX,{children:[i.jsxs(nQ,{value:s!=="All",children:["Side ",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:s})]}),i.jsx(eQ,{sideOffset:6,className:"z-50 rounded-md bg-[#242424] p-2 text-[#A8A8A8]",children:["All","Long","Short"].map(N=>i.jsx(tQ,{onSelect:()=>a(N),className:`h-8 px-2 flex items-center gap-2 rounded cursor-pointer text-[#A8A8A8] font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-[#353535] hover:text-white ${s===N?"bg-[#2F2F2F]":""}`,children:N},N))})]}),i.jsxs(JX,{children:[i.jsxs(nQ,{value:c!=="All",children:["Fee ",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:c})]}),i.jsx(eQ,{sideOffset:6,className:"z-50 rounded-md bg-[#242424] p-2 text-[#A8A8A8]",children:["All","Profit","Loss"].map(N=>i.jsx(tQ,{onSelect:()=>u(N),className:`h-8 px-2 flex items-center gap-2 rounded cursor-pointer text-[#A8A8A8] font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-[#353535] hover:text-white ${c===N?"bg-[#2F2F2F]":""}`,children:N},N))})]}),i.jsxs(K1n,{children:[i.jsx(Y1n,{asChild:!0,children:i.jsxs("button",{className:"h-8 px-3 rounded-lg flex items-center gap-2 text-[13px] bg-transparent text-[#fff] border border-[#2A2A2A]",children:["Unrealized PnL",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:o?o.label:"All"}),i.jsx(N9,{className:"w-4 h-4"})]})}),i.jsx(X1n,{children:i.jsxs(Q1n,{sideOffset:6,align:"start",className:"z-50 w-64 rounded-lg bg-[#242424] p-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("span",{className:"text-white font-manrope text-[13px] font-medium leading-[8px] pl-[15px]",children:"Unrealized PnL"}),i.jsx("button",{onClick:()=>{g(""),w("")},className:"rounded-[6px] border border-[#353535] px-2 py-[6px] text-[#CECECE] font-manrope text-[11px] font-medium leading-[8px] bg-transparent",children:"Clear"})]}),i.jsx("div",{className:"space-y-3",children:["Min","Max"].map((N,I)=>{const P=I===0?x:v,R=I===0?g:w,F=P!=="";return i.jsxs("div",{children:[i.jsx("label",{className:"block mb-1 text-[#A8A8A8] text-[13px] leading-[8px] tracking-[-0.26px] font-normal pl-[15px] pb-[9px]",children:N}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#67FFBD] text-sm",children:"$"}),i.jsx("input",{type:"number",value:P,onChange:U=>R(U.target.value),placeholder:"..",className:`w-full h-[32px] pl-7 pr-3 rounded-md outline-none text-[14px] leading-[8px] tracking-[-0.28px] font-medium ${F?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"bg-[#353535] text-[#A8A8A8]"}`})]})]},N)})}),i.jsx("div",{className:"h-px bg-[#363636]"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-white font-inter text-[13px] font-medium leading-[8px] pl-[15px] pb-[13px] pt-1",children:"Presets"}),J1n.map(N=>i.jsx("button",{onClick:()=>{N.label==="All"?(g(""),w("")):(g(N.min.toString()),w(N.max===1/0?"":N.max.toString()))},className:`w-full text-left px-3 py-2 rounded-md text-[13px] leading-[8px] tracking-[-0.26px] font-medium bg-transparent ${(o==null?void 0:o.label)===N.label?"bg-[#2F2F2F] text-white":"text-[#A8A8A8]"} hover:bg-[#2A2A2A] hover:rounded-[6px] hover:p-[9px] hover:text-white hover:border-none`,children:N.label},N.label))]})]})})]}),i.jsx("div",{className:"h-5 w-px bg-[#262626] mx-3"}),i.jsx("div",{className:"inline-flex items-center h-8 px-1.5 py-[18px] rounded-[8px] border border-[#262626] flex-shrink-0 gap-[12px]",children:i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsx("div",{onClick:()=>f("All"),className:`flex items-center justify-center h-7 w-7 px-4 rounded-[8px] text-white text-[14px] font-inter leading-[16px] cursor-pointer transition-colors ${d==="All"?"bg-[#262626]":"hover:bg-[#262626]"}`,children:"All"}),H_.map(({id:N,emoji:I,description:P})=>{const R=d===N;return i.jsx("div",{onClick:()=>f(R?"All":N),className:`h-7 w-7 flex items-center justify-center rounded-[8px] text-[18px] cursor-pointer transition-colors ${R?"bg-[#262626]":"hover:bg-[#262626]"}`,children:i.jsx(pi,{content:P,children:I})},N)})]})})]})}function tbn({data:e}){var d,f;if(!e)return i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 flex justify-between items-center h-[128px] animate-pulse",children:[i.jsxs("div",{className:"space-y-3 max-w-[220px] flex-1",children:[i.jsx("div",{className:"h-[16px] w-[80px] rounded bg-[#262626]"}),i.jsx("div",{className:"h-[16px] w-[60px] rounded bg-[#262626]"}),i.jsx("div",{className:"h-[32px] w-full rounded bg-[#262626]"})]}),i.jsx("div",{className:"flex flex-col items-center gap-3",children:i.jsx("div",{className:"h-[96px] w-[96px] rounded-full bg-[#262626]"})})]});const t=((d=e.long)==null?void 0:d.position)??0,n=((f=e.short)==null?void 0:f.position)??0,r=t+n,s=t>=n,a=r?Math.round(Math.max(t,n)/r*100):0,o=s?"#67FFBD":"#FF797C",l=s?"#FF797C":"#67FFBD",c=s?"#1B4734":"#5E2425",u={chart:{type:"radialBar",sparkline:{enabled:!0}},plotOptions:{radialBar:{startAngle:-90,endAngle:90,hollow:{size:"60%"},track:{background:l,strokeWidth:"100%",margin:0},dataLabels:{show:!1}}},stroke:{lineCap:"round"},fill:{colors:[o]}};return i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 flex justify-between items-center h-[128px] opacity-0 animate-fadeInUp",children:[i.jsxs("div",{className:"space-y-2 max-w-[220px]",children:[i.jsx("div",{className:"text-[#929292] text-[14px] leading-[16px] tracking-[-0.14px]",children:"Direction"}),i.jsx("div",{className:"text-white text-[14px] font-semibold leading-[16px] tracking-[-0.14px]",children:s?"Long":"Short"}),i.jsxs("p",{className:"text-[#9C9C9C] text-[14px] leading-[16px] tracking-[-0.12px]",children:["The least loss and funding load in the last 24 hours is on the"," ",s?"Long":"Short"," side."]})]}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsxs("div",{className:"relative w-[96px] h-[48px]",children:[i.jsx(HL,{options:u,series:[a],height:96,width:96,type:"radialBar"}),i.jsx("div",{className:"absolute inset-0 flex items-center justify-center translate-y-[10px]",children:i.jsxs("span",{className:"text-white font-semibold font-manrope text-[18px] leading-[21px] mt-5",children:["%",a]})})]}),i.jsxs("div",{className:`mt-3 rounded-[6px] px-1.5 py-1 flex items-center gap-1 ${s?"bg-[#67FFBD]":"bg-[#FF797C]"}`,children:[s?i.jsx(nse,{className:"w-[10px] h-[10px]",style:{color:c}}):i.jsx(Bl,{className:"w-[10px] h-[10px]",style:{color:c}}),i.jsx("span",{className:"text-[11px] font-semibold leading-[8px] tracking-[0.66px] font-[Manrope]",style:{color:c},children:s?"LONG":"SHORT"})]})]})]})}var rQ,jU="HoverCard",[hWe,Cvn]=E5(jU,[l8]),EU=l8(),[nbn,_U]=hWe(jU),pWe=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:a,openDelay:o=700,closeDelay:l=300}=e,c=EU(t),u=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),x=m.useRef(!1),[g,v]=bU({prop:r,defaultProp:s??!1,onChange:a,caller:jU}),w=m.useCallback(()=>{clearTimeout(d.current),u.current=window.setTimeout(()=>v(!0),o)},[o,v]),C=m.useCallback(()=>{clearTimeout(u.current),!f.current&&!x.current&&(d.current=window.setTimeout(()=>v(!1),l))},[l,v]),N=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(d.current)},[]),i.jsx(nbn,{scope:t,open:g,onOpenChange:v,onOpen:w,onClose:C,onDismiss:N,hasSelectionRef:f,isPointerDownOnContentRef:x,children:i.jsx(Tue,{...c,children:n})})};pWe.displayName=jU;var mWe="HoverCardTrigger",xWe=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=_U(mWe,n),a=EU(n);return i.jsx(vU,{asChild:!0,...a,children:i.jsx(Lc.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:li(e.onPointerEnter,oD(s.onOpen)),onPointerLeave:li(e.onPointerLeave,oD(s.onClose)),onFocus:li(e.onFocus,s.onOpen),onBlur:li(e.onBlur,s.onClose),onTouchStart:li(e.onTouchStart,o=>o.preventDefault())})})});xWe.displayName=mWe;var zue="HoverCardPortal",[rbn,sbn]=hWe(zue,{forceMount:void 0}),gWe=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,a=_U(zue,t);return i.jsx(rbn,{scope:t,forceMount:n,children:i.jsx(w2,{present:n||a.open,children:i.jsx(Fue,{asChild:!0,container:s,children:r})})})};gWe.displayName=zue;var aD="HoverCardContent",bWe=m.forwardRef((e,t)=>{const n=sbn(aD,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,a=_U(aD,e.__scopeHoverCard);return i.jsx(w2,{present:r||a.open,children:i.jsx(ibn,{"data-state":a.open?"open":"closed",...s,onPointerEnter:li(e.onPointerEnter,oD(a.onOpen)),onPointerLeave:li(e.onPointerLeave,oD(a.onClose)),ref:t})})});bWe.displayName=aD;var ibn=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,...l}=e,c=_U(aD,n),u=EU(n),d=m.useRef(null),f=au(t,d),[x,g]=m.useState(!1);return m.useEffect(()=>{if(x){const v=document.body;return rQ=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=rQ,v.style.webkitUserSelect=rQ}}},[x]),m.useEffect(()=>{if(d.current){const v=()=>{g(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var C;((C=document.getSelection())==null?void 0:C.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),m.useEffect(()=>{d.current&&lbn(d.current).forEach(w=>w.setAttribute("tabindex","-1"))}),i.jsx(yU,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:li(a,v=>{v.preventDefault()}),onDismiss:c.onDismiss,children:i.jsx(Iue,{...u,...l,onPointerDown:li(l.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:f,style:{...l.style,userSelect:x?"text":void 0,WebkitUserSelect:x?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),abn="HoverCardArrow",obn=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=EU(n);return i.jsx(Pue,{...s,...r,ref:t})});obn.displayName=abn;function oD(e){return t=>t.pointerType==="touch"?void 0:e()}function lbn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var cbn=pWe,ubn=xWe,dbn=gWe,fbn=bWe;const hbn="#67FFBD",pbn="#FF797C",sQ=e=>{const t=Math.abs(Number(e));return t>=1e9?`$${(t/1e9).toFixed(2)}B`:t>=1e6?`$${(t/1e6).toFixed(2)}M`:t>=1e3?`$${(t/1e3).toFixed(1)}K`:`$${t.toFixed(0)}`};function mbn({data:e=[],title:t=""}){const n=m.useMemo(()=>e.map(r=>({...r,total:r.total??r.long+r.short})).sort((r,s)=>s.total-r.total).slice(0,10),[e]);return i.jsxs("div",{className:"flex w-96 min-w-[240px] flex-col gap-[12px] rounded-[12px] border-[0.8px] border-[rgba(133,133,133,0.32)] bg-[rgba(255,255,255,0.08)] p-[12px] shadow-[0_4px_4px_0_#050505] backdrop-blur-[43px]",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("span",{className:"text-[14px] font-medium leading-[14px] tracking-[-0.14px] text-white",children:t})}),n.map(r=>{const s=(r.long/r.total*100).toFixed(1),a=(100-s).toFixed(1),o=i.jsxs("div",{className:"flex flex-col gap-[2px] rounded-[8px] border-[0.8px] border-[rgba(133,133,133,0.32)] bg-[rgba(255,255,255,0.08)] shadow-[0_2px_2px_0_rgba(5,5,5,0.48)] backdrop-blur-[43px] p-2 space-y-[2px]",children:[i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("span",{className:"inline-block h-[6px] w-[6px] rounded-full",style:{backgroundColor:hbn}}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:"Long"}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:sQ(r.long)}),i.jsxs("span",{className:"text-[10px] font-medium leading-[10px] text-[#909090]",children:["(",s,"%)"]})]}),i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("span",{className:"inline-block h-[6px] w-[6px] rounded-full",style:{backgroundColor:pbn}}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:"Short"}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:sQ(r.short)}),i.jsxs("span",{className:"text-[10px] font-medium leading-[10px] text-[#909090]",children:["(",a,"%)"]})]})]});return i.jsx(pi,{content:o,children:i.jsxs("div",{className:"flex items-center gap-[8px] w-full",children:[i.jsxs("div",{className:"flex w-[100px] items-center gap-[4px] mt-[2px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${r.coin}.svg`,alt:r.coin,className:"h-[18px] w-[18px] rounded-full",onError:l=>{l.currentTarget.onerror=null,l.currentTarget.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='9' cy='9' r='9' fill='%23575757'/%3E%3C/svg%3E"}}),i.jsx("span",{className:"text-[12px] font-normal leading-[14px] tracking-[-0.12px] text-white",children:r.coin})]}),i.jsxs("div",{className:"flex h-[16px] w-full gap-[2px] overflow-hidden ml-3",children:[i.jsx("div",{className:"flex rounded-[4px] items-center justify-center bg-[rgba(103,255,189,0.16)] text-[10px] font-semibold leading-[10px] tracking-[-0.1px] text-[#67FFBD]",style:{flexGrow:r.long,flexBasis:0},children:s>=15?`${s}%`:""}),i.jsx("div",{className:"flex rounded-[4px] items-center justify-center bg-[rgba(255,121,124,0.16)] text-[10px] font-semibold leading-[10px] tracking-[-0.1px] text-[#FF797C]",style:{flexGrow:r.short,flexBasis:0},children:a>=15?`${a}%`:""})]}),i.jsx("span",{className:"w-[48px] text-right text-[12px] font-medium leading-[14px] tracking-[-0.12px] text-white mt-[2px]",children:sQ(r.total)})]})},r.coin)})]})}const xbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/open_interest/?period=1d",gbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/tx_summary/?period=1d",bbn={BTC:"Bitcoin",ETH:"Ethereum",HYPE:"Hyperliquid",SOL:"Solana",XRP:"XRP",PUMP:"Pump",FARTCOIN:"Fartcoin"},ybn=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(0)}K`:`${n}$${r.toFixed(0)}`};function vbn(){const[e,t]=m.useState(null),[n,r]=m.useState([]),[s,a]=m.useState([]);return m.useEffect(()=>{const o=async()=>{var c,u,d,f,x,g;try{const[v,w]=await Promise.all([ds.get(xbn),ds.get(gbn)]),C=((u=(c=v.data)==null?void 0:c.position_summary)==null?void 0:u.slice(0,10).map(R=>({coin:R.coin,long:Number(R.long),short:Number(R.short),total:Number(R.total)})))||[],N=((f=(d=w.data)==null?void 0:d.whale_summary)==null?void 0:f.slice(0,10).map(R=>({coin:R.coin,long:Number(R.long_tx_count),short:Number(R.short_tx_count),total:Number(R.total_tx_count)})))||[];r(C),a(N);const I=C[0]||{},P=((g=(x=w.data)==null?void 0:x.whale_summary)==null?void 0:g[0])||{};t([{type:"position",title:"Highest OI",coin:I.coin||"",name:bbn[I.coin]||I.coin,value:ybn(I.total)},{type:"trader",title:"Most Traded",coin:P.coin||"",name:"Top Trader",value:`${P.whale_count??"-"} Whales | TX: ${P.total_tx_count??"-"}`}])}catch{t([])}};o();const l=setInterval(o,3e4);return()=>clearInterval(l)},[]),e?i.jsx("div",{className:"border border-[#1E1E1E] bg-[#101010] rounded-[16px] p-2 flex gap-2 h-[128px]",children:e.map(o=>i.jsxs(cbn,{openDelay:0,closeDelay:0,children:[i.jsx(ubn,{asChild:!0,children:i.jsxs("div",{className:"flex-1 bg-[#1B1B1B] rounded-[12px] p-[10px] flex flex-col gap-1 hover:bg-[#2A2A2A] transition cursor-pointer",children:[i.jsxs("div",{className:"flex gap-1 justify-between items-center",children:[i.jsx("span",{className:"text-[#929292] text-[14px] leading-[16px] tracking-[-0.14px]",children:o.title}),i.jsxs("div",{className:"relative w-3 h-3 flex justify-center items-center mt-[4px]",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]})]}),i.jsxs("div",{children:[i.jsx("img",{src:o.coin!=="wallet"?`https://app.hyperliquid.xyz/coins/${o.coin}.svg`:"https://app.hyperliquid.xyz/coins/BTC.svg",alt:o.coin,className:"w-[24px] h-[24px] mt-[5px]"}),i.jsxs("div",{className:"flex items-center gap-1 mt-[5px]",children:[i.jsx("div",{className:"text-white text-[14px] font-semibold leading-[16px] tracking-[-0.14px]",children:o.coin}),i.jsx("span",{className:"text-[#B7B7B7] text-[12px] leading-[11px]",children:o.name})]})]}),i.jsx("div",{className:"text-white font-inter text-[13px] font-medium leading-[14px] tracking-[-0.14px] mt-[6px] break-words whitespace-normal",children:o.value})]})}),i.jsx(dbn,{children:i.jsx(fbn,{side:"right",align:"start",sideOffset:0,collisionPadding:8,children:i.jsx(mbn,{title:o.type==="position"?"Top 10 Open OI":"Top 5 Most Trades",data:o.type==="position"?n:s})})})]},o.title))}):i.jsx("div",{className:"border border-[#1E1E1E] bg-[#101010] rounded-[16px] p-2 flex gap-2 h-[128px]",children:Array.from({length:2}).map((o,l)=>i.jsxs("div",{className:"flex-1 bg-[#1B1B1B] rounded-[12px] p-[10px] flex flex-col gap-3 animate-pulse",children:[i.jsx("div",{className:"h-[16px] w-24 rounded bg-[#262626]"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-6 w-6 rounded-full bg-[#262626]"}),i.jsx("div",{className:"h-[14px] w-24 rounded bg-[#262626]"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-[14px] w-24 rounded bg-[#262626]"}),i.jsx("div",{className:"h-[14px] w-14 rounded bg-[#262626]"})]})]},l))})}const wbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/top_user_pnl/?period=1d",Cbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/high_risk_traders/?period=1d",Sbn=e=>`${e.slice(0,5)}...${e.slice(-4)}`,Nbn=e=>{const t=Math.abs(Number(e));return t>=1e9?`$${(t/1e9).toFixed(2)}B`:t>=1e6?`$${(t/1e6).toFixed(2)}M`:t>=1e3?`$${(t/1e3).toFixed(2)}K`:`$${t.toFixed(2)}`};function Abn(){const[e,t]=m.useState(null);return m.useEffect(()=>{const n=async()=>{var s,a,o,l;try{const[c,u]=await Promise.all([ds.get(wbn),ds.get(Cbn)]),d=(a=(s=c.data)==null?void 0:s.top_users)==null?void 0:a[0],f=(l=(o=u.data)==null?void 0:o.high_risk_traders)==null?void 0:l[0],x=(g,v,w="growth_rate")=>({title:v,address:Sbn(g.user_token),wallet:g.user_token,amount:`${Number(g.pnl)>=0?"+":"-"}${Nbn(g.pnl)}`,percent:`${Number(g[w]||0).toFixed(1)}%`});t([x(d,"Today's Trader","growth_rate"),x(f,"Low Risk Trader","total_win_rate")])}catch(c){console.error("Error loading Highlighted Whales",c),t([])}};n();const r=setInterval(n,3e4);return()=>clearInterval(r)},[]),e?i.jsx("div",{className:"flex gap-2 rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-2 ",children:e.map(({title:n,address:r,amount:s,percent:a,wallet:o},l)=>i.jsx("div",{className:"flex-1",children:i.jsx("a",{href:`/wallet-details/${o}`,target:"_blank",rel:"noopener noreferrer",className:"flex-1 cursor-pointer",children:i.jsxs("div",{className:"flex flex-col gap-4 rounded-[12px] bg-[#1B1B1B] p-[10px] hover:bg-[#2A2A2A] transition",children:[i.jsx("h3",{className:"text-[#929292] font-inter text-[14px] leading-[16px] tracking-[-0.14px]",children:n}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(QHe,{size:24,name:r}),i.jsx("span",{className:"text-white font-inter font-medium text-[14px] leading-[13px] tracking-[-0.14px]",children:r})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-white font-inter font-medium text-[14px] leading-[13px] tracking-[-0.14px]",children:s}),i.jsx(pi,{content:n==="Today's Trader"?"Growth Rate":"Win Rate",children:i.jsx("div",{className:"flex h-[18px] w-[48px] items-center justify-center gap-[2px] rounded-[4px] bg-[#67FFBD]/20 pl-[4px] pr-[6px] py-[4px]",children:i.jsx("span",{className:"font-manrope text-[11px] font-semibold leading-[8px] text-[#67FFBD]",children:a})})})]})]})})},l))}):i.jsx("div",{className:"flex gap-4 rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-2",children:Array.from({length:2}).map((n,r)=>i.jsx("div",{className:"flex-1 animate-pulse",children:i.jsxs("div",{className:"flex flex-col gap-4 rounded-[12px] bg-[#1B1B1B] p-[10px]",children:[i.jsx("div",{className:"h-[16px] w-24 rounded bg-[#262626]"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-6 w-6 rounded-full bg-[#262626]"}),i.jsx("div",{className:"h-[14px] w-32 rounded bg-[#262626]"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-[14px] w-20 rounded bg-[#262626]"}),i.jsx("div",{className:"h-[18px] w-12 rounded bg-[#262626]"})]})]})},r))})}function iQ(e){if(!e)return"-";const t=Math.floor((Date.now()-e.getTime())/1e3);return t<60?`Last updated ${t} sec ago`:`Last updated ${Math.floor(t/60)} min ago`}function jbn({data:e,lastUpdated:t}){const[n,r]=m.useState(0);return m.useEffect(()=>{const s=setInterval(()=>{r(a=>a+1)},1e3);return()=>clearInterval(s)},[]),i.jsxs("div",{className:"w-full flex flex-col xl:flex-row gap-4 mt-10",children:[i.jsxs("div",{className:"flex-1 min-w-[300px] bg-transparent space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(pi,{content:`Shows overall market direction from whale positions in the last 24 hours.
Covers all coins on Hyperliquid.
Note: Only includes whales with PERP equity > $1M.`,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white font-inter text-[16px] not-italic font-medium leading-[21px] tracking-[-0.32px]",children:"Market Insights"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full text-white",children:"LAST 24H"}),i.jsx("img",{className:"-ml-1",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:iQ(t)})]}),i.jsx(tbn,{data:e})]}),i.jsxs("div",{className:"flex-1 min-w-[300px] bg-transparent space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(pi,{content:"Highlights the most active assets by whale positions and trading volume.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white font-inter text-[16px] not-italic font-medium leading-[21px] tracking-[-0.32px]",children:"Asset Insights"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full text-white",children:"LAST 24H"}),i.jsx("img",{className:"-ml-1",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:iQ(t)})]}),i.jsx(vbn,{})]}),i.jsxs("div",{className:"flex-1 min-w-[300px] bg-transparent space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(pi,{content:"Spotlights standout whale traders based on daily performance and risk profile.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white font-inter text-[16px] not-italic font-medium leading-[21px] tracking-[-0.32px]",children:"Highlighted Whales"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full text-white",children:"LAST 24H"}),i.jsx("img",{className:"-ml-1",src:E0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:iQ(t)})]}),i.jsx(Abn,{})]})]})}function Ebn(){const[e,t]=m.useState(null),[n,r]=m.useState(null);return m.useEffect(()=>{const s=document.querySelector("main");return s&&(s.style.background="#050505"),()=>{s&&(s.style.background="")}},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"High Volume Trades on Hyperliquid"}),i.jsx("meta",{name:"description",content:"Track Hyperliquid high volume trades and whale activity in real-time."}),i.jsx("meta",{name:"og:title",content:"Hyperliquid High Volume Trades Tracker | DextraBot"}),i.jsx("meta",{name:"og:description",content:"Track Hyperliquid high volume trades and whale activity in real-time."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/hyperliquid-whale-trades"})]})}),i.jsxs("div",{className:"max-w-[1440px] w-full mx-auto px-4 font-manrope relative mt-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("h1",{className:"flex items-center gap-[6px] py-4 text-[18px] leading-[21px] tracking-[-0.36px] font-normal",children:[i.jsx("span",{className:"text-[#929292] font-normal",children:"Dextrabot"}),i.jsx("span",{className:"text-[#929292] font-normal",children:"/"}),i.jsx("img",{className:"w-6 h-6",src:Iyt,alt:"Dextrabot - Hyperliquid Whale Trades"}),i.jsx("span",{className:"hidden sm:block text-white font-bold text-[16px]",children:"Hyperliquid Whale Trades"}),i.jsx("span",{className:"block sm:hidden text-white font-bold text-[16px]",children:"Whale Trades"})]}),i.jsx(pi,{content:"Join our Telegram for Hyperliquid whale alerts.",children:i.jsxs("a",{href:"https://t.me/+bYnGEvP0fB41M2I0",target:"_blank",rel:"noopener noreferrer",className:"rounded-[10px] border border-[#242424] inline-flex h-8 px-2 py-3 justify-center items-center gap-[10px] shrink-0 text-white font-manrope text-[13px] font-semibold leading-[8px] hover:text-white",children:[i.jsx("img",{src:Dbt,alt:"Dextrabot Whale Trades - Join Telegram"}),"Join Telegram"]})})]}),i.jsxs("div",{className:"flex flex-col space-y-4 sm:flex-row sm:space-y-0 sm:space-x-4",children:[i.jsx("div",{className:"w-full sm:w-1/3",children:i.jsx(E0n,{onData:s=>{t(s),r(new Date)}})}),i.jsx("div",{className:"w-full sm:w-2/3",children:i.jsx(Q0n,{})})]}),i.jsx("div",{className:"mt-4",children:i.jsx(jbn,{data:e,lastUpdated:n})}),i.jsx("div",{className:"mt-4",children:i.jsx(ebn,{})})]})]})}const _bn=()=>{const{setSignModalOpen:e}=m.useContext(Qr),{address:t}=Jr(),[n,r]=m.useState(Array(6).fill("")),[s,a]=m.useState(""),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(!1),x=async()=>{try{const N=window.localStorage.getItem("hyperToken"),I=window.localStorage.getItem("hyperAddress");if(!N||n.join("")===""||n.join("").length<6){N?n.join("")===""?a("Please enter the verification code."):n.join("").length<6&&a("The verification code must be 6 characters long."):e(!0);return}l(!0),a("");const P="https://dextrabothypev2.nftinit.io/api/telegram/sign_with_telegram/",R={address:t?t.toLowerCase():I,token:N,temp_password:n.join("")},U=await(await fetch(P,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(R)})).json();U!=null&&U.success?(U!=null&&U.telegram_chat_id&&u(!0),r(Array(6).fill("")),ln.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#67ffbd",paddingLeft:"5px"},children:"Verified successfully."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),l(!1)):(console.log(U.error_message),a("Invalid code. Please request a new code from Telegram and try again."),f(!0),l(!1))}catch(N){console.error("Error in telegram verify:",N),ln.error(N.message||"Something went wrong!"),a(N.message||"Something went wrong!"),f(!0),l(!1)}},g=(N,I)=>{f(!1);const P=[...n];P[I]=N.target.value.toUpperCase().slice(0,1),r(P),N.target.value.length===1&&I<5&&document.getElementById(`code-input-${I+1}`).focus()},v=N=>{f(!1);const I=N.clipboardData.getData("Text").slice(0,6),P=[...n];for(let F=0;F<I.length;F++)P[F]=I[F].toUpperCase();r(P);const R=document.getElementById(`code-input-${(I==null?void 0:I.length)-1}`);R==null||R.focus(),R==null||R.select()},w=(N,I)=>{var P,R;if(f(!1),N.key==="Backspace"){if(n[I]){const F=[...n];F[I]="",r(F)}else if(I>0){const F=document.getElementById(`code-input-${I-1}`),U=[...n];U[I-1]="",r(U),F==null||F.focus()}}else N.key==="ArrowLeft"&&I>0?(P=document.getElementById(`code-input-${I-1}`))==null||P.focus():N.key==="ArrowRight"&&I<5&&((R=document.getElementById(`code-input-${I+1}`))==null||R.focus())},C=()=>{r(Array(6).fill("")),f(!1)};return i.jsxs("div",{className:"flex flex-col items-center justify-center px-2 pb-2 gap-6 w-max h-max bg-[#212121]/90 rounded-2xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#2a2a2a] relative pt-10",onPaste:v,children:[s&&i.jsxs("div",{style:{backdropFilter:"blur(16px)"},className:"w-full max-w-[345px] px-3 py-2 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 absolute top-2 ",children:[i.jsx("img",{src:ec,alt:"",className:"mb-[2.5px]"}),i.jsx("div",{className:"flex justify-start text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4 tracking-[-0.26px]",children:s})]}),c?i.jsxs("div",{className:"flex flex-col items-center text-white text-base font-medium font-['Inter'] text-center gap-2",children:[i.jsx("img",{src:ike,alt:""}),i.jsx("div",{className:"text-center text-white text-sm font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Successfully"}),i.jsx("div",{className:" w-[186px] text-center text-white text-[13px] font-normal font-['Inter'] leading-4",children:"Your Telegram account is now synced with your wallet."}),i.jsx("div",{className:"flex flex-col items-center gap-6 mt-[33px]",children:i.jsxs("div",{onClick:()=>window.open("https://t.me/Dextrabot_CopyTrade_bot","_blank"),className:"w-[345px] h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 cursor-pointer",children:[i.jsx("img",{src:ake,alt:""}),i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none",children:"Open Telegram App"})]})})]}):i.jsxs(i.Fragment,{children:[i.jsx("img",{src:Fyt,alt:"",className:"w-auto h-[40px]"}),i.jsx("h1",{className:"text-center text-white text-sm font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Verify Your Telegram Account"}),i.jsx("p",{className:"mb-2 -mt-4 text-center text-[#929292] text-[13px] font-normal font-['Inter'] leading-4 max-w-[240px]",children:"Enter the 6-character verification code sent to your Telegram account."}),i.jsx("div",{className:"flex gap-2",children:n.map((N,I)=>i.jsx("input",{id:`code-input-${I}`,type:"text",maxLength:"1",value:N,autoComplete:"off",onChange:P=>g(P,I),onKeyDown:P=>w(P,I),className:`${d?"border-[#ff787b]":"border-white/20"} w-10 h-12 text-center text-white text-[32px] font-medium font-['Inter'] leading-10 bg-transparent shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border-[0.60px] rounded-[10px] focus:bg-[#353535] outline-none`},I))}),i.jsxs("div",{className:"text-center",children:[i.jsxs("span",{class:"text-[#929292] text-[11px] font-normal font-['Inter'] leading-none",children:["Didn’t get a code?"," "]}),i.jsx("span",{onClick:()=>window.open("https://t.me/Dextrabot_CopyTrade_bot","_blank"),class:"text-[#929292] hover:text-white text-[11px] font-medium font-['Inter'] leading-4 cursor-pointer",children:"Open Telegram App"})]}),i.jsxs("div",{className:"flex items-center justify-center gap-2 relative",children:[i.jsx("div",{onClick:C,className:"w-[140px] h-10 px-6 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] outline outline-1 outline-offset-[-1px] outline-[#424242] flex justify-center items-center gap-2.5 cursor-pointer group",children:i.jsx("div",{className:"text-[#b7b7b7] group-hover:text-white text-sm font-semibold font-['Inter'] leading-4 tracking-[-0.28px]",children:"Clear"})}),i.jsx("div",{onClick:N=>{N.preventDefault(),o||x()},className:"w-[196px] h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-center items-center gap-2.5 cursor-pointer",children:o?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[72px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-[8px]",children:"Authorize Wallet"})})]})]})]})},kbn=()=>{const{isConnected:e,address:t}=Jr(),{hyperToken:n,hyperAddress:r,setSignModalOpen:s,setTelegramChatId:a,setSubscriberRole:o,setSubsExpireDay:l,setMushboomerETH:c,setMushboomerSOL:u,setIsReferralCode:d,setIsReferralCodeName:f,setIsWhitelist:x,setHyperToken:g,setHyperAddress:v}=m.useContext(Qr),[w,C]=m.useState(!!window.localStorage.getItem("hyperToken"));return m.useEffect(()=>{const N=window.localStorage.getItem("hyperToken");C(!!N)},[t,e,n,r]),m.useEffect(()=>{(async()=>{var R,F;const I=window.localStorage.getItem("hyperToken"),P=window.localStorage.getItem("hyperAddress");if(!(!I||!P))try{const U=await ji(P.toLowerCase(),I);U!=null&&U.success?(a(U==null?void 0:U.telegram_chat_id),o(U==null?void 0:U.subscriber_role),l(U==null?void 0:U.subs_expire_day),c((R=U==null?void 0:U.mushboomer_counts)==null?void 0:R.eth),u((F=U==null?void 0:U.mushboomer_counts)==null?void 0:F.sol),d(U==null?void 0:U.referral_code),f(U==null?void 0:U.refcode),x(U==null?void 0:U.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""))}catch(U){console.error("Token verification error:",U),console.error(U.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Telegram Verify – DextraBot"}),i.jsx("meta",{name:"description",content:"Verify your Telegram account to start earning with DextraBot's referral program. Follow the steps to confirm your Telegram identity and gain access to exclusive rewards."}),i.jsx("meta",{name:"og:title",content:"Telegram Verify – DextraBot"}),i.jsx("meta",{name:"og:description",content:"Verify your Telegram account to start earning with DextraBot's referral program. Follow the steps to confirm your Telegram identity and gain access to exclusive rewards."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/telegram-verify"})]})}),i.jsx("div",{style:{background:"linear-gradient(135deg, #0d0d0d 0%, #1c1c1c 50%, #0d0d0d 100%)"},className:"flex justify-center items-center w-full h-[calc(100vh-6rem)] sm:h-[calc(100vh-5rem)] min-h-max max-h-[calc(100vh-6rem)] sm:max-h-[calc(100vh-5rem)] px-4 pt-16 sm:pt-4 pb-10 bg-[#161616]",children:w?i.jsx(_bn,{}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(dU,{})})})]})};function Tbn({onRun:e}){const[t,n]=m.useState({wallet:"",pairs:[],equity:"",scale:"",period:"30D",method:"3"}),[r,s]=m.useState([]);m.useEffect(()=>{fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/").then(u=>u.json()).then(u=>s(u.coins.filter(d=>!d.startsWith("@")).map(d=>({value:d,label:d,icon:`https://app.hyperliquid.xyz/coins/${d}.svg`}))))},[]);const a=[{value:"All",label:"All"},...r],o=({label:u,icon:d})=>i.jsxs("div",{className:"flex items-center gap-2",children:[u!=="All"&&i.jsx("img",{src:d,alt:u,className:"w-4 h-4",onError:f=>f.currentTarget.style.display="none"}),i.jsx("span",{children:u})]}),l={control:(u,d)=>({...u,backgroundColor:"#1B1B1B",borderColor:"#303030",height:"32px",minHeight:"32px",borderRadius:"6px",boxShadow:"none",fontSize:"14px",alignItems:"center"}),valueContainer:u=>({...u,height:"32px",padding:"0 8px",display:"flex",alignItems:"center"}),input:u=>({...u,margin:0,padding:0,color:"#C9C9C9",fontSize:"14px",display:"flex",alignItems:"center"}),indicatorsContainer:u=>({...u,height:"32px"}),indicatorSeparator:u=>({...u,height:"16px",alignSelf:"center",backgroundColor:"#444"}),placeholder:u=>({...u,color:"#7F7F7F",fontSize:"14px",display:"flex",alignItems:"center"}),singleValue:u=>({...u,color:"#7F7F7F",fontSize:"14px",display:"flex",alignItems:"center"}),menu:u=>({...u,backgroundColor:"#1B1B1B",fontSize:"14px"}),option:(u,d)=>({...u,backgroundColor:d.isFocused?"#292929":"#1B1B1B",color:"#C9C9C9",fontSize:"14px",paddingTop:"8px",paddingBottom:"8px",display:"flex",alignItems:"center",":active":{backgroundColor:"#292929"}}),multiValue:u=>({...u,backgroundColor:"#292929"}),multiValueLabel:u=>({...u,color:"#fff",fontSize:"14px"}),multiValueRemove:u=>({...u,color:"#fff",":hover":{backgroundColor:"#555",color:"#fff"}})},c=u=>d=>n({...t,[u]:d.target.value});return i.jsxs("div",{className:"w-[388px] h-auto rounded-[16px] bg-[rgba(30,30,30,0.64)] backdrop-blur-[64px] p-6 flex flex-col gap-4",children:[i.jsx("h2",{className:"text-white font-inter text-[18px] font-semibold tracking-[-0.36px]",children:"Start your backtest"}),i.jsx("p",{className:"text-[#8E8E8E] text-[14px] leading-[16px] tracking-[-0.28px] w-[277px]",children:"Test how profitable it would be to copy any trader’s strategy"}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Wallet Address"}),i.jsx("input",{className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-3 text-[#7F7F7F] text-[14px] placeholder:text-[#7F7F7F] outline-none",placeholder:"Enter trader’s wallet address",value:t.wallet,onChange:c("wallet")})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Method"}),i.jsxs("select",{value:t.method,onChange:c("method"),className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-2 text-[14px] text-[#7F7F7F] outline-none",children:[i.jsx("option",{value:"1",disabled:!0,children:"Method I (coming soon)"}),i.jsx("option",{value:"2",disabled:!0,children:"Method II (coming soon)"}),i.jsx("option",{value:"3",children:"Method III"})]})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Trading Pairs"}),i.jsx(Cl,{options:a,isMulti:!0,placeholder:"All",closeMenuOnSelect:!1,hideSelectedOptions:!1,formatOptionLabel:o,styles:l,value:t.pairs.length?a.filter(u=>t.pairs.includes(u.value)):null,onChange:u=>{u!=null&&u.some(d=>d.value==="All")?n({...t,pairs:[]}):n({...t,pairs:u?u.map(d=>d.value):[]})}})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Initial Equity"}),i.jsx("input",{type:"number",placeholder:"1000",className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-3 text-[#7F7F7F] text-[14px] placeholder:text-[#7F7F7F] outline-none",value:t.equity,onChange:c("equity")})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Scaling Factor (%)"}),i.jsx("input",{type:"number",placeholder:"50",className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-3 text-[#7F7F7F] text-[14px] placeholder:text-[#7F7F7F] outline-none",value:t.scale,onChange:c("scale")})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Time Period"}),i.jsx("div",{className:"flex gap-2",children:["7D","30D","90D"].map(u=>i.jsx("button",{onClick:()=>n({...t,period:u}),className:`w-[40px] h-[32px] rounded-[6px] bg-transparent border border-[#303030] flex justify-center items-center text-[12px] ${t.period===u?"text-white":"text-[#7F7F7F]"}`,children:u},u))})]}),i.jsx("button",{onClick:()=>e(t),className:"h-[32px] mt-auto flex py-[12px] px-[24px] justify-center items-center gap-[10px] rounded-[10px] bg-[#1DE674] text-[#0B331C] text-[13px] font-inter font-semibold tracking-[-0.13px]",children:"Run Backtest"})]})}function Ibn(){const[e,t]=m.useState(0);return m.useEffect(()=>{const n=setInterval(()=>{t(r=>(r+1)%3)},600);return()=>clearInterval(n)},[]),i.jsxs("div",{className:"flex flex-col items-center justify-center h-full bg-transparent text-white text-[13px] font-inter space-y-2",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("span",{className:"font-semibold leading-[14px] tracking-[-0.26px]",children:"Backtest Engine"})," ",i.jsx("span",{className:"font-normal leading-[14px] tracking-[-0.26px]",children:"is running..."})]}),i.jsx("div",{className:"text-[#7F7F7F] text-[13px] leading-[14px] tracking-[-0.26px] text-center font-normal",children:"Your strategy is being tested, the results will be here shortly...."}),i.jsx("div",{className:"flex gap-2 pt-1",children:[0,1,2].map(n=>i.jsx("div",{className:`w-[8px] h-[8px] rounded-full transition-all duration-300 ${n===e?"bg-[#1DE674]":"bg-[#404040]"}`},n))})]})}var Hue={};(function e(t,n,r,s){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!t.OffscreenCanvas)return!1;var te=new OffscreenCanvas(1,1),ae=te.getContext("2d");ae.fillRect(0,0,1,1);var he=te.transferToImageBitmap();try{ae.createPattern(he,"no-repeat")}catch{return!1}return!0}();function c(){}function u(te){var ae=n.exports.Promise,he=ae!==void 0?ae:t.Promise;return typeof he=="function"?new he(te):(te(c,c),null)}var d=function(te,ae){return{transform:function(he){if(te)return he;if(ae.has(he))return ae.get(he);var Ce=new OffscreenCanvas(he.width,he.height),ce=Ce.getContext("2d");return ce.drawImage(he,0,0),ae.set(he,Ce),Ce},clear:function(){ae.clear()}}}(l,new Map),f=function(){var te=Math.floor(16.666666666666668),ae,he,Ce={},ce=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(ae=function(ge){var Ae=Math.random();return Ce[Ae]=requestAnimationFrame(function ye(je){ce===je||ce+te-1<je?(ce=je,delete Ce[Ae],ge()):Ce[Ae]=requestAnimationFrame(ye)}),Ae},he=function(ge){Ce[ge]&&cancelAnimationFrame(Ce[ge])}):(ae=function(ge){return setTimeout(ge,te)},he=function(ge){return clearTimeout(ge)}),{frame:ae,cancel:he}}(),x=function(){var te,ae,he={};function Ce(ce){function ge(Ae,ye){ce.postMessage({options:Ae||{},callback:ye})}ce.init=function(ye){var je=ye.transferControlToOffscreen();ce.postMessage({canvas:je},[je])},ce.fire=function(ye,je,Ie){if(ae)return ge(ye,null),ae;var Re=Math.random().toString(36).slice(2);return ae=u(function(Qe){function $e(it){it.data.callback===Re&&(delete he[Re],ce.removeEventListener("message",$e),ae=null,d.clear(),Ie(),Qe())}ce.addEventListener("message",$e),ge(ye,Re),he[Re]=$e.bind(null,{data:{callback:Re}})}),ae},ce.reset=function(){ce.postMessage({reset:!0});for(var ye in he)he[ye](),delete he[ye]}}return function(){if(te)return te;if(!r&&a){var ce=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
`);try{te=new Worker(URL.createObjectURL(new Blob([ce])))}catch(ge){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",ge),null}Ce(te)}return te}}(),g={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function v(te,ae){return ae?ae(te):te}function w(te){return te!=null}function C(te,ae,he){return v(te&&w(te[ae])?te[ae]:g[ae],he)}function N(te){return te<0?0:Math.floor(te)}function I(te,ae){return Math.floor(Math.random()*(ae-te))+te}function P(te){return parseInt(te,16)}function R(te){return te.map(F)}function F(te){var ae=String(te).replace(/[^0-9a-f]/gi,"");return ae.length<6&&(ae=ae[0]+ae[0]+ae[1]+ae[1]+ae[2]+ae[2]),{r:P(ae.substring(0,2)),g:P(ae.substring(2,4)),b:P(ae.substring(4,6))}}function U(te){var ae=C(te,"origin",Object);return ae.x=C(ae,"x",Number),ae.y=C(ae,"y",Number),ae}function L(te){te.width=document.documentElement.clientWidth,te.height=document.documentElement.clientHeight}function z(te){var ae=te.getBoundingClientRect();te.width=ae.width,te.height=ae.height}function Q(te){var ae=document.createElement("canvas");return ae.style.position="fixed",ae.style.top="0px",ae.style.left="0px",ae.style.pointerEvents="none",ae.style.zIndex=te,ae}function ne(te,ae,he,Ce,ce,ge,Ae,ye,je){te.save(),te.translate(ae,he),te.rotate(ge),te.scale(Ce,ce),te.arc(0,0,1,Ae,ye,je),te.restore()}function J(te){var ae=te.angle*(Math.PI/180),he=te.spread*(Math.PI/180);return{x:te.x,y:te.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:te.startVelocity*.5+Math.random()*te.startVelocity,angle2D:-ae+(.5*he-Math.random()*he),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:te.color,shape:te.shape,tick:0,totalTicks:te.ticks,decay:te.decay,drift:te.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:te.gravity*3,ovalScalar:.6,scalar:te.scalar,flat:te.flat}}function X(te,ae){ae.x+=Math.cos(ae.angle2D)*ae.velocity+ae.drift,ae.y+=Math.sin(ae.angle2D)*ae.velocity+ae.gravity,ae.velocity*=ae.decay,ae.flat?(ae.wobble=0,ae.wobbleX=ae.x+10*ae.scalar,ae.wobbleY=ae.y+10*ae.scalar,ae.tiltSin=0,ae.tiltCos=0,ae.random=1):(ae.wobble+=ae.wobbleSpeed,ae.wobbleX=ae.x+10*ae.scalar*Math.cos(ae.wobble),ae.wobbleY=ae.y+10*ae.scalar*Math.sin(ae.wobble),ae.tiltAngle+=.1,ae.tiltSin=Math.sin(ae.tiltAngle),ae.tiltCos=Math.cos(ae.tiltAngle),ae.random=Math.random()+2);var he=ae.tick++/ae.totalTicks,Ce=ae.x+ae.random*ae.tiltCos,ce=ae.y+ae.random*ae.tiltSin,ge=ae.wobbleX+ae.random*ae.tiltCos,Ae=ae.wobbleY+ae.random*ae.tiltSin;if(te.fillStyle="rgba("+ae.color.r+", "+ae.color.g+", "+ae.color.b+", "+(1-he)+")",te.beginPath(),o&&ae.shape.type==="path"&&typeof ae.shape.path=="string"&&Array.isArray(ae.shape.matrix))te.fill(oe(ae.shape.path,ae.shape.matrix,ae.x,ae.y,Math.abs(ge-Ce)*.1,Math.abs(Ae-ce)*.1,Math.PI/10*ae.wobble));else if(ae.shape.type==="bitmap"){var ye=Math.PI/10*ae.wobble,je=Math.abs(ge-Ce)*.1,Ie=Math.abs(Ae-ce)*.1,Re=ae.shape.bitmap.width*ae.scalar,Qe=ae.shape.bitmap.height*ae.scalar,$e=new DOMMatrix([Math.cos(ye)*je,Math.sin(ye)*je,-Math.sin(ye)*Ie,Math.cos(ye)*Ie,ae.x,ae.y]);$e.multiplySelf(new DOMMatrix(ae.shape.matrix));var it=te.createPattern(d.transform(ae.shape.bitmap),"no-repeat");it.setTransform($e),te.globalAlpha=1-he,te.fillStyle=it,te.fillRect(ae.x-Re/2,ae.y-Qe/2,Re,Qe),te.globalAlpha=1}else if(ae.shape==="circle")te.ellipse?te.ellipse(ae.x,ae.y,Math.abs(ge-Ce)*ae.ovalScalar,Math.abs(Ae-ce)*ae.ovalScalar,Math.PI/10*ae.wobble,0,2*Math.PI):ne(te,ae.x,ae.y,Math.abs(ge-Ce)*ae.ovalScalar,Math.abs(Ae-ce)*ae.ovalScalar,Math.PI/10*ae.wobble,0,2*Math.PI);else if(ae.shape==="star")for(var tt=Math.PI/2*3,ot=4*ae.scalar,ft=8*ae.scalar,ct=ae.x,Vt=ae.y,It=5,an=Math.PI/It;It--;)ct=ae.x+Math.cos(tt)*ft,Vt=ae.y+Math.sin(tt)*ft,te.lineTo(ct,Vt),tt+=an,ct=ae.x+Math.cos(tt)*ot,Vt=ae.y+Math.sin(tt)*ot,te.lineTo(ct,Vt),tt+=an;else te.moveTo(Math.floor(ae.x),Math.floor(ae.y)),te.lineTo(Math.floor(ae.wobbleX),Math.floor(ce)),te.lineTo(Math.floor(ge),Math.floor(Ae)),te.lineTo(Math.floor(Ce),Math.floor(ae.wobbleY));return te.closePath(),te.fill(),ae.tick<ae.totalTicks}function re(te,ae,he,Ce,ce){var ge=ae.slice(),Ae=te.getContext("2d"),ye,je,Ie=u(function(Re){function Qe(){ye=je=null,Ae.clearRect(0,0,Ce.width,Ce.height),d.clear(),ce(),Re()}function $e(){r&&!(Ce.width===s.width&&Ce.height===s.height)&&(Ce.width=te.width=s.width,Ce.height=te.height=s.height),!Ce.width&&!Ce.height&&(he(te),Ce.width=te.width,Ce.height=te.height),Ae.clearRect(0,0,Ce.width,Ce.height),ge=ge.filter(function(it){return X(Ae,it)}),ge.length?ye=f.frame($e):Qe()}ye=f.frame($e),je=Qe});return{addFettis:function(Re){return ge=ge.concat(Re),Ie},canvas:te,promise:Ie,reset:function(){ye&&f.cancel(ye),je&&je()}}}function pe(te,ae){var he=!te,Ce=!!C(ae||{},"resize"),ce=!1,ge=C(ae,"disableForReducedMotion",Boolean),Ae=a&&!!C(ae||{},"useWorker"),ye=Ae?x():null,je=he?L:z,Ie=te&&ye?!!te.__confetti_initialized:!1,Re=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,Qe;function $e(tt,ot,ft){for(var ct=C(tt,"particleCount",N),Vt=C(tt,"angle",Number),It=C(tt,"spread",Number),an=C(tt,"startVelocity",Number),Nt=C(tt,"decay",Number),mn=C(tt,"gravity",Number),dn=C(tt,"drift",Number),Pt=C(tt,"colors",R),Xe=C(tt,"ticks",Number),Ut=C(tt,"shapes"),Lt=C(tt,"scalar"),qe=!!C(tt,"flat"),Ke=U(tt),pt=ct,en=[],Bt=te.width*Ke.x,Et=te.height*Ke.y;pt--;)en.push(J({x:Bt,y:Et,angle:Vt,spread:It,startVelocity:an,color:Pt[pt%Pt.length],shape:Ut[I(0,Ut.length)],ticks:Xe,decay:Nt,gravity:mn,drift:dn,scalar:Lt,flat:qe}));return Qe?Qe.addFettis(en):(Qe=re(te,en,je,ot,ft),Qe.promise)}function it(tt){var ot=ge||C(tt,"disableForReducedMotion",Boolean),ft=C(tt,"zIndex",Number);if(ot&&Re)return u(function(an){an()});he&&Qe?te=Qe.canvas:he&&!te&&(te=Q(ft),document.body.appendChild(te)),Ce&&!Ie&&je(te);var ct={width:te.width,height:te.height};ye&&!Ie&&ye.init(te),Ie=!0,ye&&(te.__confetti_initialized=!0);function Vt(){if(ye){var an={getBoundingClientRect:function(){if(!he)return te.getBoundingClientRect()}};je(an),ye.postMessage({resize:{width:an.width,height:an.height}});return}ct.width=ct.height=null}function It(){Qe=null,Ce&&(ce=!1,t.removeEventListener("resize",Vt)),he&&te&&(document.body.contains(te)&&document.body.removeChild(te),te=null,Ie=!1)}return Ce&&!ce&&(ce=!0,t.addEventListener("resize",Vt,!1)),ye?ye.fire(tt,ct,It):$e(tt,ct,It)}return it.reset=function(){ye&&ye.reset(),Qe&&Qe.reset()},it}var Y;function ie(){return Y||(Y=pe(null,{useWorker:!0,resize:!0})),Y}function oe(te,ae,he,Ce,ce,ge,Ae){var ye=new Path2D(te),je=new Path2D;je.addPath(ye,new DOMMatrix(ae));var Ie=new Path2D;return Ie.addPath(je,new DOMMatrix([Math.cos(Ae)*ce,Math.sin(Ae)*ce,-Math.sin(Ae)*ge,Math.cos(Ae)*ge,he,Ce])),Ie}function G(te){if(!o)throw new Error("path confetti are not supported in this browser");var ae,he;typeof te=="string"?ae=te:(ae=te.path,he=te.matrix);var Ce=new Path2D(ae),ce=document.createElement("canvas"),ge=ce.getContext("2d");if(!he){for(var Ae=1e3,ye=Ae,je=Ae,Ie=0,Re=0,Qe,$e,it=0;it<Ae;it+=2)for(var tt=0;tt<Ae;tt+=2)ge.isPointInPath(Ce,it,tt,"nonzero")&&(ye=Math.min(ye,it),je=Math.min(je,tt),Ie=Math.max(Ie,it),Re=Math.max(Re,tt));Qe=Ie-ye,$e=Re-je;var ot=10,ft=Math.min(ot/Qe,ot/$e);he=[ft,0,0,ft,-Math.round(Qe/2+ye)*ft,-Math.round($e/2+je)*ft]}return{type:"path",path:ae,matrix:he}}function V(te){var ae,he=1,Ce="#000000",ce='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof te=="string"?ae=te:(ae=te.text,he="scalar"in te?te.scalar:he,ce="fontFamily"in te?te.fontFamily:ce,Ce="color"in te?te.color:Ce);var ge=10*he,Ae=""+ge+"px "+ce,ye=new OffscreenCanvas(ge,ge),je=ye.getContext("2d");je.font=Ae;var Ie=je.measureText(ae),Re=Math.ceil(Ie.actualBoundingBoxRight+Ie.actualBoundingBoxLeft),Qe=Math.ceil(Ie.actualBoundingBoxAscent+Ie.actualBoundingBoxDescent),$e=2,it=Ie.actualBoundingBoxLeft+$e,tt=Ie.actualBoundingBoxAscent+$e;Re+=$e+$e,Qe+=$e+$e,ye=new OffscreenCanvas(Re,Qe),je=ye.getContext("2d"),je.font=Ae,je.fillStyle=Ce,je.fillText(ae,it,tt);var ot=1/he;return{type:"bitmap",bitmap:ye.transferToImageBitmap(),matrix:[ot,0,0,ot,-Re*ot/2,-Qe*ot/2]}}n.exports=function(){return ie().apply(this,arguments)},n.exports.reset=function(){ie().reset()},n.exports.create=pe,n.exports.shapeFromPath=G,n.exports.shapeFromText=V})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),Hue,!1);const Pbn=Hue.exports;Hue.exports.create;const Fbn=200,Obn={origin:{y:.7}};function sj(e,t){Pbn({...Obn,...t,particleCount:Math.floor(Fbn*e)})}function Mbn(){sj(.25,{spread:26,startVelocity:55}),sj(.2,{spread:60}),sj(.35,{spread:100,decay:.91,scalar:.8}),sj(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),sj(.1,{spread:120,startVelocity:45})}function Rbn({result:e,period:t,onBack:n}){const[r,s]=m.useState(!1),[a,o]=m.useState(!1),[l,c]=m.useState({}),u="#00FF91",d="#252525",f=`PnL (${t})`,x=ce=>{navigator.clipboard.writeText(ce),ln.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},g=ce=>ce>=1e9?`${(ce/1e9).toFixed(0)}B`:ce>=1e6?`${(ce/1e6).toFixed(0)}M`:ce>=1e3?`${(ce/1e3).toFixed(0)}K`:ce.toFixed(0),{main:v,steps:w}=e,C=Object.values(e.steps).flat().map(ce=>({...ce,timestamp:new Date(ce.timestamp).getTime()})).sort((ce,ge)=>ce.timestamp-ge.timestamp),N={};C.forEach(ce=>{N[ce.timestamp]=(N[ce.timestamp]||0)+ce.pnl_this_step});let I=e.main.initial_equity;const P=Object.entries(N).sort((ce,ge)=>ce[0]-ge[0]).map(([ce,ge])=>(I+=ge,[Number(ce),+I.toFixed(2)])),R=P.map(([,ce])=>ce);let F=R[0],U=0;R.forEach(ce=>{ce>F&&(F=ce);const ge=(F-ce)/F;ge>U&&(U=ge)});const L=(U*100).toFixed(2),z=C.filter(ce=>ce.pnl_this_step>0).length,Q=C.filter(ce=>ce.pnl_this_step<0).length,ne=`${(z/C.length*100).toFixed(2)}%`,J=P.slice(1).map(([,ce],ge)=>{const Ae=P[ge][1];return(ce-Ae)/Ae}),X=ce=>ce.length?ce.reduce((ge,Ae)=>ge+Ae,0)/ce.length:0,re=ce=>{const ge=X(ce),Ae=X(ce.map(ye=>(ye-ge)**2));return Math.sqrt(Ae)},pe=(re(J)?X(J)/re(J):0).toFixed(2),Y=((v.my_total_equity/v.initial_equity-1)*100).toFixed(2),ie={},oe=ce=>{var ge;return{time:new Date(ce.timestamp).toLocaleTimeString(),pnl:ce.pnl_this_step,coin:ce.coin,activity:{direction:((ge=ce.trader_direction)==null?void 0:ge.toLowerCase())==="long"?"Long":"Short",leverage:ce.trader_leverage},size:ce.trader_szi,posValue:ce.our_target_value,entry:ce.our_pos_entry_price,close:ce.market_price}};C.forEach(ce=>{const ge=new Date(ce.timestamp).toLocaleDateString();ie[ge]=ie[ge]||{rows:[],totalPnl:0},ie[ge].rows.push(oe(ce)),ie[ge].totalPnl+=ce.pnl_this_step});const G=Object.entries(ie).sort((ce,ge)=>new Date(ce[0])-new Date(ge[0]));let V=v.initial_equity;const te=G.map(([ce,{rows:ge,totalPnl:Ae}])=>(V+=Ae,{date:ce,rows:ge,totalPnl:Ae,equity:V}));m.useEffect(()=>{var ce;if(((ce=e==null?void 0:e.main)==null?void 0:ce.final_pnl)>0){Mbn(),o(!0);const ge=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(ge)}},[e]);const ae={chart:{type:"area",toolbar:{show:!1},background:"transparent",animations:{enabled:!1}},stroke:{width:2,curve:"straight",colors:[u]},fill:{type:"gradient",gradient:{shade:"dark",shadeIntensity:1,opacityFrom:.45,opacityTo:0,stops:[0,100],colorStops:[{offset:0,color:u,opacity:.45},{offset:100,color:u,opacity:0}]}},grid:{show:!0,borderColor:d,strokeDashArray:6,xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},xaxis:{type:"datetime",labels:{style:{colors:"#9B9B9B",fontSize:"12px",fontFamily:"Manrope",fontWeight:500},datetimeUTC:!1,format:"dd/MM"}},yaxis:{labels:{style:{colors:"#9B9B9B",fontSize:"12px",fontFamily:"Manrope",fontWeight:500},formatter:ce=>g(ce)}},dataLabels:{enabled:!1},tooltip:{theme:"dark",x:{format:"dd/MM HH:mm"},y:{formatter:ce=>`$${ce.toFixed(2)}`},marker:{fillColors:[u]}},zoom:{enabled:!1},markers:{size:0,colors:[u]}},he=[{key:"time",label:"Time",width:"0.7fr"},{key:"pnl",label:"PnL",width:"0.7fr",headerClassName:"flex justify-end",render:ce=>i.jsxs("span",{className:`flex justify-end ${ce<0?"text-[#FF797C]":"text-[#67FFBD]"}`,children:[ce<0?"- $":"$",Math.abs(ce).toFixed(2)]})},{key:"coin",label:"Symbol",sortable:!0,width:"0.7fr",render:(ce,ge)=>i.jsxs("div",{className:"flex items-center gap-2 text-[12px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${ge.coin}.svg`,onError:ra,className:"w-5 h-5"}),ge.coin]})},{key:"activity",label:"Direction",width:"1.3fr",render:(ce,ge)=>{const Ae=ge.activity.direction==="Long";return i.jsxs("div",{className:`inline-flex justify-center items-center gap-1 px-2 py-1 h-6 rounded-[6px] w-[115px] text-[11px] uppercase font-semibold ${Ae?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":"text-[#ff787b] bg-[rgba(255,131,117,0.16)]"}`,children:[i.jsx(Ts,{className:`w-3 h-3 ${Ae?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),`${ge.activity.direction} - ${ge.activity.leverage}x`]})}},{key:"size",label:"Size",width:"0.8fr"},{key:"posValue",label:"Position Value",width:"1fr",render:ce=>`$${ce.toFixed(2)}`},{key:"entry",label:"Entry Price",width:"0.9fr",render:ce=>`$${ce.toLocaleString()}`},{key:"close",label:"Close Price",width:"0.9fr",render:ce=>`$${ce.toLocaleString()}`}],Ce=Object.values(l).some(Boolean);return i.jsxs(i.Fragment,{children:[a&&i.jsx("div",{className:"fixed inset-0 top-24 flex items-start justify-center z-50 pointer-events-none font-manrope",children:i.jsx("div",{className:"text-4xl font-bold text-white px-6 py-4 rounded-xl animate-pulse",children:"🎉 You are the winner! 🥳"})}),i.jsxs(up,{isOpen:r,onClose:()=>s(!1),children:[i.jsx("h2",{className:"text-white text-lg mb-4",children:"Perp Equity Chart"}),i.jsx(HL,{options:{...ae,chart:{...ae.chart,sparkline:{enabled:!1}}},series:[{name:"Equity",data:P}],type:"area",height:320,width:"100%"})]}),i.jsxs("div",{className:["animate-slide-in text-white font-inter p-4 sm:p-6 mx-auto","rounded-[24px] border border-[#343434] backdrop-blur-[64px]","mt-0 sm:mt-20 transition-[max-width] duration-300",Ce?"max-w-96 sm:max-w-5xl":"max-w-96 sm:max-w-xl"].join(" "),children:[i.jsxs("div",{className:"flex items-center justify-between mb-[19px]",children:[i.jsx("div",{className:"flex items-center gap-1",children:i.jsx("span",{className:"text-[18px] font-semibold",children:"My Backtest Results"})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"px-6 py-3 text-[#0B331C] text-[13px] font-semibold rounded-[10px] bg-[#1DE674] h-[32px] flex justify-center items-center",onClick:n,children:"New Backtest"}),i.jsx("button",{className:"px-6 py-3 text-[#67FFBD] text-[13px] font-semibold rounded-[10px] bg-[rgba(103,255,189,0.16)] h-[32px] flex items-center gap-2",onClick:()=>x(window.location.href),children:"Share"})]})]}),i.jsx("div",{className:"grid grid-cols-4 gap-4",children:[["Initial Perp Equity",v.initial_equity,"white"],["Final Perp Equity",v.my_total_equity,v.my_total_equity<v.initial_equity?"#FF797C":"#67FFBD"],[f,v.final_pnl,v.final_pnl<0?"#FF797C":"#67FFBD"],["Max Drawdown",`${L}%`,"#FF797C"],["Win Rate",ne,"white"],["Win / Loss",i.jsxs("div",{className:"flex gap-0 sm:gap-1",children:[i.jsxs("span",{className:"flex gap-1 items-center",children:[i.jsx("span",{className:"text-[#67FFBD]",children:"●"}),z]})," ",i.jsxs("span",{className:"flex gap-1 items-center",children:[i.jsx("span",{className:"text-[#FF797C]",children:"●"}),Q]})]}),"white"],["Growth Rate",`${Y}%`,Y<0?"#FF797C":"#67FFBD"],["Sharpe",pe,"white"]].map(([ce,ge,Ae])=>i.jsxs("div",{children:[i.jsx("div",{className:"text-[#8E8E8E] text-[14px] pb-1",children:ce}),i.jsx("div",{style:{color:Ae},className:"text-[14px] font-semibold whitespace-nowrap",children:typeof ge=="number"?`$${ge.toFixed(2)}`:ge})]},ce))}),i.jsxs("div",{className:"bg-[#1B1B1B] rounded-xl mt-4 mb-4",children:[i.jsxs("div",{className:"flex px-3 pt-3 justify-between items-center text-[#8E8E8E] text-[14px] mb-2",children:["Perp Equity Chart",i.jsx("img",{src:Pyt,alt:"expand",className:"cursor-pointer",onClick:()=>s(!0)})]}),i.jsx(HL,{options:ae,series:[{name:"Equity",data:P}],type:"area",height:150,width:"100%"})]}),i.jsx("div",{className:"bg-[#1B1B1B] rounded-xl divide-y divide-[#2A2A2A] max-h-[320px] overflow-y-auto overflow-x-hidden",children:te.map(({date:ce,rows:ge,totalPnl:Ae,equity:ye})=>{const je=Ae>=0,Ie=l[ce];return i.jsxs("div",{children:[i.jsxs("button",{className:"w-full grid grid-cols-3 items-center px-4 py-[10px] text-[13px] font-semibold bg-transparent",onClick:()=>c(Re=>({...Re,[ce]:!Ie})),children:[i.jsx("span",{className:"text-left text-white",children:ce}),i.jsxs("span",{className:"text-center text-white",children:["$",ye.toFixed(2)]}),i.jsxs("span",{className:`text-right ${je?"text-[#67FFBD]":"text-[#FF797C]"}`,children:[je?"+":"-","$",Math.abs(Ae).toFixed(2)]})]}),Ie&&i.jsx("div",{className:"overflow-x-auto",children:i.jsx(Ru,{columns:he,data:ge,listHeight:Math.min(ge.length*36,180),rowClassName:"border-t border-[#2A2A2A] text-white !text-[13px] font-inter",tableClassName:"min-w-[900px] bg-[#1B1B1B] rounded-xl overflow-hidden",theadClassName:"bg-[#1B1B1B] !text-[#9B9B9B] font-manrope !text-[13px] font-semibold",tbodyClassName:"divide-y divide-[#2A2A2A]",cellClassName:"px-4 py-[10px]",rowHeight:36})})]},ce)})})]})]})}const Lbn=e=>{const t=new URLSearchParams;return t.set("wallet",e.wallet),e.pairs.length&&t.set("pairs",e.pairs.join(",")),t.set("equity",e.equity),t.set("scale",e.scale),t.set("period",e.period),t.set("method",e.method),t.toString()},Dbn=()=>{const e=new URLSearchParams(window.location.search);return{wallet:e.get("wallet")||"",pairs:e.get("pairs")?e.get("pairs").split(","):[],equity:e.get("equity")||"",scale:e.get("scale")||"",period:e.get("period")||"30D",method:e.get("method")||"3"}};function Bbn(){const[e,t]=m.useState("starter"),[n,r]=m.useState(null),[s,a]=m.useState("30D"),o=m.useCallback(async l=>{t("loading");const c={"7D":7,"30D":30,"90D":90},u=l.pairs.length?{coin:{$in:l.pairs}}:{},d={period:c[l.period]||1,filters:{user_wallet:l.wallet,...u},method:Number(l.method),initial_equity:Number(l.equity),scaling_factor:Number(l.scale),steps:!0};try{const x=await(await fetch("https://dextradata.nftinit.io/api/hyper/backtest/fills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})).json();if(x.error_message){ln.error(x.error_message),t("starter");return}window.history.replaceState(null,"","?"+Lbn(l)),a(l.period),r(x),t("result")}catch(f){console.error(f),t("starter"),ln.error("Backtest failed. Please try again.")}},[]);return m.useEffect(()=>{const l=Dbn();l.wallet&&o(l)},[o]),i.jsxs("div",{className:"flex items-start sm:items-center justify-center w-screen h-screen mt-4 sm:mt-0 mb-32 sm:mb-0",children:[e==="starter"&&i.jsx(Tbn,{onRun:o}),e==="loading"&&i.jsx(Ibn,{}),e==="result"&&i.jsx(Rbn,{result:n,period:s,onBack:()=>{window.history.replaceState(null,"",window.location.pathname),t("starter")}})]})}const $bn=({tg:e})=>{const{address:t}=Jr(),[n,r]=m.useState(!1);return m.useEffect(()=>{if(!e||isNaN(Number(e)))return;(async()=>{try{const a=window.localStorage.getItem("hyperToken"),o=window.localStorage.getItem("hyperAddress"),l=await fetch("https://dextrabothypev2.nftinit.io/api/telegram/sign_api_wallet_telegram/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():o,token:a,telegram_id:e})});if(!l.ok)throw new Error(`Request failed with status ${l.status}`);const c=await l.json();c!=null&&c.success&&r(!0)}catch(a){console.error("Error sending data:",a)}})()},[e]),i.jsxs(i.Fragment,{children:[i.jsx(d5,{open:n,setOpen:r,handleListRequest:()=>{},handlePageChange:()=>{}}),i.jsx("div",{className:"flex flex-col items-center justify-center px-6 sm:px-16 pb-10 gap-6 w-max h-max bg-[#212121]/90 rounded-2xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#2a2a2a] relative pt-10",children:i.jsxs("div",{className:"flex flex-col items-center text-white text-base font-medium font-['Inter'] text-center gap-4",children:[i.jsx("img",{src:qi,alt:"",className:"w-8 h-8"}),i.jsx("div",{className:"text-center text-white text-base font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Dextrabot Wallet Setup"}),i.jsx("div",{className:"max-w-[240px] text-center text-white text-[13px] font-normal font-['Inter'] leading-4",children:"Add an account to start your copy trading journey on Telegram. Choose between creating an API Wallet or a Generate Wallet."}),i.jsxs("div",{className:"flex flex-col items-center gap-6 mt-[33px]",children:[i.jsxs("div",{onClick:()=>{r(!0)},className:"w-full h-10 px-6 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max -mb-[1px]",children:"Add Account"})]}),i.jsxs("div",{onClick:()=>window.open("https://t.me/Dextrabot_CopyTrade_bot","_blank"),className:"w-full h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 cursor-pointer",children:[i.jsx("img",{src:ake,alt:""}),i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none min-w-max",children:"Open Telegram App"})]})]})]})})]})},Ubn=()=>{const[e]=VNe(),t=e==null?void 0:e.get("tg"),{isConnected:n,address:r}=Jr(),{hyperToken:s,hyperAddress:a,setSignModalOpen:o,setTelegramChatId:l,setSubscriberRole:c,setSubsExpireDay:u,setMushboomerETH:d,setMushboomerSOL:f,setIsReferralCode:x,setIsReferralCodeName:g,setIsWhitelist:v,setHyperToken:w,setHyperAddress:C}=m.useContext(Qr),[N,I]=m.useState(!!window.localStorage.getItem("hyperToken"));return m.useEffect(()=>{const P=window.localStorage.getItem("hyperToken");I(!!P)},[r,n,s,a]),m.useEffect(()=>{(async()=>{var U,L;const R=window.localStorage.getItem("hyperToken"),F=window.localStorage.getItem("hyperAddress");if(!(!R||!F))try{const z=await ji(F.toLowerCase(),R);z!=null&&z.success?(l(z==null?void 0:z.telegram_chat_id),c(z==null?void 0:z.subscriber_role),u(z==null?void 0:z.subs_expire_day),d((U=z==null?void 0:z.mushboomer_counts)==null?void 0:U.eth),f((L=z==null?void 0:z.mushboomer_counts)==null?void 0:L.sol),x(z==null?void 0:z.referral_code),g(z==null?void 0:z.refcode),v(z==null?void 0:z.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),w(""),C(""))}catch(z){console.error("Token verification error:",z),console.error(z.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Dextrabot Telegram Wallet Setup – Create API or Generated Wallet"}),i.jsx("meta",{name:"description",content:"Easily set up your Telegram copy trading wallet on Dextrabot. Create an API Wallet with your own account or generate a new wallet instantly, then connect to Telegram to start trading."}),i.jsx("meta",{name:"og:title",content:"Dextrabot Telegram Wallet Setup – Create API or Generated Wallet"}),i.jsx("meta",{name:"og:description",content:"Easily set up your Telegram copy trading wallet on Dextrabot. Create an API Wallet with your own account or generate a new wallet instantly, then connect to Telegram to start trading."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/telegram-api-wallet"})]})}),i.jsx("div",{style:{background:"linear-gradient(135deg, #0d0d0d 0%, #1c1c1c 50%, #0d0d0d 100%)"},className:"flex justify-center items-center w-full h-[calc(100vh-6rem)] sm:h-[calc(100vh-5rem)] min-h-max max-h-[calc(100vh-6rem)] sm:max-h-[calc(100vh-5rem)] px-4 pt-16 sm:pt-4 pb-10 bg-[#161616]",children:N?i.jsx($bn,{tg:t}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(dU,{})})})]})},dNe="/assets/share1-C-zw_JWP.jpg",zbn="/assets/share2-DdEku457.jpg",Hbn="/assets/share3-CNxpeTYT.jpg",Vbn="/assets/share4-DJuI_ZiE.jpg",Wbn="/assets/share5-T6uiFcTh.jpg",qbn="/assets/share6-DjS5fdAF.jpg",Gbn="/assets/share7-BaMtg3x6.jpg",Kbn="/assets/share8-xyCgNFII.jpg",Ybn="/assets/share9-BLclkV1L.jpg",Xbn="/assets/share10-C9sVwYdl.jpg",Qbn="/assets/share11-_FKzaoRV.jpg",Zbn="/assets/share12-DHiXk6_m.jpg",Jbn="/assets/share13-0mVBxTxA.jpg",eyn="/assets/share14-B6N7agx8.jpg",tyn="/assets/share15-D46qu5xc.jpg",nyn="/assets/share16-B06pZYlo.jpg",ryn="/assets/share17-C9ObNWuI.jpg",syn="/assets/share18-DafUfIIP.jpg",iyn="/assets/share19-DdeHQJDd.jpg",ayn="/assets/share20-Cx0LCWyZ.jpg",oyn="/assets/lighter-banner-B9jyiBZ3.png",lyn="#67FFBD",cyn="https://dextrabothypev2.nftinit.io/api/hyper/fee_calculator_save/";function uyn({initialWalletAddress:e}){const t=il(),[n,r]=m.useState(e||""),[s,a]=m.useState(!1),[o,l]=m.useState(null),[c,u]=m.useState(null),[d,f]=m.useState(e||""),[x,g]=m.useState(!1),[v,w]=m.useState(0),[C,N]=m.useState(!1),[I,P]=m.useState(dNe),[R,F]=m.useState(""),[U,L]=m.useState(""),z=m.useRef(!1),Q=m.useRef(null),ne=m.useRef(null),J=m.useRef(0),X=[dNe,zbn,Hbn,Vbn,Wbn,qbn,Gbn,Kbn,Ybn,Xbn,Qbn,Zbn,Jbn,eyn,tyn,nyn,ryn,syn,iyn,ayn];m.useEffect(()=>{const Re=document.querySelector("main");Re&&(Re.style.background="#0b0b0b"),F(`${window.location.origin}${window.location.pathname}`);const Qe=decodeURIComponent((window.location.hash||"").replace(/^#/,"")),$e=window.location.pathname.split("/").filter(Boolean),it=$e[$e.length-1]||"",ot=it&&it.toLowerCase()!=="hyperliquid-fee-calculator"?decodeURIComponent(it):"",ft=Qe||ot;if(ft){f(ft),r(ft);const ct=`${window.location.pathname}#${encodeURIComponent(ft)}`;window.history.replaceState(null,"",ct),L(`${window.location.origin}${ct}`),oe(ft)}return()=>{Re&&(Re.style.background="")}},[]),m.useEffect(()=>{e&&e.trim()&&oe(e)},[e]);const re=Re=>{const Qe=Number(Re||0);return Math.abs(Qe)>=1e6?`$${(Qe/1e6).toFixed(2)}M`:Math.abs(Qe)>=1e3?`$${(Qe/1e3).toFixed(2)}K`:`$${Qe.toFixed(2)}`},pe=Re=>`$${Number(Re||0).toFixed(2)}`,Y=()=>new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"}),ie=async Re=>{if(z.current)return;z.current=!0;const Qe=window.localStorage.getItem("hyperAddress")||"",$e={wallet_address:n||null,calculator_logs:{total_fee_spent:pe(((Re==null?void 0:Re.totalFee)||0)+((Re==null?void 0:Re.totalBuilderFee)||0)),trading_fees:pe((Re==null?void 0:Re.totalFee)||0),builder_fees:pe((Re==null?void 0:Re.totalBuilderFee)||0),total_fills:Number((Re==null?void 0:Re.totalFills)||0),created_at:Y()}};Qe&&($e.address=Qe);try{await fetch(cyn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($e)})}catch{}},oe=async Re=>{if(!Re){ln.error("Please enter a wallet address");return}z.current=!1,a(!0),l(null),u(null),g(!1),w(0),N(!1),t(`/hyperliquid-fee-calculator/${Re}`,{replace:!0}),L(`${window.location.origin}/hyperliquid-fee-calculator/${Re}`);try{await iin(Re,Qe=>{Qe.totalFills>=2e3&&g(!0),u({...Qe,isPartial:!Qe.isComplete}),w(Math.min(Qe.requestCount/12*100,100)),Qe.isComplete&&(g(!1),w(100),a(!1),N(!0),ie(Qe),t(`/hyperliquid-fee-calculator/${Re}`,{replace:!0}))})}catch(Qe){l(Qe.message||"Failed to calculate fees"),ln.error("Failed to calculate fees"),g(!1),a(!1)}},G=Re=>{f(Re),Re.trim()&&r(Re.trim())},V=(()=>{const Re=((c==null?void 0:c.totalFee)||0)+((c==null?void 0:c.totalBuilderFee)||0);return`I paid ${re(Re)} in total fees on Hyperliquid.
Generate your own fee report and see potential savings with 0% builder fees.`})(),te=async()=>{if(Q.current)try{await document.fonts.ready;const Re=await I1(Q.current,{cacheBust:!0,backgroundColor:"#0b0b0b",useCORS:!0,pixelRatio:2}),Qe=document.createElement("a");Qe.href=Re,Qe.download="dextrabot-fee-card.png",document.body.appendChild(Qe),Qe.click(),document.body.removeChild(Qe)}catch{ln.error("Failed to download PNG.")}},ae=U||R||"https://app.dextrabot.com/hyperliquid-fee-calculator",he=`https://x.com/intent/post?text=${encodeURIComponent(V)}&url=${encodeURIComponent(ae)}`,[Ce,ce]=m.useState({rx:0,ry:0,gx:50,gy:50}),ge=12,Ae=Re=>{ne.current&&(cancelAnimationFrame(J.current),J.current=requestAnimationFrame(()=>{const Qe=ne.current.getBoundingClientRect(),$e=(Re.clientX-Qe.left)/Qe.width,it=(Re.clientY-Qe.top)/Qe.height,tt=($e-.5)*(ge*2),ot=(.5-it)*(ge*2);ce({rx:Math.max(-12,Math.min(ge,ot)),ry:Math.max(-12,Math.min(ge,tt)),gx:$e*100,gy:it*100})}))},ye=()=>{cancelAnimationFrame(J.current),ce({rx:0,ry:0,gx:50,gy:50})},je=s,Ie=!n.trim();return i.jsxs(Mo,{children:[i.jsxs(Ho,{children:[i.jsx("title",{children:"Hyperliquid Fee Spent Report — Dextrabot"}),i.jsx("meta",{name:"description",content:"Hyperliquid Fee Spent Report"})]}),i.jsxs("div",{className:"relative text-white overflow-hidden overscroll-none",style:{fontFamily:"Manrope, ui-sans-serif"},children:[i.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-16 bottom-0 opacity-40 ",style:{background:"radial-gradient(800px 800px at 10% 0%, rgba(103,255,189,0.12) 0%, transparent 60%), radial-gradient(900px 900px at 90% 100%, rgba(103,255,189,0.08) 0%, transparent 55%)"}}),i.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-16 bottom-0 opacity-[0.06] ",style:{background:"repeating-linear-gradient(0deg, #fff 0, #fff 1px, transparent 1px, transparent 3px)"}}),i.jsxs("div",{className:" mx-auto pt-4 pb-4 gap-4 flex justify-center ",children:[!C&&i.jsxs(vo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"relative overflow-hidden rounded-2xl border border-[#17211b] bg-[#0a0c0c]",children:[i.jsx("div",{className:"absolute inset-0 opacity-60",style:{background:"radial-gradient(1000px 300px at 0% 0%, rgba(103,255,189,0.22) 0%, transparent 60%)"}}),i.jsx("div",{className:"absolute -inset-[1px] rounded-2xl",style:{background:"linear-gradient(120deg, rgba(103,255,189,0.35), transparent 25% 75%, rgba(103,255,189,0.2))",filter:"blur(10px)",opacity:.35}}),i.jsxs("div",{className:"relative grid grid-cols-1 lg:grid-cols-2 gap-10 p-8",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"inline-flex items-center gap-3 bg-[#0b1511] border border-[#1e2e27] rounded-xl px-3 py-2 shadow-[0_0_24px_rgba(103,255,189,0.12)]",children:[i.jsx("img",{src:EA,alt:"Dextrabot",className:"w-7 h-7 rounded-md"}),i.jsx("span",{className:"text-[#d7ffe9] font-semibold tracking-wide",children:"Hyperliquid Fee Spent Report"})]}),i.jsxs("h2",{className:"mt-4 text-[28px] leading-tight font-extrabold tracking-tight",children:["Calculate Your Hyperliquid Trading Fees",i.jsx("br",{}),i.jsx("span",{style:{color:lyn},children:"Fee Report Generator"})]}),i.jsx("p",{className:"mt-3 text-[#a6b6b0] max-w-xl",children:"Discover how much you've paid in Hyperliquid trading fees. Free calculator generates your complete fee report."}),i.jsxs("div",{className:"mt-6",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:i.jsx($an,{className:"h-5 w-5 text-[#88a296]"})}),i.jsx("input",{type:"text",value:d,onChange:Re=>G(Re.target.value),placeholder:"Paste wallet address…",className:"w-full pl-10 pr-12 py-3 rounded-xl bg-[#060808] border border-[#1c2a24] text-white placeholder-[#6e857d] focus:outline-none focus:border-[#67FFBD] focus:ring-1 focus:ring-[#67FFBD]"}),d?i.jsx("button",{onClick:()=>{f(""),r(""),window.history.replaceState(null,"",window.location.pathname),L("")},className:"absolute inset-y-0 right-2 flex justify-center items-center h-10 top-[5px]",children:i.jsx(XUe,{className:"h-6 w-6 text-[#8ea79e] hover:text-white transition-colors"})}):null]}),i.jsxs(vo.button,{whileTap:{scale:.98},onClick:()=>oe(n),disabled:je||Ie,className:`mt-3 relative overflow-hidden rounded-xl font-semibold py-3 px-5 transition-colors shadow-[0_0_24px_rgba(103,255,189,0.24)] ${je?"bg-[rgba(103,255,189,0.95)] text-[#0b0b0b]":Ie?"bg-[#16211b] text-[#7ea391] cursor-not-allowed border border-[#1e2e27]":"bg[rgba(103,255,189,0.95)]"}`,style:!je&&!Ie?{backgroundColor:"rgba(103,255,189,0.95)",color:"#0b0b0b"}:void 0,children:[i.jsx(mT,{initial:!1,children:je&&i.jsx(vo.span,{initial:{width:0,opacity:0},animate:{width:`${v}%`,opacity:1},exit:{width:0,opacity:0},transition:{ease:"easeOut",duration:.3},className:"absolute top-0 left-0 h-full bg-[#2bb584]"})}),i.jsx("span",{className:"relative z-10",children:je?"Calculating…":"Generate Report"})]})]})]}),i.jsx("div",{className:"relative",children:i.jsxs("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#050707] overflow-hidden shadow-[0_0_60px_rgba(103,255,189,0.15)]",children:[i.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.06] rounded-2xl overflow-hidden",style:{background:"repeating-linear-gradient(180deg, #fff 0, #fff 1px, transparent 1px, transparent 3px)"}}),i.jsx("video",{src:XN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[320px] lg:h-[380px] object-cover"},XN)]})})]})]}),C&&c&&i.jsx(vo.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},children:i.jsxs("div",{className:"flex flex-col lg:flex-row items-start gap-4",children:[i.jsx("div",{className:"shrink-0",children:i.jsxs("button",{onClick:()=>{N(!1),t("/hyperliquid-fee-calculator",{replace:!0})},className:"inline-flex items-center gap-2 rounded-lg px-3 py-2 border border-[#23372e] bg-[#0c1210] hover:bg-[#0f1714] text-[#d7ffe9]",children:[i.jsx(Man,{className:"w-5 h-5"}),"Back"]})}),i.jsxs("div",{className:"shrink-0",children:[i.jsx(dyn,{refCard:Q,refWrap:ne,tilt:Ce,onMove:Ae,onLeave:ye,feeData:c,selectedImage:I}),i.jsxs("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] overflow-hidden shadow-[0_0_30px_rgba(103,255,189,0.12)] p-4 mt-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-full grid place-items-center bg-[#67FFBD22] text-[#67FFBD]",children:i.jsx(E6t,{})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[15px] font-semibold",children:"Share"}),i.jsx("div",{className:"text-xs text-[#a6b6b0]",children:"Share your card on X and show off your stats!"})]}),i.jsx(XY,{className:"w-5 h-5 text-[#7a8c86]"})]}),i.jsx("div",{className:"mt-3 grid grid-cols-1 gap-2",children:i.jsx("a",{href:he,target:"_blank",className:"h-10 grid place-items-center rounded-lg bg-white text-[#111] hover:bg-[#eaeaea] transition-colors text-sm font-medium",children:"Share on X"})})]})]}),i.jsxs("div",{className:"w-full lg:w[420px] space-y-3",style:{width:"100%",maxWidth:"420px"},children:[i.jsx("a",{href:"https://t.me/Dextrabot_CopyTrade_bot",target:"_blank",className:"block rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] hover:border-[#67FFBD66] hover:bg-[#0d120f] transition-colors",children:i.jsxs("div",{className:"flex items-center gap-3 p-4",children:[i.jsx("div",{className:"w-9 h-9 rounded-full grid place-items-center bg-[#67FFBD22] font-bold text-[#67FFBD]",children:i.jsx(w6t,{})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[15px] font-semibold text-[#67FFBD]",children:"Zero Builder Fee on HL"}),i.jsx("div",{className:"text-xs text-[#a6b6b0]",children:"Trade with Zero Builder Fees on HL via Telegram."})]}),i.jsx(XY,{className:"w-5 h-5 text-[#7a8c86]"})]})}),i.jsx("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] overflow-hidden shadow-[0_0_30px_rgba(103,255,189,0.12)]",children:i.jsxs("div",{className:"p-4 pb-[18px]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-full grid place-items-center bg-[#67FFBD22] text-[#67FFBD]",children:i.jsx(N6t,{})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[15px] font-semibold",children:"Choose an Image"}),i.jsx("div",{className:"text-xs text-[#a6b6b0]",children:"Pick a meme background and download your card."})]}),i.jsx(XY,{className:"w-5 h-5 text-[#7a8c86]"})]}),i.jsxs("div",{className:"mt-8",children:[i.jsx("div",{className:"grid grid-cols-4 gap-2 pb-4",children:X.map((Re,Qe)=>i.jsx(vo.button,{whileHover:{y:-2},whileTap:{scale:.98},onClick:()=>P(Re),className:`rounded-md overflow-hidden border ${I===Re?"border-[#67FFBD]":"border-[#2b2b2b]"}`,children:i.jsx("img",{src:Re,alt:`bg-${Qe}`,className:"w-full h-16 object-cover"})},Qe))}),i.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[i.jsx("button",{onClick:te,className:"h-8 flex justify-center items-center rounded-lg border border-[#1e2e27] bg-[#0e1211] hover:border-[#67FFBD66] hover:bg-[#111716] transition-colors text-sm font-medium",children:"Download Image"}),i.jsx("button",{onClick:()=>window.open(`/wallet-details/${n}`,"_blank","noopener,noreferrer"),className:"h-8 flex justify-center items-center rounded-lg border border-[#1e2e27] bg-[#0e1211] hover:border-[#67FFBD66] hover:bg-[#111716] transition-colors text-sm font-medium",children:"Go to Wallet Details"})]})]})]})})]})]})}),C&&i.jsx("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] overflow-hidden shadow-[0_0_30px_rgba(103,255,189,0.12)]",children:i.jsx("img",{src:oyn,alt:"Lighter — Zero Fee",className:"h-full w-full cursor-pointer",loading:"eager",decoding:"async",draggable:!1,onClick:()=>{window.location.hash="lighter-farming"}})})]})]})]})}function dyn({refCard:e,refWrap:t,tilt:n,onMove:r,onLeave:s,feeData:a,selectedImage:o}){const l=((a==null?void 0:a.totalFee)||0)+((a==null?void 0:a.totalBuilderFee)||0),c=f=>{const x=Number(f||0);return Math.abs(x)>=1e6?`$${(x/1e6).toFixed(2)}M`:Math.abs(x)>=1e3?`$${(x/1e3).toFixed(2)}K`:`$${x.toFixed(2)}`},d=m.useRef(new Date).current.toLocaleDateString("en-US",{month:"short",day:"numeric"});return a!=null&&a.isPartial,i.jsx("div",{ref:t,onMouseMove:r,onMouseLeave:s,className:"relative",style:{perspective:"1200px"},children:i.jsxs("div",{ref:e,className:"relative will-change-transform rounded-2xl overflow-hidden bg-[#0a0d0c] shadow-[0_30px_80px_rgba(0,0,0,0.45),0_0_60px_rgba(103,255,189,0.16)] border border-[#1c2d26]",style:{width:"clamp(280px, 450px, 520px)",aspectRatio:"3/4",transform:`rotateX(${n.rx}deg) rotateY(${n.ry}deg)`,transition:"transform 180ms ease-out"},children:[i.jsx("div",{className:"absolute -inset-[1px] rounded-[30px] pointer-events-none",style:{background:"linear-gradient(130deg, rgba(103,255,189,0.35), transparent 25% 75%, rgba(103,255,189,0.2))",filter:"blur(10px)",opacity:.35}}),i.jsxs("div",{className:"h-14 px-5 flex items-center justify-between bg-[#1b2622] border-b border-[#253730]",children:[i.jsx("div",{className:"text-sm tracking-wide text-[#cfeee0] font-semibold",children:"Hyperliquid Fee Spent Report"}),i.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-black/60 backdrop-blur px-3 py-1.5",children:[i.jsx("img",{src:qi,alt:"",className:"w-5 h-5"}),i.jsx("span",{className:"text-[12px] tracking-wide font-semibold",children:"DEXTRABOT"})]})]}),i.jsx("div",{className:"px-5 pt-4",children:i.jsxs("div",{className:"relative h-64 rounded-xl overflow-hidden border border-[#2a3c35]",children:[i.jsx("img",{src:o,alt:"","aria-hidden":"true",className:"absolute inset-0 w-full h-full object-cover blur-md scale-110"}),i.jsx("div",{className:"absolute inset-0 bg-black/25"}),i.jsx("img",{src:o,alt:"Dextrabot - Hyperliquid Fee Calculator",className:"relative z-10 w-full h-full object-contain select-none",loading:"eager",decoding:"async",draggable:!1,style:{imageRendering:"-webkit-optimize-contrast"}})]})}),i.jsx("div",{className:"px-5 pb-5 pt-4",children:i.jsxs("div",{className:"relative rounded-2xl border border-[#21342c] bg-gradient-to-b from-[#0d1211] to-[#0a0e0d] p-6",children:[i.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl",style:{boxShadow:"inset 0 0 0 1px rgba(103,255,189,0.08)"}}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-[22px] leading-6 font-extrabold text-white/95",children:"TOTAL FEE SPENT"}),i.jsx("div",{className:"mt-2 font-extrabold leading-none",style:{color:"#67FFBD",fontSize:"clamp(32px, 4.4vw, 48px)"},children:c(l)})]}),i.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xs tracking-wide text-white/70",children:"TRADING FEES"}),i.jsx("div",{className:"text-[20px] font-bold text-white",children:c((a==null?void 0:a.totalFee)||0)})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xs tracking-wide text-white/70",children:"BUILDER FEES"}),i.jsx("div",{className:"text-[20px] font-bold text-white",children:c((a==null?void 0:a.totalBuilderFee)||0)})]})]}),i.jsxs("div",{className:"mt-5 flex items-center justify-center gap-6 text-[11px] text-white/70 px-2",children:[i.jsxs("div",{className:"whitespace-nowrap",style:{fontStyle:"italic"},children:["Shows Last ",((a==null?void 0:a.totalFills)||0).toLocaleString()," Fills"]}),i.jsxs("div",{className:"flex items-center gap-1 text-white/60 whitespace-nowrap",children:[i.jsx("img",{src:qi,alt:"",className:"w-3 h-3"}),"Generated by Dextrabot"]}),i.jsxs("div",{className:"whitespace-nowrap",children:["Created on ",d]})]})]})}),i.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-[28px] opacity-60 mix-blend-screen",style:{background:`radial-gradient(220px 220px at ${n.gx}% ${n.gy}%, rgba(103,255,189,0.25), transparent 60%)`}})]})})}const fNe=()=>{const{walletAddress:e}=e5(),{setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setIsWhitelist:a,setMushboomerSOL:o,setIsReferralCode:l,setIsReferralCodeName:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Qr);return m.useEffect(()=>{(async()=>{var v,w;const x=window.localStorage.getItem("hyperToken"),g=window.localStorage.getItem("hyperAddress");if(!(!x||!g))try{const C=await ji(g.toLowerCase(),x);C!=null&&C.success?(t(C==null?void 0:C.telegram_chat_id),n(C==null?void 0:C.subscriber_role),r(C==null?void 0:C.subs_expire_day),s((v=C==null?void 0:C.mushboomer_counts)==null?void 0:v.eth),o((w=C==null?void 0:C.mushboomer_counts)==null?void 0:w.sol),l(C==null?void 0:C.referral_code),c(C==null?void 0:C.refcode),a(C==null?void 0:C.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""))}catch(C){console.error("Token verification error:",C)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{name:"description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:title",content:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/hyperliquid-fee-calculator "})]})}),i.jsx("div",{style:{minHeight:"calc(100vh - 5rem)"},className:"flex justify-center items-start w-full h-full px-4 pt-6 pb-6 sm:px-6 sm:pt-6 sm:pb-6 bg-[#161616] overflow-auto",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(uyn,{initialWalletAddress:e})})})]})};function fyn(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1.72 5.47a.75.75 0 0 1 1.06 0L9 11.69l3.756-3.756a.75.75 0 0 1 .985-.066 12.698 12.698 0 0 1 4.575 6.832l.308 1.149 2.277-3.943a.75.75 0 1 1 1.299.75l-3.182 5.51a.75.75 0 0 1-1.025.275l-5.511-3.181a.75.75 0 0 1 .75-1.3l3.943 2.277-.308-1.149a11.194 11.194 0 0 0-3.528-5.617l-3.809 3.81a.75.75 0 0 1-1.06 0L1.72 6.53a.75.75 0 0 1 0-1.061Z",clipRule:"evenodd"},child:[]}]})(e)}function hNe(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M15.22 6.268a.75.75 0 0 1 .968-.431l5.942 2.28a.75.75 0 0 1 .431.97l-2.28 5.94a.75.75 0 1 1-1.4-.537l1.63-4.251-1.086.484a11.2 11.2 0 0 0-5.45 5.173.75.75 0 0 1-1.199.19L9 12.312l-6.22 6.22a.75.75 0 0 1-1.06-1.061l6.75-6.75a.75.75 0 0 1 1.06 0l3.606 3.606a12.695 12.695 0 0 1 5.68-4.974l1.086-.483-4.251-1.632a.75.75 0 0 1-.432-.97Z",clipRule:"evenodd"},child:[]}]})(e)}function pNe(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M15.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H7.5a.75.75 0 0 1 0-1.5h11.69l-3.22-3.22a.75.75 0 0 1 0-1.06Zm-7.94 9a.75.75 0 0 1 0 1.06l-3.22 3.22H16.5a.75.75 0 0 1 0 1.5H4.81l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"},child:[]}]})(e)}function mNe(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",clipRule:"evenodd"},child:[]}]})(e)}function hyn(e){return jl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M12 .75a8.25 8.25 0 0 0-4.135 15.39c.686.398 1.115 1.008 1.134 1.623a.75.75 0 0 0 .577.706c.352.083.71.148 1.074.195.323.041.6-.218.6-.544v-4.661a6.714 6.714 0 0 1-.937-.171.75.75 0 1 1 .374-1.453 5.261 5.261 0 0 0 2.626 0 .75.75 0 1 1 .374 1.452 6.712 6.712 0 0 1-.937.172v4.66c0 .327.277.586.6.545.364-.047.722-.112 1.074-.195a.75.75 0 0 0 .577-.706c.02-.615.448-1.225 1.134-1.623A8.25 8.25 0 0 0 12 .75Z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",d:"M9.013 19.9a.75.75 0 0 1 .877-.597 11.319 11.319 0 0 0 4.22 0 .75.75 0 1 1 .28 1.473 12.819 12.819 0 0 1-4.78 0 .75.75 0 0 1-.597-.876ZM9.754 22.344a.75.75 0 0 1 .824-.668 13.682 13.682 0 0 0 2.844 0 .75.75 0 1 1 .156 1.492 15.156 15.156 0 0 1-3.156 0 .75.75 0 0 1-.668-.824Z",clipRule:"evenodd"},child:[]}]})(e)}function pyn({value:e,onChange:t,options:n=[{value:"extended",label:"Extended"}],activeTextColor:r="#1de674",chevronColor:s="#1de674"}){const[a,o]=m.useState(!1),l=m.useRef(null);m.useEffect(()=>{const u=f=>{l.current&&(l.current.contains(f.target)||o(!1))},d=f=>{f.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",u,!0),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",u,!0),document.removeEventListener("keydown",d)}},[]);const c=m.useMemo(()=>n.find(u=>String(u.value)===String(e))||n[0]||null,[n,e]);return i.jsxs("div",{className:"relative",ref:l,children:[i.jsxs("div",{onClick:()=>o(u=>!u),className:"h-[32px] px-3 rounded-md flex justify-between items-center cursor-pointer",style:{background:To,border:`1px solid ${Oa}`,color:Gi},children:[i.jsx("span",{className:"truncate text-xs font-medium",style:{color:Gi},children:(c==null?void 0:c.label)||"Select"}),i.jsx("span",{className:"ml-2 flex items-center",children:i.jsx("span",{className:"ml-2",children:"▾"})})]}),a&&i.jsx("div",{className:"absolute z-50 mt-1 w-full max-h-[240px] overflow-auto rounded-md p-1",style:{background:To,border:`1px solid ${Oa}`},children:n.map(u=>{const d=String(u.value)===String(e);return i.jsx("div",{className:"px-3 py-2 rounded cursor-pointer text-xs font-medium",style:{background:d?"#26313b":"transparent",color:d?"#ffffff":Gi},onClick:()=>{t==null||t(u.value),o(!1)},children:u.label},u.value)})})]})}const _b="#67FFBD",PO="#ff7073",hF="#60A5FA",xNe="#A78BFA",myn="#F97316",xyn={KBONK:"BONK",KPEPE:"PEPE",KSHIB:"SHIB",KFLOKI:"FLOKI",KNEIRO:"NEIRO",KDOGS:"DOGS",KLUNC:"LUNC"},gyn=new Set(["KBONK","KPEPE","KSHIB"]),byn="https://app.hyperliquid.xyz/coins",gNe={SAFE:{icon:"✅",color:_b,label:"Safe",tooltip:"Order can be safely executed with sufficient collateral buffer"},WARNING:{icon:"⚠️",color:myn,label:"Warning",tooltip:"Position is approaching liquidation risk, consider reducing leverage or adding collateral"},STOPPED:{icon:"🛑",color:PO,label:"Stopped",tooltip:"Stop loss will trigger before this DCA order executes"},LIQUIDATED:{icon:"💀",color:"#991B1B",label:"Liquidated",tooltip:"Position will be liquidated at this price level"},CANCELLED:{icon:"❌",color:"#6B7280",label:"Cancelled",tooltip:"Order will not execute - position was already closed"},EXCEEDED:{icon:"⛔",color:"#6B7280",label:"Exceeded",tooltip:"Price deviation exceeds 100% - reduce deviation multiplier or number of orders"}},Ih=({children:e,content:t})=>{const[n,r]=m.useState(!1),[s,a]=m.useState({x:0,y:0}),o=m.useRef(null),l=u=>{const d=u.currentTarget.getBoundingClientRect();a({x:d.left+d.width/2,y:d.top}),r(!0)},c=e==null||typeof e=="string"&&e.trim()==="?"?i.jsx("div",{className:"flex items-center has-tooltip relative",children:i.jsx(Si,{className:"text-[#7C7C7C] w-3.5 min-w-3.5 min-h-3.5 h-3.5"})}):e;return i.jsxs("span",{className:"relative inline-flex",children:[i.jsx("span",{ref:o,onMouseEnter:l,onMouseLeave:()=>r(!1),className:"cursor-help transition-colors ml-1 inline-flex",children:c}),n&&i.jsxs("div",{className:"fixed z-50 px-3 py-2 text-xs bg-[#1a1a1a] border border-[#333] rounded-lg shadow-xl max-w-xs text-[#ccc] whitespace-normal",style:{left:s.x,top:s.y-8,transform:"translate(-50%, -100%)"},children:[t,i.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 top-full w-0 h-0",style:{borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:"6px solid #333"}})]})]})},ng=({label:e,value:t,onChange:n,min:r,max:s,step:a,suffix:o,tooltip:l,placeholder:c,helperText:u,validate:d,readOnly:f=!1,forceError:x=!1,forceErrorMessage:g=null})=>{const[v,w]=m.useState(!1),C=F=>{const U=parseFloat(F);return d?d(U,F):r!==void 0&&!isNaN(U)&&U<parseFloat(r)?`Minimum value is ${r}`:s!==void 0&&!isNaN(U)&&U>parseFloat(s)?`Maximum value is ${s}`:null},N=F=>{let U=F.target.value;const L=parseFloat(U);U!==""&&r!==void 0&&!Number.isNaN(L)&&!Number.isNaN(parseFloat(r))&&L<parseFloat(r)&&(U=String(parseFloat(r))),U!==""&&s!==void 0&&!Number.isNaN(L)&&!Number.isNaN(parseFloat(s))&&L>parseFloat(s)&&(U=String(parseFloat(s))),n(U)},I=()=>{w(!0)},P=C(t),R=x&&(g||P)?g||P:v&&P?P:null;return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:[e,l&&i.jsx(Ih,{content:l,children:"?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"number",value:t,onChange:N,onBlur:I,onWheel:F=>F.currentTarget.blur(),min:r,max:s,step:a,readOnly:f,placeholder:c,className:`w-full px-3 py-2 rounded-lg ${f?"bg-[#101010]":"bg-[#161616]"} border text-white text-sm focus:outline-none transition-colors ${R?"border-[#ff7073] focus:border-[#ff7073]":f?"border-[#1c2a24] focus:border-[#1c2a24] cursor-not-allowed":"border-[#1c2a24] focus:border-[#67FFBD]"}`}),o&&i.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[#6e857d] text-sm",children:o})]}),R&&i.jsx("p",{className:"text-[10px] text-[#ff7073] px-1",children:R}),u&&!R&&i.jsx("p",{className:"text-[10px] text-[#666] px-1",children:u})]})},yyn=e=>{const t=String(e||"").toUpperCase();return gyn.has(t)?`1000${t.slice(1)}`:t},Ao=(e,t=2)=>{if(e==null||isNaN(e))return"-";const n=Math.abs(e);return n>=1e9?`${(e/1e9).toFixed(2)}B`:n>=1e6?`${(e/1e6).toFixed(2)}M`:n>=1e3?`${(e/1e3).toFixed(2)}K`:e.toFixed(t)},wb=(e,t=!1)=>e==null||isNaN(e)?"-":e<=0?t?"Safe ✓":"N/A":e>=1e4?`$${e.toFixed(1)}`:e>=1e3?`$${e.toFixed(2)}`:e>=100?`$${e.toFixed(3)}`:e>=10?`$${e.toFixed(4)}`:`$${e.toFixed(5)}`,vyn=e=>e==null||isNaN(e)?"-":`${e.toFixed(2)}%`,wyn=(e,t)=>{const n=Number(e),r=!Number.isFinite(n)||n<=0?2:n<1e-4?8:n<.01?6:n<1?5:n<10?4:2,s=Number(t);return Math.max(r,Number.isFinite(s)&&s>0?s:0)},wc=e=>String(e||"").toUpperCase().replace(/-USD(T)?$/,"").replace(/\/USD(T)?$/,"").replace(/USD(T)?$/,""),Cyn=(e,t=[])=>{const n=wc(e),r=t.find(s=>{var o;const a=wc(s.symbol||s.rawSymbol||((o=s.raw)==null?void 0:o.symbol)||s.market||"");return a===n||a===`${n}USDT`||a===`${n}USD`||a===n.replace(/USD$/,"")});return r?r.market_index??r.marketIndex??r.market_id??r.marketId??r.id??null:null},Syn=(e,t=[])=>{const n=wc(e);return t.find(r=>{var a;const s=wc(r.symbol||r.rawSymbol||((a=r.raw)==null?void 0:a.symbol)||r.market||"");return s===n||s===`${n}USDT`||s===`${n}USD`||s===n.replace(/USD$/,"")})||null},Nyn=({value:e,onChange:t,min:n=1,max:r=100,tooltip:s})=>{const a=(e-n)/(r-n)*100,o=l=>{const c=l.target.value;if(c===""){t("1");return}const u=parseInt(c);isNaN(u)||t(String(Math.min(r,Math.max(n,u))))};return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Leverage",s&&i.jsx(Ih,{content:s,children:"?"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"flex-1 relative",children:[i.jsx("div",{className:"h-1.5 bg-[#1c2a24] rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-[#67FFBD] rounded-full transition-all",style:{width:`${a}%`}})}),i.jsx("input",{type:"range",min:n,max:r,value:e,onChange:l=>t(l.target.value),className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"}),i.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 w-3.5 h-3.5 bg-[#67FFBD] rounded-full border-2 border-[#101010] pointer-events-none transition-all",style:{left:`calc(${a}% - 7px)`}})]}),i.jsxs("div",{className:"flex items-center bg-[#161616] border border-[#1c2a24] rounded-lg overflow-hidden",children:[i.jsx("input",{type:"number",value:e,onChange:o,onWheel:l=>l.currentTarget.blur(),min:n,max:r,className:"w-12 px-2 py-1.5 bg-transparent text-white text-sm text-center focus:outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),i.jsx("span",{className:"pr-2 text-[#6e857d] text-sm",children:"x"})]})]})]})},bNe=({className:e="",entryPrice:t,onEntryPriceChange:n,maxBudget:r,onBudgetChange:s})=>i.jsxs("div",{className:`bg-[#0f0f0f] border border-[#2b3640] rounded-lg px-3 py-2 flex items-center gap-3 text-xs text-[#cfd4db] whitespace-nowrap overflow-x-auto ${e}`,children:[i.jsxs("div",{className:"flex items-center gap-2 text-white font-semibold",children:[i.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full bg-[#1b2630] text-[#67FFBD]",children:"i"}),i.jsx("span",{children:"Preview Mode"})]}),i.jsxs("div",{className:"flex-1 flex justify-center items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[#cfd4db] text-xs",children:"Entry Price:"}),i.jsx("input",{type:"number",value:t,onChange:a=>n==null?void 0:n(a.target.value.replace(",",".")),step:"0.000001",inputMode:"decimal",className:"h-8 px-3 rounded-lg bg-[#161616] border border-[#1c2a24] text-white text-xs focus:outline-none focus:border-[#67FFBD] w-28",placeholder:"0.000000"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[#cfd4db] text-xs",children:"Budget:"}),i.jsx("input",{type:"number",value:r,onChange:a=>s==null?void 0:s(a.target.value.replace(",",".")),step:"1",inputMode:"decimal",className:"h-8 px-3 rounded-lg bg-[#161616] border border-[#1c2a24] text-white text-xs focus:outline-none focus:border-[#67FFBD] w-28",placeholder:"0"})]})]}),i.jsxs("div",{className:"flex items-center gap-2 text-[#facc15] ml-auto",children:[i.jsx("span",{children:"⚠️"}),i.jsx("span",{className:"text-[11px] text-[#cfd4db]",children:"Calculator only (preview)"})]})]});function Ayn(){var Je;const e=Nue(),t=e.length===0,n=Aue(),r=n.length===0,[s,a]=m.useState("extended"),[o,l]=m.useState([]),[c,u]=m.useState(50),[d,f]=m.useState({}),[x,g]=m.useState("extended"),[v,w]=m.useState("BTC"),[C,N]=m.useState(""),[I,P]=m.useState("long"),[R,F]=m.useState("10"),[U,L]=m.useState("5"),[z,Q]=m.useState("10"),[ne,J]=m.useState("10"),[X,re]=m.useState("1500"),[pe,Y]=m.useState(!1),[ie,oe]=m.useState("1"),[G,V]=m.useState(""),[te,ae]=m.useState(!0),[he,Ce]=m.useState("0.50"),[ce,ge]=m.useState("1.1"),[Ae,ye]=m.useState("1"),[je,Ie]=m.useState(!0),[Re,Qe]=m.useState(!0),[$e,it]=m.useState(!0),[tt,ot]=m.useState(!0),[ft,ct]=m.useState("details"),[Vt,It]=m.useState([]),[an,Nt]=m.useState(!1),[mn,dn]=m.useState([]),[Pt,Xe]=m.useState(!1),[Ut,Lt]=m.useState(null),[qe,Ke]=m.useState(!1),[pt,en]=m.useState({}),[Bt,Et]=m.useState({}),[et,Be]=m.useState(null),Mt=m.useRef(!1),Ve=m.useRef(!0),ut=m.useRef(0),xt=s==="extended"?n:e,jt=s==="extended"?r:t,kt=s==="extended"?"extended_selected_wallet_id":"lighter_selected_wallet_id",xn=m.useMemo(()=>`dca_last_coin_${s}`,[s]),un=m.useMemo(()=>`dca_settings_${s}`,[s]),On=m.useMemo(()=>({baseOrderMargin:"5",dcaOrderMargin:"10",maxDcaOrders:"10",tpTarget:"1",stopLoss:"",priceDeviation:"0.50",dcaSizeMultiplier:"1.1",priceDevMultiplier:"1"}),[]);m.useEffect(()=>{if(typeof window>"u")return;const We=window.localStorage.getItem(un),wt={...On};if(We)try{const At=JSON.parse(We)||{};Object.keys(On).forEach(Gt=>{At[Gt]!==void 0&&At[Gt]!==null&&(wt[Gt]=String(At[Gt]))})}catch{}L(wt.baseOrderMargin),Q(wt.dcaOrderMargin),J(wt.maxDcaOrders),oe(wt.tpTarget),V(wt.stopLoss),Ce(wt.priceDeviation),ge(wt.dcaSizeMultiplier),ye(wt.priceDevMultiplier)},[un,On]),m.useEffect(()=>{if(typeof window>"u")return;const We={baseOrderMargin:U,dcaOrderMargin:z,maxDcaOrders:ne,tpTarget:ie,stopLoss:G,priceDeviation:he,dcaSizeMultiplier:ce,priceDevMultiplier:Ae};try{window.localStorage.setItem(un,JSON.stringify(We))}catch{}},[un,U,z,ne,ie,G,he,ce,Ae]);const En=m.useMemo(()=>{const We=new Map;return o.forEach(wt=>{const At=wc(wt.value||wt.label||wt.symbol||wt.coin);if(!At)return;const Gt=wt.maxLeverage??wt.max_leverage??wt.leverage??null,fn=Number(Gt);We.set(At,Number.isFinite(fn)?fn:null)}),We},[o]),jn=m.useMemo(()=>xt.map(We=>{var fn,Rn,An;const wt=wc(We.symbol||We.rawSymbol||((fn=We.raw)==null?void 0:fn.symbol)||We.market||We.coin),At=We.leverage??We.maxLeverage??We.max_leverage??(wt?En.get(wt):null),Gt=Number.isFinite(Number(At))&&Number(At)>0?Number(At):null;return{...We,symbol:We.symbol||((Rn=We.raw)==null?void 0:Rn.symbol)||We.rawSymbol||We.market||"",rawSymbol:We.rawSymbol||((An=We.raw)==null?void 0:An.symbol)||We.symbol,leverage:Gt,maxLeverage:We.maxLeverage??We.max_leverage??Gt}}),[xt,En]),bn="https://dextrabothypev2.nftinit.io/api/hyper/dca_bot",{setSignModalOpen:Zn,hyperToken:zn,hyperAddress:$n}=m.useContext(Qr),[nr,wn]=m.useState({address:null,token:null}),on=m.useCallback(()=>nr,[nr]),[Oe,rn]=m.useState(!1),cn=We=>{if(!We)return null;const wt=String(We);return wt==="null"||wt==="undefined"?null:wt};m.useEffect(()=>{const We=()=>{if(typeof window>"u")return;const At=cn($n||window.localStorage.getItem("hyperAddress")),Gt=cn(zn||window.localStorage.getItem("hyperToken"));wn({address:At,token:Gt}),(!At||!Gt)&&(rn(!1),dn([]),Lt(null),ut.current=0)};We(),window.addEventListener("localStorageUpdated",We),window.addEventListener("storage",We);const wt=setInterval(()=>{if(typeof window>"u")return;const At=cn($n||window.localStorage.getItem("hyperAddress")),Gt=cn(zn||window.localStorage.getItem("hyperToken"));wn(fn=>fn.address===At&&fn.token===Gt?fn:{address:At,token:Gt}),(!At||!Gt)&&(rn(!1),dn([]),Lt(null),ut.current=0)},1500);return()=>{window.removeEventListener("localStorageUpdated",We),window.removeEventListener("storage",We),clearInterval(wt)}},[zn,$n]),m.useEffect(()=>{const We=!!nr.token,wt=!!nr.address;rn(We&&wt)},[nr]),m.useEffect(()=>()=>{Ve.current=!1},[]);const _t=m.useCallback(async()=>{if(Mt.current)return;const We=nr.address,wt=nr.token;if(!We||!wt){Mt.current=!1,Xe(!1);return}const At=Date.now();if(!(At-ut.current<4500)){ut.current=At,Mt.current=!0,Xe(!0);try{let Gt=[];const Rn=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:We.toLowerCase(),token:wt,balance:"true"})})).json().catch(()=>null);if(!Ve.current||!Rn){Mt.current=!1,Xe(!1);return}let An=[];if(Array.isArray(Rn)?An=Rn:Array.isArray(Rn==null?void 0:Rn.data)&&(An=Rn.data),Gt=await Promise.all(An.map(async(mt,qt)=>{var Vn,gr,Ir;let Qt=null;const In=Number(mt.available_balance??mt.availableForTrade??mt.available_for_trade??mt.balance??mt.available??null);Number.isFinite(In)&&(Qt=In);const or=mt.wallet_id??mt.id??qt,Wn=mt.wallet_api_key||mt.api_key||null;if(Wn&&Qt==null)try{const Fr=`https://express-proxy-delta.vercel.app/proxy?url==${encodeURIComponent("https://api.starknet.extended.exchange/api/v1/user/balance")}`,Ht=await(await fetch(Fr,{headers:{"X-Api-Key":Wn}})).json().catch(()=>null),nn=((Vn=Ht==null?void 0:Ht.data)==null?void 0:Vn.availableForTrade)??(Ht==null?void 0:Ht.availableForTrade)??((gr=Ht==null?void 0:Ht.data)==null?void 0:gr.available_balance)??(Ht==null?void 0:Ht.available_balance)??((Ir=Ht==null?void 0:Ht.data)==null?void 0:Ir.available)??(Ht==null?void 0:Ht.available),Sr=Number(nn);Number.isFinite(Sr)&&Sr>=0&&(Qt=Sr)}catch{}return{wallet_id:or,wallet_address:mt.wallet_address||mt.address||"",wallet_name:mt.wallet_name||mt.name||`Extended Wallet ${qt+1}`,available_balance:Qt,wallet_api_key:Wn}})),!Ve.current)return;dn(Gt),Gt.length>0?Lt(mt=>{const qt=typeof window<"u"?window.localStorage.getItem(kt):null,Qt=(mt==null?void 0:mt.id)??qt,In=Qt&&Gt.find(or=>String(or.wallet_id)===String(Qt))||Gt[0];return In?{id:In.wallet_id,address:In.wallet_address,apiKey:In.wallet_api_key}:null}):Lt(null)}catch(Gt){console.error("Error loading wallets:",Gt),Ve.current&&dn([])}finally{Mt.current=!1,Ve.current&&Xe(!1)}}},[nr.address,nr.token,s,kt]);m.useEffect(()=>{Oe&&_t()},[Oe,_t]),m.useEffect(()=>{nr.address&&nr.token?(rn(!0),_t()):(rn(!1),dn([]),Lt(null),ut.current=0)},[nr.address,nr.token,_t]),m.useEffect(()=>{const We=()=>_t();return window.addEventListener("localStorageUpdated",We),window.addEventListener("storage",We),()=>{window.removeEventListener("localStorageUpdated",We),window.removeEventListener("storage",We)}},[_t]),m.useEffect(()=>{ut.current=0,dn([]),Lt(null),Be(null)},[s]),m.useEffect(()=>{Y(!1)},[Ut==null?void 0:Ut.id,s]);const Yn=m.useMemo(()=>{if(!Ut||!Ut.id)return null;const We=mn.find(At=>String(At.wallet_id)===String(Ut.id));if(!We)return null;if(s==="extended"&&Ut.apiKey){const At=Number(et==null?void 0:et.availableForTrade);if(Number.isFinite(At))return At}const wt=Number(We.available_balance??We.availableForTrade??We.available_for_trade??We.balance??We.available??null);return Number.isFinite(wt)?wt:null},[mn,Ut,s,et]),yn=m.useCallback(async()=>{const We=nr.address,wt=nr.token;if(!We||!wt){It([]);return}Nt(!0);try{const Gt=await(await fetch(`${bn}/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:We.toLowerCase(),token:wt,source_market:s})})).json().catch(()=>null),Rn=(Array.isArray(Gt==null?void 0:Gt.data)?Gt.data:Gt!=null&&Gt.data?[Gt.data]:[]).filter(An=>An?s?String(An.source_market||"").toLowerCase()===String(s||"").toLowerCase()?!0:s==="hyper"&&!An.source_market:!0:!1);It(Rn)}catch(At){console.error("Error loading bots:",At),It([])}finally{Nt(!1)}},[on,bn,s]);m.useEffect(()=>{yn()},[yn,nr.address,nr.token,s]);const Dt=m.useCallback(async()=>{var At,Gt;const{address:We,token:wt}=on();if(!We||!wt||!Ut||!Ut.id){ln.error("Please connect your wallet and select a wallet.");return}Ke(!0);try{const fn=(At=v==null?void 0:v.toUpperCase())==null?void 0:At.trim(),Rn=yyn(fn);let An=null;if(s==="lighter")try{const Br=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/funding-rates")).json().catch(()=>null);if(Br!=null&&Br.funding_rates&&Array.isArray(Br.funding_rates)){const Kr=Br.funding_rates.find(As=>String(As.symbol||"").toUpperCase().trim()===fn);console.log("coinRate",Kr),Kr&&Kr.market_id!=null?(An=Kr.market_id,console.log(`✅ Found market_id ${An} for coin ${fn} from funding-rates API (exchange: ${Kr.exchange})`)):(console.warn(`❌ Coin ${fn} not found in funding-rates API`),console.log("Sample available symbols:",Br.funding_rates.slice(0,20).map(As=>As.symbol)))}else console.warn("No funding_rates array in API response")}catch(Sr){console.error("Error fetching funding-rates API:",Sr),An=d[fn]||null,An&&console.log(`Using cached market_id ${An} for coin ${fn}`)}if(An===null){if(s==="extended"&&(!xt||!xt.length)){ln.error("Extended markets are loading. Please try again in a moment."),Ke(!1);return}An=Cyn(v,xt)}if(An===null&&s!=="extended"){console.error("Market not found for coin:",fn),ln.error(`Unable to find market index for ${fn}. Please make sure the coin is available on ${s}.`),Ke(!1);return}An!=null&&console.log(`Using market_index: ${An} for coin: ${fn}`);const pr=mn.find(Sr=>String(Sr.wallet_id)===String(Ut.id));if(!pr||!pr.wallet_id){ln.error("Unable to find selected wallet. Please select a wallet again."),Ke(!1);return}const mt=Math.max(1,Math.min(Number(c)||100,Number(R)||1)),qt=Syn(v,xt),Qt=String(v||"").toUpperCase(),In=Number((qt==null?void 0:qt.maxLeverage)??(qt==null?void 0:qt.leverage)??(qt==null?void 0:qt.max_leverage)??c??0),or=s==="extended"&&In>0?Math.min(In,mt||In):mt,Wn=parseFloat(ie)||0,Vn=Number(C)||Number(qt==null?void 0:qt.markPrice)||Number(qt==null?void 0:qt.lastPrice)||Number(qt==null?void 0:qt.last)||null,gr=Number(((Gt=qt==null?void 0:qt.tradingConfig)==null?void 0:Gt.minOrderSize)??(qt==null?void 0:qt.minOrderSize)),Ir=Number.isFinite(gr)&&gr>0&&Number.isFinite(Vn)&&Vn>0?gr*Vn:null;if(s==="extended"&&Ir!=null){const Sr=parseFloat(U)||0,Br=parseFloat(z)||0,Kr=Sr*or,As=Br*or;if(Kr<Ir||As<Ir){const ms=[];Kr<Ir&&ms.push("Base Order"),As<Ir&&ms.push("DCA Order");const vr=ms.length===1?` (${ms[0]})`:ms.length===2?" (Base Order & DCA Order)":"";ln.error(`Minimum order size for ${Qt} is $${Ir.toFixed(2)}${vr}. Increase order size or leverage.`),Ke(!1);return}}const Fr={direction:I,leverage:or,base_amount_usd:parseFloat(U)||0,safety_amount_usd:parseFloat(z)||0,max_safety_orders:parseInt(ne)||0,price_deviation:parseFloat(he)||.5,step_scale:parseFloat(Ae)||1,volume_scale:parseFloat(ce)||1.5,tp_percent:Wn,stop_loss_percent:G?parseFloat(G):0};s!=="extended"&&An!=null&&(Fr.market_index=Number.isFinite(Number(An))?Number(An):An);const Lr={address:We.toLowerCase(),token:wt,wallet_id:pr.wallet_id,source_market:s,bot_params:Fr,coin:Rn};console.log("DCA Bot API Request:",JSON.stringify(Lr,null,2));const nn=await(await fetch(`${bn}/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Lr)})).json().catch(()=>null);nn!=null&&nn.success?(ln.success("DCA Bot started successfully!"),await yn(),ct("bots")):ln.error((nn==null?void 0:nn.error_message)||"Failed to start bot. Please try again.")}catch(fn){console.error("Error starting bot:",fn),ln.error("Error starting bot. Please try again.")}finally{Ke(!1)}},[on,Ut,s,v,xt,d,mn,I,R,U,z,ne,he,ce,Ae,ie,G,yn,bn]);m.useCallback(async We=>{const{address:wt,token:At}=on();if(!wt||!At||!Ut||!Ut.id){ln.error("Please connect your wallet and select a wallet.");return}const Gt=mn.find(fn=>String(fn.wallet_id)===String(Ut.id));if(!Gt||!Gt.wallet_id){ln.error("Unable to find selected wallet. Please select a wallet again.");return}en(fn=>({...fn,[We]:!0}));try{const Rn=await(await fetch(`${bn}/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:wt.toLowerCase(),token:At,wallet_id:Gt.wallet_id,source_market:s,coin:v})})).json().catch(()=>null);Rn!=null&&Rn.success?await yn():ln.error((Rn==null?void 0:Rn.error_message)||"Failed to stop bot. Please try again.")}catch(fn){console.error("Error stopping bot:",fn),ln.error("Error stopping bot. Please try again.")}finally{en(fn=>({...fn,[We]:!1}))}},[on,Ut,s,v,mn,yn,bn]);const sn=m.useCallback(async(We,wt,At={})=>{const{address:Gt,token:fn}=on();if(!Gt||!fn){ln.error("Please connect your wallet.");return}en(Rn=>({...Rn,[We]:!0})),It(Rn=>Rn.map(An=>An.id===We||An.bot_id===We?{...An,is_deleted:wt,...At}:An));try{const An=await(await fetch(`${bn}/update/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Gt.toLowerCase(),token:fn,bot_id:We,update_params:{is_deleted:wt,...At}})})).json().catch(()=>null);if(An!=null&&An.success)await yn(),wt&&ln.success("DCA Bot has been stopped.");else{await yn();const pr=(An==null?void 0:An.error_message)||(An==null?void 0:An.message)||(An==null?void 0:An.detail)||(An==null?void 0:An.error),mt=wt?"Failed to stop bot. Please try again.":"Cannot start this bot. Another bot for this coin may already be active. Stop it first or choose a different coin.";ln.error(pr||mt)}}catch(Rn){console.error("Error updating bot:",Rn),await yn(),ln.error(wt?"Failed to stop bot. Please try again.":"Cannot start this bot. Another bot for this coin may already be active. Stop it first or choose a different coin.")}finally{en(Rn=>({...Rn,[We]:!1}))}},[on,yn,bn]);m.useCallback(async We=>{const{address:wt,token:At}=on();if(!wt||!At){ln.error("Please connect your wallet.");return}if(confirm("Are you sure you want to delete this bot? This action cannot be undone.")){Et(Gt=>({...Gt,[We]:!0})),It(Gt=>Gt.filter(fn=>fn.id!==We&&fn.bot_id!==We));try{const Gt=await fetch(`${bn}/update/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:wt.toLowerCase(),token:At,bot_id:We,update_params:{permanent_delete:!0,is_deleted:!0}})}),fn=await Gt.json().catch(()=>null);if(console.log("Delete bot response:",fn),console.log("Response status:",Gt.status),fn!=null&&fn.success)await yn();else{console.log("Trying delete endpoint as fallback...");const Rn=await fetch(`${bn}/delete/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:wt.toLowerCase(),token:At,bot_id:We})}),An=await Rn.json().catch(()=>null);if(console.log("Delete endpoint response:",An),An!=null&&An.success)await yn();else{await yn();const pr=(An==null?void 0:An.error_message)||(fn==null?void 0:fn.error_message)||(An==null?void 0:An.message)||(fn==null?void 0:fn.message)||(An==null?void 0:An.detail)||(fn==null?void 0:fn.detail)||`Failed to delete bot. Status: ${Rn.status||Gt.status}`;console.error("Delete bot error:",pr,{data:fn,deleteData:An}),ln.error(pr)}}}catch(Gt){console.error("Error deleting bot:",Gt),await yn(),ln.error(`Error deleting bot: ${Gt.message||"Please try again."}`)}finally{Et(Gt=>({...Gt,[We]:!1}))}}},[on,yn,bn]),m.useEffect(()=>{let We=!1;async function wt(){try{const Gt=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/funding-rates")).json().catch(()=>null);if(We||!(Gt!=null&&Gt.funding_rates))return;const fn={};Gt.funding_rates.filter(Rn=>Rn.exchange==="lighter").forEach(Rn=>{if(Rn.symbol&&Rn.market_id!=null){const An=String(Rn.symbol).toUpperCase().trim();fn[An]=Rn.market_id}}),We||(f(fn),console.log(`✅ Loaded ${Object.keys(fn).length} market IDs from funding-rates API for lighter exchange`))}catch(At){console.error("Error loading market IDs from funding-rates API:",At),We||f({})}}return wt(),()=>{We=!0}},[]),m.useEffect(()=>{let We=!1;async function wt(){try{const Gt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=lighter_fr")).json().catch(()=>null);if(We)return;let fn=[];Array.isArray(Gt)?fn=Gt:Array.isArray(Gt==null?void 0:Gt.data)?fn=Gt.data:Array.isArray(Gt==null?void 0:Gt.coins)&&(fn=Gt.coins);const Rn=fn.map(An=>({value:String(An.value||An.label||An.symbol||An.coin||"").toUpperCase(),label:An.label||An.value||An.symbol||An.coin,maxLeverage:An.maxLeverage||50}));We||l(Rn)}catch{We||l([])}}return wt(),()=>{We=!0}},[]),m.useEffect(()=>{var pr;if(!xt.length)return;const We=wc(v);if(We?xt.some(mt=>wc(mt.symbol)===We):!1)return;const At=typeof window<"u"?window.localStorage.getItem(xn):null,Gt=wc(At),fn=At&&Gt?xt.some(mt=>wc(mt.symbol)===Gt):!1,Rn=xt[0],An=fn?Gt:wc((Rn==null?void 0:Rn.symbol)||((pr=Rn==null?void 0:Rn.raw)==null?void 0:pr.symbol)||(Rn==null?void 0:Rn.rawSymbol));w(An||"BTC")},[xt,v,xn]);const Tn=m.useMemo(()=>{const We=wc(v);return We&&(xt.find(wt=>wc(wt.symbol)===We)||xt.find(wt=>{var At;return wc(((At=wt.raw)==null?void 0:At.symbol)||wt.rawSymbol)===We}))||null},[xt,v]),Kn=m.useMemo(()=>{const We=wc(v);if(!We)return null;const wt=xyn[We]||We;return(Tn==null?void 0:Tn.kind)==="hip3"&&(Tn!=null&&Tn.builder)?`${Tn.builder}:${wt}`:wt},[v,Tn]),ir=m.useMemo(()=>{const We=wc(v);return We&&Vt.find(wt=>{var Gt,fn;const At=wc(wt.coin||wt.symbol||((Gt=wt.bot_params)==null?void 0:Gt.coin)||((fn=wt.bot_params)==null?void 0:fn.symbol));return!wt.is_deleted&&At===We})||null},[Vt,v]),rr=m.useMemo(()=>{const We=Vt.filter(At=>!At.is_deleted),wt=Vt.filter(At=>At.is_deleted);return[...We,...wt]},[Vt]),Jt=Number(C)||Number(Tn==null?void 0:Tn.markPrice)||Number(Tn==null?void 0:Tn.lastPrice)||Number(Tn==null?void 0:Tn.last)||null,Un=Number(((Je=Tn==null?void 0:Tn.tradingConfig)==null?void 0:Je.minOrderSize)??(Tn==null?void 0:Tn.minOrderSize)),Qn=s==="extended"&&Number.isFinite(Un)&&Un>0&&Number.isFinite(Jt)&&Jt>0?Un*Jt:null,Rt=Math.max(1,Number(R)||1),Pn=parseFloat(U)||0,Ee=parseFloat(z)||0,p=Pn*Rt,h=Ee*Rt,S=s==="extended"&&Qn!=null&&p<Qn,_=s==="extended"&&Qn!=null&&h<Qn,k=S||_,T=We=>{if(Qn==null||!Number.isFinite(Rt)||Rt<=0)return"Minimum order size not met";const wt=Qn/Rt,At=Math.abs(Rt-Math.round(Rt))<1e-6?Math.round(Rt):Number(Rt.toFixed(2));return`${We} must be at least $${wt.toFixed(2)} (min. $${Qn.toFixed(2)} notional ÷ ${At}x leverage)`};m.useEffect(()=>{const We=o.find(Gt=>Gt.value===v),wt=s==="extended"?(Tn==null?void 0:Tn.maxLeverage)??(Tn==null?void 0:Tn.leverage)??(Tn==null?void 0:Tn.max_leverage)??50:We==null?void 0:We.maxLeverage,At=Number(wt);Number.isFinite(At)&&At>0&&(u(At),F(Gt=>{const fn=parseInt(Gt)||1;return String(Math.min(At,Math.max(1,fn)))}))},[v,o,Tn,s]),m.useEffect(()=>{if(s!=="extended"||!(Ut!=null&&Ut.apiKey)){Be(null);return}let We=!1;const wt=async()=>{var Gt,fn,Rn,An;try{const pr=`https://express-proxy-delta.vercel.app/proxy?url=${encodeURIComponent("https://api.starknet.extended.exchange/api/v1/user/balance")}`,qt=await(await fetch(pr,{headers:{"X-Api-Key":Ut.apiKey}})).json().catch(()=>null);if(We)return;const Qt=((Gt=qt==null?void 0:qt.data)==null?void 0:Gt.availableForTrade)??(qt==null?void 0:qt.availableForTrade)??((fn=qt==null?void 0:qt.data)==null?void 0:fn.available_balance)??(qt==null?void 0:qt.available_balance)??((Rn=qt==null?void 0:qt.data)==null?void 0:Rn.available)??(qt==null?void 0:qt.available),In=Number(Qt),or=((An=qt==null?void 0:qt.data)==null?void 0:An.equity)??(qt==null?void 0:qt.equity),Wn=Number(or);Be({availableForTrade:Number.isFinite(In)&&In>=0?In:null,equity:Number.isFinite(Wn)?Wn:null,raw:qt})}catch{We||Be(null)}};wt();const At=setInterval(wt,2e4);return()=>{We=!0,clearInterval(At)}},[s,Ut==null?void 0:Ut.apiKey]),m.useEffect(()=>{if(s!=="extended")return;const We=et==null?void 0:et.equity;Number.isFinite(We)&&!pe&&re(String(We))},[et==null?void 0:et.equity,s,pe]);const B=m.useRef(v),W=m.useRef(!1);m.useEffect(()=>{const We=B.current!==v,wt=!W.current&&!C;if((We||wt)&&(Tn!=null&&Tn.last)&&Tn.last>0){B.current=v,W.current=!0;const At=wyn(Tn.last,Tn.priceDecimals);N(Number(Tn.last).toFixed(At))}},[v,Tn==null?void 0:Tn.last,C]);const ee=m.useCallback(We=>{const wt=wc(We);w(wt),typeof window<"u"&&window.localStorage.setItem(xn,wt)},[xn]),de=m.useCallback(We=>{Y(!0),re(We)},[]),fe=m.useCallback(We=>{N(We)},[]),xe=jt,we=I==="smart",ke=m.useCallback(We=>{const wt=parseFloat(R)||10,At=.6/wt,Gt=parseFloat(C)||0,fn=parseFloat(U)||0,Rn=parseFloat(z)||0,An=parseInt(ne)||0,pr=parseFloat(X)||1/0,mt=parseFloat(he)||0,qt=parseFloat(ce)||1.1,Qt=parseFloat(Ae)||1,In=parseFloat(ie)||0,or=parseFloat(G)||100,Wn=We==="smart",Vn=We==="long";if(Wn)return{orders:[],metrics:null};if(Gt<=0||fn<=0)return{orders:[],metrics:null};let gr=fn;for(let hn=1;hn<=An;hn++)gr+=Rn*Math.pow(qt,hn-1);const Ir=[];let Fr=0,Lr=0,Ht=0,nn=0,Sr=0,Br=0,Kr=!1,As=null;const ms=pr,vr=fn*wt,Yr=vr/Gt;Fr=fn,Lr=vr,Ht=Yr,Fr>pr&&(Kr=!0,As=0);const vi=Vn?(Gt*Ht-ms)/(Ht*(1-At)):(ms+Gt*Ht)/(Ht*(1+At)),_r=Vn?Gt*(1+In/100):Gt*(1-In/100);let os="SAFE";vi<=0||(Vn&&vi>=Gt||!Vn&&vi<=Gt)&&(os="LIQUIDATED"),Kr&&(os="WARNING",Br++);const Gs=Yr*Gt*At,mi=ms/Gs,ns=Vn?(_r-Gt)*Yr:(Gt-_r)*Yr;Ir.push({label:"Base",deviation:0,price:Gt,margin:fn,positionValue:vr,coins:Yr,totalCoins:Yr,totalMargin:Fr,avgEntry:Gt,tpPrice:_r,tpProfit:ns,liqPrice:vi,healthRatio:mi,status:os});let Xt=!1,ue=vi,rt=Gt,Ft=_r;for(let hn=1;hn<=An;hn++){hn===1?nn=mt:nn+=mt*Math.pow(Qt,hn-1);const vn=Vn?Gt*(1-nn/100):Gt*(1+nn/100);if(Xt){Ir.push({label:`DCA ${hn}`,deviation:nn,price:vn,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:"CANCELLED"});continue}if(vn<=0){Xt=!0,Ir.push({label:`DCA ${hn}-${An}`,deviation:nn,price:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:"EXCEEDED",exceededCount:An-hn+1,isLong:Vn});break}const lr=Rn*Math.pow(qt,hn-1),Nr=lr*wt,fr=Nr/vn,cr=Fr+lr;cr>pr&&!Kr&&(Kr=!0,As=hn),Fr=cr,Lr+=Nr,Ht+=fr;const ts=Lr/Ht,is=Vn?(ts*Ht-ms)/(Ht*(1-At)):(ms+ts*Ht)/(Ht*(1+At));if(Vn?is>0&&vn<=is:is>0&&vn>=is){Xt=!0,Ir.push({label:"💀 Liq",deviation:null,price:ue,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:rt,tpPrice:Ft,tpProfit:null,liqPrice:ue,healthRatio:null,status:"LIQUIDATED"});for(let zt=hn;zt<=An;zt++){let er=0;for(let Ar=1;Ar<=zt;Ar++)Ar===1?er=mt:er+=mt*Math.pow(Qt,Ar-1);const qn=Vn?Gt*(1-er/100):Gt*(1+er/100),kr=qn>0;Ir.push({label:`DCA ${zt}`,deviation:er,price:kr?qn:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:kr?"CANCELLED":"EXCEEDED"})}break}const hr=Vn?is>=ts:is<=ts,Jn=Vn?ts*(1+In/100):ts*(1-In/100),vs=or>=100?null:Vn?ts*(1-or/100):ts*(1+or/100),si=Vn?(vn-ts)*Ht:(ts-vn)*Ht,ni=ms+si,Er=Ht*vn*At,Sn=ni/Er;let Mn="SAFE";if(hr){Xt=!0,Ir.push({label:`DCA ${hn}`,deviation:nn,price:vn,margin:lr,positionValue:Nr,coins:fr,totalCoins:Ht,totalMargin:Fr,avgEntry:ts,tpPrice:null,tpProfit:null,liqPrice:is,healthRatio:null,status:"LIQUIDATED"});for(let zt=hn+1;zt<=An;zt++){let er=0;for(let Ar=1;Ar<=zt;Ar++)Ar===1?er=mt:er+=mt*Math.pow(Qt,Ar-1);const qn=Vn?Gt*(1-er/100):Gt*(1+er/100),kr=qn>0;Ir.push({label:`DCA ${zt}`,deviation:er,price:kr?qn:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:kr?"CANCELLED":"EXCEEDED"})}break}else vs!==null&&(Vn&&vn<=vs||!Vn&&vn>=vs)?(Mn="STOPPED",Xt=!0):Sn<1.5?(Mn="WARNING",Br++):Sr++;const at=Vn?(Jn-ts)*Ht:(ts-Jn)*Ht;ue=is,rt=ts,Ft=Jn,Ir.push({label:`DCA ${hn}`,deviation:nn,price:vn,margin:lr,positionValue:Nr,coins:fr,totalCoins:Ht,totalMargin:Fr,avgEntry:ts,tpPrice:Jn,tpProfit:at,liqPrice:is,healthRatio:Sn,status:Mn})}const yt=[...Ir].reverse().find(hn=>hn.status!=="CANCELLED")||Ir[Ir.length-1];return{orders:Ir,metrics:{totalMargin:Fr,totalPositionValue:Lr,liquidationPrice:yt.liqPrice,breakEvenPrice:yt.avgEntry,safeCount:Sr,warningCount:Br,budgetOk:!Kr,budgetExceededAt:As,leverage:wt,requiredBudget:gr}}},[C,R,U,z,ne,X,he,ce,Ae,ie,G]),Me=m.useMemo(()=>ke(I),[ke,I]),Ye=m.useMemo(()=>Me.orders.filter(We=>We.status!=="CANCELLED").map(We=>({name:We.label,orderPrice:je&&We.price!=null&&We.price>0?We.price:null,avgEntry:Re&&We.avgEntry!=null&&We.avgEntry>0?We.avgEntry:null,tpPrice:$e&&We.tpPrice!=null&&We.tpPrice>0?We.tpPrice:null,liqPrice:tt&&We.liqPrice!=null&&We.liqPrice>0?We.liqPrice:null,status:We.status})),[Me.orders,je,Re,$e,tt]),Fe=m.useMemo(()=>{const We=[];if(Ye.forEach(fn=>{fn.orderPrice!=null&&We.push(fn.orderPrice),fn.avgEntry!=null&&We.push(fn.avgEntry),fn.tpPrice!=null&&We.push(fn.tpPrice)}),We.length===0)return["auto","auto"];const wt=Math.min(...We),At=Math.max(...We),Gt=(At-wt)*.1;return[Math.max(0,wt-Gt),At+Gt]},[Ye]),st=We=>{const{cx:wt,cy:At,payload:Gt}=We;return Gt.status==="LIQUIDATED"&&wt&&At?i.jsx("text",{x:wt,y:At,textAnchor:"middle",dominantBaseline:"middle",fontSize:14,children:"💀"}):null},se=We=>{switch(We){case"orderPrice":Ie(!je);break;case"avgEntry":Qe(!Re);break;case"tpPrice":it(!$e);break;case"liqPrice":ot(!tt);break}},Se=We=>{const{payload:wt}=We;return i.jsx("div",{className:"flex flex-wrap justify-center gap-2 sm:gap-4 mt-2",children:wt.map((At,Gt)=>{const fn=At.dataKey==="orderPrice"?je:At.dataKey==="avgEntry"?Re:At.dataKey==="tpPrice"?$e:At.dataKey==="liqPrice"?tt:!0;return i.jsxs("button",{onClick:()=>se(At.dataKey),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-all ${fn?"opacity-100":"opacity-40"}`,style:{color:At.color},children:[i.jsx("span",{className:"w-3 h-0.5",style:{backgroundColor:At.color}}),At.value]},Gt)})})},{orders:De,metrics:Le}=Me,_e=De.filter(We=>We.status!=="CANCELLED"),nt=m.useMemo(()=>{var mt,qt;if(!we)return null;const We=ke("long"),wt=ke("short"),At=(mt=We.metrics)==null?void 0:mt.safeCount,Gt=(qt=wt.metrics)==null?void 0:qt.safeCount,fn=We.orders.some(Qt=>Qt.status==="LIQUIDATED"),Rn=wt.orders.some(Qt=>Qt.status==="LIQUIDATED"),An=Number.isFinite(At)&&Number.isFinite(Gt)?Math.max(At,Gt):null;let pr=!1;return Number.isFinite(At)&&Number.isFinite(Gt)?At>Gt?pr=fn:Gt>At?pr=Rn:pr=fn&&Rn:pr=fn||Rn,{safeOrders:An,hasLiquidation:pr}},[ke,we]),lt=m.useMemo(()=>we?!!(nt!=null&&nt.hasLiquidation):_e.some(We=>We.status==="LIQUIDATED"),[we,_e,nt==null?void 0:nt.hasLiquidation]),bt=m.useMemo(()=>{if(!lt)return null;const We=we?nt==null?void 0:nt.safeOrders:Le==null?void 0:Le.safeCount,wt=Number.isFinite(We)?We:0,At=parseInt(ne)||0;return`Liquidation occurs before completing all DCA orders. Safe orders: ${wt} of ${At}. Reduce leverage, widen spacing, or lower max DCA orders.`},[lt,we,nt==null?void 0:nt.safeOrders,Le==null?void 0:Le.safeCount,ne]),Zt=m.useMemo(()=>{const We=we?nt==null?void 0:nt.safeOrders:Le==null?void 0:Le.safeCount,wt=parseInt(ne);return!Number.isFinite(We)||!Number.isFinite(wt)?null:wt>We?`Only ${We} of ${wt} DCA orders are currently safe. Increase budget, reduce leverage, or lower Max DCA Orders.`:null},[we,nt==null?void 0:nt.safeOrders,Le==null?void 0:Le.safeCount,ne]),Ge=({variant:We="desktop"})=>{const wt=We==="desktop"?"px-4 py-5":"p-3";return i.jsxs("div",{className:`${wt} space-y-3`,children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#a78bfa]/15 text-[#d7c8ff]",children:i.jsx(pNe,{className:"w-4 h-4"})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-semibold text-white",children:"Smart Direction Mode"}),i.jsx("p",{className:"text-[12px] text-[#9b9b9b]",children:"When Smart mode is enabled, the bot checks the Extended 24h price change before each trade:"})]})]}),i.jsx("div",{className:"rounded-lg border border-[#1c2a24] bg-[#0b1511] p-4 space-y-3",children:i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(mNe,{className:"w-5 h-5 text-[#67FFBD] mt-0.5"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-sm font-semibold text-white",children:"How it works"}),i.jsxs("div",{className:"space-y-2 text-sm text-[#cfd4db]",children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(hNe,{className:"w-4 h-4 mt-0.5 text-[#67FFBD]"}),i.jsx("span",{children:"If 24h change is positive (+%) → Opens a Long position."})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(fyn,{className:"w-4 h-4 mt-0.5 text-[#ff7073]"}),i.jsxs("span",{children:[" ","If 24h change is negative (-%) → Opens a Short position."]})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(mNe,{className:"w-4 h-4 mt-0.5 text-[#a78bfa]"}),i.jsx("span",{children:"Order details and calculations are not available in Smart mode since the direction is dynamic."})]})]})]})]})}),i.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-[#1c2a24] bg-[#111] p-3",children:[i.jsx(hyn,{className:"w-5 h-5 text-[#facc15] mt-0.5"}),i.jsxs("p",{className:"text-[13px] text-[#e5e7eb]",children:[i.jsx("span",{className:"font-semibold text-white",children:"Tip:"})," To preview the DCA order table for Long or Short scenarios, switch the Direction selector to the desired mode."]})]})]})};return i.jsx("div",{className:"text-white",style:{fontFamily:"Manrope, sans-serif"},children:i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5",children:[i.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"1"}),"Market & Coin"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx("div",{className:"col-span-2",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Market",i.jsx(Ih,{content:"Extended is temporarily the only available market.",children:"?"})]}),i.jsx(pyn,{value:x,onChange:g})]})}),i.jsx("div",{className:"col-span-2",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:[s==="extended"?"Extended Wallet":"Lighter Wallet",i.jsx(Ih,{content:"Select the wallet to use for this DCA bot. The bot will execute trades using this wallet.",children:"?"})]}),Oe?Pt?i.jsx("div",{className:"w-full px-3 py-2 rounded-lg bg-[#161616] border border-[#1c2a24] text-white text-sm flex items-center justify-center",children:i.jsxs("svg",{className:"animate-spin h-4 w-4 text-[#67FFBD]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):i.jsx(bT,{wallets:mn,value:Ut&&Ut.id?String(Ut.id):"",onChange:We=>{const wt=mn.find(At=>String(At.wallet_id)===String(We));wt&&(Lt({id:wt.wallet_id,address:wt.wallet_address,apiKey:wt.wallet_api_key}),typeof window<"u"&&window.localStorage.setItem(kt,String(wt.wallet_id)))},selectedBalance:Yn,mode:s}):i.jsx("div",{className:"w-full",children:i.jsx(r0,{onClick:()=>Zn(!0)})})]})}),i.jsx("div",{className:"col-span-2",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Coin",i.jsx(Ih,{content:"Select the trading pair. Price and max leverage will update automatically.",children:"?"})]}),i.jsxs("div",{className:"relative rounded-lg border border-[#1c2a24] bg-[#161616] px-2 py-1.5 flex items-center gap-2 h-8",children:[i.jsx("img",{src:`${byn}/${Kn||"BTC"}.svg`,alt:v||"coin",className:"w-6 h-6 rounded-full bg-[#161616] border border-[#1c2a24]",loading:"lazy",onError:We=>dm(We)}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx(gue,{markets:jn,value:v,onChange:ee,loading:xe,showIcon:!0})})]})]})})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"2"}),"Position Setup"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"col-span-2 space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Direction",i.jsx(Ih,{content:"Long: Profit when price rises. Short: Profit when price falls.",children:"?"})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[i.jsx("button",{type:"button",onClick:()=>P("short"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${I==="short"?"bg-[#ff7073]/20 border-[#ff7073] text-[#ff7073]":"bg-[#161616] border-[#1c2a24] text-[#6e857d] hover:border-[#ff7073]/50"}`,children:"Short"}),i.jsx("button",{type:"button",onClick:()=>P("long"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${I==="long"?"bg-[#67FFBD]/20 border-[#67FFBD] text-[#67FFBD]":"bg-[#161616] border-[#1c2a24] text-[#6e857d] hover:border-[#67FFBD]/50"}`,children:"Long"}),i.jsxs("button",{type:"button",onClick:()=>P("smart"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${I==="smart"?"bg-[#a78bfa]/20 border-[#a78bfa] text-[#d7c8ff]":"bg-[#161616] border-[#1c2a24] text-[#7f7b9f] hover:border-[#a78bfa]/50"}`,children:[i.jsx(pNe,{className:"w-4 h-4"}),"Smart"]})]})]}),i.jsx("div",{className:"col-span-2",children:i.jsx(Nyn,{value:R,onChange:F,min:1,max:c,tooltip:`Position multiplier. 10x leverage means $100 margin controls $1,000 position. Max leverage for ${v}: ${c}x`})})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"3"}),"Order Sizing"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(ng,{label:"Base Order Margin",value:U,onChange:L,step:"1",min:"1",suffix:"$",tooltip:"Initial margin for the first position opened at Entry Price.",validate:(We,wt)=>!wt||isNaN(We)?"Required":We<1?"Must be at least 1":s==="extended"&&Qn!=null&&We*Rt<Qn?T("Base Order Margin"):null}),i.jsx(ng,{label:"DCA Order Margin",value:z,onChange:Q,step:"1",min:"1",suffix:"$",tooltip:"Starting margin for DCA orders.",validate:(We,wt)=>!wt||isNaN(We)?"Required":We<1?"Must be at least 1":s==="extended"&&Qn!=null&&We*Rt<Qn?T("DCA Order Margin"):null}),i.jsx(ng,{label:"Max DCA Orders",value:ne,onChange:J,step:"1",max:"50",tooltip:"Maximum number of DCA orders to place after the Base Order.",validate:(We,wt)=>!wt||isNaN(We)?"Required":We<1?"Minimum 1":We>50?"Maximum 50":null,forceError:lt||!!Zt,forceErrorMessage:bt||Zt}),i.jsx(ng,{label:"Available to Trade",value:Yn!=null?String(Yn):"",onChange:()=>{},step:"100",suffix:"$",readOnly:!0,tooltip:"Wallet balance available for trading. Read only."})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"4"}),"Exit Strategy"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(ng,{label:"Take Profit",value:ie,onChange:oe,step:"0.1",suffix:"%",tooltip:"Target profit % calculated from the weighted average entry price."}),i.jsx(ng,{label:"Stop Loss",value:G,onChange:V,step:"1",suffix:"%",tooltip:"Maximum loss % from average entry before position closes. Leave empty to disable stop loss and rely only on liquidation"})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] overflow-hidden",children:[i.jsxs("button",{onClick:()=>ae(!te),className:"w-full flex items-center justify-between p-4 hover:bg-[#111] transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-semibold text-[#d7ffe9]",children:"Advanced Settings"}),i.jsxs("span",{className:"text-xs text-[#666]",children:["Dev: ",he,"% • Dev Mult: ",Ae,"x • Size: ",ce,"x"]})]}),te?i.jsx(Dan,{className:"w-4 h-4 text-[#67FFBD]"}):i.jsx(Fan,{className:"w-4 h-4 text-[#67FFBD]"})]}),i.jsx(mT,{children:te&&i.jsx(vo.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},children:i.jsxs("div",{className:"px-4 pb-4 grid grid-cols-2 gap-3 border-t border-[#1c2a24] pt-3",children:[i.jsx(ng,{label:"Price Deviation",value:he,onChange:Ce,step:"0.1",suffix:"%",tooltip:"Initial price change % from Entry Price to trigger DCA."}),i.jsx(ng,{label:"DCA Order Size Multiplier",value:ce,onChange:ge,step:"0.1",suffix:"x",tooltip:"Multiplier for each DCA order's margin."}),i.jsx(ng,{label:"Price Deviation Multiplier",value:Ae,onChange:ye,step:"0.05",suffix:"x",tooltip:"Multiplier for price gaps between DCA orders."})]})})})]}),(()=>{const We=C&&!isNaN(parseFloat(C))&&parseFloat(C)>0,wt=U&&!isNaN(parseFloat(U))&&parseFloat(U)>=1,At=z&&!isNaN(parseFloat(z))&&parseFloat(z)>=1,Gt=ne&&!isNaN(parseInt(ne))&&parseInt(ne)>=1,fn=X&&!isNaN(parseFloat(X))&&parseFloat(X)>0,Rn=We&&wt&&At&&Gt&&fn,An=k,pr=or=>{const Wn=parseFloat(C)||0,Vn=parseFloat(U)||0,gr=parseFloat(z)||0,Ir=parseInt(ne)||0,Fr=parseFloat(X)||1/0,Lr=parseFloat(ce)||1.1;if(Wn<=0||Vn<=0)return null;let Ht=Vn,nn=0,Sr=Ht>Fr;Sr||(nn+=1);for(let Kr=1;Kr<=Ir;Kr++){const As=gr*Math.pow(Lr,Kr-1);Ht+=As,!Sr&&Ht>Fr&&(Sr=!0),Sr||(nn+=1)}return{budgetOk:Ht<=Fr,safeCount:nn}},mt=we?{long:pr(),short:pr()}:null,qt=we&&(mt==null?void 0:mt.long)&&(mt==null?void 0:mt.short)&&mt.long.budgetOk&&mt.short.budgetOk&&mt.long.safeCount>0&&mt.short.safeCount>0&&!An,Qt=we?Rn&&qt:Rn&&Le&&Le.budgetOk&&Le.safeCount>0&&!An;let In=null;if(!Rn)In="Please fill in all required fields";else if(An&&Qn!=null){const or=[];S&&or.push("Base Order"),_&&or.push("DCA Order");const Wn=or.length===1?` (${or[0]})`:or.length===2?" (Base Order & DCA Order)":"";In=`Minimum order size for ${String(v||"").toUpperCase()} is $${Qn.toFixed(2)}${Wn}. Increase order size or leverage.`}else!we&&Le&&!Le.budgetOk?In="Budget exceeded - increase budget or reduce orders":!we&&Le&&Le.safeCount===0?In="No safe orders - reduce leverage or increase budget":we&&(!(mt!=null&&mt.long)||!(mt!=null&&mt.short)||!mt.long.budgetOk||!mt.short.budgetOk)?In="Budget exceeded in Smart mode - adjust margin or orders":we&&(mt!=null&&mt.long)&&(mt!=null&&mt.short)&&(mt.long.safeCount===0||mt.short.safeCount===0)&&(In="No safe orders in Smart mode - reduce leverage or increase budget");return i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[(()=>{const or=(ir==null?void 0:ir.id)||(ir==null?void 0:ir.bot_id),Wn=or&&pt[or]===!0,Vn=or&&Bt[or]===!0,gr=!!ir,Ir=gr?Wn||Vn:!Qt||qe||!Ut||!Ut.id,Fr=()=>{gr&&or?sn(or,!0):Dt()};return i.jsx("button",{onClick:Fr,disabled:Ir,className:`w-full py-2.5 rounded-lg text-sm font-semibold transition-all flex items-center justify-center gap-2 ${gr?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":Qt&&Ut&&Ut.id&&!qe?"bg-[#67FFBD] text-[#101010] hover:bg-[#9FFFDA]":"bg-[#333] text-[#666] cursor-not-allowed"} disabled:opacity-60 disabled:cursor-not-allowed`,children:gr?Wn?i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Stopping..."]}):i.jsxs(i.Fragment,{children:[i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Stop DCA Bot"]}):qe?i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Starting..."]}):i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),"Start DCA Bot"]})})})(),In&&i.jsx("p",{className:"text-xs text-[#ff7073] text-center mt-2",children:In}),(!Ut||!Ut.id)&&i.jsx("p",{className:"text-xs text-[#ff7073] text-center mt-2",children:"Please select a Extended wallet first"}),i.jsx("p",{className:"text-xs text-[#555] text-center mt-2",children:"Bot will execute orders on Extended exchange"})]})})(),i.jsx("div",{className:"h-4"})]}),i.jsxs("div",{className:"lg:col-span-2 space-y-4 pb-6",children:[i.jsx("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4 mb-4",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#0b1511] border border-[#1e2e27] flex items-center justify-center",children:i.jsx(hNe,{className:"w-5 h-5 text-[#67FFBD]"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-base font-semibold text-[#d7ffe9]",children:"DCA Bot and Calculator"}),i.jsx("p",{className:"text-xs text-[#666] mt-1",children:"Plan your strategy and start DCAing"}),i.jsx("div",{className:"flex items-center mt-1 text-sm text-[#67FFBD]",children:i.jsxs("a",{href:"https://docs.dextrabot.com/dca-bot/extended-dca-bot",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-lg bg-[#101010]/70 hover:bg-[#111] transition-colors",children:[i.jsx("span",{className:"text-xs text-white",children:"New to DCA? Learn how it works"}),i.jsx("span",{children:"📚"})]})})]})]}),Le&&i.jsxs("div",{className:"flex flex-wrap gap-4 sm:gap-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Total Margin",i.jsx(Ih,{content:"Total margin required for Base Order + all DCA orders",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold text-white",children:["$",Ao(Le.totalMargin)]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Position Value",i.jsx(Ih,{content:"Combined notional value of all positions. Total Margin × Leverage",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold text-white",children:["$",Ao(Le.totalPositionValue)]}),i.jsxs("div",{className:"text-xs text-[#555]",children:[Le.leverage,"x leverage"]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Safe Orders",i.jsx(Ih,{content:"DCA orders that can be executed safely.",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold",style:{color:_b},children:[Le.safeCount,"/",parseInt(ne)||0]})]})]})]})}),!we&&i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsx("h3",{className:"text-sm font-semibold text-[#d7ffe9] mb-3",children:"Price Chart"}),i.jsx("div",{className:"h-[280px] sm:h-[320px]",children:i.jsx(sBe,{width:"100%",height:"100%",children:i.jsxs(arn,{data:Ye.length>0?Ye:[{name:"No Data",orderPrice:null,avgEntry:null,tpPrice:null,liqPrice:null}],margin:{top:10,right:20,left:10,bottom:5},children:[i.jsx(X$e,{strokeDasharray:"3 3",stroke:"#1c2a24"}),i.jsx(n8,{dataKey:"name",stroke:"#666",fontSize:10,interval:0,angle:Ye.length>6?-45:0,textAnchor:Ye.length>6?"end":"middle",height:Ye.length>6?50:30,tickFormatter:We=>We==="Base"?"B":We.startsWith("DCA")?`D${We.split(" ")[1]}`:We.includes("Liq")?"💀":We}),i.jsx(r8,{stroke:"#666",fontSize:10,tickFormatter:We=>`$${Ao(We)}`,domain:Fe,allowDataOverflow:!0}),i.jsx(Yp,{contentStyle:{backgroundColor:"#101010",border:"1px solid #333",borderRadius:"6px",fontSize:"11px"},formatter:(We,wt)=>[wb(We),wt],labelFormatter:We=>We==="B"?"Base Order":We.startsWith("D")?`DCA ${We.slice(1)}`:We}),i.jsx(s3,{content:Se}),i.jsx(T0,{type:"monotone",dataKey:"orderPrice",name:"Order Price",stroke:_b,strokeWidth:2,dot:{fill:_b,r:3},connectNulls:!0}),i.jsx(T0,{type:"monotone",dataKey:"avgEntry",name:"Avg Entry",stroke:hF,strokeWidth:2,dot:{fill:hF,r:2},connectNulls:!0}),i.jsx(T0,{type:"monotone",dataKey:"tpPrice",name:"TP",stroke:xNe,strokeWidth:1.5,strokeDasharray:"4 4",dot:!1,connectNulls:!0}),i.jsx(T0,{type:"monotone",dataKey:"liqPrice",name:"Liq",stroke:PO,strokeWidth:1.5,strokeDasharray:"4 4",dot:st,connectNulls:!0})]})})}),i.jsxs("div",{className:"text-xs text-[#555] text-center mt-2",children:["B = Base Order • D1-D",ne," = DCA Orders • 💀 = Liquidation Point"]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] overflow-hidden hidden md:block",children:[i.jsxs("div",{className:"flex border-b border-[#1c2a24]",children:[i.jsx("button",{onClick:()=>ct("details"),className:`flex-1 px-4 py-3 text-sm font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${ft==="details"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white hover:bg-[#111] border-transparent"}`,children:"Order Details"}),i.jsx("button",{onClick:()=>ct("bots"),className:`flex-1 px-4 py-3 text-sm font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${ft==="bots"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white hover:bg-[#111] border-transparent"}`,children:"DCA Bots"})]}),ft==="details"&&(we?i.jsx(Ge,{variant:"desktop"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"px-4 py-3",children:i.jsx(bNe,{entryPrice:C,onEntryPriceChange:fe,maxBudget:X,onBudgetChange:de})}),i.jsxs("div",{className:"overflow-x-auto",children:[i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-[#161616] text-[#888]",children:[i.jsx("th",{className:"px-3 py-2 text-left",children:"#"}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Dev %"}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Price"}),i.jsx("th",{className:"px-3 py-2 text-right hidden lg:table-cell",children:"Margin"}),i.jsx("th",{className:"px-3 py-2 text-right hidden xl:table-cell",children:"Pos. Value"}),i.jsxs("th",{className:"px-3 py-2 text-right",children:["Size (",v,")"]}),i.jsx("th",{className:"px-3 py-2 text-right hidden lg:table-cell",children:"Total Margin"}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Avg Entry"}),i.jsx("th",{className:"px-3 py-2 text-right hidden lg:table-cell",children:"TP"}),i.jsx("th",{className:"px-3 py-2 text-right",children:i.jsxs("span",{className:"flex items-center justify-end gap-1",children:["TP Profit",i.jsx(Ih,{content:"Profit if price reaches Take Profit level after this order executes.",children:i.jsx("span",{className:"text-[#666]",children:"?"})})]})}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Liq"}),i.jsx("th",{className:"px-3 py-2 text-center",children:"Status"})]})}),i.jsx("tbody",{children:_e.map((We,wt)=>{const At=gNe[We.status];if(We.status==="EXCEEDED"){const Gt=We.isLong?"Price would drop below $0 (impossible). Reduce deviation multiplier or fewer DCA orders.":"Price deviation exceeds 100%. Reduce deviation multiplier or fewer DCA orders.";return i.jsx("tr",{className:"border-t border-[#1c2a24] bg-[#1a1a1a]",children:i.jsx("td",{colSpan:12,className:"px-3 py-3",children:i.jsxs("div",{className:"flex items-center gap-2 text-[#6B7280]",children:[i.jsx("span",{children:At.icon}),i.jsxs("span",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:We.label})," ","— ",Gt]})]})})},wt)}return i.jsxs("tr",{className:"border-t border-[#1c2a24] hover:bg-[#111]",children:[i.jsx("td",{className:"px-3 py-2 font-medium whitespace-nowrap",children:We.label}),i.jsx("td",{className:"px-3 py-2 text-right",children:We.deviation!=null?vyn(We.deviation):"-"}),i.jsx("td",{className:"px-3 py-2 text-right",children:wb(We.price)}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",children:We.margin!=null?`$${Ao(We.margin)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right hidden xl:table-cell",children:We.positionValue!=null?`$${Ao(We.positionValue)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",children:We.coins!=null?Ao(We.coins,4):"-"}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",children:We.totalMargin!=null?`$${Ao(We.totalMargin)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:hF},children:wb(We.avgEntry)}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",style:{color:xNe},children:wb(We.tpPrice)}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:_b},children:We.tpProfit!=null?`$${Ao(We.tpProfit)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:We.liqPrice<=0?_b:PO},children:wb(We.liqPrice,!0)}),i.jsx("td",{className:"px-3 py-2 text-center",children:i.jsx(Ih,{content:At.tooltip,children:i.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium cursor-help",style:{backgroundColor:`${At.color}15`,color:At.color},children:At.icon})})})]},wt)})})]}),_e.length===0&&i.jsxs("div",{className:"p-8 text-center text-[#666] text-sm",children:[i.jsx("p",{children:"No orders to display"}),i.jsx("p",{className:"text-xs text-[#555] mt-1",children:"Enter entry price and base order margin to see order details"})]})]})]})),ft==="bots"&&i.jsx("div",{className:"p-4",children:an?i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsxs("svg",{className:"animate-spin h-8 w-8 text-[#67FFBD]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),i.jsx("p",{className:"text-sm text-[#666]",children:"Loading bots..."})]}):rr.length===0?i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsx("svg",{className:"w-8 h-8 text-[#67FFBD]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),i.jsx("h4",{className:"text-sm font-medium text-[#d7ffe9] mb-2",children:"No Active DCA Bots"}),i.jsx("p",{className:"text-xs text-[#666] mb-4",children:'Configure your DCA strategy and click "Start Bot" to create your first bot.'}),i.jsx("p",{className:"text-xs text-[#555]",children:"Your active bots will appear here."})]}):i.jsx("div",{className:"space-y-3 max-h-[845px] overflow-y-auto pr-1",children:rr.map(We=>{const wt=!We.is_deleted,At=We.bot_params||{},Gt=We.created_at?new Date(We.created_at):null,fn=Gt?(()=>{const In=Date.now()-Gt.getTime(),or=Math.floor(In/(1e3*60*60)),Wn=Math.floor(or/24);return Wn>0?`${Wn}d ago`:or>0?`${or}h ago`:`${Math.floor(In/(1e3*60))}m ago`})():null,Rn=At.direction==="long"?"Long":At.direction==="short"?"Short":"Smart",An=At.price_deviation??At.priceDeviation??0,pr=At.step_scale??At.price_dev_multiplier??At.priceDevMultiplier??0,mt=At.volume_scale??At.dca_size_multiplier??At.dcaSizeMultiplier??0,qt=At.tp_percent??At.tp_target??At.take_profit_percent??0,Qt=At.stop_loss_percent??At.stop_loss??0;return At.market_index??At.marketIndex,At.coin_idx??At.coinIndex,i.jsxs("div",{className:"bg-[#111] rounded-lg p-4 border border-[#1c2a24]",children:[i.jsxs("div",{className:"flex justify-between items-start mb-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-sm font-medium",children:[We.coin||v," DCA Bot"]}),wt?i.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-[#67FFBD]/20 text-[#67FFBD]",children:"Active"}):i.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-[#666]/20 text-[#666]",children:"Stopped"})]}),fn&&i.jsx("span",{className:"text-[11px] text-[#7c7c7c]",children:fn})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2 text-xs mb-3",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Direction:"}),i.jsx("span",{className:`ml-1 ${At.direction==="long"?"text-[#67FFBD]":At.direction==="short"?"text-[#ff7073]":"text-[#A78BFA]"}`,children:Rn})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Leverage:"}),i.jsxs("span",{className:"ml-1 text-white",children:[At.leverage||0,"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Base Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",Ao(At.base_amount_usd||At.base_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",Ao(At.safety_amount_usd||At.dca_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Max DCA Orders:"}),i.jsx("span",{className:"ml-1 text-white",children:At.max_safety_orders||At.max_dca_orders||0})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Ao(An),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Ao(pr),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Size Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Ao(mt),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Take Profit:"}),i.jsxs("span",{className:"ml-1 text-[#67FFBD]",children:[Ao(qt),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Stop Loss:"}),i.jsxs("span",{className:"ml-1 text-[#ff7073]",children:[Ao(Qt),"%"]})]}),fn&&i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Created:"}),i.jsx("span",{className:"ml-1 text-white",children:fn})]})]}),i.jsx("div",{className:"mt-4",children:i.jsx("button",{onClick:()=>sn(We.id||We.bot_id,wt),disabled:pt[We.id||We.bot_id]||Bt[We.id||We.bot_id],className:`w-full py-2 rounded-lg text-sm font-semibold transition-colors ${wt?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":"bg-[#67FFBD] text-black hover:bg-[#8bffd0]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:pt[We.id||We.bot_id]?wt?"Stopping...":"Starting...":wt?"Stop Bot":"Start Bot"})})]},We.id||We.bot_id)})})})]}),i.jsx("div",{className:"md:hidden space-y-2",children:i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] overflow-hidden",children:[i.jsxs("div",{className:"flex border-b border-[#1c2a24]",children:[i.jsx("button",{onClick:()=>ct("details"),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${ft==="details"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white border-transparent"}`,children:"Order Details"}),i.jsx("button",{onClick:()=>ct("bots"),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${ft==="bots"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white border-transparent"}`,children:"DCA Bots"})]}),ft==="details"&&(we?i.jsx(Ge,{variant:"mobile"}):i.jsxs("div",{className:"p-3 space-y-2",children:[i.jsx(bNe,{className:"w-full",entryPrice:C,onEntryPriceChange:fe,maxBudget:X,onBudgetChange:de}),_e.map((We,wt)=>{const At=gNe[We.status];if(We.status==="EXCEEDED"){const Gt=We.isLong?"Price would drop below $0":"Price deviation exceeds 100%";return i.jsx("div",{className:"bg-[#1a1a1a] rounded-lg p-3 border border-[#333]",children:i.jsxs("div",{className:"flex items-center gap-2 text-[#6B7280]",children:[i.jsx("span",{children:At.icon}),i.jsxs("span",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:We.label})," ","— ",Gt]})]})},wt)}return i.jsxs("div",{className:"bg-[#111] rounded-lg p-3 border border-[#1c2a24]",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsx("span",{className:"font-medium text-sm",children:We.label}),i.jsx(Ih,{content:At.tooltip,children:i.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium cursor-help",style:{backgroundColor:`${At.color}15`,color:At.color},children:At.icon})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Price:"}),i.jsx("span",{children:wb(We.price)})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Size:"}),i.jsx("span",{children:We.coins!=null?`${Ao(We.coins,4)} ${v}`:"-"})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Avg Entry:"}),i.jsx("span",{style:{color:hF},children:wb(We.avgEntry)})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Liq:"}),i.jsx("span",{style:{color:We.liqPrice<=0?_b:PO},children:wb(We.liqPrice,!0)})]}),i.jsxs("div",{className:"flex justify-between col-span-2 pt-1 border-t border-[#1c2a24] mt-1",children:[i.jsx("span",{className:"text-[#666]",children:"TP Profit:"}),i.jsx("span",{style:{color:_b},className:"font-medium",children:We.tpProfit!=null?`$${Ao(We.tpProfit)}`:"-"})]})]})]},wt)})]})),ft==="bots"&&i.jsx("div",{className:"p-3",children:an?i.jsxs("div",{className:"text-center py-6",children:[i.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsxs("svg",{className:"animate-spin h-6 w-6 text-[#67FFBD]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),i.jsx("p",{className:"text-[10px] text-[#666]",children:"Loading bots..."})]}):rr.length===0?i.jsxs("div",{className:"text-center py-6",children:[i.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsx("svg",{className:"w-6 h-6 text-[#67FFBD]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),i.jsx("h4",{className:"text-xs font-medium text-[#d7ffe9] mb-1",children:"No Active DCA Bots"}),i.jsx("p",{className:"text-[10px] text-[#666]",children:"Your bots will appear here."})]}):i.jsx("div",{className:"space-y-2 max-h-[360px] overflow-y-auto pr-1",children:rr.map(We=>{const wt=!We.is_deleted,At=We.bot_params||{},Gt=We.created_at?new Date(We.created_at):null,fn=Gt?(()=>{const Wn=Date.now()-Gt.getTime(),Vn=Math.floor(Wn/(1e3*60*60)),gr=Math.floor(Vn/24);return gr>0?`${gr}d ago`:Vn>0?`${Vn}h ago`:`${Math.floor(Wn/(1e3*60))}m ago`})():null,Rn=At.direction==="long"?"Long":At.direction==="short"?"Short":"Smart",An=At.price_deviation??At.priceDeviation??0,pr=At.step_scale??At.price_dev_multiplier??At.priceDevMultiplier??0,mt=At.volume_scale??At.dca_size_multiplier??At.dcaSizeMultiplier??0,qt=At.tp_percent??At.tp_target??At.take_profit_percent??0,Qt=At.stop_loss_percent??At.stop_loss??0,In=At.market_index??At.marketIndex,or=At.coin_idx??At.coinIndex;return i.jsxs("div",{className:"bg-[#111] rounded-lg p-3 border border-[#1c2a24]",children:[i.jsxs("div",{className:"flex justify-between items-start mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-xs font-medium",children:[We.coin||v," DCA"]}),wt?i.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded bg-[#67FFBD]/20 text-[#67FFBD]",children:"Active"}):i.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded bg-[#666]/20 text-[#666]",children:"Stopped"})]}),fn&&i.jsx("span",{className:"text-[10px] text-[#7c7c7c]",children:fn})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1 text-[10px]",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Direction:"}),i.jsx("span",{className:`ml-1 ${At.direction==="long"?"text-[#67FFBD]":At.direction==="short"?"text-[#ff7073]":"text-[#A78BFA]"}`,children:Rn})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Leverage:"}),i.jsxs("span",{className:"ml-1 text-white",children:[At.leverage||0,"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Base Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",Ao(At.base_amount_usd||At.base_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",Ao(At.safety_amount_usd||At.dca_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Max DCA Orders:"}),i.jsx("span",{className:"ml-1 text-white",children:At.max_safety_orders||At.max_dca_orders||0})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Ao(An),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Ao(pr),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Size Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Ao(mt),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"TP:"}),i.jsxs("span",{className:"ml-1 text-[#67FFBD]",children:[Ao(qt),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"SL:"}),i.jsxs("span",{className:"ml-1 text-[#ff7073]",children:[Ao(Qt),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Market:"}),i.jsx("span",{className:"ml-1 text-white",children:In??"-"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Coin Idx:"}),i.jsx("span",{className:"ml-1 text-white",children:or??"-"})]}),fn&&i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Created:"}),i.jsx("span",{className:"ml-1 text-white",children:fn})]})]}),i.jsx("div",{className:"mt-3",children:i.jsx("button",{onClick:()=>sn(We.id||We.bot_id,wt),disabled:pt[We.id||We.bot_id]||Bt[We.id||We.bot_id],className:`w-full py-1.5 rounded-lg text-[11px] font-semibold transition-colors ${wt?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":"bg-[#67FFBD] text-black hover:bg-[#8bffd0]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:pt[We.id||We.bot_id]?"...":wt?"Stop Bot":"Start Bot"})})]},We.id||We.bot_id)})})})]})})]})]})})}const jyn=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Qr);return m.useEffect(()=>{(async()=>{var g,v;const f=window.localStorage.getItem("hyperToken"),x=window.localStorage.getItem("hyperAddress");if(!(!f||!x))try{const w=await ji(x.toLowerCase(),f);w!=null&&w.success?(e(w==null?void 0:w.telegram_chat_id),t(w==null?void 0:w.subscriber_role),n(w==null?void 0:w.subs_expire_day),r((g=w==null?void 0:w.mushboomer_counts)==null?void 0:g.eth),a((v=w==null?void 0:w.mushboomer_counts)==null?void 0:v.sol),o(w==null?void 0:w.referral_code),l(w==null?void 0:w.refcode),s(w==null?void 0:w.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(w){console.error("Token verification error:",w)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"DCA Bot Calculator | Dollar Cost Averaging Strategy | Dextrabot"}),i.jsx("meta",{name:"description",content:"Calculate your DCA bot strategy for perpetual futures. Plan safety orders, visualize liquidation prices, and optimize your dollar cost averaging strategy."}),i.jsx("meta",{property:"og:title",content:"DCA Bot Calculator | Dollar Cost Averaging Strategy | Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Calculate your DCA bot strategy for perpetual futures. Plan safety orders, visualize liquidation prices, and optimize your dollar cost averaging strategy."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/dca-bot"})]})}),i.jsx("div",{style:{minHeight:"calc(100vh - 5rem)"},className:"flex justify-center items-start w-full h-full px-4 pt-6 pb-6 sm:px-6 sm:pt-6 sm:pb-6 bg-[#050505] overflow-auto",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start gap-[26px] w-full max-w-[1400px]",children:i.jsx(Ayn,{})})})]})},ij=({size:e})=>i.jsxs("div",{role:"status",className:"flex justify-center items-center min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:`${e} inline text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]
`,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),lD="/assets/subscribeAnimation-oYDBxlRF.mp4",Eyn=()=>{const{setSignModalOpen:e,setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setIsWhitelist:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Qr),{address:f}=Jr(),[x,g]=m.useState(1),[v,w]=m.useState(""),[C,N]=m.useState(""),[I,P]=m.useState(!1),[R,F]=m.useState(!1),[U,L]=m.useState(""),[z,Q]=m.useState(0),[ne,J]=m.useState(0),[X,re]=m.useState(!1),pe=Ae=>/^\d*$/.test(Ae),Y=Ae=>{["e","E","+","-"].includes(Ae.key)&&Ae.preventDefault()},ie=m.useMemo(()=>{if(x==="")return!1;const Ae=Number(x);return Number.isInteger(Ae)&&Ae>=1},[x]),V=(Ae=>{const[ye,je]=Ae.split(" "),[Ie,Re,Qe]=ye.split("-").map(Number),[$e,it]=je.split(":").map(Number);return new Date(Date.UTC(Qe,Re-1,Ie,$e-3,it))})("29-11-2025 23:59");m.useState(()=>new Date().getTime()>=V.getTime());const te=m.useRef(z);m.useEffect(()=>{te.current=z},[z]);const ae=m.useRef(0);m.useEffect(()=>{ae.current=ne},[ne]);const he=async()=>{var je,Ie;const Ae=window.localStorage.getItem("hyperToken"),ye=window.localStorage.getItem("hyperAddress");if(!(!Ae||!ye))try{const Re=await ji(ye.toLowerCase(),Ae);Re!=null&&Re.success?(t(Re==null?void 0:Re.telegram_chat_id),n(Re==null?void 0:Re.subscriber_role),r(Re==null?void 0:Re.subs_expire_day),s((je=Re==null?void 0:Re.mushboomer_counts)==null?void 0:je.eth),a((Ie=Re==null?void 0:Re.mushboomer_counts)==null?void 0:Ie.sol),o(Re==null?void 0:Re.referral_code),l(Re==null?void 0:Re.refcode),c(Re==null?void 0:Re.whitelist),u(Ae),d(ye),w(Re==null?void 0:Re.farming_tools),Q(Number((Re==null?void 0:Re.subs_expire_day)||0))):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""))}catch(Re){console.error("Token verification error:",Re),console.error(Re.message||"An unknown error occurred.")}};m.useEffect(()=>{X&&he()},[X]),m.useEffect(()=>{const Ae=localStorage.getItem("hyperToken"),ye=localStorage.getItem("hyperAddress");re(!!(Ae&&ye));const je=setInterval(()=>{const Ie=localStorage.getItem("hyperToken"),Re=localStorage.getItem("hyperAddress");re(!!(Ie&&Re))},800);return()=>clearInterval(je)},[]);const Ce=async()=>new Sl(window.ethereum).eth.getAccounts(ye=>ye),ce=async(Ae="subscribe",ye=24,je=5e3)=>{ye<=0||(await new Promise(Ie=>setTimeout(Ie,je)),await he(),Ae==="subscribe"&&te.current===ae.current?ce(Ae,ye-1,je):he())},ge=async Ae=>{const ye=window.localStorage.getItem("hyperToken"),je=window.localStorage.getItem("hyperAddress");if(!ye||!f){e(!0);return}N(""),J(te.current),ae.current=te.current,F(!0),P(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Qe){console.error("Failed to switch network",Qe),P(!1);return}const Ie=new Sl(window.ethereum);var Re=await Ce();if(Re.length>0?Re=Re[0]:Re=void 0,Re){const $e=Ae*.12,it=Ie.utils.toWei($e.toString(),"ether"),tt={from:Re,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:it};await Ie.eth.sendTransaction(tt).then(ot=>{console.log("txHash :>> ",ot),P(!1),L(ot.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():je,token:ye,payment_tx:ot.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),he(),ce("subscribe")}).catch(ot=>{console.log(ot),ot.code===-32003||ot.message.includes("insufficient funds")?N("Insufficient funds."):ot.message==="MetaMask Tx Signature: User denied transaction signature."&&F(!1)})}else await Ie.eth.requestAccounts()};return window.localStorage.getItem("hyperToken"),i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:R,setOpen:F,transactionHash:U,transactionLoading:I,paymentPresaleRole:!(z<=ne),errorFunds:C,activeMethod:2}),i.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-start md:justify-center md:items-start gap-8 w-full h-screen md:h-full mb-72 md:mb-0",children:[i.jsx("div",{className:"flex justify-center items-start md:items-center w-full h-max md:h-full pl-0 sm:pl-4 md:pl-2",children:i.jsx("div",{className:"flex flex-col gap-2 pt-0 md:pt-7 lg:pt-0",children:i.jsx("div",{className:"flex flex-col items-start justify-start gap-4 md:mb-10 lg:mb-16",children:i.jsxs("div",{className:"flex flex-col gap-3 text-gray-200 text-sm leading-relaxed mt-2 max-w-[600px]",children:[i.jsxs("ul",{className:"space-y-2.5",children:[i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-lg",children:"🌾"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-base font-semibold text-white",children:"Farm Bot"}),i.jsxs("ul",{className:"text-sm text-gray-400",children:[i.jsx("li",{children:"• Generate volume, earn rewards."}),i.jsx("li",{children:"• Delta neutral = zero directional risk."}),i.jsx("li",{children:"• Safe automated farming."})]})]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-lg",children:"🎯"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-base font-semibold text-white",children:"Grid Bot"}),i.jsxs("ul",{className:"text-sm text-gray-400",children:[i.jsx("li",{children:"• Auto-trade price ranges."}),i.jsx("li",{children:"• Profit from volatility."}),i.jsx("li",{children:"• Built-in risk management."})]})]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-lg",children:"🔄"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-base font-semibold text-white",children:"Copy Trade"}),i.jsxs("ul",{className:"text-sm text-gray-400",children:[i.jsx("li",{children:"• Hyperliquid → Lighter copy trading."}),i.jsx("li",{children:"• Follow top traders automatically."}),i.jsx("li",{children:"• Scale positions to your size."})]})]})]})]}),i.jsx("p",{className:"mt-4 text-gray-300 text-base",children:"👉 Get Dextrabot's complete suite."})]})})})}),i.jsxs("div",{className:"relative mx-1 h-full py-10 hidden md:block",children:[i.jsx("div",{className:"w-[2px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.8)_15%,rgba(255,50,150,0.8)_85%,rgba(255,50,150,0)_100%)]"}),i.jsx("div",{className:"absolute inset-0 w-[8px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.4)_15%,rgba(255,50,150,0.4)_85%,rgba(255,50,150,0)_100%)] blur-md mx-auto"})]}),i.jsx("div",{className:"flex justify-center items-start md:items-center w-full h-full",children:i.jsxs("div",{className:"flex flex-col items-center gap-4 border border-[#404040] bg-[#141414] rounded-xl px-3 py-7 shadow-[0_0_25px_rgba(255,120,50,0.25)] min-w-[362px]",children:[i.jsx("div",{className:"rounded-lg overflow-hidden",children:i.jsx("video",{src:lD,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[284px] lg:h-[284px] object-cover"},lD)}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>g(Ae=>{const ye=Number(Ae||0);return ye>1?String(ye-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:x,onChange:Ae=>{const ye=Ae.target.value.trim();if(ye==="")return g("");pe(ye)&&g(ye)},onKeyDown:Y,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] font-semibold outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>g(Ae=>{const ye=Number(Ae||0);return String(ye+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),x!==""&&!ie&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),ie&&i.jsxs("div",{className:"text-[12px] font-semibold text-green-400",children:[" ",x," months will be added to your subscription."]}),i.jsx("div",{className:"relative flex items-center justify-center gap-3 px-4 py-2 rounded-xl shadow-[0_0_25px_rgba(255,140,0,0.15)] backdrop-blur-md bg-white/5 border border-white/10",children:i.jsxs("span",{className:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-pink-500 bg-clip-text text-transparent",children:[(x*.12).toFixed(2)," ETH"]})}),i.jsx("div",{onClick:Ae=>{Ae.preventDefault(),ie&&ge(x)},className:`text-[10px] sm:text-xs xl:text-[13px] font-semibold text-gray-200 select-none border rounded-md px-4 py-2 ${ie?"border-[#8861FF] bg-[#7446FF] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy Now"})]})})]})]})},_yn=()=>{Jr();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Qr);return m.useEffect(()=>{(async()=>{var g,v;const f=window.localStorage.getItem("hyperToken"),x=window.localStorage.getItem("hyperAddress");if(!(!f||!x))try{const w=await ji(x.toLowerCase(),f);w!=null&&w.success?(e(w==null?void 0:w.telegram_chat_id),t(w==null?void 0:w.subscriber_role),n(w==null?void 0:w.subs_expire_day),r((g=w==null?void 0:w.mushboomer_counts)==null?void 0:g.eth),s((v=w==null?void 0:w.mushboomer_counts)==null?void 0:v.sol),a(w==null?void 0:w.referral_code),o(w==null?void 0:w.refcode),l(w==null?void 0:w.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(w){console.error("Token verification error:",w),console.error(w.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Dextrabot Subscription"}),i.jsx("meta",{name:"description",content:"Subscribe to Dextrabot and unlock automated trading bots including Farm Bot, Grid Bot, Market Maker and Copy Trade. Smart automation for Hyperliquid & Lighter."}),i.jsx("meta",{name:"og:title",content:"Dextrabot Subscription"}),i.jsx("meta",{name:"og:description",content:"Subscribe to Dextrabot and unlock automated trading bots including Farm Bot, Grid Bot, Market Maker and Copy Trade. Smart automation for Hyperliquid & Lighter."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/subscribe"})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-[calc(100vh-5rem)] min-h-max px-4 pt-4 pb-10 bg-[#161616] md:bg-gradient-to-b from-[#0d0d0d] via-[#1a1a1a] to-[#0d0d0d]",children:i.jsx(Eyn,{})})]})},yWe=({open:e,setOpen:t,makerStatus:n,isStatusWallet:r,info:s,modalLoading:a})=>i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Ba})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manropeleading-7",children:"Are you sure?"}),i.jsx("div",{className:"w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:s==="settings"||s==="table"&&(r!=null&&r.isDeleted)?"Do you want to start this Market Maker operation?":"Do you want to stop this Market Maker operation?"})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:o=>{a||(o.preventDefault(),s==="settings"?n():n(r))},className:`h-8 px-4 rounded-[10px] shadow border flex items-center justify-center cursor-pointer ${a?"bg-[#444] border-[#666] cursor-not-allowed":s==="settings"||s==="table"&&(r!=null&&r.isDeleted)?"bg-[#7445ff] border-[#8860ff]":"bg-[#ff4444] border-[#ff6666]"}`,children:a?i.jsx("span",{className:"text-white text-[13px] animate-pulse",children:"Loading..."}):i.jsx("span",{className:"text-white text-[13px]",children:s==="settings"||s==="table"&&(r!=null&&r.isDeleted)?"Start":"Stop"})})]})]})})})})})]}),kyn=({fetchInfoOnOpen:e,setIsFilterWallet:t})=>{const[n,r]=m.useState([]),[s,a]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState([]),[x,g]=m.useState([]),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState(!1);m.useState(!1);const[R,F]=m.useState(""),[U,L]=m.useState(!1),[z,Q]=m.useState(null),[ne,J]=m.useState(""),[X,re]=m.useState(!1);m.useState(!1);const[pe,Y]=m.useState([]),[ie,oe]=m.useState("");m.useState("");const[G,V]=m.useState(100),[te,ae]=m.useState("NEUTRAL"),[he,Ce]=m.useState("AGGRESSIVE"),[ce,ge]=m.useState("");m.useState(""),m.useState("");const[Ae,ye]=m.useState(!1),[je,Ie]=m.useState(!1),[Re,Qe]=m.useState(!1),{setSignModalOpen:$e,setTelegramChatId:it,setSubscriberRole:tt,setMushboomerETH:ot,setMushboomerSOL:ft,setIsReferralCode:ct,setIsReferralCodeName:Vt,setIsWhitelist:It,setHyperToken:an,setHyperAddress:Nt}=m.useContext(Qr),mn="https://dextrabothypev2.nftinit.io",dn="https://api.hyperliquid.xyz/info",Pt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{async function Dt(){var sn;if(open)try{const Kn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=hyper")).json();if(Kn!=null&&Kn.coins){const ir=(sn=Kn==null?void 0:Kn.coins)==null?void 0:sn.map(Jt=>{const Un=(Jt==null?void 0:Jt.value)||"",Qn=Pt[Un]||Un,Rt=Qn==="xyz:MSTR"?"":`https://app.hyperliquid.xyz/coins/${Qn}.svg`;return{...Jt,icon:Rt}}),rr=Kn.coins.filter(Jt=>Jt.value.includes(":")).map(Jt=>{const[Un,Qn]=Jt.value.split(":");return Qn});f(ir),g(rr)}}catch(Tn){console.error("Failed to fetch coin list:",Tn)}}Dt()},[]);const Xe=Dt=>{var sn;return((sn=d.find(Tn=>Tn.label===Dt))==null?void 0:sn.maxLeverage)??100},Ut=Dt=>({HL_FEE:15e-5,BUILDER_FEE:2e-4,GROW_RATE:(x==null?void 0:x.includes(Dt))?.1:1}),Lt=(Dt,sn)=>{if(!Dt||!sn)return"";const{HL_FEE:Tn,BUILDER_FEE:Kn,GROW_RATE:ir}=Ut(sn);return(Number(Dt)*(Tn+Kn*ir)).toFixed(0)},qe=(Dt,sn)=>{if(!Dt||!sn)return"";const{HL_FEE:Tn,BUILDER_FEE:Kn,GROW_RATE:ir}=Ut(sn);return(Number(Dt)/(Tn+Kn*ir)).toFixed(0)},Ke=Dt=>Dt===""||Dt===null?"":Number(Dt).toLocaleString("en-US"),pt=Dt=>Dt?Dt.replace(/,/g,""):"",en=Dt=>{if(Dt==null||Dt==="")return"0.00";const sn=Number(Dt);return Number.isNaN(sn)?"0.00":sn.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},Bt=Dt=>/^\d*$/.test(Dt),Et=Dt=>/^\d*\.?\d{0,6}$/.test(Dt),et=Dt=>{["e","E","+","-"].includes(Dt.key)&&Dt.preventDefault()};m.useEffect(()=>{if(!o)return;const Dt=Xe(o),sn=Number(ie);!Number.isNaN(sn)&&sn>Dt&&oe(String(Dt)),!Number.isNaN(sn)&&sn<1&&ie!==""&&oe("1")},[o]);const Be=m.useMemo(()=>{if(!z||!ie||!ce)return"";const Dt=he==="NORMAL"?.02:he==="PASSIVE"?.05:.1,sn=Number(z)*Number(ie),Tn=Number(ce)*Dt;return sn>Tn?"":"Insufficient margin to create order, please increase your margin."},[z,ie,ce,he]),Mt=m.useMemo(()=>{if(ie==="")return!1;const Dt=Number(ie),sn=Xe(o);return Number.isInteger(Dt)&&Dt>=1&&Dt<=sn},[ie,o,d]);m.useEffect(()=>{if(!o)return;const Dt=Xe(o),sn=Number(ie);!Number.isNaN(sn)&&sn>Dt&&oe(String(Dt)),!Number.isNaN(sn)&&sn<1&&ie!==""&&oe("1")},[o]);const Ve=m.useMemo(()=>{if(G==="")return!1;const Dt=Number(G);return Number.isNaN(Dt)?!1:Dt===0?!0:Dt>=0},[G]),ut=m.useMemo(()=>{if(ce==="")return!1;const Dt=Number(ce);return!Number.isNaN(Dt)&&Dt>0},[ce]),xt=m.useMemo(()=>n.map(Dt=>{const sn=(Dt==null?void 0:Dt.wallet_name)??(Dt==null?void 0:Dt.name)??(Dt==null?void 0:Dt.label)??String(Dt==null?void 0:Dt.wallet_id),Tn=(Dt==null?void 0:Dt.version)===3?`${sn} - (API-AGENT) Wallet`:sn;return{value:(Dt==null?void 0:Dt.wallet_id)??(Dt==null?void 0:Dt.id)??(Dt==null?void 0:Dt.value)??"",label:Tn,raw:Dt}}),[n]),jt=m.useMemo(()=>{var Dt;return(Dt=xt.find(sn=>String(sn.value)===String(s)))==null?void 0:Dt.raw},[xt,s]),kt=m.useMemo(()=>{const Dt=jt||{};return Dt.address||Dt.evm_address||Dt.wallet_address||Dt.public_address||Dt.eth_address||Dt.addr||null},[jt]),xn=s!==""&&o!==""&&X&&Mt&&ut&&!Be&&(te==="LONG"||te==="SHORT"||te==="NEUTRAL")&&(he==="AGGRESSIVE"||he==="NORMAL"||he==="PASSIVE");m.useEffect(()=>{const Dt=localStorage.getItem("hyperToken"),sn=localStorage.getItem("hyperAddress");re(!!(Dt&&sn));const Tn=setInterval(()=>{const Kn=localStorage.getItem("hyperToken"),ir=localStorage.getItem("hyperAddress");re(!!(Kn&&ir))},800);return()=>clearInterval(Tn)},[]),m.useEffect(()=>{F(""),X&&En()},[X]),m.useEffect(()=>{kt?un(kt):(Q(null),J(""),Y([]))},[kt]),m.useEffect(()=>{X&&(e(),rn())},[X]);async function un(Dt){var sn;try{J(""),L(!0),Q(null);const Kn=await(await fetch(dn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:Dt})})).json();Q((sn=Kn==null?void 0:Kn.marginSummary)==null?void 0:sn.accountValue)}catch(Tn){J(Tn.message||"Failed to load USDC balance.")}finally{L(!1)}}function On(){const Dt=kt||window.localStorage.getItem("hyperAddress");Dt&&un(Dt)}async function En(){try{w(!0);const Dt=window.localStorage.getItem("hyperToken"),sn=window.localStorage.getItem("hyperAddress");if(!Dt||!sn){re(!1),$e(!0);return}const Kn=await(await fetch(`${mn}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:sn.toLowerCase(),token:Dt})})).json();Kn!=null&&Kn.success?r((Kn==null?void 0:Kn.data)||[]):F((Kn==null?void 0:Kn.error_message)||"Failed to load wallets.")}catch(Dt){F(Dt.message||"Wallet list error.")}finally{w(!1)}}async function jn(){if(!X){$e(!0);return}if(xn)try{P(!0),F(""),Qe(!0);const Dt=window.localStorage.getItem("hyperToken"),sn=window.localStorage.getItem("hyperAddress");if(!Dt||!sn){re(!1),$e(!0);return}const Tn={coin:c,leverage:Number(ie),volume:Number(ce),orderBookDepth:1,perOrderPosValue:he==="PASSIVE"?2:he==="NORMAL"?5:10,direction:te,executionMode:he,budget:Number(G)},Kn={address:sn.toLowerCase(),token:Dt,wallet_id:Number(s),source_market:"hyper",bot_params:Tn,coin:o},rr=await(await fetch(`${mn}/api/hyper/mmbot/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Kn)})).json();rr!=null&&rr.success?(e(),ln.success("Successfully saved.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})):(F((rr==null?void 0:rr.error_message)||"Start failed."),ln.error((rr==null?void 0:rr.error_message)||"Save failed."))}catch(Dt){F(Dt.message||"An error occurred while saving.")}finally{P(!1),Ie(!1),Qe(!1)}}const bn=32,Zn={control:(Dt,sn)=>({...Dt,backgroundColor:"#242424",borderColor:sn.isFocused?"#67FFBD":"#353535",minHeight:bn,height:bn,boxShadow:"none",cursor:"pointer",alignItems:"center",minWidth:"max-content"}),valueContainer:Dt=>({...Dt,height:bn,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Dt=>({...Dt,height:bn}),input:Dt=>({...Dt,color:"#FFFFFF",margin:0,padding:0}),singleValue:Dt=>({...Dt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Dt=>({...Dt,color:"#7F7F7F",fontSize:"12px"}),menu:Dt=>({...Dt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Dt=>({...Dt,paddingTop:0,paddingBottom:0,maxHeight:180}),option:(Dt,sn)=>({...Dt,backgroundColor:sn.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:bn,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Dt=>({...Dt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Dt=>({...Dt,backgroundColor:"#353535"})},zn=({max:Dt})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Dt,"x"]}),$n=()=>i.jsx("div",{className:"px-2 py-0.5 rounded-md bg-[#0f1b1b] text-[#67ffbd] text-[10px] font-semibold",children:"xyz"}),nr=Dt=>{var Tn;const sn=x==null?void 0:x.includes(Dt.data.label);return i.jsx(Ca.Option,{...Dt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Tn=Dt.data)!=null&&Tn.icon?i.jsx("img",{src:Dt.data.icon,alt:Dt.data.label,className:"w-4 h-4",onError:Kn=>Kn.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F]"}),i.jsx("span",{className:"text-white text-[13px]",children:Dt.data.label}),sn&&i.jsx($n,{}),i.jsx(zn,{max:Dt.data.maxLeverage})]})})},wn=Dt=>{var Tn;const sn=x==null?void 0:x.includes(Dt.data.label);return i.jsx(Ca.SingleValue,{...Dt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Tn=Dt.data)!=null&&Tn.icon?i.jsx("img",{src:Dt.data.icon,alt:Dt.data.label,className:"w-4 h-4",onError:Kn=>Kn.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F]"}),i.jsx("span",{className:"text-white text-[13px]",children:Dt.data.label}),sn&&i.jsx($n,{}),i.jsx(zn,{max:Dt.data.maxLeverage})]})})},on=(Dt,sn)=>{if(l(Dt),u(sn),G===""&&ce===""){V(100),ge(qe(100,Dt));return}if(G===""&&ce!==""){V(Lt(ce,Dt));return}if(G!==""&&ce===""){ge(qe(G,Dt));return}V(Lt(ce,Dt))},Oe=d,rn=async()=>{var Tn,Kn;const Dt=window.localStorage.getItem("hyperToken"),sn=window.localStorage.getItem("hyperAddress");if(!(!Dt||!sn))try{N(!0);const ir=await ji(sn.toLowerCase(),Dt);ir!=null&&ir.success?(it(ir==null?void 0:ir.telegram_chat_id),tt(ir==null?void 0:ir.subscriber_role),ot((Tn=ir==null?void 0:ir.mushboomer_counts)==null?void 0:Tn.eth),ft((Kn=ir==null?void 0:ir.mushboomer_counts)==null?void 0:Kn.sol),ct(ir==null?void 0:ir.referral_code),Vt(ir==null?void 0:ir.refcode),It(ir==null?void 0:ir.whitelist),an(Dt),Nt(sn),N(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),an(""),Nt(""),N(!1))}catch(ir){console.error("Token verification error:",ir),console.error(ir.message||"An unknown error occurred."),N(!1)}},cn=Dt=>i.jsxs(Ca.MenuList,{...Dt,children:[i.jsxs("div",{onClick:()=>{Dt.selectProps.setIsGenWalletModal(!0)},className:"mx-2 mt-2 mb-1 px-3 py-2 bg-[#7445ff] hover:bg-[#5834C3] rounded-md text-white text-[13px] font-medium cursor-pointer flex items-center gap-2",children:[i.jsx("span",{className:"text-[18px] leading-none",children:"+"}),"Add Account"]}),i.jsx("div",{className:"h-px bg-[#353535] my-1 mx-2"}),Dt.children]}),_t=v||I,Yn=!1,yn=Xe(o);return i.jsxs(i.Fragment,{children:[Ae&&Na.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(d5,{open:Ae,setOpen:ye,handleListRequest:En,handlePageChange:()=>{}})}),document.body),i.jsx(yWe,{open:je,setOpen:Ie,makerStatus:jn,isStatusWallet:"",info:"settings",modalLoading:Re}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 w-full",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Wallet"}),i.jsxs("div",{className:"relative",children:[i.jsx(Cl,{styles:Zn,isDisabled:_t||v||Yn,isLoading:v,options:xt,components:{MenuList:cn},setIsGenWalletModal:ye,value:xt.find(Dt=>String(Dt.value)===String(s))||null,onChange:Dt=>{a((Dt==null?void 0:Dt.value)??""),t((Dt==null?void 0:Dt.value)??"")},placeholder:X?v?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{X||$e(!0)},menuIsOpen:X?void 0:!1}),!X&&i.jsx("button",{type:"button",onClick:()=>$e(!0),className:"absolute inset-0 rounded-md cursor-pointer bg-transparent","aria-label":"Connect to select",title:"Connect"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Coin"}),i.jsx(Cl,{styles:Zn,components:{Option:nr,SingleValue:wn},isDisabled:_t||Yn,options:Oe,value:Oe.find(Dt=>Dt.label===o)||null,onChange:Dt=>on((Dt==null?void 0:Dt.label)??"",(Dt==null?void 0:Dt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Leverage"}),i.jsx("input",{value:ie,onChange:Dt=>{const sn=Dt.target.value.trim();if(sn==="")return oe("");Bt(sn)&&oe(sn)},onKeyDown:et,inputMode:"numeric",autoComplete:"off",placeholder:o?`1–${yn}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ie===""?"border-[#353535]":Mt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:_t||Yn})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Budget"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"$"}),i.jsx("input",{value:Ke(G),onChange:Dt=>{let sn=pt(Dt.target.value);if(sn===""){V(""),ge("");return}if(Et(sn)){V(sn);const Tn=qe(sn,o);ge(Tn)}},onKeyDown:et,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${G===""?"border-[#353535]":Ve?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:_t||Yn})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Volume"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"$"}),i.jsx("input",{value:Ke(ce),onChange:Dt=>{let sn=pt(Dt.target.value);if(sn===""){ge(""),V("");return}if(Et(sn)){ge(sn);const Tn=Lt(sn,o);V(Tn)}},onKeyDown:et,inputMode:"decimal",autoComplete:"off",placeholder:"VOLUME",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ce===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:_t||Yn})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Directional Bias"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6 xl:pt-1",children:[i.jsx("div",{"aria-pressed":te==="SHORT",onClick:()=>ae("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",_t||Yn?"cursor-not-allowed":"cursor-pointer",te==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsx("span",{className:"min-w-max",children:"SHORT"})}),i.jsx("div",{"aria-pressed":te==="NEUTRAL",onClick:()=>ae("NEUTRAL"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",_t||Yn?"cursor-not-allowed":"cursor-pointer",te==="NEUTRAL"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsx("span",{className:"min-w-max",children:"NEUTRAL"})}),i.jsx("div",{"aria-pressed":te==="LONG",onClick:()=>ae("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",_t||Yn?"cursor-not-allowed":"cursor-pointer",te==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsx("span",{className:"min-w-max",children:"LONG"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Execution Mode"}),i.jsxs("div",{className:"flex items-center gap-3 xl:pt-1",children:[i.jsx("button",{"aria-pressed":he==="AGGRESSIVE",onClick:()=>Ce("AGGRESSIVE"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",_t||Yn?"cursor-not-allowed":"cursor-pointer",he==="AGGRESSIVE"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["AGGRESSIVE ",he==="AGGRESSIVE"?" ✓":""]})}),i.jsx("button",{"aria-pressed":he==="NORMAL",onClick:()=>Ce("NORMAL"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",_t||Yn?"cursor-not-allowed":"cursor-pointer",he==="NORMAL"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["NORMAL ",he==="NORMAL"?" ✓":""]})}),i.jsx("button",{"aria-pressed":he==="PASSIVE",onClick:()=>Ce("PASSIVE"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",_t||Yn?"cursor-not-allowed":"cursor-pointer",he==="PASSIVE"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["PASSIVE ",he==="PASSIVE"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:"flex items-start gap-3 mt-3 pt-3 border-t border-[#353535] bg[rgba(27,27,27,0.32)] rounded-b-3xl w-full",children:[i.jsxs("div",{className:"flex basis-1/2 flex-col gap-1",children:[X&&i.jsxs("div",{className:"text-[12px] text-[#9B9B9B] flex items-center gap-2",children:["Available Perp Balance (USDC):",i.jsx("span",{className:"text-white",children:U?"Loading...":ne?"—":en(z??"0")}),i.jsx("div",{onClick:On,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(AS,{className:`w-4 h-4 ${U?"animate-spin":""}`})})]}),Be&&i.jsxs("div",{className:"flex justify-start items-center gap-2 text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-1.5 max-w-[470px]",children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-3.5 min-w-3.5 min-h-3.5 h-3.5"}),i.jsxs("div",{className:"text-[#FF797C] text-[11px] leading-[14px]",children:[Be+" ",i.jsxs("span",{onClick:()=>window.open("https://docs.dextrabot.com/market-maker-bot/hyperliquid-market-maker-bot#margin-requirements","_blank"),className:"underline cursor-pointer text-[#FF797C] hover:text-white inline-flex items-center gap-1",children:["How it works",i.jsx("img",{src:xm,alt:"Dextrabot",className:"w-2.5 h-2.5"})]})]})]})]}),i.jsx("div",{className:"flex flex-col items-end sm:flex-row sm:justify-end gap-2 sm:gap-4 w-full basis-1/2",children:i.jsx("div",{className:"flex justify-end items-center",children:i.jsx("button",{onClick:()=>{Ie(!0)},disabled:!xn||_t,className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!xn||_t?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer"}`,children:I?"Loading...":"Start"})})})]})]})},Tyn=({isOpen:e,onClose:t,children:n,fullscreen:r=!1,blurBackground:s=!1})=>{const[a,o]=m.useState(e),[l,c]=m.useState(!1);m.useEffect(()=>{if(e)o(!0),requestAnimationFrame(()=>c(!0));else{c(!1);const d=setTimeout(()=>o(!1),300);return()=>clearTimeout(d)}},[e]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&u()};return a&&(document.body.style.overflow="hidden",document.addEventListener("keydown",d)),()=>{document.body.style.overflow="",document.removeEventListener("keydown",d)}},[a]);const u=()=>{c(!1),setTimeout(()=>{t()},300)};return a?Na.createPortal(i.jsxs("div",{className:`fixed inset-0 z-[100] transition-opacity duration-300 ${l?"opacity-100":"opacity-0"} flex items-center justify-center`,children:[i.jsx("div",{className:`absolute inset-0 ${s?"backdrop-blur-md bg-black/50":"bg-black/50"}`,onClick:u}),i.jsxs("div",{className:`relative bg-[#101010] shadow-lg transform transition-transform duration-300 ${l?"translate-y-0":"translate-y-full"} ${r?"w-screen h-[100dvh] rounded-none p-0":"w-auto max-w-[95vw] max-h-[95vh] rounded-t-[24px] p-2"}`,onClick:d=>d.stopPropagation(),children:[n,i.jsx("div",{className:`absolute ${r?"top-4 right-4 text-white":"top-2 right-4 text-gray-400 hover:text-white"} text-2xl cursor-pointer z-50`,onClick:u,children:"×"})]})]}),document.body):null},Iyn=({data:e,shareModalOpen:t,setShareModalOpen:n})=>{var C,N,I,P,R;const{isReferralCodeName:r}=m.useContext(Qr),[s,a]=m.useState(Va),[o,l]=m.useState(!0),c=m.useRef(null),u=async()=>{if(c.current)try{await document.fonts.ready,await new Promise(L=>setTimeout(L,500));const F=await I1(c.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),U=document.createElement("a");U.href=F,U.download="dextrabot-market-maker.png",document.body.appendChild(U),U.click(),document.body.removeChild(U),ln.success("PNG successfully downloaded!")}catch(F){console.error("Error generating PNG:",F),ln.error("Failed to download PNG.")}},d=async F=>{l(!0);try{const L=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(F)}`)).blob();return new Promise((z,Q)=>{const ne=new FileReader;ne.onloadend=()=>z(ne.result),ne.onerror=Q,ne.readAsDataURL(L)})}catch(U){throw console.error("Image conversion failed:",U),U}finally{l(!1)}};m.useEffect(()=>{e!=null&&e.coin&&d(`https://app.hyperliquid.xyz/coins/${e==null?void 0:e.coin}.svg`).then(F=>a(F)).catch(()=>a(Va))},[e]);const f=r||window.localStorage.getItem("refcode")||"",x=f?`https://app.dextrabot.com/referral/${f}`:"",g=e?`I’m market making #${e==null?void 0:e.coin} with Dextrabot on Hyperliquid HIP-3
Low risk. High XP.
Watch me farm the airdrop while everyone sleep.
Volume: $${((N=(C=e==null?void 0:e.bot_params)==null?void 0:C.volume)==null?void 0:N.toLocaleString("en-US"))||0}`:`I’m market making with Dextrabot on Hyperliquid HIP-3
Low risk. High XP.
Watch me farm the airdrop while everyone sleep.`,v=x||"https://app.dextrabot.com/market-maker",w=`https://x.com/intent/post?text=${encodeURIComponent(g)}&url=${encodeURIComponent(v)}`;return i.jsx(i.Fragment,{children:i.jsx(Tyn,{isOpen:t,onClose:()=>n(!1),blurBackground:!0,children:i.jsxs("div",{className:"w-[340px] sm:w-[460px] bg-[#101010] rounded-3xl p-6 text-white",children:[i.jsxs("div",{ref:c,className:"bg-gradient-to-b from-[#0c1414] via-[#040707] to-[#040505] rounded-[32px] border border-emerald-500/10 p-5 shadow-[0_0_60px_rgba(0,255,200,0.08)]",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsx("p",{className:"text-sm uppercase tracking-[0.3em] text-white/70",children:"Market Maker"}),i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-white/5 border border-white/10",children:[i.jsx("img",{src:EA,alt:"Dextrabot",className:"w-5 h-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold tracking-wide",children:"DEXTRABOT"})]})]}),i.jsxs("div",{className:"mt-5 bg-[#05090a] rounded-3xl p-5 text-center border border-white/5",children:[i.jsx("p",{className:"text-xs uppercase tracking-[0.4em] text-white/50",children:"VOLUME"}),i.jsxs("p",{className:"text-4xl font-bold text-[#67FFBD] mt-2",children:["$",(I=e==null?void 0:e.bot_params)!=null&&I.volume?Is((P=e==null?void 0:e.bot_params)==null?void 0:P.volume):"--"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-6 text-left",children:[i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"Coin"}),i.jsxs("p",{className:"text-lg font-semibold text-white mt-1 flex items-center gap-2",children:[o?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:s||Va,alt:"",className:"rounded-full w-8 h-8",onError:F=>ra(F)}),(e==null?void 0:e.coin)||"--"]})]}),i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"Directional Bias"}),i.jsx("p",{className:"text-lg font-semibold text-white mt-1",children:((R=e==null?void 0:e.bot_params)==null?void 0:R.direction)||"--"})]})]})]}),i.jsxs("div",{className:"mt-4 flex items-center justify-between text-[11px] text-white/50",children:[i.jsx("span",{children:"Generated by Dextrabot"}),i.jsx("span",{children:new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]}),!e&&i.jsx("p",{className:"text-xs text-white/60 mt-4",children:"An unknown error has occurred."}),i.jsxs("div",{className:"mt-6 space-y-3",children:[i.jsx("button",{onClick:F=>{F.preventDefault(),o||u()},disabled:!e,className:`${o?"cursor-not-allowed":"cursor-pointer"} w-full border border-emerald-400/60 rounded-2xl py-3
text-emerald-300 font-semibold hover:bg-emerald-400/10
transition disabled:opacity-40 disabled:cursor-not-allowed`,children:"Download image"}),i.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:`w-full block text-center bg-white text-black
font-semibold rounded-2xl py-3 hover:bg-gray-100 transition`,children:"Share on X"})]})]})})})},Pyn=({data:e,setData:t,loading:n,error:r,fetchInfoOnOpen:s,isFilterWallet:a})=>{var Lt,qe;m.useContext(Qr);const{isConnected:o,address:l}=Jr(),[c,u]=m.useState([]),[d,f]=m.useState(null),[x,g]=m.useState(!1);m.useState(!1);const[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState({}),[R,F]=m.useState(!1),[U,L]=m.useState({id:"",walletAddress:"",isDeleted:!1}),[z,Q]=m.useState(!1),[ne,J]=m.useState(""),[X,re]=m.useState([]),[pe,Y]=m.useState([]),[ie,oe]=m.useState([]),[G,V]=m.useState(!1),[te,ae]=m.useState(!1),[he,Ce]=m.useState(!1),[ce,ge]=m.useState(!1),Ae=m.useRef(null),ye=m.useRef(null),je=m.useRef(null),Ie=m.useRef(null),[Re,Qe]=m.useState(!1),$e="tag",[it,tt]=m.useState($e),ot=Ke=>{if(!v){let pt=e;a&&(pt=pt==null?void 0:pt.filter(Bt=>String(Bt==null?void 0:Bt.wallet_id)===String(a)));const en=pt==null?void 0:pt.filter(Bt=>{var Et,et,Be,Mt,Ve,ut,xt,jt;if(X.length>0){const kt=X.includes("HyperLiquid")&&(Bt==null?void 0:Bt.source_market)==="hyper",xn=X.includes("Lighter")&&(Bt==null?void 0:Bt.source_market)==="lighter";if(!kt&&!xn)return!1}if(pe.length>0){const kt=pe.includes("Short")&&((Et=Bt==null?void 0:Bt.bot_params)==null?void 0:Et.direction)==="SHORT",xn=pe.includes("Neutral")&&((et=Bt==null?void 0:Bt.bot_params)==null?void 0:et.direction)==="NEUTRAL",un=pe.includes("Long")&&((Be=Bt==null?void 0:Bt.bot_params)==null?void 0:Be.direction)==="LONG";if(!kt&&!xn&&!un)return!1}if(ie.length>0){const kt=ie.includes("Aggressive")&&((Mt=Bt==null?void 0:Bt.bot_params)==null?void 0:Mt.executionMode)==="AGGRESSIVE",xn=ie.includes("Normal")&&((Ve=Bt==null?void 0:Bt.bot_params)==null?void 0:Ve.executionMode)==="NORMAL",un=ie.includes("Passive")&&((ut=Bt==null?void 0:Bt.bot_params)==null?void 0:ut.executionMode)==="PASSIVE";if(!kt&&!xn&&!un)return!1}return!(Re&&(Bt!=null&&Bt.is_deleted)||ne&&!((jt=(xt=Bt==null?void 0:Bt.bot_params)==null?void 0:xt.coin)!=null&&jt.toLowerCase().includes(ne.toLowerCase())))});return en==null?void 0:en.sort((Bt,Et)=>{var Zn,zn,$n,nr,wn,on,Oe,rn,cn,_t,Yn,yn,Dt,sn;const et=((zn=(Zn=Bt==null?void 0:Bt.bot_params)==null?void 0:Zn.coin)==null?void 0:zn.toUpperCase())||"",Be=((nr=($n=Et==null?void 0:Et.bot_params)==null?void 0:$n.coin)==null?void 0:nr.toUpperCase())||"",Mt=(Bt==null?void 0:Bt.wallet_id)||0,Ve=(Et==null?void 0:Et.wallet_id)||0,ut=Number(((wn=Bt==null?void 0:Bt.bot_params)==null?void 0:wn.volume)||0),xt=Number(((on=Et==null?void 0:Et.bot_params)==null?void 0:on.volume)||0),jt=Number(((Oe=Bt==null?void 0:Bt.bot_params)==null?void 0:Oe.volume)||0),kt=Number(((rn=Et==null?void 0:Et.bot_params)==null?void 0:rn.volume)||0),xn=Number(((cn=Bt==null?void 0:Bt.bot_params)==null?void 0:cn.volume)||0),un=Number(((_t=Et==null?void 0:Et.bot_params)==null?void 0:_t.volume)||0),On=Number(((Yn=Bt==null?void 0:Bt.bot_params)==null?void 0:Yn.leverage)||0),En=Number(((yn=Et==null?void 0:Et.bot_params)==null?void 0:yn.leverage)||0),jn=Number(((Dt=Bt==null?void 0:Bt.bot_params)==null?void 0:Dt.budget)||0),bn=Number(((sn=Et==null?void 0:Et.bot_params)==null?void 0:sn.budget)||0);return Ke==="coin"?et<Be?-1:et>Be?1:0:Ke==="-coin"?et>Be?-1:et<Be?1:0:Ke==="account"?Mt>Ve?-1:Mt<Ve?1:0:Ke==="-account"?Mt<Ve?-1:Mt>Ve?1:0:Ke==="volume"?ut-xt:Ke==="-volume"?xt-ut:Ke==="order"?jt-kt:Ke==="-order"?kt-jt:Ke==="perOrder"?xn-un:Ke==="-perOrder"?un-xn:Ke==="leverage"?On-En:Ke==="-leverage"?En-On:Ke==="budget"?jn-bn:Ke==="-budget"?bn-jn:0})}return e},ft=m.useRef(null),ct=["Short","Neutral","Long"],Vt=["Aggressive","Normal","Passive"],It=Ke=>{Y(pt=>pt.includes(Ke)?pt.filter(en=>en!==Ke):[...pt,Ke])},an=Ke=>{oe(pt=>pt.includes(Ke)?pt.filter(en=>en!==Ke):[...pt,Ke])};m.useEffect(()=>{function Ke(pt){Ae.current&&!Ae.current.contains(pt.target)&&ae(!1),ye.current&&!ye.current.contains(pt.target)&&Ce(!1),Ie.current&&!Ie.current.contains(pt.target)&&ge(!1),je.current&&!je.current.contains(pt.target)&&V(!1)}return document.addEventListener("mousedown",Ke),()=>document.removeEventListener("mousedown",Ke)},[]);const Nt=async({id:Ke,walletAddress:pt,isDeleted:en})=>{try{const Bt=window.localStorage.getItem("hyperToken"),Et=window.localStorage.getItem("hyperAddress");if(!Bt||!Et||!Ke){ln.error("Something went wrong!");return}Q(!0),pt&&P(ut=>({...ut,[pt]:!0}));const et="https://dextrabothypev2.nftinit.io/api/hyper/mmbot/update/",Be={is_deleted:!en},Ve=await(await fetch(et,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():Et,token:Bt,bot_id:Number(Ke),update_params:Be})})).json();Ve.success?(t((Ve==null?void 0:Ve.data)||[]),ln.success("Action completed successfully.")):ln.error(Ve.error_message),F(!1)}catch{ln.error("Something went wrong")}finally{Q(!1),P(Bt=>({...Bt,[pt]:!1}))}},mn=async()=>{try{const Ke=window.localStorage.getItem("hyperToken"),pt=window.localStorage.getItem("hyperAddress");if(!Ke||!pt)return;const Et=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/mmbot/feed/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():pt,token:Ke})})).json();Et.success&&u((Et==null?void 0:Et.data)||[])}catch(Ke){ln.error(Ke.message||"Something went wrong")}finally{}};m.useEffect(()=>{mn();const Ke=setInterval(()=>{mn()},15e3);return()=>clearInterval(Ke)},[e]);const dn=m.useMemo(()=>{const Ke={};return c==null||c.forEach(pt=>{pt!=null&&pt.id&&(Ke[pt.id]=pt.bot_params)}),Ke},[c]);m.useEffect(()=>{const Ke=localStorage.getItem("hyperToken"),pt=localStorage.getItem("hyperAddress");N(!!(Ke&&pt));const en=setInterval(()=>{const Bt=localStorage.getItem("hyperToken"),Et=localStorage.getItem("hyperAddress");N(!!(Bt&&Et))},800);return()=>clearInterval(en)},[]);const Pt={started:{label:"Started",color:"text-[#67FFBD]"},stopped:{label:"Stopped",color:"text-[#FF7173]"},completed:{label:"Completed",color:"text-[#F5D97A]"},forced_stopped:{label:"Stopped",color:"text-[#FF9E57]"}},Xe=()=>i.jsx(AS,{className:"w-4 h-4 text-yellow-400"}),Ut={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs(i.Fragment,{children:[i.jsx(yWe,{open:R,setOpen:F,makerStatus:Nt,isStatusWallet:U,info:"table",modalLoading:z}),i.jsx(Iyn,{data:d,shareModalOpen:x,setShareModalOpen:g}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white w-full font-manrope",children:[i.jsx("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full pl-2 sm:pl-0 pt-2",children:i.jsxs("div",{className:"flex items-center justify-between gap-4 w-full px-2 sm:px-3",children:[i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"History"}),i.jsxs("label",{onClick:()=>Qe(!Re),className:"flex items-center gap-2 p-[3px] px-1 h-6 relative rounded cursor-pointer text-white text-[13px] font-semibold font-manrope",children:[i.jsx("div",{className:`w-[18px] h-[18px] flex items-center justify-center border ${Re?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} rounded`,children:Re&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.5px] h-[5.6px] ml-[1px]"})}),"Active Only"]})]})}),i.jsx("div",{className:"relative w-full h-full",children:i.jsx("div",{className:"w-full h-full max-h-[540px] overflow-x-scroll relative overflow-y-scroll flex-grow",ref:ft,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#090909] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#090909] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[120px] z-[8] relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:[i.jsx(di,{title:"Coin",sortKey:"coin",sortOption:it,setSortOption:tt,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>V(!G),className:`${ne?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${ne?"text-blue-500":"text-white"}`})}),G&&i.jsxs("div",{ref:je,className:"absolute left-[58px] mt-32 w-[208px] bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10",children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>J(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:ne,onChange:Ke=>J(Ke.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2 placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#090909] left-[120px] h-8 px-1 min-w-[130px] z-[8] relative",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Account"})})}),i.jsx("th",{scope:"col",className:"font-medium bg-[#090909] h-8 px-1 min-w-[100px] z-[7]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:i.jsx(di,{title:"Leverage",sortKey:"leverage",sortOption:it,setSortOption:tt,isFilterIcon:!1})})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[110px] z-[7]",children:i.jsx(di,{title:"Volume",sortKey:"volume",sortOption:it,setSortOption:tt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[120px] z-[8]",children:i.jsx(di,{title:"Budget",sortKey:"budget",sortOption:it,setSortOption:tt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[120px] z-[7] relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:[i.jsx("div",{className:"flex items-center justify-start",children:"Direction"}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>Ce(!he),className:`${pe.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${pe.length>0?"text-blue-500":"text-white"}`})}),he&&i.jsxs("div",{ref:ye,className:`absolute left-[58px] mt-44 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>Y(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),ct==null?void 0:ct.map(Ke=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px] mt-2",children:[i.jsx("input",{type:"checkbox",checked:pe.includes(Ke),onChange:()=>It(Ke),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${pe.includes(Ke)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:pe.includes(Ke)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Ke]},Ke))]})]})]})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[150px] z-[6] relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:[i.jsx("div",{className:"flex items-center justify-start",children:"Execution Mode"}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>ge(!ce),className:`${ie.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx($f,{className:`w-4 h-4 ${ie.length>0?"text-blue-500":"text-white"}`})}),ce&&i.jsxs("div",{ref:Ie,className:`absolute left-[58px] mt-44 w-[208px]
bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>oe(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),Vt==null?void 0:Vt.map(Ke=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px] mt-2",children:[i.jsx("input",{type:"checkbox",checked:ie.includes(Ke),onChange:()=>an(Ke),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${ie.includes(Ke)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:ie.includes(Ke)&&i.jsx("img",{src:Yc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Ke]},Ke))]})]})]})}),i.jsx("th",{scope:"col",className:"min-w-[90px] px-1",children:i.jsx("div",{className:"flex items-center justify-start gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-start group",children:"Process"})})}),i.jsx("th",{scope:"col",className:"min-w-[90px] px-1",children:i.jsx("div",{className:"flex items-center justify-start gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-start group",children:"Status"})})}),i.jsx("th",{scope:"col",className:"min-w-[60px] px-1",children:i.jsx("div",{className:"flex items-center justify-center gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-end group",children:"Actions"})})}),i.jsx("th",{scope:"col",className:"min-w-[60px] pl-1 pr-4",children:i.jsx("div",{className:"flex items-center justify-center gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-end group"})})})]})}),i.jsx("tbody",{children:C?!e||n?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Da,{})})})}):r&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center ml-[33%] w-max",children:i.jsx(zl,{})})})}):((Lt=ot(it))==null?void 0:Lt.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:`${(e==null?void 0:e.length)==0?"ml-[33%]":"ml-[40%]"} flex min-h-[44vh] h-66 flex-col justify-center items-center w-max`,children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16 md:-ml-0",children:[i.jsx("img",{src:ac,alt:""}),(e==null?void 0:e.length)==0?i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You do not have any recorded transactions yet."})}):i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No results match your filters."})})]})})})})}):(qe=ot(it))==null?void 0:qe.map((Ke,pt)=>{var jt,kt,xn,un,On,En,jn,bn,Zn,zn,$n,nr,wn,on;const en=!!(Ke!=null&&Ke.is_deleted),Bt=en?"bg-[#3c1518]/70 border-[#ff6b6b]/60 text-[#ffd4d1] hover:bg-[#571f24]/80":"bg-[#123424]/70 border-[#2bd27c]/50 text-[#9cf7cb] hover:bg-[#185134]/80",Et=dn[Ke==null?void 0:Ke.id]||{},et=(Et==null?void 0:Et.status)||(Ke!=null&&Ke.is_deleted?"completed":"started"),Be=Pt[et],Mt=et==="completed",Ve=Mt?"↻":en?"▶":"⏹",ut=Et!=null&&Et.volume_usd?Et.current_volume/Et.volume_usd*100:0,xt=Math.min(100,Math.max(0,ut));return i.jsxs("tr",{className:`relative group hover:bg-[#151515] h-[56px] border-b border-white/5 text-white transition-opacity ${en?"opacity-60":"opacity-100"}`,children:[i.jsx("td",{scope:"row",className:`${pt%2==0,"bg-[#151515]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2.5 pl-2 h-14 max-h-14",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${Ke==null?void 0:Ke.coin}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-1.5 sm:pl-1.5 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Ut[(jt=Ke==null?void 0:Ke.bot_params)==null?void 0:jt.coin]||((xn=(kt=Ke==null?void 0:Ke.bot_params)==null?void 0:kt.coin)==null?void 0:xn.split("/")[0])}.svg`||Va,alt:(un=Ke==null?void 0:Ke.bot_params)==null?void 0:un.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Oe=>ra(Oe)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:(()=>{var Yn;const Oe=((Yn=Ke==null?void 0:Ke.bot_params)==null?void 0:Yn.coin)||"",rn=Oe.includes(":"),cn=rn?Oe.split(":")[1]:Oe,_t=rn?Oe.split(":")[0]:null;return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:cn}),_t&&i.jsx("span",{className:"text-[8px] bg-[#233] text-[#67FFBD] px-1 py-[0.5px] rounded-md w-fit mt-[1px]",children:_t})]})})()})})]})})})}),i.jsx("td",{scope:"row",className:`${pt%2==0,"bg-[#151515]"} sm:sticky left-[120px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-0.5 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-sm font-semibold font-manrope leading-[13px] tracking-[0.28px]",children:(Ke==null?void 0:Ke.source_market)==="lighter"?i.jsx(pi,{content:"Lighter",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx(Xf,{className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ke==null?void 0:Ke.wm_name})]})}):(Ke==null?void 0:Ke.source_market)==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(pi,{content:"Hyperliquid",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:dx,alt:"",className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ke==null?void 0:Ke.wm_name})]})})}):i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(pi,{content:"Dextrabot",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:qi,alt:"",className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ke==null?void 0:Ke.wm_name})]})})})})})}),i.jsx("td",{scope:"row",className:`${pt%2==0,"bg-[#151515]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-5 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:(On=Ke==null?void 0:Ke.bot_params)!=null&&On.leverage?`${(En=Ke==null?void 0:Ke.bot_params)==null?void 0:En.leverage}x`:"--",info1_Color:"text-white",rowTwo:!1})})})}),i.jsx("td",{scope:"row",className:`${pt%2==0,"bg-[#161616]"} z-[1] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:i.jsx(aa,{info1:(jn=Ke==null?void 0:Ke.bot_params)!=null&&jn.volume?`$${(Zn=(bn=Ke==null?void 0:Ke.bot_params)==null?void 0:bn.volume)==null?void 0:Zn.toLocaleString("en-US")}`:"--",info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${pt%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:(zn=Ke==null?void 0:Ke.bot_params)!=null&&zn.budget?`$${(nr=($n=Ke==null?void 0:Ke.bot_params)==null?void 0:$n.budget)==null?void 0:nr.toLocaleString("en-US")}`:"--",info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${pt%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:(wn=Ke==null?void 0:Ke.bot_params)==null?void 0:wn.direction,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${pt%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:(on=Ke==null?void 0:Ke.bot_params)==null?void 0:on.executionMode,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${pt%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx("div",{className:"w-16",children:i.jsxs("div",{className:"w-full h-5 rounded-md relative overflow-hidden",style:{backgroundColor:xt>=100?"rgba(40, 180, 40, 0.25)":"rgba(255, 170, 60, 0.15)"},children:[i.jsx("div",{className:"h-full transition-all duration-300",style:{width:`${xt||0}%`,backgroundColor:xt>=100?"#3ec78c":"#d68b38"}}),i.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-[10px] font-bold",style:{color:xt>=100?"#d0ffd9":"#ffcb8a"},children:[xt?xt.toFixed(0):"0","%"]})]})})})})})}),i.jsx("td",{scope:"row",className:`${pt%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(aa,{info1:Be==null?void 0:Be.label,info1_Color:Be==null?void 0:Be.color,rowTwo:!1})})})})}),i.jsx("td",{className:`${pt%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"pl-1 flex flex-col items-end gap-2 font-manrope",children:I[Ke.wallet_address]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{L({id:Number(Ke==null?void 0:Ke.id),walletAddress:Ke==null?void 0:Ke.wm_address,isDeleted:Mt?!0:Ke==null?void 0:Ke.is_deleted}),F(!0)},className:`h-7 px-3 w-[42px] rounded-md border justify-center items-center gap-2 inline-flex cursor-pointer transition ${Mt?"bg-[#2d2d2d] border-[#444]":Bt}`,title:Ve,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:Mt?i.jsx(Xe,{}):i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:Ve})})})})}),i.jsx("td",{className:`${pt%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222] pr-4`,children:i.jsx("div",{onClick:()=>{f(Ke),g(!0)},className:"pl-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx(jet,{className:"w-5 h-5 text-white"})})})]},pt)}):i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:"flex min-h-[44vh] h-66 flex-col justify-center items-center ml-[33%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16 md:-ml-0",children:[i.jsx("img",{src:ac,alt:""}),i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"View your recorded transactions by connecting your wallet."})})]})})})})})})]})})})]})]})},Fyn="https://dextrabothypev2.nftinit.io",Oyn=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState([]),[s,a]=m.useState(""),[o,l]=m.useState("");async function c(){try{t(!0);const u=window.localStorage.getItem("hyperToken"),d=window.localStorage.getItem("hyperAddress");if(!u||!d)return;const x=await(await fetch(`${Fyn}/api/hyper/mmbot/list/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:d.toLowerCase(),token:u})})).json();x!=null&&x.success?r((x==null?void 0:x.data)||[]):(r([]),a((x==null?void 0:x.error_message)||"Failed to load info."))}catch(u){a(u.message||"Wallet list error.")}finally{t(!1)}}return i.jsxs("div",{className:"relative text-white overflow-hidden overscroll-none bg-[#050505]",children:[i.jsxs("div",{className:"pointer-events-none absolute inset-0",children:[i.jsx("div",{className:"absolute inset-0 opacity-60",style:{background:"radial-gradient(1200px 800px at 10% 0%, rgba(103,255,189,0.12), transparent 55%), radial-gradient(900px 900px at 90% 100%, rgba(96,93,255,0.12), transparent 55%)"}}),i.jsx("div",{className:"absolute inset-0 opacity-[0.08]",style:{background:"repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.08) 1px, transparent 1px, transparent 120px)"}})]}),i.jsxs("div",{className:"relative mx-auto flex w-full flex-col gap-10 px-4 pb-16 pt-10 sm:px-6 lg:px-0",style:{fontFamily:"Manrope, ui-sans-serif"},children:[i.jsxs("div",{className:"relative mx-auto flex w-full flex-col gap-10 max-w-6xl",children:[i.jsx("div",{className:"absolute right-2 -top-11 text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{onClick:()=>window.open("https://www.youtube.com/watch?v=QJHZwcKMSI0","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{className:"w-4 h-4 text-white"})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]}),i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/market-maker-bot/hyperliquid-market-maker-bot","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:o5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})]})}),i.jsxs(vo.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4},className:"relative overflow-hidden rounded-[28px] border border-white/10 bg-[#050606]/90 px-4 pb-6 pt-8 shadow-[0_25px_80px_rgba(0,0,0,0.65)] backdrop-blur-xl sm:px-10",children:[i.jsx("div",{className:"absolute inset-0 opacity-40",children:i.jsx("div",{className:"absolute inset-y-0 left-0 w-1/3",style:{background:"radial-gradient(450px 200px at 0% 0%, rgba(103,255,189,0.3), transparent 75%)"}})}),i.jsx("div",{className:"relative z-10",children:i.jsx(kyn,{fetchInfoOnOpen:c,setIsFilterWallet:l})})]})]}),i.jsx("section",{className:"relative w-full rounded-[32px] border border-white/10 bg-[#050606]/90 px-3 pb-4 pt-6 shadow-[0_25px_80px_rgba(0,0,0,0.65)] backdrop-blur-2xl sm:px-6",children:i.jsx("div",{className:"rounded-[28px] border border-white/5 bg-[#090909]/90 p-3 shadow-inner",children:i.jsx(Pyn,{data:n,setData:r,loading:e,error:s,fetchInfoOnOpen:c,isFilterWallet:o})})})]})]})},pF="#67FFBD",Myn=({code:e,onCodeChange:t,onSubmit:n,loading:r,loadingCheckAccount:s,message:a})=>{const o=r||s||!e.trim();return i.jsx("div",{className:"h-[calc(100vh-10rem)]",children:s?i.jsxs("div",{className:"absolute mx-auto z-50 h-full w-full flex justify-center items-center overflow-hidden rounded-[16px] bg-transparent",children:[i.jsx(vo.div,{className:"pointer-events-none absolute -inset-[40%] opacity-80 blur-3xl h-full",style:{background:"radial-gradient(circle at 15% 0%, rgba(103,255,189,0.32), transparent 55%), radial-gradient(circle at 85% 100%, rgba(103,255,189,0.24), transparent 60%)"},initial:{x:"-4%",y:"-8%"},animate:{x:["-4%","4%","-2%","-4%"],y:["-8%","6%","2%","-8%"]},transition:{duration:24,repeat:1/0,ease:"easeInOut"}}),i.jsx(Da,{})]}):i.jsxs("div",{className:"relative h-full w-full flex justify-center items-center overflow-hidden rounded-[16px] bg-black",children:[i.jsx(vo.div,{className:"pointer-events-none absolute -inset-[40%] opacity-80 blur-3xl h-full",style:{background:"radial-gradient(circle at 15% 0%, rgba(103,255,189,0.32), transparent 55%), radial-gradient(circle at 85% 100%, rgba(103,255,189,0.24), transparent 60%)"},initial:{x:"-4%",y:"-8%"},animate:{x:["-4%","4%","-2%","-4%"],y:["-8%","6%","2%","-8%"]},transition:{duration:24,repeat:1/0,ease:"easeInOut"}}),i.jsxs(vo.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,ease:[.16,1,.3,1]},className:"relative z-10 w-full max-w-[460px] rounded-2xl border border-[#17211b] bg-[#050505] shadow-[0_30px_90px_rgba(0,0,0,0.9)] overflow-hidden",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-50",children:i.jsx("div",{className:"w-full h-full",style:{background:"radial-gradient(900px 500px at 50% -10%, rgba(103,255,189,0.45), transparent 70%)"}})}),i.jsx("video",{src:XN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[260px] object-cover bg-black"},XN)]}),i.jsxs("div",{className:"px-5 pb-5 pt-4 space-y-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-[11px] font-medium tracking-[0.18em] uppercase",style:{color:pF},children:"Early Access"}),i.jsxs("div",{className:"text-lg font-semibold",children:["Enter ",i.jsx("span",{style:{color:pF},children:"Alpha Code"})]}),i.jsx("p",{className:"text-[12px] text-white/60",children:"Market Maker is currently in private alpha. Enter your invitation code to unlock this feature in your account."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-[11px] text-white/45",children:"Alpha Code"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value.toUpperCase()),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),n())},placeholder:"DXTR-XXXXX",autoComplete:"off",spellCheck:!1,className:"flex-1 h-10 px-3 rounded-md bg-[#050505] border border-[#1e2e27] text-[13px] tracking-[0.18em] font-mono text-white placeholder:text-white/20 focus:outline-none focus:border-[#67FFBD]"}),i.jsx("button",{type:"button",onClick:n,disabled:o,className:`h-10 px-4 rounded-md text-[13px] font-semibold transition-colors ${o?"bg-[#101613] text-white/40 cursor-not-allowed":"text-black hover:opacity-90"}`,style:o?void 0:{backgroundColor:pF},children:r?"Checking…":"Access"})]})]}),(s||a)&&i.jsxs("div",{className:"text-[11px] min-h-[16px]",children:[s&&!a&&i.jsx("span",{className:"text-white/40",children:"Checking your eligibility…"}),a&&i.jsx("span",{style:{color:pF},children:a})]})]})]})]})})},Ryn=()=>{const{setSignModalOpen:e}=m.useContext(Qr);return i.jsxs("div",{className:"relative h-[calc(100vh-10rem)]",children:[i.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-80",style:{background:"radial-gradient(900px 600px at 0% 0%, rgba(103,255,189,0.16), transparent 65%), radial-gradient(700px 500px at 100% 100%, rgba(96,93,255,0.14), transparent 65%)"}}),i.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.08]",style:{background:"repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 10px)"}}),i.jsx("div",{className:"relative mx-auto z-10 flex h-full w-full max-w-4xl items-center justify-center px-4",children:i.jsxs("div",{className:"relative flex w-full max-w-xl flex-col items-center justify-center gap-4 rounded-[24px] border border-white/10 bg-[#050505]/95 px-6 py-7 shadow-[0_20px_60px_rgba(0,0,0,0.65)] backdrop-blur-xl",children:[i.jsx("div",{className:"absolute inset-x-10 -top-10 h-24 bg-gradient-to-br from-[#67ffbd]/40 via-transparent to-[#8570ff]/30 opacity-60 blur-2xl"}),i.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-4",children:[i.jsx("div",{className:"inline-flex items-center rounded-full border border-[#1c2b25] bg-[#07130d] px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.25em] text-[#67ffbd]",children:"Market Maker"}),i.jsx("p",{className:"text-sm font-semibold text-white sm:text-base",children:"Connect your wallet to use Market Maker"}),i.jsx("p",{className:"text-[12px] text-[#9BA1A6] text-center max-w-md",children:"To start and manage your market maker bots on Hyperliquid, you need to connect your wallet first."}),i.jsx("div",{className:"w-[220px] pt-1",children:i.jsx("button",{onClick:()=>e(!0),className:"w-full h-[36px] rounded-xl font-bold text-[12px] transition-opacity mb-2 flex items-center justify-center bg-[#67FFBD] text-black",children:"Connect"})})]})]})})]})},Lyn=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setMushboomerETH:n,setIsWhitelist:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setHyperToken:l,setHyperAddress:c,setSignModalOpen:u}=m.useContext(Qr),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(""),[C,N]=m.useState(!1),[I,P]=m.useState(""),[R,F]=m.useState(!1);m.useEffect(()=>{const L=localStorage.getItem("hyperToken"),z=localStorage.getItem("hyperAddress");f(!!(L&&z));const Q=setInterval(()=>{const ne=localStorage.getItem("hyperToken"),J=localStorage.getItem("hyperAddress");f(!!(ne&&J))},800);return()=>clearInterval(Q)},[]),m.useEffect(()=>{(async()=>{var ne,J;const z=window.localStorage.getItem("hyperToken"),Q=window.localStorage.getItem("hyperAddress");if(!(!z||!Q))try{F(!0);const X=await ji(Q.toLowerCase(),z);X!=null&&X.success?(e(X==null?void 0:X.telegram_chat_id),t(X==null?void 0:X.subscriber_role),n((ne=X==null?void 0:X.mushboomer_counts)==null?void 0:ne.eth),s((J=X==null?void 0:X.mushboomer_counts)==null?void 0:J.sol),a(X==null?void 0:X.referral_code),o(X==null?void 0:X.refcode),r(X==null?void 0:X.whitelist),g(X==null?void 0:X.mm_hyper_alpha_code),F(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),l(""),c(""),F(!1))}catch(X){console.error("Token verification error:",X),F(!1)}})()},[d]);const U=async()=>{var Q,ne,J,X;const L=window.localStorage.getItem("hyperToken"),z=window.localStorage.getItem("hyperAddress");if(!v.trim()){ln.error("Please enter your alpha code");return}if(!L||!z){u(!0);return}N(!0),P("");try{const re={address:z==null?void 0:z.toLowerCase(),token:L,alpha_code:v.trim(),source_market:"hyper",app_type:"mm_bot"},Y=(await ds.post("https://dextrabothypev2.nftinit.io/api/subscriber/alpha_code/set/",re)).data||{};if(Y.success){const ie=Y.message||"Alpha code added successfully";ln.success(`${ie}`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),P(ie),g(!0)}else{const ie=Y.error_message||Y.message||"This alpha code is invalid";ln.success(`${ie}.`,{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}),P(ie)}}catch(re){const pe=((ne=(Q=re==null?void 0:re.response)==null?void 0:Q.data)==null?void 0:ne.error_message)||((X=(J=re==null?void 0:re.response)==null?void 0:J.data)==null?void 0:X.message)||re.message||"Failed to validate alpha code";ln.success(`${pe}.`,{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}),P(pe)}finally{N(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"Market Maker Bot (Hyperliquid) | Dextrabot"}),i.jsx("meta",{name:"description",content:"Automate market making on Hyperliquid. Generate trading volume and provide liquidity 24/7."}),i.jsx("meta",{property:"og:title",content:"Market Maker Bot (Hyperliquid) | Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Automate market making on Hyperliquid. Generate trading volume and provide liquidity 24/7."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/market-maker "})]})}),i.jsx("div",{style:{minHeight:"calc(100vh - 5rem)"},className:"flex justify-center items-start w-full h-full px-4 pt-6 pb-6 sm:px-6 sm:pt-6 sm:pb-6 bg-[#050505] overflow-auto",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start gap-[26px] w-full flex-grow xl:flex-grow-0",children:d?x&&d?i.jsx(Oyn,{}):i.jsx(Myn,{code:v,onCodeChange:w,onSubmit:U,loading:C,loadingCheckAccount:R,message:I}):i.jsx(Ryn,{})})})]})},Dyn=({data:e,refreshAgent:t,loadingCheckAccount:n,slotCount:r})=>{var Y,ie,oe;const s=e==null?void 0:e.subs_expire_date,[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(null),g=s?new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):null,v={extended:{name:"Extended",type:"img",src:"https://app.extended.exchange/assets/logo/extended-long.svg"},lighter:{name:"Lighter",type:"component",component:i.jsx(Xf,{className:"w-6 h-6 text-white"})},pacifica:{name:"Pacifica",type:"img",src:"https://app.pacifica.fi/imgs/logo.svg"},paradex:{name:"Paradex",type:"component",component:i.jsx(nMe,{className:"h-2.5 text-white -ml-6"})},variational:{name:"Variational",type:"img",src:"https://omni.variational.io/_app/immutable/assets/full_omni_wordmark.DwlcSpMk.svg"},aster:{name:"Aster",type:"img",src:"https://static.asterdex.com/cloud-futures/static/images/aster/logo.svg"},basedapp:{name:"BasedApp",type:"img",src:oke},apex:{name:"Apex",type:"img",src:"https://omni.apex.exchange/assets/logo_content-CY9uyFbz.svg"}},w={lighter:{name:"Lighter",type:"component",src:i.jsx(Xf,{className:"w-6 h-6 text-white"})}},C=["aster","basedapp","apex","extended"],N=(e==null?void 0:e.slots_info)||{},I=Object.fromEntries(Object.entries(N).filter(([G])=>!C.includes(G))),P=Object.values(I).reduce((G,V)=>G+V.total_qty,0),R=Object.values(I).reduce((G,V)=>G+V.active_qty,0),F=(((Y=e==null?void 0:e.copy_trade_slots_info)==null?void 0:Y.using_slot_count)||0)+(((ie=e==null?void 0:e.copy_trade_slots_info)==null?void 0:ie.total_slot_count)||0),U=((oe=e==null?void 0:e.copy_trade_slots_info)==null?void 0:oe.using_slot_count)||0,L=((e==null?void 0:e.bot_slots_info)||[]).find(G=>String((G==null?void 0:G.bot_type)||"").toLowerCase()==="grid_bot"&&String((G==null?void 0:G.source_market)||"").toLowerCase()==="lighter")||{},z=(L==null?void 0:L.total_slot_count)||0,Q=(L==null?void 0:L.using_subs_slot_count)||0,ne=(L==null?void 0:L.using_extra_slot_count)||0,J=Q+ne,X=J+z,re=()=>{navigator.clipboard.writeText(`https://app.dextrabot.com/referral/${e.refcode}`),o(!0),setTimeout(()=>o(!1),2e3)},pe=!!window.localStorage.getItem("hyperToken");return i.jsxs(i.Fragment,{children:[l&&Na.createPortal(i.jsx(Ale,{open:l,setOpen:c,oldSlotCount:f,checkAccountTrade:n,tradeMarket:"copyTrade"}),document.body),u&&Na.createPortal(i.jsx(p5,{open:u,setOpen:d,oldSlotCount:J,checkAccountLighter:t,product:"grid_bot"}),document.body),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center text-2xl font-bold shadow-lg shadow-orange-500/30",children:i.jsx("img",{src:EA,alt:"",className:"w-7 h-7"})}),i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Profile"}),i.jsx("div",{onClick:()=>{t()},className:"flex justify-center items-center cursor-pointer",children:i.jsx(AS,{className:"w-4 h-4 text-[#929292] hover:text-white"})})]}),pe?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`${(e==null?void 0:e.subs_expire_day)===null?"flex":"hidden"} flex-col items-start gap-4 bg-gradient-to-br from-[#141414] to-[#0c0c0c] border border-white/5 rounded-2xl p-6 max-w-[480px] shadow-[0_0_40px_-15px_rgba(255,140,0,0.3)]`,children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center text-xl font-bold text-white shadow-lg shadow-orange-500/40",children:"!"}),i.jsx("h2",{className:"text-xl font-semibold text-white/90",children:"No Active Subscription"}),i.jsx("p",{className:"text-base text-white/70 leading-relaxed",children:"You don't have an active subscription yet. Subscribe now to unlock trading bots, copy trading, and farming tools across multiple DEXs."})]}),i.jsxs("div",{className:`${(e==null?void 0:e.subs_expire_day)===null||!(e!=null&&e.subs_expire_day)?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 relative overflow-hidden w-full`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-orange-500/10 to-transparent rounded-bl-full"}),i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("span",{className:"text-orange-400",children:"⏱"}),i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Subscription Status"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"flex flex-wrap items-baseline gap-2 mb-2",children:[i.jsx("span",{className:"text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-orange-400 to-red-500",children:e==null?void 0:e.subs_expire_day}),i.jsx("span",{className:"text-white/60 text-lg",children:"days remaining"})]}),i.jsxs("p",{className:"text-white/40 text-sm",children:["Expires on"," ",i.jsx("span",{className:"text-white/60",children:g||"-"})]})]}),i.jsxs("div",{className:`${(e==null?void 0:e.copy_trade_slots_info)===null?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 relative overflow-hidden w-full`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-orange-500/10 to-transparent rounded-bl-full"}),i.jsxs("div",{className:"flex justify-between items-center mb-2.5 gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Copy Trade Slots"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"px-3 py-1 bg-orange-500/10 rounded-lg text-orange-400 text-sm font-medium -mt-2.5",children:[U,"/",F," Active"]})]}),i.jsxs("div",{className:`flex items-center justify-between py-3 px-4 rounded-xl
bg-white/[0.02] hover:bg-white/[0.04] transition-colors
border border-white/5`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"h-5 flex items-center justify-center",children:w.lighter.src}),i.jsx("span",{className:"font-medium text-white/80",children:w.lighter.name})]}),i.jsxs("div",{className:"flex justify-end items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`w-2 h-2 rounded-full ${U>0?"bg-green-400 shadow-green-400/50 shadow-sm":"bg-white/20"}`}),i.jsx("span",{className:U>0?"text-green-400 font-semibold":"text-white/40",children:U}),i.jsx("span",{className:"text-white/30",children:"/"}),i.jsx("span",{className:"text-white/60",children:F})]}),i.jsx("div",{className:"w-24 h-1.5 bg-white/5 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 rounded-full transition-all",style:{width:`${F>0?U/F*100:0}%`}})})]})]}),i.jsx("div",{className:"flex justify-end items-center w-full mt-4",children:i.jsx("button",{onClick:()=>{x(r),c(!0)},className:"px-4 py-1.5 rounded-lg text-sm font-semibold bg-gradient-to-r from-orange-500 to-red-500 text-white shadow-[0_0_12px_rgba(255,100,0,0.4)]hover:shadow-[0_0_18px_rgba(255,120,0,0.6)] transition-all",children:"Get More Slots"})})]}),i.jsxs("div",{className:`${X===0?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 relative overflow-hidden w-full`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-orange-500/10 to-transparent rounded-bl-full"}),i.jsxs("div",{className:"flex justify-between items-center mb-2.5 gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Grid Bot Slots"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"px-3 py-1 bg-orange-500/10 rounded-lg text-orange-400 text-sm font-medium -mt-2.5",children:[J,"/",X," Active"]})]}),i.jsxs("div",{className:`flex items-center justify-between py-3 px-4 rounded-xl
bg-white/[0.02] hover:bg-white/[0.04] transition-colors
border border-white/5`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"h-5 flex items-center justify-center",children:w.lighter.src}),i.jsx("span",{className:"font-medium text-white/80",children:"Lighter"})]}),i.jsxs("div",{className:"flex justify-end items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`w-2 h-2 rounded-full ${J>0?"bg-green-400 shadow-green-400/50 shadow-sm":"bg-white/20"}`}),i.jsx("span",{className:J>0?"text-green-400 font-semibold":"text-white/40",children:J}),i.jsx("span",{className:"text-white/30",children:"/"}),i.jsx("span",{className:"text-white/60",children:X})]}),i.jsx("div",{className:"w-24 h-1.5 bg-white/5 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 rounded-full transition-all",style:{width:`${X>0?J/X*100:0}%`}})})]})]}),i.jsx("div",{className:"flex justify-end items-center w-full mt-4",children:i.jsx("button",{onClick:()=>{d(!0)},className:"px-4 py-1.5 rounded-lg text-sm font-semibold bg-gradient-to-r from-orange-500 to-red-500 text-white shadow-[0_0_12px_rgba(255,100,0,0.4)]hover:shadow-[0_0_18px_rgba(255,120,0,0.6)] transition-all",children:"Get More Slots"})})]}),i.jsxs("div",{className:`${Object.keys((e==null?void 0:e.slots_info)||{}).length===0?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 w-full`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Slots Overview"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"px-3 py-1 bg-orange-500/10 rounded-lg text-orange-400 text-sm font-medium",children:[R,"/",P," Active"]})]}),i.jsx("div",{className:"space-y-2",children:Object.entries(I).filter(([G])=>!C.includes(G)).map(([G,V])=>{var te,ae,he;return i.jsxs("div",{className:"flex items-center justify-between py-3 px-4 rounded-xl bg-white/[0.02] hover:bg-white/[0.04] transition-colors border border-transparent hover:border-white/5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:`${G==="apex"?"h-6":G==="basedapp"?"h-3.5":G==="pacifica"?"h-5":G==="variational"?"h-3":"h-3.5"} flex items-center justify-center`,children:[((te=v[G])==null?void 0:te.type)==="img"&&i.jsx("img",{src:v[G].src,alt:v[G].name,className:"w-full h-full"}),((ae=v[G])==null?void 0:ae.type)==="component"&&v[G].component]}),G==="lighter"&&i.jsx("span",{className:"font-medium text-white/80 -ml-3",children:((he=v[G])==null?void 0:he.name)||G})]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:`w-2 h-2 rounded-full ${V.active_qty>0?"bg-green-400 shadow-lg shadow-green-400/50":"bg-white/20"}`}),i.jsx("span",{className:V.active_qty>0?"text-green-400 font-semibold":"text-white/40",children:V.active_qty}),i.jsx("span",{className:"text-white/30",children:"/"}),i.jsx("span",{className:"text-white/60",children:V.total_qty})]}),i.jsx("div",{className:"w-24 h-1.5 bg-white/5 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 rounded-full transition-all",style:{width:`${V.active_qty/V.total_qty*100}%`}})})]})]},G)})})]}),i.jsxs("div",{className:`${e!=null&&e.referral_code&&(e==null?void 0:e.refcode)!==null?"":"hidden"} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 w-full`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i.jsx("span",{className:"text-orange-400",children:"🎁"}),i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Referral Code"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex-1 px-4 py-3 bg-black/30 rounded-xl border border-white/10 font-mono text-lg text-orange-400 tracking-wider",children:e==null?void 0:e.refcode}),i.jsx("button",{onClick:re,className:"px-4 py-3 bg-white/5 border border-white/10 rounded-xl hover:bg-orange-500/10 hover:border-orange-500/30 transition-all group",children:a?i.jsx("span",{className:"text-green-400",children:"✓"}):i.jsx("span",{className:"text-white/60 group-hover:text-orange-400 transition-colors",children:"📋"})})]}),i.jsx("p",{className:"text-white/40 text-sm mt-3",children:"Share your code and earn rewards for each referral"})]})]}):i.jsxs("div",{className:"flex flex-col items-start gap-4 bg-gradient-to-br from-[#141414] to-[#0c0c0c] border border-white/5 rounded-2xl p-6 max-w-[480px] shadow-[0_0_40px_-15px_rgba(255,140,0,0.3)]",children:[i.jsx("div",{className:`w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-red-600
flex items-center justify-center text-xl font-bold text-white shadow-lg shadow-orange-500/40`,children:"!"}),i.jsx("h2",{className:"text-xl font-semibold text-white/90",children:"Wallet Not Connected"}),i.jsx("p",{className:"text-base text-white/70 leading-relaxed",children:"Connect your wallet to access your profile, manage subscriptions, and view your active trading slots."})]})]})},Byn=()=>{const{setSignModalOpen:e,setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setIsWhitelist:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Qr),{address:f}=Jr(),[x,g]=m.useState(1),[v,w]=m.useState({}),[C,N]=m.useState(""),[I,P]=m.useState(""),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,Q]=m.useState(""),[ne,J]=m.useState(0),[X,re]=m.useState(0),[pe,Y]=m.useState(!1),[ie,oe]=m.useState(0),[G,V]=m.useState(!1),te=it=>/^\d*$/.test(it),ae=it=>{["e","E","+","-"].includes(it.key)&&it.preventDefault()},he=m.useMemo(()=>{if(x==="")return!1;const it=Number(x);return Number.isInteger(it)&&it>=1},[x]),ge=(it=>{const[tt,ot]=it.split(" "),[ft,ct,Vt]=tt.split("-").map(Number),[It,an]=ot.split(":").map(Number);return new Date(Date.UTC(Vt,ct-1,ft,It-3,an))})("29-11-2025 23:59");m.useState(()=>new Date().getTime()>=ge.getTime());const Ae=m.useRef(ne);m.useEffect(()=>{Ae.current=ne},[ne]);const ye=m.useRef(0);m.useEffect(()=>{ye.current=X},[X]);const je=async()=>{var ot,ft,ct;const it=window.localStorage.getItem("hyperToken"),tt=window.localStorage.getItem("hyperAddress");if(!(!it||!tt))try{V(!0);const Vt=await ji(tt.toLowerCase(),it);Vt!=null&&Vt.success?(t(Vt==null?void 0:Vt.telegram_chat_id),n(Vt==null?void 0:Vt.subscriber_role),r(Vt==null?void 0:Vt.subs_expire_day),s((ot=Vt==null?void 0:Vt.mushboomer_counts)==null?void 0:ot.eth),a((ft=Vt==null?void 0:Vt.mushboomer_counts)==null?void 0:ft.sol),o(Vt==null?void 0:Vt.referral_code),l(Vt==null?void 0:Vt.refcode),c(Vt==null?void 0:Vt.whitelist),u(it),d(tt),N(Vt==null?void 0:Vt.farming_tools),J(Number((Vt==null?void 0:Vt.subs_expire_day)||0)),w(Vt),V(!1),oe(((ct=Vt==null?void 0:Vt.copy_trade_slots_info)==null?void 0:ct.extra_slot_count)||0)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""),V(!1))}catch(Vt){console.error("Token verification error:",Vt),console.error(Vt.message||"An unknown error occurred."),V(!1)}};m.useEffect(()=>{pe&&je()},[pe]),m.useEffect(()=>{const it=localStorage.getItem("hyperToken"),tt=localStorage.getItem("hyperAddress");Y(!!(it&&tt));const ot=setInterval(()=>{const ft=localStorage.getItem("hyperToken"),ct=localStorage.getItem("hyperAddress");Y(!!(ft&&ct))},800);return()=>clearInterval(ot)},[]);const Ie=async()=>new Sl(window.ethereum).eth.getAccounts(tt=>tt),Re=async(it="subscribe",tt=24,ot=5e3)=>{tt<=0||(await new Promise(ft=>setTimeout(ft,ot)),await je(),it==="subscribe"&&Ae.current===ye.current?Re(it,tt-1,ot):je())},Qe=async it=>{const tt=window.localStorage.getItem("hyperToken"),ot=window.localStorage.getItem("hyperAddress");if(!tt||!f){e(!0);return}P(""),re(Ae.current),ye.current=Ae.current,L(!0),F(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Vt){console.error("Failed to switch network",Vt),F(!1);return}const ft=new Sl(window.ethereum);var ct=await Ie();if(ct.length>0?ct=ct[0]:ct=void 0,ct){const It=it*.12,an=ft.utils.toWei(It.toString(),"ether"),Nt={from:ct,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:an};await ft.eth.sendTransaction(Nt).then(mn=>{console.log("txHash :>> ",mn),F(!1),Q(mn.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():ot,token:tt,payment_tx:mn.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),je(),Re("subscribe")}).catch(mn=>{console.log(mn),mn.code===-32003||mn.message.includes("insufficient funds")?P("Insufficient funds."):mn.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await ft.eth.requestAccounts()},$e=()=>{je()};return window.localStorage.getItem("hyperToken"),i.jsxs(i.Fragment,{children:[i.jsx(bd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:!(ne<=X),errorFunds:I,activeMethod:2}),i.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-start md:justify-center md:items-start gap-8 w-full h-full bg-[#161616]",children:[i.jsx("div",{className:"flex justify-center items-start md:items-center w-full pl-0 sm:pl-4 md:pl-2",children:i.jsx("div",{className:"flex flex-col gap-2 pt-0 md:pt-7 lg:pt-0",children:i.jsx("div",{className:"flex flex-col items-start justify-start gap-4 md:mb-10 lg:mb-16 overflow-scroll h-full",children:i.jsx(Dyn,{data:v,refreshAgent:$e,loadingCheckAccount:G,slotCount:ie})})})}),i.jsxs("div",{className:"relative mx-1 h-full py-10 hidden md:block",children:[i.jsx("div",{className:"w-[2px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.8)_15%,rgba(255,50,150,0.8)_85%,rgba(255,50,150,0)_100%)]"}),i.jsx("div",{className:"absolute inset-0 w-[8px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.4)_15%,rgba(255,50,150,0.4)_85%,rgba(255,50,150,0)_100%)] blur-md mx-auto"})]}),i.jsx("div",{className:"flex flex-col justify-center items-center md:items-center w-full h-full gap-4 pb-10 mb:pb-0",children:i.jsxs("div",{className:"flex flex-col items-center gap-4 border border-[#404040] bg-[#141414] rounded-xl px-3 py-7 shadow-[0_0_25px_rgba(255,120,50,0.25)] min-w-[362px]",children:[i.jsx("div",{className:"rounded-lg overflow-hidden",children:i.jsx("video",{src:lD,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[284px] lg:h-[284px] object-cover"},lD)}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>g(it=>{const tt=Number(it||0);return tt>1?String(tt-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:x,onChange:it=>{const tt=it.target.value.trim();if(tt==="")return g("");te(tt)&&g(tt)},onKeyDown:ae,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] font-semibold outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>g(it=>{const tt=Number(it||0);return String(tt+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),x!==""&&!he&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),he&&i.jsxs("div",{className:"text-[12px] font-semibold text-green-400",children:[" ",x," months will be added to your subscription."]}),i.jsx("div",{className:"relative flex items-center justify-center gap-3 px-4 py-2 rounded-xl shadow-[0_0_25px_rgba(255,140,0,0.15)] backdrop-blur-md bg-white/5 border border-white/10",children:i.jsxs("span",{className:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-pink-500 bg-clip-text text-transparent",children:[(x*.12).toFixed(2)," ETH"]})}),i.jsx("div",{onClick:it=>{it.preventDefault(),he&&Qe(x)},className:`text-[10px] sm:text-xs xl:text-[13px] font-semibold text-gray-200 select-none border rounded-md px-4 py-2 ${he?"border-[#8861FF] bg-[#7446FF] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy Now"})]})})]})]})},$yn=()=>{Jr();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Qr);return m.useEffect(()=>{(async()=>{var g,v;const f=window.localStorage.getItem("hyperToken"),x=window.localStorage.getItem("hyperAddress");if(!(!f||!x))try{const w=await ji(x.toLowerCase(),f);w!=null&&w.success?(e(w==null?void 0:w.telegram_chat_id),t(w==null?void 0:w.subscriber_role),n(w==null?void 0:w.subs_expire_day),r((g=w==null?void 0:w.mushboomer_counts)==null?void 0:g.eth),s((v=w==null?void 0:w.mushboomer_counts)==null?void 0:v.sol),a(w==null?void 0:w.referral_code),o(w==null?void 0:w.refcode),l(w==null?void 0:w.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(w){console.error("Token verification error:",w),console.error(w.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Mo,{children:i.jsxs(Ho,{children:[i.jsx("title",{children:"My Profile - Dextrabot | Manage Your Trading Bots & Subscriptions"}),i.jsx("link",{rel:"canonical",href:"https://app.dextrabot.com/my-profile"}),i.jsx("meta",{name:"description",content:"View and manage your Dextrabot profile. Track your subscription status, active trading slots across multiple DEXs, referral rewards, and account features. Optimize your automated trading experience."}),i.jsx("meta",{name:"og:title",content:"My Profile - Dextrabot | Manage Your Trading Bots & Subscriptions"}),i.jsx("meta",{name:"og:description",content:"View and manage your Dextrabot profile. Track your subscription status, active trading slots across multiple DEXs, referral rewards, and account features. Optimize your automated trading experience."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/my-profile"})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-[calc(100vh-5rem)] min-h-max px-4 pt-4 pb-10 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(Byn,{})})})]})},Uyn=()=>{const{setSignModalOpen:e,setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setIsWhitelist:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Qr),{address:f}=Jr(),[x,g]=m.useState(1),[v,w]=m.useState(""),[C,N]=m.useState(!1),[I,P]=m.useState(!1),[R,F]=m.useState(""),[U,L]=m.useState(0),[z,Q]=m.useState(0),[ne,J]=m.useState(!1),[X,re]=m.useState(!1),pe=Ce=>/^\d*$/.test(Ce),Y=Ce=>{["e","E","+","-"].includes(Ce.key)&&Ce.preventDefault()},ie=m.useMemo(()=>{if(x==="")return!1;const Ce=Number(x);return Number.isInteger(Ce)&&Ce>=1},[x]),oe=m.useRef(U);m.useEffect(()=>{oe.current=U},[U]);const G=m.useRef(0);m.useEffect(()=>{G.current=z},[z]);const V=async()=>{var ge,Ae;const Ce=window.localStorage.getItem("hyperToken"),ce=window.localStorage.getItem("hyperAddress");if(!(!Ce||!ce))try{re(!0);const ye=await ji(ce.toLowerCase(),Ce);ye!=null&&ye.success?(t(ye==null?void 0:ye.telegram_chat_id),n(ye==null?void 0:ye.subscriber_role),r(ye==null?void 0:ye.subs_expire_day),s((ge=ye==null?void 0:ye.mushboomer_counts)==null?void 0:ge.eth),a((Ae=ye==null?void 0:ye.mushboomer_counts)==null?void 0:Ae.sol),o(ye==null?void 0:ye.referral_code),l(ye==null?void 0:ye.refcode),c(ye==null?void 0:ye.whitelist),u(Ce),d(ce),L(Number((ye==null?void 0:ye.subs_expire_day)||0)),re(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""),re(!1))}catch(ye){console.error("Token verification error:",ye),console.error(ye.message||"An unknown error occurred."),re(!1)}};m.useEffect(()=>{ne&&V()},[ne]),m.useEffect(()=>{const Ce=localStorage.getItem("hyperToken"),ce=localStorage.getItem("hyperAddress");J(!!(Ce&&ce));const ge=setInterval(()=>{const Ae=localStorage.getItem("hyperToken"),ye=localStorage.getItem("hyperAddress");J(!!(Ae&&ye))},800);return()=>clearInterval(ge)},[]);const te=async()=>new Sl(window.ethereum).eth.getAccounts(ce=>ce),ae=async(Ce="subscribe",ce=24,ge=5e3)=>{ce<=0||(await new Promise(Ae=>setTimeout(Ae,ge)),await V(),Ce==="subscribe"&&oe.current===G.current?ae(Ce,ce-1,ge):V())},he=async Ce=>{const ce=window.localStorage.getItem("hyperToken"),ge=window.localStorage.getItem("hyperAddress");if(!ce||!f){e(!0);return}w(""),Q(oe.current),G.current=oe.current,P(!0),N(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(je){console.error("Failed to switch network",je),N(!1);return}const Ae=new Sl(window.ethereum);var ye=await te();if(ye.length>0?ye=ye[0]:ye=void 0,ye){const Ie=Ce*.09,Re=Ae.utils.toWei(Ie.toString(),"ether"),Qe={from:ye,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:Re};await Ae.eth.sendTransaction(Qe).then($e=>{console.log("txHash :>> ",$e),N(!1),F($e.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():ge,token:ce,payment_tx:$e.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),V(),ae("subscribe")}).catch($e=>{console.log($e),$e.code===-32003||$e.message.includes("insufficient funds")?w("Insufficient funds."):$e.message==="MetaMask Tx Signature: User denied transaction signature."&&P(!1)})}else await Ae.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[I&&Na.createPortal(i.jsx(bd,{open:I,setOpen:P,transactionHash:R,transactionLoading:C,paymentPresaleRole:!(U<=z),errorFunds:v,activeMethod:2}),document.body),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>g(Ce=>{const ce=Number(Ce||0);return ce>1?String(ce-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:x,onChange:Ce=>{const ce=Ce.target.value.trim();if(ce==="")return g("");pe(ce)&&g(ce)},onKeyDown:Y,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] font-semibold outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>g(Ce=>{const ce=Number(Ce||0);return String(ce+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),x!==""&&!ie&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),ie&&i.jsxs("div",{className:"text-[12px] font-semibold text-green-400",children:[" ",x," months will be added to your subscription."]}),i.jsxs("div",{className:"relative flex items-center justify-center gap-3 px-4 py-2 rounded-xl shadow-[0_0_25px_rgba(255,140,0,0.15)] backdrop-blur-md bg-white/5 border border-white/10",children:[i.jsxs("span",{className:"line-through text-gray-400/70 text-xl",children:[(x*.12).toFixed(2)," ETH"]}),i.jsxs("span",{className:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-pink-500 bg-clip-text text-transparent",children:[(x*.09).toFixed(2)," ETH"]})]}),i.jsx("div",{onClick:Ce=>{Ce.preventDefault(),ie&&he(x)},className:`text-[10px] sm:text-xs xl:text-[13px] font-semibold text-gray-200 select-none border rounded-md px-4 py-2 ${ie?"border-[#8861FF] bg-[#7446FF] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy Now"})]})},zyn=({open:e,setOpen:t})=>{const{subsExpireDay:n}=m.useContext(Qr),r=()=>{const s=Date.now(),a=localStorage.getItem("hyperAddress");localStorage.setItem(`lighterCopyTradeDismissedAt_${a}`,s.toString()),t(!1)};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(xa,{transition:!0,className:"relative transform overflow-hidden bg-[#161616] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsxs("div",{className:"relative flex flex-col justify-start items-center gap-6 w-full min-h-[420px] p-4 sm:p-12 rounded-3xl max-w-[600px]",children:[i.jsx("button",{onClick:r,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{className:"p-1",src:Ba,alt:"close"})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:qi,alt:"",className:"w-[86px h-[86px]"})}),i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsxs("div",{className:"flex flex-col items-center w-full gap-3 sm:gap-5",children:[i.jsxs("div",{className:"text-white font-manrope text-[20px] sm:text-[22px] font-extrabold leading-none",children:["Your subscription is ending in"," ",n||0," days"]}),i.jsxs("div",{className:"text-[13px] sm:text-[14px] text-center text-white/90 font-manrope font-semibold leading-[18px] max-w-[70ch]",children:["Renew now to keep access to Copy Trading, bots, and all premium features.",i.jsx("br",{}),i.jsx("br",{}),i.jsx("span",{className:"text-[#67FFBD] font-bold",children:"Renew now and get 25% off your subscription."})]}),i.jsx(Uyn,{})]})})]})})})})]})},Hyn=({open:e,setOpen:t})=>{const n=()=>{localStorage.setItem("strategySelectorModalDismissedAt",Date.now().toString()),t(!1)},r=()=>{localStorage.setItem("strategySelectorModalDismissedAt",Date.now().toString())},s=[{key:"hyperGrid",title:"Hyperliquid Grid Bot",desc:"Automated grid trading on Hyperliquid futures.",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",url:"/terminal/hyperliquid/BTC#gridbot"},{key:"hlMaker",title:"Hyperliquid Market Maker Bot",desc:"Liquidity-providing market making with dynamic spreads.",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",url:"/market-maker"},{key:"lighterMaker",title:"Lighter DCA Bot",desc:"Automate your DCA entries on Lighter. Coming soon.",icon:i.jsx(dy,{className:"w-4 h-4 text-white"}),comingSoon:!0},{key:"extendedMaker",title:"Extended DCA Bot",desc:"Advanced market making strategies.",icon:"https://app.extended.exchange/assets/logo/extended.svg",badge:"New",highlighted:!0,url:"/dca-bot"},{key:"lighterGrid",title:"Lighter Grid Bot",desc:"Automated grid trading on Lighter futures.",icon:i.jsx(dy,{className:"w-4 h-4 text-white"}),url:"/terminal/lighter/BTC#gridbot"},{key:"extendedGrid",title:"Extended Grid Bot",desc:"Advanced grid logic with dynamic rebalancing.",icon:"https://app.extended.exchange/assets/logo/extended.svg",url:"/terminal/extended/BTC#gridbot",badge:"New",highlighted:!0},{key:"hlCopyTrade",title:"Hyperliquid Copy Trade",desc:"Automatically copy trade best Hyperliquid wallets.",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",url:"/discover-wallets"},{key:"lgCopyTrade",title:"Lighter Copy Trade",desc:"Automatically copy trade best Hyperliquid wallets on Lighter.",icon:i.jsx(dy,{className:"w-4 h-4 text-white"}),url:"/discover-wallets"},{key:"lgDelta",title:"Lighter Delta Neutral",desc:"Delta-neutral farming on Lighter.",icon:i.jsx(dy,{className:"w-4 h-4 text-white"}),url:"/discover-wallets#lighter-farming"},{key:"asterBot",title:"Aster Farming Bot",desc:"Farm points on Aster exchange.",icon:i.jsx(tMe,{className:"w-4 h-4"}),url:"/discover-wallets#aster-farming"},{key:"extendedBot",title:"Extended Delta Neutral",desc:"Delta-neutral farming on Extended.",icon:"https://app.extended.exchange/assets/logo/extended.svg",url:"/discover-wallets#extended-farming",badge:"New",highlighted:!0},{key:"variationalBot",title:"Variational Farming Bot",desc:"Farm points on Variational exchange.",icon:Oyt,url:"/discover-wallets#variational-farming"},{key:"paradexBot",title:"Paradex Farming Bot",desc:"Farm points on Paradex exchange.",icon:Ryt,url:"/discover-wallets#paradex-farming"},{key:"pacificaBot",title:"Pacifica Farming Bot",desc:"Farm points on Pacifica exchange.",icon:"https://app.pacifica.fi/imgs/icon.svg",url:"/discover-wallets#pacifica-farming"},{key:"apexBot",title:"Apex Farming Bot",desc:"Farm points on Apex exchange.",icon:Myt,url:"/discover-wallets#apex-farming"}],a=o=>{if(!o)return null;if(Ne.isValidElement(o))return o;if(typeof o=="function"){const l=o;return i.jsx(l,{className:"w-6 h-6"})}return typeof o=="string"&&(o.startsWith("/")||o.startsWith("http"))?i.jsx("img",{src:o,alt:"",className:"w-6 h-6 object-contain",draggable:!1}):i.jsx("span",{className:"text-2xl leading-none",children:o})};return i.jsxs(Ea,{open:e,onClose:n,className:"relative z-50",children:[i.jsx(ja,{className:"fixed inset-0 bg-black/50 backdrop-blur-sm"}),i.jsx("div",{className:"fixed inset-0 flex items-center justify-center px-3 pb-4 pt-10 sm:p-0",children:i.jsxs(xa,{className:"relative w-full max-w-[780px] max-h-[76vh] sm:max-h-[96vh] rounded-t-[28px] sm:rounded-[28px] border border-white/5 bg-gradient-to-b from-[#191919] via-[#141414] to-[#111111] p-4 sm:py-3 sm:px-6 shadow-[0_22px_60px_rgba(0,0,0,0.9)] overflow-y-auto",children:[i.jsx("button",{onClick:n,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{src:Ba,alt:"close",className:"w-4 h-4"})}),i.jsx("h2",{className:"text-white text-[20px] sm:text-[26px] font-extrabold text-center mb-3 sm:mb-4 tracking-tight",children:"What brings you here?"}),i.jsx("div",{className:"space-y-4",children:i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2.5",children:s==null?void 0:s.map(o=>i.jsxs("div",{onClick:()=>{o.url&&(o.url.startsWith("/"),window.open(o.url,"_blank"),r())},className:`relative rounded-2xl p-2.5 transition ${o.highlighted&&!o.comingSoon?"bg-[#111827] border border-[#1c2741] hover:bg-[#202020]":o.highlighted&&o.comingSoon?"bg-[#6B5CFF14] border border-[#6B5CFF59]":"bg-[#181818] border border-[#2a2a2a] hover:bg-[#202020]"} ${o.comingSoon?"cursor-not-allowed":"cursor-pointer"}`,children:[o.badge&&!o.comingSoon&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 z-10",children:i.jsx("div",{className:"px-1 sm:px-2.5 py-0.5 rounded-md text-[9px] sm:text-[10px] font-bold bg-[#3b82f6] text-white shadow-md min-w-max",children:o.badge})}),o.badge&&o.comingSoon&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 z-10",children:i.jsx("div",{className:"px-1.5 sm:px-2.5 py-0.5 rounded-md text-[9px] sm:text-[10px] font-bold bg-[#6B5CFF] text-white shadow-md min-w-max",children:o.badge})}),i.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-black/20 text-2xl",children:a(o.icon)}),i.jsx("div",{className:"text-white font-semibold text-sm",children:o.title}),o.desc&&i.jsx("div",{className:"text-[#9b9b9b] text-[11px] leading-tight",children:o.desc})]})]},o.key))})})]})})]})},Vyn=({open:e,setOpen:t})=>null,mF="#basedapp-farming",xF="#aster-farming",gF="#lighter-farming",bF="#apex-farming",yF="#variational-farming",vF="#extended-farming",wF="#paradex-farming",CF="#pacifica-farming";function Wyn(){const e=[{from:"/feed",to:"/tracker"},{from:"/wallet-activities",to:"/tracker"},{from:"/favorite-wallets",to:"/tracked-wallets"},{from:"/high-volume-trades",to:"/hyperliquid-whale-trades"}],{hyperToken:t,subsExpireDay:n}=m.useContext(Qr),r=Mc(),s=il(),[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(!1),g=r.hash===mF,v=r.hash===xF,w=r.hash===gF,C=r.hash===bF,N=r.hash===yF,I=r.hash===vF,P=r.hash===wF,R=r.hash===CF,F=Ne.useCallback(re=>{re?r.hash!==mF&&s(r.pathname+r.search+mF,{replace:!0}):r.hash===mF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),U=Ne.useCallback(re=>{re?r.hash!==xF&&s(r.pathname+r.search+xF,{replace:!0}):r.hash===xF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),L=Ne.useCallback(re=>{re?r.hash!==gF&&s(r.pathname+r.search+gF,{replace:!0}):r.hash===gF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),z=Ne.useCallback(re=>{re?r.hash!==bF&&s(r.pathname+r.search+bF,{replace:!0}):r.hash===bF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),Q=Ne.useCallback(re=>{re?r.hash!==yF&&s(r.pathname+r.search+yF,{replace:!0}):r.hash===yF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),ne=Ne.useCallback(re=>{re?r.hash!==vF&&s(r.pathname+r.search+vF,{replace:!0}):r.hash===vF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),J=Ne.useCallback(re=>{re?r.hash!==wF&&s(r.pathname+r.search+wF,{replace:!0}):r.hash===wF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),X=Ne.useCallback(re=>{re?r.hash!==CF&&s(r.pathname+r.search+CF,{replace:!0}):r.hash===CF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]);return m.useEffect(()=>{const re=localStorage.getItem("dailyPicksDismissedAt"),pe=localStorage.getItem("dailyPicksBlockedUntil"),Y=Date.now();if(pe&&Y<parseInt(pe)){o(!1);return}if(re){const ie=new Date(parseInt(re)).toDateString(),oe=new Date().toDateString();if(ie===oe){o(!1);return}}o(!0)},[r.pathname,t]),m.useEffect(()=>{const re=window.localStorage.getItem("hyperToken"),pe=localStorage.getItem("hyperAddress");if(!re||!pe)return;if(n===null||n===0||Number(n)>7){c(!1);return}const Y=localStorage.getItem(`lighterCopyTradeDismissedAt_${pe}`);if(Y){const ie=new Date(parseInt(Y)).toDateString(),oe=new Date().toDateString();if(ie===oe){window.location.pathname==="/my-profile"?c(!0):c(!1);return}}c(!0)},[r.pathname,t,n]),m.useEffect(()=>{const re=localStorage.getItem("strategySelectorModalDismissedAt");if(re){const pe=new Date(parseInt(re)).toDateString(),Y=new Date().toDateString();if(pe===Y){d(!1);return}}d(!0)},[r.pathname,t]),m.useEffect(()=>{if(localStorage.getItem("lighterReportModalDismissed")==="true"){x(!1);return}x(!0)},[r.pathname]),i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsx(WYe,{})}),i.jsxs("div",{children:[i.jsx(Rin,{}),i.jsxs(zKe,{children:[i.jsx(ya,{path:"/",element:i.jsx(Xan,{})}),i.jsx(ya,{path:"/sitemap",element:i.jsx(ton,{})}),i.jsx(ya,{path:"/videos",element:i.jsx(non,{})}),e.map(({from:re,to:pe})=>i.jsx(ya,{path:re,element:i.jsx(Ede,{to:pe,replace:!0})},re)),i.jsxs(ya,{element:i.jsx(hrn,{}),children:[i.jsx(ya,{path:"/mobile-auth",element:i.jsx(eon,{})}),i.jsx(ya,{path:"discover-wallets",element:i.jsx(Wsn,{})}),i.jsx(ya,{path:"/hyperliquid-vaults",element:i.jsx(ron,{})}),i.jsx(ya,{path:"/back-testing",element:i.jsx(Bbn,{})}),i.jsx(ya,{path:"/hyperliquid-whale-trades",element:i.jsx(Ebn,{})}),i.jsx(ya,{path:"wallet-details/:walletAddress",element:i.jsx(Oin,{})}),i.jsx(ya,{path:"tracked-wallets",element:i.jsx(Din,{})}),i.jsx(ya,{path:"tracker",element:i.jsx(nan,{})}),i.jsx(ya,{path:"referral/:code?",element:i.jsx(lan,{})}),i.jsx(ya,{path:"wallet-management",element:i.jsx(van,{})}),i.jsx(ya,{path:"copy-trade",element:i.jsx(San,{})}),i.jsx(ya,{path:"leaderboard",element:i.jsx(kan,{})}),i.jsx(ya,{path:"ticker",element:i.jsx(oon,{})}),i.jsx(ya,{path:"terminal",element:i.jsx(Ede,{to:"/terminal/hyperliquid/BTC",replace:!0})}),i.jsx(ya,{path:"terminal/:coin",element:i.jsx(qyn,{})}),i.jsx(ya,{path:"terminal/:exchange/:coin",element:i.jsx(A0n,{})}),i.jsx(ya,{path:"telegram-verify",element:i.jsx(kbn,{})}),i.jsx(ya,{path:"telegram-api-wallet",element:i.jsx(Ubn,{})}),i.jsx(ya,{path:"subscribe",element:i.jsx(_yn,{})}),i.jsx(ya,{path:"my-profile",element:i.jsx($yn,{})}),i.jsx(ya,{path:"hyperliquid-fee-calculator",element:i.jsx(fNe,{})}),i.jsx(ya,{path:"hyperliquid-fee-calculator/:walletAddress",element:i.jsx(fNe,{})}),i.jsx(ya,{path:"market-maker",element:i.jsx(Lyn,{})}),i.jsx(ya,{path:"dca-bot",element:i.jsx(jyn,{})})]}),i.jsx(ya,{path:"*",element:i.jsx(Gyn,{url:"https://dextrabot.com/"})})]}),i.jsx($oe,{open:g,setOpen:F}),i.jsx(zyn,{open:l,setOpen:c}),i.jsx(Hyn,{open:u,setOpen:d}),i.jsx(Vyn,{open:f,setOpen:x}),i.jsx(Uoe,{open:v,setOpen:U}),i.jsx(zoe,{open:w,setOpen:L}),i.jsx(Hoe,{open:C,setOpen:z}),i.jsx(Voe,{open:N,setOpen:Q}),i.jsx(v$,{open:I,setOpen:ne}),i.jsx(Woe,{open:P,setOpen:J}),i.jsx(qoe,{open:R,setOpen:X})]})]})}function qyn(){const{coin:e}=e5(),t=il();return m.useEffect(()=>{const n=e||"BTC",r=typeof window<"u"&&window.location.hash||"";t(`/terminal/hyperliquid/${n}${r}`,{replace:!0})},[e,t]),null}function Gyn({url:e}){return Ne.useEffect(()=>{window.location.replace(e)},[e]),null}const Kyn="4953aed406a7fd4457496250b7e4efbc",Yyn=ERt({appName:"Dextrabot",projectId:Kyn,chains:[QE,i1e,s1e,r1e],transports:{[QE.id]:cj(),[i1e.id]:cj(),[s1e.id]:cj(),[r1e.id]:cj()},ssr:!1}),Xyn=new yxt,Qyn=document.getElementById("root"),Zyn=FNe.createRoot(Qyn);Zyn.render(i.jsx(QKe,{children:i.jsx(G0t,{config:Yyn,children:i.jsx(Uxt,{client:Xyn,children:i.jsx(KOt,{modalSize:"compact",theme:lMe({borderRadius:"large",fontStack:"rounded",overlayBlur:"large"}),children:i.jsx(Lbt,{children:i.jsx(Wyn,{})})})})})}));const yNe=Object.freeze(Object.defineProperty({__proto__:null,default:Vee},Symbol.toStringTag,{value:"Module"}));export{Rr as B,Die as E,zj as H,ss as _,W2n as a,r1 as b,lB as c,sft as d,s2 as e,Y0 as f,tie as g,ki as h,yie as i,e2n as j,Tu as k,O9e as l,F0t as m,eFt as r,Tc as s,pvn as t};