@edgex-web/components 0.1.0-beta.19 → 0.1.0-beta.21

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(te,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(te=typeof globalThis<"u"?globalThis:te||self,m(te.EdgeXComponents={},te.React,te.ReactDOM))})(this,function(te,m,we){"use strict";var ch=Object.defineProperty;var fh=(te,m,we)=>m in te?ch(te,m,{enumerable:!0,configurable:!0,writable:!0,value:we}):te[m]=we;var Le=(te,m,we)=>fh(te,typeof m!="symbol"?m+"":m,we);function Oo(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 j=Oo(m),Ut=Oo(we);function Zl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yn={exports:{}},Vt={};/**
1
+ (function(Z,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(Z=typeof globalThis<"u"?globalThis:Z||self,m(Z.EdgeXComponents={},Z.React,Z.ReactDOM))})(this,function(Z,m,we){"use strict";var ph=Object.defineProperty;var mh=(Z,m,we)=>m in Z?ph(Z,m,{enumerable:!0,configurable:!0,writable:!0,value:we}):Z[m]=we;var Me=(Z,m,we)=>mh(Z,typeof m!="symbol"?m+"":m,we);function No(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 j=No(m),Ut=No(we);function ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yn={exports:{}},Vt={};/**
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 To;function ea(){if(To)return Vt;To=1;var e=m,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,i={key:!0,ref:!0,__self:!0,__source:!0};function a(u,s,l){var c,d={},p=null,f=null;l!==void 0&&(p=""+l),s.key!==void 0&&(p=""+s.key),s.ref!==void 0&&(f=s.ref);for(c in s)r.call(s,c)&&!i.hasOwnProperty(c)&&(d[c]=s[c]);if(u&&u.defaultProps)for(c in s=u.defaultProps,s)d[c]===void 0&&(d[c]=s[c]);return{$$typeof:t,type:u,key:p,ref:f,props:d,_owner:o.current}}return Vt.Fragment=n,Vt.jsx=a,Vt.jsxs=a,Vt}var Ht={};/**
9
+ */var Ao;function na(){if(Ao)return Vt;Ao=1;var e=m,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,i={key:!0,ref:!0,__self:!0,__source:!0};function l(u,s,a){var c,d={},p=null,f=null;a!==void 0&&(p=""+a),s.key!==void 0&&(p=""+s.key),s.ref!==void 0&&(f=s.ref);for(c in s)r.call(s,c)&&!i.hasOwnProperty(c)&&(d[c]=s[c]);if(u&&u.defaultProps)for(c in s=u.defaultProps,s)d[c]===void 0&&(d[c]=s[c]);return{$$typeof:t,type:u,key:p,ref:f,props:d,_owner:o.current}}return Vt.Fragment=n,Vt.jsx=l,Vt.jsxs=l,Vt}var Ht={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,53 +14,53 @@
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 No;function ta(){return No||(No=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),g=Symbol.iterator,v="@@iterator";function E(M){if(M===null||typeof M!="object")return null;var U=g&&M[g]||M[v];return typeof U=="function"?U:null}var I=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(M){{for(var U=arguments.length,Y=new Array(U>1?U-1:0),q=1;q<U;q++)Y[q-1]=arguments[q];P("error",M,Y)}}function P(M,U,Y){{var q=I.ReactDebugCurrentFrame,ie=q.getStackAddendum();ie!==""&&(U+="%s",Y=Y.concat([ie]));var le=Y.map(function(ne){return String(ne)});le.unshift("Warning: "+U),Function.prototype.apply.call(console[M],console,le)}}var F=!1,R=!1,B=!1,V=!1,h=!1,y;y=Symbol.for("react.module.reference");function b(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===i||h||M===o||M===l||M===c||V||M===f||F||R||B||typeof M=="object"&&M!==null&&(M.$$typeof===p||M.$$typeof===d||M.$$typeof===a||M.$$typeof===u||M.$$typeof===s||M.$$typeof===y||M.getModuleId!==void 0))}function A(M,U,Y){var q=M.displayName;if(q)return q;var ie=U.displayName||U.name||"";return ie!==""?Y+"("+ie+")":Y}function C(M){return M.displayName||"Context"}function N(M){if(M==null)return null;if(typeof M.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case c:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case u:var U=M;return C(U)+".Consumer";case a:var Y=M;return C(Y._context)+".Provider";case s:return A(M,M.render,"ForwardRef");case d:var q=M.displayName||null;return q!==null?q:N(M.type)||"Memo";case p:{var ie=M,le=ie._payload,ne=ie._init;try{return N(ne(le))}catch{return null}}}return null}var T=Object.assign,S=0,L,$,w,D,_,k,W;function H(){}H.__reactDisabledLog=!0;function Q(){{if(S===0){L=console.log,$=console.info,w=console.warn,D=console.error,_=console.group,k=console.groupCollapsed,W=console.groupEnd;var M={configurable:!0,enumerable:!0,value:H,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}S++}}function z(){{if(S--,S===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},M,{value:L}),info:T({},M,{value:$}),warn:T({},M,{value:w}),error:T({},M,{value:D}),group:T({},M,{value:_}),groupCollapsed:T({},M,{value:k}),groupEnd:T({},M,{value:W})})}S<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=I.ReactCurrentDispatcher,G;function oe(M,U,Y){{if(G===void 0)try{throw Error()}catch(ie){var q=ie.stack.trim().match(/\n( *(at )?)/);G=q&&q[1]||""}return`
18
- `+G+M}}var fe=!1,Ne;{var Ae=typeof WeakMap=="function"?WeakMap:Map;Ne=new Ae}function ot(M,U){if(!M||fe)return"";{var Y=Ne.get(M);if(Y!==void 0)return Y}var q;fe=!0;var ie=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var le;le=K.current,K.current=null,Q();try{if(U){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch($e){q=$e}Reflect.construct(M,[],ne)}else{try{ne.call()}catch($e){q=$e}M.call(ne.prototype)}}else{try{throw Error()}catch($e){q=$e}M()}}catch($e){if($e&&q&&typeof $e.stack=="string"){for(var Z=$e.stack.split(`
17
+ */var $o;function ra(){return $o||($o=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),g=Symbol.iterator,v="@@iterator";function S(M){if(M===null||typeof M!="object")return null;var U=g&&M[g]||M[v];return typeof U=="function"?U:null}var D=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(M){{for(var U=arguments.length,G=new Array(U>1?U-1:0),q=1;q<U;q++)G[q-1]=arguments[q];N("error",M,G)}}function N(M,U,G){{var q=D.ReactDebugCurrentFrame,ie=q.getStackAddendum();ie!==""&&(U+="%s",G=G.concat([ie]));var le=G.map(function(ne){return String(ne)});le.unshift("Warning: "+U),Function.prototype.apply.call(console[M],console,le)}}var F=!1,R=!1,B=!1,V=!1,h=!1,x;x=Symbol.for("react.module.reference");function b(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===i||h||M===o||M===a||M===c||V||M===f||F||R||B||typeof M=="object"&&M!==null&&(M.$$typeof===p||M.$$typeof===d||M.$$typeof===l||M.$$typeof===u||M.$$typeof===s||M.$$typeof===x||M.getModuleId!==void 0))}function A(M,U,G){var q=M.displayName;if(q)return q;var ie=U.displayName||U.name||"";return ie!==""?G+"("+ie+")":G}function T(M){return M.displayName||"Context"}function $(M){if(M==null)return null;if(typeof M.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case a:return"Suspense";case c:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case u:var U=M;return T(U)+".Consumer";case l:var G=M;return T(G._context)+".Provider";case s:return A(M,M.render,"ForwardRef");case d:var q=M.displayName||null;return q!==null?q:$(M.type)||"Memo";case p:{var ie=M,le=ie._payload,ne=ie._init;try{return $(ne(le))}catch{return null}}}return null}var E=Object.assign,O=0,L,P,y,I,_,W,k;function H(){}H.__reactDisabledLog=!0;function Q(){{if(O===0){L=console.log,P=console.info,y=console.warn,I=console.error,_=console.group,W=console.groupCollapsed,k=console.groupEnd;var M={configurable:!0,enumerable:!0,value:H,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}O++}}function Y(){{if(O--,O===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:E({},M,{value:L}),info:E({},M,{value:P}),warn:E({},M,{value:y}),error:E({},M,{value:I}),group:E({},M,{value:_}),groupCollapsed:E({},M,{value:W}),groupEnd:E({},M,{value:k})})}O<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=D.ReactCurrentDispatcher,z;function oe(M,U,G){{if(z===void 0)try{throw Error()}catch(ie){var q=ie.stack.trim().match(/\n( *(at )?)/);z=q&&q[1]||""}return`
18
+ `+z+M}}var fe=!1,Ae;{var $e=typeof WeakMap=="function"?WeakMap:Map;Ae=new $e}function ot(M,U){if(!M||fe)return"";{var G=Ae.get(M);if(G!==void 0)return G}var q;fe=!0;var ie=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var le;le=K.current,K.current=null,Q();try{if(U){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Pe){q=Pe}Reflect.construct(M,[],ne)}else{try{ne.call()}catch(Pe){q=Pe}M.call(ne.prototype)}}else{try{throw Error()}catch(Pe){q=Pe}M()}}catch(Pe){if(Pe&&q&&typeof Pe.stack=="string"){for(var ee=Pe.stack.split(`
19
19
  `),Se=q.stack.split(`
20
- `),pe=Z.length-1,me=Se.length-1;pe>=1&&me>=0&&Z[pe]!==Se[me];)me--;for(;pe>=1&&me>=0;pe--,me--)if(Z[pe]!==Se[me]){if(pe!==1||me!==1)do if(pe--,me--,me<0||Z[pe]!==Se[me]){var Ue=`
21
- `+Z[pe].replace(" at new "," at ");return M.displayName&&Ue.includes("<anonymous>")&&(Ue=Ue.replace("<anonymous>",M.displayName)),typeof M=="function"&&Ne.set(M,Ue),Ue}while(pe>=1&&me>=0);break}}}finally{fe=!1,K.current=le,z(),Error.prepareStackTrace=ie}var Wt=M?M.displayName||M.name:"",$t=Wt?oe(Wt):"";return typeof M=="function"&&Ne.set(M,$t),$t}function ye(M,U,Y){return ot(M,!1)}function he(M){var U=M.prototype;return!!(U&&U.isReactComponent)}function se(M,U,Y){if(M==null)return"";if(typeof M=="function")return ot(M,he(M));if(typeof M=="string")return oe(M);switch(M){case l:return oe("Suspense");case c:return oe("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case s:return ye(M.render);case d:return se(M.type,U,Y);case p:{var q=M,ie=q._payload,le=q._init;try{return se(le(ie),U,Y)}catch{}}}return""}var sn=Object.prototype.hasOwnProperty,kl={},_l=I.ReactDebugCurrentFrame;function Gn(M){if(M){var U=M._owner,Y=se(M.type,M._source,U?U.type:null);_l.setExtraStackFrame(Y)}else _l.setExtraStackFrame(null)}function Um(M,U,Y,q,ie){{var le=Function.call.bind(sn);for(var ne in M)if(le(M,ne)){var Z=void 0;try{if(typeof M[ne]!="function"){var Se=Error((q||"React class")+": "+Y+" type `"+ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[ne]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Se.name="Invariant Violation",Se}Z=M[ne](U,ne,q,Y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(pe){Z=pe}Z&&!(Z instanceof Error)&&(Gn(ie),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).",q||"React class",Y,ne,typeof Z),Gn(null)),Z instanceof Error&&!(Z.message in kl)&&(kl[Z.message]=!0,Gn(ie),x("Failed %s type: %s",Y,Z.message),Gn(null))}}}var Vm=Array.isArray;function yo(M){return Vm(M)}function Hm(M){{var U=typeof Symbol=="function"&&Symbol.toStringTag,Y=U&&M[Symbol.toStringTag]||M.constructor.name||"Object";return Y}}function zm(M){try{return Bl(M),!1}catch{return!0}}function Bl(M){return""+M}function Wl(M){if(zm(M))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Hm(M)),Bl(M)}var Ul=I.ReactCurrentOwner,Gm={key:!0,ref:!0,__self:!0,__source:!0},Vl,Hl;function Ym(M){if(sn.call(M,"ref")){var U=Object.getOwnPropertyDescriptor(M,"ref").get;if(U&&U.isReactWarning)return!1}return M.ref!==void 0}function Km(M){if(sn.call(M,"key")){var U=Object.getOwnPropertyDescriptor(M,"key").get;if(U&&U.isReactWarning)return!1}return M.key!==void 0}function qm(M,U){typeof M.ref=="string"&&Ul.current}function Xm(M,U){{var Y=function(){Vl||(Vl=!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)",U))};Y.isReactWarning=!0,Object.defineProperty(M,"key",{get:Y,configurable:!0})}}function Qm(M,U){{var Y=function(){Hl||(Hl=!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)",U))};Y.isReactWarning=!0,Object.defineProperty(M,"ref",{get:Y,configurable:!0})}}var Jm=function(M,U,Y,q,ie,le,ne){var Z={$$typeof:t,type:M,key:U,ref:Y,props:ne,_owner:le};return Z._store={},Object.defineProperty(Z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Z,"_self",{configurable:!1,enumerable:!1,writable:!1,value:q}),Object.defineProperty(Z,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ie}),Object.freeze&&(Object.freeze(Z.props),Object.freeze(Z)),Z};function Zm(M,U,Y,q,ie){{var le,ne={},Z=null,Se=null;Y!==void 0&&(Wl(Y),Z=""+Y),Km(U)&&(Wl(U.key),Z=""+U.key),Ym(U)&&(Se=U.ref,qm(U,ie));for(le in U)sn.call(U,le)&&!Gm.hasOwnProperty(le)&&(ne[le]=U[le]);if(M&&M.defaultProps){var pe=M.defaultProps;for(le in pe)ne[le]===void 0&&(ne[le]=pe[le])}if(Z||Se){var me=typeof M=="function"?M.displayName||M.name||"Unknown":M;Z&&Xm(ne,me),Se&&Qm(ne,me)}return Jm(M,Z,Se,ie,q,Ul.current,ne)}}var wo=I.ReactCurrentOwner,zl=I.ReactDebugCurrentFrame;function Bt(M){if(M){var U=M._owner,Y=se(M.type,M._source,U?U.type:null);zl.setExtraStackFrame(Y)}else zl.setExtraStackFrame(null)}var Eo;Eo=!1;function So(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function Gl(){{if(wo.current){var M=N(wo.current.type);if(M)return`
20
+ `),pe=ee.length-1,me=Se.length-1;pe>=1&&me>=0&&ee[pe]!==Se[me];)me--;for(;pe>=1&&me>=0;pe--,me--)if(ee[pe]!==Se[me]){if(pe!==1||me!==1)do if(pe--,me--,me<0||ee[pe]!==Se[me]){var Ve=`
21
+ `+ee[pe].replace(" at new "," at ");return M.displayName&&Ve.includes("<anonymous>")&&(Ve=Ve.replace("<anonymous>",M.displayName)),typeof M=="function"&&Ae.set(M,Ve),Ve}while(pe>=1&&me>=0);break}}}finally{fe=!1,K.current=le,Y(),Error.prepareStackTrace=ie}var Wt=M?M.displayName||M.name:"",$t=Wt?oe(Wt):"";return typeof M=="function"&&Ae.set(M,$t),$t}function ye(M,U,G){return ot(M,!1)}function he(M){var U=M.prototype;return!!(U&&U.isReactComponent)}function se(M,U,G){if(M==null)return"";if(typeof M=="function")return ot(M,he(M));if(typeof M=="string")return oe(M);switch(M){case a:return oe("Suspense");case c:return oe("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case s:return ye(M.render);case d:return se(M.type,U,G);case p:{var q=M,ie=q._payload,le=q._init;try{return se(le(ie),U,G)}catch{}}}return""}var sn=Object.prototype.hasOwnProperty,Bl={},Wl=D.ReactDebugCurrentFrame;function Gn(M){if(M){var U=M._owner,G=se(M.type,M._source,U?U.type:null);Wl.setExtraStackFrame(G)}else Wl.setExtraStackFrame(null)}function zm(M,U,G,q,ie){{var le=Function.call.bind(sn);for(var ne in M)if(le(M,ne)){var ee=void 0;try{if(typeof M[ne]!="function"){var Se=Error((q||"React class")+": "+G+" type `"+ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[ne]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Se.name="Invariant Violation",Se}ee=M[ne](U,ne,q,G,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(pe){ee=pe}ee&&!(ee instanceof Error)&&(Gn(ie),w("%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).",q||"React class",G,ne,typeof ee),Gn(null)),ee instanceof Error&&!(ee.message in Bl)&&(Bl[ee.message]=!0,Gn(ie),w("Failed %s type: %s",G,ee.message),Gn(null))}}}var Gm=Array.isArray;function Eo(M){return Gm(M)}function Ym(M){{var U=typeof Symbol=="function"&&Symbol.toStringTag,G=U&&M[Symbol.toStringTag]||M.constructor.name||"Object";return G}}function Km(M){try{return Ul(M),!1}catch{return!0}}function Ul(M){return""+M}function Vl(M){if(Km(M))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ym(M)),Ul(M)}var Hl=D.ReactCurrentOwner,qm={key:!0,ref:!0,__self:!0,__source:!0},zl,Gl;function Xm(M){if(sn.call(M,"ref")){var U=Object.getOwnPropertyDescriptor(M,"ref").get;if(U&&U.isReactWarning)return!1}return M.ref!==void 0}function Qm(M){if(sn.call(M,"key")){var U=Object.getOwnPropertyDescriptor(M,"key").get;if(U&&U.isReactWarning)return!1}return M.key!==void 0}function Jm(M,U){typeof M.ref=="string"&&Hl.current}function Zm(M,U){{var G=function(){zl||(zl=!0,w("%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)",U))};G.isReactWarning=!0,Object.defineProperty(M,"key",{get:G,configurable:!0})}}function eh(M,U){{var G=function(){Gl||(Gl=!0,w("%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)",U))};G.isReactWarning=!0,Object.defineProperty(M,"ref",{get:G,configurable:!0})}}var th=function(M,U,G,q,ie,le,ne){var ee={$$typeof:t,type:M,key:U,ref:G,props:ne,_owner:le};return ee._store={},Object.defineProperty(ee._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ee,"_self",{configurable:!1,enumerable:!1,writable:!1,value:q}),Object.defineProperty(ee,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ie}),Object.freeze&&(Object.freeze(ee.props),Object.freeze(ee)),ee};function nh(M,U,G,q,ie){{var le,ne={},ee=null,Se=null;G!==void 0&&(Vl(G),ee=""+G),Qm(U)&&(Vl(U.key),ee=""+U.key),Xm(U)&&(Se=U.ref,Jm(U,ie));for(le in U)sn.call(U,le)&&!qm.hasOwnProperty(le)&&(ne[le]=U[le]);if(M&&M.defaultProps){var pe=M.defaultProps;for(le in pe)ne[le]===void 0&&(ne[le]=pe[le])}if(ee||Se){var me=typeof M=="function"?M.displayName||M.name||"Unknown":M;ee&&Zm(ne,me),Se&&eh(ne,me)}return th(M,ee,Se,ie,q,Hl.current,ne)}}var So=D.ReactCurrentOwner,Yl=D.ReactDebugCurrentFrame;function Bt(M){if(M){var U=M._owner,G=se(M.type,M._source,U?U.type:null);Yl.setExtraStackFrame(G)}else Yl.setExtraStackFrame(null)}var Co;Co=!1;function Oo(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function Kl(){{if(So.current){var M=$(So.current.type);if(M)return`
22
22
 
23
- Check the render method of \``+M+"`."}return""}}function eh(M){return""}var Yl={};function th(M){{var U=Gl();if(!U){var Y=typeof M=="string"?M:M.displayName||M.name;Y&&(U=`
23
+ Check the render method of \``+M+"`."}return""}}function rh(M){return""}var ql={};function oh(M){{var U=Kl();if(!U){var G=typeof M=="string"?M:M.displayName||M.name;G&&(U=`
24
24
 
25
- Check the top-level render call using <`+Y+">.")}return U}}function Kl(M,U){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var Y=th(U);if(Yl[Y])return;Yl[Y]=!0;var q="";M&&M._owner&&M._owner!==wo.current&&(q=" It was passed a child from "+N(M._owner.type)+"."),Bt(M),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,q),Bt(null)}}function ql(M,U){{if(typeof M!="object")return;if(yo(M))for(var Y=0;Y<M.length;Y++){var q=M[Y];So(q)&&Kl(q,U)}else if(So(M))M._store&&(M._store.validated=!0);else if(M){var ie=E(M);if(typeof ie=="function"&&ie!==M.entries)for(var le=ie.call(M),ne;!(ne=le.next()).done;)So(ne.value)&&Kl(ne.value,U)}}}function nh(M){{var U=M.type;if(U==null||typeof U=="string")return;var Y;if(typeof U=="function")Y=U.propTypes;else if(typeof U=="object"&&(U.$$typeof===s||U.$$typeof===d))Y=U.propTypes;else return;if(Y){var q=N(U);Um(Y,M.props,"prop",q,M)}else if(U.PropTypes!==void 0&&!Eo){Eo=!0;var ie=N(U);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ie||"Unknown")}typeof U.getDefaultProps=="function"&&!U.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function rh(M){{for(var U=Object.keys(M.props),Y=0;Y<U.length;Y++){var q=U[Y];if(q!=="children"&&q!=="key"){Bt(M),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",q),Bt(null);break}}M.ref!==null&&(Bt(M),x("Invalid attribute `ref` supplied to `React.Fragment`."),Bt(null))}}var Xl={};function Ql(M,U,Y,q,ie,le){{var ne=b(M);if(!ne){var Z="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(Z+=" 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 Se=eh();Se?Z+=Se:Z+=Gl();var pe;M===null?pe="null":yo(M)?pe="array":M!==void 0&&M.$$typeof===t?(pe="<"+(N(M.type)||"Unknown")+" />",Z=" Did you accidentally export a JSX literal instead of a component?"):pe=typeof M,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,Z)}var me=Zm(M,U,Y,ie,le);if(me==null)return me;if(ne){var Ue=U.children;if(Ue!==void 0)if(q)if(yo(Ue)){for(var Wt=0;Wt<Ue.length;Wt++)ql(Ue[Wt],M);Object.freeze&&Object.freeze(Ue)}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 ql(Ue,M)}if(sn.call(U,"key")){var $t=N(M),$e=Object.keys(U).filter(function(uh){return uh!=="key"}),Co=$e.length>0?"{key: someKey, "+$e.join(": ..., ")+": ...}":"{key: someKey}";if(!Xl[$t+Co]){var ah=$e.length>0?"{"+$e.join(": ..., ")+": ...}":"{}";x(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+G+">.")}return U}}function Xl(M,U){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var G=oh(U);if(ql[G])return;ql[G]=!0;var q="";M&&M._owner&&M._owner!==So.current&&(q=" It was passed a child from "+$(M._owner.type)+"."),Bt(M),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',G,q),Bt(null)}}function Ql(M,U){{if(typeof M!="object")return;if(Eo(M))for(var G=0;G<M.length;G++){var q=M[G];Oo(q)&&Xl(q,U)}else if(Oo(M))M._store&&(M._store.validated=!0);else if(M){var ie=S(M);if(typeof ie=="function"&&ie!==M.entries)for(var le=ie.call(M),ne;!(ne=le.next()).done;)Oo(ne.value)&&Xl(ne.value,U)}}}function ih(M){{var U=M.type;if(U==null||typeof U=="string")return;var G;if(typeof U=="function")G=U.propTypes;else if(typeof U=="object"&&(U.$$typeof===s||U.$$typeof===d))G=U.propTypes;else return;if(G){var q=$(U);zm(G,M.props,"prop",q,M)}else if(U.PropTypes!==void 0&&!Co){Co=!0;var ie=$(U);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ie||"Unknown")}typeof U.getDefaultProps=="function"&&!U.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sh(M){{for(var U=Object.keys(M.props),G=0;G<U.length;G++){var q=U[G];if(q!=="children"&&q!=="key"){Bt(M),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",q),Bt(null);break}}M.ref!==null&&(Bt(M),w("Invalid attribute `ref` supplied to `React.Fragment`."),Bt(null))}}var Jl={};function Zl(M,U,G,q,ie,le){{var ne=b(M);if(!ne){var ee="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(ee+=" 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 Se=rh();Se?ee+=Se:ee+=Kl();var pe;M===null?pe="null":Eo(M)?pe="array":M!==void 0&&M.$$typeof===t?(pe="<"+($(M.type)||"Unknown")+" />",ee=" Did you accidentally export a JSX literal instead of a component?"):pe=typeof M,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",pe,ee)}var me=nh(M,U,G,ie,le);if(me==null)return me;if(ne){var Ve=U.children;if(Ve!==void 0)if(q)if(Eo(Ve)){for(var Wt=0;Wt<Ve.length;Wt++)Ql(Ve[Wt],M);Object.freeze&&Object.freeze(Ve)}else w("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 Ql(Ve,M)}if(sn.call(U,"key")){var $t=$(M),Pe=Object.keys(U).filter(function(dh){return dh!=="key"}),To=Pe.length>0?"{key: someKey, "+Pe.join(": ..., ")+": ...}":"{key: someKey}";if(!Jl[$t+To]){var fh=Pe.length>0?"{"+Pe.join(": ..., ")+": ...}":"{}";w(`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} />`,Co,$t,ah,$t),Xl[$t+Co]=!0}}return M===r?rh(me):nh(me),me}}function oh(M,U,Y){return Ql(M,U,Y,!0)}function ih(M,U,Y){return Ql(M,U,Y,!1)}var sh=ih,lh=oh;Ht.Fragment=r,Ht.jsx=sh,Ht.jsxs=lh}()),Ht}process.env.NODE_ENV==="production"?Yn.exports=ea():Yn.exports=ta();var O=Yn.exports;const na={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",max:"最大",arrivalTime:"到账时间",minDeposit:"最小充值金额",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 250,000。若充值金额大于250,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
31
- 充值金额大于 250,000 时,到账时间存在一定延迟,请耐心等待。`,enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"您可以在约 {{v}} 分钟 (达到 {{v1}} 个区块确认后) 提走已到账的资金",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"预计约{{v}}分钟",availableDesc:"您可以提取的最大金额。当 available 为0或负数时,不允许提现。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址"}},ra={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",max:"Max",arrivalTime:"Arrival Time",minDeposit:"Minimum Deposit Amount",maxDeposit:"Maximum Deposit Amount",depositTipFor25w:"The maximum amount per deposit is 250,000. If your deposit exceeds 250,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
32
- If the deposit amount exceeds 250,000, there may be a delay in the arrival time. Please be patient.`,enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"You can withdraw the arrived funds 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:"Estimated approximately {{v}} minutes",availableDesc:"Max. amount you can withdraw. When the available amount shown is 0 or negative, you are not allowed to make withdrawals."},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"}},oa={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",max:"最大",arrivalTime:"着金予定時間",minDeposit:"最低入金額",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は250,000です。250,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
33
- 入金金額が 250,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"{{v1}} ブロック確認後、おおよそ {{v}} 分以内に引き出し可能となります",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"推定 {{v}} 分以内",availableDesc:"出金可能な最大金額です。 available が0またはマイナスの場合、出金は行えません。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス"}},ia={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",max:"Максимум",arrivalTime:"Время поступления",minDeposit:"Минимальная сумма депозита",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 250 000. Если сумма превышает 250 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
34
- Если сумма депозита превышает 250 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Вы сможете вывести поступившие средства примерно через {{v}} минут (после {{v1}} подтверждений в блокчейне)",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"Ожидается примерно через {{v}} минут",availableDesc:"Максимальная сумма для вывода. Если доступная сумма равна 0 или меньше, вывод невозможен."},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:"Адрес получателя"}},sa={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",max:"最大",arrivalTime:"到帳時間",minDeposit:"最小儲值金額",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 250,000。若充值金額大於 250,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
35
- 充值金額大於 250,000 時,到账時間可能會有延遲,請耐心等待。`,enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"您可以在約 {{v}} 分鐘 (達到 {{v1}} 個區塊確認後) 提走已到帳的資金",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"預計約{{v}}分鐘",availableDesc:"您可以提取的最大金額。當 available 爲0或負數時,不允許提現。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址"}},Kn=["en-US","ja-JP","ru-RU","zh-CN","zh-TW"],Ao={"en-US":ra,"ja-JP":oa,"ru-RU":ia,"zh-CN":na,"zh-TW":sa},ln="en-US",la={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},aa=e=>Kn.includes(e)?Ao[e]:Ao[ln],ua=e=>Kn.includes(e),$o=m.createContext(null),ca=({config:e,children:t})=>{const n=m.useMemo(()=>{const r=e.locale||ln,o=ua(r)?r:ln,i=aa(o);return{...e,currentLocale:o,translations:i}},[e]);return O.jsx($o.Provider,{value:n,children:t})},Po=()=>{const e=m.useContext($o);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e},Ye=()=>{const{translations:e,currentLocale:t}=Po();return{t:(i,a)=>{try{const u=i.split(".");let s=e;for(const c of u)if(s&&typeof s=="object"&&c in s)s=s[c];else return i;let l=typeof s=="string"?s:i;return a&&typeof l=="string"&&Object.keys(a).forEach(c=>{const d=`{{${c}}}`;l=l.replace(new RegExp(d,"g"),String(a[c]))}),l}catch(u){return console.warn(`Translation error for key "${i}":`,u),i}},translations:e,locale:t,getTranslationObject:i=>{try{const a=i.split(".");let u=e;for(const s of a)if(u&&typeof u=="object"&&s in u)u=u[s];else return{};return typeof u=="object"?u:{}}catch(a){return console.warn(`Translation object error for key "${i}":`,a),{}}},hasTranslation:i=>{try{const a=i.split(".");let u=e;for(const s of a)if(u&&typeof u=="object"&&s in u)u=u[s];else return!1;return typeof u=="string"}catch{return!1}}}},fa=()=>({openDeposit:m.useCallback(t=>{},[])}),da=()=>({openWithdraw:m.useCallback(t=>{},[])});/**
30
+ <%s key={someKey} {...props} />`,To,$t,fh,$t),Jl[$t+To]=!0}}return M===r?sh(me):ih(me),me}}function lh(M,U,G){return Zl(M,U,G,!0)}function ah(M,U,G){return Zl(M,U,G,!1)}var uh=ah,ch=lh;Ht.Fragment=r,Ht.jsx=uh,Ht.jsxs=ch}()),Ht}process.env.NODE_ENV==="production"?Yn.exports=na():Yn.exports=ra();var C=Yn.exports;const oa={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",max:"最大",arrivalTime:"到账时间",minDeposit:"最小充值金额",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 250,000。若充值金额大于250,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
31
+ 充值金额大于 250,000 时,到账时间存在一定延迟,请耐心等待。`,enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"您可以在约 {{v}} 分钟 (达到 {{v1}} 个区块确认后) 提走已到账的资金",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"{{v}}分钟",availableDesc:"您可以提取的最大金额。当 available 为0或负数时,不允许提现。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址"}},ia={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",max:"Max",arrivalTime:"Arrival Time",minDeposit:"Minimum Deposit Amount",maxDeposit:"Maximum Deposit Amount",depositTipFor25w:"The maximum amount per deposit is 250,000. If your deposit exceeds 250,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
32
+ If the deposit amount exceeds 250,000, there may be a delay in the arrival time. Please be patient.`,enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"You can withdraw the arrived funds 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:"Max. amount you can withdraw. When the available amount shown is 0 or negative, you are not allowed to make withdrawals."},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"}},sa={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",max:"最大",arrivalTime:"着金予定時間",minDeposit:"最低入金額",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は250,000です。250,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
33
+ 入金金額が 250,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"{{v1}} ブロック確認後、おおよそ {{v}} 分以内に引き出し可能となります",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:" {{v}}",availableDesc:"出金可能な最大金額です。 available が0またはマイナスの場合、出金は行えません。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス"}},la={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",max:"Максимум",arrivalTime:"Время поступления",minDeposit:"Минимальная сумма депозита",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 250 000. Если сумма превышает 250 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
34
+ Если сумма депозита превышает 250 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Вы сможете вывести поступившие средства примерно через {{v}} минут (после {{v1}} подтверждений в блокчейне)",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:" {{v}} минут",availableDesc:"Максимальная сумма для вывода. Если доступная сумма равна 0 или меньше, вывод невозможен."},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:"Адрес получателя"}},aa={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",max:"最大",arrivalTime:"到帳時間",minDeposit:"最小儲值金額",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 250,000。若充值金額大於 250,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
35
+ 充值金額大於 250,000 時,到账時間可能會有延遲,請耐心等待。`,enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"您可以在約 {{v}} 分鐘 (達到 {{v1}} 個區塊確認後) 提走已到帳的資金",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"{{v}}分鐘",availableDesc:"您可以提取的最大金額。當 available 爲0或負數時,不允許提現。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址"}},Kn=["en-US","ja-JP","ru-RU","zh-CN","zh-TW"],Po={"en-US":ia,"ja-JP":sa,"ru-RU":la,"zh-CN":oa,"zh-TW":aa},ln="en-US",ua={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},ca=e=>Kn.includes(e)?Po[e]:Po[ln],fa=e=>Kn.includes(e),Lo=m.createContext(null),da=({config:e,children:t})=>{const n=m.useMemo(()=>{const r=e.locale||ln,o=fa(r)?r:ln,i=ca(o);return{...e,currentLocale:o,translations:i}},[e]);return C.jsx(Lo.Provider,{value:n,children:t})},Mo=()=>{const e=m.useContext(Lo);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e},He=()=>{const{translations:e,currentLocale:t}=Mo();return{t:(i,l)=>{try{const u=i.split(".");let s=e;for(const c of u)if(s&&typeof s=="object"&&c in s)s=s[c];else return i;let a=typeof s=="string"?s:i;return l&&typeof a=="string"&&Object.keys(l).forEach(c=>{const d=`{{${c}}}`;a=a.replace(new RegExp(d,"g"),String(l[c]))}),a}catch(u){return console.warn(`Translation error for key "${i}":`,u),i}},translations:e,locale:t,getTranslationObject:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return{};return typeof u=="object"?u:{}}catch(l){return console.warn(`Translation object error for key "${i}":`,l),{}}},hasTranslation:i=>{try{const l=i.split(".");let u=e;for(const s of l)if(u&&typeof u=="object"&&s in u)u=u[s];else return!1;return typeof u=="string"}catch{return!1}}}},pa=()=>({openDeposit:m.useCallback(t=>{},[])}),ma=()=>({openWithdraw:m.useCallback(t=>{},[])});/**
36
36
  * @license lucide-react v0.540.0 - ISC
37
37
  *
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
- */const pa=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ma=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Lo=e=>{const t=ma(e);return t.charAt(0).toUpperCase()+t.slice(1)},Mo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),ha=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
40
+ */const ha=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ga=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Do=e=>{const t=ga(e);return t.charAt(0).toUpperCase()+t.slice(1)},Io=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),va=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
41
41
  * @license lucide-react v0.540.0 - ISC
42
42
  *
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
- */var ga={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"};/**
45
+ */var ba={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"};/**
46
46
  * @license lucide-react v0.540.0 - ISC
47
47
  *
48
48
  * This source code is licensed under the ISC license.
49
49
  * See the LICENSE file in the root directory of this source tree.
50
- */const va=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...u},s)=>m.createElement("svg",{ref:s,...ga,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Mo("lucide",o),...!i&&!ha(u)&&{"aria-hidden":"true"},...u},[...a.map(([l,c])=>m.createElement(l,c)),...Array.isArray(i)?i:[i]]));/**
50
+ */const xa=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:l,...u},s)=>m.createElement("svg",{ref:s,...ba,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Io("lucide",o),...!i&&!va(u)&&{"aria-hidden":"true"},...u},[...l.map(([a,c])=>m.createElement(a,c)),...Array.isArray(i)?i:[i]]));/**
51
51
  * @license lucide-react v0.540.0 - ISC
52
52
  *
53
53
  * This source code is licensed under the ISC license.
54
54
  * See the LICENSE file in the root directory of this source tree.
55
- */const ba=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(va,{ref:i,iconNode:t,className:Mo(`lucide-${pa(Lo(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Lo(e),n};/**
55
+ */const ya=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(xa,{ref:i,iconNode:t,className:Io(`lucide-${ha(Do(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Do(e),n};/**
56
56
  * @license lucide-react v0.540.0 - ISC
57
57
  *
58
58
  * This source code is licensed under the ISC license.
59
59
  * See the LICENSE file in the root directory of this source tree.
60
- */const Do=ba("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class Io{constructor(){Le(this,"state");this.state={isLoading:!1,isApproving:!1,isDepositing:!1,error:null,txHash:null}}getState(){return{...this.state}}setState(t){this.state={...this.state,...t}}}class xa extends Io{constructor(n,r){super();Le(this,"smartWallet");Le(this,"currentActiveAccount");this.smartWallet=n,this.currentActiveAccount=r}getWalletType(){return"mpc"}getDisplayAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}isApprovalRequired(){return!1}getApprovalStatus(){return!0}async connect(){this.setState({isLoading:!0,error:null});try{this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){}async switchChain(n){}async getBalance(n){return"0"}async approve(n,r){return""}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{const o=`mpc_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return`mpc_signature_${Date.now()}`}getAAWalletAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}}class ya extends Io{constructor(n,r,o,i="0",a="0"){super();Le(this,"currentActiveAccount");Le(this,"approved");Le(this,"chainId");Le(this,"balance");Le(this,"allowance");this.currentActiveAccount=n,this.approved=r,this.chainId=o,this.balance=i,this.allowance=a}getWalletType(){return"evm"}getDisplayAddress(){var n;return((n=this.currentActiveAccount)==null?void 0:n.ethAddress)||""}isApprovalRequired(){return!0}getApprovalStatus(){return this.approved}async connect(){this.setState({isLoading:!0,error:null});try{this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){}async switchChain(n){this.setState({isLoading:!0,error:null});try{this.chainId=n,this.setState({isLoading:!1})}catch(r){throw this.setState({isLoading:!1,error:r instanceof Error?r.message:"Chain switch failed"}),r}}async getBalance(n){return this.balance}async approve(n,r){this.setState({isApproving:!0,error:null});try{const o=`evm_approve_${Date.now()}`;return this.approved=!0,this.setState({isApproving:!1,txHash:o}),o}catch(o){throw this.setState({isApproving:!1,error:o instanceof Error?o.message:"Approval failed"}),o}}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{if(!this.approved)throw new Error("Token approval required");const o=`evm_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return`evm_signature_${Date.now()}`}updateApprovalStatus(n){this.approved=n}updateBalance(n){this.balance=n}updateAllowance(n){this.allowance=n}}function Fo(e,t,n,r,o,i){switch(e==null?void 0:e.wallet){case"mpc":return new xa(t,e);default:return new ya(e,!1,r||1,o,i)}}const jo=typeof document<"u"?m.useLayoutEffect:()=>{};var qn;const wa=(qn=m.useInsertionEffect)!==null&&qn!==void 0?qn:jo;function Ea(e){const t=m.useRef(null);return wa(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const pt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},yt=e=>e&&"window"in e&&e.window===e?e:pt(e).defaultView||window;function Sa(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Ca(e){return Sa(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Oa=!1;function Xn(){return Oa}function Ro(e,t){if(!Xn())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:Ca(n)?n=n.host:n=n.parentNode}return!1}const Qn=(e=document)=>{var t;if(!Xn())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 ko(e){return Xn()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function an(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 Jn(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 it(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const Zn=it(function(){return Jn(/^Mac/i)}),Ta=it(function(){return Jn(/^iPhone/i)}),Na=it(function(){return Jn(/^iPad/i)||Zn()&&navigator.maxTouchPoints>1}),Aa=it(function(){return Ta()||Na()});it(function(){return Zn()||Aa()}),it(function(){return an(/AppleWebKit/i)&&!$a()});const $a=it(function(){return an(/Chrome/i)}),Pa=it(function(){return an(/Android/i)});it(function(){return an(/Firefox/i)});function _o(){let e=m.useRef(new Map),t=m.useCallback((o,i,a,u)=>{let s=u!=null&&u.once?(...l)=>{e.current.delete(a),a(...l)}:a;e.current.set(a,{type:i,eventTarget:o,fn:s,options:u}),o.addEventListener(i,s,u)},[]),n=m.useCallback((o,i,a,u)=>{var s;let l=((s=e.current.get(a))===null||s===void 0?void 0:s.fn)||a;o.removeEventListener(i,l,u),e.current.delete(a)},[]),r=m.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return m.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function La(e){return e.mozInputSource===0&&e.isTrusted?!0:Pa()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Bo(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Ma(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function Wo(e){let t=m.useRef({isFocused:!1,observer:null});jo(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Ea(r=>{e==null||e(r)});return m.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=a=>{if(t.current.isFocused=!1,o.disabled){let u=Bo(a);n(u)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var a;(a=t.current.observer)===null||a===void 0||a.disconnect();let u=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:u})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:u}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Da=!1,zt=null,er=new Set,Gt=new Map,wt=!1,tr=!1;const Ia={Tab:!0,Escape:!0};function nr(e,t){for(let n of er)n(e,t)}function Fa(e){return!(e.metaKey||!Zn()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function un(e){wt=!0,Fa(e)&&(zt="keyboard",nr("keyboard",e))}function Me(e){zt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(wt=!0,nr("pointer",e))}function Uo(e){La(e)&&(wt=!0,zt="virtual")}function Vo(e){e.target===window||e.target===document||Da||!e.isTrusted||(!wt&&!tr&&(zt="virtual",nr("virtual",e)),wt=!1,tr=!1)}function Ho(){wt=!1,tr=!0}function rr(e){if(typeof window>"u"||typeof document>"u"||Gt.get(yt(e)))return;const t=yt(e),n=pt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){wt=!0,r.apply(this,arguments)},n.addEventListener("keydown",un,!0),n.addEventListener("keyup",un,!0),n.addEventListener("click",Uo,!0),t.addEventListener("focus",Vo,!0),t.addEventListener("blur",Ho,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Me,!0),n.addEventListener("pointermove",Me,!0),n.addEventListener("pointerup",Me,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Me,!0),n.addEventListener("mousemove",Me,!0),n.addEventListener("mouseup",Me,!0)),t.addEventListener("beforeunload",()=>{zo(e)},{once:!0}),Gt.set(t,{focus:r})}const zo=(e,t)=>{const n=yt(e),r=pt(e);t&&r.removeEventListener("DOMContentLoaded",t),Gt.has(n)&&(n.HTMLElement.prototype.focus=Gt.get(n).focus,r.removeEventListener("keydown",un,!0),r.removeEventListener("keyup",un,!0),r.removeEventListener("click",Uo,!0),n.removeEventListener("focus",Vo,!0),n.removeEventListener("blur",Ho,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Me,!0),r.removeEventListener("pointermove",Me,!0),r.removeEventListener("pointerup",Me,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Me,!0),r.removeEventListener("mousemove",Me,!0),r.removeEventListener("mouseup",Me,!0)),Gt.delete(n))};function ja(e){const t=pt(e);let n;return t.readyState!=="loading"?rr(e):(n=()=>{rr(e)},t.addEventListener("DOMContentLoaded",n)),()=>zo(e,n)}typeof document<"u"&&ja();function Go(){return zt!=="pointer"}const Ra=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ka(e,t,n){let r=pt(n==null?void 0:n.target);const o=typeof window<"u"?yt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?yt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?yt(n==null?void 0:n.target).HTMLElement:HTMLElement,u=typeof window<"u"?yt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Ra.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof a&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof u&&!Ia[n.key])}function _a(e,t,n){rr(),m.useEffect(()=>{let r=(o,i)=>{ka(!!(n!=null&&n.isTextInput),o,i)&&e(Go())};return er.add(r),()=>{er.delete(r)}},t)}function Ba(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=m.useCallback(s=>{if(s.target===s.currentTarget)return r&&r(s),o&&o(!1),!0},[r,o]),a=Wo(i),u=m.useCallback(s=>{const l=pt(s.target),c=l?Qn(l):Qn();s.target===s.currentTarget&&c===ko(s.nativeEvent)&&(n&&n(s),o&&o(!0),a(s))},[o,n,a]);return{focusProps:{onFocus:!t&&(n||o||r)?u:void 0,onBlur:!t&&(r||o)?i:void 0}}}function Wa(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=m.useRef({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:u}=_o(),s=m.useCallback(d=>{d.currentTarget.contains(d.target)&&i.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(i.current.isFocusWithin=!1,u(),n&&n(d),o&&o(!1))},[n,o,i,u]),l=Wo(s),c=m.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const p=pt(d.target),f=Qn(p);if(!i.current.isFocusWithin&&f===ko(d.nativeEvent)){r&&r(d),o&&o(!0),i.current.isFocusWithin=!0,l(d);let g=d.currentTarget;a(p,"focus",v=>{if(i.current.isFocusWithin&&!Ro(g,v.target)){let E=new p.defaultView.FocusEvent("blur",{relatedTarget:v.target});Ma(E,g);let I=Bo(E);s(I)}},{capture:!0})}},[r,o,l,a,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:s}}}let cn=!1,fn=0;function or(){cn=!0,setTimeout(()=>{cn=!1},50)}function Yo(e){e.pointerType==="touch"&&or()}function Ua(){if(!(typeof document>"u"))return fn===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",Yo):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",or)),fn++,()=>{fn--,!(fn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Yo):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",or))}}function Va(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,a]=m.useState(!1),u=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(Ua,[]);let{addGlobalListener:s,removeAllGlobalListeners:l}=_o(),{hoverProps:c,triggerHoverEnd:d}=m.useMemo(()=>{let p=(v,E)=>{if(u.pointerType=E,o||E==="touch"||u.isHovered||!v.currentTarget.contains(v.target))return;u.isHovered=!0;let I=v.currentTarget;u.target=I,s(pt(v.target),"pointerover",x=>{u.isHovered&&u.target&&!Ro(u.target,x.target)&&f(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:I,pointerType:E}),n&&n(!0),a(!0)},f=(v,E)=>{let I=u.target;u.pointerType="",u.target=null,!(E==="touch"||!u.isHovered||!I)&&(u.isHovered=!1,l(),r&&r({type:"hoverend",target:I,pointerType:E}),n&&n(!1),a(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=v=>{cn&&v.pointerType==="mouse"||p(v,v.pointerType)},g.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(g.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},g.onMouseEnter=v=>{!u.ignoreEmulatedMouseEvents&&!cn&&p(v,"mouse"),u.ignoreEmulatedMouseEvents=!1},g.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,"mouse")}),{hoverProps:g,triggerHoverEnd:f}},[t,n,r,o,u,s,l]);return m.useEffect(()=>{o&&d({currentTarget:u.target},u.pointerType)},[o]),{hoverProps:c,isHovered:i}}function Ha(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=m.useRef({isFocused:!1,isFocusVisible:t||Go()}),[i,a]=m.useState(!1),[u,s]=m.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=m.useCallback(()=>s(o.current.isFocused&&o.current.isFocusVisible),[]),c=m.useCallback(f=>{o.current.isFocused=f,a(f),l()},[l]);_a(f=>{o.current.isFocusVisible=f,l()},[],{isTextInput:n});let{focusProps:d}=Ba({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=Wa({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:u,focusProps:r?p:d}}var za=Object.defineProperty,Ga=(e,t,n)=>t in e?za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ir=(e,t,n)=>(Ga(e,typeof t!="symbol"?t+"":t,n),n);let Ya=class{constructor(){ir(this,"current",this.detect()),ir(this,"handoffState","pending"),ir(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"}},Ke=new Ya;function Yt(e){var t,n;return Ke.isServer?null:e?"ownerDocument"in e?e.ownerDocument:"current"in e?(n=(t=e.current)==null?void 0:t.ownerDocument)!=null?n:document:null:document}function Ko(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ve(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},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 Ko(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=Ve();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 Pt(){let[e]=m.useState(Ve);return m.useEffect(()=>()=>e.dispose(),[e]),e}let ae=(e,t)=>{Ke.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Et(e){let t=m.useRef(e);return ae(()=>{t.current=e},[e]),t}let ee=function(e){let t=Et(e);return m.useCallback((...n)=>t.current(...n),[t])};function Ka(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 qa(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Xa({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),o=Pt(),i=ee(()=>{t.current=null,r(!1),o.dispose()}),a=ee(u=>{if(o.dispose(),t.current===null){t.current=u.currentTarget,r(!0);{let s=Yt(u.currentTarget);o.addEventListener(s,"pointerup",i,!1),o.addEventListener(s,"pointermove",l=>{if(t.current){let c=Ka(l);r(qa(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(s,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:a,onPointerUp:i,onClick:i}}}let Qa=m.createContext(void 0);function sr(){return m.useContext(Qa)}function lr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function De(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,De),r}var dn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(dn||{}),mt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(mt||{});function Pe(){let e=Za();return m.useCallback(t=>Ja({mergeRefs:e,...t}),[e])}function Ja({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:a,mergeRefs:u}){u=u??eu;let s=qo(t,e);if(i)return pn(s,n,r,a,u);let l=o??0;if(l&2){let{static:c=!1,...d}=s;if(c)return pn(d,n,r,a,u)}if(l&1){let{unmount:c=!0,...d}=s;return De(c?0:1,{0(){return null},1(){return pn({...d,hidden:!0,style:{display:"none"}},n,r,a,u)}})}return pn(s,n,r,a,u)}function pn(e,t={},n,r,o){let{as:i=n,children:a,refName:u="ref",...s}=ar(e,["unmount","static"]),l=e.ref!==void 0?{[u]:e.ref}:{},c=typeof a=="function"?a(t):a;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t)),s["aria-labelledby"]&&s["aria-labelledby"]===s.id&&(s["aria-labelledby"]=void 0);let d={};if(t){let p=!1,f=[];for(let[g,v]of Object.entries(t))typeof v=="boolean"&&(p=!0),v===!0&&f.push(g.replace(/([A-Z])/g,E=>`-${E.toLowerCase()}`));if(p){d["data-headlessui-state"]=f.join(" ");for(let g of f)d[`data-${g}`]=""}}if(i===m.Fragment&&(Object.keys(ht(s)).length>0||Object.keys(ht(d)).length>0))if(!m.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(ht(s)).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(ht(s)).concat(Object.keys(ht(d))).map(p=>` - ${p}`).join(`
60
+ */const Fo=ya("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class jo{constructor(){Me(this,"state");this.state={isLoading:!1,isApproving:!1,isDepositing:!1,error:null,txHash:null}}getState(){return{...this.state}}setState(t){this.state={...this.state,...t}}}class wa extends jo{constructor(n,r){super();Me(this,"smartWallet");Me(this,"currentActiveAccount");this.smartWallet=n,this.currentActiveAccount=r}getWalletType(){return"mpc"}getDisplayAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}isApprovalRequired(){return!1}getApprovalStatus(){return!0}async connect(){this.setState({isLoading:!0,error:null});try{this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){}async switchChain(n){}async getBalance(n){return"0"}async approve(n,r){return""}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{const o=`mpc_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return`mpc_signature_${Date.now()}`}getAAWalletAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}}class Ea extends jo{constructor(n,r,o,i="0",l="0"){super();Me(this,"currentActiveAccount");Me(this,"approved");Me(this,"chainId");Me(this,"balance");Me(this,"allowance");this.currentActiveAccount=n,this.approved=r,this.chainId=o,this.balance=i,this.allowance=l}getWalletType(){return"evm"}getDisplayAddress(){var n;return((n=this.currentActiveAccount)==null?void 0:n.ethAddress)||""}isApprovalRequired(){return!0}getApprovalStatus(){return this.approved}async connect(){this.setState({isLoading:!0,error:null});try{this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){}async switchChain(n){this.setState({isLoading:!0,error:null});try{this.chainId=n,this.setState({isLoading:!1})}catch(r){throw this.setState({isLoading:!1,error:r instanceof Error?r.message:"Chain switch failed"}),r}}async getBalance(n){return this.balance}async approve(n,r){this.setState({isApproving:!0,error:null});try{const o=`evm_approve_${Date.now()}`;return this.approved=!0,this.setState({isApproving:!1,txHash:o}),o}catch(o){throw this.setState({isApproving:!1,error:o instanceof Error?o.message:"Approval failed"}),o}}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{if(!this.approved)throw new Error("Token approval required");const o=`evm_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return`evm_signature_${Date.now()}`}updateApprovalStatus(n){this.approved=n}updateBalance(n){this.balance=n}updateAllowance(n){this.allowance=n}}function Ro(e,t,n,r,o,i){switch(e==null?void 0:e.wallet){case"mpc":return new wa(t,e);default:return new Ea(e,!1,r||1,o,i)}}const ko=typeof document<"u"?m.useLayoutEffect:()=>{};var qn;const Sa=(qn=m.useInsertionEffect)!==null&&qn!==void 0?qn:ko;function Ca(e){const t=m.useRef(null);return Sa(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const pt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},yt=e=>e&&"window"in e&&e.window===e?e:pt(e).defaultView||window;function Oa(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Ta(e){return Oa(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Na=!1;function Xn(){return Na}function _o(e,t){if(!Xn())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:Ta(n)?n=n.host:n=n.parentNode}return!1}const Qn=(e=document)=>{var t;if(!Xn())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 Bo(e){return Xn()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function an(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 Jn(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 it(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const Zn=it(function(){return Jn(/^Mac/i)}),Aa=it(function(){return Jn(/^iPhone/i)}),$a=it(function(){return Jn(/^iPad/i)||Zn()&&navigator.maxTouchPoints>1}),Pa=it(function(){return Aa()||$a()});it(function(){return Zn()||Pa()}),it(function(){return an(/AppleWebKit/i)&&!La()});const La=it(function(){return an(/Chrome/i)}),Ma=it(function(){return an(/Android/i)});it(function(){return an(/Firefox/i)});function Wo(){let e=m.useRef(new Map),t=m.useCallback((o,i,l,u)=>{let s=u!=null&&u.once?(...a)=>{e.current.delete(l),l(...a)}:l;e.current.set(l,{type:i,eventTarget:o,fn:s,options:u}),o.addEventListener(i,s,u)},[]),n=m.useCallback((o,i,l,u)=>{var s;let a=((s=e.current.get(l))===null||s===void 0?void 0:s.fn)||l;o.removeEventListener(i,a,u),e.current.delete(l)},[]),r=m.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return m.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Da(e){return e.mozInputSource===0&&e.isTrusted?!0:Ma()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Uo(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Ia(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function Vo(e){let t=m.useRef({isFocused:!1,observer:null});ko(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Ca(r=>{e==null||e(r)});return m.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=l=>{if(t.current.isFocused=!1,o.disabled){let u=Uo(l);n(u)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var l;(l=t.current.observer)===null||l===void 0||l.disconnect();let u=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:u})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:u}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Fa=!1,zt=null,er=new Set,Gt=new Map,wt=!1,tr=!1;const ja={Tab:!0,Escape:!0};function nr(e,t){for(let n of er)n(e,t)}function Ra(e){return!(e.metaKey||!Zn()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function un(e){wt=!0,Ra(e)&&(zt="keyboard",nr("keyboard",e))}function De(e){zt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(wt=!0,nr("pointer",e))}function Ho(e){Da(e)&&(wt=!0,zt="virtual")}function zo(e){e.target===window||e.target===document||Fa||!e.isTrusted||(!wt&&!tr&&(zt="virtual",nr("virtual",e)),wt=!1,tr=!1)}function Go(){wt=!1,tr=!0}function rr(e){if(typeof window>"u"||typeof document>"u"||Gt.get(yt(e)))return;const t=yt(e),n=pt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){wt=!0,r.apply(this,arguments)},n.addEventListener("keydown",un,!0),n.addEventListener("keyup",un,!0),n.addEventListener("click",Ho,!0),t.addEventListener("focus",zo,!0),t.addEventListener("blur",Go,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",De,!0),n.addEventListener("pointermove",De,!0),n.addEventListener("pointerup",De,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",De,!0),n.addEventListener("mousemove",De,!0),n.addEventListener("mouseup",De,!0)),t.addEventListener("beforeunload",()=>{Yo(e)},{once:!0}),Gt.set(t,{focus:r})}const Yo=(e,t)=>{const n=yt(e),r=pt(e);t&&r.removeEventListener("DOMContentLoaded",t),Gt.has(n)&&(n.HTMLElement.prototype.focus=Gt.get(n).focus,r.removeEventListener("keydown",un,!0),r.removeEventListener("keyup",un,!0),r.removeEventListener("click",Ho,!0),n.removeEventListener("focus",zo,!0),n.removeEventListener("blur",Go,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",De,!0),r.removeEventListener("pointermove",De,!0),r.removeEventListener("pointerup",De,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",De,!0),r.removeEventListener("mousemove",De,!0),r.removeEventListener("mouseup",De,!0)),Gt.delete(n))};function ka(e){const t=pt(e);let n;return t.readyState!=="loading"?rr(e):(n=()=>{rr(e)},t.addEventListener("DOMContentLoaded",n)),()=>Yo(e,n)}typeof document<"u"&&ka();function Ko(){return zt!=="pointer"}const _a=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ba(e,t,n){let r=pt(n==null?void 0:n.target);const o=typeof window<"u"?yt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?yt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?yt(n==null?void 0:n.target).HTMLElement:HTMLElement,u=typeof window<"u"?yt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!_a.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof u&&!ja[n.key])}function Wa(e,t,n){rr(),m.useEffect(()=>{let r=(o,i)=>{Ba(!!(n!=null&&n.isTextInput),o,i)&&e(Ko())};return er.add(r),()=>{er.delete(r)}},t)}function Ua(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=m.useCallback(s=>{if(s.target===s.currentTarget)return r&&r(s),o&&o(!1),!0},[r,o]),l=Vo(i),u=m.useCallback(s=>{const a=pt(s.target),c=a?Qn(a):Qn();s.target===s.currentTarget&&c===Bo(s.nativeEvent)&&(n&&n(s),o&&o(!0),l(s))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?u:void 0,onBlur:!t&&(r||o)?i:void 0}}}function Va(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=m.useRef({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:u}=Wo(),s=m.useCallback(d=>{d.currentTarget.contains(d.target)&&i.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(i.current.isFocusWithin=!1,u(),n&&n(d),o&&o(!1))},[n,o,i,u]),a=Vo(s),c=m.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const p=pt(d.target),f=Qn(p);if(!i.current.isFocusWithin&&f===Bo(d.nativeEvent)){r&&r(d),o&&o(!0),i.current.isFocusWithin=!0,a(d);let g=d.currentTarget;l(p,"focus",v=>{if(i.current.isFocusWithin&&!_o(g,v.target)){let S=new p.defaultView.FocusEvent("blur",{relatedTarget:v.target});Ia(S,g);let D=Uo(S);s(D)}},{capture:!0})}},[r,o,a,l,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:s}}}let cn=!1,fn=0;function or(){cn=!0,setTimeout(()=>{cn=!1},50)}function qo(e){e.pointerType==="touch"&&or()}function Ha(){if(!(typeof document>"u"))return fn===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",qo):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",or)),fn++,()=>{fn--,!(fn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",qo):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",or))}}function za(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=m.useState(!1),u=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(Ha,[]);let{addGlobalListener:s,removeAllGlobalListeners:a}=Wo(),{hoverProps:c,triggerHoverEnd:d}=m.useMemo(()=>{let p=(v,S)=>{if(u.pointerType=S,o||S==="touch"||u.isHovered||!v.currentTarget.contains(v.target))return;u.isHovered=!0;let D=v.currentTarget;u.target=D,s(pt(v.target),"pointerover",w=>{u.isHovered&&u.target&&!_o(u.target,w.target)&&f(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:D,pointerType:S}),n&&n(!0),l(!0)},f=(v,S)=>{let D=u.target;u.pointerType="",u.target=null,!(S==="touch"||!u.isHovered||!D)&&(u.isHovered=!1,a(),r&&r({type:"hoverend",target:D,pointerType:S}),n&&n(!1),l(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=v=>{cn&&v.pointerType==="mouse"||p(v,v.pointerType)},g.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(g.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},g.onMouseEnter=v=>{!u.ignoreEmulatedMouseEvents&&!cn&&p(v,"mouse"),u.ignoreEmulatedMouseEvents=!1},g.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,"mouse")}),{hoverProps:g,triggerHoverEnd:f}},[t,n,r,o,u,s,a]);return m.useEffect(()=>{o&&d({currentTarget:u.target},u.pointerType)},[o]),{hoverProps:c,isHovered:i}}function Ga(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=m.useRef({isFocused:!1,isFocusVisible:t||Ko()}),[i,l]=m.useState(!1),[u,s]=m.useState(()=>o.current.isFocused&&o.current.isFocusVisible),a=m.useCallback(()=>s(o.current.isFocused&&o.current.isFocusVisible),[]),c=m.useCallback(f=>{o.current.isFocused=f,l(f),a()},[a]);Wa(f=>{o.current.isFocusVisible=f,a()},[],{isTextInput:n});let{focusProps:d}=Ua({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=Va({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:u,focusProps:r?p:d}}var Ya=Object.defineProperty,Ka=(e,t,n)=>t in e?Ya(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ir=(e,t,n)=>(Ka(e,typeof t!="symbol"?t+"":t,n),n);let qa=class{constructor(){ir(this,"current",this.detect()),ir(this,"handoffState","pending"),ir(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"}},qe=new qa;function Yt(e){var t,n;return qe.isServer?null:e?"ownerDocument"in e?e.ownerDocument:"current"in e?(n=(t=e.current)==null?void 0:t.ownerDocument)!=null?n:document:null:document}function Xo(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ze(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},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 Xo(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=ze();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 Pt(){let[e]=m.useState(ze);return m.useEffect(()=>()=>e.dispose(),[e]),e}let ae=(e,t)=>{qe.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Et(e){let t=m.useRef(e);return ae(()=>{t.current=e},[e]),t}let te=function(e){let t=Et(e);return m.useCallback((...n)=>t.current(...n),[t])};function Xa(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 Qa(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Ja({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),o=Pt(),i=te(()=>{t.current=null,r(!1),o.dispose()}),l=te(u=>{if(o.dispose(),t.current===null){t.current=u.currentTarget,r(!0);{let s=Yt(u.currentTarget);o.addEventListener(s,"pointerup",i,!1),o.addEventListener(s,"pointermove",a=>{if(t.current){let c=Xa(a);r(Qa(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(s,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let Za=m.createContext(void 0);function sr(){return m.useContext(Za)}function lr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Ie(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,Ie),r}var dn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(dn||{}),mt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(mt||{});function Le(){let e=tu();return m.useCallback(t=>eu({mergeRefs:e,...t}),[e])}function eu({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:u}){u=u??nu;let s=Qo(t,e);if(i)return pn(s,n,r,l,u);let a=o??0;if(a&2){let{static:c=!1,...d}=s;if(c)return pn(d,n,r,l,u)}if(a&1){let{unmount:c=!0,...d}=s;return Ie(c?0:1,{0(){return null},1(){return pn({...d,hidden:!0,style:{display:"none"}},n,r,l,u)}})}return pn(s,n,r,l,u)}function pn(e,t={},n,r,o){let{as:i=n,children:l,refName:u="ref",...s}=ar(e,["unmount","static"]),a=e.ref!==void 0?{[u]:e.ref}:{},c=typeof l=="function"?l(t):l;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t)),s["aria-labelledby"]&&s["aria-labelledby"]===s.id&&(s["aria-labelledby"]=void 0);let d={};if(t){let p=!1,f=[];for(let[g,v]of Object.entries(t))typeof v=="boolean"&&(p=!0),v===!0&&f.push(g.replace(/([A-Z])/g,S=>`-${S.toLowerCase()}`));if(p){d["data-headlessui-state"]=f.join(" ");for(let g of f)d[`data-${g}`]=""}}if(i===m.Fragment&&(Object.keys(ht(s)).length>0||Object.keys(ht(d)).length>0))if(!m.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(ht(s)).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(ht(s)).concat(Object.keys(ht(d))).map(p=>` - ${p}`).join(`
61
61
  `),"","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(`
62
62
  `)].join(`
63
- `))}else{let p=c.props,f=p==null?void 0:p.className,g=typeof f=="function"?(...I)=>lr(f(...I),s.className):lr(f,s.className),v=g?{className:g}:{},E=qo(c.props,ht(ar(s,["ref"])));for(let I in d)I in E&&delete d[I];return m.cloneElement(c,Object.assign({},E,d,l,{ref:o(tu(c),l.ref)},v))}return m.createElement(i,Object.assign({},ar(s,["ref"]),i!==m.Fragment&&l,i!==m.Fragment&&d),c)}function Za(){let e=m.useRef([]),t=m.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function eu(...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 qo(...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 i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let a=n[r];for(let u of a){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...i)}}});return t}function Xo(...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 i=n[r];for(let a of i)a==null||a(...o)}});return t}function Ce(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function ht(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function ar(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function tu(e){return m.version.split(".")[0]>="19"?e.props.ref:e.ref}function nu(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,a=m.useRef(i),u=m.useRef(!1),s=m.useRef(!1);return i&&!a.current&&!u.current?(u.current=!0,a.current=i,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.")):!i&&a.current&&!s.current&&(s.current=!0,a.current=i,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.")),[i?e:r,ee(l=>(i||o(l),t==null?void 0:t(l)))]}function ru(e){let[t]=m.useState(e);return t}function Qo(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))Zo(n,Jo(t,r),o);return n}function Jo(e,t){return e?e+"["+t+"]":t}function Zo(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())Zo(e,Jo(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,""]):Qo(n,t,e)}function ou(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)}}let iu="span";var ur=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ur||{});function su(e,t){var n;let{features:r=1,...o}=e,i={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 Pe()({ourProps:i,theirProps:o,slot:{},defaultTag:iu,name:"Hidden"})}let ei=Ce(su),lu=m.createContext(null);function au({children:e}){let t=m.useContext(lu);if(!t)return m.createElement(m.Fragment,null,e);let{target:n}=t;return n?we.createPortal(m.createElement(m.Fragment,null,e),n):null}function uu({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,a]=m.useState(null),u=Pt();return m.useEffect(()=>{if(r&&i)return u.addEventListener(i,"reset",r)},[i,t,r]),m.createElement(au,null,m.createElement(cu,{setForm:a,formId:t}),Qo(e).map(([s,l])=>m.createElement(ei,{features:ur.Hidden,...ht({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:s,value:l,...o})})))}function cu({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:m.createElement(ei,{features:ur.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let fu=m.createContext(void 0);function ti(){return m.useContext(fu)}function cr(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function mn(e){return cr(e)&&"tagName"in e}function st(e){return mn(e)&&"accessKey"in e}function Lt(e){return mn(e)&&"tabIndex"in e}function du(e){return mn(e)&&"style"in e}function pu(e){return st(e)&&e.nodeName==="IFRAME"}function ni(e){return st(e)&&e.nodeName==="INPUT"}function ri(e){return st(e)&&e.nodeName==="LABEL"}function mu(e){return st(e)&&e.nodeName==="FIELDSET"}function oi(e){return st(e)&&e.nodeName==="LEGEND"}function hu(e){return mn(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function gu(e){let t=e.parentElement,n=null;for(;t&&!mu(t);)oi(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&vu(n)?!1:r}function vu(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(oi(t))return!1;t=t.previousElementSibling}return!0}let ii=Symbol();function bu(e,t=!0){return Object.assign(e,{[ii]:t})}function Ie(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=ee(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[ii]))?void 0:n}let fr=m.createContext(null);fr.displayName="DescriptionContext";function si(){let e=m.useContext(fr);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,si),t}return e}function xu(){var e,t;return(t=(e=m.useContext(fr))==null?void 0:e.value)!=null?t:void 0}let yu="p";function wu(e,t){let n=m.useId(),r=sr(),{id:o=`headlessui-description-${n}`,...i}=e,a=si(),u=Ie(t);ae(()=>a.register(o),[o,a.register]);let s=r||!1,l=m.useMemo(()=>({...a.slot,disabled:s}),[a.slot,s]),c={ref:u,...a.props,id:o};return Pe()({ourProps:c,theirProps:i,slot:l,defaultTag:yu,name:a.name||"Description"})}let Eu=Ce(wu);Object.assign(Eu,{});var ge=(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))(ge||{});let hn=m.createContext(null);hn.displayName="LabelContext";function li(){let e=m.useContext(hn);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,li),t}return e}function ai(e){var t,n,r;let o=(n=(t=m.useContext(hn))==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 Su({inherit:e=!1}={}){let t=ai(),[n,r]=m.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,m.useMemo(()=>function(i){let a=ee(s=>(r(l=>[...l,s]),()=>r(l=>{let c=l.slice(),d=c.indexOf(s);return d!==-1&&c.splice(d,1),c}))),u=m.useMemo(()=>({register:a,slot:i.slot,name:i.name,props:i.props,value:i.value}),[a,i.slot,i.name,i.props,i.value]);return m.createElement(hn.Provider,{value:u},i.children)},[r])]}let Cu="label";function Ou(e,t){var n;let r=m.useId(),o=li(),i=ti(),a=sr(),{id:u=`headlessui-label-${r}`,htmlFor:s=i??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...c}=e,d=Ie(t);ae(()=>o.register(u),[u,o.register]);let p=ee(E=>{let I=E.currentTarget;if(!(E.target!==E.currentTarget&&hu(E.target))&&(ri(I)&&E.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(E),ri(I))){let x=document.getElementById(I.htmlFor);if(x){let P=x.getAttribute("disabled");if(P==="true"||P==="")return;let F=x.getAttribute("aria-disabled");if(F==="true"||F==="")return;(ni(x)&&(x.type==="file"||x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),f=a||!1,g=m.useMemo(()=>({...o.slot,disabled:f}),[o.slot,f]),v={ref:d,...o.props,id:u,htmlFor:s,onClick:p};return l&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in c&&delete c.onClick),Pe()({ourProps:v,theirProps:c,slot:g,defaultTag:s?Cu:"div",name:o.name||"Label"})}let Tu=Ce(Ou),Nu=Object.assign(Tu,{});function Au(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 $u(e=Au){return m.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 Pu(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Lu(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),o=m.useMemo(()=>Pu(e),[e,n]);return ae(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let ui=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 Mu=Object.defineProperty,Du=(e,t,n)=>t in e?Mu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Iu=(e,t,n)=>(Du(e,t+"",n),n),ci=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Fe=(e,t,n)=>(ci(e,t,"read from private field"),n?n.call(e):t.get(e)),dr=(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)},fi=(e,t,n,r)=>(ci(e,t,"write to private field"),t.set(e,n),n),qe,Kt,qt;let di=class{constructor(t){dr(this,qe,{}),dr(this,Kt,new ui(()=>new Set)),dr(this,qt,new Set),Iu(this,"disposables",Ve()),fi(this,qe,t),Ke.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Fe(this,qe)}subscribe(t,n){if(Ke.isServer)return()=>{};let r={selector:t,callback:n,current:t(Fe(this,qe))};return Fe(this,qt).add(r),this.disposables.add(()=>{Fe(this,qt).delete(r)})}on(t,n){return Ke.isServer?()=>{}:(Fe(this,Kt).get(t).add(n),this.disposables.add(()=>{Fe(this,Kt).get(t).delete(n)}))}send(t){let n=this.reduce(Fe(this,qe),t);if(n!==Fe(this,qe)){fi(this,qe,n);for(let r of Fe(this,qt)){let o=r.selector(Fe(this,qe));pi(r.current,o)||(r.current=o,r.callback(o))}for(let r of Fe(this,Kt).get(t.type))r(Fe(this,qe),t)}}};qe=new WeakMap,Kt=new WeakMap,qt=new WeakMap;function pi(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:pr(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:pr(e.entries(),t.entries()):mi(e)&&mi(t)?pr(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function pr(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 mi(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function mr(e){let[t,n]=e(),r=Ve();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Fu=Object.defineProperty,ju=(e,t,n)=>t in e?Fu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hi=(e,t,n)=>(ju(e,typeof t!="symbol"?t+"":t,n),n),gi=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(gi||{});let Ru={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let i=e.stack.slice();return i.splice(o,1),i.push(n),r=i,{...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}}},ku=class Jl extends di{constructor(){super(...arguments),hi(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),hi(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Jl({stack:[]})}reduce(t,n){return De(n.type,Ru,t,n)}};const hr=new ui(()=>ku.new());var gr={exports:{}},vr={};/**
63
+ `))}else{let p=c.props,f=p==null?void 0:p.className,g=typeof f=="function"?(...D)=>lr(f(...D),s.className):lr(f,s.className),v=g?{className:g}:{},S=Qo(c.props,ht(ar(s,["ref"])));for(let D in d)D in S&&delete d[D];return m.cloneElement(c,Object.assign({},S,d,a,{ref:o(ru(c),a.ref)},v))}return m.createElement(i,Object.assign({},ar(s,["ref"]),i!==m.Fragment&&a,i!==m.Fragment&&d),c)}function tu(){let e=m.useRef([]),t=m.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function nu(...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 Qo(...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 i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let l=n[r];for(let u of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...i)}}});return t}function Jo(...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 i=n[r];for(let l of i)l==null||l(...o)}});return t}function Ce(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function ht(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function ar(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function ru(e){return m.version.split(".")[0]>="19"?e.props.ref:e.ref}function ou(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,l=m.useRef(i),u=m.useRef(!1),s=m.useRef(!1);return i&&!l.current&&!u.current?(u.current=!0,l.current=i,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.")):!i&&l.current&&!s.current&&(s.current=!0,l.current=i,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.")),[i?e:r,te(a=>(i||o(a),t==null?void 0:t(a)))]}function iu(e){let[t]=m.useState(e);return t}function Zo(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))ti(n,ei(t,r),o);return n}function ei(e,t){return e?e+"["+t+"]":t}function ti(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())ti(e,ei(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,""]):Zo(n,t,e)}function su(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)}}let lu="span";var ur=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ur||{});function au(e,t){var n;let{features:r=1,...o}=e,i={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 Le()({ourProps:i,theirProps:o,slot:{},defaultTag:lu,name:"Hidden"})}let ni=Ce(au),uu=m.createContext(null);function cu({children:e}){let t=m.useContext(uu);if(!t)return m.createElement(m.Fragment,null,e);let{target:n}=t;return n?we.createPortal(m.createElement(m.Fragment,null,e),n):null}function fu({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=m.useState(null),u=Pt();return m.useEffect(()=>{if(r&&i)return u.addEventListener(i,"reset",r)},[i,t,r]),m.createElement(cu,null,m.createElement(du,{setForm:l,formId:t}),Zo(e).map(([s,a])=>m.createElement(ni,{features:ur.Hidden,...ht({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:s,value:a,...o})})))}function du({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:m.createElement(ni,{features:ur.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let pu=m.createContext(void 0);function ri(){return m.useContext(pu)}function cr(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function mn(e){return cr(e)&&"tagName"in e}function st(e){return mn(e)&&"accessKey"in e}function Lt(e){return mn(e)&&"tabIndex"in e}function mu(e){return mn(e)&&"style"in e}function hu(e){return st(e)&&e.nodeName==="IFRAME"}function oi(e){return st(e)&&e.nodeName==="INPUT"}function ii(e){return st(e)&&e.nodeName==="LABEL"}function gu(e){return st(e)&&e.nodeName==="FIELDSET"}function si(e){return st(e)&&e.nodeName==="LEGEND"}function vu(e){return mn(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function bu(e){let t=e.parentElement,n=null;for(;t&&!gu(t);)si(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&xu(n)?!1:r}function xu(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(si(t))return!1;t=t.previousElementSibling}return!0}let li=Symbol();function yu(e,t=!0){return Object.assign(e,{[li]:t})}function Fe(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=te(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[li]))?void 0:n}let fr=m.createContext(null);fr.displayName="DescriptionContext";function ai(){let e=m.useContext(fr);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,ai),t}return e}function wu(){var e,t;return(t=(e=m.useContext(fr))==null?void 0:e.value)!=null?t:void 0}let Eu="p";function Su(e,t){let n=m.useId(),r=sr(),{id:o=`headlessui-description-${n}`,...i}=e,l=ai(),u=Fe(t);ae(()=>l.register(o),[o,l.register]);let s=r||!1,a=m.useMemo(()=>({...l.slot,disabled:s}),[l.slot,s]),c={ref:u,...l.props,id:o};return Le()({ourProps:c,theirProps:i,slot:a,defaultTag:Eu,name:l.name||"Description"})}let Cu=Ce(Su);Object.assign(Cu,{});var ge=(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))(ge||{});let hn=m.createContext(null);hn.displayName="LabelContext";function ui(){let e=m.useContext(hn);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,ui),t}return e}function ci(e){var t,n,r;let o=(n=(t=m.useContext(hn))==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 Ou({inherit:e=!1}={}){let t=ci(),[n,r]=m.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,m.useMemo(()=>function(i){let l=te(s=>(r(a=>[...a,s]),()=>r(a=>{let c=a.slice(),d=c.indexOf(s);return d!==-1&&c.splice(d,1),c}))),u=m.useMemo(()=>({register:l,slot:i.slot,name:i.name,props:i.props,value:i.value}),[l,i.slot,i.name,i.props,i.value]);return m.createElement(hn.Provider,{value:u},i.children)},[r])]}let Tu="label";function Nu(e,t){var n;let r=m.useId(),o=ui(),i=ri(),l=sr(),{id:u=`headlessui-label-${r}`,htmlFor:s=i??((n=o.props)==null?void 0:n.htmlFor),passive:a=!1,...c}=e,d=Fe(t);ae(()=>o.register(u),[u,o.register]);let p=te(S=>{let D=S.currentTarget;if(!(S.target!==S.currentTarget&&vu(S.target))&&(ii(D)&&S.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(S),ii(D))){let w=document.getElementById(D.htmlFor);if(w){let N=w.getAttribute("disabled");if(N==="true"||N==="")return;let F=w.getAttribute("aria-disabled");if(F==="true"||F==="")return;(oi(w)&&(w.type==="file"||w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.focus({preventScroll:!0})}}}),f=l||!1,g=m.useMemo(()=>({...o.slot,disabled:f}),[o.slot,f]),v={ref:d,...o.props,id:u,htmlFor:s,onClick:p};return a&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in c&&delete c.onClick),Le()({ourProps:v,theirProps:c,slot:g,defaultTag:s?Tu:"div",name:o.name||"Label"})}let Au=Ce(Nu),$u=Object.assign(Au,{});function Pu(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 Lu(e=Pu){return m.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 Mu(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Du(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),o=m.useMemo(()=>Mu(e),[e,n]);return ae(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let fi=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 Iu=Object.defineProperty,Fu=(e,t,n)=>t in e?Iu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ju=(e,t,n)=>(Fu(e,t+"",n),n),di=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},je=(e,t,n)=>(di(e,t,"read from private field"),n?n.call(e):t.get(e)),dr=(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)},pi=(e,t,n,r)=>(di(e,t,"write to private field"),t.set(e,n),n),Xe,Kt,qt;let mi=class{constructor(t){dr(this,Xe,{}),dr(this,Kt,new fi(()=>new Set)),dr(this,qt,new Set),ju(this,"disposables",ze()),pi(this,Xe,t),qe.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return je(this,Xe)}subscribe(t,n){if(qe.isServer)return()=>{};let r={selector:t,callback:n,current:t(je(this,Xe))};return je(this,qt).add(r),this.disposables.add(()=>{je(this,qt).delete(r)})}on(t,n){return qe.isServer?()=>{}:(je(this,Kt).get(t).add(n),this.disposables.add(()=>{je(this,Kt).get(t).delete(n)}))}send(t){let n=this.reduce(je(this,Xe),t);if(n!==je(this,Xe)){pi(this,Xe,n);for(let r of je(this,qt)){let o=r.selector(je(this,Xe));hi(r.current,o)||(r.current=o,r.callback(o))}for(let r of je(this,Kt).get(t.type))r(je(this,Xe),t)}}};Xe=new WeakMap,Kt=new WeakMap,qt=new WeakMap;function hi(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:pr(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:pr(e.entries(),t.entries()):gi(e)&&gi(t)?pr(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function pr(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 gi(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function mr(e){let[t,n]=e(),r=ze();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Ru=Object.defineProperty,ku=(e,t,n)=>t in e?Ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vi=(e,t,n)=>(ku(e,typeof t!="symbol"?t+"":t,n),n),bi=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(bi||{});let _u={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let i=e.stack.slice();return i.splice(o,1),i.push(n),r=i,{...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}}},Bu=class ea extends mi{constructor(){super(...arguments),vi(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),vi(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new ea({stack:[]})}reduce(t,n){return Ie(n.type,_u,t,n)}};const hr=new fi(()=>Bu.new());var gr={exports:{}},vr={};/**
64
64
  * @license React
65
65
  * use-sync-external-store-with-selector.production.js
66
66
  *
@@ -68,7 +68,7 @@ React keys must be passed directly to JSX without using spread:
68
68
  *
69
69
  * This source code is licensed under the MIT license found in the
70
70
  * LICENSE file in the root directory of this source tree.
71
- */var vi;function _u(){if(vi)return vr;vi=1;var e=m;function t(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,u=e.useDebugValue;return vr.useSyncExternalStoreWithSelector=function(s,l,c,d,p){var f=o(null);if(f.current===null){var g={hasValue:!1,value:null};f.current=g}else g=f.current;f=a(function(){function E(R){if(!I){if(I=!0,x=R,R=d(R),p!==void 0&&g.hasValue){var B=g.value;if(p(B,R))return P=B}return P=R}if(B=P,n(x,R))return B;var V=d(R);return p!==void 0&&p(B,V)?(x=R,B):(x=R,P=V)}var I=!1,x,P,F=c===void 0?null:c;return[function(){return E(l())},F===null?void 0:function(){return E(F())}]},[l,c,d,p]);var v=r(s,f[0],f[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),u(v),v},vr}var br={};/**
71
+ */var xi;function Wu(){if(xi)return vr;xi=1;var e=m;function t(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,l=e.useMemo,u=e.useDebugValue;return vr.useSyncExternalStoreWithSelector=function(s,a,c,d,p){var f=o(null);if(f.current===null){var g={hasValue:!1,value:null};f.current=g}else g=f.current;f=l(function(){function S(R){if(!D){if(D=!0,w=R,R=d(R),p!==void 0&&g.hasValue){var B=g.value;if(p(B,R))return N=B}return N=R}if(B=N,n(w,R))return B;var V=d(R);return p!==void 0&&p(B,V)?(w=R,B):(w=R,N=V)}var D=!1,w,N,F=c===void 0?null:c;return[function(){return S(a())},F===null?void 0:function(){return S(F())}]},[a,c,d,p]);var v=r(s,f[0],f[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),u(v),v},vr}var br={};/**
72
72
  * @license React
73
73
  * use-sync-external-store-with-selector.development.js
74
74
  *
@@ -76,39 +76,39 @@ React keys must be passed directly to JSX without using spread:
76
76
  *
77
77
  * This source code is licensed under the MIT license found in the
78
78
  * LICENSE file in the root directory of this source tree.
79
- */var bi;function Bu(){return bi||(bi=1,process.env.NODE_ENV!=="production"&&function(){function e(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=m,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,a=t.useMemo,u=t.useDebugValue;br.useSyncExternalStoreWithSelector=function(s,l,c,d,p){var f=o(null);if(f.current===null){var g={hasValue:!1,value:null};f.current=g}else g=f.current;f=a(function(){function E(R){if(!I){if(I=!0,x=R,R=d(R),p!==void 0&&g.hasValue){var B=g.value;if(p(B,R))return P=B}return P=R}if(B=P,n(x,R))return B;var V=d(R);return p!==void 0&&p(B,V)?(x=R,B):(x=R,P=V)}var I=!1,x,P,F=c===void 0?null:c;return[function(){return E(l())},F===null?void 0:function(){return E(F())}]},[l,c,d,p]);var v=r(s,f[0],f[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),u(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),br}process.env.NODE_ENV==="production"?gr.exports=_u():gr.exports=Bu();var Wu=gr.exports;function je(e,t,n=pi){return Wu.useSyncExternalStoreWithSelector(ee(r=>e.subscribe(Uu,r)),ee(()=>e.state),ee(()=>e.state),ee(t),n)}function Uu(e){return e}function xi(e,t){let n=m.useId(),r=hr.get(t),[o,i]=je(r,m.useCallback(a=>[r.selectors.isTop(a,n),r.selectors.inStack(a,n)],[r,n]));return ae(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?i?o:!0:!1}let xr=new Map,Xt=new Map;function yi(e){var t;let n=(t=Xt.get(e))!=null?t:0;return Xt.set(e,n+1),n!==0?()=>wi(e):(xr.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>wi(e))}function wi(e){var t;let n=(t=Xt.get(e))!=null?t:1;if(n===1?Xt.delete(e):Xt.set(e,n-1),n!==1)return;let r=xr.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,xr.delete(e))}function Vu(e,{allowed:t,disallowed:n}={}){let r=xi(e,"inert-others");ae(()=>{var o,i;if(!r)return;let a=Ve();for(let s of(o=n==null?void 0:n())!=null?o:[])s&&a.add(yi(s));let u=(i=t==null?void 0:t())!=null?i:[];for(let s of u){if(!s)continue;let l=Yt(s);if(!l)continue;let c=s.parentElement;for(;c&&c!==l.body;){for(let d of c.children)u.some(p=>d.contains(p))||a.add(yi(d));c=c.parentElement}}return a.dispose},[r,t,n])}function Hu(e,t,n){let r=Et(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});m.useEffect(()=>{if(!e)return;let o=t===null?null:st(t)?t:t.current;if(!o)return;let i=Ve();if(typeof ResizeObserver<"u"){let a=new ResizeObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}return()=>i.dispose()},[t,r,e])}let yr=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),zu=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var wr=(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))(wr||{}),Gu=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Gu||{}),Yu=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Yu||{});function Ei(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(yr)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Ku(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(zu)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Er=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Er||{});function Si(e,t=0){var n;return e===((n=Yt(e))==null?void 0:n.body)?!1:De(t,{0(){return e.matches(yr)},1(){let r=e;for(;r!==null;){if(r.matches(yr))return!0;r=r.parentElement}return!1}})}var qu=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(qu||{});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 Xu=["textarea","input"].join(",");function Qu(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Xu))!=null?n:!1}function Ci(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let a=o.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ju(e,t){return Zu(Ei(),t,{relativeTo:e})}function Zu(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?n?Ci(e):e:t&64?Ku(e):Ei(e);o.length>0&&a.length>1&&(a=a.filter(f=>!o.some(g=>g!=null&&"current"in g?(g==null?void 0:g.current)===f:g===f))),r=r??i.activeElement;let u=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(r))-1;if(t&4)return Math.max(0,a.indexOf(r))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},c=0,d=a.length,p;do{if(c>=d||c+d<=0)return 0;let f=s+c;if(t&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}p=a[f],p==null||p.focus(l),c+=u}while(p!==i.activeElement);return t&6&&Qu(p)&&p.select(),2}function Oi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ec(){return/Android/gi.test(window.navigator.userAgent)}function Ti(){return Oi()||ec()}function Mt(e,t,n,r){let o=Et(n);m.useEffect(()=>{if(!e)return;function i(a){o.current(a)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function tc(e,t,n,r){let o=Et(n);m.useEffect(()=>{if(!e)return;function i(a){o.current(a)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const Ni=30;function nc(e,t,n){let r=Et(n),o=m.useCallback(function(u,s){if(u.defaultPrevented)return;let l=s(u);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function d(p){return typeof p=="function"?d(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let d of c)if(d!==null&&(d.contains(l)||u.composed&&u.composedPath().includes(d)))return;return!Si(l,Er.Loose)&&l.tabIndex!==-1&&u.preventDefault(),r.current(u,l)},[r,t]),i=m.useRef(null);Mt(e,"pointerdown",u=>{var s,l;Ti()||(i.current=((l=(s=u.composedPath)==null?void 0:s.call(u))==null?void 0:l[0])||u.target)},!0),Mt(e,"pointerup",u=>{if(Ti()||!i.current)return;let s=i.current;return i.current=null,o(u,()=>s)},!0);let a=m.useRef({x:0,y:0});Mt(e,"touchstart",u=>{a.current.x=u.touches[0].clientX,a.current.y=u.touches[0].clientY},!0),Mt(e,"touchend",u=>{let s={x:u.changedTouches[0].clientX,y:u.changedTouches[0].clientY};if(!(Math.abs(s.x-a.current.x)>=Ni||Math.abs(s.y-a.current.y)>=Ni))return o(u,()=>Lt(u.target)?u.target:null)},!0),tc(e,"blur",u=>o(u,()=>pu(window.document.activeElement)?window.document.activeElement:null),!0)}function Sr(...e){return m.useMemo(()=>Yt(...e),[...e])}var rc=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(rc||{});const gn={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},oc=200,Ai=5;function ic(e,{trigger:t,action:n,close:r,select:o}){let i=m.useRef(null),a=m.useRef(null),u=m.useRef(null);Mt(e&&t!==null,"pointerdown",s=>{cr(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(a.current=s.x,u.current=s.y,i.current=s.timeStamp)}),Mt(e&&t!==null,"pointerup",s=>{var l,c;let d=i.current;if(d===null||(i.current=null,!Lt(s.target))||Math.abs(s.x-((l=a.current)!=null?l:s.x))<Ai&&Math.abs(s.y-((c=u.current)!=null?c:s.y))<Ai)return;let p=n(s);switch(p.kind){case 0:return;case 1:{s.timeStamp-d>oc&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function sc(e,t){return m.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function lc(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function ac(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let a=t[o].call(n,...i);a&&(n=a,r.forEach(u=>u()))}}}function uc(){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),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function cc(){return Oi()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let u=Ve();u.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>u.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,a=null;t.addEventListener(e,"click",u=>{if(Lt(u.target))try{let s=u.target.closest("a");if(!s)return;let{hash:l}=new URL(s.href),c=e.querySelector(l);Lt(c)&&!r(c)&&(a=c)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(Lt(u.target)&&du(u.target))if(r(u.target)){let s=u.target;for(;s.parentElement&&r(s.parentElement);)s=s.parentElement;t.style(s,"overscrollBehavior","contain")}else t.style(u.target,"touchAction","none")}),t.addEventListener(e,"touchmove",u=>{if(Lt(u.target)){if(ni(u.target))return;if(r(u.target)){let s=u.target;for(;s.parentElement&&s.dataset.headlessuiPortal!==""&&!(s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth);)s=s.parentElement;s.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),t.add(()=>{var u;let s=(u=window.scrollY)!=null?u:window.pageYOffset;i!==s&&window.scrollTo(0,i),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function fc(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function dc(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let St=ac(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Ve(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:dc(n)},o=[cc(),uc(),fc()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});St.subscribe(()=>{let e=St.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)&&St.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&St.dispatch("TEARDOWN",n)}});function pc(e,t,n=()=>({containers:[]})){let r=lc(St),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ae(()=>{if(!(!t||!e))return St.dispatch("PUSH",t,n),()=>St.dispatch("POP",t,n)},[e,t]),i}function mc(e,t,n=()=>[document.body]){let r=xi(e,"scroll-lock");pc(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function $i(e){return[e.screenX,e.screenY]}function hc(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=$i(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=$i(t)}}}function gc(e=0){let[t,n]=m.useState(e),r=m.useCallback(s=>n(s),[t]),o=m.useCallback(s=>n(l=>l|s),[t]),i=m.useCallback(s=>(t&s)===s,[t]),a=m.useCallback(s=>n(l=>l&~s),[n]),u=m.useCallback(s=>n(l=>l^s),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:u}}var Pi,Li;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Pi=process==null?void 0:process.env)==null?void 0:Pi.NODE_ENV)==="test"&&typeof((Li=Element==null?void 0:Element.prototype)==null?void 0:Li.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(`
80
- `)),[]});var vc=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(vc||{});function Mi(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Di(e,t,n,r){let[o,i]=m.useState(n),{hasFlag:a,addFlag:u,removeFlag:s}=gc(e&&o?3:0),l=m.useRef(!1),c=m.useRef(!1),d=Pt();return ae(()=>{var p;if(e){if(n&&i(!0),!t){n&&u(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),bc(t,{inFlight:l,prepare(){c.current?c.current=!1:c.current=l.current,l.current=!0,!c.current&&(n?(u(3),s(4)):(u(4),s(2)))},run(){c.current?n?(s(3),u(4)):(s(4),u(3)):n?s(1):u(1)},done(){var f;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(l.current=!1,s(7),n||i(!1),(f=r==null?void 0:r.end)==null||f.call(r,n))}})}},[e,n,t,d]),e?[o,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function bc(e,{prepare:t,run:n,done:r,inFlight:o}){let i=Ve();return yc(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(xc(e,r))})}),i.dispose}function xc(e,t){var n,r;let o=Ve();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let a=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(u=>u instanceof CSSTransition))!=null?r:[];return a.length===0?(t(),o.dispose):(Promise.allSettled(a.map(u=>u.finished)).then(()=>{i||t()}),o.dispose)}function yc(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 vn(){return typeof window<"u"}function Dt(e){return Cr(e)?(e.nodeName||"").toLowerCase():"#document"}function Oe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xe(e){var t;return(t=(Cr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Cr(e){return vn()?e instanceof Node||e instanceof Oe(e).Node:!1}function re(e){return vn()?e instanceof Element||e instanceof Oe(e).Element:!1}function Ee(e){return vn()?e instanceof HTMLElement||e instanceof Oe(e).HTMLElement:!1}function Or(e){return!vn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Oe(e).ShadowRoot}const wc=new Set(["inline","contents"]);function Qt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Re(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!wc.has(o)}const Ec=new Set(["table","td","th"]);function Sc(e){return Ec.has(Dt(e))}const Cc=[":popover-open",":modal"];function bn(e){return Cc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Oc=["transform","translate","scale","rotate","perspective"],Tc=["transform","translate","scale","rotate","perspective","filter"],Nc=["paint","layout","strict","content"];function Tr(e){const t=xn(),n=re(e)?Re(e):e;return Oc.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)||Tc.some(r=>(n.willChange||"").includes(r))||Nc.some(r=>(n.contain||"").includes(r))}function Ac(e){let t=at(e);for(;Ee(t)&&!lt(t);){if(Tr(t))return t;if(bn(t))return null;t=at(t)}return null}function xn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $c=new Set(["html","body","#document"]);function lt(e){return $c.has(Dt(e))}function Re(e){return Oe(e).getComputedStyle(e)}function yn(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function at(e){if(Dt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Or(e)&&e.host||Xe(e);return Or(t)?t.host:t}function Ii(e){const t=at(e);return lt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ee(t)&&Qt(t)?t:Ii(t)}function gt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ii(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Oe(o);if(i){const u=Nr(a);return t.concat(a,a.visualViewport||[],Qt(o)?o:[],u&&n?gt(u):[])}return t.concat(o,gt(o,[],n))}function Nr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pc(){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 ut=Math.min,xe=Math.max,Jt=Math.round,wn=Math.floor,Qe=e=>({x:e,y:e}),Lc={left:"right",right:"left",bottom:"top",top:"bottom"},Mc={start:"end",end:"start"};function Ar(e,t,n){return xe(e,ut(t,n))}function Ct(e,t){return typeof e=="function"?e(t):e}function vt(e){return e.split("-")[0]}function It(e){return e.split("-")[1]}function Fi(e){return e==="x"?"y":"x"}function $r(e){return e==="y"?"height":"width"}const Dc=new Set(["top","bottom"]);function ct(e){return Dc.has(vt(e))?"y":"x"}function Pr(e){return Fi(ct(e))}function Ic(e,t,n){n===void 0&&(n=!1);const r=It(e),o=Pr(e),i=$r(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=En(a)),[a,En(a)]}function Fc(e){const t=En(e);return[Lr(e),t,Lr(t)]}function Lr(e){return e.replace(/start|end/g,t=>Mc[t])}const ji=["left","right"],Ri=["right","left"],jc=["top","bottom"],Rc=["bottom","top"];function kc(e,t,n){switch(e){case"top":case"bottom":return n?t?Ri:ji:t?ji:Ri;case"left":case"right":return t?jc:Rc;default:return[]}}function _c(e,t,n,r){const o=It(e);let i=kc(vt(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Lr)))),i}function En(e){return e.replace(/left|right|bottom|top/g,t=>Lc[t])}function Bc(e){return{top:0,right:0,bottom:0,left:0,...e}}function ki(e){return typeof e!="number"?Bc(e):{top:e,right:e,bottom:e,left:e}}function Sn(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}}/*!
79
+ */var yi;function Uu(){return yi||(yi=1,process.env.NODE_ENV!=="production"&&function(){function e(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=m,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,l=t.useMemo,u=t.useDebugValue;br.useSyncExternalStoreWithSelector=function(s,a,c,d,p){var f=o(null);if(f.current===null){var g={hasValue:!1,value:null};f.current=g}else g=f.current;f=l(function(){function S(R){if(!D){if(D=!0,w=R,R=d(R),p!==void 0&&g.hasValue){var B=g.value;if(p(B,R))return N=B}return N=R}if(B=N,n(w,R))return B;var V=d(R);return p!==void 0&&p(B,V)?(w=R,B):(w=R,N=V)}var D=!1,w,N,F=c===void 0?null:c;return[function(){return S(a())},F===null?void 0:function(){return S(F())}]},[a,c,d,p]);var v=r(s,f[0],f[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),u(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),br}process.env.NODE_ENV==="production"?gr.exports=Wu():gr.exports=Uu();var Vu=gr.exports;function Re(e,t,n=hi){return Vu.useSyncExternalStoreWithSelector(te(r=>e.subscribe(Hu,r)),te(()=>e.state),te(()=>e.state),te(t),n)}function Hu(e){return e}function wi(e,t){let n=m.useId(),r=hr.get(t),[o,i]=Re(r,m.useCallback(l=>[r.selectors.isTop(l,n),r.selectors.inStack(l,n)],[r,n]));return ae(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?i?o:!0:!1}let xr=new Map,Xt=new Map;function Ei(e){var t;let n=(t=Xt.get(e))!=null?t:0;return Xt.set(e,n+1),n!==0?()=>Si(e):(xr.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Si(e))}function Si(e){var t;let n=(t=Xt.get(e))!=null?t:1;if(n===1?Xt.delete(e):Xt.set(e,n-1),n!==1)return;let r=xr.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,xr.delete(e))}function zu(e,{allowed:t,disallowed:n}={}){let r=wi(e,"inert-others");ae(()=>{var o,i;if(!r)return;let l=ze();for(let s of(o=n==null?void 0:n())!=null?o:[])s&&l.add(Ei(s));let u=(i=t==null?void 0:t())!=null?i:[];for(let s of u){if(!s)continue;let a=Yt(s);if(!a)continue;let c=s.parentElement;for(;c&&c!==a.body;){for(let d of c.children)u.some(p=>d.contains(p))||l.add(Ei(d));c=c.parentElement}}return l.dispose},[r,t,n])}function Gu(e,t,n){let r=Et(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});m.useEffect(()=>{if(!e)return;let o=t===null?null:st(t)?t:t.current;if(!o)return;let i=ze();if(typeof ResizeObserver<"u"){let l=new ResizeObserver(()=>r.current(o));l.observe(o),i.add(()=>l.disconnect())}if(typeof IntersectionObserver<"u"){let l=new IntersectionObserver(()=>r.current(o));l.observe(o),i.add(()=>l.disconnect())}return()=>i.dispose()},[t,r,e])}let yr=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Yu=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var wr=(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))(wr||{}),Ku=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ku||{}),qu=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(qu||{});function Ci(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(yr)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Xu(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Yu)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Er=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Er||{});function Oi(e,t=0){var n;return e===((n=Yt(e))==null?void 0:n.body)?!1:Ie(t,{0(){return e.matches(yr)},1(){let r=e;for(;r!==null;){if(r.matches(yr))return!0;r=r.parentElement}return!1}})}var Qu=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Qu||{});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 Ju=["textarea","input"].join(",");function Zu(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Ju))!=null?n:!1}function Ti(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let l=o.compareDocumentPosition(i);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ec(e,t){return tc(Ci(),t,{relativeTo:e})}function tc(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?n?Ti(e):e:t&64?Xu(e):Ci(e);o.length>0&&l.length>1&&(l=l.filter(f=>!o.some(g=>g!=null&&"current"in g?(g==null?void 0:g.current)===f:g===f))),r=r??i.activeElement;let u=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,l.indexOf(r))-1;if(t&4)return Math.max(0,l.indexOf(r))+1;if(t&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=t&32?{preventScroll:!0}:{},c=0,d=l.length,p;do{if(c>=d||c+d<=0)return 0;let f=s+c;if(t&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}p=l[f],p==null||p.focus(a),c+=u}while(p!==i.activeElement);return t&6&&Zu(p)&&p.select(),2}function Ni(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function nc(){return/Android/gi.test(window.navigator.userAgent)}function Ai(){return Ni()||nc()}function Mt(e,t,n,r){let o=Et(n);m.useEffect(()=>{if(!e)return;function i(l){o.current(l)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function rc(e,t,n,r){let o=Et(n);m.useEffect(()=>{if(!e)return;function i(l){o.current(l)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const $i=30;function oc(e,t,n){let r=Et(n),o=m.useCallback(function(u,s){if(u.defaultPrevented)return;let a=s(u);if(a===null||!a.getRootNode().contains(a)||!a.isConnected)return;let c=function d(p){return typeof p=="function"?d(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let d of c)if(d!==null&&(d.contains(a)||u.composed&&u.composedPath().includes(d)))return;return!Oi(a,Er.Loose)&&a.tabIndex!==-1&&u.preventDefault(),r.current(u,a)},[r,t]),i=m.useRef(null);Mt(e,"pointerdown",u=>{var s,a;Ai()||(i.current=((a=(s=u.composedPath)==null?void 0:s.call(u))==null?void 0:a[0])||u.target)},!0),Mt(e,"pointerup",u=>{if(Ai()||!i.current)return;let s=i.current;return i.current=null,o(u,()=>s)},!0);let l=m.useRef({x:0,y:0});Mt(e,"touchstart",u=>{l.current.x=u.touches[0].clientX,l.current.y=u.touches[0].clientY},!0),Mt(e,"touchend",u=>{let s={x:u.changedTouches[0].clientX,y:u.changedTouches[0].clientY};if(!(Math.abs(s.x-l.current.x)>=$i||Math.abs(s.y-l.current.y)>=$i))return o(u,()=>Lt(u.target)?u.target:null)},!0),rc(e,"blur",u=>o(u,()=>hu(window.document.activeElement)?window.document.activeElement:null),!0)}function Sr(...e){return m.useMemo(()=>Yt(...e),[...e])}var ic=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(ic||{});const gn={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},sc=200,Pi=5;function lc(e,{trigger:t,action:n,close:r,select:o}){let i=m.useRef(null),l=m.useRef(null),u=m.useRef(null);Mt(e&&t!==null,"pointerdown",s=>{cr(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(l.current=s.x,u.current=s.y,i.current=s.timeStamp)}),Mt(e&&t!==null,"pointerup",s=>{var a,c;let d=i.current;if(d===null||(i.current=null,!Lt(s.target))||Math.abs(s.x-((a=l.current)!=null?a:s.x))<Pi&&Math.abs(s.y-((c=u.current)!=null?c:s.y))<Pi)return;let p=n(s);switch(p.kind){case 0:return;case 1:{s.timeStamp-d>sc&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function ac(e,t){return m.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function uc(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function cc(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let l=t[o].call(n,...i);l&&(n=l,r.forEach(u=>u()))}}}function fc(){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),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function dc(){return Ni()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let u=ze();u.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>u.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;t.addEventListener(e,"click",u=>{if(Lt(u.target))try{let s=u.target.closest("a");if(!s)return;let{hash:a}=new URL(s.href),c=e.querySelector(a);Lt(c)&&!r(c)&&(l=c)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(Lt(u.target)&&mu(u.target))if(r(u.target)){let s=u.target;for(;s.parentElement&&r(s.parentElement);)s=s.parentElement;t.style(s,"overscrollBehavior","contain")}else t.style(u.target,"touchAction","none")}),t.addEventListener(e,"touchmove",u=>{if(Lt(u.target)){if(oi(u.target))return;if(r(u.target)){let s=u.target;for(;s.parentElement&&s.dataset.headlessuiPortal!==""&&!(s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth);)s=s.parentElement;s.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),t.add(()=>{var u;let s=(u=window.scrollY)!=null?u:window.pageYOffset;i!==s&&window.scrollTo(0,i),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function pc(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function mc(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let St=cc(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ze(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:mc(n)},o=[dc(),fc(),pc()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});St.subscribe(()=>{let e=St.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)&&St.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&St.dispatch("TEARDOWN",n)}});function hc(e,t,n=()=>({containers:[]})){let r=uc(St),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ae(()=>{if(!(!t||!e))return St.dispatch("PUSH",t,n),()=>St.dispatch("POP",t,n)},[e,t]),i}function gc(e,t,n=()=>[document.body]){let r=wi(e,"scroll-lock");hc(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Li(e){return[e.screenX,e.screenY]}function vc(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=Li(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Li(t)}}}function bc(e=0){let[t,n]=m.useState(e),r=m.useCallback(s=>n(s),[t]),o=m.useCallback(s=>n(a=>a|s),[t]),i=m.useCallback(s=>(t&s)===s,[t]),l=m.useCallback(s=>n(a=>a&~s),[n]),u=m.useCallback(s=>n(a=>a^s),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:u}}var Mi,Di;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Mi=process==null?void 0:process.env)==null?void 0:Mi.NODE_ENV)==="test"&&typeof((Di=Element==null?void 0:Element.prototype)==null?void 0:Di.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(`
80
+ `)),[]});var xc=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(xc||{});function Ii(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Fi(e,t,n,r){let[o,i]=m.useState(n),{hasFlag:l,addFlag:u,removeFlag:s}=bc(e&&o?3:0),a=m.useRef(!1),c=m.useRef(!1),d=Pt();return ae(()=>{var p;if(e){if(n&&i(!0),!t){n&&u(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),yc(t,{inFlight:a,prepare(){c.current?c.current=!1:c.current=a.current,a.current=!0,!c.current&&(n?(u(3),s(4)):(u(4),s(2)))},run(){c.current?n?(s(3),u(4)):(s(4),u(3)):n?s(1):u(1)},done(){var f;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(a.current=!1,s(7),n||i(!1),(f=r==null?void 0:r.end)==null||f.call(r,n))}})}},[e,n,t,d]),e?[o,{closed:l(1),enter:l(2),leave:l(4),transition:l(2)||l(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function yc(e,{prepare:t,run:n,done:r,inFlight:o}){let i=ze();return Ec(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(wc(e,r))})}),i.dispose}function wc(e,t){var n,r;let o=ze();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let l=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(u=>u instanceof CSSTransition))!=null?r:[];return l.length===0?(t(),o.dispose):(Promise.allSettled(l.map(u=>u.finished)).then(()=>{i||t()}),o.dispose)}function Ec(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 vn(){return typeof window<"u"}function Dt(e){return Cr(e)?(e.nodeName||"").toLowerCase():"#document"}function Oe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qe(e){var t;return(t=(Cr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Cr(e){return vn()?e instanceof Node||e instanceof Oe(e).Node:!1}function re(e){return vn()?e instanceof Element||e instanceof Oe(e).Element:!1}function Ee(e){return vn()?e instanceof HTMLElement||e instanceof Oe(e).HTMLElement:!1}function Or(e){return!vn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Oe(e).ShadowRoot}const Sc=new Set(["inline","contents"]);function Qt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Sc.has(o)}const Cc=new Set(["table","td","th"]);function Oc(e){return Cc.has(Dt(e))}const Tc=[":popover-open",":modal"];function bn(e){return Tc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Nc=["transform","translate","scale","rotate","perspective"],Ac=["transform","translate","scale","rotate","perspective","filter"],$c=["paint","layout","strict","content"];function Tr(e){const t=xn(),n=re(e)?ke(e):e;return Nc.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)||Ac.some(r=>(n.willChange||"").includes(r))||$c.some(r=>(n.contain||"").includes(r))}function Pc(e){let t=at(e);for(;Ee(t)&&!lt(t);){if(Tr(t))return t;if(bn(t))return null;t=at(t)}return null}function xn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Lc=new Set(["html","body","#document"]);function lt(e){return Lc.has(Dt(e))}function ke(e){return Oe(e).getComputedStyle(e)}function yn(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function at(e){if(Dt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Or(e)&&e.host||Qe(e);return Or(t)?t.host:t}function ji(e){const t=at(e);return lt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ee(t)&&Qt(t)?t:ji(t)}function gt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ji(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=Oe(o);if(i){const u=Nr(l);return t.concat(l,l.visualViewport||[],Qt(o)?o:[],u&&n?gt(u):[])}return t.concat(o,gt(o,[],n))}function Nr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mc(){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 ut=Math.min,xe=Math.max,Jt=Math.round,wn=Math.floor,Je=e=>({x:e,y:e}),Dc={left:"right",right:"left",bottom:"top",top:"bottom"},Ic={start:"end",end:"start"};function Ar(e,t,n){return xe(e,ut(t,n))}function Ct(e,t){return typeof e=="function"?e(t):e}function vt(e){return e.split("-")[0]}function It(e){return e.split("-")[1]}function Ri(e){return e==="x"?"y":"x"}function $r(e){return e==="y"?"height":"width"}const Fc=new Set(["top","bottom"]);function ct(e){return Fc.has(vt(e))?"y":"x"}function Pr(e){return Ri(ct(e))}function jc(e,t,n){n===void 0&&(n=!1);const r=It(e),o=Pr(e),i=$r(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=En(l)),[l,En(l)]}function Rc(e){const t=En(e);return[Lr(e),t,Lr(t)]}function Lr(e){return e.replace(/start|end/g,t=>Ic[t])}const ki=["left","right"],_i=["right","left"],kc=["top","bottom"],_c=["bottom","top"];function Bc(e,t,n){switch(e){case"top":case"bottom":return n?t?_i:ki:t?ki:_i;case"left":case"right":return t?kc:_c;default:return[]}}function Wc(e,t,n,r){const o=It(e);let i=Bc(vt(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(Lr)))),i}function En(e){return e.replace(/left|right|bottom|top/g,t=>Dc[t])}function Uc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Bi(e){return typeof e!="number"?Uc(e):{top:e,right:e,bottom:e,left:e}}function Sn(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}}/*!
81
81
  * tabbable 6.2.0
82
82
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
83
- */var Wc=["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])"],Mr=Wc.join(","),_i=typeof Element>"u",Zt=_i?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Cn=!_i&&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},On=function e(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"),i=o===""||o==="true",a=i||n&&t&&e(t.parentNode);return a},Uc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Vc=function(t,n,r){if(On(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Mr));return n&&Zt.call(t,Mr)&&o.unshift(t),o=o.filter(r),o},Hc=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!On(a,!1))if(a.tagName==="SLOT"){var u=a.assignedElements(),s=u.length?u:a.children,l=e(s,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l})}else{var c=Zt.call(a,Mr);c&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var d=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!On(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(d&&p){var f=e(d===!0?a.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:a,candidates:f})}else i.unshift.apply(i,a.children)}}return o},Bi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Wi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Uc(t))&&!Bi(t)?0:t.tabIndex},zc=function(t,n){var r=Wi(t);return r<0&&n&&!Bi(t)?0:r},Gc=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ui=function(t){return t.tagName==="INPUT"},Yc=function(t){return Ui(t)&&t.type==="hidden"},Kc=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},qc=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Xc=function(t){if(!t.name)return!0;var n=t.form||Cn(t),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},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(a){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",a.message),!1}var i=qc(o,t.form);return!i||i===t},Qc=function(t){return Ui(t)&&t.type==="radio"},Jc=function(t){return Qc(t)&&!Xc(t)},Zc=function(t){var n,r=t&&Cn(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var a,u,s;for(i=!!((a=o)!==null&&a!==void 0&&(u=a.ownerDocument)!==null&&u!==void 0&&u.contains(o)||t!=null&&(s=t.ownerDocument)!==null&&s!==void 0&&s.contains(t));!i&&o;){var l,c,d;r=Cn(o),o=(l=r)===null||l===void 0?void 0:l.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},Vi=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},ef=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=Zt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(Zt.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var s=t.parentElement,l=Cn(t);if(s&&!s.shadowRoot&&o(s)===!0)return Vi(t);t.assignedSlot?t=t.assignedSlot:!s&&l!==t.ownerDocument?t=l.host:t=s}t=u}if(Zc(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Vi(t);return!1},tf=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 Zt.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},nf=function(t,n){return!(n.disabled||On(n)||Yc(n)||ef(n,t)||Kc(n)||tf(n))},Hi=function(t,n){return!(Jc(n)||Wi(n)<0||!nf(t,n))},rf=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},of=function e(t){var n=[],r=[];return t.forEach(function(o,i){var a=!!o.scopeParent,u=a?o.scopeParent:o,s=zc(u,a),l=a?e(o.candidates):u;s===0?a?n.push.apply(n,l):n.push(u):r.push({documentOrder:i,tabIndex:s,item:o,isScope:a,content:l})}),r.sort(Gc).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},zi=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Hc([t],n.includeContainer,{filter:Hi.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:rf}):r=Vc(t,n.includeContainer,Hi.bind(null,n)),of(r)};function Gi(e,t,n){let{reference:r,floating:o}=e;const i=ct(t),a=Pr(t),u=$r(a),s=vt(t),l=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[u]/2-o[u]/2;let f;switch(s){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(It(t)){case"start":f[a]-=p*(n&&l?-1:1);break;case"end":f[a]+=p*(n&&l?-1:1);break}return f}const sf=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,u=i.filter(Boolean),s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Gi(l,r,s),p=r,f={},g=0;for(let v=0;v<u.length;v++){const{name:E,fn:I}=u[v],{x,y:P,data:F,reset:R}=await I({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:l,platform:a,elements:{reference:e,floating:t}});c=x??c,d=P??d,f={...f,[E]:{...f[E],...F}},R&&g<=50&&(g++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(l=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:c,y:d}=Gi(l,p,s)),v=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}};async function Tn(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:u,strategy:s}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Ct(t,e),g=ki(f),E=u[p?d==="floating"?"reference":"floating":d],I=Sn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:l,rootBoundary:c,strategy:s})),x=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),F=await(i.isElement==null?void 0:i.isElement(P))?await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1}:{x:1,y:1},R=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:x,offsetParent:P,strategy:s}):x);return{top:(I.top-R.top+g.top)/F.y,bottom:(R.bottom-I.bottom+g.bottom)/F.y,left:(I.left-R.left+g.left)/F.x,right:(R.right-I.right+g.right)/F.x}}const lf=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:u,middlewareData:s}=t,{element:l,padding:c=0}=Ct(e,t)||{};if(l==null)return{};const d=ki(c),p={x:n,y:r},f=Pr(o),g=$r(f),v=await a.getDimensions(l),E=f==="y",I=E?"top":"left",x=E?"bottom":"right",P=E?"clientHeight":"clientWidth",F=i.reference[g]+i.reference[f]-p[f]-i.floating[g],R=p[f]-i.reference[f],B=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let V=B?B[P]:0;(!V||!await(a.isElement==null?void 0:a.isElement(B)))&&(V=u.floating[P]||i.floating[g]);const h=F/2-R/2,y=V/2-v[g]/2-1,b=ut(d[I],y),A=ut(d[x],y),C=b,N=V-v[g]-A,T=V/2-v[g]/2+h,S=Ar(C,T,N),L=!s.arrow&&It(o)!=null&&T!==S&&i.reference[g]/2-(T<C?b:A)-v[g]/2<0,$=L?T<C?T-C:T-N:0;return{[f]:p[f]+$,data:{[f]:S,centerOffset:T-S-$,...L&&{alignmentOffset:$}},reset:L}}}),af=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:u,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...E}=Ct(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const I=vt(o),x=ct(u),P=vt(u)===u,F=await(s.isRTL==null?void 0:s.isRTL(l.floating)),R=p||(P||!v?[En(u)]:Fc(u)),B=g!=="none";!p&&B&&R.push(..._c(u,v,g,F));const V=[u,...R],h=await Tn(t,E),y=[];let b=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&y.push(h[I]),d){const T=Ic(o,a,F);y.push(h[T[0]],h[T[1]])}if(b=[...b,{placement:o,overflows:y}],!y.every(T=>T<=0)){var A,C;const T=(((A=i.flip)==null?void 0:A.index)||0)+1,S=V[T];if(S&&(!(d==="alignment"?x!==ct(S):!1)||b.every(w=>ct(w.placement)===x?w.overflows[0]>0:!0)))return{data:{index:T,overflows:b},reset:{placement:S}};let L=(C=b.filter($=>$.overflows[0]<=0).sort(($,w)=>$.overflows[1]-w.overflows[1])[0])==null?void 0:C.placement;if(!L)switch(f){case"bestFit":{var N;const $=(N=b.filter(w=>{if(B){const D=ct(w.placement);return D===x||D==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(D=>D>0).reduce((D,_)=>D+_,0)]).sort((w,D)=>w[1]-D[1])[0])==null?void 0:N[0];$&&(L=$);break}case"initialPlacement":L=u;break}if(o!==L)return{reset:{placement:L}}}return{}}}},uf=new Set(["left","top"]);async function cf(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=vt(n),u=It(n),s=ct(n)==="y",l=uf.has(a)?-1:1,c=i&&s?-1:1,d=Ct(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return u&&typeof g=="number"&&(f=u==="end"?g*-1:g),s?{x:f*c,y:p*l}:{x:p*l,y:f*c}}const ff=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:u}=t,s=await cf(t,e);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:a}}}}},df=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:E=>{let{x:I,y:x}=E;return{x:I,y:x}}},...s}=Ct(e,t),l={x:n,y:r},c=await Tn(t,s),d=ct(vt(o)),p=Fi(d);let f=l[p],g=l[d];if(i){const E=p==="y"?"top":"left",I=p==="y"?"bottom":"right",x=f+c[E],P=f-c[I];f=Ar(x,f,P)}if(a){const E=d==="y"?"top":"left",I=d==="y"?"bottom":"right",x=g+c[E],P=g-c[I];g=Ar(x,g,P)}const v=u.fn({...t,[p]:f,[d]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:i,[d]:a}}}}}},pf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:u}=t,{apply:s=()=>{},...l}=Ct(e,t),c=await Tn(t,l),d=vt(o),p=It(o),f=ct(o)==="y",{width:g,height:v}=i.floating;let E,I;d==="top"||d==="bottom"?(E=d,I=p===(await(a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(I=d,E=p==="end"?"top":"bottom");const x=v-c.top-c.bottom,P=g-c.left-c.right,F=ut(v-c[E],x),R=ut(g-c[I],P),B=!t.middlewareData.shift;let V=F,h=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(h=P),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(V=x),B&&!p){const b=xe(c.left,0),A=xe(c.right,0),C=xe(c.top,0),N=xe(c.bottom,0);f?h=g-2*(b!==0||A!==0?b+A:xe(c.left,c.right)):V=v-2*(C!==0||N!==0?C+N:xe(c.top,c.bottom))}await s({...t,availableWidth:h,availableHeight:V});const y=await a.getDimensions(u.floating);return g!==y.width||v!==y.height?{reset:{rects:!0}}:{}}}};function Yi(e){const t=Re(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ee(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,u=Jt(n)!==i||Jt(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function Dr(e){return re(e)?e:e.contextElement}function Ft(e){const t=Dr(e);if(!Ee(t))return Qe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Yi(t);let a=(i?Jt(n.width):n.width)/r,u=(i?Jt(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const mf=Qe(0);function Ki(e){const t=Oe(e);return!xn()||!t.visualViewport?mf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Oe(e)?!1:t}function Ot(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Dr(e);let a=Qe(1);t&&(r?re(r)&&(a=Ft(r)):a=Ft(e));const u=hf(i,n,r)?Ki(i):Qe(0);let s=(o.left+u.x)/a.x,l=(o.top+u.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const p=Oe(i),f=r&&re(r)?Oe(r):r;let g=p,v=Nr(g);for(;v&&r&&f!==g;){const E=Ft(v),I=v.getBoundingClientRect(),x=Re(v),P=I.left+(v.clientLeft+parseFloat(x.paddingLeft))*E.x,F=I.top+(v.clientTop+parseFloat(x.paddingTop))*E.y;s*=E.x,l*=E.y,c*=E.x,d*=E.y,s+=P,l+=F,g=Oe(v),v=Nr(g)}}return Sn({width:c,height:d,x:s,y:l})}function Nn(e,t){const n=yn(e).scrollLeft;return t?t.left+n:Ot(Xe(e)).left+n}function qi(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Nn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function gf(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=Xe(r),u=t?bn(t.floating):!1;if(r===a||u&&i)return n;let s={scrollLeft:0,scrollTop:0},l=Qe(1);const c=Qe(0),d=Ee(r);if((d||!d&&!i)&&((Dt(r)!=="body"||Qt(a))&&(s=yn(r)),Ee(r))){const f=Ot(r);l=Ft(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}const p=a&&!d&&!i?qi(a,s):Qe(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-s.scrollLeft*l.x+c.x+p.x,y:n.y*l.y-s.scrollTop*l.y+c.y+p.y}}function vf(e){return Array.from(e.getClientRects())}function bf(e){const t=Xe(e),n=yn(e),r=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Nn(e);const u=-n.scrollTop;return Re(r).direction==="rtl"&&(a+=xe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:u}}const Xi=25;function xf(e,t){const n=Oe(e),r=Xe(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,u=0,s=0;if(o){i=o.width,a=o.height;const c=xn();(!c||c&&t==="fixed")&&(u=o.offsetLeft,s=o.offsetTop)}const l=Nn(r);if(l<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),f=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-f);g<=Xi&&(i-=g)}else l<=Xi&&(i+=l);return{width:i,height:a,x:u,y:s}}const yf=new Set(["absolute","fixed"]);function wf(e,t){const n=Ot(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ee(e)?Ft(e):Qe(1),a=e.clientWidth*i.x,u=e.clientHeight*i.y,s=o*i.x,l=r*i.y;return{width:a,height:u,x:s,y:l}}function Qi(e,t,n){let r;if(t==="viewport")r=xf(e,n);else if(t==="document")r=bf(Xe(e));else if(re(t))r=wf(t,n);else{const o=Ki(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Sn(r)}function Ji(e,t){const n=at(e);return n===t||!re(n)||lt(n)?!1:Re(n).position==="fixed"||Ji(n,t)}function Ef(e,t){const n=t.get(e);if(n)return n;let r=gt(e,[],!1).filter(u=>re(u)&&Dt(u)!=="body"),o=null;const i=Re(e).position==="fixed";let a=i?at(e):e;for(;re(a)&&!lt(a);){const u=Re(a),s=Tr(a);!s&&u.position==="fixed"&&(o=null),(i?!s&&!o:!s&&u.position==="static"&&!!o&&yf.has(o.position)||Qt(a)&&!s&&Ji(e,a))?r=r.filter(c=>c!==a):o=u,a=at(a)}return t.set(e,r),r}function Sf(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?bn(t)?[]:Ef(t,this._c):[].concat(n),r],u=a[0],s=a.reduce((l,c)=>{const d=Qi(t,c,o);return l.top=xe(d.top,l.top),l.right=ut(d.right,l.right),l.bottom=ut(d.bottom,l.bottom),l.left=xe(d.left,l.left),l},Qi(t,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Cf(e){const{width:t,height:n}=Yi(e);return{width:t,height:n}}function Of(e,t,n){const r=Ee(t),o=Xe(t),i=n==="fixed",a=Ot(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const s=Qe(0);function l(){s.x=Nn(o)}if(r||!r&&!i)if((Dt(t)!=="body"||Qt(o))&&(u=yn(t)),r){const f=Ot(t,!0,i,t);s.x=f.x+t.clientLeft,s.y=f.y+t.clientTop}else o&&l();i&&!r&&o&&l();const c=o&&!r&&!i?qi(o,u):Qe(0),d=a.left+u.scrollLeft-s.x-c.x,p=a.top+u.scrollTop-s.y-c.y;return{x:d,y:p,width:a.width,height:a.height}}function Ir(e){return Re(e).position==="static"}function Zi(e,t){if(!Ee(e)||Re(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xe(e)===n&&(n=n.ownerDocument.body),n}function es(e,t){const n=Oe(e);if(bn(e))return n;if(!Ee(e)){let o=at(e);for(;o&&!lt(o);){if(re(o)&&!Ir(o))return o;o=at(o)}return n}let r=Zi(e,t);for(;r&&Sc(r)&&Ir(r);)r=Zi(r,t);return r&&lt(r)&&Ir(r)&&!Tr(r)?n:r||Ac(e)||n}const Tf=async function(e){const t=this.getOffsetParent||es,n=this.getDimensions,r=await n(e.floating);return{reference:Of(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nf(e){return Re(e).direction==="rtl"}const Af={convertOffsetParentRelativeRectToViewportRelativeRect:gf,getDocumentElement:Xe,getClippingRect:Sf,getOffsetParent:es,getElementRects:Tf,getClientRects:vf,getDimensions:Cf,getScale:Ft,isElement:re,isRTL:Nf};function ts(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $f(e,t){let n=null,r;const o=Xe(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function a(u,s){u===void 0&&(u=!1),s===void 0&&(s=1),i();const l=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=l;if(u||t(),!p||!f)return;const g=wn(d),v=wn(o.clientWidth-(c+p)),E=wn(o.clientHeight-(d+f)),I=wn(c),P={rootMargin:-g+"px "+-v+"px "+-E+"px "+-I+"px",threshold:xe(0,ut(1,s))||1};let F=!0;function R(B){const V=B[0].intersectionRatio;if(V!==s){if(!F)return a();V?a(!1,V):r=setTimeout(()=>{a(!1,1e-7)},1e3)}V===1&&!ts(l,e.getBoundingClientRect())&&a(),F=!1}try{n=new IntersectionObserver(R,{...P,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,P)}n.observe(e)}return a(!0),i}function ns(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,l=Dr(e),c=o||i?[...l?gt(l):[],...gt(t)]:[];c.forEach(I=>{o&&I.addEventListener("scroll",n,{passive:!0}),i&&I.addEventListener("resize",n)});const d=l&&u?$f(l,n):null;let p=-1,f=null;a&&(f=new ResizeObserver(I=>{let[x]=I;x&&x.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var P;(P=f)==null||P.observe(t)})),n()}),l&&!s&&f.observe(l),f.observe(t));let g,v=s?Ot(e):null;s&&E();function E(){const I=Ot(e);v&&!ts(v,I)&&n(),v=I,g=requestAnimationFrame(E)}return n(),()=>{var I;c.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),d==null||d(),(I=f)==null||I.disconnect(),f=null,s&&cancelAnimationFrame(g)}}const Fr=Tn,Pf=ff,Lf=df,Mf=af,Df=pf,rs=lf,If=(e,t,n)=>{const r=new Map,o={platform:Af,...n},i={...o.platform,_c:r};return sf(e,t,{...o,platform:i})};var Ff=typeof document<"u",jf=function(){},An=Ff?m.useLayoutEffect:jf;function $n(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(!$n(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!$n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function os(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function is(e,t){const n=os(e);return Math.round(t*n)/n}function jr(e){const t=j.useRef(e);return An(()=>{t.current=e}),t}function ss(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:u=!0,whileElementsMounted:s,open:l}=e,[c,d]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=j.useState(r);$n(p,r)||f(r);const[g,v]=j.useState(null),[E,I]=j.useState(null),x=j.useCallback(w=>{w!==B.current&&(B.current=w,v(w))},[]),P=j.useCallback(w=>{w!==V.current&&(V.current=w,I(w))},[]),F=i||g,R=a||E,B=j.useRef(null),V=j.useRef(null),h=j.useRef(c),y=s!=null,b=jr(s),A=jr(o),C=jr(l),N=j.useCallback(()=>{if(!B.current||!V.current)return;const w={placement:t,strategy:n,middleware:p};A.current&&(w.platform=A.current),If(B.current,V.current,w).then(D=>{const _={...D,isPositioned:C.current!==!1};T.current&&!$n(h.current,_)&&(h.current=_,Ut.flushSync(()=>{d(_)}))})},[p,t,n,A,C]);An(()=>{l===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,d(w=>({...w,isPositioned:!1})))},[l]);const T=j.useRef(!1);An(()=>(T.current=!0,()=>{T.current=!1}),[]),An(()=>{if(F&&(B.current=F),R&&(V.current=R),F&&R){if(b.current)return b.current(F,R,N);N()}},[F,R,N,b,y]);const S=j.useMemo(()=>({reference:B,floating:V,setReference:x,setFloating:P}),[x,P]),L=j.useMemo(()=>({reference:F,floating:R}),[F,R]),$=j.useMemo(()=>{const w={position:n,left:0,top:0};if(!L.floating)return w;const D=is(L.floating,c.x),_=is(L.floating,c.y);return u?{...w,transform:"translate("+D+"px, "+_+"px)",...os(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:_}},[n,u,L.floating,c.x,c.y]);return j.useMemo(()=>({...c,update:N,refs:S,elements:L,floatingStyles:$}),[c,N,S,L,$])}const Rf=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?rs({element:r.current,padding:o}).fn(n):{}:r?rs({element:r,padding:o}).fn(n):{}}}},Rr=(e,t)=>({...Pf(e),options:[e,t]}),ls=(e,t)=>({...Lf(e),options:[e,t]}),as=(e,t)=>({...Mf(e),options:[e,t]}),kf=(e,t)=>({...Df(e),options:[e,t]}),_f=(e,t)=>({...Rf(e),options:[e,t]}),us={...j},Bf=us.useInsertionEffect||(e=>e());function cs(e){const t=j.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Bf(()=>{t.current=e}),j.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 kr=typeof document<"u"?m.useLayoutEffect:m.useEffect;let fs=!1,Wf=0;const ds=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Wf++;function Uf(){const[e,t]=j.useState(()=>fs?ds():void 0);return kr(()=>{e==null&&t(ds())},[]),j.useEffect(()=>{fs=!0},[]),e}const Vf=us.useId||Uf;let en;process.env.NODE_ENV!=="production"&&(en=new Set);function Hf(){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=en)!=null&&e.has(o))){var i;(i=en)==null||i.add(o),console.warn(o)}}function zf(){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=en)!=null&&e.has(o))){var i;(i=en)==null||i.add(o),console.error(o)}}function Gf(){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 Yf=j.createContext(null),Kf=j.createContext(null),qf=()=>{var e;return((e=j.useContext(Yf))==null?void 0:e.id)||null},Xf=()=>j.useContext(Kf),Qf="data-floating-ui-focusable";function Jf(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Vf(),i=j.useRef({}),[a]=j.useState(()=>Gf()),u=qf()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!re(f)&&zf("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,l]=j.useState(r.reference),c=cs((f,g,v)=>{i.current.openEvent=f?g:void 0,a.emit("openchange",{open:f,event:g,reason:v,nested:u}),n==null||n(f,g,v)}),d=j.useMemo(()=>({setPositionReference:l}),[]),p=j.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return j.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:a,floatingId:o,refs:d}),[t,c,p,a,o,d])}function Zf(e){e===void 0&&(e={});const{nodeId:t}=e,n=Jf({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,a]=j.useState(null),[u,s]=j.useState(null),c=(o==null?void 0:o.domReference)||i,d=j.useRef(null),p=Xf();kr(()=>{c&&(d.current=c)},[c]);const f=ss({...e,elements:{...o,...u&&{reference:u}}}),g=j.useCallback(P=>{const F=re(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),contextElement:P}:P;s(F),f.refs.setReference(F)},[f.refs]),v=j.useCallback(P=>{(re(P)||P===null)&&(d.current=P,a(P)),(re(f.refs.reference.current)||f.refs.reference.current===null||P!==null&&!re(P))&&f.refs.setReference(P)},[f.refs]),E=j.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),I=j.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),x=j.useMemo(()=>({...f,...r,refs:E,elements:I,nodeId:t}),[f,E,I,t,r]);return kr(()=>{r.dataRef.current.floatingContext=x;const P=p==null?void 0:p.nodesRef.current.find(F=>F.id===t);P&&(P.context=x)}),j.useMemo(()=>({...f,context:x,refs:E,elements:I}),[f,E,I,x])}const ps="active",ms="selected";function _r(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[ps]:a,[ms]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[Qf]:""},...i,...t.map(a=>{const u=a?a[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((a,u)=>(u&&Object.entries(u).forEach(s=>{let[l,c]=s;if(!(o&&[ps,ms].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof c=="function"){var d;(d=r.get(l))==null||d.push(c),a[l]=function(){for(var p,f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return(p=r.get(l))==null?void 0:p.map(E=>E(...g)).find(E=>E!==void 0)}}}else a[l]=c}),a),{})}}function ed(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=j.useCallback(u=>_r(u,e,"reference"),t),i=j.useCallback(u=>_r(u,e,"floating"),n),a=j.useCallback(u=>_r(u,e,"item"),r);return j.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a}),[o,i,a])}function hs(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const td=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:a=0,minItemsVisible:u=4,referenceOverflowThreshold:s=0,scrollRef:l,...c}=Ct(e,t),{rects:d,elements:{floating:p}}=t,f=n.current[a],g=(l==null?void 0:l.current)||p,v=p.clientTop||g.clientTop,E=p.clientTop!==0,I=g.clientTop!==0,x=p===g;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Hf('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const P={...t,...await Rr(-f.offsetTop-p.clientTop-d.reference.height/2-f.offsetHeight/2-i).fn(t)},F=await Fr(hs(P,g.scrollHeight+v+p.clientTop),c),R=await Fr(P,{...c,elementContext:"reference"}),B=xe(0,F.top),V=P.y+B,b=(g.scrollHeight>g.clientHeight?A=>A:Jt)(xe(0,g.scrollHeight+(E&&x||I?v*2:0)-B-xe(0,F.bottom)));if(g.style.maxHeight=b+"px",g.scrollTop=B,o){const A=g.offsetHeight<f.offsetHeight*ut(u,n.current.length)-1||R.top>=-s||R.bottom>=-s;Ut.flushSync(()=>o(A))}return r&&(r.current=await Fr(hs({...P,y:V},g.offsetHeight+v+p.clientTop),c)),{y:V}}});function nd(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:a,onChange:u}=t,s=cs(u),l=j.useRef(!1),c=j.useRef(null),d=j.useRef(null);j.useEffect(()=>{if(!o)return;function f(v){if(v.ctrlKey||!g||i.current==null)return;const E=v.deltaY,I=i.current.top>=-.5,x=i.current.bottom>=-.5,P=g.scrollHeight-g.clientHeight,F=E<0?-1:1,R=E<0?"max":"min";g.scrollHeight<=g.clientHeight||(!I&&E>0||!x&&E<0?(v.preventDefault(),Ut.flushSync(()=>{s(B=>B+Math[R](E,P*F))})):/firefox/i.test(Pc())&&(g.scrollTop+=E))}const g=(a==null?void 0:a.current)||r.floating;if(n&&g)return g.addEventListener("wheel",f),requestAnimationFrame(()=>{c.current=g.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{c.current=null,d.current=null,g.removeEventListener("wheel",f)}},[o,n,r.floating,i,a,s]);const p=j.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const f=(a==null?void 0:a.current)||r.floating;if(!(!i.current||!f||!l.current)){if(c.current!==null){const g=f.scrollTop-c.current;(i.current.bottom<-.5&&g<-1||i.current.top<-.5&&g>1)&&Ut.flushSync(()=>s(v=>v+g))}requestAnimationFrame(()=>{c.current=f.scrollTop})}}}),[r.floating,s,i,a]);return j.useMemo(()=>o?{floating:p}:{},[o,p])}let jt=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});jt.displayName="FloatingContext";let Br=m.createContext(null);Br.displayName="PlacementContext";function rd(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function od(){return m.useContext(jt).setReference}function id(){return m.useContext(jt).getReferenceProps}function sd(){let{getFloatingProps:e,slot:t}=m.useContext(jt);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function ld(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Br),n=m.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var a;return(a=i==null?void 0:i.outerHTML)!=null?a:i})]);ae(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(jt);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let gs=4;function ad({children:e,enabled:t=!0}){let[n,r]=m.useState(null),[o,i]=m.useState(0),a=m.useRef(null),[u,s]=m.useState(null);ud(u);let l=t&&n!==null&&u!==null,{to:c="bottom",gap:d=0,offset:p=0,padding:f=0,inner:g}=cd(n,u),[v,E="center"]=c.split(" ");ae(()=>{l&&i(0)},[l]);let{refs:I,floatingStyles:x,context:P}=Zf({open:l,placement:v==="selection"?E==="center"?"bottom":`bottom-${E}`:E==="center"?`${v}`:`${v}-${E}`,strategy:"absolute",transform:!1,middleware:[Rr({mainAxis:v==="selection"?0:d,crossAxis:p}),ls({padding:f}),v!=="selection"&&as({padding:f}),v==="selection"&&g?td({...g,padding:f,overflowRef:a,offset:o,minItemsVisible:gs,referenceOverflowThreshold:f,onFallbackChange(A){var C,N;if(!A)return;let T=P.elements.floating;if(!T)return;let S=parseFloat(getComputedStyle(T).scrollPaddingBottom)||0,L=Math.min(gs,T.childElementCount),$=0,w=0;for(let D of(N=(C=P.elements.floating)==null?void 0:C.childNodes)!=null?N:[])if(st(D)){let _=D.offsetTop,k=_+D.clientHeight+S,W=T.scrollTop,H=W+T.clientHeight;if(_>=W&&k<=H)L--;else{w=Math.max(0,Math.min(k,H)-Math.max(_,W)),$=D.clientHeight;break}}L>=1&&i(D=>{let _=$*L-w+S;return D>=_?D:_})}}):null,kf({padding:f,apply({availableWidth:A,availableHeight:C,elements:N}){Object.assign(N.floating.style,{overflow:"auto",maxWidth:`${A}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${C}px)`})}})].filter(Boolean),whileElementsMounted:ns}),[F=v,R=E]=P.placement.split("-");v==="selection"&&(F="selection");let B=m.useMemo(()=>({anchor:[F,R].filter(Boolean).join(" ")}),[F,R]),V=nd(P,{overflowRef:a,onChange:i}),{getReferenceProps:h,getFloatingProps:y}=ed([V]),b=ee(A=>{s(A),I.setFloating(A)});return j.createElement(Br.Provider,{value:r},j.createElement(jt.Provider,{value:{setFloating:b,setReference:I.setReference,styles:x,getReferenceProps:h,getFloatingProps:y,slot:B}},e))}function ud(e){ae(()=>{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 cd(e,t){var n,r,o;let i=Wr((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),a=Wr((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),u=Wr((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:a,padding:u}}function Wr(e,t,n=void 0){let r=Pt(),o=ee((s,l)=>{if(s==null)return[n,null];if(typeof s=="number")return[s,null];if(typeof s=="string"){if(!l)return[n,null];let c=bs(s,l);return[c,d=>{let p=vs(s);{let f=p.map(g=>window.getComputedStyle(l).getPropertyValue(g));r.requestAnimationFrame(function g(){r.nextFrame(g);let v=!1;for(let[I,x]of p.entries()){let P=window.getComputedStyle(l).getPropertyValue(x);if(f[I]!==P){f[I]=P,v=!0;break}}if(!v)return;let E=bs(s,l);c!==E&&(d(E),c=E)})}return r.dispose}]}return[n,null]}),i=m.useMemo(()=>o(e,t)[0],[e,t]),[a=i,u]=m.useState();return ae(()=>{let[s,l]=o(e,t);if(u(s),!!l)return l(u)},[e,t]),a}function vs(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,...vs(o)]:[r]}return[]}function bs(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 fd(e,t){let[n,r]=m.useState(t);return!e&&n!==t&&r(t),e?n:t}let Ur=m.createContext(null);Ur.displayName="OpenClosedContext";var He=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(He||{});function Vr(){return m.useContext(Ur)}function xs({value:e,children:t}){return m.createElement(Ur.Provider,{value:e},t)}function dd(e){throw new Error("Unexpected object: "+e)}var ue=(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))(ue||{});function Pn(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 i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:dd(e)}}var ys=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(ys||{});function ws(e){let t=ee(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,Ko(()=>{n.current&&t()})}),[t])}function pd(){let e=typeof document>"u";return"useSyncExternalStore"in j?(t=>t.useSyncExternalStore)(j)(()=>()=>{},()=>!1,()=>!e):!1}function Hr(){let e=pd(),[t,n]=j.useState(Ke.isHandoffComplete);return t&&Ke.isHandoffComplete===!1&&n(!1),j.useEffect(()=>{t!==!0&&n(!0)},[t]),j.useEffect(()=>Ke.handoff(),[]),e?!1:t}let md=m.createContext(!1);function hd(){return m.useContext(md)}function gd(e){let t=hd(),n=m.useContext(Ss),[r,o]=m.useState(()=>{var i;if(!t&&n!==null)return(i=n.current)!=null?i:null;if(Ke.isServer)return null;let a=e==null?void 0:e.getElementById("headlessui-portal-root");if(a)return a;if(e===null)return null;let u=e.createElement("div");return u.setAttribute("id","headlessui-portal-root"),e.body.appendChild(u)});return m.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),m.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let Es=m.Fragment,vd=Ce(function(e,t){let{ownerDocument:n=null,...r}=e,o=m.useRef(null),i=Ie(bu(f=>{o.current=f}),t),a=Sr(o),u=n??a,s=gd(u),[l]=m.useState(()=>{var f;return Ke.isServer?null:(f=u==null?void 0:u.createElement("div"))!=null?f:null}),c=m.useContext(wd),d=Hr();ae(()=>{!s||!l||s.contains(l)||(l.setAttribute("data-headlessui-portal",""),s.appendChild(l))},[s,l]),ae(()=>{if(l&&c)return c.register(l)},[c,l]),ws(()=>{var f;!s||!l||(cr(l)&&s.contains(l)&&s.removeChild(l),s.childNodes.length<=0&&((f=s.parentElement)==null||f.removeChild(s)))});let p=Pe();return d?!s||!l?null:we.createPortal(p({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:Es,name:"Portal"}),l):null});function bd(e,t){let n=Ie(t),{enabled:r=!0,ownerDocument:o,...i}=e,a=Pe();return r?m.createElement(vd,{...i,ownerDocument:o,ref:n}):a({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:Es,name:"Portal"})}let xd=m.Fragment,Ss=m.createContext(null);function yd(e,t){let{target:n,...r}=e,o={ref:Ie(t)},i=Pe();return m.createElement(Ss.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:xd,name:"Popover.Group"}))}let wd=m.createContext(null),Ed=Ce(bd),Sd=Ce(yd),Cd=Object.assign(Ed,{Group:Sd});function Od(){let e=m.useRef(!1);return ae(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Cs(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Ts)!==m.Fragment||m.Children.count(e.children)===1}let Ln=m.createContext(null);Ln.displayName="TransitionContext";var Td=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Td||{});function Nd(){let e=m.useContext(Ln);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Ad(){let e=m.useContext(Mn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Mn=m.createContext(null);Mn.displayName="NestingContext";function Dn(e){return"children"in e?Dn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Os(e,t){let n=Et(e),r=m.useRef([]),o=Od(),i=Pt(),a=ee((f,g=mt.Hidden)=>{let v=r.current.findIndex(({el:E})=>E===f);v!==-1&&(De(g,{[mt.Unmount](){r.current.splice(v,1)},[mt.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var E;!Dn(r)&&o.current&&((E=n.current)==null||E.call(n))}))}),u=ee(f=>{let g=r.current.find(({el:v})=>v===f);return g?g.state!=="visible"&&(g.state="visible"):r.current.push({el:f,state:"visible"}),()=>a(f,mt.Unmount)}),s=m.useRef([]),l=m.useRef(Promise.resolve()),c=m.useRef({enter:[],leave:[]}),d=ee((f,g,v)=>{s.current.splice(0),t&&(t.chains.current[g]=t.chains.current[g].filter(([E])=>E!==f)),t==null||t.chains.current[g].push([f,new Promise(E=>{s.current.push(E)})]),t==null||t.chains.current[g].push([f,new Promise(E=>{Promise.all(c.current[g].map(([I,x])=>x)).then(()=>E())})]),g==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(g)):v(g)}),p=ee((f,g,v)=>{Promise.all(c.current[g].splice(0).map(([E,I])=>I)).then(()=>{var E;(E=s.current.shift())==null||E()}).then(()=>v(g))});return m.useMemo(()=>({children:r,register:u,unregister:a,onStart:d,onStop:p,wait:l,chains:c}),[u,a,r,d,p,c,l])}let Ts=m.Fragment,Ns=dn.RenderStrategy;function $d(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:a,beforeLeave:u,afterLeave:s,enter:l,enterFrom:c,enterTo:d,entered:p,leave:f,leaveFrom:g,leaveTo:v,...E}=e,[I,x]=m.useState(null),P=m.useRef(null),F=Cs(e),R=Ie(...F?[P,t,x]:t===null?[]:[t]),B=(n=E.unmount)==null||n?mt.Unmount:mt.Hidden,{show:V,appear:h,initial:y}=Nd(),[b,A]=m.useState(V?"visible":"hidden"),C=Ad(),{register:N,unregister:T}=C;ae(()=>N(P),[N,P]),ae(()=>{if(B===mt.Hidden&&P.current){if(V&&b!=="visible"){A("visible");return}return De(b,{hidden:()=>T(P),visible:()=>N(P)})}},[b,P,N,T,V,B]);let S=Hr();ae(()=>{if(F&&S&&b==="visible"&&P.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[P,b,S,F]);let L=y&&!h,$=h&&V&&y,w=m.useRef(!1),D=Os(()=>{w.current||(A("hidden"),T(P))},C),_=ee(G=>{w.current=!0;let oe=G?"enter":"leave";D.onStart(P,oe,fe=>{fe==="enter"?i==null||i():fe==="leave"&&(u==null||u())})}),k=ee(G=>{let oe=G?"enter":"leave";w.current=!1,D.onStop(P,oe,fe=>{fe==="enter"?a==null||a():fe==="leave"&&(s==null||s())}),oe==="leave"&&!Dn(D)&&(A("hidden"),T(P))});m.useEffect(()=>{F&&o||(_(V),k(V))},[V,F,o]);let W=!(!o||!F||!S||L),[,H]=Di(W,I,V,{start:_,end:k}),Q=ht({ref:R,className:((r=lr(E.className,$&&l,$&&c,H.enter&&l,H.enter&&H.closed&&c,H.enter&&!H.closed&&d,H.leave&&f,H.leave&&!H.closed&&g,H.leave&&H.closed&&v,!H.transition&&V&&p))==null?void 0:r.trim())||void 0,...Mi(H)}),z=0;b==="visible"&&(z|=He.Open),b==="hidden"&&(z|=He.Closed),V&&b==="hidden"&&(z|=He.Opening),!V&&b==="visible"&&(z|=He.Closing);let K=Pe();return m.createElement(Mn.Provider,{value:D},m.createElement(xs,{value:z},K({ourProps:Q,theirProps:E,defaultTag:Ts,features:Ns,visible:b==="visible",name:"Transition.Child"})))}function Pd(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,a=m.useRef(null),u=Cs(e),s=Ie(...u?[a,t]:t===null?[]:[t]);Hr();let l=Vr();if(n===void 0&&l!==null&&(n=(l&He.Open)===He.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=m.useState(n?"visible":"hidden"),p=Os(()=>{n||d("hidden")}),[f,g]=m.useState(!0),v=m.useRef([n]);ae(()=>{f!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let E=m.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);ae(()=>{n?d("visible"):!Dn(p)&&a.current!==null&&d("hidden")},[n,p]);let I={unmount:o},x=ee(()=>{var R;f&&g(!1),(R=e.beforeEnter)==null||R.call(e)}),P=ee(()=>{var R;f&&g(!1),(R=e.beforeLeave)==null||R.call(e)}),F=Pe();return m.createElement(Mn.Provider,{value:p},m.createElement(Ln.Provider,{value:E},F({ourProps:{...I,as:m.Fragment,children:m.createElement(As,{ref:s,...I,...i,beforeEnter:x,beforeLeave:P})},theirProps:{},defaultTag:m.Fragment,features:Ns,visible:c==="visible",name:"Transition"})))}function Ld(e,t){let n=m.useContext(Ln)!==null,r=Vr()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(zr,{ref:t,...e}):m.createElement(As,{ref:t,...e}))}let zr=Ce(Pd),As=Ce($d),Md=Ce(Ld),$s=Object.assign(zr,{Child:Md,Root:zr});function Dd(e,t){let n=m.useRef({left:0,top:0});if(ae(()=>{if(!t)return;let o=t.getBoundingClientRect();o&&(n.current=o)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let Ps=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Ls(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!st(o))return r;let i=!1;for(let u of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),i=!0;let a=i?(n=o.innerText)!=null?n:"":r;return Ps.test(a)&&(a=a.replace(Ps,"")),a}function Id(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 i=document.getElementById(o);if(i){let a=i.getAttribute("aria-label");return typeof a=="string"?a.trim():Ls(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Ls(e).trim()}function Fd(e){let t=m.useRef(""),n=m.useRef("");return ee(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=Id(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var jd=Object.defineProperty,Rd=(e,t,n)=>t in e?jd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ms=(e,t,n)=>(Rd(e,typeof t!="symbol"?t+"":t,n),n),ve=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ve||{}),Je=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Je||{}),In=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(In||{}),Ds=(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.RegisterOptions=5]="RegisterOptions",e[e.UnregisterOptions=6]="UnregisterOptions",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e[e.SortOptions=9]="SortOptions",e))(Ds||{});function Is(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Ci(t(e.options.slice()),i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let kd={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:ue.Nothing},listboxState:1,__demoMode:!1}},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(i=>r(i.dataRef.current.value));return o!==-1&&(n=o),{...e,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1}},2(e,t){var n,r,o,i,a;if(e.dataRef.current.disabled||e.listboxState===1)return e;let u={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===ue.Nothing)return{...u,activeOptionIndex:null};if(t.focus===ue.Specific)return{...u,activeOptionIndex:e.options.findIndex(c=>c.id===t.id)};if(t.focus===ue.Previous){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=Pn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((r=d.current)==null?void 0:r.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...u,activeOptionIndex:p}}}}else if(t.focus===ue.Next){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=Pn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((i=d.current)==null?void 0:i.nextElementSibling)===f.current||((a=f.current)==null?void 0:a.nextElementSibling)===null)return{...u,activeOptionIndex:p}}}}let s=Is(e),l=Pn(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...u,...s,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(a=>{var u;return!a.dataRef.current.disabled&&((u=a.dataRef.current.textValue)==null?void 0:u.startsWith(r))}),i=o?e.options.indexOf(o):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:i,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==ue.Nothing&&(r=Pn(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 i=n.findIndex(a=>o==null?void 0:o(a.dataRef.current.value));i!==-1&&(r=i)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:ue.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[i,a]of n.entries())if(o.has(a.id)&&(r.push(i),o.delete(a.id),o.size===0))break;if(r.length>0){n=n.slice();for(let i of r.reverse())n.splice(i,1)}return{...e,options:n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},9:e=>e.pendingShouldSort?{...e,...Is(e),pendingShouldSort:!1}:e};class Gr extends di{constructor(t){super(t),Ms(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:a}=this.state.dataRef.current;return De(i,{0:()=>r==null?void 0:r(n),1:()=>{let u=a.slice(),s=u.findIndex(l=>o(l,n));return s===-1?u.push(n):u.splice(s,1),r==null?void 0:r(u)}})},registerOption:mr(()=>{let n=[],r=new Set;return[(o,i)=>{r.has(i)||(r.add(i),n.push({id:o,dataRef:i}))},()=>(r.clear(),this.send({type:5,options:n.splice(0)}))]}),unregisterOption:mr(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:mr(()=>{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:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:n,id:r}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(n.current.value),this.send({type:2,focus:ue.Specific,id:r})}},selectOption:n=>{let r=this.state.options.find(o=>o.id===n);r&&this.actions.onChange(r.dataRef.current.value)},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:7,element:n})},setOptionsElement:n=>{this.send({type:8,element:n})}}),Ms(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,i=n.options;return o===null||(r=i[o])==null?void 0:r.id},isActive(n,r){var o;let i=n.activeOptionIndex,a=n.options;return i!==null?((o=a[i])==null?void 0:o.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=hr.get(null);this.disposables.add(r.on(gi.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))}}static new({id:t,__demoMode:n=!1}){return new Gr({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:ue.Nothing},__demoMode:n})}reduce(t,n){return De(n.type,kd,t,n)}}const Fs=m.createContext(null);function Yr(e){let t=m.useContext(Fs);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,js),n}return t}function js({id:e,__demoMode:t=!1}){let n=m.useMemo(()=>Gr.new({id:e,__demoMode:t}),[]);return ws(()=>n.dispose()),n}let Fn=m.createContext(null);Fn.displayName="ListboxDataContext";function tn(e){let t=m.useContext(Fn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,tn),n}return t}let _d=m.Fragment;function Bd(e,t){let n=m.useId(),r=sr(),{value:o,defaultValue:i,form:a,name:u,onChange:s,by:l,invalid:c=!1,disabled:d=r||!1,horizontal:p=!1,multiple:f=!1,__demoMode:g=!1,...v}=e;const E=p?"horizontal":"vertical";let I=Ie(t),x=ru(i),[P=f?[]:void 0,F]=nu(o,s,x),R=js({id:n,__demoMode:g}),B=m.useRef({static:!1,hold:!1}),V=m.useRef(new Map),h=$u(l),y=m.useCallback(W=>De(b.mode,{[Je.Multi]:()=>P.some(H=>h(H,W)),[Je.Single]:()=>h(P,W)}),[P]),b=m.useMemo(()=>({value:P,disabled:d,invalid:c,mode:f?Je.Multi:Je.Single,orientation:E,onChange:F,compare:h,isSelected:y,optionsPropsRef:B,listRef:V}),[P,d,c,f,E,F,h,y,B,V]);ae(()=>{R.state.dataRef.current=b},[b]);let A=je(R,W=>W.listboxState),C=hr.get(null),N=je(C,m.useCallback(W=>C.selectors.isTop(W,n),[C,n])),[T,S]=je(R,W=>[W.buttonElement,W.optionsElement]);nc(N,[T,S],(W,H)=>{R.send({type:Ds.CloseListbox}),Si(H,Er.Loose)||(W.preventDefault(),T==null||T.focus())});let L=m.useMemo(()=>({open:A===ve.Open,disabled:d,invalid:c,value:P}),[A,d,c,P]),[$,w]=Su({inherit:!0}),D={ref:I},_=m.useCallback(()=>{if(x!==void 0)return F==null?void 0:F(x)},[F,x]),k=Pe();return m.createElement(w,{value:$,props:{htmlFor:T==null?void 0:T.id},slot:{open:A===ve.Open,disabled:d}},m.createElement(ad,null,m.createElement(Fs.Provider,{value:R},m.createElement(Fn.Provider,{value:b},m.createElement(xs,{value:De(A,{[ve.Open]:He.Open,[ve.Closed]:He.Closed})},u!=null&&P!=null&&m.createElement(uu,{disabled:d,data:{[u]:P},form:a,onReset:_}),k({ourProps:D,theirProps:v,slot:L,defaultTag:_d,name:"Listbox"}))))))}let Wd="button";function Ud(e,t){let n=m.useId(),r=ti(),o=tn("Listbox.Button"),i=Yr("Listbox.Button"),{id:a=r||`headlessui-listbox-button-${n}`,disabled:u=o.disabled||!1,autoFocus:s=!1,...l}=e,c=Ie(t,od(),i.actions.setButtonElement),d=id(),[p,f,g]=je(i,w=>[w.listboxState,w.buttonElement,w.optionsElement]),v=p===ve.Open;ic(v,{trigger:f,action:m.useCallback(w=>{if(f!=null&&f.contains(w.target))return gn.Ignore;let D=w.target.closest('[role="option"]:not([data-disabled])');return st(D)?gn.Select(D):g!=null&&g.contains(w.target)?gn.Ignore:gn.Close},[f,g]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let E=ee(w=>{switch(w.key){case ge.Enter:ou(w.currentTarget);break;case ge.Space:case ge.ArrowDown:w.preventDefault(),i.actions.openListbox({focus:o.value?ue.Nothing:ue.First});break;case ge.ArrowUp:w.preventDefault(),i.actions.openListbox({focus:o.value?ue.Nothing:ue.Last});break}}),I=ee(w=>{switch(w.key){case ge.Space:w.preventDefault();break}}),x=ee(w=>{var D;if(w.button===ys.Left){if(gu(w.currentTarget))return w.preventDefault();i.state.listboxState===ve.Open?(we.flushSync(()=>i.actions.closeListbox()),(D=i.state.buttonElement)==null||D.focus({preventScroll:!0})):(w.preventDefault(),i.actions.openListbox({focus:ue.Nothing}))}}),P=m.useRef(null),F=ee(w=>{P.current=w.pointerType,w.pointerType==="mouse"&&x(w)}),R=ee(w=>{P.current!=="mouse"&&x(w)}),B=ee(w=>w.preventDefault()),V=ai([a]),h=xu(),{isFocusVisible:y,focusProps:b}=Ha({autoFocus:s}),{isHovered:A,hoverProps:C}=Va({isDisabled:u}),{pressed:N,pressProps:T}=Xa({disabled:u}),S=m.useMemo(()=>({open:p===ve.Open,active:N||p===ve.Open,disabled:u,invalid:o.invalid,value:o.value,hover:A,focus:y,autofocus:s}),[p,o.value,u,A,y,N,o.invalid,s]),L=je(i,w=>w.listboxState===ve.Open),$=Xo(d(),{ref:c,id:a,type:sc(e,f),"aria-haspopup":"listbox","aria-controls":g==null?void 0:g.id,"aria-expanded":L,"aria-labelledby":V,"aria-describedby":h,disabled:u||void 0,autoFocus:s,onKeyDown:E,onKeyUp:I,onKeyPress:B,onPointerDown:F,onClick:R},b,C,T);return Pe()({ourProps:$,theirProps:l,slot:S,defaultTag:Wd,name:"Listbox.Button"})}let Rs=m.createContext(!1),Vd="div",Hd=dn.RenderStrategy|dn.Static;function zd(e,t){let n=m.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:i=!1,modal:a=!0,transition:u=!1,...s}=e,l=rd(o),[c,d]=m.useState(null);l&&(i=!0);let p=tn("Listbox.Options"),f=Yr("Listbox.Options"),[g,v,E,I]=je(f,G=>[G.listboxState,G.buttonElement,G.optionsElement,G.__demoMode]),x=Sr(v),P=Sr(E),F=Vr(),[R,B]=Di(u,c,F!==null?(F&He.Open)===He.Open:g===ve.Open);Hu(R,v,f.actions.closeListbox);let V=I?!1:a&&g===ve.Open;mc(V,P);let h=I?!1:a&&g===ve.Open;Vu(h,{allowed:m.useCallback(()=>[v,E],[v,E])});let y=g!==ve.Open,b=Dd(y,v)?!1:R,A=R&&g===ve.Closed,C=fd(A,p.value),N=ee(G=>p.compare(C,G)),T=je(f,G=>{var oe;if(l==null||!((oe=l==null?void 0:l.to)!=null&&oe.includes("selection")))return null;let fe=G.options.findIndex(Ne=>N(Ne.dataRef.current.value));return fe===-1&&(fe=0),fe}),S=(()=>{if(l==null)return;if(T===null)return{...l,inner:void 0};let G=Array.from(p.listRef.current.values());return{...l,inner:{listRef:{current:G},index:T}}})(),[L,$]=ld(S),w=sd(),D=Ie(t,l?L:null,f.actions.setOptionsElement,d),_=Pt();m.useEffect(()=>{var G;let oe=E;oe&&g===ve.Open&&oe!==((G=Yt(oe))==null?void 0:G.activeElement)&&(oe==null||oe.focus({preventScroll:!0}))},[g,E]);let k=ee(G=>{var oe,fe;switch(_.dispose(),G.key){case ge.Space:if(f.state.searchQuery!=="")return G.preventDefault(),G.stopPropagation(),f.actions.search(G.key);case ge.Enter:if(G.preventDefault(),G.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:Ne}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(Ne.current.value)}p.mode===Je.Single&&(we.flushSync(()=>f.actions.closeListbox()),(oe=f.state.buttonElement)==null||oe.focus({preventScroll:!0}));break;case De(p.orientation,{vertical:ge.ArrowDown,horizontal:ge.ArrowRight}):return G.preventDefault(),G.stopPropagation(),f.actions.goToOption({focus:ue.Next});case De(p.orientation,{vertical:ge.ArrowUp,horizontal:ge.ArrowLeft}):return G.preventDefault(),G.stopPropagation(),f.actions.goToOption({focus:ue.Previous});case ge.Home:case ge.PageUp:return G.preventDefault(),G.stopPropagation(),f.actions.goToOption({focus:ue.First});case ge.End:case ge.PageDown:return G.preventDefault(),G.stopPropagation(),f.actions.goToOption({focus:ue.Last});case ge.Escape:G.preventDefault(),G.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),(fe=f.state.buttonElement)==null||fe.focus({preventScroll:!0});return;case ge.Tab:G.preventDefault(),G.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),Ju(f.state.buttonElement,G.shiftKey?wr.Previous:wr.Next);break;default:G.key.length===1&&(f.actions.search(G.key),_.setTimeout(()=>f.actions.clearSearch(),350));break}}),W=je(f,G=>{var oe;return(oe=G.buttonElement)==null?void 0:oe.id}),H=m.useMemo(()=>({open:g===ve.Open}),[g]),Q=Xo(l?w():{},{id:r,ref:D,"aria-activedescendant":je(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===Je.Multi?!0:void 0,"aria-labelledby":W,"aria-orientation":p.orientation,onKeyDown:k,role:"listbox",tabIndex:g===ve.Open?0:void 0,style:{...s.style,...$,"--button-width":Lu(v,!0).width},...Mi(B)}),z=Pe(),K=m.useMemo(()=>p.mode===Je.Multi?p:{...p,isSelected:N},[p,N]);return m.createElement(Cd,{enabled:i?e.static||R:!1,ownerDocument:x},m.createElement(Fn.Provider,{value:K},z({ourProps:Q,theirProps:s,slot:H,defaultTag:Vd,features:Hd,visible:b,name:"Listbox.Options"})))}let Gd="div";function Yd(e,t){let n=m.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...a}=e,u=m.useContext(Rs)===!0,s=tn("Listbox.Option"),l=Yr("Listbox.Option"),c=je(l,b=>l.selectors.isActive(b,r)),d=s.isSelected(i),p=m.useRef(null),f=Fd(p),g=Et({disabled:o,value:i,domRef:p,get textValue(){return f()}}),v=Ie(t,p,b=>{b?s.listRef.current.set(r,b):s.listRef.current.delete(r)}),E=je(l,b=>l.selectors.shouldScrollIntoView(b,r));ae(()=>{if(E)return Ve().requestAnimationFrame(()=>{var b,A;(A=(b=p.current)==null?void 0:b.scrollIntoView)==null||A.call(b,{block:"nearest"})})},[E,p]),ae(()=>{if(!u)return l.actions.registerOption(r,g),()=>l.actions.unregisterOption(r)},[g,r,u]);let I=ee(b=>{var A;if(o)return b.preventDefault();l.actions.onChange(i),s.mode===Je.Single&&(we.flushSync(()=>l.actions.closeListbox()),(A=l.state.buttonElement)==null||A.focus({preventScroll:!0}))}),x=ee(()=>{if(o)return l.actions.goToOption({focus:ue.Nothing});l.actions.goToOption({focus:ue.Specific,id:r})}),P=hc(),F=ee(b=>P.update(b)),R=ee(b=>{P.wasMoved(b)&&(o||c&&l.state.activationTrigger===In.Pointer||l.actions.goToOption({focus:ue.Specific,id:r},In.Pointer))}),B=ee(b=>{P.wasMoved(b)&&(o||c&&l.state.activationTrigger===In.Pointer&&l.actions.goToOption({focus:ue.Nothing}))}),V=m.useMemo(()=>({active:c,focus:c,selected:d,disabled:o,selectedOption:d&&u}),[c,d,o,u]),h=u?{}:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":d,disabled:void 0,onClick:I,onFocus:x,onPointerEnter:F,onMouseEnter:F,onPointerMove:R,onMouseMove:R,onPointerLeave:B,onMouseLeave:B},y=Pe();return!d&&u?null:y({ourProps:h,theirProps:a,slot:V,defaultTag:Gd,name:"Listbox.Option"})}let Kd=m.Fragment;function qd(e,t){let{options:n,placeholder:r,...o}=e,i={ref:Ie(t)},a=tn("ListboxSelectedOption"),u=m.useMemo(()=>({}),[]),s=a.value===void 0||a.value===null||a.mode===Je.Multi&&Array.isArray(a.value)&&a.value.length===0,l=Pe();return m.createElement(Rs.Provider,{value:!0},l({ourProps:i,theirProps:{...o,children:m.createElement(m.Fragment,null,r&&s?r:n)},slot:u,defaultTag:Kd,name:"ListboxSelectedOption"}))}let Xd=Ce(Bd),Qd=Ce(Ud),Jd=Nu,Zd=Ce(zd),ep=Ce(Yd),tp=Ce(qd),bt=Object.assign(Xd,{Button:Qd,Label:Jd,Options:Zd,Option:ep,SelectedOption:tp});function np({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const ks=j.forwardRef(np),rp=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o=""})=>{const{t:i}=Ye();return O.jsx("div",{className:`relative ${o}`,children:O.jsx(bt,{value:t,onChange:n,disabled:r,children:({open:a})=>O.jsxs(O.Fragment,{children:[O.jsxs(bt.Button,{className:`
83
+ */var Vc=["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])"],Mr=Vc.join(","),Wi=typeof Element>"u",Zt=Wi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Cn=!Wi&&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},On=function e(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"),i=o===""||o==="true",l=i||n&&t&&e(t.parentNode);return l},Hc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},zc=function(t,n,r){if(On(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Mr));return n&&Zt.call(t,Mr)&&o.unshift(t),o=o.filter(r),o},Gc=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!On(l,!1))if(l.tagName==="SLOT"){var u=l.assignedElements(),s=u.length?u:l.children,a=e(s,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:l,candidates:a})}else{var c=Zt.call(l,Mr);c&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var d=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),p=!On(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(d&&p){var f=e(d===!0?l.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},Ui=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Vi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Hc(t))&&!Ui(t)?0:t.tabIndex},Yc=function(t,n){var r=Vi(t);return r<0&&n&&!Ui(t)?0:r},Kc=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Hi=function(t){return t.tagName==="INPUT"},qc=function(t){return Hi(t)&&t.type==="hidden"},Xc=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Qc=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Jc=function(t){if(!t.name)return!0;var n=t.form||Cn(t),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},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(l){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",l.message),!1}var i=Qc(o,t.form);return!i||i===t},Zc=function(t){return Hi(t)&&t.type==="radio"},ef=function(t){return Zc(t)&&!Jc(t)},tf=function(t){var n,r=t&&Cn(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var l,u,s;for(i=!!((l=o)!==null&&l!==void 0&&(u=l.ownerDocument)!==null&&u!==void 0&&u.contains(o)||t!=null&&(s=t.ownerDocument)!==null&&s!==void 0&&s.contains(t));!i&&o;){var a,c,d;r=Cn(o),o=(a=r)===null||a===void 0?void 0:a.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},zi=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},nf=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=Zt.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(Zt.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var s=t.parentElement,a=Cn(t);if(s&&!s.shadowRoot&&o(s)===!0)return zi(t);t.assignedSlot?t=t.assignedSlot:!s&&a!==t.ownerDocument?t=a.host:t=s}t=u}if(tf(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return zi(t);return!1},rf=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 Zt.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},of=function(t,n){return!(n.disabled||On(n)||qc(n)||nf(n,t)||Xc(n)||rf(n))},Gi=function(t,n){return!(ef(n)||Vi(n)<0||!of(t,n))},sf=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},lf=function e(t){var n=[],r=[];return t.forEach(function(o,i){var l=!!o.scopeParent,u=l?o.scopeParent:o,s=Yc(u,l),a=l?e(o.candidates):u;s===0?l?n.push.apply(n,a):n.push(u):r.push({documentOrder:i,tabIndex:s,item:o,isScope:l,content:a})}),r.sort(Kc).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Yi=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Gc([t],n.includeContainer,{filter:Gi.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:sf}):r=zc(t,n.includeContainer,Gi.bind(null,n)),lf(r)};function Ki(e,t,n){let{reference:r,floating:o}=e;const i=ct(t),l=Pr(t),u=$r(l),s=vt(t),a=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[u]/2-o[u]/2;let f;switch(s){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(It(t)){case"start":f[l]-=p*(n&&a?-1:1);break;case"end":f[l]+=p*(n&&a?-1:1);break}return f}const af=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),s=await(l.isRTL==null?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Ki(a,r,s),p=r,f={},g=0;for(let v=0;v<u.length;v++){const{name:S,fn:D}=u[v],{x:w,y:N,data:F,reset:R}=await D({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:a,platform:l,elements:{reference:e,floating:t}});c=w??c,d=N??d,f={...f,[S]:{...f[S],...F}},R&&g<=50&&(g++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(a=R.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:c,y:d}=Ki(a,p,s)),v=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}};async function Tn(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:s}=e,{boundary:a="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Ct(t,e),g=Bi(f),S=u[p?d==="floating"?"reference":"floating":d],D=Sn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:a,rootBoundary:c,strategy:s})),w=d==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),F=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},R=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:w,offsetParent:N,strategy:s}):w);return{top:(D.top-R.top+g.top)/F.y,bottom:(R.bottom-D.bottom+g.bottom)/F.y,left:(D.left-R.left+g.left)/F.x,right:(R.right-D.right+g.right)/F.x}}const uf=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:s}=t,{element:a,padding:c=0}=Ct(e,t)||{};if(a==null)return{};const d=Bi(c),p={x:n,y:r},f=Pr(o),g=$r(f),v=await l.getDimensions(a),S=f==="y",D=S?"top":"left",w=S?"bottom":"right",N=S?"clientHeight":"clientWidth",F=i.reference[g]+i.reference[f]-p[f]-i.floating[g],R=p[f]-i.reference[f],B=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a));let V=B?B[N]:0;(!V||!await(l.isElement==null?void 0:l.isElement(B)))&&(V=u.floating[N]||i.floating[g]);const h=F/2-R/2,x=V/2-v[g]/2-1,b=ut(d[D],x),A=ut(d[w],x),T=b,$=V-v[g]-A,E=V/2-v[g]/2+h,O=Ar(T,E,$),L=!s.arrow&&It(o)!=null&&E!==O&&i.reference[g]/2-(E<T?b:A)-v[g]/2<0,P=L?E<T?E-T:E-$:0;return{[f]:p[f]+P,data:{[f]:O,centerOffset:E-O-P,...L&&{alignmentOffset:P}},reset:L}}}),cf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:u,platform:s,elements:a}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...S}=Ct(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const D=vt(o),w=ct(u),N=vt(u)===u,F=await(s.isRTL==null?void 0:s.isRTL(a.floating)),R=p||(N||!v?[En(u)]:Rc(u)),B=g!=="none";!p&&B&&R.push(...Wc(u,v,g,F));const V=[u,...R],h=await Tn(t,S),x=[];let b=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&x.push(h[D]),d){const E=jc(o,l,F);x.push(h[E[0]],h[E[1]])}if(b=[...b,{placement:o,overflows:x}],!x.every(E=>E<=0)){var A,T;const E=(((A=i.flip)==null?void 0:A.index)||0)+1,O=V[E];if(O&&(!(d==="alignment"?w!==ct(O):!1)||b.every(y=>ct(y.placement)===w?y.overflows[0]>0:!0)))return{data:{index:E,overflows:b},reset:{placement:O}};let L=(T=b.filter(P=>P.overflows[0]<=0).sort((P,y)=>P.overflows[1]-y.overflows[1])[0])==null?void 0:T.placement;if(!L)switch(f){case"bestFit":{var $;const P=($=b.filter(y=>{if(B){const I=ct(y.placement);return I===w||I==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(I=>I>0).reduce((I,_)=>I+_,0)]).sort((y,I)=>y[1]-I[1])[0])==null?void 0:$[0];P&&(L=P);break}case"initialPlacement":L=u;break}if(o!==L)return{reset:{placement:L}}}return{}}}},ff=new Set(["left","top"]);async function df(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=vt(n),u=It(n),s=ct(n)==="y",a=ff.has(l)?-1:1,c=i&&s?-1:1,d=Ct(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return u&&typeof g=="number"&&(f=u==="end"?g*-1:g),s?{x:f*c,y:p*a}:{x:p*a,y:f*c}}const pf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:u}=t,s=await df(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}},mf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:S=>{let{x:D,y:w}=S;return{x:D,y:w}}},...s}=Ct(e,t),a={x:n,y:r},c=await Tn(t,s),d=ct(vt(o)),p=Ri(d);let f=a[p],g=a[d];if(i){const S=p==="y"?"top":"left",D=p==="y"?"bottom":"right",w=f+c[S],N=f-c[D];f=Ar(w,f,N)}if(l){const S=d==="y"?"top":"left",D=d==="y"?"bottom":"right",w=g+c[S],N=g-c[D];g=Ar(w,g,N)}const v=u.fn({...t,[p]:f,[d]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:i,[d]:l}}}}}},hf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:u}=t,{apply:s=()=>{},...a}=Ct(e,t),c=await Tn(t,a),d=vt(o),p=It(o),f=ct(o)==="y",{width:g,height:v}=i.floating;let S,D;d==="top"||d==="bottom"?(S=d,D=p===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(D=d,S=p==="end"?"top":"bottom");const w=v-c.top-c.bottom,N=g-c.left-c.right,F=ut(v-c[S],w),R=ut(g-c[D],N),B=!t.middlewareData.shift;let V=F,h=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(h=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(V=w),B&&!p){const b=xe(c.left,0),A=xe(c.right,0),T=xe(c.top,0),$=xe(c.bottom,0);f?h=g-2*(b!==0||A!==0?b+A:xe(c.left,c.right)):V=v-2*(T!==0||$!==0?T+$:xe(c.top,c.bottom))}await s({...t,availableWidth:h,availableHeight:V});const x=await l.getDimensions(u.floating);return g!==x.width||v!==x.height?{reset:{rects:!0}}:{}}}};function qi(e){const t=ke(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ee(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=Jt(n)!==i||Jt(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Dr(e){return re(e)?e:e.contextElement}function Ft(e){const t=Dr(e);if(!Ee(t))return Je(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qi(t);let l=(i?Jt(n.width):n.width)/r,u=(i?Jt(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const gf=Je(0);function Xi(e){const t=Oe(e);return!xn()||!t.visualViewport?gf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Oe(e)?!1:t}function Ot(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Dr(e);let l=Je(1);t&&(r?re(r)&&(l=Ft(r)):l=Ft(e));const u=vf(i,n,r)?Xi(i):Je(0);let s=(o.left+u.x)/l.x,a=(o.top+u.y)/l.y,c=o.width/l.x,d=o.height/l.y;if(i){const p=Oe(i),f=r&&re(r)?Oe(r):r;let g=p,v=Nr(g);for(;v&&r&&f!==g;){const S=Ft(v),D=v.getBoundingClientRect(),w=ke(v),N=D.left+(v.clientLeft+parseFloat(w.paddingLeft))*S.x,F=D.top+(v.clientTop+parseFloat(w.paddingTop))*S.y;s*=S.x,a*=S.y,c*=S.x,d*=S.y,s+=N,a+=F,g=Oe(v),v=Nr(g)}}return Sn({width:c,height:d,x:s,y:a})}function Nn(e,t){const n=yn(e).scrollLeft;return t?t.left+n:Ot(Qe(e)).left+n}function Qi(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Nn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function bf(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=Qe(r),u=t?bn(t.floating):!1;if(r===l||u&&i)return n;let s={scrollLeft:0,scrollTop:0},a=Je(1);const c=Je(0),d=Ee(r);if((d||!d&&!i)&&((Dt(r)!=="body"||Qt(l))&&(s=yn(r)),Ee(r))){const f=Ot(r);a=Ft(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}const p=l&&!d&&!i?Qi(l,s):Je(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+c.x+p.x,y:n.y*a.y-s.scrollTop*a.y+c.y+p.y}}function xf(e){return Array.from(e.getClientRects())}function yf(e){const t=Qe(e),n=yn(e),r=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Nn(e);const u=-n.scrollTop;return ke(r).direction==="rtl"&&(l+=xe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}const Ji=25;function wf(e,t){const n=Oe(e),r=Qe(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,s=0;if(o){i=o.width,l=o.height;const c=xn();(!c||c&&t==="fixed")&&(u=o.offsetLeft,s=o.offsetTop)}const a=Nn(r);if(a<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),f=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-f);g<=Ji&&(i-=g)}else a<=Ji&&(i+=a);return{width:i,height:l,x:u,y:s}}const Ef=new Set(["absolute","fixed"]);function Sf(e,t){const n=Ot(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ee(e)?Ft(e):Je(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,s=o*i.x,a=r*i.y;return{width:l,height:u,x:s,y:a}}function Zi(e,t,n){let r;if(t==="viewport")r=wf(e,n);else if(t==="document")r=yf(Qe(e));else if(re(t))r=Sf(t,n);else{const o=Xi(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Sn(r)}function es(e,t){const n=at(e);return n===t||!re(n)||lt(n)?!1:ke(n).position==="fixed"||es(n,t)}function Cf(e,t){const n=t.get(e);if(n)return n;let r=gt(e,[],!1).filter(u=>re(u)&&Dt(u)!=="body"),o=null;const i=ke(e).position==="fixed";let l=i?at(e):e;for(;re(l)&&!lt(l);){const u=ke(l),s=Tr(l);!s&&u.position==="fixed"&&(o=null),(i?!s&&!o:!s&&u.position==="static"&&!!o&&Ef.has(o.position)||Qt(l)&&!s&&es(e,l))?r=r.filter(c=>c!==l):o=u,l=at(l)}return t.set(e,r),r}function Of(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?bn(t)?[]:Cf(t,this._c):[].concat(n),r],u=l[0],s=l.reduce((a,c)=>{const d=Zi(t,c,o);return a.top=xe(d.top,a.top),a.right=ut(d.right,a.right),a.bottom=ut(d.bottom,a.bottom),a.left=xe(d.left,a.left),a},Zi(t,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Tf(e){const{width:t,height:n}=qi(e);return{width:t,height:n}}function Nf(e,t,n){const r=Ee(t),o=Qe(t),i=n==="fixed",l=Ot(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const s=Je(0);function a(){s.x=Nn(o)}if(r||!r&&!i)if((Dt(t)!=="body"||Qt(o))&&(u=yn(t)),r){const f=Ot(t,!0,i,t);s.x=f.x+t.clientLeft,s.y=f.y+t.clientTop}else o&&a();i&&!r&&o&&a();const c=o&&!r&&!i?Qi(o,u):Je(0),d=l.left+u.scrollLeft-s.x-c.x,p=l.top+u.scrollTop-s.y-c.y;return{x:d,y:p,width:l.width,height:l.height}}function Ir(e){return ke(e).position==="static"}function ts(e,t){if(!Ee(e)||ke(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qe(e)===n&&(n=n.ownerDocument.body),n}function ns(e,t){const n=Oe(e);if(bn(e))return n;if(!Ee(e)){let o=at(e);for(;o&&!lt(o);){if(re(o)&&!Ir(o))return o;o=at(o)}return n}let r=ts(e,t);for(;r&&Oc(r)&&Ir(r);)r=ts(r,t);return r&&lt(r)&&Ir(r)&&!Tr(r)?n:r||Pc(e)||n}const Af=async function(e){const t=this.getOffsetParent||ns,n=this.getDimensions,r=await n(e.floating);return{reference:Nf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $f(e){return ke(e).direction==="rtl"}const Pf={convertOffsetParentRelativeRectToViewportRelativeRect:bf,getDocumentElement:Qe,getClippingRect:Of,getOffsetParent:ns,getElementRects:Af,getClientRects:xf,getDimensions:Tf,getScale:Ft,isElement:re,isRTL:$f};function rs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Lf(e,t){let n=null,r;const o=Qe(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,s){u===void 0&&(u=!1),s===void 0&&(s=1),i();const a=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=a;if(u||t(),!p||!f)return;const g=wn(d),v=wn(o.clientWidth-(c+p)),S=wn(o.clientHeight-(d+f)),D=wn(c),N={rootMargin:-g+"px "+-v+"px "+-S+"px "+-D+"px",threshold:xe(0,ut(1,s))||1};let F=!0;function R(B){const V=B[0].intersectionRatio;if(V!==s){if(!F)return l();V?l(!1,V):r=setTimeout(()=>{l(!1,1e-7)},1e3)}V===1&&!rs(a,e.getBoundingClientRect())&&l(),F=!1}try{n=new IntersectionObserver(R,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,N)}n.observe(e)}return l(!0),i}function os(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,a=Dr(e),c=o||i?[...a?gt(a):[],...gt(t)]:[];c.forEach(D=>{o&&D.addEventListener("scroll",n,{passive:!0}),i&&D.addEventListener("resize",n)});const d=a&&u?Lf(a,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(D=>{let[w]=D;w&&w.target===a&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var N;(N=f)==null||N.observe(t)})),n()}),a&&!s&&f.observe(a),f.observe(t));let g,v=s?Ot(e):null;s&&S();function S(){const D=Ot(e);v&&!rs(v,D)&&n(),v=D,g=requestAnimationFrame(S)}return n(),()=>{var D;c.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(D=f)==null||D.disconnect(),f=null,s&&cancelAnimationFrame(g)}}const Fr=Tn,Mf=pf,Df=mf,If=cf,Ff=hf,is=uf,jf=(e,t,n)=>{const r=new Map,o={platform:Pf,...n},i={...o.platform,_c:r};return af(e,t,{...o,platform:i})};var Rf=typeof document<"u",kf=function(){},An=Rf?m.useLayoutEffect:kf;function $n(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(!$n(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!$n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ss(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ls(e,t){const n=ss(e);return Math.round(t*n)/n}function jr(e){const t=j.useRef(e);return An(()=>{t.current=e}),t}function as(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:s,open:a}=e,[c,d]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=j.useState(r);$n(p,r)||f(r);const[g,v]=j.useState(null),[S,D]=j.useState(null),w=j.useCallback(y=>{y!==B.current&&(B.current=y,v(y))},[]),N=j.useCallback(y=>{y!==V.current&&(V.current=y,D(y))},[]),F=i||g,R=l||S,B=j.useRef(null),V=j.useRef(null),h=j.useRef(c),x=s!=null,b=jr(s),A=jr(o),T=jr(a),$=j.useCallback(()=>{if(!B.current||!V.current)return;const y={placement:t,strategy:n,middleware:p};A.current&&(y.platform=A.current),jf(B.current,V.current,y).then(I=>{const _={...I,isPositioned:T.current!==!1};E.current&&!$n(h.current,_)&&(h.current=_,Ut.flushSync(()=>{d(_)}))})},[p,t,n,A,T]);An(()=>{a===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,d(y=>({...y,isPositioned:!1})))},[a]);const E=j.useRef(!1);An(()=>(E.current=!0,()=>{E.current=!1}),[]),An(()=>{if(F&&(B.current=F),R&&(V.current=R),F&&R){if(b.current)return b.current(F,R,$);$()}},[F,R,$,b,x]);const O=j.useMemo(()=>({reference:B,floating:V,setReference:w,setFloating:N}),[w,N]),L=j.useMemo(()=>({reference:F,floating:R}),[F,R]),P=j.useMemo(()=>{const y={position:n,left:0,top:0};if(!L.floating)return y;const I=ls(L.floating,c.x),_=ls(L.floating,c.y);return u?{...y,transform:"translate("+I+"px, "+_+"px)",...ss(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:_}},[n,u,L.floating,c.x,c.y]);return j.useMemo(()=>({...c,update:$,refs:O,elements:L,floatingStyles:P}),[c,$,O,L,P])}const _f=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?is({element:r.current,padding:o}).fn(n):{}:r?is({element:r,padding:o}).fn(n):{}}}},Rr=(e,t)=>({...Mf(e),options:[e,t]}),us=(e,t)=>({...Df(e),options:[e,t]}),cs=(e,t)=>({...If(e),options:[e,t]}),Bf=(e,t)=>({...Ff(e),options:[e,t]}),Wf=(e,t)=>({..._f(e),options:[e,t]}),fs={...j},Uf=fs.useInsertionEffect||(e=>e());function ds(e){const t=j.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Uf(()=>{t.current=e}),j.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 kr=typeof document<"u"?m.useLayoutEffect:m.useEffect;let ps=!1,Vf=0;const ms=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Vf++;function Hf(){const[e,t]=j.useState(()=>ps?ms():void 0);return kr(()=>{e==null&&t(ms())},[]),j.useEffect(()=>{ps=!0},[]),e}const zf=fs.useId||Hf;let en;process.env.NODE_ENV!=="production"&&(en=new Set);function Gf(){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=en)!=null&&e.has(o))){var i;(i=en)==null||i.add(o),console.warn(o)}}function Yf(){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=en)!=null&&e.has(o))){var i;(i=en)==null||i.add(o),console.error(o)}}function Kf(){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 qf=j.createContext(null),Xf=j.createContext(null),Qf=()=>{var e;return((e=j.useContext(qf))==null?void 0:e.id)||null},Jf=()=>j.useContext(Xf),Zf="data-floating-ui-focusable";function ed(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=zf(),i=j.useRef({}),[l]=j.useState(()=>Kf()),u=Qf()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!re(f)&&Yf("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=j.useState(r.reference),c=ds((f,g,v)=>{i.current.openEvent=f?g:void 0,l.emit("openchange",{open:f,event:g,reason:v,nested:u}),n==null||n(f,g,v)}),d=j.useMemo(()=>({setPositionReference:a}),[]),p=j.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return j.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function td(e){e===void 0&&(e={});const{nodeId:t}=e,n=ed({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=j.useState(null),[u,s]=j.useState(null),c=(o==null?void 0:o.domReference)||i,d=j.useRef(null),p=Jf();kr(()=>{c&&(d.current=c)},[c]);const f=as({...e,elements:{...o,...u&&{reference:u}}}),g=j.useCallback(N=>{const F=re(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;s(F),f.refs.setReference(F)},[f.refs]),v=j.useCallback(N=>{(re(N)||N===null)&&(d.current=N,l(N)),(re(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!re(N))&&f.refs.setReference(N)},[f.refs]),S=j.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),D=j.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=j.useMemo(()=>({...f,...r,refs:S,elements:D,nodeId:t}),[f,S,D,t,r]);return kr(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(F=>F.id===t);N&&(N.context=w)}),j.useMemo(()=>({...f,context:w,refs:S,elements:D}),[f,S,D,w])}const hs="active",gs="selected";function _r(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[hs]:l,[gs]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[Zf]:""},...i,...t.map(l=>{const u=l?l[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((l,u)=>(u&&Object.entries(u).forEach(s=>{let[a,c]=s;if(!(o&&[hs,gs].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var d;(d=r.get(a))==null||d.push(c),l[a]=function(){for(var p,f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return(p=r.get(a))==null?void 0:p.map(S=>S(...g)).find(S=>S!==void 0)}}}else l[a]=c}),l),{})}}function nd(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=j.useCallback(u=>_r(u,e,"reference"),t),i=j.useCallback(u=>_r(u,e,"floating"),n),l=j.useCallback(u=>_r(u,e,"item"),r);return j.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}function vs(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const rd=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:l=0,minItemsVisible:u=4,referenceOverflowThreshold:s=0,scrollRef:a,...c}=Ct(e,t),{rects:d,elements:{floating:p}}=t,f=n.current[l],g=(a==null?void 0:a.current)||p,v=p.clientTop||g.clientTop,S=p.clientTop!==0,D=g.clientTop!==0,w=p===g;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Gf('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const N={...t,...await Rr(-f.offsetTop-p.clientTop-d.reference.height/2-f.offsetHeight/2-i).fn(t)},F=await Fr(vs(N,g.scrollHeight+v+p.clientTop),c),R=await Fr(N,{...c,elementContext:"reference"}),B=xe(0,F.top),V=N.y+B,b=(g.scrollHeight>g.clientHeight?A=>A:Jt)(xe(0,g.scrollHeight+(S&&w||D?v*2:0)-B-xe(0,F.bottom)));if(g.style.maxHeight=b+"px",g.scrollTop=B,o){const A=g.offsetHeight<f.offsetHeight*ut(u,n.current.length)-1||R.top>=-s||R.bottom>=-s;Ut.flushSync(()=>o(A))}return r&&(r.current=await Fr(vs({...N,y:V},g.offsetHeight+v+p.clientTop),c)),{y:V}}});function od(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:l,onChange:u}=t,s=ds(u),a=j.useRef(!1),c=j.useRef(null),d=j.useRef(null);j.useEffect(()=>{if(!o)return;function f(v){if(v.ctrlKey||!g||i.current==null)return;const S=v.deltaY,D=i.current.top>=-.5,w=i.current.bottom>=-.5,N=g.scrollHeight-g.clientHeight,F=S<0?-1:1,R=S<0?"max":"min";g.scrollHeight<=g.clientHeight||(!D&&S>0||!w&&S<0?(v.preventDefault(),Ut.flushSync(()=>{s(B=>B+Math[R](S,N*F))})):/firefox/i.test(Mc())&&(g.scrollTop+=S))}const g=(l==null?void 0:l.current)||r.floating;if(n&&g)return g.addEventListener("wheel",f),requestAnimationFrame(()=>{c.current=g.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{c.current=null,d.current=null,g.removeEventListener("wheel",f)}},[o,n,r.floating,i,l,s]);const p=j.useMemo(()=>({onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const f=(l==null?void 0:l.current)||r.floating;if(!(!i.current||!f||!a.current)){if(c.current!==null){const g=f.scrollTop-c.current;(i.current.bottom<-.5&&g<-1||i.current.top<-.5&&g>1)&&Ut.flushSync(()=>s(v=>v+g))}requestAnimationFrame(()=>{c.current=f.scrollTop})}}}),[r.floating,s,i,l]);return j.useMemo(()=>o?{floating:p}:{},[o,p])}let jt=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});jt.displayName="FloatingContext";let Br=m.createContext(null);Br.displayName="PlacementContext";function id(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function sd(){return m.useContext(jt).setReference}function ld(){return m.useContext(jt).getReferenceProps}function ad(){let{getFloatingProps:e,slot:t}=m.useContext(jt);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function ud(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Br),n=m.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var l;return(l=i==null?void 0:i.outerHTML)!=null?l:i})]);ae(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(jt);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let bs=4;function cd({children:e,enabled:t=!0}){let[n,r]=m.useState(null),[o,i]=m.useState(0),l=m.useRef(null),[u,s]=m.useState(null);fd(u);let a=t&&n!==null&&u!==null,{to:c="bottom",gap:d=0,offset:p=0,padding:f=0,inner:g}=dd(n,u),[v,S="center"]=c.split(" ");ae(()=>{a&&i(0)},[a]);let{refs:D,floatingStyles:w,context:N}=td({open:a,placement:v==="selection"?S==="center"?"bottom":`bottom-${S}`:S==="center"?`${v}`:`${v}-${S}`,strategy:"absolute",transform:!1,middleware:[Rr({mainAxis:v==="selection"?0:d,crossAxis:p}),us({padding:f}),v!=="selection"&&cs({padding:f}),v==="selection"&&g?rd({...g,padding:f,overflowRef:l,offset:o,minItemsVisible:bs,referenceOverflowThreshold:f,onFallbackChange(A){var T,$;if(!A)return;let E=N.elements.floating;if(!E)return;let O=parseFloat(getComputedStyle(E).scrollPaddingBottom)||0,L=Math.min(bs,E.childElementCount),P=0,y=0;for(let I of($=(T=N.elements.floating)==null?void 0:T.childNodes)!=null?$:[])if(st(I)){let _=I.offsetTop,W=_+I.clientHeight+O,k=E.scrollTop,H=k+E.clientHeight;if(_>=k&&W<=H)L--;else{y=Math.max(0,Math.min(W,H)-Math.max(_,k)),P=I.clientHeight;break}}L>=1&&i(I=>{let _=P*L-y+O;return I>=_?I:_})}}):null,Bf({padding:f,apply({availableWidth:A,availableHeight:T,elements:$}){Object.assign($.floating.style,{overflow:"auto",maxWidth:`${A}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${T}px)`})}})].filter(Boolean),whileElementsMounted:os}),[F=v,R=S]=N.placement.split("-");v==="selection"&&(F="selection");let B=m.useMemo(()=>({anchor:[F,R].filter(Boolean).join(" ")}),[F,R]),V=od(N,{overflowRef:l,onChange:i}),{getReferenceProps:h,getFloatingProps:x}=nd([V]),b=te(A=>{s(A),D.setFloating(A)});return j.createElement(Br.Provider,{value:r},j.createElement(jt.Provider,{value:{setFloating:b,setReference:D.setReference,styles:w,getReferenceProps:h,getFloatingProps:x,slot:B}},e))}function fd(e){ae(()=>{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 dd(e,t){var n,r,o;let i=Wr((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),l=Wr((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),u=Wr((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:l,padding:u}}function Wr(e,t,n=void 0){let r=Pt(),o=te((s,a)=>{if(s==null)return[n,null];if(typeof s=="number")return[s,null];if(typeof s=="string"){if(!a)return[n,null];let c=ys(s,a);return[c,d=>{let p=xs(s);{let f=p.map(g=>window.getComputedStyle(a).getPropertyValue(g));r.requestAnimationFrame(function g(){r.nextFrame(g);let v=!1;for(let[D,w]of p.entries()){let N=window.getComputedStyle(a).getPropertyValue(w);if(f[D]!==N){f[D]=N,v=!0;break}}if(!v)return;let S=ys(s,a);c!==S&&(d(S),c=S)})}return r.dispose}]}return[n,null]}),i=m.useMemo(()=>o(e,t)[0],[e,t]),[l=i,u]=m.useState();return ae(()=>{let[s,a]=o(e,t);if(u(s),!!a)return a(u)},[e,t]),l}function xs(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,...xs(o)]:[r]}return[]}function ys(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 pd(e,t){let[n,r]=m.useState(t);return!e&&n!==t&&r(t),e?n:t}let Ur=m.createContext(null);Ur.displayName="OpenClosedContext";var Ge=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ge||{});function Vr(){return m.useContext(Ur)}function ws({value:e,children:t}){return m.createElement(Ur.Provider,{value:e},t)}function md(e){throw new Error("Unexpected object: "+e)}var ue=(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))(ue||{});function Pn(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 i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:md(e)}}var Es=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Es||{});function Ss(e){let t=te(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,Xo(()=>{n.current&&t()})}),[t])}function hd(){let e=typeof document>"u";return"useSyncExternalStore"in j?(t=>t.useSyncExternalStore)(j)(()=>()=>{},()=>!1,()=>!e):!1}function Hr(){let e=hd(),[t,n]=j.useState(qe.isHandoffComplete);return t&&qe.isHandoffComplete===!1&&n(!1),j.useEffect(()=>{t!==!0&&n(!0)},[t]),j.useEffect(()=>qe.handoff(),[]),e?!1:t}let gd=m.createContext(!1);function vd(){return m.useContext(gd)}function bd(e){let t=vd(),n=m.useContext(Os),[r,o]=m.useState(()=>{var i;if(!t&&n!==null)return(i=n.current)!=null?i:null;if(qe.isServer)return null;let l=e==null?void 0:e.getElementById("headlessui-portal-root");if(l)return l;if(e===null)return null;let u=e.createElement("div");return u.setAttribute("id","headlessui-portal-root"),e.body.appendChild(u)});return m.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),m.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let Cs=m.Fragment,xd=Ce(function(e,t){let{ownerDocument:n=null,...r}=e,o=m.useRef(null),i=Fe(yu(f=>{o.current=f}),t),l=Sr(o),u=n??l,s=bd(u),[a]=m.useState(()=>{var f;return qe.isServer?null:(f=u==null?void 0:u.createElement("div"))!=null?f:null}),c=m.useContext(Sd),d=Hr();ae(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),ae(()=>{if(a&&c)return c.register(a)},[c,a]),Ss(()=>{var f;!s||!a||(cr(a)&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((f=s.parentElement)==null||f.removeChild(s)))});let p=Le();return d?!s||!a?null:we.createPortal(p({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:Cs,name:"Portal"}),a):null});function yd(e,t){let n=Fe(t),{enabled:r=!0,ownerDocument:o,...i}=e,l=Le();return r?m.createElement(xd,{...i,ownerDocument:o,ref:n}):l({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:Cs,name:"Portal"})}let wd=m.Fragment,Os=m.createContext(null);function Ed(e,t){let{target:n,...r}=e,o={ref:Fe(t)},i=Le();return m.createElement(Os.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:wd,name:"Popover.Group"}))}let Sd=m.createContext(null),Cd=Ce(yd),Od=Ce(Ed),Td=Object.assign(Cd,{Group:Od});function Nd(){let e=m.useRef(!1);return ae(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ts(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:As)!==m.Fragment||m.Children.count(e.children)===1}let Ln=m.createContext(null);Ln.displayName="TransitionContext";var Ad=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ad||{});function $d(){let e=m.useContext(Ln);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Pd(){let e=m.useContext(Mn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Mn=m.createContext(null);Mn.displayName="NestingContext";function Dn(e){return"children"in e?Dn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ns(e,t){let n=Et(e),r=m.useRef([]),o=Nd(),i=Pt(),l=te((f,g=mt.Hidden)=>{let v=r.current.findIndex(({el:S})=>S===f);v!==-1&&(Ie(g,{[mt.Unmount](){r.current.splice(v,1)},[mt.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var S;!Dn(r)&&o.current&&((S=n.current)==null||S.call(n))}))}),u=te(f=>{let g=r.current.find(({el:v})=>v===f);return g?g.state!=="visible"&&(g.state="visible"):r.current.push({el:f,state:"visible"}),()=>l(f,mt.Unmount)}),s=m.useRef([]),a=m.useRef(Promise.resolve()),c=m.useRef({enter:[],leave:[]}),d=te((f,g,v)=>{s.current.splice(0),t&&(t.chains.current[g]=t.chains.current[g].filter(([S])=>S!==f)),t==null||t.chains.current[g].push([f,new Promise(S=>{s.current.push(S)})]),t==null||t.chains.current[g].push([f,new Promise(S=>{Promise.all(c.current[g].map(([D,w])=>w)).then(()=>S())})]),g==="enter"?a.current=a.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(g)):v(g)}),p=te((f,g,v)=>{Promise.all(c.current[g].splice(0).map(([S,D])=>D)).then(()=>{var S;(S=s.current.shift())==null||S()}).then(()=>v(g))});return m.useMemo(()=>({children:r,register:u,unregister:l,onStart:d,onStop:p,wait:a,chains:c}),[u,l,r,d,p,c,a])}let As=m.Fragment,$s=dn.RenderStrategy;function Ld(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:l,beforeLeave:u,afterLeave:s,enter:a,enterFrom:c,enterTo:d,entered:p,leave:f,leaveFrom:g,leaveTo:v,...S}=e,[D,w]=m.useState(null),N=m.useRef(null),F=Ts(e),R=Fe(...F?[N,t,w]:t===null?[]:[t]),B=(n=S.unmount)==null||n?mt.Unmount:mt.Hidden,{show:V,appear:h,initial:x}=$d(),[b,A]=m.useState(V?"visible":"hidden"),T=Pd(),{register:$,unregister:E}=T;ae(()=>$(N),[$,N]),ae(()=>{if(B===mt.Hidden&&N.current){if(V&&b!=="visible"){A("visible");return}return Ie(b,{hidden:()=>E(N),visible:()=>$(N)})}},[b,N,$,E,V,B]);let O=Hr();ae(()=>{if(F&&O&&b==="visible"&&N.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[N,b,O,F]);let L=x&&!h,P=h&&V&&x,y=m.useRef(!1),I=Ns(()=>{y.current||(A("hidden"),E(N))},T),_=te(z=>{y.current=!0;let oe=z?"enter":"leave";I.onStart(N,oe,fe=>{fe==="enter"?i==null||i():fe==="leave"&&(u==null||u())})}),W=te(z=>{let oe=z?"enter":"leave";y.current=!1,I.onStop(N,oe,fe=>{fe==="enter"?l==null||l():fe==="leave"&&(s==null||s())}),oe==="leave"&&!Dn(I)&&(A("hidden"),E(N))});m.useEffect(()=>{F&&o||(_(V),W(V))},[V,F,o]);let k=!(!o||!F||!O||L),[,H]=Fi(k,D,V,{start:_,end:W}),Q=ht({ref:R,className:((r=lr(S.className,P&&a,P&&c,H.enter&&a,H.enter&&H.closed&&c,H.enter&&!H.closed&&d,H.leave&&f,H.leave&&!H.closed&&g,H.leave&&H.closed&&v,!H.transition&&V&&p))==null?void 0:r.trim())||void 0,...Ii(H)}),Y=0;b==="visible"&&(Y|=Ge.Open),b==="hidden"&&(Y|=Ge.Closed),V&&b==="hidden"&&(Y|=Ge.Opening),!V&&b==="visible"&&(Y|=Ge.Closing);let K=Le();return m.createElement(Mn.Provider,{value:I},m.createElement(ws,{value:Y},K({ourProps:Q,theirProps:S,defaultTag:As,features:$s,visible:b==="visible",name:"Transition.Child"})))}function Md(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=m.useRef(null),u=Ts(e),s=Fe(...u?[l,t]:t===null?[]:[t]);Hr();let a=Vr();if(n===void 0&&a!==null&&(n=(a&Ge.Open)===Ge.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=m.useState(n?"visible":"hidden"),p=Ns(()=>{n||d("hidden")}),[f,g]=m.useState(!0),v=m.useRef([n]);ae(()=>{f!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let S=m.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);ae(()=>{n?d("visible"):!Dn(p)&&l.current!==null&&d("hidden")},[n,p]);let D={unmount:o},w=te(()=>{var R;f&&g(!1),(R=e.beforeEnter)==null||R.call(e)}),N=te(()=>{var R;f&&g(!1),(R=e.beforeLeave)==null||R.call(e)}),F=Le();return m.createElement(Mn.Provider,{value:p},m.createElement(Ln.Provider,{value:S},F({ourProps:{...D,as:m.Fragment,children:m.createElement(Ps,{ref:s,...D,...i,beforeEnter:w,beforeLeave:N})},theirProps:{},defaultTag:m.Fragment,features:$s,visible:c==="visible",name:"Transition"})))}function Dd(e,t){let n=m.useContext(Ln)!==null,r=Vr()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(zr,{ref:t,...e}):m.createElement(Ps,{ref:t,...e}))}let zr=Ce(Md),Ps=Ce(Ld),Id=Ce(Dd),Ls=Object.assign(zr,{Child:Id,Root:zr});function Fd(e,t){let n=m.useRef({left:0,top:0});if(ae(()=>{if(!t)return;let o=t.getBoundingClientRect();o&&(n.current=o)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let Ms=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Ds(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!st(o))return r;let i=!1;for(let u of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),i=!0;let l=i?(n=o.innerText)!=null?n:"":r;return Ms.test(l)&&(l=l.replace(Ms,"")),l}function jd(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 i=document.getElementById(o);if(i){let l=i.getAttribute("aria-label");return typeof l=="string"?l.trim():Ds(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Ds(e).trim()}function Rd(e){let t=m.useRef(""),n=m.useRef("");return te(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=jd(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var kd=Object.defineProperty,_d=(e,t,n)=>t in e?kd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Is=(e,t,n)=>(_d(e,typeof t!="symbol"?t+"":t,n),n),ve=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ve||{}),Ze=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Ze||{}),In=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(In||{}),Fs=(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.RegisterOptions=5]="RegisterOptions",e[e.UnregisterOptions=6]="UnregisterOptions",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e[e.SortOptions=9]="SortOptions",e))(Fs||{});function js(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Ti(t(e.options.slice()),i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let Bd={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:ue.Nothing},listboxState:1,__demoMode:!1}},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(i=>r(i.dataRef.current.value));return o!==-1&&(n=o),{...e,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1}},2(e,t){var n,r,o,i,l;if(e.dataRef.current.disabled||e.listboxState===1)return e;let u={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===ue.Nothing)return{...u,activeOptionIndex:null};if(t.focus===ue.Specific)return{...u,activeOptionIndex:e.options.findIndex(c=>c.id===t.id)};if(t.focus===ue.Previous){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=Pn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((r=d.current)==null?void 0:r.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...u,activeOptionIndex:p}}}}else if(t.focus===ue.Next){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=Pn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((i=d.current)==null?void 0:i.nextElementSibling)===f.current||((l=f.current)==null?void 0:l.nextElementSibling)===null)return{...u,activeOptionIndex:p}}}}let s=js(e),a=Pn(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...u,...s,activeOptionIndex:a}},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(l=>{var u;return!l.dataRef.current.disabled&&((u=l.dataRef.current.textValue)==null?void 0:u.startsWith(r))}),i=o?e.options.indexOf(o):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:i,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==ue.Nothing&&(r=Pn(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 i=n.findIndex(l=>o==null?void 0:o(l.dataRef.current.value));i!==-1&&(r=i)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:ue.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[i,l]of n.entries())if(o.has(l.id)&&(r.push(i),o.delete(l.id),o.size===0))break;if(r.length>0){n=n.slice();for(let i of r.reverse())n.splice(i,1)}return{...e,options:n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},9:e=>e.pendingShouldSort?{...e,...js(e),pendingShouldSort:!1}:e};class Gr extends mi{constructor(t){super(t),Is(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:l}=this.state.dataRef.current;return Ie(i,{0:()=>r==null?void 0:r(n),1:()=>{let u=l.slice(),s=u.findIndex(a=>o(a,n));return s===-1?u.push(n):u.splice(s,1),r==null?void 0:r(u)}})},registerOption:mr(()=>{let n=[],r=new Set;return[(o,i)=>{r.has(i)||(r.add(i),n.push({id:o,dataRef:i}))},()=>(r.clear(),this.send({type:5,options:n.splice(0)}))]}),unregisterOption:mr(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:mr(()=>{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:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:n,id:r}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(n.current.value),this.send({type:2,focus:ue.Specific,id:r})}},selectOption:n=>{let r=this.state.options.find(o=>o.id===n);r&&this.actions.onChange(r.dataRef.current.value)},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:7,element:n})},setOptionsElement:n=>{this.send({type:8,element:n})}}),Is(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,i=n.options;return o===null||(r=i[o])==null?void 0:r.id},isActive(n,r){var o;let i=n.activeOptionIndex,l=n.options;return i!==null?((o=l[i])==null?void 0:o.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=hr.get(null);this.disposables.add(r.on(bi.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))}}static new({id:t,__demoMode:n=!1}){return new Gr({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:ue.Nothing},__demoMode:n})}reduce(t,n){return Ie(n.type,Bd,t,n)}}const Rs=m.createContext(null);function Yr(e){let t=m.useContext(Rs);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ks),n}return t}function ks({id:e,__demoMode:t=!1}){let n=m.useMemo(()=>Gr.new({id:e,__demoMode:t}),[]);return Ss(()=>n.dispose()),n}let Fn=m.createContext(null);Fn.displayName="ListboxDataContext";function tn(e){let t=m.useContext(Fn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,tn),n}return t}let Wd=m.Fragment;function Ud(e,t){let n=m.useId(),r=sr(),{value:o,defaultValue:i,form:l,name:u,onChange:s,by:a,invalid:c=!1,disabled:d=r||!1,horizontal:p=!1,multiple:f=!1,__demoMode:g=!1,...v}=e;const S=p?"horizontal":"vertical";let D=Fe(t),w=iu(i),[N=f?[]:void 0,F]=ou(o,s,w),R=ks({id:n,__demoMode:g}),B=m.useRef({static:!1,hold:!1}),V=m.useRef(new Map),h=Lu(a),x=m.useCallback(k=>Ie(b.mode,{[Ze.Multi]:()=>N.some(H=>h(H,k)),[Ze.Single]:()=>h(N,k)}),[N]),b=m.useMemo(()=>({value:N,disabled:d,invalid:c,mode:f?Ze.Multi:Ze.Single,orientation:S,onChange:F,compare:h,isSelected:x,optionsPropsRef:B,listRef:V}),[N,d,c,f,S,F,h,x,B,V]);ae(()=>{R.state.dataRef.current=b},[b]);let A=Re(R,k=>k.listboxState),T=hr.get(null),$=Re(T,m.useCallback(k=>T.selectors.isTop(k,n),[T,n])),[E,O]=Re(R,k=>[k.buttonElement,k.optionsElement]);oc($,[E,O],(k,H)=>{R.send({type:Fs.CloseListbox}),Oi(H,Er.Loose)||(k.preventDefault(),E==null||E.focus())});let L=m.useMemo(()=>({open:A===ve.Open,disabled:d,invalid:c,value:N}),[A,d,c,N]),[P,y]=Ou({inherit:!0}),I={ref:D},_=m.useCallback(()=>{if(w!==void 0)return F==null?void 0:F(w)},[F,w]),W=Le();return m.createElement(y,{value:P,props:{htmlFor:E==null?void 0:E.id},slot:{open:A===ve.Open,disabled:d}},m.createElement(cd,null,m.createElement(Rs.Provider,{value:R},m.createElement(Fn.Provider,{value:b},m.createElement(ws,{value:Ie(A,{[ve.Open]:Ge.Open,[ve.Closed]:Ge.Closed})},u!=null&&N!=null&&m.createElement(fu,{disabled:d,data:{[u]:N},form:l,onReset:_}),W({ourProps:I,theirProps:v,slot:L,defaultTag:Wd,name:"Listbox"}))))))}let Vd="button";function Hd(e,t){let n=m.useId(),r=ri(),o=tn("Listbox.Button"),i=Yr("Listbox.Button"),{id:l=r||`headlessui-listbox-button-${n}`,disabled:u=o.disabled||!1,autoFocus:s=!1,...a}=e,c=Fe(t,sd(),i.actions.setButtonElement),d=ld(),[p,f,g]=Re(i,y=>[y.listboxState,y.buttonElement,y.optionsElement]),v=p===ve.Open;lc(v,{trigger:f,action:m.useCallback(y=>{if(f!=null&&f.contains(y.target))return gn.Ignore;let I=y.target.closest('[role="option"]:not([data-disabled])');return st(I)?gn.Select(I):g!=null&&g.contains(y.target)?gn.Ignore:gn.Close},[f,g]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let S=te(y=>{switch(y.key){case ge.Enter:su(y.currentTarget);break;case ge.Space:case ge.ArrowDown:y.preventDefault(),i.actions.openListbox({focus:o.value?ue.Nothing:ue.First});break;case ge.ArrowUp:y.preventDefault(),i.actions.openListbox({focus:o.value?ue.Nothing:ue.Last});break}}),D=te(y=>{switch(y.key){case ge.Space:y.preventDefault();break}}),w=te(y=>{var I;if(y.button===Es.Left){if(bu(y.currentTarget))return y.preventDefault();i.state.listboxState===ve.Open?(we.flushSync(()=>i.actions.closeListbox()),(I=i.state.buttonElement)==null||I.focus({preventScroll:!0})):(y.preventDefault(),i.actions.openListbox({focus:ue.Nothing}))}}),N=m.useRef(null),F=te(y=>{N.current=y.pointerType,y.pointerType==="mouse"&&w(y)}),R=te(y=>{N.current!=="mouse"&&w(y)}),B=te(y=>y.preventDefault()),V=ci([l]),h=wu(),{isFocusVisible:x,focusProps:b}=Ga({autoFocus:s}),{isHovered:A,hoverProps:T}=za({isDisabled:u}),{pressed:$,pressProps:E}=Ja({disabled:u}),O=m.useMemo(()=>({open:p===ve.Open,active:$||p===ve.Open,disabled:u,invalid:o.invalid,value:o.value,hover:A,focus:x,autofocus:s}),[p,o.value,u,A,x,$,o.invalid,s]),L=Re(i,y=>y.listboxState===ve.Open),P=Jo(d(),{ref:c,id:l,type:ac(e,f),"aria-haspopup":"listbox","aria-controls":g==null?void 0:g.id,"aria-expanded":L,"aria-labelledby":V,"aria-describedby":h,disabled:u||void 0,autoFocus:s,onKeyDown:S,onKeyUp:D,onKeyPress:B,onPointerDown:F,onClick:R},b,T,E);return Le()({ourProps:P,theirProps:a,slot:O,defaultTag:Vd,name:"Listbox.Button"})}let _s=m.createContext(!1),zd="div",Gd=dn.RenderStrategy|dn.Static;function Yd(e,t){let n=m.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:i=!1,modal:l=!0,transition:u=!1,...s}=e,a=id(o),[c,d]=m.useState(null);a&&(i=!0);let p=tn("Listbox.Options"),f=Yr("Listbox.Options"),[g,v,S,D]=Re(f,z=>[z.listboxState,z.buttonElement,z.optionsElement,z.__demoMode]),w=Sr(v),N=Sr(S),F=Vr(),[R,B]=Fi(u,c,F!==null?(F&Ge.Open)===Ge.Open:g===ve.Open);Gu(R,v,f.actions.closeListbox);let V=D?!1:l&&g===ve.Open;gc(V,N);let h=D?!1:l&&g===ve.Open;zu(h,{allowed:m.useCallback(()=>[v,S],[v,S])});let x=g!==ve.Open,b=Fd(x,v)?!1:R,A=R&&g===ve.Closed,T=pd(A,p.value),$=te(z=>p.compare(T,z)),E=Re(f,z=>{var oe;if(a==null||!((oe=a==null?void 0:a.to)!=null&&oe.includes("selection")))return null;let fe=z.options.findIndex(Ae=>$(Ae.dataRef.current.value));return fe===-1&&(fe=0),fe}),O=(()=>{if(a==null)return;if(E===null)return{...a,inner:void 0};let z=Array.from(p.listRef.current.values());return{...a,inner:{listRef:{current:z},index:E}}})(),[L,P]=ud(O),y=ad(),I=Fe(t,a?L:null,f.actions.setOptionsElement,d),_=Pt();m.useEffect(()=>{var z;let oe=S;oe&&g===ve.Open&&oe!==((z=Yt(oe))==null?void 0:z.activeElement)&&(oe==null||oe.focus({preventScroll:!0}))},[g,S]);let W=te(z=>{var oe,fe;switch(_.dispose(),z.key){case ge.Space:if(f.state.searchQuery!=="")return z.preventDefault(),z.stopPropagation(),f.actions.search(z.key);case ge.Enter:if(z.preventDefault(),z.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:Ae}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(Ae.current.value)}p.mode===Ze.Single&&(we.flushSync(()=>f.actions.closeListbox()),(oe=f.state.buttonElement)==null||oe.focus({preventScroll:!0}));break;case Ie(p.orientation,{vertical:ge.ArrowDown,horizontal:ge.ArrowRight}):return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:ue.Next});case Ie(p.orientation,{vertical:ge.ArrowUp,horizontal:ge.ArrowLeft}):return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:ue.Previous});case ge.Home:case ge.PageUp:return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:ue.First});case ge.End:case ge.PageDown:return z.preventDefault(),z.stopPropagation(),f.actions.goToOption({focus:ue.Last});case ge.Escape:z.preventDefault(),z.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),(fe=f.state.buttonElement)==null||fe.focus({preventScroll:!0});return;case ge.Tab:z.preventDefault(),z.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),ec(f.state.buttonElement,z.shiftKey?wr.Previous:wr.Next);break;default:z.key.length===1&&(f.actions.search(z.key),_.setTimeout(()=>f.actions.clearSearch(),350));break}}),k=Re(f,z=>{var oe;return(oe=z.buttonElement)==null?void 0:oe.id}),H=m.useMemo(()=>({open:g===ve.Open}),[g]),Q=Jo(a?y():{},{id:r,ref:I,"aria-activedescendant":Re(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===Ze.Multi?!0:void 0,"aria-labelledby":k,"aria-orientation":p.orientation,onKeyDown:W,role:"listbox",tabIndex:g===ve.Open?0:void 0,style:{...s.style,...P,"--button-width":Du(v,!0).width},...Ii(B)}),Y=Le(),K=m.useMemo(()=>p.mode===Ze.Multi?p:{...p,isSelected:$},[p,$]);return m.createElement(Td,{enabled:i?e.static||R:!1,ownerDocument:w},m.createElement(Fn.Provider,{value:K},Y({ourProps:Q,theirProps:s,slot:H,defaultTag:zd,features:Gd,visible:b,name:"Listbox.Options"})))}let Kd="div";function qd(e,t){let n=m.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...l}=e,u=m.useContext(_s)===!0,s=tn("Listbox.Option"),a=Yr("Listbox.Option"),c=Re(a,b=>a.selectors.isActive(b,r)),d=s.isSelected(i),p=m.useRef(null),f=Rd(p),g=Et({disabled:o,value:i,domRef:p,get textValue(){return f()}}),v=Fe(t,p,b=>{b?s.listRef.current.set(r,b):s.listRef.current.delete(r)}),S=Re(a,b=>a.selectors.shouldScrollIntoView(b,r));ae(()=>{if(S)return ze().requestAnimationFrame(()=>{var b,A;(A=(b=p.current)==null?void 0:b.scrollIntoView)==null||A.call(b,{block:"nearest"})})},[S,p]),ae(()=>{if(!u)return a.actions.registerOption(r,g),()=>a.actions.unregisterOption(r)},[g,r,u]);let D=te(b=>{var A;if(o)return b.preventDefault();a.actions.onChange(i),s.mode===Ze.Single&&(we.flushSync(()=>a.actions.closeListbox()),(A=a.state.buttonElement)==null||A.focus({preventScroll:!0}))}),w=te(()=>{if(o)return a.actions.goToOption({focus:ue.Nothing});a.actions.goToOption({focus:ue.Specific,id:r})}),N=vc(),F=te(b=>N.update(b)),R=te(b=>{N.wasMoved(b)&&(o||c&&a.state.activationTrigger===In.Pointer||a.actions.goToOption({focus:ue.Specific,id:r},In.Pointer))}),B=te(b=>{N.wasMoved(b)&&(o||c&&a.state.activationTrigger===In.Pointer&&a.actions.goToOption({focus:ue.Nothing}))}),V=m.useMemo(()=>({active:c,focus:c,selected:d,disabled:o,selectedOption:d&&u}),[c,d,o,u]),h=u?{}:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":d,disabled:void 0,onClick:D,onFocus:w,onPointerEnter:F,onMouseEnter:F,onPointerMove:R,onMouseMove:R,onPointerLeave:B,onMouseLeave:B},x=Le();return!d&&u?null:x({ourProps:h,theirProps:l,slot:V,defaultTag:Kd,name:"Listbox.Option"})}let Xd=m.Fragment;function Qd(e,t){let{options:n,placeholder:r,...o}=e,i={ref:Fe(t)},l=tn("ListboxSelectedOption"),u=m.useMemo(()=>({}),[]),s=l.value===void 0||l.value===null||l.mode===Ze.Multi&&Array.isArray(l.value)&&l.value.length===0,a=Le();return m.createElement(_s.Provider,{value:!0},a({ourProps:i,theirProps:{...o,children:m.createElement(m.Fragment,null,r&&s?r:n)},slot:u,defaultTag:Xd,name:"ListboxSelectedOption"}))}let Jd=Ce(Ud),Zd=Ce(Hd),ep=$u,tp=Ce(Yd),np=Ce(qd),rp=Ce(Qd),bt=Object.assign(Jd,{Button:Zd,Label:ep,Options:tp,Option:np,SelectedOption:rp});function op({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const Bs=j.forwardRef(op),ip=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o=""})=>{const{t:i}=He();return C.jsx("div",{className:`relative ${o}`,children:C.jsx(bt,{value:t,onChange:n,disabled:r,children:({open:l})=>C.jsxs(C.Fragment,{children:[C.jsxs(bt.Button,{className:`
84
84
  relative w-full h-9 text-text-primary bg-fill-input-primary
85
85
  items-center justify-between flex px-3 rounded-lg
86
86
  focus:outline-none
87
87
  ${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
88
- ${a?"ring-1 ring-white":""}
89
- `,children:[O.jsx("span",{className:"text-sm leading-[18px] font-medium",children:i("deposit.asset")}),O.jsxs("div",{className:"flex items-center",children:[t.iconUrl?O.jsx("img",{src:t.iconUrl,alt:t.token,className:"w-4 h-4 rounded-full"}):O.jsx("div",{className:"w-4 h-4 rounded-full bg-green-500 flex items-center justify-center",children:O.jsx("span",{className:"text-xs text-white font-bold",children:t.token.charAt(0)})}),O.jsx("span",{className:"text-sm text-white ml-1",children:t.symbol||t.token}),O.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${a?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[O.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:O.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"})}),O.jsx("defs",{children:O.jsx("clipPath",{id:"clip0_12919_27745",children:O.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),O.jsx($s,{as:m.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:O.jsx(bt.Options,{className:`
88
+ ${l?"ring-1 ring-white":""}
89
+ `,children:[C.jsx("span",{className:"text-sm leading-[18px] font-medium",children:i("deposit.asset")}),C.jsxs("div",{className:"flex items-center",children:[t.iconUrl?C.jsx("img",{src:t.iconUrl,alt:t.token,className:"w-4 h-4 rounded-full"}):C.jsx("div",{className:"w-4 h-4 rounded-full bg-green-500 flex items-center justify-center",children:C.jsx("span",{className:"text-xs text-white font-bold",children:t.token.charAt(0)})}),C.jsx("span",{className:"text-sm text-white ml-1",children:t.symbol||t.token}),C.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:[C.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:C.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"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_12919_27745",children:C.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),C.jsx(Ls,{as:m.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:C.jsx(bt.Options,{className:`
90
90
  absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
91
91
  bg-fill-input-primary border border-line-divider-secondary shadow-lg
92
92
  focus:outline-none
93
- `,children:e.map(u=>O.jsx(bt.Option,{value:u,className:({active:s,selected:l})=>`relative cursor-pointer select-none py-3 px-3 ${l?"bg-fill-btn-secondary":s?"bg-fill-input-secondary":""}`,children:({selected:s,active:l})=>O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center space-x-3",children:[u.iconUrl?O.jsx("img",{src:u.iconUrl,alt:u.token,className:"w-5 h-5 rounded-full"}):O.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:O.jsx("span",{className:"text-xs text-white font-bold",children:u.token.charAt(0)})}),O.jsx("div",{className:"flex flex-col",children:O.jsx("span",{className:`text-sm font-medium ${s||l?"text-text-primary":"text-text-tertiary"}`,children:u.symbol||u.token})})]}),s&&O.jsx(ks,{className:"w-4 h-4 text-blue-400"})]})},u.tokenAddress))})})]})})})},op=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:i="mpc"})=>{const{t:a}=Ye();return O.jsx("div",{className:`relative ${o}`,children:O.jsx(bt,{value:t,onChange:n,disabled:r,children:({open:u})=>O.jsxs(O.Fragment,{children:[O.jsxs(bt.Button,{className:`
93
+ `,children:e.map(u=>C.jsx(bt.Option,{value:u,className:({active:s,selected:a})=>`relative cursor-pointer select-none py-3 px-3 ${a?"bg-fill-btn-secondary":s?"bg-fill-input-secondary":""}`,children:({selected:s,active:a})=>C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center space-x-3",children:[u.iconUrl?C.jsx("img",{src:u.iconUrl,alt:u.token,className:"w-5 h-5 rounded-full"}):C.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:C.jsx("span",{className:"text-xs text-white font-bold",children:u.token.charAt(0)})}),C.jsx("div",{className:"flex flex-col",children:C.jsx("span",{className:`text-sm font-medium ${s||a?"text-text-primary":"text-text-tertiary"}`,children:u.symbol||u.token})})]}),s&&C.jsx(Bs,{className:"w-4 h-4 text-blue-400"})]})},u.tokenAddress))})})]})})})},sp=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:i="mpc"})=>{const{t:l}=He();return C.jsx("div",{className:`relative ${o}`,children:C.jsx(bt,{value:t,onChange:n,disabled:r,children:({open:u})=>C.jsxs(C.Fragment,{children:[C.jsxs(bt.Button,{className:`
94
94
  relative w-full h-9 text-text-primary bg-fill-input-primary
95
95
  items-center justify-between flex px-3 rounded-lg
96
96
  focus:outline-none
97
97
  ${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
98
98
  ${u?"ring-1 ring-white":""}
99
- `,children:[O.jsx("span",{className:"text-sm leading-[18px] font-medium",children:a("deposit.chain")}),O.jsxs("div",{className:"flex items-center space-x-2",children:[t.chainIconUrl?O.jsx("img",{src:t.chainIconUrl,alt:t.chain,className:"w-4 h-4 rounded-full"}):O.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:O.jsx("span",{className:"text-xs text-white font-bold",children:t.chain.charAt(0)})}),O.jsx("span",{className:"text-sm text-white ml-1",children:t.chain}),O.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${u?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[O.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:O.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"})}),O.jsx("defs",{children:O.jsx("clipPath",{id:"clip0_12919_27745",children:O.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),O.jsx($s,{as:m.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:O.jsx(bt.Options,{className:`
99
+ `,children:[C.jsx("span",{className:"text-sm leading-[18px] font-medium",children:l("deposit.chain")}),C.jsxs("div",{className:"flex items-center space-x-2",children:[t.chainIconUrl?C.jsx("img",{src:t.chainIconUrl,alt:t.chain,className:"w-4 h-4 rounded-full"}):C.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:C.jsx("span",{className:"text-xs text-white font-bold",children:t.chain.charAt(0)})}),C.jsx("span",{className:"text-sm text-white ml-1",children:t.chain}),C.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${u?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:C.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"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_12919_27745",children:C.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),C.jsx(Ls,{as:m.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:C.jsx(bt.Options,{className:`
100
100
  absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
101
101
  bg-fill-input-primary border border-line-divider-secondary shadow-lg
102
102
  focus:outline-none
103
- `,children:e.filter(s=>s[i==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(s=>O.jsx(bt.Option,{value:s,className:({active:l,selected:c})=>`relative cursor-pointer select-none py-3 px-3 ${c?"bg-fill-btn-secondary":l?"bg-fill-input-secondary":""}`,children:({selected:l,active:c})=>O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center space-x-3",children:[s.chainIconUrl?O.jsx("img",{src:s.chainIconUrl,alt:s.chain,className:"w-5 h-5 rounded-full"}):O.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:O.jsx("span",{className:"text-xs text-white font-bold",children:s.chain.charAt(0)})}),O.jsx("div",{className:"flex flex-col",children:O.jsx("span",{className:`text-sm font-medium ${l||c?"text-text-primary":"text-text-tertiary"}`,children:s.chain})})]}),l&&O.jsx(ks,{className:"w-4 h-4 text-blue-400"})]})},s.chainId))})})]})})})},Kr=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:i="mpc"})=>{const a=m.useMemo(()=>(e==null?void 0:e.tokenList)||[],[e]),u=f=>{if(n(f.chainId),f.tokenList&&f.tokenList.length>0&&!f.tokenList.some(v=>v.token===r||v.symbol===r)){const v=f.tokenList[0];o(v.symbol||v.token)}},s=f=>{o(f.symbol||f.token)},l=m.useMemo(()=>t.map(f=>f),[t]),c=m.useMemo(()=>l.find(f=>f.chainId===e.chainId)||l[0],[l,e.chainId]),d=m.useMemo(()=>a.map(f=>({token:f.token,symbol:f.symbol,iconUrl:f.iconUrl,decimals:f.decimals,tokenAddress:f.tokenAddress})),[a]),p=m.useMemo(()=>{if(d.length!==0)return d.find(f=>f.token===r||f.symbol===r)||d[0]},[d,r]);return O.jsxs("div",{className:"space-y-4",children:[O.jsx(op,{chains:l,selectedChain:c,onChainChange:f=>{const g=t.find(v=>v.chainId===f.chainId);g&&u(g)},walletType:i,className:"w-full"}),d.length>0?p&&O.jsx(rp,{tokens:d,selectedToken:p,onTokenChange:s,className:"w-full"}):O.jsx("div",{className:"w-full h-9 bg-fill-input-primary rounded-lg flex items-center justify-center",children:O.jsx("span",{className:"text-sm text-gray-400",children:"No tokens available"})})]})},ip=(e,t)=>Number(e)>Number(t),ze=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 i=r[1]||"";return i.length>6&&(i=i.substring(0,6)),i=i.replace(/0+$/,""),i?(i.length===1&&(i+="0"),o+"."+i):o+".00"},qr=(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 s=o[0]+"."+o[1].substring(0,6);return qr(s,t)}const i=parseFloat(e),a=parseFloat(t);if(!isNaN(i)&&!isNaN(a)&&i>a)return{isValid:!0,formattedValue:ze(t),errorType:"auto_adjusted_to_max"};let u=e;return!isNaN(i)&&!e.endsWith(".")&&e.includes(".")&&(u=e.replace(/\.?0+$/,""),u.includes(".")||(u=u)),{isValid:!0,formattedValue:u}},sp=(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)},_s={ETHEREUM:1,SEPOLIA:11155111},lp=[_s.ETHEREUM,_s.SEPOLIA],ap=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!lp.includes(t)}return!0},up=[{chainId:1,chain:"Ethereum",chainIconUrl:"https://static.edgex.exchange/icons/logo/ethereum.svg",allowDeposit:!0,blockTime:12,txConfirm:12},{chainId:42161,chain:"Arbitrum",chainIconUrl:"https://static.edgex.exchange/icons/logo/arbitrum.svg",allowDeposit:!0,blockTime:1,txConfirm:1}],Xr={wallet:"mpc",ethAddress:"0x1234567890123456789012345678901234567890",accountId:"123",l2Key:"0x123"},Qr={address:"0x1234567890123456789012345678901234567890"},Jr={multiChain:{minDeposit:10}};var jn={},cp=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()}},fp=cp,Bs={"text/plain":"Text","text/html":"Url",default:"Text"},dp="Copy to clipboard: #{key}, Enter";function pp(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function mp(e,t){var n,r,o,i,a,u,s=!1;t||(t={}),n=t.debug||!1;try{o=fp(),i=document.createRange(),a=document.getSelection(),u=document.createElement("span"),u.textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(c){if(c.stopPropagation(),t.format)if(c.preventDefault(),typeof c.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=Bs[t.format]||Bs.default;window.clipboardData.setData(d,e)}else c.clipboardData.clearData(),c.clipboardData.setData(t.format,e);t.onCopy&&(c.preventDefault(),t.onCopy(c.clipboardData))}),document.body.appendChild(u),i.selectNodeContents(u),a.addRange(i);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");s=!0}catch(c){n&&console.error("unable to copy using execCommand: ",c),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),r=pp("message"in t?t.message:dp),window.prompt(r,e)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(i):a.removeAllRanges()),u&&document.body.removeChild(u),o()}return s}var hp=mp;function Zr(e){"@babel/helpers - typeof";return Zr=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},Zr(e)}Object.defineProperty(jn,"__esModule",{value:!0}),jn.CopyToClipboard=void 0;var Rn=Ws(m),gp=Ws(hp),vp=["text","onCopy","options","children"];function Ws(e){return e&&e.__esModule?e:{default:e}}function Us(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 Vs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Us(Object(n),!0).forEach(function(r){to(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Us(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bp(e,t){if(e==null)return{};var n=xp(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xp(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function yp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wp(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 Ep(e,t,n){return t&&wp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sp(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&&eo(e,t)}function eo(e,t){return eo=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},eo(e,t)}function Cp(e){var t=Tp();return function(){var r=kn(e),o;if(t){var i=kn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Op(this,o)}}function Op(e,t){if(t&&(Zr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hs(e)}function Hs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tp(){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 kn(e){return kn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},kn(e)}function to(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zs=function(e){Sp(n,e);var t=Cp(n);function n(){var r;yp(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),to(Hs(r),"onClick",function(u){var s=r.props,l=s.text,c=s.onCopy,d=s.children,p=s.options,f=Rn.default.Children.only(d),g=(0,gp.default)(l,p);c&&c(l,g),f&&f.props&&typeof f.props.onClick=="function"&&f.props.onClick(u)}),r}return Ep(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var i=o.children,a=bp(o,vp),u=Rn.default.Children.only(i);return Rn.default.cloneElement(u,Vs(Vs({},a),{},{onClick:this.onClick}))}}]),n}(Rn.default.PureComponent);jn.CopyToClipboard=zs,to(zs,"defaultProps",{onCopy:void 0,options:void 0});var Np=jn,no=Np.CopyToClipboard;no.CopyToClipboard=no;var Ap=no;const $p=Zl(Ap);var Pp=Object.defineProperty,_n=Object.getOwnPropertySymbols,Gs=Object.prototype.hasOwnProperty,Ys=Object.prototype.propertyIsEnumerable,Ks=(e,t,n)=>t in e?Pp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ro=(e,t)=>{for(var n in t||(t={}))Gs.call(t,n)&&Ks(e,n,t[n]);if(_n)for(var n of _n(t))Ys.call(t,n)&&Ks(e,n,t[n]);return e},oo=(e,t)=>{var n={};for(var r in e)Gs.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_n)for(var r of _n(e))t.indexOf(r)<0&&Ys.call(e,r)&&(n[r]=e[r]);return n};/**
103
+ `,children:e.filter(s=>s[i==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(s=>C.jsx(bt.Option,{value:s,className:({active:a,selected:c})=>`relative cursor-pointer select-none py-3 px-3 ${c?"bg-fill-btn-secondary":a?"bg-fill-input-secondary":""}`,children:({selected:a,active:c})=>C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center space-x-3",children:[s.chainIconUrl?C.jsx("img",{src:s.chainIconUrl,alt:s.chain,className:"w-5 h-5 rounded-full"}):C.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:C.jsx("span",{className:"text-xs text-white font-bold",children:s.chain.charAt(0)})}),C.jsx("div",{className:"flex flex-col",children:C.jsx("span",{className:`text-sm font-medium ${a||c?"text-text-primary":"text-text-tertiary"}`,children:s.chain})})]}),a&&C.jsx(Bs,{className:"w-4 h-4 text-blue-400"})]})},s.chainId))})})]})})})},Kr=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:i="mpc"})=>{const l=m.useMemo(()=>(e==null?void 0:e.tokenList)||[],[e]),u=f=>{if(n(f.chainId),f.tokenList&&f.tokenList.length>0&&!f.tokenList.some(v=>v.token===r||v.symbol===r)){const v=f.tokenList[0];o(v.symbol||v.token)}},s=f=>{o(f.symbol||f.token)},a=m.useMemo(()=>t.map(f=>f),[t]),c=m.useMemo(()=>a.find(f=>f.chainId===e.chainId)||a[0],[a,e.chainId]),d=m.useMemo(()=>l.map(f=>({token:f.token,symbol:f.symbol,iconUrl:f.iconUrl,decimals:f.decimals,tokenAddress:f.tokenAddress})),[l]),p=m.useMemo(()=>{if(d.length!==0)return d.find(f=>f.token===r||f.symbol===r)||d[0]},[d,r]);return C.jsxs("div",{className:"space-y-4",children:[C.jsx(sp,{chains:a,selectedChain:c,onChainChange:f=>{const g=t.find(v=>v.chainId===f.chainId);g&&u(g)},walletType:i,className:"w-full"}),d.length>0?p&&C.jsx(ip,{tokens:d,selectedToken:p,onTokenChange:s,className:"w-full"}):C.jsx("div",{className:"w-full h-9 bg-fill-input-primary rounded-lg flex items-center justify-center",children:C.jsx("span",{className:"text-sm text-gray-400",children:"No tokens available"})})]})},lp=(e,t)=>Number(e)>Number(t),Ye=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 i=r[1]||"";return i.length>6&&(i=i.substring(0,6)),i=i.replace(/0+$/,""),i?(i.length===1&&(i+="0"),o+"."+i):o+".00"},qr=(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 s=o[0]+"."+o[1].substring(0,6);return qr(s,t)}const i=parseFloat(e),l=parseFloat(t);if(!isNaN(i)&&!isNaN(l)&&i>l)return{isValid:!0,formattedValue:Ye(t),errorType:"auto_adjusted_to_max"};let u=e;return!isNaN(i)&&!e.endsWith(".")&&e.includes(".")&&(u=e.replace(/\.?0+$/,""),u.includes(".")||(u=u)),{isValid:!0,formattedValue:u}},ap=(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)},Ws={ETHEREUM:1,SEPOLIA:11155111},up=[Ws.ETHEREUM,Ws.SEPOLIA],cp=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!up.includes(t)}return!0},fp=[{chainId:1,chain:"Ethereum",chainIconUrl:"https://static.edgex.exchange/icons/logo/ethereum.svg",allowDeposit:!0,blockTime:12,txConfirm:12},{chainId:42161,chain:"Arbitrum",chainIconUrl:"https://static.edgex.exchange/icons/logo/arbitrum.svg",allowDeposit:!0,blockTime:1,txConfirm:1}],Xr={wallet:"mpc",ethAddress:"0x1234567890123456789012345678901234567890",accountId:"123",l2Key:"0x123"},Qr={address:"0x1234567890123456789012345678901234567890"},Jr={multiChain:{minDeposit:10}};var jn={},dp=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()}},pp=dp,Us={"text/plain":"Text","text/html":"Url",default:"Text"},mp="Copy to clipboard: #{key}, Enter";function hp(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function gp(e,t){var n,r,o,i,l,u,s=!1;t||(t={}),n=t.debug||!1;try{o=pp(),i=document.createRange(),l=document.getSelection(),u=document.createElement("span"),u.textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(c){if(c.stopPropagation(),t.format)if(c.preventDefault(),typeof c.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=Us[t.format]||Us.default;window.clipboardData.setData(d,e)}else c.clipboardData.clearData(),c.clipboardData.setData(t.format,e);t.onCopy&&(c.preventDefault(),t.onCopy(c.clipboardData))}),document.body.appendChild(u),i.selectNodeContents(u),l.addRange(i);var a=document.execCommand("copy");if(!a)throw new Error("copy command was unsuccessful");s=!0}catch(c){n&&console.error("unable to copy using execCommand: ",c),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),r=hp("message"in t?t.message:mp),window.prompt(r,e)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(i):l.removeAllRanges()),u&&document.body.removeChild(u),o()}return s}var vp=gp;function Zr(e){"@babel/helpers - typeof";return Zr=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},Zr(e)}Object.defineProperty(jn,"__esModule",{value:!0}),jn.CopyToClipboard=void 0;var Rn=Vs(m),bp=Vs(vp),xp=["text","onCopy","options","children"];function Vs(e){return e&&e.__esModule?e:{default:e}}function Hs(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 zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hs(Object(n),!0).forEach(function(r){to(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hs(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yp(e,t){if(e==null)return{};var n=wp(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wp(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Ep(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sp(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 Cp(e,t,n){return t&&Sp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Op(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&&eo(e,t)}function eo(e,t){return eo=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},eo(e,t)}function Tp(e){var t=Ap();return function(){var r=kn(e),o;if(t){var i=kn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Np(this,o)}}function Np(e,t){if(t&&(Zr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gs(e)}function Gs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ap(){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 kn(e){return kn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},kn(e)}function to(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ys=function(e){Op(n,e);var t=Tp(n);function n(){var r;Ep(this,n);for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return r=t.call.apply(t,[this].concat(i)),to(Gs(r),"onClick",function(u){var s=r.props,a=s.text,c=s.onCopy,d=s.children,p=s.options,f=Rn.default.Children.only(d),g=(0,bp.default)(a,p);c&&c(a,g),f&&f.props&&typeof f.props.onClick=="function"&&f.props.onClick(u)}),r}return Cp(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var i=o.children,l=yp(o,xp),u=Rn.default.Children.only(i);return Rn.default.cloneElement(u,zs(zs({},l),{},{onClick:this.onClick}))}}]),n}(Rn.default.PureComponent);jn.CopyToClipboard=Ys,to(Ys,"defaultProps",{onCopy:void 0,options:void 0});var $p=jn,no=$p.CopyToClipboard;no.CopyToClipboard=no;var Pp=no;const Lp=ta(Pp);var Mp=Object.defineProperty,_n=Object.getOwnPropertySymbols,Ks=Object.prototype.hasOwnProperty,qs=Object.prototype.propertyIsEnumerable,Xs=(e,t,n)=>t in e?Mp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ro=(e,t)=>{for(var n in t||(t={}))Ks.call(t,n)&&Xs(e,n,t[n]);if(_n)for(var n of _n(t))qs.call(t,n)&&Xs(e,n,t[n]);return e},oo=(e,t)=>{var n={};for(var r in e)Ks.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_n)for(var r of _n(e))t.indexOf(r)<0&&qs.call(e,r)&&(n[r]=e[r]);return n};/**
104
104
  * @license QR Code generator library (TypeScript)
105
105
  * Copyright (c) Project Nayuki.
106
106
  * SPDX-License-Identifier: MIT
107
- */var Tt;(e=>{const t=class J{constructor(s,l,c,d){if(this.version=s,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],s<J.MIN_VERSION||s>J.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=s*4+17;let p=[];for(let g=0;g<this.size;g++)p.push(!1);for(let g=0;g<this.size;g++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const f=this.addEccAndInterleave(c);if(this.drawCodewords(f),d==-1){let g=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const E=this.getPenaltyScore();E<g&&(d=v,g=E),this.applyMask(v)}}o(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(s,l){const c=e.QrSegment.makeSegments(s);return J.encodeSegments(c,l)}static encodeBinary(s,l){const c=e.QrSegment.makeBytes(s);return J.encodeSegments([c],l)}static encodeSegments(s,l,c=1,d=40,p=-1,f=!0){if(!(J.MIN_VERSION<=c&&c<=d&&d<=J.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let g,v;for(g=c;;g++){const P=J.getNumDataCodewords(g,l)*8,F=a.getTotalBits(s,g);if(F<=P){v=F;break}if(g>=d)throw new RangeError("Data too long")}for(const P of[J.Ecc.MEDIUM,J.Ecc.QUARTILE,J.Ecc.HIGH])f&&v<=J.getNumDataCodewords(g,P)*8&&(l=P);let E=[];for(const P of s){n(P.mode.modeBits,4,E),n(P.numChars,P.mode.numCharCountBits(g),E);for(const F of P.getData())E.push(F)}o(E.length==v);const I=J.getNumDataCodewords(g,l)*8;o(E.length<=I),n(0,Math.min(4,I-E.length),E),n(0,(8-E.length%8)%8,E),o(E.length%8==0);for(let P=236;E.length<I;P^=253)n(P,8,E);let x=[];for(;x.length*8<E.length;)x.push(0);return E.forEach((P,F)=>x[F>>>3]|=P<<7-(F&7)),new J(g,l,x,p)}getModule(s,l){return 0<=s&&s<this.size&&0<=l&&l<this.size&&this.modules[l][s]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const s=this.getAlignmentPatternPositions(),l=s.length;for(let c=0;c<l;c++)for(let d=0;d<l;d++)c==0&&d==0||c==0&&d==l-1||c==l-1&&d==0||this.drawAlignmentPattern(s[c],s[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(s){const l=this.errorCorrectionLevel.formatBits<<3|s;let c=l;for(let p=0;p<10;p++)c=c<<1^(c>>>9)*1335;const d=(l<<10|c)^21522;o(d>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,r(d,p));this.setFunctionModule(8,7,r(d,6)),this.setFunctionModule(8,8,r(d,7)),this.setFunctionModule(7,8,r(d,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,r(d,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,r(d,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,r(d,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let s=this.version;for(let c=0;c<12;c++)s=s<<1^(s>>>11)*7973;const l=this.version<<12|s;o(l>>>18==0);for(let c=0;c<18;c++){const d=r(l,c),p=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(p,f,d),this.setFunctionModule(f,p,d)}}drawFinderPattern(s,l){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){const p=Math.max(Math.abs(d),Math.abs(c)),f=s+d,g=l+c;0<=f&&f<this.size&&0<=g&&g<this.size&&this.setFunctionModule(f,g,p!=2&&p!=4)}}drawAlignmentPattern(s,l){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(s+d,l+c,Math.max(Math.abs(d),Math.abs(c))!=1)}setFunctionModule(s,l,c){this.modules[l][s]=c,this.isFunction[l][s]=!0}addEccAndInterleave(s){const l=this.version,c=this.errorCorrectionLevel;if(s.length!=J.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");const d=J.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],p=J.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],f=Math.floor(J.getNumRawDataModules(l)/8),g=d-f%d,v=Math.floor(f/d);let E=[];const I=J.reedSolomonComputeDivisor(p);for(let P=0,F=0;P<d;P++){let R=s.slice(F,F+v-p+(P<g?0:1));F+=R.length;const B=J.reedSolomonComputeRemainder(R,I);P<g&&R.push(0),E.push(R.concat(B))}let x=[];for(let P=0;P<E[0].length;P++)E.forEach((F,R)=>{(P!=v-p||R>=g)&&x.push(F[P])});return o(x.length==f),x}drawCodewords(s){if(s.length!=Math.floor(J.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let d=0;d<this.size;d++)for(let p=0;p<2;p++){const f=c-p,v=(c+1&2)==0?this.size-1-d:d;!this.isFunction[v][f]&&l<s.length*8&&(this.modules[v][f]=r(s[l>>>3],7-(l&7)),l++)}}o(l==s.length*8)}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let d;switch(s){case 0:d=(c+l)%2==0;break;case 1:d=l%2==0;break;case 2:d=c%3==0;break;case 3:d=(c+l)%3==0;break;case 4:d=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:d=c*l%2+c*l%3==0;break;case 6:d=(c*l%2+c*l%3)%2==0;break;case 7:d=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&d&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let s=0;for(let p=0;p<this.size;p++){let f=!1,g=0,v=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[p][E]==f?(g++,g==5?s+=J.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*J.PENALTY_N3),f=this.modules[p][E],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*J.PENALTY_N3}for(let p=0;p<this.size;p++){let f=!1,g=0,v=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[E][p]==f?(g++,g==5?s+=J.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*J.PENALTY_N3),f=this.modules[E][p],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*J.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let f=0;f<this.size-1;f++){const g=this.modules[p][f];g==this.modules[p][f+1]&&g==this.modules[p+1][f]&&g==this.modules[p+1][f+1]&&(s+=J.PENALTY_N2)}let l=0;for(const p of this.modules)l=p.reduce((f,g)=>f+(g?1:0),l);const c=this.size*this.size,d=Math.ceil(Math.abs(l*20-c*10)/c)-1;return o(0<=d&&d<=9),s+=d*J.PENALTY_N4,o(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return[];{const s=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2;let c=[6];for(let d=this.size-7;c.length<s;d-=l)c.splice(1,0,d);return c}}static getNumRawDataModules(s){if(s<J.MIN_VERSION||s>J.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*s+128)*s+64;if(s>=2){const c=Math.floor(s/7)+2;l-=(25*c-10)*c-55,s>=7&&(l-=36)}return o(208<=l&&l<=29648),l}static getNumDataCodewords(s,l){return Math.floor(J.getNumRawDataModules(s)/8)-J.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s]*J.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let l=[];for(let d=0;d<s-1;d++)l.push(0);l.push(1);let c=1;for(let d=0;d<s;d++){for(let p=0;p<l.length;p++)l[p]=J.reedSolomonMultiply(l[p],c),p+1<l.length&&(l[p]^=l[p+1]);c=J.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(s,l){let c=l.map(d=>0);for(const d of s){const p=d^c.shift();c.push(0),l.forEach((f,g)=>c[g]^=J.reedSolomonMultiply(f,p))}return c}static reedSolomonMultiply(s,l){if(s>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285,c^=(l>>>d&1)*s;return o(c>>>8==0),c}finderPenaltyCountPatterns(s){const l=s[1];o(l<=this.size*3);const c=l>0&&s[2]==l&&s[3]==l*3&&s[4]==l&&s[5]==l;return(c&&s[0]>=l*4&&s[6]>=l?1:0)+(c&&s[6]>=l*4&&s[0]>=l?1:0)}finderPenaltyTerminateAndCount(s,l,c){return s&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(s,l){l[0]==0&&(s+=this.size),l.pop(),l.unshift(s)}};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(u,s,l){if(s<0||s>31||u>>>s)throw new RangeError("Value out of range");for(let c=s-1;c>=0;c--)l.push(u>>>c&1)}function r(u,s){return(u>>>s&1)!=0}function o(u){if(!u)throw new Error("Assertion error")}const i=class de{constructor(s,l,c){if(this.mode=s,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(s){let l=[];for(const c of s)n(c,8,l);return new de(de.Mode.BYTE,s.length,l)}static makeNumeric(s){if(!de.isNumeric(s))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<s.length;){const d=Math.min(s.length-c,3);n(parseInt(s.substring(c,c+d),10),d*3+1,l),c+=d}return new de(de.Mode.NUMERIC,s.length,l)}static makeAlphanumeric(s){if(!de.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=s.length;c+=2){let d=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c))*45;d+=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c+1)),n(d,11,l)}return c<s.length&&n(de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c)),6,l),new de(de.Mode.ALPHANUMERIC,s.length,l)}static makeSegments(s){return s==""?[]:de.isNumeric(s)?[de.makeNumeric(s)]:de.isAlphanumeric(s)?[de.makeAlphanumeric(s)]:[de.makeBytes(de.toUtf8ByteArray(s))]}static makeEci(s){let l=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)n(s,8,l);else if(s<16384)n(2,2,l),n(s,14,l);else if(s<1e6)n(6,3,l),n(s,21,l);else throw new RangeError("ECI assignment value out of range");return new de(de.Mode.ECI,0,l)}static isNumeric(s){return de.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return de.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,l){let c=0;for(const d of s){const p=d.mode.numCharCountBits(l);if(d.numChars>=1<<p)return 1/0;c+=4+p+d.bitData.length}return c}static toUtf8ByteArray(s){s=encodeURI(s);let l=[];for(let c=0;c<s.length;c++)s.charAt(c)!="%"?l.push(s.charCodeAt(c)):(l.push(parseInt(s.substring(c+1,c+3),16)),c+=2);return l}};i.NUMERIC_REGEX=/^[0-9]*$/,i.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,i.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let a=i;e.QrSegment=i})(Tt||(Tt={})),(e=>{(t=>{const n=class{constructor(o,i){this.ordinal=o,this.formatBits=i}};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={}))})(Tt||(Tt={})),(e=>{(t=>{const n=class{constructor(o,i){this.modeBits=o,this.numBitsCharCount=i}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={}))})(Tt||(Tt={}));var Rt=Tt;/**
107
+ */var Tt;(e=>{const t=class J{constructor(s,a,c,d){if(this.version=s,this.errorCorrectionLevel=a,this.modules=[],this.isFunction=[],s<J.MIN_VERSION||s>J.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=s*4+17;let p=[];for(let g=0;g<this.size;g++)p.push(!1);for(let g=0;g<this.size;g++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const f=this.addEccAndInterleave(c);if(this.drawCodewords(f),d==-1){let g=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const S=this.getPenaltyScore();S<g&&(d=v,g=S),this.applyMask(v)}}o(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(s,a){const c=e.QrSegment.makeSegments(s);return J.encodeSegments(c,a)}static encodeBinary(s,a){const c=e.QrSegment.makeBytes(s);return J.encodeSegments([c],a)}static encodeSegments(s,a,c=1,d=40,p=-1,f=!0){if(!(J.MIN_VERSION<=c&&c<=d&&d<=J.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let g,v;for(g=c;;g++){const N=J.getNumDataCodewords(g,a)*8,F=l.getTotalBits(s,g);if(F<=N){v=F;break}if(g>=d)throw new RangeError("Data too long")}for(const N of[J.Ecc.MEDIUM,J.Ecc.QUARTILE,J.Ecc.HIGH])f&&v<=J.getNumDataCodewords(g,N)*8&&(a=N);let S=[];for(const N of s){n(N.mode.modeBits,4,S),n(N.numChars,N.mode.numCharCountBits(g),S);for(const F of N.getData())S.push(F)}o(S.length==v);const D=J.getNumDataCodewords(g,a)*8;o(S.length<=D),n(0,Math.min(4,D-S.length),S),n(0,(8-S.length%8)%8,S),o(S.length%8==0);for(let N=236;S.length<D;N^=253)n(N,8,S);let w=[];for(;w.length*8<S.length;)w.push(0);return S.forEach((N,F)=>w[F>>>3]|=N<<7-(F&7)),new J(g,a,w,p)}getModule(s,a){return 0<=s&&s<this.size&&0<=a&&a<this.size&&this.modules[a][s]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const s=this.getAlignmentPatternPositions(),a=s.length;for(let c=0;c<a;c++)for(let d=0;d<a;d++)c==0&&d==0||c==0&&d==a-1||c==a-1&&d==0||this.drawAlignmentPattern(s[c],s[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(s){const a=this.errorCorrectionLevel.formatBits<<3|s;let c=a;for(let p=0;p<10;p++)c=c<<1^(c>>>9)*1335;const d=(a<<10|c)^21522;o(d>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,r(d,p));this.setFunctionModule(8,7,r(d,6)),this.setFunctionModule(8,8,r(d,7)),this.setFunctionModule(7,8,r(d,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,r(d,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,r(d,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,r(d,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let s=this.version;for(let c=0;c<12;c++)s=s<<1^(s>>>11)*7973;const a=this.version<<12|s;o(a>>>18==0);for(let c=0;c<18;c++){const d=r(a,c),p=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(p,f,d),this.setFunctionModule(f,p,d)}}drawFinderPattern(s,a){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){const p=Math.max(Math.abs(d),Math.abs(c)),f=s+d,g=a+c;0<=f&&f<this.size&&0<=g&&g<this.size&&this.setFunctionModule(f,g,p!=2&&p!=4)}}drawAlignmentPattern(s,a){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(s+d,a+c,Math.max(Math.abs(d),Math.abs(c))!=1)}setFunctionModule(s,a,c){this.modules[a][s]=c,this.isFunction[a][s]=!0}addEccAndInterleave(s){const a=this.version,c=this.errorCorrectionLevel;if(s.length!=J.getNumDataCodewords(a,c))throw new RangeError("Invalid argument");const d=J.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a],p=J.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a],f=Math.floor(J.getNumRawDataModules(a)/8),g=d-f%d,v=Math.floor(f/d);let S=[];const D=J.reedSolomonComputeDivisor(p);for(let N=0,F=0;N<d;N++){let R=s.slice(F,F+v-p+(N<g?0:1));F+=R.length;const B=J.reedSolomonComputeRemainder(R,D);N<g&&R.push(0),S.push(R.concat(B))}let w=[];for(let N=0;N<S[0].length;N++)S.forEach((F,R)=>{(N!=v-p||R>=g)&&w.push(F[N])});return o(w.length==f),w}drawCodewords(s){if(s.length!=Math.floor(J.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let a=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let d=0;d<this.size;d++)for(let p=0;p<2;p++){const f=c-p,v=(c+1&2)==0?this.size-1-d:d;!this.isFunction[v][f]&&a<s.length*8&&(this.modules[v][f]=r(s[a>>>3],7-(a&7)),a++)}}o(a==s.length*8)}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let a=0;a<this.size;a++)for(let c=0;c<this.size;c++){let d;switch(s){case 0:d=(c+a)%2==0;break;case 1:d=a%2==0;break;case 2:d=c%3==0;break;case 3:d=(c+a)%3==0;break;case 4:d=(Math.floor(c/3)+Math.floor(a/2))%2==0;break;case 5:d=c*a%2+c*a%3==0;break;case 6:d=(c*a%2+c*a%3)%2==0;break;case 7:d=((c+a)%2+c*a%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[a][c]&&d&&(this.modules[a][c]=!this.modules[a][c])}}getPenaltyScore(){let s=0;for(let p=0;p<this.size;p++){let f=!1,g=0,v=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[p][S]==f?(g++,g==5?s+=J.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*J.PENALTY_N3),f=this.modules[p][S],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*J.PENALTY_N3}for(let p=0;p<this.size;p++){let f=!1,g=0,v=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[S][p]==f?(g++,g==5?s+=J.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*J.PENALTY_N3),f=this.modules[S][p],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*J.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let f=0;f<this.size-1;f++){const g=this.modules[p][f];g==this.modules[p][f+1]&&g==this.modules[p+1][f]&&g==this.modules[p+1][f+1]&&(s+=J.PENALTY_N2)}let a=0;for(const p of this.modules)a=p.reduce((f,g)=>f+(g?1:0),a);const c=this.size*this.size,d=Math.ceil(Math.abs(a*20-c*10)/c)-1;return o(0<=d&&d<=9),s+=d*J.PENALTY_N4,o(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return[];{const s=Math.floor(this.version/7)+2,a=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2;let c=[6];for(let d=this.size-7;c.length<s;d-=a)c.splice(1,0,d);return c}}static getNumRawDataModules(s){if(s<J.MIN_VERSION||s>J.MAX_VERSION)throw new RangeError("Version number out of range");let a=(16*s+128)*s+64;if(s>=2){const c=Math.floor(s/7)+2;a-=(25*c-10)*c-55,s>=7&&(a-=36)}return o(208<=a&&a<=29648),a}static getNumDataCodewords(s,a){return Math.floor(J.getNumRawDataModules(s)/8)-J.ECC_CODEWORDS_PER_BLOCK[a.ordinal][s]*J.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let a=[];for(let d=0;d<s-1;d++)a.push(0);a.push(1);let c=1;for(let d=0;d<s;d++){for(let p=0;p<a.length;p++)a[p]=J.reedSolomonMultiply(a[p],c),p+1<a.length&&(a[p]^=a[p+1]);c=J.reedSolomonMultiply(c,2)}return a}static reedSolomonComputeRemainder(s,a){let c=a.map(d=>0);for(const d of s){const p=d^c.shift();c.push(0),a.forEach((f,g)=>c[g]^=J.reedSolomonMultiply(f,p))}return c}static reedSolomonMultiply(s,a){if(s>>>8||a>>>8)throw new RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285,c^=(a>>>d&1)*s;return o(c>>>8==0),c}finderPenaltyCountPatterns(s){const a=s[1];o(a<=this.size*3);const c=a>0&&s[2]==a&&s[3]==a*3&&s[4]==a&&s[5]==a;return(c&&s[0]>=a*4&&s[6]>=a?1:0)+(c&&s[6]>=a*4&&s[0]>=a?1:0)}finderPenaltyTerminateAndCount(s,a,c){return s&&(this.finderPenaltyAddHistory(a,c),a=0),a+=this.size,this.finderPenaltyAddHistory(a,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(s,a){a[0]==0&&(s+=this.size),a.pop(),a.unshift(s)}};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(u,s,a){if(s<0||s>31||u>>>s)throw new RangeError("Value out of range");for(let c=s-1;c>=0;c--)a.push(u>>>c&1)}function r(u,s){return(u>>>s&1)!=0}function o(u){if(!u)throw new Error("Assertion error")}const i=class de{constructor(s,a,c){if(this.mode=s,this.numChars=a,this.bitData=c,a<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(s){let a=[];for(const c of s)n(c,8,a);return new de(de.Mode.BYTE,s.length,a)}static makeNumeric(s){if(!de.isNumeric(s))throw new RangeError("String contains non-numeric characters");let a=[];for(let c=0;c<s.length;){const d=Math.min(s.length-c,3);n(parseInt(s.substring(c,c+d),10),d*3+1,a),c+=d}return new de(de.Mode.NUMERIC,s.length,a)}static makeAlphanumeric(s){if(!de.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let a=[],c;for(c=0;c+2<=s.length;c+=2){let d=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c))*45;d+=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c+1)),n(d,11,a)}return c<s.length&&n(de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c)),6,a),new de(de.Mode.ALPHANUMERIC,s.length,a)}static makeSegments(s){return s==""?[]:de.isNumeric(s)?[de.makeNumeric(s)]:de.isAlphanumeric(s)?[de.makeAlphanumeric(s)]:[de.makeBytes(de.toUtf8ByteArray(s))]}static makeEci(s){let a=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)n(s,8,a);else if(s<16384)n(2,2,a),n(s,14,a);else if(s<1e6)n(6,3,a),n(s,21,a);else throw new RangeError("ECI assignment value out of range");return new de(de.Mode.ECI,0,a)}static isNumeric(s){return de.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return de.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,a){let c=0;for(const d of s){const p=d.mode.numCharCountBits(a);if(d.numChars>=1<<p)return 1/0;c+=4+p+d.bitData.length}return c}static toUtf8ByteArray(s){s=encodeURI(s);let a=[];for(let c=0;c<s.length;c++)s.charAt(c)!="%"?a.push(s.charCodeAt(c)):(a.push(parseInt(s.substring(c+1,c+3),16)),c+=2);return a}};i.NUMERIC_REGEX=/^[0-9]*$/,i.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,i.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let l=i;e.QrSegment=i})(Tt||(Tt={})),(e=>{(t=>{const n=class{constructor(o,i){this.ordinal=o,this.formatBits=i}};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={}))})(Tt||(Tt={})),(e=>{(t=>{const n=class{constructor(o,i){this.modeBits=o,this.numBitsCharCount=i}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={}))})(Tt||(Tt={}));var Rt=Tt;/**
108
108
  * @license qrcode.react
109
109
  * Copyright (c) Paul O'Shannessy
110
110
  * SPDX-License-Identifier: ISC
111
- */var Lp={L:Rt.QrCode.Ecc.LOW,M:Rt.QrCode.Ecc.MEDIUM,Q:Rt.QrCode.Ecc.QUARTILE,H:Rt.QrCode.Ecc.HIGH},qs=128,Xs="L",Qs="#FFFFFF",Js="#000000",Zs=!1,el=1,Mp=4,Dp=0,Ip=.1;function tl(e,t=0){const n=[];return e.forEach(function(r,o){let i=null;r.forEach(function(a,u){if(!a&&i!==null){n.push(`M${i+t} ${o+t}h${u-i}v1H${i+t}z`),i=null;return}if(u===r.length-1){if(!a)return;i===null?n.push(`M${u+t},${o+t} h1v1H${u+t}z`):n.push(`M${i+t},${o+t} h${u+1-i}v1H${i+t}z`);return}a&&i===null&&(i=u)})}),n.join("")}function nl(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,i)=>i<t.x||i>=t.x+t.w?o:!1))}function Fp(e,t,n,r){if(r==null)return null;const o=e.length+n*2,i=Math.floor(t*Ip),a=o/t,u=(r.width||i)*a,s=(r.height||i)*a,l=r.x==null?e.length/2-u/2:r.x*a,c=r.y==null?e.length/2-s/2:r.y*a,d=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let g=Math.floor(l),v=Math.floor(c),E=Math.ceil(u+l-g),I=Math.ceil(s+c-v);p={x:g,y:v,w:E,h:I}}const f=r.crossOrigin;return{x:l,y:c,h:s,w:u,excavation:p,opacity:d,crossOrigin:f}}function jp(e,t){return t!=null?Math.max(Math.floor(t),0):e?Mp:Dp}function rl({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:i,size:a,boostLevel:u}){let s=m.useMemo(()=>{const g=(Array.isArray(e)?e:[e]).reduce((v,E)=>(v.push(...Rt.QrSegment.makeSegments(E)),v),[]);return Rt.QrCode.encodeSegments(g,Lp[t],n,void 0,void 0,u)},[e,t,n,u]);const{cells:l,margin:c,numCells:d,calculatedImageSettings:p}=m.useMemo(()=>{let f=s.getModules();const g=jp(r,o),v=f.length+g*2,E=Fp(f,a,g,i);return{cells:f,margin:g,numCells:v,calculatedImageSettings:E}},[s,a,i,r,o]);return{qrcode:s,margin:c,cells:l,numCells:d,calculatedImageSettings:p}}var Rp=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),kp=m.forwardRef(function(t,n){const r=t,{value:o,size:i=qs,level:a=Xs,bgColor:u=Qs,fgColor:s=Js,includeMargin:l=Zs,minVersion:c=el,boostLevel:d,marginSize:p,imageSettings:f}=r,v=oo(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:E}=v,I=oo(v,["style"]),x=f==null?void 0:f.src,P=m.useRef(null),F=m.useRef(null),R=m.useCallback(T=>{P.current=T,typeof n=="function"?n(T):n&&(n.current=T)},[n]),[B,V]=m.useState(!1),{margin:h,cells:y,numCells:b,calculatedImageSettings:A}=rl({value:o,level:a,minVersion:c,boostLevel:d,includeMargin:l,marginSize:p,imageSettings:f,size:i});m.useEffect(()=>{if(P.current!=null){const T=P.current,S=T.getContext("2d");if(!S)return;let L=y;const $=F.current,w=A!=null&&$!==null&&$.complete&&$.naturalHeight!==0&&$.naturalWidth!==0;w&&A.excavation!=null&&(L=nl(y,A.excavation));const D=window.devicePixelRatio||1;T.height=T.width=i*D;const _=i/b*D;S.scale(_,_),S.fillStyle=u,S.fillRect(0,0,b,b),S.fillStyle=s,Rp?S.fill(new Path2D(tl(L,h))):y.forEach(function(k,W){k.forEach(function(H,Q){H&&S.fillRect(Q+h,W+h,1,1)})}),A&&(S.globalAlpha=A.opacity),w&&S.drawImage($,A.x+h,A.y+h,A.w,A.h)}}),m.useEffect(()=>{V(!1)},[x]);const C=ro({height:i,width:i},E);let N=null;return x!=null&&(N=m.createElement("img",{src:x,key:x,style:{display:"none"},onLoad:()=>{V(!0)},ref:F,crossOrigin:A==null?void 0:A.crossOrigin})),m.createElement(m.Fragment,null,m.createElement("canvas",ro({style:C,height:i,width:i,ref:R,role:"img"},I)),N)});kp.displayName="QRCodeCanvas";var ol=m.forwardRef(function(t,n){const r=t,{value:o,size:i=qs,level:a=Xs,bgColor:u=Qs,fgColor:s=Js,includeMargin:l=Zs,minVersion:c=el,boostLevel:d,title:p,marginSize:f,imageSettings:g}=r,v=oo(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:E,cells:I,numCells:x,calculatedImageSettings:P}=rl({value:o,level:a,minVersion:c,boostLevel:d,includeMargin:l,marginSize:f,imageSettings:g,size:i});let F=I,R=null;g!=null&&P!=null&&(P.excavation!=null&&(F=nl(I,P.excavation)),R=m.createElement("image",{href:g.src,height:P.h,width:P.w,x:P.x+E,y:P.y+E,preserveAspectRatio:"none",opacity:P.opacity,crossOrigin:P.crossOrigin}));const B=tl(F,E);return m.createElement("svg",ro({height:i,width:i,viewBox:`0 0 ${x} ${x}`,ref:n,role:"img"},v),!!p&&m.createElement("title",null,p),m.createElement("path",{fill:u,d:`M0,0 h${x}v${x}H0z`,shapeRendering:"crispEdges"}),m.createElement("path",{fill:s,d:B,shapeRendering:"crispEdges"}),R)});ol.displayName="QRCodeSVG";function _p(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Bp(){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 il(){return/apple/i.test(navigator.vendor)}function Wp(){return _p().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Up(){return Bp().includes("jsdom/")}const sl="data-floating-ui-focusable",Vp="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function io(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 kt(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Or(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function _t(e){return"composedPath"in e?e.composedPath()[0]:e.target}function so(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 Hp(e){return e.matches("html,body")}function Ze(e){return(e==null?void 0:e.ownerDocument)||document}function ll(e){return Ee(e)&&e.matches(Vp)}function zp(e){if(!e||Up())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Gp(e){return e?e.hasAttribute(sl)?e:e.querySelector("["+sl+"]")||e:null}function Bn(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...Bn(e,o.id,n)])}function Yp(e){return"nativeEvent"in e}function nn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Kp=typeof document<"u",qp=function(){},et=Kp?m.useLayoutEffect:qp;const Xp={...j};function Wn(e){const t=j.useRef(e);return et(()=>{t.current=e}),t}const Qp=Xp.useInsertionEffect||(e=>e());function tt(e){const t=j.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Qp(()=>{t.current=e}),j.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 al=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ul(e,t){const n=zi(e,al()),r=n.length;if(r===0)return;const o=io(Ze(e)),i=n.indexOf(o),a=i===-1?t===1?0:r-1:i+t;return n[a]}function Jp(e){return ul(Ze(e).body,1)||e}function Zp(e){return ul(Ze(e).body,-1)||e}function lo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!kt(n,r)}function em(e){zi(e,al()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function cl(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 tm="data-floating-ui-focusable",fl="active",dl="selected",nm={...j};let pl=!1,rm=0;const ml=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+rm++;function om(){const[e,t]=j.useState(()=>pl?ml():void 0);return et(()=>{e==null&&t(ml())},[]),j.useEffect(()=>{pl=!0},[]),e}const ao=nm.useId||om;let uo;process.env.NODE_ENV!=="production"&&(uo=new Set);function im(){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=uo)!=null&&e.has(o))){var i;(i=uo)==null||i.add(o),console.error(o)}}function sm(){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 lm=j.createContext(null),am=j.createContext(null),co=()=>{var e;return((e=j.useContext(lm))==null?void 0:e.id)||null},fo=()=>j.useContext(am);function rn(e){return"data-floating-ui-"+e}function ke(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const hl=rn("safe-polygon");function po(e,t,n){if(n&&!nn(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 mo(e){return typeof e=="function"?e():e}function um(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:a}=e,{enabled:u=!0,delay:s=0,handleClose:l=null,mouseOnly:c=!1,restMs:d=0,move:p=!0}=t,f=fo(),g=co(),v=Wn(l),E=Wn(s),I=Wn(n),x=Wn(d),P=j.useRef(),F=j.useRef(-1),R=j.useRef(),B=j.useRef(-1),V=j.useRef(!0),h=j.useRef(!1),y=j.useRef(()=>{}),b=j.useRef(!1),A=tt(()=>{var $;const w=($=o.current.openEvent)==null?void 0:$.type;return(w==null?void 0:w.includes("mouse"))&&w!=="mousedown"});j.useEffect(()=>{if(!u)return;function $(w){let{open:D}=w;D||(ke(F),ke(B),V.current=!0,b.current=!1)}return i.on("openchange",$),()=>{i.off("openchange",$)}},[u,i]),j.useEffect(()=>{if(!u||!v.current||!n)return;function $(D){A()&&r(!1,D,"hover")}const w=Ze(a.floating).documentElement;return w.addEventListener("mouseleave",$),()=>{w.removeEventListener("mouseleave",$)}},[a.floating,n,r,u,v,A]);const C=j.useCallback(function($,w,D){w===void 0&&(w=!0),D===void 0&&(D="hover");const _=po(E.current,"close",P.current);_&&!R.current?(ke(F),F.current=window.setTimeout(()=>r(!1,$,D),_)):w&&(ke(F),r(!1,$,D))},[E,r]),N=tt(()=>{y.current(),R.current=void 0}),T=tt(()=>{if(h.current){const $=Ze(a.floating).body;$.style.pointerEvents="",$.removeAttribute(hl),h.current=!1}}),S=tt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);j.useEffect(()=>{if(!u)return;function $(W){if(ke(F),V.current=!1,c&&!nn(P.current)||mo(x.current)>0&&!po(E.current,"open"))return;const H=po(E.current,"open",P.current);H?F.current=window.setTimeout(()=>{I.current||r(!0,W,"hover")},H):n||r(!0,W,"hover")}function w(W){if(S()){T();return}y.current();const H=Ze(a.floating);if(ke(B),b.current=!1,v.current&&o.current.floatingContext){n||ke(F),R.current=v.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){T(),N(),S()||C(W,!0,"safe-polygon")}});const z=R.current;H.addEventListener("mousemove",z),y.current=()=>{H.removeEventListener("mousemove",z)};return}(P.current==="touch"?!kt(a.floating,W.relatedTarget):!0)&&C(W)}function D(W){S()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){T(),N(),S()||C(W)}})(W))}function _(){ke(F)}function k(W){S()||C(W,!1)}if(re(a.domReference)){const W=a.domReference,H=a.floating;return n&&W.addEventListener("mouseleave",D),p&&W.addEventListener("mousemove",$,{once:!0}),W.addEventListener("mouseenter",$),W.addEventListener("mouseleave",w),H&&(H.addEventListener("mouseleave",D),H.addEventListener("mouseenter",_),H.addEventListener("mouseleave",k)),()=>{n&&W.removeEventListener("mouseleave",D),p&&W.removeEventListener("mousemove",$),W.removeEventListener("mouseenter",$),W.removeEventListener("mouseleave",w),H&&(H.removeEventListener("mouseleave",D),H.removeEventListener("mouseenter",_),H.removeEventListener("mouseleave",k))}}},[a,u,e,c,p,C,N,T,r,n,I,f,E,v,o,S,x]),et(()=>{var $;if(u&&n&&($=v.current)!=null&&($=$.__options)!=null&&$.blockPointerEvents&&A()){h.current=!0;const D=a.floating;if(re(a.domReference)&&D){var w;const _=Ze(a.floating).body;_.setAttribute(hl,"");const k=a.domReference,W=f==null||(w=f.nodesRef.current.find(H=>H.id===g))==null||(w=w.context)==null?void 0:w.elements.floating;return W&&(W.style.pointerEvents=""),_.style.pointerEvents="none",k.style.pointerEvents="auto",D.style.pointerEvents="auto",()=>{_.style.pointerEvents="",k.style.pointerEvents="",D.style.pointerEvents=""}}}},[u,n,g,a,f,v,A]),et(()=>{n||(P.current=void 0,b.current=!1,N(),T())},[n,N,T]),j.useEffect(()=>()=>{N(),ke(F),ke(B),T()},[u,a.domReference,N,T]);const L=j.useMemo(()=>{function $(w){P.current=w.pointerType}return{onPointerDown:$,onPointerEnter:$,onMouseMove(w){const{nativeEvent:D}=w;function _(){!V.current&&!I.current&&r(!0,D,"hover")}c&&!nn(P.current)||n||mo(x.current)===0||b.current&&w.movementX**2+w.movementY**2<2||(ke(B),P.current==="touch"?_():(b.current=!0,B.current=window.setTimeout(_,mo(x.current))))}}},[c,r,n,I,x]);return j.useMemo(()=>u?{reference:L}:{},[u,L])}const gl={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},vl=j.forwardRef(function(t,n){const[r,o]=j.useState();et(()=>{il()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[rn("focus-guard")]:"",style:gl};return O.jsx("span",{...t,...i})}),bl=j.createContext(null),xl=rn("portal");function cm(e){e===void 0&&(e={});const{id:t,root:n}=e,r=ao(),o=dm(),[i,a]=j.useState(null),u=j.useRef(null);return et(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{u.current=null})},[i]),et(()=>{if(!r||u.current)return;const s=t?document.getElementById(t):null;if(!s)return;const l=document.createElement("div");l.id=r,l.setAttribute(xl,""),s.appendChild(l),u.current=l,a(l)},[t,r]),et(()=>{if(n===null||!r||u.current)return;let s=n||(o==null?void 0:o.portalNode);s&&!Cr(s)&&(s=s.current),s=s||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,s.appendChild(l));const c=document.createElement("div");c.id=r,c.setAttribute(xl,""),s=l||s,s.appendChild(c),u.current=c,a(c)},[t,n,r,o]),i}function fm(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=cm({id:n,root:r}),[a,u]=j.useState(null),s=j.useRef(null),l=j.useRef(null),c=j.useRef(null),d=j.useRef(null),p=a==null?void 0:a.modal,f=a==null?void 0:a.open,g=!!a&&!a.modal&&a.open&&o&&!!(r||i);return j.useEffect(()=>{if(!i||!o||p)return;function v(E){i&&lo(E)&&(E.type==="focusin"?cl:em)(i)}return i.addEventListener("focusin",v,!0),i.addEventListener("focusout",v,!0),()=>{i.removeEventListener("focusin",v,!0),i.removeEventListener("focusout",v,!0)}},[i,o,p]),j.useEffect(()=>{i&&(f||cl(i))},[f,i]),O.jsxs(bl.Provider,{value:j.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:l,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:u}),[o,i]),children:[g&&i&&O.jsx(vl,{"data-type":"outside",ref:s,onFocus:v=>{if(lo(v,i)){var E;(E=c.current)==null||E.focus()}else{const I=a?a.domReference:null,x=Zp(I);x==null||x.focus()}}}),g&&i&&O.jsx("span",{"aria-owns":i.id,style:gl}),i&&Ut.createPortal(t,i),g&&i&&O.jsx(vl,{"data-type":"outside",ref:l,onFocus:v=>{if(lo(v,i)){var E;(E=d.current)==null||E.focus()}else{const I=a?a.domReference:null,x=Jp(I);x==null||x.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,v.nativeEvent,"focus-out"))}}})]})}const dm=()=>j.useContext(bl);function yl(e){return Ee(e.target)&&e.target.tagName==="BUTTON"}function pm(e){return Ee(e.target)&&e.target.tagName==="A"}function wl(e){return ll(e)}function mm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:a=!0,event:u="click",toggle:s=!0,ignoreMouse:l=!1,keyboardHandlers:c=!0,stickIfOpen:d=!0}=t,p=j.useRef(),f=j.useRef(!1),g=j.useMemo(()=>({onPointerDown(v){p.current=v.pointerType},onMouseDown(v){const E=p.current;v.button===0&&u!=="click"&&(nn(E,!0)&&l||(n&&s&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="mousedown")?r(!1,v.nativeEvent,"click"):(v.preventDefault(),r(!0,v.nativeEvent,"click"))))},onClick(v){const E=p.current;if(u==="mousedown"&&p.current){p.current=void 0;return}nn(E,!0)&&l||(n&&s&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="click")?r(!1,v.nativeEvent,"click"):r(!0,v.nativeEvent,"click"))},onKeyDown(v){p.current=void 0,!(v.defaultPrevented||!c||yl(v))&&(v.key===" "&&!wl(i)&&(v.preventDefault(),f.current=!0),!pm(v)&&v.key==="Enter"&&r(!(n&&s),v.nativeEvent,"click"))},onKeyUp(v){v.defaultPrevented||!c||yl(v)||wl(i)||v.key===" "&&f.current&&(f.current=!1,r(!(n&&s),v.nativeEvent,"click"))}}),[o,i,u,l,c,r,n,d,s]);return j.useMemo(()=>a?{reference:g}:{},[a,g])}const hm={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},gm={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},El=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 vm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:a=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:l="pointerdown",referencePress:c=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:g}=t,v=fo(),E=tt(typeof s=="function"?s:()=>!1),I=typeof s=="function"?E:s,x=j.useRef(!1),{escapeKey:P,outsidePress:F}=El(f),{escapeKey:R,outsidePress:B}=El(g),V=j.useRef(!1),h=tt(T=>{var S;if(!n||!a||!u||T.key!=="Escape"||V.current)return;const L=(S=i.current.floatingContext)==null?void 0:S.nodeId,$=v?Bn(v.nodesRef.current,L):[];if(!P&&(T.stopPropagation(),$.length>0)){let w=!0;if($.forEach(D=>{var _;if((_=D.context)!=null&&_.open&&!D.context.dataRef.current.__escapeKeyBubbles){w=!1;return}}),!w)return}r(!1,Yp(T)?T.nativeEvent:T,"escape-key")}),y=tt(T=>{var S;const L=()=>{var $;h(T),($=_t(T))==null||$.removeEventListener("keydown",L)};(S=_t(T))==null||S.addEventListener("keydown",L)}),b=tt(T=>{var S;const L=i.current.insideReactTree;i.current.insideReactTree=!1;const $=x.current;if(x.current=!1,l==="click"&&$||L||typeof I=="function"&&!I(T))return;const w=_t(T),D="["+rn("inert")+"]",_=Ze(o.floating).querySelectorAll(D);let k=re(w)?w:null;for(;k&&!lt(k);){const z=at(k);if(lt(z)||!re(z))break;k=z}if(_.length&&re(w)&&!Hp(w)&&!kt(w,o.floating)&&Array.from(_).every(z=>!kt(k,z)))return;if(Ee(w)&&N){const z=lt(w),K=Re(w),G=/auto|scroll/,oe=z||G.test(K.overflowX),fe=z||G.test(K.overflowY),Ne=oe&&w.clientWidth>0&&w.scrollWidth>w.clientWidth,Ae=fe&&w.clientHeight>0&&w.scrollHeight>w.clientHeight,ot=K.direction==="rtl",ye=Ae&&(ot?T.offsetX<=w.offsetWidth-w.clientWidth:T.offsetX>w.clientWidth),he=Ne&&T.offsetY>w.clientHeight;if(ye||he)return}const W=(S=i.current.floatingContext)==null?void 0:S.nodeId,H=v&&Bn(v.nodesRef.current,W).some(z=>{var K;return so(T,(K=z.context)==null?void 0:K.elements.floating)});if(so(T,o.floating)||so(T,o.domReference)||H)return;const Q=v?Bn(v.nodesRef.current,W):[];if(Q.length>0){let z=!0;if(Q.forEach(K=>{var G;if((G=K.context)!=null&&G.open&&!K.context.dataRef.current.__outsidePressBubbles){z=!1;return}}),!z)return}r(!1,T,"outside-press")}),A=tt(T=>{var S;const L=()=>{var $;b(T),($=_t(T))==null||$.removeEventListener(l,L)};(S=_t(T))==null||S.addEventListener(l,L)});j.useEffect(()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=P,i.current.__outsidePressBubbles=F;let T=-1;function S(_){r(!1,_,"ancestor-scroll")}function L(){window.clearTimeout(T),V.current=!0}function $(){T=window.setTimeout(()=>{V.current=!1},xn()?5:0)}const w=Ze(o.floating);u&&(w.addEventListener("keydown",R?y:h,R),w.addEventListener("compositionstart",L),w.addEventListener("compositionend",$)),I&&w.addEventListener(l,B?A:b,B);let D=[];return p&&(re(o.domReference)&&(D=gt(o.domReference)),re(o.floating)&&(D=D.concat(gt(o.floating))),!re(o.reference)&&o.reference&&o.reference.contextElement&&(D=D.concat(gt(o.reference.contextElement)))),D=D.filter(_=>{var k;return _!==((k=w.defaultView)==null?void 0:k.visualViewport)}),D.forEach(_=>{_.addEventListener("scroll",S,{passive:!0})}),()=>{u&&(w.removeEventListener("keydown",R?y:h,R),w.removeEventListener("compositionstart",L),w.removeEventListener("compositionend",$)),I&&w.removeEventListener(l,B?A:b,B),D.forEach(_=>{_.removeEventListener("scroll",S)}),window.clearTimeout(T)}},[i,o,u,I,l,n,r,p,a,P,F,h,R,y,b,B,A]),j.useEffect(()=>{i.current.insideReactTree=!1},[i,I,l]);const C=j.useMemo(()=>({onKeyDown:h,...c&&{[hm[d]]:T=>{r(!1,T.nativeEvent,"reference-press")},...d!=="click"&&{onClick(T){r(!1,T.nativeEvent,"reference-press")}}}}),[h,r,c,d]),N=j.useMemo(()=>({onKeyDown:h,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[gm[l]]:()=>{i.current.insideReactTree=!0}}),[h,l,i]);return j.useMemo(()=>a?{reference:C,floating:N}:{},[a,C,N])}function bm(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ao(),i=j.useRef({}),[a]=j.useState(()=>sm()),u=co()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!re(f)&&im("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,l]=j.useState(r.reference),c=tt((f,g,v)=>{i.current.openEvent=f?g:void 0,a.emit("openchange",{open:f,event:g,reason:v,nested:u}),n==null||n(f,g,v)}),d=j.useMemo(()=>({setPositionReference:l}),[]),p=j.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return j.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:a,floatingId:o,refs:d}),[t,c,p,a,o,d])}function xm(e){e===void 0&&(e={});const{nodeId:t}=e,n=bm({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,a]=j.useState(null),[u,s]=j.useState(null),c=(o==null?void 0:o.domReference)||i,d=j.useRef(null),p=fo();et(()=>{c&&(d.current=c)},[c]);const f=ss({...e,elements:{...o,...u&&{reference:u}}}),g=j.useCallback(P=>{const F=re(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;s(F),f.refs.setReference(F)},[f.refs]),v=j.useCallback(P=>{(re(P)||P===null)&&(d.current=P,a(P)),(re(f.refs.reference.current)||f.refs.reference.current===null||P!==null&&!re(P))&&f.refs.setReference(P)},[f.refs]),E=j.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),I=j.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),x=j.useMemo(()=>({...f,...r,refs:E,elements:I,nodeId:t}),[f,E,I,t,r]);return et(()=>{r.dataRef.current.floatingContext=x;const P=p==null?void 0:p.nodesRef.current.find(F=>F.id===t);P&&(P.context=x)}),j.useMemo(()=>({...f,context:x,refs:E,elements:I}),[f,E,I,x])}function ho(){return Wp()&&il()}function ym(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:a}=e,{enabled:u=!0,visibleOnly:s=!0}=t,l=j.useRef(!1),c=j.useRef(-1),d=j.useRef(!0);j.useEffect(()=>{if(!u)return;const f=Oe(a.domReference);function g(){!n&&Ee(a.domReference)&&a.domReference===io(Ze(a.domReference))&&(l.current=!0)}function v(){d.current=!0}function E(){d.current=!1}return f.addEventListener("blur",g),ho()&&(f.addEventListener("keydown",v,!0),f.addEventListener("pointerdown",E,!0)),()=>{f.removeEventListener("blur",g),ho()&&(f.removeEventListener("keydown",v,!0),f.removeEventListener("pointerdown",E,!0))}},[a.domReference,n,u]),j.useEffect(()=>{if(!u)return;function f(g){let{reason:v}=g;(v==="reference-press"||v==="escape-key")&&(l.current=!0)}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,u]),j.useEffect(()=>()=>{ke(c)},[]);const p=j.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(f){if(l.current)return;const g=_t(f.nativeEvent);if(s&&re(g)){if(ho()&&!f.relatedTarget){if(!d.current&&!ll(g))return}else if(!zp(g))return}r(!0,f.nativeEvent,"focus")},onBlur(f){l.current=!1;const g=f.relatedTarget,v=f.nativeEvent,E=re(g)&&g.hasAttribute(rn("focus-guard"))&&g.getAttribute("data-type")==="outside";c.current=window.setTimeout(()=>{var I;const x=io(a.domReference?a.domReference.ownerDocument:document);!g&&x===a.domReference||kt((I=i.current.floatingContext)==null?void 0:I.refs.floating.current,x)||kt(a.domReference,x)||E||r(!1,v,"focus")})}}),[i,a.domReference,r,s]);return j.useMemo(()=>u?{reference:p}:{},[u,p])}function go(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[fl]:a,[dl]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[tm]:""},...i,...t.map(a=>{const u=a?a[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((a,u)=>(u&&Object.entries(u).forEach(s=>{let[l,c]=s;if(!(o&&[fl,dl].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof c=="function"){var d;(d=r.get(l))==null||d.push(c),a[l]=function(){for(var p,f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return(p=r.get(l))==null?void 0:p.map(E=>E(...g)).find(E=>E!==void 0)}}}else a[l]=c}),a),{})}}function wm(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=j.useCallback(u=>go(u,e,"reference"),t),i=j.useCallback(u=>go(u,e,"floating"),n),a=j.useCallback(u=>go(u,e,"item"),r);return j.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a}),[o,i,a])}const Em=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Sm(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:a}=e,{enabled:u=!0,role:s="dialog"}=t,l=ao(),c=((n=i.domReference)==null?void 0:n.id)||l,d=j.useMemo(()=>{var x;return((x=Gp(i.floating))==null?void 0:x.id)||a},[i.floating,a]),p=(r=Em.get(s))!=null?r:s,g=co()!=null,v=j.useMemo(()=>p==="tooltip"||s==="label"?{["aria-"+(s==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:c},...p==="menu"&&g&&{role:"menuitem"},...s==="select"&&{"aria-autocomplete":"none"},...s==="combobox"&&{"aria-autocomplete":"list"}},[p,d,g,o,c,s]),E=j.useMemo(()=>{const x={id:d,...p&&{role:p}};return p==="tooltip"||s==="label"?x:{...x,...p==="menu"&&{"aria-labelledby":c}}},[p,d,c,s]),I=j.useCallback(x=>{let{active:P,selected:F}=x;const R={role:"option",...P&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...R,"aria-selected":F}}return{}},[d,s]);return j.useMemo(()=>u?{reference:v,floating:E,item:I}:{},[u,v,E,I])}const Sl=m.forwardRef(({placement:e,className:t=""},n)=>{const o=(i=>{switch(i.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 O.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});Sl.displayName="TooltipArrow";const on=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:i="",disabled:a=!1,maxWidth:u="max-w-xs",trigger:s=["hover","focus"]})=>{const[l,c]=m.useState(!1),d=m.useRef(null),{refs:p,floatingStyles:f,context:g}=xm({open:l&&!a,onOpenChange:c,placement:n,whileElementsMounted:ns,middleware:[Rr(o?12:8),as({fallbackAxisSideDirection:"start",padding:8}),ls({padding:8}),...o?[_f({element:d})]:[]]}),v=um(g,{enabled:s.includes("hover"),delay:{open:r,close:150}}),E=ym(g,{enabled:s.includes("focus")}),I=mm(g,{enabled:s.includes("click")}),x=vm(g),P=Sm(g,{role:"tooltip"}),{getReferenceProps:F,getFloatingProps:R}=wm([v,E,I,x,P]);return a?O.jsx(O.Fragment,{children:e}):O.jsxs(O.Fragment,{children:[O.jsx("div",{ref:p.setReference,...F(),children:e}),l&&O.jsx(fm,{children:O.jsxs("div",{ref:p.setFloating,...R(),style:f,className:`
111
+ */var Dp={L:Rt.QrCode.Ecc.LOW,M:Rt.QrCode.Ecc.MEDIUM,Q:Rt.QrCode.Ecc.QUARTILE,H:Rt.QrCode.Ecc.HIGH},Qs=128,Js="L",Zs="#FFFFFF",el="#000000",tl=!1,nl=1,Ip=4,Fp=0,jp=.1;function rl(e,t=0){const n=[];return e.forEach(function(r,o){let i=null;r.forEach(function(l,u){if(!l&&i!==null){n.push(`M${i+t} ${o+t}h${u-i}v1H${i+t}z`),i=null;return}if(u===r.length-1){if(!l)return;i===null?n.push(`M${u+t},${o+t} h1v1H${u+t}z`):n.push(`M${i+t},${o+t} h${u+1-i}v1H${i+t}z`);return}l&&i===null&&(i=u)})}),n.join("")}function ol(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,i)=>i<t.x||i>=t.x+t.w?o:!1))}function Rp(e,t,n,r){if(r==null)return null;const o=e.length+n*2,i=Math.floor(t*jp),l=o/t,u=(r.width||i)*l,s=(r.height||i)*l,a=r.x==null?e.length/2-u/2:r.x*l,c=r.y==null?e.length/2-s/2:r.y*l,d=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let g=Math.floor(a),v=Math.floor(c),S=Math.ceil(u+a-g),D=Math.ceil(s+c-v);p={x:g,y:v,w:S,h:D}}const f=r.crossOrigin;return{x:a,y:c,h:s,w:u,excavation:p,opacity:d,crossOrigin:f}}function kp(e,t){return t!=null?Math.max(Math.floor(t),0):e?Ip:Fp}function il({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:i,size:l,boostLevel:u}){let s=m.useMemo(()=>{const g=(Array.isArray(e)?e:[e]).reduce((v,S)=>(v.push(...Rt.QrSegment.makeSegments(S)),v),[]);return Rt.QrCode.encodeSegments(g,Dp[t],n,void 0,void 0,u)},[e,t,n,u]);const{cells:a,margin:c,numCells:d,calculatedImageSettings:p}=m.useMemo(()=>{let f=s.getModules();const g=kp(r,o),v=f.length+g*2,S=Rp(f,l,g,i);return{cells:f,margin:g,numCells:v,calculatedImageSettings:S}},[s,l,i,r,o]);return{qrcode:s,margin:c,cells:a,numCells:d,calculatedImageSettings:p}}var _p=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Bp=m.forwardRef(function(t,n){const r=t,{value:o,size:i=Qs,level:l=Js,bgColor:u=Zs,fgColor:s=el,includeMargin:a=tl,minVersion:c=nl,boostLevel:d,marginSize:p,imageSettings:f}=r,v=oo(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:S}=v,D=oo(v,["style"]),w=f==null?void 0:f.src,N=m.useRef(null),F=m.useRef(null),R=m.useCallback(E=>{N.current=E,typeof n=="function"?n(E):n&&(n.current=E)},[n]),[B,V]=m.useState(!1),{margin:h,cells:x,numCells:b,calculatedImageSettings:A}=il({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:p,imageSettings:f,size:i});m.useEffect(()=>{if(N.current!=null){const E=N.current,O=E.getContext("2d");if(!O)return;let L=x;const P=F.current,y=A!=null&&P!==null&&P.complete&&P.naturalHeight!==0&&P.naturalWidth!==0;y&&A.excavation!=null&&(L=ol(x,A.excavation));const I=window.devicePixelRatio||1;E.height=E.width=i*I;const _=i/b*I;O.scale(_,_),O.fillStyle=u,O.fillRect(0,0,b,b),O.fillStyle=s,_p?O.fill(new Path2D(rl(L,h))):x.forEach(function(W,k){W.forEach(function(H,Q){H&&O.fillRect(Q+h,k+h,1,1)})}),A&&(O.globalAlpha=A.opacity),y&&O.drawImage(P,A.x+h,A.y+h,A.w,A.h)}}),m.useEffect(()=>{V(!1)},[w]);const T=ro({height:i,width:i},S);let $=null;return w!=null&&($=m.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{V(!0)},ref:F,crossOrigin:A==null?void 0:A.crossOrigin})),m.createElement(m.Fragment,null,m.createElement("canvas",ro({style:T,height:i,width:i,ref:R,role:"img"},D)),$)});Bp.displayName="QRCodeCanvas";var sl=m.forwardRef(function(t,n){const r=t,{value:o,size:i=Qs,level:l=Js,bgColor:u=Zs,fgColor:s=el,includeMargin:a=tl,minVersion:c=nl,boostLevel:d,title:p,marginSize:f,imageSettings:g}=r,v=oo(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:S,cells:D,numCells:w,calculatedImageSettings:N}=il({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:f,imageSettings:g,size:i});let F=D,R=null;g!=null&&N!=null&&(N.excavation!=null&&(F=ol(D,N.excavation)),R=m.createElement("image",{href:g.src,height:N.h,width:N.w,x:N.x+S,y:N.y+S,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const B=rl(F,S);return m.createElement("svg",ro({height:i,width:i,viewBox:`0 0 ${w} ${w}`,ref:n,role:"img"},v),!!p&&m.createElement("title",null,p),m.createElement("path",{fill:u,d:`M0,0 h${w}v${w}H0z`,shapeRendering:"crispEdges"}),m.createElement("path",{fill:s,d:B,shapeRendering:"crispEdges"}),R)});sl.displayName="QRCodeSVG";function Wp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Up(){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 ll(){return/apple/i.test(navigator.vendor)}function Vp(){return Wp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Hp(){return Up().includes("jsdom/")}const al="data-floating-ui-focusable",zp="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function io(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 kt(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Or(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function _t(e){return"composedPath"in e?e.composedPath()[0]:e.target}function so(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 Gp(e){return e.matches("html,body")}function et(e){return(e==null?void 0:e.ownerDocument)||document}function ul(e){return Ee(e)&&e.matches(zp)}function Yp(e){if(!e||Hp())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Kp(e){return e?e.hasAttribute(al)?e:e.querySelector("["+al+"]")||e:null}function Bn(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...Bn(e,o.id,n)])}function qp(e){return"nativeEvent"in e}function nn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Xp=typeof document<"u",Qp=function(){},tt=Xp?m.useLayoutEffect:Qp;const Jp={...j};function Wn(e){const t=j.useRef(e);return tt(()=>{t.current=e}),t}const Zp=Jp.useInsertionEffect||(e=>e());function nt(e){const t=j.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Zp(()=>{t.current=e}),j.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 cl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function fl(e,t){const n=Yi(e,cl()),r=n.length;if(r===0)return;const o=io(et(e)),i=n.indexOf(o),l=i===-1?t===1?0:r-1:i+t;return n[l]}function em(e){return fl(et(e).body,1)||e}function tm(e){return fl(et(e).body,-1)||e}function lo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!kt(n,r)}function nm(e){Yi(e,cl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function dl(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 rm="data-floating-ui-focusable",pl="active",ml="selected",om={...j};let hl=!1,im=0;const gl=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+im++;function sm(){const[e,t]=j.useState(()=>hl?gl():void 0);return tt(()=>{e==null&&t(gl())},[]),j.useEffect(()=>{hl=!0},[]),e}const ao=om.useId||sm;let uo;process.env.NODE_ENV!=="production"&&(uo=new Set);function lm(){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=uo)!=null&&e.has(o))){var i;(i=uo)==null||i.add(o),console.error(o)}}function am(){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 um=j.createContext(null),cm=j.createContext(null),co=()=>{var e;return((e=j.useContext(um))==null?void 0:e.id)||null},fo=()=>j.useContext(cm);function rn(e){return"data-floating-ui-"+e}function _e(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const vl=rn("safe-polygon");function po(e,t,n){if(n&&!nn(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 mo(e){return typeof e=="function"?e():e}function fm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:l}=e,{enabled:u=!0,delay:s=0,handleClose:a=null,mouseOnly:c=!1,restMs:d=0,move:p=!0}=t,f=fo(),g=co(),v=Wn(a),S=Wn(s),D=Wn(n),w=Wn(d),N=j.useRef(),F=j.useRef(-1),R=j.useRef(),B=j.useRef(-1),V=j.useRef(!0),h=j.useRef(!1),x=j.useRef(()=>{}),b=j.useRef(!1),A=nt(()=>{var P;const y=(P=o.current.openEvent)==null?void 0:P.type;return(y==null?void 0:y.includes("mouse"))&&y!=="mousedown"});j.useEffect(()=>{if(!u)return;function P(y){let{open:I}=y;I||(_e(F),_e(B),V.current=!0,b.current=!1)}return i.on("openchange",P),()=>{i.off("openchange",P)}},[u,i]),j.useEffect(()=>{if(!u||!v.current||!n)return;function P(I){A()&&r(!1,I,"hover")}const y=et(l.floating).documentElement;return y.addEventListener("mouseleave",P),()=>{y.removeEventListener("mouseleave",P)}},[l.floating,n,r,u,v,A]);const T=j.useCallback(function(P,y,I){y===void 0&&(y=!0),I===void 0&&(I="hover");const _=po(S.current,"close",N.current);_&&!R.current?(_e(F),F.current=window.setTimeout(()=>r(!1,P,I),_)):y&&(_e(F),r(!1,P,I))},[S,r]),$=nt(()=>{x.current(),R.current=void 0}),E=nt(()=>{if(h.current){const P=et(l.floating).body;P.style.pointerEvents="",P.removeAttribute(vl),h.current=!1}}),O=nt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);j.useEffect(()=>{if(!u)return;function P(k){if(_e(F),V.current=!1,c&&!nn(N.current)||mo(w.current)>0&&!po(S.current,"open"))return;const H=po(S.current,"open",N.current);H?F.current=window.setTimeout(()=>{D.current||r(!0,k,"hover")},H):n||r(!0,k,"hover")}function y(k){if(O()){E();return}x.current();const H=et(l.floating);if(_e(B),b.current=!1,v.current&&o.current.floatingContext){n||_e(F),R.current=v.current({...o.current.floatingContext,tree:f,x:k.clientX,y:k.clientY,onClose(){E(),$(),O()||T(k,!0,"safe-polygon")}});const Y=R.current;H.addEventListener("mousemove",Y),x.current=()=>{H.removeEventListener("mousemove",Y)};return}(N.current==="touch"?!kt(l.floating,k.relatedTarget):!0)&&T(k)}function I(k){O()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:f,x:k.clientX,y:k.clientY,onClose(){E(),$(),O()||T(k)}})(k))}function _(){_e(F)}function W(k){O()||T(k,!1)}if(re(l.domReference)){const k=l.domReference,H=l.floating;return n&&k.addEventListener("mouseleave",I),p&&k.addEventListener("mousemove",P,{once:!0}),k.addEventListener("mouseenter",P),k.addEventListener("mouseleave",y),H&&(H.addEventListener("mouseleave",I),H.addEventListener("mouseenter",_),H.addEventListener("mouseleave",W)),()=>{n&&k.removeEventListener("mouseleave",I),p&&k.removeEventListener("mousemove",P),k.removeEventListener("mouseenter",P),k.removeEventListener("mouseleave",y),H&&(H.removeEventListener("mouseleave",I),H.removeEventListener("mouseenter",_),H.removeEventListener("mouseleave",W))}}},[l,u,e,c,p,T,$,E,r,n,D,f,S,v,o,O,w]),tt(()=>{var P;if(u&&n&&(P=v.current)!=null&&(P=P.__options)!=null&&P.blockPointerEvents&&A()){h.current=!0;const I=l.floating;if(re(l.domReference)&&I){var y;const _=et(l.floating).body;_.setAttribute(vl,"");const W=l.domReference,k=f==null||(y=f.nodesRef.current.find(H=>H.id===g))==null||(y=y.context)==null?void 0:y.elements.floating;return k&&(k.style.pointerEvents=""),_.style.pointerEvents="none",W.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{_.style.pointerEvents="",W.style.pointerEvents="",I.style.pointerEvents=""}}}},[u,n,g,l,f,v,A]),tt(()=>{n||(N.current=void 0,b.current=!1,$(),E())},[n,$,E]),j.useEffect(()=>()=>{$(),_e(F),_e(B),E()},[u,l.domReference,$,E]);const L=j.useMemo(()=>{function P(y){N.current=y.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(y){const{nativeEvent:I}=y;function _(){!V.current&&!D.current&&r(!0,I,"hover")}c&&!nn(N.current)||n||mo(w.current)===0||b.current&&y.movementX**2+y.movementY**2<2||(_e(B),N.current==="touch"?_():(b.current=!0,B.current=window.setTimeout(_,mo(w.current))))}}},[c,r,n,D,w]);return j.useMemo(()=>u?{reference:L}:{},[u,L])}const bl={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},xl=j.forwardRef(function(t,n){const[r,o]=j.useState();tt(()=>{ll()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[rn("focus-guard")]:"",style:bl};return C.jsx("span",{...t,...i})}),yl=j.createContext(null),wl=rn("portal");function dm(e){e===void 0&&(e={});const{id:t,root:n}=e,r=ao(),o=mm(),[i,l]=j.useState(null),u=j.useRef(null);return tt(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{u.current=null})},[i]),tt(()=>{if(!r||u.current)return;const s=t?document.getElementById(t):null;if(!s)return;const a=document.createElement("div");a.id=r,a.setAttribute(wl,""),s.appendChild(a),u.current=a,l(a)},[t,r]),tt(()=>{if(n===null||!r||u.current)return;let s=n||(o==null?void 0:o.portalNode);s&&!Cr(s)&&(s=s.current),s=s||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,s.appendChild(a));const c=document.createElement("div");c.id=r,c.setAttribute(wl,""),s=a||s,s.appendChild(c),u.current=c,l(c)},[t,n,r,o]),i}function pm(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=dm({id:n,root:r}),[l,u]=j.useState(null),s=j.useRef(null),a=j.useRef(null),c=j.useRef(null),d=j.useRef(null),p=l==null?void 0:l.modal,f=l==null?void 0:l.open,g=!!l&&!l.modal&&l.open&&o&&!!(r||i);return j.useEffect(()=>{if(!i||!o||p)return;function v(S){i&&lo(S)&&(S.type==="focusin"?dl:nm)(i)}return i.addEventListener("focusin",v,!0),i.addEventListener("focusout",v,!0),()=>{i.removeEventListener("focusin",v,!0),i.removeEventListener("focusout",v,!0)}},[i,o,p]),j.useEffect(()=>{i&&(f||dl(i))},[f,i]),C.jsxs(yl.Provider,{value:j.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:u}),[o,i]),children:[g&&i&&C.jsx(xl,{"data-type":"outside",ref:s,onFocus:v=>{if(lo(v,i)){var S;(S=c.current)==null||S.focus()}else{const D=l?l.domReference:null,w=tm(D);w==null||w.focus()}}}),g&&i&&C.jsx("span",{"aria-owns":i.id,style:bl}),i&&Ut.createPortal(t,i),g&&i&&C.jsx(xl,{"data-type":"outside",ref:a,onFocus:v=>{if(lo(v,i)){var S;(S=d.current)==null||S.focus()}else{const D=l?l.domReference:null,w=em(D);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,v.nativeEvent,"focus-out"))}}})]})}const mm=()=>j.useContext(yl);function El(e){return Ee(e.target)&&e.target.tagName==="BUTTON"}function hm(e){return Ee(e.target)&&e.target.tagName==="A"}function Sl(e){return ul(e)}function gm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:l=!0,event:u="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:c=!0,stickIfOpen:d=!0}=t,p=j.useRef(),f=j.useRef(!1),g=j.useMemo(()=>({onPointerDown(v){p.current=v.pointerType},onMouseDown(v){const S=p.current;v.button===0&&u!=="click"&&(nn(S,!0)&&a||(n&&s&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="mousedown")?r(!1,v.nativeEvent,"click"):(v.preventDefault(),r(!0,v.nativeEvent,"click"))))},onClick(v){const S=p.current;if(u==="mousedown"&&p.current){p.current=void 0;return}nn(S,!0)&&a||(n&&s&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="click")?r(!1,v.nativeEvent,"click"):r(!0,v.nativeEvent,"click"))},onKeyDown(v){p.current=void 0,!(v.defaultPrevented||!c||El(v))&&(v.key===" "&&!Sl(i)&&(v.preventDefault(),f.current=!0),!hm(v)&&v.key==="Enter"&&r(!(n&&s),v.nativeEvent,"click"))},onKeyUp(v){v.defaultPrevented||!c||El(v)||Sl(i)||v.key===" "&&f.current&&(f.current=!1,r(!(n&&s),v.nativeEvent,"click"))}}),[o,i,u,a,c,r,n,d,s]);return j.useMemo(()=>l?{reference:g}:{},[l,g])}const vm={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},bm={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Cl=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 xm(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:l=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:c=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:g}=t,v=fo(),S=nt(typeof s=="function"?s:()=>!1),D=typeof s=="function"?S:s,w=j.useRef(!1),{escapeKey:N,outsidePress:F}=Cl(f),{escapeKey:R,outsidePress:B}=Cl(g),V=j.useRef(!1),h=nt(E=>{var O;if(!n||!l||!u||E.key!=="Escape"||V.current)return;const L=(O=i.current.floatingContext)==null?void 0:O.nodeId,P=v?Bn(v.nodesRef.current,L):[];if(!N&&(E.stopPropagation(),P.length>0)){let y=!0;if(P.forEach(I=>{var _;if((_=I.context)!=null&&_.open&&!I.context.dataRef.current.__escapeKeyBubbles){y=!1;return}}),!y)return}r(!1,qp(E)?E.nativeEvent:E,"escape-key")}),x=nt(E=>{var O;const L=()=>{var P;h(E),(P=_t(E))==null||P.removeEventListener("keydown",L)};(O=_t(E))==null||O.addEventListener("keydown",L)}),b=nt(E=>{var O;const L=i.current.insideReactTree;i.current.insideReactTree=!1;const P=w.current;if(w.current=!1,a==="click"&&P||L||typeof D=="function"&&!D(E))return;const y=_t(E),I="["+rn("inert")+"]",_=et(o.floating).querySelectorAll(I);let W=re(y)?y:null;for(;W&&!lt(W);){const Y=at(W);if(lt(Y)||!re(Y))break;W=Y}if(_.length&&re(y)&&!Gp(y)&&!kt(y,o.floating)&&Array.from(_).every(Y=>!kt(W,Y)))return;if(Ee(y)&&$){const Y=lt(y),K=ke(y),z=/auto|scroll/,oe=Y||z.test(K.overflowX),fe=Y||z.test(K.overflowY),Ae=oe&&y.clientWidth>0&&y.scrollWidth>y.clientWidth,$e=fe&&y.clientHeight>0&&y.scrollHeight>y.clientHeight,ot=K.direction==="rtl",ye=$e&&(ot?E.offsetX<=y.offsetWidth-y.clientWidth:E.offsetX>y.clientWidth),he=Ae&&E.offsetY>y.clientHeight;if(ye||he)return}const k=(O=i.current.floatingContext)==null?void 0:O.nodeId,H=v&&Bn(v.nodesRef.current,k).some(Y=>{var K;return so(E,(K=Y.context)==null?void 0:K.elements.floating)});if(so(E,o.floating)||so(E,o.domReference)||H)return;const Q=v?Bn(v.nodesRef.current,k):[];if(Q.length>0){let Y=!0;if(Q.forEach(K=>{var z;if((z=K.context)!=null&&z.open&&!K.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}r(!1,E,"outside-press")}),A=nt(E=>{var O;const L=()=>{var P;b(E),(P=_t(E))==null||P.removeEventListener(a,L)};(O=_t(E))==null||O.addEventListener(a,L)});j.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=N,i.current.__outsidePressBubbles=F;let E=-1;function O(_){r(!1,_,"ancestor-scroll")}function L(){window.clearTimeout(E),V.current=!0}function P(){E=window.setTimeout(()=>{V.current=!1},xn()?5:0)}const y=et(o.floating);u&&(y.addEventListener("keydown",R?x:h,R),y.addEventListener("compositionstart",L),y.addEventListener("compositionend",P)),D&&y.addEventListener(a,B?A:b,B);let I=[];return p&&(re(o.domReference)&&(I=gt(o.domReference)),re(o.floating)&&(I=I.concat(gt(o.floating))),!re(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(gt(o.reference.contextElement)))),I=I.filter(_=>{var W;return _!==((W=y.defaultView)==null?void 0:W.visualViewport)}),I.forEach(_=>{_.addEventListener("scroll",O,{passive:!0})}),()=>{u&&(y.removeEventListener("keydown",R?x:h,R),y.removeEventListener("compositionstart",L),y.removeEventListener("compositionend",P)),D&&y.removeEventListener(a,B?A:b,B),I.forEach(_=>{_.removeEventListener("scroll",O)}),window.clearTimeout(E)}},[i,o,u,D,a,n,r,p,l,N,F,h,R,x,b,B,A]),j.useEffect(()=>{i.current.insideReactTree=!1},[i,D,a]);const T=j.useMemo(()=>({onKeyDown:h,...c&&{[vm[d]]:E=>{r(!1,E.nativeEvent,"reference-press")},...d!=="click"&&{onClick(E){r(!1,E.nativeEvent,"reference-press")}}}}),[h,r,c,d]),$=j.useMemo(()=>({onKeyDown:h,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[bm[a]]:()=>{i.current.insideReactTree=!0}}),[h,a,i]);return j.useMemo(()=>l?{reference:T,floating:$}:{},[l,T,$])}function ym(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ao(),i=j.useRef({}),[l]=j.useState(()=>am()),u=co()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!re(f)&&lm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=j.useState(r.reference),c=nt((f,g,v)=>{i.current.openEvent=f?g:void 0,l.emit("openchange",{open:f,event:g,reason:v,nested:u}),n==null||n(f,g,v)}),d=j.useMemo(()=>({setPositionReference:a}),[]),p=j.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return j.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function wm(e){e===void 0&&(e={});const{nodeId:t}=e,n=ym({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=j.useState(null),[u,s]=j.useState(null),c=(o==null?void 0:o.domReference)||i,d=j.useRef(null),p=fo();tt(()=>{c&&(d.current=c)},[c]);const f=as({...e,elements:{...o,...u&&{reference:u}}}),g=j.useCallback(N=>{const F=re(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;s(F),f.refs.setReference(F)},[f.refs]),v=j.useCallback(N=>{(re(N)||N===null)&&(d.current=N,l(N)),(re(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!re(N))&&f.refs.setReference(N)},[f.refs]),S=j.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),D=j.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=j.useMemo(()=>({...f,...r,refs:S,elements:D,nodeId:t}),[f,S,D,t,r]);return tt(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(F=>F.id===t);N&&(N.context=w)}),j.useMemo(()=>({...f,context:w,refs:S,elements:D}),[f,S,D,w])}function ho(){return Vp()&&ll()}function Em(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:l}=e,{enabled:u=!0,visibleOnly:s=!0}=t,a=j.useRef(!1),c=j.useRef(-1),d=j.useRef(!0);j.useEffect(()=>{if(!u)return;const f=Oe(l.domReference);function g(){!n&&Ee(l.domReference)&&l.domReference===io(et(l.domReference))&&(a.current=!0)}function v(){d.current=!0}function S(){d.current=!1}return f.addEventListener("blur",g),ho()&&(f.addEventListener("keydown",v,!0),f.addEventListener("pointerdown",S,!0)),()=>{f.removeEventListener("blur",g),ho()&&(f.removeEventListener("keydown",v,!0),f.removeEventListener("pointerdown",S,!0))}},[l.domReference,n,u]),j.useEffect(()=>{if(!u)return;function f(g){let{reason:v}=g;(v==="reference-press"||v==="escape-key")&&(a.current=!0)}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,u]),j.useEffect(()=>()=>{_e(c)},[]);const p=j.useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(f){if(a.current)return;const g=_t(f.nativeEvent);if(s&&re(g)){if(ho()&&!f.relatedTarget){if(!d.current&&!ul(g))return}else if(!Yp(g))return}r(!0,f.nativeEvent,"focus")},onBlur(f){a.current=!1;const g=f.relatedTarget,v=f.nativeEvent,S=re(g)&&g.hasAttribute(rn("focus-guard"))&&g.getAttribute("data-type")==="outside";c.current=window.setTimeout(()=>{var D;const w=io(l.domReference?l.domReference.ownerDocument:document);!g&&w===l.domReference||kt((D=i.current.floatingContext)==null?void 0:D.refs.floating.current,w)||kt(l.domReference,w)||S||r(!1,v,"focus")})}}),[i,l.domReference,r,s]);return j.useMemo(()=>u?{reference:p}:{},[u,p])}function go(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[pl]:l,[ml]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[rm]:""},...i,...t.map(l=>{const u=l?l[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((l,u)=>(u&&Object.entries(u).forEach(s=>{let[a,c]=s;if(!(o&&[pl,ml].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof c=="function"){var d;(d=r.get(a))==null||d.push(c),l[a]=function(){for(var p,f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return(p=r.get(a))==null?void 0:p.map(S=>S(...g)).find(S=>S!==void 0)}}}else l[a]=c}),l),{})}}function Sm(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=j.useCallback(u=>go(u,e,"reference"),t),i=j.useCallback(u=>go(u,e,"floating"),n),l=j.useCallback(u=>go(u,e,"item"),r);return j.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}const Cm=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Om(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:l}=e,{enabled:u=!0,role:s="dialog"}=t,a=ao(),c=((n=i.domReference)==null?void 0:n.id)||a,d=j.useMemo(()=>{var w;return((w=Kp(i.floating))==null?void 0:w.id)||l},[i.floating,l]),p=(r=Cm.get(s))!=null?r:s,g=co()!=null,v=j.useMemo(()=>p==="tooltip"||s==="label"?{["aria-"+(s==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:c},...p==="menu"&&g&&{role:"menuitem"},...s==="select"&&{"aria-autocomplete":"none"},...s==="combobox"&&{"aria-autocomplete":"list"}},[p,d,g,o,c,s]),S=j.useMemo(()=>{const w={id:d,...p&&{role:p}};return p==="tooltip"||s==="label"?w:{...w,...p==="menu"&&{"aria-labelledby":c}}},[p,d,c,s]),D=j.useCallback(w=>{let{active:N,selected:F}=w;const R={role:"option",...N&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...R,"aria-selected":F}}return{}},[d,s]);return j.useMemo(()=>u?{reference:v,floating:S,item:D}:{},[u,v,S,D])}const Ol=m.forwardRef(({placement:e,className:t=""},n)=>{const o=(i=>{switch(i.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 C.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});Ol.displayName="TooltipArrow";const on=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:i="",disabled:l=!1,maxWidth:u="max-w-xs",trigger:s=["hover","focus"]})=>{const[a,c]=m.useState(!1),d=m.useRef(null),{refs:p,floatingStyles:f,context:g}=wm({open:a&&!l,onOpenChange:c,placement:n,whileElementsMounted:os,middleware:[Rr(o?12:8),cs({fallbackAxisSideDirection:"start",padding:8}),us({padding:8}),...o?[Wf({element:d})]:[]]}),v=fm(g,{enabled:s.includes("hover"),delay:{open:r,close:150}}),S=Em(g,{enabled:s.includes("focus")}),D=gm(g,{enabled:s.includes("click")}),w=xm(g),N=Om(g,{role:"tooltip"}),{getReferenceProps:F,getFloatingProps:R}=Sm([v,S,D,w,N]);return l?C.jsx(C.Fragment,{children:e}):C.jsxs(C.Fragment,{children:[C.jsx("div",{ref:p.setReference,...F(),children:e}),a&&C.jsx(pm,{children:C.jsxs("div",{ref:p.setFloating,...R(),style:f,className:`
112
112
  z-50 px-3 py-2
113
113
  bg-fill-page-secondary
114
114
  text-text-primary text-sm font-medium
@@ -116,5 +116,5 @@ React keys must be passed directly to JSX without using spread:
116
116
  relative
117
117
  ${u}
118
118
  ${i}
119
- `,children:[t,o&&O.jsx(Sl,{ref:d,placement:g.placement||n})]})})]})},Cl="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=",Cm=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const{t:i}=Ye(),a=m.useMemo(()=>ap(n||{}),[n]);return O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"flex justify-center mt-4 mb-3",children:O.jsx("div",{className:"bg-white rounded-lg",children:O.jsx(ol,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),O.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[O.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),O.jsx($p,{onCopy:()=>{const s=(e==null?void 0:e.getDisplayAddress())||"";o&&o(s)},text:e==null?void 0:e.getDisplayAddress(),children:O.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[O.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),O.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")]}),O.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[O.jsxs("div",{className:"flex items-start",children:[O.jsx("div",{className:"w-5",children:O.jsx("img",{src:Cl,className:"w-4 h-4",alt:"Warning"})}),O.jsx("div",{className:"flex-1",children:O.jsxs("p",{className:"text-xs text-functional-orange-1",children:["Only ",t," (",n==null?void 0:n.chain,") is supported for deposits to this address."]})})]}),a&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),O.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:"When the deposit amount exceeds 250,000, there may be a delay in arrival. It is recommended to use the Ethereum network for deposits."})]})]}),O.jsxs("div",{className:"text-sm",children:[O.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[O.jsx("span",{className:"text-text-tertiary",children:i("deposit.arrivalTime")}),O.jsx(on,{content:O.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[O.jsx("p",{children:i("deposit.arrivaltimeTooltip1",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60,v1:n==null?void 0:n.txConfirm})}),O.jsx("p",{children:i("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:O.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:i("deposit.arrivalEstimated",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60})})})]}),O.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[O.jsx("span",{className:"text-text-tertiary",children:i("deposit.minDeposit")}),O.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((u=r==null?void 0:r.multiChain)==null?void 0:u.minDeposit)||10," ",t]})]}),O.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[O.jsx("span",{className:"text-text-tertiary",children:i("deposit.maxDeposit")}),O.jsxs("span",{className:"text-text-primary font-medium text-right",children:["250,000 ",t]})]})]})]})},Om=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:i,onCopy:a,onClose:u})=>{var g;const[s,l]=m.useState(()=>{var v;return!e||e.length===0?1:t||((v=e[0])==null?void 0:v.chainId)||1}),[c,d]=m.useState(()=>{var x;if(!e||e.length===0)return"";const v=t||((x=e[0])==null?void 0:x.chainId),E=e.find(P=>P.chainId===v);if(!E||!E.tokenList||E.tokenList.length===0)return"";const I=E.tokenList.find(P=>P.tokenAddress===n)||E.tokenList[0];return(I==null?void 0:I.token)||""}),p=e&&e.length>0?e.find(v=>v.chainId===s)||e[0]:null,f=(g=p==null?void 0:p.tokenList)==null?void 0:g.find(v=>v.token===c);return!e||e.length===0?O.jsx("div",{className:"text-center py-8",children:O.jsx("p",{className:"text-gray-400",children:"No chains available"})}):p?O.jsxs(O.Fragment,{children:[O.jsx(Kr,{currentActiveChain:p,chainList:e,onChainChange:l,curSelectToken:c,onTokenChange:d,walletType:"mpc"}),O.jsx(Cm,{walletAdapter:r,curSelectToken:c,currentActiveChain:p,metadata:o,onCopy:a}),O.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:()=>{i&&i({amount:"",chainId:s,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:c}),u()},children:"Deposit"})]}):O.jsx("div",{className:"text-center py-8",children:O.jsx("p",{className:"text-gray-400",children:"Loading..."})})};var Tm=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,vo=Math.ceil,_e=Math.floor,Te="[BigNumber Error] ",Ol=Te+"Number primitive has more than 15 significant digits: ",Ge=1e14,X=14,bo=9007199254740991,xo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],xt=1e7,be=1e9;function Tl(e){var t,n,r,o=x.prototype={constructor:x,toString:null,valueOf:null},i=new x(1),a=20,u=4,s=-7,l=21,c=-1e7,d=1e7,p=!1,f=1,g=0,v={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",I=!0;function x(h,y){var b,A,C,N,T,S,L,$,w=this;if(!(w instanceof x))return new x(h,y);if(y==null){if(h&&h._isBigNumber===!0){w.s=h.s,!h.c||h.e>d?w.c=w.e=null:h.e<c?w.c=[w.e=0]:(w.e=h.e,w.c=h.c.slice());return}if((S=typeof h=="number")&&h*0==0){if(w.s=1/h<0?(h=-h,-1):1,h===~~h){for(N=0,T=h;T>=10;T/=10,N++);N>d?w.c=w.e=null:(w.e=N,w.c=[h]);return}$=String(h)}else{if(!Tm.test($=String(h)))return r(w,$,S);w.s=$.charCodeAt(0)==45?($=$.slice(1),-1):1}(N=$.indexOf("."))>-1&&($=$.replace(".","")),(T=$.search(/e/i))>0?(N<0&&(N=T),N+=+$.slice(T+1),$=$.substring(0,T)):N<0&&(N=$.length)}else{if(ce(y,2,E.length,"Base"),y==10&&I)return w=new x(h),B(w,a+w.e+1,u);if($=String(h),S=typeof h=="number"){if(h*0!=0)return r(w,$,S,y);if(w.s=1/h<0?($=$.slice(1),-1):1,x.DEBUG&&$.replace(/^0\.0*|\./,"").length>15)throw Error(Ol+h)}else w.s=$.charCodeAt(0)===45?($=$.slice(1),-1):1;for(b=E.slice(0,y),N=T=0,L=$.length;T<L;T++)if(b.indexOf(A=$.charAt(T))<0){if(A=="."){if(T>N){N=L;continue}}else if(!C&&($==$.toUpperCase()&&($=$.toLowerCase())||$==$.toLowerCase()&&($=$.toUpperCase()))){C=!0,T=-1,N=0;continue}return r(w,String(h),S,y)}S=!1,$=n($,y,10,w.s),(N=$.indexOf("."))>-1?$=$.replace(".",""):N=$.length}for(T=0;$.charCodeAt(T)===48;T++);for(L=$.length;$.charCodeAt(--L)===48;);if($=$.slice(T,++L)){if(L-=T,S&&x.DEBUG&&L>15&&(h>bo||h!==_e(h)))throw Error(Ol+w.s*h);if((N=N-T-1)>d)w.c=w.e=null;else if(N<c)w.c=[w.e=0];else{if(w.e=N,w.c=[],T=(N+1)%X,N<0&&(T+=X),T<L){for(T&&w.c.push(+$.slice(0,T)),L-=X;T<L;)w.c.push(+$.slice(T,T+=X));T=X-($=$.slice(T)).length}else T-=L;for(;T--;$+="0");w.c.push(+$)}}else w.c=[w.e=0]}x.clone=Tl,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(h){var y,b;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(y="DECIMAL_PLACES")&&(b=h[y],ce(b,0,be,y),a=b),h.hasOwnProperty(y="ROUNDING_MODE")&&(b=h[y],ce(b,0,8,y),u=b),h.hasOwnProperty(y="EXPONENTIAL_AT")&&(b=h[y],b&&b.pop?(ce(b[0],-be,0,y),ce(b[1],0,be,y),s=b[0],l=b[1]):(ce(b,-be,be,y),s=-(l=b<0?-b:b))),h.hasOwnProperty(y="RANGE"))if(b=h[y],b&&b.pop)ce(b[0],-be,-1,y),ce(b[1],1,be,y),c=b[0],d=b[1];else if(ce(b,-be,be,y),b)c=-(d=b<0?-b:b);else throw Error(Te+y+" cannot be zero: "+b);if(h.hasOwnProperty(y="CRYPTO"))if(b=h[y],b===!!b)if(b)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=b;else throw p=!b,Error(Te+"crypto unavailable");else p=b;else throw Error(Te+y+" not true or false: "+b);if(h.hasOwnProperty(y="MODULO_MODE")&&(b=h[y],ce(b,0,9,y),f=b),h.hasOwnProperty(y="POW_PRECISION")&&(b=h[y],ce(b,0,be,y),g=b),h.hasOwnProperty(y="FORMAT"))if(b=h[y],typeof b=="object")v=b;else throw Error(Te+y+" not an object: "+b);if(h.hasOwnProperty(y="ALPHABET"))if(b=h[y],typeof b=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(b))I=b.slice(0,10)=="0123456789",E=b;else throw Error(Te+y+" invalid: "+b)}else throw Error(Te+"Object expected: "+h);return{DECIMAL_PLACES:a,ROUNDING_MODE:u,EXPONENTIAL_AT:[s,l],RANGE:[c,d],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:g,FORMAT:v,ALPHABET:E}},x.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var y,b,A=h.c,C=h.e,N=h.s;e:if({}.toString.call(A)=="[object Array]"){if((N===1||N===-1)&&C>=-be&&C<=be&&C===_e(C)){if(A[0]===0){if(C===0&&A.length===1)return!0;break e}if(y=(C+1)%X,y<1&&(y+=X),String(A[0]).length==y){for(y=0;y<A.length;y++)if(b=A[y],b<0||b>=Ge||b!==_e(b))break e;if(b!==0)return!0}}}else if(A===null&&C===null&&(N===null||N===1||N===-1))return!0;throw Error(Te+"Invalid BigNumber: "+h)},x.maximum=x.max=function(){return F(arguments,-1)},x.minimum=x.min=function(){return F(arguments,1)},x.random=function(){var h=9007199254740992,y=Math.random()*h&2097151?function(){return _e(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(b){var A,C,N,T,S,L=0,$=[],w=new x(i);if(b==null?b=a:ce(b,0,be),T=vo(b/X),p)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(T*=2));L<T;)S=A[L]*131072+(A[L+1]>>>11),S>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),A[L]=C[0],A[L+1]=C[1]):($.push(S%1e14),L+=2);L=T/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(T*=7);L<T;)S=(A[L]&31)*281474976710656+A[L+1]*1099511627776+A[L+2]*4294967296+A[L+3]*16777216+(A[L+4]<<16)+(A[L+5]<<8)+A[L+6],S>=9e15?crypto.randomBytes(7).copy(A,L):($.push(S%1e14),L+=7);L=T/7}else throw p=!1,Error(Te+"crypto unavailable");if(!p)for(;L<T;)S=y(),S<9e15&&($[L++]=S%1e14);for(T=$[--L],b%=X,T&&b&&(S=xo[X-b],$[L]=_e(T/S)*S);$[L]===0;$.pop(),L--);if(L<0)$=[N=0];else{for(N=-1;$[0]===0;$.splice(0,1),N-=X);for(L=1,S=$[0];S>=10;S/=10,L++);L<X&&(N-=X-L)}return w.e=N,w.c=$,w}}(),x.sum=function(){for(var h=1,y=arguments,b=new x(y[0]);h<y.length;)b=b.plus(y[h++]);return b},n=function(){var h="0123456789";function y(b,A,C,N){for(var T,S=[0],L,$=0,w=b.length;$<w;){for(L=S.length;L--;S[L]*=A);for(S[0]+=N.indexOf(b.charAt($++)),T=0;T<S.length;T++)S[T]>C-1&&(S[T+1]==null&&(S[T+1]=0),S[T+1]+=S[T]/C|0,S[T]%=C)}return S.reverse()}return function(b,A,C,N,T){var S,L,$,w,D,_,k,W,H=b.indexOf("."),Q=a,z=u;for(H>=0&&(w=g,g=0,b=b.replace(".",""),W=new x(A),_=W.pow(b.length-H),g=w,W.c=y(ft(We(_.c),_.e,"0"),10,C,h),W.e=W.c.length),k=y(b,A,C,T?(S=E,h):(S=h,E)),$=w=k.length;k[--w]==0;k.pop());if(!k[0])return S.charAt(0);if(H<0?--$:(_.c=k,_.e=$,_.s=N,_=t(_,W,Q,z,C),k=_.c,D=_.r,$=_.e),L=$+Q+1,H=k[L],w=C/2,D=D||L<0||k[L+1]!=null,D=z<4?(H!=null||D)&&(z==0||z==(_.s<0?3:2)):H>w||H==w&&(z==4||D||z==6&&k[L-1]&1||z==(_.s<0?8:7)),L<1||!k[0])b=D?ft(S.charAt(1),-Q,S.charAt(0)):S.charAt(0);else{if(k.length=L,D)for(--C;++k[--L]>C;)k[L]=0,L||(++$,k=[1].concat(k));for(w=k.length;!k[--w];);for(H=0,b="";H<=w;b+=S.charAt(k[H++]));b=ft(b,$,S.charAt(0))}return b}}(),t=function(){function h(A,C,N){var T,S,L,$,w=0,D=A.length,_=C%xt,k=C/xt|0;for(A=A.slice();D--;)L=A[D]%xt,$=A[D]/xt|0,T=k*L+$*_,S=_*L+T%xt*xt+w,w=(S/N|0)+(T/xt|0)+k*$,A[D]=S%N;return w&&(A=[w].concat(A)),A}function y(A,C,N,T){var S,L;if(N!=T)L=N>T?1:-1;else for(S=L=0;S<N;S++)if(A[S]!=C[S]){L=A[S]>C[S]?1:-1;break}return L}function b(A,C,N,T){for(var S=0;N--;)A[N]-=S,S=A[N]<C[N]?1:0,A[N]=S*T+A[N]-C[N];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,C,N,T,S){var L,$,w,D,_,k,W,H,Q,z,K,G,oe,fe,Ne,Ae,ot,ye=A.s==C.s?1:-1,he=A.c,se=C.c;if(!he||!he[0]||!se||!se[0])return new x(!A.s||!C.s||(he?se&&he[0]==se[0]:!se)?NaN:he&&he[0]==0||!se?ye*0:ye/0);for(H=new x(ye),Q=H.c=[],$=A.e-C.e,ye=N+$+1,S||(S=Ge,$=Be(A.e/X)-Be(C.e/X),ye=ye/X|0),w=0;se[w]==(he[w]||0);w++);if(se[w]>(he[w]||0)&&$--,ye<0)Q.push(1),D=!0;else{for(fe=he.length,Ae=se.length,w=0,ye+=2,_=_e(S/(se[0]+1)),_>1&&(se=h(se,_,S),he=h(he,_,S),Ae=se.length,fe=he.length),oe=Ae,z=he.slice(0,Ae),K=z.length;K<Ae;z[K++]=0);ot=se.slice(),ot=[0].concat(ot),Ne=se[0],se[1]>=S/2&&Ne++;do{if(_=0,L=y(se,z,Ae,K),L<0){if(G=z[0],Ae!=K&&(G=G*S+(z[1]||0)),_=_e(G/Ne),_>1)for(_>=S&&(_=S-1),k=h(se,_,S),W=k.length,K=z.length;y(k,z,W,K)==1;)_--,b(k,Ae<W?ot:se,W,S),W=k.length,L=1;else _==0&&(L=_=1),k=se.slice(),W=k.length;if(W<K&&(k=[0].concat(k)),b(z,k,K,S),K=z.length,L==-1)for(;y(se,z,Ae,K)<1;)_++,b(z,Ae<K?ot:se,K,S),K=z.length}else L===0&&(_++,z=[0]);Q[w++]=_,z[0]?z[K++]=he[oe]||0:(z=[he[oe]],K=1)}while((oe++<fe||z[0]!=null)&&ye--);D=z[0]!=null,Q[0]||Q.splice(0,1)}if(S==Ge){for(w=1,ye=Q[0];ye>=10;ye/=10,w++);B(H,N+(H.e=w+$*X-1)+1,T,D)}else H.e=$,H.r=+D;return H}}();function P(h,y,b,A){var C,N,T,S,L;if(b==null?b=u:ce(b,0,8),!h.c)return h.toString();if(C=h.c[0],T=h.e,y==null)L=We(h.c),L=A==1||A==2&&(T<=s||T>=l)?Vn(L,T):ft(L,T,"0");else if(h=B(new x(h),y,b),N=h.e,L=We(h.c),S=L.length,A==1||A==2&&(y<=N||N<=s)){for(;S<y;L+="0",S++);L=Vn(L,N)}else if(y-=T+(A===2&&N>T),L=ft(L,N,"0"),N+1>S){if(--y>0)for(L+=".";y--;L+="0");}else if(y+=N-S,y>0)for(N+1==S&&(L+=".");y--;L+="0");return h.s<0&&C?"-"+L:L}function F(h,y){for(var b,A,C=1,N=new x(h[0]);C<h.length;C++)A=new x(h[C]),(!A.s||(b=Nt(N,A))===y||b===0&&N.s===y)&&(N=A);return N}function R(h,y,b){for(var A=1,C=y.length;!y[--C];y.pop());for(C=y[0];C>=10;C/=10,A++);return(b=A+b*X-1)>d?h.c=h.e=null:b<c?h.c=[h.e=0]:(h.e=b,h.c=y),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,y=/^([^.]+)\.$/,b=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(N,T,S,L){var $,w=S?T:T.replace(C,"");if(A.test(w))N.s=isNaN(w)?null:w<0?-1:1;else{if(!S&&(w=w.replace(h,function(D,_,k){return $=(k=k.toLowerCase())=="x"?16:k=="b"?2:8,!L||L==$?_:D}),L&&($=L,w=w.replace(y,"$1").replace(b,"0.$1")),T!=w))return new x(w,$);if(x.DEBUG)throw Error(Te+"Not a"+(L?" base "+L:"")+" number: "+T);N.s=null}N.c=N.e=null}}();function B(h,y,b,A){var C,N,T,S,L,$,w,D=h.c,_=xo;if(D){e:{for(C=1,S=D[0];S>=10;S/=10,C++);if(N=y-C,N<0)N+=X,T=y,L=D[$=0],w=_e(L/_[C-T-1]%10);else if($=vo((N+1)/X),$>=D.length)if(A){for(;D.length<=$;D.push(0));L=w=0,C=1,N%=X,T=N-X+1}else break e;else{for(L=S=D[$],C=1;S>=10;S/=10,C++);N%=X,T=N-X+C,w=T<0?0:_e(L/_[C-T-1]%10)}if(A=A||y<0||D[$+1]!=null||(T<0?L:L%_[C-T-1]),A=b<4?(w||A)&&(b==0||b==(h.s<0?3:2)):w>5||w==5&&(b==4||A||b==6&&(N>0?T>0?L/_[C-T]:0:D[$-1])%10&1||b==(h.s<0?8:7)),y<1||!D[0])return D.length=0,A?(y-=h.e+1,D[0]=_[(X-y%X)%X],h.e=-y||0):D[0]=h.e=0,h;if(N==0?(D.length=$,S=1,$--):(D.length=$+1,S=_[X-N],D[$]=T>0?_e(L/_[C-T]%_[T])*S:0),A)for(;;)if($==0){for(N=1,T=D[0];T>=10;T/=10,N++);for(T=D[0]+=S,S=1;T>=10;T/=10,S++);N!=S&&(h.e++,D[0]==Ge&&(D[0]=1));break}else{if(D[$]+=S,D[$]!=Ge)break;D[$--]=0,S=1}for(N=D.length;D[--N]===0;D.pop());}h.e>d?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function V(h){var y,b=h.e;return b===null?h.toString():(y=We(h.c),y=b<=s||b>=l?Vn(y,b):ft(y,b,"0"),h.s<0?"-"+y:y)}return o.absoluteValue=o.abs=function(){var h=new x(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,y){return Nt(this,new x(h,y))},o.decimalPlaces=o.dp=function(h,y){var b,A,C,N=this;if(h!=null)return ce(h,0,be),y==null?y=u:ce(y,0,8),B(new x(N),h+N.e+1,y);if(!(b=N.c))return null;if(A=((C=b.length-1)-Be(this.e/X))*X,C=b[C])for(;C%10==0;C/=10,A--);return A<0&&(A=0),A},o.dividedBy=o.div=function(h,y){return t(this,new x(h,y),a,u)},o.dividedToIntegerBy=o.idiv=function(h,y){return t(this,new x(h,y),0,1)},o.exponentiatedBy=o.pow=function(h,y){var b,A,C,N,T,S,L,$,w,D=this;if(h=new x(h),h.c&&!h.isInteger())throw Error(Te+"Exponent not an integer: "+V(h));if(y!=null&&(y=new x(y)),S=h.e>14,!D.c||!D.c[0]||D.c[0]==1&&!D.e&&D.c.length==1||!h.c||!h.c[0])return w=new x(Math.pow(+V(D),S?h.s*(2-Un(h)):+V(h))),y?w.mod(y):w;if(L=h.s<0,y){if(y.c?!y.c[0]:!y.s)return new x(NaN);A=!L&&D.isInteger()&&y.isInteger(),A&&(D=D.mod(y))}else{if(h.e>9&&(D.e>0||D.e<-1||(D.e==0?D.c[0]>1||S&&D.c[1]>=24e7:D.c[0]<8e13||S&&D.c[0]<=9999975e7)))return N=D.s<0&&Un(h)?-0:0,D.e>-1&&(N=1/N),new x(L?1/N:N);g&&(N=vo(g/X+2))}for(S?(b=new x(.5),L&&(h.s=1),$=Un(h)):(C=Math.abs(+V(h)),$=C%2),w=new x(i);;){if($){if(w=w.times(D),!w.c)break;N?w.c.length>N&&(w.c.length=N):A&&(w=w.mod(y))}if(C){if(C=_e(C/2),C===0)break;$=C%2}else if(h=h.times(b),B(h,h.e+1,1),h.e>14)$=Un(h);else{if(C=+V(h),C===0)break;$=C%2}D=D.times(D),N?D.c&&D.c.length>N&&(D.c.length=N):A&&(D=D.mod(y))}return A?w:(L&&(w=i.div(w)),y?w.mod(y):N?B(w,g,u,T):w)},o.integerValue=function(h){var y=new x(this);return h==null?h=u:ce(h,0,8),B(y,y.e+1,h)},o.isEqualTo=o.eq=function(h,y){return Nt(this,new x(h,y))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,y){return Nt(this,new x(h,y))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,y){return(y=Nt(this,new x(h,y)))===1||y===0},o.isInteger=function(){return!!this.c&&Be(this.e/X)>this.c.length-2},o.isLessThan=o.lt=function(h,y){return Nt(this,new x(h,y))<0},o.isLessThanOrEqualTo=o.lte=function(h,y){return(y=Nt(this,new x(h,y)))===-1||y===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(h,y){var b,A,C,N,T=this,S=T.s;if(h=new x(h,y),y=h.s,!S||!y)return new x(NaN);if(S!=y)return h.s=-y,T.plus(h);var L=T.e/X,$=h.e/X,w=T.c,D=h.c;if(!L||!$){if(!w||!D)return w?(h.s=-y,h):new x(D?T:NaN);if(!w[0]||!D[0])return D[0]?(h.s=-y,h):new x(w[0]?T:u==3?-0:0)}if(L=Be(L),$=Be($),w=w.slice(),S=L-$){for((N=S<0)?(S=-S,C=w):($=L,C=D),C.reverse(),y=S;y--;C.push(0));C.reverse()}else for(A=(N=(S=w.length)<(y=D.length))?S:y,S=y=0;y<A;y++)if(w[y]!=D[y]){N=w[y]<D[y];break}if(N&&(C=w,w=D,D=C,h.s=-h.s),y=(A=D.length)-(b=w.length),y>0)for(;y--;w[b++]=0);for(y=Ge-1;A>S;){if(w[--A]<D[A]){for(b=A;b&&!w[--b];w[b]=y);--w[b],w[A]+=Ge}w[A]-=D[A]}for(;w[0]==0;w.splice(0,1),--$);return w[0]?R(h,w,$):(h.s=u==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,y){var b,A,C=this;return h=new x(h,y),!C.c||!h.s||h.c&&!h.c[0]?new x(NaN):!h.c||C.c&&!C.c[0]?new x(C):(f==9?(A=h.s,h.s=1,b=t(C,h,0,3),h.s=A,b.s*=A):b=t(C,h,0,f),h=C.minus(b.times(h)),!h.c[0]&&f==1&&(h.s=C.s),h)},o.multipliedBy=o.times=function(h,y){var b,A,C,N,T,S,L,$,w,D,_,k,W,H,Q,z=this,K=z.c,G=(h=new x(h,y)).c;if(!K||!G||!K[0]||!G[0])return!z.s||!h.s||K&&!K[0]&&!G||G&&!G[0]&&!K?h.c=h.e=h.s=null:(h.s*=z.s,!K||!G?h.c=h.e=null:(h.c=[0],h.e=0)),h;for(A=Be(z.e/X)+Be(h.e/X),h.s*=z.s,L=K.length,D=G.length,L<D&&(W=K,K=G,G=W,C=L,L=D,D=C),C=L+D,W=[];C--;W.push(0));for(H=Ge,Q=xt,C=D;--C>=0;){for(b=0,_=G[C]%Q,k=G[C]/Q|0,T=L,N=C+T;N>C;)$=K[--T]%Q,w=K[T]/Q|0,S=k*$+w*_,$=_*$+S%Q*Q+W[N]+b,b=($/H|0)+(S/Q|0)+k*w,W[N--]=$%H;W[N]=b}return b?++A:W.splice(0,1),R(h,W,A)},o.negated=function(){var h=new x(this);return h.s=-h.s||null,h},o.plus=function(h,y){var b,A=this,C=A.s;if(h=new x(h,y),y=h.s,!C||!y)return new x(NaN);if(C!=y)return h.s=-y,A.minus(h);var N=A.e/X,T=h.e/X,S=A.c,L=h.c;if(!N||!T){if(!S||!L)return new x(C/0);if(!S[0]||!L[0])return L[0]?h:new x(S[0]?A:C*0)}if(N=Be(N),T=Be(T),S=S.slice(),C=N-T){for(C>0?(T=N,b=L):(C=-C,b=S),b.reverse();C--;b.push(0));b.reverse()}for(C=S.length,y=L.length,C-y<0&&(b=L,L=S,S=b,y=C),C=0;y;)C=(S[--y]=S[y]+L[y]+C)/Ge|0,S[y]=Ge===S[y]?0:S[y]%Ge;return C&&(S=[C].concat(S),++T),R(h,S,T)},o.precision=o.sd=function(h,y){var b,A,C,N=this;if(h!=null&&h!==!!h)return ce(h,1,be),y==null?y=u:ce(y,0,8),B(new x(N),h,y);if(!(b=N.c))return null;if(C=b.length-1,A=C*X+1,C=b[C]){for(;C%10==0;C/=10,A--);for(C=b[0];C>=10;C/=10,A++);}return h&&N.e+1>A&&(A=N.e+1),A},o.shiftedBy=function(h){return ce(h,-bo,bo),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,y,b,A,C,N=this,T=N.c,S=N.s,L=N.e,$=a+4,w=new x("0.5");if(S!==1||!T||!T[0])return new x(!S||S<0&&(!T||T[0])?NaN:T?N:1/0);if(S=Math.sqrt(+V(N)),S==0||S==1/0?(y=We(T),(y.length+L)%2==0&&(y+="0"),S=Math.sqrt(+y),L=Be((L+1)/2)-(L<0||L%2),S==1/0?y="5e"+L:(y=S.toExponential(),y=y.slice(0,y.indexOf("e")+1)+L),b=new x(y)):b=new x(S+""),b.c[0]){for(L=b.e,S=L+$,S<3&&(S=0);;)if(C=b,b=w.times(C.plus(t(N,C,$,1))),We(C.c).slice(0,S)===(y=We(b.c)).slice(0,S))if(b.e<L&&--S,y=y.slice(S-3,S+1),y=="9999"||!A&&y=="4999"){if(!A&&(B(C,C.e+a+2,0),C.times(C).eq(N))){b=C;break}$+=4,S+=4,A=1}else{(!+y||!+y.slice(1)&&y.charAt(0)=="5")&&(B(b,b.e+a+2,1),h=!b.times(b).eq(N));break}}return B(b,b.e+a+1,u,h)},o.toExponential=function(h,y){return h!=null&&(ce(h,0,be),h++),P(this,h,y,1)},o.toFixed=function(h,y){return h!=null&&(ce(h,0,be),h=h+this.e+1),P(this,h,y)},o.toFormat=function(h,y,b){var A,C=this;if(b==null)h!=null&&y&&typeof y=="object"?(b=y,y=null):h&&typeof h=="object"?(b=h,h=y=null):b=v;else if(typeof b!="object")throw Error(Te+"Argument not an object: "+b);if(A=C.toFixed(h,y),C.c){var N,T=A.split("."),S=+b.groupSize,L=+b.secondaryGroupSize,$=b.groupSeparator||"",w=T[0],D=T[1],_=C.s<0,k=_?w.slice(1):w,W=k.length;if(L&&(N=S,S=L,L=N,W-=N),S>0&&W>0){for(N=W%S||S,w=k.substr(0,N);N<W;N+=S)w+=$+k.substr(N,S);L>0&&(w+=$+k.slice(N)),_&&(w="-"+w)}A=D?w+(b.decimalSeparator||"")+((L=+b.fractionGroupSize)?D.replace(new RegExp("\\d{"+L+"}\\B","g"),"$&"+(b.fractionGroupSeparator||"")):D):w}return(b.prefix||"")+A+(b.suffix||"")},o.toFraction=function(h){var y,b,A,C,N,T,S,L,$,w,D,_,k=this,W=k.c;if(h!=null&&(S=new x(h),!S.isInteger()&&(S.c||S.s!==1)||S.lt(i)))throw Error(Te+"Argument "+(S.isInteger()?"out of range: ":"not an integer: ")+V(S));if(!W)return new x(k);for(y=new x(i),$=b=new x(i),A=L=new x(i),_=We(W),N=y.e=_.length-k.e-1,y.c[0]=xo[(T=N%X)<0?X+T:T],h=!h||S.comparedTo(y)>0?N>0?y:$:S,T=d,d=1/0,S=new x(_),L.c[0]=0;w=t(S,y,0,1),C=b.plus(w.times(A)),C.comparedTo(h)!=1;)b=A,A=C,$=L.plus(w.times(C=$)),L=C,y=S.minus(w.times(C=y)),S=C;return C=t(h.minus(b),A,0,1),L=L.plus(C.times($)),b=b.plus(C.times(A)),L.s=$.s=k.s,N=N*2,D=t($,A,N,u).minus(k).abs().comparedTo(t(L,b,N,u).minus(k).abs())<1?[$,A]:[L,b],d=T,D},o.toNumber=function(){return+V(this)},o.toPrecision=function(h,y){return h!=null&&ce(h,1,be),P(this,h,y,2)},o.toString=function(h){var y,b=this,A=b.s,C=b.e;return C===null?A?(y="Infinity",A<0&&(y="-"+y)):y="NaN":(h==null?y=C<=s||C>=l?Vn(We(b.c),C):ft(We(b.c),C,"0"):h===10&&I?(b=B(new x(b),a+C+1,u),y=ft(We(b.c),b.e,"0")):(ce(h,2,E.length,"Base"),y=n(ft(We(b.c),C,"0"),10,h,A,!0)),A<0&&b.c[0]&&(y="-"+y)),y},o.valueOf=o.toJSON=function(){return V(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&x.set(e),x}function Be(e){var t=e|0;return e>0||e===t?t:t-1}function We(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=X-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Nt(e,t){var n,r,o=e.c,i=t.c,a=e.s,u=t.s,s=e.e,l=t.e;if(!a||!u)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-u:a;if(a!=u)return a;if(n=a<0,r=s==l,!o||!i)return r?0:!o^n?1:-1;if(!r)return s>l^n?1:-1;for(u=(s=o.length)<(l=i.length)?s:l,a=0;a<u;a++)if(o[a]!=i[a])return o[a]>i[a]^n?1:-1;return s==l?0:s>l^n?1:-1}function ce(e,t,n,r){if(e<t||e>n||e!==_e(e))throw Error(Te+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Un(e){var t=e.c.length-1;return Be(e.e/X)==t&&e.c[t]%2!=0}function Vn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ft(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 Hn=Tl();const Nm=Object.values({MAINNET:1,SEPOLIA:11155111}),At=e=>Nm.includes(+e),Am=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:i,amount:a,decimals:u,tokenBalance:s,platformBalance:l="0",onDepositAmountChange:c,onApprove:d})=>{const{t:p}=Ye(),f=m.useCallback(()=>{let I=s||"0";if(!At(o==null?void 0:o.chainId))try{const x=new Hn(I),P=new Hn("250000");x.gt(P)&&(I="250000")}catch(x){console.warn("Error calculating max amount limit:",x)}return I},[s,o==null?void 0:o.chainId]),g=m.useMemo(()=>{if(At(o==null?void 0:o.chainId))return!1;try{const I=new Hn(e||"0"),x=new Hn("250000");return I.isNaN()||x.isNaN()?!1:I.gte(x)}catch{return!1}},[o,e]),v=I=>{const x=I.target.value,P=f(),F=qr(x,P);if(F.isValid)c(F.formattedValue),F.errorType;else return F.errorType==="exceed_balance",void 0},E=()=>{const I=parseFloat(s||"0"),x=parseFloat(e||"0");if(x>0){const P=I-x,F=ze(Math.max(0,P).toString());return O.jsxs("span",{className:"flex items-center gap-1",children:[ze(s||"0"),O.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),F," ",t]})}return`${ze(s||"0")} ${t}`};return O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[O.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[O.jsx("input",{type:"text",placeholder:p("deposit.amount"),value:e,onChange:v,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"}),O.jsx("button",{onClick:()=>{const I=f();c(I)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:p("deposit.max")})]}),O.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),O.jsxs("div",{className:"flex justify-between items-center",children:[O.jsx(on,{content:p("deposit.availableDesc"),children:O.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:p("deposit.available")})}),O.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:E()})]})]}),!r&&ip(e||"0",0)&&O.jsxs("div",{className:"flex justify-center flex-col items-center",children:[O.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:p("deposit.enableSystemProWithToken",{token:t,network:o==null?void 0:o.chain})}),O.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:p("deposit.enableTokenDesc",{token:t,network:o==null?void 0:o.chain})}),O.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",onClick:d,children:p("deposit.enableWithToken",{token:t})})]}),g&&O.jsxs("div",{className:"flex mb-4",children:[O.jsx("div",{className:"w-5",children:O.jsx("img",{src:Cl,className:"w-4 h-4",alt:"Warning"})}),O.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.depositTipFor25w")})]}),O.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:O.jsxs("div",{className:"flex justify-between items-center",children:[O.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:p("deposit.equity")}),O.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?O.jsxs("span",{className:"flex items-center gap-1",children:[ze(l),O.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),ze((parseFloat(l)+parseFloat(e)).toString())," ",t]}):`${ze(l)} ${t}`})]})})]})},$m=({token:e,account:t,chainId:n,contractAddress:r,wagmiHooks:o,onResult:i})=>{var s,l;const a=(s=o==null?void 0:o.useBalance)==null?void 0:s.call(o,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(o!=null&&o.useBalance)}}),u=(l=o==null?void 0:o.useReadContract)==null?void 0:l.call(o,{address:e.tokenAddress,abi:[{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],functionName:"allowance",args:[t,r],chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!r&&!!(o!=null&&o.useReadContract)}});return m.useEffect(()=>{i(e.tokenAddress,{balance:a,allowance:u})},[a,u,e.tokenAddress,i]),null},Nl=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var g;const i=m.useMemo(()=>r.filter(v=>v.tokenAddress&&v.tokenAddress!=="0x0000000000000000000000000000000000000000"),[r]),[a,u]=m.useState({}),s=m.useCallback((v,E)=>{u(I=>({...I,[v]:E}))},[]),l=(g=o==null?void 0:o.useBalance)==null?void 0:g.call(o,{address:e,chainId:t,query:{enabled:!!e&&!!t&&!!(o!=null&&o.useBalance)}}),c=m.useMemo(()=>i.map(v=>m.createElement($m,{key:v.tokenAddress,token:v,account:e,chainId:t,contractAddress:n,wagmiHooks:o,onResult:s})),[i,e,t,n,o,s]),d=m.useMemo(()=>{if(!(o!=null&&o.useBalance))return{balanceList:[],allowanceList:[],baseTokenBalance:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},combinedData:{}};const v=l!=null&&l.data?{value:l.data.value,formatted:l.data.formatted,decimals:l.data.decimals,symbol:l.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},E=i.map(P=>{const F=a[P.tokenAddress],R=F==null?void 0:F.balance,B=R==null?void 0:R.data;return{address:P.tokenAddress,value:(B==null?void 0:B.value)||BigInt(0),formatted:(B==null?void 0:B.formatted)||"0",decimals:(B==null?void 0:B.decimals)||P.decimals}}).filter(P=>P.address),I=i.map(P=>{const F=a[P.tokenAddress],R=F==null?void 0:F.allowance,B=R==null?void 0:R.data,V=BigInt(B?B.toString():0);return{address:P.tokenAddress,value:V,formatted:(V/BigInt(10)**BigInt(P.decimals)).toString(),decimals:P.decimals}}).filter(P=>P.address),x=E.reduce((P,F)=>{const R=I.find(B=>B.address===F.address);return{...P,[F.address]:{balance:F,allowance:R||{address:F.address,value:BigInt(0),formatted:"0",decimals:F.decimals}}}},{});return{balanceList:E,allowanceList:I,baseTokenBalance:v,combinedData:x}},[l,a,i,o==null?void 0:o.useBalance]),p=m.useCallback(async()=>d,[d]),f=m.useMemo(()=>{const v=(l==null?void 0:l.isLoading)||!1,E=Object.values(a).some(I=>{var x,P;return((x=I.balance)==null?void 0:x.isLoading)||((P=I.allowance)==null?void 0:P.isLoading)});return v||E},[l==null?void 0:l.isLoading,a]);return{multicallRun:p,multicallResult:d,validErcTokens:i,isLoading:f,queryComponents:c}},Pm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:a,platformBalance:u="0",wagmiHooks:s,approved:l,onApproved:c,onDeposit:d,onClose:p,onChainChange:f,onTokenChange:g})=>{var _;const{t:v}=Ye(),[E,I]=m.useState(()=>{var k;return!e||e.length===0?1:t||((k=e[0])==null?void 0:k.chainId)||1}),[x,P]=m.useState(()=>{var Q;if(!e||e.length===0)return"";const k=t||((Q=e[0])==null?void 0:Q.chainId),W=e.find(z=>z.chainId===k);if(!W||!W.tokenList||W.tokenList.length===0)return"";const H=W.tokenList.find(z=>z.tokenAddress===n)||W.tokenList[0];return(H==null?void 0:H.token)||""}),[F,R]=m.useState(r),B=m.useCallback(k=>{I(k),f==null||f(k)},[f]),V=m.useCallback(k=>{P(k),g==null||g(k)},[g]),h=m.useRef(!0),y=m.useRef(x),b=m.useRef(E);m.useEffect(()=>{if(h.current){h.current=!1,y.current=x,b.current=E;return}(y.current!==x||b.current!==E)&&(R(""),y.current=x,b.current=E)},[x,E]);const A=e&&e.length>0?e.find(k=>k.chainId===E)||e[0]:null,C=(_=A==null?void 0:A.tokenList)==null?void 0:_.find(k=>k.token===x),N=o==null?void 0:o.getDisplayAddress(),{multicallResult:T,queryComponents:S}=Nl({account:N,chainId:E,contractAddress:void 0,tokens:(A==null?void 0:A.tokenList)||[],wagmiHooks:s}),L=m.useMemo(()=>{var W;if(!C)return;if(!C.tokenAddress||C.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return T.baseTokenBalance.formatted;const k=T.combinedData[C.tokenAddress];return((W=k==null?void 0:k.balance)==null?void 0:W.formatted)||"0"},[C,T]),$=l??!1,w=m.useMemo(()=>{const k=parseFloat(F||"0"),W=10,H=L||"0",Q=sp(F,H,$);return!F||k===0||!$?{text:v("deposit.confirmDeposit"),disabled:!0}:k>parseFloat(H)?{text:"Insufficient Balance",disabled:!0}:k<W?{text:`Min Deposit ${W} ${x}`,disabled:!0}:{text:v("deposit.confirmDeposit"),disabled:!Q}},[F,x,L,$]),D=m.useCallback(async()=>{d&&d({amount:F,chainId:E,tokenAddress:(C==null?void 0:C.tokenAddress)||"",tokenSymbol:x})},[d,F,E,C==null?void 0:C.tokenAddress,x]);return!(s!=null&&s.useBalance)||!(s!=null&&s.useReadContract)||!(s!=null&&s.useAccount)?O.jsxs("div",{className:"p-6 text-center",children:[O.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),O.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?O.jsx("div",{className:"text-center py-8",children:O.jsx("p",{className:"text-gray-400",children:"No chains available"})}):A?O.jsxs(O.Fragment,{children:[S,O.jsx(Kr,{currentActiveChain:A,chainList:e,onChainChange:B,curSelectToken:x,onTokenChange:V,walletType:"evm"}),O.jsx(Am,{depositAmount:F,curSelectToken:x,curSelectTokenData:{balance:C==null?void 0:C.balance,allowance:C==null?void 0:C.allowance},approved:$,currentActiveChain:A,currentEquity:a||0,amount:F,decimals:(C==null?void 0:C.decimals)||6,tokenBalance:L,platformBalance:u,onDepositAmountChange:R,onApprove:async()=>{c&&await c()}}),O.jsx("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors ${w.disabled?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:D,disabled:w.disabled,children:w.text})]}):O.jsx("div",{className:"text-center py-8",children:O.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Al=({isOpen:e,onClose:t,config:n,currentActiveAccount:r=Xr,smartWallet:o=Qr,chains:i,defaultChainId:a,defaultTokenAddress:u,defaultAmount:s="",metadata:l=Jr,currentEquity:c=5e3,platformBalance:d="0",wagmiHooks:p,approved:f,onApproved:g,onDeposit:v,onCopy:E,onChainChange:I,onTokenChange:x})=>{const{t:P}=Ye(),F=m.useMemo(()=>{var B;return r?Fo(r,o,!1,(B=i[0])==null?void 0:B.chainId,"0","0"):null},[r,o,i]),R=(F==null?void 0:F.getWalletType())==="mpc";return e?we.createPortal(O.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:O.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{t()},"aria-hidden":"true",children:O.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:B=>{B.stopPropagation()},children:[O.jsxs("div",{className:"flex items-center justify-between mb-4",children:[O.jsx("h2",{className:"text-lg font-semibold text-white",children:P("deposit.title")}),O.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:O.jsx(Do,{className:"h-4 w-4"})})]}),R?O.jsx(Om,{chains:i,defaultChainId:a,defaultTokenAddress:u,defaultAmount:s,walletAdapter:F,metadata:l,currentEquity:c,onDeposit:v,onCopy:E,onClose:t}):O.jsx(Pm,{chains:i,defaultChainId:a,defaultTokenAddress:u,defaultAmount:s,walletAdapter:F,metadata:l,currentEquity:c,platformBalance:d,wagmiHooks:p,approved:f,onApproved:g,onDeposit:v,onClose:t,onChainChange:I,onTokenChange:x})]})})}),document.body):null};let nt=null;const Lm={symbol:"USDT"},$l=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState({chains:[]}),a=m.useCallback(c=>{i(c),r(!0)},[]),u=m.useCallback(c=>{i(d=>({...d,...c}))},[]),s=m.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),l=m.useCallback(()=>n,[n]);return m.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:s,updateDepositOptions:u,isOpen:l}),[a,s,u,l]),m.useEffect(()=>(nt={openDeposit:a,closeDeposit:s,updateDepositOptions:u,isOpen:l},()=>{nt=null}),[a,s,u,l]),O.jsx(Al,{isOpen:n,onClose:s,config:o.config||Lm,currentActiveAccount:o.currentActiveAccount||Xr,smartWallet:o.smartWallet||Qr,chains:o.chains||up,defaultChainId:o.defaultChainId,defaultTokenAddress:o.defaultTokenAddress,defaultAmount:o.defaultAmount,metadata:o.metadata||Jr,currentEquity:o.currentEquity??5e3,platformBalance:o.platformBalance||"0",wagmiHooks:o.wagmiHooks,approved:o.approved,onApproved:o.onApproved,onDeposit:o.onDeposit,onCopy:o.onCopy,onChainChange:o.onChainChange,onTokenChange:o.onTokenChange})});$l.displayName="DepositManager";const Pl=e=>{if(!nt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}nt.openDeposit(e||{chains:[]})},Ll=()=>{if(!nt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}nt.closeDeposit()},Ml=e=>{nt&&nt.updateDepositOptions(e)},Mm=()=>nt?nt.isOpen():!1,Dm=()=>({openDeposit:Pl,closeDeposit:Ll,updateDepositOptions:Ml,isOpen:Mm});m.createContext(null);const Im=()=>O.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[O.jsx("g",{clipPath:"url(#clip0_active)",children:O.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"})}),O.jsx("defs",{children:O.jsx("clipPath",{id:"clip0_active",children:O.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Fm=()=>O.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[O.jsx("g",{clipPath:"url(#clip0_inactive)",children:O.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"})}),O.jsx("defs",{children:O.jsx("clipPath",{id:"clip0_inactive",children:O.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),zn=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,i)=>i+1);return O.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>O.jsx("div",{className:"flex items-center justify-center",children:o<=e?O.jsx(Im,{}):O.jsx(Fm,{})},o))})};class dt{}Le(dt,"FAST",3),Le(dt,"Medium",2),Le(dt,"SLOW",1),Le(dt,"NONE",0);const jm=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",walletType:o="evm",receiverAddress:i="",onWithdrawAmountChange:a,onReceiverAddressChange:u})=>{const{t:s}=Ye(),l=p=>{const f=p.target.value,v=qr(f,r||"0");if(v.isValid)a(v.formattedValue),v.errorType;else return v.errorType==="exceed_balance",void 0},c=()=>{a(r)},d=()=>{const p=parseFloat(r||"0"),f=parseFloat(e||"0");if(f>0){const g=p-f,v=ze(Math.max(0,g).toString());return O.jsxs("span",{className:"flex items-center gap-1",children:[ze(r||"0"),O.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),v," ",t]})}return`${ze(r||"0")} ${t}`};return O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[O.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[O.jsx("input",{type:"text",placeholder:s("deposit.amount"),value:e,onChange:l,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"}),O.jsx("button",{onClick:c,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:s("deposit.max")})]}),O.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),O.jsxs("div",{className:"flex justify-between items-center",children:[O.jsx(on,{content:s("deposit.availableDesc"),children:O.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:s("deposit.available")})}),O.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:d()})]})]}),o==="mpc"&&!At(n==null?void 0:n.chainId)&&O.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:O.jsx("input",{type:"text",placeholder:s("withdraw.receiverAddress"),value:i,onChange:p=>u==null?void 0:u(p.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"})}),O.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:At(n==null?void 0:n.chainId)?O.jsxs(O.Fragment,{children:[O.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:s("withdraw.noticeDesc")}),O.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:s("withdraw.commonWithdraw")})]}):O.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:s("withdraw.crossChainTips")})}),O.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsx("span",{className:"text-text-tertiary text-xs",children:s("withdraw.speed")}),O.jsx("div",{className:"flex items-center",children:O.jsx(on,{content:O.jsxs("div",{children:[O.jsx("div",{children:s("withdraw.speedNote")}),O.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[O.jsx(zn,{selectedLevel:dt.FAST,maxLevel:3}),O.jsx("span",{children:s("withdraw.speedNoteSpeed1")})]}),O.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[O.jsx(zn,{selectedLevel:dt.Medium,maxLevel:3}),O.jsx("span",{children:s("withdraw.speedNoteSpeed2")})]}),O.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[O.jsx(zn,{selectedLevel:dt.SLOW,maxLevel:3}),O.jsx("span",{children:s("withdraw.speedNoteSpeed3")})]})]}),children:O.jsx(zn,{selectedLevel:At(n==null?void 0:n.chainId)?dt.SLOW:dt.FAST,maxLevel:3})})})]}),O.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[O.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:"Amount to receive"}),O.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[ze(e)," ",t]})]})]})]})},Rm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:a,platformBalance:u="0",wagmiHooks:s,onWithdraw:l,onClose:c,onChainChange:d,onTokenChange:p})=>{var _;const{t:f}=Ye(),[g,v]=m.useState(()=>{var k;return!e||e.length===0?1:t||((k=e[0])==null?void 0:k.chainId)||1}),[E,I]=m.useState(()=>{var Q;if(!e||e.length===0)return"";const k=t||((Q=e[0])==null?void 0:Q.chainId),W=e.find(z=>z.chainId===k);if(!W||!W.tokenList||W.tokenList.length===0)return"";const H=W.tokenList.find(z=>z.tokenAddress===n)||W.tokenList[0];return(H==null?void 0:H.token)||""}),[x,P]=m.useState(r),[F,R]=m.useState(""),B=(o==null?void 0:o.getWalletType())||"evm",V=m.useCallback(k=>{v(k),d==null||d(k)},[d]),h=m.useCallback(k=>{I(k),p==null||p(k)},[p]),y=m.useRef(!0),b=m.useRef(E),A=m.useRef(g);m.useEffect(()=>{if(y.current){y.current=!1,b.current=E,A.current=g;return}(b.current!==E||A.current!==g)&&(P(""),b.current=E,A.current=g)},[E,g]);const C=e&&e.length>0?e.find(k=>k.chainId===g)||e[0]:null,N=(_=C==null?void 0:C.tokenList)==null?void 0:_.find(k=>k.token===E),T=o==null?void 0:o.getDisplayAddress(),{multicallResult:S,queryComponents:L}=Nl({account:T,chainId:g,contractAddress:void 0,tokens:(C==null?void 0:C.tokenList)||[],wagmiHooks:s}),$=m.useMemo(()=>{var W;if(!N)return;if(!N.tokenAddress||N.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return S.baseTokenBalance.formatted;const k=S.combinedData[N.tokenAddress];return((W=k==null?void 0:k.balance)==null?void 0:W.formatted)||"0"},[N,S]),w=m.useMemo(()=>{const k=parseFloat(x||"0");return!x||k===0?{text:f("withdraw.confirmWithdraw"),disabled:!0}:B==="mpc"&&!At(g)&&!F.trim()?{text:"Enter Receiver Address",disabled:!0}:{text:f("withdraw.confirmWithdraw"),disabled:!1}},[f,g,x,B,F]),D=m.useCallback(async()=>{if(l){const k={amount:x,chainId:g,tokenAddress:(N==null?void 0:N.tokenAddress)||"",tokenSymbol:E};B==="mpc"&&!At(g)&&(k.receiverAddress=F),l(k)}},[l,x,g,N==null?void 0:N.tokenAddress,E,B,F]);return!(s!=null&&s.useBalance)||!(s!=null&&s.useReadContract)||!(s!=null&&s.useAccount)?O.jsxs("div",{className:"p-6 text-center",children:[O.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),O.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?O.jsx("div",{className:"text-center py-8",children:O.jsx("p",{className:"text-gray-400",children:"No chains available"})}):C?O.jsxs(O.Fragment,{children:[L,O.jsx(Kr,{currentActiveChain:C,chainList:e,onChainChange:V,curSelectToken:E,onTokenChange:h,walletType:"evm"}),O.jsx(jm,{withdrawAmount:x,curSelectToken:E,curSelectTokenData:{balance:N==null?void 0:N.balance,allowance:N==null?void 0:N.allowance},currentActiveChain:C,currentEquity:a||0,amount:x,decimals:(N==null?void 0:N.decimals)||6,tokenBalance:$,platformBalance:u,walletType:B,receiverAddress:F,onWithdrawAmountChange:P,onReceiverAddressChange:R}),O.jsx("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors ${w.disabled?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:D,disabled:w.disabled,children:w.text})]}):O.jsx("div",{className:"text-center py-8",children:O.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Dl=({isOpen:e,onClose:t,config:n,currentActiveAccount:r=Xr,smartWallet:o=Qr,chains:i,defaultChainId:a,defaultTokenAddress:u,defaultAmount:s="",metadata:l=Jr,currentEquity:c=5e3,platformBalance:d="0",wagmiHooks:p,onWithdraw:f,onChainChange:g,onTokenChange:v})=>{const{t:E}=Ye(),I=m.useMemo(()=>{var x;return r?Fo(r,o,!1,(x=i[0])==null?void 0:x.chainId,"0","0"):null},[r,o,i]);return e?we.createPortal(O.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:O.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{t()},"aria-hidden":"true",children:O.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:x=>{x.stopPropagation()},children:[O.jsxs("div",{className:"flex items-center justify-between mb-4",children:[O.jsx("h2",{className:"text-lg font-semibold text-white",children:E("withdraw.withdraw")}),O.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:O.jsx(Do,{className:"h-4 w-4"})})]}),O.jsx(Rm,{chains:i,defaultChainId:a,defaultTokenAddress:u,defaultAmount:s,walletAdapter:I,metadata:l,currentEquity:c,platformBalance:d,wagmiHooks:p,onWithdraw:f,onClose:t,onChainChange:g,onTokenChange:v})]})})}),document.body):null},km=[],_m={};let rt=null;const Il=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState({chains:[]}),a=m.useCallback(c=>{i(c||{chains:[]}),r(!0)},[]),u=m.useCallback(c=>{i(d=>({...d,...c}))},[]),s=m.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),l=m.useCallback(()=>n,[n]);return m.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:s,updateWithdrawOptions:u,isOpen:l}),[a,s,u,l]),m.useEffect(()=>(rt={openWithdraw:a,closeWithdraw:s,updateWithdrawOptions:u,isOpen:l},()=>{rt=null}),[a,s,u,l]),O.jsx(Dl,{isOpen:n,onClose:s,config:o.config||{symbol:"USDT"},currentActiveAccount:o.currentActiveAccount,smartWallet:o.smartWallet,chains:o.chains||km,defaultChainId:o.defaultChainId,defaultTokenAddress:o.defaultTokenAddress,defaultAmount:o.defaultAmount,metadata:o.metadata||_m,currentEquity:o.currentEquity??5e3,platformBalance:o.platformBalance||"0",wagmiHooks:o.wagmiHooks,onWithdraw:o.onWithdraw,onChainChange:o.onChainChange,onTokenChange:o.onTokenChange})});Il.displayName="WithdrawManager";const Fl=e=>{if(!rt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}rt.openWithdraw(e||{chains:[]})},jl=()=>{if(!rt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}rt.closeWithdraw()},Rl=e=>{if(!rt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}rt.updateWithdrawOptions(e)},Bm=()=>rt?rt.isOpen():!1,Wm=()=>({openWithdraw:Fl,closeWithdraw:jl,updateWithdrawOptions:Rl,isOpen:Bm});te.ComponentProvider=ca,te.DEFAULT_LOCALE=ln,te.Deposit=Al,te.DepositManager=$l,te.LOCALE_NAMES=la,te.SUPPORTED_LOCALES=Kn,te.Tooltip=on,te.Withdraw=Dl,te.WithdrawManager=Il,te.closeDeposit=Ll,te.closeWithdraw=jl,te.openDeposit=Pl,te.openWithdraw=Fl,te.updateDepositOptions=Ml,te.updateWithdrawOptions=Rl,te.useComponentConfig=Po,te.useDeposit=fa,te.useDepositManager=Dm,te.useTranslation=Ye,te.useWithdraw=da,te.useWithdrawManager=Wm,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})});
119
+ `,children:[t,o&&C.jsx(Ol,{ref:d,placement:g.placement||n})]})})]})},Tl="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=",Tm=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const{t:i}=He(),l=m.useMemo(()=>cp(n||{}),[n]);return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex justify-center mt-4 mb-3",children:C.jsx("div",{className:"bg-white rounded-lg",children:C.jsx(sl,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),C.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[C.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),C.jsx(Lp,{onCopy:()=>{const s=(e==null?void 0:e.getDisplayAddress())||"";o&&o(s)},text:e==null?void 0:e.getDisplayAddress(),children:C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[C.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),C.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")]}),C.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[C.jsxs("div",{className:"flex items-start",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:Tl,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1",children:C.jsxs("p",{className:"text-xs text-functional-orange-1",children:["Only ",t," (",n==null?void 0:n.chain,") is supported for deposits to this address."]})})]}),l&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:"When the deposit amount exceeds 250,000, there may be a delay in arrival. It is recommended to use the Ethereum network for deposits."})]})]}),C.jsxs("div",{className:"text-sm",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.arrivalTime")}),C.jsx(on,{content:C.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[C.jsx("p",{children:i("deposit.arrivaltimeTooltip1",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60,v1:n==null?void 0:n.txConfirm})}),C.jsx("p",{children:i("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:C.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:i("deposit.arrivalEstimated",{v:(n==null?void 0:n.blockTime)*n.txConfirm/60})})})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.minDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((u=r==null?void 0:r.multiChain)==null?void 0:u.minDeposit)||10," ",t]})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[C.jsx("span",{className:"text-text-tertiary",children:i("deposit.maxDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:["250,000 ",t]})]})]})]})},Nm=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:i,onCopy:l,onClose:u})=>{var v;const{t:s}=He(),[a,c]=m.useState(()=>{var S;return!e||e.length===0?1:t||((S=e[0])==null?void 0:S.chainId)||1}),[d,p]=m.useState(()=>{var N;if(!e||e.length===0)return"";const S=t||((N=e[0])==null?void 0:N.chainId),D=e.find(F=>F.chainId===S);if(!D||!D.tokenList||D.tokenList.length===0)return"";const w=D.tokenList.find(F=>F.tokenAddress===n)||D.tokenList[0];return(w==null?void 0:w.token)||""}),f=e&&e.length>0?e.find(S=>S.chainId===a)||e[0]:null,g=(v=f==null?void 0:f.tokenList)==null?void 0:v.find(S=>S.token===d);return!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):f?C.jsxs(C.Fragment,{children:[C.jsx(Kr,{currentActiveChain:f,chainList:e,onChainChange:c,curSelectToken:d,onTokenChange:p,walletType:"mpc"}),C.jsx(Tm,{walletAdapter:r,curSelectToken:d,currentActiveChain:f,metadata:o,onCopy:l}),C.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:()=>{i&&i({amount:"",chainId:a,tokenAddress:(g==null?void 0:g.tokenAddress)||"",tokenSymbol:d}),u()},children:s("deposit.title")})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})};var Am=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,vo=Math.ceil,Be=Math.floor,Te="[BigNumber Error] ",Nl=Te+"Number primitive has more than 15 significant digits: ",Ke=1e14,X=14,bo=9007199254740991,xo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],xt=1e7,be=1e9;function Al(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},i=new w(1),l=20,u=4,s=-7,a=21,c=-1e7,d=1e7,p=!1,f=1,g=0,v={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",D=!0;function w(h,x){var b,A,T,$,E,O,L,P,y=this;if(!(y instanceof w))return new w(h,x);if(x==null){if(h&&h._isBigNumber===!0){y.s=h.s,!h.c||h.e>d?y.c=y.e=null:h.e<c?y.c=[y.e=0]:(y.e=h.e,y.c=h.c.slice());return}if((O=typeof h=="number")&&h*0==0){if(y.s=1/h<0?(h=-h,-1):1,h===~~h){for($=0,E=h;E>=10;E/=10,$++);$>d?y.c=y.e=null:(y.e=$,y.c=[h]);return}P=String(h)}else{if(!Am.test(P=String(h)))return r(y,P,O);y.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}($=P.indexOf("."))>-1&&(P=P.replace(".","")),(E=P.search(/e/i))>0?($<0&&($=E),$+=+P.slice(E+1),P=P.substring(0,E)):$<0&&($=P.length)}else{if(ce(x,2,S.length,"Base"),x==10&&D)return y=new w(h),B(y,l+y.e+1,u);if(P=String(h),O=typeof h=="number"){if(h*0!=0)return r(y,P,O,x);if(y.s=1/h<0?(P=P.slice(1),-1):1,w.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Nl+h)}else y.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(b=S.slice(0,x),$=E=0,L=P.length;E<L;E++)if(b.indexOf(A=P.charAt(E))<0){if(A=="."){if(E>$){$=L;continue}}else if(!T&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){T=!0,E=-1,$=0;continue}return r(y,String(h),O,x)}O=!1,P=n(P,x,10,y.s),($=P.indexOf("."))>-1?P=P.replace(".",""):$=P.length}for(E=0;P.charCodeAt(E)===48;E++);for(L=P.length;P.charCodeAt(--L)===48;);if(P=P.slice(E,++L)){if(L-=E,O&&w.DEBUG&&L>15&&(h>bo||h!==Be(h)))throw Error(Nl+y.s*h);if(($=$-E-1)>d)y.c=y.e=null;else if($<c)y.c=[y.e=0];else{if(y.e=$,y.c=[],E=($+1)%X,$<0&&(E+=X),E<L){for(E&&y.c.push(+P.slice(0,E)),L-=X;E<L;)y.c.push(+P.slice(E,E+=X));E=X-(P=P.slice(E)).length}else E-=L;for(;E--;P+="0");y.c.push(+P)}}else y.c=[y.e=0]}w.clone=Al,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(h){var x,b;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(x="DECIMAL_PLACES")&&(b=h[x],ce(b,0,be,x),l=b),h.hasOwnProperty(x="ROUNDING_MODE")&&(b=h[x],ce(b,0,8,x),u=b),h.hasOwnProperty(x="EXPONENTIAL_AT")&&(b=h[x],b&&b.pop?(ce(b[0],-be,0,x),ce(b[1],0,be,x),s=b[0],a=b[1]):(ce(b,-be,be,x),s=-(a=b<0?-b:b))),h.hasOwnProperty(x="RANGE"))if(b=h[x],b&&b.pop)ce(b[0],-be,-1,x),ce(b[1],1,be,x),c=b[0],d=b[1];else if(ce(b,-be,be,x),b)c=-(d=b<0?-b:b);else throw Error(Te+x+" cannot be zero: "+b);if(h.hasOwnProperty(x="CRYPTO"))if(b=h[x],b===!!b)if(b)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=b;else throw p=!b,Error(Te+"crypto unavailable");else p=b;else throw Error(Te+x+" not true or false: "+b);if(h.hasOwnProperty(x="MODULO_MODE")&&(b=h[x],ce(b,0,9,x),f=b),h.hasOwnProperty(x="POW_PRECISION")&&(b=h[x],ce(b,0,be,x),g=b),h.hasOwnProperty(x="FORMAT"))if(b=h[x],typeof b=="object")v=b;else throw Error(Te+x+" not an object: "+b);if(h.hasOwnProperty(x="ALPHABET"))if(b=h[x],typeof b=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(b))D=b.slice(0,10)=="0123456789",S=b;else throw Error(Te+x+" invalid: "+b)}else throw Error(Te+"Object expected: "+h);return{DECIMAL_PLACES:l,ROUNDING_MODE:u,EXPONENTIAL_AT:[s,a],RANGE:[c,d],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:g,FORMAT:v,ALPHABET:S}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var x,b,A=h.c,T=h.e,$=h.s;e:if({}.toString.call(A)=="[object Array]"){if(($===1||$===-1)&&T>=-be&&T<=be&&T===Be(T)){if(A[0]===0){if(T===0&&A.length===1)return!0;break e}if(x=(T+1)%X,x<1&&(x+=X),String(A[0]).length==x){for(x=0;x<A.length;x++)if(b=A[x],b<0||b>=Ke||b!==Be(b))break e;if(b!==0)return!0}}}else if(A===null&&T===null&&($===null||$===1||$===-1))return!0;throw Error(Te+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return F(arguments,-1)},w.minimum=w.min=function(){return F(arguments,1)},w.random=function(){var h=9007199254740992,x=Math.random()*h&2097151?function(){return Be(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(b){var A,T,$,E,O,L=0,P=[],y=new w(i);if(b==null?b=l:ce(b,0,be),E=vo(b/X),p)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(E*=2));L<E;)O=A[L]*131072+(A[L+1]>>>11),O>=9e15?(T=crypto.getRandomValues(new Uint32Array(2)),A[L]=T[0],A[L+1]=T[1]):(P.push(O%1e14),L+=2);L=E/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(E*=7);L<E;)O=(A[L]&31)*281474976710656+A[L+1]*1099511627776+A[L+2]*4294967296+A[L+3]*16777216+(A[L+4]<<16)+(A[L+5]<<8)+A[L+6],O>=9e15?crypto.randomBytes(7).copy(A,L):(P.push(O%1e14),L+=7);L=E/7}else throw p=!1,Error(Te+"crypto unavailable");if(!p)for(;L<E;)O=x(),O<9e15&&(P[L++]=O%1e14);for(E=P[--L],b%=X,E&&b&&(O=xo[X-b],P[L]=Be(E/O)*O);P[L]===0;P.pop(),L--);if(L<0)P=[$=0];else{for($=-1;P[0]===0;P.splice(0,1),$-=X);for(L=1,O=P[0];O>=10;O/=10,L++);L<X&&($-=X-L)}return y.e=$,y.c=P,y}}(),w.sum=function(){for(var h=1,x=arguments,b=new w(x[0]);h<x.length;)b=b.plus(x[h++]);return b},n=function(){var h="0123456789";function x(b,A,T,$){for(var E,O=[0],L,P=0,y=b.length;P<y;){for(L=O.length;L--;O[L]*=A);for(O[0]+=$.indexOf(b.charAt(P++)),E=0;E<O.length;E++)O[E]>T-1&&(O[E+1]==null&&(O[E+1]=0),O[E+1]+=O[E]/T|0,O[E]%=T)}return O.reverse()}return function(b,A,T,$,E){var O,L,P,y,I,_,W,k,H=b.indexOf("."),Q=l,Y=u;for(H>=0&&(y=g,g=0,b=b.replace(".",""),k=new w(A),_=k.pow(b.length-H),g=y,k.c=x(ft(Ue(_.c),_.e,"0"),10,T,h),k.e=k.c.length),W=x(b,A,T,E?(O=S,h):(O=h,S)),P=y=W.length;W[--y]==0;W.pop());if(!W[0])return O.charAt(0);if(H<0?--P:(_.c=W,_.e=P,_.s=$,_=t(_,k,Q,Y,T),W=_.c,I=_.r,P=_.e),L=P+Q+1,H=W[L],y=T/2,I=I||L<0||W[L+1]!=null,I=Y<4?(H!=null||I)&&(Y==0||Y==(_.s<0?3:2)):H>y||H==y&&(Y==4||I||Y==6&&W[L-1]&1||Y==(_.s<0?8:7)),L<1||!W[0])b=I?ft(O.charAt(1),-Q,O.charAt(0)):O.charAt(0);else{if(W.length=L,I)for(--T;++W[--L]>T;)W[L]=0,L||(++P,W=[1].concat(W));for(y=W.length;!W[--y];);for(H=0,b="";H<=y;b+=O.charAt(W[H++]));b=ft(b,P,O.charAt(0))}return b}}(),t=function(){function h(A,T,$){var E,O,L,P,y=0,I=A.length,_=T%xt,W=T/xt|0;for(A=A.slice();I--;)L=A[I]%xt,P=A[I]/xt|0,E=W*L+P*_,O=_*L+E%xt*xt+y,y=(O/$|0)+(E/xt|0)+W*P,A[I]=O%$;return y&&(A=[y].concat(A)),A}function x(A,T,$,E){var O,L;if($!=E)L=$>E?1:-1;else for(O=L=0;O<$;O++)if(A[O]!=T[O]){L=A[O]>T[O]?1:-1;break}return L}function b(A,T,$,E){for(var O=0;$--;)A[$]-=O,O=A[$]<T[$]?1:0,A[$]=O*E+A[$]-T[$];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,T,$,E,O){var L,P,y,I,_,W,k,H,Q,Y,K,z,oe,fe,Ae,$e,ot,ye=A.s==T.s?1:-1,he=A.c,se=T.c;if(!he||!he[0]||!se||!se[0])return new w(!A.s||!T.s||(he?se&&he[0]==se[0]:!se)?NaN:he&&he[0]==0||!se?ye*0:ye/0);for(H=new w(ye),Q=H.c=[],P=A.e-T.e,ye=$+P+1,O||(O=Ke,P=We(A.e/X)-We(T.e/X),ye=ye/X|0),y=0;se[y]==(he[y]||0);y++);if(se[y]>(he[y]||0)&&P--,ye<0)Q.push(1),I=!0;else{for(fe=he.length,$e=se.length,y=0,ye+=2,_=Be(O/(se[0]+1)),_>1&&(se=h(se,_,O),he=h(he,_,O),$e=se.length,fe=he.length),oe=$e,Y=he.slice(0,$e),K=Y.length;K<$e;Y[K++]=0);ot=se.slice(),ot=[0].concat(ot),Ae=se[0],se[1]>=O/2&&Ae++;do{if(_=0,L=x(se,Y,$e,K),L<0){if(z=Y[0],$e!=K&&(z=z*O+(Y[1]||0)),_=Be(z/Ae),_>1)for(_>=O&&(_=O-1),W=h(se,_,O),k=W.length,K=Y.length;x(W,Y,k,K)==1;)_--,b(W,$e<k?ot:se,k,O),k=W.length,L=1;else _==0&&(L=_=1),W=se.slice(),k=W.length;if(k<K&&(W=[0].concat(W)),b(Y,W,K,O),K=Y.length,L==-1)for(;x(se,Y,$e,K)<1;)_++,b(Y,$e<K?ot:se,K,O),K=Y.length}else L===0&&(_++,Y=[0]);Q[y++]=_,Y[0]?Y[K++]=he[oe]||0:(Y=[he[oe]],K=1)}while((oe++<fe||Y[0]!=null)&&ye--);I=Y[0]!=null,Q[0]||Q.splice(0,1)}if(O==Ke){for(y=1,ye=Q[0];ye>=10;ye/=10,y++);B(H,$+(H.e=y+P*X-1)+1,E,I)}else H.e=P,H.r=+I;return H}}();function N(h,x,b,A){var T,$,E,O,L;if(b==null?b=u:ce(b,0,8),!h.c)return h.toString();if(T=h.c[0],E=h.e,x==null)L=Ue(h.c),L=A==1||A==2&&(E<=s||E>=a)?Vn(L,E):ft(L,E,"0");else if(h=B(new w(h),x,b),$=h.e,L=Ue(h.c),O=L.length,A==1||A==2&&(x<=$||$<=s)){for(;O<x;L+="0",O++);L=Vn(L,$)}else if(x-=E+(A===2&&$>E),L=ft(L,$,"0"),$+1>O){if(--x>0)for(L+=".";x--;L+="0");}else if(x+=$-O,x>0)for($+1==O&&(L+=".");x--;L+="0");return h.s<0&&T?"-"+L:L}function F(h,x){for(var b,A,T=1,$=new w(h[0]);T<h.length;T++)A=new w(h[T]),(!A.s||(b=Nt($,A))===x||b===0&&$.s===x)&&($=A);return $}function R(h,x,b){for(var A=1,T=x.length;!x[--T];x.pop());for(T=x[0];T>=10;T/=10,A++);return(b=A+b*X-1)>d?h.c=h.e=null:b<c?h.c=[h.e=0]:(h.e=b,h.c=x),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,b=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,E,O,L){var P,y=O?E:E.replace(T,"");if(A.test(y))$.s=isNaN(y)?null:y<0?-1:1;else{if(!O&&(y=y.replace(h,function(I,_,W){return P=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!L||L==P?_:I}),L&&(P=L,y=y.replace(x,"$1").replace(b,"0.$1")),E!=y))return new w(y,P);if(w.DEBUG)throw Error(Te+"Not a"+(L?" base "+L:"")+" number: "+E);$.s=null}$.c=$.e=null}}();function B(h,x,b,A){var T,$,E,O,L,P,y,I=h.c,_=xo;if(I){e:{for(T=1,O=I[0];O>=10;O/=10,T++);if($=x-T,$<0)$+=X,E=x,L=I[P=0],y=Be(L/_[T-E-1]%10);else if(P=vo(($+1)/X),P>=I.length)if(A){for(;I.length<=P;I.push(0));L=y=0,T=1,$%=X,E=$-X+1}else break e;else{for(L=O=I[P],T=1;O>=10;O/=10,T++);$%=X,E=$-X+T,y=E<0?0:Be(L/_[T-E-1]%10)}if(A=A||x<0||I[P+1]!=null||(E<0?L:L%_[T-E-1]),A=b<4?(y||A)&&(b==0||b==(h.s<0?3:2)):y>5||y==5&&(b==4||A||b==6&&($>0?E>0?L/_[T-E]:0:I[P-1])%10&1||b==(h.s<0?8:7)),x<1||!I[0])return I.length=0,A?(x-=h.e+1,I[0]=_[(X-x%X)%X],h.e=-x||0):I[0]=h.e=0,h;if($==0?(I.length=P,O=1,P--):(I.length=P+1,O=_[X-$],I[P]=E>0?Be(L/_[T-E]%_[E])*O:0),A)for(;;)if(P==0){for($=1,E=I[0];E>=10;E/=10,$++);for(E=I[0]+=O,O=1;E>=10;E/=10,O++);$!=O&&(h.e++,I[0]==Ke&&(I[0]=1));break}else{if(I[P]+=O,I[P]!=Ke)break;I[P--]=0,O=1}for($=I.length;I[--$]===0;I.pop());}h.e>d?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function V(h){var x,b=h.e;return b===null?h.toString():(x=Ue(h.c),x=b<=s||b>=a?Vn(x,b):ft(x,b,"0"),h.s<0?"-"+x:x)}return o.absoluteValue=o.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,x){return Nt(this,new w(h,x))},o.decimalPlaces=o.dp=function(h,x){var b,A,T,$=this;if(h!=null)return ce(h,0,be),x==null?x=u:ce(x,0,8),B(new w($),h+$.e+1,x);if(!(b=$.c))return null;if(A=((T=b.length-1)-We(this.e/X))*X,T=b[T])for(;T%10==0;T/=10,A--);return A<0&&(A=0),A},o.dividedBy=o.div=function(h,x){return t(this,new w(h,x),l,u)},o.dividedToIntegerBy=o.idiv=function(h,x){return t(this,new w(h,x),0,1)},o.exponentiatedBy=o.pow=function(h,x){var b,A,T,$,E,O,L,P,y,I=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Te+"Exponent not an integer: "+V(h));if(x!=null&&(x=new w(x)),O=h.e>14,!I.c||!I.c[0]||I.c[0]==1&&!I.e&&I.c.length==1||!h.c||!h.c[0])return y=new w(Math.pow(+V(I),O?h.s*(2-Un(h)):+V(h))),x?y.mod(x):y;if(L=h.s<0,x){if(x.c?!x.c[0]:!x.s)return new w(NaN);A=!L&&I.isInteger()&&x.isInteger(),A&&(I=I.mod(x))}else{if(h.e>9&&(I.e>0||I.e<-1||(I.e==0?I.c[0]>1||O&&I.c[1]>=24e7:I.c[0]<8e13||O&&I.c[0]<=9999975e7)))return $=I.s<0&&Un(h)?-0:0,I.e>-1&&($=1/$),new w(L?1/$:$);g&&($=vo(g/X+2))}for(O?(b=new w(.5),L&&(h.s=1),P=Un(h)):(T=Math.abs(+V(h)),P=T%2),y=new w(i);;){if(P){if(y=y.times(I),!y.c)break;$?y.c.length>$&&(y.c.length=$):A&&(y=y.mod(x))}if(T){if(T=Be(T/2),T===0)break;P=T%2}else if(h=h.times(b),B(h,h.e+1,1),h.e>14)P=Un(h);else{if(T=+V(h),T===0)break;P=T%2}I=I.times(I),$?I.c&&I.c.length>$&&(I.c.length=$):A&&(I=I.mod(x))}return A?y:(L&&(y=i.div(y)),x?y.mod(x):$?B(y,g,u,E):y)},o.integerValue=function(h){var x=new w(this);return h==null?h=u:ce(h,0,8),B(x,x.e+1,h)},o.isEqualTo=o.eq=function(h,x){return Nt(this,new w(h,x))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,x){return Nt(this,new w(h,x))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,x){return(x=Nt(this,new w(h,x)))===1||x===0},o.isInteger=function(){return!!this.c&&We(this.e/X)>this.c.length-2},o.isLessThan=o.lt=function(h,x){return Nt(this,new w(h,x))<0},o.isLessThanOrEqualTo=o.lte=function(h,x){return(x=Nt(this,new w(h,x)))===-1||x===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(h,x){var b,A,T,$,E=this,O=E.s;if(h=new w(h,x),x=h.s,!O||!x)return new w(NaN);if(O!=x)return h.s=-x,E.plus(h);var L=E.e/X,P=h.e/X,y=E.c,I=h.c;if(!L||!P){if(!y||!I)return y?(h.s=-x,h):new w(I?E:NaN);if(!y[0]||!I[0])return I[0]?(h.s=-x,h):new w(y[0]?E:u==3?-0:0)}if(L=We(L),P=We(P),y=y.slice(),O=L-P){for(($=O<0)?(O=-O,T=y):(P=L,T=I),T.reverse(),x=O;x--;T.push(0));T.reverse()}else for(A=($=(O=y.length)<(x=I.length))?O:x,O=x=0;x<A;x++)if(y[x]!=I[x]){$=y[x]<I[x];break}if($&&(T=y,y=I,I=T,h.s=-h.s),x=(A=I.length)-(b=y.length),x>0)for(;x--;y[b++]=0);for(x=Ke-1;A>O;){if(y[--A]<I[A]){for(b=A;b&&!y[--b];y[b]=x);--y[b],y[A]+=Ke}y[A]-=I[A]}for(;y[0]==0;y.splice(0,1),--P);return y[0]?R(h,y,P):(h.s=u==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,x){var b,A,T=this;return h=new w(h,x),!T.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||T.c&&!T.c[0]?new w(T):(f==9?(A=h.s,h.s=1,b=t(T,h,0,3),h.s=A,b.s*=A):b=t(T,h,0,f),h=T.minus(b.times(h)),!h.c[0]&&f==1&&(h.s=T.s),h)},o.multipliedBy=o.times=function(h,x){var b,A,T,$,E,O,L,P,y,I,_,W,k,H,Q,Y=this,K=Y.c,z=(h=new w(h,x)).c;if(!K||!z||!K[0]||!z[0])return!Y.s||!h.s||K&&!K[0]&&!z||z&&!z[0]&&!K?h.c=h.e=h.s=null:(h.s*=Y.s,!K||!z?h.c=h.e=null:(h.c=[0],h.e=0)),h;for(A=We(Y.e/X)+We(h.e/X),h.s*=Y.s,L=K.length,I=z.length,L<I&&(k=K,K=z,z=k,T=L,L=I,I=T),T=L+I,k=[];T--;k.push(0));for(H=Ke,Q=xt,T=I;--T>=0;){for(b=0,_=z[T]%Q,W=z[T]/Q|0,E=L,$=T+E;$>T;)P=K[--E]%Q,y=K[E]/Q|0,O=W*P+y*_,P=_*P+O%Q*Q+k[$]+b,b=(P/H|0)+(O/Q|0)+W*y,k[$--]=P%H;k[$]=b}return b?++A:k.splice(0,1),R(h,k,A)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,x){var b,A=this,T=A.s;if(h=new w(h,x),x=h.s,!T||!x)return new w(NaN);if(T!=x)return h.s=-x,A.minus(h);var $=A.e/X,E=h.e/X,O=A.c,L=h.c;if(!$||!E){if(!O||!L)return new w(T/0);if(!O[0]||!L[0])return L[0]?h:new w(O[0]?A:T*0)}if($=We($),E=We(E),O=O.slice(),T=$-E){for(T>0?(E=$,b=L):(T=-T,b=O),b.reverse();T--;b.push(0));b.reverse()}for(T=O.length,x=L.length,T-x<0&&(b=L,L=O,O=b,x=T),T=0;x;)T=(O[--x]=O[x]+L[x]+T)/Ke|0,O[x]=Ke===O[x]?0:O[x]%Ke;return T&&(O=[T].concat(O),++E),R(h,O,E)},o.precision=o.sd=function(h,x){var b,A,T,$=this;if(h!=null&&h!==!!h)return ce(h,1,be),x==null?x=u:ce(x,0,8),B(new w($),h,x);if(!(b=$.c))return null;if(T=b.length-1,A=T*X+1,T=b[T]){for(;T%10==0;T/=10,A--);for(T=b[0];T>=10;T/=10,A++);}return h&&$.e+1>A&&(A=$.e+1),A},o.shiftedBy=function(h){return ce(h,-bo,bo),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,x,b,A,T,$=this,E=$.c,O=$.s,L=$.e,P=l+4,y=new w("0.5");if(O!==1||!E||!E[0])return new w(!O||O<0&&(!E||E[0])?NaN:E?$:1/0);if(O=Math.sqrt(+V($)),O==0||O==1/0?(x=Ue(E),(x.length+L)%2==0&&(x+="0"),O=Math.sqrt(+x),L=We((L+1)/2)-(L<0||L%2),O==1/0?x="5e"+L:(x=O.toExponential(),x=x.slice(0,x.indexOf("e")+1)+L),b=new w(x)):b=new w(O+""),b.c[0]){for(L=b.e,O=L+P,O<3&&(O=0);;)if(T=b,b=y.times(T.plus(t($,T,P,1))),Ue(T.c).slice(0,O)===(x=Ue(b.c)).slice(0,O))if(b.e<L&&--O,x=x.slice(O-3,O+1),x=="9999"||!A&&x=="4999"){if(!A&&(B(T,T.e+l+2,0),T.times(T).eq($))){b=T;break}P+=4,O+=4,A=1}else{(!+x||!+x.slice(1)&&x.charAt(0)=="5")&&(B(b,b.e+l+2,1),h=!b.times(b).eq($));break}}return B(b,b.e+l+1,u,h)},o.toExponential=function(h,x){return h!=null&&(ce(h,0,be),h++),N(this,h,x,1)},o.toFixed=function(h,x){return h!=null&&(ce(h,0,be),h=h+this.e+1),N(this,h,x)},o.toFormat=function(h,x,b){var A,T=this;if(b==null)h!=null&&x&&typeof x=="object"?(b=x,x=null):h&&typeof h=="object"?(b=h,h=x=null):b=v;else if(typeof b!="object")throw Error(Te+"Argument not an object: "+b);if(A=T.toFixed(h,x),T.c){var $,E=A.split("."),O=+b.groupSize,L=+b.secondaryGroupSize,P=b.groupSeparator||"",y=E[0],I=E[1],_=T.s<0,W=_?y.slice(1):y,k=W.length;if(L&&($=O,O=L,L=$,k-=$),O>0&&k>0){for($=k%O||O,y=W.substr(0,$);$<k;$+=O)y+=P+W.substr($,O);L>0&&(y+=P+W.slice($)),_&&(y="-"+y)}A=I?y+(b.decimalSeparator||"")+((L=+b.fractionGroupSize)?I.replace(new RegExp("\\d{"+L+"}\\B","g"),"$&"+(b.fractionGroupSeparator||"")):I):y}return(b.prefix||"")+A+(b.suffix||"")},o.toFraction=function(h){var x,b,A,T,$,E,O,L,P,y,I,_,W=this,k=W.c;if(h!=null&&(O=new w(h),!O.isInteger()&&(O.c||O.s!==1)||O.lt(i)))throw Error(Te+"Argument "+(O.isInteger()?"out of range: ":"not an integer: ")+V(O));if(!k)return new w(W);for(x=new w(i),P=b=new w(i),A=L=new w(i),_=Ue(k),$=x.e=_.length-W.e-1,x.c[0]=xo[(E=$%X)<0?X+E:E],h=!h||O.comparedTo(x)>0?$>0?x:P:O,E=d,d=1/0,O=new w(_),L.c[0]=0;y=t(O,x,0,1),T=b.plus(y.times(A)),T.comparedTo(h)!=1;)b=A,A=T,P=L.plus(y.times(T=P)),L=T,x=O.minus(y.times(T=x)),O=T;return T=t(h.minus(b),A,0,1),L=L.plus(T.times(P)),b=b.plus(T.times(A)),L.s=P.s=W.s,$=$*2,I=t(P,A,$,u).minus(W).abs().comparedTo(t(L,b,$,u).minus(W).abs())<1?[P,A]:[L,b],d=E,I},o.toNumber=function(){return+V(this)},o.toPrecision=function(h,x){return h!=null&&ce(h,1,be),N(this,h,x,2)},o.toString=function(h){var x,b=this,A=b.s,T=b.e;return T===null?A?(x="Infinity",A<0&&(x="-"+x)):x="NaN":(h==null?x=T<=s||T>=a?Vn(Ue(b.c),T):ft(Ue(b.c),T,"0"):h===10&&D?(b=B(new w(b),l+T+1,u),x=ft(Ue(b.c),b.e,"0")):(ce(h,2,S.length,"Base"),x=n(ft(Ue(b.c),T,"0"),10,h,A,!0)),A<0&&b.c[0]&&(x="-"+x)),x},o.valueOf=o.toJSON=function(){return V(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function We(e){var t=e|0;return e>0||e===t?t:t-1}function Ue(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=X-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Nt(e,t){var n,r,o=e.c,i=t.c,l=e.s,u=t.s,s=e.e,a=t.e;if(!l||!u)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-u:l;if(l!=u)return l;if(n=l<0,r=s==a,!o||!i)return r?0:!o^n?1:-1;if(!r)return s>a^n?1:-1;for(u=(s=o.length)<(a=i.length)?s:a,l=0;l<u;l++)if(o[l]!=i[l])return o[l]>i[l]^n?1:-1;return s==a?0:s>a^n?1:-1}function ce(e,t,n,r){if(e<t||e>n||e!==Be(e))throw Error(Te+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Un(e){var t=e.c.length-1;return We(e.e/X)==t&&e.c[t]%2!=0}function Vn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ft(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 Hn=Al();const $m=Object.values({MAINNET:1,SEPOLIA:11155111}),At=e=>$m.includes(+e),Pm=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:i,amount:l,decimals:u,tokenBalance:s,platformBalance:a="0",onDepositAmountChange:c,onApprove:d})=>{const{t:p}=He(),f=m.useCallback(()=>{let D=s||"0";if(!At(o==null?void 0:o.chainId))try{const w=new Hn(D),N=new Hn("250000");w.gt(N)&&(D="250000")}catch(w){console.warn("Error calculating max amount limit:",w)}return D},[s,o==null?void 0:o.chainId]),g=m.useMemo(()=>{if(At(o==null?void 0:o.chainId))return!1;try{const D=new Hn(e||"0"),w=new Hn("250000");return D.isNaN()||w.isNaN()?!1:D.gte(w)}catch{return!1}},[o,e]),v=D=>{const w=D.target.value,N=f(),F=qr(w,N);if(F.isValid)c(F.formattedValue),F.errorType;else return F.errorType==="exceed_balance",void 0},S=()=>{const D=parseFloat(s||"0"),w=parseFloat(e||"0");if(w>0){const N=D-w,F=Ye(Math.max(0,N).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Ye(s||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),F," ",t]})}return`${Ye(s||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:p("deposit.amount"),value:e,onChange:v,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"}),C.jsx("button",{onClick:()=>{const D=f();c(D)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:p("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(on,{content:p("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:p("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:S()})]})]}),!r&&lp(e||"0",0)&&C.jsxs("div",{className:"flex justify-center flex-col items-center",children:[C.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:p("deposit.enableSystemProWithToken",{token:t,network:o==null?void 0:o.chain})}),C.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:p("deposit.enableTokenDesc",{token:t,network:o==null?void 0:o.chain})}),C.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",onClick:d,children:p("deposit.enableWithToken",{token:t})})]}),g&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:Tl,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.depositTipFor25w")})]}),C.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:p("deposit.equity")}),C.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?C.jsxs("span",{className:"flex items-center gap-1",children:[Ye(a),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),Ye((parseFloat(a)+parseFloat(e)).toString())," ",t]}):`${Ye(a)} ${t}`})]})})]})},Lm=({token:e,account:t,chainId:n,contractAddress:r,wagmiHooks:o,onResult:i})=>{var s,a;const l=(s=o==null?void 0:o.useBalance)==null?void 0:s.call(o,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(o!=null&&o.useBalance)}}),u=(a=o==null?void 0:o.useReadContract)==null?void 0:a.call(o,{address:e.tokenAddress,abi:[{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],functionName:"allowance",args:[t,r],chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!r&&!!(o!=null&&o.useReadContract)}});return m.useEffect(()=>{i(e.tokenAddress,{balance:l,allowance:u})},[l,u,e.tokenAddress,i]),null},$l=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var g;const i=m.useMemo(()=>r.filter(v=>v.tokenAddress&&v.tokenAddress!=="0x0000000000000000000000000000000000000000"),[r]),[l,u]=m.useState({}),s=m.useCallback((v,S)=>{u(D=>({...D,[v]:S}))},[]),a=(g=o==null?void 0:o.useBalance)==null?void 0:g.call(o,{address:e,chainId:t,query:{enabled:!!e&&!!t&&!!(o!=null&&o.useBalance)}}),c=m.useMemo(()=>i.map(v=>m.createElement(Lm,{key:v.tokenAddress,token:v,account:e,chainId:t,contractAddress:n,wagmiHooks:o,onResult:s})),[i,e,t,n,o,s]),d=m.useMemo(()=>{if(!(o!=null&&o.useBalance))return{balanceList:[],allowanceList:[],baseTokenBalance:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},combinedData:{}};const v=a!=null&&a.data?{value:a.data.value,formatted:a.data.formatted,decimals:a.data.decimals,symbol:a.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},S=i.map(N=>{const F=l[N.tokenAddress],R=F==null?void 0:F.balance,B=R==null?void 0:R.data;return{address:N.tokenAddress,value:(B==null?void 0:B.value)||BigInt(0),formatted:(B==null?void 0:B.formatted)||"0",decimals:(B==null?void 0:B.decimals)||N.decimals}}).filter(N=>N.address),D=i.map(N=>{const F=l[N.tokenAddress],R=F==null?void 0:F.allowance,B=R==null?void 0:R.data,V=BigInt(B?B.toString():0);return{address:N.tokenAddress,value:V,formatted:(V/BigInt(10)**BigInt(N.decimals)).toString(),decimals:N.decimals}}).filter(N=>N.address),w=S.reduce((N,F)=>{const R=D.find(B=>B.address===F.address);return{...N,[F.address]:{balance:F,allowance:R||{address:F.address,value:BigInt(0),formatted:"0",decimals:F.decimals}}}},{});return{balanceList:S,allowanceList:D,baseTokenBalance:v,combinedData:w}},[a,l,i,o==null?void 0:o.useBalance]),p=m.useCallback(async()=>d,[d]),f=m.useMemo(()=>{const v=(a==null?void 0:a.isLoading)||!1,S=Object.values(l).some(D=>{var w,N;return((w=D.balance)==null?void 0:w.isLoading)||((N=D.allowance)==null?void 0:N.isLoading)});return v||S},[a==null?void 0:a.isLoading,l]);return{multicallRun:p,multicallResult:d,validErcTokens:i,isLoading:f,queryComponents:c}},Mm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",wagmiHooks:s,approved:a,onApproved:c,onDeposit:d,onClose:p,onChainChange:f,onTokenChange:g})=>{var _;const{t:v}=He(),[S,D]=m.useState(()=>{var W;return!e||e.length===0?1:t||((W=e[0])==null?void 0:W.chainId)||1}),[w,N]=m.useState(()=>{var Q;if(!e||e.length===0)return"";const W=t||((Q=e[0])==null?void 0:Q.chainId),k=e.find(Y=>Y.chainId===W);if(!k||!k.tokenList||k.tokenList.length===0)return"";const H=k.tokenList.find(Y=>Y.tokenAddress===n)||k.tokenList[0];return(H==null?void 0:H.token)||""}),[F,R]=m.useState(r),B=m.useCallback(W=>{D(W),f==null||f(W)},[f]),V=m.useCallback(W=>{N(W),g==null||g(W)},[g]),h=m.useRef(!0),x=m.useRef(w),b=m.useRef(S);m.useEffect(()=>{if(h.current){h.current=!1,x.current=w,b.current=S;return}(x.current!==w||b.current!==S)&&(R(""),x.current=w,b.current=S)},[w,S]);const A=e&&e.length>0?e.find(W=>W.chainId===S)||e[0]:null,T=(_=A==null?void 0:A.tokenList)==null?void 0:_.find(W=>W.token===w),$=o==null?void 0:o.getDisplayAddress(),{multicallResult:E,queryComponents:O}=$l({account:$,chainId:S,contractAddress:void 0,tokens:(A==null?void 0:A.tokenList)||[],wagmiHooks:s}),L=m.useMemo(()=>{var k;if(!T)return;if(!T.tokenAddress||T.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return E.baseTokenBalance.formatted;const W=E.combinedData[T.tokenAddress];return((k=W==null?void 0:W.balance)==null?void 0:k.formatted)||"0"},[T,E]),P=a??!1,y=m.useMemo(()=>{const W=parseFloat(F||"0"),k=10,H=L||"0",Q=ap(F,H,P);return!F||W===0||!P?{text:v("deposit.confirmDeposit"),disabled:!0}:W>parseFloat(H)?{text:"Insufficient Balance",disabled:!0}:W<k?{text:`Min Deposit ${k} ${w}`,disabled:!0}:{text:v("deposit.confirmDeposit"),disabled:!Q}},[F,w,L,P]),I=m.useCallback(async()=>{d&&d({amount:F,chainId:S,tokenAddress:(T==null?void 0:T.tokenAddress)||"",tokenSymbol:w})},[d,F,S,T==null?void 0:T.tokenAddress,w]);return!(s!=null&&s.useBalance)||!(s!=null&&s.useReadContract)||!(s!=null&&s.useAccount)?C.jsxs("div",{className:"p-6 text-center",children:[C.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),C.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):A?C.jsxs(C.Fragment,{children:[O,C.jsx(Kr,{currentActiveChain:A,chainList:e,onChainChange:B,curSelectToken:w,onTokenChange:V,walletType:"evm"}),C.jsx(Pm,{depositAmount:F,curSelectToken:w,curSelectTokenData:{balance:T==null?void 0:T.balance,allowance:T==null?void 0:T.allowance},approved:P,currentActiveChain:A,currentEquity:l||0,amount:F,decimals:(T==null?void 0:T.decimals)||6,tokenBalance:L,platformBalance:u,onDepositAmountChange:R,onApprove:async()=>{c&&await c()}}),C.jsx("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors ${y.disabled?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:I,disabled:y.disabled,children:y.text})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Pl=({isOpen:e,onClose:t,config:n,currentActiveAccount:r=Xr,smartWallet:o=Qr,chains:i,defaultChainId:l,defaultTokenAddress:u,defaultAmount:s="",metadata:a=Jr,currentEquity:c=5e3,platformBalance:d="0",wagmiHooks:p,approved:f,onApproved:g,onDeposit:v,onCopy:S,onChainChange:D,onTokenChange:w})=>{const{t:N}=He(),F=m.useMemo(()=>{var B;return r?Ro(r,o,!1,(B=i[0])==null?void 0:B.chainId,"0","0"):null},[r,o,i]),R=(F==null?void 0:F.getWalletType())==="mpc";return e?we.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{t()},"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:B=>{B.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:N("deposit.title")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:C.jsx(Fo,{className:"h-4 w-4"})})]}),R?C.jsx(Nm,{chains:i,defaultChainId:l,defaultTokenAddress:u,defaultAmount:s,walletAdapter:F,metadata:a,currentEquity:c,onDeposit:v,onCopy:S,onClose:t}):C.jsx(Mm,{chains:i,defaultChainId:l,defaultTokenAddress:u,defaultAmount:s,walletAdapter:F,metadata:a,currentEquity:c,platformBalance:d,wagmiHooks:p,approved:f,onApproved:g,onDeposit:v,onClose:t,onChainChange:D,onTokenChange:w})]})})}),document.body):null};let rt=null;const Dm={symbol:"USDT"},Ll=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState({chains:[]}),l=m.useCallback(c=>{i(c),r(!0)},[]),u=m.useCallback(c=>{i(d=>({...d,...c}))},[]),s=m.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),a=m.useCallback(()=>n,[n]);return m.useImperativeHandle(t,()=>({openDeposit:l,closeDeposit:s,updateDepositOptions:u,isOpen:a}),[l,s,u,a]),m.useEffect(()=>(rt={openDeposit:l,closeDeposit:s,updateDepositOptions:u,isOpen:a},()=>{rt=null}),[l,s,u,a]),C.jsx(Pl,{isOpen:n,onClose:s,config:o.config||Dm,currentActiveAccount:o.currentActiveAccount||Xr,smartWallet:o.smartWallet||Qr,chains:o.chains||fp,defaultChainId:o.defaultChainId,defaultTokenAddress:o.defaultTokenAddress,defaultAmount:o.defaultAmount,metadata:o.metadata||Jr,currentEquity:o.currentEquity??5e3,platformBalance:o.platformBalance||"0",wagmiHooks:o.wagmiHooks,approved:o.approved,onApproved:o.onApproved,onDeposit:o.onDeposit,onCopy:o.onCopy,onChainChange:o.onChainChange,onTokenChange:o.onTokenChange})});Ll.displayName="DepositManager";const Ml=e=>{if(!rt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}rt.openDeposit(e||{chains:[]})},Dl=()=>{if(!rt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}rt.closeDeposit()},Il=e=>{rt&&rt.updateDepositOptions(e)},Im=()=>rt?rt.isOpen():!1,Fm=()=>({openDeposit:Ml,closeDeposit:Dl,updateDepositOptions:Il,isOpen:Im});m.createContext(null);const jm=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_active)",children:C.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"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_active",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Rm=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_inactive)",children:C.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"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_inactive",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),zn=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,i)=>i+1);return C.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>C.jsx("div",{className:"flex items-center justify-center",children:o<=e?C.jsx(jm,{}):C.jsx(Rm,{})},o))})};class dt{}Me(dt,"FAST",3),Me(dt,"Medium",2),Me(dt,"SLOW",1),Me(dt,"NONE",0);const km=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",walletType:o="evm",receiverAddress:i="",onWithdrawAmountChange:l,onReceiverAddressChange:u})=>{const{t:s}=He(),a=p=>{const f=p.target.value,v=qr(f,r||"0");if(v.isValid)l(v.formattedValue),v.errorType;else return v.errorType==="exceed_balance",void 0},c=()=>{l(r)},d=()=>{const p=parseFloat(r||"0"),f=parseFloat(e||"0");if(f>0){const g=p-f,v=Ye(Math.max(0,g).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Ye(r||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),v," ",t]})}return`${Ye(r||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:s("deposit.amount"),value:e,onChange:a,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"}),C.jsx("button",{onClick:c,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:s("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(on,{content:s("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:s("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:d()})]})]}),o==="mpc"&&!At(n==null?void 0:n.chainId)&&C.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:C.jsx("input",{type:"text",placeholder:s("withdraw.receiverAddress"),value:i,onChange:p=>u==null?void 0:u(p.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"})}),C.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:At(n==null?void 0:n.chainId)?C.jsxs(C.Fragment,{children:[C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:s("withdraw.noticeDesc")}),C.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:s("withdraw.commonWithdraw")})]}):C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:s("withdraw.crossChainTips")})}),C.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-text-tertiary text-xs",children:s("withdraw.speed")}),C.jsx("div",{className:"flex items-center",children:C.jsx(on,{content:C.jsxs("div",{children:[C.jsx("div",{children:s("withdraw.speedNote")}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(zn,{selectedLevel:dt.FAST,maxLevel:3}),C.jsx("span",{children:s("withdraw.speedNoteSpeed1")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(zn,{selectedLevel:dt.Medium,maxLevel:3}),C.jsx("span",{children:s("withdraw.speedNoteSpeed2")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(zn,{selectedLevel:dt.SLOW,maxLevel:3}),C.jsx("span",{children:s("withdraw.speedNoteSpeed3")})]})]}),children:C.jsx(zn,{selectedLevel:At(n==null?void 0:n.chainId)?dt.SLOW:dt.FAST,maxLevel:3})})})]}),C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:"Amount to receive"}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Ye(e)," ",t]})]})]})]})},_m=[],Bm={};let Ne=null;const Fl=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1),[o,i]=m.useState(!1),[l,u]=m.useState({chains:[]}),s=m.useCallback(g=>{u(g||{chains:[]}),r(!0)},[]),a=m.useCallback(g=>{u(v=>({...v,...g}))},[]),c=m.useCallback(()=>{r(!1),i(!1),l.onClose&&l.onClose()},[l.onClose]),d=m.useCallback(g=>{i(g)},[]),p=m.useCallback(()=>n,[n]),f=m.useCallback(()=>o,[o]);return m.useImperativeHandle(t,()=>({openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Ne={openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{Ne=null}),[s,c,a,d,p,f]),C.jsx(_l,{isOpen:n,isLoading:o,onClose:c,config:l.config||{symbol:"USDT"},currentActiveAccount:l.currentActiveAccount,smartWallet:l.smartWallet,chains:l.chains||_m,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||Bm,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",wagmiHooks:l.wagmiHooks,onWithdraw:l.onWithdraw,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange})});Fl.displayName="WithdrawManager";const jl=e=>{if(!Ne){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ne.openWithdraw(e||{chains:[]})},Rl=()=>{if(!Ne){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ne.closeWithdraw()},kl=e=>{if(!Ne){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ne.updateWithdrawOptions(e)},yo=e=>{if(!Ne){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ne.setWithdrawLoading(e)},Wm=()=>Ne?Ne.isOpen():!1,Um=()=>Ne?Ne.isLoading():!1,Vm=()=>({openWithdraw:jl,closeWithdraw:Rl,updateWithdrawOptions:kl,setWithdrawLoading:yo,isOpen:Wm,isLoading:Um}),wo=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const i=t?`loading-${t}`:"",l=o?"loading-inline":"";return C.jsx("span",{className:`loading loading-${e} loading-spinner ${i} ${l} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},Hm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",isLoading:s=!1,wagmiHooks:a,onWithdraw:c,onClose:d,onChainChange:p,onTokenChange:f})=>{var W;const{t:g}=He(),[v,S]=m.useState(()=>{var k;return!e||e.length===0?1:t||((k=e[0])==null?void 0:k.chainId)||1}),[D,w]=m.useState(()=>{var Y;if(!e||e.length===0)return"";const k=t||((Y=e[0])==null?void 0:Y.chainId),H=e.find(K=>K.chainId===k);if(!H||!H.tokenList||H.tokenList.length===0)return"";const Q=H.tokenList.find(K=>K.tokenAddress===n)||H.tokenList[0];return(Q==null?void 0:Q.token)||""}),[N,F]=m.useState(r),[R,B]=m.useState(""),V=(o==null?void 0:o.getWalletType())||"evm",h=m.useCallback(k=>{S(k),p==null||p(k)},[p]),x=m.useCallback(k=>{w(k),f==null||f(k)},[f]),b=m.useRef(!0),A=m.useRef(D),T=m.useRef(v);m.useEffect(()=>{if(b.current){b.current=!1,A.current=D,T.current=v;return}(A.current!==D||T.current!==v)&&(F(""),A.current=D,T.current=v)},[D,v]);const $=e&&e.length>0?e.find(k=>k.chainId===v)||e[0]:null,E=(W=$==null?void 0:$.tokenList)==null?void 0:W.find(k=>k.token===D),O=o==null?void 0:o.getDisplayAddress(),{multicallResult:L,queryComponents:P}=$l({account:O,chainId:v,contractAddress:void 0,tokens:($==null?void 0:$.tokenList)||[],wagmiHooks:a}),y=m.useMemo(()=>{var H;if(!E)return;if(!E.tokenAddress||E.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return L.baseTokenBalance.formatted;const k=L.combinedData[E.tokenAddress];return((H=k==null?void 0:k.balance)==null?void 0:H.formatted)||"0"},[E,L]),I=m.useMemo(()=>{const k=parseFloat(N||"0");return!N||k===0?{text:g("withdraw.confirmWithdraw"),disabled:!0}:V==="mpc"&&!At(v)&&!R.trim()?{text:"Enter Receiver Address",disabled:!0}:{text:g("withdraw.confirmWithdraw"),disabled:!1}},[g,v,N,V,R]),_=m.useCallback(async()=>{yo(!0);try{if(c){const k={amount:N,chainId:v,tokenAddress:(E==null?void 0:E.tokenAddress)||"",tokenSymbol:D};V==="mpc"&&!At(v)&&(k.receiverAddress=R),c(k)}}catch(k){console.error("Withdraw error:",k),yo(!1)}},[c,N,v,E==null?void 0:E.tokenAddress,D,V,R]);return!(a!=null&&a.useBalance)||!(a!=null&&a.useReadContract)||!(a!=null&&a.useAccount)?C.jsxs("div",{className:"p-6 text-center",children:[C.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),C.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):$?C.jsxs(C.Fragment,{children:[P,C.jsx(Kr,{currentActiveChain:$,chainList:e,onChainChange:h,curSelectToken:D,onTokenChange:x,walletType:"evm"}),C.jsx(km,{withdrawAmount:N,curSelectToken:D,curSelectTokenData:{balance:E==null?void 0:E.balance,allowance:E==null?void 0:E.allowance},currentActiveChain:$,currentEquity:l||0,amount:N,decimals:(E==null?void 0:E.decimals)||6,tokenBalance:y,platformBalance:u,walletType:V,receiverAddress:R,onWithdrawAmountChange:F,onReceiverAddressChange:B}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${I.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:_,disabled:I.disabled||s,children:[s&&C.jsx(wo,{size:"xs"}),I.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},_l=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=Xr,smartWallet:i=Qr,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=Jr,currentEquity:d=5e3,platformBalance:p="0",wagmiHooks:f,onWithdraw:g,onChainChange:v,onTokenChange:S})=>{const{t:D}=He(),w=m.useMemo(()=>{var N;return o?Ro(o,i,!1,(N=l[0])==null?void 0:N.chainId,"0","0"):null},[o,i,l]);return e?we.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{n()},"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:N=>{N.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:D("withdraw.withdraw")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(Fo,{className:"h-4 w-4"})})]}),C.jsx(Hm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:w,metadata:c,currentEquity:d,platformBalance:p,isLoading:t,wagmiHooks:f,onWithdraw:g,onClose:n,onChainChange:v,onTokenChange:S})]})})}),document.body):null};Z.ChromeLoader=wo,Z.ComponentProvider=da,Z.DEFAULT_LOCALE=ln,Z.Deposit=Pl,Z.DepositManager=Ll,Z.LOCALE_NAMES=ua,Z.LoadingSpinner=wo,Z.SUPPORTED_LOCALES=Kn,Z.Tooltip=on,Z.Withdraw=_l,Z.WithdrawManager=Fl,Z.closeDeposit=Dl,Z.closeWithdraw=Rl,Z.openDeposit=Ml,Z.openWithdraw=jl,Z.updateDepositOptions=Il,Z.updateWithdrawOptions=kl,Z.useComponentConfig=Mo,Z.useDeposit=pa,Z.useDepositManager=Fm,Z.useTranslation=He,Z.useWithdraw=ma,Z.useWithdrawManager=Vm,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
120
120
  //# sourceMappingURL=index.umd.js.map