@edgex-web/components 0.2.0-beta.26 → 0.2.0-beta.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(oe,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(oe=typeof globalThis<"u"?globalThis:oe||self,x(oe.EdgeXComponents={},oe.React,oe.ReactDOM))})(this,function(oe,x,je){"use strict";var dP=Object.defineProperty;var pP=(oe,x,je)=>x in oe?dP(oe,x,{enumerable:!0,configurable:!0,writable:!0,value:je}):oe[x]=je;var Go=(oe,x,je)=>pP(oe,typeof x!="symbol"?x+"":x,je);function Ol(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const U=Ol(x),Mr=Ol(je);function Lm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mi={exports:{}},Lr={};/**
1
+ (function(se,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],E):(se=typeof globalThis<"u"?globalThis:se||self,E(se.EdgeXComponents={},se.React,se.ReactDOM))})(this,function(se,E,je){"use strict";var $P=Object.defineProperty;var AP=(se,E,je)=>E in se?$P(se,E,{enumerable:!0,configurable:!0,writable:!0,value:je}):se[E]=je;var ns=(se,E,je)=>AP(se,typeof E!="symbol"?E+"":E,je);function _l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const U=_l(E),zr=_l(je);function Um(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $i={exports:{}},Ur={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Il;function Bm(){if(Il)return Lr;Il=1;var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(c,a,l){var u,f={},p=null,d=null;l!==void 0&&(p=""+l),a.key!==void 0&&(p=""+a.key),a.ref!==void 0&&(d=a.ref);for(u in a)r.call(a,u)&&!s.hasOwnProperty(u)&&(f[u]=a[u]);if(c&&c.defaultProps)for(u in a=c.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:t,type:c,key:p,ref:d,props:f,_owner:o.current}}return Lr.Fragment=n,Lr.jsx=i,Lr.jsxs=i,Lr}var Br={};/**
9
+ */var zl;function Wm(){if(zl)return Ur;zl=1;var e=E,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(c,a,l){var u,f={},d=null,p=null;l!==void 0&&(d=""+l),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(p=a.ref);for(u in a)r.call(a,u)&&!s.hasOwnProperty(u)&&(f[u]=a[u]);if(c&&c.defaultProps)for(u in a=c.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:t,type:c,key:d,ref:p,props:f,_owner:o.current}}return Ur.Fragment=n,Ur.jsx=i,Ur.jsxs=i,Ur}var Wr={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,109 +14,109 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var kl;function Fm(){return kl||(kl=1,process.env.NODE_ENV!=="production"&&function(){var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.offscreen"),h=Symbol.iterator,m="@@iterator";function v(R){if(R===null||typeof R!="object")return null;var q=h&&R[h]||R[m];return typeof q=="function"?q:null}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(R){{for(var q=arguments.length,K=new Array(q>1?q-1:0),ne=1;ne<q;ne++)K[ne-1]=arguments[ne];S("error",R,K)}}function S(R,q,K){{var ne=T.ReactDebugCurrentFrame,be=ne.getStackAddendum();be!==""&&(q+="%s",K=K.concat([be]));var ge=K.map(function(le){return String(le)});ge.unshift("Warning: "+q),Function.prototype.apply.call(console[R],console,ge)}}var N=!1,M=!1,B=!1,F=!1,b=!1,g;g=Symbol.for("react.module.reference");function w(R){return!!(typeof R=="string"||typeof R=="function"||R===r||R===s||b||R===o||R===l||R===u||F||R===d||N||M||B||typeof R=="object"&&R!==null&&(R.$$typeof===p||R.$$typeof===f||R.$$typeof===i||R.$$typeof===c||R.$$typeof===a||R.$$typeof===g||R.getModuleId!==void 0))}function $(R,q,K){var ne=R.displayName;if(ne)return ne;var be=q.displayName||q.name||"";return be!==""?K+"("+be+")":K}function C(R){return R.displayName||"Context"}function O(R){if(R==null)return null;if(typeof R.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof R=="function")return R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof R=="object")switch(R.$$typeof){case c:var q=R;return C(q)+".Consumer";case i:var K=R;return C(K._context)+".Provider";case a:return $(R,R.render,"ForwardRef");case f:var ne=R.displayName||null;return ne!==null?ne:O(R.type)||"Memo";case p:{var be=R,ge=be._payload,le=be._init;try{return O(le(ge))}catch{return null}}}return null}var k=Object.assign,y=0,A,I,P,L,j,z,_;function H(){}H.__reactDisabledLog=!0;function Y(){{if(y===0){A=console.log,I=console.info,P=console.warn,L=console.error,j=console.group,z=console.groupCollapsed,_=console.groupEnd;var R={configurable:!0,enumerable:!0,value:H,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}y++}}function G(){{if(y--,y===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},R,{value:A}),info:k({},R,{value:I}),warn:k({},R,{value:P}),error:k({},R,{value:L}),group:k({},R,{value:j}),groupCollapsed:k({},R,{value:z}),groupEnd:k({},R,{value:_})})}y<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var W=T.ReactCurrentDispatcher,Z;function J(R,q,K){{if(Z===void 0)try{throw Error()}catch(be){var ne=be.stack.trim().match(/\n( *(at )?)/);Z=ne&&ne[1]||""}return`
18
- `+Z+R}}var ee=!1,fe;{var pe=typeof WeakMap=="function"?WeakMap:Map;fe=new pe}function he(R,q){if(!R||ee)return"";{var K=fe.get(R);if(K!==void 0)return K}var ne;ee=!0;var be=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ge;ge=W.current,W.current=null,Y();try{if(q){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(Xe){ne=Xe}Reflect.construct(R,[],le)}else{try{le.call()}catch(Xe){ne=Xe}R.call(le.prototype)}}else{try{throw Error()}catch(Xe){ne=Xe}R()}}catch(Xe){if(Xe&&ne&&typeof Xe.stack=="string"){for(var ce=Xe.stack.split(`
19
- `),Re=ne.stack.split(`
20
- `),Pe=ce.length-1,Te=Re.length-1;Pe>=1&&Te>=0&&ce[Pe]!==Re[Te];)Te--;for(;Pe>=1&&Te>=0;Pe--,Te--)if(ce[Pe]!==Re[Te]){if(Pe!==1||Te!==1)do if(Pe--,Te--,Te<0||ce[Pe]!==Re[Te]){var yt=`
21
- `+ce[Pe].replace(" at new "," at ");return R.displayName&&yt.includes("<anonymous>")&&(yt=yt.replace("<anonymous>",R.displayName)),typeof R=="function"&&fe.set(R,yt),yt}while(Pe>=1&&Te>=0);break}}}finally{ee=!1,W.current=ge,G(),Error.prepareStackTrace=be}var Dr=R?R.displayName||R.name:"",Jn=Dr?J(Dr):"";return typeof R=="function"&&fe.set(R,Jn),Jn}function se(R,q,K){return he(R,!1)}function me(R){var q=R.prototype;return!!(q&&q.isReactComponent)}function te(R,q,K){if(R==null)return"";if(typeof R=="function")return he(R,me(R));if(typeof R=="string")return J(R);switch(R){case l:return J("Suspense");case u:return J("SuspenseList")}if(typeof R=="object")switch(R.$$typeof){case a:return se(R.render);case f:return te(R.type,q,K);case p:{var ne=R,be=ne._payload,ge=ne._init;try{return te(ge(be),q,K)}catch{}}}return""}var Se=Object.prototype.hasOwnProperty,Nn={},gt=T.ReactDebugCurrentFrame;function hi(R){if(R){var q=R._owner,K=te(R.type,R._source,q?q.type:null);gt.setExtraStackFrame(K)}else gt.setExtraStackFrame(null)}function HS(R,q,K,ne,be){{var ge=Function.call.bind(Se);for(var le in R)if(ge(R,le)){var ce=void 0;try{if(typeof R[le]!="function"){var Re=Error((ne||"React class")+": "+K+" type `"+le+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof R[le]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Re.name="Invariant Violation",Re}ce=R[le](q,le,ne,K,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Pe){ce=Pe}ce&&!(ce instanceof Error)&&(hi(be),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",ne||"React class",K,le,typeof ce),hi(null)),ce instanceof Error&&!(ce.message in Nn)&&(Nn[ce.message]=!0,hi(be),E("Failed %s type: %s",K,ce.message),hi(null))}}}var VS=Array.isArray;function Sl(R){return VS(R)}function GS(R){{var q=typeof Symbol=="function"&&Symbol.toStringTag,K=q&&R[Symbol.toStringTag]||R.constructor.name||"Object";return K}}function qS(R){try{return Em(R),!1}catch{return!0}}function Em(R){return""+R}function Sm(R){if(qS(R))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",GS(R)),Em(R)}var Pm=T.ReactCurrentOwner,ZS={key:!0,ref:!0,__self:!0,__source:!0},Tm,Am;function KS(R){if(Se.call(R,"ref")){var q=Object.getOwnPropertyDescriptor(R,"ref").get;if(q&&q.isReactWarning)return!1}return R.ref!==void 0}function YS(R){if(Se.call(R,"key")){var q=Object.getOwnPropertyDescriptor(R,"key").get;if(q&&q.isReactWarning)return!1}return R.key!==void 0}function XS(R,q){typeof R.ref=="string"&&Pm.current}function QS(R,q){{var K=function(){Tm||(Tm=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",q))};K.isReactWarning=!0,Object.defineProperty(R,"key",{get:K,configurable:!0})}}function JS(R,q){{var K=function(){Am||(Am=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",q))};K.isReactWarning=!0,Object.defineProperty(R,"ref",{get:K,configurable:!0})}}var eP=function(R,q,K,ne,be,ge,le){var ce={$$typeof:t,type:R,key:q,ref:K,props:le,_owner:ge};return ce._store={},Object.defineProperty(ce._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ce,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ne}),Object.defineProperty(ce,"_source",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.freeze&&(Object.freeze(ce.props),Object.freeze(ce)),ce};function tP(R,q,K,ne,be){{var ge,le={},ce=null,Re=null;K!==void 0&&(Sm(K),ce=""+K),YS(q)&&(Sm(q.key),ce=""+q.key),KS(q)&&(Re=q.ref,XS(q,be));for(ge in q)Se.call(q,ge)&&!ZS.hasOwnProperty(ge)&&(le[ge]=q[ge]);if(R&&R.defaultProps){var Pe=R.defaultProps;for(ge in Pe)le[ge]===void 0&&(le[ge]=Pe[ge])}if(ce||Re){var Te=typeof R=="function"?R.displayName||R.name||"Unknown":R;ce&&QS(le,Te),Re&&JS(le,Te)}return eP(R,ce,Re,be,ne,Pm.current,le)}}var Pl=T.ReactCurrentOwner,$m=T.ReactDebugCurrentFrame;function kr(R){if(R){var q=R._owner,K=te(R.type,R._source,q?q.type:null);$m.setExtraStackFrame(K)}else $m.setExtraStackFrame(null)}var Tl;Tl=!1;function Al(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function Cm(){{if(Pl.current){var R=O(Pl.current.type);if(R)return`
17
+ */var Ul;function Hm(){return Ul||(Ul=1,process.env.NODE_ENV!=="production"&&function(){var e=E,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,b="@@iterator";function S(R){if(R===null||typeof R!="object")return null;var Z=h&&R[h]||R[b];return typeof Z=="function"?Z:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(R){{for(var Z=arguments.length,Y=new Array(Z>1?Z-1:0),re=1;re<Z;re++)Y[re-1]=arguments[re];w("error",R,Y)}}function w(R,Z,Y){{var re=P.ReactDebugCurrentFrame,be=re.getStackAddendum();be!==""&&(Z+="%s",Y=Y.concat([be]));var ge=Y.map(function(ue){return String(ue)});ge.unshift("Warning: "+Z),Function.prototype.apply.call(console[R],console,ge)}}var $=!1,k=!1,B=!1,F=!1,m=!1,g;g=Symbol.for("react.module.reference");function v(R){return!!(typeof R=="string"||typeof R=="function"||R===r||R===s||m||R===o||R===l||R===u||F||R===p||$||k||B||typeof R=="object"&&R!==null&&(R.$$typeof===d||R.$$typeof===f||R.$$typeof===i||R.$$typeof===c||R.$$typeof===a||R.$$typeof===g||R.getModuleId!==void 0))}function A(R,Z,Y){var re=R.displayName;if(re)return re;var be=Z.displayName||Z.name||"";return be!==""?Y+"("+be+")":Y}function N(R){return R.displayName||"Context"}function O(R){if(R==null)return null;if(typeof R.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof R=="function")return R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof R=="object")switch(R.$$typeof){case c:var Z=R;return N(Z)+".Consumer";case i:var Y=R;return N(Y._context)+".Provider";case a:return A(R,R.render,"ForwardRef");case f:var re=R.displayName||null;return re!==null?re:O(R.type)||"Memo";case d:{var be=R,ge=be._payload,ue=be._init;try{return O(ue(ge))}catch{return null}}}return null}var D=Object.assign,y=0,C,I,T,L,j,z,_;function W(){}W.__reactDisabledLog=!0;function K(){{if(y===0){C=console.log,I=console.info,T=console.warn,L=console.error,j=console.group,z=console.groupCollapsed,_=console.groupEnd;var R={configurable:!0,enumerable:!0,value:W,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}y++}}function G(){{if(y--,y===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},R,{value:C}),info:D({},R,{value:I}),warn:D({},R,{value:T}),error:D({},R,{value:L}),group:D({},R,{value:j}),groupCollapsed:D({},R,{value:z}),groupEnd:D({},R,{value:_})})}y<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=P.ReactCurrentDispatcher,q;function Q(R,Z,Y){{if(q===void 0)try{throw Error()}catch(be){var re=be.stack.trim().match(/\n( *(at )?)/);q=re&&re[1]||""}return`
18
+ `+q+R}}var ee=!1,pe;{var le=typeof WeakMap=="function"?WeakMap:Map;pe=new le}function he(R,Z){if(!R||ee)return"";{var Y=pe.get(R);if(Y!==void 0)return Y}var re;ee=!0;var be=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ge;ge=H.current,H.current=null,K();try{if(Z){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(Je){re=Je}Reflect.construct(R,[],ue)}else{try{ue.call()}catch(Je){re=Je}R.call(ue.prototype)}}else{try{throw Error()}catch(Je){re=Je}R()}}catch(Je){if(Je&&re&&typeof Je.stack=="string"){for(var ce=Je.stack.split(`
19
+ `),Re=re.stack.split(`
20
+ `),Pe=ce.length-1,Te=Re.length-1;Pe>=1&&Te>=0&&ce[Pe]!==Re[Te];)Te--;for(;Pe>=1&&Te>=0;Pe--,Te--)if(ce[Pe]!==Re[Te]){if(Pe!==1||Te!==1)do if(Pe--,Te--,Te<0||ce[Pe]!==Re[Te]){var wt=`
21
+ `+ce[Pe].replace(" at new "," at ");return R.displayName&&wt.includes("<anonymous>")&&(wt=wt.replace("<anonymous>",R.displayName)),typeof R=="function"&&pe.set(R,wt),wt}while(Pe>=1&&Te>=0);break}}}finally{ee=!1,H.current=ge,G(),Error.prepareStackTrace=be}var _r=R?R.displayName||R.name:"",rr=_r?Q(_r):"";return typeof R=="function"&&pe.set(R,rr),rr}function ie(R,Z,Y){return he(R,!1)}function me(R){var Z=R.prototype;return!!(Z&&Z.isReactComponent)}function ne(R,Z,Y){if(R==null)return"";if(typeof R=="function")return he(R,me(R));if(typeof R=="string")return Q(R);switch(R){case l:return Q("Suspense");case u:return Q("SuspenseList")}if(typeof R=="object")switch(R.$$typeof){case a:return ie(R.render);case f:return ne(R.type,Z,Y);case d:{var re=R,be=re._payload,ge=re._init;try{return ne(ge(be),Z,Y)}catch{}}}return""}var Se=Object.prototype.hasOwnProperty,Dn={},vt=P.ReactDebugCurrentFrame;function Ti(R){if(R){var Z=R._owner,Y=ne(R.type,R._source,Z?Z.type:null);vt.setExtraStackFrame(Y)}else vt.setExtraStackFrame(null)}function oP(R,Z,Y,re,be){{var ge=Function.call.bind(Se);for(var ue in R)if(ge(R,ue)){var ce=void 0;try{if(typeof R[ue]!="function"){var Re=Error((re||"React class")+": "+Y+" type `"+ue+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof R[ue]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Re.name="Invariant Violation",Re}ce=R[ue](Z,ue,re,Y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Pe){ce=Pe}ce&&!(ce instanceof Error)&&(Ti(be),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",re||"React class",Y,ue,typeof ce),Ti(null)),ce instanceof Error&&!(ce.message in Dn)&&(Dn[ce.message]=!0,Ti(be),x("Failed %s type: %s",Y,ce.message),Ti(null))}}}var sP=Array.isArray;function Ml(R){return sP(R)}function iP(R){{var Z=typeof Symbol=="function"&&Symbol.toStringTag,Y=Z&&R[Symbol.toStringTag]||R.constructor.name||"Object";return Y}}function aP(R){try{return Cm(R),!1}catch{return!0}}function Cm(R){return""+R}function Om(R){if(aP(R))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",iP(R)),Cm(R)}var Im=P.ReactCurrentOwner,cP={key:!0,ref:!0,__self:!0,__source:!0},Dm,Mm;function lP(R){if(Se.call(R,"ref")){var Z=Object.getOwnPropertyDescriptor(R,"ref").get;if(Z&&Z.isReactWarning)return!1}return R.ref!==void 0}function uP(R){if(Se.call(R,"key")){var Z=Object.getOwnPropertyDescriptor(R,"key").get;if(Z&&Z.isReactWarning)return!1}return R.key!==void 0}function fP(R,Z){typeof R.ref=="string"&&Im.current}function dP(R,Z){{var Y=function(){Dm||(Dm=!0,x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Z))};Y.isReactWarning=!0,Object.defineProperty(R,"key",{get:Y,configurable:!0})}}function pP(R,Z){{var Y=function(){Mm||(Mm=!0,x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Z))};Y.isReactWarning=!0,Object.defineProperty(R,"ref",{get:Y,configurable:!0})}}var hP=function(R,Z,Y,re,be,ge,ue){var ce={$$typeof:t,type:R,key:Z,ref:Y,props:ue,_owner:ge};return ce._store={},Object.defineProperty(ce._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ce,"_self",{configurable:!1,enumerable:!1,writable:!1,value:re}),Object.defineProperty(ce,"_source",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.freeze&&(Object.freeze(ce.props),Object.freeze(ce)),ce};function mP(R,Z,Y,re,be){{var ge,ue={},ce=null,Re=null;Y!==void 0&&(Om(Y),ce=""+Y),uP(Z)&&(Om(Z.key),ce=""+Z.key),lP(Z)&&(Re=Z.ref,fP(Z,be));for(ge in Z)Se.call(Z,ge)&&!cP.hasOwnProperty(ge)&&(ue[ge]=Z[ge]);if(R&&R.defaultProps){var Pe=R.defaultProps;for(ge in Pe)ue[ge]===void 0&&(ue[ge]=Pe[ge])}if(ce||Re){var Te=typeof R=="function"?R.displayName||R.name||"Unknown":R;ce&&dP(ue,Te),Re&&pP(ue,Te)}return hP(R,ce,Re,be,re,Im.current,ue)}}var kl=P.ReactCurrentOwner,km=P.ReactDebugCurrentFrame;function jr(R){if(R){var Z=R._owner,Y=ne(R.type,R._source,Z?Z.type:null);km.setExtraStackFrame(Y)}else km.setExtraStackFrame(null)}var Ll;Ll=!1;function Bl(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function Lm(){{if(kl.current){var R=O(kl.current.type);if(R)return`
22
22
 
23
- Check the render method of \``+R+"`."}return""}}function nP(R){return""}var Nm={};function rP(R){{var q=Cm();if(!q){var K=typeof R=="string"?R:R.displayName||R.name;K&&(q=`
23
+ Check the render method of \``+R+"`."}return""}}function bP(R){return""}var Bm={};function gP(R){{var Z=Lm();if(!Z){var Y=typeof R=="string"?R:R.displayName||R.name;Y&&(Z=`
24
24
 
25
- Check the top-level render call using <`+K+">.")}return q}}function Om(R,q){{if(!R._store||R._store.validated||R.key!=null)return;R._store.validated=!0;var K=rP(q);if(Nm[K])return;Nm[K]=!0;var ne="";R&&R._owner&&R._owner!==Pl.current&&(ne=" It was passed a child from "+O(R._owner.type)+"."),kr(R),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',K,ne),kr(null)}}function Im(R,q){{if(typeof R!="object")return;if(Sl(R))for(var K=0;K<R.length;K++){var ne=R[K];Al(ne)&&Om(ne,q)}else if(Al(R))R._store&&(R._store.validated=!0);else if(R){var be=v(R);if(typeof be=="function"&&be!==R.entries)for(var ge=be.call(R),le;!(le=ge.next()).done;)Al(le.value)&&Om(le.value,q)}}}function oP(R){{var q=R.type;if(q==null||typeof q=="string")return;var K;if(typeof q=="function")K=q.propTypes;else if(typeof q=="object"&&(q.$$typeof===a||q.$$typeof===f))K=q.propTypes;else return;if(K){var ne=O(q);HS(K,R.props,"prop",ne,R)}else if(q.PropTypes!==void 0&&!Tl){Tl=!0;var be=O(q);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",be||"Unknown")}typeof q.getDefaultProps=="function"&&!q.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sP(R){{for(var q=Object.keys(R.props),K=0;K<q.length;K++){var ne=q[K];if(ne!=="children"&&ne!=="key"){kr(R),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ne),kr(null);break}}R.ref!==null&&(kr(R),E("Invalid attribute `ref` supplied to `React.Fragment`."),kr(null))}}var km={};function Dm(R,q,K,ne,be,ge){{var le=w(R);if(!le){var ce="";(R===void 0||typeof R=="object"&&R!==null&&Object.keys(R).length===0)&&(ce+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Re=nP();Re?ce+=Re:ce+=Cm();var Pe;R===null?Pe="null":Sl(R)?Pe="array":R!==void 0&&R.$$typeof===t?(Pe="<"+(O(R.type)||"Unknown")+" />",ce=" Did you accidentally export a JSX literal instead of a component?"):Pe=typeof R,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Pe,ce)}var Te=tP(R,q,K,be,ge);if(Te==null)return Te;if(le){var yt=q.children;if(yt!==void 0)if(ne)if(Sl(yt)){for(var Dr=0;Dr<yt.length;Dr++)Im(yt[Dr],R);Object.freeze&&Object.freeze(yt)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Im(yt,R)}if(Se.call(q,"key")){var Jn=O(R),Xe=Object.keys(q).filter(function(fP){return fP!=="key"}),$l=Xe.length>0?"{key: someKey, "+Xe.join(": ..., ")+": ...}":"{key: someKey}";if(!km[Jn+$l]){var uP=Xe.length>0?"{"+Xe.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+Y+">.")}return Z}}function Fm(R,Z){{if(!R._store||R._store.validated||R.key!=null)return;R._store.validated=!0;var Y=gP(Z);if(Bm[Y])return;Bm[Y]=!0;var re="";R&&R._owner&&R._owner!==kl.current&&(re=" It was passed a child from "+O(R._owner.type)+"."),jr(R),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Y,re),jr(null)}}function Rm(R,Z){{if(typeof R!="object")return;if(Ml(R))for(var Y=0;Y<R.length;Y++){var re=R[Y];Bl(re)&&Fm(re,Z)}else if(Bl(R))R._store&&(R._store.validated=!0);else if(R){var be=S(R);if(typeof be=="function"&&be!==R.entries)for(var ge=be.call(R),ue;!(ue=ge.next()).done;)Bl(ue.value)&&Fm(ue.value,Z)}}}function yP(R){{var Z=R.type;if(Z==null||typeof Z=="string")return;var Y;if(typeof Z=="function")Y=Z.propTypes;else if(typeof Z=="object"&&(Z.$$typeof===a||Z.$$typeof===f))Y=Z.propTypes;else return;if(Y){var re=O(Z);oP(Y,R.props,"prop",re,R)}else if(Z.PropTypes!==void 0&&!Ll){Ll=!0;var be=O(Z);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",be||"Unknown")}typeof Z.getDefaultProps=="function"&&!Z.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vP(R){{for(var Z=Object.keys(R.props),Y=0;Y<Z.length;Y++){var re=Z[Y];if(re!=="children"&&re!=="key"){jr(R),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",re),jr(null);break}}R.ref!==null&&(jr(R),x("Invalid attribute `ref` supplied to `React.Fragment`."),jr(null))}}var jm={};function _m(R,Z,Y,re,be,ge){{var ue=v(R);if(!ue){var ce="";(R===void 0||typeof R=="object"&&R!==null&&Object.keys(R).length===0)&&(ce+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Re=bP();Re?ce+=Re:ce+=Lm();var Pe;R===null?Pe="null":Ml(R)?Pe="array":R!==void 0&&R.$$typeof===t?(Pe="<"+(O(R.type)||"Unknown")+" />",ce=" Did you accidentally export a JSX literal instead of a component?"):Pe=typeof R,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Pe,ce)}var Te=mP(R,Z,Y,be,ge);if(Te==null)return Te;if(ue){var wt=Z.children;if(wt!==void 0)if(re)if(Ml(wt)){for(var _r=0;_r<wt.length;_r++)Rm(wt[_r],R);Object.freeze&&Object.freeze(wt)}else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Rm(wt,R)}if(Se.call(Z,"key")){var rr=O(R),Je=Object.keys(Z).filter(function(TP){return TP!=="key"}),Fl=Je.length>0?"{key: someKey, "+Je.join(": ..., ")+": ...}":"{key: someKey}";if(!jm[rr+Fl]){var PP=Je.length>0?"{"+Je.join(": ..., ")+": ...}":"{}";x(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,$l,Jn,uP,Jn),km[Jn+$l]=!0}}return R===r?sP(Te):oP(Te),Te}}function iP(R,q,K){return Dm(R,q,K,!0)}function aP(R,q,K){return Dm(R,q,K,!1)}var cP=aP,lP=iP;Br.Fragment=r,Br.jsx=cP,Br.jsxs=lP}()),Br}process.env.NODE_ENV==="production"?mi.exports=Bm():mi.exports=Fm();var D=mi.exports;const Rm={deposit:{title:"Einzahlen",chain:"Chain",asset:"Asset",amount:"Betrag",available:"Verfügbar",equity:"Eigenkapital",confirmDeposit:"Einzahlung bestätigen",switchNetwork:"Netzwerk wechseln",max:"Max.",arrivalTime:"Ankunftszeit",ethCrossChainDepositInitiated:"ETH-Cross-Chain-Einzahlung initiiert. Voraussichtliche Ankunft in 2 bis 5 Minuten.",minDeposit:"Mindestbetrag der Einzahlung",minDepositParsed:"Min. {{amount}} {{token}} einzahlen",maxDeposit:"Maximaler Einzahlungsbetrag",depositTipFor25w:"Der Höchstbetrag pro Einzahlung beträgt 200.000. Wenn deine Einzahlung 200.000 übersteigt, verwende bitte die Ethereum-Chain.",depositAllTip:`Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt.
30
+ <%s key={someKey} {...props} />`,Fl,rr,PP,rr),jm[rr+Fl]=!0}}return R===r?vP(Te):yP(Te),Te}}function wP(R,Z,Y){return _m(R,Z,Y,!0)}function xP(R,Z,Y){return _m(R,Z,Y,!1)}var EP=xP,SP=wP;Wr.Fragment=r,Wr.jsx=EP,Wr.jsxs=SP}()),Wr}process.env.NODE_ENV==="production"?$i.exports=Wm():$i.exports=Hm();var M=$i.exports;const Vm={deposit:{title:"Einzahlen",chain:"Chain",asset:"Asset",amount:"Betrag",available:"Verfügbar",equity:"Eigenkapital",confirmDeposit:"Einzahlung bestätigen",switchNetwork:"Netzwerk wechseln",max:"Max.",arrivalTime:"Ankunftszeit",ethCrossChainDepositInitiated:"ETH-Cross-Chain-Einzahlung initiiert. Voraussichtliche Ankunft in 2 bis 5 Minuten.",minDeposit:"Mindestbetrag der Einzahlung",minDepositParsed:"Min. {{amount}} {{token}} einzahlen",maxDeposit:"Maximaler Einzahlungsbetrag",depositTipFor25w:"Der Höchstbetrag pro Einzahlung beträgt 200.000. Wenn deine Einzahlung 200.000 übersteigt, verwende bitte die Ethereum-Chain.",depositAllTip:`Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt.
31
31
  Wenn der Einzahlungsbetrag 200.000 übersteigt, kann es zu einer Verzögerung der Ankunftszeit kommen. Bitte hab etwas Geduld.`,maxDepositSplitTip:"Der Höchstbetrag pro Einzahlung beträgt 200.000. Falls du mehr als 200.000 einzahlen musst, teile den Betrag bitte in mehrere Einzahlungen auf.",spotDepositNotSupportedTip:"Einzahlungen werden nicht unterstützt. Bitte zahle auf das Perpetual-Konto ein und überweise den Betrag anschließend.",crossChainDepositFeeTip:`Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt.
32
- Bei Chain-übergreifenden Einzahlungen musst du die Edge-Gas-Gebühr zahlen. Der gutgeschriebene Betrag wird etwas geringer sein als dein Einzahlungsbetrag.`,addressUpdatedNotice:"Hinweis: Deine Einzahlungsadresse wurde aktualisiert. Verwende die neue Adresse. Die alte Adresse funktioniert nur während der Übergangszeit und wird dann deaktiviert. Wenn sie an einem anderen Ort gespeichert wurde, aktualisiere sie umgehend.",enableSystemProWithToken:"{{token}} auf {{network}} aktivieren",enableTokenDesc:"Bei der ersten Einzahlung auf {{network}} musst du {{token}} aktivieren.",enableWithToken:"{{token}} aktivieren",arrivaltimeTooltip1:"Die Gelder kommen in etwa {{v}} Minuten an (nach Erreichen von {{v1}} Blockbestätigungen).",arrivaltimeTooltip2:"Die geschätzte Zeit wird auf der Grundlage historischer Daten berechnet und dient nur als Referenz. Eine Überlastung des Netzwerks kann zu längeren tatsächlichen Ankunftszeiten führen.",arrivalEstimated:"≈ {{v}} Minuten",availableDesc:"Der maximale Betrag, den du einzahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Einzahlungen vorgenommen werden.",noPrivateKeyWalletWarning:"Verwende für Einzahlungen keine schlüssellosen Wallets. Einzahlungen mit einer schlüssellosen Wallet können zu einem unwiderruflichen Verlust der Gelder führen.",layerZeroDepositTip:"Das System wird deine Einzahlung über LayerZero auf Basis der tatsächlichen Einzahlungsbedingungen abschließen.",layerZeroDepositTipExceedPool:"Da der Einzahlungsbetrag den Pool übersteigt, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositTipGte200k:"Da der Einzahlungsbetrag größer als oder gleich 200.000 USDT ist, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositButton:"Mit LayerZero einzahlen",defaultSpotNotice:"Standardeinzahlungen werden dem Spot-Konto gutgeschrieben.",defaultSpotToPerpNotice:"Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt. Standardeinzahlungen werden dem Spot-Konto gutgeschrieben. Überweise Gelder vom Spot-Konto auf das Futures-Konto, um das Futures-Konto zu finanzieren."},withdraw:{noticeDesc:"Normale Auszahlungen erfolgen in zwei Schritten. Im aktuellen Schritt wird dein Auszahlungsantrag eingeleitet und auf Layer 2 bearbeitet. Sobald deine Gelder zur Verfügung stehen (dies kann bis zu 4 Stunden dauern), erhältst du eine Benachrichtigung, um deine Gelder in deine Wallet auszuzahlen. Aufgrund der Chain-Synchronisierung und anderer Faktoren kann die Dauer bis zu 48 Stunden betragen. Du bist für alle Gas-Gebühren der Transaktion verantwortlich.",crossChainTips:"Bei Chain-übergreifenden Auszahlungen ist eine Verifizierung über L2 (über ZK-Proofs) erforderlich. Die Auszahlung kann bis zu 2 Stunden dauern. Für die Abwicklung von Chain-übergreifenden Auszahlungen sind ausreichende Mittel im Asset-Pool der entsprechenden Chain erforderlich. Außerdem fallen Gas-Gebühren an. edgeX erhebt eine Gebühr zur Deckung dieser Kosten.",commonWithdraw:"FAQ zu Auszahlungen",withdraw:"Auszahlen",speed:"Geschwindigkeit",confirmWithdraw:"Auszahlung bestätigen",speedNote:"Bearbeitungszeiten:",speedNoteSpeed1:"Ca. 8 Minuten",speedNoteSpeed2:"Ca. 2-4 Stunden",speedNoteSpeed3:"Ca. 4 Stunden",receiverAddress:"Empfängeradresse",fee:"Gebühr",feeRate:"Gebührensatz",withdrawlAmount:"Auszahlungsbetrag",amountToReceive:"Zu erhaltender Betrag",minWithdraw:"Mindestauszahlungsbetrag",minWithdrawParsed:"Min. Auszahlung {{amount}} {{token}}",invalidReceiverAddress:"Die Adresse darf nicht leer sein.",availableDesc:"Der maximale Betrag, den du auszahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Auszahlungen vorgenommen werden.",feeCalculationTip:"Die Auszahlungsgebühren werden berechnet, indem der Auszahlungsbetrag mit dem Gebührensatz multipliziert wird. Der Mindestbetrag liegt bei 1 USDT/USDC. Der Gebührensatz kann auf Basis der tatsächlichen On-chain-Bedingungen angepasst werden.",crossChainPoolBalance:"Guthaben des Cross-Chain-Pools",poolBalance:"Pool-Guthaben",poolBalanceInsufficientTip:"Da der Auszahlungsbetrag das Pool-Guthaben übersteigt, kann die Auszahlung nicht bearbeitet werden. Bitte wähle eine Option mit ausreichendem Pool-Guthaben."},account:{title:"Konto",perpetual:"Perpetual-Konto",spot:"Spot-Konto"}},jm={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",max:"Max",arrivalTime:"Arrival Time",ethCrossChainDepositInitiated:"ETH cross-chain deposit initiated. Estimated arrival in 2–5 minutes.",minDeposit:"Minimum Deposit Amount",minDepositParsed:"Min. Deposit {{amount}} {{token}}",maxDeposit:"Maximum Deposit Amount",depositTipFor25w:"The maximum amount per deposit is 200,000. If your deposit exceeds 200,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
32
+ Bei Chain-übergreifenden Einzahlungen musst du die Edge-Gas-Gebühr zahlen. Der gutgeschriebene Betrag wird etwas geringer sein als dein Einzahlungsbetrag.`,addressUpdatedNotice:"Hinweis: Deine Einzahlungsadresse wurde aktualisiert. Verwende die neue Adresse. Die alte Adresse funktioniert nur während der Übergangszeit und wird dann deaktiviert. Wenn sie an einem anderen Ort gespeichert wurde, aktualisiere sie umgehend.",enableSystemProWithToken:"{{token}} auf {{network}} aktivieren",enableTokenDesc:"Bei der ersten Einzahlung auf {{network}} musst du {{token}} aktivieren.",enableWithToken:"{{token}} aktivieren",arrivaltimeTooltip1:"Die Gelder kommen in etwa {{v}} Minuten an (nach Erreichen von {{v1}} Blockbestätigungen).",arrivaltimeTooltip2:"Die geschätzte Zeit wird auf der Grundlage historischer Daten berechnet und dient nur als Referenz. Eine Überlastung des Netzwerks kann zu längeren tatsächlichen Ankunftszeiten führen.",arrivalEstimated:"≈ {{v}} Minuten",availableDesc:"Der maximale Betrag, den du einzahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Einzahlungen vorgenommen werden.",noPrivateKeyWalletWarning:"Verwende für Einzahlungen keine schlüssellosen Wallets. Einzahlungen mit einer schlüssellosen Wallet können zu einem unwiderruflichen Verlust der Gelder führen.",layerZeroDepositTip:"Das System wird deine Einzahlung über LayerZero auf Basis der tatsächlichen Einzahlungsbedingungen abschließen.",layerZeroDepositTipExceedPool:"Da der Einzahlungsbetrag den Pool übersteigt, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositTipGte200k:"Da der Einzahlungsbetrag größer als oder gleich 200.000 USDT ist, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositButton:"Mit LayerZero einzahlen",defaultSpotNotice:"Standardeinzahlungen werden dem Spot-Konto gutgeschrieben.",defaultSpotToPerpNotice:"Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt. Standardeinzahlungen werden dem Spot-Konto gutgeschrieben. Überweise Gelder vom Spot-Konto auf das Futures-Konto, um das Futures-Konto zu finanzieren."},withdraw:{noticeDesc:"Normale Auszahlungen erfolgen in zwei Schritten. Im aktuellen Schritt wird dein Auszahlungsantrag eingeleitet und auf Layer 2 bearbeitet. Sobald deine Gelder zur Verfügung stehen (dies kann bis zu 4 Stunden dauern), erhältst du eine Benachrichtigung, um deine Gelder in deine Wallet auszuzahlen. Aufgrund der Chain-Synchronisierung und anderer Faktoren kann die Dauer bis zu 48 Stunden betragen. Du bist für alle Gas-Gebühren der Transaktion verantwortlich.",crossChainTips:"Bei Chain-übergreifenden Auszahlungen ist eine Verifizierung über L2 (über ZK-Proofs) erforderlich. Die Auszahlung kann bis zu 2 Stunden dauern. Für die Abwicklung von Chain-übergreifenden Auszahlungen sind ausreichende Mittel im Asset-Pool der entsprechenden Chain erforderlich. Außerdem fallen Gas-Gebühren an. edgeX erhebt eine Gebühr zur Deckung dieser Kosten.",commonWithdraw:"FAQ zu Auszahlungen",withdraw:"Auszahlen",speed:"Geschwindigkeit",confirmWithdraw:"Auszahlung bestätigen",speedNote:"Bearbeitungszeiten:",speedNoteSpeed1:"Ca. 8 Minuten",speedNoteSpeed2:"Ca. 2-4 Stunden",speedNoteSpeed3:"Ca. 4 Stunden",receiverAddress:"Empfängeradresse",fee:"Gebühr",feeRate:"Gebührensatz",withdrawlAmount:"Auszahlungsbetrag",amountToReceive:"Zu erhaltender Betrag",minWithdraw:"Mindestauszahlungsbetrag",minWithdrawParsed:"Min. Auszahlung {{amount}} {{token}}",invalidReceiverAddress:"Die Adresse darf nicht leer sein.",availableDesc:"Der maximale Betrag, den du auszahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Auszahlungen vorgenommen werden.",feeCalculationTip:"Die Auszahlungsgebühren werden berechnet, indem der Auszahlungsbetrag mit dem Gebührensatz multipliziert wird. Der Mindestbetrag liegt bei 1 USDT/USDC. Der Gebührensatz kann auf Basis der tatsächlichen On-chain-Bedingungen angepasst werden.",crossChainPoolBalance:"Guthaben des Cross-Chain-Pools",poolBalance:"Pool-Guthaben",poolBalanceInsufficientTip:"Da der Auszahlungsbetrag das Pool-Guthaben übersteigt, kann die Auszahlung nicht bearbeitet werden. Bitte wähle eine Option mit ausreichendem Pool-Guthaben."},account:{title:"Konto",perpetual:"Perpetual-Konto",spot:"Spot-Konto"}},Gm={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",max:"Max",arrivalTime:"Arrival Time",ethCrossChainDepositInitiated:"ETH cross-chain deposit initiated. Estimated arrival in 2–5 minutes.",minDeposit:"Minimum Deposit Amount",minDepositParsed:"Min. Deposit {{amount}} {{token}}",maxDeposit:"Maximum Deposit Amount",depositTipFor25w:"The maximum amount per deposit is 200,000. If your deposit exceeds 200,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
33
33
  If the deposit amount exceeds 200,000, there may be a delay in the arrival time. Please be patient.`,maxDepositSplitTip:"The maximum amount per deposit is 200,000. If you need to deposit more than 200,000, please split it into multiple deposits.",spotDepositNotSupportedTip:"Deposits aren't supported. Please deposit to perpetual account, then transfer.",crossChainDepositFeeTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
34
- Cross-chain deposits require you to pay the Edge gas fee. The credited amount will be slightly less than your deposit amount.`,addressUpdatedNotice:"Notice: Your deposit address has been updated. Use the new address. The old one works only during the transition and will be disabled. If saved elsewhere, update it promptly.",enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"The funds will arrive in approximately {{v}} minutes (after reaching {{v1}} block confirmations).",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"The maximum amount you can deposit. When the available balance is 0 or negative, deposits cannot be made.",noPrivateKeyWalletWarning:"Do not use keyless wallets to make deposits. Depositing with a keyless wallet may result in irreversible loss of funds.",layerZeroDepositTip:"The system will complete your deposit via LayerZero based on the actual deposit conditions.",layerZeroDepositTipExceedPool:"Since the deposit amount exceeds the pool, your deposit will be completed via LayerZero.",layerZeroDepositTipGte200k:"Since the deposit amount is greater than or equal to 200,000 USDT, your deposit will be completed via LayerZero.",layerZeroDepositButton:"Deposit with LayerZero",defaultSpotNotice:"Default deposits go to the spot account.",defaultSpotToPerpNotice:"Only {{coin}} ({{v}}) is supported for deposits to this address. Default deposits go to the spot account. To fund the futures account, transfer from the spot account to the futures account."},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",feeRate:"Fee Rate",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",minWithdraw:"Minimum Withdrawal Amount",minWithdrawParsed:"Min. Withdrawal {{amount}} {{token}}",invalidReceiverAddress:"Address cannot be empty",availableDesc:"The maximum amount you can withdraw. When the available balance is 0 or negative, withdrawals cannot be made.",feeCalculationTip:"Withdrawal fees are calculated by multiplying the withdrawal amount by the fee rate, with a minimum of 1 USDT/USDC. The fee rate may be adjusted based on actual on-chain conditions.",crossChainPoolBalance:"Cross-chain pool balance",poolBalance:"Pool balance",poolBalanceInsufficientTip:"The withdrawal amount exceeds the fund pool balance, and the withdrawal cannot be processed. Please select an option with a sufficient fund pool balance."},account:{title:"Account",perpetual:"Perpetual Account",spot:"Spot Account"}},_m={deposit:{title:"Depósito",chain:"Cadena",asset:"Activo",amount:"Monto",available:"Disponible",equity:"Capital",confirmDeposit:"Confirmar depósito",switchNetwork:"Cambiar de red",max:"Máx.",arrivalTime:"Hora de llegada",ethCrossChainDepositInitiated:"Se inició el depósito entre cadenas de ETH. Llegada estimada en 2 a 5 minutos.",minDeposit:"Monto mínimo de depósito",minDepositParsed:"Mín. de depósito: {{amount}} {{token}}",maxDeposit:"Monto máximo de depósito",depositTipFor25w:"El monto máximo por depósito es de 200,000. Si tu depósito supera los 200,000, usa la cadena Ethereum.",depositAllTip:`Esta dirección solo admite depósitos en {{coin}} ({{v}})
34
+ Cross-chain deposits require you to pay the Edge gas fee. The credited amount will be slightly less than your deposit amount.`,addressUpdatedNotice:"Notice: Your deposit address has been updated. Use the new address. The old one works only during the transition and will be disabled. If saved elsewhere, update it promptly.",enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"The funds will arrive in approximately {{v}} minutes (after reaching {{v1}} block confirmations).",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"The maximum amount you can deposit. When the available balance is 0 or negative, deposits cannot be made.",noPrivateKeyWalletWarning:"Do not use keyless wallets to make deposits. Depositing with a keyless wallet may result in irreversible loss of funds.",layerZeroDepositTip:"The system will complete your deposit via LayerZero based on the actual deposit conditions.",layerZeroDepositTipExceedPool:"Since the deposit amount exceeds the pool, your deposit will be completed via LayerZero.",layerZeroDepositTipGte200k:"Since the deposit amount is greater than or equal to 200,000 USDT, your deposit will be completed via LayerZero.",layerZeroDepositButton:"Deposit with LayerZero",defaultSpotNotice:"Default deposits go to the spot account.",defaultSpotToPerpNotice:"Only {{coin}} ({{v}}) is supported for deposits to this address. Default deposits go to the spot account. To fund the futures account, transfer from the spot account to the futures account."},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",feeRate:"Fee Rate",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",minWithdraw:"Minimum Withdrawal Amount",minWithdrawParsed:"Min. Withdrawal {{amount}} {{token}}",invalidReceiverAddress:"Address cannot be empty",availableDesc:"The maximum amount you can withdraw. When the available balance is 0 or negative, withdrawals cannot be made.",feeCalculationTip:"Withdrawal fees are calculated by multiplying the withdrawal amount by the fee rate, with a minimum of 1 USDT/USDC. The fee rate may be adjusted based on actual on-chain conditions.",crossChainPoolBalance:"Cross-chain pool balance",poolBalance:"Pool balance",poolBalanceInsufficientTip:"The withdrawal amount exceeds the fund pool balance, and the withdrawal cannot be processed. Please select an option with a sufficient fund pool balance."},account:{title:"Account",perpetual:"Perpetual Account",spot:"Spot Account"}},qm={deposit:{title:"Depósito",chain:"Cadena",asset:"Activo",amount:"Monto",available:"Disponible",equity:"Capital",confirmDeposit:"Confirmar depósito",switchNetwork:"Cambiar de red",max:"Máx.",arrivalTime:"Hora de llegada",ethCrossChainDepositInitiated:"Se inició el depósito entre cadenas de ETH. Llegada estimada en 2 a 5 minutos.",minDeposit:"Monto mínimo de depósito",minDepositParsed:"Mín. de depósito: {{amount}} {{token}}",maxDeposit:"Monto máximo de depósito",depositTipFor25w:"El monto máximo por depósito es de 200,000. Si tu depósito supera los 200,000, usa la cadena Ethereum.",depositAllTip:`Esta dirección solo admite depósitos en {{coin}} ({{v}})
35
35
  Si el monto del depósito supera los 200,000, puede haber un retraso en la hora de llegada. Ten paciencia.`,maxDepositSplitTip:"El monto máximo por depósito es de 200,000. Si necesitas depositar más de 200,000, divídelo en varios depósitos.",spotDepositNotSupportedTip:"No se admiten depósitos. Deposita en la cuenta de perpetuos y luego haz la transferencia.",crossChainDepositFeeTip:`Esta dirección solo admite depósitos en {{coin}} ({{v}})
36
- Los depósitos entre cadenas requieren el pago de la comisión de gas de Edge. El monto acreditado será ligeramente inferior al monto depositado.`,addressUpdatedNotice:"Aviso: Se actualizó tu dirección de depósito. Usa esta nueva dirección. La anterior solo funciona durante la transición y pronto se desactivará. Si la tienes guardada en otros dispositivos, actualízala lo antes posible.",enableSystemProWithToken:"Habilitar {{token}} en {{network}}",enableTokenDesc:"Debes habilitar {{token}} la primera vez que deposites en {{network}}.",enableWithToken:"Habilitar {{token}}",arrivaltimeTooltip1:"Los fondos se acreditarán en aproximadamente {{v}} minutos (tras obtener {{v1}} confirmaciones de bloque).",arrivaltimeTooltip2:"El tiempo estimado se calcula a partir de datos históricos y es solo de referencia. La congestión de la red puede ocasionar tiempos de acreditación más largos.",arrivalEstimated:"Aprox. {{v}} minutos",availableDesc:"Lo máximo que puedes depositar. Si el saldo disponible es 0 o negativo, los depósitos no están permitidos.",noPrivateKeyWalletWarning:"No uses billeteras sin clave para realizar depósitos. Existe el riesgo de una pérdida irreversible de los fondos.",layerZeroDepositTip:"El sistema completará tu depósito a través de LayerZero según las condiciones de depósito reales.",layerZeroDepositTipExceedPool:"Dado que el importe del depósito supera el pool, tu depósito se completará a través de LayerZero.",layerZeroDepositTipGte200k:"El depósito es de 200,000 USDT o más. Se completará a través de LayerZero.",layerZeroDepositButton:"Depositar con LayerZero",defaultSpotNotice:"Los depósitos predeterminados van a la cuenta spot.",defaultSpotToPerpNotice:"Esta dirección solo admite depósitos en {{coin}} ({{v}}) Los depósitos predeterminados van a la cuenta spot. Para agregar fondos a la cuenta de futuros, transfiere desde la cuenta spot a la cuenta de futuros."},withdraw:{noticeDesc:"Los retiros normales son un proceso de dos pasos. Este paso inicia tu solicitud de retiro, que se procesará en la capa 2. Una vez que tus fondos estén listos (puede tardar hasta 4 horas), recibirás una notificación para retirar fondos a tu billetera. Debido a la sincronización de la cadena y a otros factores, el proceso puede llevar hasta 48 horas. Las comisiones de gas de las transacciones corren por tu cuenta.",crossChainTips:"Los retiros entre cadenas requieren verificación en la capa 2 (mediante pruebas ZK) y el proceso de retiro puede tardar hasta 2 horas. Para procesar retiros entre cadenas, se requieren fondos suficientes en el pool de activos de la cadena correspondiente. También se incurrirá en comisiones de gas. edgeX cobrará una tarifa para cubrirlos.",commonWithdraw:"Preguntas frecuentes sobre los retiros",withdraw:"Retirar",speed:"Velocidad",confirmWithdraw:"Confirmar el retiro",speedNote:"Plazos de procesamiento:",speedNoteSpeed1:"Aprox. 8 minutos",speedNoteSpeed2:"Aprox. 2-4 horas",speedNoteSpeed3:"Aprox. 4 horas",receiverAddress:"Dirección del destinatario",fee:"Comisión",feeRate:"Tasa de comisión",withdrawlAmount:"Monto del retiro",amountToReceive:"Monto a recibir",minWithdraw:"Monto mínimo de retiro",minWithdrawParsed:"Min. de retiro: {{amount}} {{token}}",invalidReceiverAddress:"La dirección no puede estar vacía",availableDesc:"Lo máximo que puedes retirar. Si el saldo disponible es 0 o negativo, los retiros no están permitidos.",feeCalculationTip:"Las comisiones de retiro se calculan multiplicando el monto de retiro por la tasa de comisión, con un mínimo de 1 USDT/USDC. La tasa de la comisión puede modificarse en función de las condiciones reales de la cadena.",crossChainPoolBalance:"Saldo del pool cross-chain",poolBalance:"Saldo del pool",poolBalanceInsufficientTip:"El monto a retirar excede el saldo del pool. El retiro no se puede procesar. Selecciona una opción con un saldo suficiente en el pool."},account:{title:"Cuenta",perpetual:"Cuenta de perpetuos",spot:"Cuenta spot"}},zm={deposit:{title:"Dépôt",chain:"Blockchain",asset:"Actif",amount:"Montant",available:"Disponible",equity:"Actif net",confirmDeposit:"Confirmer le dépôt",switchNetwork:"Changer de réseau",max:"Max.",arrivalTime:"Heure d’arrivée",ethCrossChainDepositInitiated:"Dépôt ETH inter-blockchains initié. Arrivée estimée dans 2 à 5 minutes.",minDeposit:"Montant minimum de dépôt",minDepositParsed:"Dépôt min. {{amount}} {{token}}",maxDeposit:"Montant maximum de dépôt",depositTipFor25w:"Le montant maximum par dépôt est de 200 000. Si votre dépôt dépasse 200 000, utilisez la blockchain Ethereum.",depositAllTip:`Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse.
36
+ Los depósitos entre cadenas requieren el pago de la comisión de gas de Edge. El monto acreditado será ligeramente inferior al monto depositado.`,addressUpdatedNotice:"Aviso: Se actualizó tu dirección de depósito. Usa esta nueva dirección. La anterior solo funciona durante la transición y pronto se desactivará. Si la tienes guardada en otros dispositivos, actualízala lo antes posible.",enableSystemProWithToken:"Habilitar {{token}} en {{network}}",enableTokenDesc:"Debes habilitar {{token}} la primera vez que deposites en {{network}}.",enableWithToken:"Habilitar {{token}}",arrivaltimeTooltip1:"Los fondos se acreditarán en aproximadamente {{v}} minutos (tras obtener {{v1}} confirmaciones de bloque).",arrivaltimeTooltip2:"El tiempo estimado se calcula a partir de datos históricos y es solo de referencia. La congestión de la red puede ocasionar tiempos de acreditación más largos.",arrivalEstimated:"Aprox. {{v}} minutos",availableDesc:"Lo máximo que puedes depositar. Si el saldo disponible es 0 o negativo, los depósitos no están permitidos.",noPrivateKeyWalletWarning:"No uses billeteras sin clave para realizar depósitos. Existe el riesgo de una pérdida irreversible de los fondos.",layerZeroDepositTip:"El sistema completará tu depósito a través de LayerZero según las condiciones de depósito reales.",layerZeroDepositTipExceedPool:"Dado que el importe del depósito supera el pool, tu depósito se completará a través de LayerZero.",layerZeroDepositTipGte200k:"El depósito es de 200,000 USDT o más. Se completará a través de LayerZero.",layerZeroDepositButton:"Depositar con LayerZero",defaultSpotNotice:"Los depósitos predeterminados van a la cuenta spot.",defaultSpotToPerpNotice:"Esta dirección solo admite depósitos en {{coin}} ({{v}}) Los depósitos predeterminados van a la cuenta spot. Para agregar fondos a la cuenta de futuros, transfiere desde la cuenta spot a la cuenta de futuros."},withdraw:{noticeDesc:"Los retiros normales son un proceso de dos pasos. Este paso inicia tu solicitud de retiro, que se procesará en la capa 2. Una vez que tus fondos estén listos (puede tardar hasta 4 horas), recibirás una notificación para retirar fondos a tu billetera. Debido a la sincronización de la cadena y a otros factores, el proceso puede llevar hasta 48 horas. Las comisiones de gas de las transacciones corren por tu cuenta.",crossChainTips:"Los retiros entre cadenas requieren verificación en la capa 2 (mediante pruebas ZK) y el proceso de retiro puede tardar hasta 2 horas. Para procesar retiros entre cadenas, se requieren fondos suficientes en el pool de activos de la cadena correspondiente. También se incurrirá en comisiones de gas. edgeX cobrará una tarifa para cubrirlos.",commonWithdraw:"Preguntas frecuentes sobre los retiros",withdraw:"Retirar",speed:"Velocidad",confirmWithdraw:"Confirmar el retiro",speedNote:"Plazos de procesamiento:",speedNoteSpeed1:"Aprox. 8 minutos",speedNoteSpeed2:"Aprox. 2-4 horas",speedNoteSpeed3:"Aprox. 4 horas",receiverAddress:"Dirección del destinatario",fee:"Comisión",feeRate:"Tasa de comisión",withdrawlAmount:"Monto del retiro",amountToReceive:"Monto a recibir",minWithdraw:"Monto mínimo de retiro",minWithdrawParsed:"Min. de retiro: {{amount}} {{token}}",invalidReceiverAddress:"La dirección no puede estar vacía",availableDesc:"Lo máximo que puedes retirar. Si el saldo disponible es 0 o negativo, los retiros no están permitidos.",feeCalculationTip:"Las comisiones de retiro se calculan multiplicando el monto de retiro por la tasa de comisión, con un mínimo de 1 USDT/USDC. La tasa de la comisión puede modificarse en función de las condiciones reales de la cadena.",crossChainPoolBalance:"Saldo del pool cross-chain",poolBalance:"Saldo del pool",poolBalanceInsufficientTip:"El monto a retirar excede el saldo del pool. El retiro no se puede procesar. Selecciona una opción con un saldo suficiente en el pool."},account:{title:"Cuenta",perpetual:"Cuenta de perpetuos",spot:"Cuenta spot"}},Zm={deposit:{title:"Dépôt",chain:"Blockchain",asset:"Actif",amount:"Montant",available:"Disponible",equity:"Actif net",confirmDeposit:"Confirmer le dépôt",switchNetwork:"Changer de réseau",max:"Max.",arrivalTime:"Heure d’arrivée",ethCrossChainDepositInitiated:"Dépôt ETH inter-blockchains initié. Arrivée estimée dans 2 à 5 minutes.",minDeposit:"Montant minimum de dépôt",minDepositParsed:"Dépôt min. {{amount}} {{token}}",maxDeposit:"Montant maximum de dépôt",depositTipFor25w:"Le montant maximum par dépôt est de 200 000. Si votre dépôt dépasse 200 000, utilisez la blockchain Ethereum.",depositAllTip:`Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse.
37
37
  Si le montant du dépôt dépasse 200 000, l’heure d’arrivée peut être retardée. Merci de patienter.`,maxDepositSplitTip:"Le montant maximum par dépôt est de 200 000. Si vous devez déposer plus de 200 000, veuillez effectuer plusieurs dépôts.",spotDepositNotSupportedTip:"Les dépôts ne sont pas pris en charge. Veuillez effectuer le dépôt sur le compte perpétuel, puis transférer les fonds.",crossChainDepositFeeTip:`Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse.
38
- Les dépôts inter-blockchains nécessitent le paiement des frais de gas Edge. Le montant crédité sera légèrement inférieur au montant déposé.`,addressUpdatedNotice:"Avis : Votre adresse de dépôt a été mise à jour. Utilisez la nouvelle adresse. L’ancienne ne fonctionne que pendant la transition et sera désactivée. Si vous l’avez enregistrée ailleurs, modifiez-la sans tarder.",enableSystemProWithToken:"Activer {{token}} sur {{network}}",enableTokenDesc:"Vous devez activer {{token}} lors de votre premier dépôt sur {{network}}.",enableWithToken:"Activer {{token}}",arrivaltimeTooltip1:"Les fonds arriveront dans environ {{v}} minutes (après {{v1}} confirmations de bloc).",arrivaltimeTooltip2:"La durée estimée est calculée sur la base de données historiques et n’est donnée qu’à titre indicatif. L’encombrement du réseau peut rallonger l’heure d’arrivée réelle.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"Montant maximal que vous pouvez déposer. Lorsque le solde disponible est nul ou négatif, aucun dépôt ne peut être effectué.",noPrivateKeyWalletWarning:"N’utilisez pas de wallets sans clé pour effectuer des dépôts. Un dépôt effectué depuis un wallet sans clé peut entraîner une perte irréversible des fonds.",layerZeroDepositTip:"Le système effectuera votre dépôt via LayerZero en fonction des conditions réelles du dépôt.",layerZeroDepositTipExceedPool:"Comme le montant du dépôt est supérieur au pool, votre dépôt sera effectué via LayerZero.",layerZeroDepositTipGte200k:"Comme le montant du dépôt est supérieur ou égal à 200 000 USDT, votre dépôt sera effectué via LayerZero.",layerZeroDepositButton:"Déposer via LayerZero",defaultSpotNotice:"Par défaut, les dépôts sont crédités sur le compte spot.",defaultSpotToPerpNotice:"Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse. Par défaut, les dépôts sont crédités sur le compte spot. Pour alimenter le compte futures, transférez des fonds du compte spot vers le compte futures."},withdraw:{noticeDesc:"Les retraits classiques s’effectuent en deux étapes. Cette étape initie votre demande de retrait et sera traitée sur la Layer 2. Une fois vos fonds prêts (cela peut prendre jusqu’à 4 heures), vous recevrez une notification pour retirer les fonds vers votre wallet. En raison de la synchronisation de la chaîne et d’autres facteurs, le délai peut atteindre 48 heures. Vous êtes responsable de tous les frais de gas liés aux transactions.",crossChainTips:"Les retraits inter-blockchains nécessitent une vérification sur L2 (via des preuves ZK) et le processus de retrait peut prendre jusqu’à 2 heures. Des fonds suffisants dans le pool d’actifs de la chaîne concernée sont nécessaires pour traiter les retraits inter-blockchains. Des frais de gas seront également appliqués. edgeX facturera des frais pour les couvrir.",commonWithdraw:"FAQ sur les retraits",withdraw:"Retrait",speed:"Vitesse",confirmWithdraw:"Confirmer le retrait",speedNote:"Délais de traitement :",speedNoteSpeed1:"Env. 8 minutes",speedNoteSpeed2:"Env. 2 à 4 heures",speedNoteSpeed3:"Env. 4 heures",receiverAddress:"Adresse de réception",fee:"Frais",feeRate:"Taux de frais",withdrawlAmount:"Montant du retrait",amountToReceive:"Montant à recevoir",minWithdraw:"Montant minimum de retrait",minWithdrawParsed:"Retrait min. {{amount}} {{token}}",invalidReceiverAddress:"L’adresse ne peut pas être vide",availableDesc:"Montant maximal que vous pouvez retirer. Lorsque le solde disponible est nul ou négatif, aucun retrait ne peut être effectué.",feeCalculationTip:"Les frais de retrait sont calculés en multipliant le montant du retrait par le taux de frais, avec un minimum de 1 USDT/USDC. Le taux de frais peut être ajusté en fonction des conditions réelles on-chain.",crossChainPoolBalance:"Solde du pool inter-blockchains",poolBalance:"Solde du pool",poolBalanceInsufficientTip:"Le montant du retrait dépasse le solde du pool de fonds ; le retrait ne peut pas être traité. Sélectionnez une option disposant d’un solde de pool de fonds suffisant."},account:{title:"Compte",perpetual:"Compte perpétuel",spot:"Compte spot"}},Um={deposit:{title:"Deposita",chain:"Blockchain",asset:"Asset",amount:"Importo",available:"Disponibile",equity:"Equity",confirmDeposit:"Conferma il deposito",switchNetwork:"Cambia rete",max:"Max",arrivalTime:"Orario di arrivo",ethCrossChainDepositInitiated:"Deposito cross-chain di ETH avviato. Il deposito arriverà tra 2-5 minuti.",minDeposit:"Importo minimo del deposito",minDepositParsed:"Deposito min. {{amount}} {{token}}",maxDeposit:"Importo massimo del deposito",depositTipFor25w:"L'importo massimo per deposito è 200.000. Se il tuo deposito supera i 200.000, utilizza la catena Ethereum.",depositAllTip:`I depositi a questo indirizzo supportano solo {{coin}} ({{v}}).
38
+ Les dépôts inter-blockchains nécessitent le paiement des frais de gas Edge. Le montant crédité sera légèrement inférieur au montant déposé.`,addressUpdatedNotice:"Avis : Votre adresse de dépôt a été mise à jour. Utilisez la nouvelle adresse. L’ancienne ne fonctionne que pendant la transition et sera désactivée. Si vous l’avez enregistrée ailleurs, modifiez-la sans tarder.",enableSystemProWithToken:"Activer {{token}} sur {{network}}",enableTokenDesc:"Vous devez activer {{token}} lors de votre premier dépôt sur {{network}}.",enableWithToken:"Activer {{token}}",arrivaltimeTooltip1:"Les fonds arriveront dans environ {{v}} minutes (après {{v1}} confirmations de bloc).",arrivaltimeTooltip2:"La durée estimée est calculée sur la base de données historiques et n’est donnée qu’à titre indicatif. L’encombrement du réseau peut rallonger l’heure d’arrivée réelle.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"Montant maximal que vous pouvez déposer. Lorsque le solde disponible est nul ou négatif, aucun dépôt ne peut être effectué.",noPrivateKeyWalletWarning:"N’utilisez pas de wallets sans clé pour effectuer des dépôts. Un dépôt effectué depuis un wallet sans clé peut entraîner une perte irréversible des fonds.",layerZeroDepositTip:"Le système effectuera votre dépôt via LayerZero en fonction des conditions réelles du dépôt.",layerZeroDepositTipExceedPool:"Comme le montant du dépôt est supérieur au pool, votre dépôt sera effectué via LayerZero.",layerZeroDepositTipGte200k:"Comme le montant du dépôt est supérieur ou égal à 200 000 USDT, votre dépôt sera effectué via LayerZero.",layerZeroDepositButton:"Déposer via LayerZero",defaultSpotNotice:"Par défaut, les dépôts sont crédités sur le compte spot.",defaultSpotToPerpNotice:"Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse. Par défaut, les dépôts sont crédités sur le compte spot. Pour alimenter le compte futures, transférez des fonds du compte spot vers le compte futures."},withdraw:{noticeDesc:"Les retraits classiques s’effectuent en deux étapes. Cette étape initie votre demande de retrait et sera traitée sur la Layer 2. Une fois vos fonds prêts (cela peut prendre jusqu’à 4 heures), vous recevrez une notification pour retirer les fonds vers votre wallet. En raison de la synchronisation de la chaîne et d’autres facteurs, le délai peut atteindre 48 heures. Vous êtes responsable de tous les frais de gas liés aux transactions.",crossChainTips:"Les retraits inter-blockchains nécessitent une vérification sur L2 (via des preuves ZK) et le processus de retrait peut prendre jusqu’à 2 heures. Des fonds suffisants dans le pool d’actifs de la chaîne concernée sont nécessaires pour traiter les retraits inter-blockchains. Des frais de gas seront également appliqués. edgeX facturera des frais pour les couvrir.",commonWithdraw:"FAQ sur les retraits",withdraw:"Retrait",speed:"Vitesse",confirmWithdraw:"Confirmer le retrait",speedNote:"Délais de traitement :",speedNoteSpeed1:"Env. 8 minutes",speedNoteSpeed2:"Env. 2 à 4 heures",speedNoteSpeed3:"Env. 4 heures",receiverAddress:"Adresse de réception",fee:"Frais",feeRate:"Taux de frais",withdrawlAmount:"Montant du retrait",amountToReceive:"Montant à recevoir",minWithdraw:"Montant minimum de retrait",minWithdrawParsed:"Retrait min. {{amount}} {{token}}",invalidReceiverAddress:"L’adresse ne peut pas être vide",availableDesc:"Montant maximal que vous pouvez retirer. Lorsque le solde disponible est nul ou négatif, aucun retrait ne peut être effectué.",feeCalculationTip:"Les frais de retrait sont calculés en multipliant le montant du retrait par le taux de frais, avec un minimum de 1 USDT/USDC. Le taux de frais peut être ajusté en fonction des conditions réelles on-chain.",crossChainPoolBalance:"Solde du pool inter-blockchains",poolBalance:"Solde du pool",poolBalanceInsufficientTip:"Le montant du retrait dépasse le solde du pool de fonds ; le retrait ne peut pas être traité. Sélectionnez une option disposant d’un solde de pool de fonds suffisant."},account:{title:"Compte",perpetual:"Compte perpétuel",spot:"Compte spot"}},Km={deposit:{title:"Deposita",chain:"Blockchain",asset:"Asset",amount:"Importo",available:"Disponibile",equity:"Equity",confirmDeposit:"Conferma il deposito",switchNetwork:"Cambia rete",max:"Max",arrivalTime:"Orario di arrivo",ethCrossChainDepositInitiated:"Deposito cross-chain di ETH avviato. Il deposito arriverà tra 2-5 minuti.",minDeposit:"Importo minimo del deposito",minDepositParsed:"Deposito min. {{amount}} {{token}}",maxDeposit:"Importo massimo del deposito",depositTipFor25w:"L'importo massimo per deposito è 200.000. Se il tuo deposito supera i 200.000, utilizza la catena Ethereum.",depositAllTip:`I depositi a questo indirizzo supportano solo {{coin}} ({{v}}).
39
39
  Se l'importo del deposito supera i 200.000, l'orario di arrivo potrebbe subire ritardi. Sii paziente.`,maxDepositSplitTip:"L'importo massimo per deposito è 200.000. Se devi depositare più di 200.000, dividi l'importo in più depositi.",spotDepositNotSupportedTip:"I depositi non sono supportati. Prima deposita sul conto perpetuo, quindi effettua il trasferimento.",crossChainDepositFeeTip:`I depositi a questo indirizzo supportano solo {{coin}} ({{v}}).
40
- Per i depositi cross-chain è necessario pagare la gas fee Edge. L'importo accreditato sarà leggermente inferiore all'importo del deposito.`,addressUpdatedNotice:"Avviso: il tuo indirizzo di deposito è stato aggiornato. Utilizza il nuovo indirizzo. L'indirizzo precedente funzionerà solo durante la transizione, quindi verrà disattivato. Se l'hai salvato altrove, aggiornarlo il prima possibile.",enableSystemProWithToken:"Abilita {{token}} su {{network}}",enableTokenDesc:"Devi abilitare {{token}} la prima volta che depositi su {{network}}.",enableWithToken:"Abilita {{token}}",arrivaltimeTooltip1:"I fondi arriveranno entro circa {{v}} minuti (dopo{{v1}} conferme di blocco).",arrivaltimeTooltip2:"Il tempo stimato è calcolato in base ai dati storici ed solo per riferimento. Se la rete è congestionata, potrebbero esserci dei ritardi.",arrivalEstimated:"≈ {{v}} minuti",availableDesc:"L'importo massimo che puoi depositare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare depositi.",noPrivateKeyWalletWarning:"Non effettuare depositi con wallet senza chiavi. Se effettui un deposito tramite un wallet senza chiave rischi di perdere i tuoi fondi per sempre.",layerZeroDepositTip:"Il sistema completerà il tuo deposito tramite LayerZero in base alle condizioni effettive di deposito.",layerZeroDepositTipExceedPool:"Poiché l'importo del deposito supera il pool, il deposito sarà completato tramite LayerZero.",layerZeroDepositTipGte200k:"Poiché l'importo del deposito è maggiore o uguale a 200.000 USDT, il deposito verrà completato tramite LayerZero.",layerZeroDepositButton:"Deposita con LayerZero",defaultSpotNotice:"I depositi predefiniti vanno sul conto spot.",defaultSpotToPerpNotice:"I depositi a questo indirizzo supportano solo {{coin}} ({{v}}). I depositi predefiniti vanno sul conto spot. Per finanziare il conto futures, effettua un trasferimento dal conto spot al conto futures."},withdraw:{noticeDesc:"I prelievi normali avvengono in due fasi. La fase attuale dà il via alla richiesta di prelievo, che verrà elaborata nel Layer 2. Non appena i fondi saranno pronti (possono volerci fino a 4 ore), riceverai una notifica per prelevarli nel tuo portafoglio. A causa della sincronizzazione della blockchain e di altri fattori, l'operazione potrebbe richiedere fino a 48 ore. Sei responsabile di eventuali gas fee per la transazione.",crossChainTips:"I prelievi cross-chain richiedono una verifica sul L2 (tramite prove ZK) e l'elaborazione del prelievo può richiedere fino a 2 ore. Per elaborare i prelievi cross-chain, il pool degli asset della blockchain corrispondente deve disporre di fondi a sufficienza. Inoltre, è necessario pagare delle gas fee. edgeX addebiterà una commissione per coprire tale costo.",commonWithdraw:"Domande frequenti sui prelievi",withdraw:"Preleva",speed:"Velocità",confirmWithdraw:"Conferma prelievo",speedNote:"Tempi di elaborazione:",speedNoteSpeed1:"Circa 8 minuti",speedNoteSpeed2:"Circa 2-4 ore",speedNoteSpeed3:"Circa 4 ore",receiverAddress:"Indirizzo del destinatario",fee:"Commissione",feeRate:"Tariffa",withdrawlAmount:"Importo del prelievo",amountToReceive:"Importo da ricevere",minWithdraw:"Importo minimo di prelievo",minWithdrawParsed:"Prelievo min. {{amount}} {{token}}",invalidReceiverAddress:"L'indirizzo non può essere vuoto",availableDesc:"L'importo massimo che puoi prelevare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare prelievi.",feeCalculationTip:"Le commissioni di prelievo vengono calcolate moltiplicando l'importo del prelievo per il tasso di commissione, con un minimo di 1 USDT/USDC. La tariffa può essere modificata in base alle condizioni effettive on-chain.",crossChainPoolBalance:"Equilibrio del pool cross-chain",poolBalance:"Equilibrio della piscina",poolBalanceInsufficientTip:"L'importo del prelievo supera il saldo del fondo e il prelievo non può essere elaborato. Selezionare un'opzione con un saldo di fondi sufficiente."},account:{title:"Account",perpetual:"Conto perpetuo",spot:"Conto Spot"}},Wm={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",arrivalTime:"着金予定時間",ethCrossChainDepositInitiated:"ETH のクロスチェーン入金を開始しました。到着まで約2〜5分です。",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は200,000です。200,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
40
+ Per i depositi cross-chain è necessario pagare la gas fee Edge. L'importo accreditato sarà leggermente inferiore all'importo del deposito.`,addressUpdatedNotice:"Avviso: il tuo indirizzo di deposito è stato aggiornato. Utilizza il nuovo indirizzo. L'indirizzo precedente funzionerà solo durante la transizione, quindi verrà disattivato. Se l'hai salvato altrove, aggiornarlo il prima possibile.",enableSystemProWithToken:"Abilita {{token}} su {{network}}",enableTokenDesc:"Devi abilitare {{token}} la prima volta che depositi su {{network}}.",enableWithToken:"Abilita {{token}}",arrivaltimeTooltip1:"I fondi arriveranno entro circa {{v}} minuti (dopo{{v1}} conferme di blocco).",arrivaltimeTooltip2:"Il tempo stimato è calcolato in base ai dati storici ed solo per riferimento. Se la rete è congestionata, potrebbero esserci dei ritardi.",arrivalEstimated:"≈ {{v}} minuti",availableDesc:"L'importo massimo che puoi depositare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare depositi.",noPrivateKeyWalletWarning:"Non effettuare depositi con wallet senza chiavi. Se effettui un deposito tramite un wallet senza chiave rischi di perdere i tuoi fondi per sempre.",layerZeroDepositTip:"Il sistema completerà il tuo deposito tramite LayerZero in base alle condizioni effettive di deposito.",layerZeroDepositTipExceedPool:"Poiché l'importo del deposito supera il pool, il deposito sarà completato tramite LayerZero.",layerZeroDepositTipGte200k:"Poiché l'importo del deposito è maggiore o uguale a 200.000 USDT, il deposito verrà completato tramite LayerZero.",layerZeroDepositButton:"Deposita con LayerZero",defaultSpotNotice:"I depositi predefiniti vanno sul conto spot.",defaultSpotToPerpNotice:"I depositi a questo indirizzo supportano solo {{coin}} ({{v}}). I depositi predefiniti vanno sul conto spot. Per finanziare il conto futures, effettua un trasferimento dal conto spot al conto futures."},withdraw:{noticeDesc:"I prelievi normali avvengono in due fasi. La fase attuale dà il via alla richiesta di prelievo, che verrà elaborata nel Layer 2. Non appena i fondi saranno pronti (possono volerci fino a 4 ore), riceverai una notifica per prelevarli nel tuo portafoglio. A causa della sincronizzazione della blockchain e di altri fattori, l'operazione potrebbe richiedere fino a 48 ore. Sei responsabile di eventuali gas fee per la transazione.",crossChainTips:"I prelievi cross-chain richiedono una verifica sul L2 (tramite prove ZK) e l'elaborazione del prelievo può richiedere fino a 2 ore. Per elaborare i prelievi cross-chain, il pool degli asset della blockchain corrispondente deve disporre di fondi a sufficienza. Inoltre, è necessario pagare delle gas fee. edgeX addebiterà una commissione per coprire tale costo.",commonWithdraw:"Domande frequenti sui prelievi",withdraw:"Preleva",speed:"Velocità",confirmWithdraw:"Conferma prelievo",speedNote:"Tempi di elaborazione:",speedNoteSpeed1:"Circa 8 minuti",speedNoteSpeed2:"Circa 2-4 ore",speedNoteSpeed3:"Circa 4 ore",receiverAddress:"Indirizzo del destinatario",fee:"Commissione",feeRate:"Tariffa",withdrawlAmount:"Importo del prelievo",amountToReceive:"Importo da ricevere",minWithdraw:"Importo minimo di prelievo",minWithdrawParsed:"Prelievo min. {{amount}} {{token}}",invalidReceiverAddress:"L'indirizzo non può essere vuoto",availableDesc:"L'importo massimo che puoi prelevare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare prelievi.",feeCalculationTip:"Le commissioni di prelievo vengono calcolate moltiplicando l'importo del prelievo per il tasso di commissione, con un minimo di 1 USDT/USDC. La tariffa può essere modificata in base alle condizioni effettive on-chain.",crossChainPoolBalance:"Equilibrio del pool cross-chain",poolBalance:"Equilibrio della piscina",poolBalanceInsufficientTip:"L'importo del prelievo supera il saldo del fondo e il prelievo non può essere elaborato. Selezionare un'opzione con un saldo di fondi sufficiente."},account:{title:"Account",perpetual:"Conto perpetuo",spot:"Conto Spot"}},Ym={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",arrivalTime:"着金予定時間",ethCrossChainDepositInitiated:"ETH のクロスチェーン入金を開始しました。到着まで約2〜5分です。",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は200,000です。200,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
41
41
  入金金額が 200,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,maxDepositSplitTip:"1回の入金上限は200,000です。200,000を超える金額を入金する場合は、複数回に分けて行ってください。",spotDepositNotSupportedTip:"入金非対応。先に契約アカウント入金後、振替。",crossChainDepositFeeTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
42
- クロスチェーン入金では Edge ネットワーク手数料はお客様負担となります。入金額はご入金額よりわずかに少なくなります。`,addressUpdatedNotice:"注意:入金アドレスが更新されました。新しいアドレスをご利用ください。旧アドレスは移行期間のみ有効で、その後無効になります。他のサービスに保存している場合は早急に更新してください。",enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"資金は約 {{v}} 分以内({{v1}} 回のブロック確認が完了後)に到账します。",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",availableDesc:"入金可能な最大金額。利用可能残高が0または負の数の場合、入金はできません。",noPrivateKeyWalletWarning:"秘密鍵のないウォレットでの入金は行わないでください。そのような入金は資金を失い、取り戻すことができません。",layerZeroDepositTip:"システムは入金資金の実際の状況に基づき、LayerZeroを通じて入金を完了します。",layerZeroDepositTipExceedPool:"入金額がプールを超えているため、LayerZero を通じて入金が完了します。",layerZeroDepositTipGte200k:"入金額が 200,000 USDT 以上のため、LayerZero を通じて入金が完了します。",layerZeroDepositButton:"LayerZeroで入金",defaultSpotNotice:"デフォルトでは現物口座に入金されます",defaultSpotToPerpNotice:"このアドレスは {{coin}} ({{v}}) 専用です。 デフォルトでは現物口座に入金されます。先物口座に入金する場合は、現物口座から先物口座へ振替してください。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",feeRate:"手数料率",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",minWithdraw:"最低出金額",minWithdrawParsed:"最低出金 {{amount}} {{token}}",invalidReceiverAddress:"ウォレットアドレスは必須です",availableDesc:"引き出し可能な最大金額。利用可能残高が0または負の数の場合、引き出しはできません。",feeCalculationTip:"出金手数料は、出金金額に料率を乗じて計算され、最低1 USDT/USDCとなります。料率は、ブロックチェーンの実際の状況に基づいて調整される場合があります。",crossChainPoolBalance:"クロスチェーンプール残高",poolBalance:"プール残高",poolBalanceInsufficientTip:"出金額が資金プールの残高を上回っているため、出金は処理できません。資金プールの残高が十分にあるオプションを選択してください。"},account:{title:"アカウント",perpetual:"パーペチュアルアカウント",spot:"スポットアカウント"}},Hm={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",arrivalTime:"Время поступления",ethCrossChainDepositInitiated:"Кроссчейн‑депозит ETH запущен. Ожидаемое зачисление: 2–5 минут.",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 200 000. Если сумма превышает 200 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
42
+ クロスチェーン入金では Edge ネットワーク手数料はお客様負担となります。入金額はご入金額よりわずかに少なくなります。`,addressUpdatedNotice:"注意:入金アドレスが更新されました。新しいアドレスをご利用ください。旧アドレスは移行期間のみ有効で、その後無効になります。他のサービスに保存している場合は早急に更新してください。",enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"資金は約 {{v}} 分以内({{v1}} 回のブロック確認が完了後)に到账します。",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",availableDesc:"入金可能な最大金額。利用可能残高が0または負の数の場合、入金はできません。",noPrivateKeyWalletWarning:"秘密鍵のないウォレットでの入金は行わないでください。そのような入金は資金を失い、取り戻すことができません。",layerZeroDepositTip:"システムは入金資金の実際の状況に基づき、LayerZeroを通じて入金を完了します。",layerZeroDepositTipExceedPool:"入金額がプールを超えているため、LayerZero を通じて入金が完了します。",layerZeroDepositTipGte200k:"入金額が 200,000 USDT 以上のため、LayerZero を通じて入金が完了します。",layerZeroDepositButton:"LayerZeroで入金",defaultSpotNotice:"デフォルトでは現物口座に入金されます",defaultSpotToPerpNotice:"このアドレスは {{coin}} ({{v}}) 専用です。 デフォルトでは現物口座に入金されます。先物口座に入金する場合は、現物口座から先物口座へ振替してください。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",feeRate:"手数料率",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",minWithdraw:"最低出金額",minWithdrawParsed:"最低出金 {{amount}} {{token}}",invalidReceiverAddress:"ウォレットアドレスは必須です",availableDesc:"引き出し可能な最大金額。利用可能残高が0または負の数の場合、引き出しはできません。",feeCalculationTip:"出金手数料は、出金金額に料率を乗じて計算され、最低1 USDT/USDCとなります。料率は、ブロックチェーンの実際の状況に基づいて調整される場合があります。",crossChainPoolBalance:"クロスチェーンプール残高",poolBalance:"プール残高",poolBalanceInsufficientTip:"出金額が資金プールの残高を上回っているため、出金は処理できません。資金プールの残高が十分にあるオプションを選択してください。"},account:{title:"アカウント",perpetual:"パーペチュアルアカウント",spot:"スポットアカウント"}},Xm={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",arrivalTime:"Время поступления",ethCrossChainDepositInitiated:"Кроссчейн‑депозит ETH запущен. Ожидаемое зачисление: 2–5 минут.",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 200 000. Если сумма превышает 200 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
43
43
  Если сумма депозита превышает 200 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,maxDepositSplitTip:"Максимальная сумма одного пополнения — 200 000. Если вам нужно пополнить на сумму более 200 000, выполните несколько пополнений.",spotDepositNotSupportedTip:"Пополнение недоступно. Сначала контрактный счёт, затем перевод.",crossChainDepositFeeTip:`На этот адрес можно внести только {{coin}} ({{v}}).
44
44
  За кроссчейн‑депозит вы оплачиваете комиссию сети Edge. Зачисленная сумма будет немного меньше суммы вашего депозита.`,addressUpdatedNotice:"Внимание: ваш адрес пополнения обновлён. Используйте новый адрес. Старый действует только в переходный период и будет отключён. Если он сохранён где‑то ещё, срочно обновите.",enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Средства поступят в течение примерно {{v}} минут (после достижения {{v1}} подтверждений блоков).",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"≈ {{v}} минут",availableDesc:"Максимальная сумма, которую вы можете пополнить. Если доступный баланс равен 0 или отрицательный, пополнение невозможно.",noPrivateKeyWalletWarning:`Не используйте кошельки без приватных ключей для пополнения. Пополнение с такого кошелька может привести к безвозвратной потере средств.
45
45
 
46
- Tangem не подключаем, это кошелек без приватного ключа`,layerZeroDepositTip:"Система завершит ваше пополнение через LayerZero в зависимости от фактических условий депозита.",layerZeroDepositTipExceedPool:"Поскольку сумма пополнения превышает пул, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositTipGte200k:"Поскольку сумма пополнения больше либо равна 200,000 USDT, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositButton:"Пополнение через LayerZero",defaultSpotNotice:"По умолчанию — на спотовый счёт",defaultSpotToPerpNotice:"На этот адрес можно внести только {{coin}} ({{v}}). Пополнение по умолчанию зачисляется на спотовый счёт. Чтобы пополнить фьючерсный счёт, переведите средства со спотового на фьючерсный."},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",feeRate:"Тариф",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",minWithdraw:"Минимальная сумма вывода",minWithdrawParsed:"Мин. вывод {{amount}} {{token}}",invalidReceiverAddress:"Укажите адрес кошелька",availableDesc:"Максимальная сумма, которую вы можете вывести. Если доступный баланс равен 0 или отрицательный, вывод средств невозможен.",feeCalculationTip:"Комиссия за вывод средств рассчитывается путем умножения суммы вывода на ставку комиссии, минимальная комиссия составляет 1 USDT/USDC. Ставка комиссии может быть скорректирована в зависимости от фактической ситуации в сети блокчейн.",crossChainPoolBalance:"Баланс кросс-чейн пула",poolBalance:"Баланс пула",poolBalanceInsufficientTip:"Сумма вывода превышает баланс пула средств, и операция не может быть выполнена. Пожалуйста, выберите опцию с достаточным балансом пула средств."},account:{title:"Аккаунт",perpetual:"Перпетуальный счет",spot:"Спотовый счет"}},Vm={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",arrivalTime:"到账时间",ethCrossChainDepositInitiated:"ETH 跨链充值已发起,预计 2–5 分钟到账。",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 200,000。若充值金额大于200,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
46
+ Tangem не подключаем, это кошелек без приватного ключа`,layerZeroDepositTip:"Система завершит ваше пополнение через LayerZero в зависимости от фактических условий депозита.",layerZeroDepositTipExceedPool:"Поскольку сумма пополнения превышает пул, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositTipGte200k:"Поскольку сумма пополнения больше либо равна 200,000 USDT, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositButton:"Пополнение через LayerZero",defaultSpotNotice:"По умолчанию — на спотовый счёт",defaultSpotToPerpNotice:"На этот адрес можно внести только {{coin}} ({{v}}). Пополнение по умолчанию зачисляется на спотовый счёт. Чтобы пополнить фьючерсный счёт, переведите средства со спотового на фьючерсный."},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",feeRate:"Тариф",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",minWithdraw:"Минимальная сумма вывода",minWithdrawParsed:"Мин. вывод {{amount}} {{token}}",invalidReceiverAddress:"Укажите адрес кошелька",availableDesc:"Максимальная сумма, которую вы можете вывести. Если доступный баланс равен 0 или отрицательный, вывод средств невозможен.",feeCalculationTip:"Комиссия за вывод средств рассчитывается путем умножения суммы вывода на ставку комиссии, минимальная комиссия составляет 1 USDT/USDC. Ставка комиссии может быть скорректирована в зависимости от фактической ситуации в сети блокчейн.",crossChainPoolBalance:"Баланс кросс-чейн пула",poolBalance:"Баланс пула",poolBalanceInsufficientTip:"Сумма вывода превышает баланс пула средств, и операция не может быть выполнена. Пожалуйста, выберите опцию с достаточным балансом пула средств."},account:{title:"Аккаунт",perpetual:"Перпетуальный счет",spot:"Спотовый счет"}},Qm={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",arrivalTime:"到账时间",ethCrossChainDepositInitiated:"ETH 跨链充值已发起,预计 2–5 分钟到账。",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 200,000。若充值金额大于200,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
47
47
  充值金额大于 200,000 时,到账时间存在一定延迟,请耐心等待。`,maxDepositSplitTip:"单笔充值金额上限为200,000。若需要充值金额大于200,000,请分多笔进行操作。",spotDepositNotSupportedTip:"不支持充值,请先充入合约账户再划转。",crossChainDepositFeeTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
48
- 跨链充值需由您承担 Edge 网络手续费。到账金额会略小于您的充值金额。`,addressUpdatedNotice:"注意:充值地址已更新,请改用新地址。原地址仅在过渡期可用,随后停用。若旧地址已存于其他平台,请尽快更新。",enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"资金约在 {{v}} 分钟 内 (达到 {{v1}} 个区块确认后) 到账。",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",availableDesc:"您可以充值的最大金额。当可用为0或负数时,无法进行充值。",noPrivateKeyWalletWarning:"请勿使用无私钥钱包进行充值,无私钥钱包充值会导致资金损失且无法追回。",layerZeroDepositTip:"系统会根据充值资金实际情况,将您的充值通过LayerZero完成。",layerZeroDepositTipExceedPool:"由于充值资金大于资金池,将通过LayerZero完成您的充值。",layerZeroDepositTipGte200k:"由于充值资金大于等于200,000 USDT,将通过LayerZero完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"默认充值至现货账户",defaultSpotToPerpNotice:"仅支持发送 {{coin}} ({{v}}) 资产到此地址。默认充值至现货账户。若需充入合约账户,请从现货账户划转至合约账户。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",feeRate:"费率",withdrawlAmount:"提现金额",amountToReceive:"到账金额",minWithdraw:"最小提现金额",minWithdrawParsed:"最小提现 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能为空",availableDesc:"您可以提现的最大金额。当可用为0或负数时,无法进行提现。",feeCalculationTip:"提现手续费按照提现金额乘以费率计算,最低为1 USDT/USDC。费率会根据链上实际情况进行调整。",crossChainPoolBalance:"跨链资金池余额",poolBalance:"资金池余额",poolBalanceInsufficientTip:"提现金额大于资金池余额,无法进行提现。请选择资金池余额充足的选项。"},account:{title:"账户",perpetual:"合约账户",spot:"现货账户"}},Gm={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",arrivalTime:"到帳時間",ethCrossChainDepositInitiated:"ETH 跨鏈充值已發起 ,預計 2–5 分鐘到賬。",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 200,000。若充值金額大於 200,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
48
+ 跨链充值需由您承担 Edge 网络手续费。到账金额会略小于您的充值金额。`,addressUpdatedNotice:"注意:充值地址已更新,请改用新地址。原地址仅在过渡期可用,随后停用。若旧地址已存于其他平台,请尽快更新。",enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"资金约在 {{v}} 分钟 内 (达到 {{v1}} 个区块确认后) 到账。",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",availableDesc:"您可以充值的最大金额。当可用为0或负数时,无法进行充值。",noPrivateKeyWalletWarning:"请勿使用无私钥钱包进行充值,无私钥钱包充值会导致资金损失且无法追回。",layerZeroDepositTip:"系统会根据充值资金实际情况,将您的充值通过LayerZero完成。",layerZeroDepositTipExceedPool:"由于充值资金大于资金池,将通过LayerZero完成您的充值。",layerZeroDepositTipGte200k:"由于充值资金大于等于200,000 USDT,将通过LayerZero完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"默认充值至现货账户",defaultSpotToPerpNotice:"仅支持发送 {{coin}} ({{v}}) 资产到此地址。默认充值至现货账户。若需充入合约账户,请从现货账户划转至合约账户。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",feeRate:"费率",withdrawlAmount:"提现金额",amountToReceive:"到账金额",minWithdraw:"最小提现金额",minWithdrawParsed:"最小提现 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能为空",availableDesc:"您可以提现的最大金额。当可用为0或负数时,无法进行提现。",feeCalculationTip:"提现手续费按照提现金额乘以费率计算,最低为1 USDT/USDC。费率会根据链上实际情况进行调整。",crossChainPoolBalance:"跨链资金池余额",poolBalance:"资金池余额",poolBalanceInsufficientTip:"提现金额大于资金池余额,无法进行提现。请选择资金池余额充足的选项。"},account:{title:"账户",perpetual:"合约账户",spot:"现货账户"}},Jm={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",arrivalTime:"到帳時間",ethCrossChainDepositInitiated:"ETH 跨鏈充值已發起 ,預計 2–5 分鐘到賬。",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 200,000。若充值金額大於 200,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
49
49
  充值金額大於 200,000 時,到账時間可能會有延遲,請耐心等待。`,maxDepositSplitTip:"單筆充值金額上限為 200,000。若需要充值金額大於 200,000,請分多筆進行操作。",spotDepositNotSupportedTip:"不支援充值,請先充入合約帳戶再劃轉。",crossChainDepositFeeTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
50
- 跨鏈充值需由您承擔 Edge 網路手續費。到帳金額會略小於您的充值金額。`,addressUpdatedNotice:"注意:充值地址已更新,請改用新地址。原地址僅在過渡期內有效,之後將停用。若已在其他平台儲存,請儘速更新。",enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"資金約在 {{v}} 分鐘內(達到 {{v1}} 個區塊確認後)到賬。",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",availableDesc:"您可以充值的最大金額。當可用餘額為0或負數時,無法進行充值。",noPrivateKeyWalletWarning:"請勿使用無私鑰錢包進行充值,無私鑰錢包充值會導致資金損失且無法追回。",layerZeroDepositTip:"系統會根據充值資金的實際情況,通過 LayerZero 完成您的充值。",layerZeroDepositTipExceedPool:"由於充值資金大於資金池,將透過 LayerZero 完成您的充值。",layerZeroDepositTipGte200k:"由於充值資金大於等於 200,000 USDT,將透過 LayerZero 完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"預設充值至現貨帳戶",defaultSpotToPerpNotice:"僅支援發送 {{coin}} ({{v}}) 資產到此位址。預設充值至現貨帳戶。若需充入合約帳戶,請自現貨帳戶劃轉至合約帳戶。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",feeRate:"費率",withdrawlAmount:"提現金額",amountToReceive:"到账金額",minWithdraw:"最小提現金額",minWithdrawParsed:"最小提現 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能為空",availableDesc:"您可以提現的最大金額。當可用餘額為0或負數時,無法進行提現。",feeCalculationTip:"提現手續費按照提現金額乘以費率計算,最低為 1 USDT/USDC。費率會根據鏈上實際情況進行調整。",crossChainPoolBalance:"跨鏈資金池餘額",poolBalance:"資金池餘額",poolBalanceInsufficientTip:"提現金額大於資金池餘額,無法進行提現。請選擇資金池餘額充足的選項。"},account:{title:"帳戶",perpetual:"合約帳戶",spot:"現貨帳戶"}},bi=["en-US","ja-JP","ru-RU","zh-CN","zh-TW","de-DE","es-LA","fr-FR","it-IT"],Dl={"en-US":jm,"ja-JP":Wm,"ru-RU":Hm,"zh-CN":Vm,"zh-TW":Gm,"de-DE":Rm,"es-LA":_m,"fr-FR":zm,"it-IT":Um},qo="en-US",qm={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский","de-DE":"Deutsch","es-LA":"Español (Latinoamérica)","fr-FR":"Français","it-IT":"Italiano"},Zm=e=>bi.includes(e)?Dl[e]:Dl[qo],Km=e=>bi.includes(e),Ml=x.createContext(null),Ym=({config:e,children:t})=>{const n=x.useMemo(()=>{const r=e.locale||qo,o=Km(r)?r:qo,s=Zm(o);return{...e,currentLocale:o,translations:s}},[e]);return D.jsx(Ml.Provider,{value:n,children:t})},Ll=()=>{const e=x.useContext(Ml);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var Xm=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,gi=Math.ceil,ot=Math.floor,_e="[BigNumber Error] ",Bl=_e+"Number primitive has more than 15 significant digits: ",vt=1e14,re=14,yi=9007199254740991,vi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],fn=1e7,Ce=1e9;function Fl(e){var t,n,r,o=E.prototype={constructor:E,toString:null,valueOf:null},s=new E(1),i=20,c=4,a=-7,l=21,u=-1e7,f=1e7,p=!1,d=1,h=0,m={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},v="0123456789abcdefghijklmnopqrstuvwxyz",T=!0;function E(b,g){var w,$,C,O,k,y,A,I,P=this;if(!(P instanceof E))return new E(b,g);if(g==null){if(b&&b._isBigNumber===!0){P.s=b.s,!b.c||b.e>f?P.c=P.e=null:b.e<u?P.c=[P.e=0]:(P.e=b.e,P.c=b.c.slice());return}if((y=typeof b=="number")&&b*0==0){if(P.s=1/b<0?(b=-b,-1):1,b===~~b){for(O=0,k=b;k>=10;k/=10,O++);O>f?P.c=P.e=null:(P.e=O,P.c=[b]);return}I=String(b)}else{if(!Xm.test(I=String(b)))return r(P,I,y);P.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(O=I.indexOf("."))>-1&&(I=I.replace(".","")),(k=I.search(/e/i))>0?(O<0&&(O=k),O+=+I.slice(k+1),I=I.substring(0,k)):O<0&&(O=I.length)}else{if(ye(g,2,v.length,"Base"),g==10&&T)return P=new E(b),B(P,i+P.e+1,c);if(I=String(b),y=typeof b=="number"){if(b*0!=0)return r(P,I,y,g);if(P.s=1/b<0?(I=I.slice(1),-1):1,E.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(Bl+b)}else P.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(w=v.slice(0,g),O=k=0,A=I.length;k<A;k++)if(w.indexOf($=I.charAt(k))<0){if($=="."){if(k>O){O=A;continue}}else if(!C&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){C=!0,k=-1,O=0;continue}return r(P,String(b),y,g)}y=!1,I=n(I,g,10,P.s),(O=I.indexOf("."))>-1?I=I.replace(".",""):O=I.length}for(k=0;I.charCodeAt(k)===48;k++);for(A=I.length;I.charCodeAt(--A)===48;);if(I=I.slice(k,++A)){if(A-=k,y&&E.DEBUG&&A>15&&(b>yi||b!==ot(b)))throw Error(Bl+P.s*b);if((O=O-k-1)>f)P.c=P.e=null;else if(O<u)P.c=[P.e=0];else{if(P.e=O,P.c=[],k=(O+1)%re,O<0&&(k+=re),k<A){for(k&&P.c.push(+I.slice(0,k)),A-=re;k<A;)P.c.push(+I.slice(k,k+=re));k=re-(I=I.slice(k)).length}else k-=A;for(;k--;I+="0");P.c.push(+I)}}else P.c=[P.e=0]}E.clone=Fl,E.ROUND_UP=0,E.ROUND_DOWN=1,E.ROUND_CEIL=2,E.ROUND_FLOOR=3,E.ROUND_HALF_UP=4,E.ROUND_HALF_DOWN=5,E.ROUND_HALF_EVEN=6,E.ROUND_HALF_CEIL=7,E.ROUND_HALF_FLOOR=8,E.EUCLID=9,E.config=E.set=function(b){var g,w;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(g="DECIMAL_PLACES")&&(w=b[g],ye(w,0,Ce,g),i=w),b.hasOwnProperty(g="ROUNDING_MODE")&&(w=b[g],ye(w,0,8,g),c=w),b.hasOwnProperty(g="EXPONENTIAL_AT")&&(w=b[g],w&&w.pop?(ye(w[0],-Ce,0,g),ye(w[1],0,Ce,g),a=w[0],l=w[1]):(ye(w,-Ce,Ce,g),a=-(l=w<0?-w:w))),b.hasOwnProperty(g="RANGE"))if(w=b[g],w&&w.pop)ye(w[0],-Ce,-1,g),ye(w[1],1,Ce,g),u=w[0],f=w[1];else if(ye(w,-Ce,Ce,g),w)u=-(f=w<0?-w:w);else throw Error(_e+g+" cannot be zero: "+w);if(b.hasOwnProperty(g="CRYPTO"))if(w=b[g],w===!!w)if(w)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=w;else throw p=!w,Error(_e+"crypto unavailable");else p=w;else throw Error(_e+g+" not true or false: "+w);if(b.hasOwnProperty(g="MODULO_MODE")&&(w=b[g],ye(w,0,9,g),d=w),b.hasOwnProperty(g="POW_PRECISION")&&(w=b[g],ye(w,0,Ce,g),h=w),b.hasOwnProperty(g="FORMAT"))if(w=b[g],typeof w=="object")m=w;else throw Error(_e+g+" not an object: "+w);if(b.hasOwnProperty(g="ALPHABET"))if(w=b[g],typeof w=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(w))T=w.slice(0,10)=="0123456789",v=w;else throw Error(_e+g+" invalid: "+w)}else throw Error(_e+"Object expected: "+b);return{DECIMAL_PLACES:i,ROUNDING_MODE:c,EXPONENTIAL_AT:[a,l],RANGE:[u,f],CRYPTO:p,MODULO_MODE:d,POW_PRECISION:h,FORMAT:m,ALPHABET:v}},E.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!E.DEBUG)return!0;var g,w,$=b.c,C=b.e,O=b.s;e:if({}.toString.call($)=="[object Array]"){if((O===1||O===-1)&&C>=-Ce&&C<=Ce&&C===ot(C)){if($[0]===0){if(C===0&&$.length===1)return!0;break e}if(g=(C+1)%re,g<1&&(g+=re),String($[0]).length==g){for(g=0;g<$.length;g++)if(w=$[g],w<0||w>=vt||w!==ot(w))break e;if(w!==0)return!0}}}else if($===null&&C===null&&(O===null||O===1||O===-1))return!0;throw Error(_e+"Invalid BigNumber: "+b)},E.maximum=E.max=function(){return N(arguments,-1)},E.minimum=E.min=function(){return N(arguments,1)},E.random=function(){var b=9007199254740992,g=Math.random()*b&2097151?function(){return ot(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(w){var $,C,O,k,y,A=0,I=[],P=new E(s);if(w==null?w=i:ye(w,0,Ce),k=gi(w/re),p)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(k*=2));A<k;)y=$[A]*131072+($[A+1]>>>11),y>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),$[A]=C[0],$[A+1]=C[1]):(I.push(y%1e14),A+=2);A=k/2}else if(crypto.randomBytes){for($=crypto.randomBytes(k*=7);A<k;)y=($[A]&31)*281474976710656+$[A+1]*1099511627776+$[A+2]*4294967296+$[A+3]*16777216+($[A+4]<<16)+($[A+5]<<8)+$[A+6],y>=9e15?crypto.randomBytes(7).copy($,A):(I.push(y%1e14),A+=7);A=k/7}else throw p=!1,Error(_e+"crypto unavailable");if(!p)for(;A<k;)y=g(),y<9e15&&(I[A++]=y%1e14);for(k=I[--A],w%=re,k&&w&&(y=vi[re-w],I[A]=ot(k/y)*y);I[A]===0;I.pop(),A--);if(A<0)I=[O=0];else{for(O=-1;I[0]===0;I.splice(0,1),O-=re);for(A=1,y=I[0];y>=10;y/=10,A++);A<re&&(O-=re-A)}return P.e=O,P.c=I,P}}(),E.sum=function(){for(var b=1,g=arguments,w=new E(g[0]);b<g.length;)w=w.plus(g[b++]);return w},n=function(){var b="0123456789";function g(w,$,C,O){for(var k,y=[0],A,I=0,P=w.length;I<P;){for(A=y.length;A--;y[A]*=$);for(y[0]+=O.indexOf(w.charAt(I++)),k=0;k<y.length;k++)y[k]>C-1&&(y[k+1]==null&&(y[k+1]=0),y[k+1]+=y[k]/C|0,y[k]%=C)}return y.reverse()}return function(w,$,C,O,k){var y,A,I,P,L,j,z,_,H=w.indexOf("."),Y=i,G=c;for(H>=0&&(P=h,h=0,w=w.replace(".",""),_=new E($),j=_.pow(w.length-H),h=P,_.c=g(Vt(it(j.c),j.e,"0"),10,C,b),_.e=_.c.length),z=g(w,$,C,k?(y=v,b):(y=b,v)),I=P=z.length;z[--P]==0;z.pop());if(!z[0])return y.charAt(0);if(H<0?--I:(j.c=z,j.e=I,j.s=O,j=t(j,_,Y,G,C),z=j.c,L=j.r,I=j.e),A=I+Y+1,H=z[A],P=C/2,L=L||A<0||z[A+1]!=null,L=G<4?(H!=null||L)&&(G==0||G==(j.s<0?3:2)):H>P||H==P&&(G==4||L||G==6&&z[A-1]&1||G==(j.s<0?8:7)),A<1||!z[0])w=L?Vt(y.charAt(1),-Y,y.charAt(0)):y.charAt(0);else{if(z.length=A,L)for(--C;++z[--A]>C;)z[A]=0,A||(++I,z=[1].concat(z));for(P=z.length;!z[--P];);for(H=0,w="";H<=P;w+=y.charAt(z[H++]));w=Vt(w,I,y.charAt(0))}return w}}(),t=function(){function b($,C,O){var k,y,A,I,P=0,L=$.length,j=C%fn,z=C/fn|0;for($=$.slice();L--;)A=$[L]%fn,I=$[L]/fn|0,k=z*A+I*j,y=j*A+k%fn*fn+P,P=(y/O|0)+(k/fn|0)+z*I,$[L]=y%O;return P&&($=[P].concat($)),$}function g($,C,O,k){var y,A;if(O!=k)A=O>k?1:-1;else for(y=A=0;y<O;y++)if($[y]!=C[y]){A=$[y]>C[y]?1:-1;break}return A}function w($,C,O,k){for(var y=0;O--;)$[O]-=y,y=$[O]<C[O]?1:0,$[O]=y*k+$[O]-C[O];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,C,O,k,y){var A,I,P,L,j,z,_,H,Y,G,W,Z,J,ee,fe,pe,he,se=$.s==C.s?1:-1,me=$.c,te=C.c;if(!me||!me[0]||!te||!te[0])return new E(!$.s||!C.s||(me?te&&me[0]==te[0]:!te)?NaN:me&&me[0]==0||!te?se*0:se/0);for(H=new E(se),Y=H.c=[],I=$.e-C.e,se=O+I+1,y||(y=vt,I=st($.e/re)-st(C.e/re),se=se/re|0),P=0;te[P]==(me[P]||0);P++);if(te[P]>(me[P]||0)&&I--,se<0)Y.push(1),L=!0;else{for(ee=me.length,pe=te.length,P=0,se+=2,j=ot(y/(te[0]+1)),j>1&&(te=b(te,j,y),me=b(me,j,y),pe=te.length,ee=me.length),J=pe,G=me.slice(0,pe),W=G.length;W<pe;G[W++]=0);he=te.slice(),he=[0].concat(he),fe=te[0],te[1]>=y/2&&fe++;do{if(j=0,A=g(te,G,pe,W),A<0){if(Z=G[0],pe!=W&&(Z=Z*y+(G[1]||0)),j=ot(Z/fe),j>1)for(j>=y&&(j=y-1),z=b(te,j,y),_=z.length,W=G.length;g(z,G,_,W)==1;)j--,w(z,pe<_?he:te,_,y),_=z.length,A=1;else j==0&&(A=j=1),z=te.slice(),_=z.length;if(_<W&&(z=[0].concat(z)),w(G,z,W,y),W=G.length,A==-1)for(;g(te,G,pe,W)<1;)j++,w(G,pe<W?he:te,W,y),W=G.length}else A===0&&(j++,G=[0]);Y[P++]=j,G[0]?G[W++]=me[J]||0:(G=[me[J]],W=1)}while((J++<ee||G[0]!=null)&&se--);L=G[0]!=null,Y[0]||Y.splice(0,1)}if(y==vt){for(P=1,se=Y[0];se>=10;se/=10,P++);B(H,O+(H.e=P+I*re-1)+1,k,L)}else H.e=I,H.r=+L;return H}}();function S(b,g,w,$){var C,O,k,y,A;if(w==null?w=c:ye(w,0,8),!b.c)return b.toString();if(C=b.c[0],k=b.e,g==null)A=it(b.c),A=$==1||$==2&&(k<=a||k>=l)?Ko(A,k):Vt(A,k,"0");else if(b=B(new E(b),g,w),O=b.e,A=it(b.c),y=A.length,$==1||$==2&&(g<=O||O<=a)){for(;y<g;A+="0",y++);A=Ko(A,O)}else if(g-=k+($===2&&O>k),A=Vt(A,O,"0"),O+1>y){if(--g>0)for(A+=".";g--;A+="0");}else if(g+=O-y,g>0)for(O+1==y&&(A+=".");g--;A+="0");return b.s<0&&C?"-"+A:A}function N(b,g){for(var w,$,C=1,O=new E(b[0]);C<b.length;C++)$=new E(b[C]),(!$.s||(w=On(O,$))===g||w===0&&O.s===g)&&(O=$);return O}function M(b,g,w){for(var $=1,C=g.length;!g[--C];g.pop());for(C=g[0];C>=10;C/=10,$++);return(w=$+w*re-1)>f?b.c=b.e=null:w<u?b.c=[b.e=0]:(b.e=w,b.c=g),b}r=function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,g=/^([^.]+)\.$/,w=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(O,k,y,A){var I,P=y?k:k.replace(C,"");if($.test(P))O.s=isNaN(P)?null:P<0?-1:1;else{if(!y&&(P=P.replace(b,function(L,j,z){return I=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!A||A==I?j:L}),A&&(I=A,P=P.replace(g,"$1").replace(w,"0.$1")),k!=P))return new E(P,I);if(E.DEBUG)throw Error(_e+"Not a"+(A?" base "+A:"")+" number: "+k);O.s=null}O.c=O.e=null}}();function B(b,g,w,$){var C,O,k,y,A,I,P,L=b.c,j=vi;if(L){e:{for(C=1,y=L[0];y>=10;y/=10,C++);if(O=g-C,O<0)O+=re,k=g,A=L[I=0],P=ot(A/j[C-k-1]%10);else if(I=gi((O+1)/re),I>=L.length)if($){for(;L.length<=I;L.push(0));A=P=0,C=1,O%=re,k=O-re+1}else break e;else{for(A=y=L[I],C=1;y>=10;y/=10,C++);O%=re,k=O-re+C,P=k<0?0:ot(A/j[C-k-1]%10)}if($=$||g<0||L[I+1]!=null||(k<0?A:A%j[C-k-1]),$=w<4?(P||$)&&(w==0||w==(b.s<0?3:2)):P>5||P==5&&(w==4||$||w==6&&(O>0?k>0?A/j[C-k]:0:L[I-1])%10&1||w==(b.s<0?8:7)),g<1||!L[0])return L.length=0,$?(g-=b.e+1,L[0]=j[(re-g%re)%re],b.e=-g||0):L[0]=b.e=0,b;if(O==0?(L.length=I,y=1,I--):(L.length=I+1,y=j[re-O],L[I]=k>0?ot(A/j[C-k]%j[k])*y:0),$)for(;;)if(I==0){for(O=1,k=L[0];k>=10;k/=10,O++);for(k=L[0]+=y,y=1;k>=10;k/=10,y++);O!=y&&(b.e++,L[0]==vt&&(L[0]=1));break}else{if(L[I]+=y,L[I]!=vt)break;L[I--]=0,y=1}for(O=L.length;L[--O]===0;L.pop());}b.e>f?b.c=b.e=null:b.e<u&&(b.c=[b.e=0])}return b}function F(b){var g,w=b.e;return w===null?b.toString():(g=it(b.c),g=w<=a||w>=l?Ko(g,w):Vt(g,w,"0"),b.s<0?"-"+g:g)}return o.absoluteValue=o.abs=function(){var b=new E(this);return b.s<0&&(b.s=1),b},o.comparedTo=function(b,g){return On(this,new E(b,g))},o.decimalPlaces=o.dp=function(b,g){var w,$,C,O=this;if(b!=null)return ye(b,0,Ce),g==null?g=c:ye(g,0,8),B(new E(O),b+O.e+1,g);if(!(w=O.c))return null;if($=((C=w.length-1)-st(this.e/re))*re,C=w[C])for(;C%10==0;C/=10,$--);return $<0&&($=0),$},o.dividedBy=o.div=function(b,g){return t(this,new E(b,g),i,c)},o.dividedToIntegerBy=o.idiv=function(b,g){return t(this,new E(b,g),0,1)},o.exponentiatedBy=o.pow=function(b,g){var w,$,C,O,k,y,A,I,P,L=this;if(b=new E(b),b.c&&!b.isInteger())throw Error(_e+"Exponent not an integer: "+F(b));if(g!=null&&(g=new E(g)),y=b.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!b.c||!b.c[0])return P=new E(Math.pow(+F(L),y?b.s*(2-Zo(b)):+F(b))),g?P.mod(g):P;if(A=b.s<0,g){if(g.c?!g.c[0]:!g.s)return new E(NaN);$=!A&&L.isInteger()&&g.isInteger(),$&&(L=L.mod(g))}else{if(b.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||y&&L.c[1]>=24e7:L.c[0]<8e13||y&&L.c[0]<=9999975e7)))return O=L.s<0&&Zo(b)?-0:0,L.e>-1&&(O=1/O),new E(A?1/O:O);h&&(O=gi(h/re+2))}for(y?(w=new E(.5),A&&(b.s=1),I=Zo(b)):(C=Math.abs(+F(b)),I=C%2),P=new E(s);;){if(I){if(P=P.times(L),!P.c)break;O?P.c.length>O&&(P.c.length=O):$&&(P=P.mod(g))}if(C){if(C=ot(C/2),C===0)break;I=C%2}else if(b=b.times(w),B(b,b.e+1,1),b.e>14)I=Zo(b);else{if(C=+F(b),C===0)break;I=C%2}L=L.times(L),O?L.c&&L.c.length>O&&(L.c.length=O):$&&(L=L.mod(g))}return $?P:(A&&(P=s.div(P)),g?P.mod(g):O?B(P,h,c,k):P)},o.integerValue=function(b){var g=new E(this);return b==null?b=c:ye(b,0,8),B(g,g.e+1,b)},o.isEqualTo=o.eq=function(b,g){return On(this,new E(b,g))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(b,g){return On(this,new E(b,g))>0},o.isGreaterThanOrEqualTo=o.gte=function(b,g){return(g=On(this,new E(b,g)))===1||g===0},o.isInteger=function(){return!!this.c&&st(this.e/re)>this.c.length-2},o.isLessThan=o.lt=function(b,g){return On(this,new E(b,g))<0},o.isLessThanOrEqualTo=o.lte=function(b,g){return(g=On(this,new E(b,g)))===-1||g===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(b,g){var w,$,C,O,k=this,y=k.s;if(b=new E(b,g),g=b.s,!y||!g)return new E(NaN);if(y!=g)return b.s=-g,k.plus(b);var A=k.e/re,I=b.e/re,P=k.c,L=b.c;if(!A||!I){if(!P||!L)return P?(b.s=-g,b):new E(L?k:NaN);if(!P[0]||!L[0])return L[0]?(b.s=-g,b):new E(P[0]?k:c==3?-0:0)}if(A=st(A),I=st(I),P=P.slice(),y=A-I){for((O=y<0)?(y=-y,C=P):(I=A,C=L),C.reverse(),g=y;g--;C.push(0));C.reverse()}else for($=(O=(y=P.length)<(g=L.length))?y:g,y=g=0;g<$;g++)if(P[g]!=L[g]){O=P[g]<L[g];break}if(O&&(C=P,P=L,L=C,b.s=-b.s),g=($=L.length)-(w=P.length),g>0)for(;g--;P[w++]=0);for(g=vt-1;$>y;){if(P[--$]<L[$]){for(w=$;w&&!P[--w];P[w]=g);--P[w],P[$]+=vt}P[$]-=L[$]}for(;P[0]==0;P.splice(0,1),--I);return P[0]?M(b,P,I):(b.s=c==3?-1:1,b.c=[b.e=0],b)},o.modulo=o.mod=function(b,g){var w,$,C=this;return b=new E(b,g),!C.c||!b.s||b.c&&!b.c[0]?new E(NaN):!b.c||C.c&&!C.c[0]?new E(C):(d==9?($=b.s,b.s=1,w=t(C,b,0,3),b.s=$,w.s*=$):w=t(C,b,0,d),b=C.minus(w.times(b)),!b.c[0]&&d==1&&(b.s=C.s),b)},o.multipliedBy=o.times=function(b,g){var w,$,C,O,k,y,A,I,P,L,j,z,_,H,Y,G=this,W=G.c,Z=(b=new E(b,g)).c;if(!W||!Z||!W[0]||!Z[0])return!G.s||!b.s||W&&!W[0]&&!Z||Z&&!Z[0]&&!W?b.c=b.e=b.s=null:(b.s*=G.s,!W||!Z?b.c=b.e=null:(b.c=[0],b.e=0)),b;for($=st(G.e/re)+st(b.e/re),b.s*=G.s,A=W.length,L=Z.length,A<L&&(_=W,W=Z,Z=_,C=A,A=L,L=C),C=A+L,_=[];C--;_.push(0));for(H=vt,Y=fn,C=L;--C>=0;){for(w=0,j=Z[C]%Y,z=Z[C]/Y|0,k=A,O=C+k;O>C;)I=W[--k]%Y,P=W[k]/Y|0,y=z*I+P*j,I=j*I+y%Y*Y+_[O]+w,w=(I/H|0)+(y/Y|0)+z*P,_[O--]=I%H;_[O]=w}return w?++$:_.splice(0,1),M(b,_,$)},o.negated=function(){var b=new E(this);return b.s=-b.s||null,b},o.plus=function(b,g){var w,$=this,C=$.s;if(b=new E(b,g),g=b.s,!C||!g)return new E(NaN);if(C!=g)return b.s=-g,$.minus(b);var O=$.e/re,k=b.e/re,y=$.c,A=b.c;if(!O||!k){if(!y||!A)return new E(C/0);if(!y[0]||!A[0])return A[0]?b:new E(y[0]?$:C*0)}if(O=st(O),k=st(k),y=y.slice(),C=O-k){for(C>0?(k=O,w=A):(C=-C,w=y),w.reverse();C--;w.push(0));w.reverse()}for(C=y.length,g=A.length,C-g<0&&(w=A,A=y,y=w,g=C),C=0;g;)C=(y[--g]=y[g]+A[g]+C)/vt|0,y[g]=vt===y[g]?0:y[g]%vt;return C&&(y=[C].concat(y),++k),M(b,y,k)},o.precision=o.sd=function(b,g){var w,$,C,O=this;if(b!=null&&b!==!!b)return ye(b,1,Ce),g==null?g=c:ye(g,0,8),B(new E(O),b,g);if(!(w=O.c))return null;if(C=w.length-1,$=C*re+1,C=w[C]){for(;C%10==0;C/=10,$--);for(C=w[0];C>=10;C/=10,$++);}return b&&O.e+1>$&&($=O.e+1),$},o.shiftedBy=function(b){return ye(b,-yi,yi),this.times("1e"+b)},o.squareRoot=o.sqrt=function(){var b,g,w,$,C,O=this,k=O.c,y=O.s,A=O.e,I=i+4,P=new E("0.5");if(y!==1||!k||!k[0])return new E(!y||y<0&&(!k||k[0])?NaN:k?O:1/0);if(y=Math.sqrt(+F(O)),y==0||y==1/0?(g=it(k),(g.length+A)%2==0&&(g+="0"),y=Math.sqrt(+g),A=st((A+1)/2)-(A<0||A%2),y==1/0?g="5e"+A:(g=y.toExponential(),g=g.slice(0,g.indexOf("e")+1)+A),w=new E(g)):w=new E(y+""),w.c[0]){for(A=w.e,y=A+I,y<3&&(y=0);;)if(C=w,w=P.times(C.plus(t(O,C,I,1))),it(C.c).slice(0,y)===(g=it(w.c)).slice(0,y))if(w.e<A&&--y,g=g.slice(y-3,y+1),g=="9999"||!$&&g=="4999"){if(!$&&(B(C,C.e+i+2,0),C.times(C).eq(O))){w=C;break}I+=4,y+=4,$=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(B(w,w.e+i+2,1),b=!w.times(w).eq(O));break}}return B(w,w.e+i+1,c,b)},o.toExponential=function(b,g){return b!=null&&(ye(b,0,Ce),b++),S(this,b,g,1)},o.toFixed=function(b,g){return b!=null&&(ye(b,0,Ce),b=b+this.e+1),S(this,b,g)},o.toFormat=function(b,g,w){var $,C=this;if(w==null)b!=null&&g&&typeof g=="object"?(w=g,g=null):b&&typeof b=="object"?(w=b,b=g=null):w=m;else if(typeof w!="object")throw Error(_e+"Argument not an object: "+w);if($=C.toFixed(b,g),C.c){var O,k=$.split("."),y=+w.groupSize,A=+w.secondaryGroupSize,I=w.groupSeparator||"",P=k[0],L=k[1],j=C.s<0,z=j?P.slice(1):P,_=z.length;if(A&&(O=y,y=A,A=O,_-=O),y>0&&_>0){for(O=_%y||y,P=z.substr(0,O);O<_;O+=y)P+=I+z.substr(O,y);A>0&&(P+=I+z.slice(O)),j&&(P="-"+P)}$=L?P+(w.decimalSeparator||"")+((A=+w.fractionGroupSize)?L.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(w.fractionGroupSeparator||"")):L):P}return(w.prefix||"")+$+(w.suffix||"")},o.toFraction=function(b){var g,w,$,C,O,k,y,A,I,P,L,j,z=this,_=z.c;if(b!=null&&(y=new E(b),!y.isInteger()&&(y.c||y.s!==1)||y.lt(s)))throw Error(_e+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+F(y));if(!_)return new E(z);for(g=new E(s),I=w=new E(s),$=A=new E(s),j=it(_),O=g.e=j.length-z.e-1,g.c[0]=vi[(k=O%re)<0?re+k:k],b=!b||y.comparedTo(g)>0?O>0?g:I:y,k=f,f=1/0,y=new E(j),A.c[0]=0;P=t(y,g,0,1),C=w.plus(P.times($)),C.comparedTo(b)!=1;)w=$,$=C,I=A.plus(P.times(C=I)),A=C,g=y.minus(P.times(C=g)),y=C;return C=t(b.minus(w),$,0,1),A=A.plus(C.times(I)),w=w.plus(C.times($)),A.s=I.s=z.s,O=O*2,L=t(I,$,O,c).minus(z).abs().comparedTo(t(A,w,O,c).minus(z).abs())<1?[I,$]:[A,w],f=k,L},o.toNumber=function(){return+F(this)},o.toPrecision=function(b,g){return b!=null&&ye(b,1,Ce),S(this,b,g,2)},o.toString=function(b){var g,w=this,$=w.s,C=w.e;return C===null?$?(g="Infinity",$<0&&(g="-"+g)):g="NaN":(b==null?g=C<=a||C>=l?Ko(it(w.c),C):Vt(it(w.c),C,"0"):b===10&&T?(w=B(new E(w),i+C+1,c),g=Vt(it(w.c),w.e,"0")):(ye(b,2,v.length,"Base"),g=n(Vt(it(w.c),C,"0"),10,b,$,!0)),$<0&&w.c[0]&&(g="-"+g)),g},o.valueOf=o.toJSON=function(){return F(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&E.set(e),E}function st(e){var t=e|0;return e>0||e===t?t:t-1}function it(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=re-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function On(e,t){var n,r,o=e.c,s=t.c,i=e.s,c=t.s,a=e.e,l=t.e;if(!i||!c)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-c:i;if(i!=c)return i;if(n=i<0,r=a==l,!o||!s)return r?0:!o^n?1:-1;if(!r)return a>l^n?1:-1;for(c=(a=o.length)<(l=s.length)?a:l,i=0;i<c;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return a==l?0:a>l^n?1:-1}function ye(e,t,n,r){if(e<t||e>n||e!==ot(e))throw Error(_e+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Zo(e){var t=e.c.length-1;return st(e.e/re)==t&&e.c[t]%2!=0}function Ko(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Vt(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Ie=Fl();const Qm=(e,t=6)=>{try{const n=new Ie(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Ie.ROUND_DOWN),[o,s=""]=r.toString().split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const c=(s||"").padEnd(t,"0");return`${i}.${c}`}return i}catch(n){return console.warn("formatThousands error:",n),"0"}},wt=()=>{const{translations:e,currentLocale:t}=Ll();return{t:(s,i)=>{try{const c=s.split(".");let a=e;for(const u of c)if(a&&typeof a=="object"&&u in a)a=a[u];else return s;let l=typeof a=="string"?a:s;return i&&typeof l=="string"&&Object.keys(i).forEach(u=>{const f=`{{${u}}}`;l=l.replace(new RegExp(f,"g"),String(i[u]))}),l}catch(c){return console.warn(`Translation error for key "${s}":`,c),s}},translations:e,locale:t,getTranslationObject:s=>{try{const i=s.split(".");let c=e;for(const a of i)if(c&&typeof c=="object"&&a in c)c=c[a];else return{};return typeof c=="object"?c:{}}catch(i){return console.warn(`Translation object error for key "${s}":`,i),{}}},hasTranslation:s=>{try{const i=s.split(".");let c=e;for(const a of i)if(c&&typeof c=="object"&&a in c)c=c[a];else return!1;return typeof c=="string"}catch{return!1}}}},Jm="1.1.0";let ze=class Cl extends Error{constructor(t,n={}){var i;const r=n.cause instanceof Cl?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof Cl&&n.cause.docsPath||n.docsPath,s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${Jm}`].join(`
51
- `);super(s),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=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function Gt(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Rl=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,jl=/^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)?$/,_l=/^\(.+?\).*?$/,zl=/^tuple(?<array>(\[(\d*)\])*)$/;function wi(e){let t=e.type;if(zl.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let o=0;o<n;o++){const s=e.components[o];t+=wi(s),o<n-1&&(t+=", ")}const r=Gt(zl,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,wi({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function er(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=wi(o),r!==n-1&&(t+=", ")}return t}function Yo(e){var t;return e.type==="function"?`function ${e.name}(${er(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${er(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${er(e.inputs)})`:e.type==="error"?`error ${e.name}(${er(e.inputs)})`:e.type==="constructor"?`constructor(${er(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Ul=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function eb(e){return Ul.test(e)}function tb(e){return Gt(Ul,e)}const Wl=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function nb(e){return Wl.test(e)}function rb(e){return Gt(Wl,e)}const Hl=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function ob(e){return Hl.test(e)}function sb(e){return Gt(Hl,e)}const Vl=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Xo(e){return Vl.test(e)}function ib(e){return Gt(Vl,e)}const Gl=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function ab(e){return Gl.test(e)}function cb(e){return Gt(Gl,e)}const ql=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function lb(e){return ql.test(e)}function ub(e){return Gt(ql,e)}const fb=/^receive\(\) external payable$/;function db(e){return fb.test(e)}const Zl=new Set(["memory","indexed","storage","calldata"]),pb=new Set(["indexed"]),xi=new Set(["calldata","memory","storage"]);class hb extends ze{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 mb extends ze{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 bb extends ze{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 gb extends ze{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class yb extends ze{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class vb extends ze{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 wb extends ze{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 xb extends ze{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 Eb extends ze{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"})}}class tr extends ze{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Sb extends ze{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Pb extends ze{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 Tb extends ze{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 Ab extends ze{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 $b(e,t,n){let r="";if(n)for(const o of Object.entries(n)){if(!o)continue;let s="";for(const i of o[1])s+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${o[0]}{${s}})`}return t?`${t}:${e}${r}`:e}const Ei=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 Si(e,t={}){if(ob(e))return Cb(e,t);if(nb(e))return Nb(e,t);if(eb(e))return Ob(e,t);if(ab(e))return Ib(e,t);if(lb(e))return kb(e);if(db(e))return{type:"receive",stateMutability:"payable"};throw new Sb({signature:e})}function Cb(e,t={}){const n=sb(e);if(!n)throw new tr({signature:e,type:"function"});const r=Qe(n.parameters),o=[],s=r.length;for(let c=0;c<s;c++)o.push(qt(r[c],{modifiers:xi,structs:t,type:"function"}));const i=[];if(n.returns){const c=Qe(n.returns),a=c.length;for(let l=0;l<a;l++)i.push(qt(c[l],{modifiers:xi,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function Nb(e,t={}){const n=rb(e);if(!n)throw new tr({signature:e,type:"event"});const r=Qe(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(qt(r[i],{modifiers:pb,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function Ob(e,t={}){const n=tb(e);if(!n)throw new tr({signature:e,type:"error"});const r=Qe(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(qt(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function Ib(e,t={}){const n=cb(e);if(!n)throw new tr({signature:e,type:"constructor"});const r=Qe(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(qt(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function kb(e){const t=ub(e);if(!t)throw new tr({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const Db=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Mb=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Lb=/^u?int$/;function qt(e,t){var f,p;const n=$b(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Ei.has(n))return Ei.get(n);const r=_l.test(e),o=Gt(r?Mb:Db,e);if(!o)throw new yb({param:e});if(o.name&&Fb(o.name))throw new vb({param:e,name:o.name});const s=o.name?{name:o.name}:{},i=o.modifier==="indexed"?{indexed:!0}:{},c=(t==null?void 0:t.structs)??{};let a,l={};if(r){a="tuple";const d=Qe(o.type),h=[],m=d.length;for(let v=0;v<m;v++)h.push(qt(d[v],{structs:c}));l={components:h}}else if(o.type in c)a="tuple",l={components:c[o.type]};else if(Lb.test(o.type))a=`${o.type}256`;else if(o.type==="address payable")a="address";else if(a=o.type,(t==null?void 0:t.type)!=="struct"&&!Kl(a))throw new bb({type:a});if(o.modifier){if(!((p=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&p.call(f,o.modifier)))throw new wb({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(xi.has(o.modifier)&&!Rb(a,!!o.array))throw new xb({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const u={type:`${a}${o.array??""}`,...s,...i,...l};return Ei.set(n,u),u}function Qe(e,t=[],n="",r=0){const o=e.trim().length;for(let s=0;s<o;s++){const i=e[s],c=e.slice(s+1);switch(i){case",":return r===0?Qe(c,[...t,n.trim()]):Qe(c,t,`${n}${i}`,r);case"(":return Qe(c,t,`${n}${i}`,r+1);case")":return Qe(c,t,`${n}${i}`,r-1);default:return Qe(c,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new Ab({current:n,depth:r});return t.push(n.trim()),t}function Kl(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Rl.test(e)||jl.test(e)}const Bb=/^(?: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 Fb(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Rl.test(e)||jl.test(e)||Bb.test(e)}function Rb(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Pi(e){const t={},n=e.length;for(let i=0;i<n;i++){const c=e[i];if(!Xo(c))continue;const a=ib(c);if(!a)throw new tr({signature:c,type:"struct"});const l=a.properties.split(";"),u=[],f=l.length;for(let p=0;p<f;p++){const h=l[p].trim();if(!h)continue;const m=qt(h,{type:"struct"});u.push(m)}if(!u.length)throw new Pb({signature:c});t[a.name]=u}const r={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[c,a]=o[i];r[c]=Yl(a,t)}return r}const jb=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Yl(e,t,n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(_l.test(i.type))r.push(i);else{const a=Gt(jb,i.type);if(!(a!=null&&a.type))throw new Eb({abiParameter:i});const{array:l,type:u}=a;if(u in t){if(n.has(u))throw new Tb({type:u});r.push({...i,type:`tuple${l??""}`,components:Yl(t[u]??[],t,new Set([...n,u]))})}else if(Kl(u))r.push(i);else throw new mb({type:u})}}return r}function Xl(e){const t=Pi(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];Xo(s)||n.push(Si(s,t))}return n}function Ql(e){let t;if(typeof e=="string")t=Si(e);else{const n=Pi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!Xo(s)){t=Si(s,n);break}}}if(!t)throw new hb({signature:e});return t}function Jl(e){const t=[];if(typeof e=="string"){const n=Qe(e),r=n.length;for(let o=0;o<r;o++)t.push(qt(n[o],{modifiers:Zl}))}else{const n=Pi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(Xo(s))continue;const i=Qe(s),c=i.length;for(let a=0;a<c;a++)t.push(qt(i[a],{modifiers:Zl,structs:n}))}}if(t.length===0)throw new gb({params:e});return t}function X(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}function xt(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Jb(e.type);return`${e.name}(${Qo(e.inputs,{includeName:t})})`}function Qo(e,{includeName:t=!1}={}){return e?e.map(n=>_b(n,{includeName:t})).join(t?", ":","):""}function _b(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Qo(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Et(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function ve(e){return Et(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const eu="2.42.1";let Fr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${eu}`},V=class Nl extends Error{constructor(t,n={}){var c;const r=(()=>{var a;return n.cause instanceof Nl?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof Nl&&n.cause.docsPath||n.docsPath,s=(c=Fr.getDocsUrl)==null?void 0:c.call(Fr,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...Fr.version?[`Version: ${Fr.version}`]:[]].join(`
52
- `);super(i,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=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=eu}walk(t){return tu(this,t)}};function tu(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?tu(e.cause,t):t?null:e}class zb extends V{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(`
53
- `),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class nu extends V{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(`
54
- `),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class ru extends V{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
55
- `),{metaMessages:[`Params: (${Qo(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 Rr extends V{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class Ub extends V{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
56
- `),{name:"AbiEncodingArrayLengthMismatchError"})}}class Wb extends V{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ve(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Hb extends V{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
57
- `),{name:"AbiEncodingLengthMismatchError"})}}class Vb extends V{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(`
58
- `),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class ou extends V{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(`
59
- `),{docsPath:n,name:"AbiErrorNotFoundError"})}}class su extends V{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(`
60
- `),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class Gb extends V{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class qb extends V{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(`
61
- `),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class iu extends V{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(`
62
- `),{docsPath:n,name:"AbiEventNotFoundError"})}}class nr extends V{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(`
63
- `),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class au extends V{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(`
64
- `),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class Zb extends V{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(`
65
- `),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class Kb extends V{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${xt(t.abiItem)}\`, and`,`\`${n.type}\` in \`${xt(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let Yb=class extends V{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class Jo extends V{constructor({abiItem:t,data:n,params:r,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(`
66
- `),{metaMessages:[`Params: (${Qo(r,{includeName:!0})})`,`Data: ${n} (${o} 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=o}}class Ti extends V{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${xt(t,{includeName:!0})}".`].join(`
67
- `),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class Xb extends V{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
68
- `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Qb extends V{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
69
- `),{docsPath:n,name:"InvalidAbiDecodingType"})}}let cu=class extends V{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
70
- `),{name:"InvalidArrayError"})}};class Jb extends V{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
71
- `),{name:"InvalidDefinitionTypeError"})}}class e1 extends V{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let lu=class extends V{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},uu=class extends V{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 fu extends V{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 rr(e,{dir:t,size:n=32}={}){return typeof e=="string"?dn(e,{dir:t,size:n}):t1(e,{dir:t,size:n})}function dn(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new uu({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function t1(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new uu({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o<n;o++){const s=t==="right";r[s?o:n-o-1]=e[s?o:e.length-o-1]}return r}let du=class extends V{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},n1=class extends V{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 r1 extends V{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let o1=class extends V{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function In(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)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}function St(e,{size:t}){if(ve(e)>t)throw new o1({givenSize:ve(e),maxSize:t})}function Dt(e,t={}){const{signed:n}=t;t.size&&St(e,{size:t.size});const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function s1(e,t={}){let n=e;if(t.size&&(St(n,{size:t.size}),n=In(n)),In(n)==="0x00")return!1;if(In(n)==="0x01")return!0;throw new r1(n)}function Zt(e,t={}){return Number(Dt(e,t))}const i1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function pn(e,t={}){return typeof e=="number"||typeof e=="bigint"?Q(e,t):typeof e=="string"?jr(e,t):typeof e=="boolean"?pu(e,t):Ae(e,t)}function pu(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(St(n,{size:t.size}),rr(n,{size:t.size})):n}function Ae(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=i1[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(St(r,{size:t.size}),rr(r,{dir:"right",size:t.size})):r}function Q(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const a=typeof e=="bigint"?"n":"";throw new du({max:s?`${s}${a}`:void 0,min:`${i}${a}`,signed:n,size:r,value:`${e}${a}`})}const c=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?rr(c,{size:r}):c}const a1=new TextEncoder;function jr(e,t={}){const n=a1.encode(e);return Ae(n,t)}const c1=new TextEncoder;function or(e,t={}){return typeof e=="number"||typeof e=="bigint"?u1(e,t):typeof e=="boolean"?l1(e,t):Et(e)?Mt(e,t):kn(e,t)}function l1(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(St(n,{size:t.size}),rr(n,{size:t.size})):n}const Kt={zero:48,nine:57,A:65,F:70,a:97,f:102};function hu(e){if(e>=Kt.zero&&e<=Kt.nine)return e-Kt.zero;if(e>=Kt.A&&e<=Kt.F)return e-(Kt.A-10);if(e>=Kt.a&&e<=Kt.f)return e-(Kt.a-10)}function Mt(e,t={}){let n=e;t.size&&(St(n,{size:t.size}),n=rr(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,s=new Uint8Array(o);for(let i=0,c=0;i<o;i++){const a=hu(r.charCodeAt(c++)),l=hu(r.charCodeAt(c++));if(a===void 0||l===void 0)throw new V(`Invalid byte sequence ("${r[c-2]}${r[c-1]}" in "${r}").`);s[i]=a*16+l}return s}function u1(e,t){const n=Q(e,t);return Mt(n)}function kn(e,t={}){const n=c1.encode(e);return typeof t.size=="number"?(St(n,{size:t.size}),rr(n,{dir:"right",size:t.size})):n}const es=BigInt(2**32-1),mu=BigInt(32);function f1(e,t=!1){return t?{h:Number(e&es),l:Number(e>>mu&es)}:{h:Number(e>>mu&es)|0,l:Number(e&es)|0}}function d1(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let s=0;s<n;s++){const{h:i,l:c}=f1(e[s],t);[r[s],o[s]]=[i,c]}return[r,o]}const p1=(e,t,n)=>e<<n|t>>>32-n,h1=(e,t,n)=>t<<n|e>>>32-n,m1=(e,t,n)=>t<<n-32|e>>>64-n,b1=(e,t,n)=>e<<n-32|t>>>64-n,sr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function g1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function _r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Dn(e,...t){if(!g1(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 y1(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");_r(e.outputLen),_r(e.blockLen)}function ir(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 bu(e,t){Dn(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function v1(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ar(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ai(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Lt(e,t){return e<<32-t|e>>>t}const w1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function x1(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function E1(e){for(let t=0;t<e.length;t++)e[t]=x1(e[t]);return e}const gu=w1?e=>e:E1;function S1(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ts(e){return typeof e=="string"&&(e=S1(e)),Dn(e),e}function P1(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];Dn(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}class $i{}function yu(e){const t=r=>e().update(ts(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function T1(e=32){if(sr&&typeof sr.getRandomValues=="function")return sr.getRandomValues(new Uint8Array(e));if(sr&&typeof sr.randomBytes=="function")return Uint8Array.from(sr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const A1=BigInt(0),zr=BigInt(1),$1=BigInt(2),C1=BigInt(7),N1=BigInt(256),O1=BigInt(113),vu=[],wu=[],xu=[];for(let e=0,t=zr,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],vu.push(2*(5*r+n)),wu.push((e+1)*(e+2)/2%64);let o=A1;for(let s=0;s<7;s++)t=(t<<zr^(t>>C1)*O1)%N1,t&$1&&(o^=zr<<(zr<<BigInt(s))-zr);xu.push(o)}const Eu=d1(xu,!0),I1=Eu[0],k1=Eu[1],Su=(e,t,n)=>n>32?m1(e,t,n):p1(e,t,n),Pu=(e,t,n)=>n>32?b1(e,t,n):h1(e,t,n);function D1(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const c=(i+8)%10,a=(i+2)%10,l=n[a],u=n[a+1],f=Su(l,u,1)^n[c],p=Pu(l,u,1)^n[c+1];for(let d=0;d<50;d+=10)e[i+d]^=f,e[i+d+1]^=p}let o=e[2],s=e[3];for(let i=0;i<24;i++){const c=wu[i],a=Su(o,s,c),l=Pu(o,s,c),u=vu[i];o=e[u],s=e[u+1],e[u]=a,e[u+1]=l}for(let i=0;i<50;i+=10){for(let c=0;c<10;c++)n[c]=e[i+c];for(let c=0;c<10;c++)e[i+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=I1[r],e[1]^=k1[r]}ar(n)}class Ci extends $i{constructor(t,n,r,o=!1,s=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=o,this.rounds=s,_r(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=v1(this.state)}clone(){return this._cloneInto()}keccak(){gu(this.state32),D1(this.state32,this.rounds),gu(this.state32),this.posOut=0,this.pos=0}update(t){ir(this),t=ts(t),Dn(t);const{blockLen:n,state:r}=this,o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);for(let c=0;c<i;c++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){ir(this,!1),Dn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let o=0,s=t.length;o<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-o);t.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return _r(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(bu(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,ar(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new Ci(n,r,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}}const M1=(e,t,n)=>yu(()=>new Ci(t,e,n)),Tu=M1(1,136,256/8);function ke(e,t){const n=t||"hex",r=Tu(Et(e,{strict:!1})?or(e):e);return n==="bytes"?r:pn(r)}const L1=e=>ke(or(e));function B1(e){return L1(e)}function F1(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function",""].includes(o))o="";else if(o+=c,c===")"){s=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=c,n+=c}}if(!s)throw new V("Unable to normalize signature.");return o}const R1=e=>{const t=typeof e=="string"?e:Yo(e);return F1(t)};function Au(e){return B1(R1(e))}const ns=Au;let hn=class extends V{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"})}},rs=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}};const Ni=new rs(8192);function os(e,t){if(Ni.has(`${e}.${t}`))return Ni.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=ke(kn(n),"bytes"),o=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(r[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());const s=`0x${o.join("")}`;return Ni.set(`${e}.${t}`,s),s}function mn(e,t){if(!at(e,{strict:!1}))throw new hn({address:e});return os(e,t)}const j1=/^0x[a-fA-F0-9]{40}$/,Oi=new rs(8192);function at(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Oi.has(r))return Oi.get(r);const o=j1.test(e)?e.toLowerCase()===e?!0:n?os(e)===e:!0:!1;return Oi.set(r,o),o}function Pt(e){return typeof e[0]=="string"?cr(e):_1(e)}function _1(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function cr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function lr(e,t,n,{strict:r}={}){return Et(e,{strict:!1})?z1(e,t,n,{strict:r}):Nu(e,t,n,{strict:r})}function $u(e,t){if(typeof t=="number"&&t>0&&t>ve(e)-1)throw new lu({offset:t,position:"start",size:ve(e)})}function Cu(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ve(e)!==n-t)throw new lu({offset:n,position:"end",size:ve(e)})}function Nu(e,t,n,{strict:r}={}){$u(e,t);const o=e.slice(t,n);return r&&Cu(o,t,n),o}function z1(e,t,n,{strict:r}={}){$u(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Cu(o,t,n),o}const U1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ou=/^(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 bn(e,t){if(e.length!==t.length)throw new Hb({expectedLength:e.length,givenLength:t.length});const n=W1({params:e,values:t}),r=ki(n);return r.length===0?"0x":r}function W1({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Ii({param:e[r],value:t[r]}));return n}function Ii({param:e,value:t}){const n=Di(e.type);if(n){const[r,o]=n;return V1(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return Y1(t,{param:e});if(e.type==="address")return H1(t);if(e.type==="bool")return q1(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=Ou.exec(e.type)??[];return Z1(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return G1(t,{param:e});if(e.type==="string")return K1(t);throw new Xb(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function ki(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=ve(c)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?(n.push(Q(t+o,{size:32})),r.push(c),o+=ve(c)):n.push(c)}return Pt([...n,...r])}function H1(e){if(!at(e))throw new hn({address:e});return{dynamic:!1,encoded:dn(e.toLowerCase())}}function V1(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new cu(e);if(!r&&e.length!==t)throw new Ub({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const c=Ii({param:n,value:e[i]});c.dynamic&&(o=!0),s.push(c)}if(r||o){const i=ki(s);if(r){const c=Q(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Pt([c,i]):c}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:Pt(s.map(({encoded:i})=>i))}}function G1(e,{param:t}){const[,n]=t.type.split("bytes"),r=ve(e);if(!n){let o=e;return r%32!==0&&(o=dn(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Pt([dn(Q(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new Wb({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:dn(e,{dir:"right"})}}function q1(e){if(typeof e!="boolean")throw new V(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:dn(pu(e))}}function Z1(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new du({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Q(e,{size:32,signed:t})}}function K1(e){const t=jr(e),n=Math.ceil(ve(t)/32),r=[];for(let o=0;o<n;o++)r.push(dn(lr(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Pt([dn(Q(ve(t),{size:32})),...r])}}function Y1(e,{param:t}){let n=!1;const r=[];for(let o=0;o<t.components.length;o++){const s=t.components[o],i=Array.isArray(e)?o:s.name,c=Ii({param:s,value:e[i]});r.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?ki(r):Pt(r.map(({encoded:o})=>o))}}function Di(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Ur=e=>lr(Au(e),0,4);function Mn(e){const{abi:t,args:n=[],name:r}=e,o=Et(r,{strict:!1}),s=t.filter(c=>o?c.type==="function"?Ur(c)===r:c.type==="event"?ns(c)===r:!1:"name"in c&&c.name===r);if(s.length===0)return;if(s.length===1)return s[0];let i;for(const c of s){if(!("inputs"in c))continue;if(!n||n.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==n.length)continue;if(n.every((l,u)=>{const f="inputs"in c&&c.inputs[u];return f?Mi(l,f):!1})){if(i&&"inputs"in i&&i.inputs){const l=Iu(c.inputs,i.inputs,n);if(l)throw new Kb({abiItem:c,type:l[0]},{abiItem:i,type:l[1]})}i=c}}return i||s[0]}function Mi(e,t){const n=typeof e,r=t.type;switch(r){case"address":return at(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((o,s)=>Mi(Object.values(e)[s],o)):/^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(o=>Mi(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Iu(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return Iu(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?at(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?at(n[r],{strict:!1}):!1)return i}}const ku="/docs/contract/encodeEventTopics";function Wr(e){var a;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const l=Mn({abi:t,name:n});if(!l)throw new iu(n,{docsPath:ku});o=l}if(o.type!=="event")throw new iu(void 0,{docsPath:ku});const s=xt(o),i=ns(s);let c=[];if(r&&"inputs"in o){const l=(a=o.inputs)==null?void 0:a.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(r)?r:Object.values(r).length>0?(l==null?void 0:l.map(f=>r[f.name]))??[]:[];u.length>0&&(c=(l==null?void 0:l.map((f,p)=>Array.isArray(u[p])?u[p].map((d,h)=>Du({param:f,value:u[p][h]})):typeof u[p]<"u"&&u[p]!==null?Du({param:f,value:u[p]}):null))??[])}return[i,...c]}function Du({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return ke(or(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new e1(e.type);return bn([e],[t])}function ss(e,{method:t}){var r,o;const n={};return e.transport.type==="fallback"&&((o=(r=e.transport).onResponse)==null||o.call(r,({method:s,response:i,status:c,transport:a})=>{c==="success"&&t===s&&(n[i]=a.request)})),s=>n[s]||e.request}async function Mu(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:c,toBlock:a}=t,l=ss(e,{method:"eth_newFilter"}),u=s?Wr({abi:r,args:o,eventName:s}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?Q(i):i,toBlock:typeof a=="bigint"?Q(a):a,topics:u}]});return{abi:r,args:o,eventName:s,id:f,request:l(f),strict:!!c,type:"event"}}function Je(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Lu="/docs/contract/encodeFunctionData";function X1(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=Mn({abi:t,args:n,name:r});if(!s)throw new nr(r,{docsPath:Lu});o=s}if(o.type!=="function")throw new nr(void 0,{docsPath:Lu});return{abi:[o],functionName:Ur(xt(o))}}function Tt(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:X1(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?bn(o.inputs,t??[]):void 0;return cr([s,i??"0x"])}const Q1={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."},Bu={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},J1={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let Fu=class extends V{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Ru=class extends V{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},eg=class extends V{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const tg={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 eg({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Ru({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Fu({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 Fu({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 Li(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(tg);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function ng(e,t={}){typeof t.size<"u"&&St(e,{size:t.size});const n=Ae(e,t);return Dt(n,t)}function rg(e,t={}){let n=e;if(typeof t.size<"u"&&(St(n,{size:t.size}),n=In(n)),n.length>1||n[0]>1)throw new n1(n);return!!n[0]}function Yt(e,t={}){typeof t.size<"u"&&St(e,{size:t.size});const n=Ae(e,t);return Zt(n,t)}function og(e,t={}){let n=e;return typeof t.size<"u"&&(St(n,{size:t.size}),n=In(n,{dir:"right"})),new TextDecoder().decode(n)}function Hr(e,t){const n=typeof t=="string"?Mt(t):t,r=Li(n);if(ve(n)===0&&e.length>0)throw new Rr;if(ve(t)&&ve(t)<32)throw new ru({data:typeof t=="string"?t:Ae(t),params:e,size:ve(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const c=e[i];r.setPosition(o);const[a,l]=ur(r,c,{staticPosition:0});o+=l,s.push(a)}return s}function ur(e,t,{staticPosition:n}){const r=Di(t.type);if(r){const[o,s]=r;return ig(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return ug(e,t,{staticPosition:n});if(t.type==="address")return sg(e);if(t.type==="bool")return ag(e);if(t.type.startsWith("bytes"))return cg(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return lg(e,t);if(t.type==="string")return fg(e,{staticPosition:n});throw new Qb(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ju=32,Bi=32;function sg(e){const t=e.readBytes(32);return[os(Ae(Nu(t,-20))),32]}function ig(e,t,{length:n,staticPosition:r}){if(!n){const i=Yt(e.readBytes(Bi)),c=r+i,a=c+ju;e.setPosition(c);const l=Yt(e.readBytes(ju)),u=Vr(t);let f=0;const p=[];for(let d=0;d<l;++d){e.setPosition(a+(u?d*32:f));const[h,m]=ur(e,t,{staticPosition:a});f+=m,p.push(h)}return e.setPosition(r+32),[p,32]}if(Vr(t)){const i=Yt(e.readBytes(Bi)),c=r+i,a=[];for(let l=0;l<n;++l){e.setPosition(c+l*32);const[u]=ur(e,t,{staticPosition:c});a.push(u)}return e.setPosition(r+32),[a,32]}let o=0;const s=[];for(let i=0;i<n;++i){const[c,a]=ur(e,t,{staticPosition:r+o});o+=a,s.push(c)}return[s,o]}function ag(e){return[rg(e.readBytes(32),{size:32}),32]}function cg(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=Yt(e.readBytes(32));e.setPosition(n+i);const c=Yt(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Ae(a),32]}return[Ae(e.readBytes(Number.parseInt(o,10),32)),32]}function lg(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?ng(o,{signed:n}):Yt(o,{signed:n}),32]}function ug(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(Vr(t)){const i=Yt(e.readBytes(Bi)),c=n+i;for(let a=0;a<t.components.length;++a){const l=t.components[a];e.setPosition(c+s);const[u,f]=ur(e,l,{staticPosition:c});s+=f,o[r?a:l==null?void 0:l.name]=u}return e.setPosition(n+32),[o,32]}for(let i=0;i<t.components.length;++i){const c=t.components[i],[a,l]=ur(e,c,{staticPosition:n});o[r?i:c==null?void 0:c.name]=a,s+=l}return[o,s]}function fg(e,{staticPosition:t}){const n=Yt(e.readBytes(32)),r=t+n;e.setPosition(r);const o=Yt(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=og(In(s));return e.setPosition(t+32),[i,32]}function Vr(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(Vr);const n=Di(e.type);return!!(n&&Vr({...e,type:n[1]}))}function _u(e){const{abi:t,data:n}=e,r=lr(n,0,4);if(r==="0x")throw new Rr;const s=[...t||[],Bu,J1].find(i=>i.type==="error"&&r===Ur(xt(i)));if(!s)throw new su(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Hr(s.inputs,lr(n,4)):void 0,errorName:s.name}}const $e=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n);function zu({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((o,s)=>`${r&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?$e(t[s]):t[s]}`).join(", ")})`}const dg={gwei:9,wei:18},pg={ether:-9,wei:9};function Fi(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${s?`.${s}`:""}`}function Ri(e,t="wei"){return Fi(e,dg[t])}function Ue(e,t="wei"){return Fi(e,pg[t])}class hg extends V{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class mg extends V{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function Uu(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
72
- `,"")}function bg(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
50
+ 跨鏈充值需由您承擔 Edge 網路手續費。到帳金額會略小於您的充值金額。`,addressUpdatedNotice:"注意:充值地址已更新,請改用新地址。原地址僅在過渡期內有效,之後將停用。若已在其他平台儲存,請儘速更新。",enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"資金約在 {{v}} 分鐘內(達到 {{v1}} 個區塊確認後)到賬。",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",availableDesc:"您可以充值的最大金額。當可用餘額為0或負數時,無法進行充值。",noPrivateKeyWalletWarning:"請勿使用無私鑰錢包進行充值,無私鑰錢包充值會導致資金損失且無法追回。",layerZeroDepositTip:"系統會根據充值資金的實際情況,通過 LayerZero 完成您的充值。",layerZeroDepositTipExceedPool:"由於充值資金大於資金池,將透過 LayerZero 完成您的充值。",layerZeroDepositTipGte200k:"由於充值資金大於等於 200,000 USDT,將透過 LayerZero 完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"預設充值至現貨帳戶",defaultSpotToPerpNotice:"僅支援發送 {{coin}} ({{v}}) 資產到此位址。預設充值至現貨帳戶。若需充入合約帳戶,請自現貨帳戶劃轉至合約帳戶。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",feeRate:"費率",withdrawlAmount:"提現金額",amountToReceive:"到账金額",minWithdraw:"最小提現金額",minWithdrawParsed:"最小提現 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能為空",availableDesc:"您可以提現的最大金額。當可用餘額為0或負數時,無法進行提現。",feeCalculationTip:"提現手續費按照提現金額乘以費率計算,最低為 1 USDT/USDC。費率會根據鏈上實際情況進行調整。",crossChainPoolBalance:"跨鏈資金池餘額",poolBalance:"資金池餘額",poolBalanceInsufficientTip:"提現金額大於資金池餘額,無法進行提現。請選擇資金池餘額充足的選項。"},account:{title:"帳戶",perpetual:"合約帳戶",spot:"現貨帳戶"}},Ai=["en-US","ja-JP","ru-RU","zh-CN","zh-TW","de-DE","es-LA","fr-FR","it-IT"],Wl={"en-US":Gm,"ja-JP":Ym,"ru-RU":Xm,"zh-CN":Qm,"zh-TW":Jm,"de-DE":Vm,"es-LA":qm,"fr-FR":Zm,"it-IT":Km},rs="en-US",eb={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский","de-DE":"Deutsch","es-LA":"Español (Latinoamérica)","fr-FR":"Français","it-IT":"Italiano"},tb=e=>Ai.includes(e)?Wl[e]:Wl[rs],nb=e=>Ai.includes(e),Hl=E.createContext(null),rb=({config:e,children:t})=>{const n=E.useMemo(()=>{const r=e.locale||rs,o=nb(r)?r:rs,s=tb(o);return{...e,currentLocale:o,translations:s}},[e]);return M.jsx(Hl.Provider,{value:n,children:t})},Vl=()=>{const e=E.useContext(Hl);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var ob=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ni=Math.ceil,st=Math.floor,_e="[BigNumber Error] ",Gl=_e+"Number primitive has more than 15 significant digits: ",xt=1e14,oe=14,Ci=9007199254740991,Oi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],pn=1e7,Ce=1e9;function ql(e){var t,n,r,o=x.prototype={constructor:x,toString:null,valueOf:null},s=new x(1),i=20,c=4,a=-7,l=21,u=-1e7,f=1e7,d=!1,p=1,h=0,b={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",P=!0;function x(m,g){var v,A,N,O,D,y,C,I,T=this;if(!(T instanceof x))return new x(m,g);if(g==null){if(m&&m._isBigNumber===!0){T.s=m.s,!m.c||m.e>f?T.c=T.e=null:m.e<u?T.c=[T.e=0]:(T.e=m.e,T.c=m.c.slice());return}if((y=typeof m=="number")&&m*0==0){if(T.s=1/m<0?(m=-m,-1):1,m===~~m){for(O=0,D=m;D>=10;D/=10,O++);O>f?T.c=T.e=null:(T.e=O,T.c=[m]);return}I=String(m)}else{if(!ob.test(I=String(m)))return r(T,I,y);T.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(O=I.indexOf("."))>-1&&(I=I.replace(".","")),(D=I.search(/e/i))>0?(O<0&&(O=D),O+=+I.slice(D+1),I=I.substring(0,D)):O<0&&(O=I.length)}else{if(ye(g,2,S.length,"Base"),g==10&&P)return T=new x(m),B(T,i+T.e+1,c);if(I=String(m),y=typeof m=="number"){if(m*0!=0)return r(T,I,y,g);if(T.s=1/m<0?(I=I.slice(1),-1):1,x.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(Gl+m)}else T.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(v=S.slice(0,g),O=D=0,C=I.length;D<C;D++)if(v.indexOf(A=I.charAt(D))<0){if(A=="."){if(D>O){O=C;continue}}else if(!N&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){N=!0,D=-1,O=0;continue}return r(T,String(m),y,g)}y=!1,I=n(I,g,10,T.s),(O=I.indexOf("."))>-1?I=I.replace(".",""):O=I.length}for(D=0;I.charCodeAt(D)===48;D++);for(C=I.length;I.charCodeAt(--C)===48;);if(I=I.slice(D,++C)){if(C-=D,y&&x.DEBUG&&C>15&&(m>Ci||m!==st(m)))throw Error(Gl+T.s*m);if((O=O-D-1)>f)T.c=T.e=null;else if(O<u)T.c=[T.e=0];else{if(T.e=O,T.c=[],D=(O+1)%oe,O<0&&(D+=oe),D<C){for(D&&T.c.push(+I.slice(0,D)),C-=oe;D<C;)T.c.push(+I.slice(D,D+=oe));D=oe-(I=I.slice(D)).length}else D-=C;for(;D--;I+="0");T.c.push(+I)}}else T.c=[T.e=0]}x.clone=ql,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(m){var g,v;if(m!=null)if(typeof m=="object"){if(m.hasOwnProperty(g="DECIMAL_PLACES")&&(v=m[g],ye(v,0,Ce,g),i=v),m.hasOwnProperty(g="ROUNDING_MODE")&&(v=m[g],ye(v,0,8,g),c=v),m.hasOwnProperty(g="EXPONENTIAL_AT")&&(v=m[g],v&&v.pop?(ye(v[0],-Ce,0,g),ye(v[1],0,Ce,g),a=v[0],l=v[1]):(ye(v,-Ce,Ce,g),a=-(l=v<0?-v:v))),m.hasOwnProperty(g="RANGE"))if(v=m[g],v&&v.pop)ye(v[0],-Ce,-1,g),ye(v[1],1,Ce,g),u=v[0],f=v[1];else if(ye(v,-Ce,Ce,g),v)u=-(f=v<0?-v:v);else throw Error(_e+g+" cannot be zero: "+v);if(m.hasOwnProperty(g="CRYPTO"))if(v=m[g],v===!!v)if(v)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))d=v;else throw d=!v,Error(_e+"crypto unavailable");else d=v;else throw Error(_e+g+" not true or false: "+v);if(m.hasOwnProperty(g="MODULO_MODE")&&(v=m[g],ye(v,0,9,g),p=v),m.hasOwnProperty(g="POW_PRECISION")&&(v=m[g],ye(v,0,Ce,g),h=v),m.hasOwnProperty(g="FORMAT"))if(v=m[g],typeof v=="object")b=v;else throw Error(_e+g+" not an object: "+v);if(m.hasOwnProperty(g="ALPHABET"))if(v=m[g],typeof v=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(v))P=v.slice(0,10)=="0123456789",S=v;else throw Error(_e+g+" invalid: "+v)}else throw Error(_e+"Object expected: "+m);return{DECIMAL_PLACES:i,ROUNDING_MODE:c,EXPONENTIAL_AT:[a,l],RANGE:[u,f],CRYPTO:d,MODULO_MODE:p,POW_PRECISION:h,FORMAT:b,ALPHABET:S}},x.isBigNumber=function(m){if(!m||m._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var g,v,A=m.c,N=m.e,O=m.s;e:if({}.toString.call(A)=="[object Array]"){if((O===1||O===-1)&&N>=-Ce&&N<=Ce&&N===st(N)){if(A[0]===0){if(N===0&&A.length===1)return!0;break e}if(g=(N+1)%oe,g<1&&(g+=oe),String(A[0]).length==g){for(g=0;g<A.length;g++)if(v=A[g],v<0||v>=xt||v!==st(v))break e;if(v!==0)return!0}}}else if(A===null&&N===null&&(O===null||O===1||O===-1))return!0;throw Error(_e+"Invalid BigNumber: "+m)},x.maximum=x.max=function(){return $(arguments,-1)},x.minimum=x.min=function(){return $(arguments,1)},x.random=function(){var m=9007199254740992,g=Math.random()*m&2097151?function(){return st(Math.random()*m)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(v){var A,N,O,D,y,C=0,I=[],T=new x(s);if(v==null?v=i:ye(v,0,Ce),D=Ni(v/oe),d)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(D*=2));C<D;)y=A[C]*131072+(A[C+1]>>>11),y>=9e15?(N=crypto.getRandomValues(new Uint32Array(2)),A[C]=N[0],A[C+1]=N[1]):(I.push(y%1e14),C+=2);C=D/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(D*=7);C<D;)y=(A[C]&31)*281474976710656+A[C+1]*1099511627776+A[C+2]*4294967296+A[C+3]*16777216+(A[C+4]<<16)+(A[C+5]<<8)+A[C+6],y>=9e15?crypto.randomBytes(7).copy(A,C):(I.push(y%1e14),C+=7);C=D/7}else throw d=!1,Error(_e+"crypto unavailable");if(!d)for(;C<D;)y=g(),y<9e15&&(I[C++]=y%1e14);for(D=I[--C],v%=oe,D&&v&&(y=Oi[oe-v],I[C]=st(D/y)*y);I[C]===0;I.pop(),C--);if(C<0)I=[O=0];else{for(O=-1;I[0]===0;I.splice(0,1),O-=oe);for(C=1,y=I[0];y>=10;y/=10,C++);C<oe&&(O-=oe-C)}return T.e=O,T.c=I,T}}(),x.sum=function(){for(var m=1,g=arguments,v=new x(g[0]);m<g.length;)v=v.plus(g[m++]);return v},n=function(){var m="0123456789";function g(v,A,N,O){for(var D,y=[0],C,I=0,T=v.length;I<T;){for(C=y.length;C--;y[C]*=A);for(y[0]+=O.indexOf(v.charAt(I++)),D=0;D<y.length;D++)y[D]>N-1&&(y[D+1]==null&&(y[D+1]=0),y[D+1]+=y[D]/N|0,y[D]%=N)}return y.reverse()}return function(v,A,N,O,D){var y,C,I,T,L,j,z,_,W=v.indexOf("."),K=i,G=c;for(W>=0&&(T=h,h=0,v=v.replace(".",""),_=new x(A),j=_.pow(v.length-W),h=T,_.c=g(qt(at(j.c),j.e,"0"),10,N,m),_.e=_.c.length),z=g(v,A,N,D?(y=S,m):(y=m,S)),I=T=z.length;z[--T]==0;z.pop());if(!z[0])return y.charAt(0);if(W<0?--I:(j.c=z,j.e=I,j.s=O,j=t(j,_,K,G,N),z=j.c,L=j.r,I=j.e),C=I+K+1,W=z[C],T=N/2,L=L||C<0||z[C+1]!=null,L=G<4?(W!=null||L)&&(G==0||G==(j.s<0?3:2)):W>T||W==T&&(G==4||L||G==6&&z[C-1]&1||G==(j.s<0?8:7)),C<1||!z[0])v=L?qt(y.charAt(1),-K,y.charAt(0)):y.charAt(0);else{if(z.length=C,L)for(--N;++z[--C]>N;)z[C]=0,C||(++I,z=[1].concat(z));for(T=z.length;!z[--T];);for(W=0,v="";W<=T;v+=y.charAt(z[W++]));v=qt(v,I,y.charAt(0))}return v}}(),t=function(){function m(A,N,O){var D,y,C,I,T=0,L=A.length,j=N%pn,z=N/pn|0;for(A=A.slice();L--;)C=A[L]%pn,I=A[L]/pn|0,D=z*C+I*j,y=j*C+D%pn*pn+T,T=(y/O|0)+(D/pn|0)+z*I,A[L]=y%O;return T&&(A=[T].concat(A)),A}function g(A,N,O,D){var y,C;if(O!=D)C=O>D?1:-1;else for(y=C=0;y<O;y++)if(A[y]!=N[y]){C=A[y]>N[y]?1:-1;break}return C}function v(A,N,O,D){for(var y=0;O--;)A[O]-=y,y=A[O]<N[O]?1:0,A[O]=y*D+A[O]-N[O];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,N,O,D,y){var C,I,T,L,j,z,_,W,K,G,H,q,Q,ee,pe,le,he,ie=A.s==N.s?1:-1,me=A.c,ne=N.c;if(!me||!me[0]||!ne||!ne[0])return new x(!A.s||!N.s||(me?ne&&me[0]==ne[0]:!ne)?NaN:me&&me[0]==0||!ne?ie*0:ie/0);for(W=new x(ie),K=W.c=[],I=A.e-N.e,ie=O+I+1,y||(y=xt,I=it(A.e/oe)-it(N.e/oe),ie=ie/oe|0),T=0;ne[T]==(me[T]||0);T++);if(ne[T]>(me[T]||0)&&I--,ie<0)K.push(1),L=!0;else{for(ee=me.length,le=ne.length,T=0,ie+=2,j=st(y/(ne[0]+1)),j>1&&(ne=m(ne,j,y),me=m(me,j,y),le=ne.length,ee=me.length),Q=le,G=me.slice(0,le),H=G.length;H<le;G[H++]=0);he=ne.slice(),he=[0].concat(he),pe=ne[0],ne[1]>=y/2&&pe++;do{if(j=0,C=g(ne,G,le,H),C<0){if(q=G[0],le!=H&&(q=q*y+(G[1]||0)),j=st(q/pe),j>1)for(j>=y&&(j=y-1),z=m(ne,j,y),_=z.length,H=G.length;g(z,G,_,H)==1;)j--,v(z,le<_?he:ne,_,y),_=z.length,C=1;else j==0&&(C=j=1),z=ne.slice(),_=z.length;if(_<H&&(z=[0].concat(z)),v(G,z,H,y),H=G.length,C==-1)for(;g(ne,G,le,H)<1;)j++,v(G,le<H?he:ne,H,y),H=G.length}else C===0&&(j++,G=[0]);K[T++]=j,G[0]?G[H++]=me[Q]||0:(G=[me[Q]],H=1)}while((Q++<ee||G[0]!=null)&&ie--);L=G[0]!=null,K[0]||K.splice(0,1)}if(y==xt){for(T=1,ie=K[0];ie>=10;ie/=10,T++);B(W,O+(W.e=T+I*oe-1)+1,D,L)}else W.e=I,W.r=+L;return W}}();function w(m,g,v,A){var N,O,D,y,C;if(v==null?v=c:ye(v,0,8),!m.c)return m.toString();if(N=m.c[0],D=m.e,g==null)C=at(m.c),C=A==1||A==2&&(D<=a||D>=l)?ss(C,D):qt(C,D,"0");else if(m=B(new x(m),g,v),O=m.e,C=at(m.c),y=C.length,A==1||A==2&&(g<=O||O<=a)){for(;y<g;C+="0",y++);C=ss(C,O)}else if(g-=D+(A===2&&O>D),C=qt(C,O,"0"),O+1>y){if(--g>0)for(C+=".";g--;C+="0");}else if(g+=O-y,g>0)for(O+1==y&&(C+=".");g--;C+="0");return m.s<0&&N?"-"+C:C}function $(m,g){for(var v,A,N=1,O=new x(m[0]);N<m.length;N++)A=new x(m[N]),(!A.s||(v=Mn(O,A))===g||v===0&&O.s===g)&&(O=A);return O}function k(m,g,v){for(var A=1,N=g.length;!g[--N];g.pop());for(N=g[0];N>=10;N/=10,A++);return(v=A+v*oe-1)>f?m.c=m.e=null:v<u?m.c=[m.e=0]:(m.e=v,m.c=g),m}r=function(){var m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,g=/^([^.]+)\.$/,v=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,N=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(O,D,y,C){var I,T=y?D:D.replace(N,"");if(A.test(T))O.s=isNaN(T)?null:T<0?-1:1;else{if(!y&&(T=T.replace(m,function(L,j,z){return I=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!C||C==I?j:L}),C&&(I=C,T=T.replace(g,"$1").replace(v,"0.$1")),D!=T))return new x(T,I);if(x.DEBUG)throw Error(_e+"Not a"+(C?" base "+C:"")+" number: "+D);O.s=null}O.c=O.e=null}}();function B(m,g,v,A){var N,O,D,y,C,I,T,L=m.c,j=Oi;if(L){e:{for(N=1,y=L[0];y>=10;y/=10,N++);if(O=g-N,O<0)O+=oe,D=g,C=L[I=0],T=st(C/j[N-D-1]%10);else if(I=Ni((O+1)/oe),I>=L.length)if(A){for(;L.length<=I;L.push(0));C=T=0,N=1,O%=oe,D=O-oe+1}else break e;else{for(C=y=L[I],N=1;y>=10;y/=10,N++);O%=oe,D=O-oe+N,T=D<0?0:st(C/j[N-D-1]%10)}if(A=A||g<0||L[I+1]!=null||(D<0?C:C%j[N-D-1]),A=v<4?(T||A)&&(v==0||v==(m.s<0?3:2)):T>5||T==5&&(v==4||A||v==6&&(O>0?D>0?C/j[N-D]:0:L[I-1])%10&1||v==(m.s<0?8:7)),g<1||!L[0])return L.length=0,A?(g-=m.e+1,L[0]=j[(oe-g%oe)%oe],m.e=-g||0):L[0]=m.e=0,m;if(O==0?(L.length=I,y=1,I--):(L.length=I+1,y=j[oe-O],L[I]=D>0?st(C/j[N-D]%j[D])*y:0),A)for(;;)if(I==0){for(O=1,D=L[0];D>=10;D/=10,O++);for(D=L[0]+=y,y=1;D>=10;D/=10,y++);O!=y&&(m.e++,L[0]==xt&&(L[0]=1));break}else{if(L[I]+=y,L[I]!=xt)break;L[I--]=0,y=1}for(O=L.length;L[--O]===0;L.pop());}m.e>f?m.c=m.e=null:m.e<u&&(m.c=[m.e=0])}return m}function F(m){var g,v=m.e;return v===null?m.toString():(g=at(m.c),g=v<=a||v>=l?ss(g,v):qt(g,v,"0"),m.s<0?"-"+g:g)}return o.absoluteValue=o.abs=function(){var m=new x(this);return m.s<0&&(m.s=1),m},o.comparedTo=function(m,g){return Mn(this,new x(m,g))},o.decimalPlaces=o.dp=function(m,g){var v,A,N,O=this;if(m!=null)return ye(m,0,Ce),g==null?g=c:ye(g,0,8),B(new x(O),m+O.e+1,g);if(!(v=O.c))return null;if(A=((N=v.length-1)-it(this.e/oe))*oe,N=v[N])for(;N%10==0;N/=10,A--);return A<0&&(A=0),A},o.dividedBy=o.div=function(m,g){return t(this,new x(m,g),i,c)},o.dividedToIntegerBy=o.idiv=function(m,g){return t(this,new x(m,g),0,1)},o.exponentiatedBy=o.pow=function(m,g){var v,A,N,O,D,y,C,I,T,L=this;if(m=new x(m),m.c&&!m.isInteger())throw Error(_e+"Exponent not an integer: "+F(m));if(g!=null&&(g=new x(g)),y=m.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!m.c||!m.c[0])return T=new x(Math.pow(+F(L),y?m.s*(2-os(m)):+F(m))),g?T.mod(g):T;if(C=m.s<0,g){if(g.c?!g.c[0]:!g.s)return new x(NaN);A=!C&&L.isInteger()&&g.isInteger(),A&&(L=L.mod(g))}else{if(m.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||y&&L.c[1]>=24e7:L.c[0]<8e13||y&&L.c[0]<=9999975e7)))return O=L.s<0&&os(m)?-0:0,L.e>-1&&(O=1/O),new x(C?1/O:O);h&&(O=Ni(h/oe+2))}for(y?(v=new x(.5),C&&(m.s=1),I=os(m)):(N=Math.abs(+F(m)),I=N%2),T=new x(s);;){if(I){if(T=T.times(L),!T.c)break;O?T.c.length>O&&(T.c.length=O):A&&(T=T.mod(g))}if(N){if(N=st(N/2),N===0)break;I=N%2}else if(m=m.times(v),B(m,m.e+1,1),m.e>14)I=os(m);else{if(N=+F(m),N===0)break;I=N%2}L=L.times(L),O?L.c&&L.c.length>O&&(L.c.length=O):A&&(L=L.mod(g))}return A?T:(C&&(T=s.div(T)),g?T.mod(g):O?B(T,h,c,D):T)},o.integerValue=function(m){var g=new x(this);return m==null?m=c:ye(m,0,8),B(g,g.e+1,m)},o.isEqualTo=o.eq=function(m,g){return Mn(this,new x(m,g))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(m,g){return Mn(this,new x(m,g))>0},o.isGreaterThanOrEqualTo=o.gte=function(m,g){return(g=Mn(this,new x(m,g)))===1||g===0},o.isInteger=function(){return!!this.c&&it(this.e/oe)>this.c.length-2},o.isLessThan=o.lt=function(m,g){return Mn(this,new x(m,g))<0},o.isLessThanOrEqualTo=o.lte=function(m,g){return(g=Mn(this,new x(m,g)))===-1||g===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(m,g){var v,A,N,O,D=this,y=D.s;if(m=new x(m,g),g=m.s,!y||!g)return new x(NaN);if(y!=g)return m.s=-g,D.plus(m);var C=D.e/oe,I=m.e/oe,T=D.c,L=m.c;if(!C||!I){if(!T||!L)return T?(m.s=-g,m):new x(L?D:NaN);if(!T[0]||!L[0])return L[0]?(m.s=-g,m):new x(T[0]?D:c==3?-0:0)}if(C=it(C),I=it(I),T=T.slice(),y=C-I){for((O=y<0)?(y=-y,N=T):(I=C,N=L),N.reverse(),g=y;g--;N.push(0));N.reverse()}else for(A=(O=(y=T.length)<(g=L.length))?y:g,y=g=0;g<A;g++)if(T[g]!=L[g]){O=T[g]<L[g];break}if(O&&(N=T,T=L,L=N,m.s=-m.s),g=(A=L.length)-(v=T.length),g>0)for(;g--;T[v++]=0);for(g=xt-1;A>y;){if(T[--A]<L[A]){for(v=A;v&&!T[--v];T[v]=g);--T[v],T[A]+=xt}T[A]-=L[A]}for(;T[0]==0;T.splice(0,1),--I);return T[0]?k(m,T,I):(m.s=c==3?-1:1,m.c=[m.e=0],m)},o.modulo=o.mod=function(m,g){var v,A,N=this;return m=new x(m,g),!N.c||!m.s||m.c&&!m.c[0]?new x(NaN):!m.c||N.c&&!N.c[0]?new x(N):(p==9?(A=m.s,m.s=1,v=t(N,m,0,3),m.s=A,v.s*=A):v=t(N,m,0,p),m=N.minus(v.times(m)),!m.c[0]&&p==1&&(m.s=N.s),m)},o.multipliedBy=o.times=function(m,g){var v,A,N,O,D,y,C,I,T,L,j,z,_,W,K,G=this,H=G.c,q=(m=new x(m,g)).c;if(!H||!q||!H[0]||!q[0])return!G.s||!m.s||H&&!H[0]&&!q||q&&!q[0]&&!H?m.c=m.e=m.s=null:(m.s*=G.s,!H||!q?m.c=m.e=null:(m.c=[0],m.e=0)),m;for(A=it(G.e/oe)+it(m.e/oe),m.s*=G.s,C=H.length,L=q.length,C<L&&(_=H,H=q,q=_,N=C,C=L,L=N),N=C+L,_=[];N--;_.push(0));for(W=xt,K=pn,N=L;--N>=0;){for(v=0,j=q[N]%K,z=q[N]/K|0,D=C,O=N+D;O>N;)I=H[--D]%K,T=H[D]/K|0,y=z*I+T*j,I=j*I+y%K*K+_[O]+v,v=(I/W|0)+(y/K|0)+z*T,_[O--]=I%W;_[O]=v}return v?++A:_.splice(0,1),k(m,_,A)},o.negated=function(){var m=new x(this);return m.s=-m.s||null,m},o.plus=function(m,g){var v,A=this,N=A.s;if(m=new x(m,g),g=m.s,!N||!g)return new x(NaN);if(N!=g)return m.s=-g,A.minus(m);var O=A.e/oe,D=m.e/oe,y=A.c,C=m.c;if(!O||!D){if(!y||!C)return new x(N/0);if(!y[0]||!C[0])return C[0]?m:new x(y[0]?A:N*0)}if(O=it(O),D=it(D),y=y.slice(),N=O-D){for(N>0?(D=O,v=C):(N=-N,v=y),v.reverse();N--;v.push(0));v.reverse()}for(N=y.length,g=C.length,N-g<0&&(v=C,C=y,y=v,g=N),N=0;g;)N=(y[--g]=y[g]+C[g]+N)/xt|0,y[g]=xt===y[g]?0:y[g]%xt;return N&&(y=[N].concat(y),++D),k(m,y,D)},o.precision=o.sd=function(m,g){var v,A,N,O=this;if(m!=null&&m!==!!m)return ye(m,1,Ce),g==null?g=c:ye(g,0,8),B(new x(O),m,g);if(!(v=O.c))return null;if(N=v.length-1,A=N*oe+1,N=v[N]){for(;N%10==0;N/=10,A--);for(N=v[0];N>=10;N/=10,A++);}return m&&O.e+1>A&&(A=O.e+1),A},o.shiftedBy=function(m){return ye(m,-Ci,Ci),this.times("1e"+m)},o.squareRoot=o.sqrt=function(){var m,g,v,A,N,O=this,D=O.c,y=O.s,C=O.e,I=i+4,T=new x("0.5");if(y!==1||!D||!D[0])return new x(!y||y<0&&(!D||D[0])?NaN:D?O:1/0);if(y=Math.sqrt(+F(O)),y==0||y==1/0?(g=at(D),(g.length+C)%2==0&&(g+="0"),y=Math.sqrt(+g),C=it((C+1)/2)-(C<0||C%2),y==1/0?g="5e"+C:(g=y.toExponential(),g=g.slice(0,g.indexOf("e")+1)+C),v=new x(g)):v=new x(y+""),v.c[0]){for(C=v.e,y=C+I,y<3&&(y=0);;)if(N=v,v=T.times(N.plus(t(O,N,I,1))),at(N.c).slice(0,y)===(g=at(v.c)).slice(0,y))if(v.e<C&&--y,g=g.slice(y-3,y+1),g=="9999"||!A&&g=="4999"){if(!A&&(B(N,N.e+i+2,0),N.times(N).eq(O))){v=N;break}I+=4,y+=4,A=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(B(v,v.e+i+2,1),m=!v.times(v).eq(O));break}}return B(v,v.e+i+1,c,m)},o.toExponential=function(m,g){return m!=null&&(ye(m,0,Ce),m++),w(this,m,g,1)},o.toFixed=function(m,g){return m!=null&&(ye(m,0,Ce),m=m+this.e+1),w(this,m,g)},o.toFormat=function(m,g,v){var A,N=this;if(v==null)m!=null&&g&&typeof g=="object"?(v=g,g=null):m&&typeof m=="object"?(v=m,m=g=null):v=b;else if(typeof v!="object")throw Error(_e+"Argument not an object: "+v);if(A=N.toFixed(m,g),N.c){var O,D=A.split("."),y=+v.groupSize,C=+v.secondaryGroupSize,I=v.groupSeparator||"",T=D[0],L=D[1],j=N.s<0,z=j?T.slice(1):T,_=z.length;if(C&&(O=y,y=C,C=O,_-=O),y>0&&_>0){for(O=_%y||y,T=z.substr(0,O);O<_;O+=y)T+=I+z.substr(O,y);C>0&&(T+=I+z.slice(O)),j&&(T="-"+T)}A=L?T+(v.decimalSeparator||"")+((C=+v.fractionGroupSize)?L.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(v.fractionGroupSeparator||"")):L):T}return(v.prefix||"")+A+(v.suffix||"")},o.toFraction=function(m){var g,v,A,N,O,D,y,C,I,T,L,j,z=this,_=z.c;if(m!=null&&(y=new x(m),!y.isInteger()&&(y.c||y.s!==1)||y.lt(s)))throw Error(_e+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+F(y));if(!_)return new x(z);for(g=new x(s),I=v=new x(s),A=C=new x(s),j=at(_),O=g.e=j.length-z.e-1,g.c[0]=Oi[(D=O%oe)<0?oe+D:D],m=!m||y.comparedTo(g)>0?O>0?g:I:y,D=f,f=1/0,y=new x(j),C.c[0]=0;T=t(y,g,0,1),N=v.plus(T.times(A)),N.comparedTo(m)!=1;)v=A,A=N,I=C.plus(T.times(N=I)),C=N,g=y.minus(T.times(N=g)),y=N;return N=t(m.minus(v),A,0,1),C=C.plus(N.times(I)),v=v.plus(N.times(A)),C.s=I.s=z.s,O=O*2,L=t(I,A,O,c).minus(z).abs().comparedTo(t(C,v,O,c).minus(z).abs())<1?[I,A]:[C,v],f=D,L},o.toNumber=function(){return+F(this)},o.toPrecision=function(m,g){return m!=null&&ye(m,1,Ce),w(this,m,g,2)},o.toString=function(m){var g,v=this,A=v.s,N=v.e;return N===null?A?(g="Infinity",A<0&&(g="-"+g)):g="NaN":(m==null?g=N<=a||N>=l?ss(at(v.c),N):qt(at(v.c),N,"0"):m===10&&P?(v=B(new x(v),i+N+1,c),g=qt(at(v.c),v.e,"0")):(ye(m,2,S.length,"Base"),g=n(qt(at(v.c),N,"0"),10,m,A,!0)),A<0&&v.c[0]&&(g="-"+g)),g},o.valueOf=o.toJSON=function(){return F(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&x.set(e),x}function it(e){var t=e|0;return e>0||e===t?t:t-1}function at(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=oe-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Mn(e,t){var n,r,o=e.c,s=t.c,i=e.s,c=t.s,a=e.e,l=t.e;if(!i||!c)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-c:i;if(i!=c)return i;if(n=i<0,r=a==l,!o||!s)return r?0:!o^n?1:-1;if(!r)return a>l^n?1:-1;for(c=(a=o.length)<(l=s.length)?a:l,i=0;i<c;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return a==l?0:a>l^n?1:-1}function ye(e,t,n,r){if(e<t||e>n||e!==st(e))throw Error(_e+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function os(e){var t=e.c.length-1;return it(e.e/oe)==t&&e.c[t]%2!=0}function ss(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function qt(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var $e=ql();const sb=(e,t=6)=>{try{const n=new $e(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,$e.ROUND_DOWN),[o,s=""]=r.toString().split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const c=(s||"").padEnd(t,"0");return`${i}.${c}`}return i}catch(n){return console.warn("formatThousands error:",n),"0"}},Et=()=>{const{translations:e,currentLocale:t}=Vl();return{t:(s,i)=>{try{const c=s.split(".");let a=e;for(const u of c)if(a&&typeof a=="object"&&u in a)a=a[u];else return s;let l=typeof a=="string"?a:s;return i&&typeof l=="string"&&Object.keys(i).forEach(u=>{const f=`{{${u}}}`;l=l.replace(new RegExp(f,"g"),String(i[u]))}),l}catch(c){return console.warn(`Translation error for key "${s}":`,c),s}},translations:e,locale:t,getTranslationObject:s=>{try{const i=s.split(".");let c=e;for(const a of i)if(c&&typeof c=="object"&&a in c)c=c[a];else return{};return typeof c=="object"?c:{}}catch(i){return console.warn(`Translation object error for key "${s}":`,i),{}}},hasTranslation:s=>{try{const i=s.split(".");let c=e;for(const a of i)if(c&&typeof c=="object"&&a in c)c=c[a];else return!1;return typeof c=="string"}catch{return!1}}}},ib="1.2.3";let ze=class Rl extends Error{constructor(t,n={}){var i;const r=n.cause instanceof Rl?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof Rl&&n.cause.docsPath||n.docsPath,s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${ib}`].join(`
51
+ `);super(s),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=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function Zt(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Zl=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Kl=/^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)?$/,Yl=/^\(.+?\).*?$/,Xl=/^tuple(?<array>(\[(\d*)\])*)$/;function Ii(e){let t=e.type;if(Xl.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let o=0;o<n;o++){const s=e.components[o];t+=Ii(s),o<n-1&&(t+=", ")}const r=Zt(Xl,e.type);return t+=`)${(r==null?void 0:r.array)||""}`,Ii({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function or(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=Ii(o),r!==n-1&&(t+=", ")}return t}function is(e){var t;return e.type==="function"?`function ${e.name}(${or(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${or(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${or(e.inputs)})`:e.type==="error"?`error ${e.name}(${or(e.inputs)})`:e.type==="constructor"?`constructor(${or(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Ql=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function ab(e){return Ql.test(e)}function cb(e){return Zt(Ql,e)}const Jl=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function lb(e){return Jl.test(e)}function ub(e){return Zt(Jl,e)}const eu=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function fb(e){return eu.test(e)}function db(e){return Zt(eu,e)}const tu=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function as(e){return tu.test(e)}function pb(e){return Zt(tu,e)}const nu=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function hb(e){return nu.test(e)}function mb(e){return Zt(nu,e)}const ru=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function bb(e){return ru.test(e)}function gb(e){return Zt(ru,e)}const yb=/^receive\(\) external payable$/;function vb(e){return yb.test(e)}const ou=new Set(["memory","indexed","storage","calldata"]),wb=new Set(["indexed"]),Di=new Set(["calldata","memory","storage"]);class xb extends ze{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 Eb extends ze{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 Sb extends ze{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 Pb extends ze{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class Tb extends ze{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class $b extends ze{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 Ab extends ze{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 Nb extends ze{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 Cb extends ze{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"})}}class sr extends ze{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Ob extends ze{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Ib extends ze{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 Db extends ze{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 Mb extends ze{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 kb(e,t,n){let r="";if(n)for(const o of Object.entries(n)){if(!o)continue;let s="";for(const i of o[1])s+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${o[0]}{${s}})`}return t?`${t}:${e}${r}`:`${e}${r}`}const Mi=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 ki(e,t={}){if(fb(e))return Lb(e,t);if(lb(e))return Bb(e,t);if(ab(e))return Fb(e,t);if(hb(e))return Rb(e,t);if(bb(e))return jb(e);if(vb(e))return{type:"receive",stateMutability:"payable"};throw new Ob({signature:e})}function Lb(e,t={}){const n=db(e);if(!n)throw new sr({signature:e,type:"function"});const r=et(n.parameters),o=[],s=r.length;for(let c=0;c<s;c++)o.push(Kt(r[c],{modifiers:Di,structs:t,type:"function"}));const i=[];if(n.returns){const c=et(n.returns),a=c.length;for(let l=0;l<a;l++)i.push(Kt(c[l],{modifiers:Di,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function Bb(e,t={}){const n=ub(e);if(!n)throw new sr({signature:e,type:"event"});const r=et(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(Kt(r[i],{modifiers:wb,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function Fb(e,t={}){const n=cb(e);if(!n)throw new sr({signature:e,type:"error"});const r=et(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(Kt(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function Rb(e,t={}){const n=mb(e);if(!n)throw new sr({signature:e,type:"constructor"});const r=et(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(Kt(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function jb(e){const t=gb(e);if(!t)throw new sr({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const _b=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,zb=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ub=/^u?int$/;function Kt(e,t){var f,d;const n=kb(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Mi.has(n))return Mi.get(n);const r=Yl.test(e),o=Zt(r?zb:_b,e);if(!o)throw new Tb({param:e});if(o.name&&Hb(o.name))throw new $b({param:e,name:o.name});const s=o.name?{name:o.name}:{},i=o.modifier==="indexed"?{indexed:!0}:{},c=(t==null?void 0:t.structs)??{};let a,l={};if(r){a="tuple";const p=et(o.type),h=[],b=p.length;for(let S=0;S<b;S++)h.push(Kt(p[S],{structs:c}));l={components:h}}else if(o.type in c)a="tuple",l={components:c[o.type]};else if(Ub.test(o.type))a=`${o.type}256`;else if(o.type==="address payable")a="address";else if(a=o.type,(t==null?void 0:t.type)!=="struct"&&!su(a))throw new Sb({type:a});if(o.modifier){if(!((d=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&d.call(f,o.modifier)))throw new Ab({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(Di.has(o.modifier)&&!Vb(a,!!o.array))throw new Nb({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const u={type:`${a}${o.array??""}`,...s,...i,...l};return Mi.set(n,u),u}function et(e,t=[],n="",r=0){const o=e.trim().length;for(let s=0;s<o;s++){const i=e[s],c=e.slice(s+1);switch(i){case",":return r===0?et(c,[...t,n.trim()]):et(c,t,`${n}${i}`,r);case"(":return et(c,t,`${n}${i}`,r+1);case")":return et(c,t,`${n}${i}`,r-1);default:return et(c,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new Mb({current:n,depth:r});return t.push(n.trim()),t}function su(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Zl.test(e)||Kl.test(e)}const Wb=/^(?: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 Hb(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Zl.test(e)||Kl.test(e)||Wb.test(e)}function Vb(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Li(e){const t={},n=e.length;for(let i=0;i<n;i++){const c=e[i];if(!as(c))continue;const a=pb(c);if(!a)throw new sr({signature:c,type:"struct"});const l=a.properties.split(";"),u=[],f=l.length;for(let d=0;d<f;d++){const h=l[d].trim();if(!h)continue;const b=Kt(h,{type:"struct"});u.push(b)}if(!u.length)throw new Ib({signature:c});t[a.name]=u}const r={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[c,a]=o[i];r[c]=iu(a,t)}return r}const Gb=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function iu(e=[],t={},n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(Yl.test(i.type))r.push(i);else{const a=Zt(Gb,i.type);if(!(a!=null&&a.type))throw new Cb({abiParameter:i});const{array:l,type:u}=a;if(u in t){if(n.has(u))throw new Db({type:u});r.push({...i,type:`tuple${l??""}`,components:iu(t[u],t,new Set([...n,u]))})}else if(su(u))r.push(i);else throw new Eb({type:u})}}return r}function au(e){const t=Li(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];as(s)||n.push(ki(s,t))}return n}function cu(e){let t;if(typeof e=="string")t=ki(e);else{const n=Li(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!as(s)){t=ki(s,n);break}}}if(!t)throw new xb({signature:e});return t}function lu(e){const t=[];if(typeof e=="string"){const n=et(e),r=n.length;for(let o=0;o<r;o++)t.push(Kt(n[o],{modifiers:ou}))}else{const n=Li(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(as(s))continue;const i=et(s),c=i.length;for(let a=0;a<c;a++)t.push(Kt(i[a],{modifiers:ou,structs:n}))}}if(t.length===0)throw new Pb({params:e});return t}function X(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}function St(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new i1(e.type);return`${e.name}(${cs(e.inputs,{includeName:t})})`}function cs(e,{includeName:t=!1}={}){return e?e.map(n=>qb(n,{includeName:t})).join(t?", ":","):""}function qb(e,{includeName:t}){return e.type.startsWith("tuple")?`(${cs(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Pt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function ve(e){return Pt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const uu="2.47.2";let Hr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${uu}`},V=class jl extends Error{constructor(t,n={}){var c;const r=(()=>{var a;return n.cause instanceof jl?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof jl&&n.cause.docsPath||n.docsPath,s=(c=Hr.getDocsUrl)==null?void 0:c.call(Hr,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...Hr.version?[`Version: ${Hr.version}`]:[]].join(`
52
+ `);super(i,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=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=uu}walk(t){return fu(this,t)}};function fu(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?fu(e.cause,t):t?null:e}class Zb extends V{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(`
53
+ `),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class du extends V{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(`
54
+ `),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class pu extends V{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
55
+ `),{metaMessages:[`Params: (${cs(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 Vr extends V{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class Kb extends V{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
56
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}}class Yb extends V{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ve(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Xb extends V{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
57
+ `),{name:"AbiEncodingLengthMismatchError"})}}class Qb extends V{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(`
58
+ `),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class hu extends V{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(`
59
+ `),{docsPath:n,name:"AbiErrorNotFoundError"})}}class mu extends V{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://4byte.sourcify.dev/?q=${t}.`].join(`
60
+ `),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class Jb extends V{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class e1 extends V{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://4byte.sourcify.dev/?q=${t}.`].join(`
61
+ `),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class bu extends V{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(`
62
+ `),{docsPath:n,name:"AbiEventNotFoundError"})}}class ir extends V{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(`
63
+ `),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class gu extends V{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(`
64
+ `),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class t1 extends V{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://4byte.sourcify.dev/?q=${t}.`].join(`
65
+ `),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class n1 extends V{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${St(t.abiItem)}\`, and`,`\`${n.type}\` in \`${St(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let r1=class extends V{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class ls extends V{constructor({abiItem:t,data:n,params:r,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(`
66
+ `),{metaMessages:[`Params: (${cs(r,{includeName:!0})})`,`Data: ${n} (${o} 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=o}}class Bi extends V{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${St(t,{includeName:!0})}".`].join(`
67
+ `),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class o1 extends V{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
68
+ `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class s1 extends V{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
69
+ `),{docsPath:n,name:"InvalidAbiDecodingType"})}}let yu=class extends V{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
70
+ `),{name:"InvalidArrayError"})}};class i1 extends V{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
71
+ `),{name:"InvalidDefinitionTypeError"})}}class a1 extends V{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let vu=class extends V{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},wu=class extends V{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 xu extends V{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 ar(e,{dir:t,size:n=32}={}){return typeof e=="string"?hn(e,{dir:t,size:n}):c1(e,{dir:t,size:n})}function hn(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new wu({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function c1(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new wu({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o<n;o++){const s=t==="right";r[s?o:n-o-1]=e[s?o:e.length-o-1]}return r}let Fi=class extends V{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},l1=class extends V{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 u1 extends V{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let f1=class extends V{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function kn(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)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}function Tt(e,{size:t}){if(ve(e)>t)throw new f1({givenSize:ve(e),maxSize:t})}function Lt(e,t={}){const{signed:n}=t;t.size&&Tt(e,{size:t.size});const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function d1(e,t={}){let n=e;if(t.size&&(Tt(n,{size:t.size}),n=kn(n)),kn(n)==="0x00")return!1;if(kn(n)==="0x01")return!0;throw new u1(n)}function Yt(e,t={}){const n=Lt(e,t),r=Number(n);if(!Number.isSafeInteger(r))throw new Fi({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return r}const p1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function mn(e,t={}){return typeof e=="number"||typeof e=="bigint"?J(e,t):typeof e=="string"?Gr(e,t):typeof e=="boolean"?Eu(e,t):Ae(e,t)}function Eu(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Tt(n,{size:t.size}),ar(n,{size:t.size})):n}function Ae(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=p1[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(Tt(r,{size:t.size}),ar(r,{dir:"right",size:t.size})):r}function J(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const a=typeof e=="bigint"?"n":"";throw new Fi({max:s?`${s}${a}`:void 0,min:`${i}${a}`,signed:n,size:r,value:`${e}${a}`})}const c=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?ar(c,{size:r}):c}const h1=new TextEncoder;function Gr(e,t={}){const n=h1.encode(e);return Ae(n,t)}const m1=new TextEncoder;function cr(e,t={}){return typeof e=="number"||typeof e=="bigint"?g1(e,t):typeof e=="boolean"?b1(e,t):Pt(e)?Bt(e,t):Ln(e,t)}function b1(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(Tt(n,{size:t.size}),ar(n,{size:t.size})):n}const Xt={zero:48,nine:57,A:65,F:70,a:97,f:102};function Su(e){if(e>=Xt.zero&&e<=Xt.nine)return e-Xt.zero;if(e>=Xt.A&&e<=Xt.F)return e-(Xt.A-10);if(e>=Xt.a&&e<=Xt.f)return e-(Xt.a-10)}function Bt(e,t={}){let n=e;t.size&&(Tt(n,{size:t.size}),n=ar(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,s=new Uint8Array(o);for(let i=0,c=0;i<o;i++){const a=Su(r.charCodeAt(c++)),l=Su(r.charCodeAt(c++));if(a===void 0||l===void 0)throw new V(`Invalid byte sequence ("${r[c-2]}${r[c-1]}" in "${r}").`);s[i]=a*16+l}return s}function g1(e,t){const n=J(e,t);return Bt(n)}function Ln(e,t={}){const n=m1.encode(e);return typeof t.size=="number"?(Tt(n,{size:t.size}),ar(n,{dir:"right",size:t.size})):n}const us=BigInt(2**32-1),Pu=BigInt(32);function y1(e,t=!1){return t?{h:Number(e&us),l:Number(e>>Pu&us)}:{h:Number(e>>Pu&us)|0,l:Number(e&us)|0}}function v1(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let s=0;s<n;s++){const{h:i,l:c}=y1(e[s],t);[r[s],o[s]]=[i,c]}return[r,o]}const w1=(e,t,n)=>e<<n|t>>>32-n,x1=(e,t,n)=>t<<n|e>>>32-n,E1=(e,t,n)=>t<<n-32|e>>>64-n,S1=(e,t,n)=>e<<n-32|t>>>64-n,lr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function P1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function qr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Bn(e,...t){if(!P1(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 T1(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");qr(e.outputLen),qr(e.blockLen)}function ur(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 Tu(e,t){Bn(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function $1(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function fr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ri(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ft(e,t){return e<<32-t|e>>>t}const A1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function N1(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function C1(e){for(let t=0;t<e.length;t++)e[t]=N1(e[t]);return e}const $u=A1?e=>e:C1;function O1(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function fs(e){return typeof e=="string"&&(e=O1(e)),Bn(e),e}function I1(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];Bn(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}class ji{}function Au(e){const t=r=>e().update(fs(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function D1(e=32){if(lr&&typeof lr.getRandomValues=="function")return lr.getRandomValues(new Uint8Array(e));if(lr&&typeof lr.randomBytes=="function")return Uint8Array.from(lr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const M1=BigInt(0),Zr=BigInt(1),k1=BigInt(2),L1=BigInt(7),B1=BigInt(256),F1=BigInt(113),Nu=[],Cu=[],Ou=[];for(let e=0,t=Zr,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Nu.push(2*(5*r+n)),Cu.push((e+1)*(e+2)/2%64);let o=M1;for(let s=0;s<7;s++)t=(t<<Zr^(t>>L1)*F1)%B1,t&k1&&(o^=Zr<<(Zr<<BigInt(s))-Zr);Ou.push(o)}const Iu=v1(Ou,!0),R1=Iu[0],j1=Iu[1],Du=(e,t,n)=>n>32?E1(e,t,n):w1(e,t,n),Mu=(e,t,n)=>n>32?S1(e,t,n):x1(e,t,n);function _1(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const c=(i+8)%10,a=(i+2)%10,l=n[a],u=n[a+1],f=Du(l,u,1)^n[c],d=Mu(l,u,1)^n[c+1];for(let p=0;p<50;p+=10)e[i+p]^=f,e[i+p+1]^=d}let o=e[2],s=e[3];for(let i=0;i<24;i++){const c=Cu[i],a=Du(o,s,c),l=Mu(o,s,c),u=Nu[i];o=e[u],s=e[u+1],e[u]=a,e[u+1]=l}for(let i=0;i<50;i+=10){for(let c=0;c<10;c++)n[c]=e[i+c];for(let c=0;c<10;c++)e[i+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=R1[r],e[1]^=j1[r]}fr(n)}class _i extends ji{constructor(t,n,r,o=!1,s=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=o,this.rounds=s,qr(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=$1(this.state)}clone(){return this._cloneInto()}keccak(){$u(this.state32),_1(this.state32,this.rounds),$u(this.state32),this.posOut=0,this.pos=0}update(t){ur(this),t=fs(t),Bn(t);const{blockLen:n,state:r}=this,o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);for(let c=0;c<i;c++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){ur(this,!1),Bn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let o=0,s=t.length;o<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-o);t.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return qr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Tu(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,fr(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new _i(n,r,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}}const z1=(e,t,n)=>Au(()=>new _i(t,e,n)),ku=z1(1,136,256/8);function De(e,t){const n=t||"hex",r=ku(Pt(e,{strict:!1})?cr(e):e);return n==="bytes"?r:mn(r)}const U1=e=>De(cr(e));function W1(e){return U1(e)}function H1(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function",""].includes(o))o="";else if(o+=c,c===")"){s=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=c,n+=c}}if(!s)throw new V("Unable to normalize signature.");return o}const V1=e=>{const t=typeof e=="string"?e:is(e);return H1(t)};function Lu(e){return W1(V1(e))}const ds=Lu;let bn=class extends V{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"})}},ps=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}};const zi=new ps(8192);function hs(e,t){if(zi.has(`${e}.${t}`))return zi.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=De(Ln(n),"bytes"),o=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(r[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());const s=`0x${o.join("")}`;return zi.set(`${e}.${t}`,s),s}function Qt(e,t){if(!ct(e,{strict:!1}))throw new bn({address:e});return hs(e,t)}const G1=/^0x[a-fA-F0-9]{40}$/,Ui=new ps(8192);function ct(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Ui.has(r))return Ui.get(r);const o=G1.test(e)?e.toLowerCase()===e?!0:n?hs(e)===e:!0:!1;return Ui.set(r,o),o}function $t(e){return typeof e[0]=="string"?dr(e):q1(e)}function q1(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function dr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Fn(e,t,n,{strict:r}={}){return Pt(e,{strict:!1})?Z1(e,t,n,{strict:r}):Ru(e,t,n,{strict:r})}function Bu(e,t){if(typeof t=="number"&&t>0&&t>ve(e)-1)throw new vu({offset:t,position:"start",size:ve(e)})}function Fu(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ve(e)!==n-t)throw new vu({offset:n,position:"end",size:ve(e)})}function Ru(e,t,n,{strict:r}={}){Bu(e,t);const o=e.slice(t,n);return r&&Fu(o,t,n),o}function Z1(e,t,n,{strict:r}={}){Bu(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Fu(o,t,n),o}const K1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ju=/^(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 gn(e,t){if(e.length!==t.length)throw new Xb({expectedLength:e.length,givenLength:t.length});const n=Y1({params:e,values:t}),r=Hi(n);return r.length===0?"0x":r}function Y1({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Wi({param:e[r],value:t[r]}));return n}function Wi({param:e,value:t}){const n=Vi(e.type);if(n){const[r,o]=n;return Q1(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return rg(t,{param:e});if(e.type==="address")return X1(t);if(e.type==="bool")return eg(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=ju.exec(e.type)??[];return tg(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return J1(t,{param:e});if(e.type==="string")return ng(t);throw new o1(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Hi(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=ve(c)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?(n.push(J(t+o,{size:32})),r.push(c),o+=ve(c)):n.push(c)}return $t([...n,...r])}function X1(e){if(!ct(e))throw new bn({address:e});return{dynamic:!1,encoded:hn(e.toLowerCase())}}function Q1(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new yu(e);if(!r&&e.length!==t)throw new Kb({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const c=Wi({param:n,value:e[i]});c.dynamic&&(o=!0),s.push(c)}if(r||o){const i=Hi(s);if(r){const c=J(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?$t([c,i]):c}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:$t(s.map(({encoded:i})=>i))}}function J1(e,{param:t}){const[,n]=t.type.split("bytes"),r=ve(e);if(!n){let o=e;return r%32!==0&&(o=hn(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:$t([hn(J(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new Yb({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:hn(e,{dir:"right"})}}function eg(e){if(typeof e!="boolean")throw new V(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:hn(Eu(e))}}function tg(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new Fi({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:J(e,{size:32,signed:t})}}function ng(e){const t=Gr(e),n=Math.ceil(ve(t)/32),r=[];for(let o=0;o<n;o++)r.push(hn(Fn(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:$t([hn(J(ve(t),{size:32})),...r])}}function rg(e,{param:t}){let n=!1;const r=[];for(let o=0;o<t.components.length;o++){const s=t.components[o],i=Array.isArray(e)?o:s.name,c=Wi({param:s,value:e[i]});r.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Hi(r):$t(r.map(({encoded:o})=>o))}}function Vi(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Kr=e=>Fn(Lu(e),0,4);function Rn(e){const{abi:t,args:n=[],name:r}=e,o=Pt(r,{strict:!1}),s=t.filter(c=>o?c.type==="function"?Kr(c)===r:c.type==="event"?ds(c)===r:!1:"name"in c&&c.name===r);if(s.length===0)return;if(s.length===1)return s[0];let i;for(const c of s){if(!("inputs"in c))continue;if(!n||n.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==n.length)continue;if(n.every((l,u)=>{const f="inputs"in c&&c.inputs[u];return f?Gi(l,f):!1})){if(i&&"inputs"in i&&i.inputs){const l=_u(c.inputs,i.inputs,n);if(l)throw new n1({abiItem:c,type:l[0]},{abiItem:i,type:l[1]})}i=c}}return i||s[0]}function Gi(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ct(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((o,s)=>n==="object"&&Gi(Object.values(e)[s],o)):/^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(o=>Gi(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function _u(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return _u(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?ct(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?ct(n[r],{strict:!1}):!1)return i}}const zu="/docs/contract/encodeEventTopics";function Yr(e){var a;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const l=Rn({abi:t,name:n});if(!l)throw new bu(n,{docsPath:zu});o=l}if(o.type!=="event")throw new bu(void 0,{docsPath:zu});const s=St(o),i=ds(s);let c=[];if(r&&"inputs"in o){const l=(a=o.inputs)==null?void 0:a.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(r)?r:Object.values(r).length>0?(l==null?void 0:l.map(f=>r[f.name]))??[]:[];u.length>0&&(c=(l==null?void 0:l.map((f,d)=>Array.isArray(u[d])?u[d].map((p,h)=>Uu({param:f,value:u[d][h]})):typeof u[d]<"u"&&u[d]!==null?Uu({param:f,value:u[d]}):null))??[])}return[i,...c]}function Uu({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return De(cr(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new a1(e.type);return gn([e],[t])}function ms(e,{method:t}){var r,o;const n={};return e.transport.type==="fallback"&&((o=(r=e.transport).onResponse)==null||o.call(r,({method:s,response:i,status:c,transport:a})=>{c==="success"&&t===s&&(n[i]=a.request)})),s=>n[s]||e.request}async function Wu(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:c,toBlock:a}=t,l=ms(e,{method:"eth_newFilter"}),u=s?Yr({abi:r,args:o,eventName:s}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?J(i):i,toBlock:typeof a=="bigint"?J(a):a,topics:u}]});return{abi:r,args:o,eventName:s,id:f,request:l(f),strict:!!c,type:"event"}}function tt(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Hu="/docs/contract/encodeFunctionData";function og(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=Rn({abi:t,args:n,name:r});if(!s)throw new ir(r,{docsPath:Hu});o=s}if(o.type!=="function")throw new ir(void 0,{docsPath:Hu});return{abi:[o],functionName:Kr(St(o))}}function lt(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:og(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?gn(o.inputs,t??[]):void 0;return dr([s,i??"0x"])}const sg={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."},Vu={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},ig={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let Gu=class extends V{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},qu=class extends V{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},ag=class extends V{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const cg={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 ag({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new qu({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Gu({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 Gu({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 qi(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(cg);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function lg(e,t={}){typeof t.size<"u"&&Tt(e,{size:t.size});const n=Ae(e,t);return Lt(n,t)}function ug(e,t={}){let n=e;if(typeof t.size<"u"&&(Tt(n,{size:t.size}),n=kn(n)),n.length>1||n[0]>1)throw new l1(n);return!!n[0]}function Jt(e,t={}){typeof t.size<"u"&&Tt(e,{size:t.size});const n=Ae(e,t);return Yt(n,t)}function fg(e,t={}){let n=e;return typeof t.size<"u"&&(Tt(n,{size:t.size}),n=kn(n,{dir:"right"})),new TextDecoder().decode(n)}function Xr(e,t){const n=typeof t=="string"?Bt(t):t,r=qi(n);if(ve(n)===0&&e.length>0)throw new Vr;if(ve(t)&&ve(t)<32)throw new pu({data:typeof t=="string"?t:Ae(t),params:e,size:ve(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const c=e[i];r.setPosition(o);const[a,l]=pr(r,c,{staticPosition:0});o+=l,s.push(a)}return s}function pr(e,t,{staticPosition:n}){const r=Vi(t.type);if(r){const[o,s]=r;return pg(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return gg(e,t,{staticPosition:n});if(t.type==="address")return dg(e);if(t.type==="bool")return hg(e);if(t.type.startsWith("bytes"))return mg(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return bg(e,t);if(t.type==="string")return yg(e,{staticPosition:n});throw new s1(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Zu=32,Zi=32;function dg(e){const t=e.readBytes(32);return[hs(Ae(Ru(t,-20))),32]}function pg(e,t,{length:n,staticPosition:r}){if(!n){const i=Jt(e.readBytes(Zi)),c=r+i,a=c+Zu;e.setPosition(c);const l=Jt(e.readBytes(Zu)),u=Qr(t);let f=0;const d=[];for(let p=0;p<l;++p){e.setPosition(a+(u?p*32:f));const[h,b]=pr(e,t,{staticPosition:a});f+=b,d.push(h)}return e.setPosition(r+32),[d,32]}if(Qr(t)){const i=Jt(e.readBytes(Zi)),c=r+i,a=[];for(let l=0;l<n;++l){e.setPosition(c+l*32);const[u]=pr(e,t,{staticPosition:c});a.push(u)}return e.setPosition(r+32),[a,32]}let o=0;const s=[];for(let i=0;i<n;++i){const[c,a]=pr(e,t,{staticPosition:r+o});o+=a,s.push(c)}return[s,o]}function hg(e){return[ug(e.readBytes(32),{size:32}),32]}function mg(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=Jt(e.readBytes(32));e.setPosition(n+i);const c=Jt(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Ae(a),32]}return[Ae(e.readBytes(Number.parseInt(o,10),32)),32]}function bg(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?lg(o,{signed:n}):Jt(o,{signed:n}),32]}function gg(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(Qr(t)){const i=Jt(e.readBytes(Zi)),c=n+i;for(let a=0;a<t.components.length;++a){const l=t.components[a];e.setPosition(c+s);const[u,f]=pr(e,l,{staticPosition:c});s+=f,o[r?a:l==null?void 0:l.name]=u}return e.setPosition(n+32),[o,32]}for(let i=0;i<t.components.length;++i){const c=t.components[i],[a,l]=pr(e,c,{staticPosition:n});o[r?i:c==null?void 0:c.name]=a,s+=l}return[o,s]}function yg(e,{staticPosition:t}){const n=Jt(e.readBytes(32)),r=t+n;e.setPosition(r);const o=Jt(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=fg(kn(s));return e.setPosition(t+32),[i,32]}function Qr(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(Qr);const n=Vi(e.type);return!!(n&&Qr({...e,type:n[1]}))}function Ku(e){const{abi:t,data:n}=e,r=Fn(n,0,4);if(r==="0x")throw new Vr;const s=[...t||[],Vu,ig].find(i=>i.type==="error"&&r===Kr(St(i)));if(!s)throw new mu(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Xr(s.inputs,Fn(n,4)):void 0,errorName:s.name}}const Ne=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n);function Yu({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((o,s)=>`${r&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?Ne(t[s]):t[s]}`).join(", ")})`}const vg={gwei:9,wei:18},wg={ether:-9,wei:9};function Ki(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${s?`.${s}`:""}`}function Yi(e,t="wei"){return Ki(e,vg[t])}function Ue(e,t="wei"){return Ki(e,wg[t])}class xg extends V{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Eg extends V{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function Xu(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
72
+ `,"")}function Sg(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
73
73
  `;return r.nonce&&(o+=` nonce: ${r.nonce}
74
74
  `),r.balance&&(o+=` balance: ${r.balance}
75
75
  `),r.code&&(o+=` code: ${r.code}
76
76
  `),r.state&&(o+=` state:
77
- `,o+=Uu(r.state)),r.stateDiff&&(o+=` stateDiff:
78
- `,o+=Uu(r.stateDiff)),o},` State Override:
79
- `).slice(0,-1)}function Gr(e){const t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
80
- `)}class gg extends V{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Gr(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 yg extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:p}){var h;const d=Gr({chain:o&&`${o==null?void 0:o.name} (id: ${o==null?void 0:o.id})`,from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Ri(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ue(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ue(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ue(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",d].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Wu extends V{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){let i="Transaction";r&&s!==void 0&&(i=`Transaction at block time "${r}" at index "${s}"`),t&&s!==void 0&&(i=`Transaction at block hash "${t}" at index "${s}"`),n&&s!==void 0&&(i=`Transaction at block number "${n}" at index "${s}"`),o&&(i=`Transaction with hash "${o}"`),super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}}class Hu extends V{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 vg extends V{constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class wg extends V{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const xg=e=>e,qr=e=>e;class Vu extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:p,stateOverride:d}){var v;const h=n?Je(n):void 0;let m=Gr({from:h==null?void 0:h.address,to:f,value:typeof p<"u"&&`${Ri(p)} ${((v=o==null?void 0:o.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ue(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ue(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ue(l)} gwei`,nonce:u});d&&(m+=`
81
- ${bg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Gu extends V{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:s,functionName:i,sender:c}){const a=Mn({abi:n,args:r,name:i}),l=a?zu({abiItem:a,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=a?xt(a,{includeName:!0}):void 0,f=Gr({address:o&&xg(o),function:u,args:l&&l!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:c});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:s,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=o,this.functionName=i,this.sender=c}}class ji extends V{constructor({abi:t,data:n,functionName:r,message:o}){let s,i,c,a;if(n&&n!=="0x")try{i=_u({abi:t,data:n});const{abiItem:u,errorName:f,args:p}=i;if(f==="Error")a=p[0];else if(f==="Panic"){const[d]=p;a=Q1[d]}else{const d=u?xt(u,{includeName:!0}):void 0,h=u&&p?zu({abiItem:u,args:p,includeFunctionName:!1,includeName:!1}):void 0;c=[d?`Error: ${d}`:"",h&&h!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(u){s=u}else o&&(a=o);let l;s instanceof su&&(l=s.signature,c=[`Unable to decode signature "${l}" 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=${l}.`]),super(a&&a!=="execution reverted"||l?[`The contract function "${r}" reverted with the following ${l?"signature":"reason"}:`,a||l].join(`
82
- `):`The contract function "${r}" reverted.`,{cause:s,metaMessages:c,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=i,this.raw=n,this.reason=a,this.signature=l}}class Eg extends V{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 Sg extends V{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 is extends V{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}}class Ln extends V{constructor({body:t,cause:n,details:r,headers:o,status:s,url:i}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${qr(i)}`,t&&`Request body: ${$e(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=o,this.status=s,this.url=i}}class _i extends V{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${qr(r)}`,`Request body: ${$e(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}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=r}}class qu extends V{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${qr(n)}`,`Request body: ${$e(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const Pg=-1;class We extends V{constructor(t,{code:n,docsPath:r,metaMessages:o,name:s,shortMessage:i}){super(i,{cause:t,docsPath:r,metaMessages:o||(t==null?void 0:t.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||t.name,this.code=t instanceof _i?t.code:n??Pg}}class et extends We{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class Zr extends We{constructor(t){super(t,{code:Zr.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Zr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Kr extends We{constructor(t){super(t,{code:Kr.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Kr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Yr extends We{constructor(t,{method:n}={}){super(t,{code:Yr.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(Yr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Xr extends We{constructor(t){super(t,{code:Xr.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
83
- `)})}}Object.defineProperty(Xr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Bn extends We{constructor(t){super(t,{code:Bn.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Bn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class gn extends We{constructor(t){super(t,{code:gn.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
84
- `)})}}Object.defineProperty(gn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Qr extends We{constructor(t){super(t,{code:Qr.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Qr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Jr extends We{constructor(t){super(t,{code:Jr.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Jr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class eo extends We{constructor(t){super(t,{code:eo.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Fn extends We{constructor(t,{method:n}={}){super(t,{code:Fn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Fn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class fr extends We{constructor(t){super(t,{code:fr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(fr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class to extends We{constructor(t){super(t,{code:to.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(to,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class dr extends et{constructor(t){super(t,{code:dr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(dr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class no extends et{constructor(t){super(t,{code:no.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(no,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class ro extends et{constructor(t,{method:n}={}){super(t,{code:ro.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class oo extends et{constructor(t){super(t,{code:oo.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class so extends et{constructor(t){super(t,{code:so.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(so,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class io extends et{constructor(t){super(t,{code:io.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(io,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class ao extends et{constructor(t){super(t,{code:ao.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(ao,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class co extends et{constructor(t){super(t,{code:co.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(co,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class lo extends et{constructor(t){super(t,{code:lo.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(lo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class uo extends et{constructor(t){super(t,{code:uo.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(uo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class fo extends et{constructor(t){super(t,{code:fo.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(fo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class po extends et{constructor(t){super(t,{code:po.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(po,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class ho extends et{constructor(t){super(t,{code:ho.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Tg extends We{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Ag=3;function pr(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const c=e instanceof is?e:e instanceof V?e.walk(h=>"data"in h)||e.walk():{},{code:a,data:l,details:u,message:f,shortMessage:p}=c,d=e instanceof Rr?new Eg({functionName:s}):[Ag,Bn.code].includes(a)&&(l||u||f||p)||a===gn.code&&u==="execution reverted"&&l?new ji({abi:t,data:typeof l=="object"?l.data:l,functionName:s,message:c instanceof _i?u:p??f}):e;return new Gu(d,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}function $g(e){const t=ke(`0x${e.substring(4)}`).substring(26);return os(`0x${t}`)}async function Cg({hash:e,signature:t}){const n=Et(e)?e:pn(e),{secp256k1:r}=await Promise.resolve().then(()=>a6);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:l,s:u,v:f,yParity:p}=t,d=Number(p??f),h=Zu(d);return new r.Signature(Dt(l),Dt(u)).addRecoveryBit(h)}const i=Et(t)?t:pn(t);if(ve(i)!==65)throw new Error("invalid signature length");const c=Zt(`0x${i.slice(130)}`),a=Zu(c);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function Zu(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 Ku({hash:e,signature:t}){return $g(await Cg({hash:e,signature:t}))}function Ng(e,t="hex"){const n=Yu(e),r=Li(new Uint8Array(n.length));return n.encode(r),t==="hex"?Ae(r.bytes):r.bytes}function Yu(e){return Array.isArray(e)?Og(e.map(t=>Yu(t))):Ig(e)}function Og(e){const t=e.reduce((o,s)=>o+s.length,0),n=Xu(t);return{length:t<=55?1+t:1+n+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+n),n===1?o.pushUint8(t):n===2?o.pushUint16(t):n===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:s}of e)s(o)}}}function Ig(e){const t=typeof e=="string"?Mt(e):e,n=Xu(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+n),n===1?o.pushUint8(t.length):n===2?o.pushUint16(t.length):n===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function Xu(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 V("Length is too large.")}function kg(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=ke(cr(["0x05",Ng([t?Q(t):"0x",o,n?Q(n):"0x"])]));return r==="bytes"?Mt(s):s}async function Qu(e){const{authorization:t,signature:n}=e;return Ku({hash:kg(t),signature:n??t})}class Dg extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:p}){var h;const d=Gr({from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Ri(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ue(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ue(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ue(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",d].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class hr extends V{constructor({cause:t,message:n}={}){var o;const r=(o=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:o.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(hr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(hr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class as extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Ue(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(as,"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 zi extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Ue(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(zi,"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 Ui extends V{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(Ui,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Wi extends V{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(`
85
- `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(Wi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Hi extends V{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(Hi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Vi extends V{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
86
- `),{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(Vi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Gi extends V{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(Gi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class qi extends V{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(qi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Zi extends V{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Zi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class cs extends V{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Ue(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${Ue(r)} gwei`:""}).`].join(`
87
- `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(cs,"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 mo extends V{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function ls(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof V?e.walk(o=>(o==null?void 0:o.code)===hr.code):e;return r instanceof V?new hr({cause:e,message:r.details}):hr.nodeMessage.test(n)?new hr({cause:e,message:e.details}):as.nodeMessage.test(n)?new as({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):zi.nodeMessage.test(n)?new zi({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Ui.nodeMessage.test(n)?new Ui({cause:e,nonce:t==null?void 0:t.nonce}):Wi.nodeMessage.test(n)?new Wi({cause:e,nonce:t==null?void 0:t.nonce}):Hi.nodeMessage.test(n)?new Hi({cause:e,nonce:t==null?void 0:t.nonce}):Vi.nodeMessage.test(n)?new Vi({cause:e}):Gi.nodeMessage.test(n)?new Gi({cause:e,gas:t==null?void 0:t.gas}):qi.nodeMessage.test(n)?new qi({cause:e,gas:t==null?void 0:t.gas}):Zi.nodeMessage.test(n)?new Zi({cause:e}):cs.nodeMessage.test(n)?new cs({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new mo({cause:e})}function Mg(e,{docsPath:t,...n}){const r=(()=>{const o=ls(e,n);return o instanceof mo?e:o})();return new Dg(r,{docsPath:t,...n})}function us(e,{format:t}){if(!t)return{};const n={};function r(s){const i=Object.keys(s);for(const c of i)c in e&&(n[c]=e[c]),s[c]&&typeof s[c]=="object"&&!Array.isArray(s[c])&&r(s[c])}const o=t(e||{});return r(o),n}const Lg={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function bo(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Bg(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>Ae(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=Q(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=Q(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=Q(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=Q(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=Q(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=Q(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Lg[e.type]),typeof e.value<"u"&&(n.value=Q(e.value)),n}function Bg(e){return e.map(t=>({address:t.address,r:t.r?Q(BigInt(t.r)):t.r,s:t.s?Q(BigInt(t.s)):t.s,chainId:Q(t.chainId),nonce:Q(t.nonce),...typeof t.yParity<"u"?{yParity:Q(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:Q(t.v)}:{}}))}function Ju(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new fu({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new fu({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Fg(e){const{balance:t,nonce:n,state:r,stateDiff:o,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=Q(t)),n!==void 0&&(i.nonce=Q(n)),r!==void 0&&(i.state=Ju(r)),o!==void 0){if(i.state)throw new mg;i.stateDiff=Ju(o)}return i}function Ki(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!at(n,{strict:!1}))throw new hn({address:n});if(t[n])throw new hg({address:n});t[n]=Fg(r)}return t}const ef=2n**256n-1n;function mr(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?Je(t):void 0;if(s&&!at(s.address))throw new hn({address:s.address});if(o&&!at(o))throw new hn({address:o});if(n&&n>ef)throw new as({maxFeePerGas:n});if(r&&n&&r>n)throw new cs({maxFeePerGas:n,maxPriorityFeePerGas:r})}class tf extends V{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Yi extends V{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Rg extends V{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Ue(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class nf extends V{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 rf={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Xi(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Zt(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?Zt(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?rf[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&&(n.authorizationList=jg(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}function jg(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 of(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Xi(r));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:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function At(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:o}={}){var l,u,f;const s=o??!1,i=n!==void 0?Q(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,s]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[i||r,s]},{dedupe:!!i}),!c)throw new nf({blockHash:t,blockNumber:n});return(((f=(u=(l=e.chain)==null?void 0:l.formatters)==null?void 0:u.block)==null?void 0:f.format)||of)(c,"getBlock")}async function Qi(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function _g(e,t){return sf(e,t)}async function sf(e,t){var s,i;const{block:n,chain:r=e.chain,request:o}=t||{};try{const c=((s=r==null?void 0:r.fees)==null?void 0:s.maxPriorityFeePerGas)??((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee);if(typeof c=="function"){const l=n||await X(e,At,"getBlock")({}),u=await c({block:l,client:e,request:o});if(u===null)throw new Error;return u}if(typeof c<"u")return c;const a=await e.request({method:"eth_maxPriorityFeePerGas"});return Dt(a)}catch{const[c,a]=await Promise.all([n?Promise.resolve(n):X(e,At,"getBlock")({}),X(e,Qi,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new Yi;const l=a-c.baseFeePerGas;return l<0n?0n:l}}async function zg(e,t){return Ji(e,t)}async function Ji(e,t){var p,d;const{block:n,chain:r=e.chain,request:o,type:s="eip1559"}=t||{},i=await(async()=>{var h,m;return typeof((h=r==null?void 0:r.fees)==null?void 0:h.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:o}):((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(i<1)throw new tf;const a=10**(((p=i.toString().split(".")[1])==null?void 0:p.length)??0),l=h=>h*BigInt(Math.ceil(i*a))/BigInt(a),u=n||await X(e,At,"getBlock")({});if(typeof((d=r==null?void 0:r.fees)==null?void 0:d.estimateFeesPerGas)=="function"){const h=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:l,request:o,type:s});if(h!==null)return h}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Yi;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await sf(e,{block:u,chain:r,request:o}),m=l(u.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??m+h,maxPriorityFeePerGas:h}}return{gasPrice:(o==null?void 0:o.gasPrice)??l(await X(e,Qi,"getGasPrice")({}))}}async function af(e,{address:t,blockTag:n="latest",blockNumber:r}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?Q(r):n]},{dedupe:!!r});return Zt(o)}function cf(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(s=>Mt(s)):e.blobs,o=[];for(const s of r)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?o:o.map(s=>Ae(s))}function lf(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>Mt(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>Mt(i)):e.commitments,s=[];for(let i=0;i<r.length;i++){const c=r[i],a=o[i];s.push(Uint8Array.from(t.computeBlobKzgProof(c,a)))}return n==="bytes"?s:s.map(i=>Ae(i))}function Ug(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),c=Number(n&s),a=r?4:0,l=r?0:4;e.setUint32(t+a,i,r),e.setUint32(t+l,c,r)}function Wg(e,t,n){return e&t^~e&n}function Hg(e,t,n){return e&t^e&n^t&n}class Vg extends $i{constructor(t,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=Ai(this.buffer)}update(t){ir(this),t=ts(t),Dn(t);const{view:n,buffer:r,blockLen:o}=this,s=t.length;for(let i=0;i<s;){const c=Math.min(o-this.pos,s-i);if(c===o){const a=Ai(t);for(;o<=s-i;i+=o)this.process(a,i);continue}r.set(t.subarray(i,i+c),this.pos),this.pos+=c,i+=c,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ir(this),bu(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,ar(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let f=i;f<o;f++)n[f]=0;Ug(r,o-8,BigInt(this.length*8),s),this.process(r,0);const c=Ai(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=a/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)c.setUint32(4*f,u[f],s)}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:o,finished:s,destroyed:i,pos:c}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=c,o%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const yn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Gg=Uint32Array.from([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]),vn=new Uint32Array(64);class qg extends Vg{constructor(t=32){super(64,t,8,!1),this.A=yn[0]|0,this.B=yn[1]|0,this.C=yn[2]|0,this.D=yn[3]|0,this.E=yn[4]|0,this.F=yn[5]|0,this.G=yn[6]|0,this.H=yn[7]|0}get(){const{A:t,B:n,C:r,D:o,E:s,F:i,G:c,H:a}=this;return[t,n,r,o,s,i,c,a]}set(t,n,r,o,s,i,c,a){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=c|0,this.H=a|0}process(t,n){for(let f=0;f<16;f++,n+=4)vn[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const p=vn[f-15],d=vn[f-2],h=Lt(p,7)^Lt(p,18)^p>>>3,m=Lt(d,17)^Lt(d,19)^d>>>10;vn[f]=m+vn[f-7]+h+vn[f-16]|0}let{A:r,B:o,C:s,D:i,E:c,F:a,G:l,H:u}=this;for(let f=0;f<64;f++){const p=Lt(c,6)^Lt(c,11)^Lt(c,25),d=u+p+Wg(c,a,l)+Gg[f]+vn[f]|0,m=(Lt(r,2)^Lt(r,13)^Lt(r,22))+Hg(r,o,s)|0;u=l,l=a,a=c,c=i+d|0,i=s,s=o,o=r,r=d+m|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,c=c+this.E|0,a=a+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,o,s,i,c,a,l,u)}roundClean(){ar(vn)}destroy(){this.set(0,0,0,0,0,0,0,0),ar(this.buffer)}}const uf=yu(()=>new qg),Zg=uf;function Kg(e,t){return Zg(Et(e,{strict:!1})?or(e):e)}function Yg(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=Kg(t);return o.set([n],0),r==="bytes"?o:Ae(o)}function Xg(e){const{commitments:t,version:n}=e,r=e.to,o=[];for(const s of t)o.push(Yg({commitment:s,to:r,version:n}));return o}const ff=6,df=32,ea=4096,pf=df*ea,hf=pf*ff-1-1*ea*ff;class Qg extends V{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Jg extends V{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function ey(e){const t=typeof e.data=="string"?Mt(e.data):e.data,n=ve(t);if(!n)throw new Jg;if(n>hf)throw new Qg({maxSize:hf,size:n});const r=[];let o=!0,s=0;for(;o;){const i=Li(new Uint8Array(pf));let c=0;for(;c<ea;){const a=t.slice(s,s+(df-1));if(i.pushByte(0),i.pushBytes(a),a.length<31){i.pushByte(128),o=!1;break}c++,s+=31}r.push(i)}return r.map(i=>Ae(i.bytes))}function ty(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??ey({data:t}),s=e.commitments??cf({blobs:o,kzg:n,to:r}),i=e.proofs??lf({blobs:o,commitments:s,kzg:n,to:r}),c=[];for(let a=0;a<o.length;a++)c.push({blob:o[a],commitment:s[a],proof:i[a]});return c}function ny(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 gg({transaction:e})}function ry(e,{docsPath:t,...n}){const r=(()=>{const o=ls(e,n);return o instanceof mo?e:o})();return new yg(r,{docsPath:t,...n})}async function ta(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Zt(t)}async function mf(e,t){var b,g,w,$,C;const{account:n=e.account,accessList:r,authorizationList:o,chain:s=e.chain,blobVersionedHashes:i,blobs:c,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:d,nonce:h,nonceManager:m,to:v,type:T,value:E,...S}=t,N=await(async()=>{if(!n||!m||typeof h<"u")return h;const O=Je(n),k=s?s.id:await X(e,ta,"getChainId")({});return await m.consume({address:O.address,chainId:k,client:e})})();mr(t);const M=(g=(b=s==null?void 0:s.formatters)==null?void 0:b.transactionRequest)==null?void 0:g.format,F=(M||bo)({...us(S,{format:M}),account:n?Je(n):void 0,accessList:r,authorizationList:o,blobs:c,blobVersionedHashes:i,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:d,nonce:N,to:v,type:T,value:E},"fillTransaction");try{const O=await e.request({method:"eth_fillTransaction",params:[F]}),y=((($=(w=s==null?void 0:s.formatters)==null?void 0:w.transaction)==null?void 0:$.format)||Xi)(O.tx);delete y.blockHash,delete y.blockNumber,delete y.r,delete y.s,delete y.transactionIndex,delete y.v,delete y.yParity,y.data=y.input,y.gas&&(y.gas=t.gas??y.gas),y.gasPrice&&(y.gasPrice=t.gasPrice??y.gasPrice),y.maxFeePerBlobGas&&(y.maxFeePerBlobGas=t.maxFeePerBlobGas??y.maxFeePerBlobGas),y.maxFeePerGas&&(y.maxFeePerGas=t.maxFeePerGas??y.maxFeePerGas),y.maxPriorityFeePerGas&&(y.maxPriorityFeePerGas=t.maxPriorityFeePerGas??y.maxPriorityFeePerGas),y.nonce&&(y.nonce=t.nonce??y.nonce);const A=await(async()=>{var j,z;if(typeof((j=s==null?void 0:s.fees)==null?void 0:j.baseFeeMultiplier)=="function"){const _=await X(e,At,"getBlock")({});return s.fees.baseFeeMultiplier({block:_,client:e,request:t})}return((z=s==null?void 0:s.fees)==null?void 0:z.baseFeeMultiplier)??1.2})();if(A<1)throw new tf;const P=10**(((C=A.toString().split(".")[1])==null?void 0:C.length)??0),L=j=>j*BigInt(Math.ceil(A*P))/BigInt(P);return y.maxFeePerGas&&!t.maxFeePerGas&&(y.maxFeePerGas=L(y.maxFeePerGas)),y.gasPrice&&!t.gasPrice&&(y.gasPrice=L(y.gasPrice)),{raw:O.raw,transaction:{from:F.from,...y}}}catch(O){throw ry(O,{...t,chain:e.chain})}}const oy=["blobVersionedHashes","chainId","fees","gas","nonce","type"],bf=new Map,na=new rs(128);async function gf(e,t){var N,M,B;let n=t;const{account:r=e.account,chain:o=e.chain,nonceManager:s,parameters:i=oy}=n,c=(()=>{if(typeof(o==null?void 0:o.prepareTransactionRequest)=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o==null?void 0:o.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})();let a;async function l(){return a||(typeof n.chainId<"u"?n.chainId:o?o.id:(a=await X(e,ta,"getChainId")({}),a))}const u=r&&Je(r);let f=n.nonce;if(i.includes("nonce")&&typeof f>"u"&&u&&s){const F=await l();f=await s.consume({address:u.address,chainId:F,client:e})}c!=null&&c.fn&&((N=c.runAt)!=null&&N.includes("beforeFillTransaction"))&&(n=await c.fn(n,{phase:"beforeFillTransaction"}),f??(f=n.nonce));const d=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||na.get(e.uid)===!1||!["fees","gas"].some(b=>i.includes(b))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof f!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await X(e,mf,"fillTransaction")({...n,nonce:f}).then(F=>{const{chainId:b,from:g,gas:w,gasPrice:$,nonce:C,maxFeePerBlobGas:O,maxFeePerGas:k,maxPriorityFeePerGas:y,type:A,...I}=F.transaction;return na.set(e.uid,!0),{...n,...g?{from:g}:{},...A?{type:A}:{},...typeof b<"u"?{chainId:b}:{},...typeof w<"u"?{gas:w}:{},...typeof $<"u"?{gasPrice:$}:{},...typeof C<"u"?{nonce:C}:{},...typeof O<"u"?{maxFeePerBlobGas:O}:{},...typeof k<"u"?{maxFeePerGas:k}:{},...typeof y<"u"?{maxPriorityFeePerGas:y}:{},..."nonceKey"in I&&typeof I.nonceKey<"u"?{nonceKey:I.nonceKey}:{}}}).catch(F=>{var w;const b=F;return((w=b.walk)==null?void 0:w.call(b,$=>{const C=$;return C.name==="MethodNotFoundRpcError"||C.name==="MethodNotSupportedRpcError"}))&&na.set(e.uid,!1),n}):n;f??(f=d.nonce),n={...d,...u?{from:u==null?void 0:u.address}:{},...f?{nonce:f}:{}};const{blobs:h,gas:m,kzg:v,type:T}=n;c!=null&&c.fn&&((M=c.runAt)!=null&&M.includes("beforeFillParameters"))&&(n=await c.fn(n,{phase:"beforeFillParameters"}));let E;async function S(){return E||(E=await X(e,At,"getBlock")({blockTag:"latest"}),E)}if(i.includes("nonce")&&typeof f>"u"&&u&&!s&&(n.nonce=await X(e,af,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&h&&v){const F=cf({blobs:h,kzg:v});if(i.includes("blobVersionedHashes")){const b=Xg({commitments:F,to:"hex"});n.blobVersionedHashes=b}if(i.includes("sidecars")){const b=lf({blobs:h,commitments:F,kzg:v}),g=ty({blobs:h,commitments:F,proofs:b,to:"hex"});n.sidecars=g}}if(i.includes("chainId")&&(n.chainId=await l()),(i.includes("fees")||i.includes("type"))&&typeof T>"u")try{n.type=ny(n)}catch{let F=bf.get(e.uid);if(typeof F>"u"){const b=await S();F=typeof(b==null?void 0:b.baseFeePerGas)=="bigint",bf.set(e.uid,F)}n.type=F?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const F=await S(),{maxFeePerGas:b,maxPriorityFeePerGas:g}=await Ji(e,{block:F,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<g)throw new Rg({maxPriorityFeePerGas:g});n.maxPriorityFeePerGas=g,n.maxFeePerGas=b}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Yi;if(typeof n.gasPrice>"u"){const F=await S(),{gasPrice:b}=await Ji(e,{block:F,chain:o,request:n,type:"legacy"});n.gasPrice=b}}return i.includes("gas")&&typeof m>"u"&&(n.gas=await X(e,ra,"estimateGas")({...n,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),c!=null&&c.fn&&((B=c.runAt)!=null&&B.includes("afterFillParameters"))&&(n=await c.fn(n,{phase:"afterFillParameters"})),mr(n),delete n.parameters,n}async function ra(e,t){var i,c,a;const{account:n=e.account,prepare:r=!0}=t,o=n?Je(n):void 0,s=(()=>{if(Array.isArray(r))return r;if((o==null?void 0:o.type)!=="local")return["blobVersionedHashes"]})();try{const l=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await Qu({authorization:t.authorizationList[0]}).catch(()=>{throw new V("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:f,blobs:p,blobVersionedHashes:d,blockNumber:h,blockTag:m,data:v,gas:T,gasPrice:E,maxFeePerBlobGas:S,maxFeePerGas:N,maxPriorityFeePerGas:M,nonce:B,value:F,stateOverride:b,...g}=r?await gf(e,{...t,parameters:s,to:l}):t;if(T&&t.gas!==T)return T;const $=(typeof h=="bigint"?Q(h):void 0)||m,C=Ki(b);mr(t);const O=(a=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionRequest)==null?void 0:a.format,y=(O||bo)({...us(g,{format:O}),account:o,accessList:u,authorizationList:f,blobs:p,blobVersionedHashes:d,data:v,gasPrice:E,maxFeePerBlobGas:S,maxFeePerGas:N,maxPriorityFeePerGas:M,nonce:B,to:l,value:F},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:C?[y,$??e.experimental_blockTag??"latest",C]:$?[y,$]:[y]}))}catch(l){throw Mg(l,{...t,account:o,chain:e.chain})}}async function sy(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:i,...c}=t,a=Tt({abi:n,args:o,functionName:s});try{return await X(e,ra,"estimateGas")({data:`${a}${i?i.replace("0x",""):""}`,to:r,...c})}catch(l){const u=c.account?Je(c.account):void 0;throw pr(l,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:u==null?void 0:u.address})}}function go(e,t){if(!at(e,{strict:!1}))throw new hn({address:e});if(!at(t,{strict:!1}))throw new hn({address:t});return e.toLowerCase()===t.toLowerCase()}const yf="/docs/contract/decodeEventLog";function fs(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...c]=o;if(!i)throw new Gb({docsPath:yf});const a=t.find(m=>m.type==="event"&&i===ns(xt(m)));if(!(a&&"name"in a)||a.type!=="event")throw new qb(i,{docsPath:yf});const{name:l,inputs:u}=a,f=u==null?void 0:u.some(m=>!("name"in m&&m.name)),p=f?[]:{},d=u.map((m,v)=>[m,v]).filter(([m])=>"indexed"in m&&m.indexed);for(let m=0;m<d.length;m++){const[v,T]=d[m],E=c[m];if(!E)throw new Ti({abiItem:a,param:v});p[f?T:v.name||T]=iy({param:v,value:E})}const h=u.filter(m=>!("indexed"in m&&m.indexed));if(h.length>0){if(n&&n!=="0x")try{const m=Hr(h,n);if(m)if(f)for(let v=0;v<u.length;v++)p[v]=p[v]??m.shift();else for(let v=0;v<h.length;v++)p[h[v].name]=m[v]}catch(m){if(s)throw m instanceof ru||m instanceof Ru?new Jo({abiItem:a,data:n,params:h,size:ve(n)}):m}else if(s)throw new Jo({abiItem:a,data:"0x",params:h,size:0})}return{eventName:l,args:Object.values(p).length>0?p:void 0}}function iy({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Hr([e],t)||[])[0]}function oa(e){const{abi:t,args:n,logs:r,strict:o=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(i=>{var u;const c=t.filter(f=>f.type==="event"&&i.topics[0]===ns(f));if(c.length===0)return null;let a,l;for(const f of c)try{a=fs({...i,abi:[f],strict:!0}),l=f;break}catch{}if(!a&&!o){l=c[0];try{a=fs({...i,abi:[l],strict:!1})}catch{const f=(u=l.inputs)==null?void 0:u.some(p=>!("name"in p&&p.name));return{...i,args:f?[]:{},eventName:l.name}}}return!a||!l||s&&!s.includes(a.eventName)||!ay({args:a.args,inputs:l.inputs,matchArgs:n})?null:{...a,...i}}).filter(Boolean)}function ay(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function o(s,i,c){try{return s.type==="address"?go(i,c):s.type==="string"||s.type==="bytes"?ke(or(i))===c:i===c}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((s,i)=>{if(s==null)return!0;const c=n[i];return c?(Array.isArray(s)?s:[s]).some(l=>o(c,l,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,i])=>{if(i==null)return!0;const c=n.find(l=>l.name===s);return c?(Array.isArray(i)?i:[i]).some(l=>o(c,l,t[s])):!1}):!1}function Xt(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,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 sa(e,{address:t,blockHash:n,fromBlock:r,toBlock:o,event:s,events:i,args:c,strict:a}={}){const l=a??!1,u=i??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(m=>Wr({abi:[m],eventName:m.name,args:i?void 0:c}))],s&&(f=f[0]));let p;n?p=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):p=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?Q(r):r,toBlock:typeof o=="bigint"?Q(o):o}]});const d=p.map(h=>Xt(h));return u?oa({abi:u,args:c,logs:d,strict:l}):d}async function vf(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:c,toBlock:a,strict:l}=t,u=i?Mn({abi:n,name:i}):void 0,f=u?void 0:n.filter(p=>p.type==="event");return X(e,sa,"getLogs")({address:r,args:o,blockHash:s,event:u,events:f,fromBlock:c,toBlock:a,strict:l})}const ia="/docs/contract/decodeFunctionResult";function Rn(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const c=Mn({abi:t,args:n,name:r});if(!c)throw new nr(r,{docsPath:ia});s=c}if(s.type!=="function")throw new nr(void 0,{docsPath:ia});if(!s.outputs)throw new au(s.name,{docsPath:ia});const i=Hr(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const aa=BigInt(0),ca=BigInt(1);function yo(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function la(e){if(!yo(e))throw new Error("Uint8Array expected")}function vo(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function ds(e){const t=e.toString(16);return t.length&1?"0"+t:t}function wf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?aa:BigInt("0x"+e)}const xf=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",cy=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function wo(e){if(la(e),xf)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=cy[e[n]];return t}const Qt={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ef(e){if(e>=Qt._0&&e<=Qt._9)return e-Qt._0;if(e>=Qt.A&&e<=Qt.F)return e-(Qt.A-10);if(e>=Qt.a&&e<=Qt.f)return e-(Qt.a-10)}function ps(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(xf)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 o=0,s=0;o<n;o++,s+=2){const i=Ef(e.charCodeAt(s)),c=Ef(e.charCodeAt(s+1));if(i===void 0||c===void 0){const a=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+s)}r[o]=i*16+c}return r}function jn(e){return wf(wo(e))}function Sf(e){return la(e),wf(wo(Uint8Array.from(e).reverse()))}function xo(e,t){return ps(e.toString(16).padStart(t*2,"0"))}function Pf(e,t){return xo(e,t).reverse()}function ct(e,t,n){let r;if(typeof t=="string")try{r=ps(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(yo(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}function hs(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];la(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}const ua=e=>typeof e=="bigint"&&aa<=e;function fa(e,t,n){return ua(e)&&ua(t)&&ua(n)&&t<=e&&e<n}function br(e,t,n,r){if(!fa(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function ly(e){let t;for(t=0;e>aa;e>>=ca,t+=1);return t}const ms=e=>(ca<<BigInt(e))-ca,da=e=>new Uint8Array(e),Tf=e=>Uint8Array.from(e);function uy(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=da(e),o=da(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},c=(...f)=>n(o,r,...f),a=(f=da(0))=>{o=c(Tf([0]),f),r=c(),f.length!==0&&(o=c(Tf([1]),f),r=c())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const p=[];for(;f<t;){r=c();const d=r.slice();p.push(d),f+=r.length}return hs(...p)};return(f,p)=>{i(),a(f);let d;for(;!(d=p(l()));)a();return i(),d}}const fy={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"||yo(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 bs(e,t,n={}){const r=(o,s,i)=>{const c=fy[s];if(typeof c!="function")throw new Error("invalid validator function");const a=e[o];if(!(i&&a===void 0)&&!c(a,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+a)};for(const[o,s]of Object.entries(t))r(o,s,!1);for(const[o,s]of Object.entries(n))r(o,s,!0);return e}function Af(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e(n,...r);return t.set(n,s),s}}const dy="0.1.1";function py(){return dy}class ie extends Error{constructor(t,n={}){const r=(()=>{var a;if(n.cause instanceof ie){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof ie&&n.cause.docsPath||n.docsPath,i=`https://oxlib.sh${o??""}`,c=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o?["",r?`Details: ${r}`:void 0,o?`See: ${i}`:void 0]:[]].filter(a=>typeof a=="string").join(`
88
- `);super(c,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@${py()}`}),this.cause=n.cause,this.details=r,this.docs=i,this.docsPath=o,this.shortMessage=t}walk(t){return $f(this,t)}}function $f(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?$f(e.cause,t):t?null:e}function Eo(e,t){if(gr(e)>t)throw new Oy({givenSize:gr(e),maxSize:t})}const Jt={zero:48,nine:57,A:65,F:70,a:97,f:102};function Cf(e){if(e>=Jt.zero&&e<=Jt.nine)return e-Jt.zero;if(e>=Jt.A&&e<=Jt.F)return e-(Jt.A-10);if(e>=Jt.a&&e<=Jt.f)return e-(Jt.a-10)}function hy(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Iy({size:e.length,targetSize:r,type:"Bytes"});const o=new Uint8Array(r);for(let s=0;s<r;s++){const i=n==="right";o[i?s:r-s-1]=e[i?s:e.length-s-1]}return o}function Nf(e,t={}){const{dir:n="left"}=t;let r=e,o=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)o++;return r=n==="left"?r.slice(o):r.slice(0,r.length-o),r}function gs(e,t){if(tt(e)>t)throw new Fy({givenSize:tt(e),maxSize:t})}function my(e,t){if(typeof t=="number"&&t>0&&t>tt(e)-1)throw new _f({offset:t,position:"start",size:tt(e)})}function by(e,t,n){if(typeof t=="number"&&typeof n=="number"&&tt(e)!==n-t)throw new _f({offset:n,position:"end",size:tt(e)})}function Of(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const o=e.replace("0x","");if(o.length>r*2)throw new Ry({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const gy="#__bigint";function If(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+gy:o,n)}const yy=new TextDecoder,vy=new TextEncoder;function wy(e){return e instanceof Uint8Array?e:typeof e=="string"?kf(e):xy(e)}function xy(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function kf(e,t={}){const{size:n}=t;let r=e;n&&(gs(e,n),r=zn(e,n));let o=r.slice(2);o.length%2&&(o=`0${o}`);const s=o.length/2,i=new Uint8Array(s);for(let c=0,a=0;c<s;c++){const l=Cf(o.charCodeAt(a++)),u=Cf(o.charCodeAt(a++));if(l===void 0||u===void 0)throw new ie(`Invalid byte sequence ("${o[a-2]}${o[a-1]}" in "${o}").`);i[c]=l*16+u}return i}function Ey(e,t={}){const{size:n}=t,r=vy.encode(e);return typeof n=="number"?(Eo(r,n),Sy(r,n)):r}function Sy(e,t){return hy(e,{dir:"right",size:t})}function gr(e){return e.length}function Py(e,t,n,r={}){const{strict:o}=r;return e.slice(t,n)}function Ty(e,t={}){const{size:n}=t;typeof n<"u"&&Eo(e,n);const r=Ct(e,t);return Lf(r,t)}function Ay(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Eo(r,n),r=Df(r)),r.length>1||r[0]>1)throw new Ny(r);return!!r[0]}function en(e,t={}){const{size:n}=t;typeof n<"u"&&Eo(e,n);const r=Ct(e,t);return Bf(r,t)}function $y(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Eo(r,n),r=Cy(r)),yy.decode(r)}function Df(e){return Nf(e,{dir:"left"})}function Cy(e){return Nf(e,{dir:"right"})}class Ny extends ie{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let Oy=class extends ie{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"})}},Iy=class extends ie{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 ky=new TextEncoder,Dy=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function My(e,t={}){const{strict:n=!1}=t;if(!e)throw new Rf(e);if(typeof e!="string")throw new Rf(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new jf(e);if(!e.startsWith("0x"))throw new jf(e)}function $t(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Ly(e){return e instanceof Uint8Array?Ct(e):Array.isArray(e)?Ct(new Uint8Array(e)):e}function Mf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(gs(n,t.size),_n(n,t.size)):n}function Ct(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=Dy[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(gs(r,t.size),zn(r,t.size)):r}function Le(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const l=typeof e=="bigint"?"n":"";throw new Ff({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:n,size:r,value:`${e}${l}`})}const a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?_n(a,r):a}function pa(e,t={}){return Ct(ky.encode(e),t)}function _n(e,t){return Of(e,{dir:"left",size:t})}function zn(e,t){return Of(e,{dir:"right",size:t})}function Bt(e,t,n,r={}){const{strict:o}=r;my(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&by(s,t,n),s}function tt(e){return Math.ceil((e.length-2)/2)}function Lf(e,t={}){const{signed:n}=t;t.size&&gs(e,t.size);const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n)-1n,i=s>>1n;return r<=i?r:r-s-1n}function Bf(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:Lf(e,t))}function By(e,t={}){const{strict:n=!1}=t;try{return My(e,{strict:n}),!0}catch{return!1}}class Ff extends ie{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*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 Rf extends ie{constructor(t){super(`Value \`${typeof t=="object"?If(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 jf extends ie{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 Fy extends ie{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 _f extends ie{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 Ry extends ie{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 jy(e){return{address:e.address,amount:Le(e.amount),index:Le(e.index),validatorIndex:Le(e.validatorIndex)}}function zf(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Le(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Le(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Le(e.gasLimit)},...typeof e.number=="bigint"&&{number:Le(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Le(e.prevRandao)},...typeof e.time=="bigint"&&{time:Le(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(jy)}}}const ys=[{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"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],ha=[{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"}]}],Uf=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],Wf=[...Uf,{name:"resolveWithGateways",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"}]}],_y=[...Uf,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],Hf=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Vf=[{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"}]}],Gf=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],qf=[{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"}],yr=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],zy="0x82ad56cb",Zf="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Uy="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",Wy="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",ma="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class ba extends V{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"})}}class Kf extends V{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const ga="/docs/contract/encodeDeployData";function ya(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new zb({docsPath:ga});if(!("inputs"in o))throw new nu({docsPath:ga});if(!o.inputs||o.inputs.length===0)throw new nu({docsPath:ga});const s=bn(o.inputs,n);return cr([r,s])}function vr({blockNumber:e,chain:t,contract:n}){var o;const r=(o=t==null?void 0:t.contracts)==null?void 0:o[n];if(!r)throw new ba({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new ba({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function Yf(e,{docsPath:t,...n}){const r=(()=>{const o=ls(e,n);return o instanceof mo?e:o})();return new Vu(r,{docsPath:t,...n})}function Xf(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const va=new Map;function Qf({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const u=a();i();const f=u.map(({args:p})=>p);f.length!==0&&e(f).then(p=>{o&&Array.isArray(p)&&p.sort(o);for(let d=0;d<u.length;d++){const{resolve:h}=u[d];h==null||h([p[d],p])}}).catch(p=>{for(let d=0;d<u.length;d++){const{reject:h}=u[d];h==null||h(p)}})},i=()=>va.delete(t),c=()=>a().map(({args:u})=>u),a=()=>va.get(t)||[],l=u=>va.set(t,[...a(),u]);return{flush:i,async schedule(u){const{promise:f,resolve:p,reject:d}=Xf();return(n==null?void 0:n([...c(),u]))&&s(),a().length>0?(l({args:u,resolve:p,reject:d}),f):(l({args:u,resolve:p,reject:d}),setTimeout(s,r),f)}}}async function So(e,t){var O,k,y,A;const{account:n=e.account,authorizationList:r,batch:o=!!((O=e.batch)!=null&&O.multicall),blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",accessList:c,blobs:a,blockOverrides:l,code:u,data:f,factory:p,factoryData:d,gas:h,gasPrice:m,maxFeePerBlobGas:v,maxFeePerGas:T,maxPriorityFeePerGas:E,nonce:S,to:N,value:M,stateOverride:B,...F}=t,b=n?Je(n):void 0;if(u&&(p||d))throw new V("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&N)throw new V("Cannot provide both `code` & `to` as parameters.");const g=u&&f,w=p&&d&&N&&f,$=g||w,C=g?Jf({code:u,data:f}):w?Gy({data:f,factory:p,factoryData:d,to:N}):f;try{mr(t);const P=(typeof s=="bigint"?Q(s):void 0)||i,L=l?zf(l):void 0,j=Ki(B),z=(A=(y=(k=e.chain)==null?void 0:k.formatters)==null?void 0:y.transactionRequest)==null?void 0:A.format,H=(z||bo)({...us(F,{format:z}),accessList:c,account:b,authorizationList:r,blobs:a,data:C,gas:h,gasPrice:m,maxFeePerBlobGas:v,maxFeePerGas:T,maxPriorityFeePerGas:E,nonce:S,to:$?void 0:N,value:M},"call");if(o&&Hy({request:H})&&!j&&!L)try{return await Vy(e,{...H,blockNumber:s,blockTag:i})}catch(W){if(!(W instanceof Kf)&&!(W instanceof ba))throw W}const Y=(()=>{const W=[H,P];return j&&L?[...W,j,L]:j?[...W,j]:L?[...W,{},L]:W})(),G=await e.request({method:"eth_call",params:Y});return G==="0x"?{data:void 0}:{data:G}}catch(I){const P=qy(I),{offchainLookup:L,offchainLookupSignature:j}=await Promise.resolve().then(()=>Vv);if(e.ccipRead!==!1&&(P==null?void 0:P.slice(0,10))===j&&N)return{data:await L(e,{data:P,to:N})};throw $&&(P==null?void 0:P.slice(0,10))==="0x101bb98d"?new Sg({factory:p}):Yf(I,{...t,account:b,chain:e.chain})}}function Hy({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(zy)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function Vy(e,t){var m;const{batchSize:n=1024,deployless:r=!1,wait:o=0}=typeof((m=e.batch)==null?void 0:m.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",data:c,to:a}=t,l=(()=>{if(r)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return vr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Kf})(),f=(typeof s=="bigint"?Q(s):void 0)||i,{schedule:p}=Qf({id:`${e.uid}.${f}`,wait:o,shouldSplitBatch(v){return v.reduce((E,{data:S})=>E+(S.length-2),0)>n*2},fn:async v=>{const T=v.map(N=>({allowFailure:!0,callData:N.data,target:N.to})),E=Tt({abi:ys,args:[T],functionName:"aggregate3"}),S=await e.request({method:"eth_call",params:[{...l===null?{data:Jf({code:ma,data:E})}:{to:l,data:E}},f]});return Rn({abi:ys,args:[T],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:d,success:h}]=await p({data:c,to:a});if(!h)throw new is({data:d});return d==="0x"?{data:void 0}:{data:d}}function Jf(e){const{code:t,data:n}=e;return ya({abi:Xl(["constructor(bytes, bytes)"]),bytecode:Zf,args:[t,n]})}function Gy(e){const{data:t,factory:n,factoryData:r,to:o}=e;return ya({abi:Xl(["constructor(address, bytes, address, bytes)"]),bytecode:Uy,args:[o,t,n,r]})}function qy(e){var n;if(!(e instanceof V))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 Nt(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,c=Tt({abi:n,args:o,functionName:s});try{const{data:a}=await X(e,So,"call")({...i,data:c,to:r});return Rn({abi:n,args:o,functionName:s,data:a||"0x"})}catch(a){throw pr(a,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function Zy(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:i,...c}=t,a=c.account?Je(c.account):e.account,l=Tt({abi:n,args:o,functionName:i});try{const{data:u}=await X(e,So,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:r,...c,account:a}),f=Rn({abi:n,args:o,functionName:i,data:u||"0x"}),p=n.filter(d=>"name"in d&&d.name===t.functionName);return{result:f,request:{abi:p,address:r,args:o,dataSuffix:s,functionName:i,...c,account:a}}}catch(u){throw pr(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:i,sender:a==null?void 0:a.address})}}const wa=new Map,ed=new Map;let Ky=0;function wn(e,t,n){const r=++Ky,o=()=>wa.get(e)||[],s=()=>{const u=o();wa.set(e,u.filter(f=>f.id!==r))},i=()=>{const u=o();if(!u.some(p=>p.id===r))return;const f=ed.get(e);if(u.length===1&&f){const p=f();p instanceof Promise&&p.catch(()=>{})}s()},c=o();if(wa.set(e,[...c,{id:r,fns:t}]),c&&c.length>0)return i;const a={};for(const u in t)a[u]=(...f)=>{var d,h;const p=o();if(p.length!==0)for(const m of p)(h=(d=m.fns)[u])==null||h.call(d,...f)};const l=n(a);return typeof l=="function"&&ed.set(e,l),i}async function xa(e){return new Promise(t=>setTimeout(t,e))}function Po(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let o=!0;const s=()=>o=!1;return(async()=>{let c;t&&(c=await e({unpoll:s}));const a=await(n==null?void 0:n(c))??r;await xa(a);const l=async()=>{o&&(await e({unpoll:s}),await xa(r),l())};l()})(),s}const Yy=new Map,Xy=new Map;function Qy(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,Yy),r=t(e,Xy);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function Jy(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=Qy(t),o=r.response.get();if(o&&n>0&&Date.now()-o.created.getTime()<n)return o.data;let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const i=await s;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const ev=e=>`blockNumber.${e}`;async function To(e,{cacheTime:t=e.cacheTime}={}){const n=await Jy(()=>e.request({method:"eth_blockNumber"}),{cacheKey:ev(e.uid),cacheTime:t});return BigInt(n)}async function vs(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 o=r.map(s=>Xt(s));return!("abi"in t)||!t.abi?o:oa({abi:t.abi,logs:o,strict:n})}async function ws(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function tv(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:i,fromBlock:c,onError:a,onLogs:l,poll:u,pollingInterval:f=e.pollingInterval,strict:p}=t;return(typeof u<"u"?u:typeof c=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const v=p??!1,T=$e(["watchContractEvent",r,o,s,e.uid,i,f,v,c]);return wn(T,{onLogs:l,onError:a},E=>{let S;c!==void 0&&(S=c-1n);let N,M=!1;const B=Po(async()=>{var F;if(!M){try{N=await X(e,Mu,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:v,fromBlock:c})}catch{}M=!0;return}try{let b;if(N)b=await X(e,vs,"getFilterChanges")({filter:N});else{const g=await X(e,To,"getBlockNumber")({});S&&S<g?b=await X(e,vf,"getContractEvents")({abi:n,address:r,args:o,eventName:i,fromBlock:S+1n,toBlock:g,strict:v}):b=[],S=g}if(b.length===0)return;if(s)E.onLogs(b);else for(const g of b)E.onLogs([g])}catch(b){N&&b instanceof gn&&(M=!1),(F=E.onError)==null||F.call(E,b)}},{emitOnBegin:!0,interval:f});return async()=>{N&&await X(e,ws,"uninstallFilter")({filter:N}),B()}})})():(()=>{const v=p??!1,T=$e(["watchContractEvent",r,o,s,e.uid,i,f,v]);let E=!0,S=()=>E=!1;return wn(T,{onLogs:l,onError:a},N=>((async()=>{try{const M=(()=>{if(e.transport.type==="fallback"){const b=e.transport.transports.find(g=>g.config.type==="webSocket"||g.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),B=i?Wr({abi:n,eventName:i,args:o}):[],{unsubscribe:F}=await M.subscribe({params:["logs",{address:r,topics:B}],onData(b){var w;if(!E)return;const g=b.result;try{const{eventName:$,args:C}=fs({abi:n,data:g.data,topics:g.topics,strict:p}),O=Xt(g,{args:C,eventName:$});N.onLogs([O])}catch($){let C,O;if($ instanceof Jo||$ instanceof Ti){if(p)return;C=$.abiItem.name,O=(w=$.abiItem.inputs)==null?void 0:w.some(y=>!("name"in y&&y.name))}const k=Xt(g,{args:O?[]:{},eventName:C});N.onLogs([k])}},onError(b){var g;(g=N.onError)==null||g.call(N,b)}});S=F,E||S()}catch(M){a==null||a(M)}})(),()=>S()))})()}async function nv(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}function Ea(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((o,s)=>{const i=async({count:c=0}={})=>{const a=async({error:l})=>{const u=typeof t=="function"?t({count:c,error:l}):t;u&&await xa(u),i({count:c+1})};try{const l=await e();o(l)}catch(l){if(c<n&&await r({count:c,error:l}))return a({error:l});s(l)}};i()})}const rv={"0x0":"reverted","0x1":"success"};function td(e,t){const n={...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(r=>Xt(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Zt(e.transactionIndex):null,status:e.status?rv[e.status]:null,type:e.type?rf[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Sa=256;let xs=Sa,Es;function nd(e=11){if(!Es||xs+e>Sa*2){Es="",xs=0;for(let t=0;t<Sa;t++)Es+=(256+Math.random()*256|0).toString(16).substring(1)}return Es.substring(xs,xs+++e)}function ov(e){const{batch:t,chain:n,ccipRead:r,key:o="base",name:s="Base Client",type:i="base"}=e,c=e.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),a=(n==null?void 0:n.blockTime)??12e3,l=Math.min(Math.max(Math.floor(a/2),500),4e3),u=e.pollingInterval??l,f=e.cacheTime??u,p=e.account?Je(e.account):void 0,{config:d,request:h,value:m}=e.transport({account:p,chain:n,pollingInterval:u}),v={...d,...m},T={account:p,batch:t,cacheTime:f,ccipRead:r,chain:n,key:o,name:s,pollingInterval:u,request:h,transport:v,type:i,uid:nd(),...c?{experimental_blockTag:c}:{}};function E(S){return N=>{const M=N(S);for(const F in T)delete M[F];const B={...S,...M};return Object.assign(B,{extend:E(B)})}}return Object.assign(T,{extend:E(T)})}function Pa(e){var n,r,o,s,i,c;if(!(e instanceof V))return!1;const t=e.walk(a=>a instanceof ji);return t instanceof ji?((n=t.data)==null?void 0:n.errorName)==="HttpError"||((r=t.data)==null?void 0:r.errorName)==="ResolverError"||((o=t.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotFound"||((i=t.data)==null?void 0:i.errorName)==="ReverseAddressMismatch"||((c=t.data)==null?void 0:c.errorName)==="UnsupportedResolverProfile":!1}function sv(e){const{abi:t,data:n}=e,r=lr(n,0,4),o=t.find(s=>s.type==="function"&&r===Ur(xt(s)));if(!o)throw new Zb(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Hr(o.inputs,lr(n,4)):void 0}}const Ta="/docs/contract/encodeErrorResult";function rd(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const a=Mn({abi:t,args:r,name:n});if(!a)throw new ou(n,{docsPath:Ta});o=a}if(o.type!=="error")throw new ou(void 0,{docsPath:Ta});const s=xt(o),i=Ur(s);let c="0x";if(r&&r.length>0){if(!o.inputs)throw new Vb(o.name,{docsPath:Ta});c=bn(o.inputs,r)}return cr([i,c])}const Aa="/docs/contract/encodeFunctionResult";function iv(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=Mn({abi:t,name:n});if(!i)throw new nr(n,{docsPath:Aa});o=i}if(o.type!=="function")throw new nr(void 0,{docsPath:Aa});if(!o.outputs)throw new au(o.name,{docsPath:Aa});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new cu(r)})();return bn(o.outputs,s)}const Ao="x-batch-gateway:true";async function od(e){const{data:t,ccipRequest:n}=e,{args:[r]}=sv({abi:ha,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,c)=>{try{s[c]=i.urls.includes(Ao)?await od({data:i.data,ccipRequest:n}):await n(i),o[c]=!1}catch(a){o[c]=!0,s[c]=av(a)}})),iv({abi:ha,functionName:"query",result:[o,s]})}function av(e){return e.name==="HttpRequestError"&&e.status?rd({abi:ha,errorName:"HttpError",args:[e.status,e.shortMessage]}):rd({abi:[Bu],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function sd(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Et(t)?t:null}function $a(e){let t=new Uint8Array(32).fill(0);if(!e)return Ae(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=sd(n[r]),s=o?or(o):ke(kn(n[r]),"bytes");t=ke(Pt([t,s]),"bytes")}return Ae(t)}function cv(e){return`[${e.slice(2)}]`}function lv(e){const t=new Uint8Array(32).fill(0);return e?sd(e)||ke(kn(e)):Ae(t)}function Ca(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(kn(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=kn(o[s]);i.byteLength>255&&(i=kn(cv(lv(o[s])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function uv(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:i,strict:c}=t,{chain:a}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return vr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(p=>s.endsWith(p)))return null;const f=o!=null?[$a(s),BigInt(o)]:[$a(s)];try{const p=Tt({abi:Vf,functionName:"addr",args:f}),d={address:l,abi:Wf,functionName:"resolveWithGateways",args:[pn(Ca(s)),p,i??[Ao]],blockNumber:n,blockTag:r},m=await X(e,Nt,"readContract")(d);if(m[0]==="0x")return null;const v=Rn({abi:Vf,args:f,functionName:"addr",data:m[0]});return v==="0x"||In(v)==="0x00"?null:v}catch(p){if(c)throw p;if(Pa(p))return null;throw p}}class fv extends V{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 $o extends V{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Na extends V{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 dv extends V{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const pv=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,hv=/^(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>\/.*)?$/,mv=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,bv=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function gv(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"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function id(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function ad({uri:e,gatewayUrls:t}){const n=mv.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=id(t==null?void 0:t.ipfs,"https://ipfs.io"),o=id(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(pv),{protocol:i,subpath:c,target:a,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=i==="ipns:/"||c==="ipns/",f=i==="ipfs:/"||c==="ipfs/"||hv.test(e);if(e.startsWith("http")&&!u&&!f){let d=e;return t!=null&&t.arweave&&(d=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:d,isOnChain:!1,isEncoded:!1}}if((u||f)&&a)return{uri:`${r}/${u?"ipns":"ipfs"}/${a}${l}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&a)return{uri:`${o}/${a}${l||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(bv,"");if(p.startsWith("<svg")&&(p=`data:image/svg+xml;base64,${btoa(p)}`),p.startsWith("data:")||p.startsWith("{"))return{uri:p,isOnChain:!0,isEncoded:!1};throw new Na({uri:e})}function cd(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new fv({data:e});return e.image||e.image_url||e.image_data}async function yv({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await Oa({gatewayUrls:e,uri:cd(n)})}catch{throw new Na({uri:t})}}async function Oa({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=ad({uri:t,gatewayUrls:e});if(r||await gv(n))return n;throw new Na({uri:t})}function vv(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,o]=t.split("/"),[s,i]=n.split(":"),[c,a]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new $o({reason:"Only EIP-155 supported"});if(!i)throw new $o({reason:"Chain ID not found"});if(!a)throw new $o({reason:"Contract address not found"});if(!o)throw new $o({reason:"Token ID not found"});if(!c)throw new $o({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:c.toLowerCase(),contractAddress:a,tokenID:o}}async function wv(e,{nft:t}){if(t.namespace==="erc721")return Nt(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 Nt(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 dv({namespace:t.namespace})}async function xv(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Ev(e,{gatewayUrls:t,record:n}):Oa({uri:n,gatewayUrls:t})}async function Ev(e,{gatewayUrls:t,record:n}){const r=vv(n),o=await wv(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:c}=ad({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=c?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return Oa({uri:cd(u),gatewayUrls:t})}let a=r.tokenID;return r.namespace==="erc1155"&&(a=a.replace("0x","").padStart(64,"0")),yv({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,a)})}async function ld(e,t){const{blockNumber:n,blockTag:r,key:o,name:s,gatewayUrls:i,strict:c}=t,{chain:a}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return vr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(f=>s.endsWith(f)))return null;try{const f={address:l,abi:Wf,args:[pn(Ca(s)),Tt({abi:Hf,functionName:"text",args:[$a(s),o]}),i??[Ao]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},d=await X(e,Nt,"readContract")(f);if(d[0]==="0x")return null;const h=Rn({abi:Hf,functionName:"text",data:d[0]});return h===""?null:h}catch(f){if(c)throw f;if(Pa(f))return null;throw f}}async function Sv(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:c}){const a=await X(e,ld,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:c,gatewayUrls:s,strict:i});if(!a)return null;try{return await xv(e,{record:a,gatewayUrls:r})}catch{return null}}async function Pv(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:i,strict:c}=t,{chain:a}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return vr({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:_y,args:[n,s,i??[Ao]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},f=X(e,Nt,"readContract"),[p]=await f(u);return p||null}catch(u){if(c)throw u;if(Pa(u))return null;throw u}}async function Tv(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return vr({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),c=s==null?void 0:s.ensTlds;if(c&&!c.some(l=>o.endsWith(l)))throw new Error(`${o} is not a valid ENS TLD (${c==null?void 0:c.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[a]=await X(e,Nt,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[pn(Ca(o))],blockNumber:n,blockTag:r});return a}async function ud(e,t){var v,T,E;const{account:n=e.account,blockNumber:r,blockTag:o="latest",blobs:s,data:i,gas:c,gasPrice:a,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:f,to:p,value:d,...h}=t,m=n?Je(n):void 0;try{mr(t);const N=(typeof r=="bigint"?Q(r):void 0)||o,M=(E=(T=(v=e.chain)==null?void 0:v.formatters)==null?void 0:T.transactionRequest)==null?void 0:E.format,F=(M||bo)({...us(h,{format:M}),account:m,blobs:s,data:i,gas:c,gasPrice:a,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:f,to:p,value:d},"createAccessList"),b=await e.request({method:"eth_createAccessList",params:[F,N]});return{accessList:b.accessList,gasUsed:BigInt(b.gasUsed)}}catch(S){throw Yf(S,{...t,account:m,chain:e.chain})}}async function Av(e){const t=ss(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function fd(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:c}={}){const a=o??(r?[r]:void 0),l=ss(e,{method:"eth_newFilter"});let u=[];a&&(u=[a.flatMap(d=>Wr({abi:[d],eventName:d.name,args:n}))],r&&(u=u[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?Q(s):s,toBlock:typeof c=="bigint"?Q(c):c,...u.length?{topics:u}:{}}]});return{abi:a,args:n,eventName:r?r.name:void 0,fromBlock:s,id:f,request:l(f),strict:!!i,toBlock:c,type:"event"}}async function dd(e){const t=ss(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function $v(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o=typeof n=="bigint"?Q(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}async function Cv(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Nv(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=n!==void 0?Q(n):void 0;let s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:!!o}),Zt(s)}async function Ia(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=n!==void 0?Q(n):void 0,s=await e.request({method:"eth_getCode",params:[t,o||r]},{dedupe:!!o});if(s!=="0x")return s}class Ov extends V{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 Iv(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,c,a,l,u,f]=await X(e,Nt,"readContract")({abi:kv,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:i,version:c,chainId:Number(a),verifyingContract:l,salt:u},extensions:f,fields:s}}catch(s){const i=s;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new Ov({address:n}):i}}const kv=[{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 Dv(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 Mv(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:o}){const s=typeof n=="bigint"?Q(n):void 0,i=await e.request({method:"eth_feeHistory",params:[Q(t),s||r,o]},{dedupe:!!s});return Dv(i)}async function Lv(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Xt(s));return t.abi?oa({abi:t.abi,logs:o,strict:n}):o}async function Bv({address:e,authorization:t,signature:n}){return go(mn(e),await Qu({authorization:t,signature:n}))}const Ss=new rs(8192);function Fv(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Ss.get(n))return Ss.get(n);const r=e().finally(()=>Ss.delete(n));return Ss.set(n,r),r}function Rv(e,t={}){return async(n,r={})=>{var f;const{dedupe:o=!1,methods:s,retryDelay:i=150,retryCount:c=3,uid:a}={...t,...r},{method:l}=n;if((f=s==null?void 0:s.exclude)!=null&&f.includes(l))throw new Fn(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new Fn(new Error("method not supported"),{method:l});const u=o?jr(`${a}.${$e(n)}`):void 0;return Fv(()=>Ea(async()=>{try{return await e(n)}catch(p){const d=p;switch(d.code){case Zr.code:throw new Zr(d);case Kr.code:throw new Kr(d);case Yr.code:throw new Yr(d,{method:n.method});case Xr.code:throw new Xr(d);case Bn.code:throw new Bn(d);case gn.code:throw new gn(d);case Qr.code:throw new Qr(d);case Jr.code:throw new Jr(d);case eo.code:throw new eo(d);case Fn.code:throw new Fn(d,{method:n.method});case fr.code:throw new fr(d);case to.code:throw new to(d);case dr.code:throw new dr(d);case no.code:throw new no(d);case ro.code:throw new ro(d);case oo.code:throw new oo(d);case so.code:throw new so(d);case io.code:throw new io(d);case ao.code:throw new ao(d);case co.code:throw new co(d);case lo.code:throw new lo(d);case uo.code:throw new uo(d);case fo.code:throw new fo(d);case po.code:throw new po(d);case ho.code:throw new ho(d);case 5e3:throw new dr(d);default:throw p instanceof V?p:new Tg(d)}}},{delay:({count:p,error:d})=>{var h;if(d&&d instanceof Ln){const m=(h=d==null?void 0:d.headers)==null?void 0:h.get("Retry-After");if(m!=null&&m.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<<p)*i},retryCount:c,shouldRetry:({error:p})=>jv(p)}),{enabled:o,id:u})}}function jv(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===fr.code||e.code===Bn.code:e instanceof Ln&&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}class _v extends V{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:s,urls:i}){var c;super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],(c=n.metaMessages)!=null&&c.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(a=>` ${qr(a)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class zv extends V{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${qr(n)}`,`Response: ${$e(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Uv extends V{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const Wv="0x556f1830",pd={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function Hv(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=_u({data:r,abi:[pd]}),[i,c,a,l,u]=s,{ccipRead:f}=e,p=f&&typeof(f==null?void 0:f.request)=="function"?f.request:hd;try{if(!go(o,i))throw new Uv({sender:i,to:o});const d=c.includes(Ao)?await od({data:a,ccipRequest:p}):await p({data:a,sender:i,urls:c}),{data:h}=await So(e,{blockNumber:t,blockTag:n,data:Pt([l,bn([{type:"bytes"},{type:"bytes"}],[d,u])]),to:o});return h}catch(d){throw new _v({callbackSelector:l,cause:d,data:r,extraData:u,sender:i,urls:c})}}async function hd({data:e,sender:t,urls:n}){var o;let r=new Error("An unknown error occurred.");for(let s=0;s<n.length;s++){const i=n[s],c=i.includes("{data}")?"GET":"POST",a=c==="POST"?{data:e,sender:t}:void 0,l=c==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(i.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(a),headers:l,method:c});let f;if((o=u.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?f=(await u.json()).data:f=await u.text(),!u.ok){r=new Ln({body:a,details:f!=null&&f.error?$e(f.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!Et(f)){r=new zv({result:f,url:i});continue}return f}catch(u){r=new Ln({body:a,details:u.message,url:i})}}throw r}const Vv=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:hd,offchainLookup:Hv,offchainLookupAbiItem:pd,offchainLookupSignature:Wv},Symbol.toStringTag,{value:"Module"}));function Gv(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function qv(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((o,s)=>{(async()=>{let i;try{const c=new AbortController;n>0&&(i=setTimeout(()=>{r&&c.abort()},n)),o(await e({signal:(c==null?void 0:c.signal)||null}))}catch(c){(c==null?void 0:c.name)==="AbortError"&&s(t),s(c)}finally{clearTimeout(i)}})()})}function Zv(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const md=Zv();function Kv(e,t={}){return{async request(n){var p;const{body:r,fetchFn:o=t.fetchFn??fetch,onRequest:s=t.onRequest,onResponse:i=t.onResponse,timeout:c=t.timeout??1e4}=n,a={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:l,method:u,signal:f}=a;try{const d=await qv(async({signal:m})=>{const v={...a,body:Array.isArray(r)?$e(r.map(N=>({jsonrpc:"2.0",id:N.id??md.take(),...N}))):$e({jsonrpc:"2.0",id:r.id??md.take(),...r}),headers:{"Content-Type":"application/json",...l},method:u||"POST",signal:f||(c>0?m:null)},T=new Request(e,v),E=await(s==null?void 0:s(T,v))??{...v,url:e};return await o(E.url??e,E)},{errorInstance:new qu({body:r,url:e}),timeout:c,signal:!0});i&&await i(d);let h;if((p=d.headers.get("Content-Type"))!=null&&p.startsWith("application/json"))h=await d.json();else{h=await d.text();try{h=JSON.parse(h||"{}")}catch(m){if(d.ok)throw m;h={error:h}}}if(!d.ok)throw new Ln({body:r,details:$e(h.error)||d.statusText,headers:d.headers,status:d.status,url:e});return h}catch(d){throw d instanceof Ln||d instanceof qu?d:new Ln({body:r,cause:d,url:e})}}}}const Yv=`Ethereum Signed Message:
89
- `;function Xv(e){const t=typeof e=="string"?jr(e):typeof e.raw=="string"?e.raw:Ae(e.raw),n=jr(`${Yv}${ve(t)}`);return Pt([n,t])}function bd(e,t){return ke(Xv(e),t)}class Qv extends V{constructor({domain:t}){super(`Invalid domain "${$e(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Jv extends V{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 ew extends V{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function tw(e){const{domain:t,message:n,primaryType:r,types:o}=e,s=(i,c)=>{for(const a of i){const{name:l,type:u}=a,f=c[l],p=u.match(Ou);if(p&&(typeof f=="number"||typeof f=="bigint")){const[m,v,T]=p;Q(f,{signed:v==="int",size:Number.parseInt(T,10)/8})}if(u==="address"&&typeof f=="string"&&!at(f))throw new hn({address:f});const d=u.match(U1);if(d){const[m,v]=d;if(v&&ve(f)!==Number.parseInt(v,10))throw new Yb({expectedSize:Number.parseInt(v,10),givenSize:ve(f)})}const h=o[u];h&&(rw(u),s(h,f))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new Qv({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new Jv({primaryType:r,types:o})}function nw({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 rw(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new ew({type:e})}function ow(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:nw({domain:t}),...e.types};tw({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(sw({domain:t,types:o})),r!=="EIP712Domain"&&s.push(gd({data:n,primaryType:r,types:o})),ke(Pt(s))}function sw({domain:e,types:t}){return gd({data:e,primaryType:"EIP712Domain",types:t})}function gd({data:e,primaryType:t,types:n}){const r=yd({data:e,primaryType:t,types:n});return ke(r)}function yd({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[iw({primaryType:t,types:n})];for(const s of n[t]){const[i,c]=wd({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(c)}return bn(r,o)}function iw({primaryType:e,types:t}){const n=pn(aw({primaryType:e,types:t}));return ke(n)}function aw({primaryType:e,types:t}){let n="";const r=vd({primaryType:e,types:t});r.delete(e);const o=[e,...Array.from(r).sort()];for(const s of o)n+=`${s}(${t[s].map(({name:i,type:c})=>`${c} ${i}`).join(",")})`;return n}function vd({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),o=r==null?void 0:r[0];if(n.has(o)||t[o]===void 0)return n;n.add(o);for(const s of t[o])vd({primaryType:s.type,types:t},n);return n}function wd({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},ke(yd({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},ke(r)];if(n==="string")return[{type:"bytes32"},ke(pn(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>wd({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},ke(bn(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class cw 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 ka={checksum:new cw(8192)}.checksum;function xd(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Tu(wy(e));return n==="Bytes"?r:Ct(r)}const lw=/^0x[a-fA-F0-9]{40}$/;function Ps(e,t={}){const{strict:n=!0}=t;if(!lw.test(e))throw new Sd({address:e,cause:new uw});if(n){if(e.toLowerCase()===e)return;if(Ed(e)!==e)throw new Sd({address:e,cause:new fw})}}function Ed(e){if(ka.has(e))return ka.get(e);Ps(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=xd(Ey(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const o=`0x${r.join("")}`;return ka.set(e,o),o}function Da(e,t={}){const{strict:n=!0}=t??{};try{return Ps(e,{strict:n}),!0}catch{return!1}}class Sd extends ie{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"})}}class uw extends ie{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 fw extends ie{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const dw=/^(.*)\[([0-9]*)\]$/,pw=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Pd=/^(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)?$/,Td=2n**256n-1n;function wr(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=Fa(t.type);if(s){const[i,c]=s;return mw(e,{...t,type:c},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return vw(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return hw(e,{checksum:r});if(t.type==="bool")return bw(e);if(t.type.startsWith("bytes"))return gw(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return yw(e,t);if(t.type==="string")return ww(e,{staticPosition:o});throw new _a(t.type)}const Ad=32,Ma=32;function hw(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?Ed(s):s)(Ct(Py(r,-20))),32]}function mw(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const a=en(e.readBytes(Ma)),l=s+a,u=l+Ad;e.setPosition(l);const f=en(e.readBytes(Ad)),p=Co(t);let d=0;const h=[];for(let m=0;m<f;++m){e.setPosition(u+(p?m*32:d));const[v,T]=wr(e,t,{checksumAddress:r,staticPosition:u});d+=T,h.push(v)}return e.setPosition(s+32),[h,32]}if(Co(t)){const a=en(e.readBytes(Ma)),l=s+a,u=[];for(let f=0;f<o;++f){e.setPosition(l+f*32);const[p]=wr(e,t,{checksumAddress:r,staticPosition:l});u.push(p)}return e.setPosition(s+32),[u,32]}let i=0;const c=[];for(let a=0;a<o;++a){const[l,u]=wr(e,t,{checksumAddress:r,staticPosition:s+i});i+=u,c.push(l)}return[c,i]}function bw(e){return[Ay(e.readBytes(32),{size:32}),32]}function gw(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=en(e.readBytes(32));e.setPosition(n+i);const c=en(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Ct(a),32]}return[Ct(e.readBytes(Number.parseInt(o,10),32)),32]}function yw(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?Ty(o,{signed:n}):en(o,{signed:n}),32]}function vw(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=t.components.length===0||t.components.some(({name:a})=>!a),i=s?[]:{};let c=0;if(Co(t)){const a=en(e.readBytes(Ma)),l=o+a;for(let u=0;u<t.components.length;++u){const f=t.components[u];e.setPosition(l+c);const[p,d]=wr(e,f,{checksumAddress:r,staticPosition:l});c+=d,i[s?u:f==null?void 0:f.name]=p}return e.setPosition(o+32),[i,32]}for(let a=0;a<t.components.length;++a){const l=t.components[a],[u,f]=wr(e,l,{checksumAddress:r,staticPosition:o});i[s?a:l==null?void 0:l.name]=u,c+=f}return[i,c]}function ww(e,{staticPosition:t}){const n=en(e.readBytes(32)),r=t+n;e.setPosition(r);const o=en(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=$y(Df(s));return e.setPosition(t+32),[i,32]}function xw({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(La({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function La({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=Fa(r.type);if(o){const[s,i]=o;return Sw(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return Cw(n,{checksumAddress:e,parameter:r});if(r.type==="address")return Ew(n,{checksum:e});if(r.type==="bool")return Tw(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=Pd.exec(r.type)??[];return Aw(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return Pw(n,{type:r.type});if(r.type==="string")return $w(n);throw new _a(r.type)}function Ba(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=tt(c)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?(n.push(Le(t+o,{size:32})),r.push(c),o+=tt(c)):n.push(c)}return $t(...n,...r)}function Ew(e,t){const{checksum:n=!1}=t;return Ps(e,{strict:n}),{dynamic:!1,encoded:_n(e.toLowerCase())}}function Sw(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new Fw(e);if(!s&&e.length!==r)throw new Bw({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const c=[];for(let a=0;a<e.length;a++){const l=La({checksumAddress:n,parameter:o,value:e[a]});l.dynamic&&(i=!0),c.push(l)}if(s||i){const a=Ba(c);if(s){const l=Le(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?$t(l,a):l}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:$t(...c.map(({encoded:a})=>a))}}function Pw(e,{type:t}){const[,n]=t.split("bytes"),r=tt(e);if(!n){let o=e;return r%32!==0&&(o=zn(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:$t(_n(Le(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new Nd({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:zn(e)}}function Tw(e){if(typeof e!="boolean")throw new ie(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:_n(Mf(e))}}function Aw(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new Ff({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Le(e,{size:32,signed:t})}}function $w(e){const t=pa(e),n=Math.ceil(tt(t)/32),r=[];for(let o=0;o<n;o++)r.push(zn(Bt(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:$t(zn(Le(tt(t),{size:32})),...r)}}function Cw(e,t){const{checksumAddress:n,parameter:r}=t;let o=!1;const s=[];for(let i=0;i<r.components.length;i++){const c=r.components[i],a=Array.isArray(e)?i:c.name,l=La({checksumAddress:n,parameter:c,value:e[a]});s.push(l),l.dynamic&&(o=!0)}return{dynamic:o,encoded:o?Ba(s):$t(...s.map(({encoded:i})=>i))}}function Fa(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Co(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(Co);const n=Fa(e.type);return!!(n&&Co({...e,type:n[1]}))}const Nw={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 kw({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Iw({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new $d({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 $d({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 Ow(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Nw);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class $d extends ie{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class Iw extends ie{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class kw extends ie{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Dw(e,t,n={}){const{as:r="Array",checksumAddress:o=!1}=n,s=typeof t=="string"?kf(t):t,i=Ow(s);if(gr(s)===0&&e.length>0)throw new Lw;if(gr(s)&&gr(s)<32)throw new Mw({data:typeof t=="string"?t:Ct(t),parameters:e,size:gr(s)});let c=0;const a=r==="Array"?[]:{};for(let l=0;l<e.length;++l){const u=e[l];i.setPosition(c);const[f,p]=wr(i,u,{checksumAddress:o,staticPosition:0});c+=p,r==="Array"?a.push(f):a[u.name??l]=f}return a}function Ra(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new Od({expectedLength:e.length,givenLength:t.length});const o=xw({checksumAddress:r,parameters:e,values:t}),s=Ba(o);return s.length===0?"0x":s}function ja(e,t){if(e.length!==t.length)throw new Od({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r];n.push(ja.encode(o,s))}return $t(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const a=r;return Ps(a),_n(a.toLowerCase(),o?32:0)}if(n==="string")return pa(r);if(n==="bytes")return r;if(n==="bool")return _n(Mf(r),o?32:1);const s=n.match(Pd);if(s){const[a,l,u="256"]=s,f=Number.parseInt(u,10)/8;return Le(r,{size:o?32:f,signed:l==="int"})}const i=n.match(pw);if(i){const[a,l]=i;if(Number.parseInt(l,10)!==(r.length-2)/2)throw new Nd({expectedSize:Number.parseInt(l,10),value:r});return zn(r,o?32:0)}const c=n.match(dw);if(c&&Array.isArray(r)){const[a,l]=c,u=[];for(let f=0;f<r.length;f++)u.push(t(l,r[f],!0));return u.length===0?"0x":$t(...u)}throw new _a(n)}e.encode=t})(ja||(ja={}));function Cd(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Jl(e):e}class Mw extends ie{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${er(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class Lw extends ie{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Bw extends ie{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 Nd extends ie{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${tt(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Od extends ie{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
90
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class Fw extends ie{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class _a extends ie{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}class Id extends $i{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,y1(t);const r=ts(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 o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),ar(s)}update(t){return ir(this),this.iHash.update(t),this}digestInto(t){ir(this),Dn(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:o,destroyed:s,blockLen:i,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=c,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const kd=(e,t,n)=>new Id(e,t).update(n).digest();kd.create=(e,t)=>new Id(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const He=BigInt(0),Be=BigInt(1),Un=BigInt(2),Rw=BigInt(3),Dd=BigInt(4),Md=BigInt(5),Ld=BigInt(8);function Ve(e,t){const n=e%t;return n>=He?n:t+n}function lt(e,t,n){let r=e;for(;t-- >He;)r*=r,r%=n;return r}function za(e,t){if(e===He)throw new Error("invert: expected non-zero number");if(t<=He)throw new Error("invert: expected positive modulus, got "+t);let n=Ve(e,t),r=t,o=He,s=Be;for(;n!==He;){const c=r/n,a=r%n,l=o-s*c;r=n,n=a,o=s,s=l}if(r!==Be)throw new Error("invert: does not exist");return Ve(o,t)}function Bd(e,t){const n=(e.ORDER+Be)/Dd,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function jw(e,t){const n=(e.ORDER-Md)/Ld,r=e.mul(t,Un),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,Un),o),c=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}function _w(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Be,n=0;for(;t%Un===He;)t/=Un,n++;let r=Un;const o=Ua(e);for(;Rd(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Bd;let s=o.pow(r,t);const i=(t+Be)/Un;return function(a,l){if(a.is0(l))return l;if(Rd(a,l)!==1)throw new Error("Cannot find square root");let u=n,f=a.mul(a.ONE,s),p=a.pow(l,t),d=a.pow(l,i);for(;!a.eql(p,a.ONE);){if(a.is0(p))return a.ZERO;let h=1,m=a.sqr(p);for(;!a.eql(m,a.ONE);)if(h++,m=a.sqr(m),h===u)throw new Error("Cannot find square root");const v=Be<<BigInt(u-h-1),T=a.pow(f,v);u=h,f=a.sqr(T),p=a.mul(p,f),d=a.mul(d,T)}return d}}function zw(e){return e%Dd===Rw?Bd:e%Ld===Md?jw:_w(e)}const Uw=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ww(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Uw.reduce((r,o)=>(r[o]="function",r),t);return bs(e,n)}function Hw(e,t,n){if(n<He)throw new Error("invalid exponent, negatives unsupported");if(n===He)return e.ONE;if(n===Be)return t;let r=e.ONE,o=t;for(;n>He;)n&Be&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Be;return r}function Fd(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((i,c,a)=>e.is0(c)?i:(r[a]=i,e.mul(i,c)),e.ONE),s=e.inv(o);return t.reduceRight((i,c,a)=>e.is0(c)?i:(r[a]=e.mul(i,r[a]),e.mul(i,c)),s),r}function Rd(e,t){const n=(e.ORDER-Be)/Un,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function jd(e,t){t!==void 0&&_r(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Ua(e,t,n=!1,r={}){if(e<=He)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=jd(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const c=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:s,MASK:ms(o),ZERO:He,ONE:Be,create:a=>Ve(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return He<=a&&a<e},is0:a=>a===He,isOdd:a=>(a&Be)===Be,neg:a=>Ve(-a,e),eql:(a,l)=>a===l,sqr:a=>Ve(a*a,e),add:(a,l)=>Ve(a+l,e),sub:(a,l)=>Ve(a-l,e),mul:(a,l)=>Ve(a*l,e),pow:(a,l)=>Hw(c,a,l),div:(a,l)=>Ve(a*za(l,e),e),sqrN:a=>a*a,addN:(a,l)=>a+l,subN:(a,l)=>a-l,mulN:(a,l)=>a*l,inv:a=>za(a,e),sqrt:r.sqrt||(a=>(i||(i=zw(e)),i(c,a))),toBytes:a=>n?Pf(a,s):xo(a,s),fromBytes:a=>{if(a.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+a.length);return n?Sf(a):jn(a)},invertBatch:a=>Fd(c,a),cmov:(a,l,u)=>u?l:a});return Object.freeze(c)}function _d(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 zd(e){const t=_d(e);return t+Math.ceil(t/2)}function Vw(e,t,n=!1){const r=e.length,o=_d(t),s=zd(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?Sf(e):jn(e),c=Ve(i,t-Be)+Be;return n?Pf(c,o):xo(c,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ud=BigInt(0),Wa=BigInt(1);function Ha(e,t){const n=t.negate();return e?n:t}function Wd(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Va(e,t){Wd(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=ms(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function Hd(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:i}=n;let c=Number(e&o),a=e>>i;c>r&&(c-=s,a+=Wa);const l=t*r,u=l+Math.abs(c)-1,f=c===0,p=c<0,d=t%2!==0;return{nextN:a,offset:u,isZero:f,isNeg:p,isNegF:d,offsetF:l}}function Gw(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 qw(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 Ga=new WeakMap,Vd=new WeakMap;function qa(e){return Vd.get(e)||1}function Zw(e,t){return{constTimeNegate:Ha,hasPrecomputes(n){return qa(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>Ud;)r&Wa&&(o=o.add(s)),s=s.double(),r>>=Wa;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=Va(r,t),i=[];let c=n,a=c;for(let l=0;l<o;l++){a=c,i.push(a);for(let u=1;u<s;u++)a=a.add(c),i.push(a);c=a.double()}return i},wNAF(n,r,o){let s=e.ZERO,i=e.BASE;const c=Va(n,t);for(let a=0;a<c.windows;a++){const{nextN:l,offset:u,isZero:f,isNeg:p,isNegF:d,offsetF:h}=Hd(o,a,c);o=l,f?i=i.add(Ha(d,r[h])):s=s.add(Ha(p,r[u]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=Va(n,t);for(let c=0;c<i.windows&&o!==Ud;c++){const{nextN:a,offset:l,isZero:u,isNeg:f}=Hd(o,c,i);if(o=a,!u){const p=r[l];s=s.add(f?p.negate():p)}}return s},getPrecomputes(n,r,o){let s=Ga.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&Ga.set(r,o(s))),s},wNAFCached(n,r,o){const s=qa(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=qa(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){Wd(r,t),Vd.set(n,r),Ga.delete(n)}}}function Kw(e,t,n,r){Gw(n,e),qw(r,t);const o=n.length,s=r.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,c=ly(BigInt(o));let a=1;c>12?a=c-3:c>4?a=c-2:c>0&&(a=2);const l=ms(a),u=new Array(Number(l)+1).fill(i),f=Math.floor((t.BITS-1)/a)*a;let p=i;for(let d=f;d>=0;d-=a){u.fill(i);for(let m=0;m<s;m++){const v=r[m],T=Number(v>>BigInt(d)&l);u[T]=u[T].add(n[m])}let h=i;for(let m=u.length-1,v=i;m>0;m--)v=v.add(u[m]),h=h.add(v);if(p=p.add(h),d!==0)for(let m=0;m<a;m++)p=p.double()}return p}function Gd(e){return Ww(e.Fp),bs(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...jd(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function qd(e){e.lowS!==void 0&&vo("lowS",e.lowS),e.prehash!==void 0&&vo("prehash",e.prehash)}function Yw(e){const t=Gd(e);bs(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class Xw extends Error{constructor(t=""){super(t)}}const tn={Err:Xw,_tlv:{encode:(e,t)=>{const{Err:n}=tn;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,o=ds(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?ds(o.length/2|128):"";return ds(e)+s+o+t},decode(e,t){const{Err:n}=tn;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 o=t[r++],s=!!(o&128);let i=0;if(!s)i=o;else{const a=o&127;if(!a)throw new n("tlv.decode(long): indefinite length not supported");if(a>4)throw new n("tlv.decode(long): byte length is too big");const l=t.subarray(r,r+a);if(l.length!==a)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)i=i<<8|u;if(r+=a,i<128)throw new n("tlv.decode(long): not minimal encoding")}const c=t.subarray(r,r+i);if(c.length!==i)throw new n("tlv.decode: wrong value length");return{v:c,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=tn;if(e<nn)throw new t("integer: negative integers are not allowed");let n=ds(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}=tn;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 jn(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=tn,o=ct("signature",e),{v:s,l:i}=r.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:c,l:a}=r.decode(2,s),{v:l,l:u}=r.decode(2,a);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(c),s:n.decode(l)}},hexFromSig(e){const{_tlv:t,_int:n}=tn,r=t.encode(2,n.encode(e.r)),o=t.encode(2,n.encode(e.s)),s=r+o;return t.encode(48,s)}};function Za(e,t){return wo(xo(e,t))}const nn=BigInt(0),Ne=BigInt(1);BigInt(2);const Ka=BigInt(3),Qw=BigInt(4);function Jw(e){const t=Yw(e),{Fp:n}=t,r=Ua(t.n,t.nBitLength),o=t.toBytes||((S,N,M)=>{const B=N.toAffine();return hs(Uint8Array.from([4]),n.toBytes(B.x),n.toBytes(B.y))}),s=t.fromBytes||(S=>{const N=S.subarray(1),M=n.fromBytes(N.subarray(0,n.BYTES)),B=n.fromBytes(N.subarray(n.BYTES,2*n.BYTES));return{x:M,y:B}});function i(S){const{a:N,b:M}=t,B=n.sqr(S),F=n.mul(B,S);return n.add(n.add(F,n.mul(S,N)),M)}function c(S,N){const M=n.sqr(N),B=i(S);return n.eql(M,B)}if(!c(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const a=n.mul(n.pow(t.a,Ka),Qw),l=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(a,l)))throw new Error("bad curve params: a or b");function u(S){return fa(S,Ne,t.n)}function f(S){const{allowedPrivateKeyLengths:N,nByteLength:M,wrapPrivateKey:B,n:F}=t;if(N&&typeof S!="bigint"){if(yo(S)&&(S=wo(S)),typeof S!="string"||!N.includes(S.length))throw new Error("invalid private key");S=S.padStart(M*2,"0")}let b;try{b=typeof S=="bigint"?S:jn(ct("private key",S,M))}catch{throw new Error("invalid private key, expected hex or "+M+" bytes, got "+typeof S)}return B&&(b=Ve(b,F)),br("private key",b,Ne,F),b}function p(S){if(!(S instanceof m))throw new Error("ProjectivePoint expected")}const d=Af((S,N)=>{const{px:M,py:B,pz:F}=S;if(n.eql(F,n.ONE))return{x:M,y:B};const b=S.is0();N==null&&(N=b?n.ONE:n.inv(F));const g=n.mul(M,N),w=n.mul(B,N),$=n.mul(F,N);if(b)return{x:n.ZERO,y:n.ZERO};if(!n.eql($,n.ONE))throw new Error("invZ was invalid");return{x:g,y:w}}),h=Af(S=>{if(S.is0()){if(t.allowInfinityPoint&&!n.is0(S.py))return;throw new Error("bad point: ZERO")}const{x:N,y:M}=S.toAffine();if(!n.isValid(N)||!n.isValid(M))throw new Error("bad point: x or y not FE");if(!c(N,M))throw new Error("bad point: equation left != right");if(!S.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(N,M,B){if(N==null||!n.isValid(N))throw new Error("x required");if(M==null||!n.isValid(M)||n.is0(M))throw new Error("y required");if(B==null||!n.isValid(B))throw new Error("z required");this.px=N,this.py=M,this.pz=B,Object.freeze(this)}static fromAffine(N){const{x:M,y:B}=N||{};if(!N||!n.isValid(M)||!n.isValid(B))throw new Error("invalid affine point");if(N instanceof m)throw new Error("projective point not allowed");const F=b=>n.eql(b,n.ZERO);return F(M)&&F(B)?m.ZERO:new m(M,B,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(N){const M=Fd(n,N.map(B=>B.pz));return N.map((B,F)=>B.toAffine(M[F])).map(m.fromAffine)}static fromHex(N){const M=m.fromAffine(s(ct("pointHex",N)));return M.assertValidity(),M}static fromPrivateKey(N){return m.BASE.multiply(f(N))}static msm(N,M){return Kw(m,r,N,M)}_setWindowSize(N){E.setWindowSize(this,N)}assertValidity(){h(this)}hasEvenY(){const{y:N}=this.toAffine();if(n.isOdd)return!n.isOdd(N);throw new Error("Field doesn't support isOdd")}equals(N){p(N);const{px:M,py:B,pz:F}=this,{px:b,py:g,pz:w}=N,$=n.eql(n.mul(M,w),n.mul(b,F)),C=n.eql(n.mul(B,w),n.mul(g,F));return $&&C}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){const{a:N,b:M}=t,B=n.mul(M,Ka),{px:F,py:b,pz:g}=this;let w=n.ZERO,$=n.ZERO,C=n.ZERO,O=n.mul(F,F),k=n.mul(b,b),y=n.mul(g,g),A=n.mul(F,b);return A=n.add(A,A),C=n.mul(F,g),C=n.add(C,C),w=n.mul(N,C),$=n.mul(B,y),$=n.add(w,$),w=n.sub(k,$),$=n.add(k,$),$=n.mul(w,$),w=n.mul(A,w),C=n.mul(B,C),y=n.mul(N,y),A=n.sub(O,y),A=n.mul(N,A),A=n.add(A,C),C=n.add(O,O),O=n.add(C,O),O=n.add(O,y),O=n.mul(O,A),$=n.add($,O),y=n.mul(b,g),y=n.add(y,y),O=n.mul(y,A),w=n.sub(w,O),C=n.mul(y,k),C=n.add(C,C),C=n.add(C,C),new m(w,$,C)}add(N){p(N);const{px:M,py:B,pz:F}=this,{px:b,py:g,pz:w}=N;let $=n.ZERO,C=n.ZERO,O=n.ZERO;const k=t.a,y=n.mul(t.b,Ka);let A=n.mul(M,b),I=n.mul(B,g),P=n.mul(F,w),L=n.add(M,B),j=n.add(b,g);L=n.mul(L,j),j=n.add(A,I),L=n.sub(L,j),j=n.add(M,F);let z=n.add(b,w);return j=n.mul(j,z),z=n.add(A,P),j=n.sub(j,z),z=n.add(B,F),$=n.add(g,w),z=n.mul(z,$),$=n.add(I,P),z=n.sub(z,$),O=n.mul(k,j),$=n.mul(y,P),O=n.add($,O),$=n.sub(I,O),O=n.add(I,O),C=n.mul($,O),I=n.add(A,A),I=n.add(I,A),P=n.mul(k,P),j=n.mul(y,j),I=n.add(I,P),P=n.sub(A,P),P=n.mul(k,P),j=n.add(j,P),A=n.mul(I,j),C=n.add(C,A),A=n.mul(z,j),$=n.mul(L,$),$=n.sub($,A),A=n.mul(L,I),O=n.mul(z,O),O=n.add(O,A),new m($,C,O)}subtract(N){return this.add(N.negate())}is0(){return this.equals(m.ZERO)}wNAF(N){return E.wNAFCached(this,N,m.normalizeZ)}multiplyUnsafe(N){const{endo:M,n:B}=t;br("scalar",N,nn,B);const F=m.ZERO;if(N===nn)return F;if(this.is0()||N===Ne)return this;if(!M||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,N,m.normalizeZ);let{k1neg:b,k1:g,k2neg:w,k2:$}=M.splitScalar(N),C=F,O=F,k=this;for(;g>nn||$>nn;)g&Ne&&(C=C.add(k)),$&Ne&&(O=O.add(k)),k=k.double(),g>>=Ne,$>>=Ne;return b&&(C=C.negate()),w&&(O=O.negate()),O=new m(n.mul(O.px,M.beta),O.py,O.pz),C.add(O)}multiply(N){const{endo:M,n:B}=t;br("scalar",N,Ne,B);let F,b;if(M){const{k1neg:g,k1:w,k2neg:$,k2:C}=M.splitScalar(N);let{p:O,f:k}=this.wNAF(w),{p:y,f:A}=this.wNAF(C);O=E.constTimeNegate(g,O),y=E.constTimeNegate($,y),y=new m(n.mul(y.px,M.beta),y.py,y.pz),F=O.add(y),b=k.add(A)}else{const{p:g,f:w}=this.wNAF(N);F=g,b=w}return m.normalizeZ([F,b])[0]}multiplyAndAddUnsafe(N,M,B){const F=m.BASE,b=(w,$)=>$===nn||$===Ne||!w.equals(F)?w.multiplyUnsafe($):w.multiply($),g=b(this,M).add(b(N,B));return g.is0()?void 0:g}toAffine(N){return d(this,N)}isTorsionFree(){const{h:N,isTorsionFree:M}=t;if(N===Ne)return!0;if(M)return M(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:N,clearCofactor:M}=t;return N===Ne?this:M?M(m,this):this.multiplyUnsafe(t.h)}toRawBytes(N=!0){return vo("isCompressed",N),this.assertValidity(),o(m,this,N)}toHex(N=!0){return vo("isCompressed",N),wo(this.toRawBytes(N))}}m.BASE=new m(t.Gx,t.Gy,n.ONE),m.ZERO=new m(n.ZERO,n.ONE,n.ZERO);const{endo:v,nBitLength:T}=t,E=Zw(m,v?Math.ceil(T/2):T);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:f,weierstrassEquation:i,isWithinCurveOrder:u}}function e6(e){const t=Gd(e);return bs(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function t6(e){const t=e6(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,c=2*n.BYTES+1;function a(y){return Ve(y,r)}function l(y){return za(y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:p,isWithinCurveOrder:d}=Jw({...t,toBytes(y,A,I){const P=A.toAffine(),L=n.toBytes(P.x),j=hs;return vo("isCompressed",I),I?j(Uint8Array.from([A.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,n.toBytes(P.y))},fromBytes(y){const A=y.length,I=y[0],P=y.subarray(1);if(A===i&&(I===2||I===3)){const L=jn(P);if(!fa(L,Ne,n.ORDER))throw new Error("Point is not on curve");const j=p(L);let z;try{z=n.sqrt(j)}catch(Y){const G=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+G)}const _=(z&Ne)===Ne;return(I&1)===1!==_&&(z=n.neg(z)),{x:L,y:z}}else if(A===c&&I===4){const L=n.fromBytes(P.subarray(0,n.BYTES)),j=n.fromBytes(P.subarray(n.BYTES,2*n.BYTES));return{x:L,y:j}}else{const L=i,j=c;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+j+", got "+A)}}});function h(y){const A=r>>Ne;return y>A}function m(y){return h(y)?a(-y):y}const v=(y,A,I)=>jn(y.slice(A,I));class T{constructor(A,I,P){br("r",A,Ne,r),br("s",I,Ne,r),this.r=A,this.s=I,P!=null&&(this.recovery=P),Object.freeze(this)}static fromCompact(A){const I=o;return A=ct("compactSignature",A,I*2),new T(v(A,0,I),v(A,I,2*I))}static fromDER(A){const{r:I,s:P}=tn.toSig(ct("DER",A));return new T(I,P)}assertValidity(){}addRecoveryBit(A){return new T(this.r,this.s,A)}recoverPublicKey(A){const{r:I,s:P,recovery:L}=this,j=F(ct("msgHash",A));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const z=L===2||L===3?I+t.n:I;if(z>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const _=L&1?"03":"02",H=u.fromHex(_+Za(z,n.BYTES)),Y=l(z),G=a(-j*Y),W=a(P*Y),Z=u.BASE.multiplyAndAddUnsafe(H,G,W);if(!Z)throw new Error("point at infinify");return Z.assertValidity(),Z}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new T(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ps(this.toDERHex())}toDERHex(){return tn.hexFromSig(this)}toCompactRawBytes(){return ps(this.toCompactHex())}toCompactHex(){const A=o;return Za(this.r,A)+Za(this.s,A)}}const E={isValidPrivateKey(y){try{return f(y),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const y=zd(t.n);return Vw(t.randomBytes(y),t.n)},precompute(y=8,A=u.BASE){return A._setWindowSize(y),A.multiply(BigInt(3)),A}};function S(y,A=!0){return u.fromPrivateKey(y).toRawBytes(A)}function N(y){if(typeof y=="bigint")return!1;if(y instanceof u)return!0;const I=ct("key",y).length,P=n.BYTES,L=P+1,j=2*P+1;if(!(t.allowedPrivateKeyLengths||o===L))return I===L||I===j}function M(y,A,I=!0){if(N(y)===!0)throw new Error("first arg must be private key");if(N(A)===!1)throw new Error("second arg must be public key");return u.fromHex(A).multiply(f(y)).toRawBytes(I)}const B=t.bits2int||function(y){if(y.length>8192)throw new Error("input is too large");const A=jn(y),I=y.length*8-s;return I>0?A>>BigInt(I):A},F=t.bits2int_modN||function(y){return a(B(y))},b=ms(s);function g(y){return br("num < 2^"+s,y,nn,b),xo(y,o)}function w(y,A,I=$){if(["recovered","canonical"].some(ee=>ee in I))throw new Error("sign() legacy options not supported");const{hash:P,randomBytes:L}=t;let{lowS:j,prehash:z,extraEntropy:_}=I;j==null&&(j=!0),y=ct("msgHash",y),qd(I),z&&(y=ct("prehashed msgHash",P(y)));const H=F(y),Y=f(A),G=[g(Y),g(H)];if(_!=null&&_!==!1){const ee=_===!0?L(n.BYTES):_;G.push(ct("extraEntropy",ee))}const W=hs(...G),Z=H;function J(ee){const fe=B(ee);if(!d(fe))return;const pe=l(fe),he=u.BASE.multiply(fe).toAffine(),se=a(he.x);if(se===nn)return;const me=a(pe*a(Z+se*Y));if(me===nn)return;let te=(he.x===se?0:2)|Number(he.y&Ne),Se=me;return j&&h(me)&&(Se=m(me),te^=1),new T(se,Se,te)}return{seed:W,k2sig:J}}const $={lowS:t.lowS,prehash:!1},C={lowS:t.lowS,prehash:!1};function O(y,A,I=$){const{seed:P,k2sig:L}=w(y,A,I),j=t;return uy(j.hash.outputLen,j.nByteLength,j.hmac)(P,L)}u.BASE._setWindowSize(8);function k(y,A,I,P=C){var te;const L=y;A=ct("msgHash",A),I=ct("publicKey",I);const{lowS:j,prehash:z,format:_}=P;if(qd(P),"strict"in P)throw new Error("options.strict was renamed to lowS");if(_!==void 0&&_!=="compact"&&_!=="der")throw new Error("format must be compact or der");const H=typeof L=="string"||yo(L),Y=!H&&!_&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!H&&!Y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let G,W;try{if(Y&&(G=new T(L.r,L.s)),H){try{_!=="compact"&&(G=T.fromDER(L))}catch(Se){if(!(Se instanceof tn.Err))throw Se}!G&&_!=="der"&&(G=T.fromCompact(L))}W=u.fromHex(I)}catch{return!1}if(!G||j&&G.hasHighS())return!1;z&&(A=t.hash(A));const{r:Z,s:J}=G,ee=F(A),fe=l(J),pe=a(ee*fe),he=a(Z*fe),se=(te=u.BASE.multiplyAndAddUnsafe(W,pe,he))==null?void 0:te.toAffine();return se?a(se.x)===Z:!1}return{CURVE:t,getPublicKey:S,getSharedSecret:M,sign:O,verify:k,ProjectivePoint:u,Signature:T,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function n6(e){return{hash:e,hmac:(t,...n)=>kd(e,t,P1(...n)),randomBytes:T1}}function r6(e,t){const n=r=>t6({...e,...n6(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Zd=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Kd=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),o6=BigInt(0),s6=BigInt(1),Ya=BigInt(2),Yd=(e,t)=>(e+t/Ya)/t;function i6(e){const t=Zd,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),c=BigInt(44),a=BigInt(88),l=e*e*e%t,u=l*l*e%t,f=lt(u,n,t)*u%t,p=lt(f,n,t)*u%t,d=lt(p,Ya,t)*l%t,h=lt(d,o,t)*d%t,m=lt(h,s,t)*h%t,v=lt(m,c,t)*m%t,T=lt(v,a,t)*v%t,E=lt(T,c,t)*m%t,S=lt(E,n,t)*u%t,N=lt(S,i,t)*h%t,M=lt(N,r,t)*l%t,B=lt(M,Ya,t);if(!Xa.eql(Xa.sqr(B),e))throw new Error("Cannot find square root");return B}const Xa=Ua(Zd,void 0,void 0,{sqrt:i6}),Xd=r6({a:o6,b:BigInt(7),Fp:Xa,n:Kd,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Kd,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-s6*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),c=Yd(s*e,t),a=Yd(-r*e,t);let l=Ve(e-c*n-a*o,t),u=Ve(-c*r-a*s,t);const f=l>i,p=u>i;if(f&&(l=t-l),p&&(u=t-u),l>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:l,k2neg:p,k2:u}}}},uf),a6=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Xd},Symbol.toStringTag,{value:"Module"}));function Qd(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Ja({signature:e});if(typeof e.s>"u")throw new Ja({signature:e});if(n&&typeof e.yParity>"u")throw new Ja({signature:e});if(e.r<0n||e.r>Td)throw new h6({value:e.r});if(e.s<0n||e.s>Td)throw new m6({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new ec({value:e.yParity})}function c6(e){return Jd(Ct(e))}function Jd(e){if(e.length!==130&&e.length!==132)throw new p6({signature:e});const t=BigInt(Bt(e,0,32)),n=BigInt(Bt(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return Qa(o)}catch{throw new ec({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function l6(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return u6(e)}function u6(e){const t=typeof e=="string"?Jd(e):e instanceof Uint8Array?c6(e):typeof e.r=="string"?d6(e):e.v?f6(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return Qd(t),t}function f6(e){return{r:e.r,s:e.s,yParity:Qa(e.v)}}function d6(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=Qa(n)),typeof r!="number")throw new ec({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Qa(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new b6({value:e})}class p6 extends ie{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${tt(Ly(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Ja extends ie{constructor({signature:t}){super(`Signature \`${If(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class h6 extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class m6 extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class ec extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class b6 extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function g6(e,t={}){return typeof e.chainId=="string"?y6(e):{...e,...t.signature}}function y6(e){const{address:t,chainId:n,nonce:r}=e,o=l6(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const v6="0x8010801080108010801080108010801080108010801080108010801080108010",w6=Cd("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function e0(e){if(typeof e=="string"){if(Bt(e,-32)!==v6)throw new S6(e)}else Qd(e.authorization)}function x6(e){e0(e);const t=Bf(Bt(e,-64,-32)),n=Bt(e,-t-64,-64),r=Bt(e,0,-t-64),[o,s,i]=Dw(w6,n);return{authorization:g6({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...i&&i!=="0x"?{data:i,to:s}:{}}}function E6(e){try{return e0(e),!0}catch{return!1}}let S6=class extends ie{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class P6 extends V{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function T6(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new P6({value:e});let[n,r="0"]=e.split(".");const o=n.startsWith("-");if(o&&(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[s,i,c]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],a=Math.round(+`${i}.${c}`);a>9?r=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):r=`${s}${a}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${o?"-":""}${n}${r}`)}function A6(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function $6(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Zt(e.nonce):void 0,storageProof:e.storageProof?A6(e.storageProof):void 0}}async function C6(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",i=n!==void 0?Q(n):void 0,c=await e.request({method:"eth_getProof",params:[t,o,i||s]});return $6(c)}async function N6(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=n!==void 0?Q(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}async function tc(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s,sender:i,nonce:c}){var p,d,h;const a=r||"latest",l=n!==void 0?Q(n):void 0;let u=null;if(o?u=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Q(s)]},{dedupe:!0}):typeof s=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||a,Q(s)]},{dedupe:!!l}):i&&typeof c=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,Q(c)]},{dedupe:!0})),!u)throw new Wu({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(((h=(d=(p=e.chain)==null?void 0:p.formatters)==null?void 0:d.transaction)==null?void 0:h.format)||Xi)(u,"getTransaction")}async function O6(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([X(e,To,"getBlockNumber")({}),t?X(e,tc,"getTransaction")({hash:t}):void 0]),s=(n==null?void 0:n.blockNumber)||(o==null?void 0:o.blockNumber);return s?r-s+1n:0n}async function Ts(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Hu({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||td)(n,"getTransactionReceipt")}async function I6(e,t){var E;const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:i,blockTag:c,stateOverride:a}=t,l=t.contracts,{batchSize:u=t.batchSize??1024,deployless:f=t.deployless??!1}=typeof((E=e.batch)==null?void 0:E.multicall)=="object"?e.batch.multicall:{},p=(()=>{if(t.multicallAddress)return t.multicallAddress;if(f)return null;if(e.chain)return vr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),d=[[]];let h=0,m=0;for(let S=0;S<l.length;S++){const{abi:N,address:M,args:B,functionName:F}=l[S];try{const b=Tt({abi:N,args:B,functionName:F});m+=(b.length-2)/2,u>0&&m>u&&d[h].length>0&&(h++,m=(b.length-2)/2,d[h]=[]),d[h]=[...d[h],{allowFailure:!0,callData:b,target:M}]}catch(b){const g=pr(b,{abi:N,address:M,args:B,docsPath:"/docs/contract/multicall",functionName:F,sender:n});if(!o)throw g;d[h]=[...d[h],{allowFailure:!0,callData:"0x",target:M}]}}const v=await Promise.allSettled(d.map(S=>X(e,Nt,"readContract")({...p===null?{code:ma}:{address:p},abi:ys,account:n,args:[S],authorizationList:r,blockNumber:s,blockOverrides:i,blockTag:c,functionName:"aggregate3",stateOverride:a}))),T=[];for(let S=0;S<v.length;S++){const N=v[S];if(N.status==="rejected"){if(!o)throw N.reason;for(let B=0;B<d[S].length;B++)T.push({status:"failure",error:N.reason,result:void 0});continue}const M=N.value;for(let B=0;B<M.length;B++){const{returnData:F,success:b}=M[B],{callData:g}=d[S][B],{abi:w,address:$,functionName:C,args:O}=l[T.length];try{if(g==="0x")throw new Rr;if(!b)throw new is({data:F});const k=Rn({abi:w,args:O,data:F,functionName:C});T.push(o?{result:k,status:"success"}:k)}catch(k){const y=pr(k,{abi:w,address:$,args:O,docsPath:"/docs/contract/multicall",functionName:C});if(!o)throw y;T.push({error:y,result:void 0,status:"failure"})}}}if(T.length!==l.length)throw new V("multicall results mismatch");return T}async function nc(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:i,validation:c}=t;try{const a=[];for(const p of o){const d=p.blockOverrides?zf(p.blockOverrides):void 0,h=p.calls.map(v=>{const T=v,E=T.account?Je(T.account):void 0,S=T.abi?Tt(T):T.data,N={...T,account:E,data:T.dataSuffix?Pt([S||"0x",T.dataSuffix]):S,from:T.from??(E==null?void 0:E.address)};return mr(N),bo(N)}),m=p.stateOverrides?Ki(p.stateOverrides):void 0;a.push({blockOverrides:d,calls:h,stateOverrides:m})}const u=(typeof n=="bigint"?Q(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:s,traceTransfers:i,validation:c},u]})).map((p,d)=>({...of(p),calls:p.calls.map((h,m)=>{var w,$;const{abi:v,args:T,functionName:E,to:S}=o[d].calls[m],N=((w=h.error)==null?void 0:w.data)??h.returnData,M=BigInt(h.gasUsed),B=($=h.logs)==null?void 0:$.map(C=>Xt(C)),F=h.status==="0x1"?"success":"failure",b=v&&F==="success"&&N!=="0x"?Rn({abi:v,data:N,functionName:E}):null,g=(()=>{var O;if(F==="success")return;let C;if(((O=h.error)==null?void 0:O.data)==="0x"?C=new Rr:h.error&&(C=new is(h.error)),!!C)return pr(C,{abi:v??[],address:S??"0x",args:T,functionName:E??"<unknown>"})})();return{data:N,gasUsed:M,logs:B,status:F,...F==="success"?{result:b}:{error:g}}})}))}catch(a){const l=a,u=ls(l,{});throw u instanceof mo?l:u}}function rc(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function","error",""].includes(o))o="";else if(o+=c,c===")"){s=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=c,n+=c}}if(!s)throw new ie("Unable to normalize signature.");return o}function oc(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Da(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((o,s)=>oc(Object.values(e)[s],o)):/^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(o=>oc(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function t0(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return t0(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?Da(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?Da(n[r],{strict:!1}):!1)return i}}function n0(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Ql(e):e;return{...r,...n?{hash:xr(r)}:{}}}function As(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=By(t,{strict:!1}),i=e.filter(l=>s?l.type==="function"||l.type==="error"?r0(l)===Bt(t,0,4):l.type==="event"?xr(l)===t:!1:"name"in l&&l.name===t);if(i.length===0)throw new $s({name:t});if(i.length===1)return{...i[0],...o?{hash:xr(i[0])}:{}};let c;for(const l of i){if(!("inputs"in l))continue;if(!r||r.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...o?{hash:xr(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==r.length)continue;if(r.every((f,p)=>{const d="inputs"in l&&l.inputs[p];return d?oc(f,d):!1})){if(c&&"inputs"in c&&c.inputs){const f=t0(l.inputs,c.inputs,r);if(f)throw new D6({abiItem:l,type:f[0]},{abiItem:c,type:f[1]})}c=l}}const a=(()=>{if(c)return c;const[l,...u]=i;return{...l,overloads:u}})();if(!a)throw new $s({name:t});return{...a,...o?{hash:xr(a)}:{}}}function r0(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return As(n,r)}return e[0]})();return Bt(xr(t),0,4)}function k6(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return As(r,o)}return e[0]})(),n=typeof t=="string"?t:Yo(t);return rc(n)}function xr(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return As(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:xd(pa(k6(t)))}class D6 extends ie{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${rc(Yo(t.abiItem))}\`, and`,`\`${n.type}\` in \`${rc(Yo(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 $s extends ie{constructor({name:t,data:n,type:r="item"}){const o=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${o} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function M6(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,c]=e;return[B6(i),c]}return e})(),{bytecode:r,args:o}=n;return $t(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?Ra(t.inputs,o):"0x")}function L6(e){return n0(e)}function B6(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new $s({name:"constructor"});return t}function F6(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[l,u,f]=e;return[o0(l,u,{args:f}),f]}const[c,a]=e;return[c,a]})(),{overloads:r}=t,o=r?o0([t,...r],t.name,{args:n}):t,s=R6(o),i=n.length>0?Ra(o.inputs,n):void 0;return i?$t(s,i):s}function Er(e,t={}){return n0(e,t)}function o0(e,t,n){const r=As(e,t,n);if(r.type!=="function")throw new $s({name:t,type:"function"});return r}function R6(e){return r0(e)}const j6="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ft="0x0000000000000000000000000000000000000000",_6="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function z6(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:c,validation:a}=t,l=t.account?Je(t.account):void 0;if(i&&!l)throw new V("`account` is required when `traceAssetChanges` is true");const u=l?M6(L6("constructor(bytes, bytes)"),{bytecode:Zf,args:[_6,F6(Er("function getBalance(address)"),[l.address])]}):void 0,f=i?await Promise.all(t.calls.map(async P=>{if(!P.data&&!P.abi)return;const{accessList:L}=await ud(e,{account:l.address,...P,data:P.abi?Tt(P):P.data});return L.map(({address:j,storageKeys:z})=>z.length>0?j:null)})).then(P=>P.flat().filter(Boolean)):[],p=await nc(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:f.map((P,L)=>({abi:[Er("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:P,from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]}]:[],{calls:[...o,{}].map(P=>({...P,from:l==null?void 0:l.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:f.map((P,L)=>({abi:[Er("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:P,from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]},{calls:f.map((P,L)=>({to:P,abi:[Er("function decimals() returns (uint256)")],functionName:"decimals",from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]},{calls:f.map((P,L)=>({to:P,abi:[Er("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]},{calls:f.map((P,L)=>({to:P,abi:[Er("function symbol() returns (string)")],functionName:"symbol",from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]}]:[]],traceTransfers:c,validation:a}),d=i?p[2]:p[0],[h,m,,v,T,E,S,N]=i?p:[],{calls:M,...B}=d,F=M.slice(0,-1)??[],b=(h==null?void 0:h.calls)??[],g=(m==null?void 0:m.calls)??[],w=[...b,...g].map(P=>P.status==="success"?Dt(P.data):null),$=(v==null?void 0:v.calls)??[],C=(T==null?void 0:T.calls)??[],O=[...$,...C].map(P=>P.status==="success"?Dt(P.data):null),k=((E==null?void 0:E.calls)??[]).map(P=>P.status==="success"?P.result:null),y=((N==null?void 0:N.calls)??[]).map(P=>P.status==="success"?P.result:null),A=((S==null?void 0:S.calls)??[]).map(P=>P.status==="success"?P.result:null),I=[];for(const[P,L]of O.entries()){const j=w[P];if(typeof L!="bigint"||typeof j!="bigint")continue;const z=k[P-1],_=y[P-1],H=A[P-1],Y=P===0?{address:j6,decimals:18,symbol:"ETH"}:{address:f[P-1],decimals:H||z?Number(z??1):void 0,symbol:_??void 0};I.some(G=>G.token.address===Y.address)||I.push({token:Y,value:{pre:j,post:L,diff:L-j}})}return{assetChanges:I,block:B,results:F}}const s0="0x6492649264926492649264926492649264926492649264926492649264926492";function U6(e){if(Bt(e,-32)!==s0)throw new V6(e)}function W6(e){const{data:t,signature:n,to:r}=e;return $t(Ra(Cd("address, bytes, bytes"),[r,t,n]),s0)}function H6(e){try{return U6(e),!0}catch{return!1}}class V6 extends ie{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function G6({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(o===0||o===1)return o;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new Xd.Signature(Dt(e),Dt(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:Mt(i)}async function Cs(e,t){var c,a,l,u,f,p;const{address:n,hash:r,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??((l=(a=(c=e.chain)==null?void 0:c.contracts)==null?void 0:a.erc6492Verifier)==null?void 0:l.address),multicallAddress:s=t.multicallAddress??((p=(f=(u=e.chain)==null?void 0:u.contracts)==null?void 0:f.multicall3)==null?void 0:p.address)}=t,i=(()=>{const d=t.signature;return Et(d)?d:typeof d=="object"&&"r"in d&&"s"in d?G6(d):Ae(d)})();try{return E6(i)?await q6(e,{...t,multicallAddress:s,signature:i}):await Z6(e,{...t,verifierAddress:o,signature:i})}catch(d){try{if(go(mn(n),await Ku({hash:r,signature:i})))return!0}catch{}if(d instanceof Wn)return!1;throw d}}async function q6(e,t){var v;const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:i}=t,{authorization:c,data:a,signature:l,to:u}=x6(t.signature);if(await Ia(e,{address:n,blockNumber:r,blockTag:o})===cr(["0xef0100",c.address]))return await K6(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:l});const p={address:c.address,chainId:Number(c.chainId),nonce:Number(c.nonce),r:Q(c.r,{size:32}),s:Q(c.s,{size:32}),yParity:c.yParity};if(!await Bv({address:n,authorization:p}))throw new Wn;const h=await X(e,Nt,"readContract")({...i?{address:i}:{code:ma},authorizationList:[p],abi:ys,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...a?[{allowFailure:!0,target:u??n,callData:a}]:[],{allowFailure:!0,target:n,callData:Tt({abi:Gf,functionName:"isValidSignature",args:[s,l]})}]]}),m=(v=h[h.length-1])==null?void 0:v.returnData;if(m!=null&&m.startsWith("0x1626ba7e"))return!0;throw new Wn}async function Z6(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:c,...a}=t,l=await(async()=>!r&&!o||H6(i)?i:W6({data:o,signature:i,to:r}))(),u=c?{to:c,data:Tt({abi:qf,functionName:"isValidSig",args:[n,s,l]}),...a}:{data:ya({abi:qf,args:[n,s,l],bytecode:Wy}),...a},{data:f}=await X(e,So,"call")(u).catch(p=>{throw p instanceof Vu?new Wn:p});if(s1(f??"0x0"))return!0;throw new Wn}async function K6(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:i}=t;if((await X(e,Nt,"readContract")({address:n,abi:Gf,args:[s,i],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(a=>{throw a instanceof Gu?new Wn:a})).startsWith("0x1626ba7e"))return!0;throw new Wn}class Wn extends Error{}async function Y6(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const c=bd(n);return X(e,Cs,"verifyHash")({address:t,factory:r,factoryData:o,hash:c,signature:s,...i})}async function X6(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:c,types:a,domain:l,...u}=t,f=ow({message:i,primaryType:c,types:a,domain:l});return X(e,Cs,"verifyHash")({address:n,factory:r,factoryData:o,hash:f,signature:s,...u})}function i0(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:i=e.pollingInterval}){const c=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let a;return c?(()=>{const f=$e(["watchBlockNumber",e.uid,t,n,i]);return wn(f,{onBlockNumber:r,onError:o},p=>Po(async()=>{var d;try{const h=await X(e,To,"getBlockNumber")({cacheTime:0});if(a!==void 0){if(h===a)return;if(h-a>1&&n)for(let m=a+1n;m<h;m++)p.onBlockNumber(m,a),a=m}(a===void 0||h>a)&&(p.onBlockNumber(h,a),a=h)}catch(h){(d=p.onError)==null||d.call(p,h)}},{emitOnBegin:t,interval:i}))})():(()=>{const f=$e(["watchBlockNumber",e.uid,t,n]);return wn(f,{onBlockNumber:r,onError:o},p=>{let d=!0,h=()=>d=!1;return(async()=>{try{const m=(()=>{if(e.transport.type==="fallback"){const T=e.transport.transports.find(E=>E.config.type==="webSocket"||E.config.type==="ipc");return T?T.value:e.transport}return e.transport})(),{unsubscribe:v}=await m.subscribe({params:["newHeads"],onData(T){var S;if(!d)return;const E=Dt((S=T.result)==null?void 0:S.number);p.onBlockNumber(E,a),a=E},onError(T){var E;(E=p.onError)==null||E.call(p,T)}});h=v,d||h()}catch(m){o==null||o(m)}})(),()=>h()})})()}async function Q6(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:c=({count:M})=>~~(1<<M)*200,timeout:a=18e4}=t,l=$e(["waitForTransactionReceipt",e.uid,o]),u=(()=>{var M;return t.pollingInterval?t.pollingInterval:(M=e.chain)!=null&&M.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let f,p,d,h=!1,m,v;const{promise:T,resolve:E,reject:S}=Xf(),N=a?setTimeout(()=>{v==null||v(),m==null||m(),S(new wg({hash:o}))},a):void 0;return m=wn(l,{onReplaced:s,resolve:E,reject:S},async M=>{if(d=await X(e,Ts,"getTransactionReceipt")({hash:o}).catch(()=>{}),d&&r<=1){clearTimeout(N),M.resolve(d),m==null||m();return}v=X(e,i0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(B){const F=g=>{clearTimeout(N),v==null||v(),g(),m==null||m()};let b=B;if(!h)try{if(d){if(r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;F(()=>M.resolve(d));return}if(n&&!f&&(h=!0,await Ea(async()=>{f=await X(e,tc,"getTransaction")({hash:o}),f.blockNumber&&(b=f.blockNumber)},{delay:c,retryCount:i}),h=!1),d=await X(e,Ts,"getTransactionReceipt")({hash:o}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;F(()=>M.resolve(d))}catch(g){if(g instanceof Wu||g instanceof Hu){if(!f){h=!1;return}try{p=f,h=!0;const w=await Ea(()=>X(e,At,"getBlock")({blockNumber:b,includeTransactions:!0}),{delay:c,retryCount:i,shouldRetry:({error:O})=>O instanceof nf});h=!1;const $=w.transactions.find(({from:O,nonce:k})=>O===p.from&&k===p.nonce);if(!$||(d=await X(e,Ts,"getTransactionReceipt")({hash:$.hash}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r)))return;let C="replaced";$.to===p.to&&$.value===p.value&&$.input===p.input?C="repriced":$.from===$.to&&$.value===0n&&(C="cancelled"),F(()=>{var O;(O=M.onReplaced)==null||O.call(M,{reason:C,replacedTransaction:p,transaction:$,transactionReceipt:d}),M.resolve(d)})}catch(w){F(()=>M.reject(w))}}else F(()=>M.reject(g))}}})}),T}function J6(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:i,poll:c,pollingInterval:a=e.pollingInterval}){const l=typeof c<"u"?c:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),u=i??!1;let f;return l?(()=>{const h=$e(["watchBlocks",e.uid,t,n,r,u,a]);return wn(h,{onBlock:o,onError:s},m=>Po(async()=>{var v;try{const T=await X(e,At,"getBlock")({blockTag:t,includeTransactions:u});if(T.number!==null&&(f==null?void 0:f.number)!=null){if(T.number===f.number)return;if(T.number-f.number>1&&n)for(let E=(f==null?void 0:f.number)+1n;E<T.number;E++){const S=await X(e,At,"getBlock")({blockNumber:E,includeTransactions:u});m.onBlock(S,f),f=S}}((f==null?void 0:f.number)==null||t==="pending"&&(T==null?void 0:T.number)==null||T.number!==null&&T.number>f.number)&&(m.onBlock(T,f),f=T)}catch(T){(v=m.onError)==null||v.call(m,T)}},{emitOnBegin:r,interval:a}))})():(()=>{let h=!0,m=!0,v=()=>h=!1;return(async()=>{try{r&&X(e,At,"getBlock")({blockTag:t,includeTransactions:u}).then(S=>{h&&m&&(o(S,void 0),m=!1)}).catch(s);const T=(()=>{if(e.transport.type==="fallback"){const S=e.transport.transports.find(N=>N.config.type==="webSocket"||N.config.type==="ipc");return S?S.value:e.transport}return e.transport})(),{unsubscribe:E}=await T.subscribe({params:["newHeads"],async onData(S){var M;if(!h)return;const N=await X(e,At,"getBlock")({blockNumber:(M=S.result)==null?void 0:M.number,includeTransactions:u}).catch(()=>{});h&&(o(N,f),m=!1,f=N)},onError(S){s==null||s(S)}});v=E,h||v()}catch(T){s==null||s(T)}})(),()=>v()})()}function e5(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:i,onError:c,onLogs:a,poll:l,pollingInterval:u=e.pollingInterval,strict:f}){const p=typeof l<"u"?l:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),d=f??!1;return p?(()=>{const v=$e(["watchEvent",t,n,r,e.uid,o,u,i]);return wn(v,{onLogs:a,onError:c},T=>{let E;i!==void 0&&(E=i-1n);let S,N=!1;const M=Po(async()=>{var B;if(!N){try{S=await X(e,fd,"createEventFilter")({address:t,args:n,event:o,events:s,strict:d,fromBlock:i})}catch{}N=!0;return}try{let F;if(S)F=await X(e,vs,"getFilterChanges")({filter:S});else{const b=await X(e,To,"getBlockNumber")({});E&&E!==b?F=await X(e,sa,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:E+1n,toBlock:b}):F=[],E=b}if(F.length===0)return;if(r)T.onLogs(F);else for(const b of F)T.onLogs([b])}catch(F){S&&F instanceof gn&&(N=!1),(B=T.onError)==null||B.call(T,F)}},{emitOnBegin:!0,interval:u});return async()=>{S&&await X(e,ws,"uninstallFilter")({filter:S}),M()}})})():(()=>{let v=!0,T=()=>v=!1;return(async()=>{try{const E=(()=>{if(e.transport.type==="fallback"){const B=e.transport.transports.find(F=>F.config.type==="webSocket"||F.config.type==="ipc");return B?B.value:e.transport}return e.transport})(),S=s??(o?[o]:void 0);let N=[];S&&(N=[S.flatMap(F=>Wr({abi:[F],eventName:F.name,args:n}))],o&&(N=N[0]));const{unsubscribe:M}=await E.subscribe({params:["logs",{address:t,topics:N}],onData(B){var b;if(!v)return;const F=B.result;try{const{eventName:g,args:w}=fs({abi:S??[],data:F.data,topics:F.topics,strict:d}),$=Xt(F,{args:w,eventName:g});a([$])}catch(g){let w,$;if(g instanceof Jo||g instanceof Ti){if(f)return;w=g.abiItem.name,$=(b=g.abiItem.inputs)==null?void 0:b.some(O=>!("name"in O&&O.name))}const C=Xt(F,{args:$?[]:{},eventName:w});a([C])}},onError(B){c==null||c(B)}});T=M,v||T()}catch(E){c==null||c(E)}})(),()=>T()})()}function t5(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const l=$e(["watchPendingTransactions",e.uid,t,s]);return wn(l,{onTransactions:r,onError:n},u=>{let f;const p=Po(async()=>{var d;try{if(!f)try{f=await X(e,dd,"createPendingTransactionFilter")({});return}catch(m){throw p(),m}const h=await X(e,vs,"getFilterChanges")({filter:f});if(h.length===0)return;if(t)u.onTransactions(h);else for(const m of h)u.onTransactions([m])}catch(h){(d=u.onError)==null||d.call(u,h)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await X(e,ws,"uninstallFilter")({filter:f}),p()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(p){if(!l)return;const d=p.result;r([d])},onError(p){n==null||n(p)}});u=f,l||u()}catch(f){n==null||n(f)}})(),()=>u()})()}function n5(e){var f,p,d;const{scheme:t,statement:n,...r}=((f=e.match(r5))==null?void 0:f.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:c,requestId:a,...l}=((p=e.match(o5))==null?void 0:p.groups)??{},u=(d=e.split("Resources:")[1])==null?void 0:d.split(`
91
- - `).slice(1);return{...r,...l,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...i?{issuedAt:new Date(i)}:{},...c?{notBefore:new Date(c)}:{},...a?{requestId:a}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const r5=/^(?:(?<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)?/,o5=/(?: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 s5(e){const{address:t,domain:n,message:r,nonce:o,scheme:s,time:i=new Date}=e;if(n&&r.domain!==n||o&&r.nonce!==o||s&&r.scheme!==s||r.expirationTime&&i>=r.expirationTime||r.notBefore&&i<r.notBefore)return!1;try{if(!r.address||!at(r.address,{strict:!1})||t&&!go(r.address,t))return!1}catch{return!1}return!0}async function i5(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:i,signature:c,time:a=new Date,...l}=t,u=n5(o);if(!u.address||!s5({address:n,domain:r,message:u,nonce:s,scheme:i,time:a}))return!1;const p=bd(o);return Cs(e,{address:u.address,hash:p,signature:c,...l})}async function a5(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var c,a,l;const o=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,Q(r)]:[t]},{retryCount:0}),i=(((l=(a=(c=e.chain)==null?void 0:c.formatters)==null?void 0:a.transactionReceipt)==null?void 0:l.format)||td)(o);if(i.status==="reverted"&&n)throw new vg({receipt:i});return i}function c5(e){return{call:t=>So(e,t),createAccessList:t=>ud(e,t),createBlockFilter:()=>Av(e),createContractEventFilter:t=>Mu(e,t),createEventFilter:t=>fd(e,t),createPendingTransactionFilter:()=>dd(e),estimateContractGas:t=>sy(e,t),estimateGas:t=>ra(e,t),getBalance:t=>$v(e,t),getBlobBaseFee:()=>Cv(e),getBlock:t=>At(e,t),getBlockNumber:t=>To(e,t),getBlockTransactionCount:t=>Nv(e,t),getBytecode:t=>Ia(e,t),getChainId:()=>ta(e),getCode:t=>Ia(e,t),getContractEvents:t=>vf(e,t),getEip712Domain:t=>Iv(e,t),getEnsAddress:t=>uv(e,t),getEnsAvatar:t=>Sv(e,t),getEnsName:t=>Pv(e,t),getEnsResolver:t=>Tv(e,t),getEnsText:t=>ld(e,t),getFeeHistory:t=>Mv(e,t),estimateFeesPerGas:t=>zg(e,t),getFilterChanges:t=>vs(e,t),getFilterLogs:t=>Lv(e,t),getGasPrice:()=>Qi(e),getLogs:t=>sa(e,t),getProof:t=>C6(e,t),estimateMaxPriorityFeePerGas:t=>_g(e,t),fillTransaction:t=>mf(e,t),getStorageAt:t=>N6(e,t),getTransaction:t=>tc(e,t),getTransactionConfirmations:t=>O6(e,t),getTransactionCount:t=>af(e,t),getTransactionReceipt:t=>Ts(e,t),multicall:t=>I6(e,t),prepareTransactionRequest:t=>gf(e,t),readContract:t=>Nt(e,t),sendRawTransaction:t=>nv(e,t),sendRawTransactionSync:t=>a5(e,t),simulate:t=>nc(e,t),simulateBlocks:t=>nc(e,t),simulateCalls:t=>z6(e,t),simulateContract:t=>Zy(e,t),verifyHash:t=>Cs(e,t),verifyMessage:t=>Y6(e,t),verifySiweMessage:t=>i5(e,t),verifyTypedData:t=>X6(e,t),uninstallFilter:t=>ws(e,t),waitForTransactionReceipt:t=>Q6(e,t),watchBlocks:t=>J6(e,t),watchBlockNumber:t=>i0(e,t),watchContractEvent:t=>tv(e,t),watchEvent:t=>e5(e,t),watchPendingTransactions:t=>t5(e,t)}}function l5(e){const{key:t="public",name:n="Public Client"}=e;return ov({...e,key:t,name:n,type:"publicClient"}).extend(c5)}function u5({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:i,type:c},a){const l=nd();return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:i,type:c},request:Rv(r,{methods:t,retryCount:o,retryDelay:s,uid:l}),value:a}}class f5 extends V{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 d5(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:i,name:c="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:l,retryDelay:u,raw:f}=t;return({chain:p,retryCount:d,timeout:h})=>{const{batchSize:m=1e3,wait:v=0}=typeof n=="object"?n:{},T=t.retryCount??d,E=h??t.timeout??1e4,S=e||(p==null?void 0:p.rpcUrls.default.http[0]);if(!S)throw new f5;const N=Kv(S,{fetchFn:r,fetchOptions:o,onRequest:a,onResponse:l,timeout:E});return u5({key:s,methods:i,name:c,async request({method:M,params:B}){const F={method:M,params:B},{schedule:b}=Qf({id:S,wait:v,shouldSplitBatch(C){return C.length>m},fn:C=>N.request({body:C}),sort:(C,O)=>C.id-O.id}),g=async C=>n?b(C):[await N.request({body:C})],[{error:w,result:$}]=await g(F);if(f)return{error:w,result:$};if(w)throw new _i({body:F,error:w,url:S});return $},retryCount:T,retryDelay:u,timeout:E,type:"http"},{fetchOptions:o,url:S})}}const p5=Gv({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,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}}});function h5({client:e,tokenAddress:t,holder:n,decimals:r,fallbackFormatted:o="0",pollingInterval:s=12e3}){const[i,c]=x.useState(null),[a,l]=x.useState(o);return x.useEffect(()=>{let u,f;const p=async()=>{try{const d=await e.readContract({address:t,abi:yr,functionName:"balanceOf",args:[n]});c(d),l(Fi(d,r))}catch{l(o)}};p();try{u=e.watchContractEvent({address:t,abi:yr,eventName:"Transfer",args:{to:n},onLogs:()=>{p()},poll:!0,pollingInterval:s}),f=e.watchContractEvent({address:t,abi:yr,eventName:"Transfer",args:{from:n},onLogs:()=>{p()},poll:!0,pollingInterval:s})}catch{}return()=>{u==null||u(),f==null||f()}},[e,t,n,r,o,s]),{value:i,formatted:a}}const m5=()=>({openDeposit:x.useCallback(t=>{},[])}),b5=()=>({openWithdraw:x.useCallback(t=>{},[])}),xn="MPC",sc="EVM",g5="spot",a0="perpetual";/**
77
+ `,o+=Xu(r.state)),r.stateDiff&&(o+=` stateDiff:
78
+ `,o+=Xu(r.stateDiff)),o},` State Override:
79
+ `).slice(0,-1)}function Jr(e){const t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
80
+ `)}class Pg extends V{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Jr(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 Tg extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var h;const p=Jr({chain:o&&`${o==null?void 0:o.name} (id: ${o==null?void 0:o.id})`,from:n==null?void 0:n.address,to:f,value:typeof d<"u"&&`${Yi(d)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ue(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ue(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ue(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Qu extends V{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){let i="Transaction";r&&s!==void 0&&(i=`Transaction at block time "${r}" at index "${s}"`),t&&s!==void 0&&(i=`Transaction at block hash "${t}" at index "${s}"`),n&&s!==void 0&&(i=`Transaction at block number "${n}" at index "${s}"`),o&&(i=`Transaction with hash "${o}"`),super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}}class Ju extends V{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 $g extends V{constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class Ag extends V{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const Ng=e=>e,eo=e=>e;class ef extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,stateOverride:p}){var S;const h=n?tt(n):void 0;let b=Jr({from:h==null?void 0:h.address,to:f,value:typeof d<"u"&&`${Yi(d)} ${((S=o==null?void 0:o.nativeCurrency)==null?void 0:S.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ue(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ue(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ue(l)} gwei`,nonce:u});p&&(b+=`
81
+ ${Sg(p)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",b].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class tf extends V{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:s,functionName:i,sender:c}){const a=Rn({abi:n,args:r,name:i}),l=a?Yu({abiItem:a,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=a?St(a,{includeName:!0}):void 0,f=Jr({address:o&&Ng(o),function:u,args:l&&l!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:c});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:s,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=o,this.functionName=i,this.sender=c}}class Xi extends V{constructor({abi:t,data:n,functionName:r,message:o}){let s,i,c,a;if(n&&n!=="0x")try{i=Ku({abi:t,data:n});const{abiItem:u,errorName:f,args:d}=i;if(f==="Error")a=d[0];else if(f==="Panic"){const[p]=d;a=sg[p]}else{const p=u?St(u,{includeName:!0}):void 0,h=u&&d?Yu({abiItem:u,args:d,includeFunctionName:!1,includeName:!1}):void 0;c=[p?`Error: ${p}`:"",h&&h!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(u){s=u}else o&&(a=o);let l;s instanceof mu&&(l=s.signature,c=[`Unable to decode signature "${l}" 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://4byte.sourcify.dev/?q=${l}.`]),super(a&&a!=="execution reverted"||l?[`The contract function "${r}" reverted with the following ${l?"signature":"reason"}:`,a||l].join(`
82
+ `):`The contract function "${r}" reverted.`,{cause:s,metaMessages:c,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=i,this.raw=n,this.reason=a,this.signature=l}}class Cg extends V{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 Og extends V{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 bs extends V{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}}class jn extends V{constructor({body:t,cause:n,details:r,headers:o,status:s,url:i}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${eo(i)}`,t&&`Request body: ${Ne(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=o,this.status=s,this.url=i}}class Qi extends V{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${eo(r)}`,`Request body: ${Ne(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}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=r}}class nf extends V{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${eo(n)}`,`Request body: ${Ne(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const Ig=-1;class We extends V{constructor(t,{code:n,docsPath:r,metaMessages:o,name:s,shortMessage:i}){super(i,{cause:t,docsPath:r,metaMessages:o||(t==null?void 0:t.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||t.name,this.code=t instanceof Qi?t.code:n??Ig}}class He extends We{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class to extends We{constructor(t){super(t,{code:to.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(to,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class no extends We{constructor(t){super(t,{code:no.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(no,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class ro extends We{constructor(t,{method:n}={}){super(t,{code:ro.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class oo extends We{constructor(t){super(t,{code:oo.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
83
+ `)})}}Object.defineProperty(oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class _n extends We{constructor(t){super(t,{code:_n.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(_n,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class yn extends We{constructor(t){super(t,{code:yn.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
84
+ `)})}}Object.defineProperty(yn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class so extends We{constructor(t){super(t,{code:so.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(so,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class io extends We{constructor(t){super(t,{code:io.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(io,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class ao extends We{constructor(t){super(t,{code:ao.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(ao,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class zn extends We{constructor(t,{method:n}={}){super(t,{code:zn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(zn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class hr extends We{constructor(t){super(t,{code:hr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(hr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class co extends We{constructor(t){super(t,{code:co.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(co,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class mr extends He{constructor(t){super(t,{code:mr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(mr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class lo extends He{constructor(t){super(t,{code:lo.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(lo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class uo extends He{constructor(t,{method:n}={}){super(t,{code:uo.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(uo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class fo extends He{constructor(t){super(t,{code:fo.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(fo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class po extends He{constructor(t){super(t,{code:po.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(po,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ho extends He{constructor(t){super(t,{code:ho.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class mo extends He{constructor(t){super(t,{code:mo.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(mo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class bo extends He{constructor(t){super(t,{code:bo.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(bo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class go extends He{constructor(t){super(t,{code:go.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(go,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class yo extends He{constructor(t){super(t,{code:yo.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class vo extends He{constructor(t){super(t,{code:vo.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(vo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class wo extends He{constructor(t){super(t,{code:wo.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(wo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class xo extends He{constructor(t){super(t,{code:xo.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(xo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Eo extends He{constructor(t){super(t,{code:Eo.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(Eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class Dg extends We{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Mg=3;function br(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const c=e instanceof bs?e:e instanceof V?e.walk(h=>"data"in h)||e.walk():{},{code:a,data:l,details:u,message:f,shortMessage:d}=c,p=e instanceof Vr?new Cg({functionName:s}):[Mg,_n.code].includes(a)&&(l||u||f||d)||a===yn.code&&u==="execution reverted"&&l?new Xi({abi:t,data:typeof l=="object"?l.data:l,functionName:s,message:c instanceof Qi?u:d??f}):e;return new tf(p,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}function kg(e){const t=De(`0x${e.substring(4)}`).substring(26);return hs(`0x${t}`)}async function Lg({hash:e,signature:t}){const n=Pt(e)?e:mn(e),{secp256k1:r}=await Promise.resolve().then(()=>b6);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:l,s:u,v:f,yParity:d}=t,p=Number(d??f),h=rf(p);return new r.Signature(Lt(l),Lt(u)).addRecoveryBit(h)}const i=Pt(t)?t:mn(t);if(ve(i)!==65)throw new Error("invalid signature length");const c=Yt(`0x${i.slice(130)}`),a=rf(c);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function rf(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 of({hash:e,signature:t}){return kg(await Lg({hash:e,signature:t}))}function Bg(e,t="hex"){const n=sf(e),r=qi(new Uint8Array(n.length));return n.encode(r),t==="hex"?Ae(r.bytes):r.bytes}function sf(e){return Array.isArray(e)?Fg(e.map(t=>sf(t))):Rg(e)}function Fg(e){const t=e.reduce((o,s)=>o+s.length,0),n=af(t);return{length:t<=55?1+t:1+n+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+n),n===1?o.pushUint8(t):n===2?o.pushUint16(t):n===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:s}of e)s(o)}}}function Rg(e){const t=typeof e=="string"?Bt(e):e,n=af(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+n),n===1?o.pushUint8(t.length):n===2?o.pushUint16(t.length):n===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function af(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 V("Length is too large.")}function jg(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=De(dr(["0x05",Bg([t?J(t):"0x",o,n?J(n):"0x"])]));return r==="bytes"?Bt(s):s}async function cf(e){const{authorization:t,signature:n}=e;return of({hash:jg(t),signature:n??t})}class _g extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var h;const p=Jr({from:n==null?void 0:n.address,to:f,value:typeof d<"u"&&`${Yi(d)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ue(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ue(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ue(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class gr extends V{constructor({cause:t,message:n}={}){var o;const r=(o=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:o.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(gr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(gr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class gs extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Ue(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(gs,"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 Ji extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Ue(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(Ji,"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 ea extends V{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(ea,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ta extends V{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(`
85
+ `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(ta,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class na extends V{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(na,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class ra extends V{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
86
+ `),{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(ra,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class oa extends V{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(oa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class sa extends V{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(sa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class ia extends V{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(ia,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class ys extends V{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Ue(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${Ue(r)} gwei`:""}).`].join(`
87
+ `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(ys,"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 So extends V{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function vs(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof V?e.walk(o=>(o==null?void 0:o.code)===gr.code):e;return r instanceof V?new gr({cause:e,message:r.details}):gr.nodeMessage.test(n)?new gr({cause:e,message:e.details}):gs.nodeMessage.test(n)?new gs({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Ji.nodeMessage.test(n)?new Ji({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):ea.nodeMessage.test(n)?new ea({cause:e,nonce:t==null?void 0:t.nonce}):ta.nodeMessage.test(n)?new ta({cause:e,nonce:t==null?void 0:t.nonce}):na.nodeMessage.test(n)?new na({cause:e,nonce:t==null?void 0:t.nonce}):ra.nodeMessage.test(n)?new ra({cause:e}):oa.nodeMessage.test(n)?new oa({cause:e,gas:t==null?void 0:t.gas}):sa.nodeMessage.test(n)?new sa({cause:e,gas:t==null?void 0:t.gas}):ia.nodeMessage.test(n)?new ia({cause:e}):ys.nodeMessage.test(n)?new ys({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new So({cause:e})}function zg(e,{docsPath:t,...n}){const r=(()=>{const o=vs(e,n);return o instanceof So?e:o})();return new _g(r,{docsPath:t,...n})}function ws(e,{format:t}){if(!t)return{};const n={};function r(s){const i=Object.keys(s);for(const c of i)c in e&&(n[c]=e[c]),s[c]&&typeof s[c]=="object"&&!Array.isArray(s[c])&&r(s[c])}const o=t(e||{});return r(o),n}const Ug={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Po(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Wg(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>Ae(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=J(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=J(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=J(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=J(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=J(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=J(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Ug[e.type]),typeof e.value<"u"&&(n.value=J(e.value)),n}function Wg(e){return e.map(t=>({address:t.address,r:t.r?J(BigInt(t.r)):t.r,s:t.s?J(BigInt(t.s)):t.s,chainId:J(t.chainId),nonce:J(t.nonce),...typeof t.yParity<"u"?{yParity:J(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:J(t.v)}:{}}))}function lf(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new xu({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new xu({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Hg(e){const{balance:t,nonce:n,state:r,stateDiff:o,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=J(t)),n!==void 0&&(i.nonce=J(n)),r!==void 0&&(i.state=lf(r)),o!==void 0){if(i.state)throw new Eg;i.stateDiff=lf(o)}return i}function aa(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ct(n,{strict:!1}))throw new bn({address:n});if(t[n])throw new xg({address:n});t[n]=Hg(r)}return t}const uf=2n**256n-1n;function yr(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?tt(t):void 0;if(s&&!ct(s.address))throw new bn({address:s.address});if(o&&!ct(o))throw new bn({address:o});if(n&&n>uf)throw new gs({maxFeePerGas:n});if(r&&n&&r>n)throw new ys({maxFeePerGas:n,maxPriorityFeePerGas:r})}class ff extends V{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class ca extends V{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Vg extends V{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Ue(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class df extends V{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 pf={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function la(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Yt(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?Yt(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?pf[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&&(n.authorizationList=Gg(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}function Gg(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 hf(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:la(r));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:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function At(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:o}={}){var l,u,f;const s=o??!1,i=n!==void 0?J(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,s]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[i||r,s]},{dedupe:!!i}),!c)throw new df({blockHash:t,blockNumber:n});return(((f=(u=(l=e.chain)==null?void 0:l.formatters)==null?void 0:u.block)==null?void 0:f.format)||hf)(c,"getBlock")}async function ua(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function qg(e,t){return mf(e,t)}async function mf(e,t){var s,i;const{block:n,chain:r=e.chain,request:o}=t||{};try{const c=((s=r==null?void 0:r.fees)==null?void 0:s.maxPriorityFeePerGas)??((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee);if(typeof c=="function"){const l=n||await X(e,At,"getBlock")({}),u=await c({block:l,client:e,request:o});if(u===null)throw new Error;return u}if(typeof c<"u")return c;const a=await e.request({method:"eth_maxPriorityFeePerGas"});return Lt(a)}catch{const[c,a]=await Promise.all([n?Promise.resolve(n):X(e,At,"getBlock")({}),X(e,ua,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new ca;const l=a-c.baseFeePerGas;return l<0n?0n:l}}async function Zg(e,t){return fa(e,t)}async function fa(e,t){var d,p;const{block:n,chain:r=e.chain,request:o,type:s="eip1559"}=t||{},i=await(async()=>{var h,b;return typeof((h=r==null?void 0:r.fees)==null?void 0:h.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:o}):((b=r==null?void 0:r.fees)==null?void 0:b.baseFeeMultiplier)??1.2})();if(i<1)throw new ff;const a=10**(((d=i.toString().split(".")[1])==null?void 0:d.length)??0),l=h=>h*BigInt(Math.ceil(i*a))/BigInt(a),u=n||await X(e,At,"getBlock")({});if(typeof((p=r==null?void 0:r.fees)==null?void 0:p.estimateFeesPerGas)=="function"){const h=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:l,request:o,type:s});if(h!==null)return h}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new ca;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await mf(e,{block:u,chain:r,request:o}),b=l(u.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??b+h,maxPriorityFeePerGas:h}}return{gasPrice:(o==null?void 0:o.gasPrice)??l(await X(e,ua,"getGasPrice")({}))}}async function bf(e,{address:t,blockTag:n="latest",blockNumber:r}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?J(r):n]},{dedupe:!!r});return Yt(o)}function gf(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(s=>Bt(s)):e.blobs,o=[];for(const s of r)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?o:o.map(s=>Ae(s))}function yf(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>Bt(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>Bt(i)):e.commitments,s=[];for(let i=0;i<r.length;i++){const c=r[i],a=o[i];s.push(Uint8Array.from(t.computeBlobKzgProof(c,a)))}return n==="bytes"?s:s.map(i=>Ae(i))}function Kg(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),c=Number(n&s),a=r?4:0,l=r?0:4;e.setUint32(t+a,i,r),e.setUint32(t+l,c,r)}function Yg(e,t,n){return e&t^~e&n}function Xg(e,t,n){return e&t^e&n^t&n}class Qg extends ji{constructor(t,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=Ri(this.buffer)}update(t){ur(this),t=fs(t),Bn(t);const{view:n,buffer:r,blockLen:o}=this,s=t.length;for(let i=0;i<s;){const c=Math.min(o-this.pos,s-i);if(c===o){const a=Ri(t);for(;o<=s-i;i+=o)this.process(a,i);continue}r.set(t.subarray(i,i+c),this.pos),this.pos+=c,i+=c,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ur(this),Tu(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,fr(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let f=i;f<o;f++)n[f]=0;Kg(r,o-8,BigInt(this.length*8),s),this.process(r,0);const c=Ri(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=a/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)c.setUint32(4*f,u[f],s)}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:o,finished:s,destroyed:i,pos:c}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=c,o%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const vn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Jg=Uint32Array.from([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]),wn=new Uint32Array(64);class ey extends Qg{constructor(t=32){super(64,t,8,!1),this.A=vn[0]|0,this.B=vn[1]|0,this.C=vn[2]|0,this.D=vn[3]|0,this.E=vn[4]|0,this.F=vn[5]|0,this.G=vn[6]|0,this.H=vn[7]|0}get(){const{A:t,B:n,C:r,D:o,E:s,F:i,G:c,H:a}=this;return[t,n,r,o,s,i,c,a]}set(t,n,r,o,s,i,c,a){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=c|0,this.H=a|0}process(t,n){for(let f=0;f<16;f++,n+=4)wn[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const d=wn[f-15],p=wn[f-2],h=Ft(d,7)^Ft(d,18)^d>>>3,b=Ft(p,17)^Ft(p,19)^p>>>10;wn[f]=b+wn[f-7]+h+wn[f-16]|0}let{A:r,B:o,C:s,D:i,E:c,F:a,G:l,H:u}=this;for(let f=0;f<64;f++){const d=Ft(c,6)^Ft(c,11)^Ft(c,25),p=u+d+Yg(c,a,l)+Jg[f]+wn[f]|0,b=(Ft(r,2)^Ft(r,13)^Ft(r,22))+Xg(r,o,s)|0;u=l,l=a,a=c,c=i+p|0,i=s,s=o,o=r,r=p+b|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,c=c+this.E|0,a=a+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,o,s,i,c,a,l,u)}roundClean(){fr(wn)}destroy(){this.set(0,0,0,0,0,0,0,0),fr(this.buffer)}}const vf=Au(()=>new ey),ty=vf;function ny(e,t){return ty(Pt(e,{strict:!1})?cr(e):e)}function ry(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=ny(t);return o.set([n],0),r==="bytes"?o:Ae(o)}function oy(e){const{commitments:t,version:n}=e,r=e.to,o=[];for(const s of t)o.push(ry({commitment:s,to:r,version:n}));return o}const wf=6,xf=32,da=4096,Ef=xf*da,Sf=Ef*wf-1-1*da*wf;class sy extends V{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class iy extends V{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function ay(e){const t=typeof e.data=="string"?Bt(e.data):e.data,n=ve(t);if(!n)throw new iy;if(n>Sf)throw new sy({maxSize:Sf,size:n});const r=[];let o=!0,s=0;for(;o;){const i=qi(new Uint8Array(Ef));let c=0;for(;c<da;){const a=t.slice(s,s+(xf-1));if(i.pushByte(0),i.pushBytes(a),a.length<31){i.pushByte(128),o=!1;break}c++,s+=31}r.push(i)}return r.map(i=>Ae(i.bytes))}function cy(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??ay({data:t}),s=e.commitments??gf({blobs:o,kzg:n,to:r}),i=e.proofs??yf({blobs:o,commitments:s,kzg:n,to:r}),c=[];for(let a=0;a<o.length;a++)c.push({blob:o[a],commitment:s[a],proof:i[a]});return c}function ly(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 Pg({transaction:e})}function uy(e,{docsPath:t,...n}){const r=(()=>{const o=vs(e,n);return o instanceof So?e:o})();return new Tg(r,{docsPath:t,...n})}async function pa(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Yt(t)}async function Pf(e,t){var m,g,v,A,N;const{account:n=e.account,accessList:r,authorizationList:o,chain:s=e.chain,blobVersionedHashes:i,blobs:c,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,nonceManager:b,to:S,type:P,value:x,...w}=t,$=await(async()=>{if(!n||!b||typeof h<"u")return h;const O=tt(n),D=s?s.id:await X(e,pa,"getChainId")({});return await b.consume({address:O.address,chainId:D,client:e})})();yr(t);const k=(g=(m=s==null?void 0:s.formatters)==null?void 0:m.transactionRequest)==null?void 0:g.format,F=(k||Po)({...ws(w,{format:k}),account:n?tt(n):void 0,accessList:r,authorizationList:o,blobs:c,blobVersionedHashes:i,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:$,to:S,type:P,value:x},"fillTransaction");try{const O=await e.request({method:"eth_fillTransaction",params:[F]}),y=(((A=(v=s==null?void 0:s.formatters)==null?void 0:v.transaction)==null?void 0:A.format)||la)(O.tx);delete y.blockHash,delete y.blockNumber,delete y.r,delete y.s,delete y.transactionIndex,delete y.v,delete y.yParity,y.data=y.input,y.gas&&(y.gas=t.gas??y.gas),y.gasPrice&&(y.gasPrice=t.gasPrice??y.gasPrice),y.maxFeePerBlobGas&&(y.maxFeePerBlobGas=t.maxFeePerBlobGas??y.maxFeePerBlobGas),y.maxFeePerGas&&(y.maxFeePerGas=t.maxFeePerGas??y.maxFeePerGas),y.maxPriorityFeePerGas&&(y.maxPriorityFeePerGas=t.maxPriorityFeePerGas??y.maxPriorityFeePerGas),y.nonce&&(y.nonce=t.nonce??y.nonce);const C=await(async()=>{var j,z;if(typeof((j=s==null?void 0:s.fees)==null?void 0:j.baseFeeMultiplier)=="function"){const _=await X(e,At,"getBlock")({});return s.fees.baseFeeMultiplier({block:_,client:e,request:t})}return((z=s==null?void 0:s.fees)==null?void 0:z.baseFeeMultiplier)??1.2})();if(C<1)throw new ff;const T=10**(((N=C.toString().split(".")[1])==null?void 0:N.length)??0),L=j=>j*BigInt(Math.ceil(C*T))/BigInt(T);return y.maxFeePerGas&&!t.maxFeePerGas&&(y.maxFeePerGas=L(y.maxFeePerGas)),y.gasPrice&&!t.gasPrice&&(y.gasPrice=L(y.gasPrice)),{raw:O.raw,transaction:{from:F.from,...y}}}catch(O){throw uy(O,{...t,chain:e.chain})}}const fy=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Tf=new Map,ha=new ps(128);async function $f(e,t){var $,k,B;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=fy);const{account:r,chain:o=e.chain,nonceManager:s,parameters:i}=n,c=(()=>{if(typeof(o==null?void 0:o.prepareTransactionRequest)=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o==null?void 0:o.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})();let a;async function l(){return a||(typeof n.chainId<"u"?n.chainId:o?o.id:(a=await X(e,pa,"getChainId")({}),a))}const u=r&&tt(r);let f=n.nonce;if(i.includes("nonce")&&typeof f>"u"&&u&&s){const F=await l();f=await s.consume({address:u.address,chainId:F,client:e})}c!=null&&c.fn&&(($=c.runAt)!=null&&$.includes("beforeFillTransaction"))&&(n=await c.fn({...n,chain:o},{phase:"beforeFillTransaction"}),f??(f=n.nonce));const p=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||ha.get(e.uid)===!1||!["fees","gas"].some(m=>i.includes(m))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof f!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await X(e,Pf,"fillTransaction")({...n,nonce:f}).then(F=>{const{chainId:m,from:g,gas:v,gasPrice:A,nonce:N,maxFeePerBlobGas:O,maxFeePerGas:D,maxPriorityFeePerGas:y,type:C,...I}=F.transaction;return ha.set(e.uid,!0),{...n,...g?{from:g}:{},...C&&!n.type?{type:C}:{},...typeof m<"u"?{chainId:m}:{},...typeof v<"u"?{gas:v}:{},...typeof A<"u"?{gasPrice:A}:{},...typeof N<"u"?{nonce:N}:{},...typeof O<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:O}:{},...typeof D<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:D}:{},...typeof y<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:y}:{},..."nonceKey"in I&&typeof I.nonceKey<"u"?{nonceKey:I.nonceKey}:{}}}).catch(F=>{var v;const m=F;return m.name!=="TransactionExecutionError"||((v=m.walk)==null?void 0:v.call(m,A=>{const N=A;return N.name==="MethodNotFoundRpcError"||N.name==="MethodNotSupportedRpcError"}))&&ha.set(e.uid,!1),n}):n;f??(f=p.nonce),n={...p,...u?{from:u==null?void 0:u.address}:{},...f?{nonce:f}:{}};const{blobs:h,gas:b,kzg:S,type:P}=n;c!=null&&c.fn&&((k=c.runAt)!=null&&k.includes("beforeFillParameters"))&&(n=await c.fn({...n,chain:o},{phase:"beforeFillParameters"}));let x;async function w(){return x||(x=await X(e,At,"getBlock")({blockTag:"latest"}),x)}if(i.includes("nonce")&&typeof f>"u"&&u&&!s&&(n.nonce=await X(e,bf,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&h&&S){const F=gf({blobs:h,kzg:S});if(i.includes("blobVersionedHashes")){const m=oy({commitments:F,to:"hex"});n.blobVersionedHashes=m}if(i.includes("sidecars")){const m=yf({blobs:h,commitments:F,kzg:S}),g=cy({blobs:h,commitments:F,proofs:m,to:"hex"});n.sidecars=g}}if(i.includes("chainId")&&(n.chainId=await l()),(i.includes("fees")||i.includes("type"))&&typeof P>"u")try{n.type=ly(n)}catch{let F=Tf.get(e.uid);if(typeof F>"u"){const m=await w();F=typeof(m==null?void 0:m.baseFeePerGas)=="bigint",Tf.set(e.uid,F)}n.type=F?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const F=await w(),{maxFeePerGas:m,maxPriorityFeePerGas:g}=await fa(e,{block:F,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<g)throw new Vg({maxPriorityFeePerGas:g});n.maxPriorityFeePerGas=g,n.maxFeePerGas=m}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new ca;if(typeof n.gasPrice>"u"){const F=await w(),{gasPrice:m}=await fa(e,{block:F,chain:o,request:n,type:"legacy"});n.gasPrice=m}}return i.includes("gas")&&typeof b>"u"&&(n.gas=await X(e,ma,"estimateGas")({...n,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),c!=null&&c.fn&&((B=c.runAt)!=null&&B.includes("afterFillParameters"))&&(n=await c.fn({...n,chain:o},{phase:"afterFillParameters"})),yr(n),delete n.parameters,n}async function ma(e,t){var i,c,a;const{account:n=e.account,prepare:r=!0}=t,o=n?tt(n):void 0,s=(()=>{if(Array.isArray(r))return r;if((o==null?void 0:o.type)!=="local")return["blobVersionedHashes"]})();try{const l=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await cf({authorization:t.authorizationList[0]}).catch(()=>{throw new V("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:f,blobs:d,blobVersionedHashes:p,blockNumber:h,blockTag:b,data:S,gas:P,gasPrice:x,maxFeePerBlobGas:w,maxFeePerGas:$,maxPriorityFeePerGas:k,nonce:B,value:F,stateOverride:m,...g}=r?await $f(e,{...t,parameters:s,to:l}):t;if(P&&t.gas!==P)return P;const A=(typeof h=="bigint"?J(h):void 0)||b,N=aa(m);yr(t);const O=(a=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionRequest)==null?void 0:a.format,y=(O||Po)({...ws(g,{format:O}),account:o,accessList:u,authorizationList:f,blobs:d,blobVersionedHashes:p,data:S,gasPrice:x,maxFeePerBlobGas:w,maxFeePerGas:$,maxPriorityFeePerGas:k,nonce:B,to:l,value:F},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:N?[y,A??e.experimental_blockTag??"latest",N]:A?[y,A]:[y]}))}catch(l){throw zg(l,{...t,account:o,chain:e.chain})}}async function dy(e,t){var l;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(l=e.dataSuffix)==null?void 0:l.value,...c}=t,a=lt({abi:n,args:o,functionName:s});try{return await X(e,ma,"estimateGas")({data:`${a}${i?i.replace("0x",""):""}`,to:r,...c})}catch(u){const f=c.account?tt(c.account):void 0;throw br(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:f==null?void 0:f.address})}}function To(e,t){if(!ct(e,{strict:!1}))throw new bn({address:e});if(!ct(t,{strict:!1}))throw new bn({address:t});return e.toLowerCase()===t.toLowerCase()}function Rt(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,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}:{}}}const Af="/docs/contract/decodeEventLog";function xs(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...c]=o;if(!i)throw new Jb({docsPath:Af});const a=t.find(P=>P.type==="event"&&i===ds(St(P)));if(!(a&&"name"in a)||a.type!=="event")throw new e1(i,{docsPath:Af});const{name:l,inputs:u}=a,f=u==null?void 0:u.some(P=>!("name"in P&&P.name)),d=f?[]:{},p=u.map((P,x)=>[P,x]).filter(([P])=>"indexed"in P&&P.indexed),h=[];for(let P=0;P<p.length;P++){const[x,w]=p[P],$=c[P];if(!$){if(s)throw new Bi({abiItem:a,param:x});h.push([x,w]);continue}d[f?w:x.name||w]=py({param:x,value:$})}const b=u.filter(P=>!("indexed"in P&&P.indexed)),S=s?b:[...h.map(([P])=>P),...b];if(S.length>0){if(n&&n!=="0x")try{const P=Xr(S,n);if(P){let x=0;if(!s)for(const[w,$]of h)d[f?$:w.name||$]=P[x++];if(f)for(let w=0;w<u.length;w++)d[w]===void 0&&x<P.length&&(d[w]=P[x++]);else for(let w=0;w<b.length;w++)d[b[w].name]=P[x++]}}catch(P){if(s)throw P instanceof pu||P instanceof qu?new ls({abiItem:a,data:n,params:S,size:ve(n)}):P}else if(s)throw new ls({abiItem:a,data:"0x",params:S,size:0})}return{eventName:l,args:Object.values(d).length>0?d:void 0}}function py({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Xr([e],t)||[])[0]}function ba(e){const{abi:t,args:n,logs:r,strict:o=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),i=t.filter(c=>c.type==="event").map(c=>({abi:c,selector:ds(c)}));return r.map(c=>{var d;const a=typeof c.blockNumber=="string"?Rt(c):c,l=i.filter(p=>a.topics[0]===p.selector);if(l.length===0)return null;let u,f;for(const p of l)try{u=xs({...a,abi:[p.abi],strict:!0}),f=p;break}catch{}if(!u&&!o){f=l[0];try{u=xs({data:a.data,topics:a.topics,abi:[f.abi],strict:!1})}catch{const p=(d=f.abi.inputs)==null?void 0:d.some(h=>!("name"in h&&h.name));return{...a,args:p?[]:{},eventName:f.abi.name}}}return!u||!f||s&&!s.includes(u.eventName)||!hy({args:u.args,inputs:f.abi.inputs,matchArgs:n})?null:{...u,...a}}).filter(Boolean)}function hy(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function o(s,i,c){try{return s.type==="address"?To(i,c):s.type==="string"||s.type==="bytes"?De(cr(i))===c:i===c}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((s,i)=>{if(s==null)return!0;const c=n[i];return c?(Array.isArray(s)?s:[s]).some(l=>o(c,l,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,i])=>{if(i==null)return!0;const c=n.find(l=>l.name===s);return c?(Array.isArray(i)?i:[i]).some(l=>o(c,l,t[s])):!1}):!1}async function ga(e,{address:t,blockHash:n,fromBlock:r,toBlock:o,event:s,events:i,args:c,strict:a}={}){const l=a??!1,u=i??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(b=>Yr({abi:[b],eventName:b.name,args:i?void 0:c}))],s&&(f=f[0]));let d;n?d=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):d=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?J(r):r,toBlock:typeof o=="bigint"?J(o):o}]});const p=d.map(h=>Rt(h));return u?ba({abi:u,args:c,logs:p,strict:l}):p}async function Nf(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:c,toBlock:a,strict:l}=t,u=i?Rn({abi:n,name:i}):void 0,f=u?void 0:n.filter(d=>d.type==="event");return X(e,ga,"getLogs")({address:r,args:o,blockHash:s,event:u,events:f,fromBlock:c,toBlock:a,strict:l})}const ya="/docs/contract/decodeFunctionResult";function xn(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const c=Rn({abi:t,args:n,name:r});if(!c)throw new ir(r,{docsPath:ya});s=c}if(s.type!=="function")throw new ir(void 0,{docsPath:ya});if(!s.outputs)throw new gu(s.name,{docsPath:ya});const i=Xr(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const va=BigInt(0),wa=BigInt(1);function $o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function xa(e){if(!$o(e))throw new Error("Uint8Array expected")}function Ao(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Es(e){const t=e.toString(16);return t.length&1?"0"+t:t}function Cf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?va:BigInt("0x"+e)}const Of=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",my=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function No(e){if(xa(e),Of)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=my[e[n]];return t}const en={_0:48,_9:57,A:65,F:70,a:97,f:102};function If(e){if(e>=en._0&&e<=en._9)return e-en._0;if(e>=en.A&&e<=en.F)return e-(en.A-10);if(e>=en.a&&e<=en.f)return e-(en.a-10)}function Ss(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Of)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 o=0,s=0;o<n;o++,s+=2){const i=If(e.charCodeAt(s)),c=If(e.charCodeAt(s+1));if(i===void 0||c===void 0){const a=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+s)}r[o]=i*16+c}return r}function Un(e){return Cf(No(e))}function Df(e){return xa(e),Cf(No(Uint8Array.from(e).reverse()))}function Co(e,t){return Ss(e.toString(16).padStart(t*2,"0"))}function Mf(e,t){return Co(e,t).reverse()}function ut(e,t,n){let r;if(typeof t=="string")try{r=Ss(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if($o(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}function Ps(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];xa(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}const Ea=e=>typeof e=="bigint"&&va<=e;function Sa(e,t,n){return Ea(e)&&Ea(t)&&Ea(n)&&t<=e&&e<n}function vr(e,t,n,r){if(!Sa(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function by(e){let t;for(t=0;e>va;e>>=wa,t+=1);return t}const Ts=e=>(wa<<BigInt(e))-wa,Pa=e=>new Uint8Array(e),kf=e=>Uint8Array.from(e);function gy(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=Pa(e),o=Pa(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},c=(...f)=>n(o,r,...f),a=(f=Pa(0))=>{o=c(kf([0]),f),r=c(),f.length!==0&&(o=c(kf([1]),f),r=c())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f<t;){r=c();const p=r.slice();d.push(p),f+=r.length}return Ps(...d)};return(f,d)=>{i(),a(f);let p;for(;!(p=d(l()));)a();return i(),p}}const yy={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"||$o(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 $s(e,t,n={}){const r=(o,s,i)=>{const c=yy[s];if(typeof c!="function")throw new Error("invalid validator function");const a=e[o];if(!(i&&a===void 0)&&!c(a,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+a)};for(const[o,s]of Object.entries(t))r(o,s,!1);for(const[o,s]of Object.entries(n))r(o,s,!0);return e}function Lf(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e(n,...r);return t.set(n,s),s}}const vy="0.1.1";function wy(){return vy}class te extends Error{static setStaticOptions(t){te.prototype.docsOrigin=t.docsOrigin,te.prototype.showVersion=t.showVersion,te.prototype.version=t.version}constructor(t,n={}){const r=(()=>{var u;if(n.cause instanceof te){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(u=n.cause)!=null&&u.message?n.cause.message:n.details})(),o=n.cause instanceof te&&n.cause.docsPath||n.docsPath,s=n.docsOrigin??te.prototype.docsOrigin,i=`${s}${o??""}`,c=!!(n.version??te.prototype.showVersion),a=n.version??te.prototype.version,l=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o||c?["",r?`Details: ${r}`:void 0,o?`See: ${i}`:void 0,c?`Version: ${a}`:void 0]:[]].filter(u=>typeof u=="string").join(`
88
+ `);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,"docsOrigin",{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,"showVersion",{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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=i,this.docsOrigin=s,this.docsPath=o,this.shortMessage=t,this.showVersion=c,this.version=a}walk(t){return Bf(this,t)}}Object.defineProperty(te,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${wy()}`}}),te.setStaticOptions(te.defaultStaticOptions);function Bf(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Bf(e.cause,t):t?null:e}function Oo(e,t){if(wr(e)>t)throw new Fy({givenSize:wr(e),maxSize:t})}const tn={zero:48,nine:57,A:65,F:70,a:97,f:102};function Ff(e){if(e>=tn.zero&&e<=tn.nine)return e-tn.zero;if(e>=tn.A&&e<=tn.F)return e-(tn.A-10);if(e>=tn.a&&e<=tn.f)return e-(tn.a-10)}function xy(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Ry({size:e.length,targetSize:r,type:"Bytes"});const o=new Uint8Array(r);for(let s=0;s<r;s++){const i=n==="right";o[i?s:r-s-1]=e[i?s:e.length-s-1]}return o}function Rf(e,t={}){const{dir:n="left"}=t;let r=e,o=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)o++;return r=n==="left"?r.slice(o):r.slice(0,r.length-o),r}function As(e,t){if(nt(e)>t)throw new Hy({givenSize:nt(e),maxSize:t})}function Ey(e,t){if(typeof t=="number"&&t>0&&t>nt(e)-1)throw new Kf({offset:t,position:"start",size:nt(e)})}function Sy(e,t,n){if(typeof t=="number"&&typeof n=="number"&&nt(e)!==n-t)throw new Kf({offset:n,position:"end",size:nt(e)})}function jf(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const o=e.replace("0x","");if(o.length>r*2)throw new Vy({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const Py="#__bigint";function _f(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+Py:o,n)}const Ty=new TextDecoder,$y=new TextEncoder;function Ay(e){return e instanceof Uint8Array?e:typeof e=="string"?zf(e):Ny(e)}function Ny(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function zf(e,t={}){const{size:n}=t;let r=e;n&&(As(e,n),r=Hn(e,n));let o=r.slice(2);o.length%2&&(o=`0${o}`);const s=o.length/2,i=new Uint8Array(s);for(let c=0,a=0;c<s;c++){const l=Ff(o.charCodeAt(a++)),u=Ff(o.charCodeAt(a++));if(l===void 0||u===void 0)throw new te(`Invalid byte sequence ("${o[a-2]}${o[a-1]}" in "${o}").`);i[c]=l<<4|u}return i}function Cy(e,t={}){const{size:n}=t,r=$y.encode(e);return typeof n=="number"?(Oo(r,n),Oy(r,n)):r}function Oy(e,t){return xy(e,{dir:"right",size:t})}function wr(e){return e.length}function Iy(e,t,n,r={}){const{strict:o}=r;return e.slice(t,n)}function Dy(e,t={}){const{size:n}=t;typeof n<"u"&&Oo(e,n);const r=Ct(e,t);return Hf(r,t)}function My(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Oo(r,n),r=Uf(r)),r.length>1||r[0]>1)throw new By(r);return!!r[0]}function nn(e,t={}){const{size:n}=t;typeof n<"u"&&Oo(e,n);const r=Ct(e,t);return Vf(r,t)}function ky(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Oo(r,n),r=Ly(r)),Ty.decode(r)}function Uf(e){return Rf(e,{dir:"left"})}function Ly(e){return Rf(e,{dir:"right"})}class By extends te{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let Fy=class extends te{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"})}},Ry=class extends te{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 jy=new TextEncoder,_y=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function zy(e,t={}){const{strict:n=!1}=t;if(!e)throw new qf(e);if(typeof e!="string")throw new qf(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new Zf(e);if(!e.startsWith("0x"))throw new Zf(e)}function Nt(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Uy(e){return e instanceof Uint8Array?Ct(e):Array.isArray(e)?Ct(new Uint8Array(e)):e}function Wf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(As(n,t.size),Wn(n,t.size)):n}function Ct(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=_y[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(As(r,t.size),Hn(r,t.size)):r}function Be(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const l=typeof e=="bigint"?"n":"";throw new Gf({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:n,size:r,value:`${e}${l}`})}const a=`0x${(n&&o<0?BigInt.asUintN(r*8,BigInt(o)):o).toString(16)}`;return r?Wn(a,r):a}function Ta(e,t={}){return Ct(jy.encode(e),t)}function Wn(e,t){return jf(e,{dir:"left",size:t})}function Hn(e,t){return jf(e,{dir:"right",size:t})}function jt(e,t,n,r={}){const{strict:o}=r;Ey(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&Sy(s,t,n),s}function nt(e){return Math.ceil((e.length-2)/2)}function Hf(e,t={}){const{signed:n}=t;t.size&&As(e,t.size);const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n)-1n,i=s>>1n;return r<=i?r:r-s-1n}function Vf(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:Hf(e,t))}function Wy(e,t={}){const{strict:n=!1}=t;try{return zy(e,{strict:n}),!0}catch{return!1}}class Gf extends te{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*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 qf extends te{constructor(t){super(`Value \`${typeof t=="object"?_f(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 Zf extends te{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 Hy extends te{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 Kf extends te{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 Vy extends te{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 Gy(e){return{address:e.address,amount:Be(e.amount),index:Be(e.index),validatorIndex:Be(e.validatorIndex)}}function Yf(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Be(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Be(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Be(e.gasLimit)},...typeof e.number=="bigint"&&{number:Be(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Be(e.prevRandao)},...typeof e.time=="bigint"&&{time:Be(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Gy)}}}const xr=[{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"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],$a=[{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"}]}],Xf=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],Qf=[...Xf,{name:"resolveWithGateways",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"}]}],qy=[...Xf,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],Jf=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ed=[{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"}]}],td=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],nd=[{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"}],Er=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],Zy="0x82ad56cb",rd="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Ky="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",Yy="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Aa="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class Na extends V{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"})}}class od extends V{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const Ca="/docs/contract/encodeDeployData";function Oa(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new Zb({docsPath:Ca});if(!("inputs"in o))throw new du({docsPath:Ca});if(!o.inputs||o.inputs.length===0)throw new du({docsPath:Ca});const s=gn(o.inputs,n);return dr([r,s])}function Sr({blockNumber:e,chain:t,contract:n}){var o;const r=(o=t==null?void 0:t.contracts)==null?void 0:o[n];if(!r)throw new Na({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Na({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function sd(e,{docsPath:t,...n}){const r=(()=>{const o=vs(e,n);return o instanceof So?e:o})();return new ef(r,{docsPath:t,...n})}function id(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const Ia=new Map;function ad({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const u=a();i();const f=u.map(({args:d})=>d);f.length!==0&&e(f).then(d=>{o&&Array.isArray(d)&&d.sort(o);for(let p=0;p<u.length;p++){const{resolve:h}=u[p];h==null||h([d[p],d])}}).catch(d=>{for(let p=0;p<u.length;p++){const{reject:h}=u[p];h==null||h(d)}})},i=()=>Ia.delete(t),c=()=>a().map(({args:u})=>u),a=()=>Ia.get(t)||[],l=u=>Ia.set(t,[...a(),u]);return{flush:i,async schedule(u){const{promise:f,resolve:d,reject:p}=id();return(n==null?void 0:n([...c(),u]))&&s(),a().length>0?(l({args:u,resolve:d,reject:p}),f):(l({args:u,resolve:d,reject:p}),setTimeout(s,r),f)}}}async function Pr(e,t){var O,D,y,C;const{account:n=e.account,authorizationList:r,batch:o=!!((O=e.batch)!=null&&O.multicall),blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",accessList:c,blobs:a,blockOverrides:l,code:u,data:f,factory:d,factoryData:p,gas:h,gasPrice:b,maxFeePerBlobGas:S,maxFeePerGas:P,maxPriorityFeePerGas:x,nonce:w,to:$,value:k,stateOverride:B,...F}=t,m=n?tt(n):void 0;if(u&&(d||p))throw new V("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&$)throw new V("Cannot provide both `code` & `to` as parameters.");const g=u&&f,v=d&&p&&$&&f,A=g||v,N=g?cd({code:u,data:f}):v?Jy({data:f,factory:d,factoryData:p,to:$}):f;try{yr(t);const T=(typeof s=="bigint"?J(s):void 0)||i,L=l?Yf(l):void 0,j=aa(B),z=(C=(y=(D=e.chain)==null?void 0:D.formatters)==null?void 0:y.transactionRequest)==null?void 0:C.format,W=(z||Po)({...ws(F,{format:z}),accessList:c,account:m,authorizationList:r,blobs:a,data:N,gas:h,gasPrice:b,maxFeePerBlobGas:S,maxFeePerGas:P,maxPriorityFeePerGas:x,nonce:w,to:A?void 0:$,value:k},"call");if(o&&Xy({request:W})&&!j&&!L)try{return await Qy(e,{...W,blockNumber:s,blockTag:i})}catch(H){if(!(H instanceof od)&&!(H instanceof Na))throw H}const K=(()=>{const H=[W,T];return j&&L?[...H,j,L]:j?[...H,j]:L?[...H,{},L]:H})(),G=await e.request({method:"eth_call",params:K});return G==="0x"?{data:void 0}:{data:G}}catch(I){const T=ev(I),{offchainLookup:L,offchainLookupSignature:j}=await Promise.resolve().then(()=>Jv);if(e.ccipRead!==!1&&(T==null?void 0:T.slice(0,10))===j&&$)return{data:await L(e,{data:T,to:$})};throw A&&(T==null?void 0:T.slice(0,10))==="0x101bb98d"?new Og({factory:d}):sd(I,{...t,account:m,chain:e.chain})}}function Xy({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(Zy)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function Qy(e,t){var b;const{batchSize:n=1024,deployless:r=!1,wait:o=0}=typeof((b=e.batch)==null?void 0:b.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",data:c,to:a}=t,l=(()=>{if(r)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return Sr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new od})(),f=(typeof s=="bigint"?J(s):void 0)||i,{schedule:d}=ad({id:`${e.uid}.${f}`,wait:o,shouldSplitBatch(S){return S.reduce((x,{data:w})=>x+(w.length-2),0)>n*2},fn:async S=>{const P=S.map($=>({allowFailure:!0,callData:$.data,target:$.to})),x=lt({abi:xr,args:[P],functionName:"aggregate3"}),w=await e.request({method:"eth_call",params:[{...l===null?{data:cd({code:Aa,data:x})}:{to:l,data:x}},f]});return xn({abi:xr,args:[P],functionName:"aggregate3",data:w||"0x"})}}),[{returnData:p,success:h}]=await d({data:c,to:a});if(!h)throw new bs({data:p});return p==="0x"?{data:void 0}:{data:p}}function cd(e){const{code:t,data:n}=e;return Oa({abi:au(["constructor(bytes, bytes)"]),bytecode:rd,args:[t,n]})}function Jy(e){const{data:t,factory:n,factoryData:r,to:o}=e;return Oa({abi:au(["constructor(address, bytes, address, bytes)"]),bytecode:Ky,args:[o,t,n,r]})}function ev(e){var n;if(!(e instanceof V))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 Ot(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,c=lt({abi:n,args:o,functionName:s});try{const{data:a}=await X(e,Pr,"call")({...i,data:c,to:r});return xn({abi:n,args:o,functionName:s,data:a||"0x"})}catch(a){throw br(a,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function tv(e,t){var u;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(u=e.dataSuffix)==null?void 0:u.value,...c}=t,a=c.account?tt(c.account):e.account,l=lt({abi:n,args:o,functionName:s});try{const{data:f}=await X(e,Pr,"call")({batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:r,...c,account:a}),d=xn({abi:n,args:o,functionName:s,data:f||"0x"}),p=n.filter(h=>"name"in h&&h.name===t.functionName);return{result:d,request:{abi:p,address:r,args:o,dataSuffix:i,functionName:s,...c,account:a}}}catch(f){throw br(f,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:s,sender:a==null?void 0:a.address})}}const Da=new Map,ld=new Map;let nv=0;function En(e,t,n){const r=++nv,o=()=>Da.get(e)||[],s=()=>{const u=o();Da.set(e,u.filter(f=>f.id!==r))},i=()=>{const u=o();if(!u.some(d=>d.id===r))return;const f=ld.get(e);if(u.length===1&&f){const d=f();d instanceof Promise&&d.catch(()=>{})}s()},c=o();if(Da.set(e,[...c,{id:r,fns:t}]),c&&c.length>0)return i;const a={};for(const u in t)a[u]=(...f)=>{var p,h;const d=o();if(d.length!==0)for(const b of d)(h=(p=b.fns)[u])==null||h.call(p,...f)};const l=n(a);return typeof l=="function"&&ld.set(e,l),i}async function Ma(e){return new Promise(t=>setTimeout(t,e))}function Io(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let o=!0;const s=()=>o=!1;return(async()=>{let c;t&&(c=await e({unpoll:s}));const a=await(n==null?void 0:n(c))??r;await Ma(a);const l=async()=>{o&&(await e({unpoll:s}),await Ma(r),l())};l()})(),s}const rv=new Map,ov=new Map;function sv(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,rv),r=t(e,ov);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function iv(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=sv(t),o=r.response.get();if(o&&n>0&&Date.now()-o.created.getTime()<n)return o.data;let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const i=await s;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const av=e=>`blockNumber.${e}`;async function Do(e,{cacheTime:t=e.cacheTime}={}){const n=await iv(()=>e.request({method:"eth_blockNumber"}),{cacheKey:av(e.uid),cacheTime:t});return BigInt(n)}async function Ns(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 o=r.map(s=>Rt(s));return!("abi"in t)||!t.abi?o:ba({abi:t.abi,logs:o,strict:n})}async function Cs(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function cv(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:i,fromBlock:c,onError:a,onLogs:l,poll:u,pollingInterval:f=e.pollingInterval,strict:d}=t;return(typeof u<"u"?u:typeof c=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const S=d??!1,P=Ne(["watchContractEvent",r,o,s,e.uid,i,f,S,c]);return En(P,{onLogs:l,onError:a},x=>{let w;c!==void 0&&(w=c-1n);let $,k=!1;const B=Io(async()=>{var F;if(!k){try{$=await X(e,Wu,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:S,fromBlock:c})}catch{}k=!0;return}try{let m;if($)m=await X(e,Ns,"getFilterChanges")({filter:$});else{const g=await X(e,Do,"getBlockNumber")({});w&&w<g?m=await X(e,Nf,"getContractEvents")({abi:n,address:r,args:o,eventName:i,fromBlock:w+1n,toBlock:g,strict:S}):m=[],w=g}if(m.length===0)return;if(s)x.onLogs(m);else for(const g of m)x.onLogs([g])}catch(m){$&&m instanceof yn&&(k=!1),(F=x.onError)==null||F.call(x,m)}},{emitOnBegin:!0,interval:f});return async()=>{$&&await X(e,Cs,"uninstallFilter")({filter:$}),B()}})})():(()=>{const S=d??!1,P=Ne(["watchContractEvent",r,o,s,e.uid,i,f,S]);let x=!0,w=()=>x=!1;return En(P,{onLogs:l,onError:a},$=>((async()=>{try{const k=(()=>{if(e.transport.type==="fallback"){const m=e.transport.transports.find(g=>g.config.type==="webSocket"||g.config.type==="ipc");return m?m.value:e.transport}return e.transport})(),B=i?Yr({abi:n,eventName:i,args:o}):[],{unsubscribe:F}=await k.subscribe({params:["logs",{address:r,topics:B}],onData(m){var v;if(!x)return;const g=m.result;try{const{eventName:A,args:N}=xs({abi:n,data:g.data,topics:g.topics,strict:d}),O=Rt(g,{args:N,eventName:A});$.onLogs([O])}catch(A){let N,O;if(A instanceof ls||A instanceof Bi){if(d)return;N=A.abiItem.name,O=(v=A.abiItem.inputs)==null?void 0:v.some(y=>!("name"in y&&y.name))}const D=Rt(g,{args:O?[]:{},eventName:N});$.onLogs([D])}},onError(m){var g;(g=$.onError)==null||g.call($,m)}});w=F,x||w()}catch(k){a==null||a(k)}})(),()=>w()))})()}async function lv(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}function ka(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((o,s)=>{const i=async({count:c=0}={})=>{const a=async({error:l})=>{const u=typeof t=="function"?t({count:c,error:l}):t;u&&await Ma(u),i({count:c+1})};try{const l=await e();o(l)}catch(l){if(c<n&&await r({count:c,error:l}))return a({error:l});s(l)}};i()})}const uv={"0x0":"reverted","0x1":"success"};function ud(e,t){const n={...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(r=>Rt(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Yt(e.transactionIndex):null,status:e.status?uv[e.status]:null,type:e.type?pf[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const La=256;let Os=La,Is;function fd(e=11){if(!Is||Os+e>La*2){Is="",Os=0;for(let t=0;t<La;t++)Is+=(256+Math.random()*256|0).toString(16).substring(1)}return Is.substring(Os,Os+++e)}function fv(e){const{batch:t,chain:n,ccipRead:r,dataSuffix:o,key:s="base",name:i="Base Client",type:c="base"}=e,a=e.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),l=(n==null?void 0:n.blockTime)??12e3,u=Math.min(Math.max(Math.floor(l/2),500),4e3),f=e.pollingInterval??u,d=e.cacheTime??f,p=e.account?tt(e.account):void 0,{config:h,request:b,value:S}=e.transport({account:p,chain:n,pollingInterval:f}),P={...h,...S},x={account:p,batch:t,cacheTime:d,ccipRead:r,chain:n,dataSuffix:o,key:s,name:i,pollingInterval:f,request:b,transport:P,type:c,uid:fd(),...a?{experimental_blockTag:a}:{}};function w($){return k=>{const B=k($);for(const m in x)delete B[m];const F={...$,...B};return Object.assign(F,{extend:w(F)})}}return Object.assign(x,{extend:w(x)})}function Ba(e){var n,r,o,s,i,c;if(!(e instanceof V))return!1;const t=e.walk(a=>a instanceof Xi);return t instanceof Xi?((n=t.data)==null?void 0:n.errorName)==="HttpError"||((r=t.data)==null?void 0:r.errorName)==="ResolverError"||((o=t.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotFound"||((i=t.data)==null?void 0:i.errorName)==="ReverseAddressMismatch"||((c=t.data)==null?void 0:c.errorName)==="UnsupportedResolverProfile":!1}function dv(e){const{abi:t,data:n}=e,r=Fn(n,0,4),o=t.find(s=>s.type==="function"&&r===Kr(St(s)));if(!o)throw new t1(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Xr(o.inputs,Fn(n,4)):void 0}}const Fa="/docs/contract/encodeErrorResult";function dd(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const a=Rn({abi:t,args:r,name:n});if(!a)throw new hu(n,{docsPath:Fa});o=a}if(o.type!=="error")throw new hu(void 0,{docsPath:Fa});const s=St(o),i=Kr(s);let c="0x";if(r&&r.length>0){if(!o.inputs)throw new Qb(o.name,{docsPath:Fa});c=gn(o.inputs,r)}return dr([i,c])}const Ra="/docs/contract/encodeFunctionResult";function pv(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=Rn({abi:t,name:n});if(!i)throw new ir(n,{docsPath:Ra});o=i}if(o.type!=="function")throw new ir(void 0,{docsPath:Ra});if(!o.outputs)throw new gu(o.name,{docsPath:Ra});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new yu(r)})();return gn(o.outputs,s)}const Mo="x-batch-gateway:true";async function pd(e){const{data:t,ccipRequest:n}=e,{args:[r]}=dv({abi:$a,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,c)=>{try{s[c]=i.urls.includes(Mo)?await pd({data:i.data,ccipRequest:n}):await n(i),o[c]=!1}catch(a){o[c]=!0,s[c]=hv(a)}})),pv({abi:$a,functionName:"query",result:[o,s]})}function hv(e){return e.name==="HttpRequestError"&&e.status?dd({abi:$a,errorName:"HttpError",args:[e.status,e.shortMessage]}):dd({abi:[Vu],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function hd(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Pt(t)?t:null}function ja(e){let t=new Uint8Array(32).fill(0);if(!e)return Ae(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=hd(n[r]),s=o?cr(o):De(Ln(n[r]),"bytes");t=De($t([t,s]),"bytes")}return Ae(t)}function mv(e){return`[${e.slice(2)}]`}function bv(e){const t=new Uint8Array(32).fill(0);return e?hd(e)||De(Ln(e)):Ae(t)}function _a(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Ln(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=Ln(o[s]);i.byteLength>255&&(i=Ln(mv(bv(o[s])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function gv(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:i,strict:c}=t,{chain:a}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return Sr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(d=>s.endsWith(d)))return null;const f=o!=null?[ja(s),BigInt(o)]:[ja(s)];try{const d=lt({abi:ed,functionName:"addr",args:f}),p={address:l,abi:Qf,functionName:"resolveWithGateways",args:[mn(_a(s)),d,i??[Mo]],blockNumber:n,blockTag:r},b=await X(e,Ot,"readContract")(p);if(b[0]==="0x")return null;const S=xn({abi:ed,args:f,functionName:"addr",data:b[0]});return S==="0x"||kn(S)==="0x00"?null:S}catch(d){if(c)throw d;if(Ba(d))return null;throw d}}class yv extends V{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 ko extends V{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class za extends V{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 vv extends V{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const wv=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,xv=/^(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>\/.*)?$/,Ev=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Sv=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Pv(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"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function md(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function bd({uri:e,gatewayUrls:t}){const n=Ev.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=md(t==null?void 0:t.ipfs,"https://ipfs.io"),o=md(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(wv),{protocol:i,subpath:c,target:a,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=i==="ipns:/"||c==="ipns/",f=i==="ipfs:/"||c==="ipfs/"||xv.test(e);if(e.startsWith("http")&&!u&&!f){let p=e;return t!=null&&t.arweave&&(p=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:p,isOnChain:!1,isEncoded:!1}}if((u||f)&&a)return{uri:`${r}/${u?"ipns":"ipfs"}/${a}${l}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&a)return{uri:`${o}/${a}${l||""}`,isOnChain:!1,isEncoded:!1};let d=e.replace(Sv,"");if(d.startsWith("<svg")&&(d=`data:image/svg+xml;base64,${btoa(d)}`),d.startsWith("data:")||d.startsWith("{"))return{uri:d,isOnChain:!0,isEncoded:!1};throw new za({uri:e})}function gd(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new yv({data:e});return e.image||e.image_url||e.image_data}async function Tv({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await Ua({gatewayUrls:e,uri:gd(n)})}catch{throw new za({uri:t})}}async function Ua({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=bd({uri:t,gatewayUrls:e});if(r||await Pv(n))return n;throw new za({uri:t})}function $v(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,o]=t.split("/"),[s,i]=n.split(":"),[c,a]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new ko({reason:"Only EIP-155 supported"});if(!i)throw new ko({reason:"Chain ID not found"});if(!a)throw new ko({reason:"Contract address not found"});if(!o)throw new ko({reason:"Token ID not found"});if(!c)throw new ko({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:c.toLowerCase(),contractAddress:a,tokenID:o}}async function Av(e,{nft:t}){if(t.namespace==="erc721")return Ot(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 Ot(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 vv({namespace:t.namespace})}async function Nv(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Cv(e,{gatewayUrls:t,record:n}):Ua({uri:n,gatewayUrls:t})}async function Cv(e,{gatewayUrls:t,record:n}){const r=$v(n),o=await Av(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:c}=bd({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=c?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return Ua({uri:gd(u),gatewayUrls:t})}let a=r.tokenID;return r.namespace==="erc1155"&&(a=a.replace("0x","").padStart(64,"0")),Tv({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,a)})}async function yd(e,t){const{blockNumber:n,blockTag:r,key:o,name:s,gatewayUrls:i,strict:c}=t,{chain:a}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return Sr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(f=>s.endsWith(f)))return null;try{const f={address:l,abi:Qf,args:[mn(_a(s)),lt({abi:Jf,functionName:"text",args:[ja(s),o]}),i??[Mo]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},p=await X(e,Ot,"readContract")(f);if(p[0]==="0x")return null;const h=xn({abi:Jf,functionName:"text",data:p[0]});return h===""?null:h}catch(f){if(c)throw f;if(Ba(f))return null;throw f}}async function Ov(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:c}){const a=await X(e,yd,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:c,gatewayUrls:s,strict:i});if(!a)return null;try{return await Nv(e,{record:a,gatewayUrls:r})}catch{return null}}async function Iv(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:i,strict:c}=t,{chain:a}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return Sr({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:qy,args:[n,s,i??[Mo]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},f=X(e,Ot,"readContract"),[d]=await f(u);return d||null}catch(u){if(c)throw u;if(Ba(u))return null;throw u}}async function Dv(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return Sr({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),c=s==null?void 0:s.ensTlds;if(c&&!c.some(l=>o.endsWith(l)))throw new Error(`${o} is not a valid ENS TLD (${c==null?void 0:c.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[a]=await X(e,Ot,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[mn(_a(o))],blockNumber:n,blockTag:r});return a}async function vd(e,t){var S,P,x;const{account:n=e.account,blockNumber:r,blockTag:o="latest",blobs:s,data:i,gas:c,gasPrice:a,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:f,to:d,value:p,...h}=t,b=n?tt(n):void 0;try{yr(t);const $=(typeof r=="bigint"?J(r):void 0)||o,k=(x=(P=(S=e.chain)==null?void 0:S.formatters)==null?void 0:P.transactionRequest)==null?void 0:x.format,F=(k||Po)({...ws(h,{format:k}),account:b,blobs:s,data:i,gas:c,gasPrice:a,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:f,to:d,value:p},"createAccessList"),m=await e.request({method:"eth_createAccessList",params:[F,$]});return{accessList:m.accessList,gasUsed:BigInt(m.gasUsed)}}catch(w){throw sd(w,{...t,account:b,chain:e.chain})}}async function Mv(e){const t=ms(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function wd(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:c}={}){const a=o??(r?[r]:void 0),l=ms(e,{method:"eth_newFilter"});let u=[];a&&(u=[a.flatMap(p=>Yr({abi:[p],eventName:p.name,args:n}))],r&&(u=u[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?J(s):s,toBlock:typeof c=="bigint"?J(c):c,...u.length?{topics:u}:{}}]});return{abi:a,args:n,eventName:r?r.name:void 0,fromBlock:s,id:f,request:l(f),strict:!!i,toBlock:c,type:"event"}}async function xd(e){const t=ms(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function kv(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){var i,c,a;if((i=e.batch)!=null&&i.multicall&&((a=(c=e.chain)==null?void 0:c.contracts)!=null&&a.multicall3)){const l=e.chain.contracts.multicall3.address,u=lt({abi:xr,functionName:"getEthBalance",args:[t]}),{data:f}=await X(e,Pr,"call")({to:l,data:u,blockNumber:n,blockTag:r});return xn({abi:xr,functionName:"getEthBalance",args:[t],data:f||"0x"})}const o=typeof n=="bigint"?J(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}async function Lv(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Bv(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=n!==void 0?J(n):void 0;let s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:!!o}),Yt(s)}async function Ds(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=n!==void 0?J(n):void 0,s=await e.request({method:"eth_getCode",params:[t,o||r]},{dedupe:!!o});if(s!=="0x")return s}async function Fv(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=await Ds(e,{address:t,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(o&&ve(o)===23&&o.startsWith("0xef0100"))return Qt(Fn(o,3,23))}class Rv extends V{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 jv(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,c,a,l,u,f]=await X(e,Ot,"readContract")({abi:_v,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:i,version:c,chainId:Number(a),verifyingContract:l,salt:u},extensions:f,fields:s}}catch(s){const i=s;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new Rv({address:n}):i}}const _v=[{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 zv(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 Uv(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:o}){const s=typeof n=="bigint"?J(n):void 0,i=await e.request({method:"eth_feeHistory",params:[J(t),s||r,o]},{dedupe:!!s});return zv(i)}async function Wv(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Rt(s));return t.abi?ba({abi:t.abi,logs:o,strict:n}):o}async function Hv({address:e,authorization:t,signature:n}){return To(Qt(e),await cf({authorization:t,signature:n}))}const Ms=new ps(8192);function Vv(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Ms.get(n))return Ms.get(n);const r=e().finally(()=>Ms.delete(n));return Ms.set(n,r),r}function Gv(e,t={}){return async(n,r={})=>{var f;const{dedupe:o=!1,methods:s,retryDelay:i=150,retryCount:c=3,uid:a}={...t,...r},{method:l}=n;if((f=s==null?void 0:s.exclude)!=null&&f.includes(l))throw new zn(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new zn(new Error("method not supported"),{method:l});const u=o?Gr(`${a}.${Ne(n)}`):void 0;return Vv(()=>ka(async()=>{try{return await e(n)}catch(d){const p=d;switch(p.code){case to.code:throw new to(p);case no.code:throw new no(p);case ro.code:throw new ro(p,{method:n.method});case oo.code:throw new oo(p);case _n.code:throw new _n(p);case yn.code:throw new yn(p);case so.code:throw new so(p);case io.code:throw new io(p);case ao.code:throw new ao(p);case zn.code:throw new zn(p,{method:n.method});case hr.code:throw new hr(p);case co.code:throw new co(p);case mr.code:throw new mr(p);case lo.code:throw new lo(p);case uo.code:throw new uo(p);case fo.code:throw new fo(p);case po.code:throw new po(p);case ho.code:throw new ho(p);case mo.code:throw new mo(p);case bo.code:throw new bo(p);case go.code:throw new go(p);case yo.code:throw new yo(p);case vo.code:throw new vo(p);case wo.code:throw new wo(p);case xo.code:throw new xo(p);case 5e3:throw new mr(p);case Eo.code:throw new Eo(p);default:throw d instanceof V?d:new Dg(p)}}},{delay:({count:d,error:p})=>{var h;if(p&&p instanceof jn){const b=(h=p==null?void 0:p.headers)==null?void 0:h.get("Retry-After");if(b!=null&&b.match(/\d/))return Number.parseInt(b,10)*1e3}return~~(1<<d)*i},retryCount:c,shouldRetry:({error:d})=>qv(d)}),{enabled:o,id:u})}}function qv(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===hr.code||e.code===_n.code:e instanceof jn&&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}class Zv extends V{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:s,urls:i}){var c;super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],(c=n.metaMessages)!=null&&c.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(a=>` ${eo(a)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class Kv extends V{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${eo(n)}`,`Response: ${Ne(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Yv extends V{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const Xv="0x556f1830",Ed={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function Qv(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=Ku({data:r,abi:[Ed]}),[i,c,a,l,u]=s,{ccipRead:f}=e,d=f&&typeof(f==null?void 0:f.request)=="function"?f.request:Sd;try{if(!To(o,i))throw new Yv({sender:i,to:o});const p=c.includes(Mo)?await pd({data:a,ccipRequest:d}):await d({data:a,sender:i,urls:c}),{data:h}=await Pr(e,{blockNumber:t,blockTag:n,data:$t([l,gn([{type:"bytes"},{type:"bytes"}],[p,u])]),to:o});return h}catch(p){throw new Zv({callbackSelector:l,cause:p,data:r,extraData:u,sender:i,urls:c})}}async function Sd({data:e,sender:t,urls:n}){var o;let r=new Error("An unknown error occurred.");for(let s=0;s<n.length;s++){const i=n[s],c=i.includes("{data}")?"GET":"POST",a=c==="POST"?{data:e,sender:t}:void 0,l=c==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(i.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(a),headers:l,method:c});let f;if((o=u.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?f=(await u.json()).data:f=await u.text(),!u.ok){r=new jn({body:a,details:f!=null&&f.error?Ne(f.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!Pt(f)){r=new Kv({result:f,url:i});continue}return f}catch(u){r=new jn({body:a,details:u.message,url:i})}}throw r}const Jv=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Sd,offchainLookup:Qv,offchainLookupAbiItem:Ed,offchainLookupSignature:Xv},Symbol.toStringTag,{value:"Module"}));function ew(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return o=>{const s=typeof o=="function"?o(r):o,i={...r,...s};return Object.assign(i,{extend:n(i)})}}return Object.assign(t,{extend:n(t)})}function tw(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((o,s)=>{(async()=>{let i;try{const c=new AbortController;n>0&&(i=setTimeout(()=>{r&&c.abort()},n)),o(await e({signal:(c==null?void 0:c.signal)||null}))}catch(c){(c==null?void 0:c.name)==="AbortError"&&s(t),s(c)}finally{clearTimeout(i)}})()})}function nw(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Pd=nw();function rw(e,t={}){const{url:n,headers:r}=ow(e);return{async request(o){var h;const{body:s,fetchFn:i=t.fetchFn??fetch,onRequest:c=t.onRequest,onResponse:a=t.onResponse,timeout:l=t.timeout??1e4}=o,u={...t.fetchOptions??{},...o.fetchOptions??{}},{headers:f,method:d,signal:p}=u;try{const b=await tw(async({signal:P})=>{const x={...u,body:Array.isArray(s)?Ne(s.map(B=>({jsonrpc:"2.0",id:B.id??Pd.take(),...B}))):Ne({jsonrpc:"2.0",id:s.id??Pd.take(),...s}),headers:{...r,"Content-Type":"application/json",...f},method:d||"POST",signal:p||(l>0?P:null)},w=new Request(n,x),$=await(c==null?void 0:c(w,x))??{...x,url:n};return await i($.url??n,$)},{errorInstance:new nf({body:s,url:n}),timeout:l,signal:!0});a&&await a(b);let S;if((h=b.headers.get("Content-Type"))!=null&&h.startsWith("application/json"))S=await b.json();else{S=await b.text();try{S=JSON.parse(S||"{}")}catch(P){if(b.ok)throw P;S={error:S}}}if(!b.ok)throw new jn({body:s,details:Ne(S.error)||b.statusText,headers:b.headers,status:b.status,url:n});return S}catch(b){throw b instanceof jn||b instanceof nf?b:new jn({body:s,cause:b,url:n})}}}}function ow(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}const sw=`Ethereum Signed Message:
89
+ `;function iw(e){const t=typeof e=="string"?Gr(e):typeof e.raw=="string"?e.raw:Ae(e.raw),n=Gr(`${sw}${ve(t)}`);return $t([n,t])}function Td(e,t){return De(iw(e),t)}class aw extends V{constructor({domain:t}){super(`Invalid domain "${Ne(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class cw extends V{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 lw extends V{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function uw(e){const{domain:t,message:n,primaryType:r,types:o}=e,s=(i,c)=>{for(const a of i){const{name:l,type:u}=a,f=c[l],d=u.match(ju);if(d&&(typeof f=="number"||typeof f=="bigint")){const[b,S,P]=d;J(f,{signed:S==="int",size:Number.parseInt(P,10)/8})}if(u==="address"&&typeof f=="string"&&!ct(f))throw new bn({address:f});const p=u.match(K1);if(p){const[b,S]=p;if(S&&ve(f)!==Number.parseInt(S,10))throw new r1({expectedSize:Number.parseInt(S,10),givenSize:ve(f)})}const h=o[u];h&&(dw(u),s(h,f))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new aw({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new cw({primaryType:r,types:o})}function fw({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 dw(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new lw({type:e})}function pw(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:fw({domain:t}),...e.types};uw({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(hw({domain:t,types:o})),r!=="EIP712Domain"&&s.push($d({data:n,primaryType:r,types:o})),De($t(s))}function hw({domain:e,types:t}){return $d({data:e,primaryType:"EIP712Domain",types:t})}function $d({data:e,primaryType:t,types:n}){const r=Ad({data:e,primaryType:t,types:n});return De(r)}function Ad({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[mw({primaryType:t,types:n})];for(const s of n[t]){const[i,c]=Cd({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(c)}return gn(r,o)}function mw({primaryType:e,types:t}){const n=mn(bw({primaryType:e,types:t}));return De(n)}function bw({primaryType:e,types:t}){let n="";const r=Nd({primaryType:e,types:t});r.delete(e);const o=[e,...Array.from(r).sort()];for(const s of o)n+=`${s}(${t[s].map(({name:i,type:c})=>`${c} ${i}`).join(",")})`;return n}function Nd({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),o=r==null?void 0:r[0];if(n.has(o)||t[o]===void 0)return n;n.add(o);for(const s of t[o])Nd({primaryType:s.type,types:t},n);return n}function Cd({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},De(Ad({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},De(r)];if(n==="string")return[{type:"bytes32"},De(mn(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>Cd({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},De(gn(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class gw 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 Wa={checksum:new gw(8192)}.checksum;class Od extends ji{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,T1(t);const r=fs(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 o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),fr(s)}update(t){return ur(this),this.iHash.update(t),this}digestInto(t){ur(this),Bn(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:o,destroyed:s,blockLen:i,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=c,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Id=(e,t,n)=>new Od(e,t).update(n).digest();Id.create=(e,t)=>new Od(e,t);function Dd(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=ku(Ay(e));return n==="Bytes"?r:Ct(r)}const yw=/^0x[a-fA-F0-9]{40}$/;function ks(e,t={}){const{strict:n=!0}=t;if(!yw.test(e))throw new kd({address:e,cause:new vw});if(n){if(e.toLowerCase()===e)return;if(Md(e)!==e)throw new kd({address:e,cause:new ww})}}function Md(e){if(Wa.has(e))return Wa.get(e);ks(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=Dd(Cy(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const o=`0x${r.join("")}`;return Wa.set(e,o),o}function Ha(e,t={}){const{strict:n=!0}=t??{};try{return ks(e,{strict:n}),!0}catch{return!1}}class kd extends te{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"})}}class vw extends te{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 ww extends te{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const xw=/^(.*)\[([0-9]*)\]$/,Ew=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ld=/^(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)?$/,Bd=2n**256n-1n;function Tr(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=Za(t.type);if(s){const[i,c]=s;return Pw(e,{...t,type:c},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return Nw(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return Sw(e,{checksum:r});if(t.type==="bool")return Tw(e);if(t.type.startsWith("bytes"))return $w(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Aw(e,t);if(t.type==="string")return Cw(e,{staticPosition:o});throw new Xa(t.type)}const Fd=32,Va=32;function Sw(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?Md(s):s)(Ct(Iy(r,-20))),32]}function Pw(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const a=nn(e.readBytes(Va)),l=s+a,u=l+Fd;e.setPosition(l);const f=nn(e.readBytes(Fd)),d=Lo(t);let p=0;const h=[];for(let b=0;b<f;++b){e.setPosition(u+(d?b*32:p));const[S,P]=Tr(e,t,{checksumAddress:r,staticPosition:u});p+=P,h.push(S)}return e.setPosition(s+32),[h,32]}if(Lo(t)){const a=nn(e.readBytes(Va)),l=s+a,u=[];for(let f=0;f<o;++f){e.setPosition(l+f*32);const[d]=Tr(e,t,{checksumAddress:r,staticPosition:l});u.push(d)}return e.setPosition(s+32),[u,32]}let i=0;const c=[];for(let a=0;a<o;++a){const[l,u]=Tr(e,t,{checksumAddress:r,staticPosition:s+i});i+=u,c.push(l)}return[c,i]}function Tw(e){return[My(e.readBytes(32),{size:32}),32]}function $w(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=nn(e.readBytes(32));e.setPosition(n+i);const c=nn(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Ct(a),32]}return[Ct(e.readBytes(Number.parseInt(o,10),32)),32]}function Aw(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?Dy(o,{signed:n}):nn(o,{signed:n}),32]}function Nw(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=t.components.length===0||t.components.some(({name:a})=>!a),i=s?[]:{};let c=0;if(Lo(t)){const a=nn(e.readBytes(Va)),l=o+a;for(let u=0;u<t.components.length;++u){const f=t.components[u];e.setPosition(l+c);const[d,p]=Tr(e,f,{checksumAddress:r,staticPosition:l});c+=p,i[s?u:f==null?void 0:f.name]=d}return e.setPosition(o+32),[i,32]}for(let a=0;a<t.components.length;++a){const l=t.components[a],[u,f]=Tr(e,l,{checksumAddress:r,staticPosition:o});i[s?a:l==null?void 0:l.name]=u,c+=f}return[i,c]}function Cw(e,{staticPosition:t}){const n=nn(e.readBytes(32)),r=t+n;e.setPosition(r);const o=nn(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=ky(Uf(s));return e.setPosition(t+32),[i,32]}function Ow({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(Ga({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function Ga({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=Za(r.type);if(o){const[s,i]=o;return Dw(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return Fw(n,{checksumAddress:e,parameter:r});if(r.type==="address")return Iw(n,{checksum:e});if(r.type==="bool")return kw(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=Ld.exec(r.type)??[];return Lw(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return Mw(n,{type:r.type});if(r.type==="string")return Bw(n);throw new Xa(r.type)}function qa(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=nt(c)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?(n.push(Be(t+o,{size:32})),r.push(c),o+=nt(c)):n.push(c)}return Nt(...n,...r)}function Iw(e,t){const{checksum:n=!1}=t;return ks(e,{strict:n}),{dynamic:!1,encoded:Wn(e.toLowerCase())}}function Dw(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new Gw(e);if(!s&&e.length!==r)throw new Vw({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const c=[];for(let a=0;a<e.length;a++){const l=Ga({checksumAddress:n,parameter:o,value:e[a]});l.dynamic&&(i=!0),c.push(l)}if(s||i){const a=qa(c);if(s){const l=Be(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?Nt(l,a):l}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Nt(...c.map(({encoded:a})=>a))}}function Mw(e,{type:t}){const[,n]=t.split("bytes"),r=nt(e);if(!n){let o=e;return r%32!==0&&(o=Hn(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Nt(Wn(Be(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new _d({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Hn(e)}}function kw(e){if(typeof e!="boolean")throw new te(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Wn(Wf(e))}}function Lw(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new Gf({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Be(e,{size:32,signed:t})}}function Bw(e){const t=Ta(e),n=Math.ceil(nt(t)/32),r=[];for(let o=0;o<n;o++)r.push(Hn(jt(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:Nt(Hn(Be(nt(t),{size:32})),...r)}}function Fw(e,t){const{checksumAddress:n,parameter:r}=t;let o=!1;const s=[];for(let i=0;i<r.components.length;i++){const c=r.components[i],a=Array.isArray(e)?i:c.name,l=Ga({checksumAddress:n,parameter:c,value:e[a]});s.push(l),l.dynamic&&(o=!0)}return{dynamic:o,encoded:o?qa(s):Nt(...s.map(({encoded:i})=>i))}}function Za(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Lo(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(Lo);const n=Za(e.type);return!!(n&&Lo({...e,type:n[1]}))}const Rw={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 zw({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new _w({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Rd({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 Rd({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 jw(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Rw);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Rd extends te{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class _w extends te{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class zw extends te{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Uw(e,t,n={}){const{as:r="Array",checksumAddress:o=!1}=n,s=typeof t=="string"?zf(t):t,i=jw(s);if(wr(s)===0&&e.length>0)throw new Hw;if(wr(s)&&wr(s)<32)throw new Ww({data:typeof t=="string"?t:Ct(t),parameters:e,size:wr(s)});let c=0;const a=r==="Array"?[]:{};for(let l=0;l<e.length;++l){const u=e[l];i.setPosition(c);const[f,d]=Tr(i,u,{checksumAddress:o,staticPosition:0});c+=d,r==="Array"?a.push(f):a[u.name??l]=f}return a}function Ka(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new zd({expectedLength:e.length,givenLength:t.length});const o=Ow({checksumAddress:r,parameters:e,values:t}),s=qa(o);return s.length===0?"0x":s}function Ya(e,t){if(e.length!==t.length)throw new zd({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r];n.push(Ya.encode(o,s))}return Nt(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const a=r;return ks(a),Wn(a.toLowerCase(),o?32:0)}if(n==="string")return Ta(r);if(n==="bytes")return r;if(n==="bool")return Wn(Wf(r),o?32:1);const s=n.match(Ld);if(s){const[a,l,u="256"]=s,f=Number.parseInt(u,10)/8;return Be(r,{size:o?32:f,signed:l==="int"})}const i=n.match(Ew);if(i){const[a,l]=i;if(Number.parseInt(l,10)!==(r.length-2)/2)throw new _d({expectedSize:Number.parseInt(l,10),value:r});return Hn(r,o?32:0)}const c=n.match(xw);if(c&&Array.isArray(r)){const[a,l]=c,u=[];for(let f=0;f<r.length;f++)u.push(t(l,r[f],!0));return u.length===0?"0x":Nt(...u)}throw new Xa(n)}e.encode=t})(Ya||(Ya={}));function jd(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?lu(e):e}class Ww extends te{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${or(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class Hw extends te{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Vw extends te{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 _d extends te{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${nt(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class zd extends te{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
90
+ `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class Gw extends te{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class Xa extends te{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ve=BigInt(0),Fe=BigInt(1),Vn=BigInt(2),qw=BigInt(3),Ud=BigInt(4),Wd=BigInt(5),Hd=BigInt(8);function Ge(e,t){const n=e%t;return n>=Ve?n:t+n}function ft(e,t,n){let r=e;for(;t-- >Ve;)r*=r,r%=n;return r}function Qa(e,t){if(e===Ve)throw new Error("invert: expected non-zero number");if(t<=Ve)throw new Error("invert: expected positive modulus, got "+t);let n=Ge(e,t),r=t,o=Ve,s=Fe;for(;n!==Ve;){const c=r/n,a=r%n,l=o-s*c;r=n,n=a,o=s,s=l}if(r!==Fe)throw new Error("invert: does not exist");return Ge(o,t)}function Vd(e,t){const n=(e.ORDER+Fe)/Ud,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function Zw(e,t){const n=(e.ORDER-Wd)/Hd,r=e.mul(t,Vn),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,Vn),o),c=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}function Kw(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Fe,n=0;for(;t%Vn===Ve;)t/=Vn,n++;let r=Vn;const o=Ja(e);for(;qd(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Vd;let s=o.pow(r,t);const i=(t+Fe)/Vn;return function(a,l){if(a.is0(l))return l;if(qd(a,l)!==1)throw new Error("Cannot find square root");let u=n,f=a.mul(a.ONE,s),d=a.pow(l,t),p=a.pow(l,i);for(;!a.eql(d,a.ONE);){if(a.is0(d))return a.ZERO;let h=1,b=a.sqr(d);for(;!a.eql(b,a.ONE);)if(h++,b=a.sqr(b),h===u)throw new Error("Cannot find square root");const S=Fe<<BigInt(u-h-1),P=a.pow(f,S);u=h,f=a.sqr(P),d=a.mul(d,f),p=a.mul(p,P)}return p}}function Yw(e){return e%Ud===qw?Vd:e%Hd===Wd?Zw:Kw(e)}const Xw=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Qw(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Xw.reduce((r,o)=>(r[o]="function",r),t);return $s(e,n)}function Jw(e,t,n){if(n<Ve)throw new Error("invalid exponent, negatives unsupported");if(n===Ve)return e.ONE;if(n===Fe)return t;let r=e.ONE,o=t;for(;n>Ve;)n&Fe&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Fe;return r}function Gd(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((i,c,a)=>e.is0(c)?i:(r[a]=i,e.mul(i,c)),e.ONE),s=e.inv(o);return t.reduceRight((i,c,a)=>e.is0(c)?i:(r[a]=e.mul(i,r[a]),e.mul(i,c)),s),r}function qd(e,t){const n=(e.ORDER-Fe)/Vn,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function Zd(e,t){t!==void 0&&qr(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Ja(e,t,n=!1,r={}){if(e<=Ve)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=Zd(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const c=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:s,MASK:Ts(o),ZERO:Ve,ONE:Fe,create:a=>Ge(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return Ve<=a&&a<e},is0:a=>a===Ve,isOdd:a=>(a&Fe)===Fe,neg:a=>Ge(-a,e),eql:(a,l)=>a===l,sqr:a=>Ge(a*a,e),add:(a,l)=>Ge(a+l,e),sub:(a,l)=>Ge(a-l,e),mul:(a,l)=>Ge(a*l,e),pow:(a,l)=>Jw(c,a,l),div:(a,l)=>Ge(a*Qa(l,e),e),sqrN:a=>a*a,addN:(a,l)=>a+l,subN:(a,l)=>a-l,mulN:(a,l)=>a*l,inv:a=>Qa(a,e),sqrt:r.sqrt||(a=>(i||(i=Yw(e)),i(c,a))),toBytes:a=>n?Mf(a,s):Co(a,s),fromBytes:a=>{if(a.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+a.length);return n?Df(a):Un(a)},invertBatch:a=>Gd(c,a),cmov:(a,l,u)=>u?l:a});return Object.freeze(c)}function Kd(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 Yd(e){const t=Kd(e);return t+Math.ceil(t/2)}function e6(e,t,n=!1){const r=e.length,o=Kd(t),s=Yd(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?Df(e):Un(e),c=Ge(i,t-Fe)+Fe;return n?Mf(c,o):Co(c,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xd=BigInt(0),ec=BigInt(1);function tc(e,t){const n=t.negate();return e?n:t}function Qd(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function nc(e,t){Qd(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=Ts(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function Jd(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:i}=n;let c=Number(e&o),a=e>>i;c>r&&(c-=s,a+=ec);const l=t*r,u=l+Math.abs(c)-1,f=c===0,d=c<0,p=t%2!==0;return{nextN:a,offset:u,isZero:f,isNeg:d,isNegF:p,offsetF:l}}function t6(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 n6(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 rc=new WeakMap,e0=new WeakMap;function oc(e){return e0.get(e)||1}function r6(e,t){return{constTimeNegate:tc,hasPrecomputes(n){return oc(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>Xd;)r&ec&&(o=o.add(s)),s=s.double(),r>>=ec;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=nc(r,t),i=[];let c=n,a=c;for(let l=0;l<o;l++){a=c,i.push(a);for(let u=1;u<s;u++)a=a.add(c),i.push(a);c=a.double()}return i},wNAF(n,r,o){let s=e.ZERO,i=e.BASE;const c=nc(n,t);for(let a=0;a<c.windows;a++){const{nextN:l,offset:u,isZero:f,isNeg:d,isNegF:p,offsetF:h}=Jd(o,a,c);o=l,f?i=i.add(tc(p,r[h])):s=s.add(tc(d,r[u]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=nc(n,t);for(let c=0;c<i.windows&&o!==Xd;c++){const{nextN:a,offset:l,isZero:u,isNeg:f}=Jd(o,c,i);if(o=a,!u){const d=r[l];s=s.add(f?d.negate():d)}}return s},getPrecomputes(n,r,o){let s=rc.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&rc.set(r,o(s))),s},wNAFCached(n,r,o){const s=oc(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=oc(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){Qd(r,t),e0.set(n,r),rc.delete(n)}}}function o6(e,t,n,r){t6(n,e),n6(r,t);const o=n.length,s=r.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,c=by(BigInt(o));let a=1;c>12?a=c-3:c>4?a=c-2:c>0&&(a=2);const l=Ts(a),u=new Array(Number(l)+1).fill(i),f=Math.floor((t.BITS-1)/a)*a;let d=i;for(let p=f;p>=0;p-=a){u.fill(i);for(let b=0;b<s;b++){const S=r[b],P=Number(S>>BigInt(p)&l);u[P]=u[P].add(n[b])}let h=i;for(let b=u.length-1,S=i;b>0;b--)S=S.add(u[b]),h=h.add(S);if(d=d.add(h),p!==0)for(let b=0;b<a;b++)d=d.double()}return d}function t0(e){return Qw(e.Fp),$s(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Zd(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function n0(e){e.lowS!==void 0&&Ao("lowS",e.lowS),e.prehash!==void 0&&Ao("prehash",e.prehash)}function s6(e){const t=t0(e);$s(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class i6 extends Error{constructor(t=""){super(t)}}const rn={Err:i6,_tlv:{encode:(e,t)=>{const{Err:n}=rn;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,o=Es(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Es(o.length/2|128):"";return Es(e)+s+o+t},decode(e,t){const{Err:n}=rn;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 o=t[r++],s=!!(o&128);let i=0;if(!s)i=o;else{const a=o&127;if(!a)throw new n("tlv.decode(long): indefinite length not supported");if(a>4)throw new n("tlv.decode(long): byte length is too big");const l=t.subarray(r,r+a);if(l.length!==a)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)i=i<<8|u;if(r+=a,i<128)throw new n("tlv.decode(long): not minimal encoding")}const c=t.subarray(r,r+i);if(c.length!==i)throw new n("tlv.decode: wrong value length");return{v:c,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=rn;if(e<on)throw new t("integer: negative integers are not allowed");let n=Es(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}=rn;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 Un(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=rn,o=ut("signature",e),{v:s,l:i}=r.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:c,l:a}=r.decode(2,s),{v:l,l:u}=r.decode(2,a);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(c),s:n.decode(l)}},hexFromSig(e){const{_tlv:t,_int:n}=rn,r=t.encode(2,n.encode(e.r)),o=t.encode(2,n.encode(e.s)),s=r+o;return t.encode(48,s)}};function sc(e,t){return No(Co(e,t))}const on=BigInt(0),Oe=BigInt(1);BigInt(2);const ic=BigInt(3),a6=BigInt(4);function c6(e){const t=s6(e),{Fp:n}=t,r=Ja(t.n,t.nBitLength),o=t.toBytes||((w,$,k)=>{const B=$.toAffine();return Ps(Uint8Array.from([4]),n.toBytes(B.x),n.toBytes(B.y))}),s=t.fromBytes||(w=>{const $=w.subarray(1),k=n.fromBytes($.subarray(0,n.BYTES)),B=n.fromBytes($.subarray(n.BYTES,2*n.BYTES));return{x:k,y:B}});function i(w){const{a:$,b:k}=t,B=n.sqr(w),F=n.mul(B,w);return n.add(n.add(F,n.mul(w,$)),k)}function c(w,$){const k=n.sqr($),B=i(w);return n.eql(k,B)}if(!c(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const a=n.mul(n.pow(t.a,ic),a6),l=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(a,l)))throw new Error("bad curve params: a or b");function u(w){return Sa(w,Oe,t.n)}function f(w){const{allowedPrivateKeyLengths:$,nByteLength:k,wrapPrivateKey:B,n:F}=t;if($&&typeof w!="bigint"){if($o(w)&&(w=No(w)),typeof w!="string"||!$.includes(w.length))throw new Error("invalid private key");w=w.padStart(k*2,"0")}let m;try{m=typeof w=="bigint"?w:Un(ut("private key",w,k))}catch{throw new Error("invalid private key, expected hex or "+k+" bytes, got "+typeof w)}return B&&(m=Ge(m,F)),vr("private key",m,Oe,F),m}function d(w){if(!(w instanceof b))throw new Error("ProjectivePoint expected")}const p=Lf((w,$)=>{const{px:k,py:B,pz:F}=w;if(n.eql(F,n.ONE))return{x:k,y:B};const m=w.is0();$==null&&($=m?n.ONE:n.inv(F));const g=n.mul(k,$),v=n.mul(B,$),A=n.mul(F,$);if(m)return{x:n.ZERO,y:n.ZERO};if(!n.eql(A,n.ONE))throw new Error("invZ was invalid");return{x:g,y:v}}),h=Lf(w=>{if(w.is0()){if(t.allowInfinityPoint&&!n.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:$,y:k}=w.toAffine();if(!n.isValid($)||!n.isValid(k))throw new Error("bad point: x or y not FE");if(!c($,k))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class b{constructor($,k,B){if($==null||!n.isValid($))throw new Error("x required");if(k==null||!n.isValid(k)||n.is0(k))throw new Error("y required");if(B==null||!n.isValid(B))throw new Error("z required");this.px=$,this.py=k,this.pz=B,Object.freeze(this)}static fromAffine($){const{x:k,y:B}=$||{};if(!$||!n.isValid(k)||!n.isValid(B))throw new Error("invalid affine point");if($ instanceof b)throw new Error("projective point not allowed");const F=m=>n.eql(m,n.ZERO);return F(k)&&F(B)?b.ZERO:new b(k,B,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ($){const k=Gd(n,$.map(B=>B.pz));return $.map((B,F)=>B.toAffine(k[F])).map(b.fromAffine)}static fromHex($){const k=b.fromAffine(s(ut("pointHex",$)));return k.assertValidity(),k}static fromPrivateKey($){return b.BASE.multiply(f($))}static msm($,k){return o6(b,r,$,k)}_setWindowSize($){x.setWindowSize(this,$)}assertValidity(){h(this)}hasEvenY(){const{y:$}=this.toAffine();if(n.isOdd)return!n.isOdd($);throw new Error("Field doesn't support isOdd")}equals($){d($);const{px:k,py:B,pz:F}=this,{px:m,py:g,pz:v}=$,A=n.eql(n.mul(k,v),n.mul(m,F)),N=n.eql(n.mul(B,v),n.mul(g,F));return A&&N}negate(){return new b(this.px,n.neg(this.py),this.pz)}double(){const{a:$,b:k}=t,B=n.mul(k,ic),{px:F,py:m,pz:g}=this;let v=n.ZERO,A=n.ZERO,N=n.ZERO,O=n.mul(F,F),D=n.mul(m,m),y=n.mul(g,g),C=n.mul(F,m);return C=n.add(C,C),N=n.mul(F,g),N=n.add(N,N),v=n.mul($,N),A=n.mul(B,y),A=n.add(v,A),v=n.sub(D,A),A=n.add(D,A),A=n.mul(v,A),v=n.mul(C,v),N=n.mul(B,N),y=n.mul($,y),C=n.sub(O,y),C=n.mul($,C),C=n.add(C,N),N=n.add(O,O),O=n.add(N,O),O=n.add(O,y),O=n.mul(O,C),A=n.add(A,O),y=n.mul(m,g),y=n.add(y,y),O=n.mul(y,C),v=n.sub(v,O),N=n.mul(y,D),N=n.add(N,N),N=n.add(N,N),new b(v,A,N)}add($){d($);const{px:k,py:B,pz:F}=this,{px:m,py:g,pz:v}=$;let A=n.ZERO,N=n.ZERO,O=n.ZERO;const D=t.a,y=n.mul(t.b,ic);let C=n.mul(k,m),I=n.mul(B,g),T=n.mul(F,v),L=n.add(k,B),j=n.add(m,g);L=n.mul(L,j),j=n.add(C,I),L=n.sub(L,j),j=n.add(k,F);let z=n.add(m,v);return j=n.mul(j,z),z=n.add(C,T),j=n.sub(j,z),z=n.add(B,F),A=n.add(g,v),z=n.mul(z,A),A=n.add(I,T),z=n.sub(z,A),O=n.mul(D,j),A=n.mul(y,T),O=n.add(A,O),A=n.sub(I,O),O=n.add(I,O),N=n.mul(A,O),I=n.add(C,C),I=n.add(I,C),T=n.mul(D,T),j=n.mul(y,j),I=n.add(I,T),T=n.sub(C,T),T=n.mul(D,T),j=n.add(j,T),C=n.mul(I,j),N=n.add(N,C),C=n.mul(z,j),A=n.mul(L,A),A=n.sub(A,C),C=n.mul(L,I),O=n.mul(z,O),O=n.add(O,C),new b(A,N,O)}subtract($){return this.add($.negate())}is0(){return this.equals(b.ZERO)}wNAF($){return x.wNAFCached(this,$,b.normalizeZ)}multiplyUnsafe($){const{endo:k,n:B}=t;vr("scalar",$,on,B);const F=b.ZERO;if($===on)return F;if(this.is0()||$===Oe)return this;if(!k||x.hasPrecomputes(this))return x.wNAFCachedUnsafe(this,$,b.normalizeZ);let{k1neg:m,k1:g,k2neg:v,k2:A}=k.splitScalar($),N=F,O=F,D=this;for(;g>on||A>on;)g&Oe&&(N=N.add(D)),A&Oe&&(O=O.add(D)),D=D.double(),g>>=Oe,A>>=Oe;return m&&(N=N.negate()),v&&(O=O.negate()),O=new b(n.mul(O.px,k.beta),O.py,O.pz),N.add(O)}multiply($){const{endo:k,n:B}=t;vr("scalar",$,Oe,B);let F,m;if(k){const{k1neg:g,k1:v,k2neg:A,k2:N}=k.splitScalar($);let{p:O,f:D}=this.wNAF(v),{p:y,f:C}=this.wNAF(N);O=x.constTimeNegate(g,O),y=x.constTimeNegate(A,y),y=new b(n.mul(y.px,k.beta),y.py,y.pz),F=O.add(y),m=D.add(C)}else{const{p:g,f:v}=this.wNAF($);F=g,m=v}return b.normalizeZ([F,m])[0]}multiplyAndAddUnsafe($,k,B){const F=b.BASE,m=(v,A)=>A===on||A===Oe||!v.equals(F)?v.multiplyUnsafe(A):v.multiply(A),g=m(this,k).add(m($,B));return g.is0()?void 0:g}toAffine($){return p(this,$)}isTorsionFree(){const{h:$,isTorsionFree:k}=t;if($===Oe)return!0;if(k)return k(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:$,clearCofactor:k}=t;return $===Oe?this:k?k(b,this):this.multiplyUnsafe(t.h)}toRawBytes($=!0){return Ao("isCompressed",$),this.assertValidity(),o(b,this,$)}toHex($=!0){return Ao("isCompressed",$),No(this.toRawBytes($))}}b.BASE=new b(t.Gx,t.Gy,n.ONE),b.ZERO=new b(n.ZERO,n.ONE,n.ZERO);const{endo:S,nBitLength:P}=t,x=r6(b,S?Math.ceil(P/2):P);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:f,weierstrassEquation:i,isWithinCurveOrder:u}}function l6(e){const t=t0(e);return $s(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function u6(e){const t=l6(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,c=2*n.BYTES+1;function a(y){return Ge(y,r)}function l(y){return Qa(y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:d,isWithinCurveOrder:p}=c6({...t,toBytes(y,C,I){const T=C.toAffine(),L=n.toBytes(T.x),j=Ps;return Ao("isCompressed",I),I?j(Uint8Array.from([C.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,n.toBytes(T.y))},fromBytes(y){const C=y.length,I=y[0],T=y.subarray(1);if(C===i&&(I===2||I===3)){const L=Un(T);if(!Sa(L,Oe,n.ORDER))throw new Error("Point is not on curve");const j=d(L);let z;try{z=n.sqrt(j)}catch(K){const G=K instanceof Error?": "+K.message:"";throw new Error("Point is not on curve"+G)}const _=(z&Oe)===Oe;return(I&1)===1!==_&&(z=n.neg(z)),{x:L,y:z}}else if(C===c&&I===4){const L=n.fromBytes(T.subarray(0,n.BYTES)),j=n.fromBytes(T.subarray(n.BYTES,2*n.BYTES));return{x:L,y:j}}else{const L=i,j=c;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+j+", got "+C)}}});function h(y){const C=r>>Oe;return y>C}function b(y){return h(y)?a(-y):y}const S=(y,C,I)=>Un(y.slice(C,I));class P{constructor(C,I,T){vr("r",C,Oe,r),vr("s",I,Oe,r),this.r=C,this.s=I,T!=null&&(this.recovery=T),Object.freeze(this)}static fromCompact(C){const I=o;return C=ut("compactSignature",C,I*2),new P(S(C,0,I),S(C,I,2*I))}static fromDER(C){const{r:I,s:T}=rn.toSig(ut("DER",C));return new P(I,T)}assertValidity(){}addRecoveryBit(C){return new P(this.r,this.s,C)}recoverPublicKey(C){const{r:I,s:T,recovery:L}=this,j=F(ut("msgHash",C));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const z=L===2||L===3?I+t.n:I;if(z>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const _=L&1?"03":"02",W=u.fromHex(_+sc(z,n.BYTES)),K=l(z),G=a(-j*K),H=a(T*K),q=u.BASE.multiplyAndAddUnsafe(W,G,H);if(!q)throw new Error("point at infinify");return q.assertValidity(),q}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Ss(this.toDERHex())}toDERHex(){return rn.hexFromSig(this)}toCompactRawBytes(){return Ss(this.toCompactHex())}toCompactHex(){const C=o;return sc(this.r,C)+sc(this.s,C)}}const x={isValidPrivateKey(y){try{return f(y),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const y=Yd(t.n);return e6(t.randomBytes(y),t.n)},precompute(y=8,C=u.BASE){return C._setWindowSize(y),C.multiply(BigInt(3)),C}};function w(y,C=!0){return u.fromPrivateKey(y).toRawBytes(C)}function $(y){if(typeof y=="bigint")return!1;if(y instanceof u)return!0;const I=ut("key",y).length,T=n.BYTES,L=T+1,j=2*T+1;if(!(t.allowedPrivateKeyLengths||o===L))return I===L||I===j}function k(y,C,I=!0){if($(y)===!0)throw new Error("first arg must be private key");if($(C)===!1)throw new Error("second arg must be public key");return u.fromHex(C).multiply(f(y)).toRawBytes(I)}const B=t.bits2int||function(y){if(y.length>8192)throw new Error("input is too large");const C=Un(y),I=y.length*8-s;return I>0?C>>BigInt(I):C},F=t.bits2int_modN||function(y){return a(B(y))},m=Ts(s);function g(y){return vr("num < 2^"+s,y,on,m),Co(y,o)}function v(y,C,I=A){if(["recovered","canonical"].some(ee=>ee in I))throw new Error("sign() legacy options not supported");const{hash:T,randomBytes:L}=t;let{lowS:j,prehash:z,extraEntropy:_}=I;j==null&&(j=!0),y=ut("msgHash",y),n0(I),z&&(y=ut("prehashed msgHash",T(y)));const W=F(y),K=f(C),G=[g(K),g(W)];if(_!=null&&_!==!1){const ee=_===!0?L(n.BYTES):_;G.push(ut("extraEntropy",ee))}const H=Ps(...G),q=W;function Q(ee){const pe=B(ee);if(!p(pe))return;const le=l(pe),he=u.BASE.multiply(pe).toAffine(),ie=a(he.x);if(ie===on)return;const me=a(le*a(q+ie*K));if(me===on)return;let ne=(he.x===ie?0:2)|Number(he.y&Oe),Se=me;return j&&h(me)&&(Se=b(me),ne^=1),new P(ie,Se,ne)}return{seed:H,k2sig:Q}}const A={lowS:t.lowS,prehash:!1},N={lowS:t.lowS,prehash:!1};function O(y,C,I=A){const{seed:T,k2sig:L}=v(y,C,I),j=t;return gy(j.hash.outputLen,j.nByteLength,j.hmac)(T,L)}u.BASE._setWindowSize(8);function D(y,C,I,T=N){var ne;const L=y;C=ut("msgHash",C),I=ut("publicKey",I);const{lowS:j,prehash:z,format:_}=T;if(n0(T),"strict"in T)throw new Error("options.strict was renamed to lowS");if(_!==void 0&&_!=="compact"&&_!=="der")throw new Error("format must be compact or der");const W=typeof L=="string"||$o(L),K=!W&&!_&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!W&&!K)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let G,H;try{if(K&&(G=new P(L.r,L.s)),W){try{_!=="compact"&&(G=P.fromDER(L))}catch(Se){if(!(Se instanceof rn.Err))throw Se}!G&&_!=="der"&&(G=P.fromCompact(L))}H=u.fromHex(I)}catch{return!1}if(!G||j&&G.hasHighS())return!1;z&&(C=t.hash(C));const{r:q,s:Q}=G,ee=F(C),pe=l(Q),le=a(ee*pe),he=a(q*pe),ie=(ne=u.BASE.multiplyAndAddUnsafe(H,le,he))==null?void 0:ne.toAffine();return ie?a(ie.x)===q:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:k,sign:O,verify:D,ProjectivePoint:u,Signature:P,utils:x}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function f6(e){return{hash:e,hmac:(t,...n)=>Id(e,t,I1(...n)),randomBytes:D1}}function d6(e,t){const n=r=>u6({...e,...f6(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const r0=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),o0=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),p6=BigInt(0),h6=BigInt(1),ac=BigInt(2),s0=(e,t)=>(e+t/ac)/t;function m6(e){const t=r0,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),c=BigInt(44),a=BigInt(88),l=e*e*e%t,u=l*l*e%t,f=ft(u,n,t)*u%t,d=ft(f,n,t)*u%t,p=ft(d,ac,t)*l%t,h=ft(p,o,t)*p%t,b=ft(h,s,t)*h%t,S=ft(b,c,t)*b%t,P=ft(S,a,t)*S%t,x=ft(P,c,t)*b%t,w=ft(x,n,t)*u%t,$=ft(w,i,t)*h%t,k=ft($,r,t)*l%t,B=ft(k,ac,t);if(!cc.eql(cc.sqr(B),e))throw new Error("Cannot find square root");return B}const cc=Ja(r0,void 0,void 0,{sqrt:m6}),i0=d6({a:p6,b:BigInt(7),Fp:cc,n:o0,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=o0,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-h6*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),c=s0(s*e,t),a=s0(-r*e,t);let l=Ge(e-c*n-a*o,t),u=Ge(-c*r-a*s,t);const f=l>i,d=u>i;if(f&&(l=t-l),d&&(u=t-u),l>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:l,k2neg:d,k2:u}}}},vf),b6=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:i0},Symbol.toStringTag,{value:"Module"}));function a0(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new uc({signature:e});if(typeof e.s>"u")throw new uc({signature:e});if(n&&typeof e.yParity>"u")throw new uc({signature:e});if(e.r<0n||e.r>Bd)throw new S6({value:e.r});if(e.s<0n||e.s>Bd)throw new P6({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new fc({value:e.yParity})}function g6(e){return c0(Ct(e))}function c0(e){if(e.length!==130&&e.length!==132)throw new E6({signature:e});const t=BigInt(jt(e,0,32)),n=BigInt(jt(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return lc(o)}catch{throw new fc({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function y6(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return v6(e)}function v6(e){const t=typeof e=="string"?c0(e):e instanceof Uint8Array?g6(e):typeof e.r=="string"?x6(e):e.v?w6(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return a0(t),t}function w6(e){return{r:e.r,s:e.s,yParity:lc(e.v)}}function x6(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=lc(n)),typeof r!="number")throw new fc({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function lc(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new T6({value:e})}class E6 extends te{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${nt(Uy(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class uc extends te{constructor({signature:t}){super(`Signature \`${_f(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class S6 extends te{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class P6 extends te{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class fc extends te{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class T6 extends te{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function $6(e,t={}){return typeof e.chainId=="string"?A6(e):{...e,...t.signature}}function A6(e){const{address:t,chainId:n,nonce:r}=e,o=y6(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const N6="0x8010801080108010801080108010801080108010801080108010801080108010",C6=jd("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function l0(e){if(typeof e=="string"){if(jt(e,-32)!==N6)throw new D6(e)}else a0(e.authorization)}function O6(e){l0(e);const t=Vf(jt(e,-64,-32)),n=jt(e,-t-64,-64),r=jt(e,0,-t-64),[o,s,i]=Uw(C6,n);return{authorization:$6({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...i&&i!=="0x"?{data:i,to:s}:{}}}function I6(e){try{return l0(e),!0}catch{return!1}}let D6=class extends te{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class M6 extends V{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function k6(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new M6({value:e});let[n,r="0"]=e.split(".");const o=n.startsWith("-");if(o&&(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[s,i,c]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],a=Math.round(+`${i}.${c}`);a>9?r=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):r=`${s}${a}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${o?"-":""}${n}${r}`)}function L6(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function B6(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Yt(e.nonce):void 0,storageProof:e.storageProof?L6(e.storageProof):void 0}}async function F6(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",i=n!==void 0?J(n):void 0,c=await e.request({method:"eth_getProof",params:[t,o,i||s]});return B6(c)}async function R6(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=n!==void 0?J(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}async function dc(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s,sender:i,nonce:c}){var d,p,h;const a=r||"latest",l=n!==void 0?J(n):void 0;let u=null;if(o?u=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,J(s)]},{dedupe:!0}):typeof s=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||a,J(s)]},{dedupe:!!l}):i&&typeof c=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,J(c)]},{dedupe:!0})),!u)throw new Qu({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(((h=(p=(d=e.chain)==null?void 0:d.formatters)==null?void 0:p.transaction)==null?void 0:h.format)||la)(u,"getTransaction")}async function j6(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([X(e,Do,"getBlockNumber")({}),t?X(e,dc,"getTransaction")({hash:t}):void 0]),s=(n==null?void 0:n.blockNumber)||(o==null?void 0:o.blockNumber);return s?r-s+1n:0n}async function Ls(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Ju({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||ud)(n,"getTransactionReceipt")}async function _6(e,t){var x;const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:i,blockTag:c,stateOverride:a}=t,l=t.contracts,{batchSize:u=t.batchSize??1024,deployless:f=t.deployless??!1}=typeof((x=e.batch)==null?void 0:x.multicall)=="object"?e.batch.multicall:{},d=(()=>{if(t.multicallAddress)return t.multicallAddress;if(f)return null;if(e.chain)return Sr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),p=[[]];let h=0,b=0;for(let w=0;w<l.length;w++){const{abi:$,address:k,args:B,functionName:F}=l[w];try{const m=lt({abi:$,args:B,functionName:F});b+=(m.length-2)/2,u>0&&b>u&&p[h].length>0&&(h++,b=(m.length-2)/2,p[h]=[]),p[h]=[...p[h],{allowFailure:!0,callData:m,target:k}]}catch(m){const g=br(m,{abi:$,address:k,args:B,docsPath:"/docs/contract/multicall",functionName:F,sender:n});if(!o)throw g;p[h]=[...p[h],{allowFailure:!0,callData:"0x",target:k}]}}const S=await Promise.allSettled(p.map(w=>X(e,Ot,"readContract")({...d===null?{code:Aa}:{address:d},abi:xr,account:n,args:[w],authorizationList:r,blockNumber:s,blockOverrides:i,blockTag:c,functionName:"aggregate3",stateOverride:a}))),P=[];for(let w=0;w<S.length;w++){const $=S[w];if($.status==="rejected"){if(!o)throw $.reason;for(let B=0;B<p[w].length;B++)P.push({status:"failure",error:$.reason,result:void 0});continue}const k=$.value;for(let B=0;B<k.length;B++){const{returnData:F,success:m}=k[B],{callData:g}=p[w][B],{abi:v,address:A,functionName:N,args:O}=l[P.length];try{if(g==="0x")throw new Vr;if(!m)throw new bs({data:F});const D=xn({abi:v,args:O,data:F,functionName:N});P.push(o?{result:D,status:"success"}:D)}catch(D){const y=br(D,{abi:v,address:A,args:O,docsPath:"/docs/contract/multicall",functionName:N});if(!o)throw y;P.push({error:y,result:void 0,status:"failure"})}}}if(P.length!==l.length)throw new V("multicall results mismatch");return P}async function pc(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:i,validation:c}=t;try{const a=[];for(const d of o){const p=d.blockOverrides?Yf(d.blockOverrides):void 0,h=d.calls.map(S=>{const P=S,x=P.account?tt(P.account):void 0,w=P.abi?lt(P):P.data,$={...P,account:x,data:P.dataSuffix?$t([w||"0x",P.dataSuffix]):w,from:P.from??(x==null?void 0:x.address)};return yr($),Po($)}),b=d.stateOverrides?aa(d.stateOverrides):void 0;a.push({blockOverrides:p,calls:h,stateOverrides:b})}const u=(typeof n=="bigint"?J(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:s,traceTransfers:i,validation:c},u]})).map((d,p)=>({...hf(d),calls:d.calls.map((h,b)=>{var v,A;const{abi:S,args:P,functionName:x,to:w}=o[p].calls[b],$=((v=h.error)==null?void 0:v.data)??h.returnData,k=BigInt(h.gasUsed),B=(A=h.logs)==null?void 0:A.map(N=>Rt(N)),F=h.status==="0x1"?"success":"failure",m=S&&F==="success"&&$!=="0x"?xn({abi:S,data:$,functionName:x}):null,g=(()=>{if(F==="success")return;let N;if($==="0x"?N=new Vr:$&&(N=new bs({data:$})),!!N)return br(N,{abi:S??[],address:w??"0x",args:P,functionName:x??"<unknown>"})})();return{data:$,gasUsed:k,logs:B,status:F,...F==="success"?{result:m}:{error:g}}})}))}catch(a){const l=a,u=vs(l,{});throw u instanceof So?l:u}}function hc(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function","error",""].includes(o))o="";else if(o+=c,c===")"){s=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=c,n+=c}}if(!s)throw new te("Unable to normalize signature.");return o}function mc(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Ha(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((o,s)=>mc(Object.values(e)[s],o)):/^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(o=>mc(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function u0(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return u0(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?Ha(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?Ha(n[r],{strict:!1}):!1)return i}}function f0(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?cu(e):e;return{...r,...n?{hash:$r(r)}:{}}}function Bs(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=Wy(t,{strict:!1}),i=e.filter(l=>s?l.type==="function"||l.type==="error"?d0(l)===jt(t,0,4):l.type==="event"?$r(l)===t:!1:"name"in l&&l.name===t);if(i.length===0)throw new Fs({name:t});if(i.length===1)return{...i[0],...o?{hash:$r(i[0])}:{}};let c;for(const l of i){if(!("inputs"in l))continue;if(!r||r.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...o?{hash:$r(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==r.length)continue;if(r.every((f,d)=>{const p="inputs"in l&&l.inputs[d];return p?mc(f,p):!1})){if(c&&"inputs"in c&&c.inputs){const f=u0(l.inputs,c.inputs,r);if(f)throw new U6({abiItem:l,type:f[0]},{abiItem:c,type:f[1]})}c=l}}const a=(()=>{if(c)return c;const[l,...u]=i;return{...l,overloads:u}})();if(!a)throw new Fs({name:t});return{...a,...o?{hash:$r(a)}:{}}}function d0(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Bs(n,r)}return e[0]})();return jt($r(t),0,4)}function z6(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return Bs(r,o)}return e[0]})(),n=typeof t=="string"?t:is(t);return hc(n)}function $r(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Bs(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:Dd(Ta(z6(t)))}class U6 extends te{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${hc(is(t.abiItem))}\`, and`,`\`${n.type}\` in \`${hc(is(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 Fs extends te{constructor({name:t,data:n,type:r="item"}){const o=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${o} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function W6(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,c]=e;return[V6(i),c]}return e})(),{bytecode:r,args:o}=n;return Nt(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?Ka(t.inputs,o):"0x")}function H6(e){return f0(e)}function V6(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new Fs({name:"constructor"});return t}function G6(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[l,u,f]=e;return[p0(l,u,{args:f}),f]}const[c,a]=e;return[c,a]})(),{overloads:r}=t,o=r?p0([t,...r],t.name,{args:n}):t,s=q6(o),i=n.length>0?Ka(o.inputs,n):void 0;return i?Nt(s,i):s}function Ar(e,t={}){return f0(e,t)}function p0(e,t,n){const r=Bs(e,t,n);if(r.type!=="function")throw new Fs({name:t,type:"function"});return r}function q6(e){return d0(e)}const Z6="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",It="0x0000000000000000000000000000000000000000",K6="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function Y6(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:c,validation:a}=t,l=t.account?tt(t.account):void 0;if(i&&!l)throw new V("`account` is required when `traceAssetChanges` is true");const u=l?W6(H6("constructor(bytes, bytes)"),{bytecode:rd,args:[K6,G6(Ar("function getBalance(address)"),[l.address])]}):void 0,f=i?await Promise.all(t.calls.map(async T=>{if(!T.data&&!T.abi)return;const{accessList:L}=await vd(e,{account:l.address,...T,data:T.abi?lt(T):T.data});return L.map(({address:j,storageKeys:z})=>z.length>0?j:null)})).then(T=>T.flat().filter(Boolean)):[],d=await pc(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:f.map((T,L)=>({abi:[Ar("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:T,from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]}]:[],{calls:[...o,{to:It}].map(T=>({...T,from:l==null?void 0:l.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:f.map((T,L)=>({abi:[Ar("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:T,from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]},{calls:f.map((T,L)=>({to:T,abi:[Ar("function decimals() returns (uint256)")],functionName:"decimals",from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]},{calls:f.map((T,L)=>({to:T,abi:[Ar("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]},{calls:f.map((T,L)=>({to:T,abi:[Ar("function symbol() returns (string)")],functionName:"symbol",from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]}]:[]],traceTransfers:c,validation:a}),p=i?d[2]:d[0],[h,b,,S,P,x,w,$]=i?d:[],{calls:k,...B}=p,F=k.slice(0,-1)??[],m=(h==null?void 0:h.calls)??[],g=(b==null?void 0:b.calls)??[],v=[...m,...g].map(T=>T.status==="success"?Lt(T.data):null),A=(S==null?void 0:S.calls)??[],N=(P==null?void 0:P.calls)??[],O=[...A,...N].map(T=>T.status==="success"?Lt(T.data):null),D=((x==null?void 0:x.calls)??[]).map(T=>T.status==="success"?T.result:null),y=(($==null?void 0:$.calls)??[]).map(T=>T.status==="success"?T.result:null),C=((w==null?void 0:w.calls)??[]).map(T=>T.status==="success"?T.result:null),I=[];for(const[T,L]of O.entries()){const j=v[T];if(typeof L!="bigint"||typeof j!="bigint")continue;const z=D[T-1],_=y[T-1],W=C[T-1],K=T===0?{address:Z6,decimals:18,symbol:"ETH"}:{address:f[T-1],decimals:W||z?Number(z??1):void 0,symbol:_??void 0};I.some(G=>G.token.address===K.address)||I.push({token:K,value:{pre:j,post:L,diff:L-j}})}return{assetChanges:I,block:B,results:F}}const h0="0x6492649264926492649264926492649264926492649264926492649264926492";function X6(e){if(jt(e,-32)!==h0)throw new e5(e)}function Q6(e){const{data:t,signature:n,to:r}=e;return Nt(Ka(jd("address, bytes, bytes"),[r,t,n]),h0)}function J6(e){try{return X6(e),!0}catch{return!1}}class e5 extends te{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function t5({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(o===0||o===1)return o;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new i0.Signature(Lt(e),Lt(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:Bt(i)}async function Rs(e,t){var a,l,u,f;const{address:n,chain:r=e.chain,hash:o,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??((l=(a=r==null?void 0:r.contracts)==null?void 0:a.erc6492Verifier)==null?void 0:l.address),multicallAddress:i=t.multicallAddress??((f=(u=r==null?void 0:r.contracts)==null?void 0:u.multicall3)==null?void 0:f.address)}=t;if(r!=null&&r.verifyHash)return await r.verifyHash(e,t);const c=(()=>{const d=t.signature;return Pt(d)?d:typeof d=="object"&&"r"in d&&"s"in d?t5(d):Ae(d)})();try{return I6(c)?await n5(e,{...t,multicallAddress:i,signature:c}):await r5(e,{...t,verifierAddress:s,signature:c})}catch(d){try{if(To(Qt(n),await of({hash:o,signature:c})))return!0}catch{}if(d instanceof Gn)return!1;throw d}}async function n5(e,t){var S;const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:i}=t,{authorization:c,data:a,signature:l,to:u}=O6(t.signature);if(await Ds(e,{address:n,blockNumber:r,blockTag:o})===dr(["0xef0100",c.address]))return await o5(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:l});const d={address:c.address,chainId:Number(c.chainId),nonce:Number(c.nonce),r:J(c.r,{size:32}),s:J(c.s,{size:32}),yParity:c.yParity};if(!await Hv({address:n,authorization:d}))throw new Gn;const h=await X(e,Ot,"readContract")({...i?{address:i}:{code:Aa},authorizationList:[d],abi:xr,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...a?[{allowFailure:!0,target:u??n,callData:a}]:[],{allowFailure:!0,target:n,callData:lt({abi:td,functionName:"isValidSignature",args:[s,l]})}]]}),b=(S=h[h.length-1])==null?void 0:S.returnData;if(b!=null&&b.startsWith("0x1626ba7e"))return!0;throw new Gn}async function r5(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:c,...a}=t,l=await(async()=>!r&&!o||J6(i)?i:Q6({data:o,signature:i,to:r}))(),u=c?{to:c,data:lt({abi:nd,functionName:"isValidSig",args:[n,s,l]}),...a}:{data:Oa({abi:nd,args:[n,s,l],bytecode:Yy}),...a},{data:f}=await X(e,Pr,"call")(u).catch(d=>{throw d instanceof ef?new Gn:d});if(d1(f??"0x0"))return!0;throw new Gn}async function o5(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:i}=t;if((await X(e,Ot,"readContract")({address:n,abi:td,args:[s,i],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(a=>{throw a instanceof tf?new Gn:a})).startsWith("0x1626ba7e"))return!0;throw new Gn}class Gn extends Error{}async function s5(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const c=Td(n);return X(e,Rs,"verifyHash")({address:t,factory:r,factoryData:o,hash:c,signature:s,...i})}async function i5(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:c,types:a,domain:l,...u}=t,f=pw({message:i,primaryType:c,types:a,domain:l});return X(e,Rs,"verifyHash")({address:n,factory:r,factoryData:o,hash:f,signature:s,...u})}function m0(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:i=e.pollingInterval}){const c=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let a;return c?(()=>{const f=Ne(["watchBlockNumber",e.uid,t,n,i]);return En(f,{onBlockNumber:r,onError:o},d=>Io(async()=>{var p;try{const h=await X(e,Do,"getBlockNumber")({cacheTime:0});if(a!==void 0){if(h===a)return;if(h-a>1&&n)for(let b=a+1n;b<h;b++)d.onBlockNumber(b,a),a=b}(a===void 0||h>a)&&(d.onBlockNumber(h,a),a=h)}catch(h){(p=d.onError)==null||p.call(d,h)}},{emitOnBegin:t,interval:i}))})():(()=>{const f=Ne(["watchBlockNumber",e.uid,t,n]);return En(f,{onBlockNumber:r,onError:o},d=>{let p=!0,h=()=>p=!1;return(async()=>{try{const b=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(x=>x.config.type==="webSocket"||x.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),{unsubscribe:S}=await b.subscribe({params:["newHeads"],onData(P){var w;if(!p)return;const x=Lt((w=P.result)==null?void 0:w.number);d.onBlockNumber(x,a),a=x},onError(P){var x;(x=d.onError)==null||x.call(d,P)}});h=S,p||h()}catch(b){o==null||o(b)}})(),()=>h()})})()}async function a5(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:c=({count:k})=>~~(1<<k)*200,timeout:a=18e4}=t,l=Ne(["waitForTransactionReceipt",e.uid,o]),u=(()=>{var k;return t.pollingInterval?t.pollingInterval:(k=e.chain)!=null&&k.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let f,d,p,h=!1,b,S;const{promise:P,resolve:x,reject:w}=id(),$=a?setTimeout(()=>{S==null||S(),b==null||b(),w(new Ag({hash:o}))},a):void 0;return b=En(l,{onReplaced:s,resolve:x,reject:w},async k=>{if(p=await X(e,Ls,"getTransactionReceipt")({hash:o}).catch(()=>{}),p&&r<=1){clearTimeout($),k.resolve(p),b==null||b();return}S=X(e,m0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(B){const F=g=>{clearTimeout($),S==null||S(),g(),b==null||b()};let m=B;if(!h)try{if(p){if(r>1&&(!p.blockNumber||m-p.blockNumber+1n<r))return;F(()=>k.resolve(p));return}if(n&&!f&&(h=!0,await ka(async()=>{f=await X(e,dc,"getTransaction")({hash:o}),f.blockNumber&&(m=f.blockNumber)},{delay:c,retryCount:i}),h=!1),p=await X(e,Ls,"getTransactionReceipt")({hash:o}),r>1&&(!p.blockNumber||m-p.blockNumber+1n<r))return;F(()=>k.resolve(p))}catch(g){if(g instanceof Qu||g instanceof Ju){if(!f){h=!1;return}try{d=f,h=!0;const v=await ka(()=>X(e,At,"getBlock")({blockNumber:m,includeTransactions:!0}),{delay:c,retryCount:i,shouldRetry:({error:O})=>O instanceof df});h=!1;const A=v.transactions.find(({from:O,nonce:D})=>O===d.from&&D===d.nonce);if(!A||(p=await X(e,Ls,"getTransactionReceipt")({hash:A.hash}),r>1&&(!p.blockNumber||m-p.blockNumber+1n<r)))return;let N="replaced";A.to===d.to&&A.value===d.value&&A.input===d.input?N="repriced":A.from===A.to&&A.value===0n&&(N="cancelled"),F(()=>{var O;(O=k.onReplaced)==null||O.call(k,{reason:N,replacedTransaction:d,transaction:A,transactionReceipt:p}),k.resolve(p)})}catch(v){F(()=>k.reject(v))}}else F(()=>k.reject(g))}}})}),P}function c5(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:i,poll:c,pollingInterval:a=e.pollingInterval}){const l=typeof c<"u"?c:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),u=i??!1;let f;return l?(()=>{const h=Ne(["watchBlocks",e.uid,t,n,r,u,a]);return En(h,{onBlock:o,onError:s},b=>Io(async()=>{var S;try{const P=await X(e,At,"getBlock")({blockTag:t,includeTransactions:u});if(P.number!==null&&(f==null?void 0:f.number)!=null){if(P.number===f.number)return;if(P.number-f.number>1&&n)for(let x=(f==null?void 0:f.number)+1n;x<P.number;x++){const w=await X(e,At,"getBlock")({blockNumber:x,includeTransactions:u});b.onBlock(w,f),f=w}}((f==null?void 0:f.number)==null||t==="pending"&&(P==null?void 0:P.number)==null||P.number!==null&&P.number>f.number)&&(b.onBlock(P,f),f=P)}catch(P){(S=b.onError)==null||S.call(b,P)}},{emitOnBegin:r,interval:a}))})():(()=>{let h=!0,b=!0,S=()=>h=!1;return(async()=>{try{r&&X(e,At,"getBlock")({blockTag:t,includeTransactions:u}).then(w=>{h&&b&&(o(w,void 0),b=!1)}).catch(s);const P=(()=>{if(e.transport.type==="fallback"){const w=e.transport.transports.find($=>$.config.type==="webSocket"||$.config.type==="ipc");return w?w.value:e.transport}return e.transport})(),{unsubscribe:x}=await P.subscribe({params:["newHeads"],async onData(w){var k;if(!h)return;const $=await X(e,At,"getBlock")({blockNumber:(k=w.result)==null?void 0:k.number,includeTransactions:u}).catch(()=>{});h&&(o($,f),b=!1,f=$)},onError(w){s==null||s(w)}});S=x,h||S()}catch(P){s==null||s(P)}})(),()=>S()})()}function l5(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:i,onError:c,onLogs:a,poll:l,pollingInterval:u=e.pollingInterval,strict:f}){const d=typeof l<"u"?l:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),p=f??!1;return d?(()=>{const S=Ne(["watchEvent",t,n,r,e.uid,o,u,i]);return En(S,{onLogs:a,onError:c},P=>{let x;i!==void 0&&(x=i-1n);let w,$=!1;const k=Io(async()=>{var B;if(!$){try{w=await X(e,wd,"createEventFilter")({address:t,args:n,event:o,events:s,strict:p,fromBlock:i})}catch{}$=!0;return}try{let F;if(w)F=await X(e,Ns,"getFilterChanges")({filter:w});else{const m=await X(e,Do,"getBlockNumber")({});x&&x!==m?F=await X(e,ga,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:x+1n,toBlock:m}):F=[],x=m}if(F.length===0)return;if(r)P.onLogs(F);else for(const m of F)P.onLogs([m])}catch(F){w&&F instanceof yn&&($=!1),(B=P.onError)==null||B.call(P,F)}},{emitOnBegin:!0,interval:u});return async()=>{w&&await X(e,Cs,"uninstallFilter")({filter:w}),k()}})})():(()=>{let S=!0,P=()=>S=!1;return(async()=>{try{const x=(()=>{if(e.transport.type==="fallback"){const B=e.transport.transports.find(F=>F.config.type==="webSocket"||F.config.type==="ipc");return B?B.value:e.transport}return e.transport})(),w=s??(o?[o]:void 0);let $=[];w&&($=[w.flatMap(F=>Yr({abi:[F],eventName:F.name,args:n}))],o&&($=$[0]));const{unsubscribe:k}=await x.subscribe({params:["logs",{address:t,topics:$}],onData(B){var m;if(!S)return;const F=B.result;try{const{eventName:g,args:v}=xs({abi:w??[],data:F.data,topics:F.topics,strict:p}),A=Rt(F,{args:v,eventName:g});a([A])}catch(g){let v,A;if(g instanceof ls||g instanceof Bi){if(f)return;v=g.abiItem.name,A=(m=g.abiItem.inputs)==null?void 0:m.some(O=>!("name"in O&&O.name))}const N=Rt(F,{args:A?[]:{},eventName:v});a([N])}},onError(B){c==null||c(B)}});P=k,S||P()}catch(x){c==null||c(x)}})(),()=>P()})()}function u5(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const l=Ne(["watchPendingTransactions",e.uid,t,s]);return En(l,{onTransactions:r,onError:n},u=>{let f;const d=Io(async()=>{var p;try{if(!f)try{f=await X(e,xd,"createPendingTransactionFilter")({});return}catch(b){throw d(),b}const h=await X(e,Ns,"getFilterChanges")({filter:f});if(h.length===0)return;if(t)u.onTransactions(h);else for(const b of h)u.onTransactions([b])}catch(h){(p=u.onError)==null||p.call(u,h)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await X(e,Cs,"uninstallFilter")({filter:f}),d()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!l)return;const p=d.result;r([p])},onError(d){n==null||n(d)}});u=f,l||u()}catch(f){n==null||n(f)}})(),()=>u()})()}function f5(e){var f,d,p;const{scheme:t,statement:n,...r}=((f=e.match(d5))==null?void 0:f.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:c,requestId:a,...l}=((d=e.match(p5))==null?void 0:d.groups)??{},u=(p=e.split("Resources:")[1])==null?void 0:p.split(`
91
+ - `).slice(1);return{...r,...l,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...i?{issuedAt:new Date(i)}:{},...c?{notBefore:new Date(c)}:{},...a?{requestId:a}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const d5=/^(?:(?<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)?/,p5=/(?: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 h5(e){const{address:t,domain:n,message:r,nonce:o,scheme:s,time:i=new Date}=e;if(n&&r.domain!==n||o&&r.nonce!==o||s&&r.scheme!==s||r.expirationTime&&i>=r.expirationTime||r.notBefore&&i<r.notBefore)return!1;try{if(!r.address||!ct(r.address,{strict:!1})||t&&!To(r.address,t))return!1}catch{return!1}return!0}async function m5(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:i,signature:c,time:a=new Date,...l}=t,u=f5(o);if(!u.address||!h5({address:n,domain:r,message:u,nonce:s,scheme:i,time:a}))return!1;const d=Td(o);return Rs(e,{address:u.address,hash:d,signature:c,...l})}async function b5(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var c,a,l;const o=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,r]:[t]},{retryCount:0}),i=(((l=(a=(c=e.chain)==null?void 0:c.formatters)==null?void 0:a.transactionReceipt)==null?void 0:l.format)||ud)(o);if(i.status==="reverted"&&n)throw new $g({receipt:i});return i}function g5(e){return{call:t=>Pr(e,t),createAccessList:t=>vd(e,t),createBlockFilter:()=>Mv(e),createContractEventFilter:t=>Wu(e,t),createEventFilter:t=>wd(e,t),createPendingTransactionFilter:()=>xd(e),estimateContractGas:t=>dy(e,t),estimateGas:t=>ma(e,t),getBalance:t=>kv(e,t),getBlobBaseFee:()=>Lv(e),getBlock:t=>At(e,t),getBlockNumber:t=>Do(e,t),getBlockTransactionCount:t=>Bv(e,t),getBytecode:t=>Ds(e,t),getChainId:()=>pa(e),getCode:t=>Ds(e,t),getContractEvents:t=>Nf(e,t),getDelegation:t=>Fv(e,t),getEip712Domain:t=>jv(e,t),getEnsAddress:t=>gv(e,t),getEnsAvatar:t=>Ov(e,t),getEnsName:t=>Iv(e,t),getEnsResolver:t=>Dv(e,t),getEnsText:t=>yd(e,t),getFeeHistory:t=>Uv(e,t),estimateFeesPerGas:t=>Zg(e,t),getFilterChanges:t=>Ns(e,t),getFilterLogs:t=>Wv(e,t),getGasPrice:()=>ua(e),getLogs:t=>ga(e,t),getProof:t=>F6(e,t),estimateMaxPriorityFeePerGas:t=>qg(e,t),fillTransaction:t=>Pf(e,t),getStorageAt:t=>R6(e,t),getTransaction:t=>dc(e,t),getTransactionConfirmations:t=>j6(e,t),getTransactionCount:t=>bf(e,t),getTransactionReceipt:t=>Ls(e,t),multicall:t=>_6(e,t),prepareTransactionRequest:t=>$f(e,t),readContract:t=>Ot(e,t),sendRawTransaction:t=>lv(e,t),sendRawTransactionSync:t=>b5(e,t),simulate:t=>pc(e,t),simulateBlocks:t=>pc(e,t),simulateCalls:t=>Y6(e,t),simulateContract:t=>tv(e,t),verifyHash:t=>Rs(e,t),verifyMessage:t=>s5(e,t),verifySiweMessage:t=>m5(e,t),verifyTypedData:t=>i5(e,t),uninstallFilter:t=>Cs(e,t),waitForTransactionReceipt:t=>a5(e,t),watchBlocks:t=>c5(e,t),watchBlockNumber:t=>m0(e,t),watchContractEvent:t=>cv(e,t),watchEvent:t=>l5(e,t),watchPendingTransactions:t=>u5(e,t)}}function y5(e){const{key:t="public",name:n="Public Client"}=e;return fv({...e,key:t,name:n,type:"publicClient"}).extend(g5)}function v5({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:i,type:c},a){const l=fd();return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:i,type:c},request:Gv(r,{methods:t,retryCount:o,retryDelay:s,uid:l}),value:a}}class w5 extends V{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 x5(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:i,name:c="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:l,retryDelay:u,raw:f}=t;return({chain:d,retryCount:p,timeout:h})=>{const{batchSize:b=1e3,wait:S=0}=typeof n=="object"?n:{},P=t.retryCount??p,x=h??t.timeout??1e4,w=e||(d==null?void 0:d.rpcUrls.default.http[0]);if(!w)throw new w5;const $=rw(w,{fetchFn:r,fetchOptions:o,onRequest:a,onResponse:l,timeout:x});return v5({key:s,methods:i,name:c,async request({method:k,params:B}){const F={method:k,params:B},{schedule:m}=ad({id:w,wait:S,shouldSplitBatch(N){return N.length>b},fn:N=>$.request({body:N}),sort:(N,O)=>N.id-O.id}),g=async N=>n?m(N):[await $.request({body:N})],[{error:v,result:A}]=await g(F);if(f)return{error:v,result:A};if(v)throw new Qi({body:F,error:v,url:w});return A},retryCount:P,retryDelay:u,timeout:x,type:"http"},{fetchOptions:o,url:w})}}const E5=ew({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,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}}});function S5({client:e,tokenAddress:t,holder:n,decimals:r,fallbackFormatted:o="0",pollingInterval:s=12e3}){const[i,c]=E.useState(null),[a,l]=E.useState(o);return E.useEffect(()=>{let u,f;const d=async()=>{try{const p=await e.readContract({address:t,abi:Er,functionName:"balanceOf",args:[n]});c(p),l(Ki(p,r))}catch{l(o)}};d();try{u=e.watchContractEvent({address:t,abi:Er,eventName:"Transfer",args:{to:n},onLogs:()=>{d()},poll:!0,pollingInterval:s}),f=e.watchContractEvent({address:t,abi:Er,eventName:"Transfer",args:{from:n},onLogs:()=>{d()},poll:!0,pollingInterval:s})}catch{}return()=>{u==null||u(),f==null||f()}},[e,t,n,r,o,s]),{value:i,formatted:a}}const P5=()=>({openDeposit:E.useCallback(t=>{},[])}),T5=()=>({openWithdraw:E.useCallback(t=>{},[])}),Sn="MPC",bc="EVM",$5="spot",b0="perpetual";/**
92
92
  * @license lucide-react v0.540.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
- */const y5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),v5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),c0=e=>{const t=v5(e);return t.charAt(0).toUpperCase()+t.slice(1)},l0=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),w5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
96
+ */const A5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),N5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),g0=e=>{const t=N5(e);return t.charAt(0).toUpperCase()+t.slice(1)},y0=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),C5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
97
97
  * @license lucide-react v0.540.0 - ISC
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */var x5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
101
+ */var O5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
102
102
  * @license lucide-react v0.540.0 - ISC
103
103
  *
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
- */const E5=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...c},a)=>x.createElement("svg",{ref:a,...x5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:l0("lucide",o),...!s&&!w5(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,u])=>x.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
106
+ */const I5=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...c},a)=>E.createElement("svg",{ref:a,...O5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:y0("lucide",o),...!s&&!C5(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,u])=>E.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
107
107
  * @license lucide-react v0.540.0 - ISC
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
- */const S5=(e,t)=>{const n=x.forwardRef(({className:r,...o},s)=>x.createElement(E5,{ref:s,iconNode:t,className:l0(`lucide-${y5(c0(e))}`,`lucide-${e}`,r),...o}));return n.displayName=c0(e),n};/**
111
+ */const D5=(e,t)=>{const n=E.forwardRef(({className:r,...o},s)=>E.createElement(I5,{ref:s,iconNode:t,className:y0(`lucide-${A5(g0(e))}`,`lucide-${e}`,r),...o}));return n.displayName=g0(e),n};/**
112
112
  * @license lucide-react v0.540.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
- */const u0=S5("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),f0=typeof document<"u"?x.useLayoutEffect:()=>{};var ic;const P5=(ic=x.useInsertionEffect)!==null&&ic!==void 0?ic:f0;function T5(e){const t=x.useRef(null);return P5(()=>{t.current=e},[e]),x.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const En=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Hn=e=>e&&"window"in e&&e.window===e?e:En(e).defaultView||window;function A5(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function $5(e){return A5(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let C5=!1;function ac(){return C5}function d0(e,t){if(!ac())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:$5(n)?n=n.host:n=n.parentNode}return!1}const cc=(e=document)=>{var t;if(!ac())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function p0(e){return ac()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Ns(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function lc(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 rn(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const uc=rn(function(){return lc(/^Mac/i)}),N5=rn(function(){return lc(/^iPhone/i)}),O5=rn(function(){return lc(/^iPad/i)||uc()&&navigator.maxTouchPoints>1}),I5=rn(function(){return N5()||O5()});rn(function(){return uc()||I5()}),rn(function(){return Ns(/AppleWebKit/i)&&!k5()});const k5=rn(function(){return Ns(/Chrome/i)}),D5=rn(function(){return Ns(/Android/i)});rn(function(){return Ns(/Firefox/i)});function h0(){let e=x.useRef(new Map),t=x.useCallback((o,s,i,c)=>{let a=c!=null&&c.once?(...l)=>{e.current.delete(i),i(...l)}:i;e.current.set(i,{type:s,eventTarget:o,fn:a,options:c}),o.addEventListener(s,a,c)},[]),n=x.useCallback((o,s,i,c)=>{var a;let l=((a=e.current.get(i))===null||a===void 0?void 0:a.fn)||i;o.removeEventListener(s,l,c),e.current.delete(i)},[]),r=x.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return x.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function M5(e){return e.pointerType===""&&e.isTrusted?!0:D5()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function m0(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function L5(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function b0(e){let t=x.useRef({isFocused:!1,observer:null});f0(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=T5(r=>{e==null||e(r)});return x.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,s=i=>{if(t.current.isFocused=!1,o.disabled){let c=m0(i);n(c)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let c=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:c})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:c}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let B5=!1,No=null,fc=new Set,Oo=new Map,Vn=!1,dc=!1;const F5={Tab:!0,Escape:!0};function pc(e,t){for(let n of fc)n(e,t)}function R5(e){return!(e.metaKey||!uc()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Os(e){Vn=!0,R5(e)&&(No="keyboard",pc("keyboard",e))}function ut(e){No="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Vn=!0,pc("pointer",e))}function g0(e){M5(e)&&(Vn=!0,No="virtual")}function y0(e){e.target===window||e.target===document||B5||!e.isTrusted||(!Vn&&!dc&&(No="virtual",pc("virtual",e)),Vn=!1,dc=!1)}function v0(){Vn=!1,dc=!0}function hc(e){if(typeof window>"u"||typeof document>"u"||Oo.get(Hn(e)))return;const t=Hn(e),n=En(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Vn=!0,r.apply(this,arguments)},n.addEventListener("keydown",Os,!0),n.addEventListener("keyup",Os,!0),n.addEventListener("click",g0,!0),t.addEventListener("focus",y0,!0),t.addEventListener("blur",v0,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ut,!0),n.addEventListener("pointermove",ut,!0),n.addEventListener("pointerup",ut,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ut,!0),n.addEventListener("mousemove",ut,!0),n.addEventListener("mouseup",ut,!0)),t.addEventListener("beforeunload",()=>{w0(e)},{once:!0}),Oo.set(t,{focus:r})}const w0=(e,t)=>{const n=Hn(e),r=En(e);t&&r.removeEventListener("DOMContentLoaded",t),Oo.has(n)&&(n.HTMLElement.prototype.focus=Oo.get(n).focus,r.removeEventListener("keydown",Os,!0),r.removeEventListener("keyup",Os,!0),r.removeEventListener("click",g0,!0),n.removeEventListener("focus",y0,!0),n.removeEventListener("blur",v0,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ut,!0),r.removeEventListener("pointermove",ut,!0),r.removeEventListener("pointerup",ut,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",ut,!0),r.removeEventListener("mousemove",ut,!0),r.removeEventListener("mouseup",ut,!0)),Oo.delete(n))};function j5(e){const t=En(e);let n;return t.readyState!=="loading"?hc(e):(n=()=>{hc(e)},t.addEventListener("DOMContentLoaded",n)),()=>w0(e,n)}typeof document<"u"&&j5();function x0(){return No!=="pointer"}const _5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function z5(e,t,n){let r=En(n==null?void 0:n.target);const o=typeof window<"u"?Hn(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Hn(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Hn(n==null?void 0:n.target).HTMLElement:HTMLElement,c=typeof window<"u"?Hn(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!_5.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!F5[n.key])}function U5(e,t,n){hc(),x.useEffect(()=>{let r=(o,s)=>{z5(!!(n!=null&&n.isTextInput),o,s)&&e(x0())};return fc.add(r),()=>{fc.delete(r)}},t)}function W5(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=x.useCallback(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),i=b0(s),c=x.useCallback(a=>{const l=En(a.target),u=l?cc(l):cc();a.target===a.currentTarget&&u===p0(a.nativeEvent)&&(n&&n(a),o&&o(!0),i(a))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?c:void 0,onBlur:!t&&(r||o)?s:void 0}}}function H5(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=x.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:c}=h0(),a=x.useCallback(f=>{f.currentTarget.contains(f.target)&&s.current.isFocusWithin&&!f.currentTarget.contains(f.relatedTarget)&&(s.current.isFocusWithin=!1,c(),n&&n(f),o&&o(!1))},[n,o,s,c]),l=b0(a),u=x.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const p=En(f.target),d=cc(p);if(!s.current.isFocusWithin&&d===p0(f.nativeEvent)){r&&r(f),o&&o(!0),s.current.isFocusWithin=!0,l(f);let h=f.currentTarget;i(p,"focus",m=>{if(s.current.isFocusWithin&&!d0(h,m.target)){let v=new p.defaultView.FocusEvent("blur",{relatedTarget:m.target});L5(v,h);let T=m0(v);a(T)}},{capture:!0})}},[r,o,l,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:a}}}let Is=!1,ks=0;function mc(){Is=!0,setTimeout(()=>{Is=!1},50)}function E0(e){e.pointerType==="touch"&&mc()}function V5(){if(!(typeof document>"u"))return ks===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",E0):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",mc)),ks++,()=>{ks--,!(ks>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",E0):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",mc))}}function G5(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=x.useState(!1),c=x.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;x.useEffect(V5,[]);let{addGlobalListener:a,removeAllGlobalListeners:l}=h0(),{hoverProps:u,triggerHoverEnd:f}=x.useMemo(()=>{let p=(m,v)=>{if(c.pointerType=v,o||v==="touch"||c.isHovered||!m.currentTarget.contains(m.target))return;c.isHovered=!0;let T=m.currentTarget;c.target=T,a(En(m.target),"pointerover",E=>{c.isHovered&&c.target&&!d0(c.target,E.target)&&d(E,E.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:T,pointerType:v}),n&&n(!0),i(!0)},d=(m,v)=>{let T=c.target;c.pointerType="",c.target=null,!(v==="touch"||!c.isHovered||!T)&&(c.isHovered=!1,l(),r&&r({type:"hoverend",target:T,pointerType:v}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=m=>{Is&&m.pointerType==="mouse"||p(m,m.pointerType)},h.onPointerLeave=m=>{!o&&m.currentTarget.contains(m.target)&&d(m,m.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{c.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=m=>{!c.ignoreEmulatedMouseEvents&&!Is&&p(m,"mouse"),c.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=m=>{!o&&m.currentTarget.contains(m.target)&&d(m,"mouse")}),{hoverProps:h,triggerHoverEnd:d}},[t,n,r,o,c,a,l]);return x.useEffect(()=>{o&&f({currentTarget:c.target},c.pointerType)},[o]),{hoverProps:u,isHovered:s}}function q5(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=x.useRef({isFocused:!1,isFocusVisible:t||x0()}),[s,i]=x.useState(!1),[c,a]=x.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=x.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),u=x.useCallback(d=>{o.current.isFocused=d,i(d),l()},[l]);U5(d=>{o.current.isFocusVisible=d,l()},[],{isTextInput:n});let{focusProps:f}=W5({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=H5({isDisabled:!r,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:c,focusProps:r?p:f}}var Z5=Object.defineProperty,K5=(e,t,n)=>t in e?Z5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bc=(e,t,n)=>(K5(e,typeof t!="symbol"?t+"":t,n),n);let Y5=class{constructor(){bc(this,"current",this.detect()),bc(this,"handoffState","pending"),bc(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"}},Rt=new Y5;function Ds(e){var t;return Rt.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Ms(e){var t,n;return Rt.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function S0(e){var t,n;return(n=(t=Ms(e))==null?void 0:t.activeElement)!=null?n:null}function X5(e){return S0(e)===e}function P0(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function nt(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},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 P0(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=nt();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 o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Gn(){let[e]=x.useState(nt);return x.useEffect(()=>()=>e.dispose(),[e]),e}let Ee=(e,t)=>{Rt.isServer?x.useEffect(e,t):x.useLayoutEffect(e,t)};function qn(e){let t=x.useRef(e);return Ee(()=>{t.current=e},[e]),t}let ue=function(e){let t=qn(e);return x.useCallback((...n)=>t.current(...n),[t])};function Q5(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 J5(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ex({disabled:e=!1}={}){let t=x.useRef(null),[n,r]=x.useState(!1),o=Gn(),s=ue(()=>{t.current=null,r(!1),o.dispose()}),i=ue(c=>{if(o.dispose(),t.current===null){t.current=c.currentTarget,r(!0);{let a=Ds(c.currentTarget);o.addEventListener(a,"pointerup",s,!1),o.addEventListener(a,"pointermove",l=>{if(t.current){let u=Q5(l);r(J5(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function Sn(e){return x.useMemo(()=>e,Object.values(e))}let tx=x.createContext(void 0);function gc(){return x.useContext(tx)}function yc(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ft(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ft),r}var Ls=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ls||{}),Pn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Pn||{});function rt(){let e=rx();return x.useCallback(t=>nx({mergeRefs:e,...t}),[e])}function nx({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:c}){c=c??ox;let a=T0(t,e);if(s)return Bs(a,n,r,i,c);let l=o??0;if(l&2){let{static:u=!1,...f}=a;if(u)return Bs(f,n,r,i,c)}if(l&1){let{unmount:u=!0,...f}=a;return ft(u?0:1,{0(){return null},1(){return Bs({...f,hidden:!0,style:{display:"none"}},n,r,i,c)}})}return Bs(a,n,r,i,c)}function Bs(e,t={},n,r,o){let{as:s=n,children:i,refName:c="ref",...a}=vc(e,["unmount","static"]),l=e.ref!==void 0?{[c]:e.ref}:{},u=typeof i=="function"?i(t):i;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let f={};if(t){let p=!1,d=[];for(let[h,m]of Object.entries(t))typeof m=="boolean"&&(p=!0),m===!0&&d.push(h.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(p){f["data-headlessui-state"]=d.join(" ");for(let h of d)f[`data-${h}`]=""}}if(Io(s)&&(Object.keys(Tn(a)).length>0||Object.keys(Tn(f)).length>0))if(!x.isValidElement(u)||Array.isArray(u)&&u.length>1||ix(u)){if(Object.keys(Tn(a)).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(Tn(a)).concat(Object.keys(Tn(f))).map(p=>` - ${p}`).join(`
117
- `),"","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(p=>` - ${p}`).join(`
116
+ */const v0=D5("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),M5=typeof document<"u"?E.useLayoutEffect:()=>{},Pn=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},qn=e=>e&&"window"in e&&e.window===e?e:Pn(e).defaultView||window;function k5(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function L5(e){return k5(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let B5=!1;function gc(){return B5}function Tn(e,t){if(!gc())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:L5(n)?n=n.host:n=n.parentNode}return!1}const Nr=(e=document)=>{var t;if(!gc())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Me(e){if(gc()&&e.target instanceof Element&&e.target.shadowRoot){var t,n;if("composedPath"in e)return(t=e.composedPath()[0])!==null&&t!==void 0?t:null;if("composedPath"in e.nativeEvent)return(n=e.nativeEvent.composedPath()[0])!==null&&n!==void 0?n:null}return e.target}function F5(e){if(R5())e.focus({preventScroll:!0});else{let t=j5(e);e.focus(),_5(t)}}let js=null;function R5(){if(js==null){js=!1;try{document.createElement("div").focus({get preventScroll(){return js=!0,!0}})}catch{}}return js}function j5(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function _5(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function _s(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function yc(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 sn(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const Bo=sn(function(){return yc(/^Mac/i)}),z5=sn(function(){return yc(/^iPhone/i)}),w0=sn(function(){return yc(/^iPad/i)||Bo()&&navigator.maxTouchPoints>1}),U5=sn(function(){return z5()||w0()});sn(function(){return Bo()||U5()});const W5=sn(function(){return _s(/AppleWebKit/i)&&!H5()}),H5=sn(function(){return _s(/Chrome/i)}),V5=sn(function(){return _s(/Android/i)}),G5=sn(function(){return _s(/Firefox/i)});function Fo(e,t,n=!0){var r,o;let{metaKey:s,ctrlKey:i,altKey:c,shiftKey:a}=t;G5()&&(!((o=window.event)===null||o===void 0||(r=o.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(Bo()?s=!0:i=!0);let l=W5()&&Bo()&&!w0()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:s,ctrlKey:i,altKey:c,shiftKey:a}):new MouseEvent("click",{metaKey:s,ctrlKey:i,altKey:c,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});Fo.isOpening=n,F5(e),e.dispatchEvent(l),Fo.isOpening=!1}Fo.isOpening=!1;function x0(){let e=E.useRef(new Map),t=E.useCallback((o,s,i,c)=>{let a=c!=null&&c.once?(...l)=>{e.current.delete(i),i(...l)}:i;e.current.set(i,{type:s,eventTarget:o,fn:a,options:c}),o.addEventListener(s,a,c)},[]),n=E.useCallback((o,s,i,c)=>{var a;let l=((a=e.current.get(i))===null||a===void 0?void 0:a.fn)||i;o.removeEventListener(s,l,c),e.current.delete(i)},[]),r=E.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return E.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function q5(e){return e.pointerType===""&&e.isTrusted?!0:V5()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function E0(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Z5(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function S0(e){let t=E.useRef({isFocused:!1,observer:null});return M5(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),E.useCallback(n=>{let r=Me(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r,s=i=>{if(t.current.isFocused=!1,o.disabled){let c=E0(i);e==null||e(c)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let c=o===Nr()?null:Nr();o.dispatchEvent(new FocusEvent("blur",{relatedTarget:c})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:c}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let K5=!1,Ro=null;const vc=new Set;let jo=new Map,Zn=!1,wc=!1;const Y5={Tab:!0,Escape:!0};function xc(e,t){for(let n of vc)n(e,t)}function X5(e){return!(e.metaKey||!Bo()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function zs(e){Zn=!0,!Fo.isOpening&&X5(e)&&(Ro="keyboard",xc("keyboard",e))}function dt(e){Ro="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(Zn=!0,xc("pointer",e))}function P0(e){!Fo.isOpening&&q5(e)&&(Zn=!0,Ro="virtual")}function T0(e){Me(e)===window||Me(e)===document||K5||!e.isTrusted||(!Zn&&!wc&&(Ro="virtual",xc("virtual",e)),Zn=!1,wc=!1)}function $0(){Zn=!1,wc=!0}function Ec(e){if(typeof window>"u"||typeof document>"u"||jo.get(qn(e)))return;const t=qn(e),n=Pn(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Zn=!0,r.apply(this,arguments)},n.addEventListener("keydown",zs,!0),n.addEventListener("keyup",zs,!0),n.addEventListener("click",P0,!0),t.addEventListener("focus",T0,!0),t.addEventListener("blur",$0,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",dt,!0),n.addEventListener("pointermove",dt,!0),n.addEventListener("pointerup",dt,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",dt,!0),n.addEventListener("mousemove",dt,!0),n.addEventListener("mouseup",dt,!0)),t.addEventListener("beforeunload",()=>{A0(e)},{once:!0}),jo.set(t,{focus:r})}const A0=(e,t)=>{const n=qn(e),r=Pn(e);t&&r.removeEventListener("DOMContentLoaded",t),jo.has(n)&&(n.HTMLElement.prototype.focus=jo.get(n).focus,r.removeEventListener("keydown",zs,!0),r.removeEventListener("keyup",zs,!0),r.removeEventListener("click",P0,!0),n.removeEventListener("focus",T0,!0),n.removeEventListener("blur",$0,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",dt,!0),r.removeEventListener("pointermove",dt,!0),r.removeEventListener("pointerup",dt,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",dt,!0),r.removeEventListener("mousemove",dt,!0),r.removeEventListener("mouseup",dt,!0)),jo.delete(n))};function Q5(e){const t=Pn(e);let n;return t.readyState!=="loading"?Ec(e):(n=()=>{Ec(e)},t.addEventListener("DOMContentLoaded",n)),()=>A0(e,n)}typeof document<"u"&&Q5();function Sc(){return Ro!=="pointer"}const J5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ex(e,t,n){let r=Pn(n?Me(n):void 0),o=n?Me(n):void 0;const s=typeof window<"u"?qn(o).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?qn(o).HTMLTextAreaElement:HTMLTextAreaElement,c=typeof window<"u"?qn(o).HTMLElement:HTMLElement,a=typeof window<"u"?qn(o).KeyboardEvent:KeyboardEvent;let l=Nr(r);return e=e||l instanceof s&&!J5.has(l.type)||l instanceof i||l instanceof c&&l.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!Y5[n.key])}function tx(e,t,n){Ec(),E.useEffect(()=>{if((n==null?void 0:n.enabled)===!1)return;let r=(o,s)=>{ex(!!(n!=null&&n.isTextInput),o,s)&&e(Sc())};return vc.add(r),()=>{vc.delete(r)}},t)}function nx(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=E.useCallback(a=>{if(Me(a)===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),i=S0(s),c=E.useCallback(a=>{let l=Me(a);const u=Pn(l),f=u?Nr(u):Nr();l===a.currentTarget&&l===f&&(n&&n(a),o&&o(!0),i(a))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?c:void 0,onBlur:!t&&(r||o)?s:void 0}}}function rx(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=E.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:c}=x0(),a=E.useCallback(f=>{Tn(f.currentTarget,Me(f))&&s.current.isFocusWithin&&!Tn(f.currentTarget,f.relatedTarget)&&(s.current.isFocusWithin=!1,c(),n&&n(f),o&&o(!1))},[n,o,s,c]),l=S0(a),u=E.useCallback(f=>{if(!Tn(f.currentTarget,Me(f)))return;let d=Me(f);const p=Pn(d),h=Nr(p);if(!s.current.isFocusWithin&&h===d){r&&r(f),o&&o(!0),s.current.isFocusWithin=!0,l(f);let b=f.currentTarget;i(p,"focus",S=>{let P=Me(S);if(s.current.isFocusWithin&&!Tn(b,P)){let x=new p.defaultView.FocusEvent("blur",{relatedTarget:P});Z5(x,b);let w=E0(x);a(w)}},{capture:!0})}},[r,o,l,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:a}}}let Us=!1,Ws=0;function Pc(){Us=!0,setTimeout(()=>{Us=!1},50)}function N0(e){e.pointerType==="touch"&&Pc()}function ox(){if(!(typeof document>"u"))return Ws===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",N0):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Pc)),Ws++,()=>{Ws--,!(Ws>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",N0):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Pc))}}function sx(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=E.useState(!1),c=E.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;E.useEffect(ox,[]);let{addGlobalListener:a,removeAllGlobalListeners:l}=x0(),{hoverProps:u,triggerHoverEnd:f}=E.useMemo(()=>{let d=(b,S)=>{if(c.pointerType=S,o||S==="touch"||c.isHovered||!Tn(b.currentTarget,Me(b)))return;c.isHovered=!0;let P=b.currentTarget;c.target=P,a(Pn(Me(b)),"pointerover",x=>{c.isHovered&&c.target&&!Tn(c.target,Me(x))&&p(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:P,pointerType:S}),n&&n(!0),i(!0)},p=(b,S)=>{let P=c.target;c.pointerType="",c.target=null,!(S==="touch"||!c.isHovered||!P)&&(c.isHovered=!1,l(),r&&r({type:"hoverend",target:P,pointerType:S}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=b=>{Us&&b.pointerType==="mouse"||d(b,b.pointerType)},h.onPointerLeave=b=>{!o&&Tn(b.currentTarget,Me(b))&&p(b,b.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{c.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=b=>{!c.ignoreEmulatedMouseEvents&&!Us&&d(b,"mouse"),c.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=b=>{!o&&Tn(b.currentTarget,Me(b))&&p(b,"mouse")}),{hoverProps:h,triggerHoverEnd:p}},[t,n,r,o,c,a,l]);return E.useEffect(()=>{o&&f({currentTarget:c.target},c.pointerType)},[o]),{hoverProps:u,isHovered:s}}function ix(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=E.useRef({isFocused:!1,isFocusVisible:t||Sc()}),[s,i]=E.useState(!1),[c,a]=E.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=E.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),u=E.useCallback(p=>{o.current.isFocused=p,o.current.isFocusVisible=Sc(),i(p),l()},[l]);tx(p=>{o.current.isFocusVisible=p,l()},[n,s],{enabled:s,isTextInput:n});let{focusProps:f}=nx({isDisabled:r,onFocusChange:u}),{focusWithinProps:d}=rx({isDisabled:!r,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:c,focusProps:r?d:f}}var ax=Object.defineProperty,cx=(e,t,n)=>t in e?ax(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tc=(e,t,n)=>(cx(e,typeof t!="symbol"?t+"":t,n),n);let lx=class{constructor(){Tc(this,"current",this.detect()),Tc(this,"handoffState","pending"),Tc(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"}},_t=new lx;function Hs(e){var t;return _t.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Vs(e){var t,n;return _t.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function C0(e){var t,n;return(n=(t=Vs(e))==null?void 0:t.activeElement)!=null?n:null}function ux(e){return C0(e)===e}function O0(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function rt(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},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 O0(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=rt();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 o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Kn(){let[e]=E.useState(rt);return E.useEffect(()=>()=>e.dispose(),[e]),e}let Ee=(e,t)=>{_t.isServer?E.useEffect(e,t):E.useLayoutEffect(e,t)};function Yn(e){let t=E.useRef(e);return Ee(()=>{t.current=e},[e]),t}let fe=function(e){let t=Yn(e);return E.useCallback((...n)=>t.current(...n),[t])};function fx(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 dx(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function px({disabled:e=!1}={}){let t=E.useRef(null),[n,r]=E.useState(!1),o=Kn(),s=fe(()=>{t.current=null,r(!1),o.dispose()}),i=fe(c=>{if(o.dispose(),t.current===null){t.current=c.currentTarget,r(!0);{let a=Hs(c.currentTarget);o.addEventListener(a,"pointerup",s,!1),o.addEventListener(a,"pointermove",l=>{if(t.current){let u=fx(l);r(dx(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function $n(e){return E.useMemo(()=>e,Object.values(e))}let hx=E.createContext(void 0);function $c(){return E.useContext(hx)}function Ac(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function pt(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,pt),r}var Gs=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Gs||{}),An=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(An||{});function ot(){let e=bx();return E.useCallback(t=>mx({mergeRefs:e,...t}),[e])}function mx({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:c}){c=c??gx;let a=I0(t,e);if(s)return qs(a,n,r,i,c);let l=o??0;if(l&2){let{static:u=!1,...f}=a;if(u)return qs(f,n,r,i,c)}if(l&1){let{unmount:u=!0,...f}=a;return pt(u?0:1,{0(){return null},1(){return qs({...f,hidden:!0,style:{display:"none"}},n,r,i,c)}})}return qs(a,n,r,i,c)}function qs(e,t={},n,r,o){let{as:s=n,children:i,refName:c="ref",...a}=Nc(e,["unmount","static"]),l=e.ref!==void 0?{[c]:e.ref}:{},u=typeof i=="function"?i(t):i;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let f={};if(t){let d=!1,p=[];for(let[h,b]of Object.entries(t))typeof b=="boolean"&&(d=!0),b===!0&&p.push(h.replace(/([A-Z])/g,S=>`-${S.toLowerCase()}`));if(d){f["data-headlessui-state"]=p.join(" ");for(let h of p)f[`data-${h}`]=""}}if(_o(s)&&(Object.keys(Nn(a)).length>0||Object.keys(Nn(f)).length>0))if(!E.isValidElement(u)||Array.isArray(u)&&u.length>1||vx(u)){if(Object.keys(Nn(a)).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(Nn(a)).concat(Object.keys(Nn(f))).map(d=>` - ${d}`).join(`
117
+ `),"","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(d=>` - ${d}`).join(`
118
118
  `)].join(`
119
- `))}else{let p=u.props,d=p==null?void 0:p.className,h=typeof d=="function"?(...T)=>yc(d(...T),a.className):yc(d,a.className),m=h?{className:h}:{},v=T0(u.props,Tn(vc(a,["ref"])));for(let T in f)T in v&&delete f[T];return x.cloneElement(u,Object.assign({},v,f,l,{ref:o(sx(u),l.ref)},m))}return x.createElement(s,Object.assign({},vc(a,["ref"]),!Io(s)&&l,!Io(s)&&f),u)}function rx(){let e=x.useRef([]),t=x.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 ox(...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 T0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let c of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;c(o,...s)}}});return t}function A0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function Ge(e){var t;return Object.assign(x.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Tn(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function vc(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function sx(e){return x.version.split(".")[0]>="19"?e.props.ref:e.ref}function Io(e){return e===x.Fragment||e===Symbol.for("react.fragment")}function ix(e){return Io(e.type)}function ax(e,t,n){let[r,o]=x.useState(n),s=e!==void 0,i=x.useRef(s),c=x.useRef(!1),a=x.useRef(!1);return s&&!i.current&&!c.current?(c.current=!0,i.current=s,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.")):!s&&i.current&&!a.current&&(a.current=!0,i.current=s,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.")),[s?e:r,ue(l=>(s||je.flushSync(()=>o(l)),t==null?void 0:t(l)))]}function cx(e){let[t]=x.useState(e);return t}function $0(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))N0(n,C0(t,r),o);return n}function C0(e,t){return e?e+"["+t+"]":t}function N0(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())N0(e,C0(t,r.toString()),o);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,""]):ux(n)&&!x.isValidElement(n)&&$0(n,t,e)}function lx(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}function ux(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let fx="span";var wc=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(wc||{});function dx(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["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 rt()({ourProps:s,theirProps:o,slot:{},defaultTag:fx,name:"Hidden"})}let O0=Ge(dx),px=x.createContext(null);function hx({children:e}){let t=x.useContext(px);if(!t)return x.createElement(x.Fragment,null,e);let{target:n}=t;return n?je.createPortal(x.createElement(x.Fragment,null,e),n):null}function mx({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=x.useState(null),c=Gn();return x.useEffect(()=>{if(r&&s)return c.addEventListener(s,"reset",r)},[s,t,r]),x.createElement(hx,null,x.createElement(bx,{setForm:i,formId:t}),$0(e).map(([a,l])=>x.createElement(O0,{features:wc.Hidden,...Tn({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:l,...o})})))}function bx({setForm:e,formId:t}){return x.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:x.createElement(O0,{features:wc.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let gx=x.createContext(void 0);function I0(){return x.useContext(gx)}function k0(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Fs(e){return k0(e)&&"tagName"in e}function on(e){return Fs(e)&&"accessKey"in e}function Sr(e){return Fs(e)&&"tabIndex"in e}function yx(e){return Fs(e)&&"style"in e}function vx(e){return on(e)&&e.nodeName==="IFRAME"}function D0(e){return on(e)&&e.nodeName==="INPUT"}function M0(e){return on(e)&&e.nodeName==="LABEL"}function wx(e){return on(e)&&e.nodeName==="FIELDSET"}function L0(e){return on(e)&&e.nodeName==="LEGEND"}function xx(e){return Fs(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function B0(e){let t=e.parentElement,n=null;for(;t&&!wx(t);)L0(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Ex(n)?!1:r}function Ex(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(L0(t))return!1;t=t.previousElementSibling}return!0}let F0=Symbol();function Sx(e,t=!0){return Object.assign(e,{[F0]:t})}function dt(...e){let t=x.useRef(e);x.useEffect(()=>{t.current=e},[e]);let n=ue(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[F0]))?void 0:n}let xc=x.createContext(null);xc.displayName="DescriptionContext";function R0(){let e=x.useContext(xc);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,R0),t}return e}function Px(){var e,t;return(t=(e=x.useContext(xc))==null?void 0:e.value)!=null?t:void 0}let Tx="p";function Ax(e,t){let n=x.useId(),r=gc(),{id:o=`headlessui-description-${n}`,...s}=e,i=R0(),c=dt(t);Ee(()=>i.register(o),[o,i.register]);let a=Sn({...i.slot,disabled:r||!1}),l={ref:c,...i.props,id:o};return rt()({ourProps:l,theirProps:s,slot:a,defaultTag:Tx,name:i.name||"Description"})}let $x=Ge(Ax);Object.assign($x,{});var Oe=(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))(Oe||{});let Rs=x.createContext(null);Rs.displayName="LabelContext";function j0(){let e=x.useContext(Rs);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,j0),t}return e}function _0(e){var t,n,r;let o=(n=(t=x.useContext(Rs))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Cx({inherit:e=!1}={}){let t=_0(),[n,r]=x.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,x.useMemo(()=>function(s){let i=ue(a=>(r(l=>[...l,a]),()=>r(l=>{let u=l.slice(),f=u.indexOf(a);return f!==-1&&u.splice(f,1),u}))),c=x.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return x.createElement(Rs.Provider,{value:c},s.children)},[r])]}let Nx="label";function Ox(e,t){var n;let r=x.useId(),o=j0(),s=I0(),i=gc(),{id:c=`headlessui-label-${r}`,htmlFor:a=s??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...u}=e,f=dt(t);Ee(()=>o.register(c),[c,o.register]);let p=ue(m=>{let v=m.currentTarget;if(!(m.target!==m.currentTarget&&xx(m.target))&&(M0(v)&&m.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(m),M0(v))){let T=document.getElementById(v.htmlFor);if(T){let E=T.getAttribute("disabled");if(E==="true"||E==="")return;let S=T.getAttribute("aria-disabled");if(S==="true"||S==="")return;(D0(T)&&(T.type==="file"||T.type==="radio"||T.type==="checkbox")||T.role==="radio"||T.role==="checkbox"||T.role==="switch")&&T.click(),T.focus({preventScroll:!0})}}}),d=Sn({...o.slot,disabled:i||!1}),h={ref:f,...o.props,id:c,htmlFor:a,onClick:p};return l&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in u&&delete u.onClick),rt()({ourProps:h,theirProps:u,slot:d,defaultTag:a?Nx:"div",name:o.name||"Label"})}let Ix=Ge(Ox),kx=Object.assign(Ix,{});function Dx(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Mx(e=Dx){return x.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function z0(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Lx(e,t,n=!1){let[r,o]=x.useState(()=>z0(t));return Ee(()=>{if(!t||!e)return;let s=nt();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(c=>{let a=z0(t);return a.width===c.width&&a.height===c.height?c:a})}),()=>{s.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var U0=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(U0||{});function Bx(e){let t=x.useRef(null),n=ue(o=>{t.current=o.pointerType,!B0(o.currentTarget)&&o.pointerType==="mouse"&&o.button===U0.Left&&(o.preventDefault(),e(o))}),r=ue(o=>{t.current!=="mouse"&&(B0(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let W0=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}};var Fx=Object.defineProperty,Rx=(e,t,n)=>t in e?Fx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jx=(e,t,n)=>(Rx(e,t+"",n),n),H0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},pt=(e,t,n)=>(H0(e,t,"read from private field"),n?n.call(e):t.get(e)),Ec=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},V0=(e,t,n,r)=>(H0(e,t,"write to private field"),t.set(e,n),n),jt,ko,Do;let G0=class{constructor(t){Ec(this,jt,{}),Ec(this,ko,new W0(()=>new Set)),Ec(this,Do,new Set),jx(this,"disposables",nt()),V0(this,jt,t),Rt.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return pt(this,jt)}subscribe(t,n){if(Rt.isServer)return()=>{};let r={selector:t,callback:n,current:t(pt(this,jt))};return pt(this,Do).add(r),this.disposables.add(()=>{pt(this,Do).delete(r)})}on(t,n){return Rt.isServer?()=>{}:(pt(this,ko).get(t).add(n),this.disposables.add(()=>{pt(this,ko).get(t).delete(n)}))}send(t){let n=this.reduce(pt(this,jt),t);if(n!==pt(this,jt)){V0(this,jt,n);for(let r of pt(this,Do)){let o=r.selector(pt(this,jt));q0(r.current,o)||(r.current=o,r.callback(o))}for(let r of pt(this,ko).get(t.type))r(pt(this,jt),t)}}};jt=new WeakMap,ko=new WeakMap,Do=new WeakMap;function q0(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Sc(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Sc(e.entries(),t.entries()):Z0(e)&&Z0(t)?Sc(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Sc(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Z0(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Pc(e){let[t,n]=e(),r=nt();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var _x=Object.defineProperty,zx=(e,t,n)=>t in e?_x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K0=(e,t,n)=>(zx(e,typeof t!="symbol"?t+"":t,n),n),Y0=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Y0||{});let Ux={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Wx=class Mm extends G0{constructor(){super(...arguments),K0(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),K0(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Mm({stack:[]})}reduce(t,n){return ft(n.type,Ux,t,n)}};const Tc=new W0(()=>Wx.new());var Ac={exports:{}},$c={};/**
119
+ `))}else{let d=u.props,p=d==null?void 0:d.className,h=typeof p=="function"?(...P)=>Ac(p(...P),a.className):Ac(p,a.className),b=h?{className:h}:{},S=I0(u.props,Nn(Nc(a,["ref"])));for(let P in f)P in S&&delete f[P];return E.cloneElement(u,Object.assign({},S,f,l,{ref:o(yx(u),l.ref)},b))}return E.createElement(s,Object.assign({},Nc(a,["ref"]),!_o(s)&&l,!_o(s)&&f),u)}function bx(){let e=E.useRef([]),t=E.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 gx(...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 I0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let c of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;c(o,...s)}}});return t}function D0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function qe(e){var t;return Object.assign(E.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Nn(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Nc(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function yx(e){return E.version.split(".")[0]>="19"?e.props.ref:e.ref}function _o(e){return e===E.Fragment||e===Symbol.for("react.fragment")}function vx(e){return _o(e.type)}function wx(e,t,n){let[r,o]=E.useState(n),s=e!==void 0,i=E.useRef(s),c=E.useRef(!1),a=E.useRef(!1);return s&&!i.current&&!c.current?(c.current=!0,i.current=s,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.")):!s&&i.current&&!a.current&&(a.current=!0,i.current=s,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.")),[s?e:r,fe(l=>(s||je.flushSync(()=>o(l)),t==null?void 0:t(l)))]}function xx(e){let[t]=E.useState(e);return t}function M0(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))L0(n,k0(t,r),o);return n}function k0(e,t){return e?e+"["+t+"]":t}function L0(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())L0(e,k0(t,r.toString()),o);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,""]):Sx(n)&&!E.isValidElement(n)&&M0(n,t,e)}function Ex(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}function Sx(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let Px="span";var Cc=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Cc||{});function Tx(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["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 ot()({ourProps:s,theirProps:o,slot:{},defaultTag:Px,name:"Hidden"})}let B0=qe(Tx),$x=E.createContext(null);function Ax({children:e}){let t=E.useContext($x);if(!t)return E.createElement(E.Fragment,null,e);let{target:n}=t;return n?je.createPortal(E.createElement(E.Fragment,null,e),n):null}function Nx({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=E.useState(null),c=Kn();return E.useEffect(()=>{if(r&&s)return c.addEventListener(s,"reset",r)},[s,t,r]),E.createElement(Ax,null,E.createElement(Cx,{setForm:i,formId:t}),M0(e).map(([a,l])=>E.createElement(B0,{features:Cc.Hidden,...Nn({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:l,...o})})))}function Cx({setForm:e,formId:t}){return E.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:E.createElement(B0,{features:Cc.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Ox=E.createContext(void 0);function F0(){return E.useContext(Ox)}function R0(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Zs(e){return R0(e)&&"tagName"in e}function an(e){return Zs(e)&&"accessKey"in e}function Cr(e){return Zs(e)&&"tabIndex"in e}function Ix(e){return Zs(e)&&"style"in e}function Dx(e){return an(e)&&e.nodeName==="IFRAME"}function j0(e){return an(e)&&e.nodeName==="INPUT"}function _0(e){return an(e)&&e.nodeName==="LABEL"}function Mx(e){return an(e)&&e.nodeName==="FIELDSET"}function z0(e){return an(e)&&e.nodeName==="LEGEND"}function kx(e){return Zs(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function U0(e){let t=e.parentElement,n=null;for(;t&&!Mx(t);)z0(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Lx(n)?!1:r}function Lx(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(z0(t))return!1;t=t.previousElementSibling}return!0}let W0=Symbol();function Bx(e,t=!0){return Object.assign(e,{[W0]:t})}function ht(...e){let t=E.useRef(e);E.useEffect(()=>{t.current=e},[e]);let n=fe(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[W0]))?void 0:n}let Oc=E.createContext(null);Oc.displayName="DescriptionContext";function H0(){let e=E.useContext(Oc);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,H0),t}return e}function Fx(){var e,t;return(t=(e=E.useContext(Oc))==null?void 0:e.value)!=null?t:void 0}let Rx="p";function jx(e,t){let n=E.useId(),r=$c(),{id:o=`headlessui-description-${n}`,...s}=e,i=H0(),c=ht(t);Ee(()=>i.register(o),[o,i.register]);let a=$n({...i.slot,disabled:r||!1}),l={ref:c,...i.props,id:o};return ot()({ourProps:l,theirProps:s,slot:a,defaultTag:Rx,name:i.name||"Description"})}let _x=qe(jx);Object.assign(_x,{});var Ie=(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))(Ie||{});let Ks=E.createContext(null);Ks.displayName="LabelContext";function V0(){let e=E.useContext(Ks);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,V0),t}return e}function G0(e){var t,n,r;let o=(n=(t=E.useContext(Ks))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function zx({inherit:e=!1}={}){let t=G0(),[n,r]=E.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,E.useMemo(()=>function(s){let i=fe(a=>(r(l=>[...l,a]),()=>r(l=>{let u=l.slice(),f=u.indexOf(a);return f!==-1&&u.splice(f,1),u}))),c=E.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return E.createElement(Ks.Provider,{value:c},s.children)},[r])]}let Ux="label";function Wx(e,t){var n;let r=E.useId(),o=V0(),s=F0(),i=$c(),{id:c=`headlessui-label-${r}`,htmlFor:a=s??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...u}=e,f=ht(t);Ee(()=>o.register(c),[c,o.register]);let d=fe(b=>{let S=b.currentTarget;if(!(b.target!==b.currentTarget&&kx(b.target))&&(_0(S)&&b.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(b),_0(S))){let P=document.getElementById(S.htmlFor);if(P){let x=P.getAttribute("disabled");if(x==="true"||x==="")return;let w=P.getAttribute("aria-disabled");if(w==="true"||w==="")return;(j0(P)&&(P.type==="file"||P.type==="radio"||P.type==="checkbox")||P.role==="radio"||P.role==="checkbox"||P.role==="switch")&&P.click(),P.focus({preventScroll:!0})}}}),p=$n({...o.slot,disabled:i||!1}),h={ref:f,...o.props,id:c,htmlFor:a,onClick:d};return l&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in u&&delete u.onClick),ot()({ourProps:h,theirProps:u,slot:p,defaultTag:a?Ux:"div",name:o.name||"Label"})}let Hx=qe(Wx),Vx=Object.assign(Hx,{});function Gx(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function qx(e=Gx){return E.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function q0(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Zx(e,t,n=!1){let[r,o]=E.useState(()=>q0(t));return Ee(()=>{if(!t||!e)return;let s=rt();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(c=>{let a=q0(t);return a.width===c.width&&a.height===c.height?c:a})}),()=>{s.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var Z0=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Z0||{});function Kx(e){let t=E.useRef(null),n=fe(o=>{t.current=o.pointerType,!U0(o.currentTarget)&&o.pointerType==="mouse"&&o.button===Z0.Left&&(o.preventDefault(),e(o))}),r=fe(o=>{t.current!=="mouse"&&(U0(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let K0=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}};var Yx=Object.defineProperty,Xx=(e,t,n)=>t in e?Yx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qx=(e,t,n)=>(Xx(e,t+"",n),n),Y0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},mt=(e,t,n)=>(Y0(e,t,"read from private field"),n?n.call(e):t.get(e)),Ic=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},X0=(e,t,n,r)=>(Y0(e,t,"write to private field"),t.set(e,n),n),zt,zo,Uo;let Q0=class{constructor(t){Ic(this,zt,{}),Ic(this,zo,new K0(()=>new Set)),Ic(this,Uo,new Set),Qx(this,"disposables",rt()),X0(this,zt,t),_t.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return mt(this,zt)}subscribe(t,n){if(_t.isServer)return()=>{};let r={selector:t,callback:n,current:t(mt(this,zt))};return mt(this,Uo).add(r),this.disposables.add(()=>{mt(this,Uo).delete(r)})}on(t,n){return _t.isServer?()=>{}:(mt(this,zo).get(t).add(n),this.disposables.add(()=>{mt(this,zo).get(t).delete(n)}))}send(t){let n=this.reduce(mt(this,zt),t);if(n!==mt(this,zt)){X0(this,zt,n);for(let r of mt(this,Uo)){let o=r.selector(mt(this,zt));J0(r.current,o)||(r.current=o,r.callback(o))}for(let r of mt(this,zo).get(t.type))r(mt(this,zt),t)}}};zt=new WeakMap,zo=new WeakMap,Uo=new WeakMap;function J0(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Dc(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Dc(e.entries(),t.entries()):ep(e)&&ep(t)?Dc(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Dc(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function ep(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Mc(e){let[t,n]=e(),r=rt();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Jx=Object.defineProperty,e2=(e,t,n)=>t in e?Jx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tp=(e,t,n)=>(e2(e,typeof t!="symbol"?t+"":t,n),n),np=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(np||{});let t2={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},n2=class zm extends Q0{constructor(){super(...arguments),tp(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),tp(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new zm({stack:[]})}reduce(t,n){return pt(n.type,t2,t,n)}};const kc=new K0(()=>n2.new());var Lc={exports:{}},Bc={};/**
120
120
  * @license React
121
121
  * use-sync-external-store-with-selector.production.js
122
122
  *
@@ -124,7 +124,7 @@ ${bg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
124
124
  *
125
125
  * This source code is licensed under the MIT license found in the
126
126
  * LICENSE file in the root directory of this source tree.
127
- */var X0;function Hx(){if(X0)return $c;X0=1;var e=x;function t(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,c=e.useDebugValue;return $c.useSyncExternalStoreWithSelector=function(a,l,u,f,p){var d=o(null);if(d.current===null){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=i(function(){function v(M){if(!T){if(T=!0,E=M,M=f(M),p!==void 0&&h.hasValue){var B=h.value;if(p(B,M))return S=B}return S=M}if(B=S,n(E,M))return B;var F=f(M);return p!==void 0&&p(B,F)?(E=M,B):(E=M,S=F)}var T=!1,E,S,N=u===void 0?null:u;return[function(){return v(l())},N===null?void 0:function(){return v(N())}]},[l,u,f,p]);var m=r(a,d[0],d[1]);return s(function(){h.hasValue=!0,h.value=m},[m]),c(m),m},$c}var Cc={};/**
127
+ */var rp;function r2(){if(rp)return Bc;rp=1;var e=E;function t(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,c=e.useDebugValue;return Bc.useSyncExternalStoreWithSelector=function(a,l,u,f,d){var p=o(null);if(p.current===null){var h={hasValue:!1,value:null};p.current=h}else h=p.current;p=i(function(){function S(k){if(!P){if(P=!0,x=k,k=f(k),d!==void 0&&h.hasValue){var B=h.value;if(d(B,k))return w=B}return w=k}if(B=w,n(x,k))return B;var F=f(k);return d!==void 0&&d(B,F)?(x=k,B):(x=k,w=F)}var P=!1,x,w,$=u===void 0?null:u;return[function(){return S(l())},$===null?void 0:function(){return S($())}]},[l,u,f,d]);var b=r(a,p[0],p[1]);return s(function(){h.hasValue=!0,h.value=b},[b]),c(b),b},Bc}var Fc={};/**
128
128
  * @license React
129
129
  * use-sync-external-store-with-selector.development.js
130
130
  *
@@ -132,49 +132,49 @@ ${bg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
132
132
  *
133
133
  * This source code is licensed under the MIT license found in the
134
134
  * LICENSE file in the root directory of this source tree.
135
- */var Q0;function Vx(){return Q0||(Q0=1,process.env.NODE_ENV!=="production"&&function(){function e(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=x,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,c=t.useDebugValue;Cc.useSyncExternalStoreWithSelector=function(a,l,u,f,p){var d=o(null);if(d.current===null){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=i(function(){function v(M){if(!T){if(T=!0,E=M,M=f(M),p!==void 0&&h.hasValue){var B=h.value;if(p(B,M))return S=B}return S=M}if(B=S,n(E,M))return B;var F=f(M);return p!==void 0&&p(B,F)?(E=M,B):(E=M,S=F)}var T=!1,E,S,N=u===void 0?null:u;return[function(){return v(l())},N===null?void 0:function(){return v(N())}]},[l,u,f,p]);var m=r(a,d[0],d[1]);return s(function(){h.hasValue=!0,h.value=m},[m]),c(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Cc}process.env.NODE_ENV==="production"?Ac.exports=Hx():Ac.exports=Vx();var Gx=Ac.exports;function qe(e,t,n=q0){return Gx.useSyncExternalStoreWithSelector(ue(r=>e.subscribe(qx,r)),ue(()=>e.state),ue(()=>e.state),ue(t),n)}function qx(e){return e}function J0(e,t){let n=x.useId(),r=Tc.get(t),[o,s]=qe(r,x.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return Ee(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let Nc=new Map,Mo=new Map;function ep(e){var t;let n=(t=Mo.get(e))!=null?t:0;return Mo.set(e,n+1),n!==0?()=>tp(e):(Nc.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>tp(e))}function tp(e){var t;let n=(t=Mo.get(e))!=null?t:1;if(n===1?Mo.delete(e):Mo.set(e,n-1),n!==1)return;let r=Nc.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Nc.delete(e))}function Zx(e,{allowed:t,disallowed:n}={}){let r=J0(e,"inert-others");Ee(()=>{var o,s;if(!r)return;let i=nt();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&i.add(ep(a));let c=(s=t==null?void 0:t())!=null?s:[];for(let a of c){if(!a)continue;let l=Ds(a);if(!l)continue;let u=a.parentElement;for(;u&&u!==l.body;){for(let f of u.children)c.some(p=>f.contains(p))||i.add(ep(f));u=u.parentElement}}return i.dispose},[r,t,n])}function Kx(e,t,n){let r=qn(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});x.useEffect(()=>{if(!e)return;let o=t===null?null:on(t)?t:t.current;if(!o)return;let s=nt();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let Oc=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Yx=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ic=(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))(Ic||{}),Xx=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Xx||{}),Qx=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Qx||{});function np(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Oc)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Jx(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Yx)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var kc=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(kc||{});function rp(e,t=0){var n;return e===((n=Ds(e))==null?void 0:n.body)?!1:ft(t,{0(){return e.matches(Oc)},1(){let r=e;for(;r!==null;){if(r.matches(Oc))return!0;r=r.parentElement}return!1}})}var e2=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(e2||{});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));let t2=["textarea","input"].join(",");function n2(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,t2))!=null?n:!1}function op(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function r2(e,t,n=e===null?document.body:Ms(e)){return o2(np(n),t,{relativeTo:e})}function o2(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?Ms(e[0]):document:Ms(e),i=Array.isArray(e)?n?op(e):e:t&64?Jx(e):np(e);o.length>0&&i.length>1&&(i=i.filter(d=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===d:h===d))),r=r??(s==null?void 0:s.activeElement);let c=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},u=0,f=i.length,p;do{if(u>=f||u+f<=0)return 0;let d=a+u;if(t&16)d=(d+f)%f;else{if(d<0)return 3;if(d>=f)return 1}p=i[d],p==null||p.focus(l),u+=c}while(p!==S0(p));return t&6&&n2(p)&&p.select(),2}function sp(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function s2(){return/Android/gi.test(window.navigator.userAgent)}function ip(){return sp()||s2()}function Pr(e,t,n,r){let o=qn(n);x.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function i2(e,t,n,r){let o=qn(n);x.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const ap=30;function a2(e,t,n){let r=qn(n),o=x.useCallback(function(c,a){if(c.defaultPrevented)return;let l=a(c);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let u=function f(p){return typeof p=="function"?f(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let f of u)if(f!==null&&(f.contains(l)||c.composed&&c.composedPath().includes(f)))return;return!rp(l,kc.Loose)&&l.tabIndex!==-1&&c.preventDefault(),r.current(c,l)},[r,t]),s=x.useRef(null);Pr(e,"pointerdown",c=>{var a,l;ip()||(s.current=((l=(a=c.composedPath)==null?void 0:a.call(c))==null?void 0:l[0])||c.target)},!0),Pr(e,"pointerup",c=>{if(ip()||!s.current)return;let a=s.current;return s.current=null,o(c,()=>a)},!0);let i=x.useRef({x:0,y:0});Pr(e,"touchstart",c=>{i.current.x=c.touches[0].clientX,i.current.y=c.touches[0].clientY},!0),Pr(e,"touchend",c=>{let a={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(a.x-i.current.x)>=ap||Math.abs(a.y-i.current.y)>=ap))return o(c,()=>Sr(c.target)?c.target:null)},!0),i2(e,"blur",c=>o(c,()=>vx(window.document.activeElement)?window.document.activeElement:null),!0)}function Dc(...e){return x.useMemo(()=>Ds(...e),[...e])}var c2=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(c2||{});const js={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},l2=200,cp=5;function u2(e,{trigger:t,action:n,close:r,select:o}){let s=x.useRef(null),i=x.useRef(null),c=x.useRef(null);Pr(e&&t!==null,"pointerdown",a=>{k0(a==null?void 0:a.target)&&t!=null&&t.contains(a.target)&&(i.current=a.x,c.current=a.y,s.current=a.timeStamp)}),Pr(e&&t!==null,"pointerup",a=>{var l,u;let f=s.current;if(f===null||(s.current=null,!Sr(a.target))||Math.abs(a.x-((l=i.current)!=null?l:a.x))<cp&&Math.abs(a.y-((u=c.current)!=null?u:a.y))<cp)return;let p=n(a);switch(p.kind){case 0:return;case 1:{a.timeStamp-f>l2&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function f2(e,t){return x.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 d2(e){return x.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function p2(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(c=>c()))}}}function h2(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function m2(){return sp()?{before({doc:e,d:t,meta:n}){function r(o){for(let s of n().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let c=nt();c.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>c.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",c=>{if(Sr(c.target))try{let a=c.target.closest("a");if(!a)return;let{hash:l}=new URL(a.href),u=e.querySelector(l);Sr(u)&&!r(u)&&(i=u)}catch{}},!0),t.group(c=>{t.addEventListener(e,"touchstart",a=>{if(c.dispose(),Sr(a.target)&&yx(a.target))if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;c.style(l,"overscrollBehavior","contain")}else c.style(a.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",c=>{if(Sr(c.target)){if(D0(c.target))return;if(r(c.target)){let a=c.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&c.preventDefault()}else c.preventDefault()}},{passive:!1}),t.add(()=>{var c;let a=(c=window.scrollY)!=null?c:window.pageYOffset;s!==a&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function b2(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function lp(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Zn=p2(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:nt(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=lp(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=lp(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[m2(),h2(),b2()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Zn.subscribe(()=>{let e=Zn.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",o=n.count!==0;(o&&!r||!o&&r)&&Zn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Zn.dispatch("TEARDOWN",n)}});function g2(e,t,n=()=>({containers:[]})){let r=d2(Zn),o=t?r.get(t):void 0,s=o?o.count>0:!1;return Ee(()=>{if(!(!t||!e))return Zn.dispatch("PUSH",t,n),()=>Zn.dispatch("POP",t,n)},[e,t]),s}function y2(e,t,n=()=>[document.body]){let r=J0(e,"scroll-lock");g2(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function up(e){return[e.screenX,e.screenY]}function v2(){let e=x.useRef([-1,-1]);return{wasMoved(t){let n=up(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=up(t)}}}function w2(e=0){let[t,n]=x.useState(e),r=x.useCallback(a=>n(a),[]),o=x.useCallback(a=>n(l=>l|a),[]),s=x.useCallback(a=>(t&a)===a,[t]),i=x.useCallback(a=>n(l=>l&~a),[]),c=x.useCallback(a=>n(l=>l^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:c}}var fp,dp;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((fp=process==null?void 0:process.env)==null?void 0:fp.NODE_ENV)==="test"&&typeof((dp=Element==null?void 0:Element.prototype)==null?void 0:dp.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(`
136
- `)),[]});var x2=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(x2||{});function pp(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function hp(e,t,n,r){let[o,s]=x.useState(n),{hasFlag:i,addFlag:c,removeFlag:a}=w2(e&&o?3:0),l=x.useRef(!1),u=x.useRef(!1),f=Gn();return Ee(()=>{var p;if(e){if(n&&s(!0),!t){n&&c(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),E2(t,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(c(3),a(4)):(c(4),a(2)))},run(){u.current?n?(a(3),c(4)):(a(4),c(3)):n?a(1):c(1)},done(){var d;u.current&&T2(t)||(l.current=!1,a(7),n||s(!1),(d=r==null?void 0:r.end)==null||d.call(r,n))}})}},[e,n,t,f]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function E2(e,{prepare:t,run:n,done:r,inFlight:o}){let s=nt();return P2(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(S2(e,r))})}),s.dispose}function S2(e,t){var n,r;let o=nt();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(c=>c instanceof CSSTransition))!=null?r:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(c=>c.finished)).then(()=>{s||t()}),o.dispose)}function P2(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 T2(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function _s(){return typeof window<"u"}function Tr(e){return Mc(e)?(e.nodeName||"").toLowerCase():"#document"}function Ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _t(e){var t;return(t=(Mc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mc(e){return _s()?e instanceof Node||e instanceof Ze(e).Node:!1}function de(e){return _s()?e instanceof Element||e instanceof Ze(e).Element:!1}function Fe(e){return _s()?e instanceof HTMLElement||e instanceof Ze(e).HTMLElement:!1}function Lc(e){return!_s()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ze(e).ShadowRoot}const A2=new Set(["inline","contents"]);function Lo(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!A2.has(o)}const $2=new Set(["table","td","th"]);function C2(e){return $2.has(Tr(e))}const N2=[":popover-open",":modal"];function zs(e){return N2.some(t=>{try{return e.matches(t)}catch{return!1}})}const O2=["transform","translate","scale","rotate","perspective"],I2=["transform","translate","scale","rotate","perspective","filter"],k2=["paint","layout","strict","content"];function Bc(e){const t=Us(),n=de(e)?ht(e):e;return O2.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||I2.some(r=>(n.willChange||"").includes(r))||k2.some(r=>(n.contain||"").includes(r))}function D2(e){let t=an(e);for(;Fe(t)&&!sn(t);){if(Bc(t))return t;if(zs(t))return null;t=an(t)}return null}function Us(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const M2=new Set(["html","body","#document"]);function sn(e){return M2.has(Tr(e))}function ht(e){return Ze(e).getComputedStyle(e)}function Ws(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function an(e){if(Tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lc(e)&&e.host||_t(e);return Lc(t)?t.host:t}function mp(e){const t=an(e);return sn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fe(t)&&Lo(t)?t:mp(t)}function An(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=mp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ze(o);if(s){const c=Fc(i);return t.concat(i,i.visualViewport||[],Lo(o)?o:[],c&&n?An(c):[])}return t.concat(o,An(o,[],n))}function Fc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function L2(){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 cn=Math.min,De=Math.max,Bo=Math.round,Hs=Math.floor,zt=e=>({x:e,y:e}),B2={left:"right",right:"left",bottom:"top",top:"bottom"},F2={start:"end",end:"start"};function Rc(e,t,n){return De(e,cn(t,n))}function Kn(e,t){return typeof e=="function"?e(t):e}function $n(e){return e.split("-")[0]}function Ar(e){return e.split("-")[1]}function bp(e){return e==="x"?"y":"x"}function jc(e){return e==="y"?"height":"width"}const R2=new Set(["top","bottom"]);function ln(e){return R2.has($n(e))?"y":"x"}function _c(e){return bp(ln(e))}function j2(e,t,n){n===void 0&&(n=!1);const r=Ar(e),o=_c(e),s=jc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Vs(i)),[i,Vs(i)]}function _2(e){const t=Vs(e);return[zc(e),t,zc(t)]}function zc(e){return e.replace(/start|end/g,t=>F2[t])}const gp=["left","right"],yp=["right","left"],z2=["top","bottom"],U2=["bottom","top"];function W2(e,t,n){switch(e){case"top":case"bottom":return n?t?yp:gp:t?gp:yp;case"left":case"right":return t?z2:U2;default:return[]}}function H2(e,t,n,r){const o=Ar(e);let s=W2($n(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(zc)))),s}function Vs(e){return e.replace(/left|right|bottom|top/g,t=>B2[t])}function V2(e){return{top:0,right:0,bottom:0,left:0,...e}}function vp(e){return typeof e!="number"?V2(e):{top:e,right:e,bottom:e,left:e}}function Gs(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
137
- * tabbable 6.3.0
135
+ */var op;function o2(){return op||(op=1,process.env.NODE_ENV!=="production"&&function(){function e(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=E,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,c=t.useDebugValue;Fc.useSyncExternalStoreWithSelector=function(a,l,u,f,d){var p=o(null);if(p.current===null){var h={hasValue:!1,value:null};p.current=h}else h=p.current;p=i(function(){function S(k){if(!P){if(P=!0,x=k,k=f(k),d!==void 0&&h.hasValue){var B=h.value;if(d(B,k))return w=B}return w=k}if(B=w,n(x,k))return B;var F=f(k);return d!==void 0&&d(B,F)?(x=k,B):(x=k,w=F)}var P=!1,x,w,$=u===void 0?null:u;return[function(){return S(l())},$===null?void 0:function(){return S($())}]},[l,u,f,d]);var b=r(a,p[0],p[1]);return s(function(){h.hasValue=!0,h.value=b},[b]),c(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Fc}process.env.NODE_ENV==="production"?Lc.exports=r2():Lc.exports=o2();var s2=Lc.exports;function Ze(e,t,n=J0){return s2.useSyncExternalStoreWithSelector(fe(r=>e.subscribe(i2,r)),fe(()=>e.state),fe(()=>e.state),fe(t),n)}function i2(e){return e}function sp(e,t){let n=E.useId(),r=kc.get(t),[o,s]=Ze(r,E.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return Ee(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let Rc=new Map,Wo=new Map;function ip(e){var t;let n=(t=Wo.get(e))!=null?t:0;return Wo.set(e,n+1),n!==0?()=>ap(e):(Rc.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>ap(e))}function ap(e){var t;let n=(t=Wo.get(e))!=null?t:1;if(n===1?Wo.delete(e):Wo.set(e,n-1),n!==1)return;let r=Rc.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Rc.delete(e))}function a2(e,{allowed:t,disallowed:n}={}){let r=sp(e,"inert-others");Ee(()=>{var o,s;if(!r)return;let i=rt();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&i.add(ip(a));let c=(s=t==null?void 0:t())!=null?s:[];for(let a of c){if(!a)continue;let l=Hs(a);if(!l)continue;let u=a.parentElement;for(;u&&u!==l.body;){for(let f of u.children)c.some(d=>f.contains(d))||i.add(ip(f));u=u.parentElement}}return i.dispose},[r,t,n])}function c2(e,t,n){let r=Yn(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});E.useEffect(()=>{if(!e)return;let o=t===null?null:an(t)?t:t.current;if(!o)return;let s=rt();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let jc=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),l2=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var _c=(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))(_c||{}),u2=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(u2||{}),f2=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(f2||{});function cp(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(jc)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function d2(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(l2)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var zc=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(zc||{});function lp(e,t=0){var n;return e===((n=Hs(e))==null?void 0:n.body)?!1:pt(t,{0(){return e.matches(jc)},1(){let r=e;for(;r!==null;){if(r.matches(jc))return!0;r=r.parentElement}return!1}})}var p2=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(p2||{});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));let h2=["textarea","input"].join(",");function m2(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,h2))!=null?n:!1}function up(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function b2(e,t,n=e===null?document.body:Vs(e)){return g2(cp(n),t,{relativeTo:e})}function g2(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?Vs(e[0]):document:Vs(e),i=Array.isArray(e)?n?up(e):e:t&64?d2(e):cp(e);o.length>0&&i.length>1&&(i=i.filter(p=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===p:h===p))),r=r??(s==null?void 0:s.activeElement);let c=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},u=0,f=i.length,d;do{if(u>=f||u+f<=0)return 0;let p=a+u;if(t&16)p=(p+f)%f;else{if(p<0)return 3;if(p>=f)return 1}d=i[p],d==null||d.focus(l),u+=c}while(d!==C0(d));return t&6&&m2(d)&&d.select(),2}function fp(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function y2(){return/Android/gi.test(window.navigator.userAgent)}function dp(){return fp()||y2()}function Or(e,t,n,r){let o=Yn(n);E.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function v2(e,t,n,r){let o=Yn(n);E.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const pp=30;function w2(e,t,n){let r=Yn(n),o=E.useCallback(function(c,a){if(c.defaultPrevented)return;let l=a(c);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let u=function f(d){return typeof d=="function"?f(d()):Array.isArray(d)||d instanceof Set?d:[d]}(t);for(let f of u)if(f!==null&&(f.contains(l)||c.composed&&c.composedPath().includes(f)))return;return!lp(l,zc.Loose)&&l.tabIndex!==-1&&c.preventDefault(),r.current(c,l)},[r,t]),s=E.useRef(null);Or(e,"pointerdown",c=>{var a,l;dp()||(s.current=((l=(a=c.composedPath)==null?void 0:a.call(c))==null?void 0:l[0])||c.target)},!0),Or(e,"pointerup",c=>{if(dp()||!s.current)return;let a=s.current;return s.current=null,o(c,()=>a)},!0);let i=E.useRef({x:0,y:0});Or(e,"touchstart",c=>{i.current.x=c.touches[0].clientX,i.current.y=c.touches[0].clientY},!0),Or(e,"touchend",c=>{let a={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(a.x-i.current.x)>=pp||Math.abs(a.y-i.current.y)>=pp))return o(c,()=>Cr(c.target)?c.target:null)},!0),v2(e,"blur",c=>o(c,()=>Dx(window.document.activeElement)?window.document.activeElement:null),!0)}function Uc(...e){return E.useMemo(()=>Hs(...e),[...e])}var x2=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(x2||{});const Ys={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},E2=200,hp=5;function S2(e,{trigger:t,action:n,close:r,select:o}){let s=E.useRef(null),i=E.useRef(null),c=E.useRef(null);Or(e&&t!==null,"pointerdown",a=>{R0(a==null?void 0:a.target)&&t!=null&&t.contains(a.target)&&(i.current=a.x,c.current=a.y,s.current=a.timeStamp)}),Or(e&&t!==null,"pointerup",a=>{var l,u;let f=s.current;if(f===null||(s.current=null,!Cr(a.target))||Math.abs(a.x-((l=i.current)!=null?l:a.x))<hp&&Math.abs(a.y-((u=c.current)!=null?u:a.y))<hp)return;let d=n(a);switch(d.kind){case 0:return;case 1:{a.timeStamp-f>E2&&(o(d.target),r());break}case 2:{r();break}}},{capture:!0})}function P2(e,t){return E.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 T2(e){return E.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function $2(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(c=>c()))}}}function A2(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function N2(){return fp()?{before({doc:e,d:t,meta:n}){function r(o){for(let s of n().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let c=rt();c.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>c.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",c=>{if(Cr(c.target))try{let a=c.target.closest("a");if(!a)return;let{hash:l}=new URL(a.href),u=e.querySelector(l);Cr(u)&&!r(u)&&(i=u)}catch{}},!0),t.group(c=>{t.addEventListener(e,"touchstart",a=>{if(c.dispose(),Cr(a.target)&&Ix(a.target))if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;c.style(l,"overscrollBehavior","contain")}else c.style(a.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",c=>{if(Cr(c.target)){if(j0(c.target))return;if(r(c.target)){let a=c.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&c.preventDefault()}else c.preventDefault()}},{passive:!1}),t.add(()=>{var c;let a=(c=window.scrollY)!=null?c:window.pageYOffset;s!==a&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function C2(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function mp(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Xn=$2(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:rt(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=mp(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=mp(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[N2(),A2(),C2()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Xn.subscribe(()=>{let e=Xn.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",o=n.count!==0;(o&&!r||!o&&r)&&Xn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Xn.dispatch("TEARDOWN",n)}});function O2(e,t,n=()=>({containers:[]})){let r=T2(Xn),o=t?r.get(t):void 0,s=o?o.count>0:!1;return Ee(()=>{if(!(!t||!e))return Xn.dispatch("PUSH",t,n),()=>Xn.dispatch("POP",t,n)},[e,t]),s}function I2(e,t,n=()=>[document.body]){let r=sp(e,"scroll-lock");O2(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function bp(e){return[e.screenX,e.screenY]}function D2(){let e=E.useRef([-1,-1]);return{wasMoved(t){let n=bp(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=bp(t)}}}function M2(e=0){let[t,n]=E.useState(e),r=E.useCallback(a=>n(a),[]),o=E.useCallback(a=>n(l=>l|a),[]),s=E.useCallback(a=>(t&a)===a,[t]),i=E.useCallback(a=>n(l=>l&~a),[]),c=E.useCallback(a=>n(l=>l^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:c}}var gp,yp;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((gp=process==null?void 0:process.env)==null?void 0:gp.NODE_ENV)==="test"&&typeof((yp=Element==null?void 0:Element.prototype)==null?void 0:yp.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(`
136
+ `)),[]});var k2=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(k2||{});function vp(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function wp(e,t,n,r){let[o,s]=E.useState(n),{hasFlag:i,addFlag:c,removeFlag:a}=M2(e&&o?3:0),l=E.useRef(!1),u=E.useRef(!1),f=Kn();return Ee(()=>{var d;if(e){if(n&&s(!0),!t){n&&c(3);return}return(d=r==null?void 0:r.start)==null||d.call(r,n),L2(t,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(c(3),a(4)):(c(4),a(2)))},run(){u.current?n?(a(3),c(4)):(a(4),c(3)):n?a(1):c(1)},done(){var p;u.current&&R2(t)||(l.current=!1,a(7),n||s(!1),(p=r==null?void 0:r.end)==null||p.call(r,n))}})}},[e,n,t,f]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function L2(e,{prepare:t,run:n,done:r,inFlight:o}){let s=rt();return F2(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(B2(e,r))})}),s.dispose}function B2(e,t){var n,r;let o=rt();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(c=>c instanceof CSSTransition))!=null?r:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(c=>c.finished)).then(()=>{s||t()}),o.dispose)}function F2(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 R2(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function Xs(){return typeof window<"u"}function Ir(e){return Wc(e)?(e.nodeName||"").toLowerCase():"#document"}function Ke(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(Wc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wc(e){return Xs()?e instanceof Node||e instanceof Ke(e).Node:!1}function de(e){return Xs()?e instanceof Element||e instanceof Ke(e).Element:!1}function Ye(e){return Xs()?e instanceof HTMLElement||e instanceof Ke(e).HTMLElement:!1}function Hc(e){return!Xs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ke(e).ShadowRoot}function Ho(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function j2(e){return/^(table|td|th)$/.test(Ir(e))}function Qs(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const _2=/transform|translate|scale|rotate|perspective|filter/,z2=/paint|layout|strict|content/,Qn=e=>!!e&&e!=="none";let Vc;function Gc(e){const t=de(e)?bt(e):e;return Qn(t.transform)||Qn(t.translate)||Qn(t.scale)||Qn(t.rotate)||Qn(t.perspective)||!Js()&&(Qn(t.backdropFilter)||Qn(t.filter))||_2.test(t.willChange||"")||z2.test(t.contain||"")}function U2(e){let t=ln(e);for(;Ye(t)&&!cn(t);){if(Gc(t))return t;if(Qs(t))return null;t=ln(t)}return null}function Js(){return Vc==null&&(Vc=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Vc}function cn(e){return/^(html|body|#document)$/.test(Ir(e))}function bt(e){return Ke(e).getComputedStyle(e)}function ei(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ln(e){if(Ir(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Hc(e)&&e.host||Ut(e);return Hc(t)?t.host:t}function xp(e){const t=ln(e);return cn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ye(t)&&Ho(t)?t:xp(t)}function Cn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=xp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ke(o);if(s){const c=qc(i);return t.concat(i,i.visualViewport||[],Ho(o)?o:[],c&&n?Cn(c):[])}else return t.concat(o,Cn(o,[],n))}function qc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function W2(){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 un=Math.min,ke=Math.max,Vo=Math.round,ti=Math.floor,Wt=e=>({x:e,y:e}),H2={left:"right",right:"left",bottom:"top",top:"bottom"};function Zc(e,t,n){return ke(e,un(t,n))}function Jn(e,t){return typeof e=="function"?e(t):e}function On(e){return e.split("-")[0]}function Dr(e){return e.split("-")[1]}function Ep(e){return e==="x"?"y":"x"}function Kc(e){return e==="y"?"height":"width"}function fn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Yc(e){return Ep(fn(e))}function V2(e,t,n){n===void 0&&(n=!1);const r=Dr(e),o=Yc(e),s=Kc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ni(i)),[i,ni(i)]}function G2(e){const t=ni(e);return[Xc(e),t,Xc(t)]}function Xc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Sp=["left","right"],Pp=["right","left"],q2=["top","bottom"],Z2=["bottom","top"];function K2(e,t,n){switch(e){case"top":case"bottom":return n?t?Pp:Sp:t?Sp:Pp;case"left":case"right":return t?q2:Z2;default:return[]}}function Y2(e,t,n,r){const o=Dr(e);let s=K2(On(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Xc)))),s}function ni(e){const t=On(e);return H2[t]+e.slice(t.length)}function X2(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tp(e){return typeof e!="number"?X2(e):{top:e,right:e,bottom:e,left:e}}function ri(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
137
+ * tabbable 6.4.0
138
138
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
139
- */var G2=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Uc=G2.join(","),wp=typeof Element>"u",Fo=wp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qs=!wp&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Ro=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&Ro(t.parentNode);return i},q2=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Z2=function(t,n,r){if(Ro(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Uc));return n&&Fo.call(t,Uc)&&o.unshift(t),o=o.filter(r),o},Wc=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Ro(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,l=Wc(a,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var u=Fo.call(i,Uc);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!Ro(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&p){var d=Wc(f===!0?i.children:f.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else s.unshift.apply(s,i.children)}}return o},xp=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ep=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||q2(t))&&!xp(t)?0:t.tabIndex},K2=function(t,n){var r=Ep(t);return r<0&&n&&!xp(t)?0:r},Y2=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sp=function(t){return t.tagName==="INPUT"},X2=function(t){return Sp(t)&&t.type==="hidden"},Q2=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},J2=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},eE=function(t){if(!t.name)return!0;var n=t.form||qs(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=J2(o,t.form);return!s||s===t},tE=function(t){return Sp(t)&&t.type==="radio"},nE=function(t){return tE(t)&&!eE(t)},rE=function(t){var n,r=t&&qs(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,c,a;for(s=!!((i=o)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&o;){var l,u,f;r=qs(o),o=(l=r)===null||l===void 0?void 0:l.host,s=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return s},Pp=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},oE=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Fo.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(Fo.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,u=qs(t);if(l&&!l.shadowRoot&&o(l)===!0)return Pp(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(rE(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Pp(t);return!1},sE=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Fo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},iE=function(t,n){return!(n.disabled||Ro(n)||X2(n)||oE(n,t)||Q2(n)||sE(n))},Tp=function(t,n){return!(nE(n)||Ep(n)<0||!iE(t,n))},aE=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ap=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,a=K2(c,i),l=i?Ap(o.candidates):c;a===0?i?n.push.apply(n,l):n.push(c):r.push({documentOrder:s,tabIndex:a,item:o,isScope:i,content:l})}),r.sort(Y2).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},$p=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Wc([t],n.includeContainer,{filter:Tp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:aE}):r=Z2(t,n.includeContainer,Tp.bind(null,n)),Ap(r)};function Cp(e,t,n){let{reference:r,floating:o}=e;const s=ln(t),i=_c(t),c=jc(i),a=$n(t),l=s==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let d;switch(a){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(Ar(t)){case"start":d[i]-=p*(n&&l?-1:1);break;case"end":d[i]+=p*(n&&l?-1:1);break}return d}const cE=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=s.filter(Boolean),a=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Cp(l,r,a),p=r,d={},h=0;for(let m=0;m<c.length;m++){const{name:v,fn:T}=c[m],{x:E,y:S,data:N,reset:M}=await T({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:l,platform:i,elements:{reference:e,floating:t}});u=E??u,f=S??f,d={...d,[v]:{...d[v],...N}},M&&h<=50&&(h++,typeof M=="object"&&(M.placement&&(p=M.placement),M.rects&&(l=M.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):M.rects),{x:u,y:f}=Cp(l,p,a)),m=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}};async function Zs(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=Kn(t,e),h=vp(d),v=c[p?f==="floating"?"reference":"floating":f],T=Gs(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),E=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),N=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},M=Gs(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:S,strategy:a}):E);return{top:(T.top-M.top+h.top)/N.y,bottom:(M.bottom-T.bottom+h.bottom)/N.y,left:(T.left-M.left+h.left)/N.x,right:(M.right-T.right+h.right)/N.x}}const lE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:l,padding:u=0}=Kn(e,t)||{};if(l==null)return{};const f=vp(u),p={x:n,y:r},d=_c(o),h=jc(d),m=await i.getDimensions(l),v=d==="y",T=v?"top":"left",E=v?"bottom":"right",S=v?"clientHeight":"clientWidth",N=s.reference[h]+s.reference[d]-p[d]-s.floating[h],M=p[d]-s.reference[d],B=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let F=B?B[S]:0;(!F||!await(i.isElement==null?void 0:i.isElement(B)))&&(F=c.floating[S]||s.floating[h]);const b=N/2-M/2,g=F/2-m[h]/2-1,w=cn(f[T],g),$=cn(f[E],g),C=w,O=F-m[h]-$,k=F/2-m[h]/2+b,y=Rc(C,k,O),A=!a.arrow&&Ar(o)!=null&&k!==y&&s.reference[h]/2-(k<C?w:$)-m[h]/2<0,I=A?k<C?k-C:k-O:0;return{[d]:p[d]+I,data:{[d]:y,centerOffset:k-y-I,...A&&{alignmentOffset:I}},reset:A}}}),uE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...v}=Kn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=$n(o),E=ln(c),S=$n(c)===c,N=await(a.isRTL==null?void 0:a.isRTL(l.floating)),M=p||(S||!m?[Vs(c)]:_2(c)),B=h!=="none";!p&&B&&M.push(...H2(c,m,h,N));const F=[c,...M],b=await Zs(t,v),g=[];let w=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&g.push(b[T]),f){const k=j2(o,i,N);g.push(b[k[0]],b[k[1]])}if(w=[...w,{placement:o,overflows:g}],!g.every(k=>k<=0)){var $,C;const k=((($=s.flip)==null?void 0:$.index)||0)+1,y=F[k];if(y&&(!(f==="alignment"?E!==ln(y):!1)||w.every(P=>ln(P.placement)===E?P.overflows[0]>0:!0)))return{data:{index:k,overflows:w},reset:{placement:y}};let A=(C=w.filter(I=>I.overflows[0]<=0).sort((I,P)=>I.overflows[1]-P.overflows[1])[0])==null?void 0:C.placement;if(!A)switch(d){case"bestFit":{var O;const I=(O=w.filter(P=>{if(B){const L=ln(P.placement);return L===E||L==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(L=>L>0).reduce((L,j)=>L+j,0)]).sort((P,L)=>P[1]-L[1])[0])==null?void 0:O[0];I&&(A=I);break}case"initialPlacement":A=c;break}if(o!==A)return{reset:{placement:A}}}return{}}}},fE=new Set(["left","top"]);async function dE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=$n(n),c=Ar(n),a=ln(n)==="y",l=fE.has(i)?-1:1,u=s&&a?-1:1,f=Kn(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),a?{x:d*u,y:p*l}:{x:p*l,y:d*u}}const pE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,a=await dE(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},hE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:v=>{let{x:T,y:E}=v;return{x:T,y:E}}},...a}=Kn(e,t),l={x:n,y:r},u=await Zs(t,a),f=ln($n(o)),p=bp(f);let d=l[p],h=l[f];if(s){const v=p==="y"?"top":"left",T=p==="y"?"bottom":"right",E=d+u[v],S=d-u[T];d=Rc(E,d,S)}if(i){const v=f==="y"?"top":"left",T=f==="y"?"bottom":"right",E=h+u[v],S=h-u[T];h=Rc(E,h,S)}const m=c.fn({...t,[p]:d,[f]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:s,[f]:i}}}}}},mE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...l}=Kn(e,t),u=await Zs(t,l),f=$n(o),p=Ar(o),d=ln(o)==="y",{width:h,height:m}=s.floating;let v,T;f==="top"||f==="bottom"?(v=f,T=p===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(T=f,v=p==="end"?"top":"bottom");const E=m-u.top-u.bottom,S=h-u.left-u.right,N=cn(m-u[v],E),M=cn(h-u[T],S),B=!t.middlewareData.shift;let F=N,b=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(b=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=E),B&&!p){const w=De(u.left,0),$=De(u.right,0),C=De(u.top,0),O=De(u.bottom,0);d?b=h-2*(w!==0||$!==0?w+$:De(u.left,u.right)):F=m-2*(C!==0||O!==0?C+O:De(u.top,u.bottom))}await a({...t,availableWidth:b,availableHeight:F});const g=await i.getDimensions(c.floating);return h!==g.width||m!==g.height?{reset:{rects:!0}}:{}}}};function Np(e){const t=ht(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Fe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Bo(n)!==s||Bo(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function Hc(e){return de(e)?e:e.contextElement}function $r(e){const t=Hc(e);if(!Fe(t))return zt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Np(t);let i=(s?Bo(n.width):n.width)/r,c=(s?Bo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const bE=zt(0);function Op(e){const t=Ze(e);return!Us()||!t.visualViewport?bE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ze(e)?!1:t}function Yn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Hc(e);let i=zt(1);t&&(r?de(r)&&(i=$r(r)):i=$r(e));const c=gE(s,n,r)?Op(s):zt(0);let a=(o.left+c.x)/i.x,l=(o.top+c.y)/i.y,u=o.width/i.x,f=o.height/i.y;if(s){const p=Ze(s),d=r&&de(r)?Ze(r):r;let h=p,m=Fc(h);for(;m&&r&&d!==h;){const v=$r(m),T=m.getBoundingClientRect(),E=ht(m),S=T.left+(m.clientLeft+parseFloat(E.paddingLeft))*v.x,N=T.top+(m.clientTop+parseFloat(E.paddingTop))*v.y;a*=v.x,l*=v.y,u*=v.x,f*=v.y,a+=S,l+=N,h=Ze(m),m=Fc(h)}}return Gs({width:u,height:f,x:a,y:l})}function Ks(e,t){const n=Ws(e).scrollLeft;return t?t.left+n:Yn(_t(e)).left+n}function Ip(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ks(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function yE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=_t(r),c=t?zs(t.floating):!1;if(r===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=zt(1);const u=zt(0),f=Fe(r);if((f||!f&&!s)&&((Tr(r)!=="body"||Lo(i))&&(a=Ws(r)),Fe(r))){const d=Yn(r);l=$r(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const p=i&&!f&&!s?Ip(i,a):zt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-a.scrollTop*l.y+u.y+p.y}}function vE(e){return Array.from(e.getClientRects())}function wE(e){const t=_t(e),n=Ws(e),r=e.ownerDocument.body,o=De(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=De(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ks(e);const c=-n.scrollTop;return ht(r).direction==="rtl"&&(i+=De(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const kp=25;function xE(e,t){const n=Ze(e),r=_t(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,a=0;if(o){s=o.width,i=o.height;const u=Us();(!u||u&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}const l=Ks(r);if(l<=0){const u=r.ownerDocument,f=u.body,p=getComputedStyle(f),d=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(r.clientWidth-f.clientWidth-d);h<=kp&&(s-=h)}else l<=kp&&(s+=l);return{width:s,height:i,x:c,y:a}}const EE=new Set(["absolute","fixed"]);function SE(e,t){const n=Yn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Fe(e)?$r(e):zt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=o*s.x,l=r*s.y;return{width:i,height:c,x:a,y:l}}function Dp(e,t,n){let r;if(t==="viewport")r=xE(e,n);else if(t==="document")r=wE(_t(e));else if(de(t))r=SE(t,n);else{const o=Op(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gs(r)}function Mp(e,t){const n=an(e);return n===t||!de(n)||sn(n)?!1:ht(n).position==="fixed"||Mp(n,t)}function PE(e,t){const n=t.get(e);if(n)return n;let r=An(e,[],!1).filter(c=>de(c)&&Tr(c)!=="body"),o=null;const s=ht(e).position==="fixed";let i=s?an(e):e;for(;de(i)&&!sn(i);){const c=ht(i),a=Bc(i);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&EE.has(o.position)||Lo(i)&&!a&&Mp(e,i))?r=r.filter(u=>u!==i):o=c,i=an(i)}return t.set(e,r),r}function TE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?zs(t)?[]:PE(t,this._c):[].concat(n),r],c=i[0],a=i.reduce((l,u)=>{const f=Dp(t,u,o);return l.top=De(f.top,l.top),l.right=cn(f.right,l.right),l.bottom=cn(f.bottom,l.bottom),l.left=De(f.left,l.left),l},Dp(t,c,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function AE(e){const{width:t,height:n}=Np(e);return{width:t,height:n}}function $E(e,t,n){const r=Fe(t),o=_t(t),s=n==="fixed",i=Yn(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=zt(0);function l(){a.x=Ks(o)}if(r||!r&&!s)if((Tr(t)!=="body"||Lo(o))&&(c=Ws(t)),r){const d=Yn(t,!0,s,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?Ip(o,c):zt(0),f=i.left+c.scrollLeft-a.x-u.x,p=i.top+c.scrollTop-a.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function Vc(e){return ht(e).position==="static"}function Lp(e,t){if(!Fe(e)||ht(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _t(e)===n&&(n=n.ownerDocument.body),n}function Bp(e,t){const n=Ze(e);if(zs(e))return n;if(!Fe(e)){let o=an(e);for(;o&&!sn(o);){if(de(o)&&!Vc(o))return o;o=an(o)}return n}let r=Lp(e,t);for(;r&&C2(r)&&Vc(r);)r=Lp(r,t);return r&&sn(r)&&Vc(r)&&!Bc(r)?n:r||D2(e)||n}const CE=async function(e){const t=this.getOffsetParent||Bp,n=this.getDimensions,r=await n(e.floating);return{reference:$E(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function NE(e){return ht(e).direction==="rtl"}const OE={convertOffsetParentRelativeRectToViewportRelativeRect:yE,getDocumentElement:_t,getClippingRect:TE,getOffsetParent:Bp,getElementRects:CE,getClientRects:vE,getDimensions:AE,getScale:$r,isElement:de,isRTL:NE};function Fp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function IE(e,t){let n=null,r;const o=_t(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:d}=l;if(c||t(),!p||!d)return;const h=Hs(f),m=Hs(o.clientWidth-(u+p)),v=Hs(o.clientHeight-(f+d)),T=Hs(u),S={rootMargin:-h+"px "+-m+"px "+-v+"px "+-T+"px",threshold:De(0,cn(1,a))||1};let N=!0;function M(B){const F=B[0].intersectionRatio;if(F!==a){if(!N)return i();F?i(!1,F):r=setTimeout(()=>{i(!1,1e-7)},1e3)}F===1&&!Fp(l,e.getBoundingClientRect())&&i(),N=!1}try{n=new IntersectionObserver(M,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(M,S)}n.observe(e)}return i(!0),s}function Rp(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,l=Hc(e),u=o||s?[...l?An(l):[],...An(t)]:[];u.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const f=l&&c?IE(l,n):null;let p=-1,d=null;i&&(d=new ResizeObserver(T=>{let[E]=T;E&&E.target===l&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=d)==null||S.observe(t)})),n()}),l&&!a&&d.observe(l),d.observe(t));let h,m=a?Yn(e):null;a&&v();function v(){const T=Yn(e);m&&!Fp(m,T)&&n(),m=T,h=requestAnimationFrame(v)}return n(),()=>{var T;u.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),f==null||f(),(T=d)==null||T.disconnect(),d=null,a&&cancelAnimationFrame(h)}}const Gc=Zs,kE=pE,DE=hE,ME=uE,LE=mE,jp=lE,BE=(e,t,n)=>{const r=new Map,o={platform:OE,...n},s={...o.platform,_c:r};return cE(e,t,{...o,platform:s})};var FE=typeof document<"u",RE=function(){},Ys=FE?x.useLayoutEffect:RE;function Xs(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,o;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(!Xs(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Xs(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _p(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zp(e,t){const n=_p(e);return Math.round(t*n)/n}function qc(e){const t=U.useRef(e);return Ys(()=>{t.current=e}),t}function Up(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[u,f]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=U.useState(r);Xs(p,r)||d(r);const[h,m]=U.useState(null),[v,T]=U.useState(null),E=U.useCallback(P=>{P!==B.current&&(B.current=P,m(P))},[]),S=U.useCallback(P=>{P!==F.current&&(F.current=P,T(P))},[]),N=s||h,M=i||v,B=U.useRef(null),F=U.useRef(null),b=U.useRef(u),g=a!=null,w=qc(a),$=qc(o),C=qc(l),O=U.useCallback(()=>{if(!B.current||!F.current)return;const P={placement:t,strategy:n,middleware:p};$.current&&(P.platform=$.current),BE(B.current,F.current,P).then(L=>{const j={...L,isPositioned:C.current!==!1};k.current&&!Xs(b.current,j)&&(b.current=j,Mr.flushSync(()=>{f(j)}))})},[p,t,n,$,C]);Ys(()=>{l===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[l]);const k=U.useRef(!1);Ys(()=>(k.current=!0,()=>{k.current=!1}),[]),Ys(()=>{if(N&&(B.current=N),M&&(F.current=M),N&&M){if(w.current)return w.current(N,M,O);O()}},[N,M,O,w,g]);const y=U.useMemo(()=>({reference:B,floating:F,setReference:E,setFloating:S}),[E,S]),A=U.useMemo(()=>({reference:N,floating:M}),[N,M]),I=U.useMemo(()=>{const P={position:n,left:0,top:0};if(!A.floating)return P;const L=zp(A.floating,u.x),j=zp(A.floating,u.y);return c?{...P,transform:"translate("+L+"px, "+j+"px)",..._p(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:j}},[n,c,A.floating,u.x,u.y]);return U.useMemo(()=>({...u,update:O,refs:y,elements:A,floatingStyles:I}),[u,O,y,A,I])}const jE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?jp({element:r.current,padding:o}).fn(n):{}:r?jp({element:r,padding:o}).fn(n):{}}}},Zc=(e,t)=>({...kE(e),options:[e,t]}),Wp=(e,t)=>({...DE(e),options:[e,t]}),Hp=(e,t)=>({...ME(e),options:[e,t]}),_E=(e,t)=>({...LE(e),options:[e,t]}),zE=(e,t)=>({...jE(e),options:[e,t]}),Vp={...U},UE=Vp.useInsertionEffect||(e=>e());function Gp(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return UE(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Kc=typeof document<"u"?x.useLayoutEffect:x.useEffect;let qp=!1,WE=0;const Zp=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+WE++;function HE(){const[e,t]=U.useState(()=>qp?Zp():void 0);return Kc(()=>{e==null&&t(Zp())},[]),U.useEffect(()=>{qp=!0},[]),e}const VE=Vp.useId||HE;let jo;process.env.NODE_ENV!=="production"&&(jo=new Set);function GE(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=jo)!=null&&e.has(o))){var s;(s=jo)==null||s.add(o),console.warn(o)}}function qE(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=jo)!=null&&e.has(o))){var s;(s=jo)==null||s.add(o),console.error(o)}}function ZE(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(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(o=>o!==n))||[])}}}const KE=U.createContext(null),YE=U.createContext(null),XE=()=>{var e;return((e=U.useContext(KE))==null?void 0:e.id)||null},QE=()=>U.useContext(YE),JE="data-floating-ui-focusable";function e8(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=VE(),s=U.useRef({}),[i]=U.useState(()=>ZE()),c=XE()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!de(d)&&qE("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=U.useState(r.reference),u=Gp((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=U.useMemo(()=>({setPositionReference:l}),[]),p=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:f}),[t,u,p,i,o,f])}function t8(e){e===void 0&&(e={});const{nodeId:t}=e,n=e8({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[c,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,f=U.useRef(null),p=QE();Kc(()=>{u&&(f.current=u)},[u]);const d=Up({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(S=>{const N=de(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;a(N),d.refs.setReference(N)},[d.refs]),m=U.useCallback(S=>{(de(S)||S===null)&&(f.current=S,i(S)),(de(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!de(S))&&d.refs.setReference(S)},[d.refs]),v=U.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),T=U.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=U.useMemo(()=>({...d,...r,refs:v,elements:T,nodeId:t}),[d,v,T,t,r]);return Kc(()=>{r.dataRef.current.floatingContext=E;const S=p==null?void 0:p.nodesRef.current.find(N=>N.id===t);S&&(S.context=E)}),U.useMemo(()=>({...d,context:E,refs:v,elements:T}),[d,v,T,E])}const Kp="active",Yp="selected";function Yc(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Kp]:i,[Yp]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[JE]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(a=>{let[l,u]=a;if(!(o&&[Kp,Yp].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var f;(f=r.get(l))==null||f.push(u),i[l]=function(){for(var p,d=arguments.length,h=new Array(d),m=0;m<d;m++)h[m]=arguments[m];return(p=r.get(l))==null?void 0:p.map(v=>v(...h)).find(v=>v!==void 0)}}}else i[l]=u}),i),{})}}function n8(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=U.useCallback(c=>Yc(c,e,"reference"),t),s=U.useCallback(c=>Yc(c,e,"floating"),n),i=U.useCallback(c=>Yc(c,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function Xp(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const r8=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:c=4,referenceOverflowThreshold:a=0,scrollRef:l,...u}=Kn(e,t),{rects:f,elements:{floating:p}}=t,d=n.current[i],h=(l==null?void 0:l.current)||p,m=p.clientTop||h.clientTop,v=p.clientTop!==0,T=h.clientTop!==0,E=p===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||GE('`placement` side must be "bottom" when using the `inner`',"middleware.")),!d)return{};const S={...t,...await Zc(-d.offsetTop-p.clientTop-f.reference.height/2-d.offsetHeight/2-s).fn(t)},N=await Gc(Xp(S,h.scrollHeight+m+p.clientTop),u),M=await Gc(S,{...u,elementContext:"reference"}),B=De(0,N.top),F=S.y+B,w=(h.scrollHeight>h.clientHeight?$=>$:Bo)(De(0,h.scrollHeight+(v&&E||T?m*2:0)-B-De(0,N.bottom)));if(h.style.maxHeight=w+"px",h.scrollTop=B,o){const $=h.offsetHeight<d.offsetHeight*cn(c,n.current.length)-1||M.top>=-a||M.bottom>=-a;Mr.flushSync(()=>o($))}return r&&(r.current=await Gc(Xp({...S,y:F},h.offsetHeight+m+p.clientTop),u)),{y:F}}});function o8(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:c}=t,a=Gp(c),l=U.useRef(!1),u=U.useRef(null),f=U.useRef(null);U.useEffect(()=>{if(!o)return;function d(m){if(m.ctrlKey||!h||s.current==null)return;const v=m.deltaY,T=s.current.top>=-.5,E=s.current.bottom>=-.5,S=h.scrollHeight-h.clientHeight,N=v<0?-1:1,M=v<0?"max":"min";h.scrollHeight<=h.clientHeight||(!T&&v>0||!E&&v<0?(m.preventDefault(),Mr.flushSync(()=>{a(B=>B+Math[M](v,S*N))})):/firefox/i.test(L2())&&(h.scrollTop+=v))}const h=(i==null?void 0:i.current)||r.floating;if(n&&h)return h.addEventListener("wheel",d),requestAnimationFrame(()=>{u.current=h.scrollTop,s.current!=null&&(f.current={...s.current})}),()=>{u.current=null,f.current=null,h.removeEventListener("wheel",d)}},[o,n,r.floating,s,i,a]);const p=U.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const d=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!d||!l.current)){if(u.current!==null){const h=d.scrollTop-u.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&Mr.flushSync(()=>a(m=>m+h))}requestAnimationFrame(()=>{u.current=d.scrollTop})}}}),[r.floating,a,s,i]);return U.useMemo(()=>o?{floating:p}:{},[o,p])}let Cr=x.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Cr.displayName="FloatingContext";let Xc=x.createContext(null);Xc.displayName="PlacementContext";function s8(e){return x.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function i8(){return x.useContext(Cr).setReference}function a8(){return x.useContext(Cr).getReferenceProps}function c8(){let{getFloatingProps:e,slot:t}=x.useContext(Cr);return x.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function l8(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=x.useContext(Xc),n=x.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);Ee(()=>{t==null||t(n??null)},[t,n]);let r=x.useContext(Cr);return x.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Qp=4;function u8({children:e,enabled:t=!0}){let[n,r]=x.useState(null),[o,s]=x.useState(0),i=x.useRef(null),[c,a]=x.useState(null);f8(c);let l=t&&n!==null&&c!==null,{to:u="bottom",gap:f=0,offset:p=0,padding:d=0,inner:h}=d8(n,c),[m,v="center"]=u.split(" ");Ee(()=>{l&&s(0)},[l]);let{refs:T,floatingStyles:E,context:S}=t8({open:l,placement:m==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${m}`:`${m}-${v}`,strategy:"absolute",transform:!1,middleware:[Zc({mainAxis:m==="selection"?0:f,crossAxis:p}),Wp({padding:d}),m!=="selection"&&Hp({padding:d}),m==="selection"&&h?r8({...h,padding:d,overflowRef:i,offset:o,minItemsVisible:Qp,referenceOverflowThreshold:d,onFallbackChange($){var C,O;if(!$)return;let k=S.elements.floating;if(!k)return;let y=parseFloat(getComputedStyle(k).scrollPaddingBottom)||0,A=Math.min(Qp,k.childElementCount),I=0,P=0;for(let L of(O=(C=S.elements.floating)==null?void 0:C.childNodes)!=null?O:[])if(on(L)){let j=L.offsetTop,z=j+L.clientHeight+y,_=k.scrollTop,H=_+k.clientHeight;if(j>=_&&z<=H)A--;else{P=Math.max(0,Math.min(z,H)-Math.max(j,_)),I=L.clientHeight;break}}A>=1&&s(L=>{let j=I*A-P+y;return L>=j?L:j})}}):null,_E({padding:d,apply({availableWidth:$,availableHeight:C,elements:O}){Object.assign(O.floating.style,{overflow:"auto",maxWidth:`${$}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${C}px)`})}})].filter(Boolean),whileElementsMounted:Rp}),[N=m,M=v]=S.placement.split("-");m==="selection"&&(N="selection");let B=x.useMemo(()=>({anchor:[N,M].filter(Boolean).join(" ")}),[N,M]),F=o8(S,{overflowRef:i,onChange:s}),{getReferenceProps:b,getFloatingProps:g}=n8([F]),w=ue($=>{a($),T.setFloating($)});return U.createElement(Xc.Provider,{value:r},U.createElement(Cr.Provider,{value:{setFloating:w,setReference:T.setReference,styles:E,getReferenceProps:b,getFloatingProps:g,slot:B}},e))}function f8(e){Ee(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function d8(e,t){var n,r,o;let s=Qc((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=Qc((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),c=Qc((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:c}}function Qc(e,t,n=void 0){let r=Gn(),o=ue((a,l)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!l)return[n,null];let u=eh(a,l);return[u,f=>{let p=Jp(a);{let d=p.map(h=>window.getComputedStyle(l).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let m=!1;for(let[T,E]of p.entries()){let S=window.getComputedStyle(l).getPropertyValue(E);if(d[T]!==S){d[T]=S,m=!0;break}}if(!m)return;let v=eh(a,l);u!==v&&(f(v),u=v)})}return r.dispose}]}return[n,null]}),s=x.useMemo(()=>o(e,t)[0],[e,t]),[i=s,c]=x.useState();return Ee(()=>{let[a,l]=o(e,t);if(c(a),!!l)return l(c)},[e,t]),i}function Jp(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(),o=t[1].slice(n+1).trim();return o?[r,...Jp(o)]:[r]}return[]}function eh(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}function p8({children:e,freeze:t},n){let r=th(t,e);return x.isValidElement(r)?x.cloneElement(r,{ref:n}):x.createElement(x.Fragment,null,r)}x.forwardRef(p8);function th(e,t){let[n,r]=x.useState(t);return!e&&n!==t&&r(t),e?n:t}let Jc=x.createContext(null);Jc.displayName="OpenClosedContext";var Ot=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ot||{});function el(){return x.useContext(Jc)}function nh({value:e,children:t}){return x.createElement(Jc.Provider,{value:e},t)}function h8(e){throw new Error("Unexpected object: "+e)}var we=(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))(we||{});function Qs(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:h8(e)}}function rh(e){let t=ue(e),n=x.useRef(!1);x.useEffect(()=>(n.current=!1,()=>{n.current=!0,P0(()=>{n.current&&t()})}),[t])}let m8=x.createContext(!1);function b8(){return x.useContext(m8)}function g8(e){let t=b8(),n=x.useContext(sh),[r,o]=x.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Rt.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let c=e.createElement("div");return c.setAttribute("id","headlessui-portal-root"),e.body.appendChild(c)});return x.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),x.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let oh=x.Fragment,y8=Ge(function(e,t){let{ownerDocument:n=null,...r}=e,o=x.useRef(null),s=dt(Sx(p=>{o.current=p}),t),i=Dc(o.current),c=n??i,a=g8(c),l=x.useContext(E8),u=Gn(),f=rt();return rh(()=>{var p;a&&a.childNodes.length<=0&&((p=a.parentElement)==null||p.removeChild(a))}),a?je.createPortal(x.createElement("div",{"data-headlessui-portal":"",ref:p=>{u.dispose(),l&&p&&u.add(l.register(p))}},f({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:oh,name:"Portal"})),a):null});function v8(e,t){let n=dt(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=rt();return r?x.createElement(y8,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:oh,name:"Portal"})}let w8=x.Fragment,sh=x.createContext(null);function x8(e,t){let{target:n,...r}=e,o={ref:dt(t)},s=rt();return x.createElement(sh.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:w8,name:"Popover.Group"}))}let E8=x.createContext(null),S8=Ge(v8),P8=Ge(x8),T8=Object.assign(S8,{Group:P8});const Js={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function ih(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function A8(e,t,n){let r=nt();if(t.kind==="Tracked"){let o=function(){s!==ih(e)&&(r.dispose(),n())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),r.add(()=>i.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function $8(){let e=typeof document>"u";return"useSyncExternalStore"in U?(t=>t.useSyncExternalStore)(U)(()=>()=>{},()=>!1,()=>!e):!1}function ah(){let e=$8(),[t,n]=U.useState(Rt.isHandoffComplete);return t&&Rt.isHandoffComplete===!1&&n(!1),U.useEffect(()=>{t!==!0&&n(!0)},[t]),U.useEffect(()=>Rt.handoff(),[]),e?!1:t}function C8(){let e=x.useRef(!1);return Ee(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ch(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!Io((t=e.as)!=null?t:uh)||x.Children.count(e.children)===1}let ei=x.createContext(null);ei.displayName="TransitionContext";var N8=(e=>(e.Visible="visible",e.Hidden="hidden",e))(N8||{});function O8(){let e=x.useContext(ei);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function I8(){let e=x.useContext(ti);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let ti=x.createContext(null);ti.displayName="NestingContext";function ni(e){return"children"in e?ni(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function lh(e,t){let n=qn(e),r=x.useRef([]),o=C8(),s=Gn(),i=ue((d,h=Pn.Hidden)=>{let m=r.current.findIndex(({el:v})=>v===d);m!==-1&&(ft(h,{[Pn.Unmount](){r.current.splice(m,1)},[Pn.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var v;!ni(r)&&o.current&&((v=n.current)==null||v.call(n))}))}),c=ue(d=>{let h=r.current.find(({el:m})=>m===d);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:d,state:"visible"}),()=>i(d,Pn.Unmount)}),a=x.useRef([]),l=x.useRef(Promise.resolve()),u=x.useRef({enter:[],leave:[]}),f=ue((d,h,m)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([v])=>v!==d)),t==null||t.chains.current[h].push([d,new Promise(v=>{a.current.push(v)})]),t==null||t.chains.current[h].push([d,new Promise(v=>{Promise.all(u.current[h].map(([T,E])=>E)).then(()=>v())})]),h==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(h)):m(h)}),p=ue((d,h,m)=>{Promise.all(u.current[h].splice(0).map(([v,T])=>T)).then(()=>{var v;(v=a.current.shift())==null||v()}).then(()=>m(h))});return x.useMemo(()=>({children:r,register:c,unregister:i,onStart:f,onStop:p,wait:l,chains:u}),[c,i,r,f,p,u,l])}let uh=x.Fragment,fh=Ls.RenderStrategy;function k8(e,t){var n,r;let{transition:o=!0,beforeEnter:s,afterEnter:i,beforeLeave:c,afterLeave:a,enter:l,enterFrom:u,enterTo:f,entered:p,leave:d,leaveFrom:h,leaveTo:m,...v}=e,[T,E]=x.useState(null),S=x.useRef(null),N=ch(e),M=dt(...N?[S,t,E]:t===null?[]:[t]),B=(n=v.unmount)==null||n?Pn.Unmount:Pn.Hidden,{show:F,appear:b,initial:g}=O8(),[w,$]=x.useState(F?"visible":"hidden"),C=I8(),{register:O,unregister:k}=C;Ee(()=>O(S),[O,S]),Ee(()=>{if(B===Pn.Hidden&&S.current){if(F&&w!=="visible"){$("visible");return}return ft(w,{hidden:()=>k(S),visible:()=>O(S)})}},[w,S,O,k,F,B]);let y=ah();Ee(()=>{if(N&&y&&w==="visible"&&S.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[S,w,y,N]);let A=g&&!b,I=b&&F&&g,P=x.useRef(!1),L=lh(()=>{P.current||($("hidden"),k(S))},C),j=ue(Z=>{P.current=!0;let J=Z?"enter":"leave";L.onStart(S,J,ee=>{ee==="enter"?s==null||s():ee==="leave"&&(c==null||c())})}),z=ue(Z=>{let J=Z?"enter":"leave";P.current=!1,L.onStop(S,J,ee=>{ee==="enter"?i==null||i():ee==="leave"&&(a==null||a())}),J==="leave"&&!ni(L)&&($("hidden"),k(S))});x.useEffect(()=>{N&&o||(j(F),z(F))},[F,N,o]);let _=!(!o||!N||!y||A),[,H]=hp(_,T,F,{start:j,end:z}),Y=Tn({ref:M,className:((r=yc(v.className,I&&l,I&&u,H.enter&&l,H.enter&&H.closed&&u,H.enter&&!H.closed&&f,H.leave&&d,H.leave&&!H.closed&&h,H.leave&&H.closed&&m,!H.transition&&F&&p))==null?void 0:r.trim())||void 0,...pp(H)}),G=0;w==="visible"&&(G|=Ot.Open),w==="hidden"&&(G|=Ot.Closed),F&&w==="hidden"&&(G|=Ot.Opening),!F&&w==="visible"&&(G|=Ot.Closing);let W=rt();return x.createElement(ti.Provider,{value:L},x.createElement(nh,{value:G},W({ourProps:Y,theirProps:v,defaultTag:uh,features:fh,visible:w==="visible",name:"Transition.Child"})))}function D8(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,i=x.useRef(null),c=ch(e),a=dt(...c?[i,t]:t===null?[]:[t]);ah();let l=el();if(n===void 0&&l!==null&&(n=(l&Ot.Open)===Ot.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,f]=x.useState(n?"visible":"hidden"),p=lh(()=>{n||f("hidden")}),[d,h]=x.useState(!0),m=x.useRef([n]);Ee(()=>{d!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),h(!1))},[m,n]);let v=x.useMemo(()=>({show:n,appear:r,initial:d}),[n,r,d]);Ee(()=>{n?f("visible"):!ni(p)&&i.current!==null&&f("hidden")},[n,p]);let T={unmount:o},E=ue(()=>{var M;d&&h(!1),(M=e.beforeEnter)==null||M.call(e)}),S=ue(()=>{var M;d&&h(!1),(M=e.beforeLeave)==null||M.call(e)}),N=rt();return x.createElement(ti.Provider,{value:p},x.createElement(ei.Provider,{value:v},N({ourProps:{...T,as:x.Fragment,children:x.createElement(dh,{ref:a,...T,...s,beforeEnter:E,beforeLeave:S})},theirProps:{},defaultTag:x.Fragment,features:fh,visible:u==="visible",name:"Transition"})))}function M8(e,t){let n=x.useContext(ei)!==null,r=el()!==null;return x.createElement(x.Fragment,null,!n&&r?x.createElement(tl,{ref:t,...e}):x.createElement(dh,{ref:t,...e}))}let tl=Ge(D8),dh=Ge(k8),L8=Ge(M8),nl=Object.assign(tl,{Child:L8,Root:tl}),ph=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function hh(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!on(o))return r;let s=!1;for(let c of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))c.remove(),s=!0;let i=s?(n=o.innerText)!=null?n:"":r;return ph.test(i)&&(i=i.replace(ph,"")),i}function B8(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(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():hh(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return hh(e).trim()}function F8(e){let t=x.useRef(""),n=x.useRef("");return ue(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=B8(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var R8=Object.defineProperty,j8=(e,t,n)=>t in e?R8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mh=(e,t,n)=>(j8(e,typeof t!="symbol"?t+"":t,n),n),Me=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Me||{}),Cn=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Cn||{}),ri=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ri||{}),bh=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(bh||{});function gh(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=op(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let _8={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Js.Tracked(ih(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:we.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(s=>r(s.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:Js.Idle}},2(e,t){var n,r,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let c={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===we.Nothing)return{...c,activeOptionIndex:null};if(t.focus===we.Specific)return{...c,activeOptionIndex:e.options.findIndex(u=>u.id===t.id)};if(t.focus===we.Previous){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,p=Qs(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(p!==null){let d=e.options[p].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===d.current||((o=d.current)==null?void 0:o.previousElementSibling)===null)return{...c,activeOptionIndex:p}}}}else if(t.focus===we.Next){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,p=Qs(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(p!==null){let d=e.options[p].dataRef.current.domRef;if(((s=f.current)==null?void 0:s.nextElementSibling)===d.current||((i=d.current)==null?void 0:i.nextElementSibling)===null)return{...c,activeOptionIndex:p}}}}let a=gh(e),l=Qs(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...c,...a,activeOptionIndex:l}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var c;return!i.dataRef.current.disabled&&((c=i.dataRef.current.textValue)==null?void 0:c.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==we.Nothing&&(r=Qs(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=n.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(r=s)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:we.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[s,i]of n.entries())if(o.has(i.id)&&(r.push(s),o.delete(i.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...gh(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Js.Moved}}};class rl extends G0{constructor(t){super(t),mh(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return ft(s,{0:()=>r==null?void 0:r(n),1:()=>{let c=i.slice(),a=c.findIndex(l=>o(l,n));return a===-1?c.push(n):c.splice(a,1),r==null?void 0:r(c)}})},registerOption:Pc(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:Pc(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Pc(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),mh(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,i=n.options;return s!==null?((o=i[s])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=Tc.get(null);this.disposables.add(r.on(Y0.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(A8(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new rl({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:we.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:Js.Idle})}reduce(t,n){return ft(n.type,_8,t,n)}}const yh=x.createContext(null);function ol(e){let t=x.useContext(yh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,vh),n}return t}function vh({id:e,__demoMode:t=!1}){let n=x.useMemo(()=>rl.new({id:e,__demoMode:t}),[]);return rh(()=>n.dispose()),n}let oi=x.createContext(null);oi.displayName="ListboxDataContext";function _o(e){let t=x.useContext(oi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,_o),n}return t}let z8=x.Fragment;function U8(e,t){let n=x.useId(),r=gc(),{value:o,defaultValue:s,form:i,name:c,onChange:a,by:l,invalid:u=!1,disabled:f=r||!1,horizontal:p=!1,multiple:d=!1,__demoMode:h=!1,...m}=e;const v=p?"horizontal":"vertical";let T=dt(t),E=cx(s),[S=d?[]:void 0,N]=ax(o,a,E),M=vh({id:n,__demoMode:h}),B=x.useRef({static:!1,hold:!1}),F=x.useRef(new Map),b=Mx(l),g=x.useCallback(_=>ft(w.mode,{[Cn.Multi]:()=>S.some(H=>b(H,_)),[Cn.Single]:()=>b(S,_)}),[S]),w=Sn({value:S,disabled:f,invalid:u,mode:d?Cn.Multi:Cn.Single,orientation:v,onChange:N,compare:b,isSelected:g,optionsPropsRef:B,listRef:F});Ee(()=>{M.state.dataRef.current=w},[w]);let $=qe(M,_=>_.listboxState),C=Tc.get(null),O=qe(C,x.useCallback(_=>C.selectors.isTop(_,n),[C,n])),[k,y]=qe(M,_=>[_.buttonElement,_.optionsElement]);a2(O,[k,y],(_,H)=>{M.send({type:bh.CloseListbox}),rp(H,kc.Loose)||(_.preventDefault(),k==null||k.focus())});let A=Sn({open:$===Me.Open,disabled:f,invalid:u,value:S}),[I,P]=Cx({inherit:!0}),L={ref:T},j=x.useCallback(()=>{if(E!==void 0)return N==null?void 0:N(E)},[N,E]),z=rt();return x.createElement(P,{value:I,props:{htmlFor:k==null?void 0:k.id},slot:{open:$===Me.Open,disabled:f}},x.createElement(u8,null,x.createElement(yh.Provider,{value:M},x.createElement(oi.Provider,{value:w},x.createElement(nh,{value:ft($,{[Me.Open]:Ot.Open,[Me.Closed]:Ot.Closed})},c!=null&&S!=null&&x.createElement(mx,{disabled:f,data:{[c]:S},form:i,onReset:j}),z({ourProps:L,theirProps:m,slot:A,defaultTag:z8,name:"Listbox"}))))))}let W8="button";function H8(e,t){let n=x.useId(),r=I0(),o=_o("Listbox.Button"),s=ol("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:c=o.disabled||!1,autoFocus:a=!1,...l}=e,u=dt(t,i8(),s.actions.setButtonElement),f=a8(),[p,d,h]=qe(s,y=>[y.listboxState,y.buttonElement,y.optionsElement]),m=p===Me.Open;u2(m,{trigger:d,action:x.useCallback(y=>{if(d!=null&&d.contains(y.target))return js.Ignore;let A=y.target.closest('[role="option"]:not([data-disabled])');return on(A)?js.Select(A):h!=null&&h.contains(y.target)?js.Ignore:js.Close},[d,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let v=ue(y=>{switch(y.key){case Oe.Enter:lx(y.currentTarget);break;case Oe.Space:case Oe.ArrowDown:y.preventDefault(),s.actions.openListbox({focus:o.value?we.Nothing:we.First});break;case Oe.ArrowUp:y.preventDefault(),s.actions.openListbox({focus:o.value?we.Nothing:we.Last});break}}),T=ue(y=>{switch(y.key){case Oe.Space:y.preventDefault();break}}),E=Bx(y=>{var A;s.state.listboxState===Me.Open?(je.flushSync(()=>s.actions.closeListbox()),(A=s.state.buttonElement)==null||A.focus({preventScroll:!0})):(y.preventDefault(),s.actions.openListbox({focus:we.Nothing}))}),S=ue(y=>y.preventDefault()),N=_0([i]),M=Px(),{isFocusVisible:B,focusProps:F}=q5({autoFocus:a}),{isHovered:b,hoverProps:g}=G5({isDisabled:c}),{pressed:w,pressProps:$}=ex({disabled:c}),C=Sn({open:p===Me.Open,active:w||p===Me.Open,disabled:c,invalid:o.invalid,value:o.value,hover:b,focus:B,autofocus:a}),O=qe(s,y=>y.listboxState===Me.Open),k=A0(f(),{ref:u,id:i,type:f2(e,d),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":O,"aria-labelledby":N,"aria-describedby":M,disabled:c||void 0,autoFocus:a,onKeyDown:v,onKeyUp:T,onKeyPress:S},E,F,g,$);return rt()({ourProps:k,theirProps:l,slot:C,defaultTag:W8,name:"Listbox.Button"})}let wh=x.createContext(!1),V8="div",G8=Ls.RenderStrategy|Ls.Static;function q8(e,t){let n=x.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:c=!1,...a}=e,l=s8(o),[u,f]=x.useState(null);l&&(s=!0);let p=_o("Listbox.Options"),d=ol("Listbox.Options"),[h,m,v,T]=qe(d,W=>[W.listboxState,W.buttonElement,W.optionsElement,W.__demoMode]),E=Dc(m),S=Dc(v),N=el(),[M,B]=hp(c,u,N!==null?(N&Ot.Open)===Ot.Open:h===Me.Open);Kx(M,m,d.actions.closeListbox);let F=T?!1:i&&h===Me.Open;y2(F,S);let b=T?!1:i&&h===Me.Open;Zx(b,{allowed:x.useCallback(()=>[m,v],[m,v])});let g=qe(d,d.selectors.didButtonMove)?!1:M,w=qe(d,d.selectors.hasFrozenValue)&&!e.static,$=th(w,p.value),C=x.useCallback(W=>p.compare($,W),[p.compare,$]),O=qe(d,W=>{var Z;if(l==null||!((Z=l==null?void 0:l.to)!=null&&Z.includes("selection")))return null;let J=W.options.findIndex(ee=>C(ee.dataRef.current.value));return J===-1&&(J=0),J}),k=(()=>{if(l==null)return;if(O===null)return{...l,inner:void 0};let W=Array.from(p.listRef.current.values());return{...l,inner:{listRef:{current:W},index:O}}})(),[y,A]=l8(k),I=c8(),P=dt(t,l?y:null,d.actions.setOptionsElement,f),L=Gn();x.useEffect(()=>{let W=v;W&&h===Me.Open&&(X5(W)||W==null||W.focus({preventScroll:!0}))},[h,v]);let j=ue(W=>{var Z;switch(L.dispose(),W.key){case Oe.Space:if(d.state.searchQuery!=="")return W.preventDefault(),W.stopPropagation(),d.actions.search(W.key);case Oe.Enter:W.preventDefault(),W.stopPropagation(),d.actions.selectActiveOption();break;case ft(p.orientation,{vertical:Oe.ArrowDown,horizontal:Oe.ArrowRight}):return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:we.Next});case ft(p.orientation,{vertical:Oe.ArrowUp,horizontal:Oe.ArrowLeft}):return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:we.Previous});case Oe.Home:case Oe.PageUp:return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:we.First});case Oe.End:case Oe.PageDown:return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:we.Last});case Oe.Escape:W.preventDefault(),W.stopPropagation(),je.flushSync(()=>d.actions.closeListbox()),(Z=d.state.buttonElement)==null||Z.focus({preventScroll:!0});return;case Oe.Tab:W.preventDefault(),W.stopPropagation(),je.flushSync(()=>d.actions.closeListbox()),r2(d.state.buttonElement,W.shiftKey?Ic.Previous:Ic.Next);break;default:W.key.length===1&&(d.actions.search(W.key),L.setTimeout(()=>d.actions.clearSearch(),350));break}}),z=qe(d,W=>{var Z;return(Z=W.buttonElement)==null?void 0:Z.id}),_=Sn({open:h===Me.Open}),H=A0(l?I():{},{id:r,ref:P,"aria-activedescendant":qe(d,d.selectors.activeDescendantId),"aria-multiselectable":p.mode===Cn.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":p.orientation,onKeyDown:j,role:"listbox",tabIndex:h===Me.Open?0:void 0,style:{...a.style,...A,"--button-width":Lx(M,m,!0).width},...pp(B)}),Y=rt(),G=x.useMemo(()=>p.mode===Cn.Multi?p:{...p,isSelected:C},[p,C]);return x.createElement(T8,{enabled:s?e.static||M:!1,ownerDocument:E},x.createElement(oi.Provider,{value:G},Y({ourProps:H,theirProps:a,slot:_,defaultTag:V8,features:G8,visible:g,name:"Listbox.Options"})))}let Z8="div";function K8(e,t){let n=x.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,c=x.useContext(wh)===!0,a=_o("Listbox.Option"),l=ol("Listbox.Option"),u=qe(l,w=>l.selectors.isActive(w,r)),f=a.isSelected(s),p=x.useRef(null),d=F8(p),h=qn({disabled:o,value:s,domRef:p,get textValue(){return d()}}),m=dt(t,p,w=>{w?a.listRef.current.set(r,w):a.listRef.current.delete(r)}),v=qe(l,w=>l.selectors.shouldScrollIntoView(w,r));Ee(()=>{if(v)return nt().requestAnimationFrame(()=>{var w,$;($=(w=p.current)==null?void 0:w.scrollIntoView)==null||$.call(w,{block:"nearest"})})},[v,p]),Ee(()=>{if(!c)return l.actions.registerOption(r,h),()=>l.actions.unregisterOption(r)},[h,r,c]);let T=ue(w=>{if(o)return w.preventDefault();l.actions.selectOption(s)}),E=ue(()=>{if(o)return l.actions.goToOption({focus:we.Nothing});l.actions.goToOption({focus:we.Specific,id:r})}),S=v2(),N=ue(w=>S.update(w)),M=ue(w=>{S.wasMoved(w)&&(o||u&&l.state.activationTrigger===ri.Pointer||l.actions.goToOption({focus:we.Specific,id:r},ri.Pointer))}),B=ue(w=>{S.wasMoved(w)&&(o||u&&l.state.activationTrigger===ri.Pointer&&l.actions.goToOption({focus:we.Nothing}))}),F=Sn({active:u,focus:u,selected:f,disabled:o,selectedOption:f&&c}),b=c?{}:{id:r,ref:m,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:T,onFocus:E,onPointerEnter:N,onMouseEnter:N,onPointerMove:M,onMouseMove:M,onPointerLeave:B,onMouseLeave:B},g=rt();return!f&&c?null:g({ourProps:b,theirProps:i,slot:F,defaultTag:Z8,name:"Listbox.Option"})}let Y8=x.Fragment;function X8(e,t){let{options:n,placeholder:r,...o}=e,s={ref:dt(t)},i=_o("ListboxSelectedOption"),c=Sn({}),a=i.value===void 0||i.value===null||i.mode===Cn.Multi&&Array.isArray(i.value)&&i.value.length===0,l=rt();return x.createElement(wh.Provider,{value:!0},l({ourProps:s,theirProps:{...o,children:x.createElement(x.Fragment,null,r&&a?r:n)},slot:c,defaultTag:Y8,name:"ListboxSelectedOption"}))}let Q8=Ge(U8),J8=Ge(H8),e3=kx,t3=Ge(q8),n3=Ge(K8),r3=Ge(X8),mt=Object.assign(Q8,{Button:J8,Label:e3,Options:t3,Option:n3,SelectedOption:r3});const o3=()=>D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_active)",children:D.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_active",children:D.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),s3=()=>D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_inactive)",children:D.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_inactive",children:D.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),zo=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,s)=>s+1);return D.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>D.jsx("div",{className:"flex items-center justify-center",children:o>t-e?D.jsx(o3,{}):D.jsx(s3,{})},o))})};class It{}Go(It,"FAST",3),Go(It,"Medium",2),Go(It,"SLOW",1),Go(It,"NONE",0);const i3=Object.values({MAINNET:1,SEPOLIA:11155111}),un=e=>{const t=typeof e=="string"?parseInt(e,10):e;return i3.includes(t)},a3={USDT:!0},xh=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!a3[t.toUpperCase()]:!0},c3=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc"})=>{const{t:i}=wt();return D.jsx("div",{className:`relative ${o}`,children:D.jsx(mt,{value:t,onChange:n,disabled:r,children:({open:c})=>D.jsxs(D.Fragment,{children:[D.jsxs(mt.Button,{className:`
139
+ */var Q2=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Qc=Q2.join(","),$p=typeof Element>"u",Go=$p?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,oi=!$p&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},si=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):si(t.parentNode));return i},J2=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},eE=function(t,n,r){if(si(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Qc));return n&&Go.call(t,Qc)&&o.unshift(t),o=o.filter(r),o},Jc=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!si(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,l=Jc(a,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var u=Go.call(i,Qc);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),d=!si(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&d){var p=Jc(f===!0?i.children:f.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},Ap=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Np=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||J2(t))&&!Ap(t)?0:t.tabIndex},tE=function(t,n){var r=Np(t);return r<0&&n&&!Ap(t)?0:r},nE=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Cp=function(t){return t.tagName==="INPUT"},rE=function(t){return Cp(t)&&t.type==="hidden"},oE=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},sE=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},iE=function(t){if(!t.name)return!0;var n=t.form||oi(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=sE(o,t.form);return!s||s===t},aE=function(t){return Cp(t)&&t.type==="radio"},cE=function(t){return aE(t)&&!iE(t)},lE=function(t){var n,r=t&&oi(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,c,a;for(s=!!((i=o)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&o;){var l,u,f;r=oi(o),o=(l=r)===null||l===void 0?void 0:l.host,s=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return s},Op=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},uE=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Go.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(Go.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,u=oi(t);if(l&&!l.shadowRoot&&o(l)===!0)return Op(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(lE(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Op(t);return!1},fE=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Go.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},dE=function(t,n){return!(n.disabled||rE(n)||uE(n,t)||oE(n)||fE(n))},Ip=function(t,n){return!(cE(n)||Np(n)<0||!dE(t,n))},pE=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Dp=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,a=tE(c,i),l=i?Dp(o.candidates):c;a===0?i?n.push.apply(n,l):n.push(c):r.push({documentOrder:s,tabIndex:a,item:o,isScope:i,content:l})}),r.sort(nE).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Mp=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Jc([t],n.includeContainer,{filter:Ip.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:pE}):r=eE(t,n.includeContainer,Ip.bind(null,n)),Dp(r)};function kp(e,t,n){let{reference:r,floating:o}=e;const s=fn(t),i=Yc(t),c=Kc(i),a=On(t),l=s==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(a){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Dr(t)){case"start":p[i]-=d*(n&&l?-1:1);break;case"end":p[i]+=d*(n&&l?-1:1);break}return p}async function Lp(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Jn(t,e),h=Tp(p),S=c[d?f==="floating"?"reference":"floating":f],P=ri(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(S)))==null||n?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),x=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),$=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},k=ri(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:w,strategy:a}):x);return{top:(P.top-k.top+h.top)/$.y,bottom:(k.bottom-P.bottom+h.bottom)/$.y,left:(P.left-k.left+h.left)/$.x,right:(k.right-P.right+h.right)/$.x}}const hE=50,mE=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:Lp},a=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=kp(l,r,a),d=r,p=0;const h={};for(let b=0;b<s.length;b++){const S=s[b];if(!S)continue;const{name:P,fn:x}=S,{x:w,y:$,data:k,reset:B}=await x({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:l,platform:c,elements:{reference:e,floating:t}});u=w??u,f=$??f,h[P]={...h[P],...k},B&&p<hE&&(p++,typeof B=="object"&&(B.placement&&(d=B.placement),B.rects&&(l=B.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):B.rects),{x:u,y:f}=kp(l,d,a)),b=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}},bE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:l,padding:u=0}=Jn(e,t)||{};if(l==null)return{};const f=Tp(u),d={x:n,y:r},p=Yc(o),h=Kc(p),b=await i.getDimensions(l),S=p==="y",P=S?"top":"left",x=S?"bottom":"right",w=S?"clientHeight":"clientWidth",$=s.reference[h]+s.reference[p]-d[p]-s.floating[h],k=d[p]-s.reference[p],B=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let F=B?B[w]:0;(!F||!await(i.isElement==null?void 0:i.isElement(B)))&&(F=c.floating[w]||s.floating[h]);const m=$/2-k/2,g=F/2-b[h]/2-1,v=un(f[P],g),A=un(f[x],g),N=v,O=F-b[h]-A,D=F/2-b[h]/2+m,y=Zc(N,D,O),C=!a.arrow&&Dr(o)!=null&&D!==y&&s.reference[h]/2-(D<N?v:A)-b[h]/2<0,I=C?D<N?D-N:D-O:0;return{[p]:d[p]+I,data:{[p]:y,centerOffset:D-y-I,...C&&{alignmentOffset:I}},reset:C}}}),gE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:b=!0,...S}=Jn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const P=On(o),x=fn(c),w=On(c)===c,$=await(a.isRTL==null?void 0:a.isRTL(l.floating)),k=d||(w||!b?[ni(c)]:G2(c)),B=h!=="none";!d&&B&&k.push(...Y2(c,b,h,$));const F=[c,...k],m=await a.detectOverflow(t,S),g=[];let v=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&g.push(m[P]),f){const D=V2(o,i,$);g.push(m[D[0]],m[D[1]])}if(v=[...v,{placement:o,overflows:g}],!g.every(D=>D<=0)){var A,N;const D=(((A=s.flip)==null?void 0:A.index)||0)+1,y=F[D];if(y&&(!(f==="alignment"?x!==fn(y):!1)||v.every(T=>fn(T.placement)===x?T.overflows[0]>0:!0)))return{data:{index:D,overflows:v},reset:{placement:y}};let C=(N=v.filter(I=>I.overflows[0]<=0).sort((I,T)=>I.overflows[1]-T.overflows[1])[0])==null?void 0:N.placement;if(!C)switch(p){case"bestFit":{var O;const I=(O=v.filter(T=>{if(B){const L=fn(T.placement);return L===x||L==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(L=>L>0).reduce((L,j)=>L+j,0)]).sort((T,L)=>T[1]-L[1])[0])==null?void 0:O[0];I&&(C=I);break}case"initialPlacement":C=c;break}if(o!==C)return{reset:{placement:C}}}return{}}}},yE=new Set(["left","top"]);async function vE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=On(n),c=Dr(n),a=fn(n)==="y",l=yE.has(i)?-1:1,u=s&&a?-1:1,f=Jn(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof h=="number"&&(p=c==="end"?h*-1:h),a?{x:p*u,y:d*l}:{x:d*l,y:p*u}}const wE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,a=await vE(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},xE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:P=>{let{x,y:w}=P;return{x,y:w}}},...l}=Jn(e,t),u={x:n,y:r},f=await s.detectOverflow(t,l),d=fn(On(o)),p=Ep(d);let h=u[p],b=u[d];if(i){const P=p==="y"?"top":"left",x=p==="y"?"bottom":"right",w=h+f[P],$=h-f[x];h=Zc(w,h,$)}if(c){const P=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=b+f[P],$=b-f[x];b=Zc(w,b,$)}const S=a.fn({...t,[p]:h,[d]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[p]:i,[d]:c}}}}}},EE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...l}=Jn(e,t),u=await i.detectOverflow(t,l),f=On(o),d=Dr(o),p=fn(o)==="y",{width:h,height:b}=s.floating;let S,P;f==="top"||f==="bottom"?(S=f,P=d===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(P=f,S=d==="end"?"top":"bottom");const x=b-u.top-u.bottom,w=h-u.left-u.right,$=un(b-u[S],x),k=un(h-u[P],w),B=!t.middlewareData.shift;let F=$,m=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(m=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=x),B&&!d){const v=ke(u.left,0),A=ke(u.right,0),N=ke(u.top,0),O=ke(u.bottom,0);p?m=h-2*(v!==0||A!==0?v+A:ke(u.left,u.right)):F=b-2*(N!==0||O!==0?N+O:ke(u.top,u.bottom))}await a({...t,availableWidth:m,availableHeight:F});const g=await i.getDimensions(c.floating);return h!==g.width||b!==g.height?{reset:{rects:!0}}:{}}}};function Bp(e){const t=bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ye(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Vo(n)!==s||Vo(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function el(e){return de(e)?e:e.contextElement}function Mr(e){const t=el(e);if(!Ye(t))return Wt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Bp(t);let i=(s?Vo(n.width):n.width)/r,c=(s?Vo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const SE=Wt(0);function Fp(e){const t=Ke(e);return!Js()||!t.visualViewport?SE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ke(e)?!1:t}function er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=el(e);let i=Wt(1);t&&(r?de(r)&&(i=Mr(r)):i=Mr(e));const c=PE(s,n,r)?Fp(s):Wt(0);let a=(o.left+c.x)/i.x,l=(o.top+c.y)/i.y,u=o.width/i.x,f=o.height/i.y;if(s){const d=Ke(s),p=r&&de(r)?Ke(r):r;let h=d,b=qc(h);for(;b&&r&&p!==h;){const S=Mr(b),P=b.getBoundingClientRect(),x=bt(b),w=P.left+(b.clientLeft+parseFloat(x.paddingLeft))*S.x,$=P.top+(b.clientTop+parseFloat(x.paddingTop))*S.y;a*=S.x,l*=S.y,u*=S.x,f*=S.y,a+=w,l+=$,h=Ke(b),b=qc(h)}}return ri({width:u,height:f,x:a,y:l})}function ii(e,t){const n=ei(e).scrollLeft;return t?t.left+n:er(Ut(e)).left+n}function Rp(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ii(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function TE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Ut(r),c=t?Qs(t.floating):!1;if(r===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=Wt(1);const u=Wt(0),f=Ye(r);if((f||!f&&!s)&&((Ir(r)!=="body"||Ho(i))&&(a=ei(r)),f)){const p=er(r);l=Mr(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const d=i&&!f&&!s?Rp(i,a):Wt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+d.x,y:n.y*l.y-a.scrollTop*l.y+u.y+d.y}}function $E(e){return Array.from(e.getClientRects())}function AE(e){const t=Ut(e),n=ei(e),r=e.ownerDocument.body,o=ke(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ke(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ii(e);const c=-n.scrollTop;return bt(r).direction==="rtl"&&(i+=ke(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const jp=25;function NE(e,t){const n=Ke(e),r=Ut(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,a=0;if(o){s=o.width,i=o.height;const u=Js();(!u||u&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}const l=ii(r);if(l<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,h=Math.abs(r.clientWidth-f.clientWidth-p);h<=jp&&(s-=h)}else l<=jp&&(s+=l);return{width:s,height:i,x:c,y:a}}function CE(e,t){const n=er(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ye(e)?Mr(e):Wt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=o*s.x,l=r*s.y;return{width:i,height:c,x:a,y:l}}function _p(e,t,n){let r;if(t==="viewport")r=NE(e,n);else if(t==="document")r=AE(Ut(e));else if(de(t))r=CE(t,n);else{const o=Fp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ri(r)}function zp(e,t){const n=ln(e);return n===t||!de(n)||cn(n)?!1:bt(n).position==="fixed"||zp(n,t)}function OE(e,t){const n=t.get(e);if(n)return n;let r=Cn(e,[],!1).filter(c=>de(c)&&Ir(c)!=="body"),o=null;const s=bt(e).position==="fixed";let i=s?ln(e):e;for(;de(i)&&!cn(i);){const c=bt(i),a=Gc(i);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ho(i)&&!a&&zp(e,i))?r=r.filter(u=>u!==i):o=c,i=ln(i)}return t.set(e,r),r}function IE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Qs(t)?[]:OE(t,this._c):[].concat(n),r],c=_p(t,i[0],o);let a=c.top,l=c.right,u=c.bottom,f=c.left;for(let d=1;d<i.length;d++){const p=_p(t,i[d],o);a=ke(p.top,a),l=un(p.right,l),u=un(p.bottom,u),f=ke(p.left,f)}return{width:l-f,height:u-a,x:f,y:a}}function DE(e){const{width:t,height:n}=Bp(e);return{width:t,height:n}}function ME(e,t,n){const r=Ye(t),o=Ut(t),s=n==="fixed",i=er(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=Wt(0);function l(){a.x=ii(o)}if(r||!r&&!s)if((Ir(t)!=="body"||Ho(o))&&(c=ei(t)),r){const p=er(t,!0,s,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?Rp(o,c):Wt(0),f=i.left+c.scrollLeft-a.x-u.x,d=i.top+c.scrollTop-a.y-u.y;return{x:f,y:d,width:i.width,height:i.height}}function tl(e){return bt(e).position==="static"}function Up(e,t){if(!Ye(e)||bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function Wp(e,t){const n=Ke(e);if(Qs(e))return n;if(!Ye(e)){let o=ln(e);for(;o&&!cn(o);){if(de(o)&&!tl(o))return o;o=ln(o)}return n}let r=Up(e,t);for(;r&&j2(r)&&tl(r);)r=Up(r,t);return r&&cn(r)&&tl(r)&&!Gc(r)?n:r||U2(e)||n}const kE=async function(e){const t=this.getOffsetParent||Wp,n=this.getDimensions,r=await n(e.floating);return{reference:ME(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function LE(e){return bt(e).direction==="rtl"}const BE={convertOffsetParentRelativeRectToViewportRelativeRect:TE,getDocumentElement:Ut,getClippingRect:IE,getOffsetParent:Wp,getElementRects:kE,getClientRects:$E,getDimensions:DE,getScale:Mr,isElement:de,isRTL:LE};function Hp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function FE(e,t){let n=null,r;const o=Ut(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:d,height:p}=l;if(c||t(),!d||!p)return;const h=ti(f),b=ti(o.clientWidth-(u+d)),S=ti(o.clientHeight-(f+p)),P=ti(u),w={rootMargin:-h+"px "+-b+"px "+-S+"px "+-P+"px",threshold:ke(0,un(1,a))||1};let $=!0;function k(B){const F=B[0].intersectionRatio;if(F!==a){if(!$)return i();F?i(!1,F):r=setTimeout(()=>{i(!1,1e-7)},1e3)}F===1&&!Hp(l,e.getBoundingClientRect())&&i(),$=!1}try{n=new IntersectionObserver(k,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return i(!0),s}function Vp(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,l=el(e),u=o||s?[...l?Cn(l):[],...t?Cn(t):[]]:[];u.forEach(P=>{o&&P.addEventListener("scroll",n,{passive:!0}),s&&P.addEventListener("resize",n)});const f=l&&c?FE(l,n):null;let d=-1,p=null;i&&(p=new ResizeObserver(P=>{let[x]=P;x&&x.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),l&&!a&&p.observe(l),t&&p.observe(t));let h,b=a?er(e):null;a&&S();function S(){const P=er(e);b&&!Hp(b,P)&&n(),b=P,h=requestAnimationFrame(S)}return n(),()=>{var P;u.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(P=p)==null||P.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const nl=Lp,RE=wE,jE=xE,_E=gE,zE=EE,Gp=bE,UE=(e,t,n)=>{const r=new Map,o={platform:BE,...n},s={...o.platform,_c:r};return mE(e,t,{...o,platform:s})};var WE=typeof document<"u",HE=function(){},ai=WE?E.useLayoutEffect:HE;function ci(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,o;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(!ci(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!ci(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function qp(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zp(e,t){const n=qp(e);return Math.round(t*n)/n}function rl(e){const t=U.useRef(e);return ai(()=>{t.current=e}),t}function Kp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[u,f]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=U.useState(r);ci(d,r)||p(r);const[h,b]=U.useState(null),[S,P]=U.useState(null),x=U.useCallback(T=>{T!==B.current&&(B.current=T,b(T))},[]),w=U.useCallback(T=>{T!==F.current&&(F.current=T,P(T))},[]),$=s||h,k=i||S,B=U.useRef(null),F=U.useRef(null),m=U.useRef(u),g=a!=null,v=rl(a),A=rl(o),N=rl(l),O=U.useCallback(()=>{if(!B.current||!F.current)return;const T={placement:t,strategy:n,middleware:d};A.current&&(T.platform=A.current),UE(B.current,F.current,T).then(L=>{const j={...L,isPositioned:N.current!==!1};D.current&&!ci(m.current,j)&&(m.current=j,zr.flushSync(()=>{f(j)}))})},[d,t,n,A,N]);ai(()=>{l===!1&&m.current.isPositioned&&(m.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[l]);const D=U.useRef(!1);ai(()=>(D.current=!0,()=>{D.current=!1}),[]),ai(()=>{if($&&(B.current=$),k&&(F.current=k),$&&k){if(v.current)return v.current($,k,O);O()}},[$,k,O,v,g]);const y=U.useMemo(()=>({reference:B,floating:F,setReference:x,setFloating:w}),[x,w]),C=U.useMemo(()=>({reference:$,floating:k}),[$,k]),I=U.useMemo(()=>{const T={position:n,left:0,top:0};if(!C.floating)return T;const L=Zp(C.floating,u.x),j=Zp(C.floating,u.y);return c?{...T,transform:"translate("+L+"px, "+j+"px)",...qp(C.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:j}},[n,c,C.floating,u.x,u.y]);return U.useMemo(()=>({...u,update:O,refs:y,elements:C,floatingStyles:I}),[u,O,y,C,I])}const VE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Gp({element:r.current,padding:o}).fn(n):{}:r?Gp({element:r,padding:o}).fn(n):{}}}},ol=(e,t)=>{const n=RE(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yp=(e,t)=>{const n=jE(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xp=(e,t)=>{const n=_E(e);return{name:n.name,fn:n.fn,options:[e,t]}},GE=(e,t)=>{const n=zE(e);return{name:n.name,fn:n.fn,options:[e,t]}},qE=(e,t)=>{const n=VE(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qp={...U},ZE=Qp.useInsertionEffect||(e=>e());function Jp(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ZE(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var sl=typeof document<"u"?E.useLayoutEffect:E.useEffect;let eh=!1,KE=0;const th=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+KE++;function YE(){const[e,t]=U.useState(()=>eh?th():void 0);return sl(()=>{e==null&&t(th())},[]),U.useEffect(()=>{eh=!0},[]),e}const XE=Qp.useId||YE;let qo;process.env.NODE_ENV!=="production"&&(qo=new Set);function QE(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=qo)!=null&&e.has(o))){var s;(s=qo)==null||s.add(o),console.warn(o)}}function JE(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=qo)!=null&&e.has(o))){var s;(s=qo)==null||s.add(o),console.error(o)}}function e8(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(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(o=>o!==n))||[])}}}const t8=U.createContext(null),n8=U.createContext(null),r8=()=>{var e;return((e=U.useContext(t8))==null?void 0:e.id)||null},o8=()=>U.useContext(n8),s8="data-floating-ui-focusable";function i8(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=XE(),s=U.useRef({}),[i]=U.useState(()=>e8()),c=r8()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!de(p)&&JE("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=U.useState(r.reference),u=Jp((p,h,b)=>{s.current.openEvent=p?h:void 0,i.emit("openchange",{open:p,event:h,reason:b,nested:c}),n==null||n(p,h,b)}),f=U.useMemo(()=>({setPositionReference:l}),[]),d=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:d,events:i,floatingId:o,refs:f}),[t,u,d,i,o,f])}function a8(e){e===void 0&&(e={});const{nodeId:t}=e,n=i8({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[c,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,f=U.useRef(null),d=o8();sl(()=>{u&&(f.current=u)},[u]);const p=Kp({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(w=>{const $=de(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;a($),p.refs.setReference($)},[p.refs]),b=U.useCallback(w=>{(de(w)||w===null)&&(f.current=w,i(w)),(de(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!de(w))&&p.refs.setReference(w)},[p.refs]),S=U.useMemo(()=>({...p.refs,setReference:b,setPositionReference:h,domReference:f}),[p.refs,b,h]),P=U.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),x=U.useMemo(()=>({...p,...r,refs:S,elements:P,nodeId:t}),[p,S,P,t,r]);return sl(()=>{r.dataRef.current.floatingContext=x;const w=d==null?void 0:d.nodesRef.current.find($=>$.id===t);w&&(w.context=x)}),U.useMemo(()=>({...p,context:x,refs:S,elements:P}),[p,S,P,x])}const nh="active",rh="selected";function il(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[nh]:i,[rh]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[s8]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(a=>{let[l,u]=a;if(!(o&&[nh,rh].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var f;(f=r.get(l))==null||f.push(u),i[l]=function(){for(var d,p=arguments.length,h=new Array(p),b=0;b<p;b++)h[b]=arguments[b];return(d=r.get(l))==null?void 0:d.map(S=>S(...h)).find(S=>S!==void 0)}}}else i[l]=u}),i),{})}}function c8(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=U.useCallback(c=>il(c,e,"reference"),t),s=U.useCallback(c=>il(c,e,"floating"),n),i=U.useCallback(c=>il(c,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function oh(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const l8=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:c=4,referenceOverflowThreshold:a=0,scrollRef:l,...u}=Jn(e,t),{rects:f,elements:{floating:d}}=t,p=n.current[i],h=(l==null?void 0:l.current)||d,b=d.clientTop||h.clientTop,S=d.clientTop!==0,P=h.clientTop!==0,x=d===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||QE('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const w={...t,...await ol(-p.offsetTop-d.clientTop-f.reference.height/2-p.offsetHeight/2-s).fn(t)},$=await nl(oh(w,h.scrollHeight+b+d.clientTop),u),k=await nl(w,{...u,elementContext:"reference"}),B=ke(0,$.top),F=w.y+B,v=(h.scrollHeight>h.clientHeight?A=>A:Vo)(ke(0,h.scrollHeight+(S&&x||P?b*2:0)-B-ke(0,$.bottom)));if(h.style.maxHeight=v+"px",h.scrollTop=B,o){const A=h.offsetHeight<p.offsetHeight*un(c,n.current.length)-1||k.top>=-a||k.bottom>=-a;zr.flushSync(()=>o(A))}return r&&(r.current=await nl(oh({...w,y:F},h.offsetHeight+b+d.clientTop),u)),{y:F}}});function u8(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:c}=t,a=Jp(c),l=U.useRef(!1),u=U.useRef(null),f=U.useRef(null);U.useEffect(()=>{if(!o)return;function p(b){if(b.ctrlKey||!h||s.current==null)return;const S=b.deltaY,P=s.current.top>=-.5,x=s.current.bottom>=-.5,w=h.scrollHeight-h.clientHeight,$=S<0?-1:1,k=S<0?"max":"min";h.scrollHeight<=h.clientHeight||(!P&&S>0||!x&&S<0?(b.preventDefault(),zr.flushSync(()=>{a(B=>B+Math[k](S,w*$))})):/firefox/i.test(W2())&&(h.scrollTop+=S))}const h=(i==null?void 0:i.current)||r.floating;if(n&&h)return h.addEventListener("wheel",p),requestAnimationFrame(()=>{u.current=h.scrollTop,s.current!=null&&(f.current={...s.current})}),()=>{u.current=null,f.current=null,h.removeEventListener("wheel",p)}},[o,n,r.floating,s,i,a]);const d=U.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const p=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!p||!l.current)){if(u.current!==null){const h=p.scrollTop-u.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&zr.flushSync(()=>a(b=>b+h))}requestAnimationFrame(()=>{u.current=p.scrollTop})}}}),[r.floating,a,s,i]);return U.useMemo(()=>o?{floating:d}:{},[o,d])}let kr=E.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});kr.displayName="FloatingContext";let al=E.createContext(null);al.displayName="PlacementContext";function f8(e){return E.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function d8(){return E.useContext(kr).setReference}function p8(){return E.useContext(kr).getReferenceProps}function h8(){let{getFloatingProps:e,slot:t}=E.useContext(kr);return E.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function m8(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=E.useContext(al),n=E.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);Ee(()=>{t==null||t(n??null)},[t,n]);let r=E.useContext(kr);return E.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let sh=4;function b8({children:e,enabled:t=!0}){let[n,r]=E.useState(null),[o,s]=E.useState(0),i=E.useRef(null),[c,a]=E.useState(null);g8(c);let l=t&&n!==null&&c!==null,{to:u="bottom",gap:f=0,offset:d=0,padding:p=0,inner:h}=y8(n,c),[b,S="center"]=u.split(" ");Ee(()=>{l&&s(0)},[l]);let{refs:P,floatingStyles:x,context:w}=a8({open:l,placement:b==="selection"?S==="center"?"bottom":`bottom-${S}`:S==="center"?`${b}`:`${b}-${S}`,strategy:"absolute",transform:!1,middleware:[ol({mainAxis:b==="selection"?0:f,crossAxis:d}),Yp({padding:p}),b!=="selection"&&Xp({padding:p}),b==="selection"&&h?l8({...h,padding:p,overflowRef:i,offset:o,minItemsVisible:sh,referenceOverflowThreshold:p,onFallbackChange(A){var N,O;if(!A)return;let D=w.elements.floating;if(!D)return;let y=parseFloat(getComputedStyle(D).scrollPaddingBottom)||0,C=Math.min(sh,D.childElementCount),I=0,T=0;for(let L of(O=(N=w.elements.floating)==null?void 0:N.childNodes)!=null?O:[])if(an(L)){let j=L.offsetTop,z=j+L.clientHeight+y,_=D.scrollTop,W=_+D.clientHeight;if(j>=_&&z<=W)C--;else{T=Math.max(0,Math.min(z,W)-Math.max(j,_)),I=L.clientHeight;break}}C>=1&&s(L=>{let j=I*C-T+y;return L>=j?L:j})}}):null,GE({padding:p,apply({availableWidth:A,availableHeight:N,elements:O}){Object.assign(O.floating.style,{overflow:"auto",maxWidth:`${A}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${N}px)`})}})].filter(Boolean),whileElementsMounted:Vp}),[$=b,k=S]=w.placement.split("-");b==="selection"&&($="selection");let B=E.useMemo(()=>({anchor:[$,k].filter(Boolean).join(" ")}),[$,k]),F=u8(w,{overflowRef:i,onChange:s}),{getReferenceProps:m,getFloatingProps:g}=c8([F]),v=fe(A=>{a(A),P.setFloating(A)});return U.createElement(al.Provider,{value:r},U.createElement(kr.Provider,{value:{setFloating:v,setReference:P.setReference,styles:x,getReferenceProps:m,getFloatingProps:g,slot:B}},e))}function g8(e){Ee(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function y8(e,t){var n,r,o;let s=cl((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=cl((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),c=cl((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:c}}function cl(e,t,n=void 0){let r=Kn(),o=fe((a,l)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!l)return[n,null];let u=ah(a,l);return[u,f=>{let d=ih(a);{let p=d.map(h=>window.getComputedStyle(l).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let b=!1;for(let[P,x]of d.entries()){let w=window.getComputedStyle(l).getPropertyValue(x);if(p[P]!==w){p[P]=w,b=!0;break}}if(!b)return;let S=ah(a,l);u!==S&&(f(S),u=S)})}return r.dispose}]}return[n,null]}),s=E.useMemo(()=>o(e,t)[0],[e,t]),[i=s,c]=E.useState();return Ee(()=>{let[a,l]=o(e,t);if(c(a),!!l)return l(c)},[e,t]),i}function ih(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(),o=t[1].slice(n+1).trim();return o?[r,...ih(o)]:[r]}return[]}function ah(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}function v8({children:e,freeze:t},n){let r=ch(t,e);return E.isValidElement(r)?E.cloneElement(r,{ref:n}):E.createElement(E.Fragment,null,r)}E.forwardRef(v8);function ch(e,t){let[n,r]=E.useState(t);return!e&&n!==t&&r(t),e?n:t}let ll=E.createContext(null);ll.displayName="OpenClosedContext";var Dt=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Dt||{});function ul(){return E.useContext(ll)}function lh({value:e,children:t}){return E.createElement(ll.Provider,{value:e},t)}function w8(e){throw new Error("Unexpected object: "+e)}var we=(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))(we||{});function li(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:w8(e)}}function uh(e){let t=fe(e),n=E.useRef(!1);E.useEffect(()=>(n.current=!1,()=>{n.current=!0,O0(()=>{n.current&&t()})}),[t])}let x8=E.createContext(!1);function E8(){return E.useContext(x8)}function S8(e){let t=E8(),n=E.useContext(dh),[r,o]=E.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(_t.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let c=e.createElement("div");return c.setAttribute("id","headlessui-portal-root"),e.body.appendChild(c)});return E.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),E.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let fh=E.Fragment,P8=qe(function(e,t){let{ownerDocument:n=null,...r}=e,o=E.useRef(null),s=ht(Bx(d=>{o.current=d}),t),i=Uc(o.current),c=n??i,a=S8(c),l=E.useContext(N8),u=Kn(),f=ot();return uh(()=>{var d;a&&a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a))}),a?je.createPortal(E.createElement("div",{"data-headlessui-portal":"",ref:d=>{u.dispose(),l&&d&&u.add(l.register(d))}},f({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:fh,name:"Portal"})),a):null});function T8(e,t){let n=ht(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=ot();return r?E.createElement(P8,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:fh,name:"Portal"})}let $8=E.Fragment,dh=E.createContext(null);function A8(e,t){let{target:n,...r}=e,o={ref:ht(t)},s=ot();return E.createElement(dh.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:$8,name:"Popover.Group"}))}let N8=E.createContext(null),C8=qe(T8),O8=qe(A8),I8=Object.assign(C8,{Group:O8});const ui={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function ph(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function D8(e,t,n){let r=rt();if(t.kind==="Tracked"){let o=function(){s!==ph(e)&&(r.dispose(),n())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),r.add(()=>i.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function M8(){let e=typeof document>"u";return"useSyncExternalStore"in U?(t=>t.useSyncExternalStore)(U)(()=>()=>{},()=>!1,()=>!e):!1}function hh(){let e=M8(),[t,n]=U.useState(_t.isHandoffComplete);return t&&_t.isHandoffComplete===!1&&n(!1),U.useEffect(()=>{t!==!0&&n(!0)},[t]),U.useEffect(()=>_t.handoff(),[]),e?!1:t}function k8(){let e=E.useRef(!1);return Ee(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function mh(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!_o((t=e.as)!=null?t:gh)||E.Children.count(e.children)===1}let fi=E.createContext(null);fi.displayName="TransitionContext";var L8=(e=>(e.Visible="visible",e.Hidden="hidden",e))(L8||{});function B8(){let e=E.useContext(fi);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function F8(){let e=E.useContext(di);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let di=E.createContext(null);di.displayName="NestingContext";function pi(e){return"children"in e?pi(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function bh(e,t){let n=Yn(e),r=E.useRef([]),o=k8(),s=Kn(),i=fe((p,h=An.Hidden)=>{let b=r.current.findIndex(({el:S})=>S===p);b!==-1&&(pt(h,{[An.Unmount](){r.current.splice(b,1)},[An.Hidden](){r.current[b].state="hidden"}}),s.microTask(()=>{var S;!pi(r)&&o.current&&((S=n.current)==null||S.call(n))}))}),c=fe(p=>{let h=r.current.find(({el:b})=>b===p);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:p,state:"visible"}),()=>i(p,An.Unmount)}),a=E.useRef([]),l=E.useRef(Promise.resolve()),u=E.useRef({enter:[],leave:[]}),f=fe((p,h,b)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([S])=>S!==p)),t==null||t.chains.current[h].push([p,new Promise(S=>{a.current.push(S)})]),t==null||t.chains.current[h].push([p,new Promise(S=>{Promise.all(u.current[h].map(([P,x])=>x)).then(()=>S())})]),h==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(h)):b(h)}),d=fe((p,h,b)=>{Promise.all(u.current[h].splice(0).map(([S,P])=>P)).then(()=>{var S;(S=a.current.shift())==null||S()}).then(()=>b(h))});return E.useMemo(()=>({children:r,register:c,unregister:i,onStart:f,onStop:d,wait:l,chains:u}),[c,i,r,f,d,u,l])}let gh=E.Fragment,yh=Gs.RenderStrategy;function R8(e,t){var n,r;let{transition:o=!0,beforeEnter:s,afterEnter:i,beforeLeave:c,afterLeave:a,enter:l,enterFrom:u,enterTo:f,entered:d,leave:p,leaveFrom:h,leaveTo:b,...S}=e,[P,x]=E.useState(null),w=E.useRef(null),$=mh(e),k=ht(...$?[w,t,x]:t===null?[]:[t]),B=(n=S.unmount)==null||n?An.Unmount:An.Hidden,{show:F,appear:m,initial:g}=B8(),[v,A]=E.useState(F?"visible":"hidden"),N=F8(),{register:O,unregister:D}=N;Ee(()=>O(w),[O,w]),Ee(()=>{if(B===An.Hidden&&w.current){if(F&&v!=="visible"){A("visible");return}return pt(v,{hidden:()=>D(w),visible:()=>O(w)})}},[v,w,O,D,F,B]);let y=hh();Ee(()=>{if($&&y&&v==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,v,y,$]);let C=g&&!m,I=m&&F&&g,T=E.useRef(!1),L=bh(()=>{T.current||(A("hidden"),D(w))},N),j=fe(q=>{T.current=!0;let Q=q?"enter":"leave";L.onStart(w,Q,ee=>{ee==="enter"?s==null||s():ee==="leave"&&(c==null||c())})}),z=fe(q=>{let Q=q?"enter":"leave";T.current=!1,L.onStop(w,Q,ee=>{ee==="enter"?i==null||i():ee==="leave"&&(a==null||a())}),Q==="leave"&&!pi(L)&&(A("hidden"),D(w))});E.useEffect(()=>{$&&o||(j(F),z(F))},[F,$,o]);let _=!(!o||!$||!y||C),[,W]=wp(_,P,F,{start:j,end:z}),K=Nn({ref:k,className:((r=Ac(S.className,I&&l,I&&u,W.enter&&l,W.enter&&W.closed&&u,W.enter&&!W.closed&&f,W.leave&&p,W.leave&&!W.closed&&h,W.leave&&W.closed&&b,!W.transition&&F&&d))==null?void 0:r.trim())||void 0,...vp(W)}),G=0;v==="visible"&&(G|=Dt.Open),v==="hidden"&&(G|=Dt.Closed),F&&v==="hidden"&&(G|=Dt.Opening),!F&&v==="visible"&&(G|=Dt.Closing);let H=ot();return E.createElement(di.Provider,{value:L},E.createElement(lh,{value:G},H({ourProps:K,theirProps:S,defaultTag:gh,features:yh,visible:v==="visible",name:"Transition.Child"})))}function j8(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,i=E.useRef(null),c=mh(e),a=ht(...c?[i,t]:t===null?[]:[t]);hh();let l=ul();if(n===void 0&&l!==null&&(n=(l&Dt.Open)===Dt.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,f]=E.useState(n?"visible":"hidden"),d=bh(()=>{n||f("hidden")}),[p,h]=E.useState(!0),b=E.useRef([n]);Ee(()=>{p!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),h(!1))},[b,n]);let S=E.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);Ee(()=>{n?f("visible"):!pi(d)&&i.current!==null&&f("hidden")},[n,d]);let P={unmount:o},x=fe(()=>{var k;p&&h(!1),(k=e.beforeEnter)==null||k.call(e)}),w=fe(()=>{var k;p&&h(!1),(k=e.beforeLeave)==null||k.call(e)}),$=ot();return E.createElement(di.Provider,{value:d},E.createElement(fi.Provider,{value:S},$({ourProps:{...P,as:E.Fragment,children:E.createElement(vh,{ref:a,...P,...s,beforeEnter:x,beforeLeave:w})},theirProps:{},defaultTag:E.Fragment,features:yh,visible:u==="visible",name:"Transition"})))}function _8(e,t){let n=E.useContext(fi)!==null,r=ul()!==null;return E.createElement(E.Fragment,null,!n&&r?E.createElement(fl,{ref:t,...e}):E.createElement(vh,{ref:t,...e}))}let fl=qe(j8),vh=qe(R8),z8=qe(_8),dl=Object.assign(fl,{Child:z8,Root:fl}),wh=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function xh(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!an(o))return r;let s=!1;for(let c of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))c.remove(),s=!0;let i=s?(n=o.innerText)!=null?n:"":r;return wh.test(i)&&(i=i.replace(wh,"")),i}function U8(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(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():xh(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return xh(e).trim()}function W8(e){let t=E.useRef(""),n=E.useRef("");return fe(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=U8(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var H8=Object.defineProperty,V8=(e,t,n)=>t in e?H8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Eh=(e,t,n)=>(V8(e,typeof t!="symbol"?t+"":t,n),n),Le=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Le||{}),In=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(In||{}),hi=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(hi||{}),Sh=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(Sh||{});function Ph(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=up(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let G8={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?ui.Tracked(ph(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:we.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(s=>r(s.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:ui.Idle}},2(e,t){var n,r,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let c={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===we.Nothing)return{...c,activeOptionIndex:null};if(t.focus===we.Specific)return{...c,activeOptionIndex:e.options.findIndex(u=>u.id===t.id)};if(t.focus===we.Previous){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,d=li(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(d!==null){let p=e.options[d].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...c,activeOptionIndex:d}}}}else if(t.focus===we.Next){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,d=li(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(d!==null){let p=e.options[d].dataRef.current.domRef;if(((s=f.current)==null?void 0:s.nextElementSibling)===p.current||((i=p.current)==null?void 0:i.nextElementSibling)===null)return{...c,activeOptionIndex:d}}}}let a=Ph(e),l=li(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...c,...a,activeOptionIndex:l}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var c;return!i.dataRef.current.disabled&&((c=i.dataRef.current.textValue)==null?void 0:c.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==we.Nothing&&(r=li(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=n.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(r=s)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:we.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[s,i]of n.entries())if(o.has(i.id)&&(r.push(s),o.delete(i.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...Ph(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:ui.Moved}}};class pl extends Q0{constructor(t){super(t),Eh(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return pt(s,{0:()=>r==null?void 0:r(n),1:()=>{let c=i.slice(),a=c.findIndex(l=>o(l,n));return a===-1?c.push(n):c.splice(a,1),r==null?void 0:r(c)}})},registerOption:Mc(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:Mc(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Mc(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),Eh(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,i=n.options;return s!==null?((o=i[s])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=kc.get(null);this.disposables.add(r.on(np.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(D8(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new pl({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:we.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:ui.Idle})}reduce(t,n){return pt(n.type,G8,t,n)}}const Th=E.createContext(null);function hl(e){let t=E.useContext(Th);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,$h),n}return t}function $h({id:e,__demoMode:t=!1}){let n=E.useMemo(()=>pl.new({id:e,__demoMode:t}),[]);return uh(()=>n.dispose()),n}let mi=E.createContext(null);mi.displayName="ListboxDataContext";function Zo(e){let t=E.useContext(mi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Zo),n}return t}let q8=E.Fragment;function Z8(e,t){let n=E.useId(),r=$c(),{value:o,defaultValue:s,form:i,name:c,onChange:a,by:l,invalid:u=!1,disabled:f=r||!1,horizontal:d=!1,multiple:p=!1,__demoMode:h=!1,...b}=e;const S=d?"horizontal":"vertical";let P=ht(t),x=xx(s),[w=p?[]:void 0,$]=wx(o,a,x),k=$h({id:n,__demoMode:h}),B=E.useRef({static:!1,hold:!1}),F=E.useRef(new Map),m=qx(l),g=E.useCallback(_=>pt(v.mode,{[In.Multi]:()=>w.some(W=>m(W,_)),[In.Single]:()=>m(w,_)}),[w]),v=$n({value:w,disabled:f,invalid:u,mode:p?In.Multi:In.Single,orientation:S,onChange:$,compare:m,isSelected:g,optionsPropsRef:B,listRef:F});Ee(()=>{k.state.dataRef.current=v},[v]);let A=Ze(k,_=>_.listboxState),N=kc.get(null),O=Ze(N,E.useCallback(_=>N.selectors.isTop(_,n),[N,n])),[D,y]=Ze(k,_=>[_.buttonElement,_.optionsElement]);w2(O,[D,y],(_,W)=>{k.send({type:Sh.CloseListbox}),lp(W,zc.Loose)||(_.preventDefault(),D==null||D.focus())});let C=$n({open:A===Le.Open,disabled:f,invalid:u,value:w}),[I,T]=zx({inherit:!0}),L={ref:P},j=E.useCallback(()=>{if(x!==void 0)return $==null?void 0:$(x)},[$,x]),z=ot();return E.createElement(T,{value:I,props:{htmlFor:D==null?void 0:D.id},slot:{open:A===Le.Open,disabled:f}},E.createElement(b8,null,E.createElement(Th.Provider,{value:k},E.createElement(mi.Provider,{value:v},E.createElement(lh,{value:pt(A,{[Le.Open]:Dt.Open,[Le.Closed]:Dt.Closed})},c!=null&&w!=null&&E.createElement(Nx,{disabled:f,data:{[c]:w},form:i,onReset:j}),z({ourProps:L,theirProps:b,slot:C,defaultTag:q8,name:"Listbox"}))))))}let K8="button";function Y8(e,t){let n=E.useId(),r=F0(),o=Zo("Listbox.Button"),s=hl("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:c=o.disabled||!1,autoFocus:a=!1,...l}=e,u=ht(t,d8(),s.actions.setButtonElement),f=p8(),[d,p,h]=Ze(s,y=>[y.listboxState,y.buttonElement,y.optionsElement]),b=d===Le.Open;S2(b,{trigger:p,action:E.useCallback(y=>{if(p!=null&&p.contains(y.target))return Ys.Ignore;let C=y.target.closest('[role="option"]:not([data-disabled])');return an(C)?Ys.Select(C):h!=null&&h.contains(y.target)?Ys.Ignore:Ys.Close},[p,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let S=fe(y=>{switch(y.key){case Ie.Enter:Ex(y.currentTarget);break;case Ie.Space:case Ie.ArrowDown:y.preventDefault(),s.actions.openListbox({focus:o.value?we.Nothing:we.First});break;case Ie.ArrowUp:y.preventDefault(),s.actions.openListbox({focus:o.value?we.Nothing:we.Last});break}}),P=fe(y=>{switch(y.key){case Ie.Space:y.preventDefault();break}}),x=Kx(y=>{var C;s.state.listboxState===Le.Open?(je.flushSync(()=>s.actions.closeListbox()),(C=s.state.buttonElement)==null||C.focus({preventScroll:!0})):(y.preventDefault(),s.actions.openListbox({focus:we.Nothing}))}),w=fe(y=>y.preventDefault()),$=G0([i]),k=Fx(),{isFocusVisible:B,focusProps:F}=ix({autoFocus:a}),{isHovered:m,hoverProps:g}=sx({isDisabled:c}),{pressed:v,pressProps:A}=px({disabled:c}),N=$n({open:d===Le.Open,active:v||d===Le.Open,disabled:c,invalid:o.invalid,value:o.value,hover:m,focus:B,autofocus:a}),O=Ze(s,y=>y.listboxState===Le.Open),D=D0(f(),{ref:u,id:i,type:P2(e,p),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":O,"aria-labelledby":$,"aria-describedby":k,disabled:c||void 0,autoFocus:a,onKeyDown:S,onKeyUp:P,onKeyPress:w},x,F,g,A);return ot()({ourProps:D,theirProps:l,slot:N,defaultTag:K8,name:"Listbox.Button"})}let Ah=E.createContext(!1),X8="div",Q8=Gs.RenderStrategy|Gs.Static;function J8(e,t){let n=E.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:c=!1,...a}=e,l=f8(o),[u,f]=E.useState(null);l&&(s=!0);let d=Zo("Listbox.Options"),p=hl("Listbox.Options"),[h,b,S,P]=Ze(p,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),x=Uc(b),w=Uc(S),$=ul(),[k,B]=wp(c,u,$!==null?($&Dt.Open)===Dt.Open:h===Le.Open);c2(k,b,p.actions.closeListbox);let F=P?!1:i&&h===Le.Open;I2(F,w);let m=P?!1:i&&h===Le.Open;a2(m,{allowed:E.useCallback(()=>[b,S],[b,S])});let g=Ze(p,p.selectors.didButtonMove)?!1:k,v=Ze(p,p.selectors.hasFrozenValue)&&!e.static,A=ch(v,d.value),N=E.useCallback(H=>d.compare(A,H),[d.compare,A]),O=Ze(p,H=>{var q;if(l==null||!((q=l==null?void 0:l.to)!=null&&q.includes("selection")))return null;let Q=H.options.findIndex(ee=>N(ee.dataRef.current.value));return Q===-1&&(Q=0),Q}),D=(()=>{if(l==null)return;if(O===null)return{...l,inner:void 0};let H=Array.from(d.listRef.current.values());return{...l,inner:{listRef:{current:H},index:O}}})(),[y,C]=m8(D),I=h8(),T=ht(t,l?y:null,p.actions.setOptionsElement,f),L=Kn();E.useEffect(()=>{let H=S;H&&h===Le.Open&&(ux(H)||H==null||H.focus({preventScroll:!0}))},[h,S]);let j=fe(H=>{var q;switch(L.dispose(),H.key){case Ie.Space:if(p.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),p.actions.search(H.key);case Ie.Enter:H.preventDefault(),H.stopPropagation(),p.actions.selectActiveOption();break;case pt(d.orientation,{vertical:Ie.ArrowDown,horizontal:Ie.ArrowRight}):return H.preventDefault(),H.stopPropagation(),p.actions.goToOption({focus:we.Next});case pt(d.orientation,{vertical:Ie.ArrowUp,horizontal:Ie.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),p.actions.goToOption({focus:we.Previous});case Ie.Home:case Ie.PageUp:return H.preventDefault(),H.stopPropagation(),p.actions.goToOption({focus:we.First});case Ie.End:case Ie.PageDown:return H.preventDefault(),H.stopPropagation(),p.actions.goToOption({focus:we.Last});case Ie.Escape:H.preventDefault(),H.stopPropagation(),je.flushSync(()=>p.actions.closeListbox()),(q=p.state.buttonElement)==null||q.focus({preventScroll:!0});return;case Ie.Tab:H.preventDefault(),H.stopPropagation(),je.flushSync(()=>p.actions.closeListbox()),b2(p.state.buttonElement,H.shiftKey?_c.Previous:_c.Next);break;default:H.key.length===1&&(p.actions.search(H.key),L.setTimeout(()=>p.actions.clearSearch(),350));break}}),z=Ze(p,H=>{var q;return(q=H.buttonElement)==null?void 0:q.id}),_=$n({open:h===Le.Open}),W=D0(l?I():{},{id:r,ref:T,"aria-activedescendant":Ze(p,p.selectors.activeDescendantId),"aria-multiselectable":d.mode===In.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":d.orientation,onKeyDown:j,role:"listbox",tabIndex:h===Le.Open?0:void 0,style:{...a.style,...C,"--button-width":Zx(k,b,!0).width},...vp(B)}),K=ot(),G=E.useMemo(()=>d.mode===In.Multi?d:{...d,isSelected:N},[d,N]);return E.createElement(I8,{enabled:s?e.static||k:!1,ownerDocument:x},E.createElement(mi.Provider,{value:G},K({ourProps:W,theirProps:a,slot:_,defaultTag:X8,features:Q8,visible:g,name:"Listbox.Options"})))}let e3="div";function t3(e,t){let n=E.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,c=E.useContext(Ah)===!0,a=Zo("Listbox.Option"),l=hl("Listbox.Option"),u=Ze(l,v=>l.selectors.isActive(v,r)),f=a.isSelected(s),d=E.useRef(null),p=W8(d),h=Yn({disabled:o,value:s,domRef:d,get textValue(){return p()}}),b=ht(t,d,v=>{v?a.listRef.current.set(r,v):a.listRef.current.delete(r)}),S=Ze(l,v=>l.selectors.shouldScrollIntoView(v,r));Ee(()=>{if(S)return rt().requestAnimationFrame(()=>{var v,A;(A=(v=d.current)==null?void 0:v.scrollIntoView)==null||A.call(v,{block:"nearest"})})},[S,d]),Ee(()=>{if(!c)return l.actions.registerOption(r,h),()=>l.actions.unregisterOption(r)},[h,r,c]);let P=fe(v=>{if(o)return v.preventDefault();l.actions.selectOption(s)}),x=fe(()=>{if(o)return l.actions.goToOption({focus:we.Nothing});l.actions.goToOption({focus:we.Specific,id:r})}),w=D2(),$=fe(v=>w.update(v)),k=fe(v=>{w.wasMoved(v)&&(o||u&&l.state.activationTrigger===hi.Pointer||l.actions.goToOption({focus:we.Specific,id:r},hi.Pointer))}),B=fe(v=>{w.wasMoved(v)&&(o||u&&l.state.activationTrigger===hi.Pointer&&l.actions.goToOption({focus:we.Nothing}))}),F=$n({active:u,focus:u,selected:f,disabled:o,selectedOption:f&&c}),m=c?{}:{id:r,ref:b,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:P,onFocus:x,onPointerEnter:$,onMouseEnter:$,onPointerMove:k,onMouseMove:k,onPointerLeave:B,onMouseLeave:B},g=ot();return!f&&c?null:g({ourProps:m,theirProps:i,slot:F,defaultTag:e3,name:"Listbox.Option"})}let n3=E.Fragment;function r3(e,t){let{options:n,placeholder:r,...o}=e,s={ref:ht(t)},i=Zo("ListboxSelectedOption"),c=$n({}),a=i.value===void 0||i.value===null||i.mode===In.Multi&&Array.isArray(i.value)&&i.value.length===0,l=ot();return E.createElement(Ah.Provider,{value:!0},l({ourProps:s,theirProps:{...o,children:E.createElement(E.Fragment,null,r&&a?r:n)},slot:c,defaultTag:n3,name:"ListboxSelectedOption"}))}let o3=qe(Z8),s3=qe(Y8),i3=Vx,a3=qe(J8),c3=qe(t3),l3=qe(r3),gt=Object.assign(o3,{Button:s3,Label:i3,Options:a3,Option:c3,SelectedOption:l3});const u3=()=>M.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[M.jsx("g",{clipPath:"url(#clip0_active)",children:M.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),M.jsx("defs",{children:M.jsx("clipPath",{id:"clip0_active",children:M.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),f3=()=>M.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[M.jsx("g",{clipPath:"url(#clip0_inactive)",children:M.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),M.jsx("defs",{children:M.jsx("clipPath",{id:"clip0_inactive",children:M.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Ko=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,s)=>s+1);return M.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>M.jsx("div",{className:"flex items-center justify-center",children:o>t-e?M.jsx(u3,{}):M.jsx(f3,{})},o))})};class Mt{}ns(Mt,"FAST",3),ns(Mt,"Medium",2),ns(Mt,"SLOW",1),ns(Mt,"NONE",0);const d3=Object.values({MAINNET:1,SEPOLIA:11155111}),dn=e=>{const t=typeof e=="string"?parseInt(e,10):e;return d3.includes(t)},p3={USDT:!0},Nh=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!p3[t.toUpperCase()]:!0},h3=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc"})=>{const{t:i}=Et();return M.jsx("div",{className:`relative ${o}`,children:M.jsx(gt,{value:t,onChange:n,disabled:r,children:({open:c})=>M.jsxs(M.Fragment,{children:[M.jsxs(gt.Button,{className:`
140
140
  relative w-full h-9 text-text-primary bg-fill-input-primary
141
141
  items-center justify-between flex px-3 rounded-lg
142
142
  focus:outline-none
143
143
  ${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
144
144
  ${c?"ring-1 ring-white":""}
145
- `,children:[D.jsx("span",{className:"text-sm leading-[18px] font-medium",children:i("deposit.chain")}),D.jsxs("div",{className:"flex items-center space-x-2",children:[t.chainIconUrl?D.jsx("img",{src:t.chainIconUrl,alt:t.chain,className:"w-4 h-4 rounded-full"}):D.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:D.jsx("span",{className:"text-xs text-white font-bold",children:t.chain.charAt(0)})}),D.jsx("span",{className:"text-sm text-white ml-1",children:t.chain}),D.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${c?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:D.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_12919_27745",children:D.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),D.jsx(nl,{as:x.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:D.jsx(mt.Options,{className:`
145
+ `,children:[M.jsx("span",{className:"text-sm leading-[18px] font-medium",children:i("deposit.chain")}),M.jsxs("div",{className:"flex items-center space-x-2",children:[t.chainIconUrl?M.jsx("img",{src:t.chainIconUrl,alt:t.chain,className:"w-4 h-4 rounded-full"}):M.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:M.jsx("span",{className:"text-xs text-white font-bold",children:t.chain.charAt(0)})}),M.jsx("span",{className:"text-sm text-white ml-1",children:t.chain}),M.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${c?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[M.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:M.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),M.jsx("defs",{children:M.jsx("clipPath",{id:"clip0_12919_27745",children:M.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),M.jsx(dl,{as:E.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:M.jsx(gt.Options,{className:`
146
146
  absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
147
147
  bg-fill-input-primary border border-line-divider-secondary shadow-lg
148
148
  focus:outline-none
149
- `,children:e.filter(a=>a[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(a=>D.jsx(mt.Option,{value:a,className:({active:l,selected:u})=>`relative cursor-pointer select-none py-3 px-3 ${u?"bg-fill-btn-secondary":l?"bg-fill-input-secondary":""}`,children:({selected:l,active:u})=>D.jsx(D.Fragment,{children:D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{className:"flex items-center space-x-3",children:[a.chainIconUrl?D.jsx("img",{src:a.chainIconUrl,alt:a.chain,className:"w-5 h-5 rounded-full"}):D.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:D.jsx("span",{className:"text-xs text-white font-bold",children:a.chain.charAt(0)})}),D.jsx("div",{className:"flex flex-col",children:D.jsx("span",{className:`text-sm font-medium ${l||u?"text-text-primary":"text-text-tertiary"}`,children:a.chain})})]}),D.jsx("div",{className:"w-12 bg-fill-page-secondary p-1 h-5 flex rounded",children:D.jsx(zo,{className:"w-full justify-between",selectedLevel:un(a.chainId)?It.SLOW:It.FAST,maxLevel:3})})]})})},a.chainId))})})]})})})},l3=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o="",walletType:s,accountType:i})=>{const{t:c}=wt(),a=l=>l.token||l.symbol;return D.jsx("div",{className:`relative ${o}`,children:D.jsx(mt,{value:t,onChange:n,disabled:r,children:({open:l})=>D.jsxs(D.Fragment,{children:[D.jsxs(mt.Button,{className:`
149
+ `,children:e.filter(a=>a[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(a=>M.jsx(gt.Option,{value:a,className:({active:l,selected:u})=>`relative cursor-pointer select-none py-3 px-3 ${u?"bg-fill-btn-secondary":l?"bg-fill-input-secondary":""}`,children:({selected:l,active:u})=>M.jsx(M.Fragment,{children:M.jsxs("div",{className:"flex items-center justify-between",children:[M.jsxs("div",{className:"flex items-center space-x-3",children:[a.chainIconUrl?M.jsx("img",{src:a.chainIconUrl,alt:a.chain,className:"w-5 h-5 rounded-full"}):M.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:M.jsx("span",{className:"text-xs text-white font-bold",children:a.chain.charAt(0)})}),M.jsx("div",{className:"flex flex-col",children:M.jsx("span",{className:`text-sm font-medium ${l||u?"text-text-primary":"text-text-tertiary"}`,children:a.chain})})]}),M.jsx("div",{className:"w-12 bg-fill-page-secondary p-1 h-5 flex rounded",children:M.jsx(Ko,{className:"w-full justify-between",selectedLevel:dn(a.chainId)?Mt.SLOW:Mt.FAST,maxLevel:3})})]})})},a.chainId))})})]})})})},m3=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o="",walletType:s,accountType:i})=>{const{t:c}=Et(),a=l=>l.token||l.symbol;return M.jsx("div",{className:`relative ${o}`,children:M.jsx(gt,{value:t,onChange:n,disabled:r,children:({open:l})=>M.jsxs(M.Fragment,{children:[M.jsxs(gt.Button,{className:`
150
150
  relative w-full h-9 text-text-primary bg-fill-input-primary
151
151
  items-center justify-between flex px-3 rounded-lg
152
152
  focus:outline-none
153
153
  ${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
154
154
  ${l?"ring-1 ring-white":""}
155
- `,children:[D.jsx("span",{className:"text-sm leading-[18px] font-medium",children:c("deposit.asset")}),D.jsxs("div",{className:"flex items-center space-x-2",children:[D.jsx("img",{src:t.iconUrl,alt:a(t),className:"w-4 h-4 rounded-full"}),D.jsx("span",{className:"text-sm text-white ml-1",children:a(t)}),D.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${l?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_asset_selector)",children:D.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_asset_selector",children:D.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),D.jsx(nl,{as:x.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:D.jsx(mt.Options,{className:`
155
+ `,children:[M.jsx("span",{className:"text-sm leading-[18px] font-medium",children:c("deposit.asset")}),M.jsxs("div",{className:"flex items-center space-x-2",children:[M.jsx("img",{src:t.iconUrl,alt:a(t),className:"w-4 h-4 rounded-full"}),M.jsx("span",{className:"text-sm text-white ml-1",children:a(t)}),M.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${l?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[M.jsx("g",{clipPath:"url(#clip0_asset_selector)",children:M.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),M.jsx("defs",{children:M.jsx("clipPath",{id:"clip0_asset_selector",children:M.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),M.jsx(dl,{as:E.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:M.jsx(gt.Options,{className:`
156
156
  absolute z-50 mt-1 w-full max-h-[230px] overflow-y-auto rounded-lg
157
157
  bg-fill-input-primary border border-line-divider-secondary shadow-lg
158
158
  focus:outline-none
159
- `,children:e.map(u=>D.jsx(mt.Option,{value:u,className:({active:f,selected:p})=>`relative cursor-pointer select-none py-3 px-3 ${p?"bg-fill-btn-secondary":f?"bg-fill-input-secondary":""}`,children:({selected:f,active:p})=>D.jsxs("div",{className:"flex items-center space-x-3",children:[D.jsx("img",{src:u.iconUrl,alt:a(u),className:"w-5 h-5 rounded-full"}),D.jsxs("div",{className:"flex flex-col",children:[D.jsx("span",{className:`text-sm font-medium ${f||p?"text-text-primary":"text-text-tertiary"}`,children:a(u)}),s===xn&&i==="perpetual"&&u.token==="USDC"&&D.jsx("p",{className:"mt-2 text-xs text-text-tertiary whitespace-pre-line",children:c("deposit.defaultSpotNotice")})]})]})},a(u)))})})]})})})},Eh=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:s=xn,txType:i="deposit",accountType:c})=>{const a=x.useCallback(v=>i==="withdraw"?s===xn?v.allowAaWithdraw!==!1:v.allowWithdraw!==!1:s===xn?v.allowAaDeposit!==!1:v.allowDeposit!==!1,[i,s]),l=x.useMemo(()=>{const v=new Set,T=[];for(const E of t)if(a(E))for(const S of E.tokenList||[]){const N=S.symbol||S.token;!N||!(i!=="withdraw"||S.withdrawEnable===!0&&S.pullOff===!1)||v.has(N)||(v.add(N),T.push({token:N,symbol:N,iconUrl:S.iconUrl,decimals:S.decimals,tokenAddress:S.tokenAddress}))}return T},[t,a,i]),u=v=>{n(v.chainId)},f=v=>{const T=v.symbol||v.token;o(T);const E=[];for(const S of t){if(!a(S))continue;(S.tokenList||[]).some(M=>(M.symbol||M.token)===T)&&E.push(S.chainId)}!E.includes(e.chainId)&&E[0]!==void 0&&n(E[0])},p=x.useMemo(()=>{var E,S;const v=r||((E=l[0])==null?void 0:E.symbol)||((S=l[0])==null?void 0:S.token);if(!v)return[];const T=[];for(const N of t){if(!a(N))continue;const M=(N.tokenList||[]).find(B=>(B.symbol||B.token)===v?i==="withdraw"?B.withdrawEnable===!0&&B.pullOff===!1:!0:!1);M&&T.push({...N,tokenList:[{token:M.token,symbol:M.symbol,iconUrl:M.iconUrl,decimals:M.decimals,tokenAddress:M.tokenAddress}]})}return T},[t,r,l,a,i]),d=x.useMemo(()=>p.find(v=>v.chainId===e.chainId)||p[0],[p,e.chainId]),h=x.useMemo(()=>l,[l]),m=x.useMemo(()=>{if(h.length!==0)return h.find(v=>v.token===r||v.symbol===r)||h[0]},[h,r]);return x.useEffect(()=>{if(h.length===0)return;if(!h.some(T=>(T.symbol||T.token)===r)){const T=h[0];o(T.symbol||T.token)}},[h,r,o]),x.useEffect(()=>{if(p.length===0)return;p.some(T=>T.chainId===e.chainId)||n(p[0].chainId)},[p,e.chainId,n]),D.jsxs("div",{className:"space-y-4",children:[h.length>0&&m&&D.jsx(l3,{tokens:h,selectedToken:m,onTokenChange:f,walletType:s,accountType:c}),D.jsx(c3,{chains:p,selectedChain:d,onChainChange:v=>{const T=t.find(E=>E.chainId===v.chainId);T&&u(T)},walletType:s,className:"w-full"})]})},u3=({options:e})=>D.jsx(D.Fragment,{children:e.map(t=>D.jsx(mt.Option,{value:t.value,className:({active:n,selected:r})=>`relative cursor-pointer select-none py-3 px-3 ${r?"bg-fill-btn-secondary":n?"bg-fill-input-secondary":""}`,children:({selected:n,active:r})=>D.jsx("div",{className:"flex items-center justify-between",children:D.jsx("div",{className:"flex items-center space-x-3",children:D.jsx("div",{className:"flex flex-col",children:D.jsx("span",{className:`text-sm font-medium ${n||r?"text-text-primary":"text-text-tertiary"}`,children:t.label})})})})},t.value))}),Sh=({selectedAccount:e,onAccountChange:t,disabled:n=!1,className:r=""})=>{var f;const{t:o}=wt(),s=x.useMemo(()=>[{value:"spot",label:o("account.spot")},{value:"perpetual",label:o("account.perpetual")}],[o]),i=((f=s.find(p=>p.value===(e??"spot")))==null?void 0:f.label)||"",[c,a]=x.useState(e??"spot"),l=e??c,u=p=>{t==null||t(p),e||a(p)};return D.jsx("div",{className:`relative mb-4 ${r}`,children:D.jsx(mt,{value:l,onChange:u,disabled:n,children:({open:p})=>D.jsxs(D.Fragment,{children:[D.jsxs(mt.Button,{className:`
159
+ `,children:e.map(u=>M.jsx(gt.Option,{value:u,className:({active:f,selected:d})=>`relative cursor-pointer select-none py-3 px-3 ${d?"bg-fill-btn-secondary":f?"bg-fill-input-secondary":""}`,children:({selected:f,active:d})=>M.jsxs("div",{className:"flex items-center space-x-3",children:[M.jsx("img",{src:u.iconUrl,alt:a(u),className:"w-5 h-5 rounded-full"}),M.jsxs("div",{className:"flex flex-col",children:[M.jsx("span",{className:`text-sm font-medium ${f||d?"text-text-primary":"text-text-tertiary"}`,children:a(u)}),s===Sn&&i==="perpetual"&&u.token==="USDC"&&M.jsx("p",{className:"mt-2 text-xs text-text-tertiary whitespace-pre-line",children:c("deposit.defaultSpotNotice")})]})]})},a(u)))})})]})})})},Ch=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:s=Sn,txType:i="deposit",accountType:c})=>{const a=E.useCallback(S=>i==="withdraw"?s===Sn?S.allowAaWithdraw!==!1:S.allowWithdraw!==!1:s===Sn?S.allowAaDeposit!==!1:S.allowDeposit!==!1,[i,s]),l=E.useMemo(()=>{const S=new Set,P=[];for(const x of t)if(a(x))for(const w of x.tokenList||[]){const $=w.symbol||w.token;!$||!(i!=="withdraw"||w.withdrawEnable===!0&&w.pullOff===!1)||S.has($)||(S.add($),P.push({token:$,symbol:$,iconUrl:w.iconUrl,decimals:w.decimals,tokenAddress:w.tokenAddress}))}return P},[t,a,i]),u=S=>{n(S.chainId)},f=S=>{const P=S.symbol||S.token;o(P);const x=[];for(const w of t){if(!a(w))continue;(w.tokenList||[]).some(k=>(k.symbol||k.token)===P)&&x.push(w.chainId)}!x.includes(e.chainId)&&x[0]!==void 0&&n(x[0])},d=E.useMemo(()=>{var x,w;const S=r||((x=l[0])==null?void 0:x.symbol)||((w=l[0])==null?void 0:w.token);if(!S)return[];const P=[];for(const $ of t){if(!a($))continue;const k=($.tokenList||[]).find(B=>(B.symbol||B.token)===S?i==="withdraw"?B.withdrawEnable===!0&&B.pullOff===!1:!0:!1);k&&P.push({...$,tokenList:[{token:k.token,symbol:k.symbol,iconUrl:k.iconUrl,decimals:k.decimals,tokenAddress:k.tokenAddress}]})}return P},[t,r,l,a,i]),p=E.useMemo(()=>d.find(S=>S.chainId===e.chainId)||d[0],[d,e.chainId]),h=E.useMemo(()=>l,[l]),b=E.useMemo(()=>{if(h.length!==0)return h.find(S=>S.token===r||S.symbol===r)||h[0]},[h,r]);return E.useEffect(()=>{if(h.length===0)return;if(!h.some(P=>(P.symbol||P.token)===r)){const P=h[0];o(P.symbol||P.token)}},[h,r,o]),E.useEffect(()=>{if(d.length===0)return;d.some(P=>P.chainId===e.chainId)||n(d[0].chainId)},[d,e.chainId,n]),M.jsxs("div",{className:"space-y-4",children:[h.length>0&&b&&M.jsx(m3,{tokens:h,selectedToken:b,onTokenChange:f,walletType:s,accountType:c}),M.jsx(h3,{chains:d,selectedChain:p,onChainChange:S=>{const P=t.find(x=>x.chainId===S.chainId);P&&u(P)},walletType:s,className:"w-full"})]})},b3=({options:e})=>M.jsx(M.Fragment,{children:e.map(t=>M.jsx(gt.Option,{value:t.value,className:({active:n,selected:r})=>`relative cursor-pointer select-none py-3 px-3 ${r?"bg-fill-btn-secondary":n?"bg-fill-input-secondary":""}`,children:({selected:n,active:r})=>M.jsx("div",{className:"flex items-center justify-between",children:M.jsx("div",{className:"flex items-center space-x-3",children:M.jsx("div",{className:"flex flex-col",children:M.jsx("span",{className:`text-sm font-medium ${n||r?"text-text-primary":"text-text-tertiary"}`,children:t.label})})})})},t.value))}),Oh=({selectedAccount:e,onAccountChange:t,disabled:n=!1,className:r=""})=>{var f;const{t:o}=Et(),s=E.useMemo(()=>[{value:"spot",label:o("account.spot")},{value:"perpetual",label:o("account.perpetual")}],[o]),i=((f=s.find(d=>d.value===(e??"spot")))==null?void 0:f.label)||"",[c,a]=E.useState(e??"spot"),l=e??c,u=d=>{t==null||t(d),e||a(d)};return M.jsx("div",{className:`relative mb-4 ${r}`,children:M.jsx(gt,{value:l,onChange:u,disabled:n,children:({open:d})=>M.jsxs(M.Fragment,{children:[M.jsxs(gt.Button,{className:`
160
160
  relative w-full h-9 text-text-primary bg-fill-input-primary
161
161
  items-center justify-between flex px-3 rounded-lg
162
162
  focus:outline-none
163
163
  ${n?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
164
- ${p?"ring-1 ring-white":""}
165
- `,children:[D.jsx("span",{className:"text-sm leading-[18px] font-medium",children:o("account.title")}),D.jsxs("div",{className:"flex items-center space-x-2",children:[D.jsx("span",{className:"text-sm text-white ml-1",children:i}),D.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${p?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_asset_selector)",children:D.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_asset_selector",children:D.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),D.jsx(nl,{as:x.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:D.jsx(mt.Options,{className:`
164
+ ${d?"ring-1 ring-white":""}
165
+ `,children:[M.jsx("span",{className:"text-sm leading-[18px] font-medium",children:o("account.title")}),M.jsxs("div",{className:"flex items-center space-x-2",children:[M.jsx("span",{className:"text-sm text-white ml-1",children:i}),M.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${d?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[M.jsx("g",{clipPath:"url(#clip0_asset_selector)",children:M.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),M.jsx("defs",{children:M.jsx("clipPath",{id:"clip0_asset_selector",children:M.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),M.jsx(dl,{as:E.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:M.jsx(gt.Options,{className:`
166
166
  absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
167
167
  bg-fill-input-primary border border-line-divider-secondary shadow-lg
168
168
  focus:outline-none
169
- `,children:D.jsx(u3,{options:s})})})]})})})};var si={},f3=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},d3=f3,Ph={"text/plain":"Text","text/html":"Url",default:"Text"},p3="Copy to clipboard: #{key}, Enter";function h3(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function m3(e,t){var n,r,o,s,i,c,a=!1;t||(t={}),n=t.debug||!1;try{o=d3(),s=document.createRange(),i=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(u){if(u.stopPropagation(),t.format)if(u.preventDefault(),typeof u.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=Ph[t.format]||Ph.default;window.clipboardData.setData(f,e)}else u.clipboardData.clearData(),u.clipboardData.setData(t.format,e);t.onCopy&&(u.preventDefault(),t.onCopy(u.clipboardData))}),document.body.appendChild(c),s.selectNodeContents(c),i.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");a=!0}catch(u){n&&console.error("unable to copy using execCommand: ",u),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),a=!0}catch(f){n&&console.error("unable to copy using clipboardData: ",f),n&&console.error("falling back to prompt"),r=h3("message"in t?t.message:p3),window.prompt(r,e)}}finally{i&&(typeof i.removeRange=="function"?i.removeRange(s):i.removeAllRanges()),c&&document.body.removeChild(c),o()}return a}var b3=m3;function sl(e){"@babel/helpers - typeof";return sl=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},sl(e)}Object.defineProperty(si,"__esModule",{value:!0}),si.CopyToClipboard=void 0;var ii=Th(x),g3=Th(b3),y3=["text","onCopy","options","children"];function Th(e){return e&&e.__esModule?e:{default:e}}function Ah(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $h(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ah(Object(n),!0).forEach(function(r){al(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ah(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function v3(e,t){if(e==null)return{};var n=w3(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function w3(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function x3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S3(e,t,n){return t&&E3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function P3(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&&il(e,t)}function il(e,t){return il=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},il(e,t)}function T3(e){var t=$3();return function(){var r=ai(e),o;if(t){var s=ai(this).constructor;o=Reflect.construct(r,arguments,s)}else o=r.apply(this,arguments);return A3(this,o)}}function A3(e,t){if(t&&(sl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ch(e)}function Ch(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $3(){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 ai(e){return ai=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ai(e)}function al(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nh=function(e){P3(n,e);var t=T3(n);function n(){var r;x3(this,n);for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return r=t.call.apply(t,[this].concat(s)),al(Ch(r),"onClick",function(c){var a=r.props,l=a.text,u=a.onCopy,f=a.children,p=a.options,d=ii.default.Children.only(f),h=(0,g3.default)(l,p);u&&u(l,h),d&&d.props&&typeof d.props.onClick=="function"&&d.props.onClick(c)}),r}return S3(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var s=o.children,i=v3(o,y3),c=ii.default.Children.only(s);return ii.default.cloneElement(c,$h($h({},i),{},{onClick:this.onClick}))}}]),n}(ii.default.PureComponent);si.CopyToClipboard=Nh,al(Nh,"defaultProps",{onCopy:void 0,options:void 0});var C3=si,cl=C3.CopyToClipboard;cl.CopyToClipboard=cl;var N3=cl;const O3=Lm(N3);var I3=Object.defineProperty,ci=Object.getOwnPropertySymbols,Oh=Object.prototype.hasOwnProperty,Ih=Object.prototype.propertyIsEnumerable,kh=(e,t,n)=>t in e?I3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ll=(e,t)=>{for(var n in t||(t={}))Oh.call(t,n)&&kh(e,n,t[n]);if(ci)for(var n of ci(t))Ih.call(t,n)&&kh(e,n,t[n]);return e},ul=(e,t)=>{var n={};for(var r in e)Oh.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ci)for(var r of ci(e))t.indexOf(r)<0&&Ih.call(e,r)&&(n[r]=e[r]);return n};/**
169
+ `,children:M.jsx(b3,{options:s})})})]})})})};var bi={},g3=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},y3=g3,Ih={"text/plain":"Text","text/html":"Url",default:"Text"},v3="Copy to clipboard: #{key}, Enter";function w3(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function x3(e,t){var n,r,o,s,i,c,a=!1;t||(t={}),n=t.debug||!1;try{o=y3(),s=document.createRange(),i=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(u){if(u.stopPropagation(),t.format)if(u.preventDefault(),typeof u.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=Ih[t.format]||Ih.default;window.clipboardData.setData(f,e)}else u.clipboardData.clearData(),u.clipboardData.setData(t.format,e);t.onCopy&&(u.preventDefault(),t.onCopy(u.clipboardData))}),document.body.appendChild(c),s.selectNodeContents(c),i.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");a=!0}catch(u){n&&console.error("unable to copy using execCommand: ",u),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),a=!0}catch(f){n&&console.error("unable to copy using clipboardData: ",f),n&&console.error("falling back to prompt"),r=w3("message"in t?t.message:v3),window.prompt(r,e)}}finally{i&&(typeof i.removeRange=="function"?i.removeRange(s):i.removeAllRanges()),c&&document.body.removeChild(c),o()}return a}var E3=x3;Object.defineProperty(bi,"__esModule",{value:!0}),bi.CopyToClipboard=void 0;var S3=Dh(E3),gi=Dh(E),P3=["text","onCopy","options","children"];function Dh(e){return e&&e.__esModule?e:{default:e}}function Lr(e){"@babel/helpers - typeof";return Lr=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},Lr(e)}function Mh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function kh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mh(Object(n),!0).forEach(function(r){bl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mh(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T3(e,t){if(e==null)return{};var n,r,o=$3(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function $3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function A3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N3(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,Bh(r.key),r)}}function C3(e,t,n){return t&&N3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function O3(e,t,n){return t=yi(t),I3(e,Lh()?Reflect.construct(t,n||[],yi(e).constructor):t.apply(e,n))}function I3(e,t){if(t&&(Lr(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D3(e)}function D3(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lh=function(){return!!e})()}function yi(e){return yi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yi(e)}function M3(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&&ml(e,t)}function ml(e,t){return ml=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ml(e,t)}function bl(e,t,n){return(t=Bh(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bh(e){var t=k3(e,"string");return Lr(t)=="symbol"?t:t+""}function k3(e,t){if(Lr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var L3=bi.CopyToClipboard=function(e){function t(){var n;A3(this,t);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=O3(this,t,[].concat(o)),bl(n,"onClick",function(i){var c=n.props,a=c.text,l=c.onCopy,u=c.children,f=c.options,d=gi.default.Children.only(u),p=(0,S3.default)(a,f);l&&l(a,p),d!=null&&d.props&&typeof d.props.onClick=="function"&&d.props.onClick(i)}),n}return M3(t,e),C3(t,[{key:"render",value:function(){var r=this.props;r.text,r.onCopy,r.options;var o=r.children,s=T3(r,P3),i=gi.default.Children.only(o);return gi.default.cloneElement(i,kh(kh({},s),{},{onClick:this.onClick}))}}])}(gi.default.PureComponent);bl(L3,"defaultProps",{onCopy:void 0,options:void 0});var B3=bi,gl=B3.CopyToClipboard;gl.CopyToClipboard=gl;var F3=gl;const R3=Um(F3);var j3=Object.defineProperty,vi=Object.getOwnPropertySymbols,Fh=Object.prototype.hasOwnProperty,Rh=Object.prototype.propertyIsEnumerable,jh=(e,t,n)=>t in e?j3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yl=(e,t)=>{for(var n in t||(t={}))Fh.call(t,n)&&jh(e,n,t[n]);if(vi)for(var n of vi(t))Rh.call(t,n)&&jh(e,n,t[n]);return e},vl=(e,t)=>{var n={};for(var r in e)Fh.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vi)for(var r of vi(e))t.indexOf(r)<0&&Rh.call(e,r)&&(n[r]=e[r]);return n};/**
170
170
  * @license QR Code generator library (TypeScript)
171
171
  * Copyright (c) Project Nayuki.
172
172
  * SPDX-License-Identifier: MIT
173
- */var Xn;(e=>{const t=class ae{constructor(a,l,u,f){if(this.version=a,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],a<ae.MIN_VERSION||a>ae.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let p=[];for(let h=0;h<this.size;h++)p.push(!1);for(let h=0;h<this.size;h++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const d=this.addEccAndInterleave(u);if(this.drawCodewords(d),f==-1){let h=1e9;for(let m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);const v=this.getPenaltyScore();v<h&&(f=m,h=v),this.applyMask(m)}}o(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(a,l){const u=e.QrSegment.makeSegments(a);return ae.encodeSegments(u,l)}static encodeBinary(a,l){const u=e.QrSegment.makeBytes(a);return ae.encodeSegments([u],l)}static encodeSegments(a,l,u=1,f=40,p=-1,d=!0){if(!(ae.MIN_VERSION<=u&&u<=f&&f<=ae.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let h,m;for(h=u;;h++){const S=ae.getNumDataCodewords(h,l)*8,N=i.getTotalBits(a,h);if(N<=S){m=N;break}if(h>=f)throw new RangeError("Data too long")}for(const S of[ae.Ecc.MEDIUM,ae.Ecc.QUARTILE,ae.Ecc.HIGH])d&&m<=ae.getNumDataCodewords(h,S)*8&&(l=S);let v=[];for(const S of a){n(S.mode.modeBits,4,v),n(S.numChars,S.mode.numCharCountBits(h),v);for(const N of S.getData())v.push(N)}o(v.length==m);const T=ae.getNumDataCodewords(h,l)*8;o(v.length<=T),n(0,Math.min(4,T-v.length),v),n(0,(8-v.length%8)%8,v),o(v.length%8==0);for(let S=236;v.length<T;S^=253)n(S,8,v);let E=[];for(;E.length*8<v.length;)E.push(0);return v.forEach((S,N)=>E[N>>>3]|=S<<7-(N&7)),new ae(h,l,E,p)}getModule(a,l){return 0<=a&&a<this.size&&0<=l&&l<this.size&&this.modules[l][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const a=this.getAlignmentPatternPositions(),l=a.length;for(let u=0;u<l;u++)for(let f=0;f<l;f++)u==0&&f==0||u==0&&f==l-1||u==l-1&&f==0||this.drawAlignmentPattern(a[u],a[f]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){const l=this.errorCorrectionLevel.formatBits<<3|a;let u=l;for(let p=0;p<10;p++)u=u<<1^(u>>>9)*1335;const f=(l<<10|u)^21522;o(f>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,r(f,p));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,r(f,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,r(f,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,r(f,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let u=0;u<12;u++)a=a<<1^(a>>>11)*7973;const l=this.version<<12|a;o(l>>>18==0);for(let u=0;u<18;u++){const f=r(l,u),p=this.size-11+u%3,d=Math.floor(u/3);this.setFunctionModule(p,d,f),this.setFunctionModule(d,p,f)}}drawFinderPattern(a,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const p=Math.max(Math.abs(f),Math.abs(u)),d=a+f,h=l+u;0<=d&&d<this.size&&0<=h&&h<this.size&&this.setFunctionModule(d,h,p!=2&&p!=4)}}drawAlignmentPattern(a,l){for(let u=-2;u<=2;u++)for(let f=-2;f<=2;f++)this.setFunctionModule(a+f,l+u,Math.max(Math.abs(f),Math.abs(u))!=1)}setFunctionModule(a,l,u){this.modules[l][a]=u,this.isFunction[l][a]=!0}addEccAndInterleave(a){const l=this.version,u=this.errorCorrectionLevel;if(a.length!=ae.getNumDataCodewords(l,u))throw new RangeError("Invalid argument");const f=ae.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l],p=ae.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l],d=Math.floor(ae.getNumRawDataModules(l)/8),h=f-d%f,m=Math.floor(d/f);let v=[];const T=ae.reedSolomonComputeDivisor(p);for(let S=0,N=0;S<f;S++){let M=a.slice(N,N+m-p+(S<h?0:1));N+=M.length;const B=ae.reedSolomonComputeRemainder(M,T);S<h&&M.push(0),v.push(M.concat(B))}let E=[];for(let S=0;S<v[0].length;S++)v.forEach((N,M)=>{(S!=m-p||M>=h)&&E.push(N[S])});return o(E.length==d),E}drawCodewords(a){if(a.length!=Math.floor(ae.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let f=0;f<this.size;f++)for(let p=0;p<2;p++){const d=u-p,m=(u+1&2)==0?this.size-1-f:f;!this.isFunction[m][d]&&l<a.length*8&&(this.modules[m][d]=r(a[l>>>3],7-(l&7)),l++)}}o(l==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let u=0;u<this.size;u++){let f;switch(a){case 0:f=(u+l)%2==0;break;case 1:f=l%2==0;break;case 2:f=u%3==0;break;case 3:f=(u+l)%3==0;break;case 4:f=(Math.floor(u/3)+Math.floor(l/2))%2==0;break;case 5:f=u*l%2+u*l%3==0;break;case 6:f=(u*l%2+u*l%3)%2==0;break;case 7:f=((u+l)%2+u*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][u]&&f&&(this.modules[l][u]=!this.modules[l][u])}}getPenaltyScore(){let a=0;for(let p=0;p<this.size;p++){let d=!1,h=0,m=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[p][v]==d?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*ae.PENALTY_N3),d=this.modules[p][v],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*ae.PENALTY_N3}for(let p=0;p<this.size;p++){let d=!1,h=0,m=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][p]==d?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*ae.PENALTY_N3),d=this.modules[v][p],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*ae.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let d=0;d<this.size-1;d++){const h=this.modules[p][d];h==this.modules[p][d+1]&&h==this.modules[p+1][d]&&h==this.modules[p+1][d+1]&&(a+=ae.PENALTY_N2)}let l=0;for(const p of this.modules)l=p.reduce((d,h)=>d+(h?1:0),l);const u=this.size*this.size,f=Math.ceil(Math.abs(l*20-u*10)/u)-1;return o(0<=f&&f<=9),a+=f*ae.PENALTY_N4,o(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{const a=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2;let u=[6];for(let f=this.size-7;u.length<a;f-=l)u.splice(1,0,f);return u}}static getNumRawDataModules(a){if(a<ae.MIN_VERSION||a>ae.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*a+128)*a+64;if(a>=2){const u=Math.floor(a/7)+2;l-=(25*u-10)*u-55,a>=7&&(l-=36)}return o(208<=l&&l<=29648),l}static getNumDataCodewords(a,l){return Math.floor(ae.getNumRawDataModules(a)/8)-ae.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a]*ae.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let l=[];for(let f=0;f<a-1;f++)l.push(0);l.push(1);let u=1;for(let f=0;f<a;f++){for(let p=0;p<l.length;p++)l[p]=ae.reedSolomonMultiply(l[p],u),p+1<l.length&&(l[p]^=l[p+1]);u=ae.reedSolomonMultiply(u,2)}return l}static reedSolomonComputeRemainder(a,l){let u=l.map(f=>0);for(const f of a){const p=f^u.shift();u.push(0),l.forEach((d,h)=>u[h]^=ae.reedSolomonMultiply(d,p))}return u}static reedSolomonMultiply(a,l){if(a>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let f=7;f>=0;f--)u=u<<1^(u>>>7)*285,u^=(l>>>f&1)*a;return o(u>>>8==0),u}finderPenaltyCountPatterns(a){const l=a[1];o(l<=this.size*3);const u=l>0&&a[2]==l&&a[3]==l*3&&a[4]==l&&a[5]==l;return(u&&a[0]>=l*4&&a[6]>=l?1:0)+(u&&a[6]>=l*4&&a[0]>=l?1:0)}finderPenaltyTerminateAndCount(a,l,u){return a&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(a,l){l[0]==0&&(a+=this.size),l.pop(),l.unshift(a)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(c,a,l){if(a<0||a>31||c>>>a)throw new RangeError("Value out of range");for(let u=a-1;u>=0;u--)l.push(c>>>u&1)}function r(c,a){return(c>>>a&1)!=0}function o(c){if(!c)throw new Error("Assertion error")}const s=class xe{constructor(a,l,u){if(this.mode=a,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(a){let l=[];for(const u of a)n(u,8,l);return new xe(xe.Mode.BYTE,a.length,l)}static makeNumeric(a){if(!xe.isNumeric(a))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u<a.length;){const f=Math.min(a.length-u,3);n(parseInt(a.substring(u,u+f),10),f*3+1,l),u+=f}return new xe(xe.Mode.NUMERIC,a.length,l)}static makeAlphanumeric(a){if(!xe.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],u;for(u=0;u+2<=a.length;u+=2){let f=xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;f+=xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),n(f,11,l)}return u<a.length&&n(xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,l),new xe(xe.Mode.ALPHANUMERIC,a.length,l)}static makeSegments(a){return a==""?[]:xe.isNumeric(a)?[xe.makeNumeric(a)]:xe.isAlphanumeric(a)?[xe.makeAlphanumeric(a)]:[xe.makeBytes(xe.toUtf8ByteArray(a))]}static makeEci(a){let l=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)n(a,8,l);else if(a<16384)n(2,2,l),n(a,14,l);else if(a<1e6)n(6,3,l),n(a,21,l);else throw new RangeError("ECI assignment value out of range");return new xe(xe.Mode.ECI,0,l)}static isNumeric(a){return xe.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return xe.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,l){let u=0;for(const f of a){const p=f.mode.numCharCountBits(l);if(f.numChars>=1<<p)return 1/0;u+=4+p+f.bitData.length}return u}static toUtf8ByteArray(a){a=encodeURI(a);let l=[];for(let u=0;u<a.length;u++)a.charAt(u)!="%"?l.push(a.charCodeAt(u)):(l.push(parseInt(a.substring(u+1,u+3),16)),u+=2);return l}};s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let i=s;e.QrSegment=s})(Xn||(Xn={})),(e=>{(t=>{const n=class{constructor(o,s){this.ordinal=o,this.formatBits=s}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Xn||(Xn={})),(e=>{(t=>{const n=class{constructor(o,s){this.modeBits=o,this.numBitsCharCount=s}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Xn||(Xn={}));var Nr=Xn;/**
173
+ */var tr;(e=>{const t=class ae{constructor(a,l,u,f){if(this.version=a,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],a<ae.MIN_VERSION||a>ae.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let d=[];for(let h=0;h<this.size;h++)d.push(!1);for(let h=0;h<this.size;h++)this.modules.push(d.slice()),this.isFunction.push(d.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(u);if(this.drawCodewords(p),f==-1){let h=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);const S=this.getPenaltyScore();S<h&&(f=b,h=S),this.applyMask(b)}}o(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(a,l){const u=e.QrSegment.makeSegments(a);return ae.encodeSegments(u,l)}static encodeBinary(a,l){const u=e.QrSegment.makeBytes(a);return ae.encodeSegments([u],l)}static encodeSegments(a,l,u=1,f=40,d=-1,p=!0){if(!(ae.MIN_VERSION<=u&&u<=f&&f<=ae.MAX_VERSION)||d<-1||d>7)throw new RangeError("Invalid value");let h,b;for(h=u;;h++){const w=ae.getNumDataCodewords(h,l)*8,$=i.getTotalBits(a,h);if($<=w){b=$;break}if(h>=f)throw new RangeError("Data too long")}for(const w of[ae.Ecc.MEDIUM,ae.Ecc.QUARTILE,ae.Ecc.HIGH])p&&b<=ae.getNumDataCodewords(h,w)*8&&(l=w);let S=[];for(const w of a){n(w.mode.modeBits,4,S),n(w.numChars,w.mode.numCharCountBits(h),S);for(const $ of w.getData())S.push($)}o(S.length==b);const P=ae.getNumDataCodewords(h,l)*8;o(S.length<=P),n(0,Math.min(4,P-S.length),S),n(0,(8-S.length%8)%8,S),o(S.length%8==0);for(let w=236;S.length<P;w^=253)n(w,8,S);let x=[];for(;x.length*8<S.length;)x.push(0);return S.forEach((w,$)=>x[$>>>3]|=w<<7-($&7)),new ae(h,l,x,d)}getModule(a,l){return 0<=a&&a<this.size&&0<=l&&l<this.size&&this.modules[l][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const a=this.getAlignmentPatternPositions(),l=a.length;for(let u=0;u<l;u++)for(let f=0;f<l;f++)u==0&&f==0||u==0&&f==l-1||u==l-1&&f==0||this.drawAlignmentPattern(a[u],a[f]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){const l=this.errorCorrectionLevel.formatBits<<3|a;let u=l;for(let d=0;d<10;d++)u=u<<1^(u>>>9)*1335;const f=(l<<10|u)^21522;o(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,r(f,d));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,r(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,r(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,r(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let u=0;u<12;u++)a=a<<1^(a>>>11)*7973;const l=this.version<<12|a;o(l>>>18==0);for(let u=0;u<18;u++){const f=r(l,u),d=this.size-11+u%3,p=Math.floor(u/3);this.setFunctionModule(d,p,f),this.setFunctionModule(p,d,f)}}drawFinderPattern(a,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(u)),p=a+f,h=l+u;0<=p&&p<this.size&&0<=h&&h<this.size&&this.setFunctionModule(p,h,d!=2&&d!=4)}}drawAlignmentPattern(a,l){for(let u=-2;u<=2;u++)for(let f=-2;f<=2;f++)this.setFunctionModule(a+f,l+u,Math.max(Math.abs(f),Math.abs(u))!=1)}setFunctionModule(a,l,u){this.modules[l][a]=u,this.isFunction[l][a]=!0}addEccAndInterleave(a){const l=this.version,u=this.errorCorrectionLevel;if(a.length!=ae.getNumDataCodewords(l,u))throw new RangeError("Invalid argument");const f=ae.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l],d=ae.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l],p=Math.floor(ae.getNumRawDataModules(l)/8),h=f-p%f,b=Math.floor(p/f);let S=[];const P=ae.reedSolomonComputeDivisor(d);for(let w=0,$=0;w<f;w++){let k=a.slice($,$+b-d+(w<h?0:1));$+=k.length;const B=ae.reedSolomonComputeRemainder(k,P);w<h&&k.push(0),S.push(k.concat(B))}let x=[];for(let w=0;w<S[0].length;w++)S.forEach(($,k)=>{(w!=b-d||k>=h)&&x.push($[w])});return o(x.length==p),x}drawCodewords(a){if(a.length!=Math.floor(ae.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let f=0;f<this.size;f++)for(let d=0;d<2;d++){const p=u-d,b=(u+1&2)==0?this.size-1-f:f;!this.isFunction[b][p]&&l<a.length*8&&(this.modules[b][p]=r(a[l>>>3],7-(l&7)),l++)}}o(l==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let u=0;u<this.size;u++){let f;switch(a){case 0:f=(u+l)%2==0;break;case 1:f=l%2==0;break;case 2:f=u%3==0;break;case 3:f=(u+l)%3==0;break;case 4:f=(Math.floor(u/3)+Math.floor(l/2))%2==0;break;case 5:f=u*l%2+u*l%3==0;break;case 6:f=(u*l%2+u*l%3)%2==0;break;case 7:f=((u+l)%2+u*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][u]&&f&&(this.modules[l][u]=!this.modules[l][u])}}getPenaltyScore(){let a=0;for(let d=0;d<this.size;d++){let p=!1,h=0,b=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[d][S]==p?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,b),p||(a+=this.finderPenaltyCountPatterns(b)*ae.PENALTY_N3),p=this.modules[d][S],h=1);a+=this.finderPenaltyTerminateAndCount(p,h,b)*ae.PENALTY_N3}for(let d=0;d<this.size;d++){let p=!1,h=0,b=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[S][d]==p?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,b),p||(a+=this.finderPenaltyCountPatterns(b)*ae.PENALTY_N3),p=this.modules[S][d],h=1);a+=this.finderPenaltyTerminateAndCount(p,h,b)*ae.PENALTY_N3}for(let d=0;d<this.size-1;d++)for(let p=0;p<this.size-1;p++){const h=this.modules[d][p];h==this.modules[d][p+1]&&h==this.modules[d+1][p]&&h==this.modules[d+1][p+1]&&(a+=ae.PENALTY_N2)}let l=0;for(const d of this.modules)l=d.reduce((p,h)=>p+(h?1:0),l);const u=this.size*this.size,f=Math.ceil(Math.abs(l*20-u*10)/u)-1;return o(0<=f&&f<=9),a+=f*ae.PENALTY_N4,o(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{const a=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2;let u=[6];for(let f=this.size-7;u.length<a;f-=l)u.splice(1,0,f);return u}}static getNumRawDataModules(a){if(a<ae.MIN_VERSION||a>ae.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*a+128)*a+64;if(a>=2){const u=Math.floor(a/7)+2;l-=(25*u-10)*u-55,a>=7&&(l-=36)}return o(208<=l&&l<=29648),l}static getNumDataCodewords(a,l){return Math.floor(ae.getNumRawDataModules(a)/8)-ae.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a]*ae.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let l=[];for(let f=0;f<a-1;f++)l.push(0);l.push(1);let u=1;for(let f=0;f<a;f++){for(let d=0;d<l.length;d++)l[d]=ae.reedSolomonMultiply(l[d],u),d+1<l.length&&(l[d]^=l[d+1]);u=ae.reedSolomonMultiply(u,2)}return l}static reedSolomonComputeRemainder(a,l){let u=l.map(f=>0);for(const f of a){const d=f^u.shift();u.push(0),l.forEach((p,h)=>u[h]^=ae.reedSolomonMultiply(p,d))}return u}static reedSolomonMultiply(a,l){if(a>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let f=7;f>=0;f--)u=u<<1^(u>>>7)*285,u^=(l>>>f&1)*a;return o(u>>>8==0),u}finderPenaltyCountPatterns(a){const l=a[1];o(l<=this.size*3);const u=l>0&&a[2]==l&&a[3]==l*3&&a[4]==l&&a[5]==l;return(u&&a[0]>=l*4&&a[6]>=l?1:0)+(u&&a[6]>=l*4&&a[0]>=l?1:0)}finderPenaltyTerminateAndCount(a,l,u){return a&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(a,l){l[0]==0&&(a+=this.size),l.pop(),l.unshift(a)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(c,a,l){if(a<0||a>31||c>>>a)throw new RangeError("Value out of range");for(let u=a-1;u>=0;u--)l.push(c>>>u&1)}function r(c,a){return(c>>>a&1)!=0}function o(c){if(!c)throw new Error("Assertion error")}const s=class xe{constructor(a,l,u){if(this.mode=a,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(a){let l=[];for(const u of a)n(u,8,l);return new xe(xe.Mode.BYTE,a.length,l)}static makeNumeric(a){if(!xe.isNumeric(a))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u<a.length;){const f=Math.min(a.length-u,3);n(parseInt(a.substring(u,u+f),10),f*3+1,l),u+=f}return new xe(xe.Mode.NUMERIC,a.length,l)}static makeAlphanumeric(a){if(!xe.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],u;for(u=0;u+2<=a.length;u+=2){let f=xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;f+=xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),n(f,11,l)}return u<a.length&&n(xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,l),new xe(xe.Mode.ALPHANUMERIC,a.length,l)}static makeSegments(a){return a==""?[]:xe.isNumeric(a)?[xe.makeNumeric(a)]:xe.isAlphanumeric(a)?[xe.makeAlphanumeric(a)]:[xe.makeBytes(xe.toUtf8ByteArray(a))]}static makeEci(a){let l=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)n(a,8,l);else if(a<16384)n(2,2,l),n(a,14,l);else if(a<1e6)n(6,3,l),n(a,21,l);else throw new RangeError("ECI assignment value out of range");return new xe(xe.Mode.ECI,0,l)}static isNumeric(a){return xe.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return xe.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,l){let u=0;for(const f of a){const d=f.mode.numCharCountBits(l);if(f.numChars>=1<<d)return 1/0;u+=4+d+f.bitData.length}return u}static toUtf8ByteArray(a){a=encodeURI(a);let l=[];for(let u=0;u<a.length;u++)a.charAt(u)!="%"?l.push(a.charCodeAt(u)):(l.push(parseInt(a.substring(u+1,u+3),16)),u+=2);return l}};s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let i=s;e.QrSegment=s})(tr||(tr={})),(e=>{(t=>{const n=class{constructor(o,s){this.ordinal=o,this.formatBits=s}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(tr||(tr={})),(e=>{(t=>{const n=class{constructor(o,s){this.modeBits=o,this.numBitsCharCount=s}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(tr||(tr={}));var Br=tr;/**
174
174
  * @license qrcode.react
175
175
  * Copyright (c) Paul O'Shannessy
176
176
  * SPDX-License-Identifier: ISC
177
- */var k3={L:Nr.QrCode.Ecc.LOW,M:Nr.QrCode.Ecc.MEDIUM,Q:Nr.QrCode.Ecc.QUARTILE,H:Nr.QrCode.Ecc.HIGH},Dh=128,Mh="L",Lh="#FFFFFF",Bh="#000000",Fh=!1,Rh=1,D3=4,M3=0,L3=.1;function jh(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(i,c){if(!i&&s!==null){n.push(`M${s+t} ${o+t}h${c-s}v1H${s+t}z`),s=null;return}if(c===r.length-1){if(!i)return;s===null?n.push(`M${c+t},${o+t} h1v1H${c+t}z`):n.push(`M${s+t},${o+t} h${c+1-s}v1H${s+t}z`);return}i&&s===null&&(s=c)})}),n.join("")}function _h(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function B3(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*L3),i=o/t,c=(r.width||s)*i,a=(r.height||s)*i,l=r.x==null?e.length/2-c/2:r.x*i,u=r.y==null?e.length/2-a/2:r.y*i,f=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let h=Math.floor(l),m=Math.floor(u),v=Math.ceil(c+l-h),T=Math.ceil(a+u-m);p={x:h,y:m,w:v,h:T}}const d=r.crossOrigin;return{x:l,y:u,h:a,w:c,excavation:p,opacity:f,crossOrigin:d}}function F3(e,t){return t!=null?Math.max(Math.floor(t),0):e?D3:M3}function zh({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:c}){let a=x.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((m,v)=>(m.push(...Nr.QrSegment.makeSegments(v)),m),[]);return Nr.QrCode.encodeSegments(h,k3[t],n,void 0,void 0,c)},[e,t,n,c]);const{cells:l,margin:u,numCells:f,calculatedImageSettings:p}=x.useMemo(()=>{let d=a.getModules();const h=F3(r,o),m=d.length+h*2,v=B3(d,i,h,s);return{cells:d,margin:h,numCells:m,calculatedImageSettings:v}},[a,i,s,r,o]);return{qrcode:a,margin:u,cells:l,numCells:f,calculatedImageSettings:p}}var R3=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),j3=x.forwardRef(function(t,n){const r=t,{value:o,size:s=Dh,level:i=Mh,bgColor:c=Lh,fgColor:a=Bh,includeMargin:l=Fh,minVersion:u=Rh,boostLevel:f,marginSize:p,imageSettings:d}=r,m=ul(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:v}=m,T=ul(m,["style"]),E=d==null?void 0:d.src,S=x.useRef(null),N=x.useRef(null),M=x.useCallback(k=>{S.current=k,typeof n=="function"?n(k):n&&(n.current=k)},[n]),[B,F]=x.useState(!1),{margin:b,cells:g,numCells:w,calculatedImageSettings:$}=zh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:p,imageSettings:d,size:s});x.useEffect(()=>{if(S.current!=null){const k=S.current,y=k.getContext("2d");if(!y)return;let A=g;const I=N.current,P=$!=null&&I!==null&&I.complete&&I.naturalHeight!==0&&I.naturalWidth!==0;P&&$.excavation!=null&&(A=_h(g,$.excavation));const L=window.devicePixelRatio||1;k.height=k.width=s*L;const j=s/w*L;y.scale(j,j),y.fillStyle=c,y.fillRect(0,0,w,w),y.fillStyle=a,R3?y.fill(new Path2D(jh(A,b))):g.forEach(function(z,_){z.forEach(function(H,Y){H&&y.fillRect(Y+b,_+b,1,1)})}),$&&(y.globalAlpha=$.opacity),P&&y.drawImage(I,$.x+b,$.y+b,$.w,$.h)}}),x.useEffect(()=>{F(!1)},[E]);const C=ll({height:s,width:s},v);let O=null;return E!=null&&(O=x.createElement("img",{src:E,key:E,style:{display:"none"},onLoad:()=>{F(!0)},ref:N,crossOrigin:$==null?void 0:$.crossOrigin})),x.createElement(x.Fragment,null,x.createElement("canvas",ll({style:C,height:s,width:s,ref:M,role:"img"},T)),O)});j3.displayName="QRCodeCanvas";var Uh=x.forwardRef(function(t,n){const r=t,{value:o,size:s=Dh,level:i=Mh,bgColor:c=Lh,fgColor:a=Bh,includeMargin:l=Fh,minVersion:u=Rh,boostLevel:f,title:p,marginSize:d,imageSettings:h}=r,m=ul(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:v,cells:T,numCells:E,calculatedImageSettings:S}=zh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:d,imageSettings:h,size:s});let N=T,M=null;h!=null&&S!=null&&(S.excavation!=null&&(N=_h(T,S.excavation)),M=x.createElement("image",{href:h.src,height:S.h,width:S.w,x:S.x+v,y:S.y+v,preserveAspectRatio:"none",opacity:S.opacity,crossOrigin:S.crossOrigin}));const B=jh(N,v);return x.createElement("svg",ll({height:s,width:s,viewBox:`0 0 ${E} ${E}`,ref:n,role:"img"},m),!!p&&x.createElement("title",null,p),x.createElement("path",{fill:c,d:`M0,0 h${E}v${E}H0z`,shapeRendering:"crispEdges"}),x.createElement("path",{fill:a,d:B,shapeRendering:"crispEdges"}),M)});Uh.displayName="QRCodeSVG";function _3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function z3(){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}function Wh(){return/apple/i.test(navigator.vendor)}function U3(){return _3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function W3(){return z3().includes("jsdom/")}const Hh="data-floating-ui-focusable",H3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fl(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Or(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Lc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ir(e){return"composedPath"in e?e.composedPath()[0]:e.target}function dl(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function V3(e){return e.matches("html,body")}function Ut(e){return(e==null?void 0:e.ownerDocument)||document}function Vh(e){return Fe(e)&&e.matches(H3)}function G3(e){if(!e||W3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function q3(e){return e?e.hasAttribute(Hh)?e:e.querySelector("["+Hh+"]")||e:null}function li(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...li(e,o.id,n)])}function Z3(e){return"nativeEvent"in e}function Uo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var K3=typeof document<"u",Y3=function(){},Wt=K3?x.useLayoutEffect:Y3;const X3={...U};function ui(e){const t=U.useRef(e);return Wt(()=>{t.current=e}),t}const Q3=X3.useInsertionEffect||(e=>e());function Ht(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Q3(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Gh=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function qh(e,t){const n=$p(e,Gh()),r=n.length;if(r===0)return;const o=fl(Ut(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function J3(e){return qh(Ut(e).body,1)||e}function eS(e){return qh(Ut(e).body,-1)||e}function pl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Or(n,r)}function tS(e){$p(e,Gh()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Zh(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const nS="data-floating-ui-focusable",Kh="active",Yh="selected",rS={...U};let Xh=!1,oS=0;const Qh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+oS++;function sS(){const[e,t]=U.useState(()=>Xh?Qh():void 0);return Wt(()=>{e==null&&t(Qh())},[]),U.useEffect(()=>{Xh=!0},[]),e}const hl=rS.useId||sS;let ml;process.env.NODE_ENV!=="production"&&(ml=new Set);function iS(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ml)!=null&&e.has(o))){var s;(s=ml)==null||s.add(o),console.error(o)}}function aS(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const cS=U.createContext(null),lS=U.createContext(null),bl=()=>{var e;return((e=U.useContext(cS))==null?void 0:e.id)||null},gl=()=>U.useContext(lS);function Wo(e){return"data-floating-ui-"+e}function bt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Jh=Wo("safe-polygon");function yl(e,t,n){if(n&&!Uo(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function vl(e){return typeof e=="function"?e():e}function uS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:c=!0,delay:a=0,handleClose:l=null,mouseOnly:u=!1,restMs:f=0,move:p=!0}=t,d=gl(),h=bl(),m=ui(l),v=ui(a),T=ui(n),E=ui(f),S=U.useRef(),N=U.useRef(-1),M=U.useRef(),B=U.useRef(-1),F=U.useRef(!0),b=U.useRef(!1),g=U.useRef(()=>{}),w=U.useRef(!1),$=Ht(()=>{var I;const P=(I=o.current.openEvent)==null?void 0:I.type;return(P==null?void 0:P.includes("mouse"))&&P!=="mousedown"});U.useEffect(()=>{if(!c)return;function I(P){let{open:L}=P;L||(bt(N),bt(B),F.current=!0,w.current=!1)}return s.on("openchange",I),()=>{s.off("openchange",I)}},[c,s]),U.useEffect(()=>{if(!c||!m.current||!n)return;function I(L){$()&&r(!1,L,"hover")}const P=Ut(i.floating).documentElement;return P.addEventListener("mouseleave",I),()=>{P.removeEventListener("mouseleave",I)}},[i.floating,n,r,c,m,$]);const C=U.useCallback(function(I,P,L){P===void 0&&(P=!0),L===void 0&&(L="hover");const j=yl(v.current,"close",S.current);j&&!M.current?(bt(N),N.current=window.setTimeout(()=>r(!1,I,L),j)):P&&(bt(N),r(!1,I,L))},[v,r]),O=Ht(()=>{g.current(),M.current=void 0}),k=Ht(()=>{if(b.current){const I=Ut(i.floating).body;I.style.pointerEvents="",I.removeAttribute(Jh),b.current=!1}}),y=Ht(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);U.useEffect(()=>{if(!c)return;function I(_){if(bt(N),F.current=!1,u&&!Uo(S.current)||vl(E.current)>0&&!yl(v.current,"open"))return;const H=yl(v.current,"open",S.current);H?N.current=window.setTimeout(()=>{T.current||r(!0,_,"hover")},H):n||r(!0,_,"hover")}function P(_){if(y()){k();return}g.current();const H=Ut(i.floating);if(bt(B),w.current=!1,m.current&&o.current.floatingContext){n||bt(N),M.current=m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){k(),O(),y()||C(_,!0,"safe-polygon")}});const G=M.current;H.addEventListener("mousemove",G),g.current=()=>{H.removeEventListener("mousemove",G)};return}(S.current==="touch"?!Or(i.floating,_.relatedTarget):!0)&&C(_)}function L(_){y()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){k(),O(),y()||C(_)}})(_))}function j(){bt(N)}function z(_){y()||C(_,!1)}if(de(i.domReference)){const _=i.domReference,H=i.floating;return n&&_.addEventListener("mouseleave",L),p&&_.addEventListener("mousemove",I,{once:!0}),_.addEventListener("mouseenter",I),_.addEventListener("mouseleave",P),H&&(H.addEventListener("mouseleave",L),H.addEventListener("mouseenter",j),H.addEventListener("mouseleave",z)),()=>{n&&_.removeEventListener("mouseleave",L),p&&_.removeEventListener("mousemove",I),_.removeEventListener("mouseenter",I),_.removeEventListener("mouseleave",P),H&&(H.removeEventListener("mouseleave",L),H.removeEventListener("mouseenter",j),H.removeEventListener("mouseleave",z))}}},[i,c,e,u,p,C,O,k,r,n,T,d,v,m,o,y,E]),Wt(()=>{var I;if(c&&n&&(I=m.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&$()){b.current=!0;const L=i.floating;if(de(i.domReference)&&L){var P;const j=Ut(i.floating).body;j.setAttribute(Jh,"");const z=i.domReference,_=d==null||(P=d.nodesRef.current.find(H=>H.id===h))==null||(P=P.context)==null?void 0:P.elements.floating;return _&&(_.style.pointerEvents=""),j.style.pointerEvents="none",z.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{j.style.pointerEvents="",z.style.pointerEvents="",L.style.pointerEvents=""}}}},[c,n,h,i,d,m,$]),Wt(()=>{n||(S.current=void 0,w.current=!1,O(),k())},[n,O,k]),U.useEffect(()=>()=>{O(),bt(N),bt(B),k()},[c,i.domReference,O,k]);const A=U.useMemo(()=>{function I(P){S.current=P.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(P){const{nativeEvent:L}=P;function j(){!F.current&&!T.current&&r(!0,L,"hover")}u&&!Uo(S.current)||n||vl(E.current)===0||w.current&&P.movementX**2+P.movementY**2<2||(bt(B),S.current==="touch"?j():(w.current=!0,B.current=window.setTimeout(j,vl(E.current))))}}},[u,r,n,T,E]);return U.useMemo(()=>c?{reference:A}:{},[c,A])}const em={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},tm=U.forwardRef(function(t,n){const[r,o]=U.useState();Wt(()=>{Wh()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Wo("focus-guard")]:"",style:em};return D.jsx("span",{...t,...s})}),nm=U.createContext(null),rm=Wo("portal");function fS(e){e===void 0&&(e={});const{id:t,root:n}=e,r=hl(),o=pS(),[s,i]=U.useState(null),c=U.useRef(null);return Wt(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{c.current=null})},[s]),Wt(()=>{if(!r||c.current)return;const a=t?document.getElementById(t):null;if(!a)return;const l=document.createElement("div");l.id=r,l.setAttribute(rm,""),a.appendChild(l),c.current=l,i(l)},[t,r]),Wt(()=>{if(n===null||!r||c.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!Mc(a)&&(a=a.current),a=a||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,a.appendChild(l));const u=document.createElement("div");u.id=r,u.setAttribute(rm,""),a=l||a,a.appendChild(u),c.current=u,i(u)},[t,n,r,o]),s}function dS(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=fS({id:n,root:r}),[i,c]=U.useState(null),a=U.useRef(null),l=U.useRef(null),u=U.useRef(null),f=U.useRef(null),p=i==null?void 0:i.modal,d=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return U.useEffect(()=>{if(!s||!o||p)return;function m(v){s&&pl(v)&&(v.type==="focusin"?Zh:tS)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,p]),U.useEffect(()=>{s&&(d||Zh(s))},[d,s]),D.jsxs(nm.Provider,{value:U.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:s,setFocusManagerState:c}),[o,s]),children:[h&&s&&D.jsx(tm,{"data-type":"outside",ref:a,onFocus:m=>{if(pl(m,s)){var v;(v=u.current)==null||v.focus()}else{const T=i?i.domReference:null,E=eS(T);E==null||E.focus()}}}),h&&s&&D.jsx("span",{"aria-owns":s.id,style:em}),s&&Mr.createPortal(t,s),h&&s&&D.jsx(tm,{"data-type":"outside",ref:l,onFocus:m=>{if(pl(m,s)){var v;(v=f.current)==null||v.focus()}else{const T=i?i.domReference:null,E=J3(T);E==null||E.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const pS=()=>U.useContext(nm);function om(e){return Fe(e.target)&&e.target.tagName==="BUTTON"}function hS(e){return Fe(e.target)&&e.target.tagName==="A"}function sm(e){return Vh(e)}function mS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:a=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,p=U.useRef(),d=U.useRef(!1),h=U.useMemo(()=>({onPointerDown(m){p.current=m.pointerType},onMouseDown(m){const v=p.current;m.button===0&&c!=="click"&&(Uo(v,!0)&&l||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const v=p.current;if(c==="mousedown"&&p.current){p.current=void 0;return}Uo(v,!0)&&l||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){p.current=void 0,!(m.defaultPrevented||!u||om(m))&&(m.key===" "&&!sm(s)&&(m.preventDefault(),d.current=!0),!hS(m)&&m.key==="Enter"&&r(!(n&&a),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||om(m)||sm(s)||m.key===" "&&d.current&&(d.current=!1,r(!(n&&a),m.nativeEvent,"click"))}}),[o,s,c,l,u,r,n,f,a]);return U.useMemo(()=>i?{reference:h}:{},[i,h])}const bS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},gS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},im=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function yS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:c=!0,outsidePress:a=!0,outsidePressEvent:l="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:p=!1,bubbles:d,capture:h}=t,m=gl(),v=Ht(typeof a=="function"?a:()=>!1),T=typeof a=="function"?v:a,E=U.useRef(!1),{escapeKey:S,outsidePress:N}=im(d),{escapeKey:M,outsidePress:B}=im(h),F=U.useRef(!1),b=Ht(k=>{var y;if(!n||!i||!c||k.key!=="Escape"||F.current)return;const A=(y=s.current.floatingContext)==null?void 0:y.nodeId,I=m?li(m.nodesRef.current,A):[];if(!S&&(k.stopPropagation(),I.length>0)){let P=!0;if(I.forEach(L=>{var j;if((j=L.context)!=null&&j.open&&!L.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,Z3(k)?k.nativeEvent:k,"escape-key")}),g=Ht(k=>{var y;const A=()=>{var I;b(k),(I=Ir(k))==null||I.removeEventListener("keydown",A)};(y=Ir(k))==null||y.addEventListener("keydown",A)}),w=Ht(k=>{var y;const A=s.current.insideReactTree;s.current.insideReactTree=!1;const I=E.current;if(E.current=!1,l==="click"&&I||A||typeof T=="function"&&!T(k))return;const P=Ir(k),L="["+Wo("inert")+"]",j=Ut(o.floating).querySelectorAll(L);let z=de(P)?P:null;for(;z&&!sn(z);){const G=an(z);if(sn(G)||!de(G))break;z=G}if(j.length&&de(P)&&!V3(P)&&!Or(P,o.floating)&&Array.from(j).every(G=>!Or(z,G)))return;if(Fe(P)&&O){const G=sn(P),W=ht(P),Z=/auto|scroll/,J=G||Z.test(W.overflowX),ee=G||Z.test(W.overflowY),fe=J&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,pe=ee&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,he=W.direction==="rtl",se=pe&&(he?k.offsetX<=P.offsetWidth-P.clientWidth:k.offsetX>P.clientWidth),me=fe&&k.offsetY>P.clientHeight;if(se||me)return}const _=(y=s.current.floatingContext)==null?void 0:y.nodeId,H=m&&li(m.nodesRef.current,_).some(G=>{var W;return dl(k,(W=G.context)==null?void 0:W.elements.floating)});if(dl(k,o.floating)||dl(k,o.domReference)||H)return;const Y=m?li(m.nodesRef.current,_):[];if(Y.length>0){let G=!0;if(Y.forEach(W=>{var Z;if((Z=W.context)!=null&&Z.open&&!W.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,k,"outside-press")}),$=Ht(k=>{var y;const A=()=>{var I;w(k),(I=Ir(k))==null||I.removeEventListener(l,A)};(y=Ir(k))==null||y.addEventListener(l,A)});U.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=N;let k=-1;function y(j){r(!1,j,"ancestor-scroll")}function A(){window.clearTimeout(k),F.current=!0}function I(){k=window.setTimeout(()=>{F.current=!1},Us()?5:0)}const P=Ut(o.floating);c&&(P.addEventListener("keydown",M?g:b,M),P.addEventListener("compositionstart",A),P.addEventListener("compositionend",I)),T&&P.addEventListener(l,B?$:w,B);let L=[];return p&&(de(o.domReference)&&(L=An(o.domReference)),de(o.floating)&&(L=L.concat(An(o.floating))),!de(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(An(o.reference.contextElement)))),L=L.filter(j=>{var z;return j!==((z=P.defaultView)==null?void 0:z.visualViewport)}),L.forEach(j=>{j.addEventListener("scroll",y,{passive:!0})}),()=>{c&&(P.removeEventListener("keydown",M?g:b,M),P.removeEventListener("compositionstart",A),P.removeEventListener("compositionend",I)),T&&P.removeEventListener(l,B?$:w,B),L.forEach(j=>{j.removeEventListener("scroll",y)}),window.clearTimeout(k)}},[s,o,c,T,l,n,r,p,i,S,N,b,M,g,w,B,$]),U.useEffect(()=>{s.current.insideReactTree=!1},[s,T,l]);const C=U.useMemo(()=>({onKeyDown:b,...u&&{[bS[f]]:k=>{r(!1,k.nativeEvent,"reference-press")},...f!=="click"&&{onClick(k){r(!1,k.nativeEvent,"reference-press")}}}}),[b,r,u,f]),O=U.useMemo(()=>({onKeyDown:b,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[gS[l]]:()=>{s.current.insideReactTree=!0}}),[b,l,s]);return U.useMemo(()=>i?{reference:C,floating:O}:{},[i,C,O])}function vS(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=hl(),s=U.useRef({}),[i]=U.useState(()=>aS()),c=bl()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!de(d)&&iS("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=U.useState(r.reference),u=Ht((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=U.useMemo(()=>({setPositionReference:l}),[]),p=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:f}),[t,u,p,i,o,f])}function wS(e){e===void 0&&(e={});const{nodeId:t}=e,n=vS({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[c,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,f=U.useRef(null),p=gl();Wt(()=>{u&&(f.current=u)},[u]);const d=Up({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(S=>{const N=de(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;a(N),d.refs.setReference(N)},[d.refs]),m=U.useCallback(S=>{(de(S)||S===null)&&(f.current=S,i(S)),(de(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!de(S))&&d.refs.setReference(S)},[d.refs]),v=U.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),T=U.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=U.useMemo(()=>({...d,...r,refs:v,elements:T,nodeId:t}),[d,v,T,t,r]);return Wt(()=>{r.dataRef.current.floatingContext=E;const S=p==null?void 0:p.nodesRef.current.find(N=>N.id===t);S&&(S.context=E)}),U.useMemo(()=>({...d,context:E,refs:v,elements:T}),[d,v,T,E])}function wl(){return U3()&&Wh()}function xS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:a=!0}=t,l=U.useRef(!1),u=U.useRef(-1),f=U.useRef(!0);U.useEffect(()=>{if(!c)return;const d=Ze(i.domReference);function h(){!n&&Fe(i.domReference)&&i.domReference===fl(Ut(i.domReference))&&(l.current=!0)}function m(){f.current=!0}function v(){f.current=!1}return d.addEventListener("blur",h),wl()&&(d.addEventListener("keydown",m,!0),d.addEventListener("pointerdown",v,!0)),()=>{d.removeEventListener("blur",h),wl()&&(d.removeEventListener("keydown",m,!0),d.removeEventListener("pointerdown",v,!0))}},[i.domReference,n,c]),U.useEffect(()=>{if(!c)return;function d(h){let{reason:m}=h;(m==="reference-press"||m==="escape-key")&&(l.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,c]),U.useEffect(()=>()=>{bt(u)},[]);const p=U.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(d){if(l.current)return;const h=Ir(d.nativeEvent);if(a&&de(h)){if(wl()&&!d.relatedTarget){if(!f.current&&!Vh(h))return}else if(!G3(h))return}r(!0,d.nativeEvent,"focus")},onBlur(d){l.current=!1;const h=d.relatedTarget,m=d.nativeEvent,v=de(h)&&h.hasAttribute(Wo("focus-guard"))&&h.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var T;const E=fl(i.domReference?i.domReference.ownerDocument:document);!h&&E===i.domReference||Or((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,E)||Or(i.domReference,E)||v||r(!1,m,"focus")})}}),[s,i.domReference,r,a]);return U.useMemo(()=>c?{reference:p}:{},[c,p])}function xl(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Kh]:i,[Yh]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[nS]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(a=>{let[l,u]=a;if(!(o&&[Kh,Yh].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var f;(f=r.get(l))==null||f.push(u),i[l]=function(){for(var p,d=arguments.length,h=new Array(d),m=0;m<d;m++)h[m]=arguments[m];return(p=r.get(l))==null?void 0:p.map(v=>v(...h)).find(v=>v!==void 0)}}}else i[l]=u}),i),{})}}function ES(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=U.useCallback(c=>xl(c,e,"reference"),t),s=U.useCallback(c=>xl(c,e,"floating"),n),i=U.useCallback(c=>xl(c,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const SS=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function PS(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:c=!0,role:a="dialog"}=t,l=hl(),u=((n=s.domReference)==null?void 0:n.id)||l,f=U.useMemo(()=>{var E;return((E=q3(s.floating))==null?void 0:E.id)||i},[s.floating,i]),p=(r=SS.get(a))!=null?r:a,h=bl()!=null,m=U.useMemo(()=>p==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?f:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:u},...p==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,f,h,o,u,a]),v=U.useMemo(()=>{const E={id:f,...p&&{role:p}};return p==="tooltip"||a==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,a]),T=U.useCallback(E=>{let{active:S,selected:N}=E;const M={role:"option",...S&&{id:f+"-fui-option"}};switch(a){case"select":case"combobox":return{...M,"aria-selected":N}}return{}},[f,a]);return U.useMemo(()=>c?{reference:m,floating:v,item:T}:{},[c,m,v,T])}const am=x.forwardRef(({placement:e,className:t=""},n)=>{const o=(s=>{switch(s.split("-")[0]){case"top":return{bottom:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid #242424"};case"bottom":return{top:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #242424"};case"left":return{right:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:"4px solid #242424"};case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderRight:"4px solid #242424"};default:return{}}})(e);return D.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});am.displayName="TooltipArrow";const Qn=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:s="",disabled:i=!1,maxWidth:c="max-w-xs",trigger:a=["hover","focus"]})=>{const[l,u]=x.useState(!1),f=x.useRef(null),{refs:p,floatingStyles:d,context:h}=wS({open:l&&!i,onOpenChange:u,placement:n,whileElementsMounted:Rp,middleware:[Zc(o?12:8),Hp({fallbackAxisSideDirection:"start",padding:8}),Wp({padding:8}),...o?[zE({element:f})]:[]]}),m=uS(h,{enabled:a.includes("hover"),delay:{open:r,close:150}}),v=xS(h,{enabled:a.includes("focus")}),T=mS(h,{enabled:a.includes("click")}),E=yS(h),S=PS(h,{role:"tooltip"}),{getReferenceProps:N,getFloatingProps:M}=ES([m,v,T,E,S]);return i?D.jsx(D.Fragment,{children:e}):D.jsxs(D.Fragment,{children:[D.jsx("div",{ref:p.setReference,...N(),className:"cursor-help",children:e}),l&&D.jsx(dS,{children:D.jsxs("div",{ref:p.setFloating,...M(),style:{...d,zIndex:101},className:`
177
+ */var _3={L:Br.QrCode.Ecc.LOW,M:Br.QrCode.Ecc.MEDIUM,Q:Br.QrCode.Ecc.QUARTILE,H:Br.QrCode.Ecc.HIGH},_h=128,zh="L",Uh="#FFFFFF",Wh="#000000",Hh=!1,Vh=1,z3=4,U3=0,W3=.1;function Gh(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(i,c){if(!i&&s!==null){n.push(`M${s+t} ${o+t}h${c-s}v1H${s+t}z`),s=null;return}if(c===r.length-1){if(!i)return;s===null?n.push(`M${c+t},${o+t} h1v1H${c+t}z`):n.push(`M${s+t},${o+t} h${c+1-s}v1H${s+t}z`);return}i&&s===null&&(s=c)})}),n.join("")}function qh(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function H3(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*W3),i=o/t,c=(r.width||s)*i,a=(r.height||s)*i,l=r.x==null?e.length/2-c/2:r.x*i,u=r.y==null?e.length/2-a/2:r.y*i,f=r.opacity==null?1:r.opacity;let d=null;if(r.excavate){let h=Math.floor(l),b=Math.floor(u),S=Math.ceil(c+l-h),P=Math.ceil(a+u-b);d={x:h,y:b,w:S,h:P}}const p=r.crossOrigin;return{x:l,y:u,h:a,w:c,excavation:d,opacity:f,crossOrigin:p}}function V3(e,t){return t!=null?Math.max(Math.floor(t),0):e?z3:U3}function Zh({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:c}){let a=E.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((b,S)=>(b.push(...Br.QrSegment.makeSegments(S)),b),[]);return Br.QrCode.encodeSegments(h,_3[t],n,void 0,void 0,c)},[e,t,n,c]);const{cells:l,margin:u,numCells:f,calculatedImageSettings:d}=E.useMemo(()=>{let p=a.getModules();const h=V3(r,o),b=p.length+h*2,S=H3(p,i,h,s);return{cells:p,margin:h,numCells:b,calculatedImageSettings:S}},[a,i,s,r,o]);return{qrcode:a,margin:u,cells:l,numCells:f,calculatedImageSettings:d}}var G3=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),q3=E.forwardRef(function(t,n){const r=t,{value:o,size:s=_h,level:i=zh,bgColor:c=Uh,fgColor:a=Wh,includeMargin:l=Hh,minVersion:u=Vh,boostLevel:f,marginSize:d,imageSettings:p}=r,b=vl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:S}=b,P=vl(b,["style"]),x=p==null?void 0:p.src,w=E.useRef(null),$=E.useRef(null),k=E.useCallback(D=>{w.current=D,typeof n=="function"?n(D):n&&(n.current=D)},[n]),[B,F]=E.useState(!1),{margin:m,cells:g,numCells:v,calculatedImageSettings:A}=Zh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:d,imageSettings:p,size:s});E.useEffect(()=>{if(w.current!=null){const D=w.current,y=D.getContext("2d");if(!y)return;let C=g;const I=$.current,T=A!=null&&I!==null&&I.complete&&I.naturalHeight!==0&&I.naturalWidth!==0;T&&A.excavation!=null&&(C=qh(g,A.excavation));const L=window.devicePixelRatio||1;D.height=D.width=s*L;const j=s/v*L;y.scale(j,j),y.fillStyle=c,y.fillRect(0,0,v,v),y.fillStyle=a,G3?y.fill(new Path2D(Gh(C,m))):g.forEach(function(z,_){z.forEach(function(W,K){W&&y.fillRect(K+m,_+m,1,1)})}),A&&(y.globalAlpha=A.opacity),T&&y.drawImage(I,A.x+m,A.y+m,A.w,A.h)}}),E.useEffect(()=>{F(!1)},[x]);const N=yl({height:s,width:s},S);let O=null;return x!=null&&(O=E.createElement("img",{src:x,key:x,style:{display:"none"},onLoad:()=>{F(!0)},ref:$,crossOrigin:A==null?void 0:A.crossOrigin})),E.createElement(E.Fragment,null,E.createElement("canvas",yl({style:N,height:s,width:s,ref:k,role:"img"},P)),O)});q3.displayName="QRCodeCanvas";var Kh=E.forwardRef(function(t,n){const r=t,{value:o,size:s=_h,level:i=zh,bgColor:c=Uh,fgColor:a=Wh,includeMargin:l=Hh,minVersion:u=Vh,boostLevel:f,title:d,marginSize:p,imageSettings:h}=r,b=vl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:S,cells:P,numCells:x,calculatedImageSettings:w}=Zh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:p,imageSettings:h,size:s});let $=P,k=null;h!=null&&w!=null&&(w.excavation!=null&&($=qh(P,w.excavation)),k=E.createElement("image",{href:h.src,height:w.h,width:w.w,x:w.x+S,y:w.y+S,preserveAspectRatio:"none",opacity:w.opacity,crossOrigin:w.crossOrigin}));const B=Gh($,S);return E.createElement("svg",yl({height:s,width:s,viewBox:`0 0 ${x} ${x}`,ref:n,role:"img"},b),!!d&&E.createElement("title",null,d),E.createElement("path",{fill:c,d:`M0,0 h${x}v${x}H0z`,shapeRendering:"crispEdges"}),E.createElement("path",{fill:a,d:B,shapeRendering:"crispEdges"}),k)});Kh.displayName="QRCodeSVG";function Z3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function K3(){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}function Yh(){return/apple/i.test(navigator.vendor)}function Y3(){return Z3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function X3(){return K3().includes("jsdom/")}const Xh="data-floating-ui-focusable",Q3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function wl(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Fr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Hc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Rr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function xl(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function J3(e){return e.matches("html,body")}function Ht(e){return(e==null?void 0:e.ownerDocument)||document}function Qh(e){return Ye(e)&&e.matches(Q3)}function eS(e){if(!e||X3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function tS(e){return e?e.hasAttribute(Xh)?e:e.querySelector("["+Xh+"]")||e:null}function wi(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...wi(e,o.id,n)])}function nS(e){return"nativeEvent"in e}function Yo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var rS=typeof document<"u",oS=function(){},Vt=rS?E.useLayoutEffect:oS;const sS={...U};function xi(e){const t=U.useRef(e);return Vt(()=>{t.current=e}),t}const iS=sS.useInsertionEffect||(e=>e());function Gt(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return iS(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Jh=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function em(e,t){const n=Mp(e,Jh()),r=n.length;if(r===0)return;const o=wl(Ht(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function aS(e){return em(Ht(e).body,1)||e}function cS(e){return em(Ht(e).body,-1)||e}function El(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Fr(n,r)}function lS(e){Mp(e,Jh()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function tm(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const uS="data-floating-ui-focusable",nm="active",rm="selected",fS={...U};let om=!1,dS=0;const sm=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+dS++;function pS(){const[e,t]=U.useState(()=>om?sm():void 0);return Vt(()=>{e==null&&t(sm())},[]),U.useEffect(()=>{om=!0},[]),e}const Sl=fS.useId||pS;let Pl;process.env.NODE_ENV!=="production"&&(Pl=new Set);function hS(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Pl)!=null&&e.has(o))){var s;(s=Pl)==null||s.add(o),console.error(o)}}function mS(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const bS=U.createContext(null),gS=U.createContext(null),Tl=()=>{var e;return((e=U.useContext(bS))==null?void 0:e.id)||null},$l=()=>U.useContext(gS);function Xo(e){return"data-floating-ui-"+e}function yt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const im=Xo("safe-polygon");function Al(e,t,n){if(n&&!Yo(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function Nl(e){return typeof e=="function"?e():e}function yS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:c=!0,delay:a=0,handleClose:l=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,p=$l(),h=Tl(),b=xi(l),S=xi(a),P=xi(n),x=xi(f),w=U.useRef(),$=U.useRef(-1),k=U.useRef(),B=U.useRef(-1),F=U.useRef(!0),m=U.useRef(!1),g=U.useRef(()=>{}),v=U.useRef(!1),A=Gt(()=>{var I;const T=(I=o.current.openEvent)==null?void 0:I.type;return(T==null?void 0:T.includes("mouse"))&&T!=="mousedown"});U.useEffect(()=>{if(!c)return;function I(T){let{open:L}=T;L||(yt($),yt(B),F.current=!0,v.current=!1)}return s.on("openchange",I),()=>{s.off("openchange",I)}},[c,s]),U.useEffect(()=>{if(!c||!b.current||!n)return;function I(L){A()&&r(!1,L,"hover")}const T=Ht(i.floating).documentElement;return T.addEventListener("mouseleave",I),()=>{T.removeEventListener("mouseleave",I)}},[i.floating,n,r,c,b,A]);const N=U.useCallback(function(I,T,L){T===void 0&&(T=!0),L===void 0&&(L="hover");const j=Al(S.current,"close",w.current);j&&!k.current?(yt($),$.current=window.setTimeout(()=>r(!1,I,L),j)):T&&(yt($),r(!1,I,L))},[S,r]),O=Gt(()=>{g.current(),k.current=void 0}),D=Gt(()=>{if(m.current){const I=Ht(i.floating).body;I.style.pointerEvents="",I.removeAttribute(im),m.current=!1}}),y=Gt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);U.useEffect(()=>{if(!c)return;function I(_){if(yt($),F.current=!1,u&&!Yo(w.current)||Nl(x.current)>0&&!Al(S.current,"open"))return;const W=Al(S.current,"open",w.current);W?$.current=window.setTimeout(()=>{P.current||r(!0,_,"hover")},W):n||r(!0,_,"hover")}function T(_){if(y()){D();return}g.current();const W=Ht(i.floating);if(yt(B),v.current=!1,b.current&&o.current.floatingContext){n||yt($),k.current=b.current({...o.current.floatingContext,tree:p,x:_.clientX,y:_.clientY,onClose(){D(),O(),y()||N(_,!0,"safe-polygon")}});const G=k.current;W.addEventListener("mousemove",G),g.current=()=>{W.removeEventListener("mousemove",G)};return}(w.current==="touch"?!Fr(i.floating,_.relatedTarget):!0)&&N(_)}function L(_){y()||o.current.floatingContext&&(b.current==null||b.current({...o.current.floatingContext,tree:p,x:_.clientX,y:_.clientY,onClose(){D(),O(),y()||N(_)}})(_))}function j(){yt($)}function z(_){y()||N(_,!1)}if(de(i.domReference)){const _=i.domReference,W=i.floating;return n&&_.addEventListener("mouseleave",L),d&&_.addEventListener("mousemove",I,{once:!0}),_.addEventListener("mouseenter",I),_.addEventListener("mouseleave",T),W&&(W.addEventListener("mouseleave",L),W.addEventListener("mouseenter",j),W.addEventListener("mouseleave",z)),()=>{n&&_.removeEventListener("mouseleave",L),d&&_.removeEventListener("mousemove",I),_.removeEventListener("mouseenter",I),_.removeEventListener("mouseleave",T),W&&(W.removeEventListener("mouseleave",L),W.removeEventListener("mouseenter",j),W.removeEventListener("mouseleave",z))}}},[i,c,e,u,d,N,O,D,r,n,P,p,S,b,o,y,x]),Vt(()=>{var I;if(c&&n&&(I=b.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&A()){m.current=!0;const L=i.floating;if(de(i.domReference)&&L){var T;const j=Ht(i.floating).body;j.setAttribute(im,"");const z=i.domReference,_=p==null||(T=p.nodesRef.current.find(W=>W.id===h))==null||(T=T.context)==null?void 0:T.elements.floating;return _&&(_.style.pointerEvents=""),j.style.pointerEvents="none",z.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{j.style.pointerEvents="",z.style.pointerEvents="",L.style.pointerEvents=""}}}},[c,n,h,i,p,b,A]),Vt(()=>{n||(w.current=void 0,v.current=!1,O(),D())},[n,O,D]),U.useEffect(()=>()=>{O(),yt($),yt(B),D()},[c,i.domReference,O,D]);const C=U.useMemo(()=>{function I(T){w.current=T.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(T){const{nativeEvent:L}=T;function j(){!F.current&&!P.current&&r(!0,L,"hover")}u&&!Yo(w.current)||n||Nl(x.current)===0||v.current&&T.movementX**2+T.movementY**2<2||(yt(B),w.current==="touch"?j():(v.current=!0,B.current=window.setTimeout(j,Nl(x.current))))}}},[u,r,n,P,x]);return U.useMemo(()=>c?{reference:C}:{},[c,C])}const vS={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},am=U.forwardRef(function(t,n){const[r,o]=U.useState();Vt(()=>{Yh()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Xo("focus-guard")]:"",style:vS};return M.jsx("span",{...t,...s})}),wS={clipPath:"inset(50%)",position:"fixed",top:0,left:0},cm=U.createContext(null),lm=Xo("portal");function xS(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Sl(),o=SS(),[s,i]=U.useState(null),c=U.useRef(null);return Vt(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{c.current=null})},[s]),Vt(()=>{if(!r||c.current)return;const a=t?document.getElementById(t):null;if(!a)return;const l=document.createElement("div");l.id=r,l.setAttribute(lm,""),a.appendChild(l),c.current=l,i(l)},[t,r]),Vt(()=>{if(n===null||!r||c.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!Wc(a)&&(a=a.current),a=a||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,a.appendChild(l));const u=document.createElement("div");u.id=r,u.setAttribute(lm,""),a=l||a,a.appendChild(u),c.current=u,i(u)},[t,n,r,o]),s}function ES(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=xS({id:n,root:r}),[i,c]=U.useState(null),a=U.useRef(null),l=U.useRef(null),u=U.useRef(null),f=U.useRef(null),d=i==null?void 0:i.modal,p=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return U.useEffect(()=>{if(!s||!o||d)return;function b(S){s&&El(S)&&(S.type==="focusin"?tm:lS)(s)}return s.addEventListener("focusin",b,!0),s.addEventListener("focusout",b,!0),()=>{s.removeEventListener("focusin",b,!0),s.removeEventListener("focusout",b,!0)}},[s,o,d]),U.useEffect(()=>{s&&(p||tm(s))},[p,s]),M.jsxs(cm.Provider,{value:U.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:s,setFocusManagerState:c}),[o,s]),children:[h&&s&&M.jsx(am,{"data-type":"outside",ref:a,onFocus:b=>{if(El(b,s)){var S;(S=u.current)==null||S.focus()}else{const P=i?i.domReference:null,x=cS(P);x==null||x.focus()}}}),h&&s&&M.jsx("span",{"aria-owns":s.id,style:wS}),s&&zr.createPortal(t,s),h&&s&&M.jsx(am,{"data-type":"outside",ref:l,onFocus:b=>{if(El(b,s)){var S;(S=f.current)==null||S.focus()}else{const P=i?i.domReference:null,x=aS(P);x==null||x.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,b.nativeEvent,"focus-out"))}}})]})}const SS=()=>U.useContext(cm);function um(e){return Ye(e.target)&&e.target.tagName==="BUTTON"}function PS(e){return Ye(e.target)&&e.target.tagName==="A"}function fm(e){return Qh(e)}function TS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:a=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=U.useRef(),p=U.useRef(!1),h=U.useMemo(()=>({onPointerDown(b){d.current=b.pointerType},onMouseDown(b){const S=d.current;b.button===0&&c!=="click"&&(Yo(S,!0)&&l||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,b.nativeEvent,"click"):(b.preventDefault(),r(!0,b.nativeEvent,"click"))))},onClick(b){const S=d.current;if(c==="mousedown"&&d.current){d.current=void 0;return}Yo(S,!0)&&l||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,b.nativeEvent,"click"):r(!0,b.nativeEvent,"click"))},onKeyDown(b){d.current=void 0,!(b.defaultPrevented||!u||um(b))&&(b.key===" "&&!fm(s)&&(b.preventDefault(),p.current=!0),!PS(b)&&b.key==="Enter"&&r(!(n&&a),b.nativeEvent,"click"))},onKeyUp(b){b.defaultPrevented||!u||um(b)||fm(s)||b.key===" "&&p.current&&(p.current=!1,r(!(n&&a),b.nativeEvent,"click"))}}),[o,s,c,l,u,r,n,f,a]);return U.useMemo(()=>i?{reference:h}:{},[i,h])}const $S={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},AS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},dm=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function NS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:c=!0,outsidePress:a=!0,outsidePressEvent:l="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:h}=t,b=$l(),S=Gt(typeof a=="function"?a:()=>!1),P=typeof a=="function"?S:a,x=U.useRef(!1),{escapeKey:w,outsidePress:$}=dm(p),{escapeKey:k,outsidePress:B}=dm(h),F=U.useRef(!1),m=Gt(D=>{var y;if(!n||!i||!c||D.key!=="Escape"||F.current)return;const C=(y=s.current.floatingContext)==null?void 0:y.nodeId,I=b?wi(b.nodesRef.current,C):[];if(!w&&(D.stopPropagation(),I.length>0)){let T=!0;if(I.forEach(L=>{var j;if((j=L.context)!=null&&j.open&&!L.context.dataRef.current.__escapeKeyBubbles){T=!1;return}}),!T)return}r(!1,nS(D)?D.nativeEvent:D,"escape-key")}),g=Gt(D=>{var y;const C=()=>{var I;m(D),(I=Rr(D))==null||I.removeEventListener("keydown",C)};(y=Rr(D))==null||y.addEventListener("keydown",C)}),v=Gt(D=>{var y;const C=s.current.insideReactTree;s.current.insideReactTree=!1;const I=x.current;if(x.current=!1,l==="click"&&I||C||typeof P=="function"&&!P(D))return;const T=Rr(D),L="["+Xo("inert")+"]",j=Ht(o.floating).querySelectorAll(L);let z=de(T)?T:null;for(;z&&!cn(z);){const G=ln(z);if(cn(G)||!de(G))break;z=G}if(j.length&&de(T)&&!J3(T)&&!Fr(T,o.floating)&&Array.from(j).every(G=>!Fr(z,G)))return;if(Ye(T)&&O){const G=cn(T),H=bt(T),q=/auto|scroll/,Q=G||q.test(H.overflowX),ee=G||q.test(H.overflowY),pe=Q&&T.clientWidth>0&&T.scrollWidth>T.clientWidth,le=ee&&T.clientHeight>0&&T.scrollHeight>T.clientHeight,he=H.direction==="rtl",ie=le&&(he?D.offsetX<=T.offsetWidth-T.clientWidth:D.offsetX>T.clientWidth),me=pe&&D.offsetY>T.clientHeight;if(ie||me)return}const _=(y=s.current.floatingContext)==null?void 0:y.nodeId,W=b&&wi(b.nodesRef.current,_).some(G=>{var H;return xl(D,(H=G.context)==null?void 0:H.elements.floating)});if(xl(D,o.floating)||xl(D,o.domReference)||W)return;const K=b?wi(b.nodesRef.current,_):[];if(K.length>0){let G=!0;if(K.forEach(H=>{var q;if((q=H.context)!=null&&q.open&&!H.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,D,"outside-press")}),A=Gt(D=>{var y;const C=()=>{var I;v(D),(I=Rr(D))==null||I.removeEventListener(l,C)};(y=Rr(D))==null||y.addEventListener(l,C)});U.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=$;let D=-1;function y(j){r(!1,j,"ancestor-scroll")}function C(){window.clearTimeout(D),F.current=!0}function I(){D=window.setTimeout(()=>{F.current=!1},Js()?5:0)}const T=Ht(o.floating);c&&(T.addEventListener("keydown",k?g:m,k),T.addEventListener("compositionstart",C),T.addEventListener("compositionend",I)),P&&T.addEventListener(l,B?A:v,B);let L=[];return d&&(de(o.domReference)&&(L=Cn(o.domReference)),de(o.floating)&&(L=L.concat(Cn(o.floating))),!de(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(Cn(o.reference.contextElement)))),L=L.filter(j=>{var z;return j!==((z=T.defaultView)==null?void 0:z.visualViewport)}),L.forEach(j=>{j.addEventListener("scroll",y,{passive:!0})}),()=>{c&&(T.removeEventListener("keydown",k?g:m,k),T.removeEventListener("compositionstart",C),T.removeEventListener("compositionend",I)),P&&T.removeEventListener(l,B?A:v,B),L.forEach(j=>{j.removeEventListener("scroll",y)}),window.clearTimeout(D)}},[s,o,c,P,l,n,r,d,i,w,$,m,k,g,v,B,A]),U.useEffect(()=>{s.current.insideReactTree=!1},[s,P,l]);const N=U.useMemo(()=>({onKeyDown:m,...u&&{[$S[f]]:D=>{r(!1,D.nativeEvent,"reference-press")},...f!=="click"&&{onClick(D){r(!1,D.nativeEvent,"reference-press")}}}}),[m,r,u,f]),O=U.useMemo(()=>{function D(y){y.button===0&&(x.current=!0)}return{onKeyDown:m,onMouseDown:D,onMouseUp:D,[AS[l]]:()=>{s.current.insideReactTree=!0}}},[m,l,s]);return U.useMemo(()=>i?{reference:N,floating:O}:{},[i,N,O])}function CS(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Sl(),s=U.useRef({}),[i]=U.useState(()=>mS()),c=Tl()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!de(p)&&hS("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=U.useState(r.reference),u=Gt((p,h,b)=>{s.current.openEvent=p?h:void 0,i.emit("openchange",{open:p,event:h,reason:b,nested:c}),n==null||n(p,h,b)}),f=U.useMemo(()=>({setPositionReference:l}),[]),d=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:d,events:i,floatingId:o,refs:f}),[t,u,d,i,o,f])}function OS(e){e===void 0&&(e={});const{nodeId:t}=e,n=CS({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[c,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,f=U.useRef(null),d=$l();Vt(()=>{u&&(f.current=u)},[u]);const p=Kp({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(w=>{const $=de(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;a($),p.refs.setReference($)},[p.refs]),b=U.useCallback(w=>{(de(w)||w===null)&&(f.current=w,i(w)),(de(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!de(w))&&p.refs.setReference(w)},[p.refs]),S=U.useMemo(()=>({...p.refs,setReference:b,setPositionReference:h,domReference:f}),[p.refs,b,h]),P=U.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),x=U.useMemo(()=>({...p,...r,refs:S,elements:P,nodeId:t}),[p,S,P,t,r]);return Vt(()=>{r.dataRef.current.floatingContext=x;const w=d==null?void 0:d.nodesRef.current.find($=>$.id===t);w&&(w.context=x)}),U.useMemo(()=>({...p,context:x,refs:S,elements:P}),[p,S,P,x])}function Cl(){return Y3()&&Yh()}function IS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:a=!0}=t,l=U.useRef(!1),u=U.useRef(-1),f=U.useRef(!0);U.useEffect(()=>{if(!c)return;const p=Ke(i.domReference);function h(){!n&&Ye(i.domReference)&&i.domReference===wl(Ht(i.domReference))&&(l.current=!0)}function b(){f.current=!0}function S(){f.current=!1}return p.addEventListener("blur",h),Cl()&&(p.addEventListener("keydown",b,!0),p.addEventListener("pointerdown",S,!0)),()=>{p.removeEventListener("blur",h),Cl()&&(p.removeEventListener("keydown",b,!0),p.removeEventListener("pointerdown",S,!0))}},[i.domReference,n,c]),U.useEffect(()=>{if(!c)return;function p(h){let{reason:b}=h;(b==="reference-press"||b==="escape-key")&&(l.current=!0)}return o.on("openchange",p),()=>{o.off("openchange",p)}},[o,c]),U.useEffect(()=>()=>{yt(u)},[]);const d=U.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(p){if(l.current)return;const h=Rr(p.nativeEvent);if(a&&de(h)){if(Cl()&&!p.relatedTarget){if(!f.current&&!Qh(h))return}else if(!eS(h))return}r(!0,p.nativeEvent,"focus")},onBlur(p){l.current=!1;const h=p.relatedTarget,b=p.nativeEvent,S=de(h)&&h.hasAttribute(Xo("focus-guard"))&&h.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var P;const x=wl(i.domReference?i.domReference.ownerDocument:document);!h&&x===i.domReference||Fr((P=s.current.floatingContext)==null?void 0:P.refs.floating.current,x)||Fr(i.domReference,x)||S||r(!1,b,"focus")})}}),[s,i.domReference,r,a]);return U.useMemo(()=>c?{reference:d}:{},[c,d])}function Ol(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[nm]:i,[rm]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[uS]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(a=>{let[l,u]=a;if(!(o&&[nm,rm].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var f;(f=r.get(l))==null||f.push(u),i[l]=function(){for(var d,p=arguments.length,h=new Array(p),b=0;b<p;b++)h[b]=arguments[b];return(d=r.get(l))==null?void 0:d.map(S=>S(...h)).find(S=>S!==void 0)}}}else i[l]=u}),i),{})}}function DS(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=U.useCallback(c=>Ol(c,e,"reference"),t),s=U.useCallback(c=>Ol(c,e,"floating"),n),i=U.useCallback(c=>Ol(c,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const MS=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function kS(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:c=!0,role:a="dialog"}=t,l=Sl(),u=((n=s.domReference)==null?void 0:n.id)||l,f=U.useMemo(()=>{var x;return((x=tS(s.floating))==null?void 0:x.id)||i},[s.floating,i]),d=(r=MS.get(a))!=null?r:a,h=Tl()!=null,b=U.useMemo(()=>d==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[d,f,h,o,u,a]),S=U.useMemo(()=>{const x={id:f,...d&&{role:d}};return d==="tooltip"||a==="label"?x:{...x,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,a]),P=U.useCallback(x=>{let{active:w,selected:$}=x;const k={role:"option",...w&&{id:f+"-fui-option"}};switch(a){case"select":case"combobox":return{...k,"aria-selected":$}}return{}},[f,a]);return U.useMemo(()=>c?{reference:b,floating:S,item:P}:{},[c,b,S,P])}const pm=E.forwardRef(({placement:e,className:t=""},n)=>{const o=(s=>{switch(s.split("-")[0]){case"top":return{bottom:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid #242424"};case"bottom":return{top:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #242424"};case"left":return{right:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:"4px solid #242424"};case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderRight:"4px solid #242424"};default:return{}}})(e);return M.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});pm.displayName="TooltipArrow";const nr=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:s="",disabled:i=!1,maxWidth:c="max-w-xs",trigger:a=["hover","focus"]})=>{const[l,u]=E.useState(!1),f=E.useRef(null),{refs:d,floatingStyles:p,context:h}=OS({open:l&&!i,onOpenChange:u,placement:n,whileElementsMounted:Vp,middleware:[ol(o?12:8),Xp({fallbackAxisSideDirection:"start",padding:8}),Yp({padding:8}),...o?[qE({element:f})]:[]]}),b=yS(h,{enabled:a.includes("hover"),delay:{open:r,close:150}}),S=IS(h,{enabled:a.includes("focus")}),P=TS(h,{enabled:a.includes("click")}),x=NS(h),w=kS(h,{role:"tooltip"}),{getReferenceProps:$,getFloatingProps:k}=DS([b,S,P,x,w]);return i?M.jsx(M.Fragment,{children:e}):M.jsxs(M.Fragment,{children:[M.jsx("div",{ref:d.setReference,...$(),className:"cursor-help",children:e}),l&&M.jsx(ES,{children:M.jsxs("div",{ref:d.setFloating,...k(),style:{...p,zIndex:101},className:`
178
178
  z-[101] px-3 py-2 cursor-help
179
179
  bg-fill-page-secondary
180
180
  text-text-primary text-sm font-medium
@@ -182,6 +182,6 @@ ${bg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
182
182
  relative
183
183
  ${c}
184
184
  ${s}
185
- `,children:[t,o&&D.jsx(am,{ref:f,placement:h.placement||n})]})})]})},Ho="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",TS=({currentActiveChain:e,selectedToken:t,address:n,accountType:r,onDeposit:o,onCopy:s,onClose:i})=>{const{t:c}=wt(),a=r===g5,l=x.useMemo(()=>{if(!e)return!1;const h=Number(e.chainId);return!Number.isNaN(h)&&(h===42161||h===421614)},[e]),u=a,f=x.useMemo(()=>{var h;return(h=e==null?void 0:e.tokenList)==null?void 0:h.find(m=>m.token===t||m.symbol===t)},[e,t]),p=x.useMemo(()=>{const h=(t||"").toUpperCase();if(!u&&h==="USDC")return c("deposit.defaultSpotToPerpNotice",{coin:t,v:e==null?void 0:e.chain});const T=c(u?"deposit.crossChainDepositFeeTip":"deposit.depositAllTip",{coin:t,v:e==null?void 0:e.chain});return u&&(!l||h==="USDC")?String(T).split(`
186
- `)[0]:T},[c,t,e==null?void 0:e.chain,u,l]),d=(f==null?void 0:f.minDepositSize)||"10";return D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&D.jsx("div",{className:"bg-white rounded-lg",children:D.jsx(Uh,{value:n,size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&D.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[D.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:n}),D.jsx(O3,{onCopy:()=>{s&&s(n)},text:n,children:D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[D.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),D.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),D.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[D.jsxs("div",{className:"flex items-start",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1",children:D.jsx("p",{className:"text-xs text-functional-orange-1",children:p})})]}),r===a0&&D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),D.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:c("deposit.addressUpdatedNotice")})]})]}),D.jsxs("div",{className:"text-sm",children:[(a||t.toUpperCase()!=="USDC")&&D.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[D.jsx("span",{className:"text-text-tertiary",children:c("deposit.arrivalTime")}),D.jsx(Qn,{content:D.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[D.jsx("p",{children:c("deposit.arrivaltimeTooltip1",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60,v1:e==null?void 0:e.txConfirm})}),D.jsx("p",{children:c("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:D.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:c("deposit.arrivalEstimated",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60})})})]}),D.jsxs("div",{className:`flex justify-between items-center h-[18px] ${a||t.toUpperCase()!=="USDC"?"mt-1":"mt-4"}`,children:[D.jsx("span",{className:"text-text-tertiary",children:c("deposit.minDeposit")}),D.jsxs("span",{className:"text-text-primary font-medium text-right",children:[d," ",t]})]}),r===a0&&t.toUpperCase()!=="USDC"&&D.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[D.jsx("span",{className:"text-text-tertiary",children:c("deposit.maxDeposit")}),D.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]}),D.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{o&&o({amount:"",chainId:e.chainId,tokenAddress:n,tokenSymbol:t}),i()},children:c("deposit.title")})]})},Vo=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return D.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},AS=(e,t)=>Number(e)>Number(t),kt=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let s=r[1]||"";return s.length>6&&(s=s.substring(0,6)),s=s.replace(/0+$/,""),s?(s.length===1&&(s+="0"),o+"."+s):o+".00"},fi=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const a=o[0]+"."+o[1].substring(0,6);return fi(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:kt(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},$S=(e,t,n)=>{const r=parseFloat(String(e)||"0"),o=parseFloat(String(t)||"0");if(o>0){const s=r-o,i=kt(Math.max(0,s).toString());return D.jsxs("span",{className:"flex items-center gap-1",children:[kt(e),D.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${kt(e)} ${n}`},CS=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},NS=(e,t,n)=>{if(!xh(e,n))return!1;try{const r=new Ie(t||"0"),o=new Ie("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},OS=(e,t,n,r)=>{let o=t||"0";if(!(r==="spot")&&xh(e,n))try{const i=new Ie(o),c=new Ie("200000");i.gt(c)&&(o="200000")}catch(i){console.warn("Error calculating max amount limit:",i)}try{const i=new Ie(o||"0");return console.log("bn:",i),console.log("bn:",i.isNaN()),i.isNaN()?o:i.decimalPlaces(6,Ie.ROUND_DOWN).toString()}catch{return o}},cm={chains:[],spotChains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""},defaultChainId:1,defaultAccountType:"perpetual",balances:{spot:{},perpetual:{}}};let Ke=null;const lm=x.forwardRef((e,t)=>{const[n,r]=x.useState(!1),[o,s]=x.useState(!1),[i,c]=x.useState(cm),a=x.useCallback(h=>{c(h),r(!0)},[]),l=x.useCallback(h=>{c(m=>({...m,...h}))},[]),u=x.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=x.useCallback(h=>{s(h)},[]),p=x.useCallback(()=>n,[n]),d=x.useCallback(()=>o,[o]);return x.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:p,isLoading:d}),[a,u,l,f,p,d]),x.useEffect(()=>(Ke={openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:p,isLoading:d},()=>{Ke=null}),[a,u,l,f,p,d]),n?D.jsx(mm,{isOpen:n,isLoading:o,onClose:u,currentActiveAccount:i.currentActiveAccount,chains:i.chains,spotChains:i.spotChains,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAccountType:i.defaultAccountType,balances:i.balances,wagmiHooks:i.wagmiHooks,onDeposit:i.onDeposit,onCopy:i.onCopy,onChainChange:h=>{var m;return(m=i.onChainChange)==null?void 0:m.call(i,h)},onTokenChange:h=>{var m;return(m=i.onTokenChange)==null?void 0:m.call(i,h)}}):null});lm.displayName="DepositManager";const um=e=>{if(!Ke){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Ke.openDeposit(e||cm)},fm=()=>{if(!Ke){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Ke.closeDeposit()},dm=e=>{Ke&&Ke.updateDepositOptions(e)},di=e=>{if(!Ke){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Ke.setDepositLoading(e)},IS=()=>Ke?Ke.isOpen():!1,pm=()=>Ke?Ke.isLoading():!1,kS=()=>({openDeposit:um,closeDeposit:fm,updateDepositOptions:dm,setDepositLoading:di,isOpen:IS,isLoading:pm}),DS=e=>{const{t}=wt(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:c,minDeposit:a=10}=e;return x.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const l=parseFloat(r||"0"),u=a,f=CS(r,s||"0",o);return!r||l===0||!o?{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:l<u?{text:t("deposit.minDepositParsed",{amount:u,token:i}),disabled:!0,isNetworkSwitch:!1}:{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!f,isNetworkSwitch:!1}},[n,r,o,s,i,c,a,t])};function MS(e){const{account:t,accountChainId:n,targetChainId:r,tokenInfo:o,amount:s}=e,{useReadContract:i,useWriteContract:c,usePublicClient:a,useSwitchChain:l}=e.wagmiHooks,u=o==null?void 0:o.tokenAddress,f=(o==null?void 0:o.decimals)??18,p=o==null?void 0:o.contractAddress,d=!u||u.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",{switchChainAsync:h}=l(),{writeContractAsync:m}=c(),v=a(),T=i({address:u,abi:yr,functionName:"allowance",args:[mn(t||""),p],chainId:r,query:{enabled:!!(!d&&t&&r&&u&&p)}}),E=T!=null&&T.isSuccess?T.data:void 0,S=x.useMemo(()=>{if(d)return!0;if(!T.isSuccess||E===void 0||E===0n)return!1;try{const M=T6(String(Number(s||"0")||0),Number(f));return E>=M}catch{return!1}},[d,T.isSuccess,E,s,f]),N=x.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!m||!v||!u||!p)return;const B=mn(u),F=mn(p);if((E||0n)>0n){const w=await m({abi:yr,address:B,functionName:"approve",args:[F,0n]});await v.waitForTransactionReceipt({hash:w})}const g=await m({abi:yr,address:B,functionName:"approve",args:[F,ef]});await v.waitForTransactionReceipt({hash:g}),T!=null&&T.refetch&&await T.refetch()}catch(M){console.error("[useApprove] onApprove failed:",M)}},[r,n,u,p,E,T,m,v,h]);return{approve:S,onApprove:N}}const LS=({token:e,account:t,chainId:n,wagmiHooks:r,onResult:o})=>{var i;const s=(i=r==null?void 0:r.useBalance)==null?void 0:i.call(r,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(r!=null&&r.useBalance)}});return x.useEffect(()=>{o(mn(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},BS=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var E;const s=typeof t=="string"?Number.isFinite(Number(t))?Number(t):void 0:t,i=x.useMemo(()=>{const S="0x0000000000000000000000000000000000000000",N="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(M=>{const B=M.tokenAddress;if(!B)return!1;const F=B.toLowerCase();return!(B===S||F===N)})},[r]),[c,a]=x.useState({}),l=x.useCallback((S,N)=>{a(M=>({...M,[S]:N}))},[]),u=(E=o==null?void 0:o.useBalance)==null?void 0:E.call(o,{address:e,chainId:s,query:{enabled:!!e&&!!s&&!!(o!=null&&o.useBalance)}}),[f,p]=x.useState(0),d=x.useMemo(()=>i.map(S=>x.createElement(LS,{key:`${S.tokenAddress}-${f}`,token:S,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:l})),[i,e,s,n,o,l,f]),h=x.useMemo(()=>{const S=u!=null&&u.data?{value:u.data.value,formatted:u.data.formatted,decimals:u.data.decimals,symbol:u.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},N=i.map(B=>{const F=c[mn(B.tokenAddress)],b=F==null?void 0:F.balance,g=b==null?void 0:b.data;return{address:mn(B.tokenAddress),value:(g==null?void 0:g.value)||BigInt(0),formatted:(g==null?void 0:g.formatted)||"0",decimals:(g==null?void 0:g.decimals)||B.decimals}}).filter(B=>B.address),M=N.reduce((B,F)=>({...B,[F.address]:{balance:F}}),{});return{balanceList:N,baseTokenBalance:S,combinedData:M}},[u,c,i]),m=x.useCallback(async()=>h,[h]),v=x.useMemo(()=>{const S=(u==null?void 0:u.isLoading)||!1,N=Object.values(c).some(M=>{var B;return(B=M.balance)==null?void 0:B.isLoading});return S||N},[u==null?void 0:u.isLoading,c]),T=x.useCallback(()=>p(S=>S+1),[]);return{multicallRun:m,multicallRefresh:T,multicallResult:h,validErcTokens:i,isLoading:v,queryComponents:d}},FS=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,platformBalance:o,isLoading:s,wagmiHooks:i,onChainChange:c,onDeposit:a})=>{const{t:l}=wt(),u=i.useAccount(),f=t.tokenList.find(_=>_.token===n||_.symbol===n),p=t.chainId,[d,h]=x.useState("");x.useEffect(()=>{h("")},[n,t.chainId]);const{multicallResult:m,queryComponents:v}=BS({account:e,chainId:t.chainId,contractAddress:(f==null?void 0:f.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:i}),T=x.useMemo(()=>{var H;if(!f)return"0";if(!f.tokenAddress||f.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return m.baseTokenBalance.formatted;const _=m.combinedData[f.tokenAddress];return((H=_==null?void 0:_.balance)==null?void 0:H.formatted)||"0"},[f,m]),E="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",S="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",N=x.useMemo(()=>{var _,H;return l5({chain:p5,transport:d5(t.rpcUrl||((_=window==null?void 0:window.ENV)==null?void 0:_.CHAIN_RPC_URL_42161)||((H=window==null?void 0:window.ENV)==null?void 0:H.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),M="1000000000000",{formatted:B}=h5({client:N,tokenAddress:E,holder:S,decimals:6,fallbackFormatted:M,pollingInterval:12e3}),[F,b]=x.useState(!1),{approve:g,onApprove:w}=MS({account:e,accountChainId:u.chainId,targetChainId:+t.chainId,tokenInfo:f,amount:d,wagmiHooks:i}),$=x.useCallback(async()=>{if(!F)try{b(!0),await w()}catch(_){console.error("Approve failed:",_)}finally{b(!1)}},[F,w]),C=x.useMemo(()=>+u.chainId!=+t.chainId,[u.chainId,t.chainId]),O=x.useCallback(async()=>{c&&c(p)},[c,p]);x.useEffect(()=>{C&&O()},[C,O]);const{showLayerZeroTip:k,layerZeroTipKey:y}=x.useMemo(()=>{const _=+t.chainId==42161||+t.chainId==421614,H=(n==null?void 0:n.toUpperCase())==="USDT",Y=new Ie(d||"0"),G=new Ie("200000");let W=!1,Z;if(_&&H&&d)if(Y.gte(G))W=!0,Z="deposit.layerZeroDepositTipGte200k";else{const J=B;if(typeof J=="string"&&J.length>0){const fe=new Ie(J);!fe.isNaN()&&Y.gte(fe)&&(W=!0,Z="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:W,layerZeroTipKey:Z}},[t.chainId,n,d,B]),A=x.useCallback(()=>OS(+t.chainId,T||"0",n,r),[T,t==null?void 0:t.chainId,n,r]),I=x.useMemo(()=>r!=="spot"&&NS(+t.chainId,d,n),[r,t==null?void 0:t.chainId,d,n]),P=x.useMemo(()=>"deposit.maxDepositSplitTip",[]),L=DS({isNetworkMismatch:C,depositAmount:d,approved:g,currentTokenBalance:T,selectedToken:n,showLayerZeroTip:k,minDeposit:f!=null&&f.minDepositSize?parseFloat(f.minDepositSize):10}),j=_=>{const H=_.target.value,Y=A(),G=fi(H,Y);if(G.isValid)h(G.formattedValue),G.errorType;else return G.errorType==="exceed_balance",void 0},z=x.useCallback(async()=>{di(!0);try{a&&a({amount:d,chainId:p,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:n,accountType:r})}catch(_){console.error("Deposit error:",_),di(!1)}},[a,d,p,f==null?void 0:f.tokenAddress,r,n]);return D.jsxs(D.Fragment,{children:[v,D.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[D.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[D.jsx("input",{type:"text",placeholder:l("deposit.amount"),value:d,onChange:j,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),D.jsx("button",{onClick:()=>{const _=A();h(_)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:l("deposit.max")})]}),D.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),D.jsxs("div",{className:"flex justify-between items-center",children:[D.jsx(Qn,{content:l("deposit.availableDesc"),children:D.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:l("deposit.available")})}),D.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:$S(T||"0",d,n)})]})]}),!g&&AS(d||"0",0)&&D.jsxs("div",{className:"flex justify-center flex-col items-center",children:[D.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:l("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),D.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:l("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),D.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:$,disabled:F,children:F?D.jsx(Vo,{size:"xs",inline:!0}):l("deposit.enableWithToken",{token:n})})]}),k&&D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:l(y||"deposit.layerZeroDepositTip")})]}),D.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),I&&D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:l(P)})]}),I&&D.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:!(I||k)&&D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1 whitespace-pre-line",children:l("deposit.noPrivateKeyWalletWarning")})]}),D.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[D.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[D.jsx("span",{className:"text-sm text-text-tertiary",children:l("deposit.arrivalTime")}),D.jsx(Qn,{content:D.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[D.jsx("p",{children:l("deposit.arrivaltimeTooltip1",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60,v1:t==null?void 0:t.txConfirm})}),D.jsx("p",{children:l("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:D.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed text-sm",children:l("deposit.arrivalEstimated",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60})})})]}),D.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[D.jsx("span",{className:"text-sm text-text-tertiary",children:l("deposit.equity")}),D.jsx("span",{className:"text-sm text-text-primary font-medium",children:d?D.jsxs("span",{className:"flex items-center gap-1",children:[kt(o),D.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),kt((parseFloat(o)+parseFloat(d)).toString())," ",n]}):`${kt(o)} ${n}`})]})]}),D.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${L.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:z,disabled:L.disabled||s,children:[(s||C)&&D.jsx(Vo,{size:"xs"}),L.text]})]})},hm=e=>e.toLocaleUpperCase()===xn?xn:sc,El=e=>hm(e.wallet)===xn,RS=e=>hm(e.wallet)===sc,mm=({isOpen:e,isLoading:t=!1,onClose:n,currentActiveAccount:r,chains:o,spotChains:s=[],defaultChainId:i,defaultSymbol:c,defaultAccountType:a="perpetual",balances:l,wagmiHooks:u,onDeposit:f,onCopy:p,onChainChange:d,onTokenChange:h})=>{const{t:m}=wt(),[v,T]=x.useState(a),E=x.useCallback(j=>j==="spot"&&s&&s.length>0?s:o,[o,s]),S=E(a),N=()=>{var W;if(!S||S.length===0)return{chainId:1,token:""};const j=i||((W=S[0])==null?void 0:W.chainId),z=S.find(Z=>Z.chainId===j)||S[0],_=(z==null?void 0:z.tokenList)||[],H=(c||"").toUpperCase();if(H&&_.length>0){const Z=_.find(J=>(J.token||J.symbol||"").toUpperCase()===H);if(Z)return{chainId:z.chainId,token:Z.token||Z.symbol||""}}if(H)for(const Z of S){const ee=((Z==null?void 0:Z.tokenList)||[]).find(fe=>(fe.token||fe.symbol||"").toUpperCase()===H);if(ee)return{chainId:Z.chainId,token:ee.token||ee.symbol||""}}const Y=_.length>0?z:S.find(Z=>(Z.tokenList||[]).length>0)||z,G=((Y==null?void 0:Y.tokenList)||[])[0];return{chainId:(Y==null?void 0:Y.chainId)||z.chainId||1,token:(G==null?void 0:G.token)||(G==null?void 0:G.symbol)||""}},[{chainId:M,token:B}]=x.useState(()=>N()),[F,b]=x.useState(M),g=x.useMemo(()=>E(v),[v,E]),w=g.find(j=>j.chainId===F)||g[0],[$,C]=x.useState(B),O=x.useCallback(j=>{b(j),d==null||d(j)},[d]),k=x.useCallback(j=>{C(j),h==null||h(j)},[h]),y=x.useMemo(()=>{const j=($||"").toLowerCase();if(!j)return"0";const z=v==="spot"?l==null?void 0:l.spot:l==null?void 0:l.perpetual,_=z==null?void 0:z[j];return typeof _=="string"&&_.length>0?_:"0"},[l,v,$]),[A,I]=x.useState(!1),P=j=>{j.target===j.currentTarget?I(!0):I(!1)},L=j=>{A&&j.target===j.currentTarget&&n(),I(!1)};return e?je.createPortal(D.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:D.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:P,onMouseUp:L,"aria-hidden":"true",children:D.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl border-[2px] border-solid border-line-divider-secondary",onClick:j=>{j.stopPropagation()},children:[D.jsxs("div",{className:"flex items-center justify-between mb-4",children:[D.jsx("h2",{className:"text-lg font-semibold text-white",children:m("deposit.title")}),D.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:D.jsx(u0,{className:"h-4 w-4"})})]}),D.jsx(Sh,{selectedAccount:v,onAccountChange:j=>{var ee,fe;const z=j||"perpetual";T(z);const _=E(z);if(!_||_.length===0)return;const H=_.find(pe=>pe.chainId===F),Y=H?H.chainId:_[0].chainId;b(Y),d==null||d(Y);const G=_.find(pe=>pe.chainId===Y),W=(G==null?void 0:G.tokenList)||[],J=W.some(pe=>(pe.symbol||pe.token)===$)?$:((ee=W[0])==null?void 0:ee.symbol)||((fe=W[0])==null?void 0:fe.token)||"";J&&(C(J),h==null||h(J))},className:"w-full"}),D.jsx(Eh,{currentActiveChain:w,chainList:g,onChainChange:O,curSelectToken:$,onTokenChange:k,walletType:El(r)?xn:sc,accountType:v}),El(r)&&D.jsx(TS,{address:r.smartWalletAddress,currentActiveChain:w,selectedToken:$,accountType:v,onDeposit:f,onCopy:p,onClose:n}),RS(r)&&D.jsx(FS,{address:r.ethAddress,currentActiveChain:w,selectedToken:$,accountType:v,platformBalance:y,isLoading:t,wagmiHooks:u,onChainChange:O,onDeposit:f,onClose:n})]})})}),document.body):null},jS=({withdrawAmount:e,curSelectToken:t,tokenInfo:n,currentActiveChain:r,platformBalance:o="0",fee:s="0.00",walletType:i="evm",receiverAddress:c="",accountType:a="perpetual",onWithdrawAmountChange:l,onReceiverAddressChange:u,onAmountChanged:f,showPoolBalanceInsufficientTip:p=!1})=>{const{t:d}=wt(),h=x.useMemo(()=>{if(a==="spot"||!un(r==null?void 0:r.chainId)){const B=new Ie(e||"0").minus(s||"0");if(B.isNegative()||B.isZero())return"0";const F=Math.min(B.decimalPlaces()??0,18);return B.decimalPlaces(F,Ie.ROUND_DOWN).toString()}return e||"0"},[e,s,r==null?void 0:r.chainId,a]),m=x.useMemo(()=>o||"0",[o]),v=x.useMemo(()=>{const B=(n==null?void 0:n.feeRate)||(n==null?void 0:n.withdrawFeeRate)||(r==null?void 0:r.feeRate)||0;try{return new Ie(B||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,n==null?void 0:n.withdrawFeeRate,r==null?void 0:r.feeRate]),T=x.useMemo(()=>v==="0",[v]),E=x.useMemo(()=>{const B=(t||"").toUpperCase();return B==="USDT"||B==="USDC"},[t]),S=B=>{const F=B.target.value,g=fi(F,m||"0");if(g.isValid)l(g.formattedValue),g.errorType;else return g.errorType==="exceed_balance",void 0;f==null||f(g.formattedValue)},N=()=>{const B=m||"0",b=fi(B,B).formattedValue;l(b),f==null||f(b)},M=()=>{const B=parseFloat(o||"0"),F=parseFloat(e||"0");if(F>0){const b=B-F,g=kt(Math.max(0,b).toString());return D.jsxs("span",{className:"flex items-center gap-1",children:[kt(o||"0"),D.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),g," ",t]})}return`${kt(o||"0")} ${t}`};return D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[D.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[D.jsx("input",{type:"text",placeholder:d("deposit.amount"),value:e,onChange:S,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),D.jsx("button",{onClick:N,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:d("deposit.max")})]}),D.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),D.jsxs("div",{className:"flex justify-between items-center",children:[D.jsx(Qn,{content:d("withdraw.availableDesc"),children:D.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:d("deposit.available")})}),D.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:M()})]})]}),i==="mpc"&&(a==="spot"||!un(r==null?void 0:r.chainId))?D.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:D.jsx("input",{type:"text",placeholder:d("withdraw.receiverAddress"),value:c,onChange:B=>u==null?void 0:u(B.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}):null,a!=="spot"&&D.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:un(r==null?void 0:r.chainId)?D.jsxs(D.Fragment,{children:[D.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.noticeDesc")}),D.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:d("withdraw.commonWithdraw")})]}):D.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.crossChainTips")})}),p&&D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d("withdraw.poolBalanceInsufficientTip")})]}),D.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[D.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[D.jsx(Qn,{content:D.jsxs("div",{children:[D.jsx("div",{children:d("withdraw.speedNote")}),D.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[D.jsx(zo,{selectedLevel:It.FAST,maxLevel:3}),D.jsx("span",{children:d("withdraw.speedNoteSpeed1")})]}),D.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[D.jsx(zo,{selectedLevel:It.Medium,maxLevel:3}),D.jsx("span",{children:d("withdraw.speedNoteSpeed2")})]}),D.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[D.jsx(zo,{selectedLevel:It.SLOW,maxLevel:3}),D.jsx("span",{children:d("withdraw.speedNoteSpeed3")})]})]}),children:D.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:d("withdraw.speed")})}),D.jsx("div",{className:"flex items-center",children:D.jsx(zo,{selectedLevel:un(r==null?void 0:r.chainId)?It.SLOW:It.FAST,maxLevel:3})})]}),(a==="spot"||!un(r==null?void 0:r.chainId))&&D.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[T||!E?D.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:T?d("withdraw.fee"):`${d("withdraw.fee")}/${d("withdraw.feeRate")}`}):D.jsx(Qn,{className:"w-[320px] font-normal flex items-center justify-center",content:D.jsx("span",{className:"flex items-center justify-center text-center",children:d("withdraw.feeCalculationTip")}),children:D.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:`${d("withdraw.fee")}/${d("withdraw.feeRate")}`})}),D.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t,!T&&` / ${v}%`]})]}),D.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[D.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:d(un(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),D.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[kt(h)," ",t]})]})]})]})},_S=[];let Ye=null;const bm=x.forwardRef((e,t)=>{const[n,r]=x.useState(!1),[o,s]=x.useState(!1),[i,c]=x.useState({chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),a=x.useCallback(h=>{c(h||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),r(!0)},[]),l=x.useCallback(h=>{c(m=>({...m,...h}))},[]),u=x.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=x.useCallback(h=>{s(h)},[]),p=x.useCallback(()=>n,[n]),d=x.useCallback(()=>o,[o]);return x.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:p,isLoading:d}),[a,u,l,f,p,d]),x.useEffect(()=>(Ye={openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:p,isLoading:d},()=>{Ye=null}),[a,u,l,f,p,d]),n?D.jsx(xm,{isOpen:n,isLoading:o,onClose:u,config:i.config||{symbol:"USDT"},currentActiveAccount:i.currentActiveAccount,chains:i.chains||_S,spotChains:i.spotChains,balances:i.balances,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAmount:i.defaultAmount,defaultAccountType:i.defaultAccountType,currentEquity:i.currentEquity??5e3,platformBalance:i.platformBalance||"0",fee:i.fee,wagmiHooks:i.wagmiHooks,onWithdraw:i.onWithdraw,onAccountChange:i.onAccountChange,onChainChange:i.onChainChange,onTokenChange:i.onTokenChange,onAmountChanged:i.onAmountChanged}):null});bm.displayName="WithdrawManager";const gm=e=>{if(!Ye){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ye.openWithdraw(e||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}})},ym=()=>{if(!Ye){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ye.closeWithdraw()},vm=e=>{if(!Ye){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ye.updateWithdrawOptions(e)},pi=e=>{if(!Ye){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ye.setWithdrawLoading(e)},zS=()=>Ye?Ye.isOpen():!1,wm=()=>Ye?Ye.isLoading():!1,US=()=>({openWithdraw:gm,closeWithdraw:ym,updateWithdrawOptions:vm,setWithdrawLoading:pi,isOpen:zS,isLoading:wm}),WS=({walletType:e,chains:t,spotChains:n=[],defaultChainId:r,defaultSymbol:o,defaultAmount:s="",defaultAccountType:i="perpetual",currentEquity:c,platformBalance:a="0",balances:l,fee:u="0.00",isLoading:f=!1,onWithdraw:p,onClose:d,onChainChange:h,onTokenChange:m,onAmountChanged:v,onAccountChange:T})=>{var W;const{t:E}=wt(),[S,N]=x.useState(i),M=x.useCallback(Z=>Z==="spot"&&n&&n.length>0?n:t,[t,n]),B=x.useMemo(()=>M(S),[S,M]),F=x.useMemo(()=>{if(!B||B.length===0)return{chainId:1,tokenSymbol:""};const Z=he=>{const se=he||[];if(!se.length)return"";const te="USDC".toUpperCase(),Nn=se.find(gt=>(gt.token||gt.symbol||"").toUpperCase()===te)||se[0];return Nn.token||Nn.symbol||""};if(o){const he=o==null?void 0:o.toUpperCase();for(const se of B){const me=se.tokenList||[];let te;if(he&&(te=me.find(Se=>(Se.token||Se.symbol||"").toUpperCase()===he)),te){const Se=te.token||te.symbol||o||"";return{chainId:se.chainId,tokenSymbol:Se}}}}if(r){const he=B.find(te=>te.chainId===r)||B[0],se=he.tokenList||[],me=Z(se);return{chainId:he.chainId,tokenSymbol:me}}const J="USDC",ee=he=>Array.isArray(he.tokenList)&&he.tokenList.some(se=>(se.token||se.symbol||"").toUpperCase()===J),fe=B.find(ee)||B[0];if(!fe)return{chainId:1,tokenSymbol:""};const pe=Z(fe.tokenList);return{chainId:fe.chainId,tokenSymbol:pe}},[B,r,o]),[b,g]=x.useState(()=>F.chainId),[w,$]=x.useState(()=>F.tokenSymbol),[C,O]=x.useState(s),[k,y]=x.useState(""),A=x.useCallback(Z=>{g(Z),h==null||h(Z)},[h]),I=x.useCallback(Z=>{$(Z),m==null||m(Z)},[m]),P=x.useRef(!0),L=x.useRef(w),j=x.useRef(b);x.useEffect(()=>{if(P.current){P.current=!1,L.current=w,j.current=b;return}(L.current!==w||j.current!==b)&&(O(""),L.current=w,j.current=b)},[w,b]);const z=B&&B.length>0?B.find(Z=>Z.chainId===b)||B[0]:null,_=(W=z==null?void 0:z.tokenList)==null?void 0:W.find(Z=>Z.token===w),H=x.useMemo(()=>{const Z=new Ie(C||"0"),J=new Ie(u||"0"),ee=un(b);return _!=null&&_.minWithdrawSize&&Z.lt(_.minWithdrawSize)?{text:E("withdraw.minWithdrawParsed",{amount:_.minWithdrawSize,token:_.symbol||_.token}),disabled:!0}:!C||Z.isZero()||!ee&&Z.isLessThan(J)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:e==="mpc"&&(!ee||S==="spot")&&!k.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,b,C,e,k,u,S,_]),Y=x.useMemo(()=>{const Z=(w||"").toLowerCase();if(!Z)return a||"0";const J=S==="spot"?l==null?void 0:l.spot:l==null?void 0:l.perpetual,ee=J==null?void 0:J[Z];return typeof ee=="string"&&ee.length>0?ee:a||"0"},[l,S,w,a]),G=x.useCallback(async()=>{pi(!0);try{if(p){const J={amount:new Ie(C||"0").toString(),chainId:b,tokenAddress:(_==null?void 0:_.tokenAddress)||"",coinId:(_==null?void 0:_.coinId)||"",tokenSymbol:w,accountType:S,selectedToken:_};e==="mpc"&&(!un(b)||S==="spot")&&(J.receiverAddress=k),p(J)}}catch{pi(!1)}},[p,S,_,C,b,w,e,k]);return!B||B.length===0?D.jsx("div",{className:"text-center py-8",children:D.jsx("p",{className:"text-gray-400",children:"No chains available"})}):z?D.jsxs(D.Fragment,{children:[D.jsx(Sh,{selectedAccount:S,onAccountChange:Z=>{var Se,Nn;const J=Z||"perpetual";N(J),T==null||T(J);const ee=M(J);if(!ee||ee.length===0)return;const fe=ee.find(gt=>gt.chainId===b),pe=fe?fe.chainId:ee[0].chainId;g(pe),h==null||h(pe);const he=ee.find(gt=>gt.chainId===pe),se=(he==null?void 0:he.tokenList)||[],te=se.some(gt=>(gt.symbol||gt.token)===w)?w:((Se=se[0])==null?void 0:Se.symbol)||((Nn=se[0])==null?void 0:Nn.token)||"";te&&($(te),m==null||m(te))},className:"w-full"}),D.jsx(Eh,{currentActiveChain:z,chainList:B,onChainChange:A,curSelectToken:w,onTokenChange:I,walletType:"EVM",txType:"withdraw"}),D.jsx(jS,{withdrawAmount:C,curSelectToken:w,tokenInfo:_,curSelectTokenData:{balance:_==null?void 0:_.balance,allowance:_==null?void 0:_.allowance},currentActiveChain:z,currentEquity:c||0,decimals:(_==null?void 0:_.decimals)||6,platformBalance:Y,fee:u,walletType:e,accountType:S,receiverAddress:k,onWithdrawAmountChange:O,onReceiverAddressChange:y,onAmountChanged:v}),D.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${H.disabled||f?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:G,disabled:H.disabled||f,children:[f&&D.jsx(Vo,{size:"xs"}),H.text]})]}):D.jsx("div",{className:"text-center py-8",children:D.jsx("p",{className:"text-gray-400",children:"Loading..."})})},xm=({isOpen:e,isLoading:t=!1,defaultAccountType:n="perpetual",onClose:r,config:o,currentActiveAccount:s,chains:i,spotChains:c=[],defaultChainId:a,defaultSymbol:l,defaultAmount:u="",currentEquity:f=5e3,platformBalance:p="0",balances:d,fee:h,wagmiHooks:m,onWithdraw:v,onChainChange:T,onTokenChange:E,onAmountChanged:S,onAccountChange:N})=>{const{t:M}=wt(),[B,F]=x.useState(!1),b=w=>{w.target===w.currentTarget?F(!0):F(!1)},g=w=>{B&&w.target===w.currentTarget&&r(),F(!1)};return e?je.createPortal(D.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:D.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:b,onMouseUp:g,"aria-hidden":"true",children:D.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:w=>{w.stopPropagation()},children:[D.jsxs("div",{className:"flex items-center justify-between mb-4",children:[D.jsx("h2",{className:"text-lg font-semibold text-white",children:M("withdraw.withdraw")}),D.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:D.jsx(u0,{className:"h-4 w-4"})})]}),D.jsx(WS,{chains:i,spotChains:c,walletType:El(s)?"mpc":"evm",defaultChainId:a,defaultSymbol:l,defaultAmount:u,defaultAccountType:n,currentEquity:f,platformBalance:p,balances:d,fee:h,isLoading:t,wagmiHooks:m,onWithdraw:v,onClose:r,onChainChange:T,onTokenChange:E,onAmountChanged:S,onAccountChange:N})]})})}),document.body):null};oe.ChromeLoader=Vo,oe.ComponentProvider=Ym,oe.DEFAULT_LOCALE=qo,oe.Deposit=mm,oe.DepositManager=lm,oe.LOCALE_NAMES=qm,oe.LoadingSpinner=Vo,oe.SUPPORTED_LOCALES=bi,oe.Tooltip=Qn,oe.Withdraw=xm,oe.WithdrawManager=bm,oe.closeDeposit=fm,oe.closeWithdraw=ym,oe.formatThousands=Qm,oe.isDepositLoading=pm,oe.isWithdrawLoading=wm,oe.openDeposit=um,oe.openWithdraw=gm,oe.setDepositLoading=di,oe.setWithdrawLoading=pi,oe.updateDepositOptions=dm,oe.updateWithdrawOptions=vm,oe.useComponentConfig=Ll,oe.useDeposit=m5,oe.useDepositManager=kS,oe.useTranslation=wt,oe.useWithdraw=b5,oe.useWithdrawManager=US,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
185
+ `,children:[t,o&&M.jsx(pm,{ref:f,placement:h.placement||n})]})})]})},Qo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",LS=({currentActiveChain:e,selectedToken:t,address:n,accountType:r,onDeposit:o,onCopy:s,onClose:i})=>{const{t:c}=Et(),a=r===$5,l=E.useMemo(()=>{if(!e)return!1;const h=Number(e.chainId);return!Number.isNaN(h)&&(h===42161||h===421614)},[e]),u=a,f=E.useMemo(()=>{var h;return(h=e==null?void 0:e.tokenList)==null?void 0:h.find(b=>b.token===t||b.symbol===t)},[e,t]),d=E.useMemo(()=>{const h=(t||"").toUpperCase();if(!u&&h==="USDC")return c("deposit.defaultSpotToPerpNotice",{coin:t,v:e==null?void 0:e.chain});const P=c(u?"deposit.crossChainDepositFeeTip":"deposit.depositAllTip",{coin:t,v:e==null?void 0:e.chain});return u&&(!l||h==="USDC")?String(P).split(`
186
+ `)[0]:P},[c,t,e==null?void 0:e.chain,u,l]),p=(f==null?void 0:f.minDepositSize)||"10";return M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&M.jsx("div",{className:"bg-white rounded-lg",children:M.jsx(Kh,{value:n,size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&M.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[M.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:n}),M.jsx(R3,{onCopy:()=>{s&&s(n)},text:n,children:M.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[M.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),M.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),M.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[M.jsxs("div",{className:"flex items-start",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Qo,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1",children:M.jsx("p",{className:"text-xs text-functional-orange-1",children:d})})]}),r===b0&&M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),M.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:c("deposit.addressUpdatedNotice")})]})]}),M.jsxs("div",{className:"text-sm",children:[(a||t.toUpperCase()!=="USDC")&&M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[M.jsx("span",{className:"text-text-tertiary",children:c("deposit.arrivalTime")}),M.jsx(nr,{content:M.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[M.jsx("p",{children:c("deposit.arrivaltimeTooltip1",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60,v1:e==null?void 0:e.txConfirm})}),M.jsx("p",{children:c("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:M.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:c("deposit.arrivalEstimated",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60})})})]}),M.jsxs("div",{className:`flex justify-between items-center h-[18px] ${a||t.toUpperCase()!=="USDC"?"mt-1":"mt-4"}`,children:[M.jsx("span",{className:"text-text-tertiary",children:c("deposit.minDeposit")}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:[p," ",t]})]}),r===b0&&t.toUpperCase()!=="USDC"&&M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[M.jsx("span",{className:"text-text-tertiary",children:c("deposit.maxDeposit")}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]}),M.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{o&&o({amount:"",chainId:e.chainId,tokenAddress:n,tokenSymbol:t}),i()},children:c("deposit.title")})]})},Jo=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return M.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},BS=(e,t)=>Number(e)>Number(t),kt=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let s=r[1]||"";return s.length>6&&(s=s.substring(0,6)),s=s.replace(/0+$/,""),s?(s.length===1&&(s+="0"),o+"."+s):o+".00"},es=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const a=o[0]+"."+o[1].substring(0,6);return es(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:kt(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},FS=(e,t,n)=>{const r=parseFloat(String(e)||"0"),o=parseFloat(String(t)||"0");if(o>0){const s=r-o,i=kt(Math.max(0,s).toString());return M.jsxs("span",{className:"flex items-center gap-1",children:[kt(e),M.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${kt(e)} ${n}`},RS=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},jS=(e,t,n)=>{if(!Nh(e,n))return!1;try{const r=new $e(t||"0"),o=new $e("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},_S=(e,t,n,r)=>{let o=t||"0";if(!(r==="spot")&&Nh(e,n))try{const i=new $e(o),c=new $e("200000");i.gt(c)&&(o="200000")}catch(i){console.warn("Error calculating max amount limit:",i)}try{const i=new $e(o||"0");return console.log("bn:",i),console.log("bn:",i.isNaN()),i.isNaN()?o:i.decimalPlaces(6,$e.ROUND_DOWN).toString()}catch{return o}},hm={chains:[],spotChains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""},defaultChainId:1,defaultAccountType:"perpetual",balances:{spot:{},perpetual:{}}};let Xe=null;const mm=E.forwardRef((e,t)=>{const[n,r]=E.useState(!1),[o,s]=E.useState(!1),[i,c]=E.useState(hm),a=E.useCallback(h=>{c(h),r(!0)},[]),l=E.useCallback(h=>{c(b=>({...b,...h}))},[]),u=E.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=E.useCallback(h=>{s(h)},[]),d=E.useCallback(()=>n,[n]),p=E.useCallback(()=>o,[o]);return E.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:d,isLoading:p}),[a,u,l,f,d,p]),E.useEffect(()=>(Xe={openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:d,isLoading:p},()=>{Xe=null}),[a,u,l,f,d,p]),n?M.jsx(Em,{isOpen:n,isLoading:o,onClose:u,currentActiveAccount:i.currentActiveAccount,chains:i.chains,spotChains:i.spotChains,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAccountType:i.defaultAccountType,balances:i.balances,wagmiHooks:i.wagmiHooks,onDeposit:i.onDeposit,onCopy:i.onCopy,onChainChange:h=>{var b;return(b=i.onChainChange)==null?void 0:b.call(i,h)},onTokenChange:h=>{var b;return(b=i.onTokenChange)==null?void 0:b.call(i,h)}}):null});mm.displayName="DepositManager";const bm=e=>{if(!Xe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Xe.openDeposit(e||hm)},gm=()=>{if(!Xe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Xe.closeDeposit()},ym=e=>{Xe&&Xe.updateDepositOptions(e)},Ei=e=>{if(!Xe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Xe.setDepositLoading(e)},zS=()=>Xe?Xe.isOpen():!1,vm=()=>Xe?Xe.isLoading():!1,US=()=>({openDeposit:bm,closeDeposit:gm,updateDepositOptions:ym,setDepositLoading:Ei,isOpen:zS,isLoading:vm}),WS=e=>{const{t}=Et(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:c,minDeposit:a=10}=e;return E.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const l=parseFloat(r||"0"),u=a,f=RS(r,s||"0",o);return!r||l===0||!o?{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:l<u?{text:t("deposit.minDepositParsed",{amount:u,token:i}),disabled:!0,isNetworkSwitch:!1}:{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!f,isNetworkSwitch:!1}},[n,r,o,s,i,c,a,t])};function HS(e){const{account:t,accountChainId:n,targetChainId:r,tokenInfo:o,amount:s}=e,{useReadContract:i,useWriteContract:c,usePublicClient:a,useSwitchChain:l}=e.wagmiHooks,u=o==null?void 0:o.tokenAddress,f=(o==null?void 0:o.decimals)??18,d=o==null?void 0:o.contractAddress,p=!u||u.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",{switchChainAsync:h}=l(),{writeContractAsync:b}=c(),S=a(),P=i({address:u,abi:Er,functionName:"allowance",args:[Qt(t||""),d],chainId:r,query:{enabled:!!(!p&&t&&r&&u&&d)}}),x=P!=null&&P.isSuccess?P.data:void 0,w=E.useMemo(()=>{if(p)return!0;if(!P.isSuccess||x===void 0||x===0n)return!1;try{const k=k6(String(Number(s||"0")||0),Number(f));return x>=k}catch{return!1}},[p,P.isSuccess,x,s,f]),$=E.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!b||!S||!u||!d)return;const B=Qt(u),F=Qt(d);if((x||0n)>0n){const v=await b({abi:Er,address:B,functionName:"approve",args:[F,0n]});await S.waitForTransactionReceipt({hash:v})}const g=await b({abi:Er,address:B,functionName:"approve",args:[F,uf]});await S.waitForTransactionReceipt({hash:g}),P!=null&&P.refetch&&await P.refetch()}catch(k){console.error("[useApprove] onApprove failed:",k)}},[r,n,u,d,x,P,b,S,h]);return{approve:w,onApprove:$}}const VS=({token:e,account:t,chainId:n,wagmiHooks:r,onResult:o})=>{var i;const s=(i=r==null?void 0:r.useBalance)==null?void 0:i.call(r,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(r!=null&&r.useBalance)}});return E.useEffect(()=>{o(Qt(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},GS=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var x;const s=typeof t=="string"?Number.isFinite(Number(t))?Number(t):void 0:t,i=E.useMemo(()=>{const w="0x0000000000000000000000000000000000000000",$="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(k=>{const B=k.tokenAddress;if(!B)return!1;const F=B.toLowerCase();return!(B===w||F===$)})},[r]),[c,a]=E.useState({}),l=E.useCallback((w,$)=>{a(k=>({...k,[w]:$}))},[]),u=(x=o==null?void 0:o.useBalance)==null?void 0:x.call(o,{address:e,chainId:s,query:{enabled:!!e&&!!s&&!!(o!=null&&o.useBalance)}}),[f,d]=E.useState(0),p=E.useMemo(()=>i.map(w=>E.createElement(VS,{key:`${w.tokenAddress}-${f}`,token:w,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:l})),[i,e,s,n,o,l,f]),h=E.useMemo(()=>{const w=u!=null&&u.data?{value:u.data.value,formatted:u.data.formatted,decimals:u.data.decimals,symbol:u.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},$=i.map(B=>{const F=c[Qt(B.tokenAddress)],m=F==null?void 0:F.balance,g=m==null?void 0:m.data;return{address:Qt(B.tokenAddress),value:(g==null?void 0:g.value)||BigInt(0),formatted:(g==null?void 0:g.formatted)||"0",decimals:(g==null?void 0:g.decimals)||B.decimals}}).filter(B=>B.address),k=$.reduce((B,F)=>({...B,[F.address]:{balance:F}}),{});return{balanceList:$,baseTokenBalance:w,combinedData:k}},[u,c,i]),b=E.useCallback(async()=>h,[h]),S=E.useMemo(()=>{const w=(u==null?void 0:u.isLoading)||!1,$=Object.values(c).some(k=>{var B;return(B=k.balance)==null?void 0:B.isLoading});return w||$},[u==null?void 0:u.isLoading,c]),P=E.useCallback(()=>d(w=>w+1),[]);return{multicallRun:b,multicallRefresh:P,multicallResult:h,validErcTokens:i,isLoading:S,queryComponents:p}},wm=6,qS=(e,t=wm)=>{const n=Number(e);return!Number.isFinite(n)||n<0?t:Math.floor(n)},ZS=e=>{if(e==null||e==="")return null;try{const t=new $e(e);return!t.isFinite()||t.isNaN()||t.lte(0)?null:t.decimalPlaces()??0}catch{return null}},Si=(e,t)=>{if(!e)return e;const n=Math.max(0,Math.floor(t));if(e===".")return n===0?"0":"0.";if((e.match(/\./g)||[]).length!==1)return e;const[o,s=""]=e.split(".");return n===0?o:s.length<=n?e:`${o}.${s.slice(0,n)}`},KS=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,platformBalance:o,isLoading:s,wagmiHooks:i,onChainChange:c,onDeposit:a})=>{const{t:l}=Et(),u=i.useAccount(),f=t.tokenList.find(W=>W.token===n||W.symbol===n),d=t.chainId,[p,h]=E.useState("");E.useEffect(()=>{h("")},[n,t.chainId]);const{multicallResult:b,queryComponents:S}=GS({account:e,chainId:t.chainId,contractAddress:(f==null?void 0:f.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:i}),P=E.useMemo(()=>{var K;if(!f)return"0";if(!f.tokenAddress||f.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return b.baseTokenBalance.formatted;const W=b.combinedData[f.tokenAddress];return((K=W==null?void 0:W.balance)==null?void 0:K.formatted)||"0"},[f,b]),x="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",w="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",$=E.useMemo(()=>{var W,K;return y5({chain:E5,transport:x5(t.rpcUrl||((W=window==null?void 0:window.ENV)==null?void 0:W.CHAIN_RPC_URL_42161)||((K=window==null?void 0:window.ENV)==null?void 0:K.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),k="1000000000000",{formatted:B}=S5({client:$,tokenAddress:x,holder:w,decimals:6,fallbackFormatted:k,pollingInterval:12e3}),[F,m]=E.useState(!1),{approve:g,onApprove:v}=HS({account:e,accountChainId:u.chainId,targetChainId:+t.chainId,tokenInfo:f,amount:p,wagmiHooks:i}),A=E.useCallback(async()=>{if(!F)try{m(!0),await v()}catch(W){console.error("Approve failed:",W)}finally{m(!1)}},[F,v]),N=E.useMemo(()=>+u.chainId!=+t.chainId,[u.chainId,t.chainId]),O=E.useCallback(async()=>{c&&c(d)},[c,d]);E.useEffect(()=>{N&&O()},[N,O]);const{showLayerZeroTip:D,layerZeroTipKey:y}=E.useMemo(()=>{const W=+t.chainId==42161||+t.chainId==421614,K=(n==null?void 0:n.toUpperCase())==="USDT",G=new $e(p||"0"),H=new $e("200000");let q=!1,Q;if(W&&K&&p)if(G.gte(H))q=!0,Q="deposit.layerZeroDepositTipGte200k";else{const ee=B;if(typeof ee=="string"&&ee.length>0){const le=new $e(ee);!le.isNaN()&&G.gte(le)&&(q=!0,Q="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:q,layerZeroTipKey:Q}},[t.chainId,n,p,B]),C=E.useCallback(()=>_S(+t.chainId,P||"0",n,r),[P,t==null?void 0:t.chainId,n,r]),I=E.useMemo(()=>{const W=qS(f==null?void 0:f.decimals,wm),K=ZS((f==null?void 0:f.stepSize)??(f==null?void 0:f.stepsize));return K===null?W:Math.min(W,K)},[f==null?void 0:f.decimals,f==null?void 0:f.stepSize,f==null?void 0:f.stepsize]),T=E.useMemo(()=>r!=="spot"&&jS(+t.chainId,p,n),[r,t==null?void 0:t.chainId,p,n]),L=E.useMemo(()=>"deposit.maxDepositSplitTip",[]),j=WS({isNetworkMismatch:N,depositAmount:p,approved:g,currentTokenBalance:P,selectedToken:n,showLayerZeroTip:D,minDeposit:f!=null&&f.minDepositSize?parseFloat(f.minDepositSize):10}),z=W=>{const K=W.target.value,G=Si(K,I),H=C(),q=es(G,H);if(q.isValid){const Q=Si(q.formattedValue,I);h(Q),q.errorType}else return q.errorType==="exceed_balance",void 0},_=E.useCallback(async()=>{Ei(!0);try{a&&a({amount:p,chainId:d,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:n,accountType:r})}catch(W){console.error("Deposit error:",W),Ei(!1)}},[a,p,d,f==null?void 0:f.tokenAddress,r,n]);return M.jsxs(M.Fragment,{children:[S,M.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[M.jsx("input",{type:"text",placeholder:l("deposit.amount"),value:p,onChange:z,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),M.jsx("button",{onClick:()=>{const W=C(),K=Si(W,I),G=es(K,W);h(Si(G.formattedValue,I))},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:l("deposit.max")})]}),M.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),M.jsxs("div",{className:"flex justify-between items-center",children:[M.jsx(nr,{content:l("deposit.availableDesc"),children:M.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:l("deposit.available")})}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:FS(P||"0",p,n)})]})]}),!g&&BS(p||"0",0)&&M.jsxs("div",{className:"flex justify-center flex-col items-center",children:[M.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:l("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),M.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:l("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),M.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:A,disabled:F,children:F?M.jsx(Jo,{size:"xs",inline:!0}):l("deposit.enableWithToken",{token:n})})]}),D&&M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Qo,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:l(y||"deposit.layerZeroDepositTip")})]}),M.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),T&&M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Qo,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:l(L)})]}),T&&M.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:!(T||D)&&M.jsx("img",{src:Qo,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1 whitespace-pre-line",children:l("deposit.noPrivateKeyWalletWarning")})]}),M.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[M.jsx("span",{className:"text-sm text-text-tertiary",children:l("deposit.arrivalTime")}),M.jsx(nr,{content:M.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[M.jsx("p",{children:l("deposit.arrivaltimeTooltip1",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60,v1:t==null?void 0:t.txConfirm})}),M.jsx("p",{children:l("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:M.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed text-sm",children:l("deposit.arrivalEstimated",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60})})})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[M.jsx("span",{className:"text-sm text-text-tertiary",children:l("deposit.equity")}),M.jsx("span",{className:"text-sm text-text-primary font-medium",children:p?M.jsxs("span",{className:"flex items-center gap-1",children:[kt(o),M.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),kt((parseFloat(o)+parseFloat(p)).toString())," ",n]}):`${kt(o)} ${n}`})]})]}),M.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${j.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:_,disabled:j.disabled||s,children:[(s||N)&&M.jsx(Jo,{size:"xs"}),j.text]})]})},xm=e=>e.toLocaleUpperCase()===Sn?Sn:bc,Il=e=>xm(e.wallet)===Sn,YS=e=>xm(e.wallet)===bc,Em=({isOpen:e,isLoading:t=!1,onClose:n,currentActiveAccount:r,chains:o,spotChains:s=[],defaultChainId:i,defaultSymbol:c,defaultAccountType:a="perpetual",balances:l,wagmiHooks:u,onDeposit:f,onCopy:d,onChainChange:p,onTokenChange:h})=>{const{t:b}=Et(),[S,P]=E.useState(a),x=E.useCallback(j=>j==="spot"&&s&&s.length>0?s:o,[o,s]),w=x(a),$=()=>{var H;if(!w||w.length===0)return{chainId:1,token:""};const j=i||((H=w[0])==null?void 0:H.chainId),z=w.find(q=>q.chainId===j)||w[0],_=(z==null?void 0:z.tokenList)||[],W=(c||"").toUpperCase();if(W&&_.length>0){const q=_.find(Q=>(Q.token||Q.symbol||"").toUpperCase()===W);if(q)return{chainId:z.chainId,token:q.token||q.symbol||""}}if(W)for(const q of w){const ee=((q==null?void 0:q.tokenList)||[]).find(pe=>(pe.token||pe.symbol||"").toUpperCase()===W);if(ee)return{chainId:q.chainId,token:ee.token||ee.symbol||""}}const K=_.length>0?z:w.find(q=>(q.tokenList||[]).length>0)||z,G=((K==null?void 0:K.tokenList)||[])[0];return{chainId:(K==null?void 0:K.chainId)||z.chainId||1,token:(G==null?void 0:G.token)||(G==null?void 0:G.symbol)||""}},[{chainId:k,token:B}]=E.useState(()=>$()),[F,m]=E.useState(k),g=E.useMemo(()=>x(S),[S,x]),v=g.find(j=>j.chainId===F)||g[0],[A,N]=E.useState(B),O=E.useCallback(j=>{m(j),p==null||p(j)},[p]),D=E.useCallback(j=>{N(j),h==null||h(j)},[h]),y=E.useMemo(()=>{const j=(A||"").toLowerCase();if(!j)return"0";const z=S==="spot"?l==null?void 0:l.spot:l==null?void 0:l.perpetual,_=z==null?void 0:z[j];return typeof _=="string"&&_.length>0?_:"0"},[l,S,A]),[C,I]=E.useState(!1),T=j=>{j.target===j.currentTarget?I(!0):I(!1)},L=j=>{C&&j.target===j.currentTarget&&n(),I(!1)};return e?je.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:T,onMouseUp:L,"aria-hidden":"true",children:M.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl border-[2px] border-solid border-line-divider-secondary",onClick:j=>{j.stopPropagation()},children:[M.jsxs("div",{className:"flex items-center justify-between mb-4",children:[M.jsx("h2",{className:"text-lg font-semibold text-white",children:b("deposit.title")}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:M.jsx(v0,{className:"h-4 w-4"})})]}),M.jsx(Oh,{selectedAccount:S,onAccountChange:j=>{var ee,pe;const z=j||"perpetual";P(z);const _=x(z);if(!_||_.length===0)return;const W=_.find(le=>le.chainId===F),K=W?W.chainId:_[0].chainId;m(K),p==null||p(K);const G=_.find(le=>le.chainId===K),H=(G==null?void 0:G.tokenList)||[],Q=H.some(le=>(le.symbol||le.token)===A)?A:((ee=H[0])==null?void 0:ee.symbol)||((pe=H[0])==null?void 0:pe.token)||"";Q&&(N(Q),h==null||h(Q))},className:"w-full"}),M.jsx(Ch,{currentActiveChain:v,chainList:g,onChainChange:O,curSelectToken:A,onTokenChange:D,walletType:Il(r)?Sn:bc,accountType:S}),Il(r)&&M.jsx(LS,{address:r.smartWalletAddress,currentActiveChain:v,selectedToken:A,accountType:S,onDeposit:f,onCopy:d,onClose:n}),YS(r)&&M.jsx(KS,{address:r.ethAddress,currentActiveChain:v,selectedToken:A,accountType:S,platformBalance:y,isLoading:t,wagmiHooks:u,onChainChange:O,onDeposit:f,onClose:n})]})})}),document.body):null},Dl=6,XS=(e,t=Dl)=>{const n=Number(e);return!Number.isFinite(n)||n<0?t:Math.floor(n)},QS=e=>{if(e==null||e==="")return null;try{const t=new $e(e);return!t.isFinite()||t.isNaN()||t.lte(0)?null:t.decimalPlaces()??0}catch{return null}},ts=(e,t)=>{if(!e)return e;const n=Math.max(0,Math.floor(t));if(e===".")return n===0?"0":"0.";if((e.match(/\./g)||[]).length!==1)return e;const[o,s=""]=e.split(".");return n===0?o:s.length<=n?e:`${o}.${s.slice(0,n)}`},JS=({withdrawAmount:e,curSelectToken:t,tokenInfo:n,currentActiveChain:r,platformBalance:o="0",fee:s="0.00",decimals:i=Dl,walletType:c="evm",receiverAddress:a="",accountType:l="perpetual",onWithdrawAmountChange:u,onReceiverAddressChange:f,onAmountChanged:d,showPoolBalanceInsufficientTip:p=!1})=>{const{t:h}=Et(),b=E.useMemo(()=>{const m=XS((n==null?void 0:n.decimals)??i,Dl),g=QS((n==null?void 0:n.stepSize)??(n==null?void 0:n.stepsize));return g===null?m:Math.min(m,g)},[i,n==null?void 0:n.decimals,n==null?void 0:n.stepSize,n==null?void 0:n.stepsize]),S=E.useMemo(()=>{if(l==="spot"||!dn(r==null?void 0:r.chainId)){const m=new $e(e||"0").minus(s||"0");if(m.isNegative()||m.isZero())return"0";const g=Math.min(m.decimalPlaces()??0,18);return m.decimalPlaces(g,$e.ROUND_DOWN).toString()}return e||"0"},[e,s,r==null?void 0:r.chainId,l]),P=E.useMemo(()=>o||"0",[o]),x=E.useMemo(()=>{const m=(n==null?void 0:n.feeRate)||(n==null?void 0:n.withdrawFeeRate)||(r==null?void 0:r.feeRate)||0;try{return new $e(m||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,n==null?void 0:n.withdrawFeeRate,r==null?void 0:r.feeRate]),w=E.useMemo(()=>x==="0",[x]),$=E.useMemo(()=>{const m=(t||"").toUpperCase();return m==="USDT"||m==="USDC"},[t]),k=m=>{const g=m.target.value,v=ts(g,b),N=es(v,P||"0");if(N.isValid){const O=ts(N.formattedValue,b);u(O),N.errorType}else return N.errorType==="exceed_balance",void 0;d==null||d(ts(N.formattedValue,b))},B=()=>{const m=P||"0",g=ts(m,b),v=es(g,m),A=ts(v.formattedValue,b);u(A),d==null||d(A)},F=()=>{const m=parseFloat(o||"0"),g=parseFloat(e||"0");if(g>0){const v=m-g,A=kt(Math.max(0,v).toString());return M.jsxs("span",{className:"flex items-center gap-1",children:[kt(o||"0"),M.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),A," ",t]})}return`${kt(o||"0")} ${t}`};return M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[M.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[M.jsx("input",{type:"text",placeholder:h("deposit.amount"),value:e,onChange:k,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),M.jsx("button",{onClick:B,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:h("deposit.max")})]}),M.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),M.jsxs("div",{className:"flex justify-between items-center",children:[M.jsx(nr,{content:h("withdraw.availableDesc"),children:M.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:h("deposit.available")})}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:F()})]})]}),c==="mpc"&&(l==="spot"||!dn(r==null?void 0:r.chainId))?M.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:M.jsx("input",{type:"text",placeholder:h("withdraw.receiverAddress"),value:a,onChange:m=>f==null?void 0:f(m.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}):null,l!=="spot"&&M.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:dn(r==null?void 0:r.chainId)?M.jsxs(M.Fragment,{children:[M.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:h("withdraw.noticeDesc")}),M.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:h("withdraw.commonWithdraw")})]}):M.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:h("withdraw.crossChainTips")})}),p&&M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:Qo,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:h("withdraw.poolBalanceInsufficientTip")})]}),M.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[M.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[M.jsx(nr,{content:M.jsxs("div",{children:[M.jsx("div",{children:h("withdraw.speedNote")}),M.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[M.jsx(Ko,{selectedLevel:Mt.FAST,maxLevel:3}),M.jsx("span",{children:h("withdraw.speedNoteSpeed1")})]}),M.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[M.jsx(Ko,{selectedLevel:Mt.Medium,maxLevel:3}),M.jsx("span",{children:h("withdraw.speedNoteSpeed2")})]}),M.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[M.jsx(Ko,{selectedLevel:Mt.SLOW,maxLevel:3}),M.jsx("span",{children:h("withdraw.speedNoteSpeed3")})]})]}),children:M.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:h("withdraw.speed")})}),M.jsx("div",{className:"flex items-center",children:M.jsx(Ko,{selectedLevel:dn(r==null?void 0:r.chainId)?Mt.SLOW:Mt.FAST,maxLevel:3})})]}),(l==="spot"||!dn(r==null?void 0:r.chainId))&&M.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[w||!$?M.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:w?h("withdraw.fee"):`${h("withdraw.fee")}/${h("withdraw.feeRate")}`}):M.jsx(nr,{className:"w-[320px] font-normal flex items-center justify-center",content:M.jsx("span",{className:"flex items-center justify-center text-center",children:h("withdraw.feeCalculationTip")}),children:M.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:`${h("withdraw.fee")}/${h("withdraw.feeRate")}`})}),M.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t,!w&&` / ${x}%`]})]}),M.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[M.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:h(dn(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),M.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[kt(S)," ",t]})]})]})]})},eP=[];let Qe=null;const Sm=E.forwardRef((e,t)=>{const[n,r]=E.useState(!1),[o,s]=E.useState(!1),[i,c]=E.useState({chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),a=E.useCallback(h=>{c(h||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),r(!0)},[]),l=E.useCallback(h=>{c(b=>({...b,...h}))},[]),u=E.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=E.useCallback(h=>{s(h)},[]),d=E.useCallback(()=>n,[n]),p=E.useCallback(()=>o,[o]);return E.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:d,isLoading:p}),[a,u,l,f,d,p]),E.useEffect(()=>(Qe={openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:d,isLoading:p},()=>{Qe=null}),[a,u,l,f,d,p]),n?M.jsx(Nm,{isOpen:n,isLoading:o,onClose:u,config:i.config||{symbol:"USDT"},currentActiveAccount:i.currentActiveAccount,chains:i.chains||eP,spotChains:i.spotChains,balances:i.balances,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAmount:i.defaultAmount,defaultAccountType:i.defaultAccountType,currentEquity:i.currentEquity??5e3,platformBalance:i.platformBalance||"0",fee:i.fee,wagmiHooks:i.wagmiHooks,onWithdraw:i.onWithdraw,onAccountChange:i.onAccountChange,onChainChange:i.onChainChange,onTokenChange:i.onTokenChange,onAmountChanged:i.onAmountChanged}):null});Sm.displayName="WithdrawManager";const Pm=e=>{if(!Qe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Qe.openWithdraw(e||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}})},Tm=()=>{if(!Qe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Qe.closeWithdraw()},$m=e=>{if(!Qe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Qe.updateWithdrawOptions(e)},Pi=e=>{if(!Qe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Qe.setWithdrawLoading(e)},tP=()=>Qe?Qe.isOpen():!1,Am=()=>Qe?Qe.isLoading():!1,nP=()=>({openWithdraw:Pm,closeWithdraw:Tm,updateWithdrawOptions:$m,setWithdrawLoading:Pi,isOpen:tP,isLoading:Am}),rP=({walletType:e,chains:t,spotChains:n=[],defaultChainId:r,defaultSymbol:o,defaultAmount:s="",defaultAccountType:i="perpetual",currentEquity:c,platformBalance:a="0",balances:l,fee:u="0.00",isLoading:f=!1,onWithdraw:d,onClose:p,onChainChange:h,onTokenChange:b,onAmountChanged:S,onAccountChange:P})=>{var H;const{t:x}=Et(),[w,$]=E.useState(i),k=E.useCallback(q=>q==="spot"&&n&&n.length>0?n:t,[t,n]),B=E.useMemo(()=>k(w),[w,k]),F=E.useMemo(()=>{if(!B||B.length===0)return{chainId:1,tokenSymbol:""};const q=he=>{const ie=he||[];if(!ie.length)return"";const ne="USDC".toUpperCase(),Dn=ie.find(vt=>(vt.token||vt.symbol||"").toUpperCase()===ne)||ie[0];return Dn.token||Dn.symbol||""};if(o){const he=o==null?void 0:o.toUpperCase();for(const ie of B){const me=ie.tokenList||[];let ne;if(he&&(ne=me.find(Se=>(Se.token||Se.symbol||"").toUpperCase()===he)),ne){const Se=ne.token||ne.symbol||o||"";return{chainId:ie.chainId,tokenSymbol:Se}}}}if(r){const he=B.find(ne=>ne.chainId===r)||B[0],ie=he.tokenList||[],me=q(ie);return{chainId:he.chainId,tokenSymbol:me}}const Q="USDC",ee=he=>Array.isArray(he.tokenList)&&he.tokenList.some(ie=>(ie.token||ie.symbol||"").toUpperCase()===Q),pe=B.find(ee)||B[0];if(!pe)return{chainId:1,tokenSymbol:""};const le=q(pe.tokenList);return{chainId:pe.chainId,tokenSymbol:le}},[B,r,o]),[m,g]=E.useState(()=>F.chainId),[v,A]=E.useState(()=>F.tokenSymbol),[N,O]=E.useState(s),[D,y]=E.useState(""),C=E.useCallback(q=>{g(q),h==null||h(q)},[h]),I=E.useCallback(q=>{A(q),b==null||b(q)},[b]),T=E.useRef(!0),L=E.useRef(v),j=E.useRef(m);E.useEffect(()=>{if(T.current){T.current=!1,L.current=v,j.current=m;return}(L.current!==v||j.current!==m)&&(O(""),L.current=v,j.current=m)},[v,m]);const z=B&&B.length>0?B.find(q=>q.chainId===m)||B[0]:null,_=(H=z==null?void 0:z.tokenList)==null?void 0:H.find(q=>q.token===v),W=E.useMemo(()=>{const q=new $e(N||"0"),Q=new $e(u||"0"),ee=dn(m);return _!=null&&_.minWithdrawSize&&q.lt(_.minWithdrawSize)?{text:x("withdraw.minWithdrawParsed",{amount:_.minWithdrawSize,token:_.symbol||_.token}),disabled:!0}:!N||q.isZero()||!ee&&q.isLessThan(Q)?{text:x("withdraw.confirmWithdraw"),disabled:!0}:e==="mpc"&&(!ee||w==="spot")&&!D.trim()?{text:x("withdraw.invalidReceiverAddress"),disabled:!0}:{text:x("withdraw.confirmWithdraw"),disabled:!1}},[x,m,N,e,D,u,w,_]),K=E.useMemo(()=>{const q=(v||"").toLowerCase();if(!q)return a||"0";const Q=w==="spot"?l==null?void 0:l.spot:l==null?void 0:l.perpetual,ee=Q==null?void 0:Q[q];return typeof ee=="string"&&ee.length>0?ee:a||"0"},[l,w,v,a]),G=E.useCallback(async()=>{Pi(!0);try{if(d){const Q={amount:new $e(N||"0").toString(),chainId:m,tokenAddress:(_==null?void 0:_.tokenAddress)||"",coinId:(_==null?void 0:_.coinId)||"",tokenSymbol:v,accountType:w,selectedToken:_};e==="mpc"&&(!dn(m)||w==="spot")&&(Q.receiverAddress=D),d(Q)}}catch{Pi(!1)}},[d,w,_,N,m,v,e,D]);return!B||B.length===0?M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"No chains available"})}):z?M.jsxs(M.Fragment,{children:[M.jsx(Oh,{selectedAccount:w,onAccountChange:q=>{var Se,Dn;const Q=q||"perpetual";$(Q),P==null||P(Q);const ee=k(Q);if(!ee||ee.length===0)return;const pe=ee.find(vt=>vt.chainId===m),le=pe?pe.chainId:ee[0].chainId;g(le),h==null||h(le);const he=ee.find(vt=>vt.chainId===le),ie=(he==null?void 0:he.tokenList)||[],ne=ie.some(vt=>(vt.symbol||vt.token)===v)?v:((Se=ie[0])==null?void 0:Se.symbol)||((Dn=ie[0])==null?void 0:Dn.token)||"";ne&&(A(ne),b==null||b(ne))},className:"w-full"}),M.jsx(Ch,{currentActiveChain:z,chainList:B,onChainChange:C,curSelectToken:v,onTokenChange:I,walletType:"EVM",txType:"withdraw"}),M.jsx(JS,{withdrawAmount:N,curSelectToken:v,tokenInfo:_,curSelectTokenData:{balance:_==null?void 0:_.balance,allowance:_==null?void 0:_.allowance},currentActiveChain:z,currentEquity:c||0,decimals:(_==null?void 0:_.decimals)??6,platformBalance:K,fee:u,walletType:e,accountType:w,receiverAddress:D,onWithdrawAmountChange:O,onReceiverAddressChange:y,onAmountChanged:S}),M.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${W.disabled||f?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:G,disabled:W.disabled||f,children:[f&&M.jsx(Jo,{size:"xs"}),W.text]})]}):M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Nm=({isOpen:e,isLoading:t=!1,defaultAccountType:n="perpetual",onClose:r,config:o,currentActiveAccount:s,chains:i,spotChains:c=[],defaultChainId:a,defaultSymbol:l,defaultAmount:u="",currentEquity:f=5e3,platformBalance:d="0",balances:p,fee:h,wagmiHooks:b,onWithdraw:S,onChainChange:P,onTokenChange:x,onAmountChanged:w,onAccountChange:$})=>{const{t:k}=Et(),[B,F]=E.useState(!1),m=v=>{v.target===v.currentTarget?F(!0):F(!1)},g=v=>{B&&v.target===v.currentTarget&&r(),F(!1)};return e?je.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:m,onMouseUp:g,"aria-hidden":"true",children:M.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:v=>{v.stopPropagation()},children:[M.jsxs("div",{className:"flex items-center justify-between mb-4",children:[M.jsx("h2",{className:"text-lg font-semibold text-white",children:k("withdraw.withdraw")}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:M.jsx(v0,{className:"h-4 w-4"})})]}),M.jsx(rP,{chains:i,spotChains:c,walletType:Il(s)?"mpc":"evm",defaultChainId:a,defaultSymbol:l,defaultAmount:u,defaultAccountType:n,currentEquity:f,platformBalance:d,balances:p,fee:h,isLoading:t,wagmiHooks:b,onWithdraw:S,onClose:r,onChainChange:P,onTokenChange:x,onAmountChanged:w,onAccountChange:$})]})})}),document.body):null};se.ChromeLoader=Jo,se.ComponentProvider=rb,se.DEFAULT_LOCALE=rs,se.Deposit=Em,se.DepositManager=mm,se.LOCALE_NAMES=eb,se.LoadingSpinner=Jo,se.SUPPORTED_LOCALES=Ai,se.Tooltip=nr,se.Withdraw=Nm,se.WithdrawManager=Sm,se.closeDeposit=gm,se.closeWithdraw=Tm,se.formatThousands=sb,se.isDepositLoading=vm,se.isWithdrawLoading=Am,se.openDeposit=bm,se.openWithdraw=Pm,se.setDepositLoading=Ei,se.setWithdrawLoading=Pi,se.updateDepositOptions=ym,se.updateWithdrawOptions=$m,se.useComponentConfig=Vl,se.useDeposit=P5,se.useDepositManager=US,se.useTranslation=Et,se.useWithdraw=T5,se.useWithdrawManager=nP,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
187
187
  //# sourceMappingURL=index.umd.js.map