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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(J,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):(J=typeof globalThis<"u"?globalThis:J||self,m(J.EdgeXComponents={},J.React,J.ReactDOM))})(this,function(J,m,we){"use strict";var gh=Object.defineProperty;var vh=(J,m,we)=>m in J?gh(J,m,{enumerable:!0,configurable:!0,writable:!0,value:we}):J[m]=we;var Ie=(J,m,we)=>vh(J,typeof m!="symbol"?m+"":m,we);function Lo(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 k=Lo(m),Vt=Lo(we);function oa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xn={exports:{}},zt={};/**
1
+ (function(J,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):(J=typeof globalThis<"u"?globalThis:J||self,m(J.EdgeXComponents={},J.React,J.ReactDOM))})(this,function(J,m,we){"use strict";var bh=Object.defineProperty;var xh=(J,m,we)=>m in J?bh(J,m,{enumerable:!0,configurable:!0,writable:!0,value:we}):J[m]=we;var Ie=(J,m,we)=>xh(J,typeof m!="symbol"?m+"":m,we);function $o(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 R=$o(m),Vt=$o(we);function ia(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qn={exports:{}},zt={};/**
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 Ao;function ia(){if(Ao)return zt;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 zt.Fragment=n,zt.jsx=l,zt.jsxs=l,zt}var Ht={};/**
9
+ */var Do;function sa(){if(Do)return zt;Do=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 zt.Fragment=n,zt.jsx=l,zt.jsxs=l,zt}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 $o;function sa(){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 E(D){if(D===null||typeof D!="object")return null;var U=g&&D[g]||D[v];return typeof U=="function"?U:null}var M=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(D){{for(var U=arguments.length,Y=new Array(U>1?U-1:0),X=1;X<U;X++)Y[X-1]=arguments[X];N("error",D,Y)}}function N(D,U,Y){{var X=M.ReactDebugCurrentFrame,ie=X.getStackAddendum();ie!==""&&(U+="%s",Y=Y.concat([ie]));var le=Y.map(function(re){return String(re)});le.unshift("Warning: "+U),Function.prototype.apply.call(console[D],console,le)}}var j=!1,F=!1,R=!1,W=!1,h=!1,b;b=Symbol.for("react.module.reference");function x(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===i||h||D===o||D===a||D===c||W||D===f||j||F||R||typeof D=="object"&&D!==null&&(D.$$typeof===p||D.$$typeof===d||D.$$typeof===l||D.$$typeof===u||D.$$typeof===s||D.$$typeof===b||D.getModuleId!==void 0))}function $(D,U,Y){var X=D.displayName;if(X)return X;var ie=U.displayName||U.name||"";return ie!==""?Y+"("+ie+")":Y}function A(D){return D.displayName||"Context"}function P(D){if(D==null)return null;if(typeof D.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){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 D=="object")switch(D.$$typeof){case u:var U=D;return A(U)+".Consumer";case l:var Y=D;return A(Y._context)+".Provider";case s:return $(D,D.render,"ForwardRef");case d:var X=D.displayName||null;return X!==null?X:P(D.type)||"Memo";case p:{var ie=D,le=ie._payload,re=ie._init;try{return P(re(le))}catch{return null}}}return null}var S=Object.assign,O=0,T,L,y,I,_,V,z;function G(){}G.__reactDisabledLog=!0;function q(){{if(O===0){T=console.log,L=console.info,y=console.warn,I=console.error,_=console.group,V=console.groupCollapsed,z=console.groupEnd;var D={configurable:!0,enumerable:!0,value:G,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}O++}}function B(){{if(O--,O===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},D,{value:T}),info:S({},D,{value:L}),warn:S({},D,{value:y}),error:S({},D,{value:I}),group:S({},D,{value:_}),groupCollapsed:S({},D,{value:V}),groupEnd:S({},D,{value:z})})}O<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=M.ReactCurrentDispatcher,H;function Z(D,U,Y){{if(H===void 0)try{throw Error()}catch(ie){var X=ie.stack.trim().match(/\n( *(at )?)/);H=X&&X[1]||""}return`
18
- `+H+D}}var ae=!1,Ae;{var $e=typeof WeakMap=="function"?WeakMap:Map;Ae=new $e}function st(D,U){if(!D||ae)return"";{var Y=Ae.get(D);if(Y!==void 0)return Y}var X;ae=!0;var ie=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var le;le=K.current,K.current=null,q();try{if(U){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(De){X=De}Reflect.construct(D,[],re)}else{try{re.call()}catch(De){X=De}D.call(re.prototype)}}else{try{throw Error()}catch(De){X=De}D()}}catch(De){if(De&&X&&typeof De.stack=="string"){for(var te=De.stack.split(`
17
+ */var Mo;function la(){return Mo||(Mo=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 E(D){if(D===null||typeof D!="object")return null;var U=g&&D[g]||D[v];return typeof U=="function"?U:null}var M=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(D){{for(var U=arguments.length,Y=new Array(U>1?U-1:0),X=1;X<U;X++)Y[X-1]=arguments[X];N("error",D,Y)}}function N(D,U,Y){{var X=M.ReactDebugCurrentFrame,ie=X.getStackAddendum();ie!==""&&(U+="%s",Y=Y.concat([ie]));var le=Y.map(function(re){return String(re)});le.unshift("Warning: "+U),Function.prototype.apply.call(console[D],console,le)}}var j=!1,F=!1,k=!1,W=!1,h=!1,b;b=Symbol.for("react.module.reference");function x(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===i||h||D===o||D===a||D===c||W||D===f||j||F||k||typeof D=="object"&&D!==null&&(D.$$typeof===p||D.$$typeof===d||D.$$typeof===l||D.$$typeof===u||D.$$typeof===s||D.$$typeof===b||D.getModuleId!==void 0))}function $(D,U,Y){var X=D.displayName;if(X)return X;var ie=U.displayName||U.name||"";return ie!==""?Y+"("+ie+")":Y}function A(D){return D.displayName||"Context"}function P(D){if(D==null)return null;if(typeof D.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){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 D=="object")switch(D.$$typeof){case u:var U=D;return A(U)+".Consumer";case l:var Y=D;return A(Y._context)+".Provider";case s:return $(D,D.render,"ForwardRef");case d:var X=D.displayName||null;return X!==null?X:P(D.type)||"Memo";case p:{var ie=D,le=ie._payload,re=ie._init;try{return P(re(le))}catch{return null}}}return null}var S=Object.assign,O=0,T,L,y,I,_,V,z;function G(){}G.__reactDisabledLog=!0;function q(){{if(O===0){T=console.log,L=console.info,y=console.warn,I=console.error,_=console.group,V=console.groupCollapsed,z=console.groupEnd;var D={configurable:!0,enumerable:!0,value:G,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}O++}}function B(){{if(O--,O===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},D,{value:T}),info:S({},D,{value:L}),warn:S({},D,{value:y}),error:S({},D,{value:I}),group:S({},D,{value:_}),groupCollapsed:S({},D,{value:V}),groupEnd:S({},D,{value:z})})}O<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=M.ReactCurrentDispatcher,H;function Z(D,U,Y){{if(H===void 0)try{throw Error()}catch(ie){var X=ie.stack.trim().match(/\n( *(at )?)/);H=X&&X[1]||""}return`
18
+ `+H+D}}var ae=!1,Ae;{var $e=typeof WeakMap=="function"?WeakMap:Map;Ae=new $e}function it(D,U){if(!D||ae)return"";{var Y=Ae.get(D);if(Y!==void 0)return Y}var X;ae=!0;var ie=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var le;le=K.current,K.current=null,q();try{if(U){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(De){X=De}Reflect.construct(D,[],re)}else{try{re.call()}catch(De){X=De}D.call(re.prototype)}}else{try{throw Error()}catch(De){X=De}D()}}catch(De){if(De&&X&&typeof De.stack=="string"){for(var te=De.stack.split(`
19
19
  `),Se=X.stack.split(`
20
- `),pe=te.length-1,me=Se.length-1;pe>=1&&me>=0&&te[pe]!==Se[me];)me--;for(;pe>=1&&me>=0;pe--,me--)if(te[pe]!==Se[me]){if(pe!==1||me!==1)do if(pe--,me--,me<0||te[pe]!==Se[me]){var Ge=`
21
- `+te[pe].replace(" at new "," at ");return D.displayName&&Ge.includes("<anonymous>")&&(Ge=Ge.replace("<anonymous>",D.displayName)),typeof D=="function"&&Ae.set(D,Ge),Ge}while(pe>=1&&me>=0);break}}}finally{ae=!1,K.current=le,B(),Error.prepareStackTrace=ie}var Ut=D?D.displayName||D.name:"",At=Ut?Z(Ut):"";return typeof D=="function"&&Ae.set(D,At),At}function ye(D,U,Y){return st(D,!1)}function he(D){var U=D.prototype;return!!(U&&U.isReactComponent)}function se(D,U,Y){if(D==null)return"";if(typeof D=="function")return st(D,he(D));if(typeof D=="string")return Z(D);switch(D){case a:return Z("Suspense");case c:return Z("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case s:return ye(D.render);case d:return se(D.type,U,Y);case p:{var X=D,ie=X._payload,le=X._init;try{return se(le(ie),U,Y)}catch{}}}return""}var an=Object.prototype.hasOwnProperty,Vl={},zl=M.ReactDebugCurrentFrame;function qn(D){if(D){var U=D._owner,Y=se(D.type,D._source,U?U.type:null);zl.setExtraStackFrame(Y)}else zl.setExtraStackFrame(null)}function Km(D,U,Y,X,ie){{var le=Function.call.bind(an);for(var re in D)if(le(D,re)){var te=void 0;try{if(typeof D[re]!="function"){var Se=Error((X||"React class")+": "+Y+" type `"+re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Se.name="Invariant Violation",Se}te=D[re](U,re,X,Y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(pe){te=pe}te&&!(te instanceof Error)&&(qn(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).",X||"React class",Y,re,typeof te),qn(null)),te instanceof Error&&!(te.message in Vl)&&(Vl[te.message]=!0,qn(ie),w("Failed %s type: %s",Y,te.message),qn(null))}}}var qm=Array.isArray;function Co(D){return qm(D)}function Xm(D){{var U=typeof Symbol=="function"&&Symbol.toStringTag,Y=U&&D[Symbol.toStringTag]||D.constructor.name||"Object";return Y}}function Qm(D){try{return Hl(D),!1}catch{return!0}}function Hl(D){return""+D}function Gl(D){if(Qm(D))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xm(D)),Hl(D)}var Yl=M.ReactCurrentOwner,Jm={key:!0,ref:!0,__self:!0,__source:!0},Kl,ql;function Zm(D){if(an.call(D,"ref")){var U=Object.getOwnPropertyDescriptor(D,"ref").get;if(U&&U.isReactWarning)return!1}return D.ref!==void 0}function eh(D){if(an.call(D,"key")){var U=Object.getOwnPropertyDescriptor(D,"key").get;if(U&&U.isReactWarning)return!1}return D.key!==void 0}function th(D,U){typeof D.ref=="string"&&Yl.current}function nh(D,U){{var Y=function(){Kl||(Kl=!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))};Y.isReactWarning=!0,Object.defineProperty(D,"key",{get:Y,configurable:!0})}}function rh(D,U){{var Y=function(){ql||(ql=!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))};Y.isReactWarning=!0,Object.defineProperty(D,"ref",{get:Y,configurable:!0})}}var oh=function(D,U,Y,X,ie,le,re){var te={$$typeof:t,type:D,key:U,ref:Y,props:re,_owner:le};return te._store={},Object.defineProperty(te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.defineProperty(te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ie}),Object.freeze&&(Object.freeze(te.props),Object.freeze(te)),te};function ih(D,U,Y,X,ie){{var le,re={},te=null,Se=null;Y!==void 0&&(Gl(Y),te=""+Y),eh(U)&&(Gl(U.key),te=""+U.key),Zm(U)&&(Se=U.ref,th(U,ie));for(le in U)an.call(U,le)&&!Jm.hasOwnProperty(le)&&(re[le]=U[le]);if(D&&D.defaultProps){var pe=D.defaultProps;for(le in pe)re[le]===void 0&&(re[le]=pe[le])}if(te||Se){var me=typeof D=="function"?D.displayName||D.name||"Unknown":D;te&&nh(re,me),Se&&rh(re,me)}return oh(D,te,Se,ie,X,Yl.current,re)}}var Oo=M.ReactCurrentOwner,Xl=M.ReactDebugCurrentFrame;function Bt(D){if(D){var U=D._owner,Y=se(D.type,D._source,U?U.type:null);Xl.setExtraStackFrame(Y)}else Xl.setExtraStackFrame(null)}var To;To=!1;function No(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Ql(){{if(Oo.current){var D=P(Oo.current.type);if(D)return`
20
+ `),pe=te.length-1,me=Se.length-1;pe>=1&&me>=0&&te[pe]!==Se[me];)me--;for(;pe>=1&&me>=0;pe--,me--)if(te[pe]!==Se[me]){if(pe!==1||me!==1)do if(pe--,me--,me<0||te[pe]!==Se[me]){var He=`
21
+ `+te[pe].replace(" at new "," at ");return D.displayName&&He.includes("<anonymous>")&&(He=He.replace("<anonymous>",D.displayName)),typeof D=="function"&&Ae.set(D,He),He}while(pe>=1&&me>=0);break}}}finally{ae=!1,K.current=le,B(),Error.prepareStackTrace=ie}var Ut=D?D.displayName||D.name:"",At=Ut?Z(Ut):"";return typeof D=="function"&&Ae.set(D,At),At}function ye(D,U,Y){return it(D,!1)}function he(D){var U=D.prototype;return!!(U&&U.isReactComponent)}function se(D,U,Y){if(D==null)return"";if(typeof D=="function")return it(D,he(D));if(typeof D=="string")return Z(D);switch(D){case a:return Z("Suspense");case c:return Z("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case s:return ye(D.render);case d:return se(D.type,U,Y);case p:{var X=D,ie=X._payload,le=X._init;try{return se(le(ie),U,Y)}catch{}}}return""}var an=Object.prototype.hasOwnProperty,zl={},Hl=M.ReactDebugCurrentFrame;function Xn(D){if(D){var U=D._owner,Y=se(D.type,D._source,U?U.type:null);Hl.setExtraStackFrame(Y)}else Hl.setExtraStackFrame(null)}function Xm(D,U,Y,X,ie){{var le=Function.call.bind(an);for(var re in D)if(le(D,re)){var te=void 0;try{if(typeof D[re]!="function"){var Se=Error((X||"React class")+": "+Y+" type `"+re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Se.name="Invariant Violation",Se}te=D[re](U,re,X,Y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(pe){te=pe}te&&!(te instanceof Error)&&(Xn(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).",X||"React class",Y,re,typeof te),Xn(null)),te instanceof Error&&!(te.message in zl)&&(zl[te.message]=!0,Xn(ie),w("Failed %s type: %s",Y,te.message),Xn(null))}}}var Qm=Array.isArray;function To(D){return Qm(D)}function Jm(D){{var U=typeof Symbol=="function"&&Symbol.toStringTag,Y=U&&D[Symbol.toStringTag]||D.constructor.name||"Object";return Y}}function Zm(D){try{return Gl(D),!1}catch{return!0}}function Gl(D){return""+D}function Yl(D){if(Zm(D))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Jm(D)),Gl(D)}var Kl=M.ReactCurrentOwner,eh={key:!0,ref:!0,__self:!0,__source:!0},ql,Xl;function th(D){if(an.call(D,"ref")){var U=Object.getOwnPropertyDescriptor(D,"ref").get;if(U&&U.isReactWarning)return!1}return D.ref!==void 0}function nh(D){if(an.call(D,"key")){var U=Object.getOwnPropertyDescriptor(D,"key").get;if(U&&U.isReactWarning)return!1}return D.key!==void 0}function rh(D,U){typeof D.ref=="string"&&Kl.current}function oh(D,U){{var Y=function(){ql||(ql=!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))};Y.isReactWarning=!0,Object.defineProperty(D,"key",{get:Y,configurable:!0})}}function ih(D,U){{var Y=function(){Xl||(Xl=!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))};Y.isReactWarning=!0,Object.defineProperty(D,"ref",{get:Y,configurable:!0})}}var sh=function(D,U,Y,X,ie,le,re){var te={$$typeof:t,type:D,key:U,ref:Y,props:re,_owner:le};return te._store={},Object.defineProperty(te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.defineProperty(te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ie}),Object.freeze&&(Object.freeze(te.props),Object.freeze(te)),te};function lh(D,U,Y,X,ie){{var le,re={},te=null,Se=null;Y!==void 0&&(Yl(Y),te=""+Y),nh(U)&&(Yl(U.key),te=""+U.key),th(U)&&(Se=U.ref,rh(U,ie));for(le in U)an.call(U,le)&&!eh.hasOwnProperty(le)&&(re[le]=U[le]);if(D&&D.defaultProps){var pe=D.defaultProps;for(le in pe)re[le]===void 0&&(re[le]=pe[le])}if(te||Se){var me=typeof D=="function"?D.displayName||D.name||"Unknown":D;te&&oh(re,me),Se&&ih(re,me)}return sh(D,te,Se,ie,X,Kl.current,re)}}var No=M.ReactCurrentOwner,Ql=M.ReactDebugCurrentFrame;function Bt(D){if(D){var U=D._owner,Y=se(D.type,D._source,U?U.type:null);Ql.setExtraStackFrame(Y)}else Ql.setExtraStackFrame(null)}var Po;Po=!1;function Lo(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Jl(){{if(No.current){var D=P(No.current.type);if(D)return`
22
22
 
23
- Check the render method of \``+D+"`."}return""}}function sh(D){return""}var Jl={};function lh(D){{var U=Ql();if(!U){var Y=typeof D=="string"?D:D.displayName||D.name;Y&&(U=`
23
+ Check the render method of \``+D+"`."}return""}}function ah(D){return""}var Zl={};function uh(D){{var U=Jl();if(!U){var Y=typeof D=="string"?D:D.displayName||D.name;Y&&(U=`
24
24
 
25
- Check the top-level render call using <`+Y+">.")}return U}}function Zl(D,U){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var Y=lh(U);if(Jl[Y])return;Jl[Y]=!0;var X="";D&&D._owner&&D._owner!==Oo.current&&(X=" It was passed a child from "+P(D._owner.type)+"."),Bt(D),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Y,X),Bt(null)}}function ea(D,U){{if(typeof D!="object")return;if(Co(D))for(var Y=0;Y<D.length;Y++){var X=D[Y];No(X)&&Zl(X,U)}else if(No(D))D._store&&(D._store.validated=!0);else if(D){var ie=E(D);if(typeof ie=="function"&&ie!==D.entries)for(var le=ie.call(D),re;!(re=le.next()).done;)No(re.value)&&Zl(re.value,U)}}}function ah(D){{var U=D.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 X=P(U);Km(Y,D.props,"prop",X,D)}else if(U.PropTypes!==void 0&&!To){To=!0;var ie=P(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 uh(D){{for(var U=Object.keys(D.props),Y=0;Y<U.length;Y++){var X=U[Y];if(X!=="children"&&X!=="key"){Bt(D),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",X),Bt(null);break}}D.ref!==null&&(Bt(D),w("Invalid attribute `ref` supplied to `React.Fragment`."),Bt(null))}}var ta={};function na(D,U,Y,X,ie,le){{var re=x(D);if(!re){var te="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(te+=" 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=sh();Se?te+=Se:te+=Ql();var pe;D===null?pe="null":Co(D)?pe="array":D!==void 0&&D.$$typeof===t?(pe="<"+(P(D.type)||"Unknown")+" />",te=" Did you accidentally export a JSX literal instead of a component?"):pe=typeof D,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,te)}var me=ih(D,U,Y,ie,le);if(me==null)return me;if(re){var Ge=U.children;if(Ge!==void 0)if(X)if(Co(Ge)){for(var Ut=0;Ut<Ge.length;Ut++)ea(Ge[Ut],D);Object.freeze&&Object.freeze(Ge)}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 ea(Ge,D)}if(an.call(U,"key")){var At=P(D),De=Object.keys(U).filter(function(hh){return hh!=="key"}),Po=De.length>0?"{key: someKey, "+De.join(": ..., ")+": ...}":"{key: someKey}";if(!ta[At+Po]){var mh=De.length>0?"{"+De.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+Y+">.")}return U}}function ea(D,U){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var Y=uh(U);if(Zl[Y])return;Zl[Y]=!0;var X="";D&&D._owner&&D._owner!==No.current&&(X=" It was passed a child from "+P(D._owner.type)+"."),Bt(D),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Y,X),Bt(null)}}function ta(D,U){{if(typeof D!="object")return;if(To(D))for(var Y=0;Y<D.length;Y++){var X=D[Y];Lo(X)&&ea(X,U)}else if(Lo(D))D._store&&(D._store.validated=!0);else if(D){var ie=E(D);if(typeof ie=="function"&&ie!==D.entries)for(var le=ie.call(D),re;!(re=le.next()).done;)Lo(re.value)&&ea(re.value,U)}}}function ch(D){{var U=D.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 X=P(U);Xm(Y,D.props,"prop",X,D)}else if(U.PropTypes!==void 0&&!Po){Po=!0;var ie=P(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 fh(D){{for(var U=Object.keys(D.props),Y=0;Y<U.length;Y++){var X=U[Y];if(X!=="children"&&X!=="key"){Bt(D),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",X),Bt(null);break}}D.ref!==null&&(Bt(D),w("Invalid attribute `ref` supplied to `React.Fragment`."),Bt(null))}}var na={};function ra(D,U,Y,X,ie,le){{var re=x(D);if(!re){var te="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(te+=" 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=ah();Se?te+=Se:te+=Jl();var pe;D===null?pe="null":To(D)?pe="array":D!==void 0&&D.$$typeof===t?(pe="<"+(P(D.type)||"Unknown")+" />",te=" Did you accidentally export a JSX literal instead of a component?"):pe=typeof D,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,te)}var me=lh(D,U,Y,ie,le);if(me==null)return me;if(re){var He=U.children;if(He!==void 0)if(X)if(To(He)){for(var Ut=0;Ut<He.length;Ut++)ta(He[Ut],D);Object.freeze&&Object.freeze(He)}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 ta(He,D)}if(an.call(U,"key")){var At=P(D),De=Object.keys(U).filter(function(vh){return vh!=="key"}),Ao=De.length>0?"{key: someKey, "+De.join(": ..., ")+": ...}":"{key: someKey}";if(!na[At+Ao]){var gh=De.length>0?"{"+De.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} />`,Po,At,mh,At),ta[At+Po]=!0}}return D===r?uh(me):ah(me),me}}function ch(D,U,Y){return na(D,U,Y,!0)}function fh(D,U,Y){return na(D,U,Y,!1)}var dh=fh,ph=ch;Ht.Fragment=r,Ht.jsx=dh,Ht.jsxs=ph}()),Ht}process.env.NODE_ENV==="production"?Xn.exports=ia():Xn.exports=sa();var C=Xn.exports;const la={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",arrivalTime:"到账时间",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",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或负数时,不允许提现。",noPrivateKeyWalletWarning:"暂不支持无私钥钱包充值。若您是无私钥钱包,请勿进行充值。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",withdrawlAmount:"提现金额",amountToReceive:"到账金额",invalidReceiverAddress:"接收地址不合法"}},aa={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",max:"Max",arrivalTime:"Arrival Time",minDeposit:"Minimum Deposit Amount",minDepositParsed:"Min. Deposit {{amount}} {{token}}",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.",noPrivateKeyWalletWarning:"Deposits from wallets without private keys are not supported at the moment. If you are using such a wallet, please do not make a deposit."},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",invalidReceiverAddress:"Invalid receiver address"}},ua={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",arrivalTime:"着金予定時間",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",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またはマイナスの場合、出金は行えません。",noPrivateKeyWalletWarning:"現在、秘密鍵のないウォレットからの入金はサポートされていません。該当ウォレットをご利用の場合は、入金しないでください。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",invalidReceiverAddress:"無効な受け取りアドレス"}},ca={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",arrivalTime:"Время поступления",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",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 или меньше, вывод невозможен.",noPrivateKeyWalletWarning:"В настоящее время пополнение кошельков без приватных ключей не поддерживается. Если у вас такой кошелёк, пожалуйста, не выполняйте пополнение."},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",invalidReceiverAddress:"Неверный адрес получателя"}},fa={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",arrivalTime:"到帳時間",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",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或負數時,不允許提現。",noPrivateKeyWalletWarning:"暫不支援無私鑰錢包充值。若您使用的是無私鑰錢包,請勿進行充值。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",withdrawlAmount:"提現金額",amountToReceive:"到账金額",invalidReceiverAddress:"接收地址不合法"}},Qn=["en-US","ja-JP","ru-RU","zh-CN","zh-TW"],Do={"en-US":aa,"ja-JP":ua,"ru-RU":ca,"zh-CN":la,"zh-TW":fa},un="en-US",da={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},pa=e=>Qn.includes(e)?Do[e]:Do[un],ma=e=>Qn.includes(e),Mo=m.createContext(null),ha=({config:e,children:t})=>{const n=m.useMemo(()=>{const r=e.locale||un,o=ma(r)?r:un,i=pa(o);return{...e,currentLocale:o,translations:i}},[e]);return C.jsx(Mo.Provider,{value:n,children:t})},Io=()=>{const e=m.useContext(Mo);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var ga=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Jn=Math.ceil,je=Math.floor,Ce="[BigNumber Error] ",jo=Ce+"Number primitive has more than 15 significant digits: ",Ye=1e14,Q=14,Zn=9007199254740991,er=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ht=1e7,ge=1e9;function Fo(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:""},E="0123456789abcdefghijklmnopqrstuvwxyz",M=!0;function w(h,b){var x,$,A,P,S,O,T,L,y=this;if(!(y instanceof w))return new w(h,b);if(b==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(P=0,S=h;S>=10;S/=10,P++);P>d?y.c=y.e=null:(y.e=P,y.c=[h]);return}L=String(h)}else{if(!ga.test(L=String(h)))return r(y,L,O);y.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(P=L.indexOf("."))>-1&&(L=L.replace(".","")),(S=L.search(/e/i))>0?(P<0&&(P=S),P+=+L.slice(S+1),L=L.substring(0,S)):P<0&&(P=L.length)}else{if(ce(b,2,E.length,"Base"),b==10&&M)return y=new w(h),R(y,l+y.e+1,u);if(L=String(h),O=typeof h=="number"){if(h*0!=0)return r(y,L,O,b);if(y.s=1/h<0?(L=L.slice(1),-1):1,w.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(jo+h)}else y.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(x=E.slice(0,b),P=S=0,T=L.length;S<T;S++)if(x.indexOf($=L.charAt(S))<0){if($=="."){if(S>P){P=T;continue}}else if(!A&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){A=!0,S=-1,P=0;continue}return r(y,String(h),O,b)}O=!1,L=n(L,b,10,y.s),(P=L.indexOf("."))>-1?L=L.replace(".",""):P=L.length}for(S=0;L.charCodeAt(S)===48;S++);for(T=L.length;L.charCodeAt(--T)===48;);if(L=L.slice(S,++T)){if(T-=S,O&&w.DEBUG&&T>15&&(h>Zn||h!==je(h)))throw Error(jo+y.s*h);if((P=P-S-1)>d)y.c=y.e=null;else if(P<c)y.c=[y.e=0];else{if(y.e=P,y.c=[],S=(P+1)%Q,P<0&&(S+=Q),S<T){for(S&&y.c.push(+L.slice(0,S)),T-=Q;S<T;)y.c.push(+L.slice(S,S+=Q));S=Q-(L=L.slice(S)).length}else S-=T;for(;S--;L+="0");y.c.push(+L)}}else y.c=[y.e=0]}w.clone=Fo,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 b,x;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(b="DECIMAL_PLACES")&&(x=h[b],ce(x,0,ge,b),l=x),h.hasOwnProperty(b="ROUNDING_MODE")&&(x=h[b],ce(x,0,8,b),u=x),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(x=h[b],x&&x.pop?(ce(x[0],-ge,0,b),ce(x[1],0,ge,b),s=x[0],a=x[1]):(ce(x,-ge,ge,b),s=-(a=x<0?-x:x))),h.hasOwnProperty(b="RANGE"))if(x=h[b],x&&x.pop)ce(x[0],-ge,-1,b),ce(x[1],1,ge,b),c=x[0],d=x[1];else if(ce(x,-ge,ge,b),x)c=-(d=x<0?-x:x);else throw Error(Ce+b+" cannot be zero: "+x);if(h.hasOwnProperty(b="CRYPTO"))if(x=h[b],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=x;else throw p=!x,Error(Ce+"crypto unavailable");else p=x;else throw Error(Ce+b+" not true or false: "+x);if(h.hasOwnProperty(b="MODULO_MODE")&&(x=h[b],ce(x,0,9,b),f=x),h.hasOwnProperty(b="POW_PRECISION")&&(x=h[b],ce(x,0,ge,b),g=x),h.hasOwnProperty(b="FORMAT"))if(x=h[b],typeof x=="object")v=x;else throw Error(Ce+b+" not an object: "+x);if(h.hasOwnProperty(b="ALPHABET"))if(x=h[b],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))M=x.slice(0,10)=="0123456789",E=x;else throw Error(Ce+b+" invalid: "+x)}else throw Error(Ce+"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:E}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var b,x,$=h.c,A=h.e,P=h.s;e:if({}.toString.call($)=="[object Array]"){if((P===1||P===-1)&&A>=-ge&&A<=ge&&A===je(A)){if($[0]===0){if(A===0&&$.length===1)return!0;break e}if(b=(A+1)%Q,b<1&&(b+=Q),String($[0]).length==b){for(b=0;b<$.length;b++)if(x=$[b],x<0||x>=Ye||x!==je(x))break e;if(x!==0)return!0}}}else if($===null&&A===null&&(P===null||P===1||P===-1))return!0;throw Error(Ce+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return j(arguments,-1)},w.minimum=w.min=function(){return j(arguments,1)},w.random=function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return je(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var $,A,P,S,O,T=0,L=[],y=new w(i);if(x==null?x=l:ce(x,0,ge),S=Jn(x/Q),p)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(S*=2));T<S;)O=$[T]*131072+($[T+1]>>>11),O>=9e15?(A=crypto.getRandomValues(new Uint32Array(2)),$[T]=A[0],$[T+1]=A[1]):(L.push(O%1e14),T+=2);T=S/2}else if(crypto.randomBytes){for($=crypto.randomBytes(S*=7);T<S;)O=($[T]&31)*281474976710656+$[T+1]*1099511627776+$[T+2]*4294967296+$[T+3]*16777216+($[T+4]<<16)+($[T+5]<<8)+$[T+6],O>=9e15?crypto.randomBytes(7).copy($,T):(L.push(O%1e14),T+=7);T=S/7}else throw p=!1,Error(Ce+"crypto unavailable");if(!p)for(;T<S;)O=b(),O<9e15&&(L[T++]=O%1e14);for(S=L[--T],x%=Q,S&&x&&(O=er[Q-x],L[T]=je(S/O)*O);L[T]===0;L.pop(),T--);if(T<0)L=[P=0];else{for(P=-1;L[0]===0;L.splice(0,1),P-=Q);for(T=1,O=L[0];O>=10;O/=10,T++);T<Q&&(P-=Q-T)}return y.e=P,y.c=L,y}}(),w.sum=function(){for(var h=1,b=arguments,x=new w(b[0]);h<b.length;)x=x.plus(b[h++]);return x},n=function(){var h="0123456789";function b(x,$,A,P){for(var S,O=[0],T,L=0,y=x.length;L<y;){for(T=O.length;T--;O[T]*=$);for(O[0]+=P.indexOf(x.charAt(L++)),S=0;S<O.length;S++)O[S]>A-1&&(O[S+1]==null&&(O[S+1]=0),O[S+1]+=O[S]/A|0,O[S]%=A)}return O.reverse()}return function(x,$,A,P,S){var O,T,L,y,I,_,V,z,G=x.indexOf("."),q=l,B=u;for(G>=0&&(y=g,g=0,x=x.replace(".",""),z=new w($),_=z.pow(x.length-G),g=y,z.c=b(lt(ke(_.c),_.e,"0"),10,A,h),z.e=z.c.length),V=b(x,$,A,S?(O=E,h):(O=h,E)),L=y=V.length;V[--y]==0;V.pop());if(!V[0])return O.charAt(0);if(G<0?--L:(_.c=V,_.e=L,_.s=P,_=t(_,z,q,B,A),V=_.c,I=_.r,L=_.e),T=L+q+1,G=V[T],y=A/2,I=I||T<0||V[T+1]!=null,I=B<4?(G!=null||I)&&(B==0||B==(_.s<0?3:2)):G>y||G==y&&(B==4||I||B==6&&V[T-1]&1||B==(_.s<0?8:7)),T<1||!V[0])x=I?lt(O.charAt(1),-q,O.charAt(0)):O.charAt(0);else{if(V.length=T,I)for(--A;++V[--T]>A;)V[T]=0,T||(++L,V=[1].concat(V));for(y=V.length;!V[--y];);for(G=0,x="";G<=y;x+=O.charAt(V[G++]));x=lt(x,L,O.charAt(0))}return x}}(),t=function(){function h($,A,P){var S,O,T,L,y=0,I=$.length,_=A%ht,V=A/ht|0;for($=$.slice();I--;)T=$[I]%ht,L=$[I]/ht|0,S=V*T+L*_,O=_*T+S%ht*ht+y,y=(O/P|0)+(S/ht|0)+V*L,$[I]=O%P;return y&&($=[y].concat($)),$}function b($,A,P,S){var O,T;if(P!=S)T=P>S?1:-1;else for(O=T=0;O<P;O++)if($[O]!=A[O]){T=$[O]>A[O]?1:-1;break}return T}function x($,A,P,S){for(var O=0;P--;)$[P]-=O,O=$[P]<A[P]?1:0,$[P]=O*S+$[P]-A[P];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,A,P,S,O){var T,L,y,I,_,V,z,G,q,B,K,H,Z,ae,Ae,$e,st,ye=$.s==A.s?1:-1,he=$.c,se=A.c;if(!he||!he[0]||!se||!se[0])return new w(!$.s||!A.s||(he?se&&he[0]==se[0]:!se)?NaN:he&&he[0]==0||!se?ye*0:ye/0);for(G=new w(ye),q=G.c=[],L=$.e-A.e,ye=P+L+1,O||(O=Ye,L=Fe($.e/Q)-Fe(A.e/Q),ye=ye/Q|0),y=0;se[y]==(he[y]||0);y++);if(se[y]>(he[y]||0)&&L--,ye<0)q.push(1),I=!0;else{for(ae=he.length,$e=se.length,y=0,ye+=2,_=je(O/(se[0]+1)),_>1&&(se=h(se,_,O),he=h(he,_,O),$e=se.length,ae=he.length),Z=$e,B=he.slice(0,$e),K=B.length;K<$e;B[K++]=0);st=se.slice(),st=[0].concat(st),Ae=se[0],se[1]>=O/2&&Ae++;do{if(_=0,T=b(se,B,$e,K),T<0){if(H=B[0],$e!=K&&(H=H*O+(B[1]||0)),_=je(H/Ae),_>1)for(_>=O&&(_=O-1),V=h(se,_,O),z=V.length,K=B.length;b(V,B,z,K)==1;)_--,x(V,$e<z?st:se,z,O),z=V.length,T=1;else _==0&&(T=_=1),V=se.slice(),z=V.length;if(z<K&&(V=[0].concat(V)),x(B,V,K,O),K=B.length,T==-1)for(;b(se,B,$e,K)<1;)_++,x(B,$e<K?st:se,K,O),K=B.length}else T===0&&(_++,B=[0]);q[y++]=_,B[0]?B[K++]=he[Z]||0:(B=[he[Z]],K=1)}while((Z++<ae||B[0]!=null)&&ye--);I=B[0]!=null,q[0]||q.splice(0,1)}if(O==Ye){for(y=1,ye=q[0];ye>=10;ye/=10,y++);R(G,P+(G.e=y+L*Q-1)+1,S,I)}else G.e=L,G.r=+I;return G}}();function N(h,b,x,$){var A,P,S,O,T;if(x==null?x=u:ce(x,0,8),!h.c)return h.toString();if(A=h.c[0],S=h.e,b==null)T=ke(h.c),T=$==1||$==2&&(S<=s||S>=a)?fn(T,S):lt(T,S,"0");else if(h=R(new w(h),b,x),P=h.e,T=ke(h.c),O=T.length,$==1||$==2&&(b<=P||P<=s)){for(;O<b;T+="0",O++);T=fn(T,P)}else if(b-=S+($===2&&P>S),T=lt(T,P,"0"),P+1>O){if(--b>0)for(T+=".";b--;T+="0");}else if(b+=P-O,b>0)for(P+1==O&&(T+=".");b--;T+="0");return h.s<0&&A?"-"+T:T}function j(h,b){for(var x,$,A=1,P=new w(h[0]);A<h.length;A++)$=new w(h[A]),(!$.s||(x=Et(P,$))===b||x===0&&P.s===b)&&(P=$);return P}function F(h,b,x){for(var $=1,A=b.length;!b[--A];b.pop());for(A=b[0];A>=10;A/=10,$++);return(x=$+x*Q-1)>d?h.c=h.e=null:x<c?h.c=[h.e=0]:(h.e=x,h.c=b),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,x=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(P,S,O,T){var L,y=O?S:S.replace(A,"");if($.test(y))P.s=isNaN(y)?null:y<0?-1:1;else{if(!O&&(y=y.replace(h,function(I,_,V){return L=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!T||T==L?_:I}),T&&(L=T,y=y.replace(b,"$1").replace(x,"0.$1")),S!=y))return new w(y,L);if(w.DEBUG)throw Error(Ce+"Not a"+(T?" base "+T:"")+" number: "+S);P.s=null}P.c=P.e=null}}();function R(h,b,x,$){var A,P,S,O,T,L,y,I=h.c,_=er;if(I){e:{for(A=1,O=I[0];O>=10;O/=10,A++);if(P=b-A,P<0)P+=Q,S=b,T=I[L=0],y=je(T/_[A-S-1]%10);else if(L=Jn((P+1)/Q),L>=I.length)if($){for(;I.length<=L;I.push(0));T=y=0,A=1,P%=Q,S=P-Q+1}else break e;else{for(T=O=I[L],A=1;O>=10;O/=10,A++);P%=Q,S=P-Q+A,y=S<0?0:je(T/_[A-S-1]%10)}if($=$||b<0||I[L+1]!=null||(S<0?T:T%_[A-S-1]),$=x<4?(y||$)&&(x==0||x==(h.s<0?3:2)):y>5||y==5&&(x==4||$||x==6&&(P>0?S>0?T/_[A-S]:0:I[L-1])%10&1||x==(h.s<0?8:7)),b<1||!I[0])return I.length=0,$?(b-=h.e+1,I[0]=_[(Q-b%Q)%Q],h.e=-b||0):I[0]=h.e=0,h;if(P==0?(I.length=L,O=1,L--):(I.length=L+1,O=_[Q-P],I[L]=S>0?je(T/_[A-S]%_[S])*O:0),$)for(;;)if(L==0){for(P=1,S=I[0];S>=10;S/=10,P++);for(S=I[0]+=O,O=1;S>=10;S/=10,O++);P!=O&&(h.e++,I[0]==Ye&&(I[0]=1));break}else{if(I[L]+=O,I[L]!=Ye)break;I[L--]=0,O=1}for(P=I.length;I[--P]===0;I.pop());}h.e>d?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function W(h){var b,x=h.e;return x===null?h.toString():(b=ke(h.c),b=x<=s||x>=a?fn(b,x):lt(b,x,"0"),h.s<0?"-"+b:b)}return o.absoluteValue=o.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,b){return Et(this,new w(h,b))},o.decimalPlaces=o.dp=function(h,b){var x,$,A,P=this;if(h!=null)return ce(h,0,ge),b==null?b=u:ce(b,0,8),R(new w(P),h+P.e+1,b);if(!(x=P.c))return null;if($=((A=x.length-1)-Fe(this.e/Q))*Q,A=x[A])for(;A%10==0;A/=10,$--);return $<0&&($=0),$},o.dividedBy=o.div=function(h,b){return t(this,new w(h,b),l,u)},o.dividedToIntegerBy=o.idiv=function(h,b){return t(this,new w(h,b),0,1)},o.exponentiatedBy=o.pow=function(h,b){var x,$,A,P,S,O,T,L,y,I=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Ce+"Exponent not an integer: "+W(h));if(b!=null&&(b=new w(b)),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(+W(I),O?h.s*(2-cn(h)):+W(h))),b?y.mod(b):y;if(T=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new w(NaN);$=!T&&I.isInteger()&&b.isInteger(),$&&(I=I.mod(b))}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 P=I.s<0&&cn(h)?-0:0,I.e>-1&&(P=1/P),new w(T?1/P:P);g&&(P=Jn(g/Q+2))}for(O?(x=new w(.5),T&&(h.s=1),L=cn(h)):(A=Math.abs(+W(h)),L=A%2),y=new w(i);;){if(L){if(y=y.times(I),!y.c)break;P?y.c.length>P&&(y.c.length=P):$&&(y=y.mod(b))}if(A){if(A=je(A/2),A===0)break;L=A%2}else if(h=h.times(x),R(h,h.e+1,1),h.e>14)L=cn(h);else{if(A=+W(h),A===0)break;L=A%2}I=I.times(I),P?I.c&&I.c.length>P&&(I.c.length=P):$&&(I=I.mod(b))}return $?y:(T&&(y=i.div(y)),b?y.mod(b):P?R(y,g,u,S):y)},o.integerValue=function(h){var b=new w(this);return h==null?h=u:ce(h,0,8),R(b,b.e+1,h)},o.isEqualTo=o.eq=function(h,b){return Et(this,new w(h,b))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,b){return Et(this,new w(h,b))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,b){return(b=Et(this,new w(h,b)))===1||b===0},o.isInteger=function(){return!!this.c&&Fe(this.e/Q)>this.c.length-2},o.isLessThan=o.lt=function(h,b){return Et(this,new w(h,b))<0},o.isLessThanOrEqualTo=o.lte=function(h,b){return(b=Et(this,new w(h,b)))===-1||b===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,b){var x,$,A,P,S=this,O=S.s;if(h=new w(h,b),b=h.s,!O||!b)return new w(NaN);if(O!=b)return h.s=-b,S.plus(h);var T=S.e/Q,L=h.e/Q,y=S.c,I=h.c;if(!T||!L){if(!y||!I)return y?(h.s=-b,h):new w(I?S:NaN);if(!y[0]||!I[0])return I[0]?(h.s=-b,h):new w(y[0]?S:u==3?-0:0)}if(T=Fe(T),L=Fe(L),y=y.slice(),O=T-L){for((P=O<0)?(O=-O,A=y):(L=T,A=I),A.reverse(),b=O;b--;A.push(0));A.reverse()}else for($=(P=(O=y.length)<(b=I.length))?O:b,O=b=0;b<$;b++)if(y[b]!=I[b]){P=y[b]<I[b];break}if(P&&(A=y,y=I,I=A,h.s=-h.s),b=($=I.length)-(x=y.length),b>0)for(;b--;y[x++]=0);for(b=Ye-1;$>O;){if(y[--$]<I[$]){for(x=$;x&&!y[--x];y[x]=b);--y[x],y[$]+=Ye}y[$]-=I[$]}for(;y[0]==0;y.splice(0,1),--L);return y[0]?F(h,y,L):(h.s=u==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,b){var x,$,A=this;return h=new w(h,b),!A.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||A.c&&!A.c[0]?new w(A):(f==9?($=h.s,h.s=1,x=t(A,h,0,3),h.s=$,x.s*=$):x=t(A,h,0,f),h=A.minus(x.times(h)),!h.c[0]&&f==1&&(h.s=A.s),h)},o.multipliedBy=o.times=function(h,b){var x,$,A,P,S,O,T,L,y,I,_,V,z,G,q,B=this,K=B.c,H=(h=new w(h,b)).c;if(!K||!H||!K[0]||!H[0])return!B.s||!h.s||K&&!K[0]&&!H||H&&!H[0]&&!K?h.c=h.e=h.s=null:(h.s*=B.s,!K||!H?h.c=h.e=null:(h.c=[0],h.e=0)),h;for($=Fe(B.e/Q)+Fe(h.e/Q),h.s*=B.s,T=K.length,I=H.length,T<I&&(z=K,K=H,H=z,A=T,T=I,I=A),A=T+I,z=[];A--;z.push(0));for(G=Ye,q=ht,A=I;--A>=0;){for(x=0,_=H[A]%q,V=H[A]/q|0,S=T,P=A+S;P>A;)L=K[--S]%q,y=K[S]/q|0,O=V*L+y*_,L=_*L+O%q*q+z[P]+x,x=(L/G|0)+(O/q|0)+V*y,z[P--]=L%G;z[P]=x}return x?++$:z.splice(0,1),F(h,z,$)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,b){var x,$=this,A=$.s;if(h=new w(h,b),b=h.s,!A||!b)return new w(NaN);if(A!=b)return h.s=-b,$.minus(h);var P=$.e/Q,S=h.e/Q,O=$.c,T=h.c;if(!P||!S){if(!O||!T)return new w(A/0);if(!O[0]||!T[0])return T[0]?h:new w(O[0]?$:A*0)}if(P=Fe(P),S=Fe(S),O=O.slice(),A=P-S){for(A>0?(S=P,x=T):(A=-A,x=O),x.reverse();A--;x.push(0));x.reverse()}for(A=O.length,b=T.length,A-b<0&&(x=T,T=O,O=x,b=A),A=0;b;)A=(O[--b]=O[b]+T[b]+A)/Ye|0,O[b]=Ye===O[b]?0:O[b]%Ye;return A&&(O=[A].concat(O),++S),F(h,O,S)},o.precision=o.sd=function(h,b){var x,$,A,P=this;if(h!=null&&h!==!!h)return ce(h,1,ge),b==null?b=u:ce(b,0,8),R(new w(P),h,b);if(!(x=P.c))return null;if(A=x.length-1,$=A*Q+1,A=x[A]){for(;A%10==0;A/=10,$--);for(A=x[0];A>=10;A/=10,$++);}return h&&P.e+1>$&&($=P.e+1),$},o.shiftedBy=function(h){return ce(h,-Zn,Zn),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,b,x,$,A,P=this,S=P.c,O=P.s,T=P.e,L=l+4,y=new w("0.5");if(O!==1||!S||!S[0])return new w(!O||O<0&&(!S||S[0])?NaN:S?P:1/0);if(O=Math.sqrt(+W(P)),O==0||O==1/0?(b=ke(S),(b.length+T)%2==0&&(b+="0"),O=Math.sqrt(+b),T=Fe((T+1)/2)-(T<0||T%2),O==1/0?b="5e"+T:(b=O.toExponential(),b=b.slice(0,b.indexOf("e")+1)+T),x=new w(b)):x=new w(O+""),x.c[0]){for(T=x.e,O=T+L,O<3&&(O=0);;)if(A=x,x=y.times(A.plus(t(P,A,L,1))),ke(A.c).slice(0,O)===(b=ke(x.c)).slice(0,O))if(x.e<T&&--O,b=b.slice(O-3,O+1),b=="9999"||!$&&b=="4999"){if(!$&&(R(A,A.e+l+2,0),A.times(A).eq(P))){x=A;break}L+=4,O+=4,$=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(R(x,x.e+l+2,1),h=!x.times(x).eq(P));break}}return R(x,x.e+l+1,u,h)},o.toExponential=function(h,b){return h!=null&&(ce(h,0,ge),h++),N(this,h,b,1)},o.toFixed=function(h,b){return h!=null&&(ce(h,0,ge),h=h+this.e+1),N(this,h,b)},o.toFormat=function(h,b,x){var $,A=this;if(x==null)h!=null&&b&&typeof b=="object"?(x=b,b=null):h&&typeof h=="object"?(x=h,h=b=null):x=v;else if(typeof x!="object")throw Error(Ce+"Argument not an object: "+x);if($=A.toFixed(h,b),A.c){var P,S=$.split("."),O=+x.groupSize,T=+x.secondaryGroupSize,L=x.groupSeparator||"",y=S[0],I=S[1],_=A.s<0,V=_?y.slice(1):y,z=V.length;if(T&&(P=O,O=T,T=P,z-=P),O>0&&z>0){for(P=z%O||O,y=V.substr(0,P);P<z;P+=O)y+=L+V.substr(P,O);T>0&&(y+=L+V.slice(P)),_&&(y="-"+y)}$=I?y+(x.decimalSeparator||"")+((T=+x.fractionGroupSize)?I.replace(new RegExp("\\d{"+T+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):I):y}return(x.prefix||"")+$+(x.suffix||"")},o.toFraction=function(h){var b,x,$,A,P,S,O,T,L,y,I,_,V=this,z=V.c;if(h!=null&&(O=new w(h),!O.isInteger()&&(O.c||O.s!==1)||O.lt(i)))throw Error(Ce+"Argument "+(O.isInteger()?"out of range: ":"not an integer: ")+W(O));if(!z)return new w(V);for(b=new w(i),L=x=new w(i),$=T=new w(i),_=ke(z),P=b.e=_.length-V.e-1,b.c[0]=er[(S=P%Q)<0?Q+S:S],h=!h||O.comparedTo(b)>0?P>0?b:L:O,S=d,d=1/0,O=new w(_),T.c[0]=0;y=t(O,b,0,1),A=x.plus(y.times($)),A.comparedTo(h)!=1;)x=$,$=A,L=T.plus(y.times(A=L)),T=A,b=O.minus(y.times(A=b)),O=A;return A=t(h.minus(x),$,0,1),T=T.plus(A.times(L)),x=x.plus(A.times($)),T.s=L.s=V.s,P=P*2,I=t(L,$,P,u).minus(V).abs().comparedTo(t(T,x,P,u).minus(V).abs())<1?[L,$]:[T,x],d=S,I},o.toNumber=function(){return+W(this)},o.toPrecision=function(h,b){return h!=null&&ce(h,1,ge),N(this,h,b,2)},o.toString=function(h){var b,x=this,$=x.s,A=x.e;return A===null?$?(b="Infinity",$<0&&(b="-"+b)):b="NaN":(h==null?b=A<=s||A>=a?fn(ke(x.c),A):lt(ke(x.c),A,"0"):h===10&&M?(x=R(new w(x),l+A+1,u),b=lt(ke(x.c),x.e,"0")):(ce(h,2,E.length,"Base"),b=n(lt(ke(x.c),A,"0"),10,h,$,!0)),$<0&&x.c[0]&&(b="-"+b)),b},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function Fe(e){var t=e|0;return e>0||e===t?t:t-1}function ke(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=Q-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Et(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!==je(e))throw Error(Ce+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function cn(e){var t=e.c.length-1;return Fe(e.e/Q)==t&&e.c[t]%2!=0}function fn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function lt(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 Oe=Fo();const va=(e,t=6)=>{try{const n=new Oe(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Oe.ROUND_DOWN),[o,i=""]=r.toString().split("."),l=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const u=(i||"").padEnd(t,"0");return`${l}.${u}`}return l}catch(n){return console.warn("formatThousands error:",n),"0"}},Ke=()=>{const{translations:e,currentLocale:t}=Io();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}}}},ba=()=>({openDeposit:m.useCallback(t=>{},[])}),xa=()=>({openWithdraw:m.useCallback(t=>{},[])});/**
30
+ <%s key={someKey} {...props} />`,Ao,At,gh,At),na[At+Ao]=!0}}return D===r?fh(me):ch(me),me}}function dh(D,U,Y){return ra(D,U,Y,!0)}function ph(D,U,Y){return ra(D,U,Y,!1)}var mh=ph,hh=dh;Ht.Fragment=r,Ht.jsx=mh,Ht.jsxs=hh}()),Ht}process.env.NODE_ENV==="production"?Qn.exports=sa():Qn.exports=la();var C=Qn.exports;const aa={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",arrivalTime:"到账时间",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",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或负数时,不允许提现。",noPrivateKeyWalletWarning:"暂不支持无私钥钱包充值。若您是无私钥钱包,请勿进行充值。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",withdrawlAmount:"提现金额",amountToReceive:"到账金额",invalidReceiverAddress:"接收地址不合法"}},ua={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",max:"Max",arrivalTime:"Arrival Time",minDeposit:"Minimum Deposit Amount",minDepositParsed:"Min. Deposit {{amount}} {{token}}",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.",noPrivateKeyWalletWarning:"Deposits from wallets without private keys are not supported at the moment. If you are using such a wallet, please do not make a deposit."},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",invalidReceiverAddress:"Invalid receiver address"}},ca={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",arrivalTime:"着金予定時間",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",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またはマイナスの場合、出金は行えません。",noPrivateKeyWalletWarning:"現在、秘密鍵のないウォレットからの入金はサポートされていません。該当ウォレットをご利用の場合は、入金しないでください。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",invalidReceiverAddress:"無効な受け取りアドレス"}},fa={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",arrivalTime:"Время поступления",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",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 или меньше, вывод невозможен.",noPrivateKeyWalletWarning:"В настоящее время пополнение кошельков без приватных ключей не поддерживается. Если у вас такой кошелёк, пожалуйста, не выполняйте пополнение."},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",invalidReceiverAddress:"Неверный адрес получателя"}},da={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",arrivalTime:"到帳時間",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",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或負數時,不允許提現。",noPrivateKeyWalletWarning:"暫不支援無私鑰錢包充值。若您使用的是無私鑰錢包,請勿進行充值。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",withdrawlAmount:"提現金額",amountToReceive:"到账金額",invalidReceiverAddress:"接收地址不合法"}},Jn=["en-US","ja-JP","ru-RU","zh-CN","zh-TW"],Io={"en-US":ua,"ja-JP":ca,"ru-RU":fa,"zh-CN":aa,"zh-TW":da},un="en-US",pa={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},ma=e=>Jn.includes(e)?Io[e]:Io[un],ha=e=>Jn.includes(e),jo=m.createContext(null),ga=({config:e,children:t})=>{const n=m.useMemo(()=>{const r=e.locale||un,o=ha(r)?r:un,i=ma(o);return{...e,currentLocale:o,translations:i}},[e]);return C.jsx(jo.Provider,{value:n,children:t})},Fo=()=>{const e=m.useContext(jo);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var va=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Zn=Math.ceil,je=Math.floor,Ce="[BigNumber Error] ",Ro=Ce+"Number primitive has more than 15 significant digits: ",Ge=1e14,Q=14,er=9007199254740991,tr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ht=1e7,ge=1e9;function ko(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:""},E="0123456789abcdefghijklmnopqrstuvwxyz",M=!0;function w(h,b){var x,$,A,P,S,O,T,L,y=this;if(!(y instanceof w))return new w(h,b);if(b==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(P=0,S=h;S>=10;S/=10,P++);P>d?y.c=y.e=null:(y.e=P,y.c=[h]);return}L=String(h)}else{if(!va.test(L=String(h)))return r(y,L,O);y.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(P=L.indexOf("."))>-1&&(L=L.replace(".","")),(S=L.search(/e/i))>0?(P<0&&(P=S),P+=+L.slice(S+1),L=L.substring(0,S)):P<0&&(P=L.length)}else{if(ce(b,2,E.length,"Base"),b==10&&M)return y=new w(h),k(y,l+y.e+1,u);if(L=String(h),O=typeof h=="number"){if(h*0!=0)return r(y,L,O,b);if(y.s=1/h<0?(L=L.slice(1),-1):1,w.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(Ro+h)}else y.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(x=E.slice(0,b),P=S=0,T=L.length;S<T;S++)if(x.indexOf($=L.charAt(S))<0){if($=="."){if(S>P){P=T;continue}}else if(!A&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){A=!0,S=-1,P=0;continue}return r(y,String(h),O,b)}O=!1,L=n(L,b,10,y.s),(P=L.indexOf("."))>-1?L=L.replace(".",""):P=L.length}for(S=0;L.charCodeAt(S)===48;S++);for(T=L.length;L.charCodeAt(--T)===48;);if(L=L.slice(S,++T)){if(T-=S,O&&w.DEBUG&&T>15&&(h>er||h!==je(h)))throw Error(Ro+y.s*h);if((P=P-S-1)>d)y.c=y.e=null;else if(P<c)y.c=[y.e=0];else{if(y.e=P,y.c=[],S=(P+1)%Q,P<0&&(S+=Q),S<T){for(S&&y.c.push(+L.slice(0,S)),T-=Q;S<T;)y.c.push(+L.slice(S,S+=Q));S=Q-(L=L.slice(S)).length}else S-=T;for(;S--;L+="0");y.c.push(+L)}}else y.c=[y.e=0]}w.clone=ko,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 b,x;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(b="DECIMAL_PLACES")&&(x=h[b],ce(x,0,ge,b),l=x),h.hasOwnProperty(b="ROUNDING_MODE")&&(x=h[b],ce(x,0,8,b),u=x),h.hasOwnProperty(b="EXPONENTIAL_AT")&&(x=h[b],x&&x.pop?(ce(x[0],-ge,0,b),ce(x[1],0,ge,b),s=x[0],a=x[1]):(ce(x,-ge,ge,b),s=-(a=x<0?-x:x))),h.hasOwnProperty(b="RANGE"))if(x=h[b],x&&x.pop)ce(x[0],-ge,-1,b),ce(x[1],1,ge,b),c=x[0],d=x[1];else if(ce(x,-ge,ge,b),x)c=-(d=x<0?-x:x);else throw Error(Ce+b+" cannot be zero: "+x);if(h.hasOwnProperty(b="CRYPTO"))if(x=h[b],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=x;else throw p=!x,Error(Ce+"crypto unavailable");else p=x;else throw Error(Ce+b+" not true or false: "+x);if(h.hasOwnProperty(b="MODULO_MODE")&&(x=h[b],ce(x,0,9,b),f=x),h.hasOwnProperty(b="POW_PRECISION")&&(x=h[b],ce(x,0,ge,b),g=x),h.hasOwnProperty(b="FORMAT"))if(x=h[b],typeof x=="object")v=x;else throw Error(Ce+b+" not an object: "+x);if(h.hasOwnProperty(b="ALPHABET"))if(x=h[b],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))M=x.slice(0,10)=="0123456789",E=x;else throw Error(Ce+b+" invalid: "+x)}else throw Error(Ce+"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:E}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var b,x,$=h.c,A=h.e,P=h.s;e:if({}.toString.call($)=="[object Array]"){if((P===1||P===-1)&&A>=-ge&&A<=ge&&A===je(A)){if($[0]===0){if(A===0&&$.length===1)return!0;break e}if(b=(A+1)%Q,b<1&&(b+=Q),String($[0]).length==b){for(b=0;b<$.length;b++)if(x=$[b],x<0||x>=Ge||x!==je(x))break e;if(x!==0)return!0}}}else if($===null&&A===null&&(P===null||P===1||P===-1))return!0;throw Error(Ce+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return j(arguments,-1)},w.minimum=w.min=function(){return j(arguments,1)},w.random=function(){var h=9007199254740992,b=Math.random()*h&2097151?function(){return je(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var $,A,P,S,O,T=0,L=[],y=new w(i);if(x==null?x=l:ce(x,0,ge),S=Zn(x/Q),p)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(S*=2));T<S;)O=$[T]*131072+($[T+1]>>>11),O>=9e15?(A=crypto.getRandomValues(new Uint32Array(2)),$[T]=A[0],$[T+1]=A[1]):(L.push(O%1e14),T+=2);T=S/2}else if(crypto.randomBytes){for($=crypto.randomBytes(S*=7);T<S;)O=($[T]&31)*281474976710656+$[T+1]*1099511627776+$[T+2]*4294967296+$[T+3]*16777216+($[T+4]<<16)+($[T+5]<<8)+$[T+6],O>=9e15?crypto.randomBytes(7).copy($,T):(L.push(O%1e14),T+=7);T=S/7}else throw p=!1,Error(Ce+"crypto unavailable");if(!p)for(;T<S;)O=b(),O<9e15&&(L[T++]=O%1e14);for(S=L[--T],x%=Q,S&&x&&(O=tr[Q-x],L[T]=je(S/O)*O);L[T]===0;L.pop(),T--);if(T<0)L=[P=0];else{for(P=-1;L[0]===0;L.splice(0,1),P-=Q);for(T=1,O=L[0];O>=10;O/=10,T++);T<Q&&(P-=Q-T)}return y.e=P,y.c=L,y}}(),w.sum=function(){for(var h=1,b=arguments,x=new w(b[0]);h<b.length;)x=x.plus(b[h++]);return x},n=function(){var h="0123456789";function b(x,$,A,P){for(var S,O=[0],T,L=0,y=x.length;L<y;){for(T=O.length;T--;O[T]*=$);for(O[0]+=P.indexOf(x.charAt(L++)),S=0;S<O.length;S++)O[S]>A-1&&(O[S+1]==null&&(O[S+1]=0),O[S+1]+=O[S]/A|0,O[S]%=A)}return O.reverse()}return function(x,$,A,P,S){var O,T,L,y,I,_,V,z,G=x.indexOf("."),q=l,B=u;for(G>=0&&(y=g,g=0,x=x.replace(".",""),z=new w($),_=z.pow(x.length-G),g=y,z.c=b(st(Re(_.c),_.e,"0"),10,A,h),z.e=z.c.length),V=b(x,$,A,S?(O=E,h):(O=h,E)),L=y=V.length;V[--y]==0;V.pop());if(!V[0])return O.charAt(0);if(G<0?--L:(_.c=V,_.e=L,_.s=P,_=t(_,z,q,B,A),V=_.c,I=_.r,L=_.e),T=L+q+1,G=V[T],y=A/2,I=I||T<0||V[T+1]!=null,I=B<4?(G!=null||I)&&(B==0||B==(_.s<0?3:2)):G>y||G==y&&(B==4||I||B==6&&V[T-1]&1||B==(_.s<0?8:7)),T<1||!V[0])x=I?st(O.charAt(1),-q,O.charAt(0)):O.charAt(0);else{if(V.length=T,I)for(--A;++V[--T]>A;)V[T]=0,T||(++L,V=[1].concat(V));for(y=V.length;!V[--y];);for(G=0,x="";G<=y;x+=O.charAt(V[G++]));x=st(x,L,O.charAt(0))}return x}}(),t=function(){function h($,A,P){var S,O,T,L,y=0,I=$.length,_=A%ht,V=A/ht|0;for($=$.slice();I--;)T=$[I]%ht,L=$[I]/ht|0,S=V*T+L*_,O=_*T+S%ht*ht+y,y=(O/P|0)+(S/ht|0)+V*L,$[I]=O%P;return y&&($=[y].concat($)),$}function b($,A,P,S){var O,T;if(P!=S)T=P>S?1:-1;else for(O=T=0;O<P;O++)if($[O]!=A[O]){T=$[O]>A[O]?1:-1;break}return T}function x($,A,P,S){for(var O=0;P--;)$[P]-=O,O=$[P]<A[P]?1:0,$[P]=O*S+$[P]-A[P];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,A,P,S,O){var T,L,y,I,_,V,z,G,q,B,K,H,Z,ae,Ae,$e,it,ye=$.s==A.s?1:-1,he=$.c,se=A.c;if(!he||!he[0]||!se||!se[0])return new w(!$.s||!A.s||(he?se&&he[0]==se[0]:!se)?NaN:he&&he[0]==0||!se?ye*0:ye/0);for(G=new w(ye),q=G.c=[],L=$.e-A.e,ye=P+L+1,O||(O=Ge,L=Fe($.e/Q)-Fe(A.e/Q),ye=ye/Q|0),y=0;se[y]==(he[y]||0);y++);if(se[y]>(he[y]||0)&&L--,ye<0)q.push(1),I=!0;else{for(ae=he.length,$e=se.length,y=0,ye+=2,_=je(O/(se[0]+1)),_>1&&(se=h(se,_,O),he=h(he,_,O),$e=se.length,ae=he.length),Z=$e,B=he.slice(0,$e),K=B.length;K<$e;B[K++]=0);it=se.slice(),it=[0].concat(it),Ae=se[0],se[1]>=O/2&&Ae++;do{if(_=0,T=b(se,B,$e,K),T<0){if(H=B[0],$e!=K&&(H=H*O+(B[1]||0)),_=je(H/Ae),_>1)for(_>=O&&(_=O-1),V=h(se,_,O),z=V.length,K=B.length;b(V,B,z,K)==1;)_--,x(V,$e<z?it:se,z,O),z=V.length,T=1;else _==0&&(T=_=1),V=se.slice(),z=V.length;if(z<K&&(V=[0].concat(V)),x(B,V,K,O),K=B.length,T==-1)for(;b(se,B,$e,K)<1;)_++,x(B,$e<K?it:se,K,O),K=B.length}else T===0&&(_++,B=[0]);q[y++]=_,B[0]?B[K++]=he[Z]||0:(B=[he[Z]],K=1)}while((Z++<ae||B[0]!=null)&&ye--);I=B[0]!=null,q[0]||q.splice(0,1)}if(O==Ge){for(y=1,ye=q[0];ye>=10;ye/=10,y++);k(G,P+(G.e=y+L*Q-1)+1,S,I)}else G.e=L,G.r=+I;return G}}();function N(h,b,x,$){var A,P,S,O,T;if(x==null?x=u:ce(x,0,8),!h.c)return h.toString();if(A=h.c[0],S=h.e,b==null)T=Re(h.c),T=$==1||$==2&&(S<=s||S>=a)?fn(T,S):st(T,S,"0");else if(h=k(new w(h),b,x),P=h.e,T=Re(h.c),O=T.length,$==1||$==2&&(b<=P||P<=s)){for(;O<b;T+="0",O++);T=fn(T,P)}else if(b-=S+($===2&&P>S),T=st(T,P,"0"),P+1>O){if(--b>0)for(T+=".";b--;T+="0");}else if(b+=P-O,b>0)for(P+1==O&&(T+=".");b--;T+="0");return h.s<0&&A?"-"+T:T}function j(h,b){for(var x,$,A=1,P=new w(h[0]);A<h.length;A++)$=new w(h[A]),(!$.s||(x=Et(P,$))===b||x===0&&P.s===b)&&(P=$);return P}function F(h,b,x){for(var $=1,A=b.length;!b[--A];b.pop());for(A=b[0];A>=10;A/=10,$++);return(x=$+x*Q-1)>d?h.c=h.e=null:x<c?h.c=[h.e=0]:(h.e=x,h.c=b),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,x=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(P,S,O,T){var L,y=O?S:S.replace(A,"");if($.test(y))P.s=isNaN(y)?null:y<0?-1:1;else{if(!O&&(y=y.replace(h,function(I,_,V){return L=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!T||T==L?_:I}),T&&(L=T,y=y.replace(b,"$1").replace(x,"0.$1")),S!=y))return new w(y,L);if(w.DEBUG)throw Error(Ce+"Not a"+(T?" base "+T:"")+" number: "+S);P.s=null}P.c=P.e=null}}();function k(h,b,x,$){var A,P,S,O,T,L,y,I=h.c,_=tr;if(I){e:{for(A=1,O=I[0];O>=10;O/=10,A++);if(P=b-A,P<0)P+=Q,S=b,T=I[L=0],y=je(T/_[A-S-1]%10);else if(L=Zn((P+1)/Q),L>=I.length)if($){for(;I.length<=L;I.push(0));T=y=0,A=1,P%=Q,S=P-Q+1}else break e;else{for(T=O=I[L],A=1;O>=10;O/=10,A++);P%=Q,S=P-Q+A,y=S<0?0:je(T/_[A-S-1]%10)}if($=$||b<0||I[L+1]!=null||(S<0?T:T%_[A-S-1]),$=x<4?(y||$)&&(x==0||x==(h.s<0?3:2)):y>5||y==5&&(x==4||$||x==6&&(P>0?S>0?T/_[A-S]:0:I[L-1])%10&1||x==(h.s<0?8:7)),b<1||!I[0])return I.length=0,$?(b-=h.e+1,I[0]=_[(Q-b%Q)%Q],h.e=-b||0):I[0]=h.e=0,h;if(P==0?(I.length=L,O=1,L--):(I.length=L+1,O=_[Q-P],I[L]=S>0?je(T/_[A-S]%_[S])*O:0),$)for(;;)if(L==0){for(P=1,S=I[0];S>=10;S/=10,P++);for(S=I[0]+=O,O=1;S>=10;S/=10,O++);P!=O&&(h.e++,I[0]==Ge&&(I[0]=1));break}else{if(I[L]+=O,I[L]!=Ge)break;I[L--]=0,O=1}for(P=I.length;I[--P]===0;I.pop());}h.e>d?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function W(h){var b,x=h.e;return x===null?h.toString():(b=Re(h.c),b=x<=s||x>=a?fn(b,x):st(b,x,"0"),h.s<0?"-"+b:b)}return o.absoluteValue=o.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,b){return Et(this,new w(h,b))},o.decimalPlaces=o.dp=function(h,b){var x,$,A,P=this;if(h!=null)return ce(h,0,ge),b==null?b=u:ce(b,0,8),k(new w(P),h+P.e+1,b);if(!(x=P.c))return null;if($=((A=x.length-1)-Fe(this.e/Q))*Q,A=x[A])for(;A%10==0;A/=10,$--);return $<0&&($=0),$},o.dividedBy=o.div=function(h,b){return t(this,new w(h,b),l,u)},o.dividedToIntegerBy=o.idiv=function(h,b){return t(this,new w(h,b),0,1)},o.exponentiatedBy=o.pow=function(h,b){var x,$,A,P,S,O,T,L,y,I=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Ce+"Exponent not an integer: "+W(h));if(b!=null&&(b=new w(b)),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(+W(I),O?h.s*(2-cn(h)):+W(h))),b?y.mod(b):y;if(T=h.s<0,b){if(b.c?!b.c[0]:!b.s)return new w(NaN);$=!T&&I.isInteger()&&b.isInteger(),$&&(I=I.mod(b))}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 P=I.s<0&&cn(h)?-0:0,I.e>-1&&(P=1/P),new w(T?1/P:P);g&&(P=Zn(g/Q+2))}for(O?(x=new w(.5),T&&(h.s=1),L=cn(h)):(A=Math.abs(+W(h)),L=A%2),y=new w(i);;){if(L){if(y=y.times(I),!y.c)break;P?y.c.length>P&&(y.c.length=P):$&&(y=y.mod(b))}if(A){if(A=je(A/2),A===0)break;L=A%2}else if(h=h.times(x),k(h,h.e+1,1),h.e>14)L=cn(h);else{if(A=+W(h),A===0)break;L=A%2}I=I.times(I),P?I.c&&I.c.length>P&&(I.c.length=P):$&&(I=I.mod(b))}return $?y:(T&&(y=i.div(y)),b?y.mod(b):P?k(y,g,u,S):y)},o.integerValue=function(h){var b=new w(this);return h==null?h=u:ce(h,0,8),k(b,b.e+1,h)},o.isEqualTo=o.eq=function(h,b){return Et(this,new w(h,b))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,b){return Et(this,new w(h,b))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,b){return(b=Et(this,new w(h,b)))===1||b===0},o.isInteger=function(){return!!this.c&&Fe(this.e/Q)>this.c.length-2},o.isLessThan=o.lt=function(h,b){return Et(this,new w(h,b))<0},o.isLessThanOrEqualTo=o.lte=function(h,b){return(b=Et(this,new w(h,b)))===-1||b===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,b){var x,$,A,P,S=this,O=S.s;if(h=new w(h,b),b=h.s,!O||!b)return new w(NaN);if(O!=b)return h.s=-b,S.plus(h);var T=S.e/Q,L=h.e/Q,y=S.c,I=h.c;if(!T||!L){if(!y||!I)return y?(h.s=-b,h):new w(I?S:NaN);if(!y[0]||!I[0])return I[0]?(h.s=-b,h):new w(y[0]?S:u==3?-0:0)}if(T=Fe(T),L=Fe(L),y=y.slice(),O=T-L){for((P=O<0)?(O=-O,A=y):(L=T,A=I),A.reverse(),b=O;b--;A.push(0));A.reverse()}else for($=(P=(O=y.length)<(b=I.length))?O:b,O=b=0;b<$;b++)if(y[b]!=I[b]){P=y[b]<I[b];break}if(P&&(A=y,y=I,I=A,h.s=-h.s),b=($=I.length)-(x=y.length),b>0)for(;b--;y[x++]=0);for(b=Ge-1;$>O;){if(y[--$]<I[$]){for(x=$;x&&!y[--x];y[x]=b);--y[x],y[$]+=Ge}y[$]-=I[$]}for(;y[0]==0;y.splice(0,1),--L);return y[0]?F(h,y,L):(h.s=u==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,b){var x,$,A=this;return h=new w(h,b),!A.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||A.c&&!A.c[0]?new w(A):(f==9?($=h.s,h.s=1,x=t(A,h,0,3),h.s=$,x.s*=$):x=t(A,h,0,f),h=A.minus(x.times(h)),!h.c[0]&&f==1&&(h.s=A.s),h)},o.multipliedBy=o.times=function(h,b){var x,$,A,P,S,O,T,L,y,I,_,V,z,G,q,B=this,K=B.c,H=(h=new w(h,b)).c;if(!K||!H||!K[0]||!H[0])return!B.s||!h.s||K&&!K[0]&&!H||H&&!H[0]&&!K?h.c=h.e=h.s=null:(h.s*=B.s,!K||!H?h.c=h.e=null:(h.c=[0],h.e=0)),h;for($=Fe(B.e/Q)+Fe(h.e/Q),h.s*=B.s,T=K.length,I=H.length,T<I&&(z=K,K=H,H=z,A=T,T=I,I=A),A=T+I,z=[];A--;z.push(0));for(G=Ge,q=ht,A=I;--A>=0;){for(x=0,_=H[A]%q,V=H[A]/q|0,S=T,P=A+S;P>A;)L=K[--S]%q,y=K[S]/q|0,O=V*L+y*_,L=_*L+O%q*q+z[P]+x,x=(L/G|0)+(O/q|0)+V*y,z[P--]=L%G;z[P]=x}return x?++$:z.splice(0,1),F(h,z,$)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,b){var x,$=this,A=$.s;if(h=new w(h,b),b=h.s,!A||!b)return new w(NaN);if(A!=b)return h.s=-b,$.minus(h);var P=$.e/Q,S=h.e/Q,O=$.c,T=h.c;if(!P||!S){if(!O||!T)return new w(A/0);if(!O[0]||!T[0])return T[0]?h:new w(O[0]?$:A*0)}if(P=Fe(P),S=Fe(S),O=O.slice(),A=P-S){for(A>0?(S=P,x=T):(A=-A,x=O),x.reverse();A--;x.push(0));x.reverse()}for(A=O.length,b=T.length,A-b<0&&(x=T,T=O,O=x,b=A),A=0;b;)A=(O[--b]=O[b]+T[b]+A)/Ge|0,O[b]=Ge===O[b]?0:O[b]%Ge;return A&&(O=[A].concat(O),++S),F(h,O,S)},o.precision=o.sd=function(h,b){var x,$,A,P=this;if(h!=null&&h!==!!h)return ce(h,1,ge),b==null?b=u:ce(b,0,8),k(new w(P),h,b);if(!(x=P.c))return null;if(A=x.length-1,$=A*Q+1,A=x[A]){for(;A%10==0;A/=10,$--);for(A=x[0];A>=10;A/=10,$++);}return h&&P.e+1>$&&($=P.e+1),$},o.shiftedBy=function(h){return ce(h,-er,er),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,b,x,$,A,P=this,S=P.c,O=P.s,T=P.e,L=l+4,y=new w("0.5");if(O!==1||!S||!S[0])return new w(!O||O<0&&(!S||S[0])?NaN:S?P:1/0);if(O=Math.sqrt(+W(P)),O==0||O==1/0?(b=Re(S),(b.length+T)%2==0&&(b+="0"),O=Math.sqrt(+b),T=Fe((T+1)/2)-(T<0||T%2),O==1/0?b="5e"+T:(b=O.toExponential(),b=b.slice(0,b.indexOf("e")+1)+T),x=new w(b)):x=new w(O+""),x.c[0]){for(T=x.e,O=T+L,O<3&&(O=0);;)if(A=x,x=y.times(A.plus(t(P,A,L,1))),Re(A.c).slice(0,O)===(b=Re(x.c)).slice(0,O))if(x.e<T&&--O,b=b.slice(O-3,O+1),b=="9999"||!$&&b=="4999"){if(!$&&(k(A,A.e+l+2,0),A.times(A).eq(P))){x=A;break}L+=4,O+=4,$=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(k(x,x.e+l+2,1),h=!x.times(x).eq(P));break}}return k(x,x.e+l+1,u,h)},o.toExponential=function(h,b){return h!=null&&(ce(h,0,ge),h++),N(this,h,b,1)},o.toFixed=function(h,b){return h!=null&&(ce(h,0,ge),h=h+this.e+1),N(this,h,b)},o.toFormat=function(h,b,x){var $,A=this;if(x==null)h!=null&&b&&typeof b=="object"?(x=b,b=null):h&&typeof h=="object"?(x=h,h=b=null):x=v;else if(typeof x!="object")throw Error(Ce+"Argument not an object: "+x);if($=A.toFixed(h,b),A.c){var P,S=$.split("."),O=+x.groupSize,T=+x.secondaryGroupSize,L=x.groupSeparator||"",y=S[0],I=S[1],_=A.s<0,V=_?y.slice(1):y,z=V.length;if(T&&(P=O,O=T,T=P,z-=P),O>0&&z>0){for(P=z%O||O,y=V.substr(0,P);P<z;P+=O)y+=L+V.substr(P,O);T>0&&(y+=L+V.slice(P)),_&&(y="-"+y)}$=I?y+(x.decimalSeparator||"")+((T=+x.fractionGroupSize)?I.replace(new RegExp("\\d{"+T+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):I):y}return(x.prefix||"")+$+(x.suffix||"")},o.toFraction=function(h){var b,x,$,A,P,S,O,T,L,y,I,_,V=this,z=V.c;if(h!=null&&(O=new w(h),!O.isInteger()&&(O.c||O.s!==1)||O.lt(i)))throw Error(Ce+"Argument "+(O.isInteger()?"out of range: ":"not an integer: ")+W(O));if(!z)return new w(V);for(b=new w(i),L=x=new w(i),$=T=new w(i),_=Re(z),P=b.e=_.length-V.e-1,b.c[0]=tr[(S=P%Q)<0?Q+S:S],h=!h||O.comparedTo(b)>0?P>0?b:L:O,S=d,d=1/0,O=new w(_),T.c[0]=0;y=t(O,b,0,1),A=x.plus(y.times($)),A.comparedTo(h)!=1;)x=$,$=A,L=T.plus(y.times(A=L)),T=A,b=O.minus(y.times(A=b)),O=A;return A=t(h.minus(x),$,0,1),T=T.plus(A.times(L)),x=x.plus(A.times($)),T.s=L.s=V.s,P=P*2,I=t(L,$,P,u).minus(V).abs().comparedTo(t(T,x,P,u).minus(V).abs())<1?[L,$]:[T,x],d=S,I},o.toNumber=function(){return+W(this)},o.toPrecision=function(h,b){return h!=null&&ce(h,1,ge),N(this,h,b,2)},o.toString=function(h){var b,x=this,$=x.s,A=x.e;return A===null?$?(b="Infinity",$<0&&(b="-"+b)):b="NaN":(h==null?b=A<=s||A>=a?fn(Re(x.c),A):st(Re(x.c),A,"0"):h===10&&M?(x=k(new w(x),l+A+1,u),b=st(Re(x.c),x.e,"0")):(ce(h,2,E.length,"Base"),b=n(st(Re(x.c),A,"0"),10,h,$,!0)),$<0&&x.c[0]&&(b="-"+b)),b},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function Fe(e){var t=e|0;return e>0||e===t?t:t-1}function Re(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=Q-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Et(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!==je(e))throw Error(Ce+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function cn(e){var t=e.c.length-1;return Fe(e.e/Q)==t&&e.c[t]%2!=0}function fn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function st(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 Oe=ko();const ba=(e,t=6)=>{try{const n=new Oe(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Oe.ROUND_DOWN),[o,i=""]=r.toString().split("."),l=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const u=(i||"").padEnd(t,"0");return`${l}.${u}`}return l}catch(n){return console.warn("formatThousands error:",n),"0"}},Ye=()=>{const{translations:e,currentLocale:t}=Fo();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}}}},xa=()=>({openDeposit:m.useCallback(t=>{},[])}),ya=()=>({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 ya=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wa=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),ko=e=>{const t=wa(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ro=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Ea=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
40
+ */const wa=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ea=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),_o=e=>{const t=Ea(e);return t.charAt(0).toUpperCase()+t.slice(1)},Wo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Sa=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 Sa={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 Ca={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 Ca=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,...Sa,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ro("lucide",o),...!i&&!Ea(u)&&{"aria-hidden":"true"},...u},[...l.map(([a,c])=>m.createElement(a,c)),...Array.isArray(i)?i:[i]]));/**
50
+ */const Oa=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,...Ca,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Wo("lucide",o),...!i&&!Sa(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 Oa=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(Ca,{ref:i,iconNode:t,className:Ro(`lucide-${ya(ko(e))}`,`lucide-${e}`,r),...o}));return n.displayName=ko(e),n};/**
55
+ */const Ta=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(Oa,{ref:i,iconNode:t,className:Wo(`lucide-${wa(_o(e))}`,`lucide-${e}`,r),...o}));return n.displayName=_o(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 _o=Oa("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class Wo{constructor(){Ie(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 Ta extends Wo{constructor(n,r){super();Ie(this,"smartWallet");Ie(this,"currentActiveAccount");this.smartWallet=n,this.currentActiveAccount=r}getWalletType(){return"mpc"}getDisplayAddress(){var n;return((n=this.smartWallet)==null?void 0:n.address)||""}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 Na extends Wo{constructor(n,r,o,i="0",l="0"){super();Ie(this,"currentActiveAccount");Ie(this,"approved");Ie(this,"chainId");Ie(this,"balance");Ie(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 Bo(e,t,n,r,o,i){switch(e==null?void 0:e.wallet){case"mpc":return new Ta(t,e);default:return new Na(e,!1,r||1,o,i)}}const Uo=typeof document<"u"?m.useLayoutEffect:()=>{};var tr;const Pa=(tr=m.useInsertionEffect)!==null&&tr!==void 0?tr:Uo;function La(e){const t=m.useRef(null);return Pa(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const gt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},St=e=>e&&"window"in e&&e.window===e?e:gt(e).defaultView||window;function Aa(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function $a(e){return Aa(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Da=!1;function nr(){return Da}function Vo(e,t){if(!nr())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:$a(n)?n=n.host:n=n.parentNode}return!1}const rr=(e=document)=>{var t;if(!nr())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 zo(e){return nr()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function dn(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 or(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 at(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const ir=at(function(){return or(/^Mac/i)}),Ma=at(function(){return or(/^iPhone/i)}),Ia=at(function(){return or(/^iPad/i)||ir()&&navigator.maxTouchPoints>1}),ja=at(function(){return Ma()||Ia()});at(function(){return ir()||ja()}),at(function(){return dn(/AppleWebKit/i)&&!Fa()});const Fa=at(function(){return dn(/Chrome/i)}),ka=at(function(){return dn(/Android/i)});at(function(){return dn(/Firefox/i)});function Ho(){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 Ra(e){return e.mozInputSource===0&&e.isTrusted?!0:ka()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Go(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function _a(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function Yo(e){let t=m.useRef({isFocused:!1,observer:null});Uo(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=La(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=Go(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 Wa=!1,Gt=null,sr=new Set,Yt=new Map,Ct=!1,lr=!1;const Ba={Tab:!0,Escape:!0};function ar(e,t){for(let n of sr)n(e,t)}function Ua(e){return!(e.metaKey||!ir()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function pn(e){Ct=!0,Ua(e)&&(Gt="keyboard",ar("keyboard",e))}function Re(e){Gt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ct=!0,ar("pointer",e))}function Ko(e){Ra(e)&&(Ct=!0,Gt="virtual")}function qo(e){e.target===window||e.target===document||Wa||!e.isTrusted||(!Ct&&!lr&&(Gt="virtual",ar("virtual",e)),Ct=!1,lr=!1)}function Xo(){Ct=!1,lr=!0}function ur(e){if(typeof window>"u"||typeof document>"u"||Yt.get(St(e)))return;const t=St(e),n=gt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ct=!0,r.apply(this,arguments)},n.addEventListener("keydown",pn,!0),n.addEventListener("keyup",pn,!0),n.addEventListener("click",Ko,!0),t.addEventListener("focus",qo,!0),t.addEventListener("blur",Xo,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Re,!0),n.addEventListener("pointermove",Re,!0),n.addEventListener("pointerup",Re,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Re,!0),n.addEventListener("mousemove",Re,!0),n.addEventListener("mouseup",Re,!0)),t.addEventListener("beforeunload",()=>{Qo(e)},{once:!0}),Yt.set(t,{focus:r})}const Qo=(e,t)=>{const n=St(e),r=gt(e);t&&r.removeEventListener("DOMContentLoaded",t),Yt.has(n)&&(n.HTMLElement.prototype.focus=Yt.get(n).focus,r.removeEventListener("keydown",pn,!0),r.removeEventListener("keyup",pn,!0),r.removeEventListener("click",Ko,!0),n.removeEventListener("focus",qo,!0),n.removeEventListener("blur",Xo,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Re,!0),r.removeEventListener("pointermove",Re,!0),r.removeEventListener("pointerup",Re,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Re,!0),r.removeEventListener("mousemove",Re,!0),r.removeEventListener("mouseup",Re,!0)),Yt.delete(n))};function Va(e){const t=gt(e);let n;return t.readyState!=="loading"?ur(e):(n=()=>{ur(e)},t.addEventListener("DOMContentLoaded",n)),()=>Qo(e,n)}typeof document<"u"&&Va();function Jo(){return Gt!=="pointer"}const za=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ha(e,t,n){let r=gt(n==null?void 0:n.target);const o=typeof window<"u"?St(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?St(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?St(n==null?void 0:n.target).HTMLElement:HTMLElement,u=typeof window<"u"?St(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!za.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof u&&!Ba[n.key])}function Ga(e,t,n){ur(),m.useEffect(()=>{let r=(o,i)=>{Ha(!!(n!=null&&n.isTextInput),o,i)&&e(Jo())};return sr.add(r),()=>{sr.delete(r)}},t)}function Ya(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=Yo(i),u=m.useCallback(s=>{const a=gt(s.target),c=a?rr(a):rr();s.target===s.currentTarget&&c===zo(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 Ka(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=m.useRef({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:u}=Ho(),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=Yo(s),c=m.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const p=gt(d.target),f=rr(p);if(!i.current.isFocusWithin&&f===zo(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&&!Vo(g,v.target)){let E=new p.defaultView.FocusEvent("blur",{relatedTarget:v.target});_a(E,g);let M=Go(E);s(M)}},{capture:!0})}},[r,o,a,l,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:s}}}let mn=!1,hn=0;function cr(){mn=!0,setTimeout(()=>{mn=!1},50)}function Zo(e){e.pointerType==="touch"&&cr()}function qa(){if(!(typeof document>"u"))return hn===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",Zo):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",cr)),hn++,()=>{hn--,!(hn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Zo):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",cr))}}function Xa(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(qa,[]);let{addGlobalListener:s,removeAllGlobalListeners:a}=Ho(),{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 M=v.currentTarget;u.target=M,s(gt(v.target),"pointerover",w=>{u.isHovered&&u.target&&!Vo(u.target,w.target)&&f(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:M,pointerType:E}),n&&n(!0),l(!0)},f=(v,E)=>{let M=u.target;u.pointerType="",u.target=null,!(E==="touch"||!u.isHovered||!M)&&(u.isHovered=!1,a(),r&&r({type:"hoverend",target:M,pointerType:E}),n&&n(!1),l(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=v=>{mn&&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&&!mn&&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 Qa(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=m.useRef({isFocused:!1,isFocusVisible:t||Jo()}),[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]);Ga(f=>{o.current.isFocusVisible=f,a()},[],{isTextInput:n});let{focusProps:d}=Ya({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=Ka({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:u,focusProps:r?p:d}}var Ja=Object.defineProperty,Za=(e,t,n)=>t in e?Ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fr=(e,t,n)=>(Za(e,typeof t!="symbol"?t+"":t,n),n);let eu=class{constructor(){fr(this,"current",this.detect()),fr(this,"handoffState","pending"),fr(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"}},Je=new eu;function Kt(e){var t,n;return Je.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 ei(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function qe(){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 ei(()=>{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=qe();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 $t(){let[e]=m.useState(qe);return m.useEffect(()=>()=>e.dispose(),[e]),e}let ue=(e,t)=>{Je.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Ot(e){let t=m.useRef(e);return ue(()=>{t.current=e},[e]),t}let ne=function(e){let t=Ot(e);return m.useCallback((...n)=>t.current(...n),[t])};function tu(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 nu(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ru({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),o=$t(),i=ne(()=>{t.current=null,r(!1),o.dispose()}),l=ne(u=>{if(o.dispose(),t.current===null){t.current=u.currentTarget,r(!0);{let s=Kt(u.currentTarget);o.addEventListener(s,"pointerup",i,!1),o.addEventListener(s,"pointermove",a=>{if(t.current){let c=tu(a);r(nu(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(s,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let ou=m.createContext(void 0);function dr(){return m.useContext(ou)}function pr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function _e(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,_e),r}var gn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(gn||{}),vt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(vt||{});function Me(){let e=su();return m.useCallback(t=>iu({mergeRefs:e,...t}),[e])}function iu({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:u}){u=u??lu;let s=ti(t,e);if(i)return vn(s,n,r,l,u);let a=o??0;if(a&2){let{static:c=!1,...d}=s;if(c)return vn(d,n,r,l,u)}if(a&1){let{unmount:c=!0,...d}=s;return _e(c?0:1,{0(){return null},1(){return vn({...d,hidden:!0,style:{display:"none"}},n,r,l,u)}})}return vn(s,n,r,l,u)}function vn(e,t={},n,r,o){let{as:i=n,children:l,refName:u="ref",...s}=mr(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,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(bt(s)).length>0||Object.keys(bt(d)).length>0))if(!m.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(bt(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(bt(s)).concat(Object.keys(bt(d))).map(p=>` - ${p}`).join(`
60
+ */const Bo=Ta("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class Uo{constructor(){Ie(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 Na extends Uo{constructor(n,r){super();Ie(this,"smartWallet");Ie(this,"currentActiveAccount");this.smartWallet=n,this.currentActiveAccount=r}getWalletType(){return"mpc"}getDisplayAddress(){var n;return((n=this.smartWallet)==null?void 0:n.address)||""}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 Pa extends Uo{constructor(n,r,o,i="0",l="0"){super();Ie(this,"currentActiveAccount");Ie(this,"approved");Ie(this,"chainId");Ie(this,"balance");Ie(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 Vo(e,t,n,r,o,i){switch(e==null?void 0:e.wallet){case"mpc":return new Na(t,e);default:return new Pa(e,!1,r||1,o,i)}}const zo=typeof document<"u"?m.useLayoutEffect:()=>{};var nr;const La=(nr=m.useInsertionEffect)!==null&&nr!==void 0?nr:zo;function Aa(e){const t=m.useRef(null);return La(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const gt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},St=e=>e&&"window"in e&&e.window===e?e:gt(e).defaultView||window;function $a(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Da(e){return $a(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Ma=!1;function rr(){return Ma}function Ho(e,t){if(!rr())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:Da(n)?n=n.host:n=n.parentNode}return!1}const or=(e=document)=>{var t;if(!rr())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 Go(e){return rr()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function dn(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 ir(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 lt(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const sr=lt(function(){return ir(/^Mac/i)}),Ia=lt(function(){return ir(/^iPhone/i)}),ja=lt(function(){return ir(/^iPad/i)||sr()&&navigator.maxTouchPoints>1}),Fa=lt(function(){return Ia()||ja()});lt(function(){return sr()||Fa()}),lt(function(){return dn(/AppleWebKit/i)&&!Ra()});const Ra=lt(function(){return dn(/Chrome/i)}),ka=lt(function(){return dn(/Android/i)});lt(function(){return dn(/Firefox/i)});function Yo(){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 _a(e){return e.mozInputSource===0&&e.isTrusted?!0:ka()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ko(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Wa(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function qo(e){let t=m.useRef({isFocused:!1,observer:null});zo(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Aa(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=Ko(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 Ba=!1,Gt=null,lr=new Set,Yt=new Map,Ct=!1,ar=!1;const Ua={Tab:!0,Escape:!0};function ur(e,t){for(let n of lr)n(e,t)}function Va(e){return!(e.metaKey||!sr()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function pn(e){Ct=!0,Va(e)&&(Gt="keyboard",ur("keyboard",e))}function ke(e){Gt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ct=!0,ur("pointer",e))}function Xo(e){_a(e)&&(Ct=!0,Gt="virtual")}function Qo(e){e.target===window||e.target===document||Ba||!e.isTrusted||(!Ct&&!ar&&(Gt="virtual",ur("virtual",e)),Ct=!1,ar=!1)}function Jo(){Ct=!1,ar=!0}function cr(e){if(typeof window>"u"||typeof document>"u"||Yt.get(St(e)))return;const t=St(e),n=gt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ct=!0,r.apply(this,arguments)},n.addEventListener("keydown",pn,!0),n.addEventListener("keyup",pn,!0),n.addEventListener("click",Xo,!0),t.addEventListener("focus",Qo,!0),t.addEventListener("blur",Jo,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ke,!0),n.addEventListener("pointermove",ke,!0),n.addEventListener("pointerup",ke,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ke,!0),n.addEventListener("mousemove",ke,!0),n.addEventListener("mouseup",ke,!0)),t.addEventListener("beforeunload",()=>{Zo(e)},{once:!0}),Yt.set(t,{focus:r})}const Zo=(e,t)=>{const n=St(e),r=gt(e);t&&r.removeEventListener("DOMContentLoaded",t),Yt.has(n)&&(n.HTMLElement.prototype.focus=Yt.get(n).focus,r.removeEventListener("keydown",pn,!0),r.removeEventListener("keyup",pn,!0),r.removeEventListener("click",Xo,!0),n.removeEventListener("focus",Qo,!0),n.removeEventListener("blur",Jo,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ke,!0),r.removeEventListener("pointermove",ke,!0),r.removeEventListener("pointerup",ke,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",ke,!0),r.removeEventListener("mousemove",ke,!0),r.removeEventListener("mouseup",ke,!0)),Yt.delete(n))};function za(e){const t=gt(e);let n;return t.readyState!=="loading"?cr(e):(n=()=>{cr(e)},t.addEventListener("DOMContentLoaded",n)),()=>Zo(e,n)}typeof document<"u"&&za();function ei(){return Gt!=="pointer"}const Ha=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ga(e,t,n){let r=gt(n==null?void 0:n.target);const o=typeof window<"u"?St(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?St(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?St(n==null?void 0:n.target).HTMLElement:HTMLElement,u=typeof window<"u"?St(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Ha.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof u&&!Ua[n.key])}function Ya(e,t,n){cr(),m.useEffect(()=>{let r=(o,i)=>{Ga(!!(n!=null&&n.isTextInput),o,i)&&e(ei())};return lr.add(r),()=>{lr.delete(r)}},t)}function Ka(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=qo(i),u=m.useCallback(s=>{const a=gt(s.target),c=a?or(a):or();s.target===s.currentTarget&&c===Go(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 qa(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=m.useRef({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:u}=Yo(),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=qo(s),c=m.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const p=gt(d.target),f=or(p);if(!i.current.isFocusWithin&&f===Go(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&&!Ho(g,v.target)){let E=new p.defaultView.FocusEvent("blur",{relatedTarget:v.target});Wa(E,g);let M=Ko(E);s(M)}},{capture:!0})}},[r,o,a,l,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:s}}}let mn=!1,hn=0;function fr(){mn=!0,setTimeout(()=>{mn=!1},50)}function ti(e){e.pointerType==="touch"&&fr()}function Xa(){if(!(typeof document>"u"))return hn===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",ti):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",fr)),hn++,()=>{hn--,!(hn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",ti):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",fr))}}function Qa(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(Xa,[]);let{addGlobalListener:s,removeAllGlobalListeners:a}=Yo(),{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 M=v.currentTarget;u.target=M,s(gt(v.target),"pointerover",w=>{u.isHovered&&u.target&&!Ho(u.target,w.target)&&f(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:M,pointerType:E}),n&&n(!0),l(!0)},f=(v,E)=>{let M=u.target;u.pointerType="",u.target=null,!(E==="touch"||!u.isHovered||!M)&&(u.isHovered=!1,a(),r&&r({type:"hoverend",target:M,pointerType:E}),n&&n(!1),l(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=v=>{mn&&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&&!mn&&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 Ja(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=m.useRef({isFocused:!1,isFocusVisible:t||ei()}),[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]);Ya(f=>{o.current.isFocusVisible=f,a()},[],{isTextInput:n});let{focusProps:d}=Ka({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=qa({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:u,focusProps:r?p:d}}var Za=Object.defineProperty,eu=(e,t,n)=>t in e?Za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dr=(e,t,n)=>(eu(e,typeof t!="symbol"?t+"":t,n),n);let tu=class{constructor(){dr(this,"current",this.detect()),dr(this,"handoffState","pending"),dr(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 tu;function Kt(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 ni(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ke(){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 ni(()=>{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=Ke();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 $t(){let[e]=m.useState(Ke);return m.useEffect(()=>()=>e.dispose(),[e]),e}let ue=(e,t)=>{Qe.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Ot(e){let t=m.useRef(e);return ue(()=>{t.current=e},[e]),t}let ne=function(e){let t=Ot(e);return m.useCallback((...n)=>t.current(...n),[t])};function nu(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 ru(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ou({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),o=$t(),i=ne(()=>{t.current=null,r(!1),o.dispose()}),l=ne(u=>{if(o.dispose(),t.current===null){t.current=u.currentTarget,r(!0);{let s=Kt(u.currentTarget);o.addEventListener(s,"pointerup",i,!1),o.addEventListener(s,"pointermove",a=>{if(t.current){let c=nu(a);r(ru(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(s,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let iu=m.createContext(void 0);function pr(){return m.useContext(iu)}function mr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function _e(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,_e),r}var gn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(gn||{}),vt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(vt||{});function Me(){let e=lu();return m.useCallback(t=>su({mergeRefs:e,...t}),[e])}function su({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:u}){u=u??au;let s=ri(t,e);if(i)return vn(s,n,r,l,u);let a=o??0;if(a&2){let{static:c=!1,...d}=s;if(c)return vn(d,n,r,l,u)}if(a&1){let{unmount:c=!0,...d}=s;return _e(c?0:1,{0(){return null},1(){return vn({...d,hidden:!0,style:{display:"none"}},n,r,l,u)}})}return vn(s,n,r,l,u)}function vn(e,t={},n,r,o){let{as:i=n,children:l,refName:u="ref",...s}=hr(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,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(bt(s)).length>0||Object.keys(bt(d)).length>0))if(!m.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(bt(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(bt(s)).concat(Object.keys(bt(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"?(...M)=>pr(f(...M),s.className):pr(f,s.className),v=g?{className:g}:{},E=ti(c.props,bt(mr(s,["ref"])));for(let M in d)M in E&&delete d[M];return m.cloneElement(c,Object.assign({},E,d,a,{ref:o(au(c),a.ref)},v))}return m.createElement(i,Object.assign({},mr(s,["ref"]),i!==m.Fragment&&a,i!==m.Fragment&&d),c)}function su(){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 lu(...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 ti(...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 ni(...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 Te(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function bt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function mr(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function au(e){return m.version.split(".")[0]>="19"?e.props.ref:e.ref}function uu(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,ne(a=>(i||o(a),t==null?void 0:t(a)))]}function cu(e){let[t]=m.useState(e);return t}function ri(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))ii(n,oi(t,r),o);return n}function oi(e,t){return e?e+"["+t+"]":t}function ii(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())ii(e,oi(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,""]):ri(n,t,e)}function fu(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 du="span";var hr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(hr||{});function pu(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 Me()({ourProps:i,theirProps:o,slot:{},defaultTag:du,name:"Hidden"})}let si=Te(pu),mu=m.createContext(null);function hu({children:e}){let t=m.useContext(mu);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 gu({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=m.useState(null),u=$t();return m.useEffect(()=>{if(r&&i)return u.addEventListener(i,"reset",r)},[i,t,r]),m.createElement(hu,null,m.createElement(vu,{setForm:l,formId:t}),ri(e).map(([s,a])=>m.createElement(si,{features:hr.Hidden,...bt({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:s,value:a,...o})})))}function vu({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:m.createElement(si,{features:hr.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let bu=m.createContext(void 0);function li(){return m.useContext(bu)}function gr(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function bn(e){return gr(e)&&"tagName"in e}function ut(e){return bn(e)&&"accessKey"in e}function Dt(e){return bn(e)&&"tabIndex"in e}function xu(e){return bn(e)&&"style"in e}function yu(e){return ut(e)&&e.nodeName==="IFRAME"}function ai(e){return ut(e)&&e.nodeName==="INPUT"}function ui(e){return ut(e)&&e.nodeName==="LABEL"}function wu(e){return ut(e)&&e.nodeName==="FIELDSET"}function ci(e){return ut(e)&&e.nodeName==="LEGEND"}function Eu(e){return bn(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Su(e){let t=e.parentElement,n=null;for(;t&&!wu(t);)ci(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Cu(n)?!1:r}function Cu(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(ci(t))return!1;t=t.previousElementSibling}return!0}let fi=Symbol();function Ou(e,t=!0){return Object.assign(e,{[fi]:t})}function We(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=ne(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[fi]))?void 0:n}let vr=m.createContext(null);vr.displayName="DescriptionContext";function di(){let e=m.useContext(vr);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,di),t}return e}function Tu(){var e,t;return(t=(e=m.useContext(vr))==null?void 0:e.value)!=null?t:void 0}let Nu="p";function Pu(e,t){let n=m.useId(),r=dr(),{id:o=`headlessui-description-${n}`,...i}=e,l=di(),u=We(t);ue(()=>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 Me()({ourProps:c,theirProps:i,slot:a,defaultTag:Nu,name:l.name||"Description"})}let Lu=Te(Pu);Object.assign(Lu,{});var ve=(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))(ve||{});let xn=m.createContext(null);xn.displayName="LabelContext";function pi(){let e=m.useContext(xn);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,pi),t}return e}function mi(e){var t,n,r;let o=(n=(t=m.useContext(xn))==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 Au({inherit:e=!1}={}){let t=mi(),[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=ne(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(xn.Provider,{value:u},i.children)},[r])]}let $u="label";function Du(e,t){var n;let r=m.useId(),o=pi(),i=li(),l=dr(),{id:u=`headlessui-label-${r}`,htmlFor:s=i??((n=o.props)==null?void 0:n.htmlFor),passive:a=!1,...c}=e,d=We(t);ue(()=>o.register(u),[u,o.register]);let p=ne(E=>{let M=E.currentTarget;if(!(E.target!==E.currentTarget&&Eu(E.target))&&(ui(M)&&E.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(E),ui(M))){let w=document.getElementById(M.htmlFor);if(w){let N=w.getAttribute("disabled");if(N==="true"||N==="")return;let j=w.getAttribute("aria-disabled");if(j==="true"||j==="")return;(ai(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),Me()({ourProps:v,theirProps:c,slot:g,defaultTag:s?$u:"div",name:o.name||"Label"})}let Mu=Te(Du),Iu=Object.assign(Mu,{});function ju(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 Fu(e=ju){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 ku(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Ru(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),o=m.useMemo(()=>ku(e),[e,n]);return ue(()=>{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 hi=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 _u=Object.defineProperty,Wu=(e,t,n)=>t in e?_u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bu=(e,t,n)=>(Wu(e,t+"",n),n),gi=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Be=(e,t,n)=>(gi(e,t,"read from private field"),n?n.call(e):t.get(e)),br=(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)},vi=(e,t,n,r)=>(gi(e,t,"write to private field"),t.set(e,n),n),Ze,qt,Xt;let bi=class{constructor(t){br(this,Ze,{}),br(this,qt,new hi(()=>new Set)),br(this,Xt,new Set),Bu(this,"disposables",qe()),vi(this,Ze,t),Je.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Be(this,Ze)}subscribe(t,n){if(Je.isServer)return()=>{};let r={selector:t,callback:n,current:t(Be(this,Ze))};return Be(this,Xt).add(r),this.disposables.add(()=>{Be(this,Xt).delete(r)})}on(t,n){return Je.isServer?()=>{}:(Be(this,qt).get(t).add(n),this.disposables.add(()=>{Be(this,qt).get(t).delete(n)}))}send(t){let n=this.reduce(Be(this,Ze),t);if(n!==Be(this,Ze)){vi(this,Ze,n);for(let r of Be(this,Xt)){let o=r.selector(Be(this,Ze));xi(r.current,o)||(r.current=o,r.callback(o))}for(let r of Be(this,qt).get(t.type))r(Be(this,Ze),t)}}};Ze=new WeakMap,qt=new WeakMap,Xt=new WeakMap;function xi(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:xr(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:xr(e.entries(),t.entries()):yi(e)&&yi(t)?xr(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function xr(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 yi(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function yr(e){let[t,n]=e(),r=qe();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Uu=Object.defineProperty,Vu=(e,t,n)=>t in e?Uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wi=(e,t,n)=>(Vu(e,typeof t!="symbol"?t+"":t,n),n),Ei=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Ei||{});let zu={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}}},Hu=class ra extends bi{constructor(){super(...arguments),wi(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),wi(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new ra({stack:[]})}reduce(t,n){return _e(n.type,zu,t,n)}};const wr=new hi(()=>Hu.new());var Er={exports:{}},Sr={};/**
63
+ `))}else{let p=c.props,f=p==null?void 0:p.className,g=typeof f=="function"?(...M)=>mr(f(...M),s.className):mr(f,s.className),v=g?{className:g}:{},E=ri(c.props,bt(hr(s,["ref"])));for(let M in d)M in E&&delete d[M];return m.cloneElement(c,Object.assign({},E,d,a,{ref:o(uu(c),a.ref)},v))}return m.createElement(i,Object.assign({},hr(s,["ref"]),i!==m.Fragment&&a,i!==m.Fragment&&d),c)}function lu(){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 au(...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 ri(...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 oi(...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 Te(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function bt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function hr(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function uu(e){return m.version.split(".")[0]>="19"?e.props.ref:e.ref}function cu(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,ne(a=>(i||o(a),t==null?void 0:t(a)))]}function fu(e){let[t]=m.useState(e);return t}function ii(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))li(n,si(t,r),o);return n}function si(e,t){return e?e+"["+t+"]":t}function li(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())li(e,si(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,""]):ii(n,t,e)}function du(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 pu="span";var gr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(gr||{});function mu(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 Me()({ourProps:i,theirProps:o,slot:{},defaultTag:pu,name:"Hidden"})}let ai=Te(mu),hu=m.createContext(null);function gu({children:e}){let t=m.useContext(hu);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 vu({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=m.useState(null),u=$t();return m.useEffect(()=>{if(r&&i)return u.addEventListener(i,"reset",r)},[i,t,r]),m.createElement(gu,null,m.createElement(bu,{setForm:l,formId:t}),ii(e).map(([s,a])=>m.createElement(ai,{features:gr.Hidden,...bt({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:s,value:a,...o})})))}function bu({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:m.createElement(ai,{features:gr.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let xu=m.createContext(void 0);function ui(){return m.useContext(xu)}function vr(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function bn(e){return vr(e)&&"tagName"in e}function at(e){return bn(e)&&"accessKey"in e}function Dt(e){return bn(e)&&"tabIndex"in e}function yu(e){return bn(e)&&"style"in e}function wu(e){return at(e)&&e.nodeName==="IFRAME"}function ci(e){return at(e)&&e.nodeName==="INPUT"}function fi(e){return at(e)&&e.nodeName==="LABEL"}function Eu(e){return at(e)&&e.nodeName==="FIELDSET"}function di(e){return at(e)&&e.nodeName==="LEGEND"}function Su(e){return bn(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Cu(e){let t=e.parentElement,n=null;for(;t&&!Eu(t);)di(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Ou(n)?!1:r}function Ou(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(di(t))return!1;t=t.previousElementSibling}return!0}let pi=Symbol();function Tu(e,t=!0){return Object.assign(e,{[pi]:t})}function We(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=ne(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[pi]))?void 0:n}let br=m.createContext(null);br.displayName="DescriptionContext";function mi(){let e=m.useContext(br);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,mi),t}return e}function Nu(){var e,t;return(t=(e=m.useContext(br))==null?void 0:e.value)!=null?t:void 0}let Pu="p";function Lu(e,t){let n=m.useId(),r=pr(),{id:o=`headlessui-description-${n}`,...i}=e,l=mi(),u=We(t);ue(()=>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 Me()({ourProps:c,theirProps:i,slot:a,defaultTag:Pu,name:l.name||"Description"})}let Au=Te(Lu);Object.assign(Au,{});var ve=(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))(ve||{});let xn=m.createContext(null);xn.displayName="LabelContext";function hi(){let e=m.useContext(xn);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,hi),t}return e}function gi(e){var t,n,r;let o=(n=(t=m.useContext(xn))==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 $u({inherit:e=!1}={}){let t=gi(),[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=ne(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(xn.Provider,{value:u},i.children)},[r])]}let Du="label";function Mu(e,t){var n;let r=m.useId(),o=hi(),i=ui(),l=pr(),{id:u=`headlessui-label-${r}`,htmlFor:s=i??((n=o.props)==null?void 0:n.htmlFor),passive:a=!1,...c}=e,d=We(t);ue(()=>o.register(u),[u,o.register]);let p=ne(E=>{let M=E.currentTarget;if(!(E.target!==E.currentTarget&&Su(E.target))&&(fi(M)&&E.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(E),fi(M))){let w=document.getElementById(M.htmlFor);if(w){let N=w.getAttribute("disabled");if(N==="true"||N==="")return;let j=w.getAttribute("aria-disabled");if(j==="true"||j==="")return;(ci(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),Me()({ourProps:v,theirProps:c,slot:g,defaultTag:s?Du:"div",name:o.name||"Label"})}let Iu=Te(Mu),ju=Object.assign(Iu,{});function Fu(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 Ru(e=Fu){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 ku(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function _u(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),o=m.useMemo(()=>ku(e),[e,n]);return ue(()=>{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 vi=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 Wu=Object.defineProperty,Bu=(e,t,n)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uu=(e,t,n)=>(Bu(e,t+"",n),n),bi=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Be=(e,t,n)=>(bi(e,t,"read from private field"),n?n.call(e):t.get(e)),xr=(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)},xi=(e,t,n,r)=>(bi(e,t,"write to private field"),t.set(e,n),n),Je,qt,Xt;let yi=class{constructor(t){xr(this,Je,{}),xr(this,qt,new vi(()=>new Set)),xr(this,Xt,new Set),Uu(this,"disposables",Ke()),xi(this,Je,t),Qe.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Be(this,Je)}subscribe(t,n){if(Qe.isServer)return()=>{};let r={selector:t,callback:n,current:t(Be(this,Je))};return Be(this,Xt).add(r),this.disposables.add(()=>{Be(this,Xt).delete(r)})}on(t,n){return Qe.isServer?()=>{}:(Be(this,qt).get(t).add(n),this.disposables.add(()=>{Be(this,qt).get(t).delete(n)}))}send(t){let n=this.reduce(Be(this,Je),t);if(n!==Be(this,Je)){xi(this,Je,n);for(let r of Be(this,Xt)){let o=r.selector(Be(this,Je));wi(r.current,o)||(r.current=o,r.callback(o))}for(let r of Be(this,qt).get(t.type))r(Be(this,Je),t)}}};Je=new WeakMap,qt=new WeakMap,Xt=new WeakMap;function wi(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:yr(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:yr(e.entries(),t.entries()):Ei(e)&&Ei(t)?yr(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function yr(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 Ei(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function wr(e){let[t,n]=e(),r=Ke();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Vu=Object.defineProperty,zu=(e,t,n)=>t in e?Vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Si=(e,t,n)=>(zu(e,typeof t!="symbol"?t+"":t,n),n),Ci=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Ci||{});let Hu={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}}},Gu=class oa extends yi{constructor(){super(...arguments),Si(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Si(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new oa({stack:[]})}reduce(t,n){return _e(n.type,Hu,t,n)}};const Er=new vi(()=>Gu.new());var Sr={exports:{}},Cr={};/**
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 Si;function Gu(){if(Si)return Sr;Si=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 Sr.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 E(F){if(!M){if(M=!0,w=F,F=d(F),p!==void 0&&g.hasValue){var R=g.value;if(p(R,F))return N=R}return N=F}if(R=N,n(w,F))return R;var W=d(F);return p!==void 0&&p(R,W)?(w=F,R):(w=F,N=W)}var M=!1,w,N,j=c===void 0?null:c;return[function(){return E(a())},j===null?void 0:function(){return E(j())}]},[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},Sr}var Cr={};/**
71
+ */var Oi;function Yu(){if(Oi)return Cr;Oi=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 Cr.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 E(F){if(!M){if(M=!0,w=F,F=d(F),p!==void 0&&g.hasValue){var k=g.value;if(p(k,F))return N=k}return N=F}if(k=N,n(w,F))return k;var W=d(F);return p!==void 0&&p(k,W)?(w=F,k):(w=F,N=W)}var M=!1,w,N,j=c===void 0?null:c;return[function(){return E(a())},j===null?void 0:function(){return E(j())}]},[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},Cr}var Or={};/**
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 Ci;function Yu(){return Ci||(Ci=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;Cr.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 E(F){if(!M){if(M=!0,w=F,F=d(F),p!==void 0&&g.hasValue){var R=g.value;if(p(R,F))return N=R}return N=F}if(R=N,n(w,F))return R;var W=d(F);return p!==void 0&&p(R,W)?(w=F,R):(w=F,N=W)}var M=!1,w,N,j=c===void 0?null:c;return[function(){return E(a())},j===null?void 0:function(){return E(j())}]},[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())}()),Cr}process.env.NODE_ENV==="production"?Er.exports=Gu():Er.exports=Yu();var Ku=Er.exports;function Ue(e,t,n=xi){return Ku.useSyncExternalStoreWithSelector(ne(r=>e.subscribe(qu,r)),ne(()=>e.state),ne(()=>e.state),ne(t),n)}function qu(e){return e}function Oi(e,t){let n=m.useId(),r=wr.get(t),[o,i]=Ue(r,m.useCallback(l=>[r.selectors.isTop(l,n),r.selectors.inStack(l,n)],[r,n]));return ue(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?i?o:!0:!1}let Or=new Map,Qt=new Map;function Ti(e){var t;let n=(t=Qt.get(e))!=null?t:0;return Qt.set(e,n+1),n!==0?()=>Ni(e):(Or.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Ni(e))}function Ni(e){var t;let n=(t=Qt.get(e))!=null?t:1;if(n===1?Qt.delete(e):Qt.set(e,n-1),n!==1)return;let r=Or.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Or.delete(e))}function Xu(e,{allowed:t,disallowed:n}={}){let r=Oi(e,"inert-others");ue(()=>{var o,i;if(!r)return;let l=qe();for(let s of(o=n==null?void 0:n())!=null?o:[])s&&l.add(Ti(s));let u=(i=t==null?void 0:t())!=null?i:[];for(let s of u){if(!s)continue;let a=Kt(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(Ti(d));c=c.parentElement}}return l.dispose},[r,t,n])}function Qu(e,t,n){let r=Ot(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:ut(t)?t:t.current;if(!o)return;let i=qe();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 Tr=["[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(","),Ju=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Nr=(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))(Nr||{}),Zu=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Zu||{}),ec=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(ec||{});function Pi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Tr)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function tc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ju)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Pr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Pr||{});function Li(e,t=0){var n;return e===((n=Kt(e))==null?void 0:n.body)?!1:_e(t,{0(){return e.matches(Tr)},1(){let r=e;for(;r!==null;){if(r.matches(Tr))return!0;r=r.parentElement}return!1}})}var nc=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(nc||{});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 rc=["textarea","input"].join(",");function oc(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,rc))!=null?n:!1}function Ai(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 ic(e,t){return sc(Pi(),t,{relativeTo:e})}function sc(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?Ai(e):e:t&64?tc(e):Pi(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&&oc(p)&&p.select(),2}function $i(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function lc(){return/Android/gi.test(window.navigator.userAgent)}function Di(){return $i()||lc()}function Mt(e,t,n,r){let o=Ot(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 ac(e,t,n,r){let o=Ot(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 Mi=30;function uc(e,t,n){let r=Ot(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!Li(a,Pr.Loose)&&a.tabIndex!==-1&&u.preventDefault(),r.current(u,a)},[r,t]),i=m.useRef(null);Mt(e,"pointerdown",u=>{var s,a;Di()||(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(Di()||!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)>=Mi||Math.abs(s.y-l.current.y)>=Mi))return o(u,()=>Dt(u.target)?u.target:null)},!0),ac(e,"blur",u=>o(u,()=>yu(window.document.activeElement)?window.document.activeElement:null),!0)}function Lr(...e){return m.useMemo(()=>Kt(...e),[...e])}var cc=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(cc||{});const yn={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},fc=200,Ii=5;function dc(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=>{gr(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,!Dt(s.target))||Math.abs(s.x-((a=l.current)!=null?a:s.x))<Ii&&Math.abs(s.y-((c=u.current)!=null?c:s.y))<Ii)return;let p=n(s);switch(p.kind){case 0:return;case 1:{s.timeStamp-d>fc&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function pc(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 mc(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function hc(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 gc(){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 vc(){return $i()?{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=qe();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(Dt(u.target))try{let s=u.target.closest("a");if(!s)return;let{hash:a}=new URL(s.href),c=e.querySelector(a);Dt(c)&&!r(c)&&(l=c)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(Dt(u.target)&&xu(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(Dt(u.target)){if(ai(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 bc(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function xc(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Tt=hc(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:qe(),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:xc(n)},o=[vc(),gc(),bc()];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)}});Tt.subscribe(()=>{let e=Tt.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)&&Tt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Tt.dispatch("TEARDOWN",n)}});function yc(e,t,n=()=>({containers:[]})){let r=mc(Tt),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ue(()=>{if(!(!t||!e))return Tt.dispatch("PUSH",t,n),()=>Tt.dispatch("POP",t,n)},[e,t]),i}function wc(e,t,n=()=>[document.body]){let r=Oi(e,"scroll-lock");yc(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function ji(e){return[e.screenX,e.screenY]}function Ec(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=ji(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=ji(t)}}}function Sc(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 Fi,ki;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Fi=process==null?void 0:process.env)==null?void 0:Fi.NODE_ENV)==="test"&&typeof((ki=Element==null?void 0:Element.prototype)==null?void 0:ki.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 Cc=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Cc||{});function Ri(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function _i(e,t,n,r){let[o,i]=m.useState(n),{hasFlag:l,addFlag:u,removeFlag:s}=Sc(e&&o?3:0),a=m.useRef(!1),c=m.useRef(!1),d=$t();return ue(()=>{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),Oc(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 Oc(e,{prepare:t,run:n,done:r,inFlight:o}){let i=qe();return Nc(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Tc(e,r))})}),i.dispose}function Tc(e,t){var n,r;let o=qe();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 Nc(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 wn(){return typeof window<"u"}function It(e){return Ar(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function et(e){var t;return(t=(Ar(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ar(e){return wn()?e instanceof Node||e instanceof Ne(e).Node:!1}function oe(e){return wn()?e instanceof Element||e instanceof Ne(e).Element:!1}function Ee(e){return wn()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function $r(e){return!wn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}const Pc=new Set(["inline","contents"]);function Jt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Pc.has(o)}const Lc=new Set(["table","td","th"]);function Ac(e){return Lc.has(It(e))}const $c=[":popover-open",":modal"];function En(e){return $c.some(t=>{try{return e.matches(t)}catch{return!1}})}const Dc=["transform","translate","scale","rotate","perspective"],Mc=["transform","translate","scale","rotate","perspective","filter"],Ic=["paint","layout","strict","content"];function Dr(e){const t=Sn(),n=oe(e)?Ve(e):e;return Dc.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)||Mc.some(r=>(n.willChange||"").includes(r))||Ic.some(r=>(n.contain||"").includes(r))}function jc(e){let t=ft(e);for(;Ee(t)&&!ct(t);){if(Dr(t))return t;if(En(t))return null;t=ft(t)}return null}function Sn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Fc=new Set(["html","body","#document"]);function ct(e){return Fc.has(It(e))}function Ve(e){return Ne(e).getComputedStyle(e)}function Cn(e){return oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ft(e){if(It(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$r(e)&&e.host||et(e);return $r(t)?t.host:t}function Wi(e){const t=ft(e);return ct(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ee(t)&&Jt(t)?t:Wi(t)}function xt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Wi(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=Ne(o);if(i){const u=Mr(l);return t.concat(l,l.visualViewport||[],Jt(o)?o:[],u&&n?xt(u):[])}return t.concat(o,xt(o,[],n))}function Mr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function kc(){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 dt=Math.min,xe=Math.max,Zt=Math.round,On=Math.floor,tt=e=>({x:e,y:e}),Rc={left:"right",right:"left",bottom:"top",top:"bottom"},_c={start:"end",end:"start"};function Ir(e,t,n){return xe(e,dt(t,n))}function Nt(e,t){return typeof e=="function"?e(t):e}function yt(e){return e.split("-")[0]}function jt(e){return e.split("-")[1]}function Bi(e){return e==="x"?"y":"x"}function jr(e){return e==="y"?"height":"width"}const Wc=new Set(["top","bottom"]);function pt(e){return Wc.has(yt(e))?"y":"x"}function Fr(e){return Bi(pt(e))}function Bc(e,t,n){n===void 0&&(n=!1);const r=jt(e),o=Fr(e),i=jr(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Tn(l)),[l,Tn(l)]}function Uc(e){const t=Tn(e);return[kr(e),t,kr(t)]}function kr(e){return e.replace(/start|end/g,t=>_c[t])}const Ui=["left","right"],Vi=["right","left"],Vc=["top","bottom"],zc=["bottom","top"];function Hc(e,t,n){switch(e){case"top":case"bottom":return n?t?Vi:Ui:t?Ui:Vi;case"left":case"right":return t?Vc:zc;default:return[]}}function Gc(e,t,n,r){const o=jt(e);let i=Hc(yt(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(kr)))),i}function Tn(e){return e.replace(/left|right|bottom|top/g,t=>Rc[t])}function Yc(e){return{top:0,right:0,bottom:0,left:0,...e}}function zi(e){return typeof e!="number"?Yc(e):{top:e,right:e,bottom:e,left:e}}function Nn(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 Ti;function Ku(){return Ti||(Ti=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;Or.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 E(F){if(!M){if(M=!0,w=F,F=d(F),p!==void 0&&g.hasValue){var k=g.value;if(p(k,F))return N=k}return N=F}if(k=N,n(w,F))return k;var W=d(F);return p!==void 0&&p(k,W)?(w=F,k):(w=F,N=W)}var M=!1,w,N,j=c===void 0?null:c;return[function(){return E(a())},j===null?void 0:function(){return E(j())}]},[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())}()),Or}process.env.NODE_ENV==="production"?Sr.exports=Yu():Sr.exports=Ku();var qu=Sr.exports;function Ue(e,t,n=wi){return qu.useSyncExternalStoreWithSelector(ne(r=>e.subscribe(Xu,r)),ne(()=>e.state),ne(()=>e.state),ne(t),n)}function Xu(e){return e}function Ni(e,t){let n=m.useId(),r=Er.get(t),[o,i]=Ue(r,m.useCallback(l=>[r.selectors.isTop(l,n),r.selectors.inStack(l,n)],[r,n]));return ue(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?i?o:!0:!1}let Tr=new Map,Qt=new Map;function Pi(e){var t;let n=(t=Qt.get(e))!=null?t:0;return Qt.set(e,n+1),n!==0?()=>Li(e):(Tr.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Li(e))}function Li(e){var t;let n=(t=Qt.get(e))!=null?t:1;if(n===1?Qt.delete(e):Qt.set(e,n-1),n!==1)return;let r=Tr.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Tr.delete(e))}function Qu(e,{allowed:t,disallowed:n}={}){let r=Ni(e,"inert-others");ue(()=>{var o,i;if(!r)return;let l=Ke();for(let s of(o=n==null?void 0:n())!=null?o:[])s&&l.add(Pi(s));let u=(i=t==null?void 0:t())!=null?i:[];for(let s of u){if(!s)continue;let a=Kt(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(Pi(d));c=c.parentElement}}return l.dispose},[r,t,n])}function Ju(e,t,n){let r=Ot(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:at(t)?t:t.current;if(!o)return;let i=Ke();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 Nr=["[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 Pr=(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))(Pr||{}),ec=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(ec||{}),tc=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(tc||{});function Ai(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Nr)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function nc(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 Lr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Lr||{});function $i(e,t=0){var n;return e===((n=Kt(e))==null?void 0:n.body)?!1:_e(t,{0(){return e.matches(Nr)},1(){let r=e;for(;r!==null;){if(r.matches(Nr))return!0;r=r.parentElement}return!1}})}var rc=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(rc||{});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 oc=["textarea","input"].join(",");function ic(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,oc))!=null?n:!1}function Di(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 sc(e,t){return lc(Ai(),t,{relativeTo:e})}function lc(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?Di(e):e:t&64?nc(e):Ai(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&&ic(p)&&p.select(),2}function Mi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ac(){return/Android/gi.test(window.navigator.userAgent)}function Ii(){return Mi()||ac()}function Mt(e,t,n,r){let o=Ot(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 uc(e,t,n,r){let o=Ot(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 ji=30;function cc(e,t,n){let r=Ot(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!$i(a,Lr.Loose)&&a.tabIndex!==-1&&u.preventDefault(),r.current(u,a)},[r,t]),i=m.useRef(null);Mt(e,"pointerdown",u=>{var s,a;Ii()||(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(Ii()||!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)>=ji||Math.abs(s.y-l.current.y)>=ji))return o(u,()=>Dt(u.target)?u.target:null)},!0),uc(e,"blur",u=>o(u,()=>wu(window.document.activeElement)?window.document.activeElement:null),!0)}function Ar(...e){return m.useMemo(()=>Kt(...e),[...e])}var fc=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(fc||{});const yn={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},dc=200,Fi=5;function pc(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=>{vr(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,!Dt(s.target))||Math.abs(s.x-((a=l.current)!=null?a:s.x))<Fi&&Math.abs(s.y-((c=u.current)!=null?c:s.y))<Fi)return;let p=n(s);switch(p.kind){case 0:return;case 1:{s.timeStamp-d>dc&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function mc(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 hc(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function gc(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 vc(){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 bc(){return Mi()?{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=Ke();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(Dt(u.target))try{let s=u.target.closest("a");if(!s)return;let{hash:a}=new URL(s.href),c=e.querySelector(a);Dt(c)&&!r(c)&&(l=c)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(Dt(u.target)&&yu(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(Dt(u.target)){if(ci(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 xc(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function yc(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Tt=gc(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Ke(),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:yc(n)},o=[bc(),vc(),xc()];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)}});Tt.subscribe(()=>{let e=Tt.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)&&Tt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Tt.dispatch("TEARDOWN",n)}});function wc(e,t,n=()=>({containers:[]})){let r=hc(Tt),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ue(()=>{if(!(!t||!e))return Tt.dispatch("PUSH",t,n),()=>Tt.dispatch("POP",t,n)},[e,t]),i}function Ec(e,t,n=()=>[document.body]){let r=Ni(e,"scroll-lock");wc(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Ri(e){return[e.screenX,e.screenY]}function Sc(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=Ri(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Ri(t)}}}function Cc(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 ki,_i;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ki=process==null?void 0:process.env)==null?void 0:ki.NODE_ENV)==="test"&&typeof((_i=Element==null?void 0:Element.prototype)==null?void 0:_i.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 Oc=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Oc||{});function Wi(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Bi(e,t,n,r){let[o,i]=m.useState(n),{hasFlag:l,addFlag:u,removeFlag:s}=Cc(e&&o?3:0),a=m.useRef(!1),c=m.useRef(!1),d=$t();return ue(()=>{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),Tc(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 Tc(e,{prepare:t,run:n,done:r,inFlight:o}){let i=Ke();return Pc(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Nc(e,r))})}),i.dispose}function Nc(e,t){var n,r;let o=Ke();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 Pc(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 wn(){return typeof window<"u"}function It(e){return $r(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ze(e){var t;return(t=($r(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $r(e){return wn()?e instanceof Node||e instanceof Ne(e).Node:!1}function oe(e){return wn()?e instanceof Element||e instanceof Ne(e).Element:!1}function Ee(e){return wn()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function Dr(e){return!wn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}const Lc=new Set(["inline","contents"]);function Jt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Lc.has(o)}const Ac=new Set(["table","td","th"]);function $c(e){return Ac.has(It(e))}const Dc=[":popover-open",":modal"];function En(e){return Dc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Mc=["transform","translate","scale","rotate","perspective"],Ic=["transform","translate","scale","rotate","perspective","filter"],jc=["paint","layout","strict","content"];function Mr(e){const t=Sn(),n=oe(e)?Ve(e):e;return Mc.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)||Ic.some(r=>(n.willChange||"").includes(r))||jc.some(r=>(n.contain||"").includes(r))}function Fc(e){let t=ct(e);for(;Ee(t)&&!ut(t);){if(Mr(t))return t;if(En(t))return null;t=ct(t)}return null}function Sn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Rc=new Set(["html","body","#document"]);function ut(e){return Rc.has(It(e))}function Ve(e){return Ne(e).getComputedStyle(e)}function Cn(e){return oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ct(e){if(It(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dr(e)&&e.host||Ze(e);return Dr(t)?t.host:t}function Ui(e){const t=ct(e);return ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ee(t)&&Jt(t)?t:Ui(t)}function xt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ui(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=Ne(o);if(i){const u=Ir(l);return t.concat(l,l.visualViewport||[],Jt(o)?o:[],u&&n?xt(u):[])}return t.concat(o,xt(o,[],n))}function Ir(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function kc(){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 ft=Math.min,xe=Math.max,Zt=Math.round,On=Math.floor,et=e=>({x:e,y:e}),_c={left:"right",right:"left",bottom:"top",top:"bottom"},Wc={start:"end",end:"start"};function jr(e,t,n){return xe(e,ft(t,n))}function Nt(e,t){return typeof e=="function"?e(t):e}function yt(e){return e.split("-")[0]}function jt(e){return e.split("-")[1]}function Vi(e){return e==="x"?"y":"x"}function Fr(e){return e==="y"?"height":"width"}const Bc=new Set(["top","bottom"]);function dt(e){return Bc.has(yt(e))?"y":"x"}function Rr(e){return Vi(dt(e))}function Uc(e,t,n){n===void 0&&(n=!1);const r=jt(e),o=Rr(e),i=Fr(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Tn(l)),[l,Tn(l)]}function Vc(e){const t=Tn(e);return[kr(e),t,kr(t)]}function kr(e){return e.replace(/start|end/g,t=>Wc[t])}const zi=["left","right"],Hi=["right","left"],zc=["top","bottom"],Hc=["bottom","top"];function Gc(e,t,n){switch(e){case"top":case"bottom":return n?t?Hi:zi:t?zi:Hi;case"left":case"right":return t?zc:Hc;default:return[]}}function Yc(e,t,n,r){const o=jt(e);let i=Gc(yt(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(kr)))),i}function Tn(e){return e.replace(/left|right|bottom|top/g,t=>_c[t])}function Kc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gi(e){return typeof e!="number"?Kc(e):{top:e,right:e,bottom:e,left:e}}function Nn(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 Kc=["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])"],Rr=Kc.join(","),Hi=typeof Element>"u",en=Hi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Pn=!Hi&&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},Ln=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},qc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Xc=function(t,n,r){if(Ln(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Rr));return n&&en.call(t,Rr)&&o.unshift(t),o=o.filter(r),o},Qc=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Ln(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=en.call(l,Rr);c&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var d=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),p=!Ln(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},Gi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Yi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||qc(t))&&!Gi(t)?0:t.tabIndex},Jc=function(t,n){var r=Yi(t);return r<0&&n&&!Gi(t)?0:r},Zc=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ki=function(t){return t.tagName==="INPUT"},ef=function(t){return Ki(t)&&t.type==="hidden"},tf=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},nf=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},rf=function(t){if(!t.name)return!0;var n=t.form||Pn(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=nf(o,t.form);return!i||i===t},of=function(t){return Ki(t)&&t.type==="radio"},sf=function(t){return of(t)&&!rf(t)},lf=function(t){var n,r=t&&Pn(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=Pn(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},qi=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},af=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=en.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(en.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=Pn(t);if(s&&!s.shadowRoot&&o(s)===!0)return qi(t);t.assignedSlot?t=t.assignedSlot:!s&&a!==t.ownerDocument?t=a.host:t=s}t=u}if(lf(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return qi(t);return!1},uf=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 en.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},cf=function(t,n){return!(n.disabled||Ln(n)||ef(n)||af(n,t)||tf(n)||uf(n))},Xi=function(t,n){return!(sf(n)||Yi(n)<0||!cf(t,n))},ff=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},df=function e(t){var n=[],r=[];return t.forEach(function(o,i){var l=!!o.scopeParent,u=l?o.scopeParent:o,s=Jc(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(Zc).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Qi=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Qc([t],n.includeContainer,{filter:Xi.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ff}):r=Xc(t,n.includeContainer,Xi.bind(null,n)),df(r)};function Ji(e,t,n){let{reference:r,floating:o}=e;const i=pt(t),l=Fr(t),u=jr(l),s=yt(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(jt(t)){case"start":f[l]-=p*(n&&a?-1:1);break;case"end":f[l]+=p*(n&&a?-1:1);break}return f}const pf=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}=Ji(a,r,s),p=r,f={},g=0;for(let v=0;v<u.length;v++){const{name:E,fn:M}=u[v],{x:w,y:N,data:j,reset:F}=await M({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,[E]:{...f[E],...j}},F&&g<=50&&(g++,typeof F=="object"&&(F.placement&&(p=F.placement),F.rects&&(a=F.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):F.rects),{x:c,y:d}=Ji(a,p,s)),v=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}};async function An(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}=Nt(t,e),g=zi(f),E=u[p?d==="floating"?"reference":"floating":d],M=Nn(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: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)),j=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},F=Nn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:w,offsetParent:N,strategy:s}):w);return{top:(M.top-F.top+g.top)/j.y,bottom:(F.bottom-M.bottom+g.bottom)/j.y,left:(M.left-F.left+g.left)/j.x,right:(F.right-M.right+g.right)/j.x}}const mf=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}=Nt(e,t)||{};if(a==null)return{};const d=zi(c),p={x:n,y:r},f=Fr(o),g=jr(f),v=await l.getDimensions(a),E=f==="y",M=E?"top":"left",w=E?"bottom":"right",N=E?"clientHeight":"clientWidth",j=i.reference[g]+i.reference[f]-p[f]-i.floating[g],F=p[f]-i.reference[f],R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a));let W=R?R[N]:0;(!W||!await(l.isElement==null?void 0:l.isElement(R)))&&(W=u.floating[N]||i.floating[g]);const h=j/2-F/2,b=W/2-v[g]/2-1,x=dt(d[M],b),$=dt(d[w],b),A=x,P=W-v[g]-$,S=W/2-v[g]/2+h,O=Ir(A,S,P),T=!s.arrow&&jt(o)!=null&&S!==O&&i.reference[g]/2-(S<A?x:$)-v[g]/2<0,L=T?S<A?S-A:S-P:0;return{[f]:p[f]+L,data:{[f]:O,centerOffset:S-O-L,...T&&{alignmentOffset:L}},reset:T}}}),hf=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,...E}=Nt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const M=yt(o),w=pt(u),N=yt(u)===u,j=await(s.isRTL==null?void 0:s.isRTL(a.floating)),F=p||(N||!v?[Tn(u)]:Uc(u)),R=g!=="none";!p&&R&&F.push(...Gc(u,v,g,j));const W=[u,...F],h=await An(t,E),b=[];let x=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&b.push(h[M]),d){const S=Bc(o,l,j);b.push(h[S[0]],h[S[1]])}if(x=[...x,{placement:o,overflows:b}],!b.every(S=>S<=0)){var $,A;const S=((($=i.flip)==null?void 0:$.index)||0)+1,O=W[S];if(O&&(!(d==="alignment"?w!==pt(O):!1)||x.every(y=>pt(y.placement)===w?y.overflows[0]>0:!0)))return{data:{index:S,overflows:x},reset:{placement:O}};let T=(A=x.filter(L=>L.overflows[0]<=0).sort((L,y)=>L.overflows[1]-y.overflows[1])[0])==null?void 0:A.placement;if(!T)switch(f){case"bestFit":{var P;const L=(P=x.filter(y=>{if(R){const I=pt(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:P[0];L&&(T=L);break}case"initialPlacement":T=u;break}if(o!==T)return{reset:{placement:T}}}return{}}}},gf=new Set(["left","top"]);async function vf(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=yt(n),u=jt(n),s=pt(n)==="y",a=gf.has(l)?-1:1,c=i&&s?-1:1,d=Nt(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 bf=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 vf(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}}}}},xf=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:E=>{let{x:M,y:w}=E;return{x:M,y:w}}},...s}=Nt(e,t),a={x:n,y:r},c=await An(t,s),d=pt(yt(o)),p=Bi(d);let f=a[p],g=a[d];if(i){const E=p==="y"?"top":"left",M=p==="y"?"bottom":"right",w=f+c[E],N=f-c[M];f=Ir(w,f,N)}if(l){const E=d==="y"?"top":"left",M=d==="y"?"bottom":"right",w=g+c[E],N=g-c[M];g=Ir(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}}}}}},yf=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}=Nt(e,t),c=await An(t,a),d=yt(o),p=jt(o),f=pt(o)==="y",{width:g,height:v}=i.floating;let E,M;d==="top"||d==="bottom"?(E=d,M=p===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(M=d,E=p==="end"?"top":"bottom");const w=v-c.top-c.bottom,N=g-c.left-c.right,j=dt(v-c[E],w),F=dt(g-c[M],N),R=!t.middlewareData.shift;let W=j,h=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(h=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=w),R&&!p){const x=xe(c.left,0),$=xe(c.right,0),A=xe(c.top,0),P=xe(c.bottom,0);f?h=g-2*(x!==0||$!==0?x+$:xe(c.left,c.right)):W=v-2*(A!==0||P!==0?A+P:xe(c.top,c.bottom))}await s({...t,availableWidth:h,availableHeight:W});const b=await l.getDimensions(u.floating);return g!==b.width||v!==b.height?{reset:{rects:!0}}:{}}}};function Zi(e){const t=Ve(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=Zt(n)!==i||Zt(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function _r(e){return oe(e)?e:e.contextElement}function Ft(e){const t=_r(e);if(!Ee(t))return tt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Zi(t);let l=(i?Zt(n.width):n.width)/r,u=(i?Zt(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const wf=tt(0);function es(e){const t=Ne(e);return!Sn()||!t.visualViewport?wf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ef(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function Pt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=_r(e);let l=tt(1);t&&(r?oe(r)&&(l=Ft(r)):l=Ft(e));const u=Ef(i,n,r)?es(i):tt(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=Ne(i),f=r&&oe(r)?Ne(r):r;let g=p,v=Mr(g);for(;v&&r&&f!==g;){const E=Ft(v),M=v.getBoundingClientRect(),w=Ve(v),N=M.left+(v.clientLeft+parseFloat(w.paddingLeft))*E.x,j=M.top+(v.clientTop+parseFloat(w.paddingTop))*E.y;s*=E.x,a*=E.y,c*=E.x,d*=E.y,s+=N,a+=j,g=Ne(v),v=Mr(g)}}return Nn({width:c,height:d,x:s,y:a})}function $n(e,t){const n=Cn(e).scrollLeft;return t?t.left+n:Pt(et(e)).left+n}function ts(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-$n(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Sf(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=et(r),u=t?En(t.floating):!1;if(r===l||u&&i)return n;let s={scrollLeft:0,scrollTop:0},a=tt(1);const c=tt(0),d=Ee(r);if((d||!d&&!i)&&((It(r)!=="body"||Jt(l))&&(s=Cn(r)),Ee(r))){const f=Pt(r);a=Ft(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}const p=l&&!d&&!i?ts(l,s):tt(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 Cf(e){return Array.from(e.getClientRects())}function Of(e){const t=et(e),n=Cn(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+$n(e);const u=-n.scrollTop;return Ve(r).direction==="rtl"&&(l+=xe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}const ns=25;function Tf(e,t){const n=Ne(e),r=et(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=Sn();(!c||c&&t==="fixed")&&(u=o.offsetLeft,s=o.offsetTop)}const a=$n(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<=ns&&(i-=g)}else a<=ns&&(i+=a);return{width:i,height:l,x:u,y:s}}const Nf=new Set(["absolute","fixed"]);function Pf(e,t){const n=Pt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ee(e)?Ft(e):tt(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 rs(e,t,n){let r;if(t==="viewport")r=Tf(e,n);else if(t==="document")r=Of(et(e));else if(oe(t))r=Pf(t,n);else{const o=es(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Nn(r)}function os(e,t){const n=ft(e);return n===t||!oe(n)||ct(n)?!1:Ve(n).position==="fixed"||os(n,t)}function Lf(e,t){const n=t.get(e);if(n)return n;let r=xt(e,[],!1).filter(u=>oe(u)&&It(u)!=="body"),o=null;const i=Ve(e).position==="fixed";let l=i?ft(e):e;for(;oe(l)&&!ct(l);){const u=Ve(l),s=Dr(l);!s&&u.position==="fixed"&&(o=null),(i?!s&&!o:!s&&u.position==="static"&&!!o&&Nf.has(o.position)||Jt(l)&&!s&&os(e,l))?r=r.filter(c=>c!==l):o=u,l=ft(l)}return t.set(e,r),r}function Af(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?En(t)?[]:Lf(t,this._c):[].concat(n),r],u=l[0],s=l.reduce((a,c)=>{const d=rs(t,c,o);return a.top=xe(d.top,a.top),a.right=dt(d.right,a.right),a.bottom=dt(d.bottom,a.bottom),a.left=xe(d.left,a.left),a},rs(t,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function $f(e){const{width:t,height:n}=Zi(e);return{width:t,height:n}}function Df(e,t,n){const r=Ee(t),o=et(t),i=n==="fixed",l=Pt(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const s=tt(0);function a(){s.x=$n(o)}if(r||!r&&!i)if((It(t)!=="body"||Jt(o))&&(u=Cn(t)),r){const f=Pt(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?ts(o,u):tt(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 Wr(e){return Ve(e).position==="static"}function is(e,t){if(!Ee(e)||Ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return et(e)===n&&(n=n.ownerDocument.body),n}function ss(e,t){const n=Ne(e);if(En(e))return n;if(!Ee(e)){let o=ft(e);for(;o&&!ct(o);){if(oe(o)&&!Wr(o))return o;o=ft(o)}return n}let r=is(e,t);for(;r&&Ac(r)&&Wr(r);)r=is(r,t);return r&&ct(r)&&Wr(r)&&!Dr(r)?n:r||jc(e)||n}const Mf=async function(e){const t=this.getOffsetParent||ss,n=this.getDimensions,r=await n(e.floating);return{reference:Df(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function If(e){return Ve(e).direction==="rtl"}const jf={convertOffsetParentRelativeRectToViewportRelativeRect:Sf,getDocumentElement:et,getClippingRect:Af,getOffsetParent:ss,getElementRects:Mf,getClientRects:Cf,getDimensions:$f,getScale:Ft,isElement:oe,isRTL:If};function ls(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ff(e,t){let n=null,r;const o=et(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=On(d),v=On(o.clientWidth-(c+p)),E=On(o.clientHeight-(d+f)),M=On(c),N={rootMargin:-g+"px "+-v+"px "+-E+"px "+-M+"px",threshold:xe(0,dt(1,s))||1};let j=!0;function F(R){const W=R[0].intersectionRatio;if(W!==s){if(!j)return l();W?l(!1,W):r=setTimeout(()=>{l(!1,1e-7)},1e3)}W===1&&!ls(a,e.getBoundingClientRect())&&l(),j=!1}try{n=new IntersectionObserver(F,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(F,N)}n.observe(e)}return l(!0),i}function as(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=_r(e),c=o||i?[...a?xt(a):[],...xt(t)]:[];c.forEach(M=>{o&&M.addEventListener("scroll",n,{passive:!0}),i&&M.addEventListener("resize",n)});const d=a&&u?Ff(a,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(M=>{let[w]=M;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?Pt(e):null;s&&E();function E(){const M=Pt(e);v&&!ls(v,M)&&n(),v=M,g=requestAnimationFrame(E)}return n(),()=>{var M;c.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(M=f)==null||M.disconnect(),f=null,s&&cancelAnimationFrame(g)}}const Br=An,kf=bf,Rf=xf,_f=hf,Wf=yf,us=mf,Bf=(e,t,n)=>{const r=new Map,o={platform:jf,...n},i={...o.platform,_c:r};return pf(e,t,{...o,platform:i})};var Uf=typeof document<"u",Vf=function(){},Dn=Uf?m.useLayoutEffect:Vf;function Mn(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(!Mn(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)&&!Mn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function cs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fs(e,t){const n=cs(e);return Math.round(t*n)/n}function Ur(e){const t=k.useRef(e);return Dn(()=>{t.current=e}),t}function ds(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]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=k.useState(r);Mn(p,r)||f(r);const[g,v]=k.useState(null),[E,M]=k.useState(null),w=k.useCallback(y=>{y!==R.current&&(R.current=y,v(y))},[]),N=k.useCallback(y=>{y!==W.current&&(W.current=y,M(y))},[]),j=i||g,F=l||E,R=k.useRef(null),W=k.useRef(null),h=k.useRef(c),b=s!=null,x=Ur(s),$=Ur(o),A=Ur(a),P=k.useCallback(()=>{if(!R.current||!W.current)return;const y={placement:t,strategy:n,middleware:p};$.current&&(y.platform=$.current),Bf(R.current,W.current,y).then(I=>{const _={...I,isPositioned:A.current!==!1};S.current&&!Mn(h.current,_)&&(h.current=_,Vt.flushSync(()=>{d(_)}))})},[p,t,n,$,A]);Dn(()=>{a===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,d(y=>({...y,isPositioned:!1})))},[a]);const S=k.useRef(!1);Dn(()=>(S.current=!0,()=>{S.current=!1}),[]),Dn(()=>{if(j&&(R.current=j),F&&(W.current=F),j&&F){if(x.current)return x.current(j,F,P);P()}},[j,F,P,x,b]);const O=k.useMemo(()=>({reference:R,floating:W,setReference:w,setFloating:N}),[w,N]),T=k.useMemo(()=>({reference:j,floating:F}),[j,F]),L=k.useMemo(()=>{const y={position:n,left:0,top:0};if(!T.floating)return y;const I=fs(T.floating,c.x),_=fs(T.floating,c.y);return u?{...y,transform:"translate("+I+"px, "+_+"px)",...cs(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:_}},[n,u,T.floating,c.x,c.y]);return k.useMemo(()=>({...c,update:P,refs:O,elements:T,floatingStyles:L}),[c,P,O,T,L])}const zf=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?us({element:r.current,padding:o}).fn(n):{}:r?us({element:r,padding:o}).fn(n):{}}}},Vr=(e,t)=>({...kf(e),options:[e,t]}),ps=(e,t)=>({...Rf(e),options:[e,t]}),ms=(e,t)=>({..._f(e),options:[e,t]}),Hf=(e,t)=>({...Wf(e),options:[e,t]}),Gf=(e,t)=>({...zf(e),options:[e,t]}),hs={...k},Yf=hs.useInsertionEffect||(e=>e());function gs(e){const t=k.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Yf(()=>{t.current=e}),k.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 zr=typeof document<"u"?m.useLayoutEffect:m.useEffect;let vs=!1,Kf=0;const bs=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Kf++;function qf(){const[e,t]=k.useState(()=>vs?bs():void 0);return zr(()=>{e==null&&t(bs())},[]),k.useEffect(()=>{vs=!0},[]),e}const Xf=hs.useId||qf;let tn;process.env.NODE_ENV!=="production"&&(tn=new Set);function Qf(){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=tn)!=null&&e.has(o))){var i;(i=tn)==null||i.add(o),console.warn(o)}}function Jf(){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=tn)!=null&&e.has(o))){var i;(i=tn)==null||i.add(o),console.error(o)}}function Zf(){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 ed=k.createContext(null),td=k.createContext(null),nd=()=>{var e;return((e=k.useContext(ed))==null?void 0:e.id)||null},rd=()=>k.useContext(td),od="data-floating-ui-focusable";function id(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Xf(),i=k.useRef({}),[l]=k.useState(()=>Zf()),u=nd()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&Jf("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]=k.useState(r.reference),c=gs((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=k.useMemo(()=>({setPositionReference:a}),[]),p=k.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return k.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function sd(e){e===void 0&&(e={});const{nodeId:t}=e,n=id({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=k.useState(null),[u,s]=k.useState(null),c=(o==null?void 0:o.domReference)||i,d=k.useRef(null),p=rd();zr(()=>{c&&(d.current=c)},[c]);const f=ds({...e,elements:{...o,...u&&{reference:u}}}),g=k.useCallback(N=>{const j=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;s(j),f.refs.setReference(j)},[f.refs]),v=k.useCallback(N=>{(oe(N)||N===null)&&(d.current=N,l(N)),(oe(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!oe(N))&&f.refs.setReference(N)},[f.refs]),E=k.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),M=k.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=k.useMemo(()=>({...f,...r,refs:E,elements:M,nodeId:t}),[f,E,M,t,r]);return zr(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(j=>j.id===t);N&&(N.context=w)}),k.useMemo(()=>({...f,context:w,refs:E,elements:M}),[f,E,M,w])}const xs="active",ys="selected";function Hr(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[xs]:l,[ys]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[od]:""},...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&&[xs,ys].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(E=>E(...g)).find(E=>E!==void 0)}}}else l[a]=c}),l),{})}}function ld(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=k.useCallback(u=>Hr(u,e,"reference"),t),i=k.useCallback(u=>Hr(u,e,"floating"),n),l=k.useCallback(u=>Hr(u,e,"item"),r);return k.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}function ws(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const ad=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}=Nt(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,E=p.clientTop!==0,M=g.clientTop!==0,w=p===g;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Qf('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const N={...t,...await Vr(-f.offsetTop-p.clientTop-d.reference.height/2-f.offsetHeight/2-i).fn(t)},j=await Br(ws(N,g.scrollHeight+v+p.clientTop),c),F=await Br(N,{...c,elementContext:"reference"}),R=xe(0,j.top),W=N.y+R,x=(g.scrollHeight>g.clientHeight?$=>$:Zt)(xe(0,g.scrollHeight+(E&&w||M?v*2:0)-R-xe(0,j.bottom)));if(g.style.maxHeight=x+"px",g.scrollTop=R,o){const $=g.offsetHeight<f.offsetHeight*dt(u,n.current.length)-1||F.top>=-s||F.bottom>=-s;Vt.flushSync(()=>o($))}return r&&(r.current=await Br(ws({...N,y:W},g.offsetHeight+v+p.clientTop),c)),{y:W}}});function ud(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:l,onChange:u}=t,s=gs(u),a=k.useRef(!1),c=k.useRef(null),d=k.useRef(null);k.useEffect(()=>{if(!o)return;function f(v){if(v.ctrlKey||!g||i.current==null)return;const E=v.deltaY,M=i.current.top>=-.5,w=i.current.bottom>=-.5,N=g.scrollHeight-g.clientHeight,j=E<0?-1:1,F=E<0?"max":"min";g.scrollHeight<=g.clientHeight||(!M&&E>0||!w&&E<0?(v.preventDefault(),Vt.flushSync(()=>{s(R=>R+Math[F](E,N*j))})):/firefox/i.test(kc())&&(g.scrollTop+=E))}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=k.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)&&Vt.flushSync(()=>s(v=>v+g))}requestAnimationFrame(()=>{c.current=f.scrollTop})}}}),[r.floating,s,i,l]);return k.useMemo(()=>o?{floating:p}:{},[o,p])}let kt=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});kt.displayName="FloatingContext";let Gr=m.createContext(null);Gr.displayName="PlacementContext";function cd(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function fd(){return m.useContext(kt).setReference}function dd(){return m.useContext(kt).getReferenceProps}function pd(){let{getFloatingProps:e,slot:t}=m.useContext(kt);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function md(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Gr),n=m.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var l;return(l=i==null?void 0:i.outerHTML)!=null?l:i})]);ue(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(kt);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Es=4;function hd({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);gd(u);let a=t&&n!==null&&u!==null,{to:c="bottom",gap:d=0,offset:p=0,padding:f=0,inner:g}=vd(n,u),[v,E="center"]=c.split(" ");ue(()=>{a&&i(0)},[a]);let{refs:M,floatingStyles:w,context:N}=sd({open:a,placement:v==="selection"?E==="center"?"bottom":`bottom-${E}`:E==="center"?`${v}`:`${v}-${E}`,strategy:"absolute",transform:!1,middleware:[Vr({mainAxis:v==="selection"?0:d,crossAxis:p}),ps({padding:f}),v!=="selection"&&ms({padding:f}),v==="selection"&&g?ad({...g,padding:f,overflowRef:l,offset:o,minItemsVisible:Es,referenceOverflowThreshold:f,onFallbackChange($){var A,P;if(!$)return;let S=N.elements.floating;if(!S)return;let O=parseFloat(getComputedStyle(S).scrollPaddingBottom)||0,T=Math.min(Es,S.childElementCount),L=0,y=0;for(let I of(P=(A=N.elements.floating)==null?void 0:A.childNodes)!=null?P:[])if(ut(I)){let _=I.offsetTop,V=_+I.clientHeight+O,z=S.scrollTop,G=z+S.clientHeight;if(_>=z&&V<=G)T--;else{y=Math.max(0,Math.min(V,G)-Math.max(_,z)),L=I.clientHeight;break}}T>=1&&i(I=>{let _=L*T-y+O;return I>=_?I:_})}}):null,Hf({padding:f,apply({availableWidth:$,availableHeight:A,elements:P}){Object.assign(P.floating.style,{overflow:"auto",maxWidth:`${$}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${A}px)`})}})].filter(Boolean),whileElementsMounted:as}),[j=v,F=E]=N.placement.split("-");v==="selection"&&(j="selection");let R=m.useMemo(()=>({anchor:[j,F].filter(Boolean).join(" ")}),[j,F]),W=ud(N,{overflowRef:l,onChange:i}),{getReferenceProps:h,getFloatingProps:b}=ld([W]),x=ne($=>{s($),M.setFloating($)});return k.createElement(Gr.Provider,{value:r},k.createElement(kt.Provider,{value:{setFloating:x,setReference:M.setReference,styles:w,getReferenceProps:h,getFloatingProps:b,slot:R}},e))}function gd(e){ue(()=>{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 vd(e,t){var n,r,o;let i=Yr((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),l=Yr((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),u=Yr((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:l,padding:u}}function Yr(e,t,n=void 0){let r=$t(),o=ne((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=Cs(s,a);return[c,d=>{let p=Ss(s);{let f=p.map(g=>window.getComputedStyle(a).getPropertyValue(g));r.requestAnimationFrame(function g(){r.nextFrame(g);let v=!1;for(let[M,w]of p.entries()){let N=window.getComputedStyle(a).getPropertyValue(w);if(f[M]!==N){f[M]=N,v=!0;break}}if(!v)return;let E=Cs(s,a);c!==E&&(d(E),c=E)})}return r.dispose}]}return[n,null]}),i=m.useMemo(()=>o(e,t)[0],[e,t]),[l=i,u]=m.useState();return ue(()=>{let[s,a]=o(e,t);if(u(s),!!a)return a(u)},[e,t]),l}function Ss(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,...Ss(o)]:[r]}return[]}function Cs(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 bd(e,t){let[n,r]=m.useState(t);return!e&&n!==t&&r(t),e?n:t}let Kr=m.createContext(null);Kr.displayName="OpenClosedContext";var Xe=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Xe||{});function qr(){return m.useContext(Kr)}function Os({value:e,children:t}){return m.createElement(Kr.Provider,{value:e},t)}function xd(e){throw new Error("Unexpected object: "+e)}var fe=(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))(fe||{});function In(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:xd(e)}}var Ts=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ts||{});function Ns(e){let t=ne(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,ei(()=>{n.current&&t()})}),[t])}function yd(){let e=typeof document>"u";return"useSyncExternalStore"in k?(t=>t.useSyncExternalStore)(k)(()=>()=>{},()=>!1,()=>!e):!1}function Xr(){let e=yd(),[t,n]=k.useState(Je.isHandoffComplete);return t&&Je.isHandoffComplete===!1&&n(!1),k.useEffect(()=>{t!==!0&&n(!0)},[t]),k.useEffect(()=>Je.handoff(),[]),e?!1:t}let wd=m.createContext(!1);function Ed(){return m.useContext(wd)}function Sd(e){let t=Ed(),n=m.useContext(Ls),[r,o]=m.useState(()=>{var i;if(!t&&n!==null)return(i=n.current)!=null?i:null;if(Je.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 Ps=m.Fragment,Cd=Te(function(e,t){let{ownerDocument:n=null,...r}=e,o=m.useRef(null),i=We(Ou(f=>{o.current=f}),t),l=Lr(o),u=n??l,s=Sd(u),[a]=m.useState(()=>{var f;return Je.isServer?null:(f=u==null?void 0:u.createElement("div"))!=null?f:null}),c=m.useContext(Pd),d=Xr();ue(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),ue(()=>{if(a&&c)return c.register(a)},[c,a]),Ns(()=>{var f;!s||!a||(gr(a)&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((f=s.parentElement)==null||f.removeChild(s)))});let p=Me();return d?!s||!a?null:we.createPortal(p({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:Ps,name:"Portal"}),a):null});function Od(e,t){let n=We(t),{enabled:r=!0,ownerDocument:o,...i}=e,l=Me();return r?m.createElement(Cd,{...i,ownerDocument:o,ref:n}):l({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:Ps,name:"Portal"})}let Td=m.Fragment,Ls=m.createContext(null);function Nd(e,t){let{target:n,...r}=e,o={ref:We(t)},i=Me();return m.createElement(Ls.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:Td,name:"Popover.Group"}))}let Pd=m.createContext(null),Ld=Te(Od),Ad=Te(Nd),$d=Object.assign(Ld,{Group:Ad});function Dd(){let e=m.useRef(!1);return ue(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function As(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Ds)!==m.Fragment||m.Children.count(e.children)===1}let jn=m.createContext(null);jn.displayName="TransitionContext";var Md=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Md||{});function Id(){let e=m.useContext(jn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function jd(){let e=m.useContext(Fn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Fn=m.createContext(null);Fn.displayName="NestingContext";function kn(e){return"children"in e?kn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function $s(e,t){let n=Ot(e),r=m.useRef([]),o=Dd(),i=$t(),l=ne((f,g=vt.Hidden)=>{let v=r.current.findIndex(({el:E})=>E===f);v!==-1&&(_e(g,{[vt.Unmount](){r.current.splice(v,1)},[vt.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var E;!kn(r)&&o.current&&((E=n.current)==null||E.call(n))}))}),u=ne(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,vt.Unmount)}),s=m.useRef([]),a=m.useRef(Promise.resolve()),c=m.useRef({enter:[],leave:[]}),d=ne((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(([M,w])=>w)).then(()=>E())})]),g==="enter"?a.current=a.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(g)):v(g)}),p=ne((f,g,v)=>{Promise.all(c.current[g].splice(0).map(([E,M])=>M)).then(()=>{var E;(E=s.current.shift())==null||E()}).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 Ds=m.Fragment,Ms=gn.RenderStrategy;function Fd(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,...E}=e,[M,w]=m.useState(null),N=m.useRef(null),j=As(e),F=We(...j?[N,t,w]:t===null?[]:[t]),R=(n=E.unmount)==null||n?vt.Unmount:vt.Hidden,{show:W,appear:h,initial:b}=Id(),[x,$]=m.useState(W?"visible":"hidden"),A=jd(),{register:P,unregister:S}=A;ue(()=>P(N),[P,N]),ue(()=>{if(R===vt.Hidden&&N.current){if(W&&x!=="visible"){$("visible");return}return _e(x,{hidden:()=>S(N),visible:()=>P(N)})}},[x,N,P,S,W,R]);let O=Xr();ue(()=>{if(j&&O&&x==="visible"&&N.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[N,x,O,j]);let T=b&&!h,L=h&&W&&b,y=m.useRef(!1),I=$s(()=>{y.current||($("hidden"),S(N))},A),_=ne(H=>{y.current=!0;let Z=H?"enter":"leave";I.onStart(N,Z,ae=>{ae==="enter"?i==null||i():ae==="leave"&&(u==null||u())})}),V=ne(H=>{let Z=H?"enter":"leave";y.current=!1,I.onStop(N,Z,ae=>{ae==="enter"?l==null||l():ae==="leave"&&(s==null||s())}),Z==="leave"&&!kn(I)&&($("hidden"),S(N))});m.useEffect(()=>{j&&o||(_(W),V(W))},[W,j,o]);let z=!(!o||!j||!O||T),[,G]=_i(z,M,W,{start:_,end:V}),q=bt({ref:F,className:((r=pr(E.className,L&&a,L&&c,G.enter&&a,G.enter&&G.closed&&c,G.enter&&!G.closed&&d,G.leave&&f,G.leave&&!G.closed&&g,G.leave&&G.closed&&v,!G.transition&&W&&p))==null?void 0:r.trim())||void 0,...Ri(G)}),B=0;x==="visible"&&(B|=Xe.Open),x==="hidden"&&(B|=Xe.Closed),W&&x==="hidden"&&(B|=Xe.Opening),!W&&x==="visible"&&(B|=Xe.Closing);let K=Me();return m.createElement(Fn.Provider,{value:I},m.createElement(Os,{value:B},K({ourProps:q,theirProps:E,defaultTag:Ds,features:Ms,visible:x==="visible",name:"Transition.Child"})))}function kd(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=m.useRef(null),u=As(e),s=We(...u?[l,t]:t===null?[]:[t]);Xr();let a=qr();if(n===void 0&&a!==null&&(n=(a&Xe.Open)===Xe.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=$s(()=>{n||d("hidden")}),[f,g]=m.useState(!0),v=m.useRef([n]);ue(()=>{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]);ue(()=>{n?d("visible"):!kn(p)&&l.current!==null&&d("hidden")},[n,p]);let M={unmount:o},w=ne(()=>{var F;f&&g(!1),(F=e.beforeEnter)==null||F.call(e)}),N=ne(()=>{var F;f&&g(!1),(F=e.beforeLeave)==null||F.call(e)}),j=Me();return m.createElement(Fn.Provider,{value:p},m.createElement(jn.Provider,{value:E},j({ourProps:{...M,as:m.Fragment,children:m.createElement(Is,{ref:s,...M,...i,beforeEnter:w,beforeLeave:N})},theirProps:{},defaultTag:m.Fragment,features:Ms,visible:c==="visible",name:"Transition"})))}function Rd(e,t){let n=m.useContext(jn)!==null,r=qr()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Qr,{ref:t,...e}):m.createElement(Is,{ref:t,...e}))}let Qr=Te(kd),Is=Te(Fd),_d=Te(Rd),js=Object.assign(Qr,{Child:_d,Root:Qr});function Wd(e,t){let n=m.useRef({left:0,top:0});if(ue(()=>{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 Fs=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function ks(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!ut(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 Fs.test(l)&&(l=l.replace(Fs,"")),l}function Bd(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():ks(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return ks(e).trim()}function Ud(e){let t=m.useRef(""),n=m.useRef("");return ne(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=Bd(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Vd=Object.defineProperty,zd=(e,t,n)=>t in e?Vd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rs=(e,t,n)=>(zd(e,typeof t!="symbol"?t+"":t,n),n),be=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(be||{}),nt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(nt||{}),Rn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Rn||{}),_s=(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))(_s||{});function Ws(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Ai(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 Hd={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:fe.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===fe.Nothing)return{...u,activeOptionIndex:null};if(t.focus===fe.Specific)return{...u,activeOptionIndex:e.options.findIndex(c=>c.id===t.id)};if(t.focus===fe.Previous){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=In(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===fe.Next){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=In(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=Ws(e),a=In(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!==fe.Nothing&&(r=In(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:fe.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,...Ws(e),pendingShouldSort:!1}:e};class Jr extends bi{constructor(t){super(t),Rs(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:l}=this.state.dataRef.current;return _e(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:yr(()=>{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:yr(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:yr(()=>{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:fe.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})}}),Rs(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=wr.get(null);this.disposables.add(r.on(Ei.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 Jr({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:fe.Nothing},__demoMode:n})}reduce(t,n){return _e(n.type,Hd,t,n)}}const Bs=m.createContext(null);function Zr(e){let t=m.useContext(Bs);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Us),n}return t}function Us({id:e,__demoMode:t=!1}){let n=m.useMemo(()=>Jr.new({id:e,__demoMode:t}),[]);return Ns(()=>n.dispose()),n}let _n=m.createContext(null);_n.displayName="ListboxDataContext";function nn(e){let t=m.useContext(_n);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,nn),n}return t}let Gd=m.Fragment;function Yd(e,t){let n=m.useId(),r=dr(),{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 E=p?"horizontal":"vertical";let M=We(t),w=cu(i),[N=f?[]:void 0,j]=uu(o,s,w),F=Us({id:n,__demoMode:g}),R=m.useRef({static:!1,hold:!1}),W=m.useRef(new Map),h=Fu(a),b=m.useCallback(z=>_e(x.mode,{[nt.Multi]:()=>N.some(G=>h(G,z)),[nt.Single]:()=>h(N,z)}),[N]),x=m.useMemo(()=>({value:N,disabled:d,invalid:c,mode:f?nt.Multi:nt.Single,orientation:E,onChange:j,compare:h,isSelected:b,optionsPropsRef:R,listRef:W}),[N,d,c,f,E,j,h,b,R,W]);ue(()=>{F.state.dataRef.current=x},[x]);let $=Ue(F,z=>z.listboxState),A=wr.get(null),P=Ue(A,m.useCallback(z=>A.selectors.isTop(z,n),[A,n])),[S,O]=Ue(F,z=>[z.buttonElement,z.optionsElement]);uc(P,[S,O],(z,G)=>{F.send({type:_s.CloseListbox}),Li(G,Pr.Loose)||(z.preventDefault(),S==null||S.focus())});let T=m.useMemo(()=>({open:$===be.Open,disabled:d,invalid:c,value:N}),[$,d,c,N]),[L,y]=Au({inherit:!0}),I={ref:M},_=m.useCallback(()=>{if(w!==void 0)return j==null?void 0:j(w)},[j,w]),V=Me();return m.createElement(y,{value:L,props:{htmlFor:S==null?void 0:S.id},slot:{open:$===be.Open,disabled:d}},m.createElement(hd,null,m.createElement(Bs.Provider,{value:F},m.createElement(_n.Provider,{value:x},m.createElement(Os,{value:_e($,{[be.Open]:Xe.Open,[be.Closed]:Xe.Closed})},u!=null&&N!=null&&m.createElement(gu,{disabled:d,data:{[u]:N},form:l,onReset:_}),V({ourProps:I,theirProps:v,slot:T,defaultTag:Gd,name:"Listbox"}))))))}let Kd="button";function qd(e,t){let n=m.useId(),r=li(),o=nn("Listbox.Button"),i=Zr("Listbox.Button"),{id:l=r||`headlessui-listbox-button-${n}`,disabled:u=o.disabled||!1,autoFocus:s=!1,...a}=e,c=We(t,fd(),i.actions.setButtonElement),d=dd(),[p,f,g]=Ue(i,y=>[y.listboxState,y.buttonElement,y.optionsElement]),v=p===be.Open;dc(v,{trigger:f,action:m.useCallback(y=>{if(f!=null&&f.contains(y.target))return yn.Ignore;let I=y.target.closest('[role="option"]:not([data-disabled])');return ut(I)?yn.Select(I):g!=null&&g.contains(y.target)?yn.Ignore:yn.Close},[f,g]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let E=ne(y=>{switch(y.key){case ve.Enter:fu(y.currentTarget);break;case ve.Space:case ve.ArrowDown:y.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.First});break;case ve.ArrowUp:y.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.Last});break}}),M=ne(y=>{switch(y.key){case ve.Space:y.preventDefault();break}}),w=ne(y=>{var I;if(y.button===Ts.Left){if(Su(y.currentTarget))return y.preventDefault();i.state.listboxState===be.Open?(we.flushSync(()=>i.actions.closeListbox()),(I=i.state.buttonElement)==null||I.focus({preventScroll:!0})):(y.preventDefault(),i.actions.openListbox({focus:fe.Nothing}))}}),N=m.useRef(null),j=ne(y=>{N.current=y.pointerType,y.pointerType==="mouse"&&w(y)}),F=ne(y=>{N.current!=="mouse"&&w(y)}),R=ne(y=>y.preventDefault()),W=mi([l]),h=Tu(),{isFocusVisible:b,focusProps:x}=Qa({autoFocus:s}),{isHovered:$,hoverProps:A}=Xa({isDisabled:u}),{pressed:P,pressProps:S}=ru({disabled:u}),O=m.useMemo(()=>({open:p===be.Open,active:P||p===be.Open,disabled:u,invalid:o.invalid,value:o.value,hover:$,focus:b,autofocus:s}),[p,o.value,u,$,b,P,o.invalid,s]),T=Ue(i,y=>y.listboxState===be.Open),L=ni(d(),{ref:c,id:l,type:pc(e,f),"aria-haspopup":"listbox","aria-controls":g==null?void 0:g.id,"aria-expanded":T,"aria-labelledby":W,"aria-describedby":h,disabled:u||void 0,autoFocus:s,onKeyDown:E,onKeyUp:M,onKeyPress:R,onPointerDown:j,onClick:F},x,A,S);return Me()({ourProps:L,theirProps:a,slot:O,defaultTag:Kd,name:"Listbox.Button"})}let Vs=m.createContext(!1),Xd="div",Qd=gn.RenderStrategy|gn.Static;function Jd(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=cd(o),[c,d]=m.useState(null);a&&(i=!0);let p=nn("Listbox.Options"),f=Zr("Listbox.Options"),[g,v,E,M]=Ue(f,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),w=Lr(v),N=Lr(E),j=qr(),[F,R]=_i(u,c,j!==null?(j&Xe.Open)===Xe.Open:g===be.Open);Qu(F,v,f.actions.closeListbox);let W=M?!1:l&&g===be.Open;wc(W,N);let h=M?!1:l&&g===be.Open;Xu(h,{allowed:m.useCallback(()=>[v,E],[v,E])});let b=g!==be.Open,x=Wd(b,v)?!1:F,$=F&&g===be.Closed,A=bd($,p.value),P=ne(H=>p.compare(A,H)),S=Ue(f,H=>{var Z;if(a==null||!((Z=a==null?void 0:a.to)!=null&&Z.includes("selection")))return null;let ae=H.options.findIndex(Ae=>P(Ae.dataRef.current.value));return ae===-1&&(ae=0),ae}),O=(()=>{if(a==null)return;if(S===null)return{...a,inner:void 0};let H=Array.from(p.listRef.current.values());return{...a,inner:{listRef:{current:H},index:S}}})(),[T,L]=md(O),y=pd(),I=We(t,a?T:null,f.actions.setOptionsElement,d),_=$t();m.useEffect(()=>{var H;let Z=E;Z&&g===be.Open&&Z!==((H=Kt(Z))==null?void 0:H.activeElement)&&(Z==null||Z.focus({preventScroll:!0}))},[g,E]);let V=ne(H=>{var Z,ae;switch(_.dispose(),H.key){case ve.Space:if(f.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),f.actions.search(H.key);case ve.Enter:if(H.preventDefault(),H.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:Ae}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(Ae.current.value)}p.mode===nt.Single&&(we.flushSync(()=>f.actions.closeListbox()),(Z=f.state.buttonElement)==null||Z.focus({preventScroll:!0}));break;case _e(p.orientation,{vertical:ve.ArrowDown,horizontal:ve.ArrowRight}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.Next});case _e(p.orientation,{vertical:ve.ArrowUp,horizontal:ve.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.Previous});case ve.Home:case ve.PageUp:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.First});case ve.End:case ve.PageDown:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.Last});case ve.Escape:H.preventDefault(),H.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),(ae=f.state.buttonElement)==null||ae.focus({preventScroll:!0});return;case ve.Tab:H.preventDefault(),H.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),ic(f.state.buttonElement,H.shiftKey?Nr.Previous:Nr.Next);break;default:H.key.length===1&&(f.actions.search(H.key),_.setTimeout(()=>f.actions.clearSearch(),350));break}}),z=Ue(f,H=>{var Z;return(Z=H.buttonElement)==null?void 0:Z.id}),G=m.useMemo(()=>({open:g===be.Open}),[g]),q=ni(a?y():{},{id:r,ref:I,"aria-activedescendant":Ue(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===nt.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":p.orientation,onKeyDown:V,role:"listbox",tabIndex:g===be.Open?0:void 0,style:{...s.style,...L,"--button-width":Ru(v,!0).width},...Ri(R)}),B=Me(),K=m.useMemo(()=>p.mode===nt.Multi?p:{...p,isSelected:P},[p,P]);return m.createElement($d,{enabled:i?e.static||F:!1,ownerDocument:w},m.createElement(_n.Provider,{value:K},B({ourProps:q,theirProps:s,slot:G,defaultTag:Xd,features:Qd,visible:x,name:"Listbox.Options"})))}let Zd="div";function ep(e,t){let n=m.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...l}=e,u=m.useContext(Vs)===!0,s=nn("Listbox.Option"),a=Zr("Listbox.Option"),c=Ue(a,x=>a.selectors.isActive(x,r)),d=s.isSelected(i),p=m.useRef(null),f=Ud(p),g=Ot({disabled:o,value:i,domRef:p,get textValue(){return f()}}),v=We(t,p,x=>{x?s.listRef.current.set(r,x):s.listRef.current.delete(r)}),E=Ue(a,x=>a.selectors.shouldScrollIntoView(x,r));ue(()=>{if(E)return qe().requestAnimationFrame(()=>{var x,$;($=(x=p.current)==null?void 0:x.scrollIntoView)==null||$.call(x,{block:"nearest"})})},[E,p]),ue(()=>{if(!u)return a.actions.registerOption(r,g),()=>a.actions.unregisterOption(r)},[g,r,u]);let M=ne(x=>{var $;if(o)return x.preventDefault();a.actions.onChange(i),s.mode===nt.Single&&(we.flushSync(()=>a.actions.closeListbox()),($=a.state.buttonElement)==null||$.focus({preventScroll:!0}))}),w=ne(()=>{if(o)return a.actions.goToOption({focus:fe.Nothing});a.actions.goToOption({focus:fe.Specific,id:r})}),N=Ec(),j=ne(x=>N.update(x)),F=ne(x=>{N.wasMoved(x)&&(o||c&&a.state.activationTrigger===Rn.Pointer||a.actions.goToOption({focus:fe.Specific,id:r},Rn.Pointer))}),R=ne(x=>{N.wasMoved(x)&&(o||c&&a.state.activationTrigger===Rn.Pointer&&a.actions.goToOption({focus:fe.Nothing}))}),W=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:M,onFocus:w,onPointerEnter:j,onMouseEnter:j,onPointerMove:F,onMouseMove:F,onPointerLeave:R,onMouseLeave:R},b=Me();return!d&&u?null:b({ourProps:h,theirProps:l,slot:W,defaultTag:Zd,name:"Listbox.Option"})}let tp=m.Fragment;function np(e,t){let{options:n,placeholder:r,...o}=e,i={ref:We(t)},l=nn("ListboxSelectedOption"),u=m.useMemo(()=>({}),[]),s=l.value===void 0||l.value===null||l.mode===nt.Multi&&Array.isArray(l.value)&&l.value.length===0,a=Me();return m.createElement(Vs.Provider,{value:!0},a({ourProps:i,theirProps:{...o,children:m.createElement(m.Fragment,null,r&&s?r:n)},slot:u,defaultTag:tp,name:"ListboxSelectedOption"}))}let rp=Te(Yd),op=Te(qd),ip=Iu,sp=Te(Jd),lp=Te(ep),ap=Te(np),wt=Object.assign(rp,{Button:op,Label:ip,Options:sp,Option:lp,SelectedOption:ap});function up({title:e,titleId:t,...n},r){return k.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?k.createElement("title",{id:t},e):null,k.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 zs=k.forwardRef(up),cp=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o=""})=>{const{t:i}=Ke();return C.jsx("div",{className:`relative ${o}`,children:C.jsx(wt,{value:t,onChange:n,disabled:r,children:({open:l})=>C.jsxs(C.Fragment,{children:[C.jsxs(wt.Button,{className:`
83
+ */var qc=["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])"],_r=qc.join(","),Yi=typeof Element>"u",en=Yi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Pn=!Yi&&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},Ln=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},Xc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Qc=function(t,n,r){if(Ln(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(_r));return n&&en.call(t,_r)&&o.unshift(t),o=o.filter(r),o},Jc=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Ln(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=en.call(l,_r);c&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var d=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),p=!Ln(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},Ki=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},qi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Xc(t))&&!Ki(t)?0:t.tabIndex},Zc=function(t,n){var r=qi(t);return r<0&&n&&!Ki(t)?0:r},ef=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Xi=function(t){return t.tagName==="INPUT"},tf=function(t){return Xi(t)&&t.type==="hidden"},nf=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},rf=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},of=function(t){if(!t.name)return!0;var n=t.form||Pn(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=rf(o,t.form);return!i||i===t},sf=function(t){return Xi(t)&&t.type==="radio"},lf=function(t){return sf(t)&&!of(t)},af=function(t){var n,r=t&&Pn(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=Pn(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},Qi=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},uf=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=en.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(en.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=Pn(t);if(s&&!s.shadowRoot&&o(s)===!0)return Qi(t);t.assignedSlot?t=t.assignedSlot:!s&&a!==t.ownerDocument?t=a.host:t=s}t=u}if(af(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Qi(t);return!1},cf=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 en.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ff=function(t,n){return!(n.disabled||Ln(n)||tf(n)||uf(n,t)||nf(n)||cf(n))},Ji=function(t,n){return!(lf(n)||qi(n)<0||!ff(t,n))},df=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},pf=function e(t){var n=[],r=[];return t.forEach(function(o,i){var l=!!o.scopeParent,u=l?o.scopeParent:o,s=Zc(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(ef).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=Jc([t],n.includeContainer,{filter:Ji.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:df}):r=Qc(t,n.includeContainer,Ji.bind(null,n)),pf(r)};function es(e,t,n){let{reference:r,floating:o}=e;const i=dt(t),l=Rr(t),u=Fr(l),s=yt(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(jt(t)){case"start":f[l]-=p*(n&&a?-1:1);break;case"end":f[l]+=p*(n&&a?-1:1);break}return f}const mf=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}=es(a,r,s),p=r,f={},g=0;for(let v=0;v<u.length;v++){const{name:E,fn:M}=u[v],{x:w,y:N,data:j,reset:F}=await M({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,[E]:{...f[E],...j}},F&&g<=50&&(g++,typeof F=="object"&&(F.placement&&(p=F.placement),F.rects&&(a=F.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):F.rects),{x:c,y:d}=es(a,p,s)),v=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}};async function An(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}=Nt(t,e),g=Gi(f),E=u[p?d==="floating"?"reference":"floating":d],M=Nn(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: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)),j=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},F=Nn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:w,offsetParent:N,strategy:s}):w);return{top:(M.top-F.top+g.top)/j.y,bottom:(F.bottom-M.bottom+g.bottom)/j.y,left:(M.left-F.left+g.left)/j.x,right:(F.right-M.right+g.right)/j.x}}const hf=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}=Nt(e,t)||{};if(a==null)return{};const d=Gi(c),p={x:n,y:r},f=Rr(o),g=Fr(f),v=await l.getDimensions(a),E=f==="y",M=E?"top":"left",w=E?"bottom":"right",N=E?"clientHeight":"clientWidth",j=i.reference[g]+i.reference[f]-p[f]-i.floating[g],F=p[f]-i.reference[f],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a));let W=k?k[N]:0;(!W||!await(l.isElement==null?void 0:l.isElement(k)))&&(W=u.floating[N]||i.floating[g]);const h=j/2-F/2,b=W/2-v[g]/2-1,x=ft(d[M],b),$=ft(d[w],b),A=x,P=W-v[g]-$,S=W/2-v[g]/2+h,O=jr(A,S,P),T=!s.arrow&&jt(o)!=null&&S!==O&&i.reference[g]/2-(S<A?x:$)-v[g]/2<0,L=T?S<A?S-A:S-P:0;return{[f]:p[f]+L,data:{[f]:O,centerOffset:S-O-L,...T&&{alignmentOffset:L}},reset:T}}}),gf=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,...E}=Nt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const M=yt(o),w=dt(u),N=yt(u)===u,j=await(s.isRTL==null?void 0:s.isRTL(a.floating)),F=p||(N||!v?[Tn(u)]:Vc(u)),k=g!=="none";!p&&k&&F.push(...Yc(u,v,g,j));const W=[u,...F],h=await An(t,E),b=[];let x=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&b.push(h[M]),d){const S=Uc(o,l,j);b.push(h[S[0]],h[S[1]])}if(x=[...x,{placement:o,overflows:b}],!b.every(S=>S<=0)){var $,A;const S=((($=i.flip)==null?void 0:$.index)||0)+1,O=W[S];if(O&&(!(d==="alignment"?w!==dt(O):!1)||x.every(y=>dt(y.placement)===w?y.overflows[0]>0:!0)))return{data:{index:S,overflows:x},reset:{placement:O}};let T=(A=x.filter(L=>L.overflows[0]<=0).sort((L,y)=>L.overflows[1]-y.overflows[1])[0])==null?void 0:A.placement;if(!T)switch(f){case"bestFit":{var P;const L=(P=x.filter(y=>{if(k){const I=dt(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:P[0];L&&(T=L);break}case"initialPlacement":T=u;break}if(o!==T)return{reset:{placement:T}}}return{}}}},vf=new Set(["left","top"]);async function bf(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=yt(n),u=jt(n),s=dt(n)==="y",a=vf.has(l)?-1:1,c=i&&s?-1:1,d=Nt(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 xf=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 bf(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}}}}},yf=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:E=>{let{x:M,y:w}=E;return{x:M,y:w}}},...s}=Nt(e,t),a={x:n,y:r},c=await An(t,s),d=dt(yt(o)),p=Vi(d);let f=a[p],g=a[d];if(i){const E=p==="y"?"top":"left",M=p==="y"?"bottom":"right",w=f+c[E],N=f-c[M];f=jr(w,f,N)}if(l){const E=d==="y"?"top":"left",M=d==="y"?"bottom":"right",w=g+c[E],N=g-c[M];g=jr(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}}}}}},wf=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}=Nt(e,t),c=await An(t,a),d=yt(o),p=jt(o),f=dt(o)==="y",{width:g,height:v}=i.floating;let E,M;d==="top"||d==="bottom"?(E=d,M=p===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(M=d,E=p==="end"?"top":"bottom");const w=v-c.top-c.bottom,N=g-c.left-c.right,j=ft(v-c[E],w),F=ft(g-c[M],N),k=!t.middlewareData.shift;let W=j,h=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(h=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=w),k&&!p){const x=xe(c.left,0),$=xe(c.right,0),A=xe(c.top,0),P=xe(c.bottom,0);f?h=g-2*(x!==0||$!==0?x+$:xe(c.left,c.right)):W=v-2*(A!==0||P!==0?A+P:xe(c.top,c.bottom))}await s({...t,availableWidth:h,availableHeight:W});const b=await l.getDimensions(u.floating);return g!==b.width||v!==b.height?{reset:{rects:!0}}:{}}}};function ts(e){const t=Ve(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=Zt(n)!==i||Zt(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Wr(e){return oe(e)?e:e.contextElement}function Ft(e){const t=Wr(e);if(!Ee(t))return et(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ts(t);let l=(i?Zt(n.width):n.width)/r,u=(i?Zt(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const Ef=et(0);function ns(e){const t=Ne(e);return!Sn()||!t.visualViewport?Ef:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function Pt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Wr(e);let l=et(1);t&&(r?oe(r)&&(l=Ft(r)):l=Ft(e));const u=Sf(i,n,r)?ns(i):et(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=Ne(i),f=r&&oe(r)?Ne(r):r;let g=p,v=Ir(g);for(;v&&r&&f!==g;){const E=Ft(v),M=v.getBoundingClientRect(),w=Ve(v),N=M.left+(v.clientLeft+parseFloat(w.paddingLeft))*E.x,j=M.top+(v.clientTop+parseFloat(w.paddingTop))*E.y;s*=E.x,a*=E.y,c*=E.x,d*=E.y,s+=N,a+=j,g=Ne(v),v=Ir(g)}}return Nn({width:c,height:d,x:s,y:a})}function $n(e,t){const n=Cn(e).scrollLeft;return t?t.left+n:Pt(Ze(e)).left+n}function rs(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-$n(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Cf(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=Ze(r),u=t?En(t.floating):!1;if(r===l||u&&i)return n;let s={scrollLeft:0,scrollTop:0},a=et(1);const c=et(0),d=Ee(r);if((d||!d&&!i)&&((It(r)!=="body"||Jt(l))&&(s=Cn(r)),Ee(r))){const f=Pt(r);a=Ft(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}const p=l&&!d&&!i?rs(l,s):et(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 Of(e){return Array.from(e.getClientRects())}function Tf(e){const t=Ze(e),n=Cn(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+$n(e);const u=-n.scrollTop;return Ve(r).direction==="rtl"&&(l+=xe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}const os=25;function Nf(e,t){const n=Ne(e),r=Ze(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=Sn();(!c||c&&t==="fixed")&&(u=o.offsetLeft,s=o.offsetTop)}const a=$n(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<=os&&(i-=g)}else a<=os&&(i+=a);return{width:i,height:l,x:u,y:s}}const Pf=new Set(["absolute","fixed"]);function Lf(e,t){const n=Pt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ee(e)?Ft(e):et(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 is(e,t,n){let r;if(t==="viewport")r=Nf(e,n);else if(t==="document")r=Tf(Ze(e));else if(oe(t))r=Lf(t,n);else{const o=ns(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Nn(r)}function ss(e,t){const n=ct(e);return n===t||!oe(n)||ut(n)?!1:Ve(n).position==="fixed"||ss(n,t)}function Af(e,t){const n=t.get(e);if(n)return n;let r=xt(e,[],!1).filter(u=>oe(u)&&It(u)!=="body"),o=null;const i=Ve(e).position==="fixed";let l=i?ct(e):e;for(;oe(l)&&!ut(l);){const u=Ve(l),s=Mr(l);!s&&u.position==="fixed"&&(o=null),(i?!s&&!o:!s&&u.position==="static"&&!!o&&Pf.has(o.position)||Jt(l)&&!s&&ss(e,l))?r=r.filter(c=>c!==l):o=u,l=ct(l)}return t.set(e,r),r}function $f(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?En(t)?[]:Af(t,this._c):[].concat(n),r],u=l[0],s=l.reduce((a,c)=>{const d=is(t,c,o);return a.top=xe(d.top,a.top),a.right=ft(d.right,a.right),a.bottom=ft(d.bottom,a.bottom),a.left=xe(d.left,a.left),a},is(t,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Df(e){const{width:t,height:n}=ts(e);return{width:t,height:n}}function Mf(e,t,n){const r=Ee(t),o=Ze(t),i=n==="fixed",l=Pt(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const s=et(0);function a(){s.x=$n(o)}if(r||!r&&!i)if((It(t)!=="body"||Jt(o))&&(u=Cn(t)),r){const f=Pt(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?rs(o,u):et(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 Br(e){return Ve(e).position==="static"}function ls(e,t){if(!Ee(e)||Ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ze(e)===n&&(n=n.ownerDocument.body),n}function as(e,t){const n=Ne(e);if(En(e))return n;if(!Ee(e)){let o=ct(e);for(;o&&!ut(o);){if(oe(o)&&!Br(o))return o;o=ct(o)}return n}let r=ls(e,t);for(;r&&$c(r)&&Br(r);)r=ls(r,t);return r&&ut(r)&&Br(r)&&!Mr(r)?n:r||Fc(e)||n}const If=async function(e){const t=this.getOffsetParent||as,n=this.getDimensions,r=await n(e.floating);return{reference:Mf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jf(e){return Ve(e).direction==="rtl"}const Ff={convertOffsetParentRelativeRectToViewportRelativeRect:Cf,getDocumentElement:Ze,getClippingRect:$f,getOffsetParent:as,getElementRects:If,getClientRects:Of,getDimensions:Df,getScale:Ft,isElement:oe,isRTL:jf};function us(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rf(e,t){let n=null,r;const o=Ze(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=On(d),v=On(o.clientWidth-(c+p)),E=On(o.clientHeight-(d+f)),M=On(c),N={rootMargin:-g+"px "+-v+"px "+-E+"px "+-M+"px",threshold:xe(0,ft(1,s))||1};let j=!0;function F(k){const W=k[0].intersectionRatio;if(W!==s){if(!j)return l();W?l(!1,W):r=setTimeout(()=>{l(!1,1e-7)},1e3)}W===1&&!us(a,e.getBoundingClientRect())&&l(),j=!1}try{n=new IntersectionObserver(F,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(F,N)}n.observe(e)}return l(!0),i}function cs(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=Wr(e),c=o||i?[...a?xt(a):[],...xt(t)]:[];c.forEach(M=>{o&&M.addEventListener("scroll",n,{passive:!0}),i&&M.addEventListener("resize",n)});const d=a&&u?Rf(a,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(M=>{let[w]=M;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?Pt(e):null;s&&E();function E(){const M=Pt(e);v&&!us(v,M)&&n(),v=M,g=requestAnimationFrame(E)}return n(),()=>{var M;c.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(M=f)==null||M.disconnect(),f=null,s&&cancelAnimationFrame(g)}}const Ur=An,kf=xf,_f=yf,Wf=gf,Bf=wf,fs=hf,Uf=(e,t,n)=>{const r=new Map,o={platform:Ff,...n},i={...o.platform,_c:r};return mf(e,t,{...o,platform:i})};var Vf=typeof document<"u",zf=function(){},Dn=Vf?m.useLayoutEffect:zf;function Mn(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(!Mn(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)&&!Mn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ds(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ps(e,t){const n=ds(e);return Math.round(t*n)/n}function Vr(e){const t=R.useRef(e);return Dn(()=>{t.current=e}),t}function ms(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]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=R.useState(r);Mn(p,r)||f(r);const[g,v]=R.useState(null),[E,M]=R.useState(null),w=R.useCallback(y=>{y!==k.current&&(k.current=y,v(y))},[]),N=R.useCallback(y=>{y!==W.current&&(W.current=y,M(y))},[]),j=i||g,F=l||E,k=R.useRef(null),W=R.useRef(null),h=R.useRef(c),b=s!=null,x=Vr(s),$=Vr(o),A=Vr(a),P=R.useCallback(()=>{if(!k.current||!W.current)return;const y={placement:t,strategy:n,middleware:p};$.current&&(y.platform=$.current),Uf(k.current,W.current,y).then(I=>{const _={...I,isPositioned:A.current!==!1};S.current&&!Mn(h.current,_)&&(h.current=_,Vt.flushSync(()=>{d(_)}))})},[p,t,n,$,A]);Dn(()=>{a===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,d(y=>({...y,isPositioned:!1})))},[a]);const S=R.useRef(!1);Dn(()=>(S.current=!0,()=>{S.current=!1}),[]),Dn(()=>{if(j&&(k.current=j),F&&(W.current=F),j&&F){if(x.current)return x.current(j,F,P);P()}},[j,F,P,x,b]);const O=R.useMemo(()=>({reference:k,floating:W,setReference:w,setFloating:N}),[w,N]),T=R.useMemo(()=>({reference:j,floating:F}),[j,F]),L=R.useMemo(()=>{const y={position:n,left:0,top:0};if(!T.floating)return y;const I=ps(T.floating,c.x),_=ps(T.floating,c.y);return u?{...y,transform:"translate("+I+"px, "+_+"px)",...ds(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:_}},[n,u,T.floating,c.x,c.y]);return R.useMemo(()=>({...c,update:P,refs:O,elements:T,floatingStyles:L}),[c,P,O,T,L])}const Hf=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?fs({element:r.current,padding:o}).fn(n):{}:r?fs({element:r,padding:o}).fn(n):{}}}},zr=(e,t)=>({...kf(e),options:[e,t]}),hs=(e,t)=>({..._f(e),options:[e,t]}),gs=(e,t)=>({...Wf(e),options:[e,t]}),Gf=(e,t)=>({...Bf(e),options:[e,t]}),Yf=(e,t)=>({...Hf(e),options:[e,t]}),vs={...R},Kf=vs.useInsertionEffect||(e=>e());function bs(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Kf(()=>{t.current=e}),R.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 Hr=typeof document<"u"?m.useLayoutEffect:m.useEffect;let xs=!1,qf=0;const ys=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+qf++;function Xf(){const[e,t]=R.useState(()=>xs?ys():void 0);return Hr(()=>{e==null&&t(ys())},[]),R.useEffect(()=>{xs=!0},[]),e}const Qf=vs.useId||Xf;let tn;process.env.NODE_ENV!=="production"&&(tn=new Set);function Jf(){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=tn)!=null&&e.has(o))){var i;(i=tn)==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=tn)!=null&&e.has(o))){var i;(i=tn)==null||i.add(o),console.error(o)}}function ed(){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 td=R.createContext(null),nd=R.createContext(null),rd=()=>{var e;return((e=R.useContext(td))==null?void 0:e.id)||null},od=()=>R.useContext(nd),id="data-floating-ui-focusable";function sd(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Qf(),i=R.useRef({}),[l]=R.useState(()=>ed()),u=rd()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(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,a]=R.useState(r.reference),c=bs((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=R.useMemo(()=>({setPositionReference:a}),[]),p=R.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return R.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function ld(e){e===void 0&&(e={});const{nodeId:t}=e,n=sd({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=R.useState(null),[u,s]=R.useState(null),c=(o==null?void 0:o.domReference)||i,d=R.useRef(null),p=od();Hr(()=>{c&&(d.current=c)},[c]);const f=ms({...e,elements:{...o,...u&&{reference:u}}}),g=R.useCallback(N=>{const j=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;s(j),f.refs.setReference(j)},[f.refs]),v=R.useCallback(N=>{(oe(N)||N===null)&&(d.current=N,l(N)),(oe(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!oe(N))&&f.refs.setReference(N)},[f.refs]),E=R.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),M=R.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=R.useMemo(()=>({...f,...r,refs:E,elements:M,nodeId:t}),[f,E,M,t,r]);return Hr(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(j=>j.id===t);N&&(N.context=w)}),R.useMemo(()=>({...f,context:w,refs:E,elements:M}),[f,E,M,w])}const ws="active",Es="selected";function Gr(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[ws]:l,[Es]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[id]:""},...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&&[ws,Es].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(E=>E(...g)).find(E=>E!==void 0)}}}else l[a]=c}),l),{})}}function ad(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=R.useCallback(u=>Gr(u,e,"reference"),t),i=R.useCallback(u=>Gr(u,e,"floating"),n),l=R.useCallback(u=>Gr(u,e,"item"),r);return R.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}function Ss(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const ud=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}=Nt(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,E=p.clientTop!==0,M=g.clientTop!==0,w=p===g;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Jf('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const N={...t,...await zr(-f.offsetTop-p.clientTop-d.reference.height/2-f.offsetHeight/2-i).fn(t)},j=await Ur(Ss(N,g.scrollHeight+v+p.clientTop),c),F=await Ur(N,{...c,elementContext:"reference"}),k=xe(0,j.top),W=N.y+k,x=(g.scrollHeight>g.clientHeight?$=>$:Zt)(xe(0,g.scrollHeight+(E&&w||M?v*2:0)-k-xe(0,j.bottom)));if(g.style.maxHeight=x+"px",g.scrollTop=k,o){const $=g.offsetHeight<f.offsetHeight*ft(u,n.current.length)-1||F.top>=-s||F.bottom>=-s;Vt.flushSync(()=>o($))}return r&&(r.current=await Ur(Ss({...N,y:W},g.offsetHeight+v+p.clientTop),c)),{y:W}}});function cd(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:l,onChange:u}=t,s=bs(u),a=R.useRef(!1),c=R.useRef(null),d=R.useRef(null);R.useEffect(()=>{if(!o)return;function f(v){if(v.ctrlKey||!g||i.current==null)return;const E=v.deltaY,M=i.current.top>=-.5,w=i.current.bottom>=-.5,N=g.scrollHeight-g.clientHeight,j=E<0?-1:1,F=E<0?"max":"min";g.scrollHeight<=g.clientHeight||(!M&&E>0||!w&&E<0?(v.preventDefault(),Vt.flushSync(()=>{s(k=>k+Math[F](E,N*j))})):/firefox/i.test(kc())&&(g.scrollTop+=E))}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=R.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)&&Vt.flushSync(()=>s(v=>v+g))}requestAnimationFrame(()=>{c.current=f.scrollTop})}}}),[r.floating,s,i,l]);return R.useMemo(()=>o?{floating:p}:{},[o,p])}let Rt=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Rt.displayName="FloatingContext";let Yr=m.createContext(null);Yr.displayName="PlacementContext";function fd(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function dd(){return m.useContext(Rt).setReference}function pd(){return m.useContext(Rt).getReferenceProps}function md(){let{getFloatingProps:e,slot:t}=m.useContext(Rt);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function hd(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Yr),n=m.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var l;return(l=i==null?void 0:i.outerHTML)!=null?l:i})]);ue(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(Rt);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Cs=4;function gd({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);vd(u);let a=t&&n!==null&&u!==null,{to:c="bottom",gap:d=0,offset:p=0,padding:f=0,inner:g}=bd(n,u),[v,E="center"]=c.split(" ");ue(()=>{a&&i(0)},[a]);let{refs:M,floatingStyles:w,context:N}=ld({open:a,placement:v==="selection"?E==="center"?"bottom":`bottom-${E}`:E==="center"?`${v}`:`${v}-${E}`,strategy:"absolute",transform:!1,middleware:[zr({mainAxis:v==="selection"?0:d,crossAxis:p}),hs({padding:f}),v!=="selection"&&gs({padding:f}),v==="selection"&&g?ud({...g,padding:f,overflowRef:l,offset:o,minItemsVisible:Cs,referenceOverflowThreshold:f,onFallbackChange($){var A,P;if(!$)return;let S=N.elements.floating;if(!S)return;let O=parseFloat(getComputedStyle(S).scrollPaddingBottom)||0,T=Math.min(Cs,S.childElementCount),L=0,y=0;for(let I of(P=(A=N.elements.floating)==null?void 0:A.childNodes)!=null?P:[])if(at(I)){let _=I.offsetTop,V=_+I.clientHeight+O,z=S.scrollTop,G=z+S.clientHeight;if(_>=z&&V<=G)T--;else{y=Math.max(0,Math.min(V,G)-Math.max(_,z)),L=I.clientHeight;break}}T>=1&&i(I=>{let _=L*T-y+O;return I>=_?I:_})}}):null,Gf({padding:f,apply({availableWidth:$,availableHeight:A,elements:P}){Object.assign(P.floating.style,{overflow:"auto",maxWidth:`${$}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${A}px)`})}})].filter(Boolean),whileElementsMounted:cs}),[j=v,F=E]=N.placement.split("-");v==="selection"&&(j="selection");let k=m.useMemo(()=>({anchor:[j,F].filter(Boolean).join(" ")}),[j,F]),W=cd(N,{overflowRef:l,onChange:i}),{getReferenceProps:h,getFloatingProps:b}=ad([W]),x=ne($=>{s($),M.setFloating($)});return R.createElement(Yr.Provider,{value:r},R.createElement(Rt.Provider,{value:{setFloating:x,setReference:M.setReference,styles:w,getReferenceProps:h,getFloatingProps:b,slot:k}},e))}function vd(e){ue(()=>{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 bd(e,t){var n,r,o;let i=Kr((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),l=Kr((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),u=Kr((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:l,padding:u}}function Kr(e,t,n=void 0){let r=$t(),o=ne((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=Ts(s,a);return[c,d=>{let p=Os(s);{let f=p.map(g=>window.getComputedStyle(a).getPropertyValue(g));r.requestAnimationFrame(function g(){r.nextFrame(g);let v=!1;for(let[M,w]of p.entries()){let N=window.getComputedStyle(a).getPropertyValue(w);if(f[M]!==N){f[M]=N,v=!0;break}}if(!v)return;let E=Ts(s,a);c!==E&&(d(E),c=E)})}return r.dispose}]}return[n,null]}),i=m.useMemo(()=>o(e,t)[0],[e,t]),[l=i,u]=m.useState();return ue(()=>{let[s,a]=o(e,t);if(u(s),!!a)return a(u)},[e,t]),l}function Os(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,...Os(o)]:[r]}return[]}function Ts(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 xd(e,t){let[n,r]=m.useState(t);return!e&&n!==t&&r(t),e?n:t}let qr=m.createContext(null);qr.displayName="OpenClosedContext";var qe=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(qe||{});function Xr(){return m.useContext(qr)}function Ns({value:e,children:t}){return m.createElement(qr.Provider,{value:e},t)}function yd(e){throw new Error("Unexpected object: "+e)}var fe=(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))(fe||{});function In(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:yd(e)}}var Ps=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ps||{});function Ls(e){let t=ne(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,ni(()=>{n.current&&t()})}),[t])}function wd(){let e=typeof document>"u";return"useSyncExternalStore"in R?(t=>t.useSyncExternalStore)(R)(()=>()=>{},()=>!1,()=>!e):!1}function Qr(){let e=wd(),[t,n]=R.useState(Qe.isHandoffComplete);return t&&Qe.isHandoffComplete===!1&&n(!1),R.useEffect(()=>{t!==!0&&n(!0)},[t]),R.useEffect(()=>Qe.handoff(),[]),e?!1:t}let Ed=m.createContext(!1);function Sd(){return m.useContext(Ed)}function Cd(e){let t=Sd(),n=m.useContext($s),[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 As=m.Fragment,Od=Te(function(e,t){let{ownerDocument:n=null,...r}=e,o=m.useRef(null),i=We(Tu(f=>{o.current=f}),t),l=Ar(o),u=n??l,s=Cd(u),[a]=m.useState(()=>{var f;return Qe.isServer?null:(f=u==null?void 0:u.createElement("div"))!=null?f:null}),c=m.useContext(Ld),d=Qr();ue(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),ue(()=>{if(a&&c)return c.register(a)},[c,a]),Ls(()=>{var f;!s||!a||(vr(a)&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((f=s.parentElement)==null||f.removeChild(s)))});let p=Me();return d?!s||!a?null:we.createPortal(p({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:As,name:"Portal"}),a):null});function Td(e,t){let n=We(t),{enabled:r=!0,ownerDocument:o,...i}=e,l=Me();return r?m.createElement(Od,{...i,ownerDocument:o,ref:n}):l({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:As,name:"Portal"})}let Nd=m.Fragment,$s=m.createContext(null);function Pd(e,t){let{target:n,...r}=e,o={ref:We(t)},i=Me();return m.createElement($s.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:Nd,name:"Popover.Group"}))}let Ld=m.createContext(null),Ad=Te(Td),$d=Te(Pd),Dd=Object.assign(Ad,{Group:$d});function Md(){let e=m.useRef(!1);return ue(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ds(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Is)!==m.Fragment||m.Children.count(e.children)===1}let jn=m.createContext(null);jn.displayName="TransitionContext";var Id=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Id||{});function jd(){let e=m.useContext(jn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Fd(){let e=m.useContext(Fn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Fn=m.createContext(null);Fn.displayName="NestingContext";function Rn(e){return"children"in e?Rn(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ms(e,t){let n=Ot(e),r=m.useRef([]),o=Md(),i=$t(),l=ne((f,g=vt.Hidden)=>{let v=r.current.findIndex(({el:E})=>E===f);v!==-1&&(_e(g,{[vt.Unmount](){r.current.splice(v,1)},[vt.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var E;!Rn(r)&&o.current&&((E=n.current)==null||E.call(n))}))}),u=ne(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,vt.Unmount)}),s=m.useRef([]),a=m.useRef(Promise.resolve()),c=m.useRef({enter:[],leave:[]}),d=ne((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(([M,w])=>w)).then(()=>E())})]),g==="enter"?a.current=a.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(g)):v(g)}),p=ne((f,g,v)=>{Promise.all(c.current[g].splice(0).map(([E,M])=>M)).then(()=>{var E;(E=s.current.shift())==null||E()}).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 Is=m.Fragment,js=gn.RenderStrategy;function Rd(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,...E}=e,[M,w]=m.useState(null),N=m.useRef(null),j=Ds(e),F=We(...j?[N,t,w]:t===null?[]:[t]),k=(n=E.unmount)==null||n?vt.Unmount:vt.Hidden,{show:W,appear:h,initial:b}=jd(),[x,$]=m.useState(W?"visible":"hidden"),A=Fd(),{register:P,unregister:S}=A;ue(()=>P(N),[P,N]),ue(()=>{if(k===vt.Hidden&&N.current){if(W&&x!=="visible"){$("visible");return}return _e(x,{hidden:()=>S(N),visible:()=>P(N)})}},[x,N,P,S,W,k]);let O=Qr();ue(()=>{if(j&&O&&x==="visible"&&N.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[N,x,O,j]);let T=b&&!h,L=h&&W&&b,y=m.useRef(!1),I=Ms(()=>{y.current||($("hidden"),S(N))},A),_=ne(H=>{y.current=!0;let Z=H?"enter":"leave";I.onStart(N,Z,ae=>{ae==="enter"?i==null||i():ae==="leave"&&(u==null||u())})}),V=ne(H=>{let Z=H?"enter":"leave";y.current=!1,I.onStop(N,Z,ae=>{ae==="enter"?l==null||l():ae==="leave"&&(s==null||s())}),Z==="leave"&&!Rn(I)&&($("hidden"),S(N))});m.useEffect(()=>{j&&o||(_(W),V(W))},[W,j,o]);let z=!(!o||!j||!O||T),[,G]=Bi(z,M,W,{start:_,end:V}),q=bt({ref:F,className:((r=mr(E.className,L&&a,L&&c,G.enter&&a,G.enter&&G.closed&&c,G.enter&&!G.closed&&d,G.leave&&f,G.leave&&!G.closed&&g,G.leave&&G.closed&&v,!G.transition&&W&&p))==null?void 0:r.trim())||void 0,...Wi(G)}),B=0;x==="visible"&&(B|=qe.Open),x==="hidden"&&(B|=qe.Closed),W&&x==="hidden"&&(B|=qe.Opening),!W&&x==="visible"&&(B|=qe.Closing);let K=Me();return m.createElement(Fn.Provider,{value:I},m.createElement(Ns,{value:B},K({ourProps:q,theirProps:E,defaultTag:Is,features:js,visible:x==="visible",name:"Transition.Child"})))}function kd(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=m.useRef(null),u=Ds(e),s=We(...u?[l,t]:t===null?[]:[t]);Qr();let a=Xr();if(n===void 0&&a!==null&&(n=(a&qe.Open)===qe.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=Ms(()=>{n||d("hidden")}),[f,g]=m.useState(!0),v=m.useRef([n]);ue(()=>{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]);ue(()=>{n?d("visible"):!Rn(p)&&l.current!==null&&d("hidden")},[n,p]);let M={unmount:o},w=ne(()=>{var F;f&&g(!1),(F=e.beforeEnter)==null||F.call(e)}),N=ne(()=>{var F;f&&g(!1),(F=e.beforeLeave)==null||F.call(e)}),j=Me();return m.createElement(Fn.Provider,{value:p},m.createElement(jn.Provider,{value:E},j({ourProps:{...M,as:m.Fragment,children:m.createElement(Fs,{ref:s,...M,...i,beforeEnter:w,beforeLeave:N})},theirProps:{},defaultTag:m.Fragment,features:js,visible:c==="visible",name:"Transition"})))}function _d(e,t){let n=m.useContext(jn)!==null,r=Xr()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Jr,{ref:t,...e}):m.createElement(Fs,{ref:t,...e}))}let Jr=Te(kd),Fs=Te(Rd),Wd=Te(_d),Rs=Object.assign(Jr,{Child:Wd,Root:Jr});function Bd(e,t){let n=m.useRef({left:0,top:0});if(ue(()=>{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 ks=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function _s(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!at(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 ks.test(l)&&(l=l.replace(ks,"")),l}function Ud(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():_s(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return _s(e).trim()}function Vd(e){let t=m.useRef(""),n=m.useRef("");return ne(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=Ud(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var zd=Object.defineProperty,Hd=(e,t,n)=>t in e?zd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ws=(e,t,n)=>(Hd(e,typeof t!="symbol"?t+"":t,n),n),be=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(be||{}),tt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(tt||{}),kn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(kn||{}),Bs=(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))(Bs||{});function Us(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Di(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 Gd={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:fe.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===fe.Nothing)return{...u,activeOptionIndex:null};if(t.focus===fe.Specific)return{...u,activeOptionIndex:e.options.findIndex(c=>c.id===t.id)};if(t.focus===fe.Previous){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=In(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===fe.Next){let c=e.activeOptionIndex;if(c!==null){let d=e.options[c].dataRef.current.domRef,p=In(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=Us(e),a=In(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!==fe.Nothing&&(r=In(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:fe.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,...Us(e),pendingShouldSort:!1}:e};class Zr extends yi{constructor(t){super(t),Ws(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:l}=this.state.dataRef.current;return _e(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:wr(()=>{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:wr(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:wr(()=>{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:fe.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})}}),Ws(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=Er.get(null);this.disposables.add(r.on(Ci.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 Zr({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:fe.Nothing},__demoMode:n})}reduce(t,n){return _e(n.type,Gd,t,n)}}const Vs=m.createContext(null);function eo(e){let t=m.useContext(Vs);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,zs),n}return t}function zs({id:e,__demoMode:t=!1}){let n=m.useMemo(()=>Zr.new({id:e,__demoMode:t}),[]);return Ls(()=>n.dispose()),n}let _n=m.createContext(null);_n.displayName="ListboxDataContext";function nn(e){let t=m.useContext(_n);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,nn),n}return t}let Yd=m.Fragment;function Kd(e,t){let n=m.useId(),r=pr(),{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 E=p?"horizontal":"vertical";let M=We(t),w=fu(i),[N=f?[]:void 0,j]=cu(o,s,w),F=zs({id:n,__demoMode:g}),k=m.useRef({static:!1,hold:!1}),W=m.useRef(new Map),h=Ru(a),b=m.useCallback(z=>_e(x.mode,{[tt.Multi]:()=>N.some(G=>h(G,z)),[tt.Single]:()=>h(N,z)}),[N]),x=m.useMemo(()=>({value:N,disabled:d,invalid:c,mode:f?tt.Multi:tt.Single,orientation:E,onChange:j,compare:h,isSelected:b,optionsPropsRef:k,listRef:W}),[N,d,c,f,E,j,h,b,k,W]);ue(()=>{F.state.dataRef.current=x},[x]);let $=Ue(F,z=>z.listboxState),A=Er.get(null),P=Ue(A,m.useCallback(z=>A.selectors.isTop(z,n),[A,n])),[S,O]=Ue(F,z=>[z.buttonElement,z.optionsElement]);cc(P,[S,O],(z,G)=>{F.send({type:Bs.CloseListbox}),$i(G,Lr.Loose)||(z.preventDefault(),S==null||S.focus())});let T=m.useMemo(()=>({open:$===be.Open,disabled:d,invalid:c,value:N}),[$,d,c,N]),[L,y]=$u({inherit:!0}),I={ref:M},_=m.useCallback(()=>{if(w!==void 0)return j==null?void 0:j(w)},[j,w]),V=Me();return m.createElement(y,{value:L,props:{htmlFor:S==null?void 0:S.id},slot:{open:$===be.Open,disabled:d}},m.createElement(gd,null,m.createElement(Vs.Provider,{value:F},m.createElement(_n.Provider,{value:x},m.createElement(Ns,{value:_e($,{[be.Open]:qe.Open,[be.Closed]:qe.Closed})},u!=null&&N!=null&&m.createElement(vu,{disabled:d,data:{[u]:N},form:l,onReset:_}),V({ourProps:I,theirProps:v,slot:T,defaultTag:Yd,name:"Listbox"}))))))}let qd="button";function Xd(e,t){let n=m.useId(),r=ui(),o=nn("Listbox.Button"),i=eo("Listbox.Button"),{id:l=r||`headlessui-listbox-button-${n}`,disabled:u=o.disabled||!1,autoFocus:s=!1,...a}=e,c=We(t,dd(),i.actions.setButtonElement),d=pd(),[p,f,g]=Ue(i,y=>[y.listboxState,y.buttonElement,y.optionsElement]),v=p===be.Open;pc(v,{trigger:f,action:m.useCallback(y=>{if(f!=null&&f.contains(y.target))return yn.Ignore;let I=y.target.closest('[role="option"]:not([data-disabled])');return at(I)?yn.Select(I):g!=null&&g.contains(y.target)?yn.Ignore:yn.Close},[f,g]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let E=ne(y=>{switch(y.key){case ve.Enter:du(y.currentTarget);break;case ve.Space:case ve.ArrowDown:y.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.First});break;case ve.ArrowUp:y.preventDefault(),i.actions.openListbox({focus:o.value?fe.Nothing:fe.Last});break}}),M=ne(y=>{switch(y.key){case ve.Space:y.preventDefault();break}}),w=ne(y=>{var I;if(y.button===Ps.Left){if(Cu(y.currentTarget))return y.preventDefault();i.state.listboxState===be.Open?(we.flushSync(()=>i.actions.closeListbox()),(I=i.state.buttonElement)==null||I.focus({preventScroll:!0})):(y.preventDefault(),i.actions.openListbox({focus:fe.Nothing}))}}),N=m.useRef(null),j=ne(y=>{N.current=y.pointerType,y.pointerType==="mouse"&&w(y)}),F=ne(y=>{N.current!=="mouse"&&w(y)}),k=ne(y=>y.preventDefault()),W=gi([l]),h=Nu(),{isFocusVisible:b,focusProps:x}=Ja({autoFocus:s}),{isHovered:$,hoverProps:A}=Qa({isDisabled:u}),{pressed:P,pressProps:S}=ou({disabled:u}),O=m.useMemo(()=>({open:p===be.Open,active:P||p===be.Open,disabled:u,invalid:o.invalid,value:o.value,hover:$,focus:b,autofocus:s}),[p,o.value,u,$,b,P,o.invalid,s]),T=Ue(i,y=>y.listboxState===be.Open),L=oi(d(),{ref:c,id:l,type:mc(e,f),"aria-haspopup":"listbox","aria-controls":g==null?void 0:g.id,"aria-expanded":T,"aria-labelledby":W,"aria-describedby":h,disabled:u||void 0,autoFocus:s,onKeyDown:E,onKeyUp:M,onKeyPress:k,onPointerDown:j,onClick:F},x,A,S);return Me()({ourProps:L,theirProps:a,slot:O,defaultTag:qd,name:"Listbox.Button"})}let Hs=m.createContext(!1),Qd="div",Jd=gn.RenderStrategy|gn.Static;function Zd(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=fd(o),[c,d]=m.useState(null);a&&(i=!0);let p=nn("Listbox.Options"),f=eo("Listbox.Options"),[g,v,E,M]=Ue(f,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),w=Ar(v),N=Ar(E),j=Xr(),[F,k]=Bi(u,c,j!==null?(j&qe.Open)===qe.Open:g===be.Open);Ju(F,v,f.actions.closeListbox);let W=M?!1:l&&g===be.Open;Ec(W,N);let h=M?!1:l&&g===be.Open;Qu(h,{allowed:m.useCallback(()=>[v,E],[v,E])});let b=g!==be.Open,x=Bd(b,v)?!1:F,$=F&&g===be.Closed,A=xd($,p.value),P=ne(H=>p.compare(A,H)),S=Ue(f,H=>{var Z;if(a==null||!((Z=a==null?void 0:a.to)!=null&&Z.includes("selection")))return null;let ae=H.options.findIndex(Ae=>P(Ae.dataRef.current.value));return ae===-1&&(ae=0),ae}),O=(()=>{if(a==null)return;if(S===null)return{...a,inner:void 0};let H=Array.from(p.listRef.current.values());return{...a,inner:{listRef:{current:H},index:S}}})(),[T,L]=hd(O),y=md(),I=We(t,a?T:null,f.actions.setOptionsElement,d),_=$t();m.useEffect(()=>{var H;let Z=E;Z&&g===be.Open&&Z!==((H=Kt(Z))==null?void 0:H.activeElement)&&(Z==null||Z.focus({preventScroll:!0}))},[g,E]);let V=ne(H=>{var Z,ae;switch(_.dispose(),H.key){case ve.Space:if(f.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),f.actions.search(H.key);case ve.Enter:if(H.preventDefault(),H.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:Ae}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(Ae.current.value)}p.mode===tt.Single&&(we.flushSync(()=>f.actions.closeListbox()),(Z=f.state.buttonElement)==null||Z.focus({preventScroll:!0}));break;case _e(p.orientation,{vertical:ve.ArrowDown,horizontal:ve.ArrowRight}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.Next});case _e(p.orientation,{vertical:ve.ArrowUp,horizontal:ve.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.Previous});case ve.Home:case ve.PageUp:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.First});case ve.End:case ve.PageDown:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:fe.Last});case ve.Escape:H.preventDefault(),H.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),(ae=f.state.buttonElement)==null||ae.focus({preventScroll:!0});return;case ve.Tab:H.preventDefault(),H.stopPropagation(),we.flushSync(()=>f.actions.closeListbox()),sc(f.state.buttonElement,H.shiftKey?Pr.Previous:Pr.Next);break;default:H.key.length===1&&(f.actions.search(H.key),_.setTimeout(()=>f.actions.clearSearch(),350));break}}),z=Ue(f,H=>{var Z;return(Z=H.buttonElement)==null?void 0:Z.id}),G=m.useMemo(()=>({open:g===be.Open}),[g]),q=oi(a?y():{},{id:r,ref:I,"aria-activedescendant":Ue(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===tt.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":p.orientation,onKeyDown:V,role:"listbox",tabIndex:g===be.Open?0:void 0,style:{...s.style,...L,"--button-width":_u(v,!0).width},...Wi(k)}),B=Me(),K=m.useMemo(()=>p.mode===tt.Multi?p:{...p,isSelected:P},[p,P]);return m.createElement(Dd,{enabled:i?e.static||F:!1,ownerDocument:w},m.createElement(_n.Provider,{value:K},B({ourProps:q,theirProps:s,slot:G,defaultTag:Qd,features:Jd,visible:x,name:"Listbox.Options"})))}let ep="div";function tp(e,t){let n=m.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...l}=e,u=m.useContext(Hs)===!0,s=nn("Listbox.Option"),a=eo("Listbox.Option"),c=Ue(a,x=>a.selectors.isActive(x,r)),d=s.isSelected(i),p=m.useRef(null),f=Vd(p),g=Ot({disabled:o,value:i,domRef:p,get textValue(){return f()}}),v=We(t,p,x=>{x?s.listRef.current.set(r,x):s.listRef.current.delete(r)}),E=Ue(a,x=>a.selectors.shouldScrollIntoView(x,r));ue(()=>{if(E)return Ke().requestAnimationFrame(()=>{var x,$;($=(x=p.current)==null?void 0:x.scrollIntoView)==null||$.call(x,{block:"nearest"})})},[E,p]),ue(()=>{if(!u)return a.actions.registerOption(r,g),()=>a.actions.unregisterOption(r)},[g,r,u]);let M=ne(x=>{var $;if(o)return x.preventDefault();a.actions.onChange(i),s.mode===tt.Single&&(we.flushSync(()=>a.actions.closeListbox()),($=a.state.buttonElement)==null||$.focus({preventScroll:!0}))}),w=ne(()=>{if(o)return a.actions.goToOption({focus:fe.Nothing});a.actions.goToOption({focus:fe.Specific,id:r})}),N=Sc(),j=ne(x=>N.update(x)),F=ne(x=>{N.wasMoved(x)&&(o||c&&a.state.activationTrigger===kn.Pointer||a.actions.goToOption({focus:fe.Specific,id:r},kn.Pointer))}),k=ne(x=>{N.wasMoved(x)&&(o||c&&a.state.activationTrigger===kn.Pointer&&a.actions.goToOption({focus:fe.Nothing}))}),W=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:M,onFocus:w,onPointerEnter:j,onMouseEnter:j,onPointerMove:F,onMouseMove:F,onPointerLeave:k,onMouseLeave:k},b=Me();return!d&&u?null:b({ourProps:h,theirProps:l,slot:W,defaultTag:ep,name:"Listbox.Option"})}let np=m.Fragment;function rp(e,t){let{options:n,placeholder:r,...o}=e,i={ref:We(t)},l=nn("ListboxSelectedOption"),u=m.useMemo(()=>({}),[]),s=l.value===void 0||l.value===null||l.mode===tt.Multi&&Array.isArray(l.value)&&l.value.length===0,a=Me();return m.createElement(Hs.Provider,{value:!0},a({ourProps:i,theirProps:{...o,children:m.createElement(m.Fragment,null,r&&s?r:n)},slot:u,defaultTag:np,name:"ListboxSelectedOption"}))}let op=Te(Kd),ip=Te(Xd),sp=ju,lp=Te(Zd),ap=Te(tp),up=Te(rp),wt=Object.assign(op,{Button:ip,Label:sp,Options:lp,Option:ap,SelectedOption:up});function cp({title:e,titleId:t,...n},r){return R.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?R.createElement("title",{id:t},e):null,R.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 Gs=R.forwardRef(cp),fp=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o=""})=>{const{t:i}=Ye();return C.jsx("div",{className:`relative ${o}`,children:C.jsx(wt,{value:t,onChange:n,disabled:r,children:({open:l})=>C.jsxs(C.Fragment,{children:[C.jsxs(wt.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
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(js,{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(wt.Options,{className:`
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(Rs,{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(wt.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=>C.jsx(wt.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(zs,{className:"w-4 h-4 text-blue-400"})]})},u.tokenAddress))})})]})})})},fp=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:i="mpc"})=>{const{t:l}=Ke();return C.jsx("div",{className:`relative ${o}`,children:C.jsx(wt,{value:t,onChange:n,disabled:r,children:({open:u})=>C.jsxs(C.Fragment,{children:[C.jsxs(wt.Button,{className:`
93
+ `,children:e.map(u=>C.jsx(wt.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(Gs,{className:"w-4 h-4 text-blue-400"})]})},u.tokenAddress))})})]})})})},dp=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:i="mpc"})=>{const{t:l}=Ye();return C.jsx("div",{className:`relative ${o}`,children:C.jsx(wt,{value:t,onChange:n,disabled:r,children:({open:u})=>C.jsxs(C.Fragment,{children:[C.jsxs(wt.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:[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(js,{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(wt.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(Rs,{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(wt.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=>C.jsx(wt.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(zs,{className:"w-4 h-4 text-blue-400"})]})},s.chainId))})})]})})})},eo=({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(fp,{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(cp,{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"})})]})},dp=(e,t)=>Number(e)>Number(t),Qe=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"},to=(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 to(s,t)}const i=parseFloat(e),l=parseFloat(t);return!isNaN(i)&&!isNaN(l)&&i>l?{isValid:!0,formattedValue:Qe(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},pp=(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)},Hs={ETHEREUM:1,SEPOLIA:11155111},mp=[Hs.ETHEREUM,Hs.SEPOLIA],hp=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!mp.includes(t)}return!0},gp=[{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}],no={wallet:"mpc",ethAddress:"",accountId:"",l2Key:""},ro={address:""},oo={multiChain:{minDeposit:10}};var Wn={},vp=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()}},bp=vp,Gs={"text/plain":"Text","text/html":"Url",default:"Text"},xp="Copy to clipboard: #{key}, Enter";function yp(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function wp(e,t){var n,r,o,i,l,u,s=!1;t||(t={}),n=t.debug||!1;try{o=bp(),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=Gs[t.format]||Gs.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=yp("message"in t?t.message:xp),window.prompt(r,e)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(i):l.removeAllRanges()),u&&document.body.removeChild(u),o()}return s}var Ep=wp;function io(e){"@babel/helpers - typeof";return io=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},io(e)}Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.CopyToClipboard=void 0;var Bn=Ys(m),Sp=Ys(Ep),Cp=["text","onCopy","options","children"];function Ys(e){return e&&e.__esModule?e:{default:e}}function Ks(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 qs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ks(Object(n),!0).forEach(function(r){lo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ks(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Op(e,t){if(e==null)return{};var n=Tp(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 Tp(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 Np(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pp(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 Lp(e,t,n){return t&&Pp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ap(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&&so(e,t)}function so(e,t){return so=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},so(e,t)}function $p(e){var t=Mp();return function(){var r=Un(e),o;if(t){var i=Un(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Dp(this,o)}}function Dp(e,t){if(t&&(io(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xs(e)}function Xs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mp(){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 Un(e){return Un=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Un(e)}function lo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qs=function(e){Ap(n,e);var t=$p(n);function n(){var r;Np(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)),lo(Xs(r),"onClick",function(u){var s=r.props,a=s.text,c=s.onCopy,d=s.children,p=s.options,f=Bn.default.Children.only(d),g=(0,Sp.default)(a,p);c&&c(a,g),f&&f.props&&typeof f.props.onClick=="function"&&f.props.onClick(u)}),r}return Lp(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var i=o.children,l=Op(o,Cp),u=Bn.default.Children.only(i);return Bn.default.cloneElement(u,qs(qs({},l),{},{onClick:this.onClick}))}}]),n}(Bn.default.PureComponent);Wn.CopyToClipboard=Qs,lo(Qs,"defaultProps",{onCopy:void 0,options:void 0});var Ip=Wn,ao=Ip.CopyToClipboard;ao.CopyToClipboard=ao;var jp=ao;const Fp=oa(jp);var kp=Object.defineProperty,Vn=Object.getOwnPropertySymbols,Js=Object.prototype.hasOwnProperty,Zs=Object.prototype.propertyIsEnumerable,el=(e,t,n)=>t in e?kp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uo=(e,t)=>{for(var n in t||(t={}))Js.call(t,n)&&el(e,n,t[n]);if(Vn)for(var n of Vn(t))Zs.call(t,n)&&el(e,n,t[n]);return e},co=(e,t)=>{var n={};for(var r in e)Js.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vn)for(var r of Vn(e))t.indexOf(r)<0&&Zs.call(e,r)&&(n[r]=e[r]);return n};/**
103
+ `,children:e.filter(s=>s[i==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(s=>C.jsx(wt.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(Gs,{className:"w-4 h-4 text-blue-400"})]})},s.chainId))})})]})})})},to=({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(dp,{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(fp,{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"})})]})},pp=(e,t)=>Number(e)>Number(t),Xe=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"},no=(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 no(s,t)}const i=parseFloat(e),l=parseFloat(t);return!isNaN(i)&&!isNaN(l)&&i>l?{isValid:!0,formattedValue:Xe(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},mp=(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)},Wn={ETHEREUM:1,ARBITRUM:42161,ARBITRUM_SEPOLIA:421614,SEPOLIA:11155111},hp=[Wn.ETHEREUM,Wn.SEPOLIA,Wn.ARBITRUM,Wn.ARBITRUM_SEPOLIA],gp=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!hp.includes(t)}return!0},vp=[{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}],ro={wallet:"mpc",ethAddress:"",accountId:"",l2Key:""},oo={address:""},io={multiChain:{minDeposit:10}};var Bn={},bp=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()}},xp=bp,Ys={"text/plain":"Text","text/html":"Url",default:"Text"},yp="Copy to clipboard: #{key}, Enter";function wp(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function Ep(e,t){var n,r,o,i,l,u,s=!1;t||(t={}),n=t.debug||!1;try{o=xp(),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=Ys[t.format]||Ys.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=wp("message"in t?t.message:yp),window.prompt(r,e)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(i):l.removeAllRanges()),u&&document.body.removeChild(u),o()}return s}var Sp=Ep;function so(e){"@babel/helpers - typeof";return so=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},so(e)}Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.CopyToClipboard=void 0;var Un=Ks(m),Cp=Ks(Sp),Op=["text","onCopy","options","children"];function Ks(e){return e&&e.__esModule?e:{default:e}}function qs(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 Xs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qs(Object(n),!0).forEach(function(r){ao(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qs(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tp(e,t){if(e==null)return{};var n=Np(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 Np(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 Pp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lp(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 Ap(e,t,n){return t&&Lp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $p(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&&lo(e,t)}function lo(e,t){return lo=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},lo(e,t)}function Dp(e){var t=Ip();return function(){var r=Vn(e),o;if(t){var i=Vn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Mp(this,o)}}function Mp(e,t){if(t&&(so(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qs(e)}function Qs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ip(){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 Vn(e){return Vn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Vn(e)}function ao(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Js=function(e){$p(n,e);var t=Dp(n);function n(){var r;Pp(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)),ao(Qs(r),"onClick",function(u){var s=r.props,a=s.text,c=s.onCopy,d=s.children,p=s.options,f=Un.default.Children.only(d),g=(0,Cp.default)(a,p);c&&c(a,g),f&&f.props&&typeof f.props.onClick=="function"&&f.props.onClick(u)}),r}return Ap(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var i=o.children,l=Tp(o,Op),u=Un.default.Children.only(i);return Un.default.cloneElement(u,Xs(Xs({},l),{},{onClick:this.onClick}))}}]),n}(Un.default.PureComponent);Bn.CopyToClipboard=Js,ao(Js,"defaultProps",{onCopy:void 0,options:void 0});var jp=Bn,uo=jp.CopyToClipboard;uo.CopyToClipboard=uo;var Fp=uo;const Rp=ia(Fp);var kp=Object.defineProperty,zn=Object.getOwnPropertySymbols,Zs=Object.prototype.hasOwnProperty,el=Object.prototype.propertyIsEnumerable,tl=(e,t,n)=>t in e?kp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,co=(e,t)=>{for(var n in t||(t={}))Zs.call(t,n)&&tl(e,n,t[n]);if(zn)for(var n of zn(t))el.call(t,n)&&tl(e,n,t[n]);return e},fo=(e,t)=>{var n={};for(var r in e)Zs.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zn)for(var r of zn(e))t.indexOf(r)<0&&el.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 Lt;(e=>{const t=class ee{constructor(s,a,c,d){if(this.version=s,this.errorCorrectionLevel=a,this.modules=[],this.isFunction=[],s<ee.MIN_VERSION||s>ee.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,a){const c=e.QrSegment.makeSegments(s);return ee.encodeSegments(c,a)}static encodeBinary(s,a){const c=e.QrSegment.makeBytes(s);return ee.encodeSegments([c],a)}static encodeSegments(s,a,c=1,d=40,p=-1,f=!0){if(!(ee.MIN_VERSION<=c&&c<=d&&d<=ee.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let g,v;for(g=c;;g++){const N=ee.getNumDataCodewords(g,a)*8,j=l.getTotalBits(s,g);if(j<=N){v=j;break}if(g>=d)throw new RangeError("Data too long")}for(const N of[ee.Ecc.MEDIUM,ee.Ecc.QUARTILE,ee.Ecc.HIGH])f&&v<=ee.getNumDataCodewords(g,N)*8&&(a=N);let E=[];for(const N of s){n(N.mode.modeBits,4,E),n(N.numChars,N.mode.numCharCountBits(g),E);for(const j of N.getData())E.push(j)}o(E.length==v);const M=ee.getNumDataCodewords(g,a)*8;o(E.length<=M),n(0,Math.min(4,M-E.length),E),n(0,(8-E.length%8)%8,E),o(E.length%8==0);for(let N=236;E.length<M;N^=253)n(N,8,E);let w=[];for(;w.length*8<E.length;)w.push(0);return E.forEach((N,j)=>w[j>>>3]|=N<<7-(j&7)),new ee(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!=ee.getNumDataCodewords(a,c))throw new RangeError("Invalid argument");const d=ee.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a],p=ee.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a],f=Math.floor(ee.getNumRawDataModules(a)/8),g=d-f%d,v=Math.floor(f/d);let E=[];const M=ee.reedSolomonComputeDivisor(p);for(let N=0,j=0;N<d;N++){let F=s.slice(j,j+v-p+(N<g?0:1));j+=F.length;const R=ee.reedSolomonComputeRemainder(F,M);N<g&&F.push(0),E.push(F.concat(R))}let w=[];for(let N=0;N<E[0].length;N++)E.forEach((j,F)=>{(N!=v-p||F>=g)&&w.push(j[N])});return o(w.length==f),w}drawCodewords(s){if(s.length!=Math.floor(ee.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 E=0;E<this.size;E++)this.modules[p][E]==f?(g++,g==5?s+=ee.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[p][E],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*ee.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+=ee.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[E][p],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*ee.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+=ee.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*ee.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<ee.MIN_VERSION||s>ee.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(ee.getNumRawDataModules(s)/8)-ee.ECC_CODEWORDS_PER_BLOCK[a.ordinal][s]*ee.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]=ee.reedSolomonMultiply(a[p],c),p+1<a.length&&(a[p]^=a[p+1]);c=ee.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]^=ee.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})(Lt||(Lt={})),(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={}))})(Lt||(Lt={})),(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={}))})(Lt||(Lt={}));var Rt=Lt;/**
107
+ */var Lt;(e=>{const t=class ee{constructor(s,a,c,d){if(this.version=s,this.errorCorrectionLevel=a,this.modules=[],this.isFunction=[],s<ee.MIN_VERSION||s>ee.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,a){const c=e.QrSegment.makeSegments(s);return ee.encodeSegments(c,a)}static encodeBinary(s,a){const c=e.QrSegment.makeBytes(s);return ee.encodeSegments([c],a)}static encodeSegments(s,a,c=1,d=40,p=-1,f=!0){if(!(ee.MIN_VERSION<=c&&c<=d&&d<=ee.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let g,v;for(g=c;;g++){const N=ee.getNumDataCodewords(g,a)*8,j=l.getTotalBits(s,g);if(j<=N){v=j;break}if(g>=d)throw new RangeError("Data too long")}for(const N of[ee.Ecc.MEDIUM,ee.Ecc.QUARTILE,ee.Ecc.HIGH])f&&v<=ee.getNumDataCodewords(g,N)*8&&(a=N);let E=[];for(const N of s){n(N.mode.modeBits,4,E),n(N.numChars,N.mode.numCharCountBits(g),E);for(const j of N.getData())E.push(j)}o(E.length==v);const M=ee.getNumDataCodewords(g,a)*8;o(E.length<=M),n(0,Math.min(4,M-E.length),E),n(0,(8-E.length%8)%8,E),o(E.length%8==0);for(let N=236;E.length<M;N^=253)n(N,8,E);let w=[];for(;w.length*8<E.length;)w.push(0);return E.forEach((N,j)=>w[j>>>3]|=N<<7-(j&7)),new ee(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!=ee.getNumDataCodewords(a,c))throw new RangeError("Invalid argument");const d=ee.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a],p=ee.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a],f=Math.floor(ee.getNumRawDataModules(a)/8),g=d-f%d,v=Math.floor(f/d);let E=[];const M=ee.reedSolomonComputeDivisor(p);for(let N=0,j=0;N<d;N++){let F=s.slice(j,j+v-p+(N<g?0:1));j+=F.length;const k=ee.reedSolomonComputeRemainder(F,M);N<g&&F.push(0),E.push(F.concat(k))}let w=[];for(let N=0;N<E[0].length;N++)E.forEach((j,F)=>{(N!=v-p||F>=g)&&w.push(j[N])});return o(w.length==f),w}drawCodewords(s){if(s.length!=Math.floor(ee.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 E=0;E<this.size;E++)this.modules[p][E]==f?(g++,g==5?s+=ee.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[p][E],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*ee.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+=ee.PENALTY_N1:g>5&&s++):(this.finderPenaltyAddHistory(g,v),f||(s+=this.finderPenaltyCountPatterns(v)*ee.PENALTY_N3),f=this.modules[E][p],g=1);s+=this.finderPenaltyTerminateAndCount(f,g,v)*ee.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+=ee.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*ee.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<ee.MIN_VERSION||s>ee.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(ee.getNumRawDataModules(s)/8)-ee.ECC_CODEWORDS_PER_BLOCK[a.ordinal][s]*ee.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]=ee.reedSolomonMultiply(a[p],c),p+1<a.length&&(a[p]^=a[p+1]);c=ee.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]^=ee.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})(Lt||(Lt={})),(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={}))})(Lt||(Lt={})),(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={}))})(Lt||(Lt={}));var kt=Lt;/**
108
108
  * @license qrcode.react
109
109
  * Copyright (c) Paul O'Shannessy
110
110
  * SPDX-License-Identifier: ISC
111
- */var Rp={L:Rt.QrCode.Ecc.LOW,M:Rt.QrCode.Ecc.MEDIUM,Q:Rt.QrCode.Ecc.QUARTILE,H:Rt.QrCode.Ecc.HIGH},tl=128,nl="L",rl="#FFFFFF",ol="#000000",il=!1,sl=1,_p=4,Wp=0,Bp=.1;function ll(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 al(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 Up(e,t,n,r){if(r==null)return null;const o=e.length+n*2,i=Math.floor(t*Bp),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),E=Math.ceil(u+a-g),M=Math.ceil(s+c-v);p={x:g,y:v,w:E,h:M}}const f=r.crossOrigin;return{x:a,y:c,h:s,w:u,excavation:p,opacity:d,crossOrigin:f}}function Vp(e,t){return t!=null?Math.max(Math.floor(t),0):e?_p:Wp}function ul({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,E)=>(v.push(...Rt.QrSegment.makeSegments(E)),v),[]);return Rt.QrCode.encodeSegments(g,Rp[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=Vp(r,o),v=f.length+g*2,E=Up(f,l,g,i);return{cells:f,margin:g,numCells:v,calculatedImageSettings:E}},[s,l,i,r,o]);return{qrcode:s,margin:c,cells:a,numCells:d,calculatedImageSettings:p}}var zp=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Hp=m.forwardRef(function(t,n){const r=t,{value:o,size:i=tl,level:l=nl,bgColor:u=rl,fgColor:s=ol,includeMargin:a=il,minVersion:c=sl,boostLevel:d,marginSize:p,imageSettings:f}=r,v=co(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:E}=v,M=co(v,["style"]),w=f==null?void 0:f.src,N=m.useRef(null),j=m.useRef(null),F=m.useCallback(S=>{N.current=S,typeof n=="function"?n(S):n&&(n.current=S)},[n]),[R,W]=m.useState(!1),{margin:h,cells:b,numCells:x,calculatedImageSettings:$}=ul({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:p,imageSettings:f,size:i});m.useEffect(()=>{if(N.current!=null){const S=N.current,O=S.getContext("2d");if(!O)return;let T=b;const L=j.current,y=$!=null&&L!==null&&L.complete&&L.naturalHeight!==0&&L.naturalWidth!==0;y&&$.excavation!=null&&(T=al(b,$.excavation));const I=window.devicePixelRatio||1;S.height=S.width=i*I;const _=i/x*I;O.scale(_,_),O.fillStyle=u,O.fillRect(0,0,x,x),O.fillStyle=s,zp?O.fill(new Path2D(ll(T,h))):b.forEach(function(V,z){V.forEach(function(G,q){G&&O.fillRect(q+h,z+h,1,1)})}),$&&(O.globalAlpha=$.opacity),y&&O.drawImage(L,$.x+h,$.y+h,$.w,$.h)}}),m.useEffect(()=>{W(!1)},[w]);const A=uo({height:i,width:i},E);let P=null;return w!=null&&(P=m.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{W(!0)},ref:j,crossOrigin:$==null?void 0:$.crossOrigin})),m.createElement(m.Fragment,null,m.createElement("canvas",uo({style:A,height:i,width:i,ref:F,role:"img"},M)),P)});Hp.displayName="QRCodeCanvas";var cl=m.forwardRef(function(t,n){const r=t,{value:o,size:i=tl,level:l=nl,bgColor:u=rl,fgColor:s=ol,includeMargin:a=il,minVersion:c=sl,boostLevel:d,title:p,marginSize:f,imageSettings:g}=r,v=co(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:E,cells:M,numCells:w,calculatedImageSettings:N}=ul({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:f,imageSettings:g,size:i});let j=M,F=null;g!=null&&N!=null&&(N.excavation!=null&&(j=al(M,N.excavation)),F=m.createElement("image",{href:g.src,height:N.h,width:N.w,x:N.x+E,y:N.y+E,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const R=ll(j,E);return m.createElement("svg",uo({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:R,shapeRendering:"crispEdges"}),F)});cl.displayName="QRCodeSVG";function Gp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Yp(){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 fl(){return/apple/i.test(navigator.vendor)}function Kp(){return Gp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function qp(){return Yp().includes("jsdom/")}const dl="data-floating-ui-focusable",Xp="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fo(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 _t(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&$r(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Wt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function po(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 Qp(e){return e.matches("html,body")}function rt(e){return(e==null?void 0:e.ownerDocument)||document}function pl(e){return Ee(e)&&e.matches(Xp)}function Jp(e){if(!e||qp())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Zp(e){return e?e.hasAttribute(dl)?e:e.querySelector("["+dl+"]")||e:null}function zn(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,...zn(e,o.id,n)])}function em(e){return"nativeEvent"in e}function rn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var tm=typeof document<"u",nm=function(){},ot=tm?m.useLayoutEffect:nm;const rm={...k};function Hn(e){const t=k.useRef(e);return ot(()=>{t.current=e}),t}const om=rm.useInsertionEffect||(e=>e());function it(e){const t=k.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return om(()=>{t.current=e}),k.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 ml=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function hl(e,t){const n=Qi(e,ml()),r=n.length;if(r===0)return;const o=fo(rt(e)),i=n.indexOf(o),l=i===-1?t===1?0:r-1:i+t;return n[l]}function im(e){return hl(rt(e).body,1)||e}function sm(e){return hl(rt(e).body,-1)||e}function mo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_t(n,r)}function lm(e){Qi(e,ml()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function gl(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 am="data-floating-ui-focusable",vl="active",bl="selected",um={...k};let xl=!1,cm=0;const yl=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+cm++;function fm(){const[e,t]=k.useState(()=>xl?yl():void 0);return ot(()=>{e==null&&t(yl())},[]),k.useEffect(()=>{xl=!0},[]),e}const ho=um.useId||fm;let go;process.env.NODE_ENV!=="production"&&(go=new Set);function dm(){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=go)!=null&&e.has(o))){var i;(i=go)==null||i.add(o),console.error(o)}}function pm(){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 mm=k.createContext(null),hm=k.createContext(null),vo=()=>{var e;return((e=k.useContext(mm))==null?void 0:e.id)||null},bo=()=>k.useContext(hm);function on(e){return"data-floating-ui-"+e}function ze(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const wl=on("safe-polygon");function xo(e,t,n){if(n&&!rn(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 yo(e){return typeof e=="function"?e():e}function gm(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=bo(),g=vo(),v=Hn(a),E=Hn(s),M=Hn(n),w=Hn(d),N=k.useRef(),j=k.useRef(-1),F=k.useRef(),R=k.useRef(-1),W=k.useRef(!0),h=k.useRef(!1),b=k.useRef(()=>{}),x=k.useRef(!1),$=it(()=>{var L;const y=(L=o.current.openEvent)==null?void 0:L.type;return(y==null?void 0:y.includes("mouse"))&&y!=="mousedown"});k.useEffect(()=>{if(!u)return;function L(y){let{open:I}=y;I||(ze(j),ze(R),W.current=!0,x.current=!1)}return i.on("openchange",L),()=>{i.off("openchange",L)}},[u,i]),k.useEffect(()=>{if(!u||!v.current||!n)return;function L(I){$()&&r(!1,I,"hover")}const y=rt(l.floating).documentElement;return y.addEventListener("mouseleave",L),()=>{y.removeEventListener("mouseleave",L)}},[l.floating,n,r,u,v,$]);const A=k.useCallback(function(L,y,I){y===void 0&&(y=!0),I===void 0&&(I="hover");const _=xo(E.current,"close",N.current);_&&!F.current?(ze(j),j.current=window.setTimeout(()=>r(!1,L,I),_)):y&&(ze(j),r(!1,L,I))},[E,r]),P=it(()=>{b.current(),F.current=void 0}),S=it(()=>{if(h.current){const L=rt(l.floating).body;L.style.pointerEvents="",L.removeAttribute(wl),h.current=!1}}),O=it(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);k.useEffect(()=>{if(!u)return;function L(z){if(ze(j),W.current=!1,c&&!rn(N.current)||yo(w.current)>0&&!xo(E.current,"open"))return;const G=xo(E.current,"open",N.current);G?j.current=window.setTimeout(()=>{M.current||r(!0,z,"hover")},G):n||r(!0,z,"hover")}function y(z){if(O()){S();return}b.current();const G=rt(l.floating);if(ze(R),x.current=!1,v.current&&o.current.floatingContext){n||ze(j),F.current=v.current({...o.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){S(),P(),O()||A(z,!0,"safe-polygon")}});const B=F.current;G.addEventListener("mousemove",B),b.current=()=>{G.removeEventListener("mousemove",B)};return}(N.current==="touch"?!_t(l.floating,z.relatedTarget):!0)&&A(z)}function I(z){O()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){S(),P(),O()||A(z)}})(z))}function _(){ze(j)}function V(z){O()||A(z,!1)}if(oe(l.domReference)){const z=l.domReference,G=l.floating;return n&&z.addEventListener("mouseleave",I),p&&z.addEventListener("mousemove",L,{once:!0}),z.addEventListener("mouseenter",L),z.addEventListener("mouseleave",y),G&&(G.addEventListener("mouseleave",I),G.addEventListener("mouseenter",_),G.addEventListener("mouseleave",V)),()=>{n&&z.removeEventListener("mouseleave",I),p&&z.removeEventListener("mousemove",L),z.removeEventListener("mouseenter",L),z.removeEventListener("mouseleave",y),G&&(G.removeEventListener("mouseleave",I),G.removeEventListener("mouseenter",_),G.removeEventListener("mouseleave",V))}}},[l,u,e,c,p,A,P,S,r,n,M,f,E,v,o,O,w]),ot(()=>{var L;if(u&&n&&(L=v.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&$()){h.current=!0;const I=l.floating;if(oe(l.domReference)&&I){var y;const _=rt(l.floating).body;_.setAttribute(wl,"");const V=l.domReference,z=f==null||(y=f.nodesRef.current.find(G=>G.id===g))==null||(y=y.context)==null?void 0:y.elements.floating;return z&&(z.style.pointerEvents=""),_.style.pointerEvents="none",V.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{_.style.pointerEvents="",V.style.pointerEvents="",I.style.pointerEvents=""}}}},[u,n,g,l,f,v,$]),ot(()=>{n||(N.current=void 0,x.current=!1,P(),S())},[n,P,S]),k.useEffect(()=>()=>{P(),ze(j),ze(R),S()},[u,l.domReference,P,S]);const T=k.useMemo(()=>{function L(y){N.current=y.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(y){const{nativeEvent:I}=y;function _(){!W.current&&!M.current&&r(!0,I,"hover")}c&&!rn(N.current)||n||yo(w.current)===0||x.current&&y.movementX**2+y.movementY**2<2||(ze(R),N.current==="touch"?_():(x.current=!0,R.current=window.setTimeout(_,yo(w.current))))}}},[c,r,n,M,w]);return k.useMemo(()=>u?{reference:T}:{},[u,T])}const El={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},Sl=k.forwardRef(function(t,n){const[r,o]=k.useState();ot(()=>{fl()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[on("focus-guard")]:"",style:El};return C.jsx("span",{...t,...i})}),Cl=k.createContext(null),Ol=on("portal");function vm(e){e===void 0&&(e={});const{id:t,root:n}=e,r=ho(),o=xm(),[i,l]=k.useState(null),u=k.useRef(null);return ot(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{u.current=null})},[i]),ot(()=>{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(Ol,""),s.appendChild(a),u.current=a,l(a)},[t,r]),ot(()=>{if(n===null||!r||u.current)return;let s=n||(o==null?void 0:o.portalNode);s&&!Ar(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(Ol,""),s=a||s,s.appendChild(c),u.current=c,l(c)},[t,n,r,o]),i}function bm(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=vm({id:n,root:r}),[l,u]=k.useState(null),s=k.useRef(null),a=k.useRef(null),c=k.useRef(null),d=k.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 k.useEffect(()=>{if(!i||!o||p)return;function v(E){i&&mo(E)&&(E.type==="focusin"?gl:lm)(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]),k.useEffect(()=>{i&&(f||gl(i))},[f,i]),C.jsxs(Cl.Provider,{value:k.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:u}),[o,i]),children:[g&&i&&C.jsx(Sl,{"data-type":"outside",ref:s,onFocus:v=>{if(mo(v,i)){var E;(E=c.current)==null||E.focus()}else{const M=l?l.domReference:null,w=sm(M);w==null||w.focus()}}}),g&&i&&C.jsx("span",{"aria-owns":i.id,style:El}),i&&Vt.createPortal(t,i),g&&i&&C.jsx(Sl,{"data-type":"outside",ref:a,onFocus:v=>{if(mo(v,i)){var E;(E=d.current)==null||E.focus()}else{const M=l?l.domReference:null,w=im(M);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,v.nativeEvent,"focus-out"))}}})]})}const xm=()=>k.useContext(Cl);function Tl(e){return Ee(e.target)&&e.target.tagName==="BUTTON"}function ym(e){return Ee(e.target)&&e.target.tagName==="A"}function Nl(e){return pl(e)}function wm(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=k.useRef(),f=k.useRef(!1),g=k.useMemo(()=>({onPointerDown(v){p.current=v.pointerType},onMouseDown(v){const E=p.current;v.button===0&&u!=="click"&&(rn(E,!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 E=p.current;if(u==="mousedown"&&p.current){p.current=void 0;return}rn(E,!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||Tl(v))&&(v.key===" "&&!Nl(i)&&(v.preventDefault(),f.current=!0),!ym(v)&&v.key==="Enter"&&r(!(n&&s),v.nativeEvent,"click"))},onKeyUp(v){v.defaultPrevented||!c||Tl(v)||Nl(i)||v.key===" "&&f.current&&(f.current=!1,r(!(n&&s),v.nativeEvent,"click"))}}),[o,i,u,a,c,r,n,d,s]);return k.useMemo(()=>l?{reference:g}:{},[l,g])}const Em={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Sm={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Pl=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 Cm(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=bo(),E=it(typeof s=="function"?s:()=>!1),M=typeof s=="function"?E:s,w=k.useRef(!1),{escapeKey:N,outsidePress:j}=Pl(f),{escapeKey:F,outsidePress:R}=Pl(g),W=k.useRef(!1),h=it(S=>{var O;if(!n||!l||!u||S.key!=="Escape"||W.current)return;const T=(O=i.current.floatingContext)==null?void 0:O.nodeId,L=v?zn(v.nodesRef.current,T):[];if(!N&&(S.stopPropagation(),L.length>0)){let y=!0;if(L.forEach(I=>{var _;if((_=I.context)!=null&&_.open&&!I.context.dataRef.current.__escapeKeyBubbles){y=!1;return}}),!y)return}r(!1,em(S)?S.nativeEvent:S,"escape-key")}),b=it(S=>{var O;const T=()=>{var L;h(S),(L=Wt(S))==null||L.removeEventListener("keydown",T)};(O=Wt(S))==null||O.addEventListener("keydown",T)}),x=it(S=>{var O;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const L=w.current;if(w.current=!1,a==="click"&&L||T||typeof M=="function"&&!M(S))return;const y=Wt(S),I="["+on("inert")+"]",_=rt(o.floating).querySelectorAll(I);let V=oe(y)?y:null;for(;V&&!ct(V);){const B=ft(V);if(ct(B)||!oe(B))break;V=B}if(_.length&&oe(y)&&!Qp(y)&&!_t(y,o.floating)&&Array.from(_).every(B=>!_t(V,B)))return;if(Ee(y)&&P){const B=ct(y),K=Ve(y),H=/auto|scroll/,Z=B||H.test(K.overflowX),ae=B||H.test(K.overflowY),Ae=Z&&y.clientWidth>0&&y.scrollWidth>y.clientWidth,$e=ae&&y.clientHeight>0&&y.scrollHeight>y.clientHeight,st=K.direction==="rtl",ye=$e&&(st?S.offsetX<=y.offsetWidth-y.clientWidth:S.offsetX>y.clientWidth),he=Ae&&S.offsetY>y.clientHeight;if(ye||he)return}const z=(O=i.current.floatingContext)==null?void 0:O.nodeId,G=v&&zn(v.nodesRef.current,z).some(B=>{var K;return po(S,(K=B.context)==null?void 0:K.elements.floating)});if(po(S,o.floating)||po(S,o.domReference)||G)return;const q=v?zn(v.nodesRef.current,z):[];if(q.length>0){let B=!0;if(q.forEach(K=>{var H;if((H=K.context)!=null&&H.open&&!K.context.dataRef.current.__outsidePressBubbles){B=!1;return}}),!B)return}r(!1,S,"outside-press")}),$=it(S=>{var O;const T=()=>{var L;x(S),(L=Wt(S))==null||L.removeEventListener(a,T)};(O=Wt(S))==null||O.addEventListener(a,T)});k.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=N,i.current.__outsidePressBubbles=j;let S=-1;function O(_){r(!1,_,"ancestor-scroll")}function T(){window.clearTimeout(S),W.current=!0}function L(){S=window.setTimeout(()=>{W.current=!1},Sn()?5:0)}const y=rt(o.floating);u&&(y.addEventListener("keydown",F?b:h,F),y.addEventListener("compositionstart",T),y.addEventListener("compositionend",L)),M&&y.addEventListener(a,R?$:x,R);let I=[];return p&&(oe(o.domReference)&&(I=xt(o.domReference)),oe(o.floating)&&(I=I.concat(xt(o.floating))),!oe(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(xt(o.reference.contextElement)))),I=I.filter(_=>{var V;return _!==((V=y.defaultView)==null?void 0:V.visualViewport)}),I.forEach(_=>{_.addEventListener("scroll",O,{passive:!0})}),()=>{u&&(y.removeEventListener("keydown",F?b:h,F),y.removeEventListener("compositionstart",T),y.removeEventListener("compositionend",L)),M&&y.removeEventListener(a,R?$:x,R),I.forEach(_=>{_.removeEventListener("scroll",O)}),window.clearTimeout(S)}},[i,o,u,M,a,n,r,p,l,N,j,h,F,b,x,R,$]),k.useEffect(()=>{i.current.insideReactTree=!1},[i,M,a]);const A=k.useMemo(()=>({onKeyDown:h,...c&&{[Em[d]]:S=>{r(!1,S.nativeEvent,"reference-press")},...d!=="click"&&{onClick(S){r(!1,S.nativeEvent,"reference-press")}}}}),[h,r,c,d]),P=k.useMemo(()=>({onKeyDown:h,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Sm[a]]:()=>{i.current.insideReactTree=!0}}),[h,a,i]);return k.useMemo(()=>l?{reference:A,floating:P}:{},[l,A,P])}function Om(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ho(),i=k.useRef({}),[l]=k.useState(()=>pm()),u=vo()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&dm("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]=k.useState(r.reference),c=it((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=k.useMemo(()=>({setPositionReference:a}),[]),p=k.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return k.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function Tm(e){e===void 0&&(e={});const{nodeId:t}=e,n=Om({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=k.useState(null),[u,s]=k.useState(null),c=(o==null?void 0:o.domReference)||i,d=k.useRef(null),p=bo();ot(()=>{c&&(d.current=c)},[c]);const f=ds({...e,elements:{...o,...u&&{reference:u}}}),g=k.useCallback(N=>{const j=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;s(j),f.refs.setReference(j)},[f.refs]),v=k.useCallback(N=>{(oe(N)||N===null)&&(d.current=N,l(N)),(oe(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!oe(N))&&f.refs.setReference(N)},[f.refs]),E=k.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),M=k.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=k.useMemo(()=>({...f,...r,refs:E,elements:M,nodeId:t}),[f,E,M,t,r]);return ot(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(j=>j.id===t);N&&(N.context=w)}),k.useMemo(()=>({...f,context:w,refs:E,elements:M}),[f,E,M,w])}function wo(){return Kp()&&fl()}function Nm(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=k.useRef(!1),c=k.useRef(-1),d=k.useRef(!0);k.useEffect(()=>{if(!u)return;const f=Ne(l.domReference);function g(){!n&&Ee(l.domReference)&&l.domReference===fo(rt(l.domReference))&&(a.current=!0)}function v(){d.current=!0}function E(){d.current=!1}return f.addEventListener("blur",g),wo()&&(f.addEventListener("keydown",v,!0),f.addEventListener("pointerdown",E,!0)),()=>{f.removeEventListener("blur",g),wo()&&(f.removeEventListener("keydown",v,!0),f.removeEventListener("pointerdown",E,!0))}},[l.domReference,n,u]),k.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]),k.useEffect(()=>()=>{ze(c)},[]);const p=k.useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(f){if(a.current)return;const g=Wt(f.nativeEvent);if(s&&oe(g)){if(wo()&&!f.relatedTarget){if(!d.current&&!pl(g))return}else if(!Jp(g))return}r(!0,f.nativeEvent,"focus")},onBlur(f){a.current=!1;const g=f.relatedTarget,v=f.nativeEvent,E=oe(g)&&g.hasAttribute(on("focus-guard"))&&g.getAttribute("data-type")==="outside";c.current=window.setTimeout(()=>{var M;const w=fo(l.domReference?l.domReference.ownerDocument:document);!g&&w===l.domReference||_t((M=i.current.floatingContext)==null?void 0:M.refs.floating.current,w)||_t(l.domReference,w)||E||r(!1,v,"focus")})}}),[i,l.domReference,r,s]);return k.useMemo(()=>u?{reference:p}:{},[u,p])}function Eo(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[vl]:l,[bl]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[am]:""},...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&&[vl,bl].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(E=>E(...g)).find(E=>E!==void 0)}}}else l[a]=c}),l),{})}}function Pm(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=k.useCallback(u=>Eo(u,e,"reference"),t),i=k.useCallback(u=>Eo(u,e,"floating"),n),l=k.useCallback(u=>Eo(u,e,"item"),r);return k.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}const Lm=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Am(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=ho(),c=((n=i.domReference)==null?void 0:n.id)||a,d=k.useMemo(()=>{var w;return((w=Zp(i.floating))==null?void 0:w.id)||l},[i.floating,l]),p=(r=Lm.get(s))!=null?r:s,g=vo()!=null,v=k.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=k.useMemo(()=>{const w={id:d,...p&&{role:p}};return p==="tooltip"||s==="label"?w:{...w,...p==="menu"&&{"aria-labelledby":c}}},[p,d,c,s]),M=k.useCallback(w=>{let{active:N,selected:j}=w;const F={role:"option",...N&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...F,"aria-selected":j}}return{}},[d,s]);return k.useMemo(()=>u?{reference:v,floating:E,item:M}:{},[u,v,E,M])}const Ll=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})});Ll.displayName="TooltipArrow";const sn=({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}=Tm({open:a&&!l,onOpenChange:c,placement:n,whileElementsMounted:as,middleware:[Vr(o?12:8),ms({fallbackAxisSideDirection:"start",padding:8}),ps({padding:8}),...o?[Gf({element:d})]:[]]}),v=gm(g,{enabled:s.includes("hover"),delay:{open:r,close:150}}),E=Nm(g,{enabled:s.includes("focus")}),M=wm(g,{enabled:s.includes("click")}),w=Cm(g),N=Am(g,{role:"tooltip"}),{getReferenceProps:j,getFloatingProps:F}=Pm([v,E,M,w,N]);return l?C.jsx(C.Fragment,{children:e}):C.jsxs(C.Fragment,{children:[C.jsx("div",{ref:p.setReference,...j(),children:e}),a&&C.jsx(bm,{children:C.jsxs("div",{ref:p.setFloating,...F(),style:f,className:`
111
+ */var _p={L:kt.QrCode.Ecc.LOW,M:kt.QrCode.Ecc.MEDIUM,Q:kt.QrCode.Ecc.QUARTILE,H:kt.QrCode.Ecc.HIGH},nl=128,rl="L",ol="#FFFFFF",il="#000000",sl=!1,ll=1,Wp=4,Bp=0,Up=.1;function al(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 ul(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 Vp(e,t,n,r){if(r==null)return null;const o=e.length+n*2,i=Math.floor(t*Up),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),E=Math.ceil(u+a-g),M=Math.ceil(s+c-v);p={x:g,y:v,w:E,h:M}}const f=r.crossOrigin;return{x:a,y:c,h:s,w:u,excavation:p,opacity:d,crossOrigin:f}}function zp(e,t){return t!=null?Math.max(Math.floor(t),0):e?Wp:Bp}function cl({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,E)=>(v.push(...kt.QrSegment.makeSegments(E)),v),[]);return kt.QrCode.encodeSegments(g,_p[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=zp(r,o),v=f.length+g*2,E=Vp(f,l,g,i);return{cells:f,margin:g,numCells:v,calculatedImageSettings:E}},[s,l,i,r,o]);return{qrcode:s,margin:c,cells:a,numCells:d,calculatedImageSettings:p}}var Hp=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Gp=m.forwardRef(function(t,n){const r=t,{value:o,size:i=nl,level:l=rl,bgColor:u=ol,fgColor:s=il,includeMargin:a=sl,minVersion:c=ll,boostLevel:d,marginSize:p,imageSettings:f}=r,v=fo(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:E}=v,M=fo(v,["style"]),w=f==null?void 0:f.src,N=m.useRef(null),j=m.useRef(null),F=m.useCallback(S=>{N.current=S,typeof n=="function"?n(S):n&&(n.current=S)},[n]),[k,W]=m.useState(!1),{margin:h,cells:b,numCells:x,calculatedImageSettings:$}=cl({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:p,imageSettings:f,size:i});m.useEffect(()=>{if(N.current!=null){const S=N.current,O=S.getContext("2d");if(!O)return;let T=b;const L=j.current,y=$!=null&&L!==null&&L.complete&&L.naturalHeight!==0&&L.naturalWidth!==0;y&&$.excavation!=null&&(T=ul(b,$.excavation));const I=window.devicePixelRatio||1;S.height=S.width=i*I;const _=i/x*I;O.scale(_,_),O.fillStyle=u,O.fillRect(0,0,x,x),O.fillStyle=s,Hp?O.fill(new Path2D(al(T,h))):b.forEach(function(V,z){V.forEach(function(G,q){G&&O.fillRect(q+h,z+h,1,1)})}),$&&(O.globalAlpha=$.opacity),y&&O.drawImage(L,$.x+h,$.y+h,$.w,$.h)}}),m.useEffect(()=>{W(!1)},[w]);const A=co({height:i,width:i},E);let P=null;return w!=null&&(P=m.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{W(!0)},ref:j,crossOrigin:$==null?void 0:$.crossOrigin})),m.createElement(m.Fragment,null,m.createElement("canvas",co({style:A,height:i,width:i,ref:F,role:"img"},M)),P)});Gp.displayName="QRCodeCanvas";var fl=m.forwardRef(function(t,n){const r=t,{value:o,size:i=nl,level:l=rl,bgColor:u=ol,fgColor:s=il,includeMargin:a=sl,minVersion:c=ll,boostLevel:d,title:p,marginSize:f,imageSettings:g}=r,v=fo(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:E,cells:M,numCells:w,calculatedImageSettings:N}=cl({value:o,level:l,minVersion:c,boostLevel:d,includeMargin:a,marginSize:f,imageSettings:g,size:i});let j=M,F=null;g!=null&&N!=null&&(N.excavation!=null&&(j=ul(M,N.excavation)),F=m.createElement("image",{href:g.src,height:N.h,width:N.w,x:N.x+E,y:N.y+E,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const k=al(j,E);return m.createElement("svg",co({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:k,shapeRendering:"crispEdges"}),F)});fl.displayName="QRCodeSVG";function Yp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Kp(){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 dl(){return/apple/i.test(navigator.vendor)}function qp(){return Yp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Xp(){return Kp().includes("jsdom/")}const pl="data-floating-ui-focusable",Qp="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function po(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 _t(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Dr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Wt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function mo(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 Jp(e){return e.matches("html,body")}function nt(e){return(e==null?void 0:e.ownerDocument)||document}function ml(e){return Ee(e)&&e.matches(Qp)}function Zp(e){if(!e||Xp())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function em(e){return e?e.hasAttribute(pl)?e:e.querySelector("["+pl+"]")||e:null}function Hn(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,...Hn(e,o.id,n)])}function tm(e){return"nativeEvent"in e}function rn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var nm=typeof document<"u",rm=function(){},rt=nm?m.useLayoutEffect:rm;const om={...R};function Gn(e){const t=R.useRef(e);return rt(()=>{t.current=e}),t}const im=om.useInsertionEffect||(e=>e());function ot(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return im(()=>{t.current=e}),R.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 hl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function gl(e,t){const n=Zi(e,hl()),r=n.length;if(r===0)return;const o=po(nt(e)),i=n.indexOf(o),l=i===-1?t===1?0:r-1:i+t;return n[l]}function sm(e){return gl(nt(e).body,1)||e}function lm(e){return gl(nt(e).body,-1)||e}function ho(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_t(n,r)}function am(e){Zi(e,hl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function vl(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 um="data-floating-ui-focusable",bl="active",xl="selected",cm={...R};let yl=!1,fm=0;const wl=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fm++;function dm(){const[e,t]=R.useState(()=>yl?wl():void 0);return rt(()=>{e==null&&t(wl())},[]),R.useEffect(()=>{yl=!0},[]),e}const go=cm.useId||dm;let vo;process.env.NODE_ENV!=="production"&&(vo=new Set);function pm(){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=vo)!=null&&e.has(o))){var i;(i=vo)==null||i.add(o),console.error(o)}}function mm(){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 hm=R.createContext(null),gm=R.createContext(null),bo=()=>{var e;return((e=R.useContext(hm))==null?void 0:e.id)||null},xo=()=>R.useContext(gm);function on(e){return"data-floating-ui-"+e}function ze(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const El=on("safe-polygon");function yo(e,t,n){if(n&&!rn(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 wo(e){return typeof e=="function"?e():e}function vm(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=xo(),g=bo(),v=Gn(a),E=Gn(s),M=Gn(n),w=Gn(d),N=R.useRef(),j=R.useRef(-1),F=R.useRef(),k=R.useRef(-1),W=R.useRef(!0),h=R.useRef(!1),b=R.useRef(()=>{}),x=R.useRef(!1),$=ot(()=>{var L;const y=(L=o.current.openEvent)==null?void 0:L.type;return(y==null?void 0:y.includes("mouse"))&&y!=="mousedown"});R.useEffect(()=>{if(!u)return;function L(y){let{open:I}=y;I||(ze(j),ze(k),W.current=!0,x.current=!1)}return i.on("openchange",L),()=>{i.off("openchange",L)}},[u,i]),R.useEffect(()=>{if(!u||!v.current||!n)return;function L(I){$()&&r(!1,I,"hover")}const y=nt(l.floating).documentElement;return y.addEventListener("mouseleave",L),()=>{y.removeEventListener("mouseleave",L)}},[l.floating,n,r,u,v,$]);const A=R.useCallback(function(L,y,I){y===void 0&&(y=!0),I===void 0&&(I="hover");const _=yo(E.current,"close",N.current);_&&!F.current?(ze(j),j.current=window.setTimeout(()=>r(!1,L,I),_)):y&&(ze(j),r(!1,L,I))},[E,r]),P=ot(()=>{b.current(),F.current=void 0}),S=ot(()=>{if(h.current){const L=nt(l.floating).body;L.style.pointerEvents="",L.removeAttribute(El),h.current=!1}}),O=ot(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);R.useEffect(()=>{if(!u)return;function L(z){if(ze(j),W.current=!1,c&&!rn(N.current)||wo(w.current)>0&&!yo(E.current,"open"))return;const G=yo(E.current,"open",N.current);G?j.current=window.setTimeout(()=>{M.current||r(!0,z,"hover")},G):n||r(!0,z,"hover")}function y(z){if(O()){S();return}b.current();const G=nt(l.floating);if(ze(k),x.current=!1,v.current&&o.current.floatingContext){n||ze(j),F.current=v.current({...o.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){S(),P(),O()||A(z,!0,"safe-polygon")}});const B=F.current;G.addEventListener("mousemove",B),b.current=()=>{G.removeEventListener("mousemove",B)};return}(N.current==="touch"?!_t(l.floating,z.relatedTarget):!0)&&A(z)}function I(z){O()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){S(),P(),O()||A(z)}})(z))}function _(){ze(j)}function V(z){O()||A(z,!1)}if(oe(l.domReference)){const z=l.domReference,G=l.floating;return n&&z.addEventListener("mouseleave",I),p&&z.addEventListener("mousemove",L,{once:!0}),z.addEventListener("mouseenter",L),z.addEventListener("mouseleave",y),G&&(G.addEventListener("mouseleave",I),G.addEventListener("mouseenter",_),G.addEventListener("mouseleave",V)),()=>{n&&z.removeEventListener("mouseleave",I),p&&z.removeEventListener("mousemove",L),z.removeEventListener("mouseenter",L),z.removeEventListener("mouseleave",y),G&&(G.removeEventListener("mouseleave",I),G.removeEventListener("mouseenter",_),G.removeEventListener("mouseleave",V))}}},[l,u,e,c,p,A,P,S,r,n,M,f,E,v,o,O,w]),rt(()=>{var L;if(u&&n&&(L=v.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&$()){h.current=!0;const I=l.floating;if(oe(l.domReference)&&I){var y;const _=nt(l.floating).body;_.setAttribute(El,"");const V=l.domReference,z=f==null||(y=f.nodesRef.current.find(G=>G.id===g))==null||(y=y.context)==null?void 0:y.elements.floating;return z&&(z.style.pointerEvents=""),_.style.pointerEvents="none",V.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{_.style.pointerEvents="",V.style.pointerEvents="",I.style.pointerEvents=""}}}},[u,n,g,l,f,v,$]),rt(()=>{n||(N.current=void 0,x.current=!1,P(),S())},[n,P,S]),R.useEffect(()=>()=>{P(),ze(j),ze(k),S()},[u,l.domReference,P,S]);const T=R.useMemo(()=>{function L(y){N.current=y.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(y){const{nativeEvent:I}=y;function _(){!W.current&&!M.current&&r(!0,I,"hover")}c&&!rn(N.current)||n||wo(w.current)===0||x.current&&y.movementX**2+y.movementY**2<2||(ze(k),N.current==="touch"?_():(x.current=!0,k.current=window.setTimeout(_,wo(w.current))))}}},[c,r,n,M,w]);return R.useMemo(()=>u?{reference:T}:{},[u,T])}const Sl={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},Cl=R.forwardRef(function(t,n){const[r,o]=R.useState();rt(()=>{dl()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[on("focus-guard")]:"",style:Sl};return C.jsx("span",{...t,...i})}),Ol=R.createContext(null),Tl=on("portal");function bm(e){e===void 0&&(e={});const{id:t,root:n}=e,r=go(),o=ym(),[i,l]=R.useState(null),u=R.useRef(null);return rt(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{u.current=null})},[i]),rt(()=>{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(Tl,""),s.appendChild(a),u.current=a,l(a)},[t,r]),rt(()=>{if(n===null||!r||u.current)return;let s=n||(o==null?void 0:o.portalNode);s&&!$r(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(Tl,""),s=a||s,s.appendChild(c),u.current=c,l(c)},[t,n,r,o]),i}function xm(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=bm({id:n,root:r}),[l,u]=R.useState(null),s=R.useRef(null),a=R.useRef(null),c=R.useRef(null),d=R.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 R.useEffect(()=>{if(!i||!o||p)return;function v(E){i&&ho(E)&&(E.type==="focusin"?vl:am)(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]),R.useEffect(()=>{i&&(f||vl(i))},[f,i]),C.jsxs(Ol.Provider,{value:R.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:u}),[o,i]),children:[g&&i&&C.jsx(Cl,{"data-type":"outside",ref:s,onFocus:v=>{if(ho(v,i)){var E;(E=c.current)==null||E.focus()}else{const M=l?l.domReference:null,w=lm(M);w==null||w.focus()}}}),g&&i&&C.jsx("span",{"aria-owns":i.id,style:Sl}),i&&Vt.createPortal(t,i),g&&i&&C.jsx(Cl,{"data-type":"outside",ref:a,onFocus:v=>{if(ho(v,i)){var E;(E=d.current)==null||E.focus()}else{const M=l?l.domReference:null,w=sm(M);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,v.nativeEvent,"focus-out"))}}})]})}const ym=()=>R.useContext(Ol);function Nl(e){return Ee(e.target)&&e.target.tagName==="BUTTON"}function wm(e){return Ee(e.target)&&e.target.tagName==="A"}function Pl(e){return ml(e)}function Em(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=R.useRef(),f=R.useRef(!1),g=R.useMemo(()=>({onPointerDown(v){p.current=v.pointerType},onMouseDown(v){const E=p.current;v.button===0&&u!=="click"&&(rn(E,!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 E=p.current;if(u==="mousedown"&&p.current){p.current=void 0;return}rn(E,!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||Nl(v))&&(v.key===" "&&!Pl(i)&&(v.preventDefault(),f.current=!0),!wm(v)&&v.key==="Enter"&&r(!(n&&s),v.nativeEvent,"click"))},onKeyUp(v){v.defaultPrevented||!c||Nl(v)||Pl(i)||v.key===" "&&f.current&&(f.current=!1,r(!(n&&s),v.nativeEvent,"click"))}}),[o,i,u,a,c,r,n,d,s]);return R.useMemo(()=>l?{reference:g}:{},[l,g])}const Sm={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Cm={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ll=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 Om(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=xo(),E=ot(typeof s=="function"?s:()=>!1),M=typeof s=="function"?E:s,w=R.useRef(!1),{escapeKey:N,outsidePress:j}=Ll(f),{escapeKey:F,outsidePress:k}=Ll(g),W=R.useRef(!1),h=ot(S=>{var O;if(!n||!l||!u||S.key!=="Escape"||W.current)return;const T=(O=i.current.floatingContext)==null?void 0:O.nodeId,L=v?Hn(v.nodesRef.current,T):[];if(!N&&(S.stopPropagation(),L.length>0)){let y=!0;if(L.forEach(I=>{var _;if((_=I.context)!=null&&_.open&&!I.context.dataRef.current.__escapeKeyBubbles){y=!1;return}}),!y)return}r(!1,tm(S)?S.nativeEvent:S,"escape-key")}),b=ot(S=>{var O;const T=()=>{var L;h(S),(L=Wt(S))==null||L.removeEventListener("keydown",T)};(O=Wt(S))==null||O.addEventListener("keydown",T)}),x=ot(S=>{var O;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const L=w.current;if(w.current=!1,a==="click"&&L||T||typeof M=="function"&&!M(S))return;const y=Wt(S),I="["+on("inert")+"]",_=nt(o.floating).querySelectorAll(I);let V=oe(y)?y:null;for(;V&&!ut(V);){const B=ct(V);if(ut(B)||!oe(B))break;V=B}if(_.length&&oe(y)&&!Jp(y)&&!_t(y,o.floating)&&Array.from(_).every(B=>!_t(V,B)))return;if(Ee(y)&&P){const B=ut(y),K=Ve(y),H=/auto|scroll/,Z=B||H.test(K.overflowX),ae=B||H.test(K.overflowY),Ae=Z&&y.clientWidth>0&&y.scrollWidth>y.clientWidth,$e=ae&&y.clientHeight>0&&y.scrollHeight>y.clientHeight,it=K.direction==="rtl",ye=$e&&(it?S.offsetX<=y.offsetWidth-y.clientWidth:S.offsetX>y.clientWidth),he=Ae&&S.offsetY>y.clientHeight;if(ye||he)return}const z=(O=i.current.floatingContext)==null?void 0:O.nodeId,G=v&&Hn(v.nodesRef.current,z).some(B=>{var K;return mo(S,(K=B.context)==null?void 0:K.elements.floating)});if(mo(S,o.floating)||mo(S,o.domReference)||G)return;const q=v?Hn(v.nodesRef.current,z):[];if(q.length>0){let B=!0;if(q.forEach(K=>{var H;if((H=K.context)!=null&&H.open&&!K.context.dataRef.current.__outsidePressBubbles){B=!1;return}}),!B)return}r(!1,S,"outside-press")}),$=ot(S=>{var O;const T=()=>{var L;x(S),(L=Wt(S))==null||L.removeEventListener(a,T)};(O=Wt(S))==null||O.addEventListener(a,T)});R.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=N,i.current.__outsidePressBubbles=j;let S=-1;function O(_){r(!1,_,"ancestor-scroll")}function T(){window.clearTimeout(S),W.current=!0}function L(){S=window.setTimeout(()=>{W.current=!1},Sn()?5:0)}const y=nt(o.floating);u&&(y.addEventListener("keydown",F?b:h,F),y.addEventListener("compositionstart",T),y.addEventListener("compositionend",L)),M&&y.addEventListener(a,k?$:x,k);let I=[];return p&&(oe(o.domReference)&&(I=xt(o.domReference)),oe(o.floating)&&(I=I.concat(xt(o.floating))),!oe(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(xt(o.reference.contextElement)))),I=I.filter(_=>{var V;return _!==((V=y.defaultView)==null?void 0:V.visualViewport)}),I.forEach(_=>{_.addEventListener("scroll",O,{passive:!0})}),()=>{u&&(y.removeEventListener("keydown",F?b:h,F),y.removeEventListener("compositionstart",T),y.removeEventListener("compositionend",L)),M&&y.removeEventListener(a,k?$:x,k),I.forEach(_=>{_.removeEventListener("scroll",O)}),window.clearTimeout(S)}},[i,o,u,M,a,n,r,p,l,N,j,h,F,b,x,k,$]),R.useEffect(()=>{i.current.insideReactTree=!1},[i,M,a]);const A=R.useMemo(()=>({onKeyDown:h,...c&&{[Sm[d]]:S=>{r(!1,S.nativeEvent,"reference-press")},...d!=="click"&&{onClick(S){r(!1,S.nativeEvent,"reference-press")}}}}),[h,r,c,d]),P=R.useMemo(()=>({onKeyDown:h,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Cm[a]]:()=>{i.current.insideReactTree=!0}}),[h,a,i]);return R.useMemo(()=>l?{reference:A,floating:P}:{},[l,A,P])}function Tm(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=go(),i=R.useRef({}),[l]=R.useState(()=>mm()),u=bo()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&pm("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]=R.useState(r.reference),c=ot((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=R.useMemo(()=>({setPositionReference:a}),[]),p=R.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return R.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:l,floatingId:o,refs:d}),[t,c,p,l,o,d])}function Nm(e){e===void 0&&(e={});const{nodeId:t}=e,n=Tm({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=R.useState(null),[u,s]=R.useState(null),c=(o==null?void 0:o.domReference)||i,d=R.useRef(null),p=xo();rt(()=>{c&&(d.current=c)},[c]);const f=ms({...e,elements:{...o,...u&&{reference:u}}}),g=R.useCallback(N=>{const j=oe(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;s(j),f.refs.setReference(j)},[f.refs]),v=R.useCallback(N=>{(oe(N)||N===null)&&(d.current=N,l(N)),(oe(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!oe(N))&&f.refs.setReference(N)},[f.refs]),E=R.useMemo(()=>({...f.refs,setReference:v,setPositionReference:g,domReference:d}),[f.refs,v,g]),M=R.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),w=R.useMemo(()=>({...f,...r,refs:E,elements:M,nodeId:t}),[f,E,M,t,r]);return rt(()=>{r.dataRef.current.floatingContext=w;const N=p==null?void 0:p.nodesRef.current.find(j=>j.id===t);N&&(N.context=w)}),R.useMemo(()=>({...f,context:w,refs:E,elements:M}),[f,E,M,w])}function Eo(){return qp()&&dl()}function Pm(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=R.useRef(!1),c=R.useRef(-1),d=R.useRef(!0);R.useEffect(()=>{if(!u)return;const f=Ne(l.domReference);function g(){!n&&Ee(l.domReference)&&l.domReference===po(nt(l.domReference))&&(a.current=!0)}function v(){d.current=!0}function E(){d.current=!1}return f.addEventListener("blur",g),Eo()&&(f.addEventListener("keydown",v,!0),f.addEventListener("pointerdown",E,!0)),()=>{f.removeEventListener("blur",g),Eo()&&(f.removeEventListener("keydown",v,!0),f.removeEventListener("pointerdown",E,!0))}},[l.domReference,n,u]),R.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]),R.useEffect(()=>()=>{ze(c)},[]);const p=R.useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(f){if(a.current)return;const g=Wt(f.nativeEvent);if(s&&oe(g)){if(Eo()&&!f.relatedTarget){if(!d.current&&!ml(g))return}else if(!Zp(g))return}r(!0,f.nativeEvent,"focus")},onBlur(f){a.current=!1;const g=f.relatedTarget,v=f.nativeEvent,E=oe(g)&&g.hasAttribute(on("focus-guard"))&&g.getAttribute("data-type")==="outside";c.current=window.setTimeout(()=>{var M;const w=po(l.domReference?l.domReference.ownerDocument:document);!g&&w===l.domReference||_t((M=i.current.floatingContext)==null?void 0:M.refs.floating.current,w)||_t(l.domReference,w)||E||r(!1,v,"focus")})}}),[i,l.domReference,r,s]);return R.useMemo(()=>u?{reference:p}:{},[u,p])}function So(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[bl]:l,[xl]:u,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[um]:""},...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&&[bl,xl].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(E=>E(...g)).find(E=>E!==void 0)}}}else l[a]=c}),l),{})}}function Lm(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=R.useCallback(u=>So(u,e,"reference"),t),i=R.useCallback(u=>So(u,e,"floating"),n),l=R.useCallback(u=>So(u,e,"item"),r);return R.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}const Am=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function $m(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=go(),c=((n=i.domReference)==null?void 0:n.id)||a,d=R.useMemo(()=>{var w;return((w=em(i.floating))==null?void 0:w.id)||l},[i.floating,l]),p=(r=Am.get(s))!=null?r:s,g=bo()!=null,v=R.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=R.useMemo(()=>{const w={id:d,...p&&{role:p}};return p==="tooltip"||s==="label"?w:{...w,...p==="menu"&&{"aria-labelledby":c}}},[p,d,c,s]),M=R.useCallback(w=>{let{active:N,selected:j}=w;const F={role:"option",...N&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...F,"aria-selected":j}}return{}},[d,s]);return R.useMemo(()=>u?{reference:v,floating:E,item:M}:{},[u,v,E,M])}const Al=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})});Al.displayName="TooltipArrow";const sn=({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}=Nm({open:a&&!l,onOpenChange:c,placement:n,whileElementsMounted:cs,middleware:[zr(o?12:8),gs({fallbackAxisSideDirection:"start",padding:8}),hs({padding:8}),...o?[Yf({element:d})]:[]]}),v=vm(g,{enabled:s.includes("hover"),delay:{open:r,close:150}}),E=Pm(g,{enabled:s.includes("focus")}),M=Em(g,{enabled:s.includes("click")}),w=Om(g),N=$m(g,{role:"tooltip"}),{getReferenceProps:j,getFloatingProps:F}=Lm([v,E,M,w,N]);return l?C.jsx(C.Fragment,{children:e}):C.jsxs(C.Fragment,{children:[C.jsx("div",{ref:p.setReference,...j(),children:e}),a&&C.jsx(xm,{children:C.jsxs("div",{ref:p.setFloating,...F(),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&&C.jsx(Ll,{ref:d,placement:g.placement||n})]})})]})},So="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=",$m=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const{t:i}=Ke(),l=m.useMemo(()=>hp(n||{}),[n]);return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex justify-center mt-4 mb-3",children:(e==null?void 0:e.getDisplayAddress())&&C.jsx("div",{className:"bg-white rounded-lg",children:C.jsx(cl,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),(e==null?void 0:e.getDisplayAddress())&&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(Fp,{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:So,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1",children:C.jsx("p",{className:"text-xs text-functional-orange-1",children:i("deposit.depositAllTip",{coin:t,v:n==null?void 0:n.chain})})})]}),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:i("deposit.depositTipFor25w")})]})]}),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(sn,{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]})]})]})]})},Dm=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:i,onCopy:l,onClose:u})=>{var v;const{t:s}=Ke(),[a,c]=m.useState(()=>{var E;return!e||e.length===0?1:t||((E=e[0])==null?void 0:E.chainId)||1}),[d,p]=m.useState(()=>{var N;if(!e||e.length===0)return"";const E=t||((N=e[0])==null?void 0:N.chainId),M=e.find(j=>j.chainId===E);if(!M||!M.tokenList||M.tokenList.length===0)return"";const w=M.tokenList.find(j=>j.tokenAddress===n)||M.tokenList[0];return(w==null?void 0:w.token)||""}),f=e&&e.length>0?e.find(E=>E.chainId===a)||e[0]:null,g=(v=f==null?void 0:f.tokenList)==null?void 0:v.find(E=>E.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(eo,{currentActiveChain:f,chainList:e,onChainChange:c,curSelectToken:d,onTokenChange:p,walletType:"mpc"}),C.jsx($m,{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..."})})},Mm=Object.values({MAINNET:1,SEPOLIA:11155111}),He=e=>Mm.includes(+e),ln=({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"})},Im=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:i,amount:l,decimals:u,tokenBalance:s,platformBalance:a="0",onDepositAmountChange:c,onApproved:d})=>{const{t:p}=Ke(),[f,g]=m.useState(!1);m.useEffect(()=>{r&&f&&g(!1)},[r,f]);const v=m.useCallback(async()=>{if(!f)try{g(!0),await d()}catch(j){g(!1),console.error("Approve failed:",j)}},[d,f]),E=m.useCallback(()=>{let j=s||"0";if(!He(o==null?void 0:o.chainId))try{const F=new Oe(j),R=new Oe("250000");F.gt(R)&&(j="250000")}catch(F){console.warn("Error calculating max amount limit:",F)}return j},[s,o==null?void 0:o.chainId]),M=m.useMemo(()=>{if(He(o==null?void 0:o.chainId))return!1;try{const j=new Oe(e||"0"),F=new Oe("250000");return j.isNaN()||F.isNaN()?!1:j.gte(F)}catch{return!1}},[o,e]);m.useMemo(()=>{if(He(o==null?void 0:o.chainId))return!1;try{const j=new Oe(s||"0"),F=new Oe("250000");return j.gt(F)}catch{return!1}},[o==null?void 0:o.chainId,s]);const w=j=>{const F=j.target.value,R=E(),W=to(F,R);if(W.isValid)c(W.formattedValue),W.errorType;else return W.errorType==="exceed_balance",void 0},N=()=>{const j=parseFloat(s||"0"),F=parseFloat(e||"0");if(F>0){const R=j-F,W=Qe(Math.max(0,R).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Qe(s||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),W," ",t]})}return`${Qe(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:w,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 j=E();c(j)},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(sn,{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:N()})]})]}),!r&&dp(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 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:v,disabled:f,children:f?C.jsx(ln,{size:"xs",inline:!0}):p("deposit.enableWithToken",{token:t})})]}),M&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:So,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.depositTipFor25w")})]}),M&&C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:!M&&C.jsx("img",{src:So,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.noPrivateKeyWalletWarning")})]}),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:[Qe(a),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),Qe((parseFloat(a)+parseFloat(e)).toString())," ",t]}):`${Qe(a)} ${t}`})]})})]})},jm=({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},Al=({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,E)=>{u(M=>({...M,[v]:E}))},[]),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(jm,{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"},E=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.balance,R=F==null?void 0:F.data;return{address:N.tokenAddress,value:(R==null?void 0:R.value)||BigInt(0),formatted:(R==null?void 0:R.formatted)||"0",decimals:(R==null?void 0:R.decimals)||N.decimals}}).filter(N=>N.address),M=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.allowance,R=F==null?void 0:F.data,W=BigInt(R?R.toString():0);return{address:N.tokenAddress,value:W,formatted:(W/BigInt(10)**BigInt(N.decimals)).toString(),decimals:N.decimals}}).filter(N=>N.address),w=E.reduce((N,j)=>{const F=M.find(R=>R.address===j.address);return{...N,[j.address]:{balance:j,allowance:F||{address:j.address,value:BigInt(0),formatted:"0",decimals:j.decimals}}}},{});return{balanceList:E,allowanceList:M,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,E=Object.values(l).some(M=>{var w,N;return((w=M.balance)==null?void 0:w.isLoading)||((N=M.allowance)==null?void 0:N.isLoading)});return v||E},[a==null?void 0:a.isLoading,l]);return{multicallRun:p,multicallResult:d,validErcTokens:i,isLoading:f,queryComponents:c}};let Pe=null;const Fm={symbol:"USDT"},$l=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),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,()=>({openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Pe={openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f},()=>{Pe=null}),[s,c,a,d,p,f]),C.jsx(Fl,{isOpen:n,isLoading:o,onClose:c,config:l.config||Fm,currentActiveAccount:l.currentActiveAccount||no,smartWallet:l.smartWallet||ro,chains:l.chains||gp,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||oo,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",wagmiHooks:l.wagmiHooks,approved:l.approved,onApproved:l.onApproved,onDeposit:l.onDeposit,onCopy:l.onCopy,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange})});$l.displayName="DepositManager";const Dl=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.openDeposit(e||{chains:[]})},Ml=()=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.closeDeposit()},Il=e=>{Pe&&Pe.updateDepositOptions(e)},Gn=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.setDepositLoading(e)},km=()=>Pe?Pe.isOpen():!1,jl=()=>Pe?Pe.isLoading():!1,Rm=()=>({openDeposit:Dl,closeDeposit:Ml,updateDepositOptions:Il,setDepositLoading:Gn,isOpen:km,isLoading:jl}),_m=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",isLoading:s=!1,wagmiHooks:a,approved:c,onApproved:d,onDeposit:p,onClose:f,onChainChange:g,onTokenChange:v})=>{var q;const{t:E}=Ke(),M=a==null?void 0:a.useAccount(),[w,N]=m.useState(()=>{var B;return!e||e.length===0?1:t||((B=e[0])==null?void 0:B.chainId)||1}),[j,F]=m.useState(()=>{var Z;if(!e||e.length===0)return"";const B=t||((Z=e[0])==null?void 0:Z.chainId),K=e.find(ae=>ae.chainId===B);if(!K||!K.tokenList||K.tokenList.length===0)return"";const H=K.tokenList.find(ae=>ae.tokenAddress===n)||K.tokenList[0];return(H==null?void 0:H.token)||""}),[R,W]=m.useState(r),h=m.useCallback(B=>{N(B),g==null||g(B)},[g]),b=m.useCallback(B=>{F(B),v==null||v(B)},[v]),x=m.useRef(!0),$=m.useRef(j),A=m.useRef(w);m.useEffect(()=>{if(x.current){x.current=!1,$.current=j,A.current=w;return}($.current!==j||A.current!==w)&&(W(""),$.current=j,A.current=w)},[j,w]);const P=e&&e.length>0?e.find(B=>B.chainId===w)||e[0]:null,S=(q=P==null?void 0:P.tokenList)==null?void 0:q.find(B=>B.token===j),O=o==null?void 0:o.getDisplayAddress(),{multicallResult:T,queryComponents:L}=Al({account:O,chainId:w,contractAddress:void 0,tokens:(P==null?void 0:P.tokenList)||[],wagmiHooks:a}),y=m.useMemo(()=>{var K;if(!S)return;if(!S.tokenAddress||S.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return T.baseTokenBalance.formatted;const B=T.combinedData[S.tokenAddress];return((K=B==null?void 0:B.balance)==null?void 0:K.formatted)||"0"},[S,T]),I=c??!1,_=m.useMemo(()=>+M.chainId!=+w,[M.chainId,w]),V=m.useMemo(()=>{if(_)return{text:E("deposit.switchNetwork"),disabled:!1,isNetworkSwitch:!0};const B=parseFloat(R||"0"),K=10,Z=pp(R,y||"0",I);return!R||B===0||!I?{text:E("deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:B<K?{text:E("deposit.minDepositParsed",{amount:K,token:j}),disabled:!0,isNetworkSwitch:!1}:{text:E("deposit.confirmDeposit"),disabled:!Z,isNetworkSwitch:!1}},[R,j,y,I,_,E]),z=m.useCallback(async()=>{h&&h(w)},[h,w]),G=m.useCallback(async()=>{Gn(!0);try{p&&p({amount:R,chainId:w,tokenAddress:(S==null?void 0:S.tokenAddress)||"",tokenSymbol:j})}catch(B){console.error("Deposit error:",B),Gn(!1)}},[p,R,w,S==null?void 0:S.tokenAddress,j]);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"})}):P?C.jsxs(C.Fragment,{children:[L,C.jsx(eo,{currentActiveChain:P,chainList:e,onChainChange:h,curSelectToken:j,onTokenChange:b,walletType:"evm"}),C.jsx(Im,{depositAmount:R,curSelectToken:j,curSelectTokenData:{balance:S==null?void 0:S.balance,allowance:S==null?void 0:S.allowance},approved:I,currentActiveChain:P,currentEquity:l||0,amount:R,decimals:(S==null?void 0:S.decimals)||6,tokenBalance:y,platformBalance:u,onDepositAmountChange:W,onApproved:async()=>{d&&await d()}}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:V.isNetworkSwitch?z:G,disabled:V.disabled||s,children:[s&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Fl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=no,smartWallet:i=ro,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=oo,currentEquity:d=5e3,platformBalance:p="0",wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onCopy:M,onChainChange:w,onTokenChange:N})=>{const{t:j}=Ke(),F=m.useMemo(()=>{var W;return o?Bo(o,i,!1,(W=l[0])==null?void 0:W.chainId,"0","0"):null},[o,i,l]),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:()=>{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:W=>{W.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:j("deposit.title")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(_o,{className:"h-4 w-4"})})]}),R?C.jsx(Dm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,onDeposit:E,onCopy:M,onClose:n}):C.jsx(_m,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,platformBalance:p,isLoading:t,wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onClose:n,onChainChange:w,onTokenChange:N})]})})}),document.body):null};m.createContext(null);const Wm=()=>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)"})})})]}),Bm=()=>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)"})})})]}),Yn=({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(Wm,{}):C.jsx(Bm,{})},o))})};class mt{}Ie(mt,"FAST",3),Ie(mt,"Medium",2),Ie(mt,"SLOW",1),Ie(mt,"NONE",0);const Um=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",fee:o="0.00",walletType:i="evm",receiverAddress:l="",onWithdrawAmountChange:u,onReceiverAddressChange:s,onAmountChanged:a})=>{const{t:c}=Ke(),d=m.useMemo(()=>{if(!He(n==null?void 0:n.chainId)){const E=new Oe(e||"0").minus(o||"0").decimalPlaces(2,Oe.ROUND_DOWN);return E.isNegative()?"0.00":E.toString()}return e||"0"},[e,o,n==null?void 0:n.chainId]),p=m.useMemo(()=>r||"0",[r]),f=E=>{const M=E.target.value,N=to(M,p||"0");if(N.isValid)u(N.formattedValue),N.errorType;else return N.errorType==="exceed_balance",void 0;a==null||a(N.formattedValue)},g=()=>{u(p),a==null||a(p)},v=()=>{const E=parseFloat(r||"0"),M=parseFloat(e||"0");if(M>0){const w=E-M,N=Qe(Math.max(0,w).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Qe(r||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),N," ",t]})}return`${Qe(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:c("deposit.amount"),value:e,onChange:f,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:g,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:c("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(sn,{content:c("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:c("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:v()})]})]}),i==="mpc"&&!He(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:c("withdraw.receiverAddress"),value:l,onChange:E=>s==null?void 0:s(E.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:He(n==null?void 0:n.chainId)?C.jsxs(C.Fragment,{children:[C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("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:c("withdraw.commonWithdraw")})]}):C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("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:c("withdraw.speed")}),C.jsx("div",{className:"flex items-center",children:C.jsx(sn,{content:C.jsxs("div",{children:[C.jsx("div",{children:c("withdraw.speedNote")}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Yn,{selectedLevel:mt.FAST,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed1")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Yn,{selectedLevel:mt.Medium,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed2")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Yn,{selectedLevel:mt.SLOW,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed3")})]})]}),children:C.jsx(Yn,{selectedLevel:He(n==null?void 0:n.chainId)?mt.SLOW:mt.FAST,maxLevel:3})})})]}),!He(n==null?void 0:n.chainId)&&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:c("withdraw.fee")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[o," ",t]})]}),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:c(He(n==null?void 0:n.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Qe(d)," ",t]})]})]})]})},Vm=[],zm={};let Le=null;const kl=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(()=>(Le={openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{Le=null}),[s,c,a,d,p,f]),C.jsx(Ul,{isOpen:n,isLoading:o,onClose:c,config:l.config||{symbol:"USDT"},currentActiveAccount:l.currentActiveAccount,smartWallet:l.smartWallet,chains:l.chains||Vm,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||zm,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",fee:l.fee,wagmiHooks:l.wagmiHooks,onWithdraw:l.onWithdraw,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange,onAmountChanged:l.onAmountChanged})});kl.displayName="WithdrawManager";const Rl=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.openWithdraw(e||{chains:[]})},_l=()=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.closeWithdraw()},Wl=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.updateWithdrawOptions(e)},Kn=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.setWithdrawLoading(e)},Hm=()=>Le?Le.isOpen():!1,Bl=()=>Le?Le.isLoading():!1,Gm=()=>({openWithdraw:Rl,closeWithdraw:_l,updateWithdrawOptions:Wl,setWithdrawLoading:Kn,isOpen:Hm,isLoading:Bl}),Ym=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",fee:s="0.00",isLoading:a=!1,wagmiHooks:c,onWithdraw:d,onClose:p,onChainChange:f,onTokenChange:g,onAmountChanged:v})=>{var G;const{t:E}=Ke(),[M,w]=m.useState(()=>{var q;return!e||e.length===0?1:t||((q=e[0])==null?void 0:q.chainId)||1}),[N,j]=m.useState(()=>{var H;if(!e||e.length===0)return"";const q=t||((H=e[0])==null?void 0:H.chainId),B=e.find(Z=>Z.chainId===q);if(!B||!B.tokenList||B.tokenList.length===0)return"";const K=B.tokenList.find(Z=>Z.tokenAddress===n)||B.tokenList[0];return(K==null?void 0:K.token)||""}),[F,R]=m.useState(r),[W,h]=m.useState(""),b=(o==null?void 0:o.getWalletType())||"evm",x=m.useCallback(q=>{w(q),f==null||f(q)},[f]),$=m.useCallback(q=>{j(q),g==null||g(q)},[g]),A=m.useRef(!0),P=m.useRef(N),S=m.useRef(M);m.useEffect(()=>{if(A.current){A.current=!1,P.current=N,S.current=M;return}(P.current!==N||S.current!==M)&&(R(""),P.current=N,S.current=M)},[N,M]);const O=e&&e.length>0?e.find(q=>q.chainId===M)||e[0]:null,T=(G=O==null?void 0:O.tokenList)==null?void 0:G.find(q=>q.token===N),L=o==null?void 0:o.getDisplayAddress(),{multicallResult:y,queryComponents:I}=Al({account:L,chainId:M,contractAddress:void 0,tokens:(O==null?void 0:O.tokenList)||[],wagmiHooks:c}),_=m.useMemo(()=>{var B;if(!T)return;if(!T.tokenAddress||T.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return y.baseTokenBalance.formatted;const q=y.combinedData[T.tokenAddress];return((B=q==null?void 0:q.balance)==null?void 0:B.formatted)||"0"},[T,y]),V=m.useMemo(()=>{const q=new Oe(F||"0"),B=new Oe(s||"0"),K=He(M);return!F||q.isZero()||!K&&q.isLessThan(B)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:b==="mpc"&&!K&&!W.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,M,F,b,W,s]),z=m.useCallback(async()=>{Kn(!0);try{if(d){const q=new Oe(F||"0"),B=new Oe(s||"0"),H={amount:(He(M)?q:q.minus(B)).toString(),chainId:M,tokenAddress:(T==null?void 0:T.tokenAddress)||"",tokenSymbol:N};b==="mpc"&&!He(M)&&(H.receiverAddress=W),d(H)}}catch{Kn(!1)}},[d,F,s,M,T==null?void 0:T.tokenAddress,N,b,W]);return!(c!=null&&c.useBalance)||!(c!=null&&c.useReadContract)||!(c!=null&&c.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"})}):O?C.jsxs(C.Fragment,{children:[I,C.jsx(eo,{currentActiveChain:O,chainList:e,onChainChange:x,curSelectToken:N,onTokenChange:$,walletType:"evm"}),C.jsx(Um,{withdrawAmount:F,curSelectToken:N,curSelectTokenData:{balance:T==null?void 0:T.balance,allowance:T==null?void 0:T.allowance},currentActiveChain:O,currentEquity:l||0,amount:F,decimals:(T==null?void 0:T.decimals)||6,tokenBalance:_,platformBalance:u,fee:s,walletType:b,receiverAddress:W,onWithdrawAmountChange:R,onReceiverAddressChange:h,onAmountChanged:v}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||a?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:z,disabled:V.disabled||a,children:[a&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Ul=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=no,smartWallet:i=ro,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=oo,currentEquity:d=5e3,platformBalance:p="0",fee:f,wagmiHooks:g,onWithdraw:v,onChainChange:E,onTokenChange:M,onAmountChanged:w})=>{const{t:N}=Ke(),j=m.useMemo(()=>{var F;return o?Bo(o,i,!1,(F=l[0])==null?void 0:F.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:F=>{F.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("withdraw.withdraw")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(_o,{className:"h-4 w-4"})})]}),C.jsx(Ym,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:j,metadata:c,currentEquity:d,platformBalance:p,fee:f,isLoading:t,wagmiHooks:g,onWithdraw:v,onClose:n,onChainChange:E,onTokenChange:M,onAmountChanged:w})]})})}),document.body):null};J.ChromeLoader=ln,J.ComponentProvider=ha,J.DEFAULT_LOCALE=un,J.Deposit=Fl,J.DepositManager=$l,J.LOCALE_NAMES=da,J.LoadingSpinner=ln,J.SUPPORTED_LOCALES=Qn,J.Tooltip=sn,J.Withdraw=Ul,J.WithdrawManager=kl,J.closeDeposit=Ml,J.closeWithdraw=_l,J.formatThousands=va,J.isDepositLoading=jl,J.isWithdrawLoading=Bl,J.openDeposit=Dl,J.openWithdraw=Rl,J.setDepositLoading=Gn,J.setWithdrawLoading=Kn,J.updateDepositOptions=Il,J.updateWithdrawOptions=Wl,J.useComponentConfig=Io,J.useDeposit=ba,J.useDepositManager=Rm,J.useTranslation=Ke,J.useWithdraw=xa,J.useWithdrawManager=Gm,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
119
+ `,children:[t,o&&C.jsx(Al,{ref:d,placement:g.placement||n})]})})]})},Co="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=",Dm=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const{t:i}=Ye(),l=m.useMemo(()=>gp(n||{}),[n]);return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex justify-center mt-4 mb-3",children:(e==null?void 0:e.getDisplayAddress())&&C.jsx("div",{className:"bg-white rounded-lg",children:C.jsx(fl,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),(e==null?void 0:e.getDisplayAddress())&&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(Rp,{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:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1",children:C.jsx("p",{className:"text-xs text-functional-orange-1",children:i("deposit.depositAllTip",{coin:t,v:n==null?void 0:n.chain})})})]}),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:i("deposit.depositTipFor25w")})]})]}),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(sn,{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]})]})]})]})},Mm=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:i,onCopy:l,onClose:u})=>{var v;const{t:s}=Ye(),[a,c]=m.useState(()=>{var E;return!e||e.length===0?1:t||((E=e[0])==null?void 0:E.chainId)||1}),[d,p]=m.useState(()=>{var N;if(!e||e.length===0)return"";const E=t||((N=e[0])==null?void 0:N.chainId),M=e.find(j=>j.chainId===E);if(!M||!M.tokenList||M.tokenList.length===0)return"";const w=M.tokenList.find(j=>j.tokenAddress===n)||M.tokenList[0];return(w==null?void 0:w.token)||""}),f=e&&e.length>0?e.find(E=>E.chainId===a)||e[0]:null,g=(v=f==null?void 0:f.tokenList)==null?void 0:v.find(E=>E.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(to,{currentActiveChain:f,chainList:e,onChainChange:c,curSelectToken:d,onTokenChange:p,walletType:"mpc"}),C.jsx(Dm,{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..."})})},Im=Object.values({MAINNET:1,SEPOLIA:11155111}),pt=e=>{const t=typeof e=="string"?parseInt(e,10):e;return Im.includes(t)},jm={USDT:!0},Oo=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!jm[t.toUpperCase()]:!0},ln=({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"})},Fm=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:i,amount:l,decimals:u,tokenBalance:s,platformBalance:a="0",onDepositAmountChange:c,onApproved:d})=>{const{t:p}=Ye(),[f,g]=m.useState(!1);m.useEffect(()=>{r&&f&&g(!1)},[r,f]);const v=m.useCallback(async()=>{if(!f)try{g(!0),await d()}catch(j){g(!1),console.error("Approve failed:",j)}},[d,f]),E=m.useCallback(()=>{let j=s||"0";if(Oo(o==null?void 0:o.chainId,t))try{const F=new Oe(j),k=new Oe("250000");F.gt(k)&&(j="250000")}catch(F){console.warn("Error calculating max amount limit:",F)}return j},[s,o==null?void 0:o.chainId,t]),M=m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new Oe(e||"0"),F=new Oe("250000");return j.isNaN()||F.isNaN()?!1:j.gte(F)}catch{return!1}},[o,e,t]);m.useMemo(()=>{if(!Oo(o==null?void 0:o.chainId,t))return!1;try{const j=new Oe(s||"0"),F=new Oe("250000");return j.gt(F)}catch{return!1}},[o==null?void 0:o.chainId,s,t]);const w=j=>{const F=j.target.value,k=E(),W=no(F,k);if(W.isValid)c(W.formattedValue),W.errorType;else return W.errorType==="exceed_balance",void 0},N=()=>{const j=parseFloat(s||"0"),F=parseFloat(e||"0");if(F>0){const k=j-F,W=Xe(Math.max(0,k).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(s||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),W," ",t]})}return`${Xe(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:w,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 j=E();c(j)},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(sn,{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:N()})]})]}),!r&&pp(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 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:v,disabled:f,children:f?C.jsx(ln,{size:"xs",inline:!0}):p("deposit.enableWithToken",{token:t})})]}),M&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.depositTipFor25w")})]}),M&&C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:!M&&C.jsx("img",{src:Co,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:p("deposit.noPrivateKeyWalletWarning")})]}),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:[Xe(a),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),Xe((parseFloat(a)+parseFloat(e)).toString())," ",t]}):`${Xe(a)} ${t}`})]})})]})},Rm=({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,E)=>{u(M=>({...M,[v]:E}))},[]),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(Rm,{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"},E=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.balance,k=F==null?void 0:F.data;return{address:N.tokenAddress,value:(k==null?void 0:k.value)||BigInt(0),formatted:(k==null?void 0:k.formatted)||"0",decimals:(k==null?void 0:k.decimals)||N.decimals}}).filter(N=>N.address),M=i.map(N=>{const j=l[N.tokenAddress],F=j==null?void 0:j.allowance,k=F==null?void 0:F.data,W=BigInt(k?k.toString():0);return{address:N.tokenAddress,value:W,formatted:(W/BigInt(10)**BigInt(N.decimals)).toString(),decimals:N.decimals}}).filter(N=>N.address),w=E.reduce((N,j)=>{const F=M.find(k=>k.address===j.address);return{...N,[j.address]:{balance:j,allowance:F||{address:j.address,value:BigInt(0),formatted:"0",decimals:j.decimals}}}},{});return{balanceList:E,allowanceList:M,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,E=Object.values(l).some(M=>{var w,N;return((w=M.balance)==null?void 0:w.isLoading)||((N=M.allowance)==null?void 0:N.isLoading)});return v||E},[a==null?void 0:a.isLoading,l]);return{multicallRun:p,multicallResult:d,validErcTokens:i,isLoading:f,queryComponents:c}};let Pe=null;const km={symbol:"USDT"},Dl=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),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,()=>({openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f}),[s,c,a,d,p,f]),m.useEffect(()=>(Pe={openDeposit:s,closeDeposit:c,updateDepositOptions:a,setDepositLoading:d,isOpen:p,isLoading:f},()=>{Pe=null}),[s,c,a,d,p,f]),C.jsx(Rl,{isOpen:n,isLoading:o,onClose:c,config:l.config||km,currentActiveAccount:l.currentActiveAccount||ro,smartWallet:l.smartWallet||oo,chains:l.chains||vp,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||io,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",wagmiHooks:l.wagmiHooks,approved:l.approved,onApproved:l.onApproved,onDeposit:l.onDeposit,onCopy:l.onCopy,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange})});Dl.displayName="DepositManager";const Ml=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.openDeposit(e||{chains:[]})},Il=()=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.closeDeposit()},jl=e=>{Pe&&Pe.updateDepositOptions(e)},Yn=e=>{if(!Pe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Pe.setDepositLoading(e)},_m=()=>Pe?Pe.isOpen():!1,Fl=()=>Pe?Pe.isLoading():!1,Wm=()=>({openDeposit:Ml,closeDeposit:Il,updateDepositOptions:jl,setDepositLoading:Yn,isOpen:_m,isLoading:Fl}),Bm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",isLoading:s=!1,wagmiHooks:a,approved:c,onApproved:d,onDeposit:p,onClose:f,onChainChange:g,onTokenChange:v})=>{var q;const{t:E}=Ye(),M=a==null?void 0:a.useAccount(),[w,N]=m.useState(()=>{var B;return!e||e.length===0?1:t||((B=e[0])==null?void 0:B.chainId)||1}),[j,F]=m.useState(()=>{var Z;if(!e||e.length===0)return"";const B=t||((Z=e[0])==null?void 0:Z.chainId),K=e.find(ae=>ae.chainId===B);if(!K||!K.tokenList||K.tokenList.length===0)return"";const H=K.tokenList.find(ae=>ae.tokenAddress===n)||K.tokenList[0];return(H==null?void 0:H.token)||""}),[k,W]=m.useState(r),h=m.useCallback(B=>{N(B),g==null||g(B)},[g]),b=m.useCallback(B=>{F(B),v==null||v(B)},[v]),x=m.useRef(!0),$=m.useRef(j),A=m.useRef(w);m.useEffect(()=>{if(x.current){x.current=!1,$.current=j,A.current=w;return}($.current!==j||A.current!==w)&&(W(""),$.current=j,A.current=w)},[j,w]);const P=e&&e.length>0?e.find(B=>B.chainId===w)||e[0]:null,S=(q=P==null?void 0:P.tokenList)==null?void 0:q.find(B=>B.token===j),O=o==null?void 0:o.getDisplayAddress(),{multicallResult:T,queryComponents:L}=$l({account:O,chainId:w,contractAddress:void 0,tokens:(P==null?void 0:P.tokenList)||[],wagmiHooks:a}),y=m.useMemo(()=>{var K;if(!S)return;if(!S.tokenAddress||S.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return T.baseTokenBalance.formatted;const B=T.combinedData[S.tokenAddress];return((K=B==null?void 0:B.balance)==null?void 0:K.formatted)||"0"},[S,T]),I=c??!1,_=m.useMemo(()=>+M.chainId!=+w,[M.chainId,w]),V=m.useMemo(()=>{if(_)return{text:E("deposit.switchNetwork"),disabled:!1,isNetworkSwitch:!0};const B=parseFloat(k||"0"),K=10,Z=mp(k,y||"0",I);return!k||B===0||!I?{text:E("deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:B<K?{text:E("deposit.minDepositParsed",{amount:K,token:j}),disabled:!0,isNetworkSwitch:!1}:{text:E("deposit.confirmDeposit"),disabled:!Z,isNetworkSwitch:!1}},[k,j,y,I,_,E]),z=m.useCallback(async()=>{h&&h(w)},[h,w]),G=m.useCallback(async()=>{Yn(!0);try{p&&p({amount:k,chainId:w,tokenAddress:(S==null?void 0:S.tokenAddress)||"",tokenSymbol:j})}catch(B){console.error("Deposit error:",B),Yn(!1)}},[p,k,w,S==null?void 0:S.tokenAddress,j]);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"})}):P?C.jsxs(C.Fragment,{children:[L,C.jsx(to,{currentActiveChain:P,chainList:e,onChainChange:h,curSelectToken:j,onTokenChange:b,walletType:"evm"}),C.jsx(Fm,{depositAmount:k,curSelectToken:j,curSelectTokenData:{balance:S==null?void 0:S.balance,allowance:S==null?void 0:S.allowance},approved:I,currentActiveChain:P,currentEquity:l||0,amount:k,decimals:(S==null?void 0:S.decimals)||6,tokenBalance:y,platformBalance:u,onDepositAmountChange:W,onApproved:async()=>{d&&await d()}}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:V.isNetworkSwitch?z:G,disabled:V.disabled||s,children:[s&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Rl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=ro,smartWallet:i=oo,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=io,currentEquity:d=5e3,platformBalance:p="0",wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onCopy:M,onChainChange:w,onTokenChange:N})=>{const{t:j}=Ye(),F=m.useMemo(()=>{var W;return o?Vo(o,i,!1,(W=l[0])==null?void 0:W.chainId,"0","0"):null},[o,i,l]),k=(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:()=>{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:W=>{W.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:j("deposit.title")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(Bo,{className:"h-4 w-4"})})]}),k?C.jsx(Mm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,onDeposit:E,onCopy:M,onClose:n}):C.jsx(Bm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:F,metadata:c,currentEquity:d,platformBalance:p,isLoading:t,wagmiHooks:f,approved:g,onApproved:v,onDeposit:E,onClose:n,onChainChange:w,onTokenChange:N})]})})}),document.body):null};m.createContext(null);const Um=()=>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)"})})})]}),Vm=()=>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)"})})})]}),Kn=({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(Um,{}):C.jsx(Vm,{})},o))})};class mt{}Ie(mt,"FAST",3),Ie(mt,"Medium",2),Ie(mt,"SLOW",1),Ie(mt,"NONE",0);const zm=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",fee:o="0.00",walletType:i="evm",receiverAddress:l="",onWithdrawAmountChange:u,onReceiverAddressChange:s,onAmountChanged:a})=>{const{t:c}=Ye(),d=m.useMemo(()=>{if(!pt(n==null?void 0:n.chainId)){const E=new Oe(e||"0").minus(o||"0").decimalPlaces(2,Oe.ROUND_DOWN);return E.isNegative()?"0.00":E.toString()}return e||"0"},[e,o,n==null?void 0:n.chainId]),p=m.useMemo(()=>r||"0",[r]),f=E=>{const M=E.target.value,N=no(M,p||"0");if(N.isValid)u(N.formattedValue),N.errorType;else return N.errorType==="exceed_balance",void 0;a==null||a(N.formattedValue)},g=()=>{u(p),a==null||a(p)},v=()=>{const E=parseFloat(r||"0"),M=parseFloat(e||"0");if(M>0){const w=E-M,N=Xe(Math.max(0,w).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[Xe(r||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),N," ",t]})}return`${Xe(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:c("deposit.amount"),value:e,onChange:f,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:g,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:c("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(sn,{content:c("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:c("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:v()})]})]}),i==="mpc"&&!pt(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:c("withdraw.receiverAddress"),value:l,onChange:E=>s==null?void 0:s(E.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:pt(n==null?void 0:n.chainId)?C.jsxs(C.Fragment,{children:[C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("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:c("withdraw.commonWithdraw")})]}):C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:c("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:c("withdraw.speed")}),C.jsx("div",{className:"flex items-center",children:C.jsx(sn,{content:C.jsxs("div",{children:[C.jsx("div",{children:c("withdraw.speedNote")}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.FAST,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed1")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.Medium,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed2")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Kn,{selectedLevel:mt.SLOW,maxLevel:3}),C.jsx("span",{children:c("withdraw.speedNoteSpeed3")})]})]}),children:C.jsx(Kn,{selectedLevel:pt(n==null?void 0:n.chainId)?mt.SLOW:mt.FAST,maxLevel:3})})})]}),!pt(n==null?void 0:n.chainId)&&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:c("withdraw.fee")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[o," ",t]})]}),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:c(pt(n==null?void 0:n.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Xe(d)," ",t]})]})]})]})},Hm=[],Gm={};let Le=null;const kl=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(()=>(Le={openWithdraw:s,closeWithdraw:c,updateWithdrawOptions:a,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{Le=null}),[s,c,a,d,p,f]),C.jsx(Vl,{isOpen:n,isLoading:o,onClose:c,config:l.config||{symbol:"USDT"},currentActiveAccount:l.currentActiveAccount,smartWallet:l.smartWallet,chains:l.chains||Hm,defaultChainId:l.defaultChainId,defaultTokenAddress:l.defaultTokenAddress,defaultAmount:l.defaultAmount,metadata:l.metadata||Gm,currentEquity:l.currentEquity??5e3,platformBalance:l.platformBalance||"0",fee:l.fee,wagmiHooks:l.wagmiHooks,onWithdraw:l.onWithdraw,onChainChange:l.onChainChange,onTokenChange:l.onTokenChange,onAmountChanged:l.onAmountChanged})});kl.displayName="WithdrawManager";const _l=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.openWithdraw(e||{chains:[]})},Wl=()=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.closeWithdraw()},Bl=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.updateWithdrawOptions(e)},qn=e=>{if(!Le){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Le.setWithdrawLoading(e)},Ym=()=>Le?Le.isOpen():!1,Ul=()=>Le?Le.isLoading():!1,Km=()=>({openWithdraw:_l,closeWithdraw:Wl,updateWithdrawOptions:Bl,setWithdrawLoading:qn,isOpen:Ym,isLoading:Ul}),qm=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:i,currentEquity:l,platformBalance:u="0",fee:s="0.00",isLoading:a=!1,wagmiHooks:c,onWithdraw:d,onClose:p,onChainChange:f,onTokenChange:g,onAmountChanged:v})=>{var G;const{t:E}=Ye(),[M,w]=m.useState(()=>{var q;return!e||e.length===0?1:t||((q=e[0])==null?void 0:q.chainId)||1}),[N,j]=m.useState(()=>{var H;if(!e||e.length===0)return"";const q=t||((H=e[0])==null?void 0:H.chainId),B=e.find(Z=>Z.chainId===q);if(!B||!B.tokenList||B.tokenList.length===0)return"";const K=B.tokenList.find(Z=>Z.tokenAddress===n)||B.tokenList[0];return(K==null?void 0:K.token)||""}),[F,k]=m.useState(r),[W,h]=m.useState(""),b=(o==null?void 0:o.getWalletType())||"evm",x=m.useCallback(q=>{w(q),f==null||f(q)},[f]),$=m.useCallback(q=>{j(q),g==null||g(q)},[g]),A=m.useRef(!0),P=m.useRef(N),S=m.useRef(M);m.useEffect(()=>{if(A.current){A.current=!1,P.current=N,S.current=M;return}(P.current!==N||S.current!==M)&&(k(""),P.current=N,S.current=M)},[N,M]);const O=e&&e.length>0?e.find(q=>q.chainId===M)||e[0]:null,T=(G=O==null?void 0:O.tokenList)==null?void 0:G.find(q=>q.token===N),L=o==null?void 0:o.getDisplayAddress(),{multicallResult:y,queryComponents:I}=$l({account:L,chainId:M,contractAddress:void 0,tokens:(O==null?void 0:O.tokenList)||[],wagmiHooks:c}),_=m.useMemo(()=>{var B;if(!T)return;if(!T.tokenAddress||T.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return y.baseTokenBalance.formatted;const q=y.combinedData[T.tokenAddress];return((B=q==null?void 0:q.balance)==null?void 0:B.formatted)||"0"},[T,y]),V=m.useMemo(()=>{const q=new Oe(F||"0"),B=new Oe(s||"0"),K=pt(M);return!F||q.isZero()||!K&&q.isLessThan(B)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:b==="mpc"&&!K&&!W.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,M,F,b,W,s]),z=m.useCallback(async()=>{qn(!0);try{if(d){const q=new Oe(F||"0"),B=new Oe(s||"0"),H={amount:(pt(M)?q:q.minus(B)).toString(),chainId:M,tokenAddress:(T==null?void 0:T.tokenAddress)||"",tokenSymbol:N};b==="mpc"&&!pt(M)&&(H.receiverAddress=W),d(H)}}catch{qn(!1)}},[d,F,s,M,T==null?void 0:T.tokenAddress,N,b,W]);return!(c!=null&&c.useBalance)||!(c!=null&&c.useReadContract)||!(c!=null&&c.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"})}):O?C.jsxs(C.Fragment,{children:[I,C.jsx(to,{currentActiveChain:O,chainList:e,onChainChange:x,curSelectToken:N,onTokenChange:$,walletType:"evm"}),C.jsx(zm,{withdrawAmount:F,curSelectToken:N,curSelectTokenData:{balance:T==null?void 0:T.balance,allowance:T==null?void 0:T.allowance},currentActiveChain:O,currentEquity:l||0,amount:F,decimals:(T==null?void 0:T.decimals)||6,tokenBalance:_,platformBalance:u,fee:s,walletType:b,receiverAddress:W,onWithdrawAmountChange:k,onReceiverAddressChange:h,onAmountChanged:v}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||a?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:z,disabled:V.disabled||a,children:[a&&C.jsx(ln,{size:"xs"}),V.text]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Vl=({isOpen:e,isLoading:t=!1,onClose:n,config:r,currentActiveAccount:o=ro,smartWallet:i=oo,chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a="",metadata:c=io,currentEquity:d=5e3,platformBalance:p="0",fee:f,wagmiHooks:g,onWithdraw:v,onChainChange:E,onTokenChange:M,onAmountChanged:w})=>{const{t:N}=Ye(),j=m.useMemo(()=>{var F;return o?Vo(o,i,!1,(F=l[0])==null?void 0:F.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:F=>{F.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("withdraw.withdraw")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(Bo,{className:"h-4 w-4"})})]}),C.jsx(qm,{chains:l,defaultChainId:u,defaultTokenAddress:s,defaultAmount:a,walletAdapter:j,metadata:c,currentEquity:d,platformBalance:p,fee:f,isLoading:t,wagmiHooks:g,onWithdraw:v,onClose:n,onChainChange:E,onTokenChange:M,onAmountChanged:w})]})})}),document.body):null};J.ChromeLoader=ln,J.ComponentProvider=ga,J.DEFAULT_LOCALE=un,J.Deposit=Rl,J.DepositManager=Dl,J.LOCALE_NAMES=pa,J.LoadingSpinner=ln,J.SUPPORTED_LOCALES=Jn,J.Tooltip=sn,J.Withdraw=Vl,J.WithdrawManager=kl,J.closeDeposit=Il,J.closeWithdraw=Wl,J.formatThousands=ba,J.isDepositLoading=Fl,J.isWithdrawLoading=Ul,J.openDeposit=Ml,J.openWithdraw=_l,J.setDepositLoading=Yn,J.setWithdrawLoading=qn,J.updateDepositOptions=jl,J.updateWithdrawOptions=Bl,J.useComponentConfig=Fo,J.useDeposit=xa,J.useDepositManager=Wm,J.useTranslation=Ye,J.useWithdraw=ya,J.useWithdrawManager=Km,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
120
120
  //# sourceMappingURL=index.umd.js.map